@nice2dev/ui 1.4.13 → 1.4.15

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 (53) hide show
  1. package/CHANGELOG.md +108 -0
  2. package/dist/{NiceColorPicker-BLwYNSXJ.cjs → NiceColorPicker-79rkvaSk.cjs} +1 -1
  3. package/dist/NiceDataGrid-B1AOjgjm.cjs +10 -0
  4. package/dist/NiceForm-fmePSeA9.cjs +1 -0
  5. package/dist/{NiceHtmlEditor-BzECmDO3.cjs → NiceHtmlEditor-By7R1wRo.cjs} +1 -1
  6. package/dist/{NiceMention-CYRqPKGU.cjs → NiceMention-i7n2BoMw.cjs} +1 -1
  7. package/dist/{NiceModuleLifecyclePanel-CiYbPcHV.cjs → NiceModuleLifecyclePanel-DVHQuhc-.cjs} +1 -1
  8. package/dist/{NicePagination-BAxwqeEd.cjs → NicePagination-D9JguOl0.cjs} +1 -1
  9. package/dist/NicePivotGrid-B_7iQJys.cjs +2 -0
  10. package/dist/NiceSavedQueryPanel-ChY4HwpM.cjs +587 -0
  11. package/dist/{NiceScheduler-BqYiHPvz.cjs → NiceScheduler-B2DamQ_L.cjs} +1 -1
  12. package/dist/backup/NiceBackupScheduler.mjs +171 -119
  13. package/dist/charts/NiceOrganizationChart.mjs +159 -59
  14. package/dist/charts/orgChartExport.mjs +71 -0
  15. package/dist/charts/tidyTree.mjs +43 -0
  16. package/dist/charts-C3Q3r8Yz.cjs +918 -0
  17. package/dist/charts.cjs +1 -1
  18. package/dist/charts.d.ts +9 -0
  19. package/dist/{core-lazy-BQexApr7.cjs → core-lazy-ChKRuEPb.cjs} +1 -1
  20. package/dist/data/NiceDataGrid.mjs +301 -320
  21. package/dist/data/NiceRowEditDialog.mjs +57 -0
  22. package/dist/data/NiceTreeGrid.mjs +670 -551
  23. package/dist/data/NiceTreeView.mjs +222 -180
  24. package/dist/data/treeRowDrop.mjs +130 -0
  25. package/dist/data.cjs +1 -1
  26. package/dist/data.d.ts +68 -5
  27. package/dist/{devops-cgRBnZVX.cjs → devops-o6Zm0VKB.cjs} +3 -3
  28. package/dist/devops.cjs +1 -1
  29. package/dist/editors/forms/NiceForm.mjs +216 -167
  30. package/dist/editors/inputs/NiceUpload.mjs +238 -238
  31. package/dist/editors.cjs +1 -1
  32. package/dist/editors.d.ts +13 -1
  33. package/dist/feedback.cjs +1 -1
  34. package/dist/index.cjs +254 -254
  35. package/dist/index.d.ts +293 -8
  36. package/dist/index.mjs +980 -966
  37. package/dist/lazy.cjs +1 -1
  38. package/dist/lazy.d.ts +11 -1
  39. package/dist/navigation.cjs +1 -1
  40. package/dist/no-code/NiceDataMapper.mjs +398 -361
  41. package/dist/no-code-CN_q6TcB.cjs +331 -0
  42. package/dist/no-code.cjs +1 -1
  43. package/dist/no-code.d.ts +11 -1
  44. package/dist/style.css +1 -1
  45. package/dist/tools/NicePermissionMatrix.mjs +171 -138
  46. package/dist/tools/NiceRoleEditor.mjs +334 -297
  47. package/package.json +4 -4
  48. package/dist/NiceDataGrid-D3qRQSjy.cjs +0 -10
  49. package/dist/NiceForm-BWb4LTQJ.cjs +0 -1
  50. package/dist/NicePivotGrid-Cxu5PECg.cjs +0 -152
  51. package/dist/NiceSavedQueryPanel-BSZhE-_l.cjs +0 -587
  52. package/dist/charts-BzlvCCg9.cjs +0 -768
  53. package/dist/no-code-B1jzfUF5.cjs +0 -331
