@nice2dev/ui 1.3.0 → 1.3.2
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 +93 -0
- package/dist/NiceDataGrid-Cs4vOOTE.js +2267 -0
- package/dist/NiceDataGrid-jZvzaCv3.cjs +10 -0
- package/dist/NiceForm-DYcrWaN1.js +5017 -0
- package/dist/NiceForm-ZzfYumoR.cjs +1 -0
- package/dist/NiceMention-VhH0Dllr.cjs +430 -0
- package/dist/NiceMention-cOqXnI0M.js +11653 -0
- package/dist/NiceModuleLifecyclePanel-BWUYyWfY.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-BdcJATGF.js +7190 -0
- package/dist/NiceModuleLifecyclePanel-Bk5MXMVu.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-DmdqTQjn.js +7361 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NiceSavedQueryPanel-Cs_dypgU.js +5311 -0
- package/dist/NiceSavedQueryPanel-DTSOHW2v.cjs +586 -0
- package/dist/NiceScheduler-BmHcJLBe.cjs +5 -0
- package/dist/NiceScheduler-DI2sg3Rr.js +1710 -0
- package/dist/core-lazy-BpbIO1EN.cjs +1 -0
- package/dist/core-lazy-L7MVTPp1.js +351 -0
- package/dist/data.cjs +1 -1
- package/dist/data.mjs +2 -2
- package/dist/editors.cjs +1 -1
- package/dist/editors.mjs +3 -3
- package/dist/index.cjs +119 -119
- package/dist/index.css +1 -1
- package/dist/index.d.ts +185 -28
- package/dist/index.mjs +10368 -10337
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +143 -23
- package/dist/navigation.mjs +74 -71
- package/dist/pickerCommons-CUGHOWyc.cjs +1 -0
- package/dist/pickerCommons-D-dwdCBZ.js +659 -0
- package/dist/pickerCommons.css +1 -1
- package/dist/style.css +3 -3
- package/package.json +4 -4
package/dist/navigation.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { D as de, a as ue, b as be, c as me, d as pe, e as _e, N as he, f as Ne, g as ve, h as fe, i as ye, j as ge, k as ke, l as we, m as $e, n as Me, o as Ce, p as De, q as xe, r as Se, s as Oe, t as Ae, u as Ee, v as Ie, w as Re, x as Te, y as
|
|
1
|
+
import { D as de, a as ue, b as be, c as me, d as pe, e as _e, N as he, f as Ne, g as ve, h as fe, i as ye, j as ge, k as ke, l as we, m as $e, n as Me, o as Ce, p as De, q as xe, r as Se, s as Oe, t as Ae, u as Ee, v as Ie, w as Re, x as Te, y as Be, z as Pe, A as ze, B as Fe, C as Le, E as je, F as Ke, G as We, H as He, S as qe, I as Ue, J as Ve, K as Je, L as Ye } from "./NiceModuleLifecyclePanel-DmdqTQjn.js";
|
|
2
2
|
import { jsx as n, jsxs as b } from "react/jsx-runtime";
|
|
3
|
-
import { useControlId as T, useNiceAccessMode as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { a as
|
|
6
|
-
import { N as
|
|
3
|
+
import { useControlId as T, useNiceAccessMode as B, useNiceTranslation as j, useMenuButton as J, useRovingFocus as L, NiceIcon as E, useOverlayFocus as Y } from "@nice2dev/ui-core";
|
|
4
|
+
import { forwardRef as P, useState as I, useCallback as z, useRef as R, useLayoutEffect as Q, useEffect as X } from "react";
|
|
5
|
+
import { a as Xe } from "./pickerCommons-D-dwdCBZ.js";
|
|
6
|
+
import { N as Ge } from "./NicePagination-BJS65foT.js";
|
|
7
7
|
const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
8
|
-
/* @__PURE__ */
|
|
8
|
+
/* @__PURE__ */ P(
|
|
9
9
|
({
|
|
10
10
|
items: m = F,
|
|
11
11
|
activeKey: N,
|
|
@@ -23,22 +23,22 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
23
23
|
accessMode: M,
|
|
24
24
|
...C
|
|
25
25
|
}, u) => {
|
|
26
|
-
const k = T($), w =
|
|
27
|
-
_((
|
|
28
|
-
const s = new Set(
|
|
26
|
+
const k = T($), w = B(M, $), [f, _] = I(/* @__PURE__ */ new Set()), a = z((e) => {
|
|
27
|
+
_((i) => {
|
|
28
|
+
const s = new Set(i);
|
|
29
29
|
return s.has(e) ? s.delete(e) : s.add(e), s;
|
|
30
30
|
});
|
|
31
31
|
}, []);
|
|
32
32
|
if (w === "hidden")
|
|
33
33
|
return null;
|
|
34
|
-
const r = (e,
|
|
35
|
-
const s = e.children && e.children.length > 0,
|
|
34
|
+
const r = (e, i = 0) => {
|
|
35
|
+
const s = e.children && e.children.length > 0, c = f.has(e.key), d = e.key === N;
|
|
36
36
|
return /* @__PURE__ */ b("li", { className: "nice-sidebar-menu__item", children: [
|
|
37
37
|
/* @__PURE__ */ b(
|
|
38
38
|
"button",
|
|
39
39
|
{
|
|
40
40
|
className: `nice-sidebar-menu__btn ${d ? "nice-sidebar-menu__btn--active" : ""} ${e.disabled ? "nice-sidebar-menu__btn--disabled" : ""}`,
|
|
41
|
-
style: { paddingLeft: t ? void 0 : 12 +
|
|
41
|
+
style: { paddingLeft: t ? void 0 : 12 + i * 16 },
|
|
42
42
|
onClick: () => s ? a(e.key) : y?.(e),
|
|
43
43
|
disabled: e.disabled,
|
|
44
44
|
title: t ? e.text : void 0,
|
|
@@ -47,11 +47,11 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
47
47
|
e.icon && /* @__PURE__ */ n("span", { className: "nice-sidebar-menu__icon", children: e.icon }),
|
|
48
48
|
!t && /* @__PURE__ */ n("span", { className: "nice-sidebar-menu__label", children: e.text }),
|
|
49
49
|
!t && e.badge !== void 0 && /* @__PURE__ */ n("span", { className: "nice-sidebar-menu__badge", children: e.badge }),
|
|
50
|
-
!t && s && /* @__PURE__ */ n("span", { className: "nice-sidebar-menu__chevron", children: /* @__PURE__ */ n(E, { name:
|
|
50
|
+
!t && s && /* @__PURE__ */ n("span", { className: "nice-sidebar-menu__chevron", children: /* @__PURE__ */ n(E, { name: c ? "chevron-down" : "chevron-right", size: 14 }) })
|
|
51
51
|
]
|
|
52
52
|
}
|
|
53
53
|
),
|
|
54
|
-
s &&
|
|
54
|
+
s && c && !t && /* @__PURE__ */ n("ul", { className: "nice-sidebar-menu__children", children: e.children.map((A) => r(A, i + 1)) })
|
|
55
55
|
] }, e.key);
|
|
56
56
|
};
|
|
57
57
|
return /* @__PURE__ */ b(
|
|
@@ -73,7 +73,7 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
73
73
|
),
|
|
74
74
|
{ displayName: "NiceSidebarMenu" }
|
|
75
75
|
), se = /* @__PURE__ */ Object.assign(
|
|
76
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ P(
|
|
77
77
|
({
|
|
78
78
|
items: m = F,
|
|
79
79
|
activeKey: N,
|
|
@@ -87,8 +87,8 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
87
87
|
accessMode: p,
|
|
88
88
|
...x
|
|
89
89
|
}, S) => {
|
|
90
|
-
const $ = T(l), M =
|
|
91
|
-
|
|
90
|
+
const $ = T(l), M = B(p, l), [C, u] = I(null), [k, w] = I(!1), f = R(null), _ = R(null);
|
|
91
|
+
L(f, { orientation: "horizontal", wrap: !0, typeahead: !0 }), L(_, { orientation: "vertical", wrap: !0, typeahead: !0 }), Y(_, {
|
|
92
92
|
open: C != null && !k,
|
|
93
93
|
modal: !1,
|
|
94
94
|
onClose: () => u(null)
|
|
@@ -99,10 +99,10 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
99
99
|
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight")
|
|
100
100
|
return;
|
|
101
101
|
e.preventDefault();
|
|
102
|
-
const
|
|
102
|
+
const i = [
|
|
103
103
|
...f.current?.querySelectorAll(".nice-top-menu__btn") ?? []
|
|
104
|
-
], s =
|
|
105
|
-
u(null),
|
|
104
|
+
], s = i.findIndex((d) => d.getAttribute("aria-expanded") === "true"), c = i[(s + (e.key === "ArrowRight" ? 1 : -1) + i.length) % i.length];
|
|
105
|
+
u(null), c?.focus();
|
|
106
106
|
};
|
|
107
107
|
return M === "hidden" ? null : /* @__PURE__ */ b(
|
|
108
108
|
"nav",
|
|
@@ -115,61 +115,61 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
115
115
|
children: [
|
|
116
116
|
v && /* @__PURE__ */ n("div", { className: "nice-top-menu__brand", children: v }),
|
|
117
117
|
/* @__PURE__ */ n("ul", { className: "nice-top-menu__items", role: "menubar", ref: f, children: m.map((e) => {
|
|
118
|
-
const
|
|
118
|
+
const i = e.children && e.children.length > 0, s = C === e.key;
|
|
119
119
|
return /* @__PURE__ */ b(
|
|
120
120
|
"li",
|
|
121
121
|
{
|
|
122
122
|
className: "nice-top-menu__item",
|
|
123
123
|
onMouseEnter: () => {
|
|
124
|
-
|
|
124
|
+
i && (w(!0), u(e.key));
|
|
125
125
|
},
|
|
126
|
-
onMouseLeave: () =>
|
|
126
|
+
onMouseLeave: () => i && u(null),
|
|
127
127
|
children: [
|
|
128
128
|
/* @__PURE__ */ b(
|
|
129
129
|
"button",
|
|
130
130
|
{
|
|
131
131
|
className: `nice-top-menu__btn ${e.key === N ? "nice-top-menu__btn--active" : ""}`,
|
|
132
|
-
onClick: () =>
|
|
133
|
-
onKeyDown: (
|
|
134
|
-
const d =
|
|
135
|
-
|
|
132
|
+
onClick: () => i ? s ? u(null) : a(e.key) : t?.(e),
|
|
133
|
+
onKeyDown: (c) => {
|
|
134
|
+
const d = c.nativeEvent.niceSource;
|
|
135
|
+
i && c.key === "ArrowDown" && d !== "gamepad" && (c.preventDefault(), a(e.key));
|
|
136
136
|
},
|
|
137
137
|
role: "menuitem",
|
|
138
|
-
"aria-haspopup":
|
|
138
|
+
"aria-haspopup": i,
|
|
139
139
|
"aria-expanded": s,
|
|
140
140
|
disabled: e.disabled,
|
|
141
141
|
type: "button",
|
|
142
142
|
children: [
|
|
143
143
|
e.icon && /* @__PURE__ */ n("span", { children: e.icon }),
|
|
144
144
|
/* @__PURE__ */ n("span", { children: e.text }),
|
|
145
|
-
|
|
145
|
+
i && /* @__PURE__ */ n("span", { className: "nice-top-menu__chevron", children: /* @__PURE__ */ n(E, { name: "chevron-down", size: 14 }) })
|
|
146
146
|
]
|
|
147
147
|
}
|
|
148
148
|
),
|
|
149
|
-
|
|
149
|
+
i && s && /* @__PURE__ */ n(
|
|
150
150
|
"ul",
|
|
151
151
|
{
|
|
152
152
|
className: "nice-top-menu__dropdown",
|
|
153
153
|
role: "menu",
|
|
154
154
|
ref: _,
|
|
155
155
|
onKeyDown: r,
|
|
156
|
-
children: e.children.map((
|
|
156
|
+
children: e.children.map((c) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ b(
|
|
157
157
|
"button",
|
|
158
158
|
{
|
|
159
|
-
className: `nice-top-menu__dropdown-btn ${
|
|
159
|
+
className: `nice-top-menu__dropdown-btn ${c.key === N ? "nice-top-menu__dropdown-btn--active" : ""}`,
|
|
160
160
|
onClick: () => {
|
|
161
|
-
t?.(
|
|
161
|
+
t?.(c), u(null);
|
|
162
162
|
},
|
|
163
|
-
disabled:
|
|
163
|
+
disabled: c.disabled,
|
|
164
164
|
role: "menuitem",
|
|
165
165
|
type: "button",
|
|
166
166
|
children: [
|
|
167
|
-
|
|
168
|
-
/* @__PURE__ */ n("span", { children:
|
|
169
|
-
|
|
167
|
+
c.icon && /* @__PURE__ */ n("span", { children: c.icon }),
|
|
168
|
+
/* @__PURE__ */ n("span", { children: c.text }),
|
|
169
|
+
c.badge !== void 0 && /* @__PURE__ */ n("span", { className: "nice-top-menu__badge", children: c.badge })
|
|
170
170
|
]
|
|
171
171
|
}
|
|
172
|
-
) },
|
|
172
|
+
) }, c.key))
|
|
173
173
|
}
|
|
174
174
|
)
|
|
175
175
|
]
|
|
@@ -184,8 +184,8 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
184
184
|
}
|
|
185
185
|
),
|
|
186
186
|
{ displayName: "NiceTopMenu" }
|
|
187
|
-
), Z = [],
|
|
188
|
-
/* @__PURE__ */
|
|
187
|
+
), Z = [], ie = /* @__PURE__ */ Object.assign(
|
|
188
|
+
/* @__PURE__ */ P(
|
|
189
189
|
({
|
|
190
190
|
tabs: m = Z,
|
|
191
191
|
activeTab: N,
|
|
@@ -201,8 +201,8 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
201
201
|
...S
|
|
202
202
|
}, $) => {
|
|
203
203
|
const M = R(null);
|
|
204
|
-
|
|
205
|
-
const C = T(p), u =
|
|
204
|
+
L(M, { orientation: "horizontal", wrap: !0, activateOnMove: !0 });
|
|
205
|
+
const C = T(p), u = B(x, p), { t: k } = j(), [w, f] = I(void 0), _ = N ?? w ?? m[0]?.key, a = m.find((e) => e.key === _), r = z(
|
|
206
206
|
(e) => {
|
|
207
207
|
f(e), t?.(e);
|
|
208
208
|
},
|
|
@@ -241,7 +241,7 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
241
241
|
}
|
|
242
242
|
)
|
|
243
243
|
] }),
|
|
244
|
-
!o && a && /* @__PURE__ */ n("div", { className: "nice-ribbon-menu__panel", role: "tabpanel", children: a.groups.map((e,
|
|
244
|
+
!o && a && /* @__PURE__ */ n("div", { className: "nice-ribbon-menu__panel", role: "tabpanel", children: a.groups.map((e, i) => /* @__PURE__ */ b("div", { className: "nice-ribbon-menu__group", children: [
|
|
245
245
|
/* @__PURE__ */ n("div", { className: "nice-ribbon-menu__group-items", children: e.items.map((s) => /* @__PURE__ */ b(
|
|
246
246
|
"button",
|
|
247
247
|
{
|
|
@@ -257,15 +257,15 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
257
257
|
s.key
|
|
258
258
|
)) }),
|
|
259
259
|
/* @__PURE__ */ n("div", { className: "nice-ribbon-menu__group-label", children: e.label })
|
|
260
|
-
] },
|
|
260
|
+
] }, i)) })
|
|
261
261
|
]
|
|
262
262
|
}
|
|
263
263
|
);
|
|
264
264
|
}
|
|
265
265
|
),
|
|
266
266
|
{ displayName: "NiceRibbonMenu" }
|
|
267
|
-
),
|
|
268
|
-
/* @__PURE__ */
|
|
267
|
+
), ce = /* @__PURE__ */ Object.assign(
|
|
268
|
+
/* @__PURE__ */ P(
|
|
269
269
|
({
|
|
270
270
|
items: m = F,
|
|
271
271
|
activeKey: N,
|
|
@@ -280,7 +280,7 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
280
280
|
accessMode: x,
|
|
281
281
|
...S
|
|
282
282
|
}, $) => {
|
|
283
|
-
const M = T(p), C =
|
|
283
|
+
const M = T(p), C = B(x, p), [u, k] = I(!1), [w, f] = I(!1), _ = !o || u || w;
|
|
284
284
|
return C === "hidden" ? null : /* @__PURE__ */ n(
|
|
285
285
|
"div",
|
|
286
286
|
{
|
|
@@ -318,7 +318,7 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
318
318
|
),
|
|
319
319
|
{ displayName: "NiceDockMenu" }
|
|
320
320
|
), te = /* @__PURE__ */ Object.assign(
|
|
321
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ P(
|
|
322
322
|
({
|
|
323
323
|
items: m = F,
|
|
324
324
|
activeKey: N,
|
|
@@ -336,20 +336,20 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
336
336
|
accessMode: M,
|
|
337
337
|
...C
|
|
338
338
|
}, u) => {
|
|
339
|
-
const k = T($), w =
|
|
339
|
+
const k = T($), w = B(M, $), { t: f } = j(), [_, a] = I(!1), r = v ?? _, e = z(
|
|
340
340
|
(h) => {
|
|
341
341
|
a(h), o?.(h);
|
|
342
342
|
},
|
|
343
343
|
[o]
|
|
344
|
-
),
|
|
344
|
+
), i = z(() => e(!r), [r, e]), s = z(
|
|
345
345
|
(h) => {
|
|
346
346
|
t?.(h), e(!1);
|
|
347
347
|
},
|
|
348
348
|
[t, e]
|
|
349
|
-
),
|
|
349
|
+
), c = R(null), d = R(null), A = R(null);
|
|
350
350
|
return Q(() => {
|
|
351
351
|
A.current?.toggleAttribute("inert", !r);
|
|
352
|
-
}, [r]),
|
|
352
|
+
}, [r]), J(c, d, {
|
|
353
353
|
open: r,
|
|
354
354
|
onOpenChange: e,
|
|
355
355
|
closeOnFocusOut: !1,
|
|
@@ -366,9 +366,9 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
366
366
|
/* @__PURE__ */ n(
|
|
367
367
|
"button",
|
|
368
368
|
{
|
|
369
|
-
ref:
|
|
369
|
+
ref: c,
|
|
370
370
|
className: "nice-hamburger-menu__trigger",
|
|
371
|
-
onClick:
|
|
371
|
+
onClick: i,
|
|
372
372
|
"aria-label": f("nav.menu", "Menu"),
|
|
373
373
|
"aria-haspopup": "menu",
|
|
374
374
|
"aria-expanded": r,
|
|
@@ -386,7 +386,7 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
386
386
|
)
|
|
387
387
|
}
|
|
388
388
|
),
|
|
389
|
-
r && /* @__PURE__ */ n("div", { className: "nice-hamburger-menu__backdrop", onClick:
|
|
389
|
+
r && /* @__PURE__ */ n("div", { className: "nice-hamburger-menu__backdrop", onClick: i, "aria-hidden": !0 }),
|
|
390
390
|
/* @__PURE__ */ b(
|
|
391
391
|
"div",
|
|
392
392
|
{
|
|
@@ -421,7 +421,7 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
421
421
|
),
|
|
422
422
|
{ displayName: "NiceHamburgerMenu" }
|
|
423
423
|
), oe = /* @__PURE__ */ Object.assign(
|
|
424
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ P(
|
|
425
425
|
({
|
|
426
426
|
canGoBack: m = !1,
|
|
427
427
|
canGoForward: N = !1,
|
|
@@ -446,8 +446,8 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
446
446
|
accessMode: a,
|
|
447
447
|
disabled: r,
|
|
448
448
|
...e
|
|
449
|
-
},
|
|
450
|
-
const s = T(_),
|
|
449
|
+
}, i) => {
|
|
450
|
+
const s = T(_), c = B(a, _), { t: d } = j();
|
|
451
451
|
if (X(() => {
|
|
452
452
|
if (!y || r)
|
|
453
453
|
return;
|
|
@@ -466,13 +466,13 @@ const F = [], ae = /* @__PURE__ */ Object.assign(
|
|
|
466
466
|
v,
|
|
467
467
|
o,
|
|
468
468
|
p
|
|
469
|
-
]),
|
|
469
|
+
]), c === "hidden")
|
|
470
470
|
return null;
|
|
471
|
-
const A =
|
|
471
|
+
const A = c === "disabled" || r, h = M ?? /* @__PURE__ */ n(E, { name: "chevron-left", size: 16 }), H = C ?? /* @__PURE__ */ n(E, { name: "chevron-right", size: 16 }), q = u ?? /* @__PURE__ */ n(E, { name: "refresh", size: 16 }), U = k ?? /* @__PURE__ */ n(E, { name: "close", size: 16 });
|
|
472
472
|
return /* @__PURE__ */ b(
|
|
473
473
|
"div",
|
|
474
474
|
{
|
|
475
|
-
ref:
|
|
475
|
+
ref: i,
|
|
476
476
|
id: s,
|
|
477
477
|
className: `nice-nav-controls nice-nav-controls--${x} nice-nav-controls--${S}${A ? " nice-nav-controls--disabled" : ""}${w ? ` ${w}` : ""}`,
|
|
478
478
|
style: f,
|
|
@@ -552,7 +552,7 @@ export {
|
|
|
552
552
|
$e as NiceDashboardShell,
|
|
553
553
|
Me as NiceDesktop,
|
|
554
554
|
Ce as NiceDock,
|
|
555
|
-
|
|
555
|
+
ce as NiceDockMenu,
|
|
556
556
|
De as NiceDynamicSidebar,
|
|
557
557
|
te as NiceHamburgerMenu,
|
|
558
558
|
xe as NiceHybridShell,
|
|
@@ -563,21 +563,24 @@ export {
|
|
|
563
563
|
Ie as NiceModeSelector,
|
|
564
564
|
Re as NiceModernShell,
|
|
565
565
|
Te as NiceModuleLifecyclePanel,
|
|
566
|
-
|
|
567
|
-
|
|
566
|
+
Be as NiceNavMenu,
|
|
567
|
+
Pe as NiceNavbar,
|
|
568
568
|
oe as NiceNavigationControls,
|
|
569
|
-
|
|
570
|
-
|
|
569
|
+
ze as NiceOrganizationProfileForm,
|
|
570
|
+
Ge as NicePagination,
|
|
571
571
|
Fe as NicePwaShell,
|
|
572
|
-
|
|
573
|
-
|
|
572
|
+
ie as NiceRibbonMenu,
|
|
573
|
+
Le as NiceSetupWizard,
|
|
574
574
|
ae as NiceSidebarMenu,
|
|
575
|
-
|
|
575
|
+
je as NiceSidebarNav,
|
|
576
576
|
Ke as NiceSplitter,
|
|
577
|
-
|
|
577
|
+
Xe as NiceTabs,
|
|
578
578
|
se as NiceTopMenu,
|
|
579
579
|
We as NiceUserMenu,
|
|
580
580
|
He as NiceWizard,
|
|
581
581
|
qe as SIDEBAR_MODE_META,
|
|
582
|
-
Ue as
|
|
582
|
+
Ue as findSidebarItemByRoute,
|
|
583
|
+
Ve as mapSidebarViews,
|
|
584
|
+
Je as sidebarModeLabel,
|
|
585
|
+
Ye as walkSidebarNav
|
|
583
586
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),d=require("@nice2dev/ui-core"),m=require("react"),B=require("./vendor-Bo2Q64AF.cjs"),H=[],K=({tabs:f=H,activeTab:i,onChange:r,variant:u="default",vertical:s,size:c="md",iconOnly:n=!1,centered:o="auto",countLocation:l="right",showHints:x,id:p,className:v,style:e,displayStyle:g})=>{const{t:h}=d.useNiceTranslation(),b=d.useControlId(p),N=o==="auto"?n:o,k=d.useComponentDisplayStyle("tab",g),T=d.useComponentDisplayClass("tab",g),[A,C]=m.useState(i||f[0]?.id),M=i??A,y=m.useRef(null),S=m.useRef(null),[E]=d.useInputPreferences(),_=d.useHintsVisible(),$=m.useCallback(a=>{C(a),r?.(a)},[r]);d.useRovingFocus(S,{orientation:s?"vertical":"horizontal",wrap:!0,onMove:a=>{const w=a.getAttribute("data-tab-id");w&&$(w)}}),d.useIntent(["sectionPrev","sectionNext"],a=>{const w=f.filter(j=>!j.disabled);if(w.length<2)return!1;const G=w.findIndex(j=>j.id===M),P=a.intent==="sectionNext"?1:-1,D=w[(G+P+w.length)%w.length];return $(D.id),[...S.current?.querySelectorAll("[data-tab-id]")??[]].find(j=>j.getAttribute("data-tab-id")===D.id)?.focus(),!0},{ref:y}),d.useInputHints(y,f.length>1?[{intent:"sectionPrev",label:h("input.intent.sectionPrev","Previous section")},{intent:"sectionNext",label:h("input.intent.sectionNext","Next section")}]:[]);const R=f.length>1&&_&&(x??E.hintDensity==="bar-and-controls"),L=f.find(a=>a.id===M)?.content;return t.jsxs("div",{ref:y,className:`nice-tabs nice-tabs--${c} ${s?"nice-tabs--vertical":""} ${n?"nice-tabs--icon-only":""} nice-tabs--ds-${T} ${v||""}`,style:{...k,...e},children:[t.jsxs("div",{ref:S,className:`nice-tabs__list ${u!=="default"?`nice-tabs__list--${u}`:""} ${s?"nice-tabs__list--vertical":""} ${N?"nice-tabs__list--centered":""}`,role:"tablist","aria-orientation":s?"vertical":"horizontal",children:[R&&t.jsx("span",{className:"nice-tabs__hint","aria-hidden":"true",children:t.jsx(d.NiceButtonPrompt,{intent:"sectionPrev",size:"sm"})}),f.map(a=>t.jsxs("button",{type:"button",role:"tab",id:`${b}-tab-${a.id}`,"data-tab-id":a.id,"aria-selected":M===a.id,"aria-controls":`${b}-panel`,"aria-label":n?a.label:void 0,title:n?a.label:void 0,className:`nice-tabs__tab ${M===a.id?"nice-tabs__tab--active":""} ${a.disabled?"nice-tabs__tab--disabled":""} ${l==="bottom"?"nice-tabs__tab--count-bottom":""}`,disabled:a.disabled,onClick:()=>$(a.id),children:[a.icon,!n&&t.jsx("span",{children:a.label}),a.badge!==void 0&&t.jsx("span",{className:`nice-tabs__badge${l==="bottom"?" nice-tabs__badge--pill":""}`,children:a.badge})]},a.id)),R&&t.jsx("span",{className:"nice-tabs__hint","aria-hidden":"true",children:t.jsx(d.NiceButtonPrompt,{intent:"sectionNext",size:"sm"})})]}),t.jsx("div",{className:"nice-tabs__panel",role:"tabpanel",id:`${b}-panel`,"aria-labelledby":M?`${b}-tab-${M}`:void 0,children:L})]})};function U(f,{open:i,onSelect:r,onClose:u,onOpen:s,loop:c=!1,pageSize:n=10,intentRef:o}){const[l,x]=m.useState(0);m.useEffect(()=>{x(e=>f.length===0?0:Math.min(Math.max(e,0),f.length-1))},[f.length]);const p=m.useCallback((e,g)=>x(h=>{const b=f.length;if(b===0)return 0;const N=e(h);return g?(N%b+b)%b:Math.min(Math.max(N,0),b-1)}),[f.length]),v=m.useCallback(e=>{if(!i){(e.key==="ArrowDown"||e.key==="ArrowUp")&&(e.preventDefault(),s?.());return}const g=e.target instanceof HTMLTextAreaElement||e.target instanceof HTMLInputElement&&e.target.type!=="checkbox";if(e.key==="ArrowDown")e.preventDefault(),p(h=>h+1,c);else if(e.key==="ArrowUp")e.preventDefault(),p(h=>h-1,c);else if(e.key==="PageDown")e.preventDefault(),p(h=>h+n,!1);else if(e.key==="PageUp")e.preventDefault(),p(h=>h-n,!1);else if(!g&&(e.key==="Home"||e.key==="End"))e.preventDefault(),p(()=>e.key==="Home"?0:f.length-1,!1);else if(e.key==="Enter"){const h=f[l];h!==void 0&&(e.preventDefault(),r(h,l))}else e.key==="Escape"&&u?.()},[i,f,l,c,n,p,r,u,s]);return d.useIntent(["navigate","activate"],e=>{if(e.source==="keyboard")return!1;if(e.intent==="activate"){const g=f[l];if(g===void 0)return!1;r(g,l);return}if(e.direction!=="up"&&e.direction!=="down")return!1;p(g=>g+(e.direction==="down"?1:-1),c)},{ref:o,enabled:i&&!!o}),{activeIndex:l,setActiveIndex:x,handleKeyDown:v}}const F=Object.assign(m.forwardRef(({label:f,checked:i=!1,onChange:r,disabled:u,readOnly:s,loading:c,required:n,size:o="md",name:l,id:x,className:p,style:v,accessMode:e,displayStyle:g,showKeyboardHints:h,error:b,helperText:N,labelPlacement:k,errorPlacement:T,labelWidth:A,controlWidth:C},M)=>{const y=d.useNiceAccessMode(e,x),S=y==="hidden";(y==="disabled"||y==="readOnly")&&(u=!0);const{t:E}=d.useNiceTranslation(),_=d.useControlId(x);d.useComponentDisplayStyle("toggle",g);const $=d.useComponentDisplayClass("toggle",g),R=m.useMemo(()=>[{key:"Space",description:E("shortcuts.toggle","Toggle on/off")}],[E]);return S?null:t.jsxs("div",{className:`nice-field nice-field--inline nice-field--${o} ${k==="left"?"nice-field--label-left":""} ${c?"nice-field--loading":""} ${p||""}`,style:{...v,...A!=null&&{"--nice-field-label-width":typeof A=="number"?`${A}px`:A},...C!=null&&{"--nice-field-control-width":typeof C=="number"?`${C}px`:C}},"aria-busy":c||void 0,children:[k==="left"&&f&&t.jsx("span",{className:`nice-field__label ${n?"nice-field__label--required":""}`,children:f}),t.jsxs("div",{className:"nice-field__control",children:[t.jsxs("label",{className:`nice-toggle nice-toggle--ds-${$} ${o!=="md"?`nice-toggle--${o}`:""} ${u||c?"nice-toggle--disabled":""}`,htmlFor:_,children:[t.jsx("input",{ref:M,id:_,type:"checkbox",className:"nice-toggle__input",name:l,checked:i,disabled:u||c,readOnly:s,role:"switch","aria-checked":i,"aria-invalid":!!b,onChange:L=>{s||c||r?.(L.target.checked)}}),t.jsx("span",{className:"nice-toggle__track",children:t.jsx("span",{className:"nice-toggle__thumb"})}),k!=="left"&&f&&t.jsx("span",{children:f}),h&&t.jsx(d.NiceKeyboardHint,{shortcuts:R,size:"sm"})]}),c&&t.jsx("span",{className:"nice-field__spinner",children:t.jsx("span",{className:"nice-spinner nice-spinner--sm"})}),T==="right"&&b&&t.jsx("div",{id:`${_}-error`,className:"nice-field__error",role:"alert",children:b}),T==="right"&&!b&&N&&t.jsx("div",{id:`${_}-helper`,className:"nice-field__helper",children:N})]}),T!=="right"&&b&&t.jsx("div",{id:`${_}-error`,className:"nice-field__error",role:"alert",children:b}),T!=="right"&&!b&&N&&t.jsx("div",{id:`${_}-helper`,className:"nice-field__helper",children:N})]})}),{displayName:"NiceToggle"}),Z=Object.freeze({AR:["#74acdf","#ffffff","#74acdf"],AT:["#ed2939","#ffffff","#ed2939"],AU:["#012169","#ffffff","#e4002b"],BE:["#000000","#fae042","#ed2939"],BR:["#009c3b","#ffdf00","#002776"],CA:["#ff0000","#ffffff","#ff0000"],CH:["#d52b1e","#ffffff","#d52b1e"],CN:["#de2910","#ffde00","#de2910"],CZ:["#11457e","#ffffff","#d7141a"],DE:["#000000","#dd0000","#ffce00"],DK:["#c8102e","#ffffff","#c8102e"],EE:["#0072ce","#000000","#ffffff"],EG:["#ce1126","#ffffff","#000000"],ES:["#aa151b","#f1bf00","#aa151b"],FI:["#ffffff","#003580","#ffffff"],FR:["#0055a4","#ffffff","#ef4135"],GB:["#012169","#ffffff","#c8102e"],GR:["#0d5eaf","#ffffff","#0d5eaf"],HR:["#171796","#ffffff","#ff0000"],HU:["#ce2939","#ffffff","#477050"],IE:["#169b62","#ffffff","#ff883e"],IL:["#ffffff","#0038b8","#ffffff"],IN:["#ff9933","#ffffff","#138808"],IS:["#02529c","#ffffff","#dc1e35"],IT:["#009246","#ffffff","#ce2b37"],JP:["#ffffff","#bc002d","#ffffff"],KR:["#ffffff","#cd2e3a","#0047a0"],LT:["#fdb913","#006a44","#c1272d"],LU:["#ed2939","#ffffff","#00a1de"],LV:["#9e3039","#ffffff","#9e3039"],MX:["#006847","#ffffff","#ce1126"],NL:["#ae1c28","#ffffff","#21468b"],NO:["#ef2b2d","#ffffff","#002868"],NZ:["#012169","#ffffff","#cc142b"],PL:["#ffffff","#dc143c"],PT:["#006600","#ff0000"],RO:["#002b7f","#fcd116","#ce1126"],RU:["#ffffff","#0039a6","#d52b1e"],SE:["#006aa7","#fecc00","#006aa7"],SK:["#ffffff","#0b4ea2","#ee1c25"],TR:["#e30a17","#ffffff","#e30a17"],UA:["#005bbb","#ffd500"],US:["#b22234","#ffffff","#3c3b6e"],VN:["#da251d","#ffff00","#da251d"],ZA:["#007a4d","#ffffff","#de3831"],AD:["#10069f","#fedf00","#d50032"],AE:["#00732f","#ffffff","#000000"],AF:["#000000","#d32011","#007a36"],AG:["#ce1126","#fcd116","#000000"],AL:["#e41e20","#000000","#e41e20"],AM:["#d90012","#0033a0","#f2a800"],AO:["#ce1126","#000000","#ffc500"],AZ:["#0092bc","#ed2939","#509e2f"],BA:["#002395","#fecb00","#ffffff"],BB:["#00267f","#ffc726","#00267f"],BD:["#006a4e","#f42a41","#006a4e"],BF:["#ef2b2d","#009e49","#fcd116"],BG:["#ffffff","#00966e","#d62612"],BH:["#ffffff","#ce1126","#ce1126"],BI:["#1eb53a","#ffffff","#ce1126"],BJ:["#008751","#fcd116","#e8112d"],BN:["#f7e017","#ffffff","#000000"],BO:["#d52b1e","#f9e300","#007934"],BS:["#00778b","#ffc72c","#000000"],BT:["#ffcc33","#ff4e12","#ffcc33"],BW:["#75aadb","#ffffff","#000000"],BY:["#c8313e","#007c30","#ffffff"],BZ:["#003f87","#ce1126","#003f87"],CD:["#007fff","#f7d618","#ce1021"],CF:["#003082","#ffffff","#289728"],CG:["#009543","#fbde4a","#dc241f"],CI:["#f77f00","#ffffff","#009e60"],CM:["#007a5e","#ce1126","#fcd116"],CO:["#fcd116","#003893","#ce1126"],CR:["#002b7f","#ffffff","#ce1126"],CU:["#002590","#ffffff","#cf142b"],CV:["#003893","#ffffff","#cf2027"],CY:["#ffffff","#d57800","#ffffff"],DJ:["#6ab2e7","#ffffff","#12ad2b"],DM:["#006b3f","#ffffff","#000000"],DO:["#002d62","#ffffff","#ce1126"],DZ:["#006233","#ffffff","#d21034"],EC:["#ffd100","#034ea2","#ed1c24"],ER:["#ea0437","#0084c9","#418fde"],ET:["#078930","#fcdd09","#da121a"],FJ:["#68bfe5","#cc0000","#ffffff"],GA:["#3a75c4","#ffe700","#009e60"],GD:["#ce1126","#fcd116","#007a5e"],GE:["#ffffff","#ff0000","#ffffff"],GH:["#ce1126","#fcd116","#006b3f"],GM:["#ce1126","#ffffff","#0c1c8c"],GN:["#ce1126","#fcd116","#009460"],GQ:["#3e9a00","#ffffff","#e32118"],GT:["#4997d0","#ffffff","#4997d0"],GW:["#ce1126","#fcd116","#009e49"],GY:["#009e49","#ffffff","#fcd116"],HK:["#de2910","#ffffff","#de2910"],HN:["#0073cf","#ffffff","#0073cf"],HT:["#00209f","#d21034","#00209f"],ID:["#ff0000","#ffffff","#ff0000"],IQ:["#ce1126","#ffffff","#000000"],IR:["#239f40","#ffffff","#da0000"],JM:["#000000","#fed100","#009b3a"],JO:["#000000","#ffffff","#007a3d"],KE:["#000000","#bb0000","#006600"],KG:["#ff0000","#fcd116","#ff0000"],KH:["#032ea1","#e00025","#032ea1"],KM:["#fcd116","#ffffff","#ce1126"],KP:["#024fa2","#ed1c27","#024fa2"],KW:["#007a3d","#ffffff","#ce1126"],KZ:["#00afca","#fec50c","#00afca"],LA:["#ce1126","#002868","#ce1126"],LB:["#ed1c24","#ffffff","#ed1c24"],LI:["#002780","#ce1126","#002780"],LK:["#ffbe29","#8d153a","#00534e"],LR:["#bf0a30","#ffffff","#002868"],LS:["#00209f","#ffffff","#009543"],LY:["#e70013","#000000","#239e46"],MA:["#c1272d","#006233","#c1272d"],MD:["#0046ae","#ffd200","#cc092f"],ME:["#d4af37","#cc0033","#d4af37"],MG:["#ffffff","#fc3d32","#007e3a"],MH:["#003893","#dd7500","#ffffff"],MK:["#d20000","#ffe600","#d20000"],ML:["#14b53a","#fcd116","#ce1126"],MM:["#fecb00","#34b233","#ea2839"],MN:["#c4272f","#015197","#c4272f"],MO:["#00785a","#ffd700","#ffffff"],MR:["#006233","#ffc400","#d01c1f"],MT:["#ffffff","#cf142b","#ffffff"],MU:["#ea2839","#1a206d","#00a04d"],MV:["#d21034","#007e3a","#ffffff"],MW:["#000000","#ce1126","#339e35"],MY:["#cc0000","#ffffff","#010066"],MZ:["#009a44","#ffffff","#000000"],NA:["#003580","#ffffff","#009543"],NE:["#ff8000","#ffffff","#0db02b"],NG:["#008753","#ffffff","#008753"],NI:["#0067c6","#ffffff","#0067c6"],NP:["#dc143c","#003893","#dc143c"],OM:["#dc241f","#ffffff","#008000"],PA:["#ffffff","#cc0033","#005aa7"],PE:["#d91023","#ffffff","#d91023"],PG:["#ce1126","#000000","#fcd116"],PH:["#0038a8","#ffffff","#ce1126"],PK:["#ffffff","#01411c","#01411c"],PS:["#000000","#ffffff","#007a3d"],PY:["#d52b1e","#ffffff","#0038a8"],QA:["#ffffff","#8a1538","#8a1538"],RS:["#c6363c","#0c4076","#ffffff"],RW:["#00a1de","#fad201","#00a651"],SA:["#006c35","#ffffff","#006c35"],SB:["#0051ba","#fcd116","#215b33"],SC:["#003f87","#fcd116","#d62828"],SD:["#d21034","#ffffff","#000000"],SG:["#ed2939","#ffffff","#ed2939"],SI:["#ffffff","#0000ff","#ff0000"],SL:["#1eb53a","#ffffff","#0072c6"],SM:["#ffffff","#5eb6e4","#ffffff"],SN:["#00853f","#fdef42","#e31b23"],SO:["#4189dd","#ffffff","#4189dd"],SR:["#377e3f","#ffffff","#b40a2d"],SS:["#000000","#ce1126","#078930"],ST:["#12ad2b","#ffce00","#d21034"],SV:["#0047ab","#ffffff","#0047ab"],SY:["#ce1126","#ffffff","#000000"],SZ:["#3e5eb9","#ffd900","#b10c0c"],TD:["#002664","#fecb00","#c60c30"],TG:["#006a4e","#fcd116","#d21034"],TH:["#ed1c24","#ffffff","#241d4f"],TJ:["#cc0000","#ffffff","#006600"],TL:["#dc241f","#ffc726","#000000"],TM:["#00853e","#ffffff","#cc0000"],TN:["#e70013","#ffffff","#e70013"],TO:["#ffffff","#c10000","#c10000"],TT:["#ce1126","#ffffff","#000000"],TW:["#fe0000","#000095","#fe0000"],TZ:["#1eb53a","#fcd116","#00a3dd"],UG:["#000000","#fcdc04","#d90000"],UY:["#ffffff","#0038a8","#ffffff"],UZ:["#1eb53a","#ffffff","#0099b5"],VA:["#ffe000","#ffffff","#ffe000"],VE:["#fcd116","#00247d","#cf142b"],VU:["#000000","#ce1126","#009543"],WS:["#002b7f","#ffffff","#cc0033"],YE:["#ce1126","#ffffff","#000000"],ZM:["#198a00","#de2010","#ef7d00"],ZW:["#078930","#fcd116","#cf2027"]}),I=["#cbd5e1","#94a3b8","#cbd5e1"];function V(f){return f?Z[f.toUpperCase()]??I:I}const Y=B.Flags3x2,O=({code:f,size:i=22,className:r})=>{const{t:u}=d.useNiceTranslation(),s=f?.toUpperCase(),c=s?Y[s]:void 0,n=i,o=Math.round(i*2/3);return c?t.jsx("span",{className:r,role:"img","aria-label":u("pickerCommons.flag","{upper} flag").replace("{upper}",String(s)),style:{display:"inline-block",width:n,height:o,boxSizing:"content-box",border:"1px solid var(--nice-overlay-15, rgba(0, 0, 0, 0.15))",borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle",lineHeight:0},dangerouslySetInnerHTML:{__html:c.replace("<svg ",`<svg width="${n}" height="${o}" preserveAspectRatio="xMidYMid slice" `)}}):t.jsx(J,{code:f,size:i,className:r})},J=({code:f,size:i=18,className:r})=>{const{t:u}=d.useNiceTranslation(),s=V(f);return t.jsx("span",{className:r,role:"img","aria-label":u("pickerCommons.flag2","{code} flag").replace("{code}",String(f)),style:{display:"inline-flex",width:i,height:Math.round(i*.7),boxSizing:"content-box",border:"1px solid var(--nice-overlay-15, rgba(0, 0, 0, 0.15))",borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:s.map((c,n)=>t.jsx("span",{style:{flex:1,background:c}},n))})};function q(f,i,r,u=280){const[s,c]=m.useState(r==="left"?"left":"right"),n=m.useCallback(()=>{if(r!=="auto"){c(r);return}const o=i.current;if(!o||typeof window>"u")return;const l=o.getBoundingClientRect(),p=window.innerWidth-l.left,v=l.right;p>=u&&p>v?c("left"):c("right")},[r,i,u]);return m.useEffect(()=>{if(f)return n(),window.addEventListener("resize",n),window.addEventListener("scroll",n,!0),()=>{window.removeEventListener("resize",n),window.removeEventListener("scroll",n,!0)}},[f,n]),s}const W=({colors:f,size:i=28,shape:r="page",className:u})=>{const{t:s}=d.useNiceTranslation(),c=i,n=Math.round(i*.75),o=f.border??"color-mix(in srgb, currentColor 30%, transparent)";if(r==="swatch"){const h=[f.primary,f.background,f.backgroundSecondary??f.background,f.textColor];return t.jsx("span",{className:u,role:"img","aria-label":s("pickerCommons.themePreview","Theme preview"),style:{display:"inline-flex",width:c,height:n,border:`1px solid ${o}`,borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:h.map((b,N)=>t.jsx("span",{style:{flex:1,background:b}},N))})}const l=Math.max(2,Math.round(n*.17)),x=Math.max(2,Math.round(c*.14)),p=c-x*2,v=Math.max(2,Math.round(p*.16)),e=Math.max(1,Math.round(n*.07)),g=n-l;return t.jsxs("span",{className:u,role:"img","aria-label":s("pickerCommons.themePreview","Theme preview"),style:{position:"relative",display:"inline-block",width:c,height:n,boxSizing:"content-box",background:f.backgroundSecondary??f.background,border:`1px solid ${o}`,borderRadius:2,overflow:"hidden",flexShrink:0,verticalAlign:"middle"},children:[t.jsx("span",{style:{position:"absolute",top:0,left:0,right:0,height:l,background:f.primary}}),t.jsx("span",{style:{position:"absolute",top:l,bottom:0,left:x,right:x,background:f.background,borderLeft:`1px solid ${o}`,borderRight:`1px solid ${o}`}}),t.jsx("span",{style:{position:"absolute",top:l+Math.round(g*.28),left:x+v,right:x+v,height:e,background:f.textColor}}),t.jsx("span",{style:{position:"absolute",top:l+Math.round(g*.55),left:x+v,width:Math.max(3,Math.round((p-v*2)*.6)),height:e,background:f.textColor}})]})};exports.FlagIcon=O;exports.NiceTabs=K;exports.NiceToggle=F;exports.ThemePreviewSwatch=W;exports.useDropdownAlignment=q;exports.useListKeyboardNav=U;
|