@dcs-tech/ui 0.9.0 → 0.11.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 (235) hide show
  1. package/CHANGELOG.md +488 -0
  2. package/README.md +43 -7
  3. package/THIRD_PARTY_NOTICES.md +23 -0
  4. package/dist/ChartImageMenu-sB2QNQzd.js +9673 -0
  5. package/dist/ChartView-BstZkP1g.js +1942 -0
  6. package/dist/{SummaryChart-CxRjK_HU.js → SummaryChart-B5ibDNOZ.js} +11 -10
  7. package/dist/{SummaryImage-Crf1R-3a.js → SummaryImage-CRP7X2Nl.js} +2 -2
  8. package/dist/SummarySeeAll-CtYRGV4G.js +101 -0
  9. package/dist/assets/fileTask.worker-D97s2vRV.js +1 -0
  10. package/dist/columnValue-BOn9NC8X.js +644 -0
  11. package/dist/exportContext-CMzuzRjc.js +274 -0
  12. package/dist/{exportEngine-BFZD6djX.js → exportEngine-CYDN8Ty-.js} +167 -137
  13. package/dist/file-worker.js +1 -1
  14. package/dist/{fileActions-CFNO14Aj.js → fileActions-DkPEWE-t.js} +1 -1
  15. package/dist/{geometry-yZmKN662.js → geometry-CFS5If1N.js} +848 -439
  16. package/dist/index.js +24208 -12603
  17. package/dist/{labels-CnqqTrne.js → labels-mukFhYkc.js} +126 -1
  18. package/dist/{runFileTask-BIZTFnZP.js → runFileTask-DI_39TjR.js} +17 -0
  19. package/dist/scrollArea-B52kugL1.js +291 -0
  20. package/dist/style.css +1 -1
  21. package/dist/{summaryChartData-CARqGRUl.js → summaryChartData-D15kw64n.js} +10 -3
  22. package/dist/types/components/Alert/Alert.d.ts +16 -0
  23. package/dist/types/components/Alert/index.d.ts +2 -0
  24. package/dist/types/components/Card/Card.d.ts +4 -3
  25. package/dist/types/components/Card/index.d.ts +1 -1
  26. package/dist/types/components/Charts/BarList.d.ts +4 -3
  27. package/dist/types/components/Charts/CalendarHeatmap.d.ts +4 -2
  28. package/dist/types/components/Charts/Chart.d.ts +3 -2
  29. package/dist/types/components/Charts/ChartView.d.ts +3 -2
  30. package/dist/types/components/Charts/ColumnChart.d.ts +4 -3
  31. package/dist/types/components/Charts/Donut.d.ts +3 -2
  32. package/dist/types/components/Charts/Funnel.d.ts +4 -2
  33. package/dist/types/components/Charts/Gauge.d.ts +3 -2
  34. package/dist/types/components/Charts/LineChart.d.ts +4 -3
  35. package/dist/types/components/Charts/NumberTrend.d.ts +4 -3
  36. package/dist/types/components/Charts/Progress.d.ts +3 -2
  37. package/dist/types/components/Charts/StackedBar.d.ts +3 -2
  38. package/dist/types/components/Charts/Treemap.d.ts +3 -2
  39. package/dist/types/components/Charts/chartData.d.ts +6 -0
  40. package/dist/types/components/Charts/chartImage.d.ts +3 -0
  41. package/dist/types/components/Charts/geometry.d.ts +3 -0
  42. package/dist/types/components/Charts/index.d.ts +2 -0
  43. package/dist/types/components/Charts/palette.d.ts +1 -0
  44. package/dist/types/components/Charts/parts.d.ts +14 -0
  45. package/dist/types/components/Charts/useChartMotion.d.ts +8 -0
  46. package/dist/types/components/ChipInput/ChipTags.d.ts +3 -0
  47. package/dist/types/components/CommandPalette/CommandPaletteTrigger.d.ts +9 -0
  48. package/dist/types/components/CommandPalette/index.d.ts +2 -0
  49. package/dist/types/components/DataTable/DataTable.d.ts +3 -1
  50. package/dist/types/components/DataTable/DisplayPopover.d.ts +1 -0
  51. package/dist/types/components/DataTable/HeaderMenu.d.ts +1 -0
  52. package/dist/types/components/DataTable/TableColumnModal.d.ts +4 -1
  53. package/dist/types/components/DataTable/TablePagination.d.ts +1 -1
  54. package/dist/types/components/DataTable/TableToolbar.d.ts +21 -1
  55. package/dist/types/components/DataTable/TableView.d.ts +19 -2
  56. package/dist/types/components/DataTable/cards/CardView.d.ts +25 -5
  57. package/dist/types/components/DataTable/cards/cardFields.d.ts +1 -0
  58. package/dist/types/components/DataTable/cards/rowParts.d.ts +1 -0
  59. package/dist/types/components/DataTable/cellSelection/CellRangeBar.d.ts +16 -0
  60. package/dist/types/components/DataTable/cellSelection/cellRangeStore.d.ts +18 -0
  61. package/dist/types/components/DataTable/cellSelection/paintRanges.d.ts +2 -0
  62. package/dist/types/components/DataTable/cellSelection/useCellSelection.d.ts +63 -0
  63. package/dist/types/components/DataTable/data/listDelta.d.ts +27 -0
  64. package/dist/types/components/DataTable/data/rowLineage.d.ts +3 -0
  65. package/dist/types/components/DataTable/data/rowModels.d.ts +9 -0
  66. package/dist/types/components/DataTable/data/rowTransaction.d.ts +9 -0
  67. package/dist/types/components/DataTable/data/useServerData.d.ts +3 -1
  68. package/dist/types/components/DataTable/defaults.d.ts +4 -0
  69. package/dist/types/components/DataTable/export/exportCells.d.ts +5 -2
  70. package/dist/types/components/DataTable/export/exportEngine.d.ts +7 -2
  71. package/dist/types/components/DataTable/export/useTableExport.d.ts +17 -1
  72. package/dist/types/components/DataTable/filters/filterRowModel.d.ts +1 -0
  73. package/dist/types/components/DataTable/grouping/groupModel.d.ts +11 -0
  74. package/dist/types/components/DataTable/index.d.ts +1 -1
  75. package/dist/types/components/DataTable/keyboard/ShortcutsDialog.d.ts +4 -1
  76. package/dist/types/components/DataTable/keyboard/useGridKeyboard.d.ts +8 -0
  77. package/dist/types/components/DataTable/labels.d.ts +130 -0
  78. package/dist/types/components/DataTable/layout/LayoutSwitcher.d.ts +10 -2
  79. package/dist/types/components/DataTable/layout/useFitWidths.d.ts +7 -0
  80. package/dist/types/components/DataTable/menu/RowMenu.d.ts +1 -0
  81. package/dist/types/components/DataTable/menu/buildRowMenu.d.ts +6 -3
  82. package/dist/types/components/DataTable/motion/RowChangeNotice.d.ts +19 -0
  83. package/dist/types/components/DataTable/motion/rowChanges.d.ts +25 -0
  84. package/dist/types/components/DataTable/motion/useNoticeInsets.d.ts +2 -0
  85. package/dist/types/components/DataTable/motion/useRowChangeNotices.d.ts +35 -0
  86. package/dist/types/components/DataTable/motion/useRowMotion.d.ts +29 -3
  87. package/dist/types/components/DataTable/persistence/reconcile.d.ts +4 -0
  88. package/dist/types/components/DataTable/persistence/useColumnPersistence.d.ts +5 -1
  89. package/dist/types/components/DataTable/pivot/PivotPanel.d.ts +11 -0
  90. package/dist/types/components/DataTable/pivot/PivotView.d.ts +22 -0
  91. package/dist/types/components/DataTable/pivot/pivotModel.d.ts +54 -0
  92. package/dist/types/components/DataTable/pivot/usePivot.d.ts +44 -0
  93. package/dist/types/components/DataTable/rows/PressRow.d.ts +1 -0
  94. package/dist/types/components/DataTable/rows/RowLead.d.ts +23 -0
  95. package/dist/types/components/DataTable/rows/rowPress.d.ts +2 -0
  96. package/dist/types/components/DataTable/rows/usePinnedRows.d.ts +34 -0
  97. package/dist/types/components/DataTable/rows/useRowDrag.d.ts +44 -0
  98. package/dist/types/components/DataTable/split/SplitView.d.ts +4 -2
  99. package/dist/types/components/DataTable/summary/SummaryChart.d.ts +2 -1
  100. package/dist/types/components/DataTable/summary/TableSummary.d.ts +2 -1
  101. package/dist/types/components/DataTable/summary/summaryModel.d.ts +28 -6
  102. package/dist/types/components/DataTable/summary/useTableSummary.d.ts +3 -0
  103. package/dist/types/components/DataTable/toolbar/ToolbarMore.d.ts +14 -0
  104. package/dist/types/components/DataTable/toolbar/useToolbarFit.d.ts +10 -0
  105. package/dist/types/components/DataTable/tree/TreeChips.d.ts +5 -0
  106. package/dist/types/components/DataTable/tree/treeExport.d.ts +54 -0
  107. package/dist/types/components/DataTable/tree/treeMove.d.ts +1 -0
  108. package/dist/types/components/DataTable/tree/useTreeChildren.d.ts +15 -0
  109. package/dist/types/components/DataTable/tree/useTreeData.d.ts +60 -0
  110. package/dist/types/components/DataTable/types.d.ts +290 -6
  111. package/dist/types/components/DataTable/ui-local/TableReorderList.d.ts +13 -0
  112. package/dist/types/components/DataTable/ui.d.ts +2 -1
  113. package/dist/types/components/DataTable/useDataChangeTracker.d.ts +11 -4
  114. package/dist/types/components/DataTable/useTable.d.ts +14 -1
  115. package/dist/types/components/DataTable/virtual/useVirtualLines.d.ts +1 -0
  116. package/dist/types/components/DatePicker/PeriodGrid.d.ts +13 -0
  117. package/dist/types/components/DatePicker/PeriodPicker.d.ts +19 -0
  118. package/dist/types/components/DatePicker/index.d.ts +1 -1
  119. package/dist/types/components/Dialog/dialogSlots.d.ts +9 -0
  120. package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +8 -0
  121. package/dist/types/components/EventCalendar/EventCalendar.d.ts +46 -0
  122. package/dist/types/components/EventCalendar/eventParts.d.ts +10 -0
  123. package/dist/types/components/EventCalendar/index.d.ts +3 -0
  124. package/dist/types/components/EventCalendar/useCalendarEdit.d.ts +40 -0
  125. package/dist/types/components/FieldWrapper/index.d.ts +1 -1
  126. package/dist/types/components/Fields/index.d.ts +1 -1
  127. package/dist/types/components/Icon/Icon.d.ts +36 -0
  128. package/dist/types/components/Icon/Icon.storyData.d.ts +6 -0
  129. package/dist/types/components/Icon/IconContext.d.ts +7 -0
  130. package/dist/types/components/Icon/icons.d.ts +223 -0
  131. package/dist/types/components/Icon/index.d.ts +7 -0
  132. package/dist/types/components/Icon/useIconDone.d.ts +5 -0
  133. package/dist/types/components/Image/ImageEditor.d.ts +21 -0
  134. package/dist/types/components/Image/ImagePicker.d.ts +10 -1
  135. package/dist/types/components/Image/imageRender.d.ts +33 -0
  136. package/dist/types/components/Image/index.d.ts +3 -1
  137. package/dist/types/components/Image/prepareImage.d.ts +4 -3
  138. package/dist/types/components/Link/Link.d.ts +22 -0
  139. package/dist/types/components/Link/index.d.ts +2 -0
  140. package/dist/types/components/NavList/NavList.d.ts +13 -0
  141. package/dist/types/components/NavList/index.d.ts +2 -0
  142. package/dist/types/components/PageProgress/PageProgress.d.ts +10 -0
  143. package/dist/types/components/PageProgress/index.d.ts +2 -0
  144. package/dist/types/components/Pagination/Pagination.d.ts +19 -0
  145. package/dist/types/components/Pagination/index.d.ts +2 -0
  146. package/dist/types/components/Popover/Popover.d.ts +2 -1
  147. package/dist/types/components/Popover/floatingPosition.d.ts +26 -2
  148. package/dist/types/components/ReorderList/ReorderGroup.d.ts +16 -0
  149. package/dist/types/components/ReorderList/ReorderList.d.ts +56 -0
  150. package/dist/types/components/ReorderList/crossListDrag.d.ts +61 -0
  151. package/dist/types/components/ReorderList/index.d.ts +5 -0
  152. package/dist/types/components/ReorderList/useReorderDrag.d.ts +28 -0
  153. package/dist/types/components/Scroll/ui.d.ts +1 -0
  154. package/dist/types/components/SlidingHighlight/index.d.ts +2 -0
  155. package/dist/types/components/SlidingHighlight/useSlidingHighlight.d.ts +20 -0
  156. package/dist/types/components/Suggest/SuggestionList.d.ts +1 -0
  157. package/dist/types/components/Tooltip/useTooltip.d.ts +4 -0
  158. package/dist/types/components/UIProvider/UILabelsContext.d.ts +120 -0
  159. package/dist/types/components/UIProvider/UIProvider.d.ts +2 -0
  160. package/dist/types/core/hooks/index.d.ts +2 -1
  161. package/dist/types/core/hooks/useMeasuredState.d.ts +1 -0
  162. package/dist/types/core/hooks/usePresence.d.ts +1 -0
  163. package/dist/types/core/icons/actions.icons.d.ts +37 -0
  164. package/dist/types/core/icons/commerce.icons.d.ts +16 -0
  165. package/dist/types/core/icons/communication.icons.d.ts +10 -0
  166. package/dist/types/core/icons/delivery.icons.d.ts +13 -0
  167. package/dist/types/core/icons/devices.icons.d.ts +16 -0
  168. package/dist/types/core/icons/files.icons.d.ts +13 -0
  169. package/dist/types/core/icons/general.icons.d.ts +24 -0
  170. package/dist/types/core/icons/index.d.ts +14 -0
  171. package/dist/types/core/icons/media.icons.d.ts +11 -0
  172. package/dist/types/core/icons/navigation.icons.d.ts +25 -0
  173. package/dist/types/core/icons/people.icons.d.ts +13 -0
  174. package/dist/types/core/icons/registry.d.ts +2 -0
  175. package/dist/types/core/icons/state.icons.d.ts +14 -0
  176. package/dist/types/core/icons/status.icons.d.ts +10 -0
  177. package/dist/types/core/icons/table.icons.d.ts +22 -0
  178. package/dist/types/core/icons/text.icons.d.ts +13 -0
  179. package/dist/types/core/logic/alert.logic.d.ts +3 -0
  180. package/dist/types/core/logic/cellRange.logic.d.ts +66 -0
  181. package/dist/types/core/logic/cellTouch.logic.d.ts +16 -0
  182. package/dist/types/core/logic/columnGroups.logic.d.ts +31 -0
  183. package/dist/types/core/logic/commandPalette.logic.d.ts +2 -0
  184. package/dist/types/core/logic/datePicker.logic.d.ts +12 -0
  185. package/dist/types/core/logic/dropdownSide.logic.d.ts +19 -0
  186. package/dist/types/core/logic/eventCalendar.logic.d.ts +225 -0
  187. package/dist/types/core/logic/fieldWrapper.logic.d.ts +6 -1
  188. package/dist/types/core/logic/fitColumns.logic.d.ts +7 -0
  189. package/dist/types/core/logic/icon.logic.d.ts +24 -0
  190. package/dist/types/core/logic/imageEditor.logic.d.ts +132 -0
  191. package/dist/types/core/logic/imageTransform.logic.d.ts +57 -0
  192. package/dist/types/core/logic/index.d.ts +25 -0
  193. package/dist/types/core/logic/inertProps.d.ts +3 -0
  194. package/dist/types/core/logic/pageProgress.logic.d.ts +3 -0
  195. package/dist/types/core/logic/pagination.logic.d.ts +7 -0
  196. package/dist/types/core/logic/periodPicker.logic.d.ts +86 -0
  197. package/dist/types/core/logic/pivot.logic.d.ts +100 -0
  198. package/dist/types/core/logic/reorder.logic.d.ts +49 -0
  199. package/dist/types/core/logic/rowActions.logic.d.ts +7 -0
  200. package/dist/types/core/logic/rowDrag.logic.d.ts +36 -0
  201. package/dist/types/core/logic/rowPinning.logic.d.ts +12 -0
  202. package/dist/types/core/logic/slidingHighlight.logic.d.ts +20 -0
  203. package/dist/types/core/logic/toolbarOverflow.logic.d.ts +21 -0
  204. package/dist/types/core/logic/treeData.logic.d.ts +44 -0
  205. package/dist/types/core/logic/treeDrag.logic.d.ts +63 -0
  206. package/dist/types/core/logic/tween.logic.d.ts +33 -0
  207. package/dist/types/core/logic/visualViewport.logic.d.ts +13 -0
  208. package/dist/types/core/types/chipinput.types.d.ts +3 -1
  209. package/dist/types/core/types/collapsible.types.d.ts +3 -0
  210. package/dist/types/core/types/datePicker.types.d.ts +7 -0
  211. package/dist/types/core/types/eventCalendar.types.d.ts +18 -0
  212. package/dist/types/core/types/field.types.d.ts +6 -3
  213. package/dist/types/core/types/fieldWrapper.types.d.ts +2 -0
  214. package/dist/types/core/types/fields.types.d.ts +6 -1
  215. package/dist/types/core/types/fileEngine.types.d.ts +6 -0
  216. package/dist/types/core/types/form.types.d.ts +1 -0
  217. package/dist/types/core/types/format.types.d.ts +2 -0
  218. package/dist/types/core/types/icon.types.d.ts +109 -0
  219. package/dist/types/core/types/index.d.ts +2 -0
  220. package/dist/types/core/types/input.types.d.ts +2 -0
  221. package/dist/types/core/types/navigation.types.d.ts +1 -0
  222. package/dist/types/core/types/select.types.d.ts +2 -6
  223. package/dist/types/core/types/suggest.types.d.ts +2 -0
  224. package/dist/types/index.d.ts +31 -6
  225. package/package.json +4 -4
  226. package/dist/ChartImageMenu-DDVNJNc6.js +0 -1499
  227. package/dist/ChartView-CW3m4Z_1.js +0 -1703
  228. package/dist/SummarySeeAll-BRHOMQRA.js +0 -101
  229. package/dist/assets/fileTask.worker--Q3rI3Bn.js +0 -1
  230. package/dist/columnValue-DwUqueZ6.js +0 -610
  231. package/dist/exportContext-BKFnNQ0q.js +0 -166
  232. package/dist/scrollArea-DbYFqbIH.js +0 -269
  233. package/dist/types/components/DataTable/ui-local/DragAndDropList/DragAndDropList.d.ts +0 -4
  234. package/dist/types/components/DataTable/ui-local/DragAndDropList/index.d.ts +0 -3
  235. package/dist/types/components/DataTable/ui-local/DragAndDropList/types.d.ts +0 -70
