asterui 0.12.58 → 0.12.60

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 (96) hide show
  1. package/dist/components/Autocomplete.js +1 -1
  2. package/dist/components/Autocomplete.js.map +1 -1
  3. package/dist/components/Button.js +1 -1
  4. package/dist/components/Button.js.map +1 -1
  5. package/dist/components/Cascader.js +147 -146
  6. package/dist/components/Cascader.js.map +1 -1
  7. package/dist/components/Checkbox.js +1 -1
  8. package/dist/components/Checkbox.js.map +1 -1
  9. package/dist/components/ColorPicker.js +1 -1
  10. package/dist/components/ColorPicker.js.map +1 -1
  11. package/dist/components/ContextMenu.js +90 -89
  12. package/dist/components/ContextMenu.js.map +1 -1
  13. package/dist/components/CopyButton.js +1 -1
  14. package/dist/components/CopyButton.js.map +1 -1
  15. package/dist/components/Countdown.js +1 -1
  16. package/dist/components/Countdown.js.map +1 -1
  17. package/dist/components/DatePicker.js +1 -1
  18. package/dist/components/DatePicker.js.map +1 -1
  19. package/dist/components/Dock.js +1 -1
  20. package/dist/components/Dock.js.map +1 -1
  21. package/dist/components/Drawer.js +66 -65
  22. package/dist/components/Drawer.js.map +1 -1
  23. package/dist/components/Dropdown.js +174 -173
  24. package/dist/components/Dropdown.js.map +1 -1
  25. package/dist/components/Empty.js +1 -1
  26. package/dist/components/Empty.js.map +1 -1
  27. package/dist/components/FileInput.js +1 -1
  28. package/dist/components/FileInput.js.map +1 -1
  29. package/dist/components/Filter.js +1 -1
  30. package/dist/components/Filter.js.map +1 -1
  31. package/dist/components/Form.js +1 -1
  32. package/dist/components/Form.js.map +1 -1
  33. package/dist/components/Input.js +1 -1
  34. package/dist/components/Input.js.map +1 -1
  35. package/dist/components/InputNumber.js +1 -1
  36. package/dist/components/InputNumber.js.map +1 -1
  37. package/dist/components/List.js +1 -1
  38. package/dist/components/List.js.map +1 -1
  39. package/dist/components/Loading.js +1 -1
  40. package/dist/components/Loading.js.map +1 -1
  41. package/dist/components/Mention.js +66 -65
  42. package/dist/components/Mention.js.map +1 -1
  43. package/dist/components/Modal.js +1 -1
  44. package/dist/components/Modal.js.map +1 -1
  45. package/dist/components/OTPInput.js +1 -1
  46. package/dist/components/OTPInput.js.map +1 -1
  47. package/dist/components/Pagination.js +1 -1
  48. package/dist/components/Pagination.js.map +1 -1
  49. package/dist/components/Popconfirm.js +1 -1
  50. package/dist/components/Popconfirm.js.map +1 -1
  51. package/dist/components/Radio.js +1 -1
  52. package/dist/components/Radio.js.map +1 -1
  53. package/dist/components/Range.js +1 -1
  54. package/dist/components/Range.js.map +1 -1
  55. package/dist/components/Rating.js +1 -1
  56. package/dist/components/Rating.js.map +1 -1
  57. package/dist/components/RichTextEditor.js +1 -1
  58. package/dist/components/RichTextEditor.js.map +1 -1
  59. package/dist/components/Segmented.js +1 -1
  60. package/dist/components/Segmented.js.map +1 -1
  61. package/dist/components/Select.js +1 -1
  62. package/dist/components/Select.js.map +1 -1
  63. package/dist/components/Table.d.ts +19 -0
  64. package/dist/components/Table.js +348 -310
  65. package/dist/components/Table.js.map +1 -1
  66. package/dist/components/Tabs.js +1 -1
  67. package/dist/components/Tabs.js.map +1 -1
  68. package/dist/components/Textarea.js +1 -1
  69. package/dist/components/Textarea.js.map +1 -1
  70. package/dist/components/ThemeController.js +1 -1
  71. package/dist/components/ThemeController.js.map +1 -1
  72. package/dist/components/TimePicker.js +1 -1
  73. package/dist/components/TimePicker.js.map +1 -1
  74. package/dist/components/Toggle.js +1 -1
  75. package/dist/components/Toggle.js.map +1 -1
  76. package/dist/components/Tour.js +83 -82
  77. package/dist/components/Tour.js.map +1 -1
  78. package/dist/components/Transfer.js +107 -103
  79. package/dist/components/Transfer.js.map +1 -1
  80. package/dist/components/TreeSelect.js +245 -244
  81. package/dist/components/TreeSelect.js.map +1 -1
  82. package/dist/hooks/useTheme.d.ts +1 -1
  83. package/dist/hooks/useTheme.js +1 -1
  84. package/dist/hooks/useTheme.js.map +1 -1
  85. package/dist/index.d.ts +4 -4
  86. package/dist/index.js +2 -2
  87. package/dist/{components → providers}/ConfigProvider.d.ts +8 -0
  88. package/dist/providers/ConfigProvider.js +50 -0
  89. package/dist/providers/ConfigProvider.js.map +1 -0
  90. package/dist/providers/ThemeProvider.js.map +1 -0
  91. package/package.json +1 -1
  92. package/dist/components/ConfigProvider.js +0 -46
  93. package/dist/components/ConfigProvider.js.map +0 -1
  94. package/dist/components/ThemeProvider.js.map +0 -1
  95. /package/dist/{components → providers}/ThemeProvider.d.ts +0 -0
  96. /package/dist/{components → providers}/ThemeProvider.js +0 -0
