@nice2dev/ui 1.4.1 → 1.4.2
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 +44 -0
- package/dist/NiceCodeEditor-DhdjnDLV.cjs +289 -0
- package/dist/{NiceDataGrid-BT6iCUgP.cjs → NiceDataGrid-CrKDzMM1.cjs} +1 -1
- package/dist/{NiceForm-Bysp66Ef.cjs → NiceForm-CT9hEXpc.cjs} +1 -1
- package/dist/NiceLoginForm-C2-WgRn0.cjs +1 -0
- package/dist/NiceMention-BZEHqPrf.cjs +432 -0
- package/dist/NiceModuleLifecyclePanel-DKlqKPy2.cjs +1 -0
- package/dist/{NiceSavedQueryPanel-BbznsXFd.cjs → NiceSavedQueryPanel-C5Ab_NWx.cjs} +1 -1
- package/dist/NiceScheduler-BZQAKEVF.cjs +5 -0
- package/dist/{NiceWindow-pgR4c-kQ.cjs → NiceWindow-BklnkBpu.cjs} +1 -1
- package/dist/charts/NiceLinearGauge.mjs +96 -83
- package/dist/charts/NicePolarChart.mjs +47 -47
- package/dist/charts-BzlvCCg9.cjs +768 -0
- package/dist/charts.cjs +1 -1
- package/dist/{core-lazy-CL4ZIxF-.cjs → core-lazy-VTd5zfoZ.cjs} +1 -1
- package/dist/data.cjs +1 -1
- package/dist/display/NiceAvatar.mjs +40 -24
- package/dist/editors/pickers/NiceDateRangeBox.mjs +92 -92
- package/dist/editors/pickers/NiceDateTimePicker.mjs +173 -173
- package/dist/editors/rich/NiceCodeEditor.mjs +645 -584
- package/dist/editors/rich/NiceDocumentEditor.mjs +277 -254
- package/dist/editors.cjs +1 -1
- package/dist/feedback/NiceDrawer.mjs +15 -15
- package/dist/feedback.cjs +1 -1
- package/dist/index.cjs +202 -202
- package/dist/index.d.ts +18 -0
- package/dist/lazy.cjs +1 -1
- package/dist/navigation/NiceNavShell.mjs +646 -593
- package/dist/navigation/NiceSidebarNav.mjs +844 -823
- package/dist/navigation.cjs +1 -1
- package/dist/overlays/NiceWindow.mjs +91 -91
- package/dist/overlays.cjs +1 -1
- package/dist/planning/NiceScheduler.mjs +170 -169
- package/dist/planning/NiceSchedulerViews.mjs +242 -233
- package/dist/style.css +2 -2
- package/dist/utility/intlNames.mjs +26 -16
- package/package.json +4 -4
- package/dist/NiceCodeEditor-D0QZW88r.cjs +0 -268
- package/dist/NiceLoginForm-FGf32sro.cjs +0 -1
- package/dist/NiceMention-sc8W-DwH.cjs +0 -430
- package/dist/NiceModuleLifecyclePanel-DBQPCa_V.cjs +0 -1
- package/dist/NiceScheduler-3Ez0zSQJ.cjs +0 -5
- package/dist/charts-B0tHOpJ7.cjs +0 -768
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useNiceTranslation as
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as u, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useNiceTranslation as nt, useControllableState as at } from "@nice2dev/ui-core";
|
|
3
|
+
import st, { useState as l, useRef as ot, useCallback as w, useMemo as F } from "react";
|
|
4
4
|
import { NiceButton as H } from "../buttons/NiceButton.mjs";
|
|
5
|
-
import { NiceButtonGroup as
|
|
6
|
-
import {
|
|
5
|
+
import { NiceButtonGroup as Ne } from "../buttons/NiceButtonGroup.mjs";
|
|
6
|
+
import { getDefaultLocale as it } from "../editors/pickers/NiceDateTimePicker.mjs";
|
|
7
|
+
import { formatNumericDate as y, monthNames as rt } from "../utility/intlNames.mjs";
|
|
7
8
|
import { useIgnoredPropChangeWarning as Q } from "../utility/useIgnoredPropChangeWarning.mjs";
|
|
8
|
-
import { addDays as r, expandRecurring as
|
|
9
|
-
import { MiniCalendar as
|
|
10
|
-
const
|
|
9
|
+
import { addDays as r, expandRecurring as lt } from "./NiceScheduler.types.mjs";
|
|
10
|
+
import { MiniCalendar as dt, SchedulerLegend as Se, MonthView as ct, TimeGridView as ut, DayRangeView as gt, MonthRangeView as mt, TimelineView as ht, AgendaView as ft, EventTooltip as vt, EventEditorForm as wt } from "./NiceSchedulerViews.mjs";
|
|
11
|
+
const yt = [
|
|
11
12
|
"day",
|
|
12
13
|
"workWeek",
|
|
13
14
|
"week",
|
|
@@ -16,12 +17,12 @@ const vt = [
|
|
|
16
17
|
"monthRange",
|
|
17
18
|
"timeline",
|
|
18
19
|
"agenda"
|
|
19
|
-
],
|
|
20
|
+
], pt = ({
|
|
20
21
|
events: k,
|
|
21
|
-
defaultEvents:
|
|
22
|
+
defaultEvents: De,
|
|
22
23
|
resources: X,
|
|
23
|
-
currentDate:
|
|
24
|
-
view:
|
|
24
|
+
currentDate: x,
|
|
25
|
+
view: M,
|
|
25
26
|
onDateChange: Z,
|
|
26
27
|
onViewChange: O,
|
|
27
28
|
onEventClick: ee,
|
|
@@ -31,66 +32,66 @@ const vt = [
|
|
|
31
32
|
timelineDays: R = 7,
|
|
32
33
|
startHour: _e = 0,
|
|
33
34
|
endHour: be = 24,
|
|
34
|
-
firstDayOfWeek:
|
|
35
|
-
categories:
|
|
35
|
+
firstDayOfWeek: p = 1,
|
|
36
|
+
categories: g,
|
|
36
37
|
showLegend: ne,
|
|
37
38
|
showTooltip: A,
|
|
38
39
|
renderEvent: Ce,
|
|
39
40
|
renderTooltip: ae,
|
|
40
41
|
workHours: Ee,
|
|
41
42
|
showCurrentTime: Te = !0,
|
|
42
|
-
showMiniCalendar:
|
|
43
|
+
showMiniCalendar: se,
|
|
43
44
|
onEventCreate: U,
|
|
44
45
|
onEventEdit: Y,
|
|
45
46
|
onEventDelete: z,
|
|
46
47
|
editable: _ = !0,
|
|
47
|
-
formFields:
|
|
48
|
-
formFieldsByType:
|
|
49
|
-
eventTypes:
|
|
50
|
-
renderEventEditor:
|
|
48
|
+
formFields: $e,
|
|
49
|
+
formFieldsByType: xe,
|
|
50
|
+
eventTypes: Me,
|
|
51
|
+
renderEventEditor: Ve,
|
|
51
52
|
loadEvents: P,
|
|
52
|
-
onEventsChange:
|
|
53
|
-
accessMode:
|
|
54
|
-
className:
|
|
53
|
+
onEventsChange: oe,
|
|
54
|
+
accessMode: V = "full",
|
|
55
|
+
className: Le,
|
|
55
56
|
style: Ie
|
|
56
57
|
}) => {
|
|
57
|
-
const { t:
|
|
58
|
+
const { t: i, lang: We } = nt(), Fe = V === "hidden", b = V === "readOnly" || V === "disabled", m = V === "disabled", [He, Ae] = l(x ?? /* @__PURE__ */ new Date()), [Ue, Ye] = l(M ?? "week"), ie = x !== void 0 && Z !== void 0, re = M !== void 0 && O !== void 0, a = ie ? x : He, n = re ? M : Ue;
|
|
58
59
|
Q(
|
|
59
60
|
"NiceScheduler",
|
|
60
61
|
"currentDate",
|
|
61
62
|
"onDateChange",
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
), Q("NiceScheduler", "view", "onViewChange",
|
|
65
|
-
const
|
|
63
|
+
x,
|
|
64
|
+
ie
|
|
65
|
+
), Q("NiceScheduler", "view", "onViewChange", M, re);
|
|
66
|
+
const ze = ot(null), [d, j] = l(() => {
|
|
66
67
|
const e = /* @__PURE__ */ new Date();
|
|
67
68
|
return e.setHours(0, 0, 0, 0), e;
|
|
68
|
-
}), [
|
|
69
|
+
}), [c, B] = l(() => r(/* @__PURE__ */ new Date(), 13)), [G, le] = l(
|
|
69
70
|
null
|
|
70
|
-
),
|
|
71
|
+
), Pe = w(
|
|
71
72
|
(e, t) => {
|
|
72
73
|
A && le(e && t ? { event: e, rect: t } : null);
|
|
73
74
|
},
|
|
74
75
|
[A]
|
|
75
|
-
), [
|
|
76
|
+
), [N, C] = l(null), [je, L] = l(!1), q = k !== void 0 && oe !== void 0, [Be, de] = at({
|
|
76
77
|
value: q ? k : void 0,
|
|
77
|
-
defaultValue:
|
|
78
|
+
defaultValue: De,
|
|
78
79
|
fallbackValue: [],
|
|
79
|
-
onChange:
|
|
80
|
+
onChange: oe,
|
|
80
81
|
componentName: "NiceScheduler"
|
|
81
|
-
}), [
|
|
82
|
+
}), [ce, Ge] = l(!1), [ue, qe] = l(null), [Nt, ge] = l(!1), h = ue ?? (q || ce || k === void 0 ? Be : k);
|
|
82
83
|
Q(
|
|
83
84
|
"NiceScheduler",
|
|
84
85
|
"events",
|
|
85
86
|
"onEventsChange",
|
|
86
87
|
k,
|
|
87
|
-
q || !(
|
|
88
|
+
q || !(ce || ue !== null),
|
|
88
89
|
"the built-in editor has taken over the list"
|
|
89
90
|
);
|
|
90
|
-
const [E,
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
return
|
|
91
|
+
const [E, Je] = l(/* @__PURE__ */ new Set()), me = w((e) => {
|
|
92
|
+
Je((t) => {
|
|
93
|
+
const o = new Set(t);
|
|
94
|
+
return o.has(e) ? o.delete(e) : o.add(e), o;
|
|
94
95
|
});
|
|
95
96
|
}, []), T = F(() => {
|
|
96
97
|
if (n === "month")
|
|
@@ -101,193 +102,193 @@ const vt = [
|
|
|
101
102
|
if (n === "timeline")
|
|
102
103
|
return { start: new Date(a), end: r(a, R) };
|
|
103
104
|
if (n === "dayRange" || n === "monthRange")
|
|
104
|
-
return { start: new Date(
|
|
105
|
+
return { start: new Date(d), end: r(c, 1) };
|
|
105
106
|
const e = (() => {
|
|
106
|
-
const t = new Date(a),
|
|
107
|
-
return r(t, -
|
|
107
|
+
const t = new Date(a), o = (t.getDay() - p + 7) % 7;
|
|
108
|
+
return r(t, -o);
|
|
108
109
|
})();
|
|
109
110
|
return { start: r(e, -1), end: r(e, 8) };
|
|
110
|
-
}, [a, n,
|
|
111
|
-
let e =
|
|
111
|
+
}, [a, n, p, R, d, c]), J = F(() => {
|
|
112
|
+
let e = lt(h, T.start, T.end);
|
|
112
113
|
return E.size > 0 && (e = e.filter((t) => !t.category || !E.has(t.category))), e;
|
|
113
|
-
}, [
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
},
|
|
114
|
+
}, [h, T, E]), S = (e) => {
|
|
115
|
+
Ae(e), Z?.(e);
|
|
116
|
+
}, Ke = (e) => {
|
|
117
|
+
Ye(e), O?.(e);
|
|
118
|
+
}, he = (e) => {
|
|
118
119
|
if (n === "day")
|
|
119
|
-
|
|
120
|
+
S(r(a, e));
|
|
120
121
|
else if (n === "week" || n === "workWeek")
|
|
121
|
-
|
|
122
|
+
S(r(a, e * 7));
|
|
122
123
|
else if (n === "timeline")
|
|
123
|
-
|
|
124
|
+
S(r(a, e * R));
|
|
124
125
|
else if (n === "dayRange" || n === "monthRange") {
|
|
125
|
-
const t = Math.round((
|
|
126
|
-
j(r(
|
|
126
|
+
const t = Math.round((c.getTime() - d.getTime()) / 864e5) + 1;
|
|
127
|
+
j(r(d, e * t)), B(r(c, e * t));
|
|
127
128
|
} else {
|
|
128
129
|
const t = new Date(a);
|
|
129
|
-
t.setMonth(t.getMonth() + e),
|
|
130
|
+
t.setMonth(t.getMonth() + e), S(t);
|
|
130
131
|
}
|
|
131
132
|
}, K = F(() => {
|
|
132
|
-
const e = new Date(a), t = (e.getDay() -
|
|
133
|
+
const e = new Date(a), t = (e.getDay() - p + 7) % 7;
|
|
133
134
|
return r(e, -t);
|
|
134
|
-
}, [a,
|
|
135
|
+
}, [a, p]), I = F(() => {
|
|
135
136
|
if (n === "day")
|
|
136
137
|
return [a];
|
|
137
138
|
if (n === "workWeek") {
|
|
138
139
|
const e = [];
|
|
139
140
|
for (let t = 0; t < 7; t++) {
|
|
140
|
-
const
|
|
141
|
-
v !== 0 && v !== 6 && e.push(
|
|
141
|
+
const o = r(K, t), v = o.getDay();
|
|
142
|
+
v !== 0 && v !== 6 && e.push(o);
|
|
142
143
|
}
|
|
143
144
|
return e;
|
|
144
145
|
}
|
|
145
146
|
return Array.from({ length: 7 }, (e, t) => r(K, t));
|
|
146
|
-
}, [n, a, K]),
|
|
147
|
-
(e, t,
|
|
148
|
-
b || (_ && C({ mode: "create", slotStart: e, slotEnd: t }), te?.(e, t,
|
|
147
|
+
}, [n, a, K]), f = it(), Qe = n === "day" ? y(f, a) : n === "week" || n === "workWeek" ? `${y(f, I[0])} – ${y(f, I[I.length - 1])}` : n === "timeline" ? `${y(f, a)} – ${y(f, r(a, R - 1))}` : n === "dayRange" || n === "monthRange" ? `${y(f, d)} – ${y(f, c)}` : `${rt(We, "long")[a.getMonth()]} ${a.getFullYear()}`, Xe = w(
|
|
148
|
+
(e, t, o) => {
|
|
149
|
+
b || (_ && C({ mode: "create", slotStart: e, slotEnd: t }), te?.(e, t, o));
|
|
149
150
|
},
|
|
150
151
|
[_, te, b]
|
|
151
|
-
),
|
|
152
|
+
), Ze = w(
|
|
152
153
|
(e) => {
|
|
153
154
|
_ && !b && C({ mode: "edit", event: e }), ee?.(e);
|
|
154
155
|
},
|
|
155
156
|
[_, ee, b]
|
|
156
|
-
),
|
|
157
|
+
), $ = w(
|
|
157
158
|
(e) => {
|
|
158
|
-
|
|
159
|
+
Ge(!0), de(e);
|
|
159
160
|
},
|
|
160
|
-
[
|
|
161
|
-
),
|
|
161
|
+
[de]
|
|
162
|
+
), Oe = w(
|
|
162
163
|
async (e) => {
|
|
163
|
-
const t =
|
|
164
|
+
const t = N?.mode === "create";
|
|
164
165
|
try {
|
|
165
|
-
if (
|
|
166
|
+
if (L(!0), t) {
|
|
166
167
|
const v = (U ? await U(e) : void 0) ?? {
|
|
167
168
|
...e,
|
|
168
169
|
id: typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `evt_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`
|
|
169
|
-
}, W =
|
|
170
|
-
W.push(v),
|
|
170
|
+
}, W = h.slice();
|
|
171
|
+
W.push(v), $(W);
|
|
171
172
|
} else {
|
|
172
|
-
const v = (Y ? await Y(e) : void 0) ?? e, W =
|
|
173
|
-
|
|
173
|
+
const v = (Y ? await Y(e) : void 0) ?? e, W = h.map((pe) => pe.id === v.id ? v : pe);
|
|
174
|
+
$(W);
|
|
174
175
|
}
|
|
175
176
|
C(null);
|
|
176
177
|
} finally {
|
|
177
|
-
|
|
178
|
+
L(!1);
|
|
178
179
|
}
|
|
179
180
|
},
|
|
180
|
-
[
|
|
181
|
-
),
|
|
181
|
+
[N, U, Y, h, $]
|
|
182
|
+
), et = w(
|
|
182
183
|
async (e) => {
|
|
183
184
|
try {
|
|
184
|
-
|
|
185
|
-
const t =
|
|
186
|
-
|
|
185
|
+
L(!0), z && await z(e);
|
|
186
|
+
const t = h.filter((o) => o.id !== e.id);
|
|
187
|
+
$(t), C(null);
|
|
187
188
|
} finally {
|
|
188
|
-
|
|
189
|
+
L(!1);
|
|
189
190
|
}
|
|
190
191
|
},
|
|
191
|
-
[z,
|
|
192
|
+
[z, h, $]
|
|
192
193
|
), fe = T.start.getTime(), ve = T.end.getTime();
|
|
193
|
-
|
|
194
|
+
st.useEffect(() => {
|
|
194
195
|
if (!P)
|
|
195
196
|
return;
|
|
196
197
|
let e = !1;
|
|
197
198
|
return ge(!0), P({ start: new Date(fe), end: new Date(ve) }).then((t) => {
|
|
198
|
-
e ||
|
|
199
|
+
e || qe(t);
|
|
199
200
|
}).finally(() => {
|
|
200
201
|
e || ge(!1);
|
|
201
202
|
}), () => {
|
|
202
203
|
e = !0;
|
|
203
204
|
};
|
|
204
205
|
}, [P, fe, ve]);
|
|
205
|
-
const
|
|
206
|
-
day:
|
|
207
|
-
week:
|
|
208
|
-
workWeek:
|
|
209
|
-
month:
|
|
210
|
-
timeline:
|
|
211
|
-
agenda:
|
|
212
|
-
dayRange:
|
|
213
|
-
monthRange:
|
|
214
|
-
})[e],
|
|
206
|
+
const tt = (e) => ({
|
|
207
|
+
day: i("day", "Day"),
|
|
208
|
+
week: i("week", "Week"),
|
|
209
|
+
workWeek: i("workWeek", "Work Week"),
|
|
210
|
+
month: i("month", "Month"),
|
|
211
|
+
timeline: i("timeline", "Timeline"),
|
|
212
|
+
agenda: i("agenda", "Agenda"),
|
|
213
|
+
dayRange: i("dayRange", "Day Range"),
|
|
214
|
+
monthRange: i("monthRange", "Month Range")
|
|
215
|
+
})[e], D = {
|
|
215
216
|
events: J,
|
|
216
217
|
curDate: a,
|
|
217
|
-
firstDayOfWeek:
|
|
218
|
+
firstDayOfWeek: p,
|
|
218
219
|
startHour: _e,
|
|
219
220
|
endHour: be,
|
|
220
221
|
draggable: Re,
|
|
221
|
-
dragRef:
|
|
222
|
-
onEventClick:
|
|
223
|
-
onSlotClick:
|
|
222
|
+
dragRef: ze,
|
|
223
|
+
onEventClick: Ze,
|
|
224
|
+
onSlotClick: Xe,
|
|
224
225
|
onEventDrop: ke,
|
|
225
226
|
resources: X,
|
|
226
227
|
timelineDays: R,
|
|
227
|
-
categories:
|
|
228
|
+
categories: g,
|
|
228
229
|
workHours: Ee,
|
|
229
230
|
showCurrentTime: Te,
|
|
230
231
|
renderEvent: Ce,
|
|
231
232
|
showTooltip: A,
|
|
232
233
|
renderTooltip: ae,
|
|
233
|
-
onHoverEvent:
|
|
234
|
+
onHoverEvent: Pe,
|
|
234
235
|
readOnly: b,
|
|
235
|
-
t:
|
|
236
|
+
t: i
|
|
236
237
|
}, we = n === "dayRange" || n === "monthRange", ye = (e) => {
|
|
237
|
-
const t = (
|
|
238
|
+
const t = (o) => o.toString().padStart(2, "0");
|
|
238
239
|
return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}`;
|
|
239
240
|
};
|
|
240
|
-
return
|
|
241
|
+
return Fe ? null : /* @__PURE__ */ u(
|
|
241
242
|
"div",
|
|
242
243
|
{
|
|
243
|
-
className: `nice-scheduler ${m ? "nice-scheduler--disabled" : ""} ${
|
|
244
|
+
className: `nice-scheduler ${m ? "nice-scheduler--disabled" : ""} ${Le || ""}`,
|
|
244
245
|
style: Ie,
|
|
245
246
|
children: [
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ u("div", { className: "nice-scheduler__toolbar", children: [
|
|
248
|
+
/* @__PURE__ */ u("div", { className: "nice-scheduler__nav", children: [
|
|
249
|
+
/* @__PURE__ */ u(Ne, { size: "sm", children: [
|
|
250
|
+
/* @__PURE__ */ s(
|
|
250
251
|
H,
|
|
251
252
|
{
|
|
252
|
-
onClick: () =>
|
|
253
|
+
onClick: () => he(-1),
|
|
253
254
|
disabled: m,
|
|
254
|
-
"aria-label":
|
|
255
|
+
"aria-label": i("previous", "Previous"),
|
|
255
256
|
children: "‹"
|
|
256
257
|
}
|
|
257
258
|
),
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ s(
|
|
259
260
|
H,
|
|
260
261
|
{
|
|
261
262
|
onClick: () => {
|
|
262
263
|
if (we) {
|
|
263
264
|
const e = /* @__PURE__ */ new Date();
|
|
264
265
|
e.setHours(0, 0, 0, 0);
|
|
265
|
-
const t = Math.round((
|
|
266
|
+
const t = Math.round((c.getTime() - d.getTime()) / 864e5);
|
|
266
267
|
j(e), B(r(e, t));
|
|
267
268
|
} else
|
|
268
|
-
|
|
269
|
+
S(/* @__PURE__ */ new Date());
|
|
269
270
|
},
|
|
270
271
|
disabled: m,
|
|
271
|
-
children:
|
|
272
|
+
children: i("today", "Today")
|
|
272
273
|
}
|
|
273
274
|
),
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ s(
|
|
275
276
|
H,
|
|
276
277
|
{
|
|
277
|
-
onClick: () =>
|
|
278
|
+
onClick: () => he(1),
|
|
278
279
|
disabled: m,
|
|
279
|
-
"aria-label":
|
|
280
|
+
"aria-label": i("next", "Next"),
|
|
280
281
|
children: "›"
|
|
281
282
|
}
|
|
282
283
|
)
|
|
283
284
|
] }),
|
|
284
|
-
we ? /* @__PURE__ */
|
|
285
|
-
/* @__PURE__ */
|
|
285
|
+
we ? /* @__PURE__ */ u("span", { className: "nice-scheduler__range-picker", children: [
|
|
286
|
+
/* @__PURE__ */ s(
|
|
286
287
|
"input",
|
|
287
288
|
{
|
|
288
289
|
type: "date",
|
|
289
290
|
className: "nice-textinput nice-textinput--sm",
|
|
290
|
-
value: ye(
|
|
291
|
+
value: ye(d),
|
|
291
292
|
disabled: m,
|
|
292
293
|
onChange: (e) => {
|
|
293
294
|
const t = /* @__PURE__ */ new Date(e.target.value + "T00:00:00");
|
|
@@ -295,107 +296,107 @@ const vt = [
|
|
|
295
296
|
}
|
|
296
297
|
}
|
|
297
298
|
),
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ s("span", { style: { margin: "0 4px" }, children: "–" }),
|
|
300
|
+
/* @__PURE__ */ s(
|
|
300
301
|
"input",
|
|
301
302
|
{
|
|
302
303
|
type: "date",
|
|
303
304
|
className: "nice-textinput nice-textinput--sm",
|
|
304
|
-
value: ye(
|
|
305
|
+
value: ye(c),
|
|
305
306
|
disabled: m,
|
|
306
307
|
onChange: (e) => {
|
|
307
308
|
const t = /* @__PURE__ */ new Date(e.target.value + "T00:00:00");
|
|
308
|
-
!isNaN(t.getTime()) && t >=
|
|
309
|
+
!isNaN(t.getTime()) && t >= d && B(t);
|
|
309
310
|
}
|
|
310
311
|
}
|
|
311
312
|
)
|
|
312
|
-
] }) : /* @__PURE__ */
|
|
313
|
+
] }) : /* @__PURE__ */ s("span", { className: "nice-scheduler__title", children: Qe })
|
|
313
314
|
] }),
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ s("div", { className: "nice-scheduler__views", children: /* @__PURE__ */ s(Ne, { size: "sm", children: yt.map((e) => /* @__PURE__ */ s(
|
|
315
316
|
H,
|
|
316
317
|
{
|
|
317
318
|
variant: e === n ? "primary" : "secondary",
|
|
318
|
-
onClick: () =>
|
|
319
|
+
onClick: () => Ke(e),
|
|
319
320
|
disabled: m,
|
|
320
|
-
children:
|
|
321
|
+
children: tt(e)
|
|
321
322
|
},
|
|
322
323
|
e
|
|
323
324
|
)) }) })
|
|
324
325
|
] }),
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
|
|
327
|
-
/* @__PURE__ */
|
|
328
|
-
|
|
326
|
+
/* @__PURE__ */ u("div", { className: "nice-scheduler__body", children: [
|
|
327
|
+
se && /* @__PURE__ */ u("div", { className: "nice-scheduler__sidebar", children: [
|
|
328
|
+
/* @__PURE__ */ s(
|
|
329
|
+
dt,
|
|
329
330
|
{
|
|
330
331
|
curDate: a,
|
|
331
|
-
onDateSelect: (e) =>
|
|
332
|
-
firstDayOfWeek:
|
|
333
|
-
t:
|
|
332
|
+
onDateSelect: (e) => S(e),
|
|
333
|
+
firstDayOfWeek: p,
|
|
334
|
+
t: i
|
|
334
335
|
}
|
|
335
336
|
),
|
|
336
|
-
ne &&
|
|
337
|
-
|
|
337
|
+
ne && g && /* @__PURE__ */ s(
|
|
338
|
+
Se,
|
|
338
339
|
{
|
|
339
|
-
categories:
|
|
340
|
+
categories: g,
|
|
340
341
|
events: J,
|
|
341
342
|
filteredCategories: E,
|
|
342
|
-
onToggleCategory:
|
|
343
|
-
t:
|
|
343
|
+
onToggleCategory: me,
|
|
344
|
+
t: i
|
|
344
345
|
}
|
|
345
346
|
)
|
|
346
347
|
] }),
|
|
347
|
-
/* @__PURE__ */
|
|
348
|
-
n === "month" && /* @__PURE__ */
|
|
349
|
-
(n === "week" || n === "day" || n === "workWeek") && /* @__PURE__ */
|
|
350
|
-
n === "dayRange" && /* @__PURE__ */
|
|
351
|
-
n === "monthRange" && /* @__PURE__ */
|
|
352
|
-
n === "timeline" && /* @__PURE__ */
|
|
353
|
-
n === "agenda" && /* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ u("div", { className: "nice-scheduler__content", children: [
|
|
349
|
+
n === "month" && /* @__PURE__ */ s(ct, { ...D }),
|
|
350
|
+
(n === "week" || n === "day" || n === "workWeek") && /* @__PURE__ */ s(ut, { ...D, days: I }),
|
|
351
|
+
n === "dayRange" && /* @__PURE__ */ s(gt, { ...D, rangeStart: d, rangeEnd: c }),
|
|
352
|
+
n === "monthRange" && /* @__PURE__ */ s(mt, { ...D, rangeStart: d, rangeEnd: c }),
|
|
353
|
+
n === "timeline" && /* @__PURE__ */ s(ht, { ...D }),
|
|
354
|
+
n === "agenda" && /* @__PURE__ */ s(ft, { ...D })
|
|
354
355
|
] }),
|
|
355
|
-
!
|
|
356
|
-
|
|
356
|
+
!se && ne && g && /* @__PURE__ */ s("div", { className: "nice-scheduler__sidebar nice-scheduler__sidebar--right", children: /* @__PURE__ */ s(
|
|
357
|
+
Se,
|
|
357
358
|
{
|
|
358
|
-
categories:
|
|
359
|
+
categories: g,
|
|
359
360
|
events: J,
|
|
360
361
|
filteredCategories: E,
|
|
361
|
-
onToggleCategory:
|
|
362
|
-
t:
|
|
362
|
+
onToggleCategory: me,
|
|
363
|
+
t: i
|
|
363
364
|
}
|
|
364
365
|
) })
|
|
365
366
|
] }),
|
|
366
|
-
G && /* @__PURE__ */
|
|
367
|
-
|
|
367
|
+
G && /* @__PURE__ */ s(
|
|
368
|
+
vt,
|
|
368
369
|
{
|
|
369
370
|
event: G.event,
|
|
370
371
|
rect: G.rect,
|
|
371
|
-
categories:
|
|
372
|
+
categories: g,
|
|
372
373
|
renderTooltip: ae
|
|
373
374
|
}
|
|
374
375
|
),
|
|
375
|
-
|
|
376
|
-
|
|
376
|
+
N && _ && /* @__PURE__ */ s(
|
|
377
|
+
wt,
|
|
377
378
|
{
|
|
378
|
-
event:
|
|
379
|
-
slotStart:
|
|
380
|
-
slotEnd:
|
|
381
|
-
categories:
|
|
379
|
+
event: N.event,
|
|
380
|
+
slotStart: N.slotStart,
|
|
381
|
+
slotEnd: N.slotEnd,
|
|
382
|
+
categories: g,
|
|
382
383
|
resources: X,
|
|
383
|
-
formFields:
|
|
384
|
-
formFieldsByType:
|
|
385
|
-
eventTypes:
|
|
386
|
-
renderEditor:
|
|
387
|
-
saving:
|
|
388
|
-
onSave:
|
|
389
|
-
onDelete:
|
|
384
|
+
formFields: $e,
|
|
385
|
+
formFieldsByType: xe,
|
|
386
|
+
eventTypes: Me,
|
|
387
|
+
renderEditor: Ve,
|
|
388
|
+
saving: je,
|
|
389
|
+
onSave: Oe,
|
|
390
|
+
onDelete: et,
|
|
390
391
|
onClose: () => C(null),
|
|
391
|
-
t:
|
|
392
|
+
t: i
|
|
392
393
|
}
|
|
393
394
|
)
|
|
394
395
|
]
|
|
395
396
|
}
|
|
396
397
|
);
|
|
397
398
|
};
|
|
398
|
-
process.env.NODE_ENV !== "production" && (
|
|
399
|
+
process.env.NODE_ENV !== "production" && (pt.displayName = "NiceScheduler");
|
|
399
400
|
export {
|
|
400
|
-
|
|
401
|
+
pt as NiceScheduler
|
|
401
402
|
};
|