@nice2dev/ui 1.3.17 → 1.3.18

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.
Files changed (31) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/README.md +2 -2
  3. package/dist/{NiceDataGrid-aNPAHsWy.cjs → NiceDataGrid-CFibAGHt.cjs} +1 -1
  4. package/dist/NiceForm-ChRj4r3f.cjs +1 -0
  5. package/dist/{NiceMention-CMqAGvO0.cjs → NiceMention-DNx3d9L7.cjs} +1 -1
  6. package/dist/NiceModuleLifecyclePanel-D8Q081R6.cjs +1 -0
  7. package/dist/{NiceSavedQueryPanel-JHrSlHAV.cjs → NiceSavedQueryPanel-BuRAgrBk.cjs} +1 -1
  8. package/dist/{NiceScheduler-2TwOZq-y.cjs → NiceScheduler-DAoo1eyo.cjs} +1 -1
  9. package/dist/{core-lazy-Cda-D35m.cjs → core-lazy-DohJQ33c.cjs} +1 -1
  10. package/dist/data/treeDragSession.mjs +52 -46
  11. package/dist/data.cjs +1 -1
  12. package/dist/editors/inputs/NiceAutocomplete.mjs +44 -46
  13. package/dist/editors/pickers/NiceDateTimePicker.mjs +1 -1
  14. package/dist/editors.cjs +1 -1
  15. package/dist/index.cjs +113 -113
  16. package/dist/index.d.ts +111 -21
  17. package/dist/index.mjs +364 -359
  18. package/dist/navigation/NiceIconRail.mjs +74 -53
  19. package/dist/navigation/NiceNavShell.mjs +855 -807
  20. package/dist/navigation/NiceSetupWizard.mjs +287 -278
  21. package/dist/navigation/NiceSidebarNav.mjs +1487 -1144
  22. package/dist/navigation/navItemDrag.mjs +42 -0
  23. package/dist/navigation/navShellPane.mjs +16 -11
  24. package/dist/navigation/sidebarNavTypes.mjs +1 -0
  25. package/dist/navigation/sidebarSearch.mjs +28 -0
  26. package/dist/navigation.cjs +1 -1
  27. package/dist/navigation.d.ts +63 -21
  28. package/dist/style.css +2 -2
  29. package/package.json +4 -4
  30. package/dist/NiceForm-BtRBLffD.cjs +0 -1
  31. package/dist/NiceModuleLifecyclePanel-ugNtHimh.cjs +0 -1
@@ -1,69 +1,90 @@
1
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
2
- import { useNiceTranslation as g, useNiceAccessMode as R, useRovingFocus as j } from "@nice2dev/ui-core";
3
- import { useRef as x } from "react";
1
+ import { jsx as i, jsxs as t, Fragment as v } from "react/jsx-runtime";
2
+ import { useNiceTranslation as R, useNiceAccessMode as x, useRovingFocus as y } from "@nice2dev/ui-core";
3
+ import { useRef as u } from "react";
4
+ import { createPortal as M } from "react-dom";
5
+ import { NiceContextMenu as j } from "./NiceContextMenu.mjs";
4
6
  /* empty css */
