@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/dist/index.js CHANGED
@@ -1,17 +1,9 @@
1
- import { ActionIcon as e, ActionIcon as t, Alert as n, Alert as r, Anchor as i, Anchor as a, AppShell as o, Avatar as s, Avatar as c, Badge as l, Badge as u, Box as d, Box as f, Breadcrumbs as p, Burger as m, Button as h, Button as g, Card as _, Card as v, Center as y, Checkbox as b, CloseButton as x, ColorSwatch as S, Container as C, Divider as w, EmptyState as T, FileButton as E, FileInput as D, Flex as O, Grid as ee, Group as k, Group as A, Image as te, Indicator as ne, Input as re, Loader as ie, LoadingOverlay as ae, Menu as oe, Menu as se, Modal as ce, Modal as le, MultiSelect as ue, NativeSelect as de, NavLink as fe, Notification as pe, NumberInput as me, Pagination as j, Paper as he, PasswordInput as ge, Pill as _e, Popover as ve, Popover as M, Progress as ye, Radio as be, RingProgress as xe, ScrollArea as Se, SegmentedControl as Ce, SegmentedControl as we, Select as Te, Select as N, SimpleGrid as Ee, Skeleton as De, Stack as P, Stepper as Oe, Switch as ke, Table as F, Table as Ae, Tabs as je, TagsInput as Me, Text as I, Text as L, TextInput as R, Textarea as Ne, ThemeIcon as Pe, Title as Fe, Tooltip as Ie, Tooltip as Le, UnstyledButton as z, VisuallyHidden as Re, createTheme as ze } from "@mantine/core";
2
- import { DatePickerInput as Be, DateTimePicker as Ve } from "@mantine/dates";
3
- import { jsx as B, jsxs as V } from "react/jsx-runtime";
4
- import { useEffect as He, useState as H } from "react";
5
- import { IconCalendar as U, IconChevronDown as Ue, IconChevronLeft as W, IconChevronRight as G, IconChevronUp as We, IconSearch as Ge, IconSelector as Ke, IconX as K } from "@tabler/icons-react";
6
- import { Dropzone as qe } from "@mantine/dropzone";
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: g.extend({
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: re.extend({ defaultProps: { radius: "xl" } }),
170
- Badge: u.extend({
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: c.extend({ defaultProps: { radius: 9999 } }),
179
- Alert: r.extend({ defaultProps: { variant: "light" } }),
180
- Anchor: a.extend({ defaultProps: { underline: "hover" } }),
181
- Card: v.extend({ defaultProps: {
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: Le.extend({ defaultProps: { withArrow: !0 } }),
188
- ActionIcon: t.extend({ defaultProps: {
179
+ Tooltip: ze.extend({ defaultProps: { withArrow: !0 } }),
180
+ ActionIcon: g.extend({ defaultProps: {
189
181
  variant: "subtle",
190
182
  color: "gray"
191
183
  } }),
192
- Menu: se.extend({ defaultProps: {
184
+ Menu: ge.extend({ defaultProps: {
193
185
  shadow: "md",
194
186
  radius: "md"
195
187
  } }),
196
- Modal: le.extend({ defaultProps: {
188
+ Modal: ve.extend({ defaultProps: {
197
189
  centered: !0,
198
190
  radius: "md"
199
191
  } }),
200
- Table: Ae.extend({ defaultProps: {
192
+ Table: Ne.extend({ defaultProps: {
201
193
  highlightOnHover: !0,
202
194
  verticalSpacing: "sm",
203
195
  horizontalSpacing: "md"
204
196
  } }),
205
- SegmentedControl: we.extend({ defaultProps: { radius: "xl" } })
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
- ], lt = [
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 ut(e, t) {
221
+ function K(e, t) {
239
222
  return new Date(e, t + 1, 0).getDate();
240
223
  }
241
- function dt(e, t) {
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 ft(e) {
228
+ function Ge(e) {
246
229
  return e === 5 || e === 6;
247
230
  }
248
- function pt(e, t, n) {
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 mt({ viewYear: e, viewMonth: t, selectedDate: n, onSelect: r }) {
252
- let i = ut(e, t), a = dt(e, t), o = ut(e, t - 1), s = [];
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__ */ V(f, {
250
+ return /* @__PURE__ */ W(E, {
268
251
  style: { width: 252 },
269
- children: [/* @__PURE__ */ B(f, {
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: lt.map((e, t) => /* @__PURE__ */ B(L, {
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__ */ B(f, {
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 = ft(o);
289
- return /* @__PURE__ */ B(z, {
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__ */ B(L, {
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 ht({ value: e, onChange: n, placeholder: r = "Pilih tanggal & jam" }) {
314
- let i = e instanceof Date ? e : /* @__PURE__ */ new Date(), [a, o] = H(!1), [s, c] = H(i.getFullYear()), [l, u] = H(i.getMonth()), [d, p] = H(e instanceof Date ? e : null), [m, h] = H(e instanceof Date ? e.getHours() : 0), [g, _] = H(e instanceof Date ? e.getMinutes() : 0), v = /* @__PURE__ */ new Date(), y = !!(d && d.getDate() === v.getDate() && d.getMonth() === v.getMonth() && d.getFullYear() === v.getFullYear()), b = Array.from({ length: 24 }, (e, t) => ({
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: y && t < v.getHours()
318
- })), x = Array.from({ length: 60 }, (e, t) => ({
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: y && m === v.getHours() && t < v.getMinutes()
322
- })), S = () => {
323
- l === 0 ? (u(11), c((e) => e - 1)) : u((e) => e - 1);
324
- }, C = () => {
325
- l === 11 ? (u(0), c((e) => e + 1)) : u((e) => e + 1);
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 t = m, r = g, i = new Date(s, l, e);
328
- i.getDate() === v.getDate() && i.getMonth() === v.getMonth() && i.getFullYear() === v.getFullYear() && (t < v.getHours() || t === v.getHours() && r < v.getMinutes()) && (t = v.getHours(), r = v.getMinutes(), h(t), _(r));
329
- let a = new Date(s, l, e, t, r);
330
- p(a), n?.(a);
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
- }, E = (e) => {
338
- let t = Number(e);
339
- if (_(t), d) {
340
- let e = new Date(d);
341
- e.setMinutes(t), p(e), n?.(e);
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(), p(null), h(0), _(0), n?.(null);
345
- }, O = pt(d, m, g);
346
- return /* @__PURE__ */ V(M, {
347
- opened: a,
348
- onChange: o,
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__ */ B(M.Target, { children: /* @__PURE__ */ V(f, {
355
- onClick: () => o((e) => !e),
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__ */ B(U, {
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__ */ B(L, {
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 || r
367
+ children: O || n
385
368
  }),
386
- d && /* @__PURE__ */ B(f, {
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__ */ B(K, {
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__ */ V(M.Dropdown, {
383
+ }) }), /* @__PURE__ */ W(P.Dropdown, {
401
384
  p: "md",
402
385
  style: { minWidth: 280 },
403
386
  children: [
404
- /* @__PURE__ */ V(A, {
387
+ /* @__PURE__ */ W(k, {
405
388
  justify: "space-between",
406
389
  align: "center",
407
390
  mb: 8,
408
391
  children: [
409
- /* @__PURE__ */ B(t, {
392
+ /* @__PURE__ */ U(g, {
410
393
  variant: "subtle",
411
394
  color: "gray",
412
395
  size: "sm",
413
- onClick: S,
414
- children: /* @__PURE__ */ B(W, { size: 14 })
396
+ onClick: x,
397
+ children: /* @__PURE__ */ U(B, { size: 14 })
415
398
  }),
416
- /* @__PURE__ */ V(L, {
399
+ /* @__PURE__ */ W(I, {
417
400
  fz: 12,
418
401
  fw: 700,
419
402
  c: "neutral.7",
420
403
  children: [
421
- ct[l],
404
+ He[c],
422
405
  " ",
423
- s
406
+ o
424
407
  ]
425
408
  }),
426
- /* @__PURE__ */ B(t, {
409
+ /* @__PURE__ */ U(g, {
427
410
  variant: "subtle",
428
411
  color: "gray",
429
412
  size: "sm",
430
- onClick: C,
431
- children: /* @__PURE__ */ B(G, { size: 14 })
413
+ onClick: S,
414
+ children: /* @__PURE__ */ U(V, { size: 14 })
432
415
  })
433
416
  ]
434
417
  }),
435
- /* @__PURE__ */ B(mt, {
436
- viewYear: s,
437
- viewMonth: l,
438
- selectedDate: d,
439
- onSelect: w
418
+ /* @__PURE__ */ U(qe, {
419
+ viewYear: o,
420
+ viewMonth: c,
421
+ selectedDate: u,
422
+ onSelect: C
440
423
  }),
441
- /* @__PURE__ */ B(f, { style: {
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__ */ V(A, {
429
+ /* @__PURE__ */ W(k, {
447
430
  gap: 8,
448
431
  align: "center",
449
432
  wrap: "nowrap",
450
433
  children: [
451
- /* @__PURE__ */ B(L, {
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__ */ B(N, {
440
+ /* @__PURE__ */ U(F, {
458
441
  radius: "xl",
459
- value: String(m),
460
- onChange: T,
461
- data: b,
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__ */ B(L, {
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__ */ B(N, {
455
+ /* @__PURE__ */ U(F, {
473
456
  radius: "xl",
474
- value: String(g),
475
- onChange: E,
476
- data: x,
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 X = [
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
- ], gt = [
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 _t(e, t) {
494
+ function Y(e, t) {
512
495
  return new Date(e, t + 1, 0).getDate();
513
496
  }
514
- function vt(e, t) {
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 yt(e) {
501
+ function Xe(e) {
519
502
  return e === 5 || e === 6;
520
503
  }
521
- function Z(e, t) {
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 Q(e, t, n) {
507
+ function Z(e, t, n) {
525
508
  return new Date(e, t, n).setHours(0, 0, 0, 0);
526
509
  }
527
- function bt(e) {
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 = _t(e, t), o = vt(e, t), s = _t(e, t - 1), c = [];
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(), p = n ? Q(n.getFullYear(), n.getMonth(), n.getDate()) : null, m = r ? Q(r.getFullYear(), r.getMonth(), r.getDate()) : null;
546
- return /* @__PURE__ */ V(f, {
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__ */ B(f, {
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: gt.map((e, t) => /* @__PURE__ */ B(L, {
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__ */ B(f, {
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 ? Q(e, t, a.day) : null, h = c ? new Date(e, t, a.day) : null, g = c && Z(h, n), _ = c && Z(h, r), v = g || _, y = !!(c && l !== null && p !== null && m !== null && l > p && l < m), b = c && u.getDate() === a.day && u.getMonth() === t && u.getFullYear() === e, x = c && l !== null && l < d, S = !c || x, C = yt(s);
568
- return /* @__PURE__ */ B(f, {
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: y ? "var(--mantine-color-primary-1)" : "transparent",
574
- borderTopLeftRadius: g || y && s === 0 ? 999 : 0,
575
- borderBottomLeftRadius: g || y && s === 0 ? 999 : 0,
576
- borderTopRightRadius: _ || y && s === 6 ? 999 : 0,
577
- borderBottomRightRadius: _ || y && s === 6 ? 999 : 0
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__ */ B(z, {
580
- onClick: () => !S && i(e, t, a.day),
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: v ? "var(--mantine-primary-color-5)" : "transparent",
589
- cursor: S ? "not-allowed" : "pointer",
590
- outline: b && !v ? "2px solid var(--mantine-primary-color-5)" : "none"
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__ */ B(L, {
575
+ children: /* @__PURE__ */ U(I, {
593
576
  fz: 13,
594
- td: x ? "line-through" : void 0,
595
- c: v ? "white" : S ? "neutral.3" : C ? "red.6" : "neutral.7",
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 xt({ value: e, onChange: n, placeholder: r = "Pilih periode" }) {
605
- let i = e?.[0] instanceof Date ? e[0] : /* @__PURE__ */ new Date(), [a, o] = H(!1), [s, c] = H(i.getFullYear()), [l, u] = H(i.getMonth()), [d, p] = H(e?.[0] instanceof Date ? e[0] : null), [m, h] = H(e?.[1] instanceof Date ? e[1] : null), g = l === 11 ? s + 1 : s, _ = l === 11 ? 0 : l + 1, v = /* @__PURE__ */ new Date(), y = (e) => Array.from({ length: 24 }, (t, n) => ({
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: Z(e, v) && n < v.getHours()
609
- })), b = (e) => Array.from({ length: 60 }, (t, n) => ({
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: Z(e, v) && e !== null && e.getHours() === v.getHours() && n < v.getMinutes()
613
- })), x = () => {
614
- l === 0 ? (u(11), c((e) => e - 1)) : u((e) => e - 1);
615
- }, S = () => {
616
- l === 11 ? (u(0), c((e) => e + 1)) : u((e) => e + 1);
617
- }, C = (e, t) => n?.([e, t]), w = (e) => Z(e, v) && e.getTime() < v.getTime() ? new Date(v.getFullYear(), v.getMonth(), v.getDate(), v.getHours(), v.getMinutes()) : e, T = (e, t, n) => {
618
- if (!d || d && m) {
619
- let r = d?.getHours() ?? 0, i = d?.getMinutes() ?? 0, a = w(new Date(e, t, n, r, i));
620
- p(a), h(null), C(a, null);
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, m?.getHours() ?? 0, m?.getMinutes() ?? 0).setHours(0, 0, 0, 0) < new Date(d).setHours(0, 0, 0, 0)) {
624
- let r = w(new Date(e, t, n, d.getHours(), d.getMinutes()));
625
- p(r), h(null), C(r, null);
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 = w(new Date(e, t, n, m?.getHours() ?? 0, m?.getMinutes() ?? 0));
629
- h(r), C(d, r);
630
- }, E = (e, t, n) => {
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 (!d) return;
634
- let e = new Date(d);
635
- t === "h" ? e.setHours(r) : e.setMinutes(r), p(e), C(e, m);
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 (!m) return;
638
- let e = new Date(m);
639
- t === "h" ? e.setHours(r) : e.setMinutes(r), h(e), C(d, e);
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(), p(null), h(null), C(null, null);
643
- }, O = d ? `${bt(d)}${m ? ` - ${bt(m)}` : ""}` : "";
644
- return /* @__PURE__ */ V(M, {
645
- opened: a,
646
- onChange: o,
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__ */ B(M.Target, { children: /* @__PURE__ */ V(f, {
653
- onClick: () => o((e) => !e),
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__ */ B(U, {
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__ */ B(L, {
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 || r
665
+ children: O || n
683
666
  }),
684
- d && /* @__PURE__ */ B(f, {
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__ */ B(K, {
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__ */ V(M.Dropdown, {
681
+ }) }), /* @__PURE__ */ W(P.Dropdown, {
699
682
  p: "md",
700
683
  children: [
701
- /* @__PURE__ */ V(A, {
684
+ /* @__PURE__ */ W(k, {
702
685
  align: "flex-start",
703
686
  gap: 24,
704
687
  wrap: "nowrap",
705
- children: [/* @__PURE__ */ V(f, { children: [/* @__PURE__ */ V(A, {
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__ */ B(t, {
693
+ /* @__PURE__ */ U(g, {
711
694
  variant: "subtle",
712
695
  color: "gray",
713
696
  size: "sm",
714
- onClick: x,
715
- children: /* @__PURE__ */ B(W, { size: 14 })
697
+ onClick: b,
698
+ children: /* @__PURE__ */ U(B, { size: 14 })
716
699
  }),
717
- /* @__PURE__ */ V(L, {
700
+ /* @__PURE__ */ W(I, {
718
701
  fz: 12,
719
702
  fw: 700,
720
703
  c: "neutral.7",
721
704
  children: [
722
- X[l],
705
+ J[c],
723
706
  " ",
724
- s
707
+ o
725
708
  ]
726
709
  }),
727
- /* @__PURE__ */ B(f, { w: 22 })
710
+ /* @__PURE__ */ U(E, { w: 22 })
728
711
  ]
729
- }), /* @__PURE__ */ B($, {
730
- viewYear: s,
731
- viewMonth: l,
732
- start: d,
733
- end: m,
734
- onSelect: T
735
- })] }), /* @__PURE__ */ V(f, { children: [/* @__PURE__ */ V(A, {
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__ */ B(f, { w: 22 }),
741
- /* @__PURE__ */ V(L, {
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
- X[_],
729
+ J[h],
747
730
  " ",
748
- g
731
+ m
749
732
  ]
750
733
  }),
751
- /* @__PURE__ */ B(t, {
734
+ /* @__PURE__ */ U(g, {
752
735
  variant: "subtle",
753
736
  color: "gray",
754
737
  size: "sm",
755
- onClick: S,
756
- children: /* @__PURE__ */ B(G, { size: 14 })
738
+ onClick: x,
739
+ children: /* @__PURE__ */ U(V, { size: 14 })
757
740
  })
758
741
  ]
759
- }), /* @__PURE__ */ B($, {
760
- viewYear: g,
761
- viewMonth: _,
762
- start: d,
763
- end: m,
764
- onSelect: T
742
+ }), /* @__PURE__ */ U($, {
743
+ viewYear: m,
744
+ viewMonth: h,
745
+ start: u,
746
+ end: f,
747
+ onSelect: w
765
748
  })] })]
766
749
  }),
767
- /* @__PURE__ */ B(f, { style: {
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__ */ V(A, {
755
+ /* @__PURE__ */ W(k, {
773
756
  justify: "space-between",
774
757
  align: "center",
775
758
  wrap: "nowrap",
776
- children: [/* @__PURE__ */ V(A, {
759
+ children: [/* @__PURE__ */ W(k, {
777
760
  gap: 8,
778
761
  align: "center",
779
762
  wrap: "nowrap",
780
763
  children: [
781
- /* @__PURE__ */ B(L, {
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__ */ B(N, {
770
+ /* @__PURE__ */ U(F, {
788
771
  radius: "xl",
789
- value: d ? String(d.getHours()) : null,
790
- onChange: (e) => E("start", "h", e),
791
- data: y(d),
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: !d,
778
+ disabled: !u,
796
779
  placeholder: "--"
797
780
  }),
798
- /* @__PURE__ */ B(L, {
781
+ /* @__PURE__ */ U(I, {
799
782
  fz: 12,
800
783
  c: "neutral.6",
801
784
  children: ":"
802
785
  }),
803
- /* @__PURE__ */ B(N, {
786
+ /* @__PURE__ */ U(F, {
804
787
  radius: "xl",
805
- value: d ? String(d.getMinutes()) : null,
806
- onChange: (e) => E("start", "m", e),
807
- data: b(d),
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: !d,
794
+ disabled: !u,
812
795
  placeholder: "--"
813
796
  })
814
797
  ]
815
- }), /* @__PURE__ */ V(A, {
798
+ }), /* @__PURE__ */ W(k, {
816
799
  gap: 8,
817
800
  align: "center",
818
801
  wrap: "nowrap",
819
802
  children: [
820
- /* @__PURE__ */ B(L, {
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__ */ B(N, {
809
+ /* @__PURE__ */ U(F, {
827
810
  radius: "xl",
828
- value: m ? String(m.getHours()) : null,
829
- onChange: (e) => E("end", "h", e),
830
- data: y(m),
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: !m,
817
+ disabled: !f,
835
818
  placeholder: "--"
836
819
  }),
837
- /* @__PURE__ */ B(L, {
820
+ /* @__PURE__ */ U(I, {
838
821
  fz: 12,
839
822
  c: "neutral.6",
840
823
  children: ":"
841
824
  }),
842
- /* @__PURE__ */ B(N, {
825
+ /* @__PURE__ */ U(F, {
843
826
  radius: "xl",
844
- value: m ? String(m.getMinutes()) : null,
845
- onChange: (e) => E("end", "m", e),
846
- data: b(m),
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: !m,
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
- //#region src/components/RichTextEditor/RichTextEditor.tsx
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 };