@yuno-payments/dashboard-design-system 2.3.4 → 2.3.5

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 (54) hide show
  1. package/dist/components/atoms/checkbox/checkbox.js +16 -16
  2. package/dist/components/atoms/filter/filter-date-range.d.ts +1 -31
  3. package/dist/components/atoms/filter/filter-date-range.js +144 -140
  4. package/dist/components/atoms/filter/filter-multi-input.d.ts +0 -11
  5. package/dist/components/atoms/filter/filter-multi-input.js +36 -42
  6. package/dist/components/atoms/filter/filter.d.ts +0 -30
  7. package/dist/components/atoms/filter/filter.js +171 -191
  8. package/dist/components/atoms/filter/index.d.ts +2 -2
  9. package/dist/components/atoms/filter-dropdown/filter-dropdown.d.ts +2 -17
  10. package/dist/components/atoms/filter-dropdown/filter-dropdown.js +151 -160
  11. package/dist/components/atoms/icon/icon.d.ts +0 -6
  12. package/dist/components/atoms/icon/icon.js +21 -27
  13. package/dist/components/atoms/icon/index.d.ts +0 -1
  14. package/dist/components/atoms/index.d.ts +1 -1
  15. package/dist/components/atoms/radio-group/radio-group-option.js +2 -2
  16. package/dist/components/atoms/select/select.js +2 -2
  17. package/dist/components/molecules/dialog-header/dialog-header.d.ts +1 -1
  18. package/dist/components/molecules/pagination/index.d.ts +0 -1
  19. package/dist/components/molecules/pagination/page-numbers.d.ts +1 -3
  20. package/dist/components/molecules/pagination/page-numbers.js +9 -10
  21. package/dist/components/molecules/pagination/pagination.d.ts +0 -9
  22. package/dist/components/molecules/pagination/pagination.js +38 -46
  23. package/dist/components/organisms/data-table/components/column-header/data-table-column-header-menu.d.ts +1 -3
  24. package/dist/components/organisms/data-table/components/column-header/data-table-column-header-menu.js +27 -28
  25. package/dist/components/organisms/data-table/components/column-header/data-table-column-header.js +41 -44
  26. package/dist/components/organisms/data-table/components/data-table-header.js +12 -11
  27. package/dist/components/organisms/data-table/components/dialogs/data-table-manage-columns-dialog.d.ts +1 -3
  28. package/dist/components/organisms/data-table/components/dialogs/data-table-manage-columns-dialog.js +44 -45
  29. package/dist/components/organisms/data-table/data-table.d.ts +2 -27
  30. package/dist/components/organisms/data-table/data-table.js +134 -146
  31. package/dist/components/organisms/data-table/data-table.types.d.ts +0 -68
  32. package/dist/components/organisms/data-table/index.d.ts +1 -2
  33. package/dist/components/organisms/data-table/utils/data-table-utils.js +8 -11
  34. package/dist/dashboard-design-system.css +1 -1
  35. package/dist/index.css +1 -1
  36. package/dist/index.d.ts +1 -2
  37. package/dist/index.esm.min.js +8512 -9394
  38. package/dist/index.js +202 -208
  39. package/dist/index.umd.min.js +25 -25
  40. package/dist/lib/utils.d.ts +0 -13
  41. package/dist/lib/utils.js +10 -34
  42. package/dist/vendor/shadcn/pagination.d.ts +3 -19
  43. package/dist/vendor/shadcn/pagination.js +37 -41
  44. package/dist/vendor/shadcn/select.js +33 -33
  45. package/dist/vendor/shadcn/switch.js +1 -1
  46. package/package.json +2 -4
  47. package/registry/components-registry.json +12 -38
  48. package/dist/components/atoms/filter/filter-translations.d.ts +0 -75
  49. package/dist/components/atoms/filter/filter-translations.js +0 -450
  50. package/dist/components/atoms/icon/directional-icons.d.ts +0 -12
  51. package/dist/components/atoms/icon/directional-icons.js +0 -38
  52. package/dist/components/molecules/pagination/pagination-translations.d.ts +0 -33
  53. package/dist/components/molecules/pagination/pagination-translations.js +0 -82
  54. package/dist/components/organisms/data-table/data-table.types.js +0 -252
