@caspeco/casper-ui-library 4.0.0 → 4.0.1
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/components/combobox/combobox-button.js +72 -73
- package/dist/components/combobox/combobox-menu.js +68 -69
- package/dist/components/combobox/combobox.js +104 -109
- package/dist/components/date-picker/base-date-picker.js +175 -176
- package/dist/components/date-picker/date-picker-header.js +10 -10
- package/dist/components/date-picker/helper.js +9 -9
- package/dist/components/image-upload/image-cropper.js +112 -113
- package/dist/components/image-upload/image-upload-dropzone.js +35 -36
- package/dist/components/menu/menu-group.js +44 -45
- package/dist/components/segmented-control/segmented-control.js +29 -29
- package/dist/components/table/table-cell.js +25 -26
- package/dist/components/table/table-header-dropdown.js +60 -60
- package/dist/components/table/table-header-row.js +19 -20
- package/dist/components/table/table-toolbar.js +63 -64
- package/dist/components/table/use-controllable-state.js +7 -7
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +1 -1
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +41 -41
- package/dist/node_modules/date-fns/addDays.js +7 -7
- package/dist/node_modules/date-fns/addMonths.js +13 -13
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +11 -11
- package/dist/node_modules/date-fns/endOfDay.js +6 -6
- package/dist/node_modules/date-fns/endOfMonth.js +6 -6
- package/dist/node_modules/date-fns/format.js +46 -47
- package/dist/node_modules/date-fns/getDayOfYear.js +8 -8
- package/dist/node_modules/date-fns/getISOWeek.js +9 -9
- package/dist/node_modules/date-fns/getISOWeekYear.js +10 -10
- package/dist/node_modules/date-fns/getWeek.js +9 -9
- package/dist/node_modules/date-fns/getWeekYear.js +13 -14
- package/dist/node_modules/date-fns/isSameDay.js +9 -9
- package/dist/node_modules/date-fns/isSameMonth.js +9 -9
- package/dist/node_modules/date-fns/isSameWeek.js +8 -8
- package/dist/node_modules/date-fns/isSameYear.js +9 -9
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +12 -12
- package/dist/node_modules/date-fns/locale/da/_lib/formatDistance.js +4 -4
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +3 -3
- package/dist/node_modules/date-fns/locale/es/_lib/formatDistance.js +4 -4
- package/dist/node_modules/date-fns/locale/et/_lib/formatDistance.js +6 -6
- package/dist/node_modules/date-fns/locale/fi/_lib/formatDistance.js +17 -17
- package/dist/node_modules/date-fns/locale/lt/_lib/formatDistance.js +47 -47
- package/dist/node_modules/date-fns/locale/lv/_lib/formatDistance.js +11 -11
- package/dist/node_modules/date-fns/locale/nb/_lib/formatDistance.js +3 -3
- package/dist/node_modules/date-fns/locale/nl/_lib/formatDistance.js +4 -4
- package/dist/node_modules/date-fns/locale/sv/_lib/formatDistance.js +5 -5
- package/dist/node_modules/date-fns/startOfDay.js +6 -6
- package/dist/node_modules/date-fns/startOfMonth.js +6 -6
- package/dist/node_modules/date-fns/startOfWeek.js +7 -8
- package/dist/node_modules/date-fns/startOfWeekYear.js +9 -10
- package/dist/node_modules/date-fns/startOfYear.js +5 -5
- package/dist/theme/theme-config/components/modal-theme.js +13 -15
- package/dist/theme/theme-config/components/select-theme.js +15 -19
- package/package.json +2 -2
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 &&
|
|
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
|
|
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()) ===
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
635
|
-
right: [...((g = r
|
|
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
|
|
642
|
-
right: ((f = r
|
|
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
|
|
647
|
-
right: ((l = r
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1145
|
-
bottom: [...((d = g
|
|
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
|
|
1152
|
-
bottom: ((c = g
|
|
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
|
|
1157
|
-
bottom: ((f = g
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
2
|
-
import { toDate as
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
return isNaN(
|
|
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
|
-
|
|
9
|
-
|
|
8
|
+
s as addDays,
|
|
9
|
+
s as default
|
|
10
10
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { constructFrom as
|
|
2
|
-
import { toDate as
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
5
|
-
if (isNaN(
|
|
6
|
-
if (!
|
|
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
|
|
9
|
-
e.setMonth(t.getMonth() +
|
|
10
|
-
const
|
|
11
|
-
return
|
|
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
|
-
|
|
14
|
+
r
|
|
15
15
|
), t);
|
|
16
16
|
}
|
|
17
17
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
u as addMonths,
|
|
19
|
+
u as default
|
|
20
20
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { getTimezoneOffsetInMilliseconds as
|
|
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
|
|
5
|
-
function
|
|
6
|
-
const [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
),
|
|
11
|
-
return Math.round((
|
|
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
|
-
|
|
15
|
-
|
|
14
|
+
O as default,
|
|
15
|
+
O as differenceInCalendarDays
|
|
16
16
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { toDate as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
return
|
|
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
|
-
|
|
8
|
-
|
|
7
|
+
a as default,
|
|
8
|
+
a as endOfDay
|
|
9
9
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { toDate as
|
|
2
|
-
function
|
|
3
|
-
const t =
|
|
4
|
-
return t.setFullYear(t.getFullYear(),
|
|
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
|
-
|
|
8
|
-
|
|
7
|
+
s as default,
|
|
8
|
+
s as endOfMonth
|
|
9
9
|
};
|
|
@@ -1,59 +1,58 @@
|
|
|
1
|
-
import { getDefaultOptions as
|
|
2
|
-
import { formatters as
|
|
3
|
-
import { longFormatters as
|
|
4
|
-
import { isProtectedWeekYearToken as
|
|
5
|
-
import { isValid as
|
|
6
|
-
import { toDate as
|
|
7
|
-
import { enUS as
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
17
|
-
const
|
|
18
|
-
return
|
|
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
|
|
21
|
-
}).join("").match(
|
|
22
|
-
if (
|
|
19
|
+
return t;
|
|
20
|
+
}).join("").match(E).map((t) => {
|
|
21
|
+
if (t === "''")
|
|
23
22
|
return { isToken: !1, value: "'" };
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
return { isToken: !1, value:
|
|
27
|
-
if (
|
|
28
|
-
return { isToken: !0, value:
|
|
29
|
-
if (
|
|
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 `" +
|
|
30
|
+
"Format string contains an unescaped latin alphabet character `" + e + "`"
|
|
32
31
|
);
|
|
33
|
-
return { isToken: !1, value:
|
|
32
|
+
return { isToken: !1, value: t };
|
|
34
33
|
});
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
firstWeekContainsDate:
|
|
38
|
-
weekStartsOn:
|
|
39
|
-
locale:
|
|
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
|
|
42
|
-
if (!
|
|
43
|
-
const
|
|
44
|
-
(!
|
|
45
|
-
const
|
|
46
|
-
return
|
|
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
|
|
50
|
-
const
|
|
51
|
-
return
|
|
48
|
+
function W(o) {
|
|
49
|
+
const a = o.match(C);
|
|
50
|
+
return a ? a[1].replace(S, "'") : o;
|
|
52
51
|
}
|
|
53
52
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
|
2
|
-
import { startOfYear as
|
|
3
|
-
import { toDate as
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
return
|
|
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
|
-
|
|
10
|
-
|
|
9
|
+
c as default,
|
|
10
|
+
c as getDayOfYear
|
|
11
11
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { millisecondsInWeek as
|
|
2
|
-
import { startOfISOWeek as
|
|
3
|
-
import { startOfISOWeekYear as
|
|
4
|
-
import { toDate as
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return Math.round(
|
|
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
|
-
|
|
11
|
-
|
|
10
|
+
O as default,
|
|
11
|
+
O as getISOWeek
|
|
12
12
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { constructFrom as
|
|
2
|
-
import { startOfISOWeek as
|
|
3
|
-
import { toDate as
|
|
4
|
-
function Y(
|
|
5
|
-
const e =
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
return e.getTime() >=
|
|
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
|
|
2
|
-
import { startOfWeek as
|
|
3
|
-
import { startOfWeekYear as
|
|
4
|
-
import { toDate as
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return Math.round(
|
|
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
|
-
|
|
11
|
-
|
|
10
|
+
k as default,
|
|
11
|
+
k as getWeek
|
|
12
12
|
};
|