@@ -1,173 +1,206 @@
1
- import { jsx as i, jsxs as u } from "react/jsx-runtime";
2
- import { useNiceAccessMode as D, useNiceTranslation as S, useControlId as Y, useGridFocus as B, NiceIcon as b } from "@nice2dev/ui-core";
3
- import { forwardRef as H, useCallback as f, useRef as K } from "react";
1
+ import { jsx as r, jsxs as t } from "react/jsx-runtime";
2
+ import { useNiceAccessMode as U, useNiceTranslation as V, useControlId as J, useGridFocus as Q, NiceIcon as h } from "@nice2dev/ui-core";
3
+ import { forwardRef as W, useCallback as x, useMemo as I, useRef as X } from "react";
4
4
  /* empty css */
5
- const L = [], C = [], X = /* @__PURE__ */ Object.assign(
6
- /* @__PURE__ */ H(
5
+ const Z = [], H = [], ee = {}, le = /* @__PURE__ */ Object.assign(
6
+ /* @__PURE__ */ W(
7
7
  ({
8
- roles: p = L,
9
- actions: d = C,
10
- value: r = {},
11
- onChange: o,
12
- onCellChange: _,
13
- showBulkActions: x = !0,
8
+ roles: a = Z,
9
+ actions: o = H,
10
+ value: d = ee,
11
+ onChange: f,
12
+ onCellChange: v,
13
+ showBulkActions: R = !0,
14
14
  tristate: g = !1,
15
- readOnly: z = !1,
16
- disabled: M = !1,
17
- className: y,
18
- style: $,
19
- size: O = "md",
20
- accessMode: P,
21
- id: k
22
- }, w) => {
23
- const N = D(P, k), G = N === "hidden", s = M || N === "disabled", t = z || N === "readOnly", { t: c } = S(), j = Y(k), m = (e, n) => `${e}:${n}`, E = f(
24
- (e, n) => {
25
- if (s || t)
26
- return;
27
- const l = m(e, n), a = r[l];
28
- let h;
29
- g ? h = a === !0 ? !1 : a === !1 ? "inherited" : !0 : h = !a;
30
- const q = { ...r, [l]: h };
31
- o?.(q), _?.(e, n, h === !0);
15
+ readOnly: B = !1,
16
+ disabled: G = !1,
17
+ maxHeight: N,
18
+ className: T,
19
+ style: z,
20
+ size: S = "md",
21
+ accessMode: j,
22
+ id: P
23
+ }, Y) => {
24
+ const y = U(j, P), D = y === "hidden", m = G || y === "disabled", p = B || y === "readOnly", { t: l } = V(), L = J(P), _ = (e, i) => `${e}:${i}`, b = x(
25
+ (e) => {
26
+ const i = { ...d };
27
+ for (const [n, s] of e)
28
+ s === void 0 ? delete i[n] : i[n] = s;
29
+ return i;
32
30
  },
33
- [r, o, _, s, t, g]
34
- ), F = f(
35
- (e, n) => {
36
- if (s || t)
31
+ [d]
32
+ ), q = x(
33
+ (e, i) => {
34
+ if (m || p || e.readOnly)
37
35
  return;
38
- const l = { ...r };
39
- for (const a of d)
40
- l[m(e, a.id)] = n;
41
- o?.(l);
36
+ const n = _(e.id, i), s = d[n];
37
+ let c;
38
+ g ? c = s === !0 ? !1 : s === !1 ? "inherited" : !0 : c = s === !0 ? void 0 : !0, f?.(b([[n, c]])), v?.(e.id, i, c === !0);
42
39
  },
43
- [r, o, d, s, t]
44
- ), I = f(
45
- (e, n) => {
46
- if (s || t)
40
+ [d, f, v, m, p, g, b]
41
+ ), k = x(
42
+ (e, i, n) => {
43
+ if (m || p)
47
44
  return;
48
- const l = { ...r };
49
- for (const a of p)
50
- l[m(a.id, e)] = n;
51
- o?.(l);
45
+ const s = n ? !0 : g ? !1 : void 0, c = [];
46
+ for (const E of e)
47
+ if (!E.readOnly)
48
+ for (const K of i)
49
+ c.push([_(E.id, K), s]);
50
+ f?.(b(c));
52
51
  },
53
- [r, o, p, s, t]
54
- ), T = f(
55
- (e) => d.every((n) => r[m(e, n.id)] === !0),
56
- [d, r]
57
- ), A = f(
58
- (e) => p.every((n) => r[m(n.id, e)] === !0),
59
- [p, r]
60
- );
61
- function V(e) {
62
- return e === !0 ? /* @__PURE__ */ i(
52
+ [f, m, p, g, b]
53
+ ), u = x(
54
+ (e, i) => {
55
+ const n = e.filter((s) => !s.readOnly);
56
+ return n.length > 0 && i.length > 0 && n.every((s) => i.every((c) => d[_(s.id, c)] === !0));
57
+ },
58
+ [d]
59
+ ), C = I(() => {
60
+ const e = [];
61
+ for (const i of o) {
62
+ const n = e[e.length - 1];
63
+ n && i.group !== void 0 && n.group === i.group ? n.actions.push(i) : e.push({ group: i.group, actions: [i] });
64
+ }
65
+ return e;
66
+ }, [o]), w = o.some((e) => e.group !== void 0), O = I(() => o.map((e) => e.id), [o]);
67
+ function F(e) {
68
+ return e === !0 ? /* @__PURE__ */ r(
63
69
  "span",
64
70
  {
65
71
  className: "nice-perm-cell nice-perm-cell--granted",
66
- "aria-label": c("granted", "Granted"),
67
- children: /* @__PURE__ */ i(b, { name: "check", size: 14 })
72
+ "aria-label": l("granted", "Granted"),
73
+ children: /* @__PURE__ */ r(h, { name: "check", size: 14 })
68
74
  }
69
- ) : e === !1 ? /* @__PURE__ */ i(
75
+ ) : e === !1 ? /* @__PURE__ */ r(
70
76
  "span",
71
77
  {
72
78
  className: "nice-perm-cell nice-perm-cell--denied",
73
- "aria-label": c("denied", "Denied"),
74
- children: /* @__PURE__ */ i(b, { name: "close", size: 14 })
79
+ "aria-label": l("denied", "Denied"),
80
+ children: /* @__PURE__ */ r(h, { name: "close", size: 14 })
75
81
  }
76
- ) : e === "inherited" ? /* @__PURE__ */ i(
82
+ ) : e === "inherited" ? /* @__PURE__ */ r(
77
83
  "span",
78
84
  {
79
85
  className: "nice-perm-cell nice-perm-cell--inherited",
80
- "aria-label": c("inherited", "Inherited"),
81
- children: /* @__PURE__ */ i(b, { name: "arrow-up", size: 14 })
86
+ "aria-label": l("inherited", "Inherited"),
87
+ children: /* @__PURE__ */ r(h, { name: "arrow-up", size: 14 })
82
88
  }
83
- ) : /* @__PURE__ */ i("span", { className: "nice-perm-cell nice-perm-cell--unset", "aria-label": c("unset", "Not set"), children: "—" });
89
+ ) : /* @__PURE__ */ r("span", { className: "nice-perm-cell nice-perm-cell--unset", "aria-label": l("unset", "Not set"), children: "—" });
84
90
  }
85
- const R = K(null);
86
- return B(R), G ? null : /* @__PURE__ */ i(
91
+ const M = (e, i, n) => /* @__PURE__ */ r(
92
+ "button",
93
+ {
94
+ type: "button",
95
+ className: "nice-permission-matrix__bulk",
96
+ onClick: i,
97
+ disabled: m,
98
+ title: n,
99
+ "aria-label": n,
100
+ children: /* @__PURE__ */ r(h, { name: e ? "check-square" : "box", size: 14 })
101
+ }
102
+ ), $ = R && !p, A = X(null);
103
+ return Q(A), D ? null : /* @__PURE__ */ r(
87
104
  "div",
88
105
  {
89
- ref: w,
90
- id: j,
91
- className: `nice-permission-matrix nice-size-${O}${y ? ` ${y}` : ""}${s ? " nice-disabled" : ""}`,
92
- style: $,
93
- children: /* @__PURE__ */ u(
106
+ ref: Y,
107
+ id: L,
108
+ className: `nice-permission-matrix nice-size-${S}${N !== void 0 ? " nice-permission-matrix--scroll" : ""}${T ? ` ${T}` : ""}${m ? " nice-disabled" : ""}`,
109
+ style: N !== void 0 ? { maxHeight: N, ...z } : z,
110
+ children: /* @__PURE__ */ t(
94
111
  "table",
95
112
  {
96
- ref: R,
113
+ ref: A,
97
114
  className: "nice-permission-matrix__table",
98
115
  role: "grid",
99
- "aria-label": c("permissionMatrix.label", "Permissions"),
116
+ "aria-label": l("permissionMatrix.label", "Permissions"),
100
117
  children: [
101
- /* @__PURE__ */ i("thead", { children: /* @__PURE__ */ u("tr", { children: [
102
- /* @__PURE__ */ i("th", { className: "nice-permission-matrix__corner" }),
103
- d.map((e) => /* @__PURE__ */ u(
104
- "th",
105
- {
106
- className: "nice-permission-matrix__action-header",
107
- title: e.description,
108
- children: [
109
- /* @__PURE__ */ i("span", { children: e.label }),
110
- x && !t && /* @__PURE__ */ i(
111
- "button",
112
- {
113
- type: "button",
114
- className: "nice-permission-matrix__bulk",
115
- onClick: () => I(e.id, !A(e.id)),
116
- disabled: s,
117
- title: c("toggleAll", "Toggle all"),
118
- "aria-label": c("toggleAll", "Toggle all"),
119
- children: /* @__PURE__ */ i(
120
- b,
121
- {
122
- name: A(e.id) ? "check-square" : "box",
123
- size: 14
124
- }
118
+ /* @__PURE__ */ t("thead", { children: [
119
+ w && /* @__PURE__ */ t("tr", { children: [
120
+ /* @__PURE__ */ r("th", { className: "nice-permission-matrix__corner", rowSpan: 2 }),
121
+ C.map((e, i) => {
122
+ const n = e.actions.map((s) => s.id);
123
+ return /* @__PURE__ */ t(
124
+ "th",
125
+ {
126
+ colSpan: e.actions.length,
127
+ className: "nice-permission-matrix__group-header",
128
+ children: [
129
+ e.group !== void 0 && /* @__PURE__ */ r("span", { children: e.group }),
130
+ e.group !== void 0 && $ && M(
131
+ u(a, n),
132
+ () => k(a, n, !u(a, n)),
133
+ l("permissionMatrix.toggleGroup", "Toggle all of {group}").replace(
134
+ "{group}",
135
+ e.group
136
+ )
125
137
  )
126
- }
127
- )
128
- ]
129
- },
130
- e.id
131
- ))
132
- ] }) }),
133
- /* @__PURE__ */ i("tbody", { children: p.map((e) => /* @__PURE__ */ u("tr", { children: [
134
- /* @__PURE__ */ u("td", { className: "nice-permission-matrix__role-header", title: e.description, children: [
135
- e.icon && /* @__PURE__ */ i("span", { className: "nice-permission-matrix__role-icon", children: e.icon }),
136
- /* @__PURE__ */ i("span", { children: e.label }),
137
- x && !t && /* @__PURE__ */ i(
138
- "button",
138
+ ]
139
+ },
140
+ `${e.group ?? ""}#${i}`
141
+ );
142
+ })
143
+ ] }),
144
+ /* @__PURE__ */ t("tr", { children: [
145
+ !w && /* @__PURE__ */ r("th", { className: "nice-permission-matrix__corner" }),
146
+ o.map((e) => /* @__PURE__ */ t(
147
+ "th",
139
148
  {
140
- type: "button",
141
- className: "nice-permission-matrix__bulk",
142
- onClick: () => F(e.id, !T(e.id)),
143
- disabled: s,
144
- title: c("toggleAll", "Toggle all"),
145
- "aria-label": c("toggleAll", "Toggle all"),
146
- children: /* @__PURE__ */ i(
147
- b,
149
+ className: "nice-permission-matrix__action-header",
150
+ title: e.description,
151
+ children: [
152
+ /* @__PURE__ */ r("span", { children: e.label }),
153
+ $ && M(
154
+ u(a, [e.id]),
155
+ () => k(a, [e.id], !u(a, [e.id])),
156
+ l("toggleAll", "Toggle all")
157
+ )
158
+ ]
159
+ },
160
+ e.id
161
+ ))
162
+ ] })
163
+ ] }),
164
+ /* @__PURE__ */ r("tbody", { children: a.map((e) => /* @__PURE__ */ t(
165
+ "tr",
166
+ {
167
+ className: e.readOnly ? "nice-permission-matrix__row--locked" : void 0,
168
+ children: [
169
+ /* @__PURE__ */ r("td", { className: "nice-permission-matrix__role-header", title: e.description, children: /* @__PURE__ */ t("div", { className: "nice-permission-matrix__role", children: [
170
+ e.icon && /* @__PURE__ */ r("span", { className: "nice-permission-matrix__role-icon", children: e.icon }),
171
+ /* @__PURE__ */ r("span", { className: "nice-permission-matrix__role-label", children: e.label }),
172
+ e.readOnly ? /* @__PURE__ */ r(
173
+ "span",
148
174
  {
149
- name: T(e.id) ? "check-square" : "box",
150
- size: 14
175
+ className: "nice-permission-matrix__role-icon",
176
+ title: l("permissionMatrix.locked", "Built-in: cannot be changed"),
177
+ children: /* @__PURE__ */ r(h, { name: "lock", size: 12 })
151
178
  }
179
+ ) : $ && M(
180
+ u([e], O),
181
+ () => k([e], O, !u([e], O)),
182
+ l("toggleAll", "Toggle all")
152
183
  )
153
- }
154
- )
155
- ] }),
156
- d.map((n) => {
157
- const l = m(e.id, n.id);
158
- return /* @__PURE__ */ i(
159
- "td",
160
- {
161
- className: "nice-permission-matrix__cell",
162
- role: "gridcell",
163
- onClick: () => E(e.id, n.id),
164
- style: { cursor: s || t ? "default" : "pointer" },
165
- children: V(r[l])
166
- },
167
- l
168
- );
169
- })
170
- ] }, e.id)) })
184
+ ] }) }),
185
+ o.map((i) => {
186
+ const n = _(e.id, i.id), s = m || p || !!e.readOnly;
187
+ return /* @__PURE__ */ r(
188
+ "td",
189
+ {
190
+ className: `nice-permission-matrix__cell${e.readOnly ? " nice-permission-matrix__cell--locked" : ""}`,
191
+ role: "gridcell",
192
+ "aria-readonly": s || void 0,
193
+ onClick: () => q(e, i.id),
194
+ style: { cursor: s ? "default" : "pointer" },
195
+ children: F(d[n])
196
+ },
197
+ n
198
+ );
199
+ })
200
+ ]
201
+ },
202
+ e.id
203
+ )) })
171
204
  ]
172
205
  }
173
206
  )
@@ -178,5 +211,5 @@ const L = [], C = [], X = /* @__PURE__ */ Object.assign(
178
211
  { displayName: "NicePermissionMatrix" }
179
212
  );
180
213
  export {
181
- X as NicePermissionMatrix
214
+ le as NicePermissionMatrix
182
215
  };