asma-ui-core 3.121.6 → 3.123.0
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/dist/asma-ui-core.css +1 -1
- package/dist/components/custom/module/header-layout/ToolbarRows.js +64 -60
- package/dist/components/custom/widget/widget/StyledWidget.js +44 -37
- package/dist/components/custom/widget/widget-header/StyledWidgetHeader.js +7 -7
- package/dist/components/custom/widget/widget-title/StyledWidgetTitle.js +8 -8
- package/dist/components/data-display/chip/StyledChip.js +42 -42
- package/dist/components/data-display/form-label/components/StyledFormLabel.js +15 -15
- package/dist/components/feedback/dialog/StyledDialog.js +75 -75
- package/dist/components/feedback/dialog/StyledDialogActions.js +4 -4
- package/dist/components/feedback/dialog/StyledDialogTitle.js +13 -13
- package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +70 -69
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +69 -69
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +81 -81
- package/dist/components/feedback/snack-bar/StyledAlert.js +16 -16
- package/dist/components/inputs/button/StyledButton.js +36 -35
- package/dist/components/inputs/input-field/StyledInputField.js +38 -38
- package/dist/components/inputs/search-field/StyledSearchField.js +18 -17
- package/dist/components/miscellaneous/StyledFormControlLabel.js +13 -13
- package/dist/components/navigation/link/StyledLink.js +44 -44
- package/dist/components/navigation/title-chevron/StyledTitleChevron.js +13 -13
- package/dist/components/utils/bottom-sheet/StyledBottomSheet.js +45 -45
- package/dist/components/utils/popover/PopoverAnatomy.js +23 -23
- package/dist/hooks/useMediaQuery.hook.js +3 -2
- package/dist/index.js +66 -63
- package/dist/src/components/custom/module/header-layout/ToolbarRows.d.ts +3 -1
- package/dist/src/hooks/useMediaQuery.hook.d.ts +2 -0
- package/dist/src/table/components/table-header/SortIndicator.d.ts +12 -0
- package/dist/src/table/custom-features/order-columns/columnLayout.d.ts +24 -0
- package/dist/src/table/custom-features/order-columns/columnLayout.test.d.ts +1 -0
- package/dist/src/table/custom-features/order-columns/types.d.ts +8 -0
- package/dist/src/table/custom-features/order-columns/usePersistColumnOrder.d.ts +5 -0
- package/dist/src/table/helpers/columnIds.d.ts +27 -0
- package/dist/src/table/helpers/columnIds.test.d.ts +1 -0
- package/dist/src/table/helpers/tableStorage.d.ts +12 -0
- package/dist/src/table/helpers/tableStorage.test.d.ts +1 -0
- package/dist/src/table/hooks/useColumnSizingPersistence.d.ts +16 -3
- package/dist/src/table/hooks/useColumnSizingPersistence.test.d.ts +1 -0
- package/dist/src/table/hooks/usePersistedSorting.d.ts +54 -0
- package/dist/src/table/hooks/usePersistedSorting.test.d.ts +1 -0
- package/dist/src/table/hooks/usePersistedStateWriter.d.ts +30 -0
- package/dist/src/table/hooks/useTranslations.d.ts +6 -4
- package/dist/src/table/index.d.ts +1 -0
- package/dist/src/table/types.d.ts +9 -2
- package/dist/table/components/StyledTable.module.js +59 -56
- package/dist/table/components/columns/action-column/components/HeaderActionMenu.js +61 -54
- package/dist/table/components/columns/action-column/components/TableActions.module.js +4 -4
- package/dist/table/components/table-header/SortIndicator.js +23 -0
- package/dist/table/components/table-header/TableHeader.js +30 -30
- package/dist/table/components/table-header/TableHeaderCell.js +30 -31
- package/dist/table/custom-features/order-columns/OrderColumnsFeature.js +7 -8
- package/dist/table/custom-features/order-columns/columnLayout.js +9 -0
- package/dist/table/custom-features/order-columns/usePersistColumnOrder.js +12 -11
- package/dist/table/custom-features/order-columns/usePersistedColumnOrder.js +7 -12
- package/dist/table/helpers/columnIds.js +28 -0
- package/dist/table/helpers/tableStorage.js +33 -0
- package/dist/table/hooks/useColumnSizingPersistence.js +16 -34
- package/dist/table/hooks/usePersistedPageSize.js +11 -16
- package/dist/table/hooks/usePersistedSorting.js +58 -0
- package/dist/table/hooks/usePersistedStateWriter.js +36 -0
- package/dist/table/hooks/useStyledTable.js +90 -60
- package/dist/table/hooks/useTranslations.js +13 -11
- package/dist/table/index.js +3 -2
- package/dist/table/shared-components/DropDownIcon.js +4 -2
- package/dist/table/shared-components/DropUpIcon.js +5 -3
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { CSSProperties, MouseEvent, MutableRefObject, ReactElement, ReactNode }
|
|
|
3
3
|
import { ExpandedRow, ExpandedRowsInstance, ExpandedRowsOptions, ExpandedRowsTableState } from './custom-features/expand-rows';
|
|
4
4
|
import { TooltipProps } from '../components/data-display/tooltip/StyledTooltip';
|
|
5
5
|
import { FocusedRowsOptions, FocusedRowsTableState, FocusedRow, FocusedRowsInstance } from './custom-features/focus-rows';
|
|
6
|
-
import { OrderedColumnsOptions, OrderedColumnsTableState } from './custom-features/order-columns';
|
|
6
|
+
import { ColumnSettingsInstance, OrderedColumnsOptions, OrderedColumnsTableState } from './custom-features/order-columns';
|
|
7
7
|
import { RowSelectionTooltipOptions, RowSelectionTooltipRow } from './custom-features/row-selection-tooltip';
|
|
8
8
|
export type * from '@tanstack/react-table';
|
|
9
9
|
declare module '@tanstack/react-table' {
|
|
@@ -13,7 +13,7 @@ declare module '@tanstack/react-table' {
|
|
|
13
13
|
}
|
|
14
14
|
interface Row<TData extends RowData> extends ExpandedRow, FocusedRow, RowSelectionTooltipRow<TData> {
|
|
15
15
|
}
|
|
16
|
-
interface Table<TData extends RowData> extends ExpandedRowsInstance, FocusedRowsInstance {
|
|
16
|
+
interface Table<TData extends RowData> extends ExpandedRowsInstance, FocusedRowsInstance, ColumnSettingsInstance {
|
|
17
17
|
getCoreRowModel: () => RowModel<TData>;
|
|
18
18
|
}
|
|
19
19
|
interface ColumnDefExtensions<TData extends RowData, TValue = unknown> extends VisibilityColumnDef, ColumnPinningColumnDef, SortingColumnDef<TData>, GroupingColumnDef<TData, TValue>, ColumnSizingColumnDef {
|
|
@@ -132,6 +132,13 @@ export type StyledTableProps<TData, TCustomData> = {
|
|
|
132
132
|
* ensuring that the table state is persisted across sessions for the specific table instance.
|
|
133
133
|
*/
|
|
134
134
|
uniqueKey?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Temporary opt-in (ASMA-8597, owner decision D1, 2026-10-27): save and restore this table's
|
|
137
|
+
* sorting under `${uniqueKey}:sorting`, and let Reset columns reset it. Needs `uniqueKey`;
|
|
138
|
+
* ignored without it. Off by default until UX and privacy approve the fleet rollout, which
|
|
139
|
+
* makes `uniqueKey` alone enough and retires this prop (follow-up ASMA-8698).
|
|
140
|
+
*/
|
|
141
|
+
persistSorting?: boolean;
|
|
135
142
|
} & Omit<TTableOptions<TData>, 'getCoreRowModel' | 'getExpandedRowModel' | 'getFilteredRowModel' | 'getSortedRowModel'> & TFooter<TData>;
|
|
136
143
|
export declare const SELECT_COLUMN_ID = "select";
|
|
137
144
|
export declare const EXPAND_COLUMN_ID = "expand-column-id";
|
|
@@ -1,60 +1,63 @@
|
|
|
1
|
-
var
|
|
2
|
-
"asma-ui-table-styled-table": "_asma-ui-table-styled-
|
|
3
|
-
"table-wrapper": "_table-
|
|
4
|
-
"table-shell": "_table-
|
|
5
|
-
"table-wrapper--no-rows": "_table-wrapper--no-
|
|
6
|
-
"table-wrapper--proxy": "_table-wrapper--
|
|
7
|
-
"table-wrapper--proxy-bottom": "_table-wrapper--proxy-
|
|
8
|
-
"table-wrapper-fetching": "_table-wrapper-
|
|
9
|
-
"table-scroll": "_table-
|
|
10
|
-
"table-x--fill-height": "_table-x--fill-
|
|
11
|
-
"table-x": "_table-
|
|
12
|
-
"table-content": "_table-
|
|
13
|
-
"table-header--sticky": "_table-header--
|
|
14
|
-
"table-hscroll": "_table-
|
|
15
|
-
"table-hscroll__content": "_table-
|
|
16
|
-
"no-rows-overlay-container": "_no-rows-overlay-
|
|
17
|
-
"no-rows-overlay-content": "_no-rows-overlay-
|
|
18
|
-
"styled-table": "_styled-
|
|
19
|
-
tbody:
|
|
20
|
-
"loading-icon": "_loading-
|
|
21
|
-
"t-row": "_t-
|
|
22
|
-
"t-cell": "_t-
|
|
23
|
-
"action-cell": "_action-
|
|
24
|
-
"fixed-cell": "_fixed-
|
|
25
|
-
"fixed-right-cell": "_fixed-right-
|
|
26
|
-
expanded_row:
|
|
27
|
-
"data-cell": "_data-
|
|
28
|
-
"select-cell": "_select-
|
|
29
|
-
selected:
|
|
30
|
-
"single-selection": "_single-
|
|
31
|
-
"action-cell--no-shadow": "_action-cell--no-
|
|
1
|
+
var e = "_tbody_w4q8k_125", _ = "_expanded_row_w4q8k_178", l = "_selected_w4q8k_203", t = "_shadowed_w4q8k_228", a = "_resizer_w4q8k_285", o = "_isResizing_w4q8k_305", r = {
|
|
2
|
+
"asma-ui-table-styled-table": "_asma-ui-table-styled-table_w4q8k_1",
|
|
3
|
+
"table-wrapper": "_table-wrapper_w4q8k_27",
|
|
4
|
+
"table-shell": "_table-shell_w4q8k_34",
|
|
5
|
+
"table-wrapper--no-rows": "_table-wrapper--no-rows_w4q8k_40",
|
|
6
|
+
"table-wrapper--proxy": "_table-wrapper--proxy_w4q8k_43",
|
|
7
|
+
"table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_w4q8k_44",
|
|
8
|
+
"table-wrapper-fetching": "_table-wrapper-fetching_w4q8k_54",
|
|
9
|
+
"table-scroll": "_table-scroll_w4q8k_57",
|
|
10
|
+
"table-x--fill-height": "_table-x--fill-height_w4q8k_66",
|
|
11
|
+
"table-x": "_table-x_w4q8k_66",
|
|
12
|
+
"table-content": "_table-content_w4q8k_81",
|
|
13
|
+
"table-header--sticky": "_table-header--sticky_w4q8k_86",
|
|
14
|
+
"table-hscroll": "_table-hscroll_w4q8k_91",
|
|
15
|
+
"table-hscroll__content": "_table-hscroll__content_w4q8k_101",
|
|
16
|
+
"no-rows-overlay-container": "_no-rows-overlay-container_w4q8k_104",
|
|
17
|
+
"no-rows-overlay-content": "_no-rows-overlay-content_w4q8k_112",
|
|
18
|
+
"styled-table": "_styled-table_w4q8k_116",
|
|
19
|
+
tbody: e,
|
|
20
|
+
"loading-icon": "_loading-icon_w4q8k_130",
|
|
21
|
+
"t-row": "_t-row_w4q8k_137",
|
|
22
|
+
"t-cell": "_t-cell_w4q8k_137",
|
|
23
|
+
"action-cell": "_action-cell_w4q8k_150",
|
|
24
|
+
"fixed-cell": "_fixed-cell_w4q8k_154",
|
|
25
|
+
"fixed-right-cell": "_fixed-right-cell_w4q8k_157",
|
|
26
|
+
expanded_row: _,
|
|
27
|
+
"data-cell": "_data-cell_w4q8k_190",
|
|
28
|
+
"select-cell": "_select-cell_w4q8k_200",
|
|
29
|
+
selected: l,
|
|
30
|
+
"single-selection": "_single-selection_w4q8k_206",
|
|
31
|
+
"action-cell--no-shadow": "_action-cell--no-shadow_w4q8k_224",
|
|
32
32
|
shadowed: t,
|
|
33
|
-
"shadowed-right": "_shadowed-
|
|
34
|
-
"is-loading": "_is-
|
|
35
|
-
"action-cell-default-background": "_action-cell-default-
|
|
36
|
-
"fixed-cell-default-background": "_fixed-cell-default-
|
|
37
|
-
"fixed-right-cell-default-background": "_fixed-right-cell-default-
|
|
38
|
-
"sortable-column": "_sortable-
|
|
39
|
-
resizer:
|
|
40
|
-
isResizing:
|
|
41
|
-
"hide-table-header": "_hide-table-
|
|
42
|
-
"show-table-header": "_show-table-
|
|
43
|
-
"table-header": "_table-
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"t-cell__actions
|
|
47
|
-
"t-
|
|
48
|
-
"t-cell__fixed
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"table-
|
|
55
|
-
"
|
|
56
|
-
"
|
|
33
|
+
"shadowed-right": "_shadowed-right_w4q8k_264",
|
|
34
|
+
"is-loading": "_is-loading_w4q8k_269",
|
|
35
|
+
"action-cell-default-background": "_action-cell-default-background_w4q8k_272",
|
|
36
|
+
"fixed-cell-default-background": "_fixed-cell-default-background_w4q8k_275",
|
|
37
|
+
"fixed-right-cell-default-background": "_fixed-right-cell-default-background_w4q8k_278",
|
|
38
|
+
"sortable-column": "_sortable-column_w4q8k_281",
|
|
39
|
+
resizer: a,
|
|
40
|
+
isResizing: o,
|
|
41
|
+
"hide-table-header": "_hide-table-header_w4q8k_319",
|
|
42
|
+
"show-table-header": "_show-table-header_w4q8k_323",
|
|
43
|
+
"table-header": "_table-header_w4q8k_86",
|
|
44
|
+
"has-resize-zone": "_has-resize-zone_w4q8k_366",
|
|
45
|
+
"hide-header": "_hide-header_w4q8k_369",
|
|
46
|
+
"t-cell__actions": "_t-cell__actions_w4q8k_372",
|
|
47
|
+
"t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_w4q8k_381",
|
|
48
|
+
"t-cell__fixed": "_t-cell__fixed_w4q8k_386",
|
|
49
|
+
"t-cell__fixed-right": "_t-cell__fixed-right_w4q8k_394",
|
|
50
|
+
"sort-indicator": "_sort-indicator_w4q8k_402",
|
|
51
|
+
"sort-glyph": "_sort-glyph_w4q8k_411",
|
|
52
|
+
"sort-indicator--sorted": "_sort-indicator--sorted_w4q8k_415",
|
|
53
|
+
"header-content": "_header-content_w4q8k_429",
|
|
54
|
+
"table-footer--sticky": "_table-footer--sticky_w4q8k_473",
|
|
55
|
+
"table-footer--inline": "_table-footer--inline_w4q8k_484",
|
|
56
|
+
"table-bottom": "_table-bottom_w4q8k_495",
|
|
57
|
+
"table-bottom--sticky": "_table-bottom--sticky_w4q8k_509",
|
|
58
|
+
"cursor-not-allowed": "_cursor-not-allowed_w4q8k_513",
|
|
59
|
+
"select-control": "_select-control_w4q8k_517"
|
|
57
60
|
};
|
|
58
61
|
export {
|
|
59
|
-
|
|
62
|
+
r as default
|
|
60
63
|
};
|
|
@@ -1,99 +1,106 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { cn as N } from "../../../../../helpers/cn.js";
|
|
2
|
+
import { StyledBadge as _ } from "../../../../../components/data-display/badge/StyledBadge.js";
|
|
3
|
+
import { PinIcon as v } from "../../../../../components/icons/pin-icon/PinIcon.js";
|
|
4
|
+
import { StyledPopover as D } from "../../../../../components/utils/popover/StyledPopover.js";
|
|
4
5
|
import { message as T } from "../../../../../components/feedback/snack-bar/message.js";
|
|
5
|
-
import { INTERNAL_COLUMN_IDS as
|
|
6
|
+
import { INTERNAL_COLUMN_IDS as L } from "../../../../types.js";
|
|
7
|
+
import { hasChangedColumnLayout as k } from "../../../../custom-features/order-columns/columnLayout.js";
|
|
6
8
|
import { StyledCheckbox as A } from "../../../../shared-components/StyledCheckbox.js";
|
|
7
|
-
import { StyledTooltip as
|
|
8
|
-
import { useToggleMenuVisibility as
|
|
9
|
-
import
|
|
9
|
+
import { StyledTooltip as I } from "../../../../shared-components/tooltip/index.js";
|
|
10
|
+
import { useToggleMenuVisibility as H } from "../../../../hooks/useToggleMenuVisibility.hook.js";
|
|
11
|
+
import f from "./TableActions.module.js";
|
|
10
12
|
import d from "./HeaderActionMenu.module.js";
|
|
11
|
-
import { DotsHorizontalIcon as
|
|
12
|
-
import { useTranslations as
|
|
13
|
-
import { StyledButton as
|
|
14
|
-
import { compact as
|
|
15
|
-
import { jsx as o, jsxs as
|
|
16
|
-
import { DndContext as
|
|
17
|
-
import { restrictToParentElement as
|
|
18
|
-
import { SortableContext as
|
|
19
|
-
import { CSS as
|
|
20
|
-
function
|
|
21
|
-
const { attributes: c, listeners:
|
|
13
|
+
import { DotsHorizontalIcon as O } from "../../../../shared-components/DotsHorizontalIcon.js";
|
|
14
|
+
import { useTranslations as R } from "../../../../hooks/useTranslations.js";
|
|
15
|
+
import { StyledButton as w } from "../../../../shared-components/button/StyledButton.js";
|
|
16
|
+
import { compact as E } from "../../../../../helpers/arrays.js";
|
|
17
|
+
import { jsx as o, jsxs as u } from "react/jsx-runtime";
|
|
18
|
+
import { DndContext as M, PointerSensor as P, closestCenter as V, useSensor as W, useSensors as z } from "@dnd-kit/core";
|
|
19
|
+
import { restrictToParentElement as B, restrictToVerticalAxis as j } from "@dnd-kit/modifiers";
|
|
20
|
+
import { SortableContext as U, arrayMove as Y, useSortable as $, verticalListSortingStrategy as q } from "@dnd-kit/sortable";
|
|
21
|
+
import { CSS as F } from "@dnd-kit/utilities";
|
|
22
|
+
function G({ id: n, disabled: p, children: h }) {
|
|
23
|
+
const { attributes: c, listeners: b, setNodeRef: g, transform: m, transition: l } = $({
|
|
22
24
|
id: n,
|
|
23
|
-
disabled:
|
|
25
|
+
disabled: p
|
|
24
26
|
});
|
|
25
27
|
return /* @__PURE__ */ o("div", {
|
|
26
|
-
ref:
|
|
28
|
+
ref: g,
|
|
27
29
|
style: {
|
|
28
|
-
transform:
|
|
30
|
+
transform: F.Transform.toString(m),
|
|
29
31
|
transition: l
|
|
30
32
|
},
|
|
31
33
|
className: d["drag-item"],
|
|
32
|
-
children:
|
|
34
|
+
children: h({
|
|
33
35
|
attributes: c,
|
|
34
|
-
listeners:
|
|
36
|
+
listeners: b
|
|
35
37
|
})
|
|
36
38
|
});
|
|
37
39
|
}
|
|
38
|
-
function
|
|
39
|
-
const { anchorEl:
|
|
40
|
+
function be({ headerData: n, locale: p }) {
|
|
41
|
+
const { anchorEl: h, open: c, handleClose: b, handleOpen: g } = H(), m = k(n.table), l = n.table.getAllLeafColumns(), S = (e) => {
|
|
40
42
|
const { active: r, over: t } = e;
|
|
41
43
|
!r || !t || r.id === t.id || l.find((i) => i.id === t.id)?.columnDef.fixedLeft || l.find((i) => i.id === t.id)?.columnDef.fixedRight || n.table.setColumnOrder((i) => {
|
|
42
|
-
const a =
|
|
43
|
-
return
|
|
44
|
+
const a = E(i ?? []).length ? i : n.table.getAllLeafColumns().map((C) => C.id);
|
|
45
|
+
return Y(a, a.indexOf(r.id), a.indexOf(t.id));
|
|
44
46
|
});
|
|
45
|
-
},
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
className:
|
|
48
|
-
children: [/* @__PURE__ */
|
|
47
|
+
}, y = z(W(P, { activationConstraint: { distance: 8 } })), s = R(p), x = l.filter((e) => !L.includes(e.id) && !!e.columnDef.header);
|
|
48
|
+
return /* @__PURE__ */ u("div", {
|
|
49
|
+
className: f["actions-header-wrapper"],
|
|
50
|
+
children: [/* @__PURE__ */ u("button", {
|
|
49
51
|
type: "button",
|
|
50
|
-
"aria-label": s.column_settings,
|
|
52
|
+
"aria-label": m ? s.column_settings_changed : s.column_settings,
|
|
51
53
|
"aria-haspopup": "true",
|
|
52
54
|
"aria-expanded": c,
|
|
53
|
-
className:
|
|
54
|
-
onClick:
|
|
55
|
-
children: [/* @__PURE__ */ o(
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
className: f["actions-header"],
|
|
56
|
+
onClick: g,
|
|
57
|
+
children: [/* @__PURE__ */ o(v, { className: f["pin-icon"] }), m && /* @__PURE__ */ o(_, {
|
|
58
|
+
dataTest: "column-settings-dot",
|
|
59
|
+
variant: "dot",
|
|
60
|
+
purpose: "filter",
|
|
61
|
+
className: f["pin-dot"]
|
|
62
|
+
})]
|
|
63
|
+
}), /* @__PURE__ */ u(D, {
|
|
64
|
+
anchorEl: h,
|
|
58
65
|
anchorOrigin: {
|
|
59
66
|
horizontal: "left",
|
|
60
67
|
vertical: "bottom"
|
|
61
68
|
},
|
|
62
69
|
open: c,
|
|
63
|
-
onClose:
|
|
70
|
+
onClose: b,
|
|
64
71
|
slotProps: { paper: { sx: {
|
|
65
72
|
maxHeight: "calc(7 * 40px)",
|
|
66
73
|
overflowY: "auto",
|
|
67
74
|
scrollbarWidth: "thin"
|
|
68
75
|
} } },
|
|
69
|
-
children: [/* @__PURE__ */ o(
|
|
70
|
-
modifiers: [
|
|
71
|
-
onDragEnd:
|
|
72
|
-
collisionDetection: (e) =>
|
|
76
|
+
children: [/* @__PURE__ */ o(M, {
|
|
77
|
+
modifiers: [j, B],
|
|
78
|
+
onDragEnd: S,
|
|
79
|
+
collisionDetection: (e) => V(e).filter((r) => {
|
|
73
80
|
const t = x.find((i) => i.id === r.id);
|
|
74
81
|
return !t?.columnDef.fixedLeft && !t?.columnDef.fixedRight;
|
|
75
82
|
}),
|
|
76
|
-
sensors:
|
|
77
|
-
children: /* @__PURE__ */ o(
|
|
83
|
+
sensors: y,
|
|
84
|
+
children: /* @__PURE__ */ o(U, {
|
|
78
85
|
items: x.map((e) => e.id),
|
|
79
|
-
strategy:
|
|
86
|
+
strategy: q,
|
|
80
87
|
children: x.map((e) => {
|
|
81
88
|
const r = !!e.columnDef.fixedLeft || !!e.columnDef.fixedRight, t = e.columnDef.enableHiding === !1;
|
|
82
89
|
let i = null;
|
|
83
|
-
return r && t ? i = s.column_reorder_and_hidden : r ? i = s.column_reorder : t && (i = s.column_hidden), /* @__PURE__ */ o(
|
|
90
|
+
return r && t ? i = s.column_reorder_and_hidden : r ? i = s.column_reorder : t && (i = s.column_hidden), /* @__PURE__ */ o(G, {
|
|
84
91
|
id: e.id,
|
|
85
92
|
disabled: r,
|
|
86
|
-
children: ({ listeners: a, attributes: C }) => /* @__PURE__ */ o(
|
|
93
|
+
children: ({ listeners: a, attributes: C }) => /* @__PURE__ */ o(I, {
|
|
87
94
|
title: i,
|
|
88
95
|
arrow: !0,
|
|
89
|
-
children: /* @__PURE__ */
|
|
96
|
+
children: /* @__PURE__ */ u("button", {
|
|
90
97
|
type: "button",
|
|
91
98
|
onClick: () => {
|
|
92
99
|
t || e.toggleVisibility(!e.getIsVisible());
|
|
93
100
|
},
|
|
94
101
|
className: d["table-action-item"],
|
|
95
102
|
children: [
|
|
96
|
-
/* @__PURE__ */ o(
|
|
103
|
+
/* @__PURE__ */ o(O, {
|
|
97
104
|
width: 20,
|
|
98
105
|
height: 20,
|
|
99
106
|
...C,
|
|
@@ -104,7 +111,7 @@ function fe({ headerData: n, locale: u }) {
|
|
|
104
111
|
userSelect: "none",
|
|
105
112
|
WebkitTouchCallout: "none"
|
|
106
113
|
},
|
|
107
|
-
className:
|
|
114
|
+
className: N(d["drag-icon"], r ? d["drag-icon--disabled"] : d["drag-icon--enabled"])
|
|
108
115
|
}),
|
|
109
116
|
/* @__PURE__ */ o("span", {
|
|
110
117
|
className: "px-2",
|
|
@@ -130,19 +137,19 @@ function fe({ headerData: n, locale: u }) {
|
|
|
130
137
|
})
|
|
131
138
|
}), /* @__PURE__ */ o("div", {
|
|
132
139
|
className: "pb-2 pl-2",
|
|
133
|
-
children: /* @__PURE__ */ o(
|
|
140
|
+
children: /* @__PURE__ */ o(w, {
|
|
134
141
|
dataTest: "reset-order-button",
|
|
135
142
|
variant: "text",
|
|
136
143
|
className: "h-10",
|
|
137
144
|
onClick: () => {
|
|
138
|
-
n.table.
|
|
145
|
+
n.table.resetColumnSettings(), T.info(s.columns_reset, { closeButton: !0 });
|
|
139
146
|
},
|
|
140
|
-
children: s.
|
|
147
|
+
children: s.reset_columns
|
|
141
148
|
})
|
|
142
149
|
})]
|
|
143
150
|
})]
|
|
144
151
|
});
|
|
145
152
|
}
|
|
146
153
|
export {
|
|
147
|
-
|
|
154
|
+
be as HeaderActionMenu
|
|
148
155
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var a = {
|
|
2
|
-
"actions-header-wrapper": "_actions-header-
|
|
3
|
-
"actions-header": "_actions-
|
|
4
|
-
"pin-
|
|
5
|
-
"pin-icon": "_pin-
|
|
2
|
+
"actions-header-wrapper": "_actions-header-wrapper_f3kwf_1",
|
|
3
|
+
"actions-header": "_actions-header_f3kwf_1",
|
|
4
|
+
"pin-dot": "_pin-dot_f3kwf_25",
|
|
5
|
+
"pin-icon": "_pin-icon_f3kwf_31"
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
8
|
a as default
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import t from "../StyledTable.module.js";
|
|
2
|
+
import { DropUpIcon as e } from "../../shared-components/DropUpIcon.js";
|
|
3
|
+
import { DropDownIcon as s } from "../../shared-components/DropDownIcon.js";
|
|
4
|
+
import c from "clsx";
|
|
5
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
6
|
+
function h({ sorted: o, nextDirection: i }) {
|
|
7
|
+
const r = o || i, n = r === "asc" ? e : s;
|
|
8
|
+
return /* @__PURE__ */ a("span", {
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
className: c(t["sort-indicator"], o && t["sort-indicator--sorted"]),
|
|
11
|
+
"data-sort-direction": r,
|
|
12
|
+
"data-sort-state": o || "none",
|
|
13
|
+
children: /* @__PURE__ */ a(n, {
|
|
14
|
+
className: t["sort-glyph"],
|
|
15
|
+
focusable: "false",
|
|
16
|
+
height: 28,
|
|
17
|
+
width: 28
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
h as SortIndicator
|
|
23
|
+
};
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { ACTIONS_COLUMN_ID as
|
|
1
|
+
import { cn as k } from "../../../helpers/cn.js";
|
|
2
|
+
import { ACTIONS_COLUMN_ID as C } from "../../types.js";
|
|
3
3
|
import x from "../StyledTable.module.js";
|
|
4
4
|
import { TableHeaderCell as u } from "./TableHeaderCell.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import { jsx as
|
|
6
|
+
import { jsx as o, jsxs as I } from "react/jsx-runtime";
|
|
7
7
|
import "@tanstack/react-table";
|
|
8
|
-
function M({ table: p, styledTableProps:
|
|
9
|
-
const { stickyHeader: S = !1, tableHeaderRef:
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
className:
|
|
8
|
+
function M({ table: p, styledTableProps: n, tableCanResize: l, tableWidth: s, columnWindow: { paddingLeft: i, paddingRight: c, indexes: H } }) {
|
|
9
|
+
const { stickyHeader: S = !1, tableHeaderRef: g, tableHeaderStyle: y = {} } = n, b = p.getHeaderGroups(), D = { ...y };
|
|
10
|
+
return /* @__PURE__ */ o("thead", {
|
|
11
|
+
className: k(x["table-header"], S && x["table-header--sticky"], n.tableHeaderClassName),
|
|
12
12
|
style: D,
|
|
13
|
-
ref:
|
|
13
|
+
ref: g,
|
|
14
14
|
children: b.map((f) => {
|
|
15
|
-
const
|
|
15
|
+
const a = f.headers.map((e, t, r) => ({
|
|
16
16
|
header: e,
|
|
17
|
-
left: r.slice(0, t).reduce((d,
|
|
18
|
-
})), w =
|
|
17
|
+
left: r.slice(0, t).reduce((d, m) => d + (m.column.getSize() ?? 0), 0)
|
|
18
|
+
})), w = a.filter(({ header: e }) => e.column.columnDef.fixedLeft), N = a.filter(({ header: e }) => !e.column.columnDef.fixedLeft && !e.column.columnDef.fixedRight && e.column.id !== "actions"), h = a.filter(({ header: e }) => !!e.column.columnDef.fixedRight || e.column.id === "actions"), T = h.some(({ header: e }) => e.column.id === C), W = h.map((e, t, r) => ({
|
|
19
19
|
...e,
|
|
20
|
-
right: r.slice(t + 1).reduce((d,
|
|
21
|
-
})),
|
|
20
|
+
right: r.slice(t + 1).reduce((d, m) => d + (m.header.column.getSize() ?? 0), 0) + (T ? -1 : 0)
|
|
21
|
+
})), _ = H.reduce((e, t) => {
|
|
22
22
|
const r = N[t];
|
|
23
23
|
return r && e.push(r), e;
|
|
24
24
|
}, []);
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ I("tr", {
|
|
26
26
|
tabIndex: 0,
|
|
27
27
|
onKeyDown: (e) => {
|
|
28
|
-
if (e.key !== "Tab" || e.shiftKey) return;
|
|
28
|
+
if (e.key !== "Tab" || e.shiftKey || e.defaultPrevented || e.target !== e.currentTarget) return;
|
|
29
29
|
const t = e.currentTarget.closest("table")?.querySelector('tbody tr[tabindex="0"]');
|
|
30
30
|
t && (e.preventDefault(), t.focus());
|
|
31
31
|
},
|
|
32
32
|
children: [
|
|
33
|
-
w.map(({ header: e, left: t }) => /* @__PURE__ */
|
|
34
|
-
styledTableProps:
|
|
33
|
+
w.map(({ header: e, left: t }) => /* @__PURE__ */ o(u, {
|
|
34
|
+
styledTableProps: n,
|
|
35
35
|
header: e,
|
|
36
|
-
tableCanResize:
|
|
36
|
+
tableCanResize: l,
|
|
37
37
|
left: t,
|
|
38
|
-
tableWidth:
|
|
38
|
+
tableWidth: s
|
|
39
39
|
}, e.id)),
|
|
40
|
-
i > 0 && /* @__PURE__ */
|
|
40
|
+
i > 0 && /* @__PURE__ */ o("th", {
|
|
41
41
|
"aria-hidden": !0,
|
|
42
42
|
style: {
|
|
43
43
|
width: String(i) + "px",
|
|
@@ -47,18 +47,18 @@ function M({ table: p, styledTableProps: o, tableCanResize: s, tableWidth: l, co
|
|
|
47
47
|
border: "none"
|
|
48
48
|
}
|
|
49
49
|
}),
|
|
50
|
-
|
|
50
|
+
_.map((e) => {
|
|
51
51
|
if (!e) return null;
|
|
52
52
|
const { header: t, left: r } = e;
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
-
styledTableProps:
|
|
53
|
+
return /* @__PURE__ */ o(u, {
|
|
54
|
+
styledTableProps: n,
|
|
55
55
|
header: t,
|
|
56
|
-
tableCanResize:
|
|
56
|
+
tableCanResize: l,
|
|
57
57
|
left: r,
|
|
58
|
-
tableWidth:
|
|
58
|
+
tableWidth: s
|
|
59
59
|
}, t.id);
|
|
60
60
|
}),
|
|
61
|
-
c > 0 && /* @__PURE__ */
|
|
61
|
+
c > 0 && /* @__PURE__ */ o("th", {
|
|
62
62
|
"aria-hidden": !0,
|
|
63
63
|
style: {
|
|
64
64
|
width: String(c) + "px",
|
|
@@ -68,13 +68,13 @@ function M({ table: p, styledTableProps: o, tableCanResize: s, tableWidth: l, co
|
|
|
68
68
|
border: "none"
|
|
69
69
|
}
|
|
70
70
|
}),
|
|
71
|
-
|
|
72
|
-
styledTableProps:
|
|
71
|
+
W.map(({ header: e, left: t, right: r }) => /* @__PURE__ */ o(u, {
|
|
72
|
+
styledTableProps: n,
|
|
73
73
|
header: e,
|
|
74
|
-
tableCanResize:
|
|
74
|
+
tableCanResize: l,
|
|
75
75
|
left: t,
|
|
76
76
|
right: r,
|
|
77
|
-
tableWidth:
|
|
77
|
+
tableWidth: s
|
|
78
78
|
}, e.id))
|
|
79
79
|
]
|
|
80
80
|
}, f.id);
|
|
@@ -1,58 +1,57 @@
|
|
|
1
|
-
import { ACTIONS_COLUMN_ID as C, INTERNAL_COLUMN_IDS as
|
|
2
|
-
import { useRootContext as
|
|
1
|
+
import { ACTIONS_COLUMN_ID as C, INTERNAL_COLUMN_IDS as R } from "../../types.js";
|
|
2
|
+
import { useRootContext as A } from "../../context/RootContext.js";
|
|
3
3
|
import n from "../StyledTable.module.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import { jsx as l, jsxs as F } from "react/jsx-runtime";
|
|
4
|
+
import { SortIndicator as F } from "./SortIndicator.js";
|
|
5
|
+
import { getTableHeaderStyle as L } from "../../helpers/getTableHeaderStyle.js";
|
|
6
|
+
import _ from "clsx";
|
|
7
|
+
import { useMemo as c } from "react";
|
|
8
|
+
import { jsx as l, jsxs as w } from "react/jsx-runtime";
|
|
10
9
|
import { flexRender as M } from "@tanstack/react-table";
|
|
11
|
-
function
|
|
12
|
-
const { hideHeader:
|
|
10
|
+
function J({ styledTableProps: z, header: o, tableCanResize: D = !1, left: b, right: N, tableWidth: h }) {
|
|
11
|
+
const { hideHeader: r = !1, enableResizing: a = !1, actions: H, customActionsNode: I } = z, { isResizing: m, enableResizingFlag: u, disableResizingFlag: d } = A(), g = o.column.columnDef.fixedLeft, f = !!o.column.columnDef.fixedRight, p = o.column.id === C, T = !!H || !!I, x = c(() => o.headerGroup.headers.some((e) => e.id === C), [o.headerGroup.headers]), v = c(() => o.headerGroup.headers.some((e) => !!e.column.columnDef.fixedRight), [o.headerGroup.headers]), y = c(() => o.headerGroup.headers[o.headerGroup.headers.length - (x ? 2 : 1)], [o.headerGroup.headers, x]), t = o.column.getCanSort(), s = o.column.getIsSorted(), G = t ? s === "asc" ? "ascending" : s === "desc" ? "descending" : "none" : void 0, S = D && (a ? !0 : o.id !== y?.id) && o.column.getCanResize() && !R.includes(o.column.id);
|
|
13
12
|
return /* @__PURE__ */ l("th", {
|
|
14
13
|
colSpan: o.colSpan,
|
|
15
|
-
"aria-sort":
|
|
16
|
-
className:
|
|
14
|
+
"aria-sort": G,
|
|
15
|
+
className: _(n["t-cell"], !R.includes(o.column.id) && o.column.getSize() > 64 && n["data-cell"], o.column.id === "select" && n["select-cell"], r && n["hide-header"], p && n["t-cell__actions"], p && (!T || v) && n["t-cell__actions--no-shadow"], g && n["t-cell__fixed"], f && n["t-cell__fixed-right"]),
|
|
17
16
|
style: {
|
|
18
|
-
...
|
|
19
|
-
enableResizing:
|
|
17
|
+
...L({
|
|
18
|
+
enableResizing: a,
|
|
20
19
|
header: o,
|
|
21
|
-
tableWidth:
|
|
20
|
+
tableWidth: h
|
|
22
21
|
}),
|
|
23
|
-
...
|
|
24
|
-
...
|
|
22
|
+
...g && { left: b },
|
|
23
|
+
...f && { right: N }
|
|
25
24
|
},
|
|
26
|
-
children: /* @__PURE__ */
|
|
27
|
-
className:
|
|
25
|
+
children: /* @__PURE__ */ w("div", {
|
|
26
|
+
className: _("flex items-center justify-start", r ? n["hide-table-header"] : n["show-table-header"], t && n["sortable-column"], S && n["has-resize-zone"], o.column.columnDef.className),
|
|
28
27
|
role: t ? "button" : void 0,
|
|
29
28
|
tabIndex: t ? 0 : void 0,
|
|
30
29
|
onClick: (e) => {
|
|
31
|
-
const
|
|
32
|
-
!
|
|
30
|
+
const i = o.column.getToggleSortingHandler();
|
|
31
|
+
!m && i && i(e), d();
|
|
33
32
|
},
|
|
34
33
|
onKeyDown: t ? (e) => {
|
|
35
34
|
if (e.key !== "Enter" && e.key !== " ") return;
|
|
36
35
|
e.preventDefault();
|
|
37
|
-
const
|
|
38
|
-
!
|
|
36
|
+
const i = o.column.getToggleSortingHandler();
|
|
37
|
+
!m && i && i(e), d();
|
|
39
38
|
} : void 0,
|
|
40
39
|
children: [
|
|
41
40
|
/* @__PURE__ */ l("div", {
|
|
42
41
|
className: n["header-content"],
|
|
43
42
|
children: M(o.column.columnDef.header, o.getContext())
|
|
44
43
|
}),
|
|
45
|
-
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
44
|
+
t && /* @__PURE__ */ l(F, {
|
|
45
|
+
sorted: s,
|
|
46
|
+
nextDirection: s || o.column.getFirstSortDir()
|
|
47
|
+
}),
|
|
48
|
+
S && /* @__PURE__ */ l("div", {
|
|
50
49
|
onDoubleClick: () => o.column.resetSize(),
|
|
51
50
|
onMouseDown: (e) => {
|
|
52
|
-
e.stopPropagation(),
|
|
51
|
+
e.stopPropagation(), u(), o.getResizeHandler()(e);
|
|
53
52
|
},
|
|
54
53
|
onTouchStart: (e) => {
|
|
55
|
-
e.stopPropagation(),
|
|
54
|
+
e.stopPropagation(), u(), o.getResizeHandler()(e);
|
|
56
55
|
},
|
|
57
56
|
className: `${n.resizer} ${o.column.getIsResizing() ? n.isResizing : ""}`
|
|
58
57
|
})
|
|
@@ -61,5 +60,5 @@ function Q({ styledTableProps: R, header: o, tableCanResize: _ = !1, left: N, ri
|
|
|
61
60
|
}, o.id);
|
|
62
61
|
}
|
|
63
62
|
export {
|
|
64
|
-
|
|
63
|
+
J as TableHeaderCell
|
|
65
64
|
};
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { functionalUpdate as
|
|
2
|
-
var
|
|
1
|
+
import { functionalUpdate as o, makeStateUpdater as u } from "@tanstack/react-table";
|
|
2
|
+
var d = {
|
|
3
3
|
getInitialState: (r) => ({
|
|
4
4
|
...r,
|
|
5
5
|
columnOrder: r?.columnOrder ?? []
|
|
6
6
|
}),
|
|
7
|
-
getDefaultOptions: (r) => ({ onColumnOrderChange:
|
|
7
|
+
getDefaultOptions: (r) => ({ onColumnOrderChange: u("columnOrder", r) }),
|
|
8
8
|
createTable: (r) => {
|
|
9
|
-
const n = r.getAllLeafColumns().map((e) => e.id);
|
|
10
9
|
r.setColumnOrder = (e) => {
|
|
11
|
-
const
|
|
12
|
-
return r.options.onColumnOrderChange?.(
|
|
10
|
+
const n = (t) => o(e, t);
|
|
11
|
+
return r.options.onColumnOrderChange?.(n);
|
|
13
12
|
}, r.resetColumnOrder = () => {
|
|
14
|
-
r.setColumnOrder(
|
|
13
|
+
r.setColumnOrder([]);
|
|
15
14
|
};
|
|
16
15
|
}
|
|
17
16
|
};
|
|
18
17
|
export {
|
|
19
|
-
|
|
18
|
+
d as OrderColumnsFeature
|
|
20
19
|
};
|