laif-ds 0.2.74 → 0.2.76

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 (155) hide show
  1. package/dist/CHANGELOG.md +446 -0
  2. package/dist/agent-docs/adoption-report.json +615 -0
  3. package/dist/agent-docs/components/Accordion.md +46 -16
  4. package/dist/agent-docs/components/Alert.md +90 -95
  5. package/dist/agent-docs/components/AlertDialog.md +132 -126
  6. package/dist/agent-docs/components/AppEditor.md +90 -90
  7. package/dist/agent-docs/components/AppRadioGroup.md +18 -18
  8. package/dist/agent-docs/components/AppSidebar.md +129 -122
  9. package/dist/agent-docs/components/AppStepper.md +81 -77
  10. package/dist/agent-docs/components/AspectRatio.md +70 -62
  11. package/dist/agent-docs/components/AudioVisualizer.md +5 -5
  12. package/dist/agent-docs/components/Avatar.md +112 -113
  13. package/dist/agent-docs/components/Badge.md +123 -118
  14. package/dist/agent-docs/components/Breadcrumb.md +8 -1
  15. package/dist/agent-docs/components/Button.md +131 -129
  16. package/dist/agent-docs/components/Card.md +172 -147
  17. package/dist/agent-docs/components/Carousel.md +148 -129
  18. package/dist/agent-docs/components/Chat.md +121 -109
  19. package/dist/agent-docs/components/ChatMessage.md +72 -61
  20. package/dist/agent-docs/components/Checkbox.md +150 -135
  21. package/dist/agent-docs/components/CircularProgress.md +53 -49
  22. package/dist/agent-docs/components/CodeHighlighter.md +4 -4
  23. package/dist/agent-docs/components/Collapsible.md +114 -95
  24. package/dist/agent-docs/components/Command.md +141 -142
  25. package/dist/agent-docs/components/Confirmer.md +182 -175
  26. package/dist/agent-docs/components/ContextMenu.md +196 -191
  27. package/dist/agent-docs/components/DataCrossTable.md +114 -94
  28. package/dist/agent-docs/components/DataTable.md +32 -24
  29. package/dist/agent-docs/components/Dialog.md +130 -125
  30. package/dist/agent-docs/components/Drawer.md +141 -127
  31. package/dist/agent-docs/components/FilePreviewer.md +138 -139
  32. package/dist/agent-docs/components/FileUploader.md +149 -129
  33. package/dist/agent-docs/components/Form.md +3 -1
  34. package/dist/agent-docs/components/FormComposer.md +163 -137
  35. package/dist/agent-docs/components/GanttChart.md +125 -122
  36. package/dist/agent-docs/components/HoverCard.md +1 -1
  37. package/dist/agent-docs/components/Icon.md +98 -99
  38. package/dist/agent-docs/components/Input.md +173 -138
  39. package/dist/agent-docs/components/InputOtp.md +6 -1
  40. package/dist/agent-docs/components/InputSelector.md +94 -97
  41. package/dist/agent-docs/components/InterruptPrompt.md +4 -4
  42. package/dist/agent-docs/components/MarkdownRenderer.md +5 -2
  43. package/dist/agent-docs/components/Menubar.md +60 -57
  44. package/dist/agent-docs/components/MessageInput.md +134 -131
  45. package/dist/agent-docs/components/MessageList.md +110 -96
  46. package/dist/agent-docs/components/MultipleSelector.md +147 -146
  47. package/dist/agent-docs/components/NavigationMenu.md +6 -2
  48. package/dist/agent-docs/components/Popover.md +112 -103
  49. package/dist/agent-docs/components/PromptSuggestions.md +5 -5
  50. package/dist/agent-docs/components/RadioGroup.md +97 -90
  51. package/dist/agent-docs/components/Resizable.md +4 -1
  52. package/dist/agent-docs/components/ResizePrompt.md +12 -13
  53. package/dist/agent-docs/components/ScrollArea.md +6 -2
  54. package/dist/agent-docs/components/SecurePdfViewer.md +10 -6
  55. package/dist/agent-docs/components/Select.md +131 -132
  56. package/dist/agent-docs/components/Sheet.md +8 -1
  57. package/dist/agent-docs/components/ShikiHighlighter.md +5 -5
  58. package/dist/agent-docs/components/Sidebar.md +94 -85
  59. package/dist/agent-docs/components/Slider.md +62 -58
  60. package/dist/agent-docs/components/Sonner.md +1 -0
  61. package/dist/agent-docs/components/Spinner.md +14 -14
  62. package/dist/agent-docs/components/Stepper.md +93 -67
  63. package/dist/agent-docs/components/Switch.md +41 -42
  64. package/dist/agent-docs/components/TableSkeleton.md +8 -8
  65. package/dist/agent-docs/components/Tabs.md +106 -86
  66. package/dist/agent-docs/components/TextArea.md +51 -52
  67. package/dist/agent-docs/components/ThemeSwitcher.md +72 -69
  68. package/dist/agent-docs/components/Toaster.md +1 -0
  69. package/dist/agent-docs/components/Tooltip.md +102 -91
  70. package/dist/agent-docs/components/Typo.md +68 -65
  71. package/dist/agent-docs/components/WeeklyCalendar.md +63 -64
  72. package/dist/agent-docs/components-list.md +1 -0
  73. package/dist/agent-docs/manifest.json +5981 -0
  74. package/dist/agent-docs/truncated-cell.md +342 -0
  75. package/dist/components/editor/editor-hooks/use-update-toolbar.js +6 -6
  76. package/dist/components/editor/plugins/actions/counter-character-plugin.js +6 -6
  77. package/dist/components/editor/plugins/toolbar/font-format-toolbar-plugin.js +18 -18
  78. package/dist/components/editor/plugins/toolbar/history-toolbar-plugin.js +10 -10
  79. package/dist/components/editor/plugins/toolbar/toolbar-plugin.js +9 -9
  80. package/dist/components/ui/app-checkbox.js +1 -1
  81. package/dist/components/ui/app-dialog.js +70 -64
  82. package/dist/components/ui/app-editor.js +51 -51
  83. package/dist/components/ui/app-form.js +81 -81
  84. package/dist/components/ui/app-multiple-select-dropdown.js +36 -36
  85. package/dist/components/ui/app-select.js +109 -104
  86. package/dist/components/ui/app-sidebar.js +41 -41
  87. package/dist/components/ui/app-stepper.js +1 -1
  88. package/dist/components/ui/app-time-picker.js +18 -18
  89. package/dist/components/ui/app-tooltip.js +1 -1
  90. package/dist/components/ui/async-select.js +5 -5
  91. package/dist/components/ui/audio-visualizer.js +61 -58
  92. package/dist/components/ui/card.js +1 -1
  93. package/dist/components/ui/carousel.js +2 -2
  94. package/dist/components/ui/chart.js +1 -1
  95. package/dist/components/ui/chat-message.js +8 -8
  96. package/dist/components/ui/chat.js +86 -88
  97. package/dist/components/ui/command.js +2 -2
  98. package/dist/components/ui/copy-button.js +4 -4
  99. package/dist/components/ui/date-picker.js +20 -20
  100. package/dist/components/ui/file-preview/index.js +13 -13
  101. package/dist/components/ui/file-previewer.js +12 -11
  102. package/dist/components/ui/file-uploader.js +86 -78
  103. package/dist/components/ui/form.js +2 -2
  104. package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +56 -56
  105. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +12 -12
  106. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +1 -1
  107. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +4 -4
  108. package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/RepeteadBars/RepeteadBars.js +2 -2
  109. package/dist/components/ui/gantt/components/Chart/Chart.js +23 -23
  110. package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +1 -1
  111. package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +34 -34
  112. package/dist/components/ui/gantt/components/Controls/Controls.js +5 -5
  113. package/dist/components/ui/gantt/components/Gantt/Gantt.js +4 -4
  114. package/dist/components/ui/gantt/hooks/useGanttCalculate.js +25 -18
  115. package/dist/components/ui/input-selector.js +1 -1
  116. package/dist/components/ui/input.js +23 -23
  117. package/dist/components/ui/kanban.js +8 -9
  118. package/dist/components/ui/markdown-renderer.js +41 -35
  119. package/dist/components/ui/message-input.js +45 -44
  120. package/dist/components/ui/multiple-selector.js +91 -82
  121. package/dist/components/ui/secure-pdf-viewer.js +19 -7
  122. package/dist/components/ui/sidebar.js +1 -1
  123. package/dist/components/ui/slider.js +1 -1
  124. package/dist/components/ui/spinner.js +4 -4
  125. package/dist/components/ui/stepper.js +157 -138
  126. package/dist/components/ui/tables/data-cross-table/data-cross-table-buttons.js +29 -29
  127. package/dist/components/ui/tables/data-cross-table/data-cross-table.js +258 -246
  128. package/dist/components/ui/tables/data-table/components/data-table-advanced-filter.js +4 -1
  129. package/dist/components/ui/tables/data-table/components/data-table-body.js +211 -367
  130. package/dist/components/ui/tables/data-table/components/data-table-filter-inputs.js +114 -112
  131. package/dist/components/ui/tables/data-table/components/data-table-filters.js +116 -96
  132. package/dist/components/ui/tables/data-table/components/data-table-header.js +211 -0
  133. package/dist/components/ui/tables/data-table/components/data-table-searchbar.js +8 -8
  134. package/dist/components/ui/tables/data-table/components/data-table-skeleton-rows.js +33 -0
  135. package/dist/components/ui/tables/data-table/data-table.js +258 -250
  136. package/dist/components/ui/tables/data-table/data-table.service.js +112 -97
  137. package/dist/components/ui/tables/data-table/data-table.utils.js +25 -15
  138. package/dist/components/ui/textarea.js +2 -2
  139. package/dist/components/ui/theme-switcher.js +1 -1
  140. package/dist/components/ui/toggle-group.js +2 -2
  141. package/dist/components/ui/truncated-cell.js +100 -0
  142. package/dist/components/ui/weekly-calendar/appointment-card.js +16 -16
  143. package/dist/components/ui/weekly-calendar/calendar-context.js +6 -6
  144. package/dist/components/ui/weekly-calendar/calendar-header.js +12 -12
  145. package/dist/components/ui/weekly-calendar/day-column.js +16 -16
  146. package/dist/components/ui/weekly-calendar/time-column.js +4 -4
  147. package/dist/components/ui/weekly-calendar/weekly-calendar.js +4 -4
  148. package/dist/hooks/use-audio-recording.js +1 -1
  149. package/dist/hooks/use-auto-scroll.js +18 -18
  150. package/dist/hooks/use-autosize-textarea.js +12 -13
  151. package/dist/index.d.ts +100 -45
  152. package/dist/index.js +362 -360
  153. package/dist/lib/utils.js +6 -6
  154. package/dist/styles.v3.css +1 -1
  155. package/package.json +14 -4
