@cloud-ru/ds-uikit-product-page-layout 2.2.1 → 2.3.1-preview-93c4db1d.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +80 -12
- package/dist/cjs/components/Actions/ActionView.d.ts +1 -1
- package/dist/cjs/components/Actions/ActionView.js +6 -2
- package/dist/cjs/components/Actions/MobileActions.js +37 -16
- package/dist/cjs/components/Actions/styles.module.css +5 -0
- package/dist/cjs/components/Actions/types.d.ts +16 -7
- package/dist/cjs/components/PageForm/styles.module.css +4 -3
- package/dist/cjs/components/PageServices/MobilePageServices.d.ts +2 -2
- package/dist/cjs/components/PageServices/MobilePageServices.js +2 -2
- package/dist/cjs/style.css +9 -3
- package/dist/esm/components/Actions/ActionView.d.ts +1 -1
- package/dist/esm/components/Actions/ActionView.js +6 -2
- package/dist/esm/components/Actions/MobileActions.js +39 -18
- package/dist/esm/components/Actions/styles.module.css +5 -0
- package/dist/esm/components/Actions/types.d.ts +16 -7
- package/dist/esm/components/PageForm/styles.module.css +4 -3
- package/dist/esm/components/PageServices/MobilePageServices.d.ts +2 -2
- package/dist/esm/components/PageServices/MobilePageServices.js +2 -2
- package/dist/esm/style.css +9 -3
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +22 -22
- package/src/components/Actions/ActionView.tsx +8 -9
- package/src/components/Actions/MobileActions.tsx +68 -21
- package/src/components/Actions/styles.module.scss +4 -0
- package/src/components/Actions/types.ts +14 -7
- package/src/components/PageForm/styles.module.scss +4 -2
- package/src/components/PageServices/MobilePageServices.tsx +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 2.3.0 (2026-11-12)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **FF-8815:** forward truncateTitle in mobile page services ([3ff433f](https://github.com/cloud-ru-tech/snack-v2/commit/3ff433fe5f442dde340df59ab4fb5a44841dbe8b))
|
|
11
|
+
- **FF-8815:** handle overflowing mobile page actions ([8ad0498](https://github.com/cloud-ru-tech/snack-v2/commit/8ad0498454c846bfe58636b3b154d724b83611cb))
|
|
12
|
+
- **FF-8815:** page form fix on narrow screen ([521ee8d](https://github.com/cloud-ru-tech/snack-v2/commit/521ee8dfe9ccb60a7e126f2d0725cb62d9fdc701))
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- **FF-8815:** support custom page actions ([1d68f54](https://github.com/cloud-ru-tech/snack-v2/commit/1d68f54deb37fe81fcfb9bda6286853798ceb75f))
|
|
17
|
+
|
|
6
18
|
## 2.2.1 (2026-11-11)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @ds/uikit-product-page-layout
|
package/README.md
CHANGED
|
@@ -104,7 +104,7 @@ import {
|
|
|
104
104
|
|
|
105
105
|
| Prop | Type | Default | Description |
|
|
106
106
|
|------|------|---------|-------------|
|
|
107
|
-
| `actions` | `Action` \| `ButtonDropdownDroplistConfig` \| `ButtonDroplistProps` \| `ButtonKebabProps` \| `QuotaWidgetPropsBase` | — | |
|
|
107
|
+
| `actions` | `Action` \| `ButtonDropdownDroplistConfig` \| `ButtonDroplistProps` \| `ButtonKebabProps` \| `CustomAction` \| `QuotaWidgetPropsBase` | — | |
|
|
108
108
|
| `children` | `string \| number \| boolean \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal \| null \| undefined` | — | |
|
|
109
109
|
| `className` | `string` | — | CSS-класс |
|
|
110
110
|
| `data-test-id` | `string` | — | |
|
|
@@ -113,7 +113,7 @@ import {
|
|
|
113
113
|
|
|
114
114
|
##### Related types
|
|
115
115
|
|
|
116
|
-
- `Action` = `
|
|
116
|
+
- `Action` = `CustomAction | StandardAction`
|
|
117
117
|
|
|
118
118
|
**ButtonDroplistProps**
|
|
119
119
|
|
|
@@ -129,6 +129,15 @@ import {
|
|
|
129
129
|
| `button` | `ButtonProps` | — | |
|
|
130
130
|
| `list` | `DroplistListProps` \| `DroplistMobileSlots` \| `DroplistProps` \| `EmptyState` \| `PublicListContextType` \| `ScrollProps` \| `SelectionState` | — | |
|
|
131
131
|
|
|
132
|
+
**CustomAction**
|
|
133
|
+
|
|
134
|
+
| Prop | Type | Default | Description |
|
|
135
|
+
|------|------|---------|-------------|
|
|
136
|
+
| `hidden` | `boolean \| undefined` | — | |
|
|
137
|
+
| `render` | `() => { default: ReactNode; asListItem: Item; }` | — | Вызывается при рендеринге; React hooks следует использовать внутри компонента default. |
|
|
138
|
+
| `tooltip` | `TooltipProps` | — | |
|
|
139
|
+
| `variant` | `"custom"` | — | |
|
|
140
|
+
|
|
132
141
|
## PageServices
|
|
133
142
|
|
|
134
143
|
Детальная страница инстанса — селект раздела, заголовок со статусом, действия и контент. Адаптивная — на mobile селект выносится наверх full-bleed-строкой.
|
|
@@ -162,7 +171,7 @@ import {
|
|
|
162
171
|
|
|
163
172
|
| Prop | Type | Default | Description |
|
|
164
173
|
|------|------|---------|-------------|
|
|
165
|
-
| `actions` | `Action` \| `ButtonDropdownDroplistConfig` \| `ButtonDroplistProps` \| `ButtonKebabProps` \| `QuotaWidgetPropsBase` | — | |
|
|
174
|
+
| `actions` | `Action` \| `ButtonDropdownDroplistConfig` \| `ButtonDroplistProps` \| `ButtonKebabProps` \| `CustomAction` \| `QuotaWidgetPropsBase` | — | |
|
|
166
175
|
| `autoHeight` | `boolean` | — | |
|
|
167
176
|
| `children` | `string \| number \| boolean \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal \| null \| undefined` | — | |
|
|
168
177
|
| `className` | `string` | — | |
|
|
@@ -178,7 +187,7 @@ import {
|
|
|
178
187
|
|
|
179
188
|
##### Related types
|
|
180
189
|
|
|
181
|
-
- `Action` = `
|
|
190
|
+
- `Action` = `CustomAction | StandardAction`
|
|
182
191
|
|
|
183
192
|
**ButtonDroplistProps**
|
|
184
193
|
|
|
@@ -194,6 +203,15 @@ import {
|
|
|
194
203
|
| `button` | `ButtonProps` | — | |
|
|
195
204
|
| `list` | `DroplistListProps` \| `DroplistMobileSlots` \| `DroplistProps` \| `EmptyState` \| `PublicListContextType` \| `ScrollProps` \| `SelectionState` | — | |
|
|
196
205
|
|
|
206
|
+
**CustomAction**
|
|
207
|
+
|
|
208
|
+
| Prop | Type | Default | Description |
|
|
209
|
+
|------|------|---------|-------------|
|
|
210
|
+
| `hidden` | `boolean \| undefined` | — | |
|
|
211
|
+
| `render` | `() => { default: ReactNode; asListItem: Item; }` | — | Вызывается при рендеринге; React hooks следует использовать внутри компонента default. |
|
|
212
|
+
| `tooltip` | `TooltipProps` | — | |
|
|
213
|
+
| `variant` | `"custom"` | — | |
|
|
214
|
+
|
|
197
215
|
**Documentation**
|
|
198
216
|
|
|
199
217
|
| Prop | Type | Default | Description |
|
|
@@ -238,6 +256,27 @@ import {
|
|
|
238
256
|
| `label` | `string` | — | |
|
|
239
257
|
| `onClick` | `((e: MouseEvent<HTMLElement>) => void) \| undefined` | — | |
|
|
240
258
|
|
|
259
|
+
### Кастомные действия
|
|
260
|
+
|
|
261
|
+
Элемент `variant: 'custom'` возвращает два представления: `default` для панели действий и `asListItem` (тип `Item` из `@cloud-ru/ds-list`) для меню при нехватке места на мобильном экране. `hidden` скрывает действие. Функция `render` должна быть чистой; React hooks используются внутри компонента, возвращаемого в `default`.
|
|
262
|
+
|
|
263
|
+
```tsx
|
|
264
|
+
const actions: Action[] = [
|
|
265
|
+
{
|
|
266
|
+
variant: 'custom',
|
|
267
|
+
render: () => ({
|
|
268
|
+
default: <Button label='Создать снимок диска' onClick={createSnapshot} />,
|
|
269
|
+
asListItem: {
|
|
270
|
+
content: { label: 'Создать снимок диска' },
|
|
271
|
+
onClick: createSnapshot,
|
|
272
|
+
},
|
|
273
|
+
}),
|
|
274
|
+
},
|
|
275
|
+
];
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Свойство `hidden` поддерживается и для кастомных действий: скрытое действие не занимает место в панели, не попадает в меню, его `render` не вызывается.
|
|
279
|
+
|
|
241
280
|
## PageForm
|
|
242
281
|
|
|
243
282
|
Раскладка формы создания/настройки — степпер, контент, сайд-блок и sticky-футер с оценкой бюджета. Адаптивная.
|
|
@@ -544,7 +583,7 @@ import {
|
|
|
544
583
|
| `disabled` | `boolean` | — | Отключена |
|
|
545
584
|
| `error` | `boolean` | — | Флаг ошибки при загрузке квот |
|
|
546
585
|
| `fullWidth` | `boolean` | — | На всю ширину |
|
|
547
|
-
| `hidden` | `boolean` |
|
|
586
|
+
| `hidden` | `boolean` | — | |
|
|
548
587
|
| `href` | `string` | — | |
|
|
549
588
|
| `icon` | `ReactNode` | — | Иконка |
|
|
550
589
|
| `iconPosition` | `"after"` \| `"before"` | — | Позиция иконки относительно текста |
|
|
@@ -564,12 +603,13 @@ import {
|
|
|
564
603
|
| `projectName` | `string` | — | Название проекта, по которому отображаются квоты |
|
|
565
604
|
| `quotas` | `QuotaItem[]` | — | Список квот для отображения |
|
|
566
605
|
| `quotasUrl` | `string` | — | Ссылка на страницу квот по проекту |
|
|
606
|
+
| `render` | `() => { default: ReactNode; asListItem: Item; }` | — | Вызывается при рендеринге; React hooks следует использовать внутри компонента default. |
|
|
567
607
|
| `size` | `"l"` \| `"m"` \| `"s"` \| `"xs"` | — | Размер <br/> Размер триггера; для `xs` применяется кнопка `s`. |
|
|
568
608
|
| `skeletonRowCount` | `number` | `4` | Количество строк-заглушек, пока идёт загрузка. <br/> Строка — это ряд сетки: в две колонки (desktop-дропдаун) она даёт две карточки, <br/> в одну (mobile, аккордеон `QuotaWidgetMini`) — одну. |
|
|
569
609
|
| `target` | `HTMLAttributeAnchorTarget` | — | |
|
|
570
610
|
| `tooltip` | `TooltipProps` | — | |
|
|
571
611
|
| `triggerClassName` | `string` | — | CSS-класс триггера |
|
|
572
|
-
| `variant` | `"dropdown"` \| `"droplist"` \| `"filled"` \| `"function"` \| `"kebab"` \| `"outline"` \| `"quota"` \| `"simple"` \| `"tonal"` | — | |
|
|
612
|
+
| `variant` | `"custom"` \| `"dropdown"` \| `"droplist"` \| `"filled"` \| `"function"` \| `"kebab"` \| `"outline"` \| `"quota"` \| `"simple"` \| `"tonal"` | — | |
|
|
573
613
|
| `view` | `"elevated"` \| `"filled"` \| `"function"` \| `"outline"` \| `"simple"` \| `"tonal"` | — | Вариант кнопки (Figma: filled, outline, function, simple, elevated) |
|
|
574
614
|
|
|
575
615
|
## ButtonDroplist
|
|
@@ -749,12 +789,12 @@ import {
|
|
|
749
789
|
|
|
750
790
|
| Prop | Type | Default | Description |
|
|
751
791
|
|------|------|---------|-------------|
|
|
752
|
-
| `items` | `Action` \| `ButtonDropdownDroplistConfig` \| `ButtonDroplistProps` \| `ButtonKebabProps` \| `QuotaWidgetPropsBase` | — | |
|
|
792
|
+
| `items` | `Action` \| `ButtonDropdownDroplistConfig` \| `ButtonDroplistProps` \| `ButtonKebabProps` \| `CustomAction` \| `QuotaWidgetPropsBase` | — | |
|
|
753
793
|
| `maxVisibleItems` | `number` | — | |
|
|
754
794
|
|
|
755
795
|
#### Related types
|
|
756
796
|
|
|
757
|
-
- `Action` = `
|
|
797
|
+
- `Action` = `CustomAction | StandardAction`
|
|
758
798
|
|
|
759
799
|
**ButtonDroplistProps**
|
|
760
800
|
|
|
@@ -770,13 +810,22 @@ import {
|
|
|
770
810
|
| `button` | `ButtonProps` | — | |
|
|
771
811
|
| `list` | `DroplistListProps` \| `DroplistMobileSlots` \| `DroplistProps` \| `EmptyState` \| `PublicListContextType` \| `ScrollProps` \| `SelectionState` | — | |
|
|
772
812
|
|
|
813
|
+
**CustomAction**
|
|
814
|
+
|
|
815
|
+
| Prop | Type | Default | Description |
|
|
816
|
+
|------|------|---------|-------------|
|
|
817
|
+
| `hidden` | `boolean \| undefined` | — | |
|
|
818
|
+
| `render` | `() => { default: ReactNode; asListItem: Item; }` | — | Вызывается при рендеринге; React hooks следует использовать внутри компонента default. |
|
|
819
|
+
| `tooltip` | `TooltipProps` | — | |
|
|
820
|
+
| `variant` | `"custom"` | — | |
|
|
821
|
+
|
|
773
822
|
## MobilePageCatalog
|
|
774
823
|
|
|
775
824
|
### Props `MobilePageCatalogProps`
|
|
776
825
|
|
|
777
826
|
| Prop | Type | Default | Description |
|
|
778
827
|
|------|------|---------|-------------|
|
|
779
|
-
| `actions` | `Action` \| `ButtonDropdownDroplistConfig` \| `ButtonDroplistProps` \| `ButtonKebabProps` \| `QuotaWidgetPropsBase` | `[]` | |
|
|
828
|
+
| `actions` | `Action` \| `ButtonDropdownDroplistConfig` \| `ButtonDroplistProps` \| `ButtonKebabProps` \| `CustomAction` \| `QuotaWidgetPropsBase` | `[]` | |
|
|
780
829
|
| `children` | `string \| number \| boolean \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal \| null \| undefined` | — | |
|
|
781
830
|
| `className` | `string` | — | |
|
|
782
831
|
| `data-test-id` | `string` | — | |
|
|
@@ -785,7 +834,7 @@ import {
|
|
|
785
834
|
|
|
786
835
|
#### Related types
|
|
787
836
|
|
|
788
|
-
- `Action` = `
|
|
837
|
+
- `Action` = `CustomAction | StandardAction`
|
|
789
838
|
|
|
790
839
|
**ButtonDroplistProps**
|
|
791
840
|
|
|
@@ -801,6 +850,15 @@ import {
|
|
|
801
850
|
| `button` | `ButtonProps` | — | |
|
|
802
851
|
| `list` | `DroplistListProps` \| `DroplistMobileSlots` \| `DroplistProps` \| `EmptyState` \| `PublicListContextType` \| `ScrollProps` \| `SelectionState` | — | |
|
|
803
852
|
|
|
853
|
+
**CustomAction**
|
|
854
|
+
|
|
855
|
+
| Prop | Type | Default | Description |
|
|
856
|
+
|------|------|---------|-------------|
|
|
857
|
+
| `hidden` | `boolean \| undefined` | — | |
|
|
858
|
+
| `render` | `() => { default: ReactNode; asListItem: Item; }` | — | Вызывается при рендеринге; React hooks следует использовать внутри компонента default. |
|
|
859
|
+
| `tooltip` | `TooltipProps` | — | |
|
|
860
|
+
| `variant` | `"custom"` | — | |
|
|
861
|
+
|
|
804
862
|
## MobilePageForm
|
|
805
863
|
|
|
806
864
|
### Props `DesktopPageFormProps`
|
|
@@ -830,7 +888,7 @@ import {
|
|
|
830
888
|
|
|
831
889
|
| Prop | Type | Default | Description |
|
|
832
890
|
|------|------|---------|-------------|
|
|
833
|
-
| `actions` | `Action` \| `ButtonDropdownDroplistConfig` \| `ButtonDroplistProps` \| `ButtonKebabProps` \| `QuotaWidgetPropsBase` | `[]` | |
|
|
891
|
+
| `actions` | `Action` \| `ButtonDropdownDroplistConfig` \| `ButtonDroplistProps` \| `ButtonKebabProps` \| `CustomAction` \| `QuotaWidgetPropsBase` | `[]` | |
|
|
834
892
|
| `children` | `string \| number \| boolean \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal \| null \| undefined` | — | |
|
|
835
893
|
| `className` | `string` | — | |
|
|
836
894
|
| `data-test-id` | `string` | — | |
|
|
@@ -840,10 +898,11 @@ import {
|
|
|
840
898
|
| `slotBeforeTitle` | `ReactNode` | — | Слот перед заголовком (например, кнопка «назад») |
|
|
841
899
|
| `subtitle` | `ReactNode` | — | Подзаголовок под заголовком |
|
|
842
900
|
| `title` | `string` | — | Заголовок страницы |
|
|
901
|
+
| `truncateTitle` | `boolean` | — | Обрезать заголовок в одну строку с многоточием |
|
|
843
902
|
|
|
844
903
|
#### Related types
|
|
845
904
|
|
|
846
|
-
- `Action` = `
|
|
905
|
+
- `Action` = `CustomAction | StandardAction`
|
|
847
906
|
|
|
848
907
|
**ButtonDroplistProps**
|
|
849
908
|
|
|
@@ -859,6 +918,15 @@ import {
|
|
|
859
918
|
| `button` | `ButtonProps` | — | |
|
|
860
919
|
| `list` | `DroplistListProps` \| `DroplistMobileSlots` \| `DroplistProps` \| `EmptyState` \| `PublicListContextType` \| `ScrollProps` \| `SelectionState` | — | |
|
|
861
920
|
|
|
921
|
+
**CustomAction**
|
|
922
|
+
|
|
923
|
+
| Prop | Type | Default | Description |
|
|
924
|
+
|------|------|---------|-------------|
|
|
925
|
+
| `hidden` | `boolean \| undefined` | — | |
|
|
926
|
+
| `render` | `() => { default: ReactNode; asListItem: Item; }` | — | Вызывается при рендеринге; React hooks следует использовать внутри компонента default. |
|
|
927
|
+
| `tooltip` | `TooltipProps` | — | |
|
|
928
|
+
| `variant` | `"custom"` | — | |
|
|
929
|
+
|
|
862
930
|
- `SidebarItem` = `SidebarItemWithHref | SidebarItemWithItems`
|
|
863
931
|
|
|
864
932
|
**SidebarItemBase**
|
|
@@ -11,7 +11,7 @@ type CommonProps = {
|
|
|
11
11
|
* `@ds`-примитивы, которые берут раскладку из `AdaptiveProvider`. Раскладку фиксируют обёртки
|
|
12
12
|
* `DesktopActions` / `MobileActions` (`withLayoutType`), поэтому отдельный проп `layoutType` не нужен.
|
|
13
13
|
*/
|
|
14
|
-
export declare function ActionView({
|
|
14
|
+
export declare function ActionView({ hidden, tooltip, commonProps, ...action }: Action & {
|
|
15
15
|
commonProps: CommonProps;
|
|
16
16
|
}): string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
17
17
|
export {};
|
|
@@ -14,10 +14,14 @@ const constants_1 = require("./constants");
|
|
|
14
14
|
* `@ds`-примитивы, которые берут раскладку из `AdaptiveProvider`. Раскладку фиксируют обёртки
|
|
15
15
|
* `DesktopActions` / `MobileActions` (`withLayoutType`), поэтому отдельный проп `layoutType` не нужен.
|
|
16
16
|
*/
|
|
17
|
-
function ActionView({
|
|
18
|
-
if (hidden)
|
|
17
|
+
function ActionView({ hidden, tooltip, commonProps, ...action }) {
|
|
18
|
+
if (hidden)
|
|
19
19
|
return null;
|
|
20
|
+
if (action.variant === 'custom') {
|
|
21
|
+
const content = (0, jsx_runtime_1.jsx)("div", { className: commonProps.className, children: action.render().default });
|
|
22
|
+
return tooltip ? (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { ...tooltip, children: content }) : content;
|
|
20
23
|
}
|
|
24
|
+
const { variant, ...buttonProps } = action;
|
|
21
25
|
// disableSpanWrapper — кнопка остаётся ПРЯМЫМ flex-потомком контейнера действий: без него Tooltip
|
|
22
26
|
// добавляет span-обёртку (`flex:0 1 auto`), и `fullWidth`-кнопка (`flex:1 1 0`) не растягивается на
|
|
23
27
|
// всю ширину (mobile: 2 действия должны делить строку). Как в MobilePageForm ButtonGroup.
|
|
@@ -10,6 +10,7 @@ const adaptive_1 = require("@cloud-ru/ds-adaptive");
|
|
|
10
10
|
const button_1 = require("@cloud-ru/ds-button");
|
|
11
11
|
const system_1 = require("@cloud-ru/ds-icons/interface/system");
|
|
12
12
|
const list_1 = require("@cloud-ru/ds-list");
|
|
13
|
+
const modal_1 = require("@cloud-ru/ds-modal");
|
|
13
14
|
const tooltip_1 = require("@cloud-ru/ds-tooltip");
|
|
14
15
|
const uikit_product_quota_1 = require("@cloud-ru/ds-uikit-product-quota");
|
|
15
16
|
const utils_1 = require("@cloud-ru/ds-utils");
|
|
@@ -19,17 +20,41 @@ const ActionView_1 = require("./ActionView");
|
|
|
19
20
|
const constants_2 = require("./constants");
|
|
20
21
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
21
22
|
const utils_2 = require("./utils");
|
|
23
|
+
function isOverflowOnly(action) {
|
|
24
|
+
return action.variant === constants_2.BUTTON_TYPE.Kebab || action.variant === constants_2.BUTTON_TYPE.Quota;
|
|
25
|
+
}
|
|
22
26
|
function MobileActionsBase({ items, maxVisibleItems }) {
|
|
23
27
|
const containerRef = (0, react_2.useRef)(null);
|
|
24
28
|
const [isOpen, setIsOpen] = (0, react_2.useState)(false);
|
|
25
|
-
const
|
|
29
|
+
const [openQuotaIndex, setOpenQuotaIndex] = (0, react_2.useState)();
|
|
30
|
+
const activeAction = openQuotaIndex === undefined ? undefined : items[openQuotaIndex];
|
|
31
|
+
const openQuota = activeAction?.variant === constants_2.BUTTON_TYPE.Quota ? activeAction : undefined;
|
|
32
|
+
const availableItems = (0, react_2.useMemo)(() => items.filter(item => !item.hidden), [items]);
|
|
33
|
+
const measurableItems = (0, react_2.useMemo)(() => availableItems.filter(action => action.variant !== constants_2.BUTTON_TYPE.Quota), [availableItems]);
|
|
34
|
+
const { visibleItems, hiddenItems } = (0, utils_1.useDynamicList)({
|
|
35
|
+
parentContainerRef: containerRef,
|
|
36
|
+
items: measurableItems,
|
|
37
|
+
maxVisibleItems,
|
|
38
|
+
});
|
|
26
39
|
const { t: tQuota } = uikit_product_quota_1.quotaLocale.useTranslations();
|
|
27
40
|
if (!(0, utils_2.hasVisibleActions)(items)) {
|
|
28
41
|
return null;
|
|
29
42
|
}
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const droplistItems =
|
|
43
|
+
const overflowItems = availableItems.filter(action => isOverflowOnly(action) || hiddenItems.includes(action));
|
|
44
|
+
const visibleActions = visibleItems.filter(action => !isOverflowOnly(action));
|
|
45
|
+
const droplistItems = overflowItems.reduce((acc, action) => {
|
|
46
|
+
if (action.variant === 'custom') {
|
|
47
|
+
const { asListItem } = action.render();
|
|
48
|
+
acc.push({
|
|
49
|
+
...asListItem,
|
|
50
|
+
onClick: (event) => {
|
|
51
|
+
setIsOpen(false);
|
|
52
|
+
if ('onClick' in asListItem)
|
|
53
|
+
asListItem.onClick?.(event);
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
return acc;
|
|
57
|
+
}
|
|
33
58
|
switch (action.variant) {
|
|
34
59
|
case constants_2.BUTTON_TYPE.Tonal:
|
|
35
60
|
case constants_2.BUTTON_TYPE.Simple:
|
|
@@ -53,18 +78,14 @@ function MobileActionsBase({ items, maxVisibleItems }) {
|
|
|
53
78
|
break;
|
|
54
79
|
}
|
|
55
80
|
case constants_2.BUTTON_TYPE.Quota: {
|
|
56
|
-
// QuotaWidget самодостаточен (свой триггер + dropdown) — рендерим инлайн как inactive-айтем.
|
|
57
|
-
const quotaWidget = (0, jsx_runtime_1.jsx)(uikit_product_quota_1.QuotaWidget, { ...action, buttonProps: { size: 'm', fullWidth: true } });
|
|
58
81
|
acc.push({
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
],
|
|
82
|
+
content: { label: action.buttonProps?.label ?? tQuota('quotas') },
|
|
83
|
+
disabled: action.buttonProps?.disabled,
|
|
84
|
+
onClick: () => {
|
|
85
|
+
setIsOpen(false);
|
|
86
|
+
setOpenQuotaIndex(items.indexOf(action));
|
|
87
|
+
action.onWidgetOpen?.();
|
|
88
|
+
},
|
|
68
89
|
});
|
|
69
90
|
break;
|
|
70
91
|
}
|
|
@@ -107,7 +128,7 @@ function MobileActionsBase({ items, maxVisibleItems }) {
|
|
|
107
128
|
}
|
|
108
129
|
return acc;
|
|
109
130
|
}, []);
|
|
110
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.mobileActionsWrapper, ref: containerRef, "data-test-id": constants_1.TEST_IDS.mobileActions.root, children: [droplistItems.length > 0 && ((0, jsx_runtime_1.jsx)(list_1.Droplist, { size: 'm', open: isOpen, onOpenChange: setIsOpen, items: droplistItems, children: (0, jsx_runtime_1.jsx)(button_1.Button, { className: styles_module_scss_1.default.button, view: button_1.VIEW.Outline, appearance: 'neutral', icon: (0, jsx_runtime_1.jsx)(system_1.KebabSVG, {}), size: 'm', "data-test-id": constants_1.TEST_IDS.mobileActions.trigger }) })),
|
|
131
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.mobileActionsWrapper, ref: containerRef, "data-test-id": constants_1.TEST_IDS.mobileActions.root, children: [droplistItems.length > 0 && ((0, jsx_runtime_1.jsx)(list_1.Droplist, { size: 'm', open: isOpen, onOpenChange: setIsOpen, items: droplistItems, children: (0, jsx_runtime_1.jsx)(button_1.Button, { className: styles_module_scss_1.default.button, view: button_1.VIEW.Outline, appearance: 'neutral', icon: (0, jsx_runtime_1.jsx)(system_1.KebabSVG, {}), size: 'm', "data-test-id": constants_1.TEST_IDS.mobileActions.trigger }) })), openQuota && ((0, jsx_runtime_1.jsxs)(modal_1.ModalCustom, { open: true, onClose: () => setOpenQuotaIndex(undefined), snapPoints: [1], children: [(0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Header, { title: tQuota('quotas'), subtitle: openQuota.projectName }), (0, jsx_runtime_1.jsx)(modal_1.ModalCustom.Body, { content: (0, jsx_runtime_1.jsx)(uikit_product_quota_1.QuotaWidgetContent, { quotas: openQuota.quotas, quotasUrl: openQuota.quotasUrl, projectName: openQuota.projectName, loading: openQuota.loading, error: openQuota.error, onRefresh: openQuota.onRefresh, canEditQuota: openQuota.canEditQuota, onIncreaseQuotaClick: openQuota.onIncreaseQuotaClick, onQuotasUrlClick: openQuota.onQuotasUrlClick, disableSorting: openQuota.disableSorting, skeletonRowCount: openQuota.skeletonRowCount, hideMobileHeader: true }) })] })), visibleActions.map((action, index) => ((0, react_1.createElement)(ActionView_1.ActionView, { ...action, key: index, commonProps: {
|
|
111
132
|
className: styles_module_scss_1.default.button,
|
|
112
133
|
size: 'm',
|
|
113
134
|
fullWidth: true,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ButtonProps } from '@cloud-ru/ds-button';
|
|
2
|
+
import { Item } from '@cloud-ru/ds-list';
|
|
2
3
|
import { TooltipProps } from '@cloud-ru/ds-tooltip';
|
|
3
4
|
import { ButtonDropdownProps } from '@cloud-ru/ds-uikit-product-button-predefined';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
4
6
|
import { ButtonDroplistProps } from './buttons/ButtonDroplist';
|
|
5
7
|
import { ButtonKebabProps } from './buttons/ButtonKebab';
|
|
6
8
|
import { ButtonQuotaProps } from './buttons/ButtonQuota';
|
|
@@ -15,13 +17,19 @@ export type ActionButtonProps = (ButtonProps & {
|
|
|
15
17
|
}) | (Omit<ButtonProps<'a'>, 'as'> & {
|
|
16
18
|
as: 'a';
|
|
17
19
|
});
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*/
|
|
24
|
-
|
|
20
|
+
/** Кастомное действие с представлениями для панели и выпадающего меню. */
|
|
21
|
+
export type CustomAction = {
|
|
22
|
+
variant: 'custom';
|
|
23
|
+
hidden?: boolean;
|
|
24
|
+
tooltip?: TooltipProps;
|
|
25
|
+
/** Вызывается при рендеринге; React hooks следует использовать внутри компонента default. */
|
|
26
|
+
render(): {
|
|
27
|
+
default: ReactNode;
|
|
28
|
+
asListItem: Item;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export type Action = CustomAction | StandardAction;
|
|
32
|
+
type StandardAction = {
|
|
25
33
|
tooltip?: TooltipProps;
|
|
26
34
|
hidden?: boolean;
|
|
27
35
|
} & (({
|
|
@@ -47,3 +55,4 @@ export type ActionsProps = {
|
|
|
47
55
|
items: Action[];
|
|
48
56
|
maxVisibleItems?: number;
|
|
49
57
|
};
|
|
58
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
.container{
|
|
2
2
|
display:flex;
|
|
3
3
|
gap:var(--sn-primitive-dimension-24, 24px);
|
|
4
|
-
justify-content:center;
|
|
4
|
+
justify-content:safe center;
|
|
5
5
|
box-sizing:border-box;
|
|
6
|
-
|
|
7
|
-
min-width:
|
|
6
|
+
width:100%;
|
|
7
|
+
min-width:0;
|
|
8
8
|
min-height:100%;
|
|
9
9
|
padding:var(--sn-density-spacing-interval-l, var(--sn-platform-comfort-spacing-interval-l, var(--sn-primitive-dimension-32, 32px)));
|
|
10
10
|
}
|
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
top:var(--sn-density-spacing-interval-l, var(--sn-platform-comfort-spacing-interval-l, var(--sn-primitive-dimension-32, 32px)));
|
|
93
93
|
display:flex;
|
|
94
94
|
flex-direction:column;
|
|
95
|
+
flex-shrink:0;
|
|
95
96
|
gap:var(--sn-primitive-dimension-4, 4px);
|
|
96
97
|
align-self:flex-start;
|
|
97
98
|
width:304px;
|
|
@@ -3,10 +3,10 @@ import { PropsWithChildren } from 'react';
|
|
|
3
3
|
import { ActionsProps } from '../Actions';
|
|
4
4
|
import { HeadlineProps } from '../Headline';
|
|
5
5
|
import { SidebarSelectProps } from '../PageSidebar';
|
|
6
|
-
export type MobilePageServicesProps = WithSupportProps<PropsWithChildren<Pick<HeadlineProps, 'title' | 'slotBeforeTitle' | 'subtitle' | 'slotAfterTitle'> & {
|
|
6
|
+
export type MobilePageServicesProps = WithSupportProps<PropsWithChildren<Pick<HeadlineProps, 'title' | 'slotBeforeTitle' | 'subtitle' | 'slotAfterTitle' | 'truncateTitle'> & {
|
|
7
7
|
className?: string;
|
|
8
8
|
sidebar?: SidebarSelectProps;
|
|
9
9
|
actions?: ActionsProps['items'];
|
|
10
10
|
maxVisibleActionsItems?: ActionsProps['maxVisibleItems'];
|
|
11
11
|
}>>;
|
|
12
|
-
export declare function MobilePageServices({ children, title, actions, className, sidebar, slotAfterTitle, subtitle, slotBeforeTitle, maxVisibleActionsItems, ...rest }: MobilePageServicesProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function MobilePageServices({ children, title, actions, className, sidebar, slotAfterTitle, subtitle, slotBeforeTitle, maxVisibleActionsItems, truncateTitle, ...rest }: MobilePageServicesProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,6 +11,6 @@ const Actions_1 = require("../Actions");
|
|
|
11
11
|
const Headline_1 = require("../Headline");
|
|
12
12
|
const PageSidebar_1 = require("../PageSidebar");
|
|
13
13
|
const mobileStyles_module_scss_1 = __importDefault(require('./mobileStyles.module.css'));
|
|
14
|
-
function MobilePageServices({ children, title, actions = [], className, sidebar, slotAfterTitle, subtitle, slotBeforeTitle, maxVisibleActionsItems, ...rest }) {
|
|
15
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(mobileStyles_module_scss_1.default.wrapper, className), ...(0, utils_1.extractSupportProps)(rest), children: (0, jsx_runtime_1.jsxs)("div", { className: mobileStyles_module_scss_1.default.body, children: [(0, jsx_runtime_1.jsxs)("div", { className: mobileStyles_module_scss_1.default.headlineWrapper, children: [(0, jsx_runtime_1.jsx)(Headline_1.Headline, { title: title, slotBeforeTitle: slotBeforeTitle, slotAfterTitle: slotAfterTitle, subtitle: subtitle }), sidebar && (0, jsx_runtime_1.jsx)(PageSidebar_1.SidebarSelect, { ...sidebar }), actions.length > 0 && (0, jsx_runtime_1.jsx)(Actions_1.MobileActions, { items: actions, maxVisibleItems: maxVisibleActionsItems })] }), (0, jsx_runtime_1.jsx)("div", { className: mobileStyles_module_scss_1.default.childWrapper, children: children })] }) }));
|
|
14
|
+
function MobilePageServices({ children, title, actions = [], className, sidebar, slotAfterTitle, subtitle, slotBeforeTitle, maxVisibleActionsItems, truncateTitle, ...rest }) {
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(mobileStyles_module_scss_1.default.wrapper, className), ...(0, utils_1.extractSupportProps)(rest), children: (0, jsx_runtime_1.jsxs)("div", { className: mobileStyles_module_scss_1.default.body, children: [(0, jsx_runtime_1.jsxs)("div", { className: mobileStyles_module_scss_1.default.headlineWrapper, children: [(0, jsx_runtime_1.jsx)(Headline_1.Headline, { title: title, truncateTitle: truncateTitle, slotBeforeTitle: slotBeforeTitle, slotAfterTitle: slotAfterTitle, subtitle: subtitle }), sidebar && (0, jsx_runtime_1.jsx)(PageSidebar_1.SidebarSelect, { ...sidebar }), actions.length > 0 && (0, jsx_runtime_1.jsx)(Actions_1.MobileActions, { items: actions, maxVisibleItems: maxVisibleActionsItems })] }), (0, jsx_runtime_1.jsx)("div", { className: mobileStyles_module_scss_1.default.childWrapper, children: children })] }) }));
|
|
16
16
|
}
|
package/dist/cjs/style.css
CHANGED
|
@@ -27,6 +27,11 @@
|
|
|
27
27
|
.button[data-variant=icon-only]{
|
|
28
28
|
flex:0 0 auto;
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
.mobileActionsWrapper .button[data-full-width]:not([data-variant=icon-only]){
|
|
32
|
+
min-width:-moz-max-content;
|
|
33
|
+
min-width:max-content;
|
|
34
|
+
}
|
|
30
35
|
.subtitle{
|
|
31
36
|
display:flex;
|
|
32
37
|
flex-direction:row;
|
|
@@ -216,10 +221,10 @@
|
|
|
216
221
|
.container{
|
|
217
222
|
display:flex;
|
|
218
223
|
gap:var(--sn-primitive-dimension-24, 24px);
|
|
219
|
-
justify-content:center;
|
|
224
|
+
justify-content:safe center;
|
|
220
225
|
box-sizing:border-box;
|
|
221
|
-
|
|
222
|
-
min-width:
|
|
226
|
+
width:100%;
|
|
227
|
+
min-width:0;
|
|
223
228
|
min-height:100%;
|
|
224
229
|
padding:var(--sn-density-spacing-interval-l, var(--sn-platform-comfort-spacing-interval-l, var(--sn-primitive-dimension-32, 32px)));
|
|
225
230
|
}
|
|
@@ -307,6 +312,7 @@
|
|
|
307
312
|
top:var(--sn-density-spacing-interval-l, var(--sn-platform-comfort-spacing-interval-l, var(--sn-primitive-dimension-32, 32px)));
|
|
308
313
|
display:flex;
|
|
309
314
|
flex-direction:column;
|
|
315
|
+
flex-shrink:0;
|
|
310
316
|
gap:var(--sn-primitive-dimension-4, 4px);
|
|
311
317
|
align-self:flex-start;
|
|
312
318
|
width:304px;
|
|
@@ -11,7 +11,7 @@ type CommonProps = {
|
|
|
11
11
|
* `@ds`-примитивы, которые берут раскладку из `AdaptiveProvider`. Раскладку фиксируют обёртки
|
|
12
12
|
* `DesktopActions` / `MobileActions` (`withLayoutType`), поэтому отдельный проп `layoutType` не нужен.
|
|
13
13
|
*/
|
|
14
|
-
export declare function ActionView({
|
|
14
|
+
export declare function ActionView({ hidden, tooltip, commonProps, ...action }: Action & {
|
|
15
15
|
commonProps: CommonProps;
|
|
16
16
|
}): string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
17
17
|
export {};
|
|
@@ -11,10 +11,14 @@ import { BUTTON_TYPE } from './constants.js';
|
|
|
11
11
|
* `@ds`-примитивы, которые берут раскладку из `AdaptiveProvider`. Раскладку фиксируют обёртки
|
|
12
12
|
* `DesktopActions` / `MobileActions` (`withLayoutType`), поэтому отдельный проп `layoutType` не нужен.
|
|
13
13
|
*/
|
|
14
|
-
export function ActionView({
|
|
15
|
-
if (hidden)
|
|
14
|
+
export function ActionView({ hidden, tooltip, commonProps, ...action }) {
|
|
15
|
+
if (hidden)
|
|
16
16
|
return null;
|
|
17
|
+
if (action.variant === 'custom') {
|
|
18
|
+
const content = _jsx("div", { className: commonProps.className, children: action.render().default });
|
|
19
|
+
return tooltip ? _jsx(Tooltip, { ...tooltip, children: content }) : content;
|
|
17
20
|
}
|
|
21
|
+
const { variant, ...buttonProps } = action;
|
|
18
22
|
// disableSpanWrapper — кнопка остаётся ПРЯМЫМ flex-потомком контейнера действий: без него Tooltip
|
|
19
23
|
// добавляет span-обёртку (`flex:0 1 auto`), и `fullWidth`-кнопка (`flex:1 1 0`) не растягивается на
|
|
20
24
|
// всю ширину (mobile: 2 действия должны делить строку). Как в MobilePageForm ButtonGroup.
|
|
@@ -4,26 +4,51 @@ import { LAYOUT_TYPE, withLayoutType } from '@cloud-ru/ds-adaptive';
|
|
|
4
4
|
import { Button, VIEW } from '@cloud-ru/ds-button';
|
|
5
5
|
import { KebabSVG } from '@cloud-ru/ds-icons/interface/system';
|
|
6
6
|
import { Droplist } from '@cloud-ru/ds-list';
|
|
7
|
+
import { ModalCustom } from '@cloud-ru/ds-modal';
|
|
7
8
|
import { Tooltip } from '@cloud-ru/ds-tooltip';
|
|
8
|
-
import { quotaLocale,
|
|
9
|
+
import { quotaLocale, QuotaWidgetContent } from '@cloud-ru/ds-uikit-product-quota';
|
|
9
10
|
import { useDynamicList } from '@cloud-ru/ds-utils';
|
|
10
|
-
import { useRef, useState } from 'react';
|
|
11
|
+
import { useMemo, useRef, useState } from 'react';
|
|
11
12
|
import { TEST_IDS } from '../../constants.js';
|
|
12
13
|
import { ActionView } from './ActionView.js';
|
|
13
14
|
import { BUTTON_TYPE } from './constants.js';
|
|
14
15
|
import styles from './styles.module.css';
|
|
15
16
|
import { hasVisibleActions } from './utils.js';
|
|
17
|
+
function isOverflowOnly(action) {
|
|
18
|
+
return action.variant === BUTTON_TYPE.Kebab || action.variant === BUTTON_TYPE.Quota;
|
|
19
|
+
}
|
|
16
20
|
function MobileActionsBase({ items, maxVisibleItems }) {
|
|
17
21
|
const containerRef = useRef(null);
|
|
18
22
|
const [isOpen, setIsOpen] = useState(false);
|
|
19
|
-
const
|
|
23
|
+
const [openQuotaIndex, setOpenQuotaIndex] = useState();
|
|
24
|
+
const activeAction = openQuotaIndex === undefined ? undefined : items[openQuotaIndex];
|
|
25
|
+
const openQuota = activeAction?.variant === BUTTON_TYPE.Quota ? activeAction : undefined;
|
|
26
|
+
const availableItems = useMemo(() => items.filter(item => !item.hidden), [items]);
|
|
27
|
+
const measurableItems = useMemo(() => availableItems.filter(action => action.variant !== BUTTON_TYPE.Quota), [availableItems]);
|
|
28
|
+
const { visibleItems, hiddenItems } = useDynamicList({
|
|
29
|
+
parentContainerRef: containerRef,
|
|
30
|
+
items: measurableItems,
|
|
31
|
+
maxVisibleItems,
|
|
32
|
+
});
|
|
20
33
|
const { t: tQuota } = quotaLocale.useTranslations();
|
|
21
34
|
if (!hasVisibleActions(items)) {
|
|
22
35
|
return null;
|
|
23
36
|
}
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const droplistItems =
|
|
37
|
+
const overflowItems = availableItems.filter(action => isOverflowOnly(action) || hiddenItems.includes(action));
|
|
38
|
+
const visibleActions = visibleItems.filter(action => !isOverflowOnly(action));
|
|
39
|
+
const droplistItems = overflowItems.reduce((acc, action) => {
|
|
40
|
+
if (action.variant === 'custom') {
|
|
41
|
+
const { asListItem } = action.render();
|
|
42
|
+
acc.push({
|
|
43
|
+
...asListItem,
|
|
44
|
+
onClick: (event) => {
|
|
45
|
+
setIsOpen(false);
|
|
46
|
+
if ('onClick' in asListItem)
|
|
47
|
+
asListItem.onClick?.(event);
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
return acc;
|
|
51
|
+
}
|
|
27
52
|
switch (action.variant) {
|
|
28
53
|
case BUTTON_TYPE.Tonal:
|
|
29
54
|
case BUTTON_TYPE.Simple:
|
|
@@ -47,18 +72,14 @@ function MobileActionsBase({ items, maxVisibleItems }) {
|
|
|
47
72
|
break;
|
|
48
73
|
}
|
|
49
74
|
case BUTTON_TYPE.Quota: {
|
|
50
|
-
// QuotaWidget самодостаточен (свой триггер + dropdown) — рендерим инлайн как inactive-айтем.
|
|
51
|
-
const quotaWidget = _jsx(QuotaWidget, { ...action, buttonProps: { size: 'm', fullWidth: true } });
|
|
52
75
|
acc.push({
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
],
|
|
76
|
+
content: { label: action.buttonProps?.label ?? tQuota('quotas') },
|
|
77
|
+
disabled: action.buttonProps?.disabled,
|
|
78
|
+
onClick: () => {
|
|
79
|
+
setIsOpen(false);
|
|
80
|
+
setOpenQuotaIndex(items.indexOf(action));
|
|
81
|
+
action.onWidgetOpen?.();
|
|
82
|
+
},
|
|
62
83
|
});
|
|
63
84
|
break;
|
|
64
85
|
}
|
|
@@ -101,7 +122,7 @@ function MobileActionsBase({ items, maxVisibleItems }) {
|
|
|
101
122
|
}
|
|
102
123
|
return acc;
|
|
103
124
|
}, []);
|
|
104
|
-
return (_jsxs("div", { className: styles.mobileActionsWrapper, ref: containerRef, "data-test-id": TEST_IDS.mobileActions.root, children: [droplistItems.length > 0 && (_jsx(Droplist, { size: 'm', open: isOpen, onOpenChange: setIsOpen, items: droplistItems, children: _jsx(Button, { className: styles.button, view: VIEW.Outline, appearance: 'neutral', icon: _jsx(KebabSVG, {}), size: 'm', "data-test-id": TEST_IDS.mobileActions.trigger }) })),
|
|
125
|
+
return (_jsxs("div", { className: styles.mobileActionsWrapper, ref: containerRef, "data-test-id": TEST_IDS.mobileActions.root, children: [droplistItems.length > 0 && (_jsx(Droplist, { size: 'm', open: isOpen, onOpenChange: setIsOpen, items: droplistItems, children: _jsx(Button, { className: styles.button, view: VIEW.Outline, appearance: 'neutral', icon: _jsx(KebabSVG, {}), size: 'm', "data-test-id": TEST_IDS.mobileActions.trigger }) })), openQuota && (_jsxs(ModalCustom, { open: true, onClose: () => setOpenQuotaIndex(undefined), snapPoints: [1], children: [_jsx(ModalCustom.Header, { title: tQuota('quotas'), subtitle: openQuota.projectName }), _jsx(ModalCustom.Body, { content: _jsx(QuotaWidgetContent, { quotas: openQuota.quotas, quotasUrl: openQuota.quotasUrl, projectName: openQuota.projectName, loading: openQuota.loading, error: openQuota.error, onRefresh: openQuota.onRefresh, canEditQuota: openQuota.canEditQuota, onIncreaseQuotaClick: openQuota.onIncreaseQuotaClick, onQuotasUrlClick: openQuota.onQuotasUrlClick, disableSorting: openQuota.disableSorting, skeletonRowCount: openQuota.skeletonRowCount, hideMobileHeader: true }) })] })), visibleActions.map((action, index) => (_createElement(ActionView, { ...action, key: index, commonProps: {
|
|
105
126
|
className: styles.button,
|
|
106
127
|
size: 'm',
|
|
107
128
|
fullWidth: true,
|