@@ -0,0 +1,644 @@
1
+ "use client";
2
+ // src/core/logic/datePicker.logic.ts
3
+ var e = 1900, t = (e) => String(e).padStart(2, "0"), n = (e, t) => new Date(e, t, 0).getDate();
4
+ function r({ y: e, m: t, d: r }) {
5
+ return !Number.isInteger(e) || !Number.isInteger(t) || !Number.isInteger(r) || e < 1900 || e > 9999 || t < 1 || t > 12 ? !1 : r >= 1 && r <= n(e, t);
6
+ }
7
+ var i = ({ y: e, m: n, d: r }) => `${String(e).padStart(4, "0")}-${t(n)}-${t(r)}`;
8
+ function a(e) {
9
+ let t = /^(\d{4})-(\d{2})-(\d{2})(?:[T ].*)?$/.exec(String(e ?? "").trim());
10
+ if (!t) return null;
11
+ let n = {
12
+ y: Number(t[1]),
13
+ m: Number(t[2]),
14
+ d: Number(t[3])
15
+ };
16
+ return r(n) ? n : null;
17
+ }
18
+ var o = (e = /* @__PURE__ */ new Date()) => i({
19
+ y: e.getFullYear(),
20
+ m: e.getMonth() + 1,
21
+ d: e.getDate()
22
+ }), s = (e) => {
23
+ let t = a(e);
24
+ return t ? i(t) : "";
25
+ }, c = (e, t) => e < t ? -1 : +(e > t);
26
+ function l(e, t) {
27
+ let n = a(e);
28
+ if (!n) return "";
29
+ let r = new Date(n.y, n.m - 1, n.d + t);
30
+ return i({
31
+ y: r.getFullYear(),
32
+ m: r.getMonth() + 1,
33
+ d: r.getDate()
34
+ });
35
+ }
36
+ function u(e, t) {
37
+ let r = a(e);
38
+ if (!r) return "";
39
+ let o = r.y * 12 + (r.m - 1) + t, s = Math.floor(o / 12), c = (o % 12 + 12) % 12 + 1;
40
+ return i({
41
+ y: s,
42
+ m: c,
43
+ d: Math.min(r.d, n(s, c))
44
+ });
45
+ }
46
+ var d = (e, t) => u(e, t * 12);
47
+ function f(e) {
48
+ let t = a(e);
49
+ return t ? i({
50
+ ...t,
51
+ d: 1
52
+ }) : "";
53
+ }
54
+ function p(e) {
55
+ let t = a(e);
56
+ return t ? i({
57
+ ...t,
58
+ d: n(t.y, t.m)
59
+ }) : "";
60
+ }
61
+ function m(e) {
62
+ let t = a(e);
63
+ return t ? new Date(t.y, t.m - 1, t.d).getDay() : -1;
64
+ }
65
+ var h = (e, t, n) => {
66
+ let r = s(t), i = s(n);
67
+ return !(r && c(e, r) < 0 || i && c(e, i) > 0);
68
+ };
69
+ function g(e, t, n) {
70
+ let r = s(t), i = s(n);
71
+ return r && c(e, r) < 0 ? r : i && c(e, i) > 0 ? i : e;
72
+ }
73
+ function _(e) {
74
+ let t = (e) => {
75
+ let t = s(e);
76
+ return t ? Number(t.slice(0, 4)) : void 0;
77
+ }, n = t(e.min), r = t(e.max), i = Math.min(Math.max(Number(e.today.slice(0, 4)), n ?? -Infinity), r ?? Infinity), a = Math.max(e.back === void 0 ? n ?? i - 100 : i - e.back, n ?? -Infinity), o = Math.min(e.ahead === void 0 ? r ?? i + 10 : i + e.ahead, r ?? Infinity), c = [];
78
+ for (let e = a; e <= o; e++) c.push(e);
79
+ return e.shown < a || c.length === 0 ? c.unshift(e.shown) : e.shown > o && c.push(e.shown), c;
80
+ }
81
+ function v(e) {
82
+ let n = /^(\d{1,2}):(\d{2})(?::\d{2})?$/.exec(String(e ?? "").trim());
83
+ if (!n) return "";
84
+ let r = Number(n[1]), i = Number(n[2]);
85
+ return r > 23 || i > 59 ? "" : `${t(r)}:${t(i)}`;
86
+ }
87
+ function y(e) {
88
+ let [t = "", n = ""] = String(e ?? "").trim().replace(" ", "T").split("T");
89
+ return {
90
+ day: s(t),
91
+ time: v(n)
92
+ };
93
+ }
94
+ function b(e, t) {
95
+ let n = s(e);
96
+ if (!n) return "";
97
+ let r = v(t);
98
+ return r ? `${n}T${r}` : n;
99
+ }
100
+ function x(e, t) {
101
+ if (e > 99) return e;
102
+ let n = (t + 19) % 100, r = Math.floor((t + 19) / 100) * 100;
103
+ return e <= n ? r + e : r - 100 + e;
104
+ }
105
+ var S = /^(\d{2}|\d{4})$/, C = /^\d{1,2}$/;
106
+ function w(e, t, n) {
107
+ if (e.length === 1) {
108
+ let t = e[0];
109
+ if (t.length !== 8) return null;
110
+ let n = {
111
+ y: Number(t.slice(0, 4)),
112
+ m: Number(t.slice(4, 6)),
113
+ d: Number(t.slice(6, 8))
114
+ };
115
+ return r(n) ? i(n) : null;
116
+ }
117
+ if (!S.test(e[0]) || !C.test(e[1]) || e.length === 3 && !C.test(e[2])) return null;
118
+ let a = {
119
+ y: x(Number(e[0]), n),
120
+ m: Number(e[1]),
121
+ d: e.length === 3 ? Number(e[2]) : t.d
122
+ };
123
+ return r(a) ? i(a) : null;
124
+ }
125
+ function T(e, t = {}) {
126
+ let n = String(e ?? "").trim();
127
+ if (!n) return null;
128
+ let s = a(t.today) ?? a(o()), c = a(t.within) ?? s, l = t.order ?? "dmy", u = n.split(/[^0-9]+/).filter(Boolean);
129
+ if (!u.length || u.length > 3) return null;
130
+ if (l === "ymd") return w(u, c, s.y);
131
+ let d = "", f = "", p = "";
132
+ if (u.length === 1) {
133
+ let e = u[0];
134
+ if (e.length <= 2) d = e;
135
+ else if (e.length <= 4) d = e.slice(0, 2), f = e.slice(2);
136
+ else if (e.length === 6) d = e.slice(0, 2), f = e.slice(2, 4), p = e.slice(4, 6);
137
+ else if (e.length === 8) d = e.slice(0, 2), f = e.slice(2, 4), p = e.slice(4, 8);
138
+ else return null;
139
+ } else {
140
+ if (!C.test(u[0]) || !C.test(u[1])) return null;
141
+ if (d = u[0], f = u[1], u.length === 3) {
142
+ if (!S.test(u[2])) return null;
143
+ p = u[2];
144
+ }
145
+ }
146
+ if (l === "mdy" && f) {
147
+ let e = d;
148
+ d = f, f = e;
149
+ }
150
+ let m = {
151
+ d: Number(d),
152
+ m: f ? Number(f) : c.m,
153
+ y: p ? x(Number(p), s.y) : f ? s.y : c.y
154
+ };
155
+ return r(m) ? i(m) : null;
156
+ }
157
+ function ee(e, t = {}) {
158
+ let n = String(e ?? "").trim(), r = n.indexOf("+");
159
+ if (r <= 0 || r >= n.length - 1) return null;
160
+ let i = T(n.slice(0, r), t);
161
+ if (!i) return null;
162
+ let a = T(n.slice(r + 1), {
163
+ ...t,
164
+ within: i
165
+ });
166
+ return a ? {
167
+ from: i,
168
+ to: c(a, i) < 0 ? d(a, 1) : a
169
+ } : null;
170
+ }
171
+ function E(e, n = "dd-mm-yyyy") {
172
+ let r = a(e);
173
+ if (!r) return "";
174
+ let i = t(r.d), o = t(r.m), s = String(r.y).padStart(4, "0");
175
+ return n === "yyyy-mm-dd" ? `${s}-${o}-${i}` : n === "dd/mm/yyyy" ? `${i}/${o}/${s}` : `${i}-${o}-${s}`;
176
+ }
177
+ var te = (e = "dd-mm-yyyy", t = !1) => t ? `${e} hh:mm` : e;
178
+ function ne(e, t = "dd-mm-yyyy", n = !1) {
179
+ let { day: r, time: i } = y(e);
180
+ if (!r) return "";
181
+ let a = E(r, t);
182
+ return n && i ? `${a} ${i}` : a;
183
+ }
184
+ function re(e, t = {}) {
185
+ let n = String(e ?? "").trim(), r = "";
186
+ if (t.withTime) {
187
+ let e = /[\s,]*(\d{1,2}:\d{2})$/.exec(n);
188
+ if (e) {
189
+ if (r = v(e[1]), !r) return null;
190
+ n = n.slice(0, e.index);
191
+ }
192
+ }
193
+ let i = T(n, t);
194
+ return i ? {
195
+ day: i,
196
+ time: r
197
+ } : null;
198
+ }
199
+ function ie(e) {
200
+ let t = a(e.month) ?? a(o()), r = i({
201
+ ...t,
202
+ d: 1
203
+ }), u = (Math.trunc(e.weekStart ?? 0) % 7 + 7) % 7, d = s(e.today ?? o()), f = s(e.selected), g = s(e.highlighted), _ = s(e.rangeFrom), v = s(e.rangeTo), y = _ && v ? c(_, v) <= 0 ? _ : v : _ || v, b = _ && v ? c(_, v) <= 0 ? v : _ : _ || v, x = (m(r) - u + 7) % 7, S = n(t.y, t.m), C = e.fixedWeeks === !1 ? Math.ceil((x + S) / 7) : 6, w = l(r, -x), T = [];
204
+ for (let n = 0; n < C; n++) {
205
+ let r = [];
206
+ for (let i = 0; i < 7; i++) {
207
+ let o = l(w, n * 7 + i), s = a(o);
208
+ r.push({
209
+ day: o,
210
+ date: s.d,
211
+ inMonth: s.y === t.y && s.m === t.m,
212
+ isToday: !!d && o === d,
213
+ isSelected: !!f && o === f,
214
+ isHighlighted: !!g && o === g,
215
+ inRange: !!y && !!b && c(o, y) > 0 && c(o, b) < 0,
216
+ isRangeStart: !!y && o === y,
217
+ isRangeEnd: !!b && o === b,
218
+ disabled: !h(o, e.min, e.max)
219
+ });
220
+ }
221
+ T.push(r);
222
+ }
223
+ return {
224
+ month: r,
225
+ year: t.y,
226
+ monthIndex: t.m,
227
+ weeks: T,
228
+ weekdays: Array.from({ length: 7 }, (e, t) => (u + t) % 7),
229
+ canPagePrev: h(l(r, -1), e.min, e.max),
230
+ canPageNext: h(l(p(r), 1), e.min, e.max)
231
+ };
232
+ }
233
+ var ae = [
234
+ "highlightLeft",
235
+ "highlightRight",
236
+ "highlightPrev",
237
+ "highlightNext",
238
+ "highlightFirst",
239
+ "highlightLast",
240
+ "highlightPrevPage",
241
+ "highlightNextPage"
242
+ ];
243
+ function oe(e, t, n = {}) {
244
+ let r = s(e) || o();
245
+ return g(t === "highlightLeft" ? l(r, -1) : t === "highlightRight" ? l(r, 1) : t === "highlightPrev" ? l(r, -7) : t === "highlightNext" ? l(r, 7) : t === "highlightFirst" ? f(r) : t === "highlightLast" ? p(r) : t === "highlightPrevPage" ? u(r, -1) : u(r, 1), n.min, n.max);
246
+ }
247
+ function se(e, t = {}) {
248
+ let { day: n } = y(e);
249
+ return n || g(s(t.today ?? o()) || o(), t.min, t.max);
250
+ }
251
+ function D(e, t = 4) {
252
+ let n = a(e) ?? a(o()), r = Math.min(12, Math.max(1, Math.trunc(t) || 1)), s = i({
253
+ y: n.m >= r ? n.y : n.y - 1,
254
+ m: r,
255
+ d: 1
256
+ });
257
+ return {
258
+ from: s,
259
+ to: l(d(s, 1), -1)
260
+ };
261
+ }
262
+ function O(e, t = 0) {
263
+ let n = s(e) || o(), r = (Math.trunc(t) % 7 + 7) % 7;
264
+ return l(n, -(((m(n) - r) % 7 + 7) % 7));
265
+ }
266
+ function k(e, t = 4) {
267
+ let n = D(e, t), r = a(e).y * 12 + a(e).m - (a(n.from).y * 12 + a(n.from).m), i = u(n.from, Math.floor(r / 3) * 3);
268
+ return {
269
+ from: i,
270
+ to: p(u(i, 2))
271
+ };
272
+ }
273
+ function A(e = {}) {
274
+ let t = s(e.today ?? o()) || o(), n = e.fyStartMonth ?? 4, r = e.weekStart ?? 0, i = D(t, n), a = D(l(i.from, -1), n), c = O(t, r), d = l(c, -7), m = u(t, -1), h = k(t, n), g = k(l(h.from, -1), n), _ = [
275
+ {
276
+ key: "today",
277
+ label: "Today",
278
+ single: !0,
279
+ from: t,
280
+ to: t
281
+ },
282
+ {
283
+ key: "yesterday",
284
+ label: "Yesterday",
285
+ single: !0,
286
+ from: l(t, -1),
287
+ to: l(t, -1)
288
+ },
289
+ {
290
+ key: "last7",
291
+ label: "Last 7 days",
292
+ from: l(t, -6),
293
+ to: t
294
+ },
295
+ {
296
+ key: "last30",
297
+ label: "Last 30 days",
298
+ from: l(t, -29),
299
+ to: t
300
+ },
301
+ {
302
+ key: "thisWeek",
303
+ label: "This Week",
304
+ from: c,
305
+ to: l(c, 6)
306
+ },
307
+ {
308
+ key: "lastWeek",
309
+ label: "Last Week",
310
+ from: d,
311
+ to: l(d, 6)
312
+ },
313
+ {
314
+ key: "thisMonth",
315
+ label: "This Month",
316
+ from: f(t),
317
+ to: p(t)
318
+ },
319
+ {
320
+ key: "lastMonth",
321
+ label: "Last Month",
322
+ from: f(m),
323
+ to: p(m)
324
+ },
325
+ {
326
+ key: "thisQuarter",
327
+ label: "This Quarter",
328
+ from: h.from,
329
+ to: h.to
330
+ },
331
+ {
332
+ key: "lastQuarter",
333
+ label: "Last Quarter",
334
+ from: g.from,
335
+ to: g.to
336
+ },
337
+ {
338
+ key: "thisFY",
339
+ label: "This FY",
340
+ from: i.from,
341
+ to: i.to
342
+ },
343
+ {
344
+ key: "lastFY",
345
+ label: "Last FY",
346
+ from: a.from,
347
+ to: a.to
348
+ },
349
+ {
350
+ key: "ytd",
351
+ label: "Year to date",
352
+ from: i.from,
353
+ to: t
354
+ }
355
+ ];
356
+ if (e.labels) for (let t of _) t.label = e.labels[t.key] ?? t.label;
357
+ return e.only ? e.only.map((e) => _.find((t) => t.key === e)).filter((e) => !!e) : _;
358
+ }
359
+ function ce(e, t) {
360
+ let n = String(t ?? "").trim().toLowerCase();
361
+ return n ? e.filter((e) => e.label.toLowerCase().includes(n)) : e;
362
+ }
363
+ function le(e, t, n = {}) {
364
+ let r = s(e);
365
+ if (!r) return f(o());
366
+ let i = Math.max(1, Math.trunc(n.months ?? 1)), c = n.currentMonthSide ?? "right", l = f(r), d = f(s(t) || r), p = a(l), m = a(d), h = (m.y - p.y) * 12 + (m.m - p.m) + 1;
367
+ return c === "right" ? u(h <= i ? d : l, -(i - 1)) : l;
368
+ }
369
+ function ue(e, t) {
370
+ let n = s(t);
371
+ if (!n) return {
372
+ from: s(e?.from),
373
+ to: s(e?.to)
374
+ };
375
+ let r = s(e?.from), i = s(e?.to);
376
+ return r ? n === r && n === i ? {
377
+ from: "",
378
+ to: ""
379
+ } : n === r || n === i ? {
380
+ from: n,
381
+ to: n
382
+ } : c(n, r) < 0 ? {
383
+ from: n,
384
+ to: i || r
385
+ } : {
386
+ from: r,
387
+ to: n
388
+ } : {
389
+ from: n,
390
+ to: n
391
+ };
392
+ }
393
+ function de(e) {
394
+ let t, n, r;
395
+ try {
396
+ t = new Intl.DateTimeFormat(e, {
397
+ month: "long",
398
+ timeZone: "UTC"
399
+ }), n = new Intl.DateTimeFormat(e, {
400
+ month: "short",
401
+ timeZone: "UTC"
402
+ }), r = new Intl.DateTimeFormat(e, {
403
+ weekday: "short",
404
+ timeZone: "UTC"
405
+ });
406
+ } catch {
407
+ t = new Intl.DateTimeFormat(void 0, {
408
+ month: "long",
409
+ timeZone: "UTC"
410
+ }), n = new Intl.DateTimeFormat(void 0, {
411
+ month: "short",
412
+ timeZone: "UTC"
413
+ }), r = new Intl.DateTimeFormat(void 0, {
414
+ weekday: "short",
415
+ timeZone: "UTC"
416
+ });
417
+ }
418
+ let i = r.resolvedOptions().locale.toLowerCase().startsWith("en");
419
+ return {
420
+ months: Array.from({ length: 12 }, (e, n) => t.format(Date.UTC(2024, n, 1))),
421
+ monthsShort: Array.from({ length: 12 }, (e, t) => n.format(Date.UTC(2024, t, 1))),
422
+ weekdays: Array.from({ length: 7 }, (e, t) => {
423
+ let n = r.format(Date.UTC(2024, 0, 7 + t));
424
+ return i ? n.slice(0, 2) : n;
425
+ })
426
+ };
427
+ }
428
+ // src/core/logic/tableDate.logic.ts
429
+ var j = (e) => String(e).padStart(2, "0");
430
+ function M(e) {
431
+ if (Number.isNaN(e.getTime())) return null;
432
+ let t = i({
433
+ y: e.getFullYear(),
434
+ m: e.getMonth() + 1,
435
+ d: e.getDate()
436
+ }), n = e.getHours(), r = e.getMinutes();
437
+ return n === 0 && r === 0 ? t : `${t}T${j(n)}:${j(r)}`;
438
+ }
439
+ function N(e, t, n, a, o) {
440
+ if (!r({
441
+ y: e,
442
+ m: t,
443
+ d: n
444
+ })) return null;
445
+ let s = i({
446
+ y: e,
447
+ m: t,
448
+ d: n
449
+ });
450
+ if (a === void 0 || o === void 0) return s;
451
+ let c = Number(a), l = Number(o);
452
+ return c > 23 || l > 59 ? null : c === 0 && l === 0 ? s : `${s}T${j(c)}:${j(l)}`;
453
+ }
454
+ var P = "(?:[T ](\\d{1,2}):(\\d{2})(?::\\d{2}(?:\\.\\d+)?)?)?", fe = RegExp(`^(\\d{4})-(\\d{2})-(\\d{2})${P}$`), F = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})$/i, pe = RegExp(`^(\\d{1,2})[-/.](\\d{1,2})[-/.](\\d{4})${P}$`), me = RegExp(`^(\\d{4})[-/.](\\d{1,2})[-/.](\\d{1,2})${P}$`), I = /* @__PURE__ */ new Map(), he = 2e4;
455
+ function L(e, t) {
456
+ if (e == null || e === "") return null;
457
+ if (e instanceof Date) return M(e);
458
+ if (typeof e == "number") return Number.isFinite(e) ? M(new Date(e)) : null;
459
+ if (typeof e != "string") return null;
460
+ let n = t ? `${t}\u0000${e}` : e, r = I.get(n);
461
+ if (r !== void 0) return r;
462
+ let i = R(e, t);
463
+ return I.size >= he && I.clear(), I.set(n, i), i;
464
+ }
465
+ function R(e, t) {
466
+ let n = e.trim();
467
+ if (!n) return null;
468
+ let r = fe.exec(n);
469
+ return r && !F.test(n) ? N(Number(r[1]), Number(r[2]), Number(r[3]), r[4], r[5]) : F.test(n) ? M(new Date(n)) : t === "dd-mm-yyyy" || t === "dd/mm/yyyy" ? (r = pe.exec(n), r ? N(Number(r[3]), Number(r[2]), Number(r[1]), r[4], r[5]) : null) : t === "yyyy-mm-dd" ? (r = me.exec(n), r ? N(Number(r[1]), Number(r[2]), Number(r[3]), r[4], r[5]) : null) : /[a-z]/i.test(n) ? M(new Date(n)) : null;
470
+ }
471
+ var ge = (e) => e ? e.slice(0, 10) : null, _e = (e, t) => e < t ? -1 : +(e > t);
472
+ function z(e, t = "dd-mm-yyyy") {
473
+ if (!e) return "";
474
+ let n = E(e.slice(0, 10), t);
475
+ return e.length > 10 ? `${n} ${e.slice(11, 16)}` : n;
476
+ }
477
+ function ve(e, t, n, r) {
478
+ let i = e == null, a = t == null;
479
+ return i && a ? 0 : i ? n ? -1 : 1 : a ? n ? 1 : -1 : r(e, t);
480
+ }
481
+ var B = [
482
+ 25,
483
+ 50,
484
+ 100,
485
+ 500,
486
+ -1
487
+ ], ye = [
488
+ 25,
489
+ 50,
490
+ 100
491
+ ], V = { pageSize: 25 }, H = {
492
+ multiSort: !1,
493
+ defaultSort: []
494
+ }, U = { advanced: !0 }, be = [
495
+ "xlsx",
496
+ "pdf",
497
+ "csv",
498
+ "html",
499
+ "json"
500
+ ], W = { mode: "multiple" };
501
+ function xe() {
502
+ return {
503
+ id: G(),
504
+ logic: "AND",
505
+ conditions: []
506
+ };
507
+ }
508
+ function Se(e) {
509
+ return e.pagination === !1 ? !1 : e.pagination === !0 || e.pagination === void 0 ? V : {
510
+ ...V,
511
+ ...e.pagination
512
+ };
513
+ }
514
+ function Ce(e, t) {
515
+ let n = (t ?? []).filter((e) => e > 0);
516
+ return n.length === 0 ? e > 0 ? e : 25 : n.includes(e) ? e : n[0];
517
+ }
518
+ function we(e, t, n = B) {
519
+ return e || [...[...new Set([...n, ...t.map((e) => e ?? 0)].filter((e) => e > 0))].sort((e, t) => e - t), ...n.includes(-1) ? [-1] : []];
520
+ }
521
+ function Te(e) {
522
+ return JSON.stringify(e ?? {}, (e, t) => t && typeof t == "object" && !Array.isArray(t) ? Object.fromEntries(Object.entries(t).sort(([e], [t]) => e < t ? -1 : +(e > t))) : t);
523
+ }
524
+ function Ee(e) {
525
+ return e.sorting === !1 ? !1 : e.sorting === !0 || e.sorting === void 0 ? H : {
526
+ ...H,
527
+ ...e.sorting
528
+ };
529
+ }
530
+ function De(e) {
531
+ return e.filtering === !1 ? !1 : e.filtering === !0 || e.filtering === void 0 ? U : {
532
+ ...U,
533
+ ...e.filtering
534
+ };
535
+ }
536
+ function Oe(e) {
537
+ if (!e.export) return !1;
538
+ let t = { ...e.export };
539
+ return t.quick && (t.quick.enabled === void 0 && (t.quick = {
540
+ ...t.quick,
541
+ enabled: !0
542
+ }), t.quick.formats || (t.quick = {
543
+ ...t.quick,
544
+ formats: be
545
+ }), t.quick.fileNameAs || (t.quick = {
546
+ ...t.quick,
547
+ fileNameAs: "title-date-generated"
548
+ })), t;
549
+ }
550
+ function ke(e) {
551
+ let t = e.selection === void 0 ? "onDemand" : e.selection;
552
+ return t ? t === !0 || t === "onDemand" ? {
553
+ ...W,
554
+ show: "onDemand"
555
+ } : t === "always" ? {
556
+ ...W,
557
+ show: "always"
558
+ } : {
559
+ ...W,
560
+ ...t,
561
+ show: t.show ?? "onDemand"
562
+ } : !1;
563
+ }
564
+ function G() {
565
+ return Math.random().toString(36).substring(2, 10);
566
+ }
567
+ function K(e, t) {
568
+ return t.includes(".") ? t.split(".").reduce((e, t) => e?.[t], e) : e?.[t];
569
+ }
570
+ // src/components/DataTable/columnValue.ts
571
+ var Ae = "dd-mm-yyyy";
572
+ function q(e, t) {
573
+ return e.value ? e.value(t) : K(t, e.key);
574
+ }
575
+ function J(e, t, n) {
576
+ return L(typeof e.parse == "function" ? e.parse(t, n) : t, typeof e.parse == "string" ? e.parse : void 0);
577
+ }
578
+ var je = (e, t) => J(e, q(e, t), t);
579
+ function Me(e, t, n) {
580
+ return e.filterAccessor ? L(e.filterAccessor(t), typeof e.parse == "string" ? e.parse : void 0) : J(e, t, n);
581
+ }
582
+ function Y(e, t, n) {
583
+ let r = J(e, t, n);
584
+ return r ? z(r, e.dateFormat ?? "dd-mm-yyyy") : t == null ? "" : String(t);
585
+ }
586
+ function Ne(e, t, n) {
587
+ switch (t) {
588
+ case "integer": return n.number(e, 0);
589
+ case "amount": return n.number(e, 2);
590
+ case "currency": return n.money(e);
591
+ case "percent": return n.percent(e);
592
+ default: return String(e);
593
+ }
594
+ }
595
+ function X(e, t, n, r) {
596
+ if (e.format) {
597
+ let n = e.format(t, r);
598
+ return n == null ? "" : String(n);
599
+ }
600
+ if (e.type === "date" || t instanceof Date) return Y(e, t, r);
601
+ if (t == null) return "";
602
+ if (Array.isArray(t)) return t.map((t) => X({
603
+ ...e,
604
+ format: void 0
605
+ }, t, n, r)).filter(Boolean).join(", ");
606
+ if (typeof t == "boolean") return t ? n.yes : n.no;
607
+ let i = e.filterOptions?.find((e) => String(e.value) === String(t));
608
+ return i ? i.label : typeof t == "number" && e.numberFormat && n.fmt && Number.isFinite(t) ? Ne(t, e.numberFormat, n.fmt) : typeof t == "object" ? "" : String(t);
609
+ }
610
+ var Pe = (e, t, n) => X(e, q(e, t), n, t);
611
+ function Fe(e, t, n) {
612
+ let r = q(e, t);
613
+ if (e.searchText) return e.searchText(r, t) ?? "";
614
+ let i = X(e, r, n, t), a = r == null || typeof r == "object" ? "" : String(r);
615
+ return a && a !== i ? `${i} ${a}` : i;
616
+ }
617
+ var Z = (e) => e == null || e === "" || typeof e == "number" && Number.isNaN(e);
618
+ function Ie(e, t, n, r) {
619
+ if (e.sortValue) {
620
+ let r = e.sortValue(t, n);
621
+ return Z(r) ? null : r;
622
+ }
623
+ if (e.type === "date") return J(e, t, n);
624
+ if (Z(t)) return null;
625
+ if (e.type === "number") {
626
+ let e = typeof t == "number" ? t : Number(t);
627
+ return Number.isFinite(e) ? e : null;
628
+ }
629
+ if (typeof t == "boolean") return +!!t;
630
+ let i = X({
631
+ ...e,
632
+ format: void 0,
633
+ numberFormat: void 0
634
+ }, t, r, n);
635
+ return i === "" ? null : i;
636
+ }
637
+ var Q;
638
+ function $(e, t) {
639
+ return typeof e == "number" && typeof t == "number" ? e - t : (Q ??= new Intl.Collator(void 0, {
640
+ numeric: !0,
641
+ sensitivity: "base"
642
+ }), Q.compare(String(e), String(t)));
643
+ }
644
+ export { O as $, ae as A, E as B, ke as C, z as D, _e as E, c as F, se as G, b as H, te as I, a as J, ee as K, x as L, ie as M, A as N, ge as O, de as P, f as Q, ue as R, Se as S, ve as T, ce as U, h as V, oe as W, u as X, l as Y, y as Z, K as _, q as a, Oe as b, Me as c, X as d, i as et, B as f, G as g, Ce as h, Pe as i, _ as it, e as j, L as k, Fe as l, xe as m, je as n, le as nt, $ as o, ye as p, re as q, J as r, m as rt, Y as s, Ae as t, o as tt, Ie as u, we as v, Ee as w, De as x, Te as y, ne as z };