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