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