Skip to content

Commit 3aeb886

Browse files
authored
feat: add max-width to popup table action (#2311)
1 parent cdf0498 commit 3aeb886

File tree

4 files changed

+42
-38
lines changed

4 files changed

+42
-38
lines changed

src/components/Menu/MenuItem.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export interface MenuItemProps extends DOMProps, QAProps {
1818
selected?: boolean;
1919
href?: string;
2020
target?: string;
21+
contentClassName?: string;
2122
rel?: string;
2223
onClick?: React.MouseEventHandler<HTMLDivElement | HTMLAnchorElement>;
2324
theme?: 'normal' | 'danger';
@@ -41,6 +42,7 @@ export const MenuItem = React.forwardRef<HTMLElement, MenuItemProps>(function Me
4142
onClick,
4243
style,
4344
className,
45+
contentClassName,
4446
theme,
4547
extraProps,
4648
children,
@@ -82,7 +84,7 @@ export const MenuItem = React.forwardRef<HTMLElement, MenuItemProps>(function Me
8284
{iconStart}
8385
</div>
8486
),
85-
<div key="content" className={b('item-content')}>
87+
<div key="content" className={b('item-content', contentClassName)}>
8688
{children}
8789
</div>,
8890
iconEnd && (

src/components/Menu/README-ru.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -265,24 +265,25 @@ LANDING_BLOCK-->
265265

266266
### Свойства
267267

268-
| Имя | Описание | Тип | Значение по умолчанию |
269-
| :--------- | :------------------------------------------------------- | :-----------------------: | :-------------------: |
270-
| iconStart | Иконка меню перед текстом элемента. | `ReactNode` | |
271-
| iconEnd | Иконка меню после текста элемента. | `ReactNode` | |
272-
| selected | Флаг выбранного элемента меню. | `boolean` | `false` |
273-
| disabled | Флаг отключенного элемента меню. | `boolean` | `false` |
274-
| active | Флаг активного элемента меню. | `boolean` | `false` |
275-
| href | URL-адрес. | `string` | |
276-
| title | Атрибут заголовка. | `string` | |
277-
| target | Атрибут целевого ресурса. | `string` | |
278-
| rel | Атрибут `rel`. | `string` | |
279-
| onClick | Обработчик события клика. | `React.MouseEventHandler` | |
280-
| theme | Тема элемента меню. | `"normal"` `"danger"` | `"normal"` |
281-
| children | Дочерний элемент. | `React.ReactNode` | |
282-
| className | HTML-атрибут `class`. | `string` | |
283-
| style | HTML-атрибут `style`. | `React.CSSProperties` | |
284-
| qa | Атрибут `data-qa` в HTML, используется для тестирования. | `string` | |
285-
| extraProps | Дополнительные HTML-атрибуты. | `Record` | |
268+
| Имя | Описание | Тип | Значение по умолчанию |
269+
| :--------------- | :------------------------------------------------------- | :-----------------------: | :-------------------: |
270+
| iconStart | Иконка меню перед текстом элемента. | `ReactNode` | |
271+
| iconEnd | Иконка меню после текста элемента. | `ReactNode` | |
272+
| selected | Флаг выбранного элемента меню. | `boolean` | `false` |
273+
| disabled | Флаг отключенного элемента меню. | `boolean` | `false` |
274+
| active | Флаг активного элемента меню. | `boolean` | `false` |
275+
| href | URL-адрес. | `string` | |
276+
| title | Атрибут заголовка. | `string` | |
277+
| target | Атрибут целевого ресурса. | `string` | |
278+
| rel | Атрибут `rel`. | `string` | |
279+
| onClick | Обработчик события клика. | `React.MouseEventHandler` | |
280+
| theme | Тема элемента меню. | `"normal"` `"danger"` | `"normal"` |
281+
| children | Дочерний элемент. | `React.ReactNode` | |
282+
| className | HTML-атрибут `class` для корневого элемента. | `string` | |
283+
| contentClassName | HTML-атрибут `class` для элемента контента. | `string` | |
284+
| style | HTML-атрибут `style`. | `React.CSSProperties` | |
285+
| qa | Атрибут `data-qa` в HTML, используется для тестирования. | `string` | |
286+
| extraProps | Дополнительные HTML-атрибуты. | `Record` | |
286287

287288
## Menu.Group
288289

src/components/Menu/README.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -265,24 +265,25 @@ LANDING_BLOCK-->
265265

266266
### Properties
267267

268-
| Name | Description | Type | Default |
269-
| :--------- | :----------------------------------------- | :-----------------------: | :--------: |
270-
| iconStart | Menu icon before item text | `ReactNode` | |
271-
| iconEnd | Menu icon after item text | `ReactNode` | |
272-
| selected | Menu item selected flag | `boolean` | `false` |
273-
| disabled | Menu item disabled flag | `boolean` | `false` |
274-
| active | Menu item active flag | `boolean` | `false` |
275-
| href | URL | `string` | |
276-
| title | Title attribute | `string` | |
277-
| target | Target attribute | `string` | |
278-
| rel | Rel attribute | `string` | |
279-
| onClick | Handler for onclick event | `React.MouseEventHandler` | |
280-
| theme | Menu item theme | `"normal"` `"danger"` | `"normal"` |
281-
| children | Child element | `React.ReactNode` | |
282-
| className | `class` HTML attribute | `string` | |
283-
| style | `style` HTML attribute | `React.CSSProperties` | |
284-
| qa | `data-qa` HTML attribute, used for testing | `string` | |
285-
| extraProps | Additional HTML attributes | `Record` | |
268+
| Name | Description | Type | Default |
269+
| :--------------- | :--------------------------------------------- | :-----------------------: | :--------: |
270+
| iconStart | Menu icon before item text | `ReactNode` | |
271+
| iconEnd | Menu icon after item text | `ReactNode` | |
272+
| selected | Menu item selected flag | `boolean` | `false` |
273+
| disabled | Menu item disabled flag | `boolean` | `false` |
274+
| active | Menu item active flag | `boolean` | `false` |
275+
| href | URL | `string` | |
276+
| title | Title attribute | `string` | |
277+
| target | Target attribute | `string` | |
278+
| rel | Rel attribute | `string` | |
279+
| onClick | Handler for onclick event | `React.MouseEventHandler` | |
280+
| theme | Menu item theme | `"normal"` `"danger"` | `"normal"` |
281+
| children | Child element | `React.ReactNode` | |
282+
| className | `class` HTML attribute for the root element | `string` | |
283+
| contentClassName | `class` HTML attribute for the content element | `string` | |
284+
| style | `style` HTML attribute | `React.CSSProperties` | |
285+
| qa | `data-qa` HTML attribute, used for testing | `string` | |
286+
| extraProps | Additional HTML attributes | `Record` | |
286287

287288
## Menu.Group
288289

src/components/Table/hoc/withTableActions/withTableActions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ const DefaultRowActions = <I extends TableDataItem>({
151151
}}
152152
href={typeof href === 'function' ? href(item, index) : href}
153153
iconStart={icon}
154-
className={menuItemCn}
154+
contentClassName={menuItemCn}
155155
{...restProps}
156156
>
157157
{text}

0 commit comments

Comments
 (0)