@@ -1,82 +1,97 @@
1
- import { jsx as a, jsxs as m } from "react/jsx-runtime";
2
- import He, { forwardRef as Ue, useState as j, useMemo as W, useCallback as N, useId as et } from "react";
3
- const tt = "table", st = "table-xs", at = "table-sm", nt = "table-lg", rt = "table-xl", ot = "table-zebra", lt = "table-pin-rows", dt = "table-pin-cols", it = "dropdown", ct = "dropdown-end", ft = "dropdown-content", O = "btn", ie = "btn-ghost", ce = "btn-xs", le = "btn-sm", ht = "btn-square", ut = "btn-active", pt = "menu", fe = "checkbox", bt = "checkbox-xs", he = "checkbox-primary", yt = "radio", gt = "radio-sm", xt = "radio-primary", mt = "divider", $t = "loading", vt = "loading-spinner", kt = "loading-lg", wt = "join", de = "join-item", Ct = "select", St = "select-sm", Nt = "select-bordered", Et = "input", zt = "input-sm", Kt = "input-bordered", Rt = {
4
- xs: st,
5
- sm: at,
6
- md: "",
7
- lg: nt,
8
- xl: rt
1
+ import { jsx as a, jsxs as x } from "react/jsx-runtime";
2
+ import bt, { forwardRef as yt, useState as j, useMemo as G, useCallback as z, useId as mt } from "react";
3
+ import { useConfig as xt } from "../providers/ConfigProvider.js";
4
+ const gt = "table", $t = "table-xs", vt = "table-sm", kt = "table-md", Ct = "table-lg", Nt = "table-xl", wt = "table-zebra", St = "table-pin-rows", Rt = "table-pin-cols", Et = "dropdown", zt = "dropdown-end", Kt = "dropdown-content", D = "btn", be = "btn-ghost", ye = "btn-xs", ue = "btn-sm", Tt = "btn-square", It = "btn-active", Pt = "menu", me = "checkbox", De = "checkbox-xs", jt = "checkbox-sm", Bt = "checkbox-md", Be = "checkbox-lg", xe = "checkbox-primary", Lt = "radio", Ft = "radio-xs", Dt = "radio-sm", Ot = "radio-md", Le = "radio-lg", At = "radio-primary", Mt = "divider", Vt = "loading", Wt = "loading-spinner", Xt = "loading-lg", Jt = "join", pe = "join-item", Gt = "select", qt = "select-sm", Qt = "select-bordered", Ht = "input", Yt = "input-sm", Zt = "input-bordered", _t = {
5
+ xs: $t,
6
+ sm: vt,
7
+ md: kt,
8
+ lg: Ct,
9
+ xl: Nt
10
+ }, Fe = {
11
+ xs: De,
12
+ sm: jt,
13
+ md: Bt,
14
+ lg: Be,
15
+ xl: Be
16
+ // DaisyUI max is lg
17
+ }, Ut = {
18
+ xs: Ft,
19
+ sm: Dt,
20
+ md: Ot,
21
+ lg: Le,
22
+ xl: Le
23
+ // DaisyUI max is lg
9
24
  };
10
- function Pt({
11
- filters: i,
25
+ function es({
26
+ filters: c,
12
27
  selectedValues: v,
13
- onChange: E,
14
- locale: H,
15
- testId: F
28
+ onChange: k,
29
+ locale: se,
30
+ testId: B
16
31
  }) {
17
- const [T, V] = j(!1), X = et(), J = (l) => {
18
- const y = v.includes(l) ? v.filter((k) => k !== l) : [...v, l];
19
- E(y);
20
- }, U = () => {
21
- E([]), V(!1);
22
- }, d = (l) => {
23
- l.key === "Escape" && V(!1);
32
+ const [O, A] = j(!1), q = mt(), Q = (n) => {
33
+ const f = v.includes(n) ? v.filter((N) => N !== n) : [...v, n];
34
+ k(f);
35
+ }, ae = () => {
36
+ k([]), A(!1);
37
+ }, l = (n) => {
38
+ n.key === "Escape" && A(!1);
24
39
  };
25
- return /* @__PURE__ */ m("div", { className: `${it} ${ct}`, onKeyDown: d, children: [
40
+ return /* @__PURE__ */ x("div", { className: `${Et} ${zt}`, onKeyDown: l, children: [
26
41
  /* @__PURE__ */ a(
27
42
  "button",
28
43
  {
29
44
  type: "button",
30
- className: `${O} ${ie} ${ce} ${v.length > 0 ? "text-primary" : ""}`,
31
- onClick: () => V(!T),
45
+ className: `${D} ${be} ${ye} ${v.length > 0 ? "text-primary" : ""}`,
46
+ onClick: () => A(!O),
32
47
  "aria-label": "Filter column",
33
- "aria-expanded": T,
48
+ "aria-expanded": O,
34
49
  "aria-haspopup": "listbox",
35
- "aria-controls": X,
36
- "data-testid": `${F}-filter-button`,
50
+ "aria-controls": q,
51
+ "data-testid": `${B}-filter-button`,
37
52
  children: /* @__PURE__ */ a("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z" }) })
38
53
  }
39
54
  ),
40
- T && /* @__PURE__ */ m(
55
+ O && /* @__PURE__ */ x(
41
56
  "div",
42
57
  {
43
- id: X,
58
+ id: q,
44
59
  role: "listbox",
45
60
  "aria-multiselectable": "true",
46
- className: `${ft} z-[1] ${pt} p-2 shadow bg-base-100 rounded-box w-52 border border-base-content/10`,
47
- "data-testid": `${F}-filter-dropdown`,
61
+ className: `${Kt} z-[1] ${Pt} p-2 shadow bg-base-100 rounded-box w-52 border border-base-content/10`,
62
+ "data-testid": `${B}-filter-dropdown`,
48
63
  children: [
49
- /* @__PURE__ */ a("div", { className: "space-y-2", children: i.map((l) => /* @__PURE__ */ m(
64
+ /* @__PURE__ */ a("div", { className: "space-y-2", children: c.map((n) => /* @__PURE__ */ x(
50
65
  "label",
51
66
  {
52
67
  className: "flex items-center gap-2 cursor-pointer p-2 hover:bg-base-200 rounded",
53
68
  role: "option",
54
- "aria-selected": v.includes(l.value),
69
+ "aria-selected": v.includes(n.value),
55
70
  children: [
56
71
  /* @__PURE__ */ a(
57
72
  "input",
58
73
  {
59
74
  type: "checkbox",
60
- className: `${fe} ${bt} ${he}`,
61
- checked: v.includes(l.value),
62
- onChange: () => J(l.value),
63
- "data-testid": `${F}-filter-${String(l.value)}`
75
+ className: `${me} ${De} ${xe}`,
76
+ checked: v.includes(n.value),
77
+ onChange: () => Q(n.value),
78
+ "data-testid": `${B}-filter-${String(n.value)}`
64
79
  }
65
80
  ),
66
- /* @__PURE__ */ a("span", { className: "text-sm", children: l.text })
81
+ /* @__PURE__ */ a("span", { className: "text-sm", children: n.text })
67
82
  ]
68
83
  },
69
- String(l.value)
84
+ String(n.value)
70
85
  )) }),
71
- /* @__PURE__ */ a("div", { className: `${mt} my-1` }),
86
+ /* @__PURE__ */ a("div", { className: `${Mt} my-1` }),
72
87
  /* @__PURE__ */ a(
73
88
  "button",
74
89
  {
75
90
  type: "button",
76
- className: `${O} ${ie} ${ce} w-full`,
77
- onClick: U,
78
- "data-testid": `${F}-filter-reset`,
79
- children: H?.filterReset ?? "Clear"
91
+ className: `${D} ${be} ${ye} w-full`,
92
+ onClick: ae,
93
+ "data-testid": `${B}-filter-reset`,
94
+ children: se?.filterReset ?? "Clear"
80
95
  }
81
96
  )
82
97
  ]
@@ -84,21 +99,21 @@ function Pt({
84
99
  )
85
100
  ] });
86
101
  }
87
- function It({ expanded: i, onExpand: v }) {
102
+ function ts({ expanded: c, onExpand: v }) {
88
103
  return /* @__PURE__ */ a(
89
104
  "button",
90
105
  {
91
106
  type: "button",
92
- className: `${O} ${ie} ${ce} ${ht}`,
93
- onClick: (E) => {
94
- E.stopPropagation(), v();
107
+ className: `${D} ${be} ${ye} ${Tt}`,
108
+ onClick: (k) => {
109
+ k.stopPropagation(), v();
95
110
  },
96
- "aria-label": i ? "Collapse row" : "Expand row",
97
- "aria-expanded": i,
111
+ "aria-label": c ? "Collapse row" : "Expand row",
112
+ "aria-expanded": c,
98
113
  children: /* @__PURE__ */ a(
99
114
  "svg",
100
115
  {
101
- className: `w-4 h-4 transition-transform ${i ? "rotate-90" : ""}`,
116
+ className: `w-4 h-4 transition-transform ${c ? "rotate-90" : ""}`,
102
117
  fill: "none",
103
118
  stroke: "currentColor",
104
119
  viewBox: "0 0 24 24",
@@ -109,180 +124,193 @@ function It({ expanded: i, onExpand: v }) {
109
124
  }
110
125
  );
111
126
  }
112
- function jt({
113
- columns: i,
127
+ function ss({
128
+ columns: c,
114
129
  dataSource: v,
115
- rowKey: E = "id",
116
- loading: H = !1,
117
- size: F = "md",
118
- bordered: T = !1,
119
- hoverable: V = !0,
120
- striped: X = !1,
121
- pinRows: J = !1,
122
- pinCols: U = !1,
123
- pagination: d,
124
- rowSelection: l,
125
- expandable: y,
126
- scroll: k,
127
- className: Se = "",
128
- onRow: Ne,
129
- onChange: z,
130
- onSortChange: ue,
131
- onFilterChange: pe,
132
- locale: ee,
133
- "data-testid": Ee,
134
- "aria-label": ze,
135
- ...Ke
136
- }, Re) {
137
- const p = Ee ?? "table", Pe = 10, [C, G] = j(
138
- d !== !1 && d?.current ? d.current : 1
139
- ), [Ie, je] = j(
140
- d !== !1 && d?.pageSize ? d.pageSize : Pe
141
- ), w = d !== !1 && d?.pageSize !== void 0 ? d.pageSize : Ie, [be, Fe] = j(() => {
142
- const e = i.find((s) => s.sortOrder !== void 0);
130
+ rowKey: k = "id",
131
+ loading: se = !1,
132
+ size: B,
133
+ bordered: O = !1,
134
+ hoverable: A = !0,
135
+ striped: q = !1,
136
+ pinRows: Q = !1,
137
+ pinCols: ae = !1,
138
+ pagination: l,
139
+ rowSelection: n,
140
+ expandable: f,
141
+ scroll: N,
142
+ className: Oe = "",
143
+ showHeader: Ae = !0,
144
+ rowClassName: ne,
145
+ onRow: Me,
146
+ onHeaderRow: Ve,
147
+ onChange: K,
148
+ onSortChange: ge,
149
+ onFilterChange: $e,
150
+ locale: M,
151
+ title: ve,
152
+ footer: ke,
153
+ summary: Ce,
154
+ "data-testid": We,
155
+ "aria-label": Xe,
156
+ ...Je
157
+ }, Ge) {
158
+ const { componentSize: qe, locale: V } = xt(), H = B ?? qe ?? "md", oe = {
159
+ emptyText: M?.emptyText ?? V?.Table?.emptyText ?? "No data",
160
+ filterConfirm: M?.filterConfirm ?? V?.Table?.filterConfirm ?? "OK",
161
+ filterReset: M?.filterReset ?? V?.Table?.filterReset ?? "Reset",
162
+ selectAll: M?.selectAll ?? V?.Table?.selectAll ?? "Select all",
163
+ selectInvert: M?.selectInvert ?? V?.Table?.selectInvert ?? "Invert selection"
164
+ }, p = We ?? "table", Qe = 10, [R, Y] = j(
165
+ l !== !1 && l?.current ? l.current : 1
166
+ ), [He, Ye] = j(
167
+ l !== !1 && l?.pageSize ? l.pageSize : Qe
168
+ ), w = l !== !1 && l?.pageSize !== void 0 ? l.pageSize : He, [Ne, Ze] = j(() => {
169
+ const e = c.find((s) => s.sortOrder !== void 0);
143
170
  if (e)
144
171
  return {
145
172
  columnKey: e.key,
146
173
  order: e.sortOrder ?? null
147
174
  };
148
- const t = i.find((s) => s.defaultSortOrder);
175
+ const t = c.find((s) => s.defaultSortOrder);
149
176
  return {
150
177
  columnKey: t?.key || null,
151
178
  order: t?.defaultSortOrder || null
152
179
  };
153
- }), [ye, Be] = j(() => {
180
+ }), [we, _e] = j(() => {
154
181
  const e = {};
155
- return i.forEach((t) => {
182
+ return c.forEach((t) => {
156
183
  t.filteredValue !== void 0 ? e[t.key] = t.filteredValue : t.defaultFilteredValue && (e[t.key] = t.defaultFilteredValue);
157
184
  }), e;
158
- }), [De, te] = j(
159
- l?.selectedRowKeys || []
160
- ), [Le, Oe] = j(
161
- y?.expandedRowKeys ?? y?.defaultExpandedRowKeys ?? []
162
- ), q = i.some((e) => e.sortOrder !== void 0), Q = i.some((e) => e.filteredValue !== void 0), se = y?.expandedRowKeys !== void 0, B = l?.selectedRowKeys !== void 0, h = W(() => {
163
- if (q) {
164
- const e = i.find((t) => t.sortOrder !== void 0 && t.sortOrder !== null);
185
+ }), [Ue, re] = j(
186
+ n?.selectedRowKeys || []
187
+ ), [et, tt] = j(() => f?.expandedRowKeys ? f.expandedRowKeys : f?.defaultExpandedRowKeys ? f.defaultExpandedRowKeys : f?.defaultExpandAllRows ? v.map((e, t) => {
188
+ if (typeof k == "function") return k(e);
189
+ const s = e[k];
190
+ return String(s !== void 0 ? s : t);
191
+ }) : []), Z = c.some((e) => e.sortOrder !== void 0), _ = c.some((e) => e.filteredValue !== void 0), le = f?.expandedRowKeys !== void 0, L = n?.selectedRowKeys !== void 0, b = G(() => {
192
+ if (Z) {
193
+ const e = c.find((t) => t.sortOrder !== void 0 && t.sortOrder !== null);
165
194
  return {
166
195
  columnKey: e?.key ?? null,
167
196
  order: e?.sortOrder ?? null
168
197
  };
169
198
  }
170
- return be;
171
- }, [q, i, be]), K = W(() => {
172
- if (Q) {
199
+ return Ne;
200
+ }, [Z, c, Ne]), T = G(() => {
201
+ if (_) {
173
202
  const e = {};
174
- return i.forEach((t) => {
203
+ return c.forEach((t) => {
175
204
  t.filteredValue !== void 0 && (e[t.key] = t.filteredValue);
176
205
  }), e;
177
206
  }
178
- return ye;
179
- }, [Q, i, ye]), D = B ? l.selectedRowKeys : De, M = se ? y.expandedRowKeys : Le, Y = d !== !1, b = W(() => i.filter((e) => !e.hidden), [i]), S = N((e, t) => {
180
- if (typeof E == "function")
181
- return E(e);
182
- const s = e[E];
207
+ return we;
208
+ }, [_, c, we]), F = L ? n.selectedRowKeys : Ue, W = le ? f.expandedRowKeys : et, U = l !== !1, y = G(() => c.filter((e) => !e.hidden), [c]), E = z((e, t) => {
209
+ if (typeof k == "function")
210
+ return k(e);
211
+ const s = e[k];
183
212
  return String(s !== void 0 ? s : t);
184
- }, [E]), Z = W(() => {
213
+ }, [k]), ee = G(() => {
185
214
  let e = [...v];
186
- return Object.entries(K).forEach(([t, s]) => {
215
+ return Object.entries(T).forEach(([t, s]) => {
187
216
  if (s && s.length > 0) {
188
- const r = i.find((n) => n.key === t);
217
+ const r = c.find((o) => o.key === t);
189
218
  r?.onFilter && (e = e.filter(
190
- (n) => s.some((o) => r.onFilter(o, n))
219
+ (o) => s.some((i) => r.onFilter(i, o))
191
220
  ));
192
221
  }
193
222
  }), e;
194
- }, [v, K, i]), $ = W(() => {
195
- if (!h.columnKey || !h.order)
196
- return Z;
197
- const e = i.find((s) => s.key === h.columnKey);
223
+ }, [v, T, c]), C = G(() => {
224
+ if (!b.columnKey || !b.order)
225
+ return ee;
226
+ const e = c.find((s) => s.key === b.columnKey);
198
227
  if (!e?.sorter)
199
- return Z;
200
- const t = [...Z];
228
+ return ee;
229
+ const t = [...ee];
201
230
  return t.sort((s, r) => {
202
- let n = 0;
231
+ let o = 0;
203
232
  if (typeof e.sorter == "function")
204
- n = e.sorter(s, r);
233
+ o = e.sorter(s, r);
205
234
  else if (e.dataIndex) {
206
- const o = s[e.dataIndex], x = r[e.dataIndex];
207
- if (o == null) return 1;
208
- if (x == null) return -1;
209
- o < x && (n = -1), o > x && (n = 1);
235
+ const i = s[e.dataIndex], u = r[e.dataIndex];
236
+ if (i == null) return 1;
237
+ if (u == null) return -1;
238
+ i < u && (o = -1), i > u && (o = 1);
210
239
  }
211
- return h.order === "ascend" ? n : -n;
240
+ return b.order === "ascend" ? o : -o;
212
241
  }), t;
213
- }, [Z, h, i]), R = d !== !1 && d?.total !== void 0 ? d.total : $.length, P = Math.ceil(R / w), ae = (C - 1) * w, ge = ae + w, I = Y ? $.slice(ae, ge) : $, _ = N((e) => {
214
- if (G(e), d !== !1 && d?.onChange && d.onChange(e, w), z) {
242
+ }, [ee, b, c]), I = l !== !1 && l?.total !== void 0 ? l.total : C.length, P = Math.ceil(I / w), ie = (R - 1) * w, Se = ie + w, S = U ? C.slice(ie, Se) : C, te = z((e) => {
243
+ if (Y(e), l !== !1 && l?.onChange && l.onChange(e, w), K) {
215
244
  const t = {
216
- column: i.find((s) => s.key === h.columnKey),
217
- order: h.order,
218
- field: h.columnKey ?? void 0
245
+ column: c.find((s) => s.key === b.columnKey),
246
+ order: b.order,
247
+ field: b.columnKey ?? void 0
219
248
  };
220
- z(
221
- { current: e, pageSize: w, total: R },
222
- K,
249
+ K(
250
+ { current: e, pageSize: w, total: I },
251
+ T,
223
252
  t,
224
- { currentDataSource: $, action: "paginate" }
253
+ { currentDataSource: C, action: "paginate" }
225
254
  );
226
255
  }
227
- }, [d, w, z, i, h, K, $, R]), Te = N((e) => {
228
- je(e), G(1), d !== !1 && d?.onShowSizeChange && d.onShowSizeChange(1, e), d !== !1 && d?.onChange && d.onChange(1, e);
229
- }, [d]), xe = N((e) => {
230
- const t = i.find((n) => n.key === e);
256
+ }, [l, w, K, c, b, T, C, I]), st = z((e) => {
257
+ Ye(e), Y(1), l !== !1 && l?.onShowSizeChange && l.onShowSizeChange(1, e), l !== !1 && l?.onChange && l.onChange(1, e);
258
+ }, [l]), Re = z((e) => {
259
+ const t = c.find((o) => o.key === e);
231
260
  let s = "ascend";
232
- h.columnKey === e && (h.order === "ascend" ? s = "descend" : h.order === "descend" && (s = null)), q || Fe({ columnKey: s ? e : null, order: s }), G(1);
261
+ b.columnKey === e && (b.order === "ascend" ? s = "descend" : b.order === "descend" && (s = null)), Z || Ze({ columnKey: s ? e : null, order: s }), Y(1);
233
262
  const r = {
234
263
  column: t,
235
264
  order: s,
236
265
  field: e
237
266
  };
238
- ue?.(r), z && z(
239
- { current: 1, pageSize: w, total: R },
240
- K,
267
+ ge?.(r), K && K(
268
+ { current: 1, pageSize: w, total: I },
269
+ T,
241
270
  r,
242
- { currentDataSource: $, action: "sort" }
271
+ { currentDataSource: C, action: "sort" }
243
272
  );
244
- }, [i, h, q, w, R, K, $, ue, z]), Ve = N((e, t) => {
273
+ }, [c, b, Z, w, I, T, C, ge, K]), at = z((e, t) => {
245
274
  const s = {
246
- ...K,
275
+ ...T,
247
276
  [e]: t
248
277
  };
249
- if (Q || Be(s), G(1), pe?.(s), z) {
278
+ if (_ || _e(s), Y(1), $e?.(s), K) {
250
279
  const r = {
251
- column: i.find((n) => n.key === h.columnKey),
252
- order: h.order,
253
- field: h.columnKey ?? void 0
280
+ column: c.find((o) => o.key === b.columnKey),
281
+ order: b.order,
282
+ field: b.columnKey ?? void 0
254
283
  };
255
- z(
256
- { current: 1, pageSize: w, total: R },
284
+ K(
285
+ { current: 1, pageSize: w, total: I },
257
286
  s,
258
287
  r,
259
- { currentDataSource: $, action: "filter" }
288
+ { currentDataSource: C, action: "filter" }
260
289
  );
261
290
  }
262
- }, [K, Q, i, h, w, R, $, pe, z]), Me = N((e) => {
263
- const t = e ? I.map((s, r) => S(s, r)) : [];
264
- if (B || te(t), l?.onChange) {
265
- const s = e ? I : [];
266
- l.onChange(t, s);
291
+ }, [T, _, c, b, w, I, C, $e, K]), nt = z((e) => {
292
+ const t = e ? S.map((s, r) => E(s, r)) : [];
293
+ if (L || re(t), n?.onChange) {
294
+ const s = e ? S : [];
295
+ n.onChange(t, s);
267
296
  }
268
- }, [I, S, B, l]), Ae = N((e, t, s) => {
269
- const r = S(e, t);
270
- if (l?.type === "radio") {
271
- const o = s ? [r] : [];
272
- B || te(o), l?.onChange && l.onChange(o, s ? [e] : []);
297
+ }, [S, E, L, n]), ot = z((e, t, s, r) => {
298
+ const o = E(e, t);
299
+ if (n?.type === "radio") {
300
+ const d = s ? [o] : [], h = s ? [e] : [];
301
+ L || re(d), n?.onSelect?.(e, s, h, r), n?.onChange?.(d, h);
273
302
  return;
274
303
  }
275
- const n = s ? [...D, r] : D.filter((o) => o !== r);
276
- if (B || te(n), l?.onChange) {
277
- const o = $.filter(
278
- (x, c) => n.includes(S(x, c))
279
- );
280
- l.onChange(n, o);
281
- }
282
- }, [S, l, B, D, $]), ne = N((e, t) => {
283
- const s = S(e, t), r = M.includes(s), n = r ? M.filter((o) => o !== s) : [...M, s];
284
- se || Oe(n), y?.onExpand?.(!r, e), y?.onExpandedRowsChange?.(n);
285
- }, [S, M, se, y]), We = N((e, t, s) => {
304
+ const i = s ? [...F, o] : F.filter((d) => d !== o);
305
+ L || re(i);
306
+ const u = C.filter(
307
+ (d, h) => i.includes(E(d, h))
308
+ );
309
+ n?.onSelect?.(e, s, u, r), n?.onChange?.(i, u);
310
+ }, [E, n, L, F, C]), de = z((e, t) => {
311
+ const s = E(e, t), r = W.includes(s), o = r ? W.filter((i) => i !== s) : [...W, s];
312
+ le || tt(o), f?.onExpand?.(!r, e), f?.onExpandedRowsChange?.(o);
313
+ }, [E, W, le, f]), rt = z((e, t, s) => {
286
314
  if (e.render)
287
315
  return e.render(
288
316
  e.dataIndex ? t[e.dataIndex] : void 0,
@@ -294,131 +322,131 @@ function jt({
294
322
  return r != null ? String(r) : "";
295
323
  }
296
324
  return "";
297
- }, []), me = (e) => e === "center" ? "text-center" : e === "right" ? "text-right" : "text-left", $e = N((e, t = !1) => {
298
- const s = b[e];
325
+ }, []), Ee = (e) => e === "center" ? "text-center" : e === "right" ? "text-right" : "text-left", ze = z((e, t = !1) => {
326
+ const s = y[e];
299
327
  if (!s?.fixed) return { className: "" };
300
328
  const r = ["sticky", "bg-base-100"];
301
- let n = 0;
302
- const o = {
329
+ let o = 0;
330
+ const i = {
303
331
  boxSizing: "border-box"
304
332
  };
305
333
  if (s.fixed === "left") {
306
- for (let c = 0; c < e; c++)
307
- if (b[c].fixed === "left" && b[c].width) {
308
- const u = b[c].width, g = typeof u == "number" ? u : parseInt(String(u));
309
- isNaN(g) || (n += g);
334
+ for (let d = 0; d < e; d++)
335
+ if (y[d].fixed === "left" && y[d].width) {
336
+ const h = y[d].width, m = typeof h == "number" ? h : parseInt(String(h));
337
+ isNaN(m) || (o += m);
310
338
  }
311
- n === 0 ? r.push("left-0") : o.left = `${n}px`, r.push(t ? "z-30" : "z-20");
312
- let x = -1;
313
- for (let c = b.length - 1; c >= 0; c--)
314
- if (b[c].fixed === "left") {
315
- x = c;
339
+ o === 0 ? r.push("left-0") : i.left = `${o}px`, r.push(t ? "z-30" : "z-20");
340
+ let u = -1;
341
+ for (let d = y.length - 1; d >= 0; d--)
342
+ if (y[d].fixed === "left") {
343
+ u = d;
316
344
  break;
317
345
  }
318
- e === x && (o.boxShadow = "2px 0 4px rgba(0, 0, 0, 0.1)");
346
+ e === u && (i.boxShadow = "2px 0 4px rgba(0, 0, 0, 0.1)");
319
347
  }
320
348
  if (s.fixed === "right") {
321
- for (let c = e + 1; c < b.length; c++)
322
- if (b[c].fixed === "right" && b[c].width) {
323
- const u = b[c].width, g = typeof u == "number" ? u : parseInt(String(u));
324
- isNaN(g) || (n += g);
349
+ for (let d = e + 1; d < y.length; d++)
350
+ if (y[d].fixed === "right" && y[d].width) {
351
+ const h = y[d].width, m = typeof h == "number" ? h : parseInt(String(h));
352
+ isNaN(m) || (o += m);
325
353
  }
326
- n === 0 ? r.push("right-0") : o.right = `${n}px`, r.push(t ? "z-30" : "z-20"), e === b.findIndex((c) => c.fixed === "right") && (o.boxShadow = "-2px 0 4px rgba(0, 0, 0, 0.1)");
354
+ o === 0 ? r.push("right-0") : i.right = `${o}px`, r.push(t ? "z-30" : "z-20"), e === y.findIndex((d) => d.fixed === "right") && (i.boxShadow = "-2px 0 4px rgba(0, 0, 0, 0.1)");
327
355
  }
328
356
  return {
329
357
  className: r.filter(Boolean).join(" "),
330
- style: Object.keys(o).length > 0 ? o : void 0
358
+ style: Object.keys(i).length > 0 ? i : void 0
331
359
  };
332
- }, [b]), Xe = [
333
- tt,
360
+ }, [y]), lt = [
361
+ gt,
334
362
  "bg-base-100",
335
- Rt[F],
336
- X && ot,
337
- J && lt,
338
- U && dt,
339
- Se
340
- ].filter(Boolean).join(" "), Je = b.some((e) => e.fixed), L = y !== void 0, A = {};
341
- k?.x && (A.overflowX = "auto", A.maxWidth = typeof k.x == "number" ? `${k.x}px` : k.x), k?.y && (A.overflowY = "auto", A.maxHeight = typeof k.y == "number" ? `${k.y}px` : k.y);
342
- const Ge = [
343
- (!J || Je || k?.x) && "overflow-x-auto",
344
- T && "rounded-box border border-base-content/5 bg-base-100"
363
+ _t[H],
364
+ q && wt,
365
+ Q && St,
366
+ ae && Rt,
367
+ Oe
368
+ ].filter(Boolean).join(" "), it = y.some((e) => e.fixed), Ke = f !== void 0, X = Ke && f?.showExpandColumn !== !1, J = {};
369
+ N?.x && (J.overflowX = "auto", J.maxWidth = typeof N.x == "number" ? `${N.x}px` : N.x), N?.y && (J.overflowY = "auto", J.maxHeight = typeof N.y == "number" ? `${N.y}px` : N.y);
370
+ const dt = [
371
+ (!Q || it || N?.x) && "overflow-x-auto",
372
+ O && "rounded-box border border-base-content/5 bg-base-100"
345
373
  ].filter(Boolean).join(" ");
346
- if (H)
347
- return /* @__PURE__ */ a("div", { className: "flex justify-center items-center p-8", "data-testid": `${p}-loading`, children: /* @__PURE__ */ a("span", { className: `${$t} ${vt} ${kt}`, "aria-label": "Loading" }) });
348
- const ve = I.length > 0 && I.every((e, t) => D.includes(S(e, t))), qe = I.some((e, t) => D.includes(S(e, t))), Qe = ee?.emptyText ?? "No data", ke = (l ? 1 : 0) + (L ? 1 : 0), we = () => {
349
- if (!Y || P <= 1 || typeof d == "boolean") return null;
350
- const e = d ?? {}, t = e.position ?? "bottomRight", s = e.showSizeChanger, r = e.showQuickJumper, n = e.showTotal, o = e.pageSizeOptions ?? [10, 20, 50, 100], x = t.includes("Left") ? "justify-start" : t.includes("Center") ? "justify-center" : "justify-end";
351
- return /* @__PURE__ */ m("div", { className: `flex items-center gap-4 ${x}`, "data-testid": `${p}-pagination`, children: [
352
- n && /* @__PURE__ */ a("span", { className: "text-sm text-base-content/70", children: n(R, [ae + 1, Math.min(ge, R)]) }),
374
+ if (se)
375
+ return /* @__PURE__ */ a("div", { className: "flex justify-center items-center p-8", "data-testid": `${p}-loading`, children: /* @__PURE__ */ a("span", { className: `${Vt} ${Wt} ${Xt}`, "aria-label": "Loading" }) });
376
+ const Te = S.length > 0 && S.every((e, t) => F.includes(E(e, t))), ct = S.some((e, t) => F.includes(E(e, t))), ft = oe?.emptyText ?? "No data", Ie = (n ? 1 : 0) + (X ? 1 : 0), Pe = () => {
377
+ if (!U || P <= 1 || typeof l == "boolean") return null;
378
+ const e = l ?? {}, t = e.position ?? "bottomRight", s = e.showSizeChanger, r = e.showQuickJumper, o = e.showTotal, i = e.pageSizeOptions ?? [10, 20, 50, 100], u = t.includes("Left") ? "justify-start" : t.includes("Center") ? "justify-center" : "justify-end";
379
+ return /* @__PURE__ */ x("div", { className: `flex items-center gap-4 ${u}`, "data-testid": `${p}-pagination`, children: [
380
+ o && /* @__PURE__ */ a("span", { className: "text-sm text-base-content/70", children: o(I, [ie + 1, Math.min(Se, I)]) }),
353
381
  s && /* @__PURE__ */ a(
354
382
  "select",
355
383
  {
356
- className: `${Ct} ${St} ${Nt}`,
384
+ className: `${Gt} ${qt} ${Qt}`,
357
385
  value: w,
358
- onChange: (u) => Te(Number(u.target.value)),
386
+ onChange: (h) => st(Number(h.target.value)),
359
387
  "aria-label": "Page size",
360
388
  "data-testid": `${p}-page-size`,
361
- children: o.map((u) => /* @__PURE__ */ m("option", { value: u, children: [
362
- u,
389
+ children: i.map((h) => /* @__PURE__ */ x("option", { value: h, children: [
390
+ h,
363
391
  " / page"
364
- ] }, u))
392
+ ] }, h))
365
393
  }
366
394
  ),
367
- /* @__PURE__ */ m("div", { className: wt, children: [
395
+ /* @__PURE__ */ x("div", { className: Jt, children: [
368
396
  /* @__PURE__ */ a(
369
397
  "button",
370
398
  {
371
399
  type: "button",
372
- className: `${de} ${O} ${le}`,
373
- onClick: () => _(C - 1),
374
- disabled: C === 1,
400
+ className: `${pe} ${D} ${ue}`,
401
+ onClick: () => te(R - 1),
402
+ disabled: R === 1,
375
403
  "aria-label": "Previous page",
376
404
  "data-testid": `${p}-prev`,
377
405
  children: "«"
378
406
  }
379
407
  ),
380
- Array.from({ length: Math.min(P, 7) }, (u, g) => {
381
- let f;
382
- return P <= 7 || C <= 4 ? f = g + 1 : C >= P - 3 ? f = P - 6 + g : f = C - 3 + g, /* @__PURE__ */ a(
408
+ Array.from({ length: Math.min(P, 7) }, (h, m) => {
409
+ let g;
410
+ return P <= 7 || R <= 4 ? g = m + 1 : R >= P - 3 ? g = P - 6 + m : g = R - 3 + m, /* @__PURE__ */ a(
383
411
  "button",
384
412
  {
385
413
  type: "button",
386
- className: `${de} ${O} ${le} ${C === f ? ut : ""}`,
387
- onClick: () => _(f),
388
- "aria-label": `Page ${f}`,
389
- "aria-current": C === f ? "page" : void 0,
390
- "data-testid": `${p}-page-${f}`,
391
- children: f
414
+ className: `${pe} ${D} ${ue} ${R === g ? It : ""}`,
415
+ onClick: () => te(g),
416
+ "aria-label": `Page ${g}`,
417
+ "aria-current": R === g ? "page" : void 0,
418
+ "data-testid": `${p}-page-${g}`,
419
+ children: g
392
420
  },
393
- f
421
+ g
394
422
  );
395
423
  }),
396
424
  /* @__PURE__ */ a(
397
425
  "button",
398
426
  {
399
427
  type: "button",
400
- className: `${de} ${O} ${le}`,
401
- onClick: () => _(C + 1),
402
- disabled: C === P,
428
+ className: `${pe} ${D} ${ue}`,
429
+ onClick: () => te(R + 1),
430
+ disabled: R === P,
403
431
  "aria-label": "Next page",
404
432
  "data-testid": `${p}-next`,
405
433
  children: "»"
406
434
  }
407
435
  )
408
436
  ] }),
409
- r && /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
437
+ r && /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
410
438
  /* @__PURE__ */ a("span", { className: "text-sm", children: "Go to" }),
411
439
  /* @__PURE__ */ a(
412
440
  "input",
413
441
  {
414
442
  type: "number",
415
- className: `${Et} ${zt} ${Kt} w-16`,
443
+ className: `${Ht} ${Yt} ${Zt} w-16`,
416
444
  min: 1,
417
445
  max: P,
418
- onKeyDown: (u) => {
419
- if (u.key === "Enter") {
420
- const g = parseInt(u.target.value);
421
- g >= 1 && g <= P && _(g);
446
+ onKeyDown: (h) => {
447
+ if (h.key === "Enter") {
448
+ const m = parseInt(h.target.value);
449
+ m >= 1 && m <= P && te(m);
422
450
  }
423
451
  },
424
452
  "aria-label": "Go to page",
@@ -427,65 +455,68 @@ function jt({
427
455
  )
428
456
  ] })
429
457
  ] });
430
- }, re = d && typeof d != "boolean" ? d.position : void 0, Ye = Y && re?.startsWith("top") ? we() : null, Ze = Y && (!re || re.startsWith("bottom")) ? we() : null;
431
- return /* @__PURE__ */ m("div", { className: "space-y-4", "data-testid": p, ...Ke, children: [
432
- Ye,
433
- /* @__PURE__ */ a("div", { className: Ge, style: A, children: /* @__PURE__ */ m(
458
+ }, ce = l && typeof l != "boolean" ? l.position : void 0, ht = U && ce?.startsWith("top") ? Pe() : null, ut = U && (!ce || ce.startsWith("bottom")) ? Pe() : null;
459
+ return /* @__PURE__ */ x("div", { className: "space-y-4", "data-testid": p, ...Je, children: [
460
+ ve && /* @__PURE__ */ a("div", { className: "text-lg font-semibold", "data-testid": `${p}-title`, children: ve(S) }),
461
+ ht,
462
+ /* @__PURE__ */ a("div", { className: dt, style: J, children: /* @__PURE__ */ x(
434
463
  "table",
435
464
  {
436
- ref: Re,
437
- className: Xe,
465
+ ref: Ge,
466
+ className: lt,
438
467
  style: { borderCollapse: "separate", borderSpacing: 0, tableLayout: "fixed" },
439
468
  role: "grid",
440
- "aria-label": ze,
441
- "aria-rowcount": $.length,
469
+ "aria-label": Xe,
470
+ "aria-rowcount": C.length,
442
471
  "data-testid": `${p}-table`,
443
472
  children: [
444
- /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ m("tr", { role: "row", children: [
445
- L && /* @__PURE__ */ a("th", { style: { width: 50 }, className: "sticky left-0 z-20 bg-base-100", role: "columnheader", children: /* @__PURE__ */ a("span", { className: "sr-only", children: "Expand" }) }),
446
- l && /* @__PURE__ */ a(
473
+ Ae && /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ x("tr", { role: "row", ...Ve?.(y) || {}, children: [
474
+ X && /* @__PURE__ */ a("th", { style: { width: f?.columnWidth ?? 50 }, className: "sticky left-0 z-20 bg-base-100", role: "columnheader", children: f?.columnTitle ?? /* @__PURE__ */ a("span", { className: "sr-only", children: "Expand" }) }),
475
+ n && /* @__PURE__ */ a(
447
476
  "th",
448
477
  {
449
- style: { width: 50 },
450
- className: `sticky ${L ? "" : "left-0"} z-20 bg-base-100`,
478
+ style: { width: n.columnWidth ?? 50 },
479
+ className: `${n.fixed !== !1 ? "sticky" : ""} ${n.fixed !== !1 && !X ? "left-0" : ""} z-20 bg-base-100`,
451
480
  role: "columnheader",
452
- children: l.type !== "radio" && /* @__PURE__ */ a(
481
+ children: n.columnTitle !== void 0 ? n.columnTitle : n.type !== "radio" && !n.hideSelectAll ? /* @__PURE__ */ a(
453
482
  "input",
454
483
  {
455
484
  type: "checkbox",
456
- className: `${fe} checkbox-sm ${he}`,
457
- checked: ve,
485
+ className: `${me} ${Fe[H]} ${xe}`,
486
+ checked: Te,
458
487
  ref: (e) => {
459
- e && (e.indeterminate = qe && !ve);
488
+ e && (e.indeterminate = ct && !Te);
460
489
  },
461
- onChange: (e) => Me(e.target.checked),
462
- "aria-label": ee?.selectAll ?? "Select all rows",
490
+ onChange: (e) => nt(e.target.checked),
491
+ "aria-label": oe?.selectAll ?? "Select all rows",
463
492
  "data-testid": `${p}-select-all`
464
493
  }
465
- )
494
+ ) : null
466
495
  }
467
496
  ),
468
- b.map((e, t) => {
469
- const s = $e(t, !0), n = h.columnKey === e.key ? h.order : null;
497
+ y.map((e, t) => {
498
+ const s = ze(t, !0), o = b.columnKey === e.key ? b.order : null, i = e.onHeaderCell?.(e) || {};
470
499
  return /* @__PURE__ */ a(
471
500
  "th",
472
501
  {
473
- className: `${me(e.align)} ${s.className}`,
502
+ ...i,
503
+ className: [Ee(e.align), s.className, e.className, i.className].filter(Boolean).join(" "),
474
504
  style: {
475
505
  ...e.width ? { width: e.width } : {},
476
- ...s.style
506
+ ...s.style,
507
+ ...i.style
477
508
  },
478
509
  role: "columnheader",
479
- "aria-sort": n === "ascend" ? "ascending" : n === "descend" ? "descending" : void 0,
510
+ "aria-sort": o === "ascend" ? "ascending" : o === "descend" ? "descending" : void 0,
480
511
  "data-testid": `${p}-header-${e.key}`,
481
- children: /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
512
+ children: /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
482
513
  /* @__PURE__ */ a(
483
514
  "span",
484
515
  {
485
516
  className: e.sorter ? "cursor-pointer select-none hover:text-primary" : "",
486
- onClick: () => e.sorter && xe(e.key),
487
- onKeyDown: (o) => {
488
- e.sorter && (o.key === "Enter" || o.key === " ") && (o.preventDefault(), xe(e.key));
517
+ onClick: () => e.sorter && Re(e.key),
518
+ onKeyDown: (u) => {
519
+ e.sorter && (u.key === "Enter" || u.key === " ") && (u.preventDefault(), Re(e.key));
489
520
  },
490
521
  tabIndex: e.sorter ? 0 : void 0,
491
522
  role: e.sorter ? "button" : void 0,
@@ -493,11 +524,11 @@ function jt({
493
524
  children: e.title
494
525
  }
495
526
  ),
496
- e.sorter && /* @__PURE__ */ m("div", { className: "flex flex-col", "aria-hidden": "true", children: [
527
+ e.sorter && /* @__PURE__ */ x("div", { className: "flex flex-col", "aria-hidden": "true", children: [
497
528
  /* @__PURE__ */ a(
498
529
  "svg",
499
530
  {
500
- className: `w-3 h-3 ${n === "ascend" ? "text-primary" : "text-base-content/30"}`,
531
+ className: `w-3 h-3 ${o === "ascend" ? "text-primary" : "text-base-content/30"}`,
501
532
  fill: "currentColor",
502
533
  viewBox: "0 0 20 20",
503
534
  children: /* @__PURE__ */ a("path", { d: "M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z" })
@@ -506,7 +537,7 @@ function jt({
506
537
  /* @__PURE__ */ a(
507
538
  "svg",
508
539
  {
509
- className: `w-3 h-3 -mt-1 ${n === "descend" ? "text-primary" : "text-base-content/30"}`,
540
+ className: `w-3 h-3 -mt-1 ${o === "descend" ? "text-primary" : "text-base-content/30"}`,
510
541
  fill: "currentColor",
511
542
  viewBox: "0 0 20 20",
512
543
  children: /* @__PURE__ */ a("path", { d: "M14.707 10.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 12.586V5a1 1 0 012 0v7.586l2.293-2.293a1 1 0 011.414 0z" })
@@ -514,12 +545,12 @@ function jt({
514
545
  )
515
546
  ] }),
516
547
  e.filters && /* @__PURE__ */ a(
517
- Pt,
548
+ es,
518
549
  {
519
550
  filters: e.filters,
520
- selectedValues: K[e.key] || [],
521
- onChange: (o) => Ve(e.key, o),
522
- locale: ee,
551
+ selectedValues: T[e.key] || [],
552
+ onChange: (u) => at(e.key, u),
553
+ locale: oe,
523
554
  testId: `${p}-${e.key}`
524
555
  }
525
556
  )
@@ -529,109 +560,116 @@ function jt({
529
560
  );
530
561
  })
531
562
  ] }) }),
532
- /* @__PURE__ */ a("tbody", { children: I.length === 0 ? /* @__PURE__ */ a("tr", { role: "row", children: /* @__PURE__ */ a(
563
+ /* @__PURE__ */ a("tbody", { children: S.length === 0 ? /* @__PURE__ */ a("tr", { role: "row", children: /* @__PURE__ */ a(
533
564
  "td",
534
565
  {
535
- colSpan: b.length + ke,
566
+ colSpan: y.length + Ie,
536
567
  className: "text-center py-8 text-base-content/50",
537
568
  role: "gridcell",
538
569
  "data-testid": `${p}-empty`,
539
- children: Qe
570
+ children: ft
540
571
  }
541
- ) }) : I.map((e, t) => {
542
- const s = Ne?.(e, t) || {}, r = S(e, t), n = D.includes(r), o = M.includes(r), x = y?.rowExpandable ? y.rowExpandable(e) : !0, c = [
543
- V && "hover:bg-base-200",
544
- n && "bg-primary/10"
545
- ].filter(Boolean).join(" "), u = l?.getCheckboxProps?.(e) || {}, g = (f) => {
546
- s.onClick?.(f), y?.expandRowByClick && x && ne(e, t);
572
+ ) }) : S.map((e, t) => {
573
+ const s = Me?.(e, t) || {}, r = E(e, t), o = F.includes(r), i = W.includes(r), u = f?.rowExpandable ? f.rowExpandable(e) : !0, d = typeof ne == "function" ? ne(e, t) : ne, h = [
574
+ A && "hover:bg-base-200",
575
+ o && "bg-primary/10",
576
+ d
577
+ ].filter(Boolean).join(" "), m = n?.getCheckboxProps?.(e) || {}, g = ($) => {
578
+ s.onClick?.($), f?.expandRowByClick && u && de(e, t);
547
579
  };
548
- return /* @__PURE__ */ m(He.Fragment, { children: [
549
- /* @__PURE__ */ m(
580
+ return /* @__PURE__ */ x(bt.Fragment, { children: [
581
+ /* @__PURE__ */ x(
550
582
  "tr",
551
583
  {
552
- className: c,
584
+ className: h,
553
585
  role: "row",
554
- "aria-selected": n,
586
+ "aria-selected": o,
555
587
  "data-testid": `${p}-row-${t}`,
556
- "data-state": n ? "selected" : void 0,
588
+ "data-state": o ? "selected" : void 0,
557
589
  ...s,
558
590
  onClick: g,
559
591
  children: [
560
- L && /* @__PURE__ */ a("td", { className: "sticky left-0 z-10 bg-base-100", role: "gridcell", children: x && (y.expandIcon ? y.expandIcon({
561
- expanded: o,
562
- onExpand: () => ne(e, t),
592
+ X && /* @__PURE__ */ a("td", { className: "sticky left-0 z-10 bg-base-100", role: "gridcell", children: u && (f.expandIcon ? f.expandIcon({
593
+ expanded: i,
594
+ onExpand: () => de(e, t),
563
595
  record: e
564
596
  }) : /* @__PURE__ */ a(
565
- It,
597
+ ts,
566
598
  {
567
- expanded: o,
568
- onExpand: () => ne(e, t)
599
+ expanded: i,
600
+ onExpand: () => de(e, t)
569
601
  }
570
602
  )) }),
571
- l && /* @__PURE__ */ a(
603
+ n && /* @__PURE__ */ a(
572
604
  "td",
573
605
  {
574
- className: `sticky ${L ? "" : "left-0"} z-10 bg-base-100`,
606
+ className: `${n.fixed !== !1 ? "sticky" : ""} ${n.fixed !== !1 && !X ? "left-0" : ""} z-10 bg-base-100`,
575
607
  role: "gridcell",
576
608
  children: /* @__PURE__ */ a(
577
609
  "input",
578
610
  {
579
- type: l.type === "radio" ? "radio" : "checkbox",
580
- className: l.type === "radio" ? `${yt} ${gt} ${xt}` : `${fe} checkbox-sm ${he}`,
581
- checked: n,
582
- onChange: (f) => Ae(e, t, f.target.checked),
611
+ type: n.type === "radio" ? "radio" : "checkbox",
612
+ className: n.type === "radio" ? `${Lt} ${Ut[H]} ${At}` : `${me} ${Fe[H]} ${xe}`,
613
+ checked: o,
614
+ onChange: ($) => ot(e, t, $.target.checked, $.nativeEvent),
583
615
  "aria-label": `Select row ${t + 1}`,
584
616
  "data-testid": `${p}-row-${t}-select`,
585
- ...u
617
+ ...m
586
618
  }
587
619
  )
588
620
  }
589
621
  ),
590
- b.map((f, _e) => {
591
- const Ce = $e(_e, !1), oe = We(f, e, t);
622
+ y.map(($, pt) => {
623
+ const je = ze(pt, !1), fe = rt($, e, t), he = $.onCell?.(e, t) || {};
592
624
  return /* @__PURE__ */ a(
593
625
  "td",
594
626
  {
595
- className: `${me(f.align)} ${Ce.className} ${f.ellipsis ? "truncate max-w-0" : ""}`,
596
- style: Ce.style,
627
+ ...he,
628
+ className: [Ee($.align), je.className, $.ellipsis ? "truncate max-w-0" : "", $.className, he.className].filter(Boolean).join(" "),
629
+ style: { ...je.style, ...he.style },
597
630
  role: "gridcell",
598
- title: f.ellipsis && typeof oe == "string" ? oe : void 0,
599
- "data-testid": `${p}-row-${t}-${f.key}`,
600
- children: oe
631
+ title: $.ellipsis && typeof fe == "string" ? fe : void 0,
632
+ "data-testid": `${p}-row-${t}-${$.key}`,
633
+ children: fe
601
634
  },
602
- f.key
635
+ $.key
603
636
  );
604
637
  })
605
638
  ]
606
639
  }
607
640
  ),
608
- L && o && /* @__PURE__ */ a(
641
+ Ke && i && /* @__PURE__ */ a(
609
642
  "tr",
610
643
  {
611
- className: "bg-base-200/50",
644
+ className: [
645
+ "bg-base-200/50",
646
+ typeof f.expandedRowClassName == "function" ? f.expandedRowClassName(e, t, i) : f.expandedRowClassName
647
+ ].filter(Boolean).join(" "),
612
648
  role: "row",
613
649
  "data-testid": `${p}-row-${t}-expanded`,
614
650
  children: /* @__PURE__ */ a(
615
651
  "td",
616
652
  {
617
- colSpan: b.length + ke,
653
+ colSpan: y.length + Ie,
618
654
  className: "p-4",
619
655
  role: "gridcell",
620
- children: y.expandedRowRender(e, t, o)
656
+ children: f.expandedRowRender(e, t, i)
621
657
  }
622
658
  )
623
659
  }
624
660
  )
625
661
  ] }, r);
626
- }) })
662
+ }) }),
663
+ Ce && /* @__PURE__ */ a("tfoot", { "data-testid": `${p}-summary`, children: Ce(S) })
627
664
  ]
628
665
  }
629
666
  ) }),
630
- Ze
667
+ ut,
668
+ ke && /* @__PURE__ */ a("div", { className: "text-sm text-base-content/70", "data-testid": `${p}-footer`, children: ke(S) })
631
669
  ] });
632
670
  }
633
- const Dt = Ue(jt);
671
+ const rs = yt(ss);
634
672
  export {
635
- Dt as Table
673
+ rs as Table
636
674
  };
637
675
  //# sourceMappingURL=Table.js.map