5
- const M = [], y = ({
6
- items: s = M,
7
- orientation: a = "vertical",
8
- activeId: t,
9
- onSelect: d,
10
- "aria-label": b,
11
- size: u = "md",
12
- className: _,
7
+ function C({
8
+ item: e,
9
+ active: n,
10
+ inert: a,
11
+ onSelect: o
12
+ }) {
13
+ const l = u(null);
14
+ return /* @__PURE__ */ t(v, { children: [
15
+ /* @__PURE__ */ t(
16
+ "button",
17
+ {
18
+ ref: l,
19
+ type: "button",
20
+ className: `nice-icon-rail__item${n ? " nice-icon-rail__item--active" : ""}`,
21
+ title: e.title ?? e.label,
22
+ "aria-current": n ? "page" : void 0,
23
+ "aria-haspopup": e.menu?.length ? "menu" : void 0,
24
+ disabled: a || e.disabled,
25
+ onClick: () => {
26
+ e.onClick?.(), o?.(e);
27
+ },
28
+ children: [
29
+ /* @__PURE__ */ t("span", { className: "nice-icon-rail__icon", "aria-hidden": "true", children: [
30
+ e.icon,
31
+ e.badge !== void 0 && e.badge !== "" && /* @__PURE__ */ i("span", { className: "nice-icon-rail__badge", children: e.badge })
32
+ ] }),
33
+ /* @__PURE__ */ i("span", { className: "nice-icon-rail__label", children: e.label })
34
+ ]
35
+ }
36
+ ),
37
+ !!e.menu?.length && !a && typeof document < "u" && M(/* @__PURE__ */ i(j, { target: l, items: e.menu, size: "sm" }), document.body)
38
+ ] });
39
+ }
40
+ const S = [], I = ({
41
+ items: e = S,
42
+ orientation: n = "vertical",
43
+ activeId: a,
44
+ onSelect: o,
45
+ "aria-label": l,
46
+ size: m = "md",
47
+ className: b,
13
48
  style: p,
14
- id: c,
15
- title: h,
16
- accessMode: m,
17
- "data-testid": N
49
+ id: s,
50
+ title: f,
51
+ accessMode: _,
52
+ "data-testid": h
18
53
  }) => {
19
- const { t: f } = g(), e = R(m, c), l = x(null);
20
- if (j(l, { orientation: a, itemSelector: ".nice-icon-rail__item" }), e === "hidden")
54
+ const { t: g } = R(), c = x(_, s), d = u(null);
55
+ if (y(d, { orientation: n, itemSelector: ".nice-icon-rail__item" }), c === "hidden")
21
56
  return null;
22
- const v = e === "disabled" || e === "readOnly";
23
- return /* @__PURE__ */ n(
57
+ const N = c === "disabled" || c === "readOnly";
58
+ return /* @__PURE__ */ i(
24
59
  "div",
25
60
  {
26
- ref: l,
27
- id: c,
28
- title: h,
29
- "data-testid": N,
61
+ ref: d,
62
+ id: s,
63
+ title: f,
64
+ "data-testid": h,
30
65
  role: "toolbar",
31
- "aria-orientation": a,
32
- "aria-label": b ?? f("iconRail.label", "Shortcuts"),
66
+ "aria-orientation": n,
67
+ "aria-label": l ?? g("iconRail.label", "Shortcuts"),
33
68
  className: [
34
69
  "nice-icon-rail",
35
- `nice-icon-rail--${a}`,
36
- `nice-icon-rail--${u}`,
37
- _ ?? ""
70
+ `nice-icon-rail--${n}`,
71
+ `nice-icon-rail--${m}`,
72
+ b ?? ""
38
73
  ].filter(Boolean).join(" "),
39
74
  style: p,
40
- children: s.map((i) => {
41
- const o = i.id === t;
42
- return /* @__PURE__ */ r(
43
- "button",
44
- {
45
- type: "button",
46
- className: `nice-icon-rail__item${o ? " nice-icon-rail__item--active" : ""}`,
47
- title: i.title ?? i.label,
48
- "aria-current": o ? "page" : void 0,
49
- disabled: v || i.disabled,
50
- onClick: () => {
51
- i.onClick?.(), d?.(i);
52
- },
53
- children: [
54
- /* @__PURE__ */ r("span", { className: "nice-icon-rail__icon", "aria-hidden": "true", children: [
55
- i.icon,
56
- i.badge !== void 0 && i.badge !== "" && /* @__PURE__ */ n("span", { className: "nice-icon-rail__badge", children: i.badge })
57
- ] }),
58
- /* @__PURE__ */ n("span", { className: "nice-icon-rail__label", children: i.label })
59
- ]
60
- },
61
- i.id
62
- );
63
- })
75
+ children: e.map((r) => /* @__PURE__ */ i(
76
+ C,
77
+ {
78
+ item: r,
79
+ active: r.id === a,
80
+ inert: N,
81
+ onSelect: o
82
+ },
83
+ r.id
84
+ ))
64
85
  }
65
86
  );
66
87
  };
67
88
  export {
68
- y as NiceIconRail
89
+ I as NiceIconRail
69
90
  };