@tedi-design-system/react 19.0.0-rc.9 → 19.0.1-rc.1
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.
- package/bundle-stats.html +394 -38
- package/index.css +1 -1
- package/package.json +7 -6
- package/src/community/components/card/card.cjs.js +1 -1
- package/src/community/components/card/card.es.js +20 -19
- package/src/community/components/color-tokens.cjs.js +1 -0
- package/src/community/components/color-tokens.d.ts +14 -0
- package/src/community/components/color-tokens.es.js +35 -0
- package/src/community/components/layout/header/components/header-role/header-role.cjs.js +1 -1
- package/src/community/components/layout/header/components/header-role/header-role.es.js +19 -19
- package/src/community/components/layout/header/components/header-role/header-role.module.scss.cjs.js +1 -1
- package/src/community/components/layout/header/components/header-role/header-role.module.scss.es.js +2 -1
- package/src/community/components/map-components/button-group/button-group.cjs.js +1 -1
- package/src/community/components/map-components/button-group/button-group.es.js +18 -14
- package/src/community/components/map-components/map-button/map-button.cjs.js +1 -1
- package/src/community/components/map-components/map-button/map-button.es.js +34 -33
- package/src/community/components/tooltip/tooltip.cjs.js +1 -1
- package/src/community/components/tooltip/tooltip.es.js +31 -30
- package/src/tedi/components/content/list/list-item.cjs.js +1 -1
- package/src/tedi/components/content/list/list-item.d.ts +1 -1
- package/src/tedi/components/content/list/list-item.es.js +8 -8
- package/src/tedi/components/content/list/list.cjs.js +1 -1
- package/src/tedi/components/content/list/list.d.ts +1 -1
- package/src/tedi/components/content/list/list.es.js +29 -23
- package/src/tedi/components/content/list/list.module.scss.cjs.js +1 -1
- package/src/tedi/components/content/list/list.module.scss.es.js +3 -2
- package/src/tedi/components/content/table/table.cjs.js +1 -1
- package/src/tedi/components/content/table/table.es.js +448 -438
- package/src/tedi/components/content/text-group/text-group-list/text-group-list.d.ts +6 -5
- package/src/tedi/components/content/text-group/text-group.d.ts +7 -5
- package/src/tedi/components/form/date-field/date-field.cjs.js +1 -1
- package/src/tedi/components/form/date-field/date-field.d.ts +6 -0
- package/src/tedi/components/form/date-field/date-field.es.js +163 -162
- package/src/tedi/components/form/date-time-field/date-time-field.cjs.js +1 -1
- package/src/tedi/components/form/date-time-field/date-time-field.d.ts +6 -0
- package/src/tedi/components/form/date-time-field/date-time-field.es.js +101 -100
- package/src/tedi/components/form/select/components/select-multi-option.cjs.js +1 -1
- package/src/tedi/components/form/select/components/select-multi-option.es.js +24 -23
- package/src/tedi/components/form/select/components/select-single-option.cjs.js +1 -1
- package/src/tedi/components/form/select/components/select-single-option.es.js +11 -10
- package/src/tedi/components/form/select/select.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/select/select.module.scss.es.js +2 -1
- package/src/tedi/components/form/time-field/time-field.cjs.js +1 -1
- package/src/tedi/components/form/time-field/time-field.d.ts +6 -0
- package/src/tedi/components/form/time-field/time-field.es.js +37 -36
- package/src/tedi/components/form/time-picker/time-picker.cjs.js +1 -1
- package/src/tedi/components/form/time-picker/time-picker.es.js +1 -1
- package/src/tedi/components/layout/vertical-spacing/vertical-spacing-item.cjs.js +1 -1
- package/src/tedi/components/layout/vertical-spacing/vertical-spacing-item.d.ts +5 -0
- package/src/tedi/components/layout/vertical-spacing/vertical-spacing-item.es.js +14 -13
- package/src/tedi/components/layout/vertical-spacing/vertical-spacing.cjs.js +1 -1
- package/src/tedi/components/layout/vertical-spacing/vertical-spacing.d.ts +5 -0
- package/src/tedi/components/layout/vertical-spacing/vertical-spacing.es.js +18 -17
- package/src/tedi/components/misc/ellipsis/ellipsis.cjs.js +1 -1
- package/src/tedi/components/misc/ellipsis/ellipsis.es.js +20 -19
- package/src/tedi/components/misc/timeline/timeline.cjs.js +1 -1
- package/src/tedi/components/misc/timeline/timeline.es.js +24 -27
- package/src/tedi/components/overlays/overlay/overlay-content.cjs.js +1 -1
- package/src/tedi/components/overlays/overlay/overlay-content.d.ts +6 -1
- package/src/tedi/components/overlays/overlay/overlay-content.es.js +28 -27
- package/src/tedi/components/overlays/overlay/overlay.cjs.js +1 -1
- package/src/tedi/components/overlays/overlay/overlay.es.js +29 -28
- package/src/tedi/components/overlays/popover/popover-content.cjs.js +1 -1
- package/src/tedi/components/overlays/popover/popover-content.d.ts +7 -0
- package/src/tedi/components/overlays/popover/popover-content.es.js +47 -36
- package/src/tedi/helpers/index.d.ts +1 -0
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +21 -0
- package/src/tedi/providers/label-provider/labels-map.es.js +21 -0
|
@@ -1,198 +1,202 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useReactTable as
|
|
1
|
+
import { jsx as i, jsxs as ue } from "react/jsx-runtime";
|
|
2
|
+
import { useReactTable as Dn, flexRender as De } from "../../../../../external/@tanstack/react-table/build/lib/index.es.js";
|
|
3
3
|
import k from "../../../../../external/classnames/index.es.js";
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { CollapseButton as
|
|
7
|
-
import { Checkbox as
|
|
8
|
-
import { Radio as
|
|
9
|
-
import { TextField as
|
|
4
|
+
import { useRef as U, useId as Rn, useMemo as v, useCallback as N, useState as K, useEffect as Ye, Fragment as yn } from "react";
|
|
5
|
+
import { Icon as Qe } from "../../base/icon/icon.es.js";
|
|
6
|
+
import { CollapseButton as In } from "../../buttons/collapse-button/collapse-button.es.js";
|
|
7
|
+
import { Checkbox as Rt } from "../../form/checkbox/checkbox.es.js";
|
|
8
|
+
import { Radio as kn } from "../../form/radio/radio.es.js";
|
|
9
|
+
import { TextField as En } from "../../form/textfield/textfield.es.js";
|
|
10
10
|
import l from "./table.module.scss.es.js";
|
|
11
|
-
import { TableColumnsMenu as
|
|
12
|
-
import { TableContext as
|
|
13
|
-
import { TableHeaderButton as
|
|
14
|
-
import { TableToolbar as
|
|
15
|
-
import { useTablePersistence as
|
|
16
|
-
import { useLabels as
|
|
17
|
-
import { getCoreRowModel as
|
|
18
|
-
import { Pagination as
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
let
|
|
25
|
-
for (let
|
|
26
|
-
|
|
27
|
-
return
|
|
28
|
-
},
|
|
11
|
+
import { TableColumnsMenu as Tn } from "./table-columns-menu/table-columns-menu.es.js";
|
|
12
|
+
import { TableContext as Nn } from "./table-context.es.js";
|
|
13
|
+
import { TableHeaderButton as On } from "./table-header-button/table-header-button.es.js";
|
|
14
|
+
import { TableToolbar as Ln } from "./table-toolbar/table-toolbar.es.js";
|
|
15
|
+
import { useTablePersistence as $n } from "./use-table-persistence.es.js";
|
|
16
|
+
import { useLabels as Pn } from "../../../providers/label-provider/use-labels.es.js";
|
|
17
|
+
import { getCoreRowModel as An, getFilteredRowModel as Fn, getSortedRowModel as zn, getExpandedRowModel as Bn, getPaginationRowModel as Un } from "../../../../../external/@tanstack/table-core/build/lib/index.es.js";
|
|
18
|
+
import { Pagination as Kn } from "../../navigation/pagination/pagination.es.js";
|
|
19
|
+
const uo = (R, E) => (M) => {
|
|
20
|
+
const _ = M.index;
|
|
21
|
+
if (_ < 0 || _ >= R.length) return 1;
|
|
22
|
+
const O = E(R[_]);
|
|
23
|
+
if (_ > 0 && E(R[_ - 1]) === O) return 0;
|
|
24
|
+
let y = 1;
|
|
25
|
+
for (let V = _ + 1; V < R.length && E(R[V]) === O; V++)
|
|
26
|
+
y++;
|
|
27
|
+
return y;
|
|
28
|
+
}, yt = "data-tedi-drag-handle", Vn = ({
|
|
29
29
|
label: R,
|
|
30
30
|
onHandlePointerDown: E,
|
|
31
|
-
id:
|
|
32
|
-
pickedUp:
|
|
33
|
-
onKeyDown:
|
|
34
|
-
}) => /* @__PURE__ */
|
|
31
|
+
id: M,
|
|
32
|
+
pickedUp: _,
|
|
33
|
+
onKeyDown: O
|
|
34
|
+
}) => /* @__PURE__ */ i(
|
|
35
35
|
"button",
|
|
36
36
|
{
|
|
37
37
|
type: "button",
|
|
38
|
-
id:
|
|
38
|
+
id: M,
|
|
39
39
|
className: k(l["tedi-table__drag-handle"], {
|
|
40
|
-
[l["tedi-table__drag-handle--picked-up"]]:
|
|
40
|
+
[l["tedi-table__drag-handle--picked-up"]]: _
|
|
41
41
|
}),
|
|
42
42
|
"aria-label": R,
|
|
43
|
-
"aria-pressed":
|
|
44
|
-
onClick: (
|
|
43
|
+
"aria-pressed": _,
|
|
44
|
+
onClick: (y) => y.stopPropagation(),
|
|
45
45
|
onMouseDown: E,
|
|
46
46
|
onTouchStart: E,
|
|
47
|
-
onKeyDown:
|
|
48
|
-
[
|
|
49
|
-
children: /* @__PURE__ */
|
|
47
|
+
onKeyDown: O,
|
|
48
|
+
[yt]: "",
|
|
49
|
+
children: /* @__PURE__ */ i(Qe, { name: "drag_indicator", size: 18, color: "inherit" })
|
|
50
50
|
}
|
|
51
|
-
),
|
|
51
|
+
), Hn = (R) => {
|
|
52
52
|
const {
|
|
53
53
|
row: E,
|
|
54
|
-
rowClassName:
|
|
55
|
-
rowStyle:
|
|
56
|
-
isActiveRow:
|
|
57
|
-
clickable:
|
|
58
|
-
onClick:
|
|
54
|
+
rowClassName: M,
|
|
55
|
+
rowStyle: _,
|
|
56
|
+
isActiveRow: O,
|
|
57
|
+
clickable: y,
|
|
58
|
+
onClick: V,
|
|
59
59
|
onKeyDownHandler: ye,
|
|
60
60
|
ariaRowIndex: Ie,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
ariaExpanded: ke,
|
|
62
|
+
ariaControls: Ee,
|
|
63
|
+
columnProps: J,
|
|
64
|
+
draggable: me,
|
|
65
|
+
dragHandleLabel: Te,
|
|
64
66
|
dragHandlers: u,
|
|
65
|
-
dragHandleId:
|
|
66
|
-
dragHandlePickedUp:
|
|
67
|
-
dragOverColumnId:
|
|
67
|
+
dragHandleId: Ne,
|
|
68
|
+
dragHandlePickedUp: Oe,
|
|
69
|
+
dragOverColumnId: Q
|
|
68
70
|
} = R;
|
|
69
|
-
return /* @__PURE__ */
|
|
71
|
+
return /* @__PURE__ */ i(
|
|
70
72
|
"tr",
|
|
71
73
|
{
|
|
72
|
-
className:
|
|
73
|
-
style:
|
|
74
|
-
draggable:
|
|
74
|
+
className: M,
|
|
75
|
+
style: _,
|
|
76
|
+
draggable: me || void 0,
|
|
75
77
|
onDragStart: u == null ? void 0 : u.onDragStart,
|
|
76
78
|
onDragOver: u == null ? void 0 : u.onDragOver,
|
|
77
79
|
onDragLeave: u == null ? void 0 : u.onDragLeave,
|
|
78
80
|
onDragEnd: u == null ? void 0 : u.onDragEnd,
|
|
79
81
|
onDrop: u == null ? void 0 : u.onDrop,
|
|
80
|
-
onClick:
|
|
81
|
-
onKeyDown:
|
|
82
|
-
tabIndex:
|
|
83
|
-
role:
|
|
84
|
-
"aria-rowindex": Ie,
|
|
85
|
-
"aria-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
onClick: y && V ? () => V(E) : void 0,
|
|
83
|
+
onKeyDown: y ? ye : void 0,
|
|
84
|
+
tabIndex: y ? 0 : void 0,
|
|
85
|
+
role: y ? "button" : void 0,
|
|
86
|
+
"aria-rowindex": y ? void 0 : Ie,
|
|
87
|
+
"aria-expanded": ke,
|
|
88
|
+
"aria-controls": Ee,
|
|
89
|
+
"aria-current": O ? "true" : void 0,
|
|
90
|
+
children: E.getVisibleCells().map((T) => {
|
|
91
|
+
var ie;
|
|
92
|
+
const g = T.column.columnDef.meta, $ = J == null ? void 0 : J(T.column.id), P = me && T.column.id === Re, pe = !!Q && T.column.id === Q, Z = (ie = g == null ? void 0 : g.rowSpan) == null ? void 0 : ie.call(g, T.row);
|
|
93
|
+
return Z === 0 ? null : /* @__PURE__ */ i(
|
|
90
94
|
"td",
|
|
91
95
|
{
|
|
92
|
-
rowSpan:
|
|
96
|
+
rowSpan: Z && Z > 1 ? Z : void 0,
|
|
93
97
|
className: k(
|
|
94
98
|
l["tedi-table__cell"],
|
|
95
99
|
{
|
|
96
100
|
[l[`tedi-table__cell--align-${g == null ? void 0 : g.align}`]]: g == null ? void 0 : g.align,
|
|
97
101
|
[l[`tedi-table__cell--valign-${g == null ? void 0 : g.vAlign}`]]: g == null ? void 0 : g.vAlign,
|
|
98
|
-
[l["tedi-table__cell--drag-handle"]]:
|
|
99
|
-
[l["tedi-table__cell--drag-over"]]:
|
|
102
|
+
[l["tedi-table__cell--drag-handle"]]: P,
|
|
103
|
+
[l["tedi-table__cell--drag-over"]]: pe
|
|
100
104
|
},
|
|
101
|
-
|
|
105
|
+
$ == null ? void 0 : $.className
|
|
102
106
|
),
|
|
103
|
-
style:
|
|
104
|
-
children:
|
|
105
|
-
|
|
107
|
+
style: $ == null ? void 0 : $.style,
|
|
108
|
+
children: P ? /* @__PURE__ */ i(
|
|
109
|
+
Vn,
|
|
106
110
|
{
|
|
107
|
-
label:
|
|
111
|
+
label: Te,
|
|
108
112
|
onHandlePointerDown: (u == null ? void 0 : u.onHandlePointerDown) ?? (() => {
|
|
109
113
|
}),
|
|
110
114
|
onKeyDown: u == null ? void 0 : u.onKeyDown,
|
|
111
|
-
id:
|
|
112
|
-
pickedUp:
|
|
115
|
+
id: Ne,
|
|
116
|
+
pickedUp: Oe
|
|
113
117
|
}
|
|
114
|
-
) : De(
|
|
118
|
+
) : De(T.column.columnDef.cell, T.getContext())
|
|
115
119
|
},
|
|
116
|
-
|
|
120
|
+
T.id
|
|
117
121
|
);
|
|
118
122
|
})
|
|
119
123
|
}
|
|
120
124
|
);
|
|
121
|
-
},
|
|
122
|
-
text:
|
|
123
|
-
select:
|
|
124
|
-
"multi-select":
|
|
125
|
-
"date-range":
|
|
126
|
-
"date-range-period":
|
|
125
|
+
}, qe = "__select__", Je = "__expand__", Re = "__drag__", ge = () => !0, Gn = {
|
|
126
|
+
text: ge,
|
|
127
|
+
select: ge,
|
|
128
|
+
"multi-select": ge,
|
|
129
|
+
"date-range": ge,
|
|
130
|
+
"date-range-period": ge
|
|
127
131
|
};
|
|
128
|
-
function
|
|
132
|
+
function Mn(R) {
|
|
129
133
|
return Array.isArray(R.columns);
|
|
130
134
|
}
|
|
131
|
-
function
|
|
135
|
+
function It(R) {
|
|
132
136
|
const {
|
|
133
137
|
id: E,
|
|
134
|
-
data:
|
|
135
|
-
columns:
|
|
136
|
-
size:
|
|
137
|
-
caption:
|
|
138
|
-
state:
|
|
138
|
+
data: M,
|
|
139
|
+
columns: _,
|
|
140
|
+
size: O = "medium",
|
|
141
|
+
caption: y,
|
|
142
|
+
state: V,
|
|
139
143
|
defaultState: ye,
|
|
140
144
|
onStateChange: Ie,
|
|
141
|
-
persist:
|
|
142
|
-
emptyState:
|
|
143
|
-
emptyStateRole:
|
|
144
|
-
className:
|
|
145
|
-
children:
|
|
146
|
-
striped:
|
|
147
|
-
verticalBorders:
|
|
148
|
-
borderless:
|
|
149
|
-
stickyFirstColumn:
|
|
150
|
-
stickyLastColumn:
|
|
151
|
-
stickyHeader:
|
|
152
|
-
maxHeight:
|
|
153
|
-
onRowClick:
|
|
154
|
-
activeRowId:
|
|
155
|
-
rowHover:
|
|
156
|
-
enableRowSelection:
|
|
157
|
-
selectionMode:
|
|
158
|
-
highlightSelectedRows:
|
|
159
|
-
enableColumnFilters:
|
|
160
|
-
renderSubComponent:
|
|
161
|
-
getRowCanExpand:
|
|
162
|
-
getSubRows:
|
|
163
|
-
getRowId:
|
|
164
|
-
expandTrigger:
|
|
165
|
-
paginateExpandedRows:
|
|
166
|
-
pagination:
|
|
167
|
-
autoResetPageIndex:
|
|
168
|
-
manualPagination:
|
|
169
|
-
manualSorting:
|
|
170
|
-
manualFiltering:
|
|
171
|
-
pageCount:
|
|
172
|
-
rowCount:
|
|
173
|
-
checkboxProps:
|
|
174
|
-
radioProps:
|
|
175
|
-
collapseProps:
|
|
176
|
-
rowProps:
|
|
177
|
-
columnProps:
|
|
145
|
+
persist: ke,
|
|
146
|
+
emptyState: Ee,
|
|
147
|
+
emptyStateRole: J,
|
|
148
|
+
className: me,
|
|
149
|
+
children: Te,
|
|
150
|
+
striped: u = !1,
|
|
151
|
+
verticalBorders: Ne = !1,
|
|
152
|
+
borderless: Oe = !1,
|
|
153
|
+
stickyFirstColumn: Q = !1,
|
|
154
|
+
stickyLastColumn: T = !1,
|
|
155
|
+
stickyHeader: g = !1,
|
|
156
|
+
maxHeight: $,
|
|
157
|
+
onRowClick: P,
|
|
158
|
+
activeRowId: pe,
|
|
159
|
+
rowHover: Z,
|
|
160
|
+
enableRowSelection: ie,
|
|
161
|
+
selectionMode: Le = "multiple",
|
|
162
|
+
highlightSelectedRows: kt = !0,
|
|
163
|
+
enableColumnFilters: $e = !1,
|
|
164
|
+
renderSubComponent: W,
|
|
165
|
+
getRowCanExpand: Ze,
|
|
166
|
+
getSubRows: et,
|
|
167
|
+
getRowId: Et,
|
|
168
|
+
expandTrigger: Pe = "button",
|
|
169
|
+
paginateExpandedRows: Tt = !1,
|
|
170
|
+
pagination: j,
|
|
171
|
+
autoResetPageIndex: Nt,
|
|
172
|
+
manualPagination: X = !1,
|
|
173
|
+
manualSorting: Ae = !1,
|
|
174
|
+
manualFiltering: Fe = !1,
|
|
175
|
+
pageCount: tt,
|
|
176
|
+
rowCount: fe,
|
|
177
|
+
checkboxProps: ze,
|
|
178
|
+
radioProps: nt,
|
|
179
|
+
collapseProps: ot,
|
|
180
|
+
rowProps: Be,
|
|
181
|
+
columnProps: Y,
|
|
178
182
|
reorderableRows: S = !1,
|
|
179
|
-
onRowDrop:
|
|
180
|
-
reorderableColumns:
|
|
181
|
-
} = R, { getLabel: b } =
|
|
182
|
-
|
|
183
|
-
const
|
|
184
|
-
pageSize:
|
|
185
|
-
pageSizeOptions:
|
|
186
|
-
paginationProps:
|
|
187
|
-
} : null, [
|
|
183
|
+
onRowDrop: L,
|
|
184
|
+
reorderableColumns: ee = !1
|
|
185
|
+
} = R, { getLabel: b } = Pn(), lt = Ee ?? b("table.no-data"), A = U(b);
|
|
186
|
+
A.current = b;
|
|
187
|
+
const Ot = Rn(), m = E ?? Ot, h = v(() => j ? j === !0 ? { pageSize: 10, pageSizeOptions: [10, 25, 50], paginationProps: void 0 } : {
|
|
188
|
+
pageSize: j.pageSize ?? 10,
|
|
189
|
+
pageSizeOptions: j.pageSizeOptions === void 0 ? [10, 25, 50] : j.pageSizeOptions,
|
|
190
|
+
paginationProps: j.paginationProps
|
|
191
|
+
} : null, [j]), I = h !== null, Lt = v(() => {
|
|
188
192
|
const e = h == null ? void 0 : h.pageSizeOptions;
|
|
189
193
|
return Array.isArray(e) && e.length > 0 ? e : void 0;
|
|
190
|
-
}, [h]), [F, D] =
|
|
191
|
-
persist:
|
|
192
|
-
controlled:
|
|
194
|
+
}, [h]), [F, D] = $n({
|
|
195
|
+
persist: ke,
|
|
196
|
+
controlled: V,
|
|
193
197
|
defaultState: ye,
|
|
194
198
|
onStateChange: Ie
|
|
195
|
-
}),
|
|
199
|
+
}), $t = N(
|
|
196
200
|
(e) => {
|
|
197
201
|
D((n) => {
|
|
198
202
|
const t = n.columnVisibility ?? {};
|
|
@@ -200,7 +204,7 @@ function St(R) {
|
|
|
200
204
|
});
|
|
201
205
|
},
|
|
202
206
|
[D]
|
|
203
|
-
),
|
|
207
|
+
), Pt = N(
|
|
204
208
|
(e) => {
|
|
205
209
|
D((n) => {
|
|
206
210
|
const t = n.rowSelection ?? {};
|
|
@@ -208,7 +212,7 @@ function St(R) {
|
|
|
208
212
|
});
|
|
209
213
|
},
|
|
210
214
|
[D]
|
|
211
|
-
),
|
|
215
|
+
), At = N(
|
|
212
216
|
(e) => {
|
|
213
217
|
D((n) => {
|
|
214
218
|
const t = n.expanded ?? {};
|
|
@@ -216,7 +220,7 @@ function St(R) {
|
|
|
216
220
|
});
|
|
217
221
|
},
|
|
218
222
|
[D]
|
|
219
|
-
),
|
|
223
|
+
), Ft = N(
|
|
220
224
|
(e) => {
|
|
221
225
|
D((n) => {
|
|
222
226
|
const t = n.columnFilters ?? [];
|
|
@@ -224,7 +228,7 @@ function St(R) {
|
|
|
224
228
|
});
|
|
225
229
|
},
|
|
226
230
|
[D]
|
|
227
|
-
),
|
|
231
|
+
), zt = N(
|
|
228
232
|
(e) => {
|
|
229
233
|
D((n) => {
|
|
230
234
|
const t = n.columnOrder ?? [];
|
|
@@ -232,7 +236,7 @@ function St(R) {
|
|
|
232
236
|
});
|
|
233
237
|
},
|
|
234
238
|
[D]
|
|
235
|
-
),
|
|
239
|
+
), Bt = N(
|
|
236
240
|
(e) => {
|
|
237
241
|
D((n) => {
|
|
238
242
|
const t = n.sorting ?? [];
|
|
@@ -240,7 +244,7 @@ function St(R) {
|
|
|
240
244
|
});
|
|
241
245
|
},
|
|
242
246
|
[D]
|
|
243
|
-
),
|
|
247
|
+
), Ut = N(
|
|
244
248
|
(e) => {
|
|
245
249
|
D((n) => {
|
|
246
250
|
const t = n.pagination ?? {
|
|
@@ -251,10 +255,10 @@ function St(R) {
|
|
|
251
255
|
});
|
|
252
256
|
},
|
|
253
257
|
[D, h]
|
|
254
|
-
),
|
|
255
|
-
() =>
|
|
256
|
-
[
|
|
257
|
-
),
|
|
258
|
+
), se = !!(W || et), at = !!ie, Kt = v(() => An(), []), Vt = v(() => Fe ? void 0 : Fn(), [Fe]), Ht = v(() => Ae ? void 0 : zn(), [Ae]), Gt = v(() => se ? Bn() : void 0, [se]), Mt = v(
|
|
259
|
+
() => I && !X ? Un() : void 0,
|
|
260
|
+
[I, X]
|
|
261
|
+
), Wt = v(() => {
|
|
258
262
|
const e = [];
|
|
259
263
|
if (S && e.push({
|
|
260
264
|
id: Re,
|
|
@@ -263,88 +267,91 @@ function St(R) {
|
|
|
263
267
|
enableColumnFilter: !1,
|
|
264
268
|
size: 40,
|
|
265
269
|
header: "",
|
|
270
|
+
meta: { label: A.current("table.reorder-column") },
|
|
266
271
|
cell: () => null
|
|
267
|
-
}),
|
|
268
|
-
const n =
|
|
272
|
+
}), at) {
|
|
273
|
+
const n = Le === "single", t = `${m}-select`;
|
|
269
274
|
e.push({
|
|
270
|
-
id:
|
|
275
|
+
id: qe,
|
|
271
276
|
enableSorting: !1,
|
|
272
277
|
enableHiding: !1,
|
|
273
278
|
enableColumnFilter: !1,
|
|
274
279
|
size: 40,
|
|
275
|
-
|
|
276
|
-
|
|
280
|
+
meta: { label: A.current("table.select-column") },
|
|
281
|
+
header: n ? "" : ({ table: o }) => /* @__PURE__ */ i(
|
|
282
|
+
Rt,
|
|
277
283
|
{
|
|
278
|
-
...
|
|
284
|
+
...ze,
|
|
279
285
|
id: `${m}-select-all`,
|
|
280
286
|
name: `${m}-select-all`,
|
|
281
|
-
label:
|
|
287
|
+
label: A.current("table.select-all", o.getIsAllPageRowsSelected()),
|
|
282
288
|
hideLabel: !0,
|
|
283
289
|
value: "all",
|
|
284
290
|
checked: o.getIsAllPageRowsSelected(),
|
|
285
291
|
indeterminate: o.getIsSomePageRowsSelected() && !o.getIsAllPageRowsSelected(),
|
|
286
|
-
onChange: (a,
|
|
292
|
+
onChange: (a, r) => o.toggleAllPageRowsSelected(r)
|
|
287
293
|
}
|
|
288
294
|
),
|
|
289
|
-
cell: ({ row: o }) => n ? /* @__PURE__ */
|
|
290
|
-
|
|
295
|
+
cell: ({ row: o }) => n ? /* @__PURE__ */ i(
|
|
296
|
+
kn,
|
|
291
297
|
{
|
|
292
|
-
...
|
|
298
|
+
...nt,
|
|
293
299
|
id: `${m}-select-${o.id}`,
|
|
294
300
|
name: t,
|
|
295
|
-
label:
|
|
301
|
+
label: A.current("table.select-row", o.getIsSelected()),
|
|
296
302
|
hideLabel: !0,
|
|
297
303
|
value: o.id,
|
|
298
304
|
checked: o.getIsSelected(),
|
|
299
305
|
disabled: !o.getCanSelect(),
|
|
300
|
-
onChange: (a,
|
|
301
|
-
|
|
306
|
+
onChange: (a, r) => {
|
|
307
|
+
r && o.toggleSelected(!0);
|
|
302
308
|
}
|
|
303
309
|
}
|
|
304
|
-
) : /* @__PURE__ */
|
|
305
|
-
|
|
310
|
+
) : /* @__PURE__ */ i(
|
|
311
|
+
Rt,
|
|
306
312
|
{
|
|
307
|
-
...
|
|
313
|
+
...ze,
|
|
308
314
|
id: `${m}-select-${o.id}`,
|
|
309
315
|
name: `${m}-select-${o.id}`,
|
|
310
|
-
label:
|
|
316
|
+
label: A.current("table.select-row", o.getIsSelected()),
|
|
311
317
|
hideLabel: !0,
|
|
312
318
|
value: o.id,
|
|
313
319
|
checked: o.getIsSelected(),
|
|
314
320
|
disabled: !o.getCanSelect(),
|
|
315
321
|
indeterminate: o.getIsSomeSelected(),
|
|
316
|
-
onChange: (a,
|
|
322
|
+
onChange: (a, r) => o.toggleSelected(r)
|
|
317
323
|
}
|
|
318
324
|
)
|
|
319
325
|
});
|
|
320
326
|
}
|
|
321
|
-
return
|
|
322
|
-
id:
|
|
327
|
+
return se && e.push({
|
|
328
|
+
id: Je,
|
|
323
329
|
enableSorting: !1,
|
|
324
330
|
enableHiding: !1,
|
|
325
331
|
enableColumnFilter: !1,
|
|
326
332
|
size: 40,
|
|
327
333
|
header: "",
|
|
334
|
+
meta: { label: A.current("table.expand-column") },
|
|
328
335
|
cell: ({ row: n }) => {
|
|
329
336
|
if (!n.getCanExpand()) return null;
|
|
330
337
|
const t = `${m}-sub-${n.id}`;
|
|
331
|
-
return /* @__PURE__ */
|
|
338
|
+
return Pe === "row" ? /* @__PURE__ */ i(Qe, { name: n.getIsExpanded() ? "expand_less" : "expand_more", size: 24, filled: !0, color: "brand" }) : /* @__PURE__ */ i(
|
|
332
339
|
"span",
|
|
333
340
|
{
|
|
334
341
|
onClick: (o) => o.stopPropagation(),
|
|
335
342
|
onKeyDown: (o) => {
|
|
336
343
|
(o.key === "Enter" || o.key === " ") && o.stopPropagation();
|
|
337
344
|
},
|
|
338
|
-
children: /* @__PURE__ */
|
|
339
|
-
|
|
345
|
+
children: /* @__PURE__ */ i(
|
|
346
|
+
In,
|
|
340
347
|
{
|
|
341
|
-
arrowType:
|
|
342
|
-
...
|
|
348
|
+
arrowType: "secondary",
|
|
349
|
+
...ot,
|
|
343
350
|
hideText: !0,
|
|
344
351
|
id: `${m}-expand-${n.id}`,
|
|
345
|
-
"aria-controls":
|
|
346
|
-
openText:
|
|
347
|
-
closeText:
|
|
352
|
+
"aria-controls": W ? t : void 0,
|
|
353
|
+
openText: A.current("table.expand-row"),
|
|
354
|
+
closeText: A.current("table.collapse-row"),
|
|
348
355
|
open: n.getIsExpanded(),
|
|
349
356
|
onOpenChange: () => n.toggleExpanded()
|
|
350
357
|
}
|
|
@@ -352,309 +359,309 @@ function St(R) {
|
|
|
352
359
|
}
|
|
353
360
|
);
|
|
354
361
|
}
|
|
355
|
-
}), [...e, ...
|
|
362
|
+
}), [...e, ..._];
|
|
356
363
|
}, [
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
364
|
+
_,
|
|
365
|
+
at,
|
|
366
|
+
Le,
|
|
367
|
+
se,
|
|
368
|
+
W,
|
|
369
|
+
Pe,
|
|
363
370
|
S,
|
|
364
371
|
m,
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
]),
|
|
372
|
+
ze,
|
|
373
|
+
nt,
|
|
374
|
+
ot
|
|
375
|
+
]), jt = v(() => ({}), []), Xt = v(() => ({}), []), Yt = v(() => [], []), qt = v(() => [], []), Jt = v(() => [], []), Qt = v(
|
|
369
376
|
() => ({ pageIndex: 0, pageSize: (h == null ? void 0 : h.pageSize) ?? 10 }),
|
|
370
377
|
[h]
|
|
371
|
-
), d =
|
|
372
|
-
data:
|
|
373
|
-
columns:
|
|
378
|
+
), d = Dn({
|
|
379
|
+
data: M,
|
|
380
|
+
columns: Wt,
|
|
374
381
|
state: {
|
|
375
382
|
columnVisibility: F.columnVisibility,
|
|
376
|
-
columnOrder: F.columnOrder ??
|
|
377
|
-
rowSelection: F.rowSelection ??
|
|
378
|
-
expanded: F.expanded ??
|
|
379
|
-
columnFilters: F.columnFilters ??
|
|
380
|
-
sorting: F.sorting ??
|
|
381
|
-
pagination:
|
|
383
|
+
columnOrder: F.columnOrder ?? qt,
|
|
384
|
+
rowSelection: F.rowSelection ?? jt,
|
|
385
|
+
expanded: F.expanded ?? Xt,
|
|
386
|
+
columnFilters: F.columnFilters ?? Yt,
|
|
387
|
+
sorting: F.sorting ?? Jt,
|
|
388
|
+
pagination: I ? F.pagination ?? Qt : void 0
|
|
382
389
|
},
|
|
383
|
-
enableRowSelection:
|
|
384
|
-
enableMultiRowSelection:
|
|
385
|
-
enableColumnFilters:
|
|
386
|
-
autoResetPageIndex:
|
|
387
|
-
paginateExpandedRows:
|
|
388
|
-
manualPagination:
|
|
389
|
-
manualSorting:
|
|
390
|
-
manualFiltering:
|
|
390
|
+
enableRowSelection: ie,
|
|
391
|
+
enableMultiRowSelection: Le !== "single",
|
|
392
|
+
enableColumnFilters: $e,
|
|
393
|
+
autoResetPageIndex: Nt ?? !X,
|
|
394
|
+
paginateExpandedRows: I && !X ? Tt : !0,
|
|
395
|
+
manualPagination: X,
|
|
396
|
+
manualSorting: Ae,
|
|
397
|
+
manualFiltering: Fe,
|
|
391
398
|
// `pageCount` only matters in manual mode; TanStack ignores it otherwise.
|
|
392
|
-
pageCount:
|
|
393
|
-
rowCount:
|
|
394
|
-
getRowCanExpand:
|
|
395
|
-
getSubRows:
|
|
396
|
-
getRowId:
|
|
397
|
-
onColumnVisibilityChange:
|
|
398
|
-
onColumnOrderChange:
|
|
399
|
-
onRowSelectionChange:
|
|
400
|
-
onExpandedChange:
|
|
401
|
-
onColumnFiltersChange:
|
|
402
|
-
onSortingChange:
|
|
403
|
-
onPaginationChange:
|
|
404
|
-
filterFns:
|
|
405
|
-
getCoreRowModel:
|
|
406
|
-
getFilteredRowModel:
|
|
407
|
-
getExpandedRowModel:
|
|
408
|
-
getSortedRowModel:
|
|
409
|
-
getPaginationRowModel:
|
|
410
|
-
}),
|
|
411
|
-
() => ({ table: d, size:
|
|
412
|
-
[d,
|
|
413
|
-
),
|
|
414
|
-
|
|
415
|
-
const e =
|
|
416
|
-
if (!e || !
|
|
399
|
+
pageCount: X && tt !== void 0 ? tt : void 0,
|
|
400
|
+
rowCount: X && fe !== void 0 ? fe : void 0,
|
|
401
|
+
getRowCanExpand: W ? Ze ?? (() => !0) : Ze,
|
|
402
|
+
getSubRows: et,
|
|
403
|
+
getRowId: Et,
|
|
404
|
+
onColumnVisibilityChange: $t,
|
|
405
|
+
onColumnOrderChange: zt,
|
|
406
|
+
onRowSelectionChange: Pt,
|
|
407
|
+
onExpandedChange: At,
|
|
408
|
+
onColumnFiltersChange: Ft,
|
|
409
|
+
onSortingChange: Bt,
|
|
410
|
+
onPaginationChange: I ? Ut : void 0,
|
|
411
|
+
filterFns: Gn,
|
|
412
|
+
getCoreRowModel: Kt,
|
|
413
|
+
getFilteredRowModel: Vt,
|
|
414
|
+
getExpandedRowModel: Gt,
|
|
415
|
+
getSortedRowModel: Ht,
|
|
416
|
+
getPaginationRowModel: Mt
|
|
417
|
+
}), Zt = v(
|
|
418
|
+
() => ({ table: d, size: O, id: m, state: F }),
|
|
419
|
+
[d, O, m, F]
|
|
420
|
+
), be = U(null), [rt, en] = K({ left: !1, right: !1 }), it = Q || T;
|
|
421
|
+
Ye(() => {
|
|
422
|
+
const e = be.current;
|
|
423
|
+
if (!e || !it) return;
|
|
417
424
|
const n = () => {
|
|
418
425
|
const o = e.scrollLeft > 0, a = Math.ceil(e.scrollLeft + e.clientWidth) < e.scrollWidth;
|
|
419
|
-
|
|
426
|
+
en((r) => r.left === o && r.right === a ? r : { left: o, right: a });
|
|
420
427
|
};
|
|
421
428
|
n(), e.addEventListener("scroll", n, { passive: !0 });
|
|
422
429
|
const t = new ResizeObserver(n);
|
|
423
430
|
return t.observe(e), e.firstElementChild && t.observe(e.firstElementChild), () => {
|
|
424
431
|
e.removeEventListener("scroll", n), t.disconnect();
|
|
425
432
|
};
|
|
426
|
-
}, [
|
|
427
|
-
const
|
|
428
|
-
|
|
429
|
-
}, []),
|
|
433
|
+
}, [it]);
|
|
434
|
+
const he = N(() => {
|
|
435
|
+
be.current && (be.current.scrollTop = 0);
|
|
436
|
+
}, []), tn = N(
|
|
430
437
|
(e) => {
|
|
431
|
-
d.setPageIndex(e - 1),
|
|
438
|
+
d.setPageIndex(e - 1), he();
|
|
432
439
|
},
|
|
433
|
-
[d,
|
|
434
|
-
),
|
|
440
|
+
[d, he]
|
|
441
|
+
), nn = N(
|
|
435
442
|
(e) => {
|
|
436
|
-
d.setPageSize(e),
|
|
443
|
+
d.setPageSize(e), he();
|
|
437
444
|
},
|
|
438
|
-
[d,
|
|
439
|
-
),
|
|
445
|
+
[d, he]
|
|
446
|
+
), on = d.getHeaderGroups().length > 1, te = Pe === "row" && se, ln = Z ?? (!!P || te), an = k(
|
|
440
447
|
l["tedi-table"],
|
|
441
|
-
l[`tedi-table--${
|
|
448
|
+
l[`tedi-table--${O}`],
|
|
442
449
|
{
|
|
443
|
-
[l["tedi-table--striped"]]:
|
|
444
|
-
[l["tedi-table--vertical-borders"]]:
|
|
445
|
-
[l["tedi-table--borderless"]]:
|
|
446
|
-
[l["tedi-table--sticky-first-column"]]:
|
|
447
|
-
[l["tedi-table--sticky-last-column"]]:
|
|
448
|
-
[l["tedi-table--overflow-left"]]:
|
|
449
|
-
[l["tedi-table--overflow-right"]]:
|
|
450
|
-
[l["tedi-table--sticky-header"]]:
|
|
451
|
-
[l["tedi-table--clickable-rows"]]: !!
|
|
452
|
-
[l["tedi-table--row-hover"]]:
|
|
453
|
-
[l["tedi-table--has-pagination"]]:
|
|
454
|
-
[l["tedi-table--grouped-headers"]]:
|
|
450
|
+
[l["tedi-table--striped"]]: u,
|
|
451
|
+
[l["tedi-table--vertical-borders"]]: Ne,
|
|
452
|
+
[l["tedi-table--borderless"]]: Oe,
|
|
453
|
+
[l["tedi-table--sticky-first-column"]]: Q,
|
|
454
|
+
[l["tedi-table--sticky-last-column"]]: T,
|
|
455
|
+
[l["tedi-table--overflow-left"]]: Q && rt.left,
|
|
456
|
+
[l["tedi-table--overflow-right"]]: T && rt.right,
|
|
457
|
+
[l["tedi-table--sticky-header"]]: g,
|
|
458
|
+
[l["tedi-table--clickable-rows"]]: !!P || te,
|
|
459
|
+
[l["tedi-table--row-hover"]]: ln,
|
|
460
|
+
[l["tedi-table--has-pagination"]]: I,
|
|
461
|
+
[l["tedi-table--grouped-headers"]]: on
|
|
455
462
|
},
|
|
456
|
-
|
|
457
|
-
),
|
|
463
|
+
me
|
|
464
|
+
), w = d.getRowModel().rows, ve = d.getHeaderGroups(), st = d.getFooterGroups(), dt = d.getVisibleLeafColumns(), we = dt.length, rn = st.some(
|
|
458
465
|
(e) => e.headers.some((n) => n.column.columnDef.footer !== void 0)
|
|
459
|
-
),
|
|
460
|
-
|
|
461
|
-
},
|
|
462
|
-
|
|
463
|
-
},
|
|
464
|
-
() => S ? new Map(
|
|
465
|
-
[S,
|
|
466
|
+
), ct = (e) => !!P || te && e.getCanExpand(), ut = (e) => {
|
|
467
|
+
te && e.getCanExpand() && e.toggleExpanded(), P == null || P(e);
|
|
468
|
+
}, sn = (e) => (n) => {
|
|
469
|
+
ct(e) && n.target === n.currentTarget && (n.key === "Enter" || n.key === " ") && (n.preventDefault(), ut(e));
|
|
470
|
+
}, gt = ve.length + ($e ? 1 : 0), mt = d.getState().pagination, dn = I ? mt.pageIndex * mt.pageSize : 0, cn = I ? fe ?? d.getFilteredRowModel().rows.length : w.length, un = I ? gt + cn : void 0, [pt, Ue] = K(null), [gn, xe] = K(null), ne = U(null), oe = U(null), [ft, Ke] = K(null), [bt, Ce] = K(null), le = U(null), ae = U(null), [ht, Ve] = K(null), _e = U([]), [vt, He] = K(null), de = U(-1), [mn, H] = K(""), Se = U(null), [pn, wt] = K(0), Ge = v(
|
|
471
|
+
() => S ? new Map(w.map((e) => [e.id, e.index])) : /* @__PURE__ */ new Map(),
|
|
472
|
+
[S, w]
|
|
466
473
|
);
|
|
467
|
-
|
|
468
|
-
if (!S && !
|
|
474
|
+
Ye(() => {
|
|
475
|
+
if (!S && !ee) return;
|
|
469
476
|
const e = () => {
|
|
470
|
-
|
|
477
|
+
oe.current = null, ae.current = null;
|
|
471
478
|
};
|
|
472
479
|
return window.addEventListener("mouseup", e), window.addEventListener("touchend", e), () => {
|
|
473
480
|
window.removeEventListener("mouseup", e), window.removeEventListener("touchend", e);
|
|
474
481
|
};
|
|
475
|
-
}, [S,
|
|
476
|
-
const
|
|
482
|
+
}, [S, ee]);
|
|
483
|
+
const fn = N(
|
|
477
484
|
(e) => ({
|
|
478
485
|
onHandlePointerDown: () => {
|
|
479
|
-
|
|
486
|
+
oe.current = e;
|
|
480
487
|
},
|
|
481
488
|
onDragStart: (n) => {
|
|
482
|
-
if (
|
|
489
|
+
if (oe.current !== e) {
|
|
483
490
|
n.preventDefault();
|
|
484
491
|
return;
|
|
485
492
|
}
|
|
486
|
-
|
|
493
|
+
oe.current = null, n.dataTransfer.effectAllowed = "move";
|
|
487
494
|
try {
|
|
488
495
|
n.dataTransfer.setData("text/plain", e);
|
|
489
496
|
} catch {
|
|
490
497
|
}
|
|
491
498
|
const t = n.currentTarget, o = t.closest("table");
|
|
492
499
|
if (o) {
|
|
493
|
-
const a = t.getBoundingClientRect(),
|
|
500
|
+
const a = t.getBoundingClientRect(), r = Array.from(t.children), c = document.createElement("div");
|
|
494
501
|
c.style.cssText = `position:fixed;top:-10000px;left:0;width:${a.width}px;pointer-events:none;`;
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
const
|
|
498
|
-
|
|
499
|
-
const s = Array.from(
|
|
500
|
-
|
|
501
|
-
const
|
|
502
|
-
if (!
|
|
503
|
-
const
|
|
504
|
-
|
|
505
|
-
}),
|
|
502
|
+
const p = document.createElement("table");
|
|
503
|
+
p.className = o.className, p.style.cssText = `width:${a.width}px;table-layout:fixed;border-collapse:collapse;`;
|
|
504
|
+
const x = document.createElement("tbody"), C = t.cloneNode(!0);
|
|
505
|
+
C.classList.add(l["tedi-table__row--drag-preview"]);
|
|
506
|
+
const s = Array.from(C.children);
|
|
507
|
+
r.forEach((G, q) => {
|
|
508
|
+
const z = s[q];
|
|
509
|
+
if (!z) return;
|
|
510
|
+
const ce = G.getBoundingClientRect();
|
|
511
|
+
z.style.width = `${ce.width}px`, z.style.minWidth = `${ce.width}px`, z.style.maxWidth = `${ce.width}px`;
|
|
512
|
+
}), x.appendChild(C), p.appendChild(x), c.appendChild(p), document.body.appendChild(c), n.dataTransfer.setDragImage(c, 24, a.height / 2), window.setTimeout(() => c.remove(), 0);
|
|
506
513
|
}
|
|
507
|
-
|
|
514
|
+
ne.current = e, Ue(e);
|
|
508
515
|
},
|
|
509
516
|
onDragOver: (n) => {
|
|
510
|
-
!
|
|
517
|
+
!ne.current || ne.current === e || (n.preventDefault(), n.dataTransfer.dropEffect = "move", xe(e));
|
|
511
518
|
},
|
|
512
519
|
onDragLeave: () => {
|
|
513
|
-
|
|
520
|
+
xe((n) => n === e ? null : n);
|
|
514
521
|
},
|
|
515
522
|
onDragEnd: () => {
|
|
516
|
-
|
|
523
|
+
ne.current = null, oe.current = null, Ue(null), xe(null);
|
|
517
524
|
},
|
|
518
525
|
onDrop: (n) => {
|
|
519
526
|
n.preventDefault();
|
|
520
|
-
const t =
|
|
521
|
-
if (
|
|
522
|
-
const a =
|
|
523
|
-
a === void 0 ||
|
|
527
|
+
const t = ne.current, o = e;
|
|
528
|
+
if (ne.current = null, oe.current = null, Ue(null), xe(null), !t || t === o) return;
|
|
529
|
+
const a = Ge.get(t), r = Ge.get(o);
|
|
530
|
+
a === void 0 || r === void 0 || L == null || L({ fromId: t, toId: o, fromIndex: a, toIndex: r });
|
|
524
531
|
}
|
|
525
532
|
}),
|
|
526
|
-
[
|
|
527
|
-
),
|
|
533
|
+
[Ge, L]
|
|
534
|
+
), xt = (e, n, t) => {
|
|
528
535
|
const o = e.slice(), [a] = o.splice(n, 1);
|
|
529
536
|
return o.splice(t, 0, a), o;
|
|
530
|
-
},
|
|
537
|
+
}, bn = N(
|
|
531
538
|
(e) => ({
|
|
532
539
|
onHandlePointerDown: () => {
|
|
533
|
-
|
|
540
|
+
ae.current = e;
|
|
534
541
|
},
|
|
535
542
|
onDragStart: (n) => {
|
|
536
|
-
if (
|
|
543
|
+
if (ae.current !== e) {
|
|
537
544
|
n.preventDefault();
|
|
538
545
|
return;
|
|
539
546
|
}
|
|
540
|
-
|
|
547
|
+
ae.current = null, n.dataTransfer.effectAllowed = "move";
|
|
541
548
|
try {
|
|
542
549
|
n.dataTransfer.setData("text/plain", e);
|
|
543
550
|
} catch {
|
|
544
551
|
}
|
|
545
552
|
const t = n.currentTarget, o = t.getBoundingClientRect(), a = document.createElement("div");
|
|
546
553
|
a.style.cssText = `position:fixed;top:-10000px;left:0;width:${o.width}px;pointer-events:none;`;
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
const
|
|
552
|
-
|
|
554
|
+
const r = document.createElement("table"), c = t.closest("table");
|
|
555
|
+
r.className = (c == null ? void 0 : c.className) ?? "", r.style.cssText = `width:${o.width}px;table-layout:fixed;border-collapse:collapse;`;
|
|
556
|
+
const p = document.createElement("thead"), x = document.createElement("tr");
|
|
557
|
+
x.className = l["tedi-table__row"];
|
|
558
|
+
const C = t.cloneNode(!0);
|
|
559
|
+
C.classList.add(l["tedi-table__header-cell--drag-preview"]), C.style.width = `${o.width}px`, x.appendChild(C), p.appendChild(x), r.appendChild(p), a.appendChild(r), document.body.appendChild(a), n.dataTransfer.setDragImage(a, o.width / 2, o.height / 2), window.setTimeout(() => a.remove(), 0), le.current = e, Ke(e);
|
|
553
560
|
},
|
|
554
561
|
onDragOver: (n) => {
|
|
555
|
-
!
|
|
562
|
+
!le.current || le.current === e || (n.preventDefault(), n.dataTransfer.dropEffect = "move", Ce(e));
|
|
556
563
|
},
|
|
557
564
|
onDragLeave: () => {
|
|
558
|
-
|
|
565
|
+
Ce((n) => n === e ? null : n);
|
|
559
566
|
},
|
|
560
567
|
onDragEnd: () => {
|
|
561
|
-
|
|
568
|
+
le.current = null, ae.current = null, Ke(null), Ce(null);
|
|
562
569
|
},
|
|
563
570
|
onDrop: (n) => {
|
|
564
571
|
n.preventDefault();
|
|
565
|
-
const t =
|
|
566
|
-
if (
|
|
567
|
-
const a = d.getState().columnOrder,
|
|
568
|
-
c < 0 ||
|
|
572
|
+
const t = le.current, o = e;
|
|
573
|
+
if (le.current = null, ae.current = null, Ke(null), Ce(null), !t || t === o) return;
|
|
574
|
+
const a = d.getState().columnOrder, r = a.length > 0 ? a : d.getAllLeafColumns().map((x) => x.id), c = r.indexOf(t), p = r.indexOf(o);
|
|
575
|
+
c < 0 || p < 0 || d.setColumnOrder(xt(r, c, p));
|
|
569
576
|
}
|
|
570
577
|
}),
|
|
571
578
|
[d]
|
|
572
|
-
),
|
|
579
|
+
), hn = (e) => `${m}-col-reorder-${e}`, vn = (e) => `${m}-row-reorder-${e}`, Ct = () => d.getVisibleLeafColumns().filter((e) => !e.parent && e.id !== Re && e.id !== qe && e.id !== Je).map((e) => e.id), Me = (e) => {
|
|
573
580
|
const n = d.getColumn(e), t = n == null ? void 0 : n.columnDef.meta;
|
|
574
581
|
return (t == null ? void 0 : t.label) ?? (typeof (n == null ? void 0 : n.columnDef.header) == "string" ? n.columnDef.header : e);
|
|
575
|
-
},
|
|
576
|
-
const t =
|
|
582
|
+
}, _t = (e, n) => {
|
|
583
|
+
const t = Ct(), o = t.indexOf(n);
|
|
577
584
|
if (o < 0) return;
|
|
578
585
|
const a = o + e;
|
|
579
586
|
if (a < 0 || a >= t.length) return;
|
|
580
|
-
const
|
|
581
|
-
let
|
|
582
|
-
const
|
|
583
|
-
for (const s of
|
|
584
|
-
d.setColumnOrder(
|
|
585
|
-
},
|
|
586
|
-
if (!
|
|
587
|
-
const t =
|
|
587
|
+
const r = xt(t, o, a), c = d.getState().columnOrder.length > 0 ? [...d.getState().columnOrder] : d.getAllLeafColumns().map((s) => s.id), p = new Set(t);
|
|
588
|
+
let x = 0;
|
|
589
|
+
const C = c.map((s) => p.has(s) ? r[x++] : s);
|
|
590
|
+
for (const s of r) C.includes(s) || C.push(s);
|
|
591
|
+
d.setColumnOrder(C), H(b("table.reorder.move", Me(n), a + 1)), Se.current = { kind: "column", id: n }, wt((s) => s + 1);
|
|
592
|
+
}, wn = (e, n) => {
|
|
593
|
+
if (!ee) return;
|
|
594
|
+
const t = ht;
|
|
588
595
|
switch (e.key) {
|
|
589
596
|
case " ":
|
|
590
597
|
case "Enter":
|
|
591
598
|
if (e.preventDefault(), t === null)
|
|
592
|
-
|
|
599
|
+
_e.current = [...d.getState().columnOrder ?? []], Ve(n), H(b("table.reorder.pickup", Me(n)));
|
|
593
600
|
else {
|
|
594
|
-
const o =
|
|
595
|
-
|
|
601
|
+
const o = Ct().indexOf(t) + 1;
|
|
602
|
+
Ve(null), _e.current = [], H(b("table.reorder.drop", Me(t), o));
|
|
596
603
|
}
|
|
597
604
|
break;
|
|
598
605
|
case "Escape":
|
|
599
|
-
t !== null && (e.preventDefault(), d.setColumnOrder(
|
|
606
|
+
t !== null && (e.preventDefault(), d.setColumnOrder(_e.current), Ve(null), _e.current = [], H(b("table.reorder.cancel")));
|
|
600
607
|
break;
|
|
601
608
|
case "ArrowLeft":
|
|
602
|
-
t !== null && (e.preventDefault(),
|
|
609
|
+
t !== null && (e.preventDefault(), _t(-1, t));
|
|
603
610
|
break;
|
|
604
611
|
case "ArrowRight":
|
|
605
|
-
t !== null && (e.preventDefault(),
|
|
612
|
+
t !== null && (e.preventDefault(), _t(1, t));
|
|
606
613
|
break;
|
|
607
614
|
}
|
|
608
|
-
},
|
|
609
|
-
const t =
|
|
615
|
+
}, St = (e, n) => {
|
|
616
|
+
const t = w.findIndex((c) => c.original === n);
|
|
610
617
|
if (t < 0) return;
|
|
611
618
|
const o = t + e;
|
|
612
|
-
if (o < 0 || o >=
|
|
613
|
-
const a =
|
|
614
|
-
|
|
619
|
+
if (o < 0 || o >= w.length) return;
|
|
620
|
+
const a = w[t], r = w[o];
|
|
621
|
+
L == null || L({
|
|
615
622
|
fromId: a.id,
|
|
616
|
-
toId:
|
|
623
|
+
toId: r.id,
|
|
617
624
|
fromIndex: a.index,
|
|
618
|
-
toIndex:
|
|
619
|
-
}), H(b("table.row-reorder.move", o + 1)), Se.current = { kind: "row", original: n },
|
|
620
|
-
},
|
|
625
|
+
toIndex: r.index
|
|
626
|
+
}), H(b("table.row-reorder.move", o + 1)), Se.current = { kind: "row", original: n }, wt((c) => c + 1);
|
|
627
|
+
}, xn = (e, n) => {
|
|
621
628
|
if (!S) return;
|
|
622
|
-
const t =
|
|
629
|
+
const t = vt;
|
|
623
630
|
switch (e.key) {
|
|
624
631
|
case " ":
|
|
625
632
|
case "Enter":
|
|
626
633
|
if (e.preventDefault(), t === null)
|
|
627
|
-
|
|
634
|
+
He(n.original), de.current = n.index, H(b("table.row-reorder.pickup", w.indexOf(n) + 1));
|
|
628
635
|
else {
|
|
629
|
-
const o =
|
|
630
|
-
|
|
636
|
+
const o = w.findIndex((a) => a.original === t) + 1;
|
|
637
|
+
He(null), de.current = -1, H(b("table.row-reorder.drop", o));
|
|
631
638
|
}
|
|
632
639
|
break;
|
|
633
640
|
case "Escape":
|
|
634
641
|
if (t !== null) {
|
|
635
642
|
e.preventDefault();
|
|
636
|
-
const o =
|
|
637
|
-
if (o >= 0 &&
|
|
638
|
-
const a =
|
|
639
|
-
|
|
643
|
+
const o = w.findIndex((a) => a.original === t);
|
|
644
|
+
if (o >= 0 && de.current >= 0) {
|
|
645
|
+
const a = w[o];
|
|
646
|
+
L == null || L({
|
|
640
647
|
fromId: a.id,
|
|
641
648
|
toId: a.id,
|
|
642
649
|
fromIndex: a.index,
|
|
643
|
-
toIndex:
|
|
650
|
+
toIndex: de.current
|
|
644
651
|
});
|
|
645
652
|
}
|
|
646
|
-
|
|
653
|
+
He(null), de.current = -1, H(b("table.row-reorder.cancel"));
|
|
647
654
|
}
|
|
648
655
|
break;
|
|
649
656
|
case "ArrowUp":
|
|
650
|
-
t !== null && (e.preventDefault(),
|
|
657
|
+
t !== null && (e.preventDefault(), St(-1, t));
|
|
651
658
|
break;
|
|
652
659
|
case "ArrowDown":
|
|
653
|
-
t !== null && (e.preventDefault(),
|
|
660
|
+
t !== null && (e.preventDefault(), St(1, t));
|
|
654
661
|
break;
|
|
655
662
|
}
|
|
656
663
|
};
|
|
657
|
-
return
|
|
664
|
+
return Ye(() => {
|
|
658
665
|
var t;
|
|
659
666
|
const e = Se.current;
|
|
660
667
|
if (!e) return;
|
|
@@ -663,87 +670,88 @@ function St(R) {
|
|
|
663
670
|
if (e.kind === "column")
|
|
664
671
|
n = `${m}-col-reorder-${e.id}`;
|
|
665
672
|
else {
|
|
666
|
-
const o =
|
|
673
|
+
const o = w.find((a) => a.original === e.original);
|
|
667
674
|
n = o ? `${m}-row-reorder-${o.id}` : null;
|
|
668
675
|
}
|
|
669
676
|
n && ((t = document.getElementById(n)) == null || t.focus());
|
|
670
|
-
}, [
|
|
671
|
-
|
|
672
|
-
(S ||
|
|
673
|
-
/* @__PURE__ */
|
|
677
|
+
}, [pn, w, m]), /* @__PURE__ */ i(Nn.Provider, { value: Zt, children: /* @__PURE__ */ ue("div", { className: an, "data-name": "tedi-table", children: [
|
|
678
|
+
Te,
|
|
679
|
+
(S || ee) && /* @__PURE__ */ i("div", { className: l["tedi-table__sr-only"], "aria-live": "polite", "aria-atomic": "true", children: mn }),
|
|
680
|
+
/* @__PURE__ */ i(
|
|
674
681
|
"div",
|
|
675
682
|
{
|
|
676
|
-
ref:
|
|
683
|
+
ref: be,
|
|
677
684
|
className: l["tedi-table__scroll"],
|
|
678
|
-
style:
|
|
679
|
-
|
|
685
|
+
style: $ !== void 0 ? { maxHeight: $, overflowY: "auto" } : void 0,
|
|
686
|
+
tabIndex: 0,
|
|
687
|
+
children: /* @__PURE__ */ ue(
|
|
680
688
|
"table",
|
|
681
689
|
{
|
|
682
690
|
id: E,
|
|
683
691
|
className: l["tedi-table__table"],
|
|
684
|
-
"aria-rowcount":
|
|
685
|
-
"aria-colcount":
|
|
692
|
+
"aria-rowcount": un,
|
|
693
|
+
"aria-colcount": we > 0 ? we : void 0,
|
|
686
694
|
children: [
|
|
687
|
-
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
|
|
695
|
+
y && /* @__PURE__ */ i("caption", { className: l["tedi-table__caption"], children: y }),
|
|
696
|
+
/* @__PURE__ */ ue("thead", { className: l["tedi-table__head"], children: [
|
|
697
|
+
ve.map((e, n) => /* @__PURE__ */ i(
|
|
690
698
|
"tr",
|
|
691
699
|
{
|
|
692
700
|
className: l["tedi-table__row"],
|
|
693
|
-
"aria-rowindex":
|
|
701
|
+
"aria-rowindex": I ? n + 1 : void 0,
|
|
694
702
|
children: e.headers.map((t) => {
|
|
695
|
-
const o = t.subHeaders.length > 0, a = !!t.column.parent,
|
|
703
|
+
const o = t.subHeaders.length > 0, a = !!t.column.parent, r = Mn(t.column.columnDef), c = !r && !a;
|
|
696
704
|
if (t.isPlaceholder && !c || !t.isPlaceholder && c && n > 0)
|
|
697
705
|
return null;
|
|
698
|
-
const
|
|
699
|
-
return /* @__PURE__ */
|
|
706
|
+
const p = c ? ve.length - n : 1, x = t.column.getIsSorted(), C = t.column.getCanSort() ? x === "asc" ? "ascending" : x === "desc" ? "descending" : "none" : void 0, s = t.column.columnDef.meta, G = (s == null ? void 0 : s.label) ?? (typeof t.column.columnDef.header == "string" ? t.column.columnDef.header : void 0), q = G != null && G.trim() ? G : void 0, z = t.column.columnDef.header, ce = !r && (z == null || typeof z == "string" && z.trim() === ""), Dt = q ?? (r ? void 0 : t.column.id), B = Y == null ? void 0 : Y(t.column.id), We = t.column.getSize(), Cn = t.column.id === Re || t.column.id === qe || t.column.id === Je, re = ee && c && !Cn, f = re ? bn(t.column.id) : void 0, _n = re && ft === t.column.id, Sn = re && bt === t.column.id && ft !== t.column.id, je = re && ht === t.column.id;
|
|
707
|
+
return /* @__PURE__ */ i(
|
|
700
708
|
"th",
|
|
701
709
|
{
|
|
702
710
|
colSpan: t.colSpan,
|
|
703
|
-
rowSpan:
|
|
704
|
-
draggable:
|
|
705
|
-
onDragStart:
|
|
706
|
-
onDragOver:
|
|
707
|
-
onDragLeave:
|
|
708
|
-
onDragEnd:
|
|
709
|
-
onDrop:
|
|
711
|
+
rowSpan: p > 1 ? p : void 0,
|
|
712
|
+
draggable: re || void 0,
|
|
713
|
+
onDragStart: f == null ? void 0 : f.onDragStart,
|
|
714
|
+
onDragOver: f == null ? void 0 : f.onDragOver,
|
|
715
|
+
onDragLeave: f == null ? void 0 : f.onDragLeave,
|
|
716
|
+
onDragEnd: f == null ? void 0 : f.onDragEnd,
|
|
717
|
+
onDrop: f == null ? void 0 : f.onDrop,
|
|
710
718
|
className: k(
|
|
711
719
|
l["tedi-table__header-cell"],
|
|
712
720
|
{
|
|
713
721
|
[l["tedi-table__header-cell--group"]]: o,
|
|
714
|
-
[l["tedi-table__header-cell--dragging"]]:
|
|
715
|
-
[l["tedi-table__header-cell--drag-over"]]:
|
|
716
|
-
[l["tedi-table__header-cell--picked-up"]]:
|
|
722
|
+
[l["tedi-table__header-cell--dragging"]]: _n,
|
|
723
|
+
[l["tedi-table__header-cell--drag-over"]]: Sn,
|
|
724
|
+
[l["tedi-table__header-cell--picked-up"]]: je,
|
|
717
725
|
[l[`tedi-table__cell--align-${s == null ? void 0 : s.align}`]]: s == null ? void 0 : s.align,
|
|
718
726
|
[l[`tedi-table__cell--valign-${s == null ? void 0 : s.vAlign}`]]: s == null ? void 0 : s.vAlign
|
|
719
727
|
},
|
|
720
|
-
|
|
728
|
+
B == null ? void 0 : B.className
|
|
721
729
|
),
|
|
722
730
|
scope: "col",
|
|
723
|
-
"aria-sort":
|
|
724
|
-
"aria-label":
|
|
725
|
-
style:
|
|
726
|
-
children:
|
|
727
|
-
/* @__PURE__ */
|
|
731
|
+
"aria-sort": C,
|
|
732
|
+
"aria-label": q ?? (r ? void 0 : t.column.id),
|
|
733
|
+
style: We || B != null && B.style ? { ...We ? { width: We } : null, ...B == null ? void 0 : B.style } : void 0,
|
|
734
|
+
children: re && f ? /* @__PURE__ */ ue("span", { className: l["tedi-table__header-cell-inner"], children: [
|
|
735
|
+
/* @__PURE__ */ i(
|
|
728
736
|
"button",
|
|
729
737
|
{
|
|
730
738
|
type: "button",
|
|
731
|
-
id:
|
|
739
|
+
id: hn(t.column.id),
|
|
732
740
|
className: k(l["tedi-table__drag-handle"], {
|
|
733
|
-
[l["tedi-table__drag-handle--picked-up"]]:
|
|
741
|
+
[l["tedi-table__drag-handle--picked-up"]]: je
|
|
734
742
|
}),
|
|
735
|
-
"aria-label": b("table.drag-column",
|
|
736
|
-
"aria-pressed":
|
|
737
|
-
onClick: (
|
|
738
|
-
onMouseDown:
|
|
739
|
-
onTouchStart:
|
|
740
|
-
onKeyDown: (
|
|
741
|
-
[
|
|
742
|
-
children: /* @__PURE__ */
|
|
743
|
+
"aria-label": b("table.drag-column", q ?? t.column.id),
|
|
744
|
+
"aria-pressed": je,
|
|
745
|
+
onClick: (Xe) => Xe.stopPropagation(),
|
|
746
|
+
onMouseDown: f.onHandlePointerDown,
|
|
747
|
+
onTouchStart: f.onHandlePointerDown,
|
|
748
|
+
onKeyDown: (Xe) => wn(Xe, t.column.id),
|
|
749
|
+
[yt]: "",
|
|
750
|
+
children: /* @__PURE__ */ i(Qe, { name: "drag_indicator", size: 18, color: "inherit" })
|
|
743
751
|
}
|
|
744
752
|
),
|
|
745
753
|
De(t.column.columnDef.header, t.getContext())
|
|
746
|
-
] }) : De(t.column.columnDef.header, t.getContext())
|
|
754
|
+
] }) : ce && Dt ? /* @__PURE__ */ i("span", { className: l["tedi-table__sr-only"], children: Dt }) : De(t.column.columnDef.header, t.getContext())
|
|
747
755
|
},
|
|
748
756
|
t.id
|
|
749
757
|
);
|
|
@@ -751,21 +759,21 @@ function St(R) {
|
|
|
751
759
|
},
|
|
752
760
|
e.id
|
|
753
761
|
)),
|
|
754
|
-
|
|
762
|
+
$e && /* @__PURE__ */ i(
|
|
755
763
|
"tr",
|
|
756
764
|
{
|
|
757
765
|
className: k(l["tedi-table__row"], l["tedi-table__row--filter"]),
|
|
758
|
-
"aria-rowindex":
|
|
759
|
-
children:
|
|
760
|
-
const n = e.columnDef.meta, t = (n == null ? void 0 : n.label) ?? (typeof e.columnDef.header == "string" ? e.columnDef.header : e.id), o = `${m}-filter-${e.id}`, a =
|
|
761
|
-
return /* @__PURE__ */
|
|
766
|
+
"aria-rowindex": I ? ve.length + 1 : void 0,
|
|
767
|
+
children: dt.map((e) => {
|
|
768
|
+
const n = e.columnDef.meta, t = (n == null ? void 0 : n.label) ?? (typeof e.columnDef.header == "string" ? e.columnDef.header : e.id), o = `${m}-filter-${e.id}`, a = Y == null ? void 0 : Y(e.id);
|
|
769
|
+
return /* @__PURE__ */ i(
|
|
762
770
|
"th",
|
|
763
771
|
{
|
|
764
772
|
className: k(l["tedi-table__header-cell"], a == null ? void 0 : a.className),
|
|
765
773
|
style: a == null ? void 0 : a.style,
|
|
766
774
|
scope: "col",
|
|
767
|
-
children: e.getCanFilter() && /* @__PURE__ */
|
|
768
|
-
|
|
775
|
+
children: e.getCanFilter() && /* @__PURE__ */ i(
|
|
776
|
+
En,
|
|
769
777
|
{
|
|
770
778
|
size: "small",
|
|
771
779
|
placeholder: b("table.filter-placeholder"),
|
|
@@ -775,7 +783,7 @@ function St(R) {
|
|
|
775
783
|
label: b("table.filter-input", t),
|
|
776
784
|
hideLabel: !0,
|
|
777
785
|
value: e.getFilterValue() ?? "",
|
|
778
|
-
onChange: (
|
|
786
|
+
onChange: (r) => e.setFilterValue(r || void 0)
|
|
779
787
|
}
|
|
780
788
|
)
|
|
781
789
|
},
|
|
@@ -785,62 +793,64 @@ function St(R) {
|
|
|
785
793
|
}
|
|
786
794
|
)
|
|
787
795
|
] }),
|
|
788
|
-
/* @__PURE__ */
|
|
796
|
+
/* @__PURE__ */ i("tbody", { className: l["tedi-table__body"], children: w.length === 0 ? /* @__PURE__ */ i("tr", { className: l["tedi-table__row"], children: /* @__PURE__ */ i(
|
|
789
797
|
"td",
|
|
790
798
|
{
|
|
791
|
-
colSpan: Math.max(1,
|
|
799
|
+
colSpan: Math.max(1, we),
|
|
792
800
|
className: k(l["tedi-table__cell"], l["tedi-table__cell--placeholder"]),
|
|
793
|
-
children:
|
|
801
|
+
children: J ? /* @__PURE__ */ i("div", { role: J, children: lt }) : lt
|
|
794
802
|
}
|
|
795
|
-
) }) :
|
|
796
|
-
const t =
|
|
803
|
+
) }) : w.map((e, n) => {
|
|
804
|
+
const t = ct(e), o = pe !== void 0 && e.id === pe, a = Be == null ? void 0 : Be(e), r = k(
|
|
797
805
|
l["tedi-table__row"],
|
|
798
806
|
{
|
|
799
|
-
[l["tedi-table__row--selected"]]:
|
|
807
|
+
[l["tedi-table__row--selected"]]: kt && e.getIsSelected(),
|
|
800
808
|
[l["tedi-table__row--active"]]: o,
|
|
801
809
|
[l["tedi-table__row--clickable"]]: t,
|
|
802
810
|
[l["tedi-table__row--sub-row"]]: e.depth > 0
|
|
803
811
|
},
|
|
804
812
|
a == null ? void 0 : a.className
|
|
805
|
-
), c =
|
|
813
|
+
), c = I ? gt + dn + n + 1 : void 0, p = `${m}-sub-${e.id}`, x = S && pt === e.id, C = S && gn === e.id && pt !== e.id, s = S && vt === e.original, G = {
|
|
806
814
|
row: e,
|
|
807
|
-
rowClassName: k(
|
|
808
|
-
[l["tedi-table__row--dragging"]]:
|
|
809
|
-
[l["tedi-table__row--drag-over"]]:
|
|
815
|
+
rowClassName: k(r, {
|
|
816
|
+
[l["tedi-table__row--dragging"]]: x,
|
|
817
|
+
[l["tedi-table__row--drag-over"]]: C,
|
|
810
818
|
[l["tedi-table__row--picked-up"]]: s
|
|
811
819
|
}),
|
|
812
820
|
rowStyle: a == null ? void 0 : a.style,
|
|
813
821
|
isActiveRow: o,
|
|
814
822
|
clickable: t,
|
|
815
|
-
onClick:
|
|
816
|
-
onKeyDownHandler:
|
|
823
|
+
onClick: ut,
|
|
824
|
+
onKeyDownHandler: sn(e),
|
|
817
825
|
ariaRowIndex: c,
|
|
818
|
-
|
|
826
|
+
ariaExpanded: te && e.getCanExpand() ? e.getIsExpanded() : void 0,
|
|
827
|
+
ariaControls: te && e.getCanExpand() && W ? p : void 0,
|
|
828
|
+
columnProps: Y,
|
|
819
829
|
draggable: S,
|
|
820
830
|
dragHandleLabel: b("table.drag-row"),
|
|
821
|
-
dragHandlers: S ? { ...
|
|
822
|
-
dragHandleId: S ?
|
|
831
|
+
dragHandlers: S ? { ...fn(e.id), onKeyDown: (q) => xn(q, e) } : void 0,
|
|
832
|
+
dragHandleId: S ? vn(e.id) : void 0,
|
|
823
833
|
dragHandlePickedUp: s,
|
|
824
|
-
dragOverColumnId:
|
|
834
|
+
dragOverColumnId: ee ? bt : null
|
|
825
835
|
};
|
|
826
|
-
return /* @__PURE__ */
|
|
827
|
-
/* @__PURE__ */
|
|
828
|
-
|
|
836
|
+
return /* @__PURE__ */ ue(yn, { children: [
|
|
837
|
+
/* @__PURE__ */ i(Hn, { ...G }),
|
|
838
|
+
W && e.getIsExpanded() && /* @__PURE__ */ i("tr", { className: k(l["tedi-table__row"], l["tedi-table__row--sub-component"]), children: /* @__PURE__ */ i(
|
|
829
839
|
"td",
|
|
830
840
|
{
|
|
831
|
-
id:
|
|
841
|
+
id: p,
|
|
832
842
|
role: "region",
|
|
833
843
|
"aria-label": b("table.row-details"),
|
|
834
|
-
colSpan: Math.max(1,
|
|
844
|
+
colSpan: Math.max(1, we),
|
|
835
845
|
className: k(l["tedi-table__cell"], l["tedi-table__cell--sub-component"]),
|
|
836
|
-
children:
|
|
846
|
+
children: W(e)
|
|
837
847
|
}
|
|
838
848
|
) })
|
|
839
849
|
] }, e.id);
|
|
840
850
|
}) }),
|
|
841
|
-
|
|
851
|
+
rn && /* @__PURE__ */ i("tfoot", { className: l["tedi-table__foot"], children: st.map((e) => /* @__PURE__ */ i("tr", { className: l["tedi-table__row"], children: e.headers.map((n) => {
|
|
842
852
|
const t = n.column.columnDef.meta;
|
|
843
|
-
return /* @__PURE__ */
|
|
853
|
+
return /* @__PURE__ */ i(
|
|
844
854
|
"td",
|
|
845
855
|
{
|
|
846
856
|
colSpan: n.colSpan,
|
|
@@ -858,28 +868,28 @@ function St(R) {
|
|
|
858
868
|
)
|
|
859
869
|
}
|
|
860
870
|
),
|
|
861
|
-
|
|
862
|
-
|
|
871
|
+
I && /* @__PURE__ */ i("div", { className: l["tedi-table__pagination"], children: /* @__PURE__ */ i(
|
|
872
|
+
Kn,
|
|
863
873
|
{
|
|
864
874
|
...h == null ? void 0 : h.paginationProps,
|
|
865
875
|
pageCount: Math.max(1, d.getPageCount()),
|
|
866
876
|
page: d.getState().pagination.pageIndex + 1,
|
|
867
|
-
onPageChange:
|
|
868
|
-
totalItems:
|
|
877
|
+
onPageChange: tn,
|
|
878
|
+
totalItems: fe ?? d.getFilteredRowModel().rows.length,
|
|
869
879
|
pageSize: d.getState().pagination.pageSize,
|
|
870
|
-
pageSizeOptions:
|
|
871
|
-
onPageSizeChange:
|
|
880
|
+
pageSizeOptions: Lt,
|
|
881
|
+
onPageSizeChange: nn
|
|
872
882
|
}
|
|
873
883
|
) })
|
|
874
884
|
] }) });
|
|
875
885
|
}
|
|
876
|
-
|
|
877
|
-
const
|
|
878
|
-
Toolbar:
|
|
879
|
-
ColumnsMenu:
|
|
880
|
-
HeaderButton:
|
|
886
|
+
It.displayName = "Table";
|
|
887
|
+
const go = Object.assign(It, {
|
|
888
|
+
Toolbar: Ln,
|
|
889
|
+
ColumnsMenu: Tn,
|
|
890
|
+
HeaderButton: On
|
|
881
891
|
});
|
|
882
892
|
export {
|
|
883
|
-
|
|
884
|
-
|
|
893
|
+
go as Table,
|
|
894
|
+
uo as groupRowSpan
|
|
885
895
|
};
|