@nice2dev/ui 1.3.17 → 1.4.0
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 +146 -0
- package/README.md +29 -2
- package/dist/{NiceDataGrid-aNPAHsWy.cjs → NiceDataGrid-BT6iCUgP.cjs} +1 -1
- package/dist/NiceForm-Bysp66Ef.cjs +1 -0
- package/dist/{NiceMention-CMqAGvO0.cjs → NiceMention-sc8W-DwH.cjs} +1 -1
- package/dist/NiceModuleLifecyclePanel-DBQPCa_V.cjs +1 -0
- package/dist/{NiceSavedQueryPanel-JHrSlHAV.cjs → NiceSavedQueryPanel-BbznsXFd.cjs} +1 -1
- package/dist/{NiceScheduler-2TwOZq-y.cjs → NiceScheduler-3Ez0zSQJ.cjs} +1 -1
- package/dist/{core-lazy-Cda-D35m.cjs → core-lazy-CL4ZIxF-.cjs} +1 -1
- package/dist/data/treeDragSession.mjs +52 -46
- package/dist/data.cjs +1 -1
- package/dist/editors/inputs/NiceAutocomplete.mjs +44 -46
- package/dist/editors/pickers/NiceDateTimePicker.mjs +1 -1
- package/dist/editors/pickers/pickerCommons.mjs +284 -87
- package/dist/editors/pickers/themePickerHelpers.mjs +10 -8
- package/dist/editors.cjs +1 -1
- package/dist/index.cjs +162 -162
- package/dist/index.d.ts +253 -31
- package/dist/index.mjs +1517 -1483
- package/dist/navigation/NiceIconRail.mjs +74 -53
- package/dist/navigation/NiceNavShell.mjs +855 -807
- package/dist/navigation/NiceSetupWizard.mjs +287 -278
- package/dist/navigation/NiceSidebarNav.mjs +1487 -1144
- package/dist/navigation/navItemDrag.mjs +42 -0
- package/dist/navigation/navShellPane.mjs +16 -11
- package/dist/navigation/sidebarColors.mjs +61 -50
- package/dist/navigation/sidebarNavTypes.mjs +1 -0
- package/dist/navigation/sidebarSearch.mjs +28 -0
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +70 -21
- package/dist/pickerCommons-CwcCc8Qi.cjs +1 -0
- package/dist/planning/NiceResourceAllocation.mjs +31 -31
- package/dist/style.css +4 -4
- package/dist/tools/NiceThemeDesigner.mjs +781 -708
- package/dist/tools/NiceThemePreview.mjs +344 -282
- package/dist/tools/themeCatalog.mjs +28 -44
- package/dist/tools/themeCatalogArchive.mjs +38 -0
- package/dist/tools/themeDesigner/ThemeSetEditors.mjs +400 -0
- package/dist/tools/themeDesigner/ThemeValueField.mjs +146 -0
- package/dist/tools/themeDesigner/themeDesignerPaths.mjs +105 -0
- package/package.json +4 -4
- package/dist/NiceForm-BtRBLffD.cjs +0 -1
- package/dist/NiceModuleLifecyclePanel-ugNtHimh.cjs +0 -1
- package/dist/pickerCommons-BWglYl6J.cjs +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsxs as c, jsx as t, Fragment as V } from "react/jsx-runtime";
|
|
2
|
-
import { useNiceTranslation as je, NiceIcon as
|
|
2
|
+
import { useNiceTranslation as je, NiceIcon as fe, clickOnActivationKey as be } from "@nice2dev/ui-core";
|
|
3
3
|
import G, { forwardRef as _e, useState as E, useMemo as w, useRef as $e, useCallback as N, useImperativeHandle as Fe } from "react";
|
|
4
4
|
import { NiceButton as A } from "../buttons/NiceButton.mjs";
|
|
5
5
|
import { NiceButtonGroup as ye } from "../buttons/NiceButtonGroup.mjs";
|
|
6
|
-
const Le = [], C = (
|
|
7
|
-
const d = new Date(
|
|
6
|
+
const Le = [], C = (m, h) => {
|
|
7
|
+
const d = new Date(m);
|
|
8
8
|
return d.setDate(d.getDate() + h), d;
|
|
9
|
-
}, xe = (
|
|
10
|
-
const h =
|
|
9
|
+
}, xe = (m, h) => m.getFullYear() === h.getFullYear() && m.getMonth() === h.getMonth() && m.getDate() === h.getDate(), q = (m, h, d = "short") => d === "day" ? h.toLocaleDateString(m, { weekday: "short" }) : d === "long" ? h.toLocaleDateString(m, { day: "numeric", month: "short", year: "numeric" }) : h.toLocaleDateString(m, { day: "numeric", month: "short" }), H = (m) => {
|
|
10
|
+
const h = m.getDay();
|
|
11
11
|
return h === 0 || h === 6;
|
|
12
|
-
}, Ye = (
|
|
12
|
+
}, Ye = (m, h) => Math.ceil((h.getTime() - m.getTime()) / (1e3 * 60 * 60 * 24)), we = {
|
|
13
13
|
planned: "var(--nice-color-primary, #3b82f6)",
|
|
14
14
|
"in-progress": "var(--nice-color-warning, #f59e0b)",
|
|
15
15
|
completed: "var(--nice-color-success, #22c55e)",
|
|
16
16
|
blocked: "var(--nice-color-error, #ef4444)"
|
|
17
17
|
}, Ke = /* @__PURE__ */ Object.assign(
|
|
18
18
|
/* @__PURE__ */ _e(
|
|
19
|
-
(
|
|
19
|
+
(m, h) => {
|
|
20
20
|
const { t: d, lang: P } = je(), {
|
|
21
21
|
resources: z = Le,
|
|
22
22
|
allocations: j,
|
|
@@ -47,7 +47,7 @@ const Le = [], C = (f, h) => {
|
|
|
47
47
|
className: Me,
|
|
48
48
|
style: Se,
|
|
49
49
|
...Ce
|
|
50
|
-
} =
|
|
50
|
+
} = m, [k, le] = E(De), [D, O] = E(() => {
|
|
51
51
|
const e = new Date(ke ?? Date.now());
|
|
52
52
|
return e.setHours(0, 0, 0, 0), e;
|
|
53
53
|
}), de = w(() => {
|
|
@@ -66,14 +66,14 @@ const Le = [], C = (f, h) => {
|
|
|
66
66
|
(e) => (e.allocations ?? []).map((r) => ({ ...r, resourceId: r.resourceId ?? e.id }))
|
|
67
67
|
), [j, z]), [a, ue] = E(null), [pe, ge] = E(
|
|
68
68
|
null
|
|
69
|
-
), Ie = $e(null),
|
|
69
|
+
), Ie = $e(null), f = w(() => {
|
|
70
70
|
const e = L ? z.filter(L) : [...z];
|
|
71
71
|
return ie === "name" && e.sort((r, n) => r.name.localeCompare(n.name)), e;
|
|
72
72
|
}, [z, L, ie]), U = w(() => {
|
|
73
73
|
if (Y === "none")
|
|
74
|
-
return [{ key: "", title: "", resources:
|
|
74
|
+
return [{ key: "", title: "", resources: f }];
|
|
75
75
|
const e = /* @__PURE__ */ new Map();
|
|
76
|
-
return
|
|
76
|
+
return f.forEach((r) => {
|
|
77
77
|
const n = (Y === "department" ? r.department : r.type) || "Inne", i = e.get(n) || [];
|
|
78
78
|
i.push(r), e.set(n, i);
|
|
79
79
|
}), Array.from(e.entries()).map(([r, n]) => ({
|
|
@@ -81,7 +81,7 @@ const Le = [], C = (f, h) => {
|
|
|
81
81
|
title: r,
|
|
82
82
|
resources: n
|
|
83
83
|
}));
|
|
84
|
-
}, [
|
|
84
|
+
}, [f, Y]), u = w(() => {
|
|
85
85
|
const e = [];
|
|
86
86
|
let r = new Date(D);
|
|
87
87
|
for (let n = 0; n < de; n++)
|
|
@@ -89,7 +89,7 @@ const Le = [], C = (f, h) => {
|
|
|
89
89
|
return e;
|
|
90
90
|
}, [D, de, ce]), B = w(() => {
|
|
91
91
|
const e = /* @__PURE__ */ new Map();
|
|
92
|
-
return
|
|
92
|
+
return f.forEach((r) => {
|
|
93
93
|
const n = /* @__PURE__ */ new Map(), i = r.capacity || Z;
|
|
94
94
|
u.forEach((s) => {
|
|
95
95
|
const o = s.toISOString().split("T")[0], v = S.filter(
|
|
@@ -108,9 +108,9 @@ const Le = [], C = (f, h) => {
|
|
|
108
108
|
});
|
|
109
109
|
}), e.set(r.id, n);
|
|
110
110
|
}), e;
|
|
111
|
-
}, [
|
|
111
|
+
}, [f, u, S, Z, se]), W = w(() => {
|
|
112
112
|
const e = [];
|
|
113
|
-
return
|
|
113
|
+
return f.forEach((r) => {
|
|
114
114
|
const n = S.filter((i) => i.resourceId === r.id).sort((i, s) => new Date(i.start).getTime() - new Date(s.start).getTime());
|
|
115
115
|
for (let i = 0; i < n.length; i++) {
|
|
116
116
|
const s = n[i], o = [s];
|
|
@@ -121,13 +121,13 @@ const Le = [], C = (f, h) => {
|
|
|
121
121
|
o.length > 1 && e.push(o);
|
|
122
122
|
}
|
|
123
123
|
}), e.length > 0 && ne?.(e.flat()), e;
|
|
124
|
-
}, [
|
|
124
|
+
}, [f, S, ne]), he = 200, p = k === "day" ? 100 : k === "week" ? 60 : 30, Re = u.length * p, R = U.reduce(
|
|
125
125
|
(e, r) => e + (r.title ? 30 : 0) + r.resources.length * x,
|
|
126
126
|
0
|
|
127
127
|
), X = N((e) => {
|
|
128
128
|
const r = new Date(e);
|
|
129
129
|
r.setHours(0, 0, 0, 0), O(r);
|
|
130
|
-
}, []),
|
|
130
|
+
}, []), me = N(
|
|
131
131
|
(e) => {
|
|
132
132
|
const r = k === "month" ? 30 : k === "week" ? 7 : 1;
|
|
133
133
|
O((n) => C(n, e * r));
|
|
@@ -181,12 +181,12 @@ const Le = [], C = (f, h) => {
|
|
|
181
181
|
const r = e.clientX - a.startX, n = e.clientY - a.startY, i = Math.round(r / p);
|
|
182
182
|
if (i !== 0 || n !== 0)
|
|
183
183
|
if (a.mode === "move") {
|
|
184
|
-
const s = C(a.originalStart, i), o = Math.round(n / x), l =
|
|
184
|
+
const s = C(a.originalStart, i), o = Math.round(n / x), l = f.findIndex(
|
|
185
185
|
(g) => g.id === a.originalResourceId
|
|
186
186
|
), v = Math.max(
|
|
187
187
|
0,
|
|
188
|
-
Math.min(
|
|
189
|
-
), y =
|
|
188
|
+
Math.min(f.length - 1, l + o)
|
|
189
|
+
), y = f[v]?.id || a.originalResourceId;
|
|
190
190
|
ee?.(a.allocation, y, s);
|
|
191
191
|
} else {
|
|
192
192
|
const s = a.mode === "resize-start" ? C(a.originalStart, i) : a.originalStart, o = a.mode === "resize-end" ? C(a.originalEnd, i) : a.originalEnd;
|
|
@@ -194,7 +194,7 @@ const Le = [], C = (f, h) => {
|
|
|
194
194
|
}
|
|
195
195
|
ue(null);
|
|
196
196
|
},
|
|
197
|
-
[a, p, x,
|
|
197
|
+
[a, p, x, f, ee, re]
|
|
198
198
|
);
|
|
199
199
|
Fe(
|
|
200
200
|
h,
|
|
@@ -244,13 +244,13 @@ const Le = [], C = (f, h) => {
|
|
|
244
244
|
/* @__PURE__ */ t(
|
|
245
245
|
A,
|
|
246
246
|
{
|
|
247
|
-
onClick: () =>
|
|
247
|
+
onClick: () => me(-1),
|
|
248
248
|
"aria-label": d("planning.previous", "Previous"),
|
|
249
|
-
children: /* @__PURE__ */ t(
|
|
249
|
+
children: /* @__PURE__ */ t(fe, { name: "chevron-left", size: 14 })
|
|
250
250
|
}
|
|
251
251
|
),
|
|
252
252
|
/* @__PURE__ */ t(A, { onClick: () => X(/* @__PURE__ */ new Date()), children: d("scheduling.today", "Today") }),
|
|
253
|
-
/* @__PURE__ */ t(A, { onClick: () =>
|
|
253
|
+
/* @__PURE__ */ t(A, { onClick: () => me(1), "aria-label": d("planning.next", "Next"), children: /* @__PURE__ */ t(fe, { name: "chevron-right", size: 14 }) })
|
|
254
254
|
] }),
|
|
255
255
|
/* @__PURE__ */ c("span", { className: "nice-resource-range", children: [
|
|
256
256
|
q(P, u[0], "long"),
|
|
@@ -616,23 +616,23 @@ const Le = [], C = (f, h) => {
|
|
|
616
616
|
.nice-resource-chart {
|
|
617
617
|
flex: 1;
|
|
618
618
|
overflow-x: auto;
|
|
619
|
-
scrollbar-color: var(--nice-border-color, #cbd5e1) transparent;
|
|
620
|
-
scrollbar-width: thin;
|
|
621
619
|
}
|
|
622
620
|
.nice-resource-chart::-webkit-scrollbar {
|
|
623
621
|
height: 10px;
|
|
624
622
|
width: 10px;
|
|
625
623
|
}
|
|
626
624
|
.nice-resource-chart::-webkit-scrollbar-track {
|
|
627
|
-
background: var(--nice-
|
|
625
|
+
background: var(--nice-scrollbar-track);
|
|
628
626
|
}
|
|
629
627
|
.nice-resource-chart::-webkit-scrollbar-thumb {
|
|
630
|
-
background: var(--nice-
|
|
631
|
-
|
|
632
|
-
border:
|
|
628
|
+
background-color: var(--nice-scrollbar-thumb);
|
|
629
|
+
background-image: var(--nice-scrollbar-thumb-image);
|
|
630
|
+
border-radius: var(--nice-scrollbar-radius);
|
|
631
|
+
border: 2px solid transparent;
|
|
632
|
+
background-clip: padding-box;
|
|
633
633
|
}
|
|
634
634
|
.nice-resource-chart::-webkit-scrollbar-thumb:hover {
|
|
635
|
-
background: var(--nice-
|
|
635
|
+
background-color: var(--nice-scrollbar-thumb-hover);
|
|
636
636
|
}
|
|
637
637
|
|
|
638
638
|
.nice-resource-dates {
|