@@ -1,67 +1,68 @@
1
1
  "use client";
2
- import { jsx as c, jsxs as ie } from "react/jsx-runtime";
3
- import { useReactTable as at } from "../../../../node_modules/@tanstack/react-table/build/lib/index.js";
4
- import { cn as it } from "../../../../lib/utils.js";
5
- import { useRef as f, useState as d, useEffect as H, useMemo as F } from "react";
6
- import { Button as st } from "../../button.js";
7
- import { Checkbox as ye } from "../../checkbox.js";
8
- import { DataTableBody as lt } from "./components/data-table-body.js";
9
- import { DataTableColumnVisibility as ct } from "./components/data-table-column-visibility.js";
10
- import { DataTableFilters as dt } from "./components/data-table-filters.js";
11
- import { DataTablePaginationComponent as ut } from "./components/data-table-pagination.js";
12
- import { DataTableSearchbar as gt } from "./components/data-table-searchbar.js";
13
- import { DataTableSortingComponent as mt } from "./components/data-table-sorting.js";
14
- import { applySearchFilterToRow as we, debounce as pt, buildSearchFilter as ft, updatePageSizeFromContainer as ht, createDefaultAdvancedFilter as St, createBadgeFilterFromHeader as bt } from "./data-table.service.js";
15
- import { DataTableActionsComponent as vt } from "./components/data-table-actions.js";
16
- import { defaultDataTableI18n as Ft } from "./data-table-i18n.js";
17
- import { getPaginationRowModel as Ct, getFilteredRowModel as xt, getSortedRowModel as yt, getCoreRowModel as wt } from "../../../../node_modules/@tanstack/table-core/build/lib/index.js";
18
- function Pt({
19
- columns: Y,
20
- data: j,
2
+ import { jsx as d, jsxs as se } from "react/jsx-runtime";
3
+ import { useReactTable as ct } from "../../../../node_modules/@tanstack/react-table/build/lib/index.js";
4
+ import { useRef as f, useState as l, useEffect as O, useMemo as C } from "react";
5
+ import { cn as dt } from "../../../../lib/utils.js";
6
+ import { Button as ut } from "../../button.js";
7
+ import { Checkbox as Ie } from "../../checkbox.js";
8
+ import { DataTableActionsComponent as gt } from "./components/data-table-actions.js";
9
+ import { DataTableBody as mt } from "./components/data-table-body.js";
10
+ import { DataTableColumnVisibility as pt } from "./components/data-table-column-visibility.js";
11
+ import { DataTableFilters as ft } from "./components/data-table-filters.js";
12
+ import { DataTablePaginationComponent as ht } from "./components/data-table-pagination.js";
13
+ import { DataTableSearchbar as St } from "./components/data-table-searchbar.js";
14
+ import { DataTableSortingComponent as bt } from "./components/data-table-sorting.js";
15
+ import { applySearchFilterToRow as Te, debounce as Ft, buildSearchFilter as vt, updatePageSizeFromContainer as Ct, createDefaultAdvancedFilter as xt, createBadgeFilterFromHeader as yt } from "./data-table.service.js";
16
+ import { defaultDataTableI18n as wt } from "./data-table-i18n.js";
17
+ import { getPaginationRowModel as Rt, getFilteredRowModel as It, getSortedRowModel as Tt, getCoreRowModel as zt } from "../../../../node_modules/@tanstack/table-core/build/lib/index.js";
18
+ function Wt({
19
+ columns: Z,
20
+ data: V,
21
21
  loading: z = !1,
22
- emptyComponent: Re,
23
- className: Ie,
24
- rowSelection: Te = {},
25
- onRowSelectionChange: se,
26
- checkable: P = !1,
27
- onCheckedRowsChange: Z,
28
- actions: ze = [],
29
- customComponentsLeft: De,
30
- customComponentsRight: Be,
31
- hidePagination: _e = !1,
32
- hideActionsRow: Me = !1,
33
- i18n: h = Ft,
34
- maxSortedColumns: le = 2,
22
+ emptyComponent: ze,
23
+ className: De,
24
+ rowSelection: Be = {},
25
+ onRowSelectionChange: le,
26
+ checkable: j = !1,
27
+ onCheckedRowsChange: $,
28
+ actions: _e = [],
29
+ customComponentsLeft: Me,
30
+ customComponentsRight: Oe,
31
+ hidePagination: He = !1,
32
+ hideActionsRow: Ne = !1,
33
+ i18n: h = wt,
34
+ maxSortedColumns: ce = 2,
35
35
  initialState: u,
36
36
  // New mode-based API
37
- serverMode: He = !1,
38
- serverConfig: Ne,
37
+ serverMode: Le = !1,
38
+ serverConfig: de,
39
39
  disableAutoPageSize: b = !1,
40
40
  // Test & Accessibility
41
- id: Oe,
42
- "data-testid": Le
41
+ id: Ge,
42
+ "data-testid": Pe,
43
+ rowClassName: ke
43
44
  }) {
44
- const q = f(null), a = He === !0, g = a ? Ne : void 0, ce = (e) => !e || !e.sort_by || !e.sort_order ? [] : e.sort_by.map((t, o) => ({
45
+ const q = f(null), i = Le === !0, g = i ? de : void 0, ue = (e) => !e || !e.sort_by || !e.sort_order ? [] : e.sort_by.map((t, n) => ({
45
46
  id: t,
46
- desc: e.sort_order[o] === "desc"
47
- })), Ge = (e) => {
48
- const t = ce(e?.sorting), o = {
49
- sort_by: t.map((s) => s.id),
50
- sort_order: t.map((s) => s.desc ? "desc" : "asc")
47
+ desc: e.sort_order[n] === "desc"
48
+ })), Ae = (e) => {
49
+ const t = ue(e?.sorting), n = {
50
+ sort_by: t.map((a) => a.id),
51
+ sort_order: t.map((a) => a.desc ? "desc" : "asc")
51
52
  };
52
53
  return {
53
- computedSorting: t.length > 0 ? o : void 0,
54
+ computedSorting: t.length > 0 ? n : void 0,
54
55
  computedFilter: e?.computedFilter
55
56
  // Use provided value or undefined
56
57
  };
57
- }, [N, ke] = d(() => ce(u?.sorting)), [Ae] = d([]), [Ve, je] = d(
58
+ }, [H, Ve] = l(() => ue(u?.sorting)), [je] = l([]), [qe, Ke] = l(
58
59
  () => u?.columnVisibility ?? {}
59
- ), [m, Pe] = d(() => u?.filters?.searchbarFilter), [K, O] = d(() => u?.pagination ?? { pageIndex: 0, pageSize: 10 }), de = f(g);
60
- de.current = g;
60
+ ), [m, Ee] = l(() => u?.filters?.searchbarFilter), [K, N] = l(() => u?.pagination ?? { pageIndex: 0, pageSize: 10 }), ge = f(g);
61
+ ge.current = g;
61
62
  const E = f(g?.onStateChange);
62
63
  E.current = g?.onStateChange;
63
- const W = f(null), D = f(null), qe = f(0), ue = f(!1), ge = f(null), J = f({}), me = f(null), $ = f(z);
64
- $.current = z;
64
+ const W = f(null), D = f(null), We = f(0), me = f(!1), pe = f(null), J = f({}), fe = f(null), U = f(z);
65
+ U.current = z;
65
66
  const L = (e) => {
66
67
  e.computedFilter && (J.current.computedFilter = e.computedFilter), e.computedSorting && (J.current.computedSorting = e.computedSorting);
67
68
  const t = {
@@ -71,19 +72,19 @@ function Pt({
71
72
  computedSorting: e.computedSorting || J.current.computedSorting
72
73
  };
73
74
  W.current = t, D.current && clearTimeout(D.current), D.current = setTimeout(() => {
74
- W.current && E.current && (qe.current = Date.now(), E.current(W.current), W.current = null, D.current = null);
75
+ W.current && E.current && (We.current = Date.now(), E.current(W.current), W.current = null, D.current = null);
75
76
  }, 400);
76
77
  };
77
- H(() => {
78
+ O(() => {
78
79
  const e = setTimeout(() => {
79
- ue.current = !0;
80
+ me.current = !0;
80
81
  }, 100);
81
82
  return () => {
82
83
  clearTimeout(e), D.current && clearTimeout(D.current);
83
84
  };
84
85
  }, []);
85
- const [r, G] = d(() => {
86
- const { computedSorting: e, computedFilter: t } = Ge(u);
86
+ const [r, G] = l(() => {
87
+ const { computedSorting: e, computedFilter: t } = Ae(u);
87
88
  return {
88
89
  pagination: u?.pagination ?? { pageIndex: 0, pageSize: 10 },
89
90
  sorting: u?.sorting,
@@ -92,22 +93,22 @@ function Pt({
92
93
  computedSorting: u?.computedSorting ?? e
93
94
  };
94
95
  });
95
- a && !g && console.warn("DataTable: Server mode requires serverConfig");
96
- const [Ke, pe] = d(0), [Ee, fe] = d(0), [We, Je] = d({}), he = se ? Te : We, Ue = se || Je, [C, ee] = d(
96
+ i && !g && console.warn("DataTable: Server mode requires serverConfig");
97
+ const [Je, he] = l(0), [Ue, Se] = l(0), [Xe, Qe] = l({}), be = le ? Be : Xe, Ye = le || Qe, [F, ee] = l(
97
98
  () => u?.filters?.filterBadges ?? []
98
- ), [x, te] = d(() => u?.filters?.advancedFilterBadge), [U, Xe] = d(""), [Se, be] = d([]), ve = F(() => P ? [
99
+ ), [x, te] = l(() => u?.filters?.advancedFilterBadge), [X, Ze] = l(""), [$e, re] = l(void 0), [Fe, ve] = l([]), Ce = C(() => j ? [
99
100
  {
100
101
  id: "data-table-integrated-checkbox-column",
101
102
  size: 24,
102
103
  minSize: 24,
103
104
  maxSize: 24,
104
- header: ({ table: e }) => /* @__PURE__ */ c(
105
+ header: ({ table: e }) => /* @__PURE__ */ d(
105
106
  "div",
106
107
  {
107
108
  className: "flex w-6 max-w-6 min-w-6 items-center justify-center",
108
109
  style: { width: "24px", minWidth: "24px", maxWidth: "24px" },
109
- children: /* @__PURE__ */ c(
110
- ye,
110
+ children: /* @__PURE__ */ d(
111
+ Ie,
111
112
  {
112
113
  className: "cursor-pointer",
113
114
  checked: e.getIsAllPageRowsSelected(),
@@ -117,13 +118,13 @@ function Pt({
117
118
  )
118
119
  }
119
120
  ),
120
- cell: ({ row: e }) => /* @__PURE__ */ c(
121
+ cell: ({ row: e }) => /* @__PURE__ */ d(
121
122
  "div",
122
123
  {
123
124
  className: "flex w-6 max-w-6 min-w-6 items-center justify-center",
124
125
  style: { width: "24px", minWidth: "24px", maxWidth: "24px" },
125
- children: /* @__PURE__ */ c(
126
- ye,
126
+ children: /* @__PURE__ */ d(
127
+ Ie,
127
128
  {
128
129
  className: "cursor-pointer",
129
130
  checked: e.getIsSelected(),
@@ -145,50 +146,50 @@ function Pt({
145
146
  listOptions: []
146
147
  }
147
148
  },
148
- ...Y
149
- ] : Y, [Y, P]), I = F(() => ve.map(
149
+ ...Z
150
+ ] : Z, [Z, j]), I = C(() => Ce.map(
150
151
  (e) => e
151
- ), [ve]), X = (e) => {
152
+ ), [Ce]), Q = (e) => {
152
153
  if (e.id) return e.id;
153
154
  if ("accessorKey" in e && typeof e.accessorKey == "string")
154
155
  return e.accessorKey;
155
- }, Qe = (e) => {
156
+ }, et = (e) => {
156
157
  const t = e.meta?.headerLabel;
157
- return t || (typeof e.header == "string" ? e.header : X(e) ?? "-");
158
+ return t || (typeof e.header == "string" ? e.header : Q(e) ?? "-");
158
159
  };
159
- H(() => {
160
- const e = (I ?? []).map(X).filter((l) => !!l), t = new Set(Se), o = new Set(e);
161
- t.size === o.size && [...t].every((l) => o.has(l)) || be(e);
160
+ O(() => {
161
+ const e = (I ?? []).map(Q).filter((c) => !!c), t = new Set(Fe), n = new Set(e);
162
+ t.size === n.size && [...t].every((c) => n.has(c)) || ve(e);
162
163
  }, [I]);
163
- const B = F(() => I.filter((e) => !!e.meta?.searchable), [I]), T = F(() => B.map((e) => "accessorKey" in e && typeof e.accessorKey == "string" ? e.accessorKey : e.id).filter((e) => !!e), [B]), [Q, Ye] = d(() => u?.computedFilter ?? {}), Ze = {
164
- data: F(() => a || Object.keys(Q).length === 0 ? j : j.filter((e) => we({
164
+ const B = C(() => I.filter((e) => !!e.meta?.searchable), [I]), T = C(() => B.map((e) => "accessorKey" in e && typeof e.accessorKey == "string" ? e.accessorKey : e.id).filter((e) => !!e), [B]), [Y, tt] = l(() => u?.computedFilter ?? {}), rt = {
165
+ data: C(() => i || Object.keys(Y).length === 0 ? V : V.filter((e) => Te({
165
166
  original: e,
166
- getValue: (o) => e[o]
167
- }, Q)), [j, Q, a]),
167
+ getValue: (n) => e[n]
168
+ }, Y)), [V, Y, i]),
168
169
  columns: I,
169
- getCoreRowModel: wt(),
170
+ getCoreRowModel: zt(),
170
171
  onSortingChange: (e) => {
171
- const t = typeof e == "function" ? e(N) : e;
172
- ke(t);
172
+ const t = typeof e == "function" ? e(H) : e;
173
+ Ve(t);
173
174
  },
174
- getSortedRowModel: yt(),
175
- manualSorting: a,
176
- onColumnVisibilityChange: je,
177
- onRowSelectionChange: Ue,
178
- onColumnOrderChange: be,
179
- getFilteredRowModel: xt(),
180
- manualFiltering: a,
181
- globalFilterFn: (e, t, o) => a || !o ? !0 : (T ?? []).some((s) => {
182
- const l = e.getValue(s);
183
- return Array.isArray(l) ? l.some(
184
- (p) => String(p).toLowerCase().includes(o.toLowerCase())
185
- ) : String(l).toLowerCase().includes(o.toLowerCase());
175
+ getSortedRowModel: Tt(),
176
+ manualSorting: i,
177
+ onColumnVisibilityChange: Ke,
178
+ onRowSelectionChange: Ye,
179
+ onColumnOrderChange: ve,
180
+ getFilteredRowModel: It(),
181
+ manualFiltering: i,
182
+ globalFilterFn: (e, t, n) => i || !n ? !0 : (T ?? []).some((a) => {
183
+ const c = e.getValue(a);
184
+ return Array.isArray(c) ? c.some(
185
+ (p) => String(p).toLowerCase().includes(n.toLowerCase())
186
+ ) : String(c).toLowerCase().includes(n.toLowerCase());
186
187
  }) ?? !1,
187
188
  filterFns: {
188
- advancedFilter: (e) => a ? !0 : we(e, Q)
189
+ advancedFilter: (e) => i ? !0 : Te(e, Y)
189
190
  },
190
191
  onPaginationChange: (e) => {
191
- if (a && g) {
192
+ if (i && g) {
192
193
  if (typeof e == "object") {
193
194
  const t = b ? {
194
195
  ...r.pagination,
@@ -197,74 +198,75 @@ function Pt({
197
198
  ...r.pagination,
198
199
  pageIndex: e.pageIndex,
199
200
  pageSize: e.pageSize
200
- }, o = {
201
+ }, n = {
201
202
  ...r,
202
203
  pagination: t,
203
204
  // Preserve computed values if they exist
204
205
  computedFilter: r.computedFilter,
205
206
  computedSorting: r.computedSorting
206
207
  };
207
- G(o), L(o);
208
+ G(n), L(n);
208
209
  }
209
210
  } else
210
- O(
211
+ N(
211
212
  typeof e == "object" ? (t) => b ? { ...t, pageIndex: e.pageIndex } : {
212
213
  pageIndex: e.pageIndex,
213
214
  pageSize: e.pageSize
214
215
  } : e
215
216
  );
216
217
  },
217
- getPaginationRowModel: Ct(),
218
- manualPagination: a,
219
- pageCount: a && z ? Ee : Ke,
218
+ getPaginationRowModel: Rt(),
219
+ manualPagination: i,
220
+ pageCount: i && z ? Ue : Je,
220
221
  state: {
221
- sorting: N,
222
- columnFilters: Ae,
223
- columnVisibility: Ve,
224
- rowSelection: he,
222
+ sorting: H,
223
+ columnFilters: je,
224
+ columnVisibility: qe,
225
+ rowSelection: be,
225
226
  globalFilter: m,
226
- pagination: a ? r.pagination : K,
227
- columnOrder: Se
227
+ pagination: i ? r.pagination : K,
228
+ columnOrder: Fe
228
229
  },
229
230
  // Prevent implicit resets on data/columns changes so filters/sorting persist
230
231
  autoResetPageIndex: !1
231
- }, i = at(Ze), re = i.getFilteredRowModel();
232
- H(() => {
233
- if (a && g) {
232
+ }, s = ct(rt), ne = s.getFilteredRowModel();
233
+ O(() => {
234
+ if (i && g) {
234
235
  const e = Math.ceil(
235
236
  g.totalItems / (r.pagination.pageSize || 10)
236
237
  );
237
- pe(e), !z && e > 0 && fe(e);
238
+ he(e), !z && e > 0 && Se(e);
238
239
  } else {
239
- const e = re.rows.length, t = Math.ceil(e / K.pageSize);
240
- pe(t), fe(t);
240
+ const e = ne.rows.length, t = Math.ceil(e / K.pageSize);
241
+ he(t), Se(t);
241
242
  }
242
243
  }, [
243
- a,
244
+ i,
244
245
  g?.totalItems,
245
246
  r.pagination.pageSize,
246
247
  r.pagination.pageIndex,
247
- i,
248
- re,
248
+ s,
249
+ ne,
249
250
  K.pageSize,
250
251
  z
251
- ]), H(() => {
252
+ ]), O(() => {
252
253
  if (b) return;
253
254
  const e = () => {
255
+ if (U.current) return;
254
256
  const y = q.current;
255
257
  if (!y) return;
256
258
  const _ = y.querySelector(
257
259
  "thead tr"
258
- ), n = y.querySelector(
259
- "tbody tr"
260
+ ), o = y.querySelector(
261
+ 'tbody[data-table-body="data"] tr'
260
262
  ), w = _?.getBoundingClientRect().height ?? 40;
261
- if (!!!n?.querySelector("td")) return;
262
- const A = n?.getBoundingClientRect().height ?? 32.5;
263
- ht(y, {
264
- rowHeight: A,
263
+ if (!!!o?.querySelector("td")) return;
264
+ const k = o?.getBoundingClientRect().height ?? 32.5;
265
+ Ct(y, {
266
+ rowHeight: k,
265
267
  headerHeight: w,
266
- onPageChange: a ? (R, v) => {
267
- if (g && ue.current) {
268
+ onPageChange: i ? (R, v) => {
269
+ if (g && me.current) {
268
270
  const S = b ? {
269
271
  ...r.pagination,
270
272
  pageIndex: R
@@ -272,26 +274,26 @@ function Pt({
272
274
  ...r.pagination,
273
275
  pageIndex: R,
274
276
  pageSize: v
275
- }, oe = S.pageIndex === r.pagination.pageIndex, ae = b || S.pageSize === r.pagination.pageSize;
276
- if (oe && ae)
277
+ }, ie = S.pageIndex === r.pagination.pageIndex, ae = b || S.pageSize === r.pagination.pageSize;
278
+ if (ie && ae)
277
279
  return;
278
- const V = {
280
+ const A = {
279
281
  ...r,
280
282
  pagination: S,
281
283
  // Preserve computed values if they exist
282
284
  computedFilter: r.computedFilter,
283
285
  computedSorting: r.computedSorting
284
286
  };
285
- G(V), $.current || L(V);
287
+ G(A), U.current || L(A);
286
288
  }
287
289
  } : (R, v) => {
288
- O(
290
+ N(
289
291
  (S) => b ? { ...S, pageIndex: R } : { pageIndex: R, pageSize: v }
290
292
  );
291
293
  },
292
294
  setPagination: (R) => {
293
295
  const v = typeof R == "function" ? R(r.pagination) : R;
294
- if (a && g) {
296
+ if (i && g) {
295
297
  const S = b ? {
296
298
  ...r.pagination,
297
299
  pageIndex: v.pageIndex
@@ -299,19 +301,19 @@ function Pt({
299
301
  ...r.pagination,
300
302
  pageIndex: v.pageIndex,
301
303
  pageSize: v.pageSize
302
- }, oe = S.pageIndex === r.pagination.pageIndex, ae = b || S.pageSize === r.pagination.pageSize;
303
- if (oe && ae)
304
+ }, ie = S.pageIndex === r.pagination.pageIndex, ae = b || S.pageSize === r.pagination.pageSize;
305
+ if (ie && ae)
304
306
  return;
305
- const V = {
307
+ const A = {
306
308
  ...r,
307
309
  pagination: S,
308
310
  // Preserve computed values if they exist
309
311
  computedFilter: r.computedFilter,
310
312
  computedSorting: r.computedSorting
311
313
  };
312
- G(V), $.current || L(V);
314
+ G(A), U.current || L(A);
313
315
  } else
314
- O(
316
+ N(
315
317
  (S) => b ? { ...S, pageIndex: v.pageIndex } : {
316
318
  pageIndex: v.pageIndex,
317
319
  pageSize: v.pageSize
@@ -319,7 +321,7 @@ function Pt({
319
321
  );
320
322
  }
321
323
  });
322
- }, t = pt(() => {
324
+ }, t = Ft(() => {
323
325
  requestAnimationFrame(() => {
324
326
  e();
325
327
  });
@@ -329,102 +331,104 @@ function Pt({
329
331
  e();
330
332
  });
331
333
  });
332
- const o = setTimeout(e, 200), s = document.fonts;
333
- s && typeof s.ready?.then == "function" && s.ready.then(() => e()), window.addEventListener("resize", t);
334
- const l = q.current, p = typeof ResizeObserver < "u" ? new ResizeObserver((y) => {
334
+ const n = setTimeout(e, 200), a = document.fonts;
335
+ a && typeof a.ready?.then == "function" && a.ready.then(() => e()), window.addEventListener("resize", t);
336
+ const c = q.current, p = typeof ResizeObserver < "u" ? new ResizeObserver((y) => {
335
337
  const _ = y[0];
336
338
  if (!_) return;
337
- const n = _.contentRect.height, w = me.current;
338
- (w === null || Math.abs(n - w) > 0.5) && (me.current = n, t());
339
+ const o = _.contentRect.height, w = fe.current;
340
+ (w === null || Math.abs(o - w) > 0.5) && (fe.current = o, t());
339
341
  }) : null;
340
- return l && p && p.observe(l), () => {
341
- window.removeEventListener("resize", t), clearTimeout(o), p && p.disconnect(), clearTimeout(o);
342
+ return c && p && p.observe(c), () => {
343
+ window.removeEventListener("resize", t), clearTimeout(n), p && p.disconnect(), clearTimeout(n);
342
344
  };
343
345
  }, [
344
- a,
346
+ i,
345
347
  q,
346
348
  b,
347
349
  // Recalculate when the rendered rows count changes; helps when data arrives async
348
- re.rows.length
349
- ]), H(() => {
350
- if (Z && P) {
351
- const e = i.getFilteredSelectedRowModel().rows.map((t) => t.original);
352
- Z(e);
350
+ ne.rows.length
351
+ ]), O(() => {
352
+ if ($ && j) {
353
+ const e = s.getFilteredSelectedRowModel().rows.map((t) => t.original);
354
+ $(e);
353
355
  }
354
- }, [i, Z, P, he]);
355
- const $e = F(() => {
356
- const e = i.getHeaderGroups()[0], t = e ? e.headers : [];
357
- return (i.getState().sorting || []).map((l) => t.find((p) => p.column.id === l.id)).filter(Boolean);
358
- }, [
359
- i.getHeaderGroups,
360
- i.getState().sorting,
361
- I
362
- ]), ne = F(() => i.getHeaderGroups()[0].headers.filter((e) => e.column.columnDef.meta?.sortable), [i.getHeaderGroups, I]), k = F(() => i.getHeaderGroups()[0].headers.filter((e) => e.column.columnDef.meta?.filterable), [i.getHeaderGroups, I]), et = F(() => U ? k.filter((e) => (e.column.columnDef.meta?.headerLabel ?? (typeof e.column.columnDef.header == "string" ? e.column.columnDef.header : void 0) ?? e.column.id).toLowerCase().includes(U.toLowerCase())) : k, [k, U]), Fe = (e) => {
363
- ee((t) => [...t, bt(e)]);
364
- }, tt = () => {
365
- te(St());
366
- }, rt = F(() => C.sort((e, t) => e.value === void 0 || e.value === "" ? 1 : t.value === void 0 || t.value === "" ? -1 : 1), [C]), Ce = f({
356
+ }, [s, $, j, be]);
357
+ const xe = s.getState().sorting, nt = C(() => {
358
+ const e = s.getHeaderGroups()[0], t = e ? e.headers : [];
359
+ return (xe || []).map((c) => t.find((p) => p.column.id === c.id)).filter(Boolean);
360
+ }, [s.getHeaderGroups, xe, I]), oe = C(() => s.getHeaderGroups()[0].headers.filter((e) => e.column.columnDef.meta?.sortable), [s.getHeaderGroups, I]), P = C(() => s.getHeaderGroups()[0].headers.filter((e) => e.column.columnDef.meta?.filterable), [s.getHeaderGroups, I]), ot = C(() => X ? P.filter((e) => (e.column.columnDef.meta?.headerLabel ?? (typeof e.column.columnDef.header == "string" ? e.column.columnDef.header : void 0) ?? e.column.id).toLowerCase().includes(X.toLowerCase())) : P, [P, X]), ye = (e) => {
361
+ const t = F.find(
362
+ (a) => a.columnId === (e?.id ?? "")
363
+ );
364
+ if (t)
365
+ return re(t.id), t.id;
366
+ const n = yt(e);
367
+ return ee((a) => [...a, n]), re(n.id), n.id;
368
+ }, it = () => {
369
+ te(xt());
370
+ }, at = C(() => F.sort((e, t) => e.value === void 0 || e.value === "" ? 1 : t.value === void 0 || t.value === "" ? -1 : 1), [F]), we = f({
367
371
  filterBadges: [],
368
372
  advancedFilterBadge: void 0,
369
373
  searchbarGlobalFilter: void 0
370
374
  });
371
- H(() => {
372
- const e = ft(
373
- C,
375
+ O(() => {
376
+ const e = vt(
377
+ F,
374
378
  x ?? void 0
375
379
  ), t = m && T.length > 0 ? T.length === 1 ? (() => {
376
- const n = T[0], M = B.find(
377
- (A) => X(A) === n
380
+ const o = T[0], M = B.find(
381
+ (k) => Q(k) === o
378
382
  )?.meta?.type;
379
383
  return M === "list_multi_select" || M === "list_single_select" ? {
380
- [n]: {
384
+ [o]: {
381
385
  operator: "array_overlap",
382
386
  value: [m]
383
387
  }
384
388
  } : {
385
- [n]: {
389
+ [o]: {
386
390
  operator: "like",
387
391
  value: m
388
392
  }
389
393
  };
390
394
  })() : {
391
- _or: T.map((n) => {
395
+ _or: T.map((o) => {
392
396
  const M = B.find(
393
- (A) => X(A) === n
397
+ (k) => Q(k) === o
394
398
  )?.meta?.type;
395
399
  return M === "list_multi_select" || M === "list_single_select" ? {
396
- [n]: {
400
+ [o]: {
397
401
  operator: "array_overlap",
398
402
  value: [m]
399
403
  }
400
404
  } : {
401
- [n]: {
405
+ [o]: {
402
406
  operator: "like",
403
407
  value: m
404
408
  }
405
409
  };
406
410
  })
407
- } : null, o = [
411
+ } : null, n = [
408
412
  ...e && Object.keys(e).length > 0 ? [e] : [],
409
413
  ...t ? [t] : []
410
- ], s = o.length === 0 ? {} : o.length === 1 ? o[0] : { _and: o }, l = {
411
- sort_by: N.map((n) => n.id),
412
- sort_order: N.map((n) => n.desc ? "desc" : "asc")
413
- }, p = Ce.current, y = JSON.stringify(C) !== JSON.stringify(p.filterBadges) || JSON.stringify(x) !== JSON.stringify(p.advancedFilterBadge) || m !== p.searchbarGlobalFilter;
414
- Ce.current = {
415
- filterBadges: [...C],
414
+ ], a = n.length === 0 ? {} : n.length === 1 ? n[0] : { _and: n }, c = {
415
+ sort_by: H.map((o) => o.id),
416
+ sort_order: H.map((o) => o.desc ? "desc" : "asc")
417
+ }, p = we.current, y = JSON.stringify(F) !== JSON.stringify(p.filterBadges) || JSON.stringify(x) !== JSON.stringify(p.advancedFilterBadge) || m !== p.searchbarGlobalFilter;
418
+ we.current = {
419
+ filterBadges: [...F],
416
420
  advancedFilterBadge: x ? { ...x } : void 0,
417
421
  searchbarGlobalFilter: m
418
422
  };
419
- const _ = de.current;
420
- if (Ye(s), a && E.current && _) {
421
- const n = {
423
+ const _ = ge.current;
424
+ if (tt(a), i && E.current && _) {
425
+ const o = {
422
426
  ...r,
423
- computedFilter: s,
427
+ computedFilter: a,
424
428
  // Emit only computedSorting. Use empty arrays to signal "no sorting" when cleared.
425
- computedSorting: l,
429
+ computedSorting: c,
426
430
  filters: {
427
- filterBadges: C,
431
+ filterBadges: F,
428
432
  advancedFilterBadge: x,
429
433
  searchbarFilter: m
430
434
  },
@@ -434,74 +438,76 @@ function Pt({
434
438
  pageIndex: y ? 0 : r.pagination.pageIndex
435
439
  }
436
440
  };
437
- G(n);
441
+ G(o);
438
442
  const w = JSON.stringify({
439
- computedFilter: n.computedFilter,
440
- computedSorting: n.computedSorting,
441
- filters: n.filters,
442
- pagination: n.pagination
443
+ computedFilter: o.computedFilter,
444
+ computedSorting: o.computedSorting,
445
+ filters: o.filters,
446
+ pagination: o.pagination
443
447
  });
444
- ge.current !== w && (ge.current = w, L(n));
448
+ pe.current !== w && (pe.current = w, L(o));
445
449
  } else
446
- y && O((n) => ({
447
- ...n,
450
+ y && N((o) => ({
451
+ ...o,
448
452
  pageIndex: 0
449
453
  }));
450
454
  }, [
451
- C,
455
+ F,
452
456
  x,
453
457
  m,
454
458
  T,
455
459
  B,
456
- N,
457
- a
460
+ H,
461
+ i
458
462
  ]);
459
- const xe = i.getAllLeafColumns(), nt = xe.filter((e) => e.getIsVisible()), ot = xe.filter((e) => !e.getIsVisible());
460
- return /* @__PURE__ */ ie(
463
+ const Re = s.getAllLeafColumns(), st = Re.filter((e) => e.getIsVisible()), lt = Re.filter((e) => !e.getIsVisible());
464
+ return /* @__PURE__ */ se(
461
465
  "div",
462
466
  {
463
- id: Oe,
464
- "data-testid": Le,
465
- className: it(
467
+ id: Ge,
468
+ "data-testid": Pe,
469
+ className: dt(
466
470
  "flex h-full max-h-full min-h-[250px] w-full max-w-full min-w-0 flex-col gap-2",
467
- Ie
471
+ De
468
472
  ),
469
473
  children: [
470
- !Me && /* @__PURE__ */ ie("div", { className: "flex w-full items-center justify-between gap-1", children: [
471
- /* @__PURE__ */ ie("div", { className: "flex min-w-0 flex-1 items-center gap-1 overflow-x-auto", children: [
472
- ne.length > 0 && /* @__PURE__ */ c(
473
- mt,
474
+ !Ne && /* @__PURE__ */ se("div", { className: "flex w-full items-center justify-between gap-1", children: [
475
+ /* @__PURE__ */ se("div", { className: "flex min-w-0 flex-1 items-center gap-1 overflow-x-auto", children: [
476
+ oe.length > 0 && /* @__PURE__ */ d(
477
+ bt,
474
478
  {
475
- table: i,
476
- sortedColumns: $e,
477
- sortableColumns: ne,
479
+ table: s,
480
+ sortedColumns: nt,
481
+ sortableColumns: oe,
478
482
  i18n: h,
479
- maxSortedColumns: le
483
+ maxSortedColumns: ce
480
484
  }
481
485
  ),
482
- ne.length > 0 && k.length > 0 && /* @__PURE__ */ c("div", { className: "border-d-border h-4 min-h-4 w-[1px] border-r" }),
483
- De,
484
- /* @__PURE__ */ c(
485
- dt,
486
+ oe.length > 0 && P.length > 0 && /* @__PURE__ */ d("div", { className: "border-d-border h-4 min-h-4 w-[1px] border-r" }),
487
+ Me,
488
+ /* @__PURE__ */ d(
489
+ ft,
486
490
  {
487
491
  advancedFilterBadge: x,
488
492
  setAdvancedFilterBadge: te,
489
- filterableColumns: k,
490
- sortedFilterBadges: rt,
493
+ filterableColumns: P,
494
+ sortedFilterBadges: at,
491
495
  setFilterBadges: ee,
492
- filterSearch: U,
493
- setFilterSearch: Xe,
494
- filteredColumns: et,
495
- handleAddFilter: Fe,
496
- handleAddAdvancedFilter: tt,
496
+ filterSearch: X,
497
+ setFilterSearch: Ze,
498
+ filteredColumns: ot,
499
+ handleAddFilter: ye,
500
+ handleAddAdvancedFilter: it,
501
+ pendingOpenFilterId: $e,
502
+ onPendingOpenFilterHandled: () => re(void 0),
497
503
  i18n: h
498
504
  }
499
505
  )
500
506
  ] }),
501
- /* @__PURE__ */ c("div", { className: "border-d-border h-4 min-h-4 w-[1px] border-r" }),
502
- Be,
503
- (C.length || x) && /* @__PURE__ */ c(
504
- st,
507
+ /* @__PURE__ */ d("div", { className: "border-d-border h-4 min-h-4 w-[1px] border-r" }),
508
+ Oe,
509
+ (F.length || x) && /* @__PURE__ */ d(
510
+ ut,
505
511
  {
506
512
  className: "h-6 text-xs",
507
513
  iconLeft: "FunnelX",
@@ -513,55 +519,57 @@ function Pt({
513
519
  children: h.reset
514
520
  }
515
521
  ),
516
- T.length > 0 && /* @__PURE__ */ c(
517
- gt,
522
+ T.length > 0 && /* @__PURE__ */ d(
523
+ St,
518
524
  {
519
525
  debounceMs: 300,
520
- onSearch: Pe,
526
+ onSearch: Ee,
521
527
  i18n: h,
522
528
  initialValue: m ?? "",
523
529
  searchableColumnsHeaders: B.map(
524
- (e) => Qe(e)
530
+ (e) => et(e)
525
531
  )
526
532
  }
527
533
  ),
528
- /* @__PURE__ */ c(
529
- ct,
534
+ /* @__PURE__ */ d(
535
+ pt,
530
536
  {
531
- table: i,
532
- visibleColumns: nt,
533
- hiddenColumns: ot,
537
+ table: s,
538
+ visibleColumns: st,
539
+ hiddenColumns: lt,
534
540
  i18n: h
535
541
  }
536
542
  ),
537
- /* @__PURE__ */ c(vt, { actions: ze, i18n: h })
543
+ /* @__PURE__ */ d(gt, { actions: _e, i18n: h })
538
544
  ] }),
539
- /* @__PURE__ */ c(
540
- lt,
545
+ /* @__PURE__ */ d(
546
+ mt,
541
547
  {
542
- table: i,
548
+ table: s,
543
549
  tableContainerRef: q,
544
550
  loading: z,
545
- data: j,
546
- emptyComponent: Re,
551
+ data: V,
552
+ emptyComponent: ze,
547
553
  notFoundMessage: h?.notFoundMessage ?? "N/A",
548
- onAddFilter: Fe,
549
- maxSortedColumns: le,
554
+ onAddFilter: ye,
555
+ maxSortedColumns: ce,
550
556
  i18n: h,
551
- isServerSide: a,
552
- filterBadges: C,
557
+ isServerSide: i,
558
+ filterBadges: F,
553
559
  advancedFilterBadge: x,
554
- searchbarGlobalFilter: m
560
+ searchbarGlobalFilter: m,
561
+ serverDebounceTime: de?.serverDebounceTime,
562
+ rowClassName: ke
555
563
  }
556
564
  ),
557
- !_e && /* @__PURE__ */ c(
558
- ut,
565
+ !He && /* @__PURE__ */ d(
566
+ ht,
559
567
  {
560
- table: i,
561
- isServerSide: a,
568
+ table: s,
569
+ isServerSide: i,
562
570
  clientPagination: K,
563
- serverState: a ? r : void 0,
564
- onServerStateChange: a && g ? (e) => {
571
+ serverState: i ? r : void 0,
572
+ onServerStateChange: i && g ? (e) => {
565
573
  G(e), L(e);
566
574
  } : void 0,
567
575
  totalItems: g?.totalItems,
@@ -573,5 +581,5 @@ function Pt({
573
581
  );
574
582
  }
575
583
  export {
576
- Pt as DataTable
584
+ Wt as DataTable
577
585
  };