@talentlytica/prodigy 1.1.1 → 1.2.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/README.md +2 -2
- package/dist/carousel.d.ts +1 -0
- package/dist/carousel.js +2 -0
- package/dist/charts.d.ts +2 -0
- package/dist/charts.js +2 -0
- package/dist/components/index.d.ts +0 -8
- package/dist/data-table.d.ts +1 -0
- package/dist/data-table.js +63 -0
- package/dist/dates.d.ts +1 -0
- package/dist/dates.js +9 -0
- package/dist/dropzone.d.ts +1 -0
- package/dist/dropzone.js +2 -0
- package/dist/index.js +222 -334
- package/dist/notifications.d.ts +1 -0
- package/dist/notifications.js +2 -0
- package/dist/primitives-BiEY8qsh.js +2 -0
- package/dist/rte.d.ts +1 -0
- package/dist/rte.js +43 -0
- package/dist/themes/kelola.d.ts +8 -8
- package/package.json +41 -1
package/dist/index.js
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { useEditor as Je } from "@tiptap/react";
|
|
8
|
-
import Ye from "@tiptap/starter-kit";
|
|
9
|
-
import { Link as Xe, RichTextEditor as q } from "@mantine/tiptap";
|
|
10
|
-
import { Notifications as Ze, notifications as Qe } from "@mantine/notifications";
|
|
11
|
-
import { flexRender as J, getCoreRowModel as $e, getFilteredRowModel as et, getPaginationRowModel as tt, getSortedRowModel as nt, useReactTable as rt } from "@tanstack/react-table";
|
|
12
|
-
import { Carousel as it } from "@mantine/carousel";
|
|
13
|
-
import { BarChart as at, DonutChart as ot } from "@mantine/charts";
|
|
14
|
-
var Y = ze({
|
|
1
|
+
import { a as e, c as t, d as n, f as r, h as i, i as a, l as o, m as s, n as c, o as l, p as u, r as d, s as f, t as p, u as m } from "./primitives-BiEY8qsh.js";
|
|
2
|
+
import { ActionIcon as h, ActionIcon as g, Alert as _, Alert as v, Anchor as y, Anchor as b, AppShell as x, Avatar as S, Avatar as C, Badge as w, Badge as T, Box as E, Breadcrumbs as D, Burger as O, Button as ee, Button as te, Card as ne, Card as re, Checkbox as ie, CloseButton as ae, ColorSwatch as oe, Divider as se, EmptyState as ce, FileButton as le, FileInput as ue, Group as k, Indicator as de, Input as fe, Loader as pe, LoadingOverlay as me, Menu as he, Menu as ge, Modal as _e, Modal as ve, MultiSelect as ye, NativeSelect as be, NavLink as A, Notification as j, NumberInput as M, Paper as N, PasswordInput as xe, Pill as Se, Popover as Ce, Popover as P, Progress as we, Radio as Te, RingProgress as Ee, SegmentedControl as De, SegmentedControl as Oe, Select as ke, Select as F, Skeleton as Ae, Stepper as je, Switch as Me, Table as Ne, Tabs as Pe, TagsInput as Fe, Text as I, Textarea as Ie, ThemeIcon as Le, Tooltip as Re, Tooltip as ze, UnstyledButton as L, VisuallyHidden as Be, createTheme as Ve } from "@mantine/core";
|
|
3
|
+
import { useState as R } from "react";
|
|
4
|
+
import { IconCalendar as z, IconChevronLeft as B, IconChevronRight as V, IconX as H } from "@tabler/icons-react";
|
|
5
|
+
import { jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
6
|
+
var G = Ve({
|
|
15
7
|
primaryColor: "primary",
|
|
16
8
|
primaryShade: 5,
|
|
17
9
|
colors: {
|
|
@@ -157,7 +149,7 @@ var Y = ze({
|
|
|
157
149
|
cursorType: "pointer",
|
|
158
150
|
other: { appBackground: "#F7F7F7" },
|
|
159
151
|
components: {
|
|
160
|
-
Button:
|
|
152
|
+
Button: te.extend({
|
|
161
153
|
defaultProps: {
|
|
162
154
|
variant: "filled",
|
|
163
155
|
size: "sm",
|
|
@@ -166,8 +158,8 @@ var Y = ze({
|
|
|
166
158
|
styles: { label: { fontWeight: 700 } },
|
|
167
159
|
vars: (e, t) => t.variant === "subtle" ? { root: { "--button-color": `var(--mantine-color-${t.color || e.primaryColor}-5)` } } : { root: {} }
|
|
168
160
|
}),
|
|
169
|
-
Input:
|
|
170
|
-
Badge:
|
|
161
|
+
Input: fe.extend({ defaultProps: { radius: "xl" } }),
|
|
162
|
+
Badge: T.extend({
|
|
171
163
|
defaultProps: {
|
|
172
164
|
variant: "light",
|
|
173
165
|
radius: "xl"
|
|
@@ -175,45 +167,36 @@ var Y = ze({
|
|
|
175
167
|
vars: (e, t) => t.variant === "light" ? { root: { "--badge-color": `var(--mantine-color-${t.color || e.primaryColor}-5)` } } : { root: {} },
|
|
176
168
|
styles: (e, t) => t.variant === "dot" ? { label: { color: `var(--mantine-color-${t.color || e.primaryColor}-5)` } } : {}
|
|
177
169
|
}),
|
|
178
|
-
Avatar:
|
|
179
|
-
Alert:
|
|
180
|
-
Anchor:
|
|
181
|
-
Card:
|
|
170
|
+
Avatar: C.extend({ defaultProps: { radius: 9999 } }),
|
|
171
|
+
Alert: v.extend({ defaultProps: { variant: "light" } }),
|
|
172
|
+
Anchor: b.extend({ defaultProps: { underline: "hover" } }),
|
|
173
|
+
Card: re.extend({ defaultProps: {
|
|
182
174
|
withBorder: !0,
|
|
183
175
|
shadow: "md",
|
|
184
176
|
radius: "md",
|
|
185
177
|
padding: "lg"
|
|
186
178
|
} }),
|
|
187
|
-
Tooltip:
|
|
188
|
-
ActionIcon:
|
|
179
|
+
Tooltip: ze.extend({ defaultProps: { withArrow: !0 } }),
|
|
180
|
+
ActionIcon: g.extend({ defaultProps: {
|
|
189
181
|
variant: "subtle",
|
|
190
182
|
color: "gray"
|
|
191
183
|
} }),
|
|
192
|
-
Menu:
|
|
184
|
+
Menu: ge.extend({ defaultProps: {
|
|
193
185
|
shadow: "md",
|
|
194
186
|
radius: "md"
|
|
195
187
|
} }),
|
|
196
|
-
Modal:
|
|
188
|
+
Modal: ve.extend({ defaultProps: {
|
|
197
189
|
centered: !0,
|
|
198
190
|
radius: "md"
|
|
199
191
|
} }),
|
|
200
|
-
Table:
|
|
192
|
+
Table: Ne.extend({ defaultProps: {
|
|
201
193
|
highlightOnHover: !0,
|
|
202
194
|
verticalSpacing: "sm",
|
|
203
195
|
horizontalSpacing: "md"
|
|
204
196
|
} }),
|
|
205
|
-
SegmentedControl:
|
|
197
|
+
SegmentedControl: Oe.extend({ defaultProps: { radius: "xl" } })
|
|
206
198
|
}
|
|
207
|
-
})
|
|
208
|
-
//#endregion
|
|
209
|
-
//#region src/components/DatePickerInput/DatePickerInput.tsx
|
|
210
|
-
function st(e) {
|
|
211
|
-
let { withTime: t, ...n } = e;
|
|
212
|
-
return B(t ? Ve : Be, { ...n });
|
|
213
|
-
}
|
|
214
|
-
//#endregion
|
|
215
|
-
//#region src/components/DateTimePicker/DateTimePicker.tsx
|
|
216
|
-
var ct = [
|
|
199
|
+
}), He = [
|
|
217
200
|
"January",
|
|
218
201
|
"February",
|
|
219
202
|
"March",
|
|
@@ -226,7 +209,7 @@ var ct = [
|
|
|
226
209
|
"October",
|
|
227
210
|
"November",
|
|
228
211
|
"December"
|
|
229
|
-
],
|
|
212
|
+
], Ue = [
|
|
230
213
|
"Mo",
|
|
231
214
|
"Tu",
|
|
232
215
|
"We",
|
|
@@ -235,21 +218,21 @@ var ct = [
|
|
|
235
218
|
"Sa",
|
|
236
219
|
"Su"
|
|
237
220
|
];
|
|
238
|
-
function
|
|
221
|
+
function K(e, t) {
|
|
239
222
|
return new Date(e, t + 1, 0).getDate();
|
|
240
223
|
}
|
|
241
|
-
function
|
|
224
|
+
function We(e, t) {
|
|
242
225
|
let n = new Date(e, t, 1).getDay();
|
|
243
226
|
return n === 0 ? 6 : n - 1;
|
|
244
227
|
}
|
|
245
|
-
function
|
|
228
|
+
function Ge(e) {
|
|
246
229
|
return e === 5 || e === 6;
|
|
247
230
|
}
|
|
248
|
-
function
|
|
231
|
+
function Ke(e, t, n) {
|
|
249
232
|
return e ? `${e.getDate().toString().padStart(2, "0")}/${(e.getMonth() + 1).toString().padStart(2, "0")}/${e.getFullYear()} ${t.toString().padStart(2, "0")}:${n.toString().padStart(2, "0")}` : "";
|
|
250
233
|
}
|
|
251
|
-
function
|
|
252
|
-
let i =
|
|
234
|
+
function qe({ viewYear: e, viewMonth: t, selectedDate: n, onSelect: r }) {
|
|
235
|
+
let i = K(e, t), a = We(e, t), o = K(e, t - 1), s = [];
|
|
253
236
|
for (let e = a - 1; e >= 0; e--) s.push({
|
|
254
237
|
day: o - e,
|
|
255
238
|
month: "prev"
|
|
@@ -264,29 +247,29 @@ function mt({ viewYear: e, viewMonth: t, selectedDate: n, onSelect: r }) {
|
|
|
264
247
|
month: "next"
|
|
265
248
|
});
|
|
266
249
|
let l = /* @__PURE__ */ new Date(), u = new Date(l.getFullYear(), l.getMonth(), l.getDate()).getTime();
|
|
267
|
-
return /* @__PURE__ */
|
|
250
|
+
return /* @__PURE__ */ W(E, {
|
|
268
251
|
style: { width: 252 },
|
|
269
|
-
children: [/* @__PURE__ */
|
|
252
|
+
children: [/* @__PURE__ */ U(E, {
|
|
270
253
|
style: {
|
|
271
254
|
display: "grid",
|
|
272
255
|
gridTemplateColumns: "repeat(7, 36px)",
|
|
273
256
|
marginBottom: 4
|
|
274
257
|
},
|
|
275
|
-
children:
|
|
258
|
+
children: Ue.map((e, t) => /* @__PURE__ */ U(I, {
|
|
276
259
|
fz: 10,
|
|
277
260
|
ta: "center",
|
|
278
261
|
c: t >= 5 ? "red.6" : "neutral.5",
|
|
279
262
|
style: { lineHeight: "28px" },
|
|
280
263
|
children: e
|
|
281
264
|
}, e))
|
|
282
|
-
}), /* @__PURE__ */
|
|
265
|
+
}), /* @__PURE__ */ U(E, {
|
|
283
266
|
style: {
|
|
284
267
|
display: "grid",
|
|
285
268
|
gridTemplateColumns: "repeat(7, 36px)"
|
|
286
269
|
},
|
|
287
270
|
children: s.map((i, a) => {
|
|
288
|
-
let o = a % 7, s = i.month === "current", c = !!(s && n && n.getDate() === i.day && n.getMonth() === t && n.getFullYear() === e), d = s && l.getDate() === i.day && l.getMonth() === t && l.getFullYear() === e, f = s && new Date(e, t, i.day).getTime() < u, p = !s || f, m =
|
|
289
|
-
return /* @__PURE__ */
|
|
271
|
+
let o = a % 7, s = i.month === "current", c = !!(s && n && n.getDate() === i.day && n.getMonth() === t && n.getFullYear() === e), d = s && l.getDate() === i.day && l.getMonth() === t && l.getFullYear() === e, f = s && new Date(e, t, i.day).getTime() < u, p = !s || f, m = Ge(o);
|
|
272
|
+
return /* @__PURE__ */ U(L, {
|
|
290
273
|
onClick: () => !p && r(i.day),
|
|
291
274
|
style: {
|
|
292
275
|
width: 36,
|
|
@@ -299,7 +282,7 @@ function mt({ viewYear: e, viewMonth: t, selectedDate: n, onSelect: r }) {
|
|
|
299
282
|
cursor: p ? "not-allowed" : "pointer",
|
|
300
283
|
outline: d && !c ? "2px solid var(--mantine-primary-color-5)" : "none"
|
|
301
284
|
},
|
|
302
|
-
children: /* @__PURE__ */
|
|
285
|
+
children: /* @__PURE__ */ U(I, {
|
|
303
286
|
fz: 13,
|
|
304
287
|
td: f ? "line-through" : void 0,
|
|
305
288
|
c: c ? "white" : p ? "neutral.3" : m ? "red.6" : "neutral.7",
|
|
@@ -310,49 +293,49 @@ function mt({ viewYear: e, viewMonth: t, selectedDate: n, onSelect: r }) {
|
|
|
310
293
|
})]
|
|
311
294
|
});
|
|
312
295
|
}
|
|
313
|
-
function
|
|
314
|
-
let
|
|
296
|
+
function q({ value: e, onChange: t, placeholder: n = "Pilih tanggal & jam" }) {
|
|
297
|
+
let r = e instanceof Date ? e : /* @__PURE__ */ new Date(), [i, a] = R(!1), [o, s] = R(r.getFullYear()), [c, l] = R(r.getMonth()), [u, d] = R(e instanceof Date ? e : null), [f, p] = R(e instanceof Date ? e.getHours() : 0), [m, h] = R(e instanceof Date ? e.getMinutes() : 0), _ = /* @__PURE__ */ new Date(), v = !!(u && u.getDate() === _.getDate() && u.getMonth() === _.getMonth() && u.getFullYear() === _.getFullYear()), y = Array.from({ length: 24 }, (e, t) => ({
|
|
315
298
|
value: String(t),
|
|
316
299
|
label: String(t).padStart(2, "0"),
|
|
317
|
-
disabled:
|
|
318
|
-
})),
|
|
300
|
+
disabled: v && t < _.getHours()
|
|
301
|
+
})), b = Array.from({ length: 60 }, (e, t) => ({
|
|
319
302
|
value: String(t),
|
|
320
303
|
label: String(t).padStart(2, "0"),
|
|
321
|
-
disabled:
|
|
322
|
-
})),
|
|
323
|
-
|
|
324
|
-
},
|
|
325
|
-
|
|
304
|
+
disabled: v && f === _.getHours() && t < _.getMinutes()
|
|
305
|
+
})), x = () => {
|
|
306
|
+
c === 0 ? (l(11), s((e) => e - 1)) : l((e) => e - 1);
|
|
307
|
+
}, S = () => {
|
|
308
|
+
c === 11 ? (l(0), s((e) => e + 1)) : l((e) => e + 1);
|
|
309
|
+
}, C = (e) => {
|
|
310
|
+
let n = f, r = m, i = new Date(o, c, e);
|
|
311
|
+
i.getDate() === _.getDate() && i.getMonth() === _.getMonth() && i.getFullYear() === _.getFullYear() && (n < _.getHours() || n === _.getHours() && r < _.getMinutes()) && (n = _.getHours(), r = _.getMinutes(), p(n), h(r));
|
|
312
|
+
let a = new Date(o, c, e, n, r);
|
|
313
|
+
d(a), t?.(a);
|
|
326
314
|
}, w = (e) => {
|
|
327
|
-
let
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}, T = (e) => {
|
|
332
|
-
let t = Number(e);
|
|
333
|
-
if (h(t), d) {
|
|
334
|
-
let e = new Date(d);
|
|
335
|
-
e.setHours(t), p(e), n?.(e);
|
|
315
|
+
let n = Number(e);
|
|
316
|
+
if (p(n), u) {
|
|
317
|
+
let e = new Date(u);
|
|
318
|
+
e.setHours(n), d(e), t?.(e);
|
|
336
319
|
}
|
|
337
|
-
},
|
|
338
|
-
let
|
|
339
|
-
if (
|
|
340
|
-
let e = new Date(
|
|
341
|
-
e.setMinutes(
|
|
320
|
+
}, T = (e) => {
|
|
321
|
+
let n = Number(e);
|
|
322
|
+
if (h(n), u) {
|
|
323
|
+
let e = new Date(u);
|
|
324
|
+
e.setMinutes(n), d(e), t?.(e);
|
|
342
325
|
}
|
|
343
326
|
}, D = (e) => {
|
|
344
|
-
e.stopPropagation(),
|
|
345
|
-
}, O =
|
|
346
|
-
return /* @__PURE__ */
|
|
347
|
-
opened:
|
|
348
|
-
onChange:
|
|
327
|
+
e.stopPropagation(), d(null), p(0), h(0), t?.(null);
|
|
328
|
+
}, O = Ke(u, f, m);
|
|
329
|
+
return /* @__PURE__ */ W(P, {
|
|
330
|
+
opened: i,
|
|
331
|
+
onChange: a,
|
|
349
332
|
position: "bottom-start",
|
|
350
333
|
offset: 4,
|
|
351
334
|
shadow: "md",
|
|
352
335
|
radius: "md",
|
|
353
336
|
trapFocus: !0,
|
|
354
|
-
children: [/* @__PURE__ */
|
|
355
|
-
onClick: () =>
|
|
337
|
+
children: [/* @__PURE__ */ U(P.Target, { children: /* @__PURE__ */ W(E, {
|
|
338
|
+
onClick: () => a((e) => !e),
|
|
356
339
|
style: {
|
|
357
340
|
display: "flex",
|
|
358
341
|
alignItems: "center",
|
|
@@ -367,12 +350,12 @@ function ht({ value: e, onChange: n, placeholder: r = "Pilih tanggal & jam" }) {
|
|
|
367
350
|
minWidth: 0
|
|
368
351
|
},
|
|
369
352
|
children: [
|
|
370
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ U(z, {
|
|
371
354
|
size: 16,
|
|
372
355
|
color: "var(--mantine-color-gray-5)",
|
|
373
356
|
style: { flexShrink: 0 }
|
|
374
357
|
}),
|
|
375
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ U(I, {
|
|
376
359
|
fz: 12,
|
|
377
360
|
c: O ? "neutral.7" : "neutral.4",
|
|
378
361
|
style: {
|
|
@@ -381,9 +364,9 @@ function ht({ value: e, onChange: n, placeholder: r = "Pilih tanggal & jam" }) {
|
|
|
381
364
|
textOverflow: "ellipsis",
|
|
382
365
|
whiteSpace: "nowrap"
|
|
383
366
|
},
|
|
384
|
-
children: O ||
|
|
367
|
+
children: O || n
|
|
385
368
|
}),
|
|
386
|
-
|
|
369
|
+
u && /* @__PURE__ */ U(E, {
|
|
387
370
|
component: "span",
|
|
388
371
|
onClick: D,
|
|
389
372
|
style: {
|
|
@@ -391,89 +374,89 @@ function ht({ value: e, onChange: n, placeholder: r = "Pilih tanggal & jam" }) {
|
|
|
391
374
|
alignItems: "center",
|
|
392
375
|
flexShrink: 0
|
|
393
376
|
},
|
|
394
|
-
children: /* @__PURE__ */
|
|
377
|
+
children: /* @__PURE__ */ U(H, {
|
|
395
378
|
size: 14,
|
|
396
379
|
color: "var(--mantine-color-gray-5)"
|
|
397
380
|
})
|
|
398
381
|
})
|
|
399
382
|
]
|
|
400
|
-
}) }), /* @__PURE__ */
|
|
383
|
+
}) }), /* @__PURE__ */ W(P.Dropdown, {
|
|
401
384
|
p: "md",
|
|
402
385
|
style: { minWidth: 280 },
|
|
403
386
|
children: [
|
|
404
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ W(k, {
|
|
405
388
|
justify: "space-between",
|
|
406
389
|
align: "center",
|
|
407
390
|
mb: 8,
|
|
408
391
|
children: [
|
|
409
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ U(g, {
|
|
410
393
|
variant: "subtle",
|
|
411
394
|
color: "gray",
|
|
412
395
|
size: "sm",
|
|
413
|
-
onClick:
|
|
414
|
-
children: /* @__PURE__ */ B
|
|
396
|
+
onClick: x,
|
|
397
|
+
children: /* @__PURE__ */ U(B, { size: 14 })
|
|
415
398
|
}),
|
|
416
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ W(I, {
|
|
417
400
|
fz: 12,
|
|
418
401
|
fw: 700,
|
|
419
402
|
c: "neutral.7",
|
|
420
403
|
children: [
|
|
421
|
-
|
|
404
|
+
He[c],
|
|
422
405
|
" ",
|
|
423
|
-
|
|
406
|
+
o
|
|
424
407
|
]
|
|
425
408
|
}),
|
|
426
|
-
/* @__PURE__ */
|
|
409
|
+
/* @__PURE__ */ U(g, {
|
|
427
410
|
variant: "subtle",
|
|
428
411
|
color: "gray",
|
|
429
412
|
size: "sm",
|
|
430
|
-
onClick:
|
|
431
|
-
children: /* @__PURE__ */
|
|
413
|
+
onClick: S,
|
|
414
|
+
children: /* @__PURE__ */ U(V, { size: 14 })
|
|
432
415
|
})
|
|
433
416
|
]
|
|
434
417
|
}),
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
-
viewYear:
|
|
437
|
-
viewMonth:
|
|
438
|
-
selectedDate:
|
|
439
|
-
onSelect:
|
|
418
|
+
/* @__PURE__ */ U(qe, {
|
|
419
|
+
viewYear: o,
|
|
420
|
+
viewMonth: c,
|
|
421
|
+
selectedDate: u,
|
|
422
|
+
onSelect: C
|
|
440
423
|
}),
|
|
441
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ U(E, { style: {
|
|
442
425
|
height: 1,
|
|
443
426
|
background: "var(--mantine-color-gray-2)",
|
|
444
427
|
margin: "12px 0"
|
|
445
428
|
} }),
|
|
446
|
-
/* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ W(k, {
|
|
447
430
|
gap: 8,
|
|
448
431
|
align: "center",
|
|
449
432
|
wrap: "nowrap",
|
|
450
433
|
children: [
|
|
451
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ U(I, {
|
|
452
435
|
fz: 12,
|
|
453
436
|
c: "neutral.6",
|
|
454
437
|
style: { flexShrink: 0 },
|
|
455
438
|
children: "Jam"
|
|
456
439
|
}),
|
|
457
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ U(F, {
|
|
458
441
|
radius: "xl",
|
|
459
|
-
value: String(
|
|
460
|
-
onChange:
|
|
461
|
-
data:
|
|
442
|
+
value: String(f),
|
|
443
|
+
onChange: w,
|
|
444
|
+
data: y,
|
|
462
445
|
w: 72,
|
|
463
446
|
size: "xs",
|
|
464
447
|
searchable: !0
|
|
465
448
|
}),
|
|
466
|
-
/* @__PURE__ */
|
|
449
|
+
/* @__PURE__ */ U(I, {
|
|
467
450
|
fz: 12,
|
|
468
451
|
c: "neutral.6",
|
|
469
452
|
style: { flexShrink: 0 },
|
|
470
453
|
children: "Menit"
|
|
471
454
|
}),
|
|
472
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ U(F, {
|
|
473
456
|
radius: "xl",
|
|
474
|
-
value: String(
|
|
475
|
-
onChange:
|
|
476
|
-
data:
|
|
457
|
+
value: String(m),
|
|
458
|
+
onChange: T,
|
|
459
|
+
data: b,
|
|
477
460
|
w: 72,
|
|
478
461
|
size: "xs",
|
|
479
462
|
searchable: !0
|
|
@@ -486,7 +469,7 @@ function ht({ value: e, onChange: n, placeholder: r = "Pilih tanggal & jam" }) {
|
|
|
486
469
|
}
|
|
487
470
|
//#endregion
|
|
488
471
|
//#region src/components/DateTimeRangePicker/DateTimeRangePicker.tsx
|
|
489
|
-
var
|
|
472
|
+
var J = [
|
|
490
473
|
"January",
|
|
491
474
|
"February",
|
|
492
475
|
"March",
|
|
@@ -499,7 +482,7 @@ var X = [
|
|
|
499
482
|
"October",
|
|
500
483
|
"November",
|
|
501
484
|
"December"
|
|
502
|
-
],
|
|
485
|
+
], Je = [
|
|
503
486
|
"Mo",
|
|
504
487
|
"Tu",
|
|
505
488
|
"We",
|
|
@@ -508,27 +491,27 @@ var X = [
|
|
|
508
491
|
"Sa",
|
|
509
492
|
"Su"
|
|
510
493
|
];
|
|
511
|
-
function
|
|
494
|
+
function Y(e, t) {
|
|
512
495
|
return new Date(e, t + 1, 0).getDate();
|
|
513
496
|
}
|
|
514
|
-
function
|
|
497
|
+
function Ye(e, t) {
|
|
515
498
|
let n = new Date(e, t, 1).getDay();
|
|
516
499
|
return n === 0 ? 6 : n - 1;
|
|
517
500
|
}
|
|
518
|
-
function
|
|
501
|
+
function Xe(e) {
|
|
519
502
|
return e === 5 || e === 6;
|
|
520
503
|
}
|
|
521
|
-
function
|
|
504
|
+
function X(e, t) {
|
|
522
505
|
return !e || !t ? !1 : e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
|
|
523
506
|
}
|
|
524
|
-
function
|
|
507
|
+
function Z(e, t, n) {
|
|
525
508
|
return new Date(e, t, n).setHours(0, 0, 0, 0);
|
|
526
509
|
}
|
|
527
|
-
function
|
|
510
|
+
function Q(e) {
|
|
528
511
|
return e ? `${e.getDate().toString().padStart(2, "0")}/${(e.getMonth() + 1).toString().padStart(2, "0")}/${e.getFullYear()} ${e.getHours().toString().padStart(2, "0")}:${e.getMinutes().toString().padStart(2, "0")}` : "";
|
|
529
512
|
}
|
|
530
513
|
function $({ viewYear: e, viewMonth: t, start: n, end: r, onSelect: i }) {
|
|
531
|
-
let a =
|
|
514
|
+
let a = Y(e, t), o = Ye(e, t), s = Y(e, t - 1), c = [];
|
|
532
515
|
for (let e = o - 1; e >= 0; e--) c.push({
|
|
533
516
|
day: s - e,
|
|
534
517
|
month: "prev"
|
|
@@ -542,42 +525,42 @@ function $({ viewYear: e, viewMonth: t, start: n, end: r, onSelect: i }) {
|
|
|
542
525
|
day: e,
|
|
543
526
|
month: "next"
|
|
544
527
|
});
|
|
545
|
-
let u = /* @__PURE__ */ new Date(), d = new Date(u.getFullYear(), u.getMonth(), u.getDate()).getTime(),
|
|
546
|
-
return /* @__PURE__ */
|
|
528
|
+
let u = /* @__PURE__ */ new Date(), d = new Date(u.getFullYear(), u.getMonth(), u.getDate()).getTime(), f = n ? Z(n.getFullYear(), n.getMonth(), n.getDate()) : null, p = r ? Z(r.getFullYear(), r.getMonth(), r.getDate()) : null;
|
|
529
|
+
return /* @__PURE__ */ W(E, {
|
|
547
530
|
style: { width: 252 },
|
|
548
|
-
children: [/* @__PURE__ */
|
|
531
|
+
children: [/* @__PURE__ */ U(E, {
|
|
549
532
|
style: {
|
|
550
533
|
display: "grid",
|
|
551
534
|
gridTemplateColumns: "repeat(7, 36px)",
|
|
552
535
|
marginBottom: 4
|
|
553
536
|
},
|
|
554
|
-
children:
|
|
537
|
+
children: Je.map((e, t) => /* @__PURE__ */ U(I, {
|
|
555
538
|
fz: 10,
|
|
556
539
|
ta: "center",
|
|
557
540
|
c: t >= 5 ? "red.6" : "neutral.5",
|
|
558
541
|
style: { lineHeight: "28px" },
|
|
559
542
|
children: e
|
|
560
543
|
}, e))
|
|
561
|
-
}), /* @__PURE__ */
|
|
544
|
+
}), /* @__PURE__ */ U(E, {
|
|
562
545
|
style: {
|
|
563
546
|
display: "grid",
|
|
564
547
|
gridTemplateColumns: "repeat(7, 36px)"
|
|
565
548
|
},
|
|
566
549
|
children: c.map((a, o) => {
|
|
567
|
-
let s = o % 7, c = a.month === "current", l = c ?
|
|
568
|
-
return /* @__PURE__ */
|
|
550
|
+
let s = o % 7, c = a.month === "current", l = c ? Z(e, t, a.day) : null, m = c ? new Date(e, t, a.day) : null, h = c && X(m, n), g = c && X(m, r), _ = h || g, v = !!(c && l !== null && f !== null && p !== null && l > f && l < p), y = c && u.getDate() === a.day && u.getMonth() === t && u.getFullYear() === e, b = c && l !== null && l < d, x = !c || b, S = Xe(s);
|
|
551
|
+
return /* @__PURE__ */ U(E, {
|
|
569
552
|
style: {
|
|
570
553
|
display: "flex",
|
|
571
554
|
alignItems: "center",
|
|
572
555
|
justifyContent: "center",
|
|
573
|
-
background:
|
|
574
|
-
borderTopLeftRadius:
|
|
575
|
-
borderBottomLeftRadius:
|
|
576
|
-
borderTopRightRadius:
|
|
577
|
-
borderBottomRightRadius:
|
|
556
|
+
background: v ? "var(--mantine-color-primary-1)" : "transparent",
|
|
557
|
+
borderTopLeftRadius: h || v && s === 0 ? 999 : 0,
|
|
558
|
+
borderBottomLeftRadius: h || v && s === 0 ? 999 : 0,
|
|
559
|
+
borderTopRightRadius: g || v && s === 6 ? 999 : 0,
|
|
560
|
+
borderBottomRightRadius: g || v && s === 6 ? 999 : 0
|
|
578
561
|
},
|
|
579
|
-
children: /* @__PURE__ */
|
|
580
|
-
onClick: () => !
|
|
562
|
+
children: /* @__PURE__ */ U(L, {
|
|
563
|
+
onClick: () => !x && i(e, t, a.day),
|
|
581
564
|
style: {
|
|
582
565
|
width: 36,
|
|
583
566
|
height: 36,
|
|
@@ -585,14 +568,14 @@ function $({ viewYear: e, viewMonth: t, start: n, end: r, onSelect: i }) {
|
|
|
585
568
|
alignItems: "center",
|
|
586
569
|
justifyContent: "center",
|
|
587
570
|
borderRadius: "50%",
|
|
588
|
-
background:
|
|
589
|
-
cursor:
|
|
590
|
-
outline:
|
|
571
|
+
background: _ ? "var(--mantine-primary-color-5)" : "transparent",
|
|
572
|
+
cursor: x ? "not-allowed" : "pointer",
|
|
573
|
+
outline: y && !_ ? "2px solid var(--mantine-primary-color-5)" : "none"
|
|
591
574
|
},
|
|
592
|
-
children: /* @__PURE__ */
|
|
575
|
+
children: /* @__PURE__ */ U(I, {
|
|
593
576
|
fz: 13,
|
|
594
|
-
td:
|
|
595
|
-
c:
|
|
577
|
+
td: b ? "line-through" : void 0,
|
|
578
|
+
c: _ ? "white" : x ? "neutral.3" : S ? "red.6" : "neutral.7",
|
|
596
579
|
children: a.day
|
|
597
580
|
})
|
|
598
581
|
})
|
|
@@ -601,56 +584,56 @@ function $({ viewYear: e, viewMonth: t, start: n, end: r, onSelect: i }) {
|
|
|
601
584
|
})]
|
|
602
585
|
});
|
|
603
586
|
}
|
|
604
|
-
function
|
|
605
|
-
let
|
|
587
|
+
function Ze({ value: e, onChange: t, placeholder: n = "Pilih periode" }) {
|
|
588
|
+
let r = e?.[0] instanceof Date ? e[0] : /* @__PURE__ */ new Date(), [i, a] = R(!1), [o, s] = R(r.getFullYear()), [c, l] = R(r.getMonth()), [u, d] = R(e?.[0] instanceof Date ? e[0] : null), [f, p] = R(e?.[1] instanceof Date ? e[1] : null), m = c === 11 ? o + 1 : o, h = c === 11 ? 0 : c + 1, _ = /* @__PURE__ */ new Date(), v = (e) => Array.from({ length: 24 }, (t, n) => ({
|
|
606
589
|
value: String(n),
|
|
607
590
|
label: String(n).padStart(2, "0"),
|
|
608
|
-
disabled:
|
|
609
|
-
})),
|
|
591
|
+
disabled: X(e, _) && n < _.getHours()
|
|
592
|
+
})), y = (e) => Array.from({ length: 60 }, (t, n) => ({
|
|
610
593
|
value: String(n),
|
|
611
594
|
label: String(n).padStart(2, "0"),
|
|
612
|
-
disabled:
|
|
613
|
-
})),
|
|
614
|
-
|
|
615
|
-
},
|
|
616
|
-
|
|
617
|
-
},
|
|
618
|
-
if (!
|
|
619
|
-
let r =
|
|
620
|
-
|
|
595
|
+
disabled: X(e, _) && e !== null && e.getHours() === _.getHours() && n < _.getMinutes()
|
|
596
|
+
})), b = () => {
|
|
597
|
+
c === 0 ? (l(11), s((e) => e - 1)) : l((e) => e - 1);
|
|
598
|
+
}, x = () => {
|
|
599
|
+
c === 11 ? (l(0), s((e) => e + 1)) : l((e) => e + 1);
|
|
600
|
+
}, S = (e, n) => t?.([e, n]), C = (e) => X(e, _) && e.getTime() < _.getTime() ? new Date(_.getFullYear(), _.getMonth(), _.getDate(), _.getHours(), _.getMinutes()) : e, w = (e, t, n) => {
|
|
601
|
+
if (!u || u && f) {
|
|
602
|
+
let r = u?.getHours() ?? 0, i = u?.getMinutes() ?? 0, a = C(new Date(e, t, n, r, i));
|
|
603
|
+
d(a), p(null), S(a, null);
|
|
621
604
|
return;
|
|
622
605
|
}
|
|
623
|
-
if (new Date(e, t, n,
|
|
624
|
-
let r =
|
|
625
|
-
|
|
606
|
+
if (new Date(e, t, n, f?.getHours() ?? 0, f?.getMinutes() ?? 0).setHours(0, 0, 0, 0) < new Date(u).setHours(0, 0, 0, 0)) {
|
|
607
|
+
let r = C(new Date(e, t, n, u.getHours(), u.getMinutes()));
|
|
608
|
+
d(r), p(null), S(r, null);
|
|
626
609
|
return;
|
|
627
610
|
}
|
|
628
|
-
let r =
|
|
629
|
-
|
|
630
|
-
},
|
|
611
|
+
let r = C(new Date(e, t, n, f?.getHours() ?? 0, f?.getMinutes() ?? 0));
|
|
612
|
+
p(r), S(u, r);
|
|
613
|
+
}, T = (e, t, n) => {
|
|
631
614
|
let r = Number(n);
|
|
632
615
|
if (e === "start") {
|
|
633
|
-
if (!
|
|
634
|
-
let e = new Date(
|
|
635
|
-
t === "h" ? e.setHours(r) : e.setMinutes(r),
|
|
616
|
+
if (!u) return;
|
|
617
|
+
let e = new Date(u);
|
|
618
|
+
t === "h" ? e.setHours(r) : e.setMinutes(r), d(e), S(e, f);
|
|
636
619
|
} else {
|
|
637
|
-
if (!
|
|
638
|
-
let e = new Date(
|
|
639
|
-
t === "h" ? e.setHours(r) : e.setMinutes(r),
|
|
620
|
+
if (!f) return;
|
|
621
|
+
let e = new Date(f);
|
|
622
|
+
t === "h" ? e.setHours(r) : e.setMinutes(r), p(e), S(u, e);
|
|
640
623
|
}
|
|
641
624
|
}, D = (e) => {
|
|
642
|
-
e.stopPropagation(),
|
|
643
|
-
}, O =
|
|
644
|
-
return /* @__PURE__ */
|
|
645
|
-
opened:
|
|
646
|
-
onChange:
|
|
625
|
+
e.stopPropagation(), d(null), p(null), S(null, null);
|
|
626
|
+
}, O = u ? `${Q(u)}${f ? ` - ${Q(f)}` : ""}` : "";
|
|
627
|
+
return /* @__PURE__ */ W(P, {
|
|
628
|
+
opened: i,
|
|
629
|
+
onChange: a,
|
|
647
630
|
position: "bottom-start",
|
|
648
631
|
offset: 4,
|
|
649
632
|
shadow: "md",
|
|
650
633
|
radius: "md",
|
|
651
634
|
trapFocus: !0,
|
|
652
|
-
children: [/* @__PURE__ */
|
|
653
|
-
onClick: () =>
|
|
635
|
+
children: [/* @__PURE__ */ U(P.Target, { children: /* @__PURE__ */ W(E, {
|
|
636
|
+
onClick: () => a((e) => !e),
|
|
654
637
|
style: {
|
|
655
638
|
display: "flex",
|
|
656
639
|
alignItems: "center",
|
|
@@ -665,12 +648,12 @@ function xt({ value: e, onChange: n, placeholder: r = "Pilih periode" }) {
|
|
|
665
648
|
minWidth: 0
|
|
666
649
|
},
|
|
667
650
|
children: [
|
|
668
|
-
/* @__PURE__ */
|
|
651
|
+
/* @__PURE__ */ U(z, {
|
|
669
652
|
size: 16,
|
|
670
653
|
color: "var(--mantine-color-gray-5)",
|
|
671
654
|
style: { flexShrink: 0 }
|
|
672
655
|
}),
|
|
673
|
-
/* @__PURE__ */
|
|
656
|
+
/* @__PURE__ */ U(I, {
|
|
674
657
|
fz: 12,
|
|
675
658
|
c: O ? "neutral.7" : "neutral.4",
|
|
676
659
|
style: {
|
|
@@ -679,9 +662,9 @@ function xt({ value: e, onChange: n, placeholder: r = "Pilih periode" }) {
|
|
|
679
662
|
textOverflow: "ellipsis",
|
|
680
663
|
whiteSpace: "nowrap"
|
|
681
664
|
},
|
|
682
|
-
children: O ||
|
|
665
|
+
children: O || n
|
|
683
666
|
}),
|
|
684
|
-
|
|
667
|
+
u && /* @__PURE__ */ U(E, {
|
|
685
668
|
component: "span",
|
|
686
669
|
onClick: D,
|
|
687
670
|
style: {
|
|
@@ -689,165 +672,165 @@ function xt({ value: e, onChange: n, placeholder: r = "Pilih periode" }) {
|
|
|
689
672
|
alignItems: "center",
|
|
690
673
|
flexShrink: 0
|
|
691
674
|
},
|
|
692
|
-
children: /* @__PURE__ */
|
|
675
|
+
children: /* @__PURE__ */ U(H, {
|
|
693
676
|
size: 14,
|
|
694
677
|
color: "var(--mantine-color-gray-5)"
|
|
695
678
|
})
|
|
696
679
|
})
|
|
697
680
|
]
|
|
698
|
-
}) }), /* @__PURE__ */
|
|
681
|
+
}) }), /* @__PURE__ */ W(P.Dropdown, {
|
|
699
682
|
p: "md",
|
|
700
683
|
children: [
|
|
701
|
-
/* @__PURE__ */
|
|
684
|
+
/* @__PURE__ */ W(k, {
|
|
702
685
|
align: "flex-start",
|
|
703
686
|
gap: 24,
|
|
704
687
|
wrap: "nowrap",
|
|
705
|
-
children: [/* @__PURE__ */
|
|
688
|
+
children: [/* @__PURE__ */ W(E, { children: [/* @__PURE__ */ W(k, {
|
|
706
689
|
justify: "space-between",
|
|
707
690
|
align: "center",
|
|
708
691
|
mb: 8,
|
|
709
692
|
children: [
|
|
710
|
-
/* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ U(g, {
|
|
711
694
|
variant: "subtle",
|
|
712
695
|
color: "gray",
|
|
713
696
|
size: "sm",
|
|
714
|
-
onClick:
|
|
715
|
-
children: /* @__PURE__ */ B
|
|
697
|
+
onClick: b,
|
|
698
|
+
children: /* @__PURE__ */ U(B, { size: 14 })
|
|
716
699
|
}),
|
|
717
|
-
/* @__PURE__ */
|
|
700
|
+
/* @__PURE__ */ W(I, {
|
|
718
701
|
fz: 12,
|
|
719
702
|
fw: 700,
|
|
720
703
|
c: "neutral.7",
|
|
721
704
|
children: [
|
|
722
|
-
|
|
705
|
+
J[c],
|
|
723
706
|
" ",
|
|
724
|
-
|
|
707
|
+
o
|
|
725
708
|
]
|
|
726
709
|
}),
|
|
727
|
-
/* @__PURE__ */
|
|
710
|
+
/* @__PURE__ */ U(E, { w: 22 })
|
|
728
711
|
]
|
|
729
|
-
}), /* @__PURE__ */
|
|
730
|
-
viewYear:
|
|
731
|
-
viewMonth:
|
|
732
|
-
start:
|
|
733
|
-
end:
|
|
734
|
-
onSelect:
|
|
735
|
-
})] }), /* @__PURE__ */
|
|
712
|
+
}), /* @__PURE__ */ U($, {
|
|
713
|
+
viewYear: o,
|
|
714
|
+
viewMonth: c,
|
|
715
|
+
start: u,
|
|
716
|
+
end: f,
|
|
717
|
+
onSelect: w
|
|
718
|
+
})] }), /* @__PURE__ */ W(E, { children: [/* @__PURE__ */ W(k, {
|
|
736
719
|
justify: "space-between",
|
|
737
720
|
align: "center",
|
|
738
721
|
mb: 8,
|
|
739
722
|
children: [
|
|
740
|
-
/* @__PURE__ */
|
|
741
|
-
/* @__PURE__ */
|
|
723
|
+
/* @__PURE__ */ U(E, { w: 22 }),
|
|
724
|
+
/* @__PURE__ */ W(I, {
|
|
742
725
|
fz: 12,
|
|
743
726
|
fw: 700,
|
|
744
727
|
c: "neutral.7",
|
|
745
728
|
children: [
|
|
746
|
-
|
|
729
|
+
J[h],
|
|
747
730
|
" ",
|
|
748
|
-
|
|
731
|
+
m
|
|
749
732
|
]
|
|
750
733
|
}),
|
|
751
|
-
/* @__PURE__ */
|
|
734
|
+
/* @__PURE__ */ U(g, {
|
|
752
735
|
variant: "subtle",
|
|
753
736
|
color: "gray",
|
|
754
737
|
size: "sm",
|
|
755
|
-
onClick:
|
|
756
|
-
children: /* @__PURE__ */
|
|
738
|
+
onClick: x,
|
|
739
|
+
children: /* @__PURE__ */ U(V, { size: 14 })
|
|
757
740
|
})
|
|
758
741
|
]
|
|
759
|
-
}), /* @__PURE__ */
|
|
760
|
-
viewYear:
|
|
761
|
-
viewMonth:
|
|
762
|
-
start:
|
|
763
|
-
end:
|
|
764
|
-
onSelect:
|
|
742
|
+
}), /* @__PURE__ */ U($, {
|
|
743
|
+
viewYear: m,
|
|
744
|
+
viewMonth: h,
|
|
745
|
+
start: u,
|
|
746
|
+
end: f,
|
|
747
|
+
onSelect: w
|
|
765
748
|
})] })]
|
|
766
749
|
}),
|
|
767
|
-
/* @__PURE__ */
|
|
750
|
+
/* @__PURE__ */ U(E, { style: {
|
|
768
751
|
height: 1,
|
|
769
752
|
background: "var(--mantine-color-gray-2)",
|
|
770
753
|
margin: "12px 0"
|
|
771
754
|
} }),
|
|
772
|
-
/* @__PURE__ */
|
|
755
|
+
/* @__PURE__ */ W(k, {
|
|
773
756
|
justify: "space-between",
|
|
774
757
|
align: "center",
|
|
775
758
|
wrap: "nowrap",
|
|
776
|
-
children: [/* @__PURE__ */
|
|
759
|
+
children: [/* @__PURE__ */ W(k, {
|
|
777
760
|
gap: 8,
|
|
778
761
|
align: "center",
|
|
779
762
|
wrap: "nowrap",
|
|
780
763
|
children: [
|
|
781
|
-
/* @__PURE__ */
|
|
764
|
+
/* @__PURE__ */ U(I, {
|
|
782
765
|
fz: 12,
|
|
783
766
|
c: "neutral.6",
|
|
784
767
|
style: { flexShrink: 0 },
|
|
785
768
|
children: "Mulai"
|
|
786
769
|
}),
|
|
787
|
-
/* @__PURE__ */
|
|
770
|
+
/* @__PURE__ */ U(F, {
|
|
788
771
|
radius: "xl",
|
|
789
|
-
value:
|
|
790
|
-
onChange: (e) =>
|
|
791
|
-
data:
|
|
772
|
+
value: u ? String(u.getHours()) : null,
|
|
773
|
+
onChange: (e) => T("start", "h", e),
|
|
774
|
+
data: v(u),
|
|
792
775
|
w: 68,
|
|
793
776
|
size: "xs",
|
|
794
777
|
searchable: !0,
|
|
795
|
-
disabled: !
|
|
778
|
+
disabled: !u,
|
|
796
779
|
placeholder: "--"
|
|
797
780
|
}),
|
|
798
|
-
/* @__PURE__ */
|
|
781
|
+
/* @__PURE__ */ U(I, {
|
|
799
782
|
fz: 12,
|
|
800
783
|
c: "neutral.6",
|
|
801
784
|
children: ":"
|
|
802
785
|
}),
|
|
803
|
-
/* @__PURE__ */
|
|
786
|
+
/* @__PURE__ */ U(F, {
|
|
804
787
|
radius: "xl",
|
|
805
|
-
value:
|
|
806
|
-
onChange: (e) =>
|
|
807
|
-
data:
|
|
788
|
+
value: u ? String(u.getMinutes()) : null,
|
|
789
|
+
onChange: (e) => T("start", "m", e),
|
|
790
|
+
data: y(u),
|
|
808
791
|
w: 68,
|
|
809
792
|
size: "xs",
|
|
810
793
|
searchable: !0,
|
|
811
|
-
disabled: !
|
|
794
|
+
disabled: !u,
|
|
812
795
|
placeholder: "--"
|
|
813
796
|
})
|
|
814
797
|
]
|
|
815
|
-
}), /* @__PURE__ */
|
|
798
|
+
}), /* @__PURE__ */ W(k, {
|
|
816
799
|
gap: 8,
|
|
817
800
|
align: "center",
|
|
818
801
|
wrap: "nowrap",
|
|
819
802
|
children: [
|
|
820
|
-
/* @__PURE__ */
|
|
803
|
+
/* @__PURE__ */ U(I, {
|
|
821
804
|
fz: 12,
|
|
822
805
|
c: "neutral.6",
|
|
823
806
|
style: { flexShrink: 0 },
|
|
824
807
|
children: "Selesai"
|
|
825
808
|
}),
|
|
826
|
-
/* @__PURE__ */
|
|
809
|
+
/* @__PURE__ */ U(F, {
|
|
827
810
|
radius: "xl",
|
|
828
|
-
value:
|
|
829
|
-
onChange: (e) =>
|
|
830
|
-
data:
|
|
811
|
+
value: f ? String(f.getHours()) : null,
|
|
812
|
+
onChange: (e) => T("end", "h", e),
|
|
813
|
+
data: v(f),
|
|
831
814
|
w: 68,
|
|
832
815
|
size: "xs",
|
|
833
816
|
searchable: !0,
|
|
834
|
-
disabled: !
|
|
817
|
+
disabled: !f,
|
|
835
818
|
placeholder: "--"
|
|
836
819
|
}),
|
|
837
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ U(I, {
|
|
838
821
|
fz: 12,
|
|
839
822
|
c: "neutral.6",
|
|
840
823
|
children: ":"
|
|
841
824
|
}),
|
|
842
|
-
/* @__PURE__ */
|
|
825
|
+
/* @__PURE__ */ U(F, {
|
|
843
826
|
radius: "xl",
|
|
844
|
-
value:
|
|
845
|
-
onChange: (e) =>
|
|
846
|
-
data:
|
|
827
|
+
value: f ? String(f.getMinutes()) : null,
|
|
828
|
+
onChange: (e) => T("end", "m", e),
|
|
829
|
+
data: y(f),
|
|
847
830
|
w: 68,
|
|
848
831
|
size: "xs",
|
|
849
832
|
searchable: !0,
|
|
850
|
-
disabled: !
|
|
833
|
+
disabled: !f,
|
|
851
834
|
placeholder: "--"
|
|
852
835
|
})
|
|
853
836
|
]
|
|
@@ -858,99 +841,4 @@ function xt({ value: e, onChange: n, placeholder: r = "Pilih periode" }) {
|
|
|
858
841
|
});
|
|
859
842
|
}
|
|
860
843
|
//#endregion
|
|
861
|
-
|
|
862
|
-
function St({ content: e = "", onChange: t, editable: n = !0, ...r }) {
|
|
863
|
-
let i = Je({
|
|
864
|
-
extensions: [Ye.configure({ link: !1 }), Xe],
|
|
865
|
-
content: e,
|
|
866
|
-
editable: n,
|
|
867
|
-
immediatelyRender: !1,
|
|
868
|
-
onUpdate: ({ editor: e }) => t?.(e.getHTML())
|
|
869
|
-
});
|
|
870
|
-
return He(() => {
|
|
871
|
-
i?.setEditable(n);
|
|
872
|
-
}, [i, n]), /* @__PURE__ */ V(q, {
|
|
873
|
-
editor: i,
|
|
874
|
-
...r,
|
|
875
|
-
children: [/* @__PURE__ */ V(q.Toolbar, {
|
|
876
|
-
sticky: !0,
|
|
877
|
-
children: [
|
|
878
|
-
/* @__PURE__ */ V(q.ControlsGroup, { children: [
|
|
879
|
-
/* @__PURE__ */ B(q.Bold, {}),
|
|
880
|
-
/* @__PURE__ */ B(q.Italic, {}),
|
|
881
|
-
/* @__PURE__ */ B(q.Underline, {}),
|
|
882
|
-
/* @__PURE__ */ B(q.Strikethrough, {}),
|
|
883
|
-
/* @__PURE__ */ B(q.ClearFormatting, {})
|
|
884
|
-
] }),
|
|
885
|
-
/* @__PURE__ */ V(q.ControlsGroup, { children: [
|
|
886
|
-
/* @__PURE__ */ B(q.H1, {}),
|
|
887
|
-
/* @__PURE__ */ B(q.H2, {}),
|
|
888
|
-
/* @__PURE__ */ B(q.H3, {})
|
|
889
|
-
] }),
|
|
890
|
-
/* @__PURE__ */ V(q.ControlsGroup, { children: [/* @__PURE__ */ B(q.BulletList, {}), /* @__PURE__ */ B(q.OrderedList, {})] }),
|
|
891
|
-
/* @__PURE__ */ V(q.ControlsGroup, { children: [/* @__PURE__ */ B(q.Link, {}), /* @__PURE__ */ B(q.Unlink, {})] }),
|
|
892
|
-
/* @__PURE__ */ V(q.ControlsGroup, { children: [/* @__PURE__ */ B(q.Undo, {}), /* @__PURE__ */ B(q.Redo, {})] })
|
|
893
|
-
]
|
|
894
|
-
}), /* @__PURE__ */ B(q.Content, {})]
|
|
895
|
-
});
|
|
896
|
-
}
|
|
897
|
-
//#endregion
|
|
898
|
-
//#region src/components/DataTable/DataTable.tsx
|
|
899
|
-
function Ct({ data: e, columns: t, searchPlaceholder: n = "Cari...", pageSize: r = 10, emptyLabel: i = "Belum ada data" }) {
|
|
900
|
-
let a = rt({
|
|
901
|
-
data: e,
|
|
902
|
-
columns: t,
|
|
903
|
-
getCoreRowModel: $e(),
|
|
904
|
-
getSortedRowModel: nt(),
|
|
905
|
-
getFilteredRowModel: et(),
|
|
906
|
-
getPaginationRowModel: tt(),
|
|
907
|
-
initialState: { pagination: {
|
|
908
|
-
pageSize: r,
|
|
909
|
-
pageIndex: 0
|
|
910
|
-
} }
|
|
911
|
-
}), o = a.getRowModel().rows, s = {
|
|
912
|
-
asc: /* @__PURE__ */ B(We, { size: 14 }),
|
|
913
|
-
desc: /* @__PURE__ */ B(Ue, { size: 14 })
|
|
914
|
-
};
|
|
915
|
-
return /* @__PURE__ */ V(P, {
|
|
916
|
-
gap: "sm",
|
|
917
|
-
children: [
|
|
918
|
-
n !== void 0 && /* @__PURE__ */ B(R, {
|
|
919
|
-
placeholder: n,
|
|
920
|
-
leftSection: /* @__PURE__ */ B(Ge, { size: 16 }),
|
|
921
|
-
value: a.getState().globalFilter ?? "",
|
|
922
|
-
onChange: (e) => a.setGlobalFilter(e.currentTarget.value)
|
|
923
|
-
}),
|
|
924
|
-
/* @__PURE__ */ V(F, { children: [/* @__PURE__ */ B(F.Thead, { children: a.getHeaderGroups().map((e) => /* @__PURE__ */ B(F.Tr, { children: e.headers.map((e) => /* @__PURE__ */ B(F.Th, {
|
|
925
|
-
onClick: e.column.getToggleSortingHandler(),
|
|
926
|
-
style: { cursor: e.column.getCanSort() ? "pointer" : void 0 },
|
|
927
|
-
children: /* @__PURE__ */ V(k, {
|
|
928
|
-
gap: 4,
|
|
929
|
-
wrap: "nowrap",
|
|
930
|
-
children: [e.isPlaceholder ? null : J(e.column.columnDef.header, e.getContext()), e.column.getCanSort() && (s[e.column.getIsSorted()] ?? /* @__PURE__ */ B(Ke, {
|
|
931
|
-
size: 14,
|
|
932
|
-
opacity: .4
|
|
933
|
-
}))]
|
|
934
|
-
})
|
|
935
|
-
}, e.id)) }, e.id)) }), /* @__PURE__ */ B(F.Tbody, { children: o.length === 0 ? /* @__PURE__ */ B(F.Tr, { children: /* @__PURE__ */ B(F.Td, {
|
|
936
|
-
colSpan: t.length,
|
|
937
|
-
children: /* @__PURE__ */ B(I, {
|
|
938
|
-
ta: "center",
|
|
939
|
-
c: "dimmed",
|
|
940
|
-
py: "md",
|
|
941
|
-
children: i
|
|
942
|
-
})
|
|
943
|
-
}) }) : o.map((e) => /* @__PURE__ */ B(F.Tr, { children: e.getVisibleCells().map((e) => /* @__PURE__ */ B(F.Td, { children: J(e.column.columnDef.cell, e.getContext()) }, e.id)) }, e.id)) })] }),
|
|
944
|
-
a.getPageCount() > 1 && /* @__PURE__ */ B(k, {
|
|
945
|
-
justify: "flex-end",
|
|
946
|
-
children: /* @__PURE__ */ B(j, {
|
|
947
|
-
total: a.getPageCount(),
|
|
948
|
-
value: a.getState().pagination.pageIndex + 1,
|
|
949
|
-
onChange: (e) => a.setPageIndex(e - 1)
|
|
950
|
-
})
|
|
951
|
-
})
|
|
952
|
-
]
|
|
953
|
-
});
|
|
954
|
-
}
|
|
955
|
-
//#endregion
|
|
956
|
-
export { e as ActionIcon, n as Alert, i as Anchor, o as AppShell, s as Avatar, l as Badge, at as BarChart, d as Box, p as Breadcrumbs, m as Burger, h as Button, _ as Card, it as Carousel, y as Center, b as Checkbox, x as CloseButton, S as ColorSwatch, C as Container, Ct as DataTable, st as DatePickerInput, ht as DateTimePicker, xt as DateTimeRangePicker, w as Divider, ot as DonutChart, qe as Dropzone, T as EmptyState, E as FileButton, D as FileInput, O as Flex, ee as Grid, k as Group, te as Image, ne as Indicator, ie as Loader, ae as LoadingOverlay, oe as Menu, ce as Modal, ue as MultiSelect, de as NativeSelect, fe as NavLink, pe as Notification, Ze as Notifications, me as NumberInput, j as Pagination, he as Paper, ge as PasswordInput, _e as Pill, ve as Popover, ye as Progress, be as Radio, St as RichTextEditor, xe as RingProgress, Se as ScrollArea, Ce as SegmentedControl, Te as Select, Ee as SimpleGrid, De as Skeleton, P as Stack, Oe as Stepper, ke as Switch, F as Table, je as Tabs, Me as TagsInput, I as Text, R as TextInput, Ne as Textarea, Pe as ThemeIcon, Fe as Title, Ie as Tooltip, Re as VisuallyHidden, Y as kelolaTheme, Y as theme, Qe as notifications };
|
|
844
|
+
export { h as ActionIcon, _ as Alert, y as Anchor, x as AppShell, S as Avatar, w as Badge, p as Box, D as Breadcrumbs, O as Burger, ee as Button, ne as Card, c as Center, ie as Checkbox, ae as CloseButton, oe as ColorSwatch, d as Container, q as DateTimePicker, Ze as DateTimeRangePicker, se as Divider, ce as EmptyState, le as FileButton, ue as FileInput, a as Flex, e as Grid, l as Group, f as Image, de as Indicator, pe as Loader, me as LoadingOverlay, he as Menu, _e as Modal, ye as MultiSelect, be as NativeSelect, A as NavLink, j as Notification, M as NumberInput, s as Pagination, N as Paper, xe as PasswordInput, Se as Pill, Ce as Popover, we as Progress, Te as Radio, Ee as RingProgress, t as ScrollArea, De as SegmentedControl, ke as Select, o as SimpleGrid, Ae as Skeleton, m as Stack, je as Stepper, Me as Switch, u as Table, Pe as Tabs, Fe as TagsInput, n as Text, i as TextInput, Ie as Textarea, Le as ThemeIcon, r as Title, Re as Tooltip, Be as VisuallyHidden, G as kelolaTheme, G as theme };
|