@@ -1,69 +1,68 @@
1
- import { j as l } from "../../../../../_virtual/jsx-runtime.js";
2
- import { useState as y } from "react";
3
- import { getColumnDisplayName as d } from "../../utils/data-table-utils.js";
4
- import { Dialog as C } from "../../../dialog/dialog.js";
5
- import { SearchField as V } from "../../../../atoms/search-field/search-field.js";
6
- import { Switch as j } from "../../../../atoms/switch/switch.js";
1
+ import { j as s } from "../../../../../_virtual/jsx-runtime.js";
2
+ import { useState as x } from "react";
3
+ import { getColumnDisplayName as c } from "../../utils/data-table-utils.js";
4
+ import { Dialog as y } from "../../../dialog/dialog.js";
5
+ import { SearchField as N } from "../../../../atoms/search-field/search-field.js";
6
+ import { Switch as V } from "../../../../atoms/switch/switch.js";
7
7
  function D({
8
- isOpen: m,
9
- onOpenChange: h,
10
- toggleableColumns: t,
11
- visibleColumnsCount: a,
12
- translations: i
8
+ isOpen: d,
9
+ onOpenChange: m,
10
+ toggleableColumns: l,
11
+ visibleColumnsCount: t
13
12
  }) {
14
- const [o, r] = y(""), u = () => {
15
- r(""), h(!1);
16
- }, n = t.filter((e) => d(e).toLowerCase().includes(o.toLowerCase())), p = () => {
17
- t.forEach((e) => e.toggleVisibility(!0));
18
- }, f = () => {
19
- const e = t.filter(
20
- (s) => s.getIsVisible()
13
+ const [a, n] = x(""), h = () => {
14
+ n(""), m(!1);
15
+ }, o = l.filter((e) => c(e).toLowerCase().includes(a.toLowerCase())), u = () => {
16
+ l.forEach((e) => e.toggleVisibility(!0));
17
+ }, p = () => {
18
+ const e = l.filter(
19
+ (i) => i.getIsVisible()
21
20
  );
22
- e.length <= 1 || e.slice(1).forEach((s) => s.toggleVisibility(!1));
23
- }, b = t.every(
21
+ e.length <= 1 || e.slice(1).forEach((i) => i.toggleVisibility(!1));
22
+ }, f = l.every(
24
23
  (e) => e.getIsVisible()
25
- ), g = a <= 1;
26
- return /* @__PURE__ */ l.jsx(
27
- C,
24
+ ), b = t <= 1;
25
+ return /* @__PURE__ */ s.jsx(
26
+ y,
28
27
  {
29
- open: m,
30
- closeIcon: u,
31
- title: i.manageColumns,
28
+ open: d,
29
+ closeIcon: h,
30
+ title: "Manage columns",
32
31
  widthContainer: 400,
33
32
  buttons: [
34
33
  {
35
- children: i.hideAll,
34
+ children: "Hide all",
36
35
  variant: "link",
37
- onClick: f,
38
- disabled: g
36
+ onClick: p,
37
+ disabled: b
39
38
  },
40
39
  {
41
- children: i.showAll,
40
+ children: "Show all",
42
41
  variant: "link",
43
- onClick: p,
44
- disabled: b
42
+ onClick: u,
43
+ disabled: f
45
44
  }
46
45
  ],
47
- children: /* @__PURE__ */ l.jsxs("div", { className: "space-y-4", children: [
48
- /* @__PURE__ */ l.jsx(
49
- V,
46
+ children: /* @__PURE__ */ s.jsxs("div", { className: "space-y-4", children: [
47
+ /* @__PURE__ */ s.jsx(
48
+ N,
50
49
  {
51
- placeholder: i.searchColumns,
52
- value: o,
53
- onSearch: r,
50
+ placeholder: "Search columns...",
51
+ value: a,
52
+ onSearch: n,
54
53
  className: "mb-6"
55
54
  }
56
55
  ),
57
- /* @__PURE__ */ l.jsx("div", { className: "space-y-4 max-h-[300px] overflow-y-auto", children: n.length === 0 ? /* @__PURE__ */ l.jsx("p", { className: "text-sm text-muted-foreground text-center py-4", children: i.noColumnsFound }) : n.map((e) => {
58
- const s = d(e), c = a === 1 && e.getIsVisible();
59
- return /* @__PURE__ */ l.jsx(
60
- j,
56
+ /* @__PURE__ */ s.jsx("div", { className: "space-y-4 max-h-[300px] overflow-y-auto", children: o.length === 0 ? /* @__PURE__ */ s.jsx("p", { className: "text-sm text-muted-foreground text-center py-4", children: "No columns found" }) : o.map((e) => {
57
+ const i = c(e), r = t === 1 && e.getIsVisible();
58
+ return /* @__PURE__ */ s.jsx(
59
+ V,
61
60
  {
62
61
  id: `column-${e.id}`,
63
62
  checked: e.getIsVisible(),
64
- disabled: c,
65
- label: `${s}${c ? ` ${i.lastColumn}` : ""}`,
66
- onChange: (x) => e.toggleVisibility(x.target.checked)
63
+ disabled: r,
64
+ label: `${i}${r ? " (Last column)" : ""}`,
65
+ onChange: (g) => e.toggleVisibility(g.target.checked)
67
66
  },
68
67
  e.id
69
68
  );
@@ -1,5 +1,5 @@
1
1
  import { ColumnResizeMode } from '@tanstack/react-table';
2
- import { DataTableActionsConfig, DataTableColumnDef, DataTableTranslations, DataTableLanguage } from './data-table.types';
2
+ import { DataTableActionsConfig, DataTableColumnDef } from './data-table.types';
3
3
  import { EmptyProps } from '../../molecules';
4
4
  /**
5
5
  * Props for the DataTable component
@@ -117,31 +117,6 @@ export interface DataTableProps<TData, TValue> {
117
117
  * @default false
118
118
  */
119
119
  enableColumnDragDrop?: boolean;
120
- /**
121
- * Language code for translations.
122
- * When provided, uses built-in translations for the specified language.
123
- * @default "en"
124
- */
125
- lang?: DataTableLanguage;
126
- /**
127
- * Translation strings for the column menu and dialogs.
128
- * All fields are optional with English defaults.
129
- * Overrides lang-based translations if both are provided.
130
- *
131
- * @example
132
- * ```tsx
133
- * <DataTable
134
- * lang="es"
135
- * translations={{
136
- * ascending: t('table.ascending'),
137
- * descending: t('table.descending'),
138
- * clearSorting: t('table.clearSorting'),
139
- * // ...
140
- * }}
141
- * />
142
- * ```
143
- */
144
- translations?: DataTableTranslations;
145
120
  }
146
121
  /**
147
122
  * Advanced data table component built on TanStack Table.
@@ -159,4 +134,4 @@ export interface DataTableProps<TData, TValue> {
159
134
  * />
160
135
  * ```
161
136
  */
162
- export declare function DataTable<TData, TValue>({ columns, data, isLoading, empty, checkboxSelection, rowSelection: externalRowSelection, onRowSelectionChange, enableSorting, manualSorting, sorting: externalSorting, onSortingChange: externalOnSortingChange, enableColumnFilters, enableColumnResizing, columnResizeMode, enableColumnPinning, onRowClick, actions, height, rowHeight, className, persistKey, initialSettings, onUpdate, enableColumnDragDrop, lang, translations, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
137
+ export declare function DataTable<TData, TValue>({ columns, data, isLoading, empty, checkboxSelection, rowSelection: externalRowSelection, onRowSelectionChange, enableSorting, manualSorting, sorting: externalSorting, onSortingChange: externalOnSortingChange, enableColumnFilters, enableColumnResizing, columnResizeMode, enableColumnPinning, onRowClick, actions, height, rowHeight, className, persistKey, initialSettings, onUpdate, enableColumnDragDrop, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
@@ -1,222 +1,210 @@
1
- import { j as o } from "../../../_virtual/jsx-runtime.js";
2
- import * as l from "react";
3
- import { useReactTable as ee } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
4
- import { DragDropProvider as te } from "../../../node_modules/@dnd-kit/react/index.js";
5
- import { move as oe } from "../../../node_modules/@dnd-kit/helpers/dist/index.js";
6
- import { Table as ne } from "../../../vendor/shadcn/table.js";
7
- import { cn as R } from "../../../lib/utils.js";
8
- import { getDataTableTranslations as re } from "./data-table.types.js";
9
- import { DataTableLoading as se } from "./components/states/data-table-loading.js";
10
- import { DataTableHeader as ie } from "./components/data-table-header.js";
11
- import { DataTableBody as le } from "./components/data-table-body.js";
12
- import { useDataTableColumns as ae } from "./hooks/use-data-table-columns.js";
13
- import { useDataTableState as me } from "./hooks/use-data-table-state.js";
14
- import { ROW_HEIGHT_DEFAULT as ce } from "./utils/data-table-constants.js";
15
- import { getFilteredRowModel as ue, getSortedRowModel as de, getCoreRowModel as fe } from "../../../node_modules/@tanstack/table-core/build/lib/index.js";
16
- import { Empty as ge } from "../../molecules/empty/empty.js";
17
- function Me({
18
- columns: h,
19
- data: a,
20
- isLoading: E = !1,
21
- empty: F,
22
- checkboxSelection: x = !1,
1
+ import { j as t } from "../../../_virtual/jsx-runtime.js";
2
+ import * as c from "react";
3
+ import { useReactTable as Y } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
4
+ import { DragDropProvider as Z } from "../../../node_modules/@dnd-kit/react/index.js";
5
+ import { move as V } from "../../../node_modules/@dnd-kit/helpers/dist/index.js";
6
+ import { Table as ee } from "../../../vendor/shadcn/table.js";
7
+ import { cn as S } from "../../../lib/utils.js";
8
+ import { DataTableLoading as oe } from "./components/states/data-table-loading.js";
9
+ import { DataTableHeader as te } from "./components/data-table-header.js";
10
+ import { DataTableBody as ne } from "./components/data-table-body.js";
11
+ import { useDataTableColumns as re } from "./hooks/use-data-table-columns.js";
12
+ import { useDataTableState as se } from "./hooks/use-data-table-state.js";
13
+ import { ROW_HEIGHT_DEFAULT as ie } from "./utils/data-table-constants.js";
14
+ import { getFilteredRowModel as le, getSortedRowModel as ae, getCoreRowModel as me } from "../../../node_modules/@tanstack/table-core/build/lib/index.js";
15
+ import { Empty as ce } from "../../molecules/empty/empty.js";
16
+ function Te({
17
+ columns: b,
18
+ data: l,
19
+ isLoading: T = !1,
20
+ empty: w,
21
+ checkboxSelection: h = !1,
23
22
  rowSelection: u,
24
- onRowSelectionChange: m,
25
- enableSorting: M = !0,
26
- manualSorting: O = !1,
27
- sorting: A,
28
- onSortingChange: k,
29
- enableColumnFilters: L = !1,
23
+ onRowSelectionChange: a,
24
+ enableSorting: E = !0,
25
+ manualSorting: R = !1,
26
+ sorting: F,
27
+ onSortingChange: M,
28
+ enableColumnFilters: O = !1,
30
29
  enableColumnResizing: f = !0,
31
- columnResizeMode: P = "onChange",
32
- enableColumnPinning: B = !0,
33
- onRowClick: H,
30
+ columnResizeMode: N = "onChange",
31
+ enableColumnPinning: k = !0,
32
+ onRowClick: A,
34
33
  actions: g,
35
- height: I,
36
- rowHeight: y = ce,
37
- className: N,
38
- persistKey: W,
39
- initialSettings: _,
40
- onUpdate: $,
41
- enableColumnDragDrop: p = !1,
42
- lang: j,
43
- translations: D
34
+ height: L,
35
+ rowHeight: x = ie,
36
+ className: P,
37
+ persistKey: B,
38
+ initialSettings: H,
39
+ onUpdate: I,
40
+ enableColumnDragDrop: p = !1
44
41
  }) {
45
- const C = l.useMemo(
46
- () => ({
47
- ...re(j),
48
- ...D
49
- }),
50
- [j, D]
51
- ), z = ae({
52
- columns: h,
53
- checkboxSelection: x,
42
+ const W = re({
43
+ columns: b,
44
+ checkboxSelection: h,
54
45
  actions: g
55
46
  }), {
56
- sorting: T,
57
- setSorting: v,
58
- columnFilters: G,
59
- setColumnFilters: U,
60
- columnVisibility: q,
61
- setColumnVisibility: J,
47
+ sorting: y,
48
+ setSorting: j,
49
+ columnFilters: _,
50
+ setColumnFilters: $,
51
+ columnVisibility: z,
52
+ setColumnVisibility: G,
62
53
  rowSelection: i,
63
- setRowSelection: K,
64
- columnPinning: Q,
65
- handleColumnPinningChange: X,
54
+ setRowSelection: U,
55
+ columnPinning: q,
56
+ handleColumnPinningChange: J,
66
57
  columnOrder: d,
67
- setColumnOrder: c
68
- } = me({
69
- persistKey: W,
58
+ setColumnOrder: m
59
+ } = se({
60
+ persistKey: B,
70
61
  hasActions: !!g,
71
- externalSorting: A,
72
- onExternalSortingChange: k,
62
+ externalSorting: F,
63
+ onExternalSortingChange: M,
73
64
  externalRowSelection: u,
74
- initialSettings: _,
75
- onUpdate: $,
65
+ initialSettings: H,
66
+ onUpdate: I,
76
67
  enableColumnDragDrop: p
77
- }), r = ee({
78
- data: a,
79
- columns: z,
80
- getCoreRowModel: fe(),
68
+ }), r = Y({
69
+ data: l,
70
+ columns: W,
71
+ getCoreRowModel: me(),
81
72
  enableColumnResizing: f,
82
- columnResizeMode: P,
83
- enableColumnPinning: B,
84
- meta: {
85
- translations: C
86
- },
73
+ columnResizeMode: N,
74
+ enableColumnPinning: k,
87
75
  defaultColumn: {
88
76
  enableSorting: !1,
89
77
  minSize: 50
90
78
  },
91
- ...M && {
79
+ ...E && {
92
80
  onSortingChange: (e) => {
93
- v(typeof e == "function" ? e(T) : e);
81
+ j(typeof e == "function" ? e(y) : e);
94
82
  },
95
- getSortedRowModel: de(),
96
- manualSorting: O
83
+ getSortedRowModel: ae(),
84
+ manualSorting: R
97
85
  },
98
- ...L && {
99
- onColumnFiltersChange: U,
100
- getFilteredRowModel: ue()
86
+ ...O && {
87
+ onColumnFiltersChange: $,
88
+ getFilteredRowModel: le()
101
89
  },
102
- onColumnVisibilityChange: J,
90
+ onColumnVisibilityChange: G,
103
91
  onRowSelectionChange: (e) => {
104
- const t = typeof e == "function" ? e(i) : e;
105
- if (K(t), m && u !== void 0) {
106
- const s = Object.keys(t).filter((n) => t[n]).map((n) => a[parseInt(n)]).filter(Boolean);
107
- m(t, s);
92
+ const o = typeof e == "function" ? e(i) : e;
93
+ if (U(o), a && u !== void 0) {
94
+ const s = Object.keys(o).filter((n) => o[n]).map((n) => l[parseInt(n)]).filter(Boolean);
95
+ a(o, s);
108
96
  }
109
97
  },
110
- onColumnPinningChange: X,
111
- onColumnOrderChange: c,
98
+ onColumnPinningChange: J,
99
+ onColumnOrderChange: m,
112
100
  state: {
113
- sorting: T,
114
- columnFilters: G,
115
- columnVisibility: q,
101
+ sorting: y,
102
+ columnFilters: _,
103
+ columnVisibility: z,
116
104
  rowSelection: i,
117
- columnPinning: Q,
105
+ columnPinning: q,
118
106
  columnOrder: d
119
107
  }
120
108
  });
121
- l.useEffect(() => {
122
- if (m && u === void 0) {
123
- const e = Object.keys(i).filter((t) => i[t]).map((t) => a[parseInt(t)]).filter(Boolean);
124
- m(i, e);
109
+ c.useEffect(() => {
110
+ if (a && u === void 0) {
111
+ const e = Object.keys(i).filter((o) => i[o]).map((o) => l[parseInt(o)]).filter(Boolean);
112
+ a(i, e);
125
113
  }
126
- }, [i, m, a, u]);
127
- const S = l.useRef([]), Y = l.useCallback(() => {
128
- S.current = d.length > 0 ? [...d] : r.getAllLeafColumns().map((e) => e.id);
129
- }, [d, r]), Z = l.useCallback(
114
+ }, [i, a, l, u]);
115
+ const v = c.useRef([]), K = c.useCallback(() => {
116
+ v.current = d.length > 0 ? [...d] : r.getAllLeafColumns().map((e) => e.id);
117
+ }, [d, r]), Q = c.useCallback(
130
118
  (e) => {
131
- c((t) => {
132
- const s = t.length > 0 ? t : r.getAllLeafColumns().map((b) => b.id);
133
- return oe({ columns: s }, e).columns;
119
+ m((o) => {
120
+ const s = o.length > 0 ? o : r.getAllLeafColumns().map((C) => C.id);
121
+ return V({ columns: s }, e).columns;
134
122
  });
135
123
  },
136
- [r, c]
137
- ), V = l.useCallback(
124
+ [r, m]
125
+ ), X = c.useCallback(
138
126
  (e) => {
139
- e.operation.canceled && c(S.current);
127
+ e.operation.canceled && m(v.current);
140
128
  },
141
- [c]
129
+ [m]
142
130
  );
143
- if (E)
144
- return /* @__PURE__ */ o.jsx(
145
- se,
131
+ if (T)
132
+ return /* @__PURE__ */ t.jsx(
133
+ oe,
146
134
  {
147
- columns: h,
148
- checkboxSelection: x,
135
+ columns: b,
136
+ checkboxSelection: h,
149
137
  actions: g,
150
- rowHeight: y
138
+ rowHeight: x
151
139
  }
152
140
  );
153
- if (a.length === 0) {
154
- const e = F || {}, {
155
- title: t,
156
- description: s,
141
+ if (l.length === 0) {
142
+ const e = w || {}, {
143
+ title: o = "No results",
144
+ description: s = "No data available",
157
145
  media: n,
158
- actions: b
146
+ actions: C
159
147
  } = e;
160
- return /* @__PURE__ */ o.jsx(
161
- ge,
148
+ return /* @__PURE__ */ t.jsx(
149
+ ce,
162
150
  {
163
151
  media: n,
164
- title: t ?? C.noResults,
165
- description: s ?? C.noDataAvailable,
166
- actions: b
152
+ title: o,
153
+ description: s,
154
+ actions: C
167
155
  }
168
156
  );
169
157
  }
170
- const w = /* @__PURE__ */ o.jsx("div", { className: R("yuno-data-table space-y-4", N), children: /* @__PURE__ */ o.jsx(
158
+ const D = /* @__PURE__ */ t.jsx("div", { className: S("yuno-data-table space-y-4", P), children: /* @__PURE__ */ t.jsx(
171
159
  "div",
172
160
  {
173
161
  className: "yuno-data-table rounded-md border overflow-x-auto",
174
- style: { height: I || "auto" },
175
- children: /* @__PURE__ */ o.jsxs(ne, { className: R("table-fixed"), children: [
176
- /* @__PURE__ */ o.jsx("colgroup", { children: r.getHeaderGroups()[0]?.headers.map((e) => {
177
- const t = e.column.columnDef.enableResizing === !1, s = e.column.id === "_spacer", n = e.column.getSize();
178
- return s ? /* @__PURE__ */ o.jsx("col", { style: { width: "auto" } }, e.id) : /* @__PURE__ */ o.jsx(
162
+ style: { height: L || "auto" },
163
+ children: /* @__PURE__ */ t.jsxs(ee, { className: S("table-fixed"), children: [
164
+ /* @__PURE__ */ t.jsx("colgroup", { children: r.getHeaderGroups()[0]?.headers.map((e) => {
165
+ const o = e.column.columnDef.enableResizing === !1, s = e.column.id === "_spacer", n = e.column.getSize();
166
+ return s ? /* @__PURE__ */ t.jsx("col", { style: { width: "auto" } }, e.id) : /* @__PURE__ */ t.jsx(
179
167
  "col",
180
168
  {
181
169
  style: {
182
- width: t ? `${n}px` : "auto",
183
- minWidth: t ? `${n}px` : void 0,
184
- maxWidth: t ? `${n}px` : void 0
170
+ width: o ? `${n}px` : "auto",
171
+ minWidth: o ? `${n}px` : void 0,
172
+ maxWidth: o ? `${n}px` : void 0
185
173
  }
186
174
  },
187
175
  e.id
188
176
  );
189
177
  }) }),
190
- /* @__PURE__ */ o.jsx(
191
- ie,
178
+ /* @__PURE__ */ t.jsx(
179
+ te,
192
180
  {
193
181
  table: r,
194
182
  enableColumnResizing: f,
195
183
  enableColumnDragDrop: p
196
184
  }
197
185
  ),
198
- /* @__PURE__ */ o.jsx(
199
- le,
186
+ /* @__PURE__ */ t.jsx(
187
+ ne,
200
188
  {
201
189
  table: r,
202
190
  enableColumnResizing: f,
203
- onRowClick: H,
204
- rowHeight: y
191
+ onRowClick: A,
192
+ rowHeight: x
205
193
  }
206
194
  )
207
195
  ] })
208
196
  }
209
197
  ) });
210
- return p ? /* @__PURE__ */ o.jsx(
211
- te,
198
+ return p ? /* @__PURE__ */ t.jsx(
199
+ Z,
212
200
  {
213
- onDragStart: Y,
214
- onDragOver: Z,
215
- onDragEnd: V,
216
- children: w
201
+ onDragStart: K,
202
+ onDragOver: Q,
203
+ onDragEnd: X,
204
+ children: D
217
205
  }
218
- ) : w;
206
+ ) : D;
219
207
  }
220
208
  export {
221
- Me as DataTable
209
+ Te as DataTable
222
210
  };
@@ -1,77 +1,9 @@
1
1
  import { ColumnDef, RowData, SortingState, VisibilityState, ColumnFiltersState, PaginationState, RowSelectionState, Table, Column, CellContext, HeaderContext } from '@tanstack/react-table';
2
2
  import { IconName } from '../../atoms/icon';
3
3
  import { EmptyProps } from '../../molecules';
4
- /**
5
- * Supported languages for DataTable translations
6
- */
7
- export type DataTableLanguage = "en" | "es" | "ja" | "ar" | "fr" | "pt" | "tr" | "ru" | "de" | "zh";
8
- /**
9
- * Translation strings for the DataTable column menu and dialogs.
10
- * All fields are optional with English defaults.
11
- */
12
- export interface DataTableTranslations {
13
- /** @default "Ascending" */
14
- ascending?: string;
15
- /** @default "Descending" */
16
- descending?: string;
17
- /** @default "Clear sorting" */
18
- clearSorting?: string;
19
- /** @default "Pin to the left" */
20
- pinToLeft?: string;
21
- /** @default "Pin to the right" */
22
- pinToRight?: string;
23
- /** @default "Unpin" */
24
- unpin?: string;
25
- /** @default "Hide" */
26
- hide?: string;
27
- /** @default "(Last column)" */
28
- lastColumn?: string;
29
- /** @default "Manage columns" */
30
- manageColumns?: string;
31
- /** @default "Hide all" */
32
- hideAll?: string;
33
- /** @default "Show all" */
34
- showAll?: string;
35
- /** @default "Search columns..." */
36
- searchColumns?: string;
37
- /** @default "No columns found" */
38
- noColumnsFound?: string;
39
- /** @default "No results" */
40
- noResults?: string;
41
- /** @default "No data available" */
42
- noDataAvailable?: string;
43
- /** @default "Sort ascending" */
44
- sortAscending?: string;
45
- /** @default "Sort descending" */
46
- sortDescending?: string;
47
- /** @default "Pinned column" */
48
- pinnedColumn?: string;
49
- /** @default "Menu" */
50
- menu?: string;
51
- /** @default "Actions" */
52
- actions?: string;
53
- /** @default "Select all" */
54
- selectAll?: string;
55
- /** @default "Select row" */
56
- selectRow?: string;
57
- }
58
- /**
59
- * Default English translations for DataTable
60
- */
61
- export declare const DEFAULT_DATA_TABLE_TRANSLATIONS: Required<DataTableTranslations>;
62
- /**
63
- * All DataTable translations by language code
64
- */
65
- export declare const DATA_TABLE_TRANSLATIONS: Record<DataTableLanguage, Required<DataTableTranslations>>;
66
- /**
67
- * Get translations for a specific language
68
- * Falls back to English if language not found
69
- */
70
- export declare function getDataTableTranslations(lang?: DataTableLanguage): Required<DataTableTranslations>;
71
4
  declare module "@tanstack/react-table" {
72
5
  interface TableMeta<TData extends RowData> {
73
6
  updateData?: (rowIndex: number, columnId: string, value: unknown) => void;
74
- translations?: Required<DataTableTranslations>;
75
7
  }
76
8
  }
77
9
  export interface DataTableActionsConfig<TData> {
@@ -3,6 +3,5 @@ export type { DataTableProps } from './data-table';
3
3
  export { DataTableColumnHeader } from './components/column-header/data-table-column-header';
4
4
  export { DataTableSortIndicator } from './components/column-header/data-table-sort-indicator';
5
5
  export { DataTableListCell } from './components/cells/data-table-list-cell';
6
- export type { DataTableActionsConfig, DataTableColumnDef, DataTableColumnHeaderConfig, DataTableTranslations, DataTableLanguage, } from './data-table.types';
7
- export { DEFAULT_DATA_TABLE_TRANSLATIONS, DATA_TABLE_TRANSLATIONS, getDataTableTranslations, } from './data-table.types';
6
+ export type { DataTableActionsConfig, DataTableColumnDef, DataTableColumnHeaderConfig, } from './data-table.types';
8
7
  export type { DataTableListCellProps, DataTableListCellItem, } from './components/cells/data-table-list-cell';
@@ -1,23 +1,20 @@
1
- function r(e) {
1
+ function f(e) {
2
2
  return typeof e == "object" && e !== null && "title" in e && typeof e.title == "string";
3
3
  }
4
- function f(e) {
4
+ function n(e) {
5
5
  return typeof e.columnDef.header == "string" ? e.columnDef.header : e.columnDef.header && typeof e.columnDef.header == "object" && "title" in e.columnDef.header ? e.columnDef.header.title : e.id;
6
6
  }
7
- function o(e, t, i, n) {
7
+ function o(e, t, i, r) {
8
8
  return e ? {
9
9
  position: "sticky",
10
- // Use logical properties so pinned columns work in both LTR and RTL.
11
- // "left"-pinned columns stick to the inline-start edge,
12
- // "right"-pinned columns (e.g. actions) stick to the inline-end edge.
13
- insetInlineStart: e === "left" ? `${t("left")}px` : void 0,
14
- insetInlineEnd: e === "right" ? `${i("right")}px` : void 0,
10
+ left: e === "left" ? `${t("left")}px` : void 0,
11
+ right: e === "right" ? `${i("right")}px` : void 0,
15
12
  zIndex: 10,
16
- backgroundColor: n
13
+ backgroundColor: r
17
14
  } : {};
18
15
  }
19
16
  export {
20
- f as getColumnDisplayName,
17
+ n as getColumnDisplayName,
21
18
  o as getPinnedStyles,
22
- r as isHeaderConfig
19
+ f as isHeaderConfig
23
20
  };