@caspeco/casper-ui-library 4.0.0 → 4.1.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.
Files changed (59) hide show
  1. package/dist/components/combobox/combobox-button.d.ts +1 -1
  2. package/dist/components/combobox/combobox-button.d.ts.map +1 -1
  3. package/dist/components/combobox/combobox-button.js +85 -69
  4. package/dist/components/combobox/combobox-item.d.ts +2 -1
  5. package/dist/components/combobox/combobox-item.d.ts.map +1 -1
  6. package/dist/components/combobox/combobox-item.js +10 -10
  7. package/dist/components/combobox/combobox-menu.js +68 -69
  8. package/dist/components/combobox/combobox.d.ts.map +1 -1
  9. package/dist/components/combobox/combobox.js +120 -123
  10. package/dist/components/combobox/types.d.ts +2 -0
  11. package/dist/components/combobox/types.d.ts.map +1 -1
  12. package/dist/components/date-picker/base-date-picker.js +175 -176
  13. package/dist/components/date-picker/date-picker-header.js +10 -10
  14. package/dist/components/date-picker/helper.js +9 -9
  15. package/dist/components/image-upload/image-cropper.js +112 -113
  16. package/dist/components/image-upload/image-upload-dropzone.js +35 -36
  17. package/dist/components/menu/menu-group.js +44 -45
  18. package/dist/components/segmented-control/segmented-control.js +29 -29
  19. package/dist/components/table/table-cell.js +25 -26
  20. package/dist/components/table/table-header-dropdown.js +60 -60
  21. package/dist/components/table/table-header-row.js +19 -20
  22. package/dist/components/table/table-toolbar.js +63 -64
  23. package/dist/components/table/use-controllable-state.js +7 -7
  24. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +1 -1
  25. package/dist/node_modules/@tanstack/table-core/build/lib/index.js +41 -41
  26. package/dist/node_modules/date-fns/addDays.js +7 -7
  27. package/dist/node_modules/date-fns/addMonths.js +13 -13
  28. package/dist/node_modules/date-fns/differenceInCalendarDays.js +11 -11
  29. package/dist/node_modules/date-fns/endOfDay.js +6 -6
  30. package/dist/node_modules/date-fns/endOfMonth.js +6 -6
  31. package/dist/node_modules/date-fns/format.js +46 -47
  32. package/dist/node_modules/date-fns/getDayOfYear.js +8 -8
  33. package/dist/node_modules/date-fns/getISOWeek.js +9 -9
  34. package/dist/node_modules/date-fns/getISOWeekYear.js +10 -10
  35. package/dist/node_modules/date-fns/getWeek.js +9 -9
  36. package/dist/node_modules/date-fns/getWeekYear.js +13 -14
  37. package/dist/node_modules/date-fns/isSameDay.js +9 -9
  38. package/dist/node_modules/date-fns/isSameMonth.js +9 -9
  39. package/dist/node_modules/date-fns/isSameWeek.js +8 -8
  40. package/dist/node_modules/date-fns/isSameYear.js +9 -9
  41. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +12 -12
  42. package/dist/node_modules/date-fns/locale/da/_lib/formatDistance.js +4 -4
  43. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +3 -3
  44. package/dist/node_modules/date-fns/locale/es/_lib/formatDistance.js +4 -4
  45. package/dist/node_modules/date-fns/locale/et/_lib/formatDistance.js +6 -6
  46. package/dist/node_modules/date-fns/locale/fi/_lib/formatDistance.js +17 -17
  47. package/dist/node_modules/date-fns/locale/lt/_lib/formatDistance.js +47 -47
  48. package/dist/node_modules/date-fns/locale/lv/_lib/formatDistance.js +11 -11
  49. package/dist/node_modules/date-fns/locale/nb/_lib/formatDistance.js +3 -3
  50. package/dist/node_modules/date-fns/locale/nl/_lib/formatDistance.js +4 -4
  51. package/dist/node_modules/date-fns/locale/sv/_lib/formatDistance.js +5 -5
  52. package/dist/node_modules/date-fns/startOfDay.js +6 -6
  53. package/dist/node_modules/date-fns/startOfMonth.js +6 -6
  54. package/dist/node_modules/date-fns/startOfWeek.js +7 -8
  55. package/dist/node_modules/date-fns/startOfWeekYear.js +9 -10
  56. package/dist/node_modules/date-fns/startOfYear.js +5 -5
  57. package/dist/theme/theme-config/components/modal-theme.js +13 -15
  58. package/dist/theme/theme-config/components/select-theme.js +15 -19
  59. package/package.json +3 -3
