@nice2dev/ui 1.3.1 → 1.3.3
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 +85 -0
- package/dist/NiceModuleLifecyclePanel-Bk5MXMVu.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-DIYT_O2m.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-DmdqTQjn.js +7361 -0
- package/dist/NiceModuleLifecyclePanel-M-LNxTvd.js +7373 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/index.cjs +215 -215
- package/dist/index.css +1 -1
- package/dist/index.d.ts +177 -21
- package/dist/index.mjs +11525 -11463
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +135 -16
- package/dist/navigation.mjs +74 -71
- package/dist/style.css +2 -2
- 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-M-LNxTvd.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
|
};
|