asma-ui-core 3.105.0 → 3.106.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/dist/asma-ui-core.css +1 -1
- package/dist/components/custom/module/header-layout/DynamicToolbar.js +99 -97
- package/dist/components/custom/module/header-layout/ToolbarActionGroup.js +60 -41
- package/dist/components/custom/module/header-layout/ToolbarRows.js +51 -47
- package/dist/components/custom/module/header-layout/useTranslations.js +12 -10
- package/dist/components/custom/page/page-header/PageHeader.js +41 -40
- package/dist/components/custom/widget/widget/StyledWidget.js +21 -20
- package/dist/components/data-display/chip/StyledChip.js +70 -53
- package/dist/components/data-display/tooltip/StyledTooltip.js +116 -73
- package/dist/components/feedback/dialog/DialogBusyContext.js +32 -0
- package/dist/components/feedback/dialog/StyledDialog.js +81 -72
- package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +76 -71
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +133 -137
- package/dist/components/feedback/minimizable-dialog/components/CloseBtn.js +11 -8
- package/dist/components/feedback/minimizable-dialog/components/FullscreenBtn.js +6 -6
- package/dist/components/feedback/minimizable-dialog/components/MinimizeBtn.js +1 -1
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +94 -85
- package/dist/components/feedback/minimizable-dialog/v2/useTranslations.js +6 -4
- package/dist/components/inputs/button/StyledButton.js +83 -33
- package/dist/components/inputs/button/StyledButton.module.js +13 -13
- package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +32 -32
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +6 -6
- package/dist/components/inputs/select/StyledSelect.js +8 -8
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +14 -14
- package/dist/components/navigation/link/StyledLink.js +53 -26
- package/dist/components/navigation/link/StyledLink.module.js +6 -6
- package/dist/components/navigation/menu/StyledMenuItem.js +35 -30
- package/dist/components/navigation/tabs/StyledTab.js +23 -25
- package/dist/components/utils/bottom-sheet/StyledBottomSheet.js +6 -6
- package/dist/components/utils/copy-wrapper/CopyButton.js +4 -4
- package/dist/components/utils/copy-wrapper/CopyWrapper.js +4 -4
- package/dist/datetime/shared-components/button/StyledButton.module.js +11 -11
- package/dist/helpers/focusable.js +2 -2
- package/dist/index.js +589 -585
- package/dist/src/components/custom/module/header-layout/ToolbarActionGroup.d.ts +13 -2
- package/dist/src/components/custom/module/header-layout/ToolbarRows.d.ts +2 -1
- package/dist/src/components/custom/module/header-layout/planToolbarActions.d.ts +18 -1
- package/dist/src/components/custom/module/header-layout/useTranslations.d.ts +2 -0
- package/dist/src/components/custom/widget/widget/StyledWidget.d.ts +5 -0
- package/dist/src/components/data-display/chip/StyledChip.d.ts +6 -0
- package/dist/src/components/data-display/interactive-chip/StyledInteractiveChip.d.ts +7 -1
- package/dist/src/components/data-display/tooltip/StyledTooltip.d.ts +16 -2
- package/dist/src/components/feedback/dialog/DialogBusy.test.d.ts +1 -0
- package/dist/src/components/feedback/dialog/DialogBusyContext.d.ts +28 -0
- package/dist/src/components/feedback/dialog/StyledDialog.d.ts +5 -0
- package/dist/src/components/feedback/dialog/dialog-footer/StyledDialogFooter.d.ts +9 -8
- package/dist/src/components/feedback/dialog/index.d.ts +1 -0
- package/dist/src/components/feedback/minimizable-dialog/components/CloseBtn.d.ts +2 -0
- package/dist/src/components/feedback/minimizable-dialog/types.d.ts +11 -0
- package/dist/src/components/feedback/minimizable-dialog/v2/types.d.ts +2 -0
- package/dist/src/components/feedback/minimizable-dialog/v2/useTranslations.d.ts +2 -0
- package/dist/src/components/inputs/button/StyledButton.d.ts +25 -1
- package/dist/src/components/inputs/button/StyledButtonBusy.test.d.ts +1 -0
- package/dist/src/components/navigation/link/StyledLink.d.ts +6 -0
- package/dist/src/components/navigation/menu/StyledMenuItem.d.ts +8 -1
- package/dist/src/components/navigation/tabs/StyledTab.d.ts +6 -0
- package/dist/src/forms/submitChanged.d.ts +3 -0
- package/dist/src/helpers/focusable.d.ts +8 -0
- package/dist/src/helpers/index.d.ts +1 -0
- package/dist/src/helpers/uiCoreLocale.d.ts +1 -0
- package/dist/src/table/shared-components/StyledMenuItem.d.ts +5 -1
- package/dist/table/components/columns/action-column/components/RowActionMenu.js +63 -69
- package/dist/table/shared-components/StyledMenuItem.js +28 -16
- package/package.json +1 -1
|
@@ -6,11 +6,11 @@ import { planBulkToolbarActions as me, planToolbarActions as he } from "./planTo
|
|
|
6
6
|
import { useToolbarTranslations as ue } from "./useTranslations.js";
|
|
7
7
|
import { DynamicToolbarLayoutContext as fe } from "./DynamicToolbarLayoutContext.js";
|
|
8
8
|
import { resolveBulkActionsAvailableWidth as Ae, resolvePageActionsAvailableWidth as xe, resolveReserveBulkActionsWidthPx as ve, resolveTitleAreaWidth as be, resolveToolbarLayout as pe } from "./estimateToolbarLayout.js";
|
|
9
|
-
import { SearchSlot as
|
|
10
|
-
import { KEY_MORE_BUTTON as Me, KEY_SEARCH as $, KEY_SELECTION_INDICATOR as
|
|
9
|
+
import { SearchSlot as Pe, SelectionIndicator as we, SelectionRow as Te, TitleBlock as H, TitleText as We, UtilityCluster as Q } from "./ToolbarRows.js";
|
|
10
|
+
import { KEY_MORE_BUTTON as Me, KEY_SEARCH as $, KEY_SELECTION_INDICATOR as ge, KEY_TITLE as q, ToolbarMeasurementStrip as Be, actionKey as ye, filterKey as R } from "./ToolbarMeasurement.js";
|
|
11
11
|
import { useCallback as Se, useMemo as o } from "react";
|
|
12
|
-
import { Fragment as z, jsx as t, jsxs as
|
|
13
|
-
var G = 744, ke = 0,
|
|
12
|
+
import { Fragment as z, jsx as t, jsxs as f } from "react/jsx-runtime";
|
|
13
|
+
var G = 744, ke = 0, Le = 2, _e = [
|
|
14
14
|
{
|
|
15
15
|
minWidth: 361,
|
|
16
16
|
maxVisible: 2
|
|
@@ -24,37 +24,37 @@ var G = 744, ke = 0, _e = 2, Ie = [
|
|
|
24
24
|
maxVisible: 0
|
|
25
25
|
}
|
|
26
26
|
];
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
return Math.min(
|
|
27
|
+
function Ie(y, n) {
|
|
28
|
+
const x = _e.find((v) => y >= v.minWidth);
|
|
29
|
+
return Math.min(x?.maxVisible ?? 0, n);
|
|
30
30
|
}
|
|
31
31
|
var J = {
|
|
32
32
|
inlineActions: [],
|
|
33
33
|
overflowActions: [],
|
|
34
34
|
showMoreMenu: !1
|
|
35
35
|
};
|
|
36
|
-
function He(
|
|
37
|
-
const { title:
|
|
36
|
+
function He(y) {
|
|
37
|
+
const { title: n, helperText: x, beforeFilterActions: v = [], filter: b, search: c, afterSearchActions: C = [], selectedCount: T = 0, onClearSelection: S, bulkActions: d = [], maxVisibleBulkActions: w = Le, locale: Z = "en", className: ee, style: te, dataTest: ie = "dynamic-toolbar" } = y, m = ue(Z), { ref: oe, widthPx: l } = ce(), { register: W, widths: s } = de(), k = re(), L = o(() => Ie(l, w), [l, w]), M = !k && l >= G ? w : L, h = T > 0, O = !h, p = o(() => [...v, ...C], [v, C]), u = Se((e, i) => s[ye(e.id, i)], [s]), a = o(() => ({
|
|
38
38
|
titleWidthPx: s[q],
|
|
39
39
|
searchWidthPx: s[$],
|
|
40
40
|
filterLabelWidthPx: s[R(!1)],
|
|
41
41
|
filterIconWidthPx: s[R(!0)],
|
|
42
|
-
selectionIndicatorWidthPx: s[
|
|
42
|
+
selectionIndicatorWidthPx: s[ge],
|
|
43
43
|
moreButtonWidthPx: s[Me],
|
|
44
|
-
actionWidthPx:
|
|
45
|
-
}), [s,
|
|
44
|
+
actionWidthPx: u
|
|
45
|
+
}), [s, u]), _ = o(() => ve(ke, d, u, M), [
|
|
46
46
|
d,
|
|
47
|
-
|
|
47
|
+
u,
|
|
48
48
|
M
|
|
49
|
-
]), { mode: r, filterIconOnly:
|
|
50
|
-
containerWidth:
|
|
49
|
+
]), { mode: r, filterIconOnly: P, trailingIconOnly: g } = o(() => pe({
|
|
50
|
+
containerWidth: l,
|
|
51
51
|
isMobile: k,
|
|
52
|
-
isSelectionMode:
|
|
52
|
+
isSelectionMode: h,
|
|
53
53
|
compactBreakpointPx: G,
|
|
54
|
-
reserveBulkActionsWidthPx:
|
|
55
|
-
title:
|
|
54
|
+
reserveBulkActionsWidthPx: _,
|
|
55
|
+
title: n,
|
|
56
56
|
hasLeadingUtility: !1,
|
|
57
|
-
hasFilter:
|
|
57
|
+
hasFilter: b != null,
|
|
58
58
|
hasSearch: c != null,
|
|
59
59
|
hasTrailingUtility: !1,
|
|
60
60
|
pageActions: p,
|
|
@@ -63,182 +63,184 @@ function He(g) {
|
|
|
63
63
|
measured: a
|
|
64
64
|
}), [
|
|
65
65
|
d,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
l,
|
|
67
|
+
_,
|
|
68
|
+
b,
|
|
69
69
|
k,
|
|
70
|
-
|
|
70
|
+
h,
|
|
71
71
|
M,
|
|
72
72
|
a,
|
|
73
73
|
p,
|
|
74
74
|
c,
|
|
75
|
-
|
|
76
|
-
]),
|
|
77
|
-
containerWidth:
|
|
78
|
-
filterIconOnly:
|
|
79
|
-
trailingIconOnly:
|
|
75
|
+
n
|
|
76
|
+
]), ne = o(() => ({
|
|
77
|
+
containerWidth: l,
|
|
78
|
+
filterIconOnly: P,
|
|
79
|
+
trailingIconOnly: g
|
|
80
80
|
}), [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
]), V = be(
|
|
81
|
+
l,
|
|
82
|
+
P,
|
|
83
|
+
g
|
|
84
|
+
]), V = be(n, a.titleWidthPx), U = xe({
|
|
85
85
|
layoutMode: r,
|
|
86
|
-
containerWidth:
|
|
86
|
+
containerWidth: l,
|
|
87
87
|
titleWidth: V,
|
|
88
|
-
filterIconOnly:
|
|
89
|
-
trailingIconOnly:
|
|
90
|
-
hasFilter:
|
|
88
|
+
filterIconOnly: P,
|
|
89
|
+
trailingIconOnly: g,
|
|
90
|
+
hasFilter: b != null,
|
|
91
91
|
hasSearch: c != null,
|
|
92
92
|
hasLeadingUtility: !1,
|
|
93
93
|
hasTrailingUtility: !1,
|
|
94
|
-
reserveBulkActionsWidthPx:
|
|
94
|
+
reserveBulkActionsWidthPx: h ? 0 : _,
|
|
95
95
|
measured: a
|
|
96
96
|
}), F = Ae({
|
|
97
97
|
layoutMode: r,
|
|
98
|
-
containerWidth:
|
|
98
|
+
containerWidth: l,
|
|
99
99
|
titleWidth: V,
|
|
100
|
-
filterIconOnly:
|
|
101
|
-
hasFilter:
|
|
100
|
+
filterIconOnly: P,
|
|
101
|
+
hasFilter: b != null,
|
|
102
102
|
hasSearch: c != null,
|
|
103
103
|
measured: a
|
|
104
|
-
}),
|
|
104
|
+
}), A = o(() => he({
|
|
105
105
|
actions: p,
|
|
106
106
|
availableWidth: U,
|
|
107
107
|
collapseLabels: !0,
|
|
108
|
-
resolveActionWidth:
|
|
108
|
+
resolveActionWidth: u,
|
|
109
109
|
moreButtonWidthPx: a.moreButtonWidthPx
|
|
110
110
|
}), [
|
|
111
111
|
p,
|
|
112
112
|
U,
|
|
113
|
-
|
|
113
|
+
u,
|
|
114
114
|
a.moreButtonWidthPx
|
|
115
|
-
]),
|
|
116
|
-
const e =
|
|
115
|
+
]), B = o(() => new Set(v.map((e) => e.id)), [v]), K = o(() => {
|
|
116
|
+
const e = A.inlineActions.filter((i) => B.has(i.action.id));
|
|
117
117
|
return e.length ? {
|
|
118
118
|
inlineActions: e,
|
|
119
119
|
overflowActions: [],
|
|
120
120
|
showMoreMenu: !1
|
|
121
121
|
} : J;
|
|
122
|
-
}, [
|
|
123
|
-
const e =
|
|
124
|
-
return !e.length && !
|
|
122
|
+
}, [B, A]), D = o(() => {
|
|
123
|
+
const e = A.inlineActions.filter((i) => !B.has(i.action.id));
|
|
124
|
+
return !e.length && !A.showMoreMenu ? J : {
|
|
125
125
|
inlineActions: e,
|
|
126
|
-
overflowActions:
|
|
127
|
-
showMoreMenu:
|
|
126
|
+
overflowActions: A.overflowActions,
|
|
127
|
+
showMoreMenu: A.showMoreMenu
|
|
128
128
|
};
|
|
129
|
-
}, [
|
|
129
|
+
}, [B, A]), Y = o(() => me({
|
|
130
130
|
actions: d,
|
|
131
131
|
availableWidth: F,
|
|
132
|
-
maxVisibleBulkActions: r === "compact" ?
|
|
133
|
-
resolveActionWidth:
|
|
132
|
+
maxVisibleBulkActions: r === "compact" ? L : w,
|
|
133
|
+
resolveActionWidth: u,
|
|
134
134
|
moreButtonWidthPx: a.moreButtonWidthPx
|
|
135
135
|
}), [
|
|
136
136
|
d,
|
|
137
137
|
F,
|
|
138
|
-
|
|
138
|
+
L,
|
|
139
139
|
r,
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
w,
|
|
141
|
+
u,
|
|
142
142
|
a.moreButtonWidthPx
|
|
143
|
-
]),
|
|
143
|
+
]), le = o(() => {
|
|
144
144
|
const e = /* @__PURE__ */ new Map();
|
|
145
145
|
for (const i of [...p, ...d]) !i.hidden && !e.has(i.id) && e.set(i.id, i);
|
|
146
146
|
return [...e.values()];
|
|
147
|
-
}, [p, d]),
|
|
148
|
-
ref: W(R(
|
|
147
|
+
}, [p, d]), I = W(q, "scroll"), j = W($), N = b != null ? /* @__PURE__ */ t("span", {
|
|
148
|
+
ref: W(R(P)),
|
|
149
149
|
className: "inline-flex shrink-0 items-center",
|
|
150
|
-
children:
|
|
151
|
-
}) : void 0, se = /* @__PURE__ */ t(
|
|
152
|
-
actions:
|
|
150
|
+
children: b
|
|
151
|
+
}) : void 0, se = /* @__PURE__ */ t(Be, {
|
|
152
|
+
actions: le,
|
|
153
153
|
register: W,
|
|
154
|
-
overflowMenuLabel:
|
|
155
|
-
selectionIndicator:
|
|
154
|
+
overflowMenuLabel: m.more,
|
|
155
|
+
selectionIndicator: h ? {
|
|
156
156
|
selectedCount: T,
|
|
157
157
|
hasClear: S != null,
|
|
158
|
-
translations:
|
|
158
|
+
translations: m
|
|
159
159
|
} : void 0
|
|
160
160
|
}), X = /* @__PURE__ */ t(Te, {
|
|
161
161
|
selectedCount: T,
|
|
162
162
|
onClearSelection: S,
|
|
163
|
-
translations:
|
|
163
|
+
translations: m,
|
|
164
164
|
bulkActionsPlan: Y
|
|
165
|
-
}),
|
|
166
|
-
value:
|
|
167
|
-
children: /* @__PURE__ */
|
|
165
|
+
}), E = (e, i) => /* @__PURE__ */ t(fe.Provider, {
|
|
166
|
+
value: ne,
|
|
167
|
+
children: /* @__PURE__ */ f("div", {
|
|
168
168
|
ref: oe,
|
|
169
169
|
"data-testid": ie,
|
|
170
170
|
"data-layout": i,
|
|
171
|
-
"data-filter-icon-only":
|
|
172
|
-
"data-trailing-icon-only":
|
|
171
|
+
"data-filter-icon-only": P ? "true" : "false",
|
|
172
|
+
"data-trailing-icon-only": g ? "true" : "false",
|
|
173
173
|
className: ae("relative flex w-full flex-col gap-2", ee),
|
|
174
174
|
style: te,
|
|
175
175
|
children: [se, e]
|
|
176
176
|
})
|
|
177
177
|
});
|
|
178
|
-
return r === "compact" || r === "stacked" ?
|
|
178
|
+
return r === "compact" || r === "stacked" ? E(/* @__PURE__ */ f(z, { children: [
|
|
179
179
|
/* @__PURE__ */ t(H, {
|
|
180
|
-
title:
|
|
181
|
-
helperText:
|
|
182
|
-
titleMeasureRef:
|
|
180
|
+
title: n,
|
|
181
|
+
helperText: x,
|
|
182
|
+
titleMeasureRef: I
|
|
183
183
|
}),
|
|
184
184
|
/* @__PURE__ */ t(Q, {
|
|
185
185
|
variant: "utility-row",
|
|
186
186
|
beforeFilterActionsPlan: K,
|
|
187
|
-
filter:
|
|
187
|
+
filter: N,
|
|
188
188
|
search: c,
|
|
189
189
|
afterSearchActionsPlan: D,
|
|
190
190
|
showPageActions: O,
|
|
191
|
-
overflowMenuLabel:
|
|
191
|
+
overflowMenuLabel: m.more,
|
|
192
|
+
inProgressLabel: m.inProgress,
|
|
192
193
|
align: r === "compact" ? "start" : "end"
|
|
193
194
|
}),
|
|
194
|
-
|
|
195
|
-
] }), r) : r === "selection-split" ?
|
|
195
|
+
h && X
|
|
196
|
+
] }), r) : r === "selection-split" ? E(/* @__PURE__ */ f(z, { children: [/* @__PURE__ */ f("div", {
|
|
196
197
|
className: "flex w-full min-w-0 flex-nowrap items-center justify-between gap-3",
|
|
197
198
|
children: [/* @__PURE__ */ t("div", {
|
|
198
199
|
className: "min-w-0 flex-1 overflow-hidden",
|
|
199
200
|
children: /* @__PURE__ */ t(H, {
|
|
200
|
-
title:
|
|
201
|
-
helperText:
|
|
202
|
-
titleMeasureRef:
|
|
201
|
+
title: n,
|
|
202
|
+
helperText: x,
|
|
203
|
+
titleMeasureRef: I
|
|
203
204
|
})
|
|
204
|
-
}), /* @__PURE__ */
|
|
205
|
+
}), /* @__PURE__ */ f("div", {
|
|
205
206
|
className: "flex shrink-0 flex-nowrap items-center gap-2",
|
|
206
|
-
children: [
|
|
207
|
+
children: [N, c != null && /* @__PURE__ */ t(Pe, {
|
|
207
208
|
search: c,
|
|
208
209
|
measureRef: j
|
|
209
210
|
})]
|
|
210
211
|
})]
|
|
211
|
-
}), X] }), "selection-split") :
|
|
212
|
+
}), X] }), "selection-split") : E(/* @__PURE__ */ f("div", {
|
|
212
213
|
className: "flex w-full min-w-0 flex-col gap-1",
|
|
213
|
-
children: [/* @__PURE__ */
|
|
214
|
+
children: [/* @__PURE__ */ f("div", {
|
|
214
215
|
className: "flex w-full min-w-0 flex-nowrap items-center gap-3",
|
|
215
|
-
children: [/* @__PURE__ */
|
|
216
|
+
children: [/* @__PURE__ */ f("div", {
|
|
216
217
|
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
217
|
-
children: [
|
|
218
|
-
title:
|
|
219
|
-
measureRef:
|
|
220
|
-
}),
|
|
218
|
+
children: [n && /* @__PURE__ */ t(We, {
|
|
219
|
+
title: n,
|
|
220
|
+
measureRef: I
|
|
221
|
+
}), h && /* @__PURE__ */ t(we, {
|
|
221
222
|
selectedCount: T,
|
|
222
223
|
onClearSelection: S,
|
|
223
|
-
translations:
|
|
224
|
+
translations: m
|
|
224
225
|
})]
|
|
225
226
|
}), /* @__PURE__ */ t("div", {
|
|
226
227
|
className: "min-w-0 shrink-0",
|
|
227
228
|
children: /* @__PURE__ */ t(Q, {
|
|
228
|
-
variant:
|
|
229
|
+
variant: h ? "inline-selection" : "inline-normal",
|
|
229
230
|
beforeFilterActionsPlan: K,
|
|
230
|
-
filter:
|
|
231
|
+
filter: N,
|
|
231
232
|
search: c,
|
|
232
233
|
afterSearchActionsPlan: D,
|
|
233
234
|
bulkActionsPlan: Y,
|
|
234
235
|
showPageActions: O,
|
|
235
|
-
overflowMenuLabel:
|
|
236
|
+
overflowMenuLabel: m.more,
|
|
237
|
+
inProgressLabel: m.inProgress,
|
|
236
238
|
searchMeasureRef: j
|
|
237
239
|
})
|
|
238
240
|
})]
|
|
239
|
-
}),
|
|
241
|
+
}), x && /* @__PURE__ */ t("div", {
|
|
240
242
|
className: "text-sm text-delta-700",
|
|
241
|
-
children:
|
|
243
|
+
children: x
|
|
242
244
|
})]
|
|
243
245
|
}), "inline");
|
|
244
246
|
}
|
|
@@ -1,67 +1,85 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { DotsVerticalIcon as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { cn as p } from "../../../../helpers/cn.js";
|
|
2
|
+
import { DotsVerticalIcon as x } from "../../../icons/dots-vertical-icon/DotsVerticalIcon.js";
|
|
3
|
+
import { useReportDialogBusy as y } from "../../../feedback/dialog/DialogBusyContext.js";
|
|
4
|
+
import { StyledButton as c } from "../../../inputs/button/StyledButton.js";
|
|
5
|
+
import { StyledMenu as R } from "../../../navigation/menu/StyledMenu.js";
|
|
6
|
+
import { StyledMenuItem as A } from "../../../navigation/menu/StyledMenuItem.js";
|
|
7
|
+
import { useState as B } from "react";
|
|
8
|
+
import { Fragment as I, jsx as n, jsxs as u } from "react/jsx-runtime";
|
|
9
|
+
var v = "In progress";
|
|
10
|
+
function S(e, l = v) {
|
|
11
|
+
return e.loading ? {
|
|
12
|
+
disabled: !0,
|
|
13
|
+
disabledReason: l,
|
|
14
|
+
"aria-busy": !0
|
|
15
|
+
} : {
|
|
16
|
+
disabled: e.disabled,
|
|
17
|
+
disabledReason: e.disabledReason
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function F(e) {
|
|
9
21
|
return e != null && (e.inlineActions.length > 0 || e.showMoreMenu);
|
|
10
22
|
}
|
|
11
|
-
function T({ action: e, showLabel: l, selectionTone:
|
|
23
|
+
function T({ action: e, showLabel: l, selectionTone: o = !1, inProgressLabel: a }) {
|
|
12
24
|
if (e.render) return e.render({ showLabel: l });
|
|
13
|
-
const
|
|
14
|
-
return /* @__PURE__ */ n(
|
|
25
|
+
const i = e.ariaLabel ?? e.label;
|
|
26
|
+
return /* @__PURE__ */ n(c, {
|
|
15
27
|
dataTest: e.dataTest ?? `dynamic-toolbar-action-${e.id}`,
|
|
16
|
-
variant: e.variant ?? (
|
|
28
|
+
variant: e.variant ?? (o ? "text" : "outlined"),
|
|
17
29
|
error: e.tone === "danger",
|
|
18
30
|
size: e.size ?? "large",
|
|
19
31
|
type: "button",
|
|
32
|
+
disabled: !!e.disabled && !!e.disabledReason,
|
|
20
33
|
"aria-disabled": e.disabled ? !0 : void 0,
|
|
34
|
+
disabledReason: e.disabledReason,
|
|
35
|
+
loading: e.loading,
|
|
36
|
+
holdsDialog: e.holdsDialog,
|
|
37
|
+
loadingAnnouncement: a,
|
|
21
38
|
startIcon: e.icon,
|
|
22
39
|
onClick: e.disabled ? void 0 : e.onClick,
|
|
23
|
-
"aria-label": l && e.ariaLabel == null ? void 0 :
|
|
40
|
+
"aria-label": l && e.ariaLabel == null ? void 0 : i,
|
|
24
41
|
children: l ? e.label : void 0
|
|
25
42
|
});
|
|
26
43
|
}
|
|
27
|
-
function
|
|
28
|
-
return /* @__PURE__ */ n(
|
|
44
|
+
function k({ overflowMenuLabel: e, onOpen: l }) {
|
|
45
|
+
return /* @__PURE__ */ n(c, {
|
|
29
46
|
dataTest: "dynamic-toolbar-overflow-actions",
|
|
30
47
|
variant: "text",
|
|
31
48
|
size: "large",
|
|
32
49
|
type: "button",
|
|
33
|
-
endIcon: /* @__PURE__ */ n(
|
|
50
|
+
endIcon: /* @__PURE__ */ n(x, {
|
|
34
51
|
width: 20,
|
|
35
52
|
height: 20
|
|
36
53
|
}),
|
|
37
|
-
onClick: (
|
|
54
|
+
onClick: (o) => l?.(o.currentTarget),
|
|
38
55
|
"aria-label": e,
|
|
39
56
|
"aria-haspopup": "menu",
|
|
40
57
|
children: e
|
|
41
58
|
});
|
|
42
59
|
}
|
|
43
|
-
function j({ plan: e, overflowMenuLabel: l, className:
|
|
44
|
-
const [
|
|
45
|
-
return !
|
|
46
|
-
className:
|
|
47
|
-
children: [
|
|
48
|
-
const
|
|
60
|
+
function j({ plan: e, overflowMenuLabel: l, className: o, selectionTone: a = !1, registerActionWidth: i, inProgressLabel: m = v }) {
|
|
61
|
+
const [f, d] = B(null), { inlineActions: b, overflowActions: g, showMoreMenu: s } = e;
|
|
62
|
+
return y(s && g.some((r) => !!r.loading && r.holdsDialog !== !1)), !b.length && !s ? null : /* @__PURE__ */ u("div", {
|
|
63
|
+
className: p("flex shrink-0 flex-nowrap items-center gap-2", o),
|
|
64
|
+
children: [b.map(({ action: r, showLabel: t }) => {
|
|
65
|
+
const h = /* @__PURE__ */ n(T, {
|
|
49
66
|
action: r,
|
|
50
|
-
showLabel:
|
|
51
|
-
selectionTone:
|
|
67
|
+
showLabel: t,
|
|
68
|
+
selectionTone: a,
|
|
69
|
+
inProgressLabel: m
|
|
52
70
|
}, r.id);
|
|
53
|
-
return
|
|
54
|
-
ref:
|
|
71
|
+
return i == null || r.measureInStrip !== !1 ? h : /* @__PURE__ */ n("span", {
|
|
72
|
+
ref: i(r.id, t),
|
|
55
73
|
className: "inline-flex shrink-0",
|
|
56
|
-
children:
|
|
74
|
+
children: h
|
|
57
75
|
}, r.id);
|
|
58
|
-
}),
|
|
76
|
+
}), s && /* @__PURE__ */ u(I, { children: [/* @__PURE__ */ n(k, {
|
|
59
77
|
overflowMenuLabel: l,
|
|
60
|
-
onOpen: (r) =>
|
|
61
|
-
}), /* @__PURE__ */ n(
|
|
62
|
-
anchorEl:
|
|
63
|
-
open: !!
|
|
64
|
-
onClose: () =>
|
|
78
|
+
onOpen: (r) => d((t) => t ? null : r)
|
|
79
|
+
}), /* @__PURE__ */ n(R, {
|
|
80
|
+
anchorEl: f,
|
|
81
|
+
open: !!f,
|
|
82
|
+
onClose: () => d(null),
|
|
65
83
|
anchorOrigin: {
|
|
66
84
|
vertical: "bottom",
|
|
67
85
|
horizontal: "right"
|
|
@@ -70,13 +88,13 @@ function j({ plan: e, overflowMenuLabel: l, className: t, selectionTone: o = !1,
|
|
|
70
88
|
vertical: "top",
|
|
71
89
|
horizontal: "right"
|
|
72
90
|
},
|
|
73
|
-
children:
|
|
74
|
-
|
|
91
|
+
children: g.map((r) => /* @__PURE__ */ n(A, {
|
|
92
|
+
...S(r, m),
|
|
75
93
|
onClick: () => {
|
|
76
|
-
|
|
94
|
+
d(null), r.onClick();
|
|
77
95
|
},
|
|
78
|
-
children: /* @__PURE__ */
|
|
79
|
-
className:
|
|
96
|
+
children: /* @__PURE__ */ u("div", {
|
|
97
|
+
className: p("flex items-center gap-2", r.tone === "danger" ? "text-beta-500" : "text-delta-700"),
|
|
80
98
|
children: [r.icon, /* @__PURE__ */ n("span", { children: r.label })]
|
|
81
99
|
})
|
|
82
100
|
}, r.id))
|
|
@@ -84,8 +102,9 @@ function j({ plan: e, overflowMenuLabel: l, className: t, selectionTone: o = !1,
|
|
|
84
102
|
});
|
|
85
103
|
}
|
|
86
104
|
export {
|
|
87
|
-
|
|
105
|
+
k as MoreTriggerButton,
|
|
88
106
|
T as ToolbarActionButton,
|
|
89
107
|
j as ToolbarActionGroup,
|
|
90
|
-
|
|
108
|
+
F as hasPlannedActions,
|
|
109
|
+
S as overflowItemState
|
|
91
110
|
};
|