@@ -67,7 +67,7 @@ function S(e, o, t) {
67
67
  console.info(`%c⏱ ${s(m, 5)} /${s(f, 5)} ms`, `
68
68
  font-size: .6rem;
69
69
  font-weight: bold;
70
- color: hsl(${Math.max(0, Math.min(120 - 120 * d, 120))}deg 100% 31%);`, t == null ? void 0 : t.key);
70
+ color: hsl(${Math.max(0, Math.min(120 - 120 * d, 120))}deg 100% 31%);`, t?.key);
71
71
  }
72
72
  return r;
73
73
  };
@@ -76,7 +76,7 @@ function C(e, o, t, n) {
76
76
  return {
77
77
  debug: () => {
78
78
  var r;
79
- return (r = e == null ? void 0 : e.debugAll) != null ? r : e[o];
79
+ return (r = e?.debugAll) != null ? r : e[o];
80
80
  },
81
81
  key: process.env.NODE_ENV === "development" && t,
82
82
  onChange: n
@@ -179,15 +179,15 @@ const we = {
179
179
  createTable: (e) => {
180
180
  e.getHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => {
181
181
  var i, l;
182
- const u = (i = n == null ? void 0 : n.map((m) => t.find((d) => d.id === m)).filter(Boolean)) != null ? i : [], g = (l = r == null ? void 0 : r.map((m) => t.find((d) => d.id === m)).filter(Boolean)) != null ? l : [], a = t.filter((m) => !(n != null && n.includes(m.id)) && !(r != null && r.includes(m.id)));
182
+ const u = (i = n?.map((m) => t.find((d) => d.id === m)).filter(Boolean)) != null ? i : [], g = (l = r?.map((m) => t.find((d) => d.id === m)).filter(Boolean)) != null ? l : [], a = t.filter((m) => !(n != null && n.includes(m.id)) && !(r != null && r.includes(m.id)));
183
183
  return G(o, [...u, ...a, ...g], e);
184
184
  }, C(e.options, _, "getHeaderGroups")), e.getCenterHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => (t = t.filter((i) => !(n != null && n.includes(i.id)) && !(r != null && r.includes(i.id))), G(o, t, e, "center")), C(e.options, _, "getCenterHeaderGroups")), e.getLeftHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
185
185
  var r;
186
- const i = (r = n == null ? void 0 : n.map((l) => t.find((u) => u.id === l)).filter(Boolean)) != null ? r : [];
186
+ const i = (r = n?.map((l) => t.find((u) => u.id === l)).filter(Boolean)) != null ? r : [];
187
187
  return G(o, i, e, "left");
188
188
  }, C(e.options, _, "getLeftHeaderGroups")), e.getRightHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
189
189
  var r;
190
- const i = (r = n == null ? void 0 : n.map((l) => t.find((u) => u.id === l)).filter(Boolean)) != null ? r : [];
190
+ const i = (r = n?.map((l) => t.find((u) => u.id === l)).filter(Boolean)) != null ? r : [];
191
191
  return G(o, i, e, "right");
192
192
  }, C(e.options, _, "getRightHeaderGroups")), e.getFooterGroups = S(() => [e.getHeaderGroups()], (o) => [...o].reverse(), C(e.options, _, "getFooterGroups")), e.getLeftFooterGroups = S(() => [e.getLeftHeaderGroups()], (o) => [...o].reverse(), C(e.options, _, "getLeftFooterGroups")), e.getCenterFooterGroups = S(() => [e.getCenterHeaderGroups()], (o) => [...o].reverse(), C(e.options, _, "getCenterFooterGroups")), e.getRightFooterGroups = S(() => [e.getRightHeaderGroups()], (o) => [...o].reverse(), C(e.options, _, "getRightFooterGroups")), e.getFlatHeaders = S(() => [e.getHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, _, "getFlatHeaders")), e.getLeftFlatHeaders = S(() => [e.getLeftHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, _, "getLeftFlatHeaders")), e.getCenterFlatHeaders = S(() => [e.getCenterHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, _, "getCenterFlatHeaders")), e.getRightFlatHeaders = S(() => [e.getRightHeaderGroups()], (o) => o.map((t) => t.headers).flat(), C(e.options, _, "getRightFlatHeaders")), e.getCenterLeafHeaders = S(() => [e.getCenterFlatHeaders()], (o) => o.filter((t) => {
193
193
  var n;
@@ -224,11 +224,11 @@ function G(e, o, t, n) {
224
224
  d.forEach((R) => {
225
225
  const w = [...p].reverse()[0], h = R.column.depth === c.depth;
226
226
  let v, M = !1;
227
- if (h && R.column.parent ? v = R.column.parent : (v = R.column, M = !0), w && (w == null ? void 0 : w.column) === v)
227
+ if (h && R.column.parent ? v = R.column.parent : (v = R.column, M = !0), w && w?.column === v)
228
228
  w.subHeaders.push(R);
229
229
  else {
230
230
  const F = ne(t, v, {
231
- id: [n, s, v.id, R == null ? void 0 : R.id].filter(Boolean).join("_"),
231
+ id: [n, s, v.id, R?.id].filter(Boolean).join("_"),
232
232
  isPlaceholder: M,
233
233
  placeholderId: M ? `${p.filter((E) => E.column === v).length}` : void 0,
234
234
  depth: s,
@@ -327,7 +327,7 @@ const ie = (e, o, t) => {
327
327
  ie.autoRemove = (e) => V(e);
328
328
  const le = (e, o, t) => {
329
329
  var n;
330
- return ((n = e.getValue(o)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === (t == null ? void 0 : t.toLowerCase());
330
+ return ((n = e.getValue(o)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === t?.toLowerCase();
331
331
  };
332
332
  le.autoRemove = (e) => V(e);
333
333
  const se = (e, o, t) => {
@@ -392,7 +392,7 @@ const ve = {
392
392
  }),
393
393
  createColumn: (e, o) => {
394
394
  e.getAutoFilterFn = () => {
395
- const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
395
+ const t = o.getCoreRowModel().flatRows[0], n = t?.getValue(e.id);
396
396
  return typeof n == "string" ? P.includesString : typeof n == "number" ? P.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? P.equals : Array.isArray(n) ? P.arrIncludes : P.weakEquals;
397
397
  }, e.getFilterFn = () => {
398
398
  var t, n;
@@ -411,10 +411,10 @@ const ve = {
411
411
  return (t = (n = o.getState().columnFilters) == null ? void 0 : n.findIndex((r) => r.id === e.id)) != null ? t : -1;
412
412
  }, e.setFilterValue = (t) => {
413
413
  o.setColumnFilters((n) => {
414
- const r = e.getFilterFn(), i = n == null ? void 0 : n.find((f) => f.id === e.id), l = I(t, i ? i.value : void 0);
414
+ const r = e.getFilterFn(), i = n?.find((f) => f.id === e.id), l = I(t, i ? i.value : void 0);
415
415
  if (oe(r, l, e)) {
416
416
  var u;
417
- return (u = n == null ? void 0 : n.filter((f) => f.id !== e.id)) != null ? u : [];
417
+ return (u = n?.filter((f) => f.id !== e.id)) != null ? u : [];
418
418
  }
419
419
  const g = {
420
420
  id: e.id,
@@ -422,7 +422,7 @@ const ve = {
422
422
  };
423
423
  if (i) {
424
424
  var a;
425
- return (a = n == null ? void 0 : n.map((f) => f.id === e.id ? g : f)) != null ? a : [];
425
+ return (a = n?.map((f) => f.id === e.id ? g : f)) != null ? a : [];
426
426
  }
427
427
  return n != null && n.length ? [...n, g] : [g];
428
428
  });
@@ -536,7 +536,7 @@ const _e = (e, o, t) => t.reduce((n, r) => {
536
536
  t && e.toggleGrouping();
537
537
  };
538
538
  }, e.getAutoAggregationFn = () => {
539
- const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
539
+ const t = o.getCoreRowModel().flatRows[0], n = t?.getValue(e.id);
540
540
  if (typeof n == "number")
541
541
  return z.sum;
542
542
  if (Object.prototype.toString.call(n) === "[object Date]")
@@ -631,20 +631,20 @@ const Ge = {
631
631
  if (t === "right") {
632
632
  var u, g;
633
633
  return {
634
- left: ((u = r == null ? void 0 : r.left) != null ? u : []).filter((m) => !(n != null && n.includes(m))),
635
- right: [...((g = r == null ? void 0 : r.right) != null ? g : []).filter((m) => !(n != null && n.includes(m))), ...n]
634
+ left: ((u = r?.left) != null ? u : []).filter((m) => !(n != null && n.includes(m))),
635
+ right: [...((g = r?.right) != null ? g : []).filter((m) => !(n != null && n.includes(m))), ...n]
636
636
  };
637
637
  }
638
638
  if (t === "left") {
639
639
  var a, f;
640
640
  return {
641
- left: [...((a = r == null ? void 0 : r.left) != null ? a : []).filter((m) => !(n != null && n.includes(m))), ...n],
642
- right: ((f = r == null ? void 0 : r.right) != null ? f : []).filter((m) => !(n != null && n.includes(m)))
641
+ left: [...((a = r?.left) != null ? a : []).filter((m) => !(n != null && n.includes(m))), ...n],
642
+ right: ((f = r?.right) != null ? f : []).filter((m) => !(n != null && n.includes(m)))
643
643
  };
644
644
  }
645
645
  return {
646
- left: ((i = r == null ? void 0 : r.left) != null ? i : []).filter((m) => !(n != null && n.includes(m))),
647
- right: ((l = r == null ? void 0 : r.right) != null ? l : []).filter((m) => !(n != null && n.includes(m)))
646
+ left: ((i = r?.left) != null ? i : []).filter((m) => !(n != null && n.includes(m))),
647
+ right: ((l = r?.right) != null ? l : []).filter((m) => !(n != null && n.includes(m)))
648
648
  };
649
649
  });
650
650
  }, e.getCanPin = () => e.getLeafColumns().some((n) => {
@@ -654,7 +654,7 @@ const Ge = {
654
654
  const t = e.getLeafColumns().map((u) => u.id), {
655
655
  left: n,
656
656
  right: r
657
- } = o.getState().columnPinning, i = t.some((u) => n == null ? void 0 : n.includes(u)), l = t.some((u) => r == null ? void 0 : r.includes(u));
657
+ } = o.getState().columnPinning, i = t.some((u) => n?.includes(u)), l = t.some((u) => r?.includes(u));
658
658
  return i ? "left" : l ? "right" : !1;
659
659
  }, e.getPinnedIndex = () => {
660
660
  var t, n;
@@ -756,14 +756,14 @@ const H = {
756
756
  }
757
757
  return 0;
758
758
  }, e.getResizeHandler = (t) => {
759
- const n = o.getColumn(e.column.id), r = n == null ? void 0 : n.getCanResize();
759
+ const n = o.getColumn(e.column.id), r = n?.getCanResize();
760
760
  return (i) => {
761
761
  if (!n || !r || (i.persist == null || i.persist(), T(i) && i.touches && i.touches.length > 1))
762
762
  return;
763
763
  const l = e.getSize(), u = e ? e.getLeafHeaders().map((w) => [w.column.id, w.column.getSize()]) : [[n.id, n.getSize()]], g = T(i) ? Math.round(i.touches[0].clientX) : i.clientX, a = {}, f = (w, h) => {
764
764
  typeof h == "number" && (o.setColumnSizingInfo((v) => {
765
765
  var M, F;
766
- const E = o.options.columnResizeDirection === "rtl" ? -1 : 1, b = (h - ((M = v == null ? void 0 : v.startOffset) != null ? M : 0)) * E, ee = Math.max(b / ((F = v == null ? void 0 : v.startSize) != null ? F : 0), -0.999999);
766
+ const E = o.options.columnResizeDirection === "rtl" ? -1 : 1, b = (h - ((M = v?.startOffset) != null ? M : 0)) * E, ee = Math.max(b / ((F = v?.startSize) != null ? F : 0), -0.999999);
767
767
  return v.columnSizingStart.forEach((ce) => {
768
768
  let [pe, te] = ce;
769
769
  a[pe] = Math.round(Math.max(te + te * ee, 0) * 100) / 100;
@@ -789,18 +789,18 @@ const H = {
789
789
  }, s = Le(t), c = {
790
790
  moveHandler: (w) => m(w.clientX),
791
791
  upHandler: (w) => {
792
- s == null || s.removeEventListener("mousemove", c.moveHandler), s == null || s.removeEventListener("mouseup", c.upHandler), d(w.clientX);
792
+ s?.removeEventListener("mousemove", c.moveHandler), s?.removeEventListener("mouseup", c.upHandler), d(w.clientX);
793
793
  }
794
794
  }, p = {
795
795
  moveHandler: (w) => (w.cancelable && (w.preventDefault(), w.stopPropagation()), m(w.touches[0].clientX), !1),
796
796
  upHandler: (w) => {
797
797
  var h;
798
- s == null || s.removeEventListener("touchmove", p.moveHandler), s == null || s.removeEventListener("touchend", p.upHandler), w.cancelable && (w.preventDefault(), w.stopPropagation()), d((h = w.touches[0]) == null ? void 0 : h.clientX);
798
+ s?.removeEventListener("touchmove", p.moveHandler), s?.removeEventListener("touchend", p.upHandler), w.cancelable && (w.preventDefault(), w.stopPropagation()), d((h = w.touches[0]) == null ? void 0 : h.clientX);
799
799
  }
800
800
  }, R = ze() ? {
801
801
  passive: !1
802
802
  } : !1;
803
- T(i) ? (s == null || s.addEventListener("touchmove", p.moveHandler, R), s == null || s.addEventListener("touchend", p.upHandler, R)) : (s == null || s.addEventListener("mousemove", c.moveHandler, R), s == null || s.addEventListener("mouseup", c.upHandler, R)), o.setColumnSizingInfo((w) => ({
803
+ T(i) ? (s?.addEventListener("touchmove", p.moveHandler, R), s?.addEventListener("touchend", p.upHandler, R)) : (s?.addEventListener("mousemove", c.moveHandler, R), s?.addEventListener("mouseup", c.upHandler, R)), o.setColumnSizingInfo((w) => ({
804
804
  ...w,
805
805
  startOffset: g,
806
806
  startSize: l,
@@ -1013,7 +1013,7 @@ const Be = {
1013
1013
  }, e.getIsExpanded = () => {
1014
1014
  var t;
1015
1015
  const n = o.getState().expanded;
1016
- return !!((t = o.options.getIsRowExpanded == null ? void 0 : o.options.getIsRowExpanded(e)) != null ? t : n === !0 || n != null && n[e.id]);
1016
+ return !!((t = o.options.getIsRowExpanded == null ? void 0 : o.options.getIsRowExpanded(e)) != null ? t : n === !0 || n?.[e.id]);
1017
1017
  }, e.getCanExpand = () => {
1018
1018
  var t, n, r;
1019
1019
  return (t = o.options.getRowCanExpand == null ? void 0 : o.options.getRowCanExpand(e)) != null ? t : ((n = o.options.enableExpanding) != null ? n : !0) && !!((r = e.subRows) != null && r.length);
@@ -1037,7 +1037,7 @@ const Be = {
1037
1037
  ...e,
1038
1038
  pagination: {
1039
1039
  ...q(),
1040
- ...e == null ? void 0 : e.pagination
1040
+ ...e?.pagination
1041
1041
  }
1042
1042
  }),
1043
1043
  getDefaultOptions: (e) => ({
@@ -1141,20 +1141,20 @@ const Be = {
1141
1141
  if (t === "bottom") {
1142
1142
  var m, d;
1143
1143
  return {
1144
- top: ((m = g == null ? void 0 : g.top) != null ? m : []).filter((p) => !(u != null && u.has(p))),
1145
- bottom: [...((d = g == null ? void 0 : g.bottom) != null ? d : []).filter((p) => !(u != null && u.has(p))), ...Array.from(u)]
1144
+ top: ((m = g?.top) != null ? m : []).filter((p) => !(u != null && u.has(p))),
1145
+ bottom: [...((d = g?.bottom) != null ? d : []).filter((p) => !(u != null && u.has(p))), ...Array.from(u)]
1146
1146
  };
1147
1147
  }
1148
1148
  if (t === "top") {
1149
1149
  var s, c;
1150
1150
  return {
1151
- top: [...((s = g == null ? void 0 : g.top) != null ? s : []).filter((p) => !(u != null && u.has(p))), ...Array.from(u)],
1152
- bottom: ((c = g == null ? void 0 : g.bottom) != null ? c : []).filter((p) => !(u != null && u.has(p)))
1151
+ top: [...((s = g?.top) != null ? s : []).filter((p) => !(u != null && u.has(p))), ...Array.from(u)],
1152
+ bottom: ((c = g?.bottom) != null ? c : []).filter((p) => !(u != null && u.has(p)))
1153
1153
  };
1154
1154
  }
1155
1155
  return {
1156
- top: ((a = g == null ? void 0 : g.top) != null ? a : []).filter((p) => !(u != null && u.has(p))),
1157
- bottom: ((f = g == null ? void 0 : g.bottom) != null ? f : []).filter((p) => !(u != null && u.has(p)))
1156
+ top: ((a = g?.top) != null ? a : []).filter((p) => !(u != null && u.has(p))),
1157
+ bottom: ((f = g?.bottom) != null ? f : []).filter((p) => !(u != null && u.has(p)))
1158
1158
  };
1159
1159
  });
1160
1160
  }, e.getCanPin = () => {
@@ -1168,7 +1168,7 @@ const Be = {
1168
1168
  const t = [e.id], {
1169
1169
  top: n,
1170
1170
  bottom: r
1171
- } = o.getState().rowPinning, i = t.some((u) => n == null ? void 0 : n.includes(u)), l = t.some((u) => r == null ? void 0 : r.includes(u));
1171
+ } = o.getState().rowPinning, i = t.some((u) => n?.includes(u)), l = t.some((u) => r?.includes(u));
1172
1172
  return i ? "top" : l ? "bottom" : !1;
1173
1173
  }, e.getPinnedIndex = () => {
1174
1174
  var t, n;
@@ -1180,7 +1180,7 @@ const Be = {
1180
1180
  } = l;
1181
1181
  return u;
1182
1182
  });
1183
- return (n = i == null ? void 0 : i.indexOf(e.id)) != null ? n : -1;
1183
+ return (n = i?.indexOf(e.id)) != null ? n : -1;
1184
1184
  };
1185
1185
  },
1186
1186
  createTable: (e) => {
@@ -1300,7 +1300,7 @@ const Be = {
1300
1300
  const u = {
1301
1301
  ...i
1302
1302
  };
1303
- return X(u, e.id, t, (l = n == null ? void 0 : n.selectChildren) != null ? l : !0, o), u;
1303
+ return X(u, e.id, t, (l = n?.selectChildren) != null ? l : !0, o), u;
1304
1304
  });
1305
1305
  }, e.getIsSelected = () => {
1306
1306
  const {
@@ -1427,7 +1427,7 @@ const y = {
1427
1427
  const t = o.getFilteredRowModel().flatRows.slice(10);
1428
1428
  let n = !1;
1429
1429
  for (const r of t) {
1430
- const i = r == null ? void 0 : r.getValue(e.id);
1430
+ const i = r?.getValue(e.id);
1431
1431
  if (Object.prototype.toString.call(i) === "[object Date]")
1432
1432
  return y.datetime;
1433
1433
  if (typeof i == "string" && (n = !0, i.split(J).length > 1))
@@ -1436,7 +1436,7 @@ const y = {
1436
1436
  return n ? y.text : y.basic;
1437
1437
  }, e.getAutoSortDir = () => {
1438
1438
  const t = o.getFilteredRowModel().flatRows[0];
1439
- return typeof (t == null ? void 0 : t.getValue(e.id)) == "string" ? "asc" : "desc";
1439
+ return typeof t?.getValue(e.id) == "string" ? "asc" : "desc";
1440
1440
  }, e.getSortingFn = () => {
1441
1441
  var t, n;
1442
1442
  if (!e)
@@ -1445,7 +1445,7 @@ const y = {
1445
1445
  }, e.toggleSorting = (t, n) => {
1446
1446
  const r = e.getNextSortingOrder(), i = typeof t < "u" && t !== null;
1447
1447
  o.setSorting((l) => {
1448
- const u = l == null ? void 0 : l.find((s) => s.id === e.id), g = l == null ? void 0 : l.findIndex((s) => s.id === e.id);
1448
+ const u = l?.find((s) => s.id === e.id), g = l?.findIndex((s) => s.id === e.id);
1449
1449
  let a = [], f, m = i ? t : r === "desc";
1450
1450
  if (l != null && l.length && e.getCanMultiSort() && n ? u ? f = "toggle" : f = "add" : l != null && l.length && g !== l.length - 1 ? f = "replace" : u ? f = "toggle" : f = "replace", f === "toggle" && (i || r || (f = "remove")), f === "add") {
1451
1451
  var d;
@@ -1635,7 +1635,7 @@ function it() {
1635
1635
  i === void 0 && (i = 0);
1636
1636
  const u = [];
1637
1637
  for (let a = 0; a < r.length; a++) {
1638
- const f = Q(e, e._getRowId(r[a], a, l), r[a], a, i, void 0, l == null ? void 0 : l.id);
1638
+ const f = Q(e, e._getRowId(r[a], a, l), r[a], a, i, void 0, l?.id);
1639
1639
  if (t.flatRows.push(f), t.rowsById[f.id] = f, u.push(f), e.options.getSubRows) {
1640
1640
  var g;
1641
1641
  f.originalSubRows = e.options.getSubRows(r[a], a), (g = f.originalSubRows) != null && g.length && (f.subRows = n(f.originalSubRows, i + 1, f));
@@ -1806,7 +1806,7 @@ function ut() {
1806
1806
  return a.sort((f, m) => {
1807
1807
  for (let s = 0; s < i.length; s += 1) {
1808
1808
  var d;
1809
- const c = i[s], p = l[c.id], R = p.sortUndefined, w = (d = c == null ? void 0 : c.desc) != null ? d : !1;
1809
+ const c = i[s], p = l[c.id], R = p.sortUndefined, w = (d = c?.desc) != null ? d : !1;
1810
1810
  let h = 0;
1811
1811
  if (R) {
1812
1812
  const v = f.getValue(c.id), M = m.getValue(c.id), F = v === void 0, E = M === void 0;
@@ -1,10 +1,10 @@
1
- import { constructFrom as f } from "./constructFrom.js";
2
- import { toDate as c } from "./toDate.js";
3
- function N(a, t, e) {
4
- const r = c(a, e == null ? void 0 : e.in);
5
- return isNaN(t) ? f(a, NaN) : (t && r.setDate(r.getDate() + t), r);
1
+ import { constructFrom as a } from "./constructFrom.js";
2
+ import { toDate as i } from "./toDate.js";
3
+ function s(e, r, o) {
4
+ const t = i(e, o?.in);
5
+ return isNaN(r) ? a(e, NaN) : (r && t.setDate(t.getDate() + r), t);
6
6
  }
7
7
  export {
8
- N as addDays,
9
- N as default
8
+ s as addDays,
9
+ s as default
10
10
  };
@@ -1,20 +1,20 @@
1
- import { constructFrom as f } from "./constructFrom.js";
2
- import { toDate as c } from "./toDate.js";
3
- function M(r, n, o) {
4
- const t = c(r, o == null ? void 0 : o.in);
5
- if (isNaN(n)) return f(r, NaN);
6
- if (!n)
1
+ import { constructFrom as s } from "./constructFrom.js";
2
+ import { toDate as f } from "./toDate.js";
3
+ function u(n, o, i) {
4
+ const t = f(n, i?.in);
5
+ if (isNaN(o)) return s(n, NaN);
6
+ if (!o)
7
7
  return t;
8
- const a = t.getDate(), e = f(r, t.getTime());
9
- e.setMonth(t.getMonth() + n + 1, 0);
10
- const s = e.getDate();
11
- return a >= s ? e : (t.setFullYear(
8
+ const r = t.getDate(), e = s(n, t.getTime());
9
+ e.setMonth(t.getMonth() + o + 1, 0);
10
+ const a = e.getDate();
11
+ return r >= a ? e : (t.setFullYear(
12
12
  e.getFullYear(),
13
13
  e.getMonth(),
14
- a
14
+ r
15
15
  ), t);
16
16
  }
17
17
  export {
18
- M as addMonths,
19
- M as default
18
+ u as addMonths,
19
+ u as default
20
20
  };
@@ -1,16 +1,16 @@
1
- import { getTimezoneOffsetInMilliseconds as a } from "./_lib/getTimezoneOffsetInMilliseconds.js";
1
+ import { getTimezoneOffsetInMilliseconds as r } from "./_lib/getTimezoneOffsetInMilliseconds.js";
2
2
  import { normalizeDates as c } from "./_lib/normalizeDates.js";
3
3
  import { millisecondsInDay as D } from "./constants.js";
4
- import { startOfDay as m } from "./startOfDay.js";
5
- function p(n, i, e) {
6
- const [f, l] = c(
7
- e == null ? void 0 : e.in,
8
- n,
9
- i
10
- ), r = m(f), t = m(l), o = +r - a(r), s = +t - a(t);
11
- return Math.round((o - s) / D);
4
+ import { startOfDay as a } from "./startOfDay.js";
5
+ function O(o, n, i) {
6
+ const [s, m] = c(
7
+ i?.in,
8
+ o,
9
+ n
10
+ ), t = a(s), e = a(m), f = +t - r(t), l = +e - r(e);
11
+ return Math.round((f - l) / D);
12
12
  }
13
13
  export {
14
- p as default,
15
- p as differenceInCalendarDays
14
+ O as default,
15
+ O as differenceInCalendarDays
16
16
  };
@@ -1,9 +1,9 @@
1
- import { toDate as a } from "./toDate.js";
2
- function u(t, e) {
3
- const r = a(t, e == null ? void 0 : e.in);
4
- return r.setHours(23, 59, 59, 999), r;
1
+ import { toDate as n } from "./toDate.js";
2
+ function a(e, o) {
3
+ const t = n(e, o?.in);
4
+ return t.setHours(23, 59, 59, 999), t;
5
5
  }
6
6
  export {
7
- u as default,
8
- u as endOfDay
7
+ a as default,
8
+ a as endOfDay
9
9
  };
@@ -1,9 +1,9 @@
1
- import { toDate as n } from "./toDate.js";
2
- function l(r, e) {
3
- const t = n(r, e == null ? void 0 : e.in), a = t.getMonth();
4
- return t.setFullYear(t.getFullYear(), a + 1, 0), t.setHours(23, 59, 59, 999), t;
1
+ import { toDate as r } from "./toDate.js";
2
+ function s(e, o) {
3
+ const t = r(e, o?.in), n = t.getMonth();
4
+ return t.setFullYear(t.getFullYear(), n + 1, 0), t.setHours(23, 59, 59, 999), t;
5
5
  }
6
6
  export {
7
- l as default,
8
- l as endOfMonth
7
+ s as default,
8
+ s as endOfMonth
9
9
  };
@@ -1,59 +1,58 @@
1
- import { getDefaultOptions as v } from "./_lib/defaultOptions.js";
2
- import { formatters as D } from "./_lib/format/formatters.js";
3
- import { longFormatters as C } from "./_lib/format/longFormatters.js";
4
- import { isProtectedWeekYearToken as S, isProtectedDayOfYearToken as R, warnOrThrowProtectedError as W } from "./_lib/protectedTokens.js";
5
- import { isValid as x } from "./isValid.js";
6
- import { toDate as P } from "./toDate.js";
7
- import { enUS as Y } from "./locale/en-US.js";
8
- const z = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, F = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, y = /^'([^]*?)'?$/, A = /''/g, L = /[a-zA-Z]/;
9
- function U(t, c, e) {
10
- var i, k, s, u, d, g, h, w;
11
- const n = v(), l = (e == null ? void 0 : e.locale) ?? n.locale ?? Y, T = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((k = (i = e == null ? void 0 : e.locale) == null ? void 0 : i.options) == null ? void 0 : k.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((u = (s = n.locale) == null ? void 0 : s.options) == null ? void 0 : u.firstWeekContainsDate) ?? 1, O = (e == null ? void 0 : e.weekStartsOn) ?? ((g = (d = e == null ? void 0 : e.locale) == null ? void 0 : d.options) == null ? void 0 : g.weekStartsOn) ?? n.weekStartsOn ?? ((w = (h = n.locale) == null ? void 0 : h.options) == null ? void 0 : w.weekStartsOn) ?? 0, f = P(t, e == null ? void 0 : e.in);
12
- if (!x(f))
1
+ import { getDefaultOptions as u } from "./_lib/defaultOptions.js";
2
+ import { formatters as f } from "./_lib/format/formatters.js";
3
+ import { longFormatters as d } from "./_lib/format/longFormatters.js";
4
+ import { isProtectedWeekYearToken as g, isProtectedDayOfYearToken as h, warnOrThrowProtectedError as w } from "./_lib/protectedTokens.js";
5
+ import { isValid as D } from "./isValid.js";
6
+ import { toDate as T } from "./toDate.js";
7
+ import { enUS as O } from "./locale/en-US.js";
8
+ const E = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, v = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, C = /^'([^]*?)'?$/, S = /''/g, R = /[a-zA-Z]/;
9
+ function L(o, a, r) {
10
+ const n = u(), i = r?.locale ?? n.locale ?? O, m = r?.firstWeekContainsDate ?? r?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, p = r?.weekStartsOn ?? r?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, s = T(o, r?.in);
11
+ if (!D(s))
13
12
  throw new RangeError("Invalid time value");
14
- let m = c.match(F).map((a) => {
15
- const r = a[0];
16
- if (r === "p" || r === "P") {
17
- const o = C[r];
18
- return o(a, l.formatLong);
13
+ let c = a.match(v).map((t) => {
14
+ const e = t[0];
15
+ if (e === "p" || e === "P") {
16
+ const l = d[e];
17
+ return l(t, i.formatLong);
19
18
  }
20
- return a;
21
- }).join("").match(z).map((a) => {
22
- if (a === "''")
19
+ return t;
20
+ }).join("").match(E).map((t) => {
21
+ if (t === "''")
23
22
  return { isToken: !1, value: "'" };
24
- const r = a[0];
25
- if (r === "'")
26
- return { isToken: !1, value: $(a) };
27
- if (D[r])
28
- return { isToken: !0, value: a };
29
- if (r.match(L))
23
+ const e = t[0];
24
+ if (e === "'")
25
+ return { isToken: !1, value: W(t) };
26
+ if (f[e])
27
+ return { isToken: !0, value: t };
28
+ if (e.match(R))
30
29
  throw new RangeError(
31
- "Format string contains an unescaped latin alphabet character `" + r + "`"
30
+ "Format string contains an unescaped latin alphabet character `" + e + "`"
32
31
  );
33
- return { isToken: !1, value: a };
32
+ return { isToken: !1, value: t };
34
33
  });
35
- l.localize.preprocessor && (m = l.localize.preprocessor(f, m));
36
- const E = {
37
- firstWeekContainsDate: T,
38
- weekStartsOn: O,
39
- locale: l
34
+ i.localize.preprocessor && (c = i.localize.preprocessor(s, c));
35
+ const k = {
36
+ firstWeekContainsDate: m,
37
+ weekStartsOn: p,
38
+ locale: i
40
39
  };
41
- return m.map((a) => {
42
- if (!a.isToken) return a.value;
43
- const r = a.value;
44
- (!(e != null && e.useAdditionalWeekYearTokens) && S(r) || !(e != null && e.useAdditionalDayOfYearTokens) && R(r)) && W(r, c, String(t));
45
- const o = D[r[0]];
46
- return o(f, r, l.localize, E);
40
+ return c.map((t) => {
41
+ if (!t.isToken) return t.value;
42
+ const e = t.value;
43
+ (!r?.useAdditionalWeekYearTokens && g(e) || !r?.useAdditionalDayOfYearTokens && h(e)) && w(e, a, String(o));
44
+ const l = f[e[0]];
45
+ return l(s, e, i.localize, k);
47
46
  }).join("");
48
47
  }
49
- function $(t) {
50
- const c = t.match(y);
51
- return c ? c[1].replace(A, "'") : t;
48
+ function W(o) {
49
+ const a = o.match(C);
50
+ return a ? a[1].replace(S, "'") : o;
52
51
  }
53
52
  export {
54
- U as default,
55
- U as format,
56
- U as formatDate,
57
- D as formatters,
58
- C as longFormatters
53
+ L as default,
54
+ L as format,
55
+ L as formatDate,
56
+ f as formatters,
57
+ d as longFormatters
59
58
  };
@@ -1,11 +1,11 @@
1
- import { differenceInCalendarDays as e } from "./differenceInCalendarDays.js";
2
- import { startOfYear as t } from "./startOfYear.js";
3
- import { toDate as d } from "./toDate.js";
4
- function y(f, r) {
5
- const a = d(f, r == null ? void 0 : r.in);
6
- return e(a, t(a)) + 1;
1
+ import { differenceInCalendarDays as f } from "./differenceInCalendarDays.js";
2
+ import { startOfYear as e } from "./startOfYear.js";
3
+ import { toDate as o } from "./toDate.js";
4
+ function c(t, a) {
5
+ const r = o(t, a?.in);
6
+ return f(r, e(r)) + 1;
7
7
  }
8
8
  export {
9
- y as default,
10
- y as getDayOfYear
9
+ c as default,
10
+ c as getDayOfYear
11
11
  };
@@ -1,12 +1,12 @@
1
- import { millisecondsInWeek as m } from "./constants.js";
2
- import { startOfISOWeek as a } from "./startOfISOWeek.js";
3
- import { startOfISOWeekYear as o } from "./startOfISOWeekYear.js";
4
- import { toDate as d } from "./toDate.js";
5
- function k(t, e) {
6
- const r = d(t, e == null ? void 0 : e.in), f = +a(r) - +o(r);
7
- return Math.round(f / m) + 1;
1
+ import { millisecondsInWeek as f } from "./constants.js";
2
+ import { startOfISOWeek as i } from "./startOfISOWeek.js";
3
+ import { startOfISOWeekYear as m } from "./startOfISOWeekYear.js";
4
+ import { toDate as n } from "./toDate.js";
5
+ function O(e, o) {
6
+ const t = n(e, o?.in), r = +i(t) - +m(t);
7
+ return Math.round(r / f) + 1;
8
8
  }
9
9
  export {
10
- k as default,
11
- k as getISOWeek
10
+ O as default,
11
+ O as getISOWeek
12
12
  };
@@ -1,13 +1,13 @@
1
- import { constructFrom as f } from "./constructFrom.js";
2
- import { startOfISOWeek as u } from "./startOfISOWeek.js";
3
- import { toDate as c } from "./toDate.js";
4
- function Y(o, r) {
5
- const e = c(o, r == null ? void 0 : r.in), t = e.getFullYear(), a = f(e, 0);
6
- a.setFullYear(t + 1, 0, 4), a.setHours(0, 0, 0, 0);
7
- const m = u(a), s = f(e, 0);
8
- s.setFullYear(t, 0, 4), s.setHours(0, 0, 0, 0);
9
- const n = u(s);
10
- return e.getTime() >= m.getTime() ? t + 1 : e.getTime() >= n.getTime() ? t : t - 1;
1
+ import { constructFrom as s } from "./constructFrom.js";
2
+ import { startOfISOWeek as a } from "./startOfISOWeek.js";
3
+ import { toDate as m } from "./toDate.js";
4
+ function Y(f, n) {
5
+ const e = m(f, n?.in), t = e.getFullYear(), r = s(e, 0);
6
+ r.setFullYear(t + 1, 0, 4), r.setHours(0, 0, 0, 0);
7
+ const u = a(r), o = s(e, 0);
8
+ o.setFullYear(t, 0, 4), o.setHours(0, 0, 0, 0);
9
+ const i = a(o);
10
+ return e.getTime() >= u.getTime() ? t + 1 : e.getTime() >= i.getTime() ? t : t - 1;
11
11
  }
12
12
  export {
13
13
  Y as default,
@@ -1,12 +1,12 @@
1
- import { millisecondsInWeek as m } from "./constants.js";
2
- import { startOfWeek as a } from "./startOfWeek.js";
3
- import { startOfWeekYear as d } from "./startOfWeekYear.js";
4
- import { toDate as c } from "./toDate.js";
5
- function l(t, e) {
6
- const r = c(t, e == null ? void 0 : e.in), f = +a(r, e) - +d(r, e);
7
- return Math.round(f / m) + 1;
1
+ import { millisecondsInWeek as f } from "./constants.js";
2
+ import { startOfWeek as m } from "./startOfWeek.js";
3
+ import { startOfWeekYear as a } from "./startOfWeekYear.js";
4
+ import { toDate as i } from "./toDate.js";
5
+ function k(r, t) {
6
+ const e = i(r, t?.in), o = +m(e, t) - +a(e, t);
7
+ return Math.round(o / f) + 1;
8
8
  }
9
9
  export {
10
- l as default,
11
- l as getWeek
10
+ k as default,
11
+ k as getWeek
12
12
  };