@nice2dev/ui 1.4.14 → 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.
- package/CHANGELOG.md +73 -0
- package/dist/{NiceColorPicker-BLwYNSXJ.cjs → NiceColorPicker-79rkvaSk.cjs} +1 -1
- package/dist/NiceDataGrid-B1AOjgjm.cjs +10 -0
- package/dist/NiceForm-fmePSeA9.cjs +1 -0
- package/dist/{NiceHtmlEditor-BzECmDO3.cjs → NiceHtmlEditor-By7R1wRo.cjs} +1 -1
- package/dist/{NiceMention-CYRqPKGU.cjs → NiceMention-i7n2BoMw.cjs} +1 -1
- package/dist/{NiceModuleLifecyclePanel-CiYbPcHV.cjs → NiceModuleLifecyclePanel-DVHQuhc-.cjs} +1 -1
- package/dist/{NicePagination-BAxwqeEd.cjs → NicePagination-D9JguOl0.cjs} +1 -1
- package/dist/NicePivotGrid-B_7iQJys.cjs +2 -0
- package/dist/NiceSavedQueryPanel-ChY4HwpM.cjs +587 -0
- package/dist/{NiceScheduler-BqYiHPvz.cjs → NiceScheduler-B2DamQ_L.cjs} +1 -1
- package/dist/backup/NiceBackupScheduler.mjs +171 -119
- package/dist/charts/NiceOrganizationChart.mjs +159 -59
- package/dist/charts/orgChartExport.mjs +71 -0
- package/dist/charts/tidyTree.mjs +43 -0
- package/dist/charts-C3Q3r8Yz.cjs +918 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.d.ts +9 -0
- package/dist/{core-lazy-BQexApr7.cjs → core-lazy-ChKRuEPb.cjs} +1 -1
- package/dist/data/NiceDataGrid.mjs +301 -320
- package/dist/data/NiceRowEditDialog.mjs +57 -0
- package/dist/data/NiceTreeGrid.mjs +478 -433
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +43 -2
- package/dist/{devops-cgRBnZVX.cjs → devops-o6Zm0VKB.cjs} +3 -3
- package/dist/devops.cjs +1 -1
- package/dist/editors/forms/NiceForm.mjs +216 -167
- package/dist/editors/inputs/NiceUpload.mjs +238 -238
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +13 -1
- package/dist/feedback.cjs +1 -1
- package/dist/index.cjs +254 -254
- package/dist/index.d.ts +198 -5
- package/dist/index.mjs +928 -920
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.d.ts +11 -1
- package/dist/navigation.cjs +1 -1
- package/dist/no-code/NiceDataMapper.mjs +398 -361
- package/dist/no-code-CN_q6TcB.cjs +331 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.d.ts +11 -1
- package/dist/style.css +1 -1
- package/dist/tools/NicePermissionMatrix.mjs +171 -138
- package/dist/tools/NiceRoleEditor.mjs +334 -297
- package/package.json +4 -4
- package/dist/NiceDataGrid-D3qRQSjy.cjs +0 -10
- package/dist/NiceForm-BWb4LTQJ.cjs +0 -1
- package/dist/NicePivotGrid-Cxu5PECg.cjs +0 -152
- package/dist/NiceSavedQueryPanel-C1nxEmMu.cjs +0 -587
- package/dist/charts-BzlvCCg9.cjs +0 -768
- package/dist/no-code-B1jzfUF5.cjs +0 -331
|
@@ -1,173 +1,206 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useNiceAccessMode as
|
|
3
|
-
import { forwardRef as
|
|
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
|
|
6
|
-
/* @__PURE__ */
|
|
5
|
+
const Z = [], H = [], ee = {}, le = /* @__PURE__ */ Object.assign(
|
|
6
|
+
/* @__PURE__ */ W(
|
|
7
7
|
({
|
|
8
|
-
roles:
|
|
9
|
-
actions:
|
|
10
|
-
value:
|
|
11
|
-
onChange:
|
|
12
|
-
onCellChange:
|
|
13
|
-
showBulkActions:
|
|
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:
|
|
16
|
-
disabled:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
[
|
|
34
|
-
),
|
|
35
|
-
(e,
|
|
36
|
-
if (
|
|
31
|
+
[d]
|
|
32
|
+
), q = x(
|
|
33
|
+
(e, i) => {
|
|
34
|
+
if (m || p || e.readOnly)
|
|
37
35
|
return;
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
[
|
|
44
|
-
),
|
|
45
|
-
(e, n) => {
|
|
46
|
-
if (
|
|
40
|
+
[d, f, v, m, p, g, b]
|
|
41
|
+
), k = x(
|
|
42
|
+
(e, i, n) => {
|
|
43
|
+
if (m || p)
|
|
47
44
|
return;
|
|
48
|
-
const
|
|
49
|
-
for (const
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
[
|
|
54
|
-
),
|
|
55
|
-
(e
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
[
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
|
|
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":
|
|
67
|
-
children: /* @__PURE__ */
|
|
72
|
+
"aria-label": l("granted", "Granted"),
|
|
73
|
+
children: /* @__PURE__ */ r(h, { name: "check", size: 14 })
|
|
68
74
|
}
|
|
69
|
-
) : e === !1 ? /* @__PURE__ */
|
|
75
|
+
) : e === !1 ? /* @__PURE__ */ r(
|
|
70
76
|
"span",
|
|
71
77
|
{
|
|
72
78
|
className: "nice-perm-cell nice-perm-cell--denied",
|
|
73
|
-
"aria-label":
|
|
74
|
-
children: /* @__PURE__ */
|
|
79
|
+
"aria-label": l("denied", "Denied"),
|
|
80
|
+
children: /* @__PURE__ */ r(h, { name: "close", size: 14 })
|
|
75
81
|
}
|
|
76
|
-
) : e === "inherited" ? /* @__PURE__ */
|
|
82
|
+
) : e === "inherited" ? /* @__PURE__ */ r(
|
|
77
83
|
"span",
|
|
78
84
|
{
|
|
79
85
|
className: "nice-perm-cell nice-perm-cell--inherited",
|
|
80
|
-
"aria-label":
|
|
81
|
-
children: /* @__PURE__ */
|
|
86
|
+
"aria-label": l("inherited", "Inherited"),
|
|
87
|
+
children: /* @__PURE__ */ r(h, { name: "arrow-up", size: 14 })
|
|
82
88
|
}
|
|
83
|
-
) : /* @__PURE__ */
|
|
89
|
+
) : /* @__PURE__ */ r("span", { className: "nice-perm-cell nice-perm-cell--unset", "aria-label": l("unset", "Not set"), children: "—" });
|
|
84
90
|
}
|
|
85
|
-
const
|
|
86
|
-
|
|
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:
|
|
90
|
-
id:
|
|
91
|
-
className: `nice-permission-matrix nice-size-${
|
|
92
|
-
style:
|
|
93
|
-
children: /* @__PURE__ */
|
|
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:
|
|
113
|
+
ref: A,
|
|
97
114
|
className: "nice-permission-matrix__table",
|
|
98
115
|
role: "grid",
|
|
99
|
-
"aria-label":
|
|
116
|
+
"aria-label": l("permissionMatrix.label", "Permissions"),
|
|
100
117
|
children: [
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
-
|
|
131
|
-
)
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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
|
-
|
|
150
|
-
|
|
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
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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
|
-
|
|
214
|
+
le as NicePermissionMatrix
|
|
182
215
|
};
|