laif-ds 0.2.74 → 0.2.75

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