asma-ui-core 3.78.11 → 3.79.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/data-display/chip/StyledChip.js +41 -41
- package/dist/components/inputs/button/StyledButton.module.js +8 -8
- package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.js +45 -42
- package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.module.js +8 -8
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +25 -17
- package/dist/components/inputs/field-styles.js +3 -3
- package/dist/components/inputs/radio-button/base-ui/StyledRadio.js +34 -31
- package/dist/components/inputs/radio-button/base-ui/StyledRadio.module.js +10 -10
- package/dist/components/inputs/select/StyledSelect.js +147 -135
- package/dist/components/inputs/select/StyledSelectItem.js +29 -19
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +195 -162
- package/dist/components/inputs/switch/base-ui/StyledSwitch.module.js +4 -4
- package/dist/components/inputs/textarea/StyledTextarea.module.js +4 -4
- package/dist/components/navigation/link/StyledLink.js +11 -10
- package/dist/components/navigation/link/StyledLink.module.js +5 -5
- package/dist/components/navigation/menu/StyledMenuList.js +27 -19
- package/dist/components/navigation/tabs/StyledTab.js +7 -7
- package/dist/components/utils/accordion/base-ui/StyledAccordion.module.js +3 -3
- package/dist/datetime/shared-components/button/StyledButton.module.js +12 -12
- package/dist/src/components/inputs/select/StyledSelectItem.d.ts +3 -1
- package/dist/src/components/navigation/menu/StyledMenuList.d.ts +3 -1
- package/dist/src/table/components/TableRow.d.ts +2 -1
- package/dist/src/table/custom-features/focus-rows/types.d.ts +2 -2
- package/dist/src/table/hooks/useToggleMenuVisibility.hook.d.ts +14 -1
- package/dist/table/components/StyledTable.module.js +52 -52
- package/dist/table/components/TableRow.js +92 -80
- package/dist/table/components/TableRows.js +10 -8
- package/dist/table/components/table-footer/TablePagination.js +77 -64
- package/dist/table/components/table-footer/TableRowCountSelect.js +63 -44
- package/dist/table/components/table-header/TableHeader.js +72 -64
- package/dist/table/custom-features/focus-rows/FocusRowsFeature.js +4 -4
- package/dist/table/hooks/useToggleMenuVisibility.hook.js +77 -11
- package/dist/table/shared-components/button/StyledButton.module.js +9 -9
- package/dist/tailwind.config.d.ts +1 -0
- package/package.json +1 -1
- package/src/styles/_focus.scss +23 -0
- package/src/styles/color-variables/defaultTokens.css +2 -4
- package/src/styles/color-variables/fretexTokens.css +6 -7
- package/src/styles/color-variables/jadeTokens.css +2 -4
- package/src/styles/components-colors/inputVariables.css +2 -2
- package/tw-configs/twConfigs.json +1 -0
- package/dist/table/shared-components/CheckIcon.js +0 -12
- package/dist/table/shared-components/menu-item/index.js +0 -22
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { resolveSx as
|
|
1
|
+
import { cn as x } from "../../../helpers/cn.js";
|
|
2
|
+
import { resolveSx as b } from "../../../helpers/sx.js";
|
|
3
3
|
import { useTabsContext as u } from "./TabsContext.js";
|
|
4
4
|
import { useCallback as h } from "react";
|
|
5
5
|
import { jsx as d } from "react/jsx-runtime";
|
|
6
|
-
var k = ({ value:
|
|
7
|
-
const t = u(), o =
|
|
6
|
+
var k = ({ value: i, label: a, disabled: e, className: s, sx: l, index: m }) => {
|
|
7
|
+
const t = u(), o = i !== void 0 ? i : m, r = t ? t.value === o : !1, c = /\btext-(?:xs|sm|base|lg|xl|\[)/.test(s ?? ""), f = /\bfont-(?:thin|extralight|light|normal|medium|semibold|bold|extrabold|black)\b/.test(s ?? ""), p = /\b(?:uppercase|lowercase|capitalize|normal-case)\b/.test(s ?? "");
|
|
8
8
|
return /* @__PURE__ */ d("button", {
|
|
9
9
|
ref: h((n) => {
|
|
10
10
|
t?.register(o, n);
|
|
@@ -17,12 +17,12 @@ var k = ({ value: a, label: i, disabled: e, className: s, sx: l, index: m }) =>
|
|
|
17
17
|
tabIndex: r ? 0 : -1,
|
|
18
18
|
"data-tab-value": typeof o == "string" || typeof o == "number" ? String(o) : void 0,
|
|
19
19
|
onClick: (n) => !e && t?.onSelect(n, o),
|
|
20
|
-
className:
|
|
20
|
+
className: x("inline-flex min-h-12 min-w-[90px] shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-t-lg border-0 bg-transparent px-4 py-3 tracking-normal outline-none transition-colors", !c && (t?.size === "small" ? "text-base" : "text-lg"), !f && (t?.size === "small" || r || e ? "font-semibold" : "font-medium hover:font-semibold focus-visible:font-semibold"), !p && "normal-case", t?.size === "small" && "min-h-10 px-3 py-2", e ? "text-delta-300" : r ? "text-gama-500" : "text-delta-600", !e && "cursor-pointer", "focus-visible:shadow-[inset_0_0_0_3px_var(--colors-focus-ring)]", !e && !r && "hover:shadow-[inset_0_-2px_0_0_var(--colors-delta-300)]", s),
|
|
21
21
|
style: {
|
|
22
22
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
23
|
-
...
|
|
23
|
+
...b(l)
|
|
24
24
|
},
|
|
25
|
-
children:
|
|
25
|
+
children: a
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
28
|
export {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var r = "
|
|
1
|
+
var r = "_AccordionRoot_kpk99_1", _ = "_Trigger_kpk99_10", e = "_Header_kpk99_28", o = "_TriggerIcon_kpk99_58", a = "_TriggerIconRight_kpk99_69", g = "_Panel_kpk99_77", k = "_Content_kpk99_85", n = {
|
|
2
2
|
AccordionRoot: r,
|
|
3
3
|
Trigger: _,
|
|
4
4
|
Header: e,
|
|
5
5
|
TriggerIcon: o,
|
|
6
6
|
TriggerIconRight: a,
|
|
7
|
-
Panel:
|
|
8
|
-
Content:
|
|
7
|
+
Panel: g,
|
|
8
|
+
Content: k
|
|
9
9
|
};
|
|
10
10
|
export {
|
|
11
11
|
n as default
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
"asma-core-ui-button": "_asma-core-ui-
|
|
3
|
-
contained:
|
|
4
|
-
common:
|
|
5
|
-
medium:
|
|
6
|
-
small:
|
|
1
|
+
var e = "_contained_efhli_6", _ = "_common_efhli_6", t = "_medium_efhli_56", a = "_small_efhli_61", r = "_large_efhli_66", l = "_error_efhli_76", i = "_outlined_efhli_146", o = "_text_efhli_286", f = "_textGray_efhli_426", h = "_textWhite_efhli_496", m = {
|
|
2
|
+
"asma-core-ui-button": "_asma-core-ui-button_efhli_1",
|
|
3
|
+
contained: e,
|
|
4
|
+
common: _,
|
|
5
|
+
medium: t,
|
|
6
|
+
small: a,
|
|
7
7
|
large: r,
|
|
8
|
-
error:
|
|
9
|
-
outlined:
|
|
10
|
-
text:
|
|
11
|
-
textGray:
|
|
12
|
-
textWhite:
|
|
8
|
+
error: l,
|
|
9
|
+
outlined: i,
|
|
10
|
+
text: o,
|
|
11
|
+
textGray: f,
|
|
12
|
+
textWhite: h
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
m as default
|
|
16
16
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { MouseEvent, ReactNode } from 'react';
|
|
2
2
|
export interface StyledSelectItemProps {
|
|
3
|
+
id?: string;
|
|
3
4
|
value?: unknown;
|
|
4
5
|
children?: ReactNode;
|
|
5
6
|
selected?: boolean;
|
|
7
|
+
active?: boolean;
|
|
6
8
|
disabled?: boolean;
|
|
7
9
|
className?: string;
|
|
8
10
|
onClick?: (event: MouseEvent<HTMLLIElement>) => void;
|
|
@@ -11,4 +13,4 @@ export interface StyledSelectItemProps {
|
|
|
11
13
|
* Option row for `StyledSelect` (replaces MUI `MenuItem` in the select context). `role="option"`
|
|
12
14
|
* with a leading check column for the selected state. Public props preserved (DEC-003). TASK-402.
|
|
13
15
|
*/
|
|
14
|
-
export declare const StyledSelectItem: ({ children, selected, disabled, className, onClick, }: StyledSelectItemProps) => JSX.Element;
|
|
16
|
+
export declare const StyledSelectItem: ({ id, children, selected, active, disabled, className, onClick, }: StyledSelectItemProps) => JSX.Element;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { KeyboardEvent, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
export interface StyledMenuListProps {
|
|
3
3
|
children?: ReactNode;
|
|
4
|
+
id?: string;
|
|
5
|
+
role?: 'menu' | 'listbox';
|
|
4
6
|
className?: string;
|
|
5
7
|
/** Focus the first enabled item on mount (MUI Menu autoFocus behaviour). */
|
|
6
8
|
autoFocus?: boolean;
|
|
@@ -13,4 +15,4 @@ export interface StyledMenuListProps {
|
|
|
13
15
|
* Keyboard-navigable `role="menu"` list (replaces MUI `MenuList`). Arrow-key / Home / End roving
|
|
14
16
|
* focus over enabled `[role="menuitem"]` children. TASK-303.
|
|
15
17
|
*/
|
|
16
|
-
export declare const StyledMenuList: ({ children, className, autoFocus, disablePadding, onClick, onKeyDown, }: StyledMenuListProps) => JSX.Element;
|
|
18
|
+
export declare const StyledMenuList: ({ children, id, role, className, autoFocus, disablePadding, onClick, onKeyDown, }: StyledMenuListProps) => JSX.Element;
|
|
@@ -3,10 +3,11 @@ import { StyledTableProps } from '../types';
|
|
|
3
3
|
import { ColumnWindow } from '../hooks/useColumnVirtualizer';
|
|
4
4
|
export declare function TableRow<TData extends {
|
|
5
5
|
id: string | number;
|
|
6
|
-
}, TCustomData = Record<string, unknown>>({ styledTableProps, row, index, columnWindow: { paddingLeft, paddingRight, indexes }, }: {
|
|
6
|
+
}, TCustomData = Record<string, unknown>>({ styledTableProps, row, index, hasFocusedRow, columnWindow: { paddingLeft, paddingRight, indexes }, }: {
|
|
7
7
|
styledTableProps: StyledTableProps<TData, TCustomData>;
|
|
8
8
|
row: Row<TData>;
|
|
9
9
|
columnWindow: ColumnWindow;
|
|
10
10
|
index: number;
|
|
11
|
+
hasFocusedRow: boolean;
|
|
11
12
|
}): JSX.Element;
|
|
12
13
|
export declare const Checkmark: () => JSX.Element;
|
|
@@ -6,8 +6,8 @@ export interface FocusedRow {
|
|
|
6
6
|
toggleFocused: () => void;
|
|
7
7
|
onChangeFocused: (newExpanded: boolean, rowId?: string) => void;
|
|
8
8
|
isFocused: () => boolean;
|
|
9
|
-
focusNextRow: () =>
|
|
10
|
-
focusPrevRow: () =>
|
|
9
|
+
focusNextRow: () => boolean;
|
|
10
|
+
focusPrevRow: () => boolean;
|
|
11
11
|
}
|
|
12
12
|
export interface FocusedRowsOptions {
|
|
13
13
|
onChangeFocusedRow?: OnChangeFn<string | null>;
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
+
import { KeyboardEvent, MouseEvent, RefObject } from 'react';
|
|
1
2
|
interface ToggleMenuVisibility {
|
|
2
3
|
open: boolean;
|
|
3
4
|
anchorEl: HTMLElement | SVGSVGElement | null;
|
|
4
|
-
handleOpen: (event:
|
|
5
|
+
handleOpen: (event: MouseEvent<HTMLElement | SVGSVGElement> | KeyboardEvent<HTMLElement>) => void;
|
|
5
6
|
handleClose: () => void;
|
|
6
7
|
}
|
|
8
|
+
interface KeyboardSelectMenu extends ToggleMenuVisibility {
|
|
9
|
+
triggerRef: RefObject<HTMLButtonElement>;
|
|
10
|
+
activeIndex: number | null;
|
|
11
|
+
handleKeyDown: (event: KeyboardEvent<HTMLButtonElement>) => void;
|
|
12
|
+
}
|
|
13
|
+
interface KeyboardSelectMenuOptions {
|
|
14
|
+
optionCount: number;
|
|
15
|
+
selectedIndex: number;
|
|
16
|
+
onSelect: (index: number) => void;
|
|
17
|
+
focusHeaderOnShiftTab?: boolean;
|
|
18
|
+
}
|
|
7
19
|
export declare const useToggleMenuVisibility: () => ToggleMenuVisibility;
|
|
20
|
+
export declare const useKeyboardSelectMenu: ({ optionCount, selectedIndex, onSelect, focusHeaderOnShiftTab, }: KeyboardSelectMenuOptions) => KeyboardSelectMenu;
|
|
8
21
|
export {};
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
var e = "
|
|
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-
|
|
1
|
+
var e = "_tbody_z31fh_124", _ = "_expanded_row_z31fh_174", l = "_selected_z31fh_192", t = "_shadowed_z31fh_217", a = "_resizer_z31fh_274", o = "_isResizing_z31fh_286", h = {
|
|
2
|
+
"asma-ui-table-styled-table": "_asma-ui-table-styled-table_z31fh_1",
|
|
3
|
+
"table-wrapper": "_table-wrapper_z31fh_26",
|
|
4
|
+
"table-shell": "_table-shell_z31fh_33",
|
|
5
|
+
"table-wrapper--no-rows": "_table-wrapper--no-rows_z31fh_39",
|
|
6
|
+
"table-wrapper--proxy": "_table-wrapper--proxy_z31fh_42",
|
|
7
|
+
"table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_z31fh_43",
|
|
8
|
+
"table-wrapper-fetching": "_table-wrapper-fetching_z31fh_53",
|
|
9
|
+
"table-scroll": "_table-scroll_z31fh_56",
|
|
10
|
+
"table-x--fill-height": "_table-x--fill-height_z31fh_65",
|
|
11
|
+
"table-x": "_table-x_z31fh_65",
|
|
12
|
+
"table-content": "_table-content_z31fh_80",
|
|
13
|
+
"table-header--sticky": "_table-header--sticky_z31fh_85",
|
|
14
|
+
"table-hscroll": "_table-hscroll_z31fh_90",
|
|
15
|
+
"table-hscroll__content": "_table-hscroll__content_z31fh_100",
|
|
16
|
+
"no-rows-overlay-container": "_no-rows-overlay-container_z31fh_103",
|
|
17
|
+
"no-rows-overlay-content": "_no-rows-overlay-content_z31fh_111",
|
|
18
|
+
"styled-table": "_styled-table_z31fh_115",
|
|
19
19
|
tbody: e,
|
|
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-
|
|
20
|
+
"loading-icon": "_loading-icon_z31fh_129",
|
|
21
|
+
"t-row": "_t-row_z31fh_136",
|
|
22
|
+
"t-cell": "_t-cell_z31fh_136",
|
|
23
|
+
"action-cell": "_action-cell_z31fh_146",
|
|
24
|
+
"fixed-cell": "_fixed-cell_z31fh_150",
|
|
25
|
+
"fixed-right-cell": "_fixed-right-cell_z31fh_153",
|
|
26
26
|
expanded_row: _,
|
|
27
27
|
selected: l,
|
|
28
|
-
"single-selection": "_single-
|
|
29
|
-
"action-cell--no-shadow": "_action-cell--no-
|
|
30
|
-
shadowed:
|
|
31
|
-
"shadowed-right": "_shadowed-
|
|
32
|
-
"is-loading": "_is-
|
|
33
|
-
"action-cell-default-background": "_action-cell-default-
|
|
34
|
-
"fixed-cell-default-background": "_fixed-cell-default-
|
|
35
|
-
"fixed-right-cell-default-background": "_fixed-right-cell-default-
|
|
36
|
-
"sortable-column": "_sortable-
|
|
37
|
-
resizer:
|
|
38
|
-
isResizing:
|
|
39
|
-
"hide-table-header": "_hide-table-
|
|
40
|
-
"show-table-header": "_show-table-
|
|
41
|
-
"table-header": "_table-
|
|
42
|
-
"hide-header": "_hide-
|
|
43
|
-
"t-cell__actions": "_t-
|
|
44
|
-
"t-cell__actions--no-shadow": "_t-cell__actions--no-
|
|
45
|
-
"t-cell__fixed": "_t-
|
|
46
|
-
"t-cell__fixed-right": "_t-cell__fixed-
|
|
47
|
-
"sort-icon": "_sort-
|
|
48
|
-
"header-content": "_header-
|
|
49
|
-
"table-footer--sticky": "_table-footer--
|
|
50
|
-
"table-footer--inline": "_table-footer--
|
|
51
|
-
"table-bottom": "_table-
|
|
52
|
-
"table-bottom--sticky": "_table-bottom--
|
|
53
|
-
"cursor-not-allowed": "_cursor-not-
|
|
54
|
-
"select-control": "_select-
|
|
28
|
+
"single-selection": "_single-selection_z31fh_195",
|
|
29
|
+
"action-cell--no-shadow": "_action-cell--no-shadow_z31fh_213",
|
|
30
|
+
shadowed: t,
|
|
31
|
+
"shadowed-right": "_shadowed-right_z31fh_253",
|
|
32
|
+
"is-loading": "_is-loading_z31fh_258",
|
|
33
|
+
"action-cell-default-background": "_action-cell-default-background_z31fh_261",
|
|
34
|
+
"fixed-cell-default-background": "_fixed-cell-default-background_z31fh_264",
|
|
35
|
+
"fixed-right-cell-default-background": "_fixed-right-cell-default-background_z31fh_267",
|
|
36
|
+
"sortable-column": "_sortable-column_z31fh_270",
|
|
37
|
+
resizer: a,
|
|
38
|
+
isResizing: o,
|
|
39
|
+
"hide-table-header": "_hide-table-header_z31fh_298",
|
|
40
|
+
"show-table-header": "_show-table-header_z31fh_302",
|
|
41
|
+
"table-header": "_table-header_z31fh_85",
|
|
42
|
+
"hide-header": "_hide-header_z31fh_338",
|
|
43
|
+
"t-cell__actions": "_t-cell__actions_z31fh_341",
|
|
44
|
+
"t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_z31fh_350",
|
|
45
|
+
"t-cell__fixed": "_t-cell__fixed_z31fh_355",
|
|
46
|
+
"t-cell__fixed-right": "_t-cell__fixed-right_z31fh_363",
|
|
47
|
+
"sort-icon": "_sort-icon_z31fh_371",
|
|
48
|
+
"header-content": "_header-content_z31fh_375",
|
|
49
|
+
"table-footer--sticky": "_table-footer--sticky_z31fh_406",
|
|
50
|
+
"table-footer--inline": "_table-footer--inline_z31fh_417",
|
|
51
|
+
"table-bottom": "_table-bottom_z31fh_428",
|
|
52
|
+
"table-bottom--sticky": "_table-bottom--sticky_z31fh_442",
|
|
53
|
+
"cursor-not-allowed": "_cursor-not-allowed_z31fh_446",
|
|
54
|
+
"select-control": "_select-control_z31fh_450"
|
|
55
55
|
};
|
|
56
56
|
export {
|
|
57
|
-
|
|
57
|
+
h as default
|
|
58
58
|
};
|
|
@@ -1,62 +1,66 @@
|
|
|
1
|
-
import { ACTIONS_COLUMN_ID as
|
|
2
|
-
import { useRootContext as
|
|
1
|
+
import { ACTIONS_COLUMN_ID as $ } from "../types.js";
|
|
2
|
+
import { useRootContext as ge } from "../context/RootContext.js";
|
|
3
3
|
import n from "./StyledTable.module.js";
|
|
4
|
-
import { compact as
|
|
5
|
-
import
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { Fragment as Se, jsx as s, jsxs as
|
|
8
|
-
import { useSortable as
|
|
9
|
-
import { flexRender as
|
|
10
|
-
import { CSS as
|
|
11
|
-
|
|
12
|
-
const
|
|
4
|
+
import { compact as he } from "../../helpers/arrays.js";
|
|
5
|
+
import j from "clsx";
|
|
6
|
+
import { Fragment as pe, useCallback as q, useEffect as xe, useLayoutEffect as be, useMemo as m, useRef as Ce, useState as Re } from "react";
|
|
7
|
+
import { Fragment as Se, jsx as s, jsxs as b } from "react/jsx-runtime";
|
|
8
|
+
import { useSortable as De } from "@dnd-kit/sortable";
|
|
9
|
+
import { flexRender as ye } from "@tanstack/react-table";
|
|
10
|
+
import { CSS as Ne } from "@dnd-kit/utilities";
|
|
11
|
+
var Fe = (C) => {
|
|
12
|
+
const t = C.closest("table");
|
|
13
|
+
t && Array.from(document.querySelectorAll('a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])')).find((f) => !t.contains(f) && !!(t.compareDocumentPosition(f) & Node.DOCUMENT_POSITION_FOLLOWING))?.focus();
|
|
14
|
+
};
|
|
15
|
+
function Oe({ styledTableProps: C, row: t, index: f, hasFocusedRow: K, columnWindow: { paddingLeft: g, paddingRight: h, indexes: I } }) {
|
|
16
|
+
const { loading: G, getRowClassName: l, rowHeight: p, onRowClick: R, expandArrow: V, enableDnd: T, disableDndForRow: Y, tdClassName: w, customSubRowData: A, renderSubRows: J, defaultExpanded: Q, actions: S, customActionsNode: X, textExpandArrow: B, enableMultiRowSelection: Z, enableRowSelection: ee, singleSelectionRow: te } = C, D = Y?.(t), { transform: ne, transition: oe, setNodeRef: L, isDragging: M } = De({
|
|
13
17
|
id: t.original.id,
|
|
14
|
-
disabled: !
|
|
18
|
+
disabled: !T || D
|
|
15
19
|
}), ie = {
|
|
16
|
-
transform:
|
|
17
|
-
transition:
|
|
18
|
-
opacity:
|
|
19
|
-
zIndex:
|
|
20
|
+
transform: Ne.Transform.toString(ne),
|
|
21
|
+
transition: oe,
|
|
22
|
+
opacity: M ? 0.8 : 1,
|
|
23
|
+
zIndex: M ? 1 : 0,
|
|
20
24
|
position: "relative"
|
|
21
|
-
}, { isResizing:
|
|
25
|
+
}, { isResizing: se, disableResizingFlag: le } = ge(), y = t.isExpanded(), x = Ce(null), [ae, ce] = Re(void 0);
|
|
26
|
+
be(() => {
|
|
27
|
+
!y && x.current && ce(x.current.cells[0]?.clientHeight ?? x.current.offsetHeight);
|
|
28
|
+
}, [y]);
|
|
29
|
+
const de = q((e) => {
|
|
30
|
+
x.current = e, D || L(e);
|
|
31
|
+
}, [D, L]), H = y ? ae ?? p : p;
|
|
22
32
|
xe(() => {
|
|
23
|
-
|
|
24
|
-
}, [b]);
|
|
25
|
-
const de = j((e) => {
|
|
26
|
-
p.current = e, S || A(e);
|
|
27
|
-
}, [S, A]), L = b ? le ?? h : h;
|
|
28
|
-
pe(() => {
|
|
29
|
-
J && t.getCanExpand() && !t.getIsExpanded() && t.toggleExpand();
|
|
33
|
+
Q && t.getCanExpand() && !t.getIsExpanded() && t.toggleExpand();
|
|
30
34
|
}, []);
|
|
31
|
-
const
|
|
32
|
-
t.getCanExpand() && !
|
|
33
|
-
const
|
|
34
|
-
!
|
|
35
|
-
},
|
|
36
|
-
e.target.classList.contains("MuiModal-backdrop") || e.target.nodeName === "INPUT" || e.target.nodeName === "BUTTON" || e.target.nodeName === "LI" || e.target.closest("li") ||
|
|
37
|
-
}, r = t.getVisibleCells().map((e,
|
|
35
|
+
const O = (e) => {
|
|
36
|
+
t.getCanExpand() && !V && t.getToggleExpandedHandler()(), document.getElementById(t.id)?.focus();
|
|
37
|
+
const o = window.getSelection()?.type !== "Range" && !se, i = R instanceof Function;
|
|
38
|
+
!i && B && o ? t.toggleExpand() : i && o && R(e, t), le();
|
|
39
|
+
}, re = (e) => {
|
|
40
|
+
e.target.classList.contains("MuiModal-backdrop") || e.target.nodeName === "INPUT" || e.target.nodeName === "BUTTON" || e.target.nodeName === "LI" || e.target.closest("li") || O(e);
|
|
41
|
+
}, r = t.getVisibleCells().map((e, o, i) => ({
|
|
38
42
|
...e,
|
|
39
|
-
left:
|
|
40
|
-
})),
|
|
43
|
+
left: i.slice(0, o).reduce((c, d) => c + (d.column.getSize() ?? 0), 0)
|
|
44
|
+
})), U = m(() => r.filter((e) => !e.column.columnDef.fixedLeft && !e.column.columnDef.fixedRight && e.column.id !== "actions"), [r]), a = m(() => r.filter((e) => !!e.column.columnDef.fixedRight || e.column.id === "actions").map((e, o, i) => ({
|
|
41
45
|
...e,
|
|
42
|
-
right:
|
|
43
|
-
})), [r]),
|
|
44
|
-
const
|
|
46
|
+
right: i.slice(o + 1).reduce((c, d) => c + (d.column.getSize() ?? 0), 0)
|
|
47
|
+
})), [r]), W = m(() => a.some((e) => e.column.id === $), [a]), _ = !!S || !!X, z = m(() => a.some((e) => !!e.column.columnDef.fixedRight), [a]), u = m(() => r.filter((e) => e.column.columnDef.fixedLeft), [r]), N = !Z && !ee && te, F = t.getIsSelected() && N, k = R instanceof Function, P = I.length > 0 ? he(I.map((e) => U[e])) : U, v = q((e, o) => {
|
|
48
|
+
const i = e.column.id === $, c = e.column.columnDef.fixedLeft, d = !!e.column.columnDef.fixedRight, ue = e.id === u.at(-1)?.id, fe = e.id === a.at(0)?.id && !i, me = t.isExpanded(), E = o === 0;
|
|
45
49
|
return /* @__PURE__ */ s("td", {
|
|
46
|
-
className:
|
|
50
|
+
className: j(n["t-cell"], k && "cursor-pointer", w, i && n["action-cell"], i && (!_ || z) && n["action-cell--no-shadow"], i && !!S && u.length && n.shadowed, i && (l?.(t) ? l?.(t) : n["action-cell-default-background"]), c && n["fixed-cell"], d && n["fixed-right-cell"], ue && n.shadowed, fe && n["shadowed-right"], t.getIsSelected() && n.selected, c && (l?.(t) ? l?.(t) : n["fixed-cell-default-background"]), d && (l?.(t) ? l?.(t) : n["fixed-right-cell-default-background"]), me && n.expanded_row, !!F && n["single-selection"]),
|
|
47
51
|
style: {
|
|
48
|
-
left:
|
|
49
|
-
right:
|
|
52
|
+
left: c ? e.left : void 0,
|
|
53
|
+
right: d ? e.right + (W ? -1 : 0) : void 0
|
|
50
54
|
},
|
|
51
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ b("div", {
|
|
52
56
|
style: {
|
|
53
57
|
display: "flex",
|
|
54
58
|
alignItems: "center",
|
|
55
59
|
minWidth: E ? 32 : void 0,
|
|
56
|
-
minHeight:
|
|
60
|
+
minHeight: H,
|
|
57
61
|
position: "relative"
|
|
58
62
|
},
|
|
59
|
-
children: [E &&
|
|
63
|
+
children: [E && F && /* @__PURE__ */ s("span", {
|
|
60
64
|
style: {
|
|
61
65
|
display: "inline-flex",
|
|
62
66
|
alignItems: "center",
|
|
@@ -65,94 +69,102 @@ function Me({ styledTableProps: P, row: t, index: K, columnWindow: { paddingLeft
|
|
|
65
69
|
top: "50%",
|
|
66
70
|
transform: "translateY(-50%)"
|
|
67
71
|
},
|
|
68
|
-
children: /* @__PURE__ */ s(
|
|
72
|
+
children: /* @__PURE__ */ s(ke, {})
|
|
69
73
|
}), /* @__PURE__ */ s("span", {
|
|
70
74
|
style: {
|
|
71
|
-
marginLeft: E &&
|
|
75
|
+
marginLeft: E && N ? 30 : 0,
|
|
72
76
|
width: "100%"
|
|
73
77
|
},
|
|
74
|
-
children:
|
|
78
|
+
children: ye(e.column.columnDef.cell, e.getContext())
|
|
75
79
|
})]
|
|
76
80
|
})
|
|
77
81
|
}, e.id);
|
|
78
82
|
}, [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
F,
|
|
84
|
+
S,
|
|
85
|
+
H,
|
|
82
86
|
l,
|
|
83
|
-
|
|
84
|
-
z,
|
|
87
|
+
k,
|
|
85
88
|
W,
|
|
86
|
-
|
|
89
|
+
z,
|
|
90
|
+
u,
|
|
87
91
|
a,
|
|
88
92
|
t,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
_,
|
|
94
|
+
N,
|
|
95
|
+
w
|
|
92
96
|
]);
|
|
93
|
-
return /* @__PURE__ */
|
|
97
|
+
return /* @__PURE__ */ b(pe, { children: [/* @__PURE__ */ b("tr", {
|
|
94
98
|
"aria-selected": t.getIsSelected() || t.isFocused() ? "true" : "false",
|
|
95
|
-
tabIndex: t.isFocused() ? 0 : -1,
|
|
96
|
-
"data-index":
|
|
99
|
+
tabIndex: t.isFocused() || f === 0 && !K ? 0 : -1,
|
|
100
|
+
"data-index": f,
|
|
97
101
|
"data-test": t.id,
|
|
98
102
|
id: t.id,
|
|
99
|
-
className:
|
|
103
|
+
className: j(n["t-row"], G && n["is-loading"], l?.(t)),
|
|
100
104
|
style: {
|
|
101
|
-
height:
|
|
102
|
-
...
|
|
105
|
+
height: p ? `${p}px` : "inherit",
|
|
106
|
+
...T && ie
|
|
103
107
|
},
|
|
104
108
|
ref: de,
|
|
105
|
-
|
|
109
|
+
onFocus: (e) => {
|
|
110
|
+
e.target === e.currentTarget && !t.isFocused() && t.onChangeFocused(!0);
|
|
111
|
+
},
|
|
112
|
+
onMouseUp: re,
|
|
106
113
|
onMouseDown: (e) => {
|
|
107
|
-
e.detail > 1 && !
|
|
114
|
+
e.detail > 1 && !k && B && e.preventDefault();
|
|
108
115
|
},
|
|
109
116
|
onKeyDown: (e) => {
|
|
110
117
|
switch (e.key) {
|
|
111
118
|
case "Tab":
|
|
119
|
+
if (e.preventDefault(), e.shiftKey) {
|
|
120
|
+
if (t.focusPrevRow()) break;
|
|
121
|
+
e.currentTarget.closest("table")?.querySelector('thead tr[tabindex="0"]')?.focus();
|
|
122
|
+
} else t.focusNextRow() || Fe(e.currentTarget);
|
|
123
|
+
break;
|
|
112
124
|
case "ArrowDown":
|
|
113
|
-
t.focusNextRow()
|
|
125
|
+
t.focusNextRow() && e.preventDefault();
|
|
114
126
|
break;
|
|
115
127
|
case "ArrowUp":
|
|
116
|
-
t.focusPrevRow()
|
|
128
|
+
t.focusPrevRow() && e.preventDefault();
|
|
117
129
|
break;
|
|
118
130
|
case "Enter":
|
|
119
|
-
|
|
131
|
+
O(e);
|
|
120
132
|
break;
|
|
121
133
|
}
|
|
122
134
|
},
|
|
123
135
|
children: [
|
|
124
|
-
|
|
125
|
-
|
|
136
|
+
u.map((e, o) => v(e, o)),
|
|
137
|
+
g > 0 && /* @__PURE__ */ s("td", {
|
|
126
138
|
"aria-hidden": !0,
|
|
127
139
|
className: n["t-cell"],
|
|
128
140
|
style: {
|
|
129
|
-
width: String(
|
|
130
|
-
minWidth: String(
|
|
131
|
-
maxWidth: String(
|
|
141
|
+
width: String(g) + "px",
|
|
142
|
+
minWidth: String(g) + "px",
|
|
143
|
+
maxWidth: String(g) + "px",
|
|
132
144
|
padding: 0,
|
|
133
145
|
border: "none"
|
|
134
146
|
}
|
|
135
147
|
}),
|
|
136
|
-
|
|
137
|
-
|
|
148
|
+
P.map((e, o) => v(e, u.length + o)),
|
|
149
|
+
h > 0 && /* @__PURE__ */ s("td", {
|
|
138
150
|
"aria-hidden": !0,
|
|
139
151
|
className: n["t-cell"],
|
|
140
152
|
style: {
|
|
141
|
-
width: String(
|
|
142
|
-
minWidth: String(
|
|
143
|
-
maxWidth: String(
|
|
153
|
+
width: String(h) + "px",
|
|
154
|
+
minWidth: String(h) + "px",
|
|
155
|
+
maxWidth: String(h) + "px",
|
|
144
156
|
padding: 0,
|
|
145
157
|
border: "none"
|
|
146
158
|
}
|
|
147
159
|
}),
|
|
148
|
-
a.map((e,
|
|
160
|
+
a.map((e, o) => v(e, u.length + P.length + o))
|
|
149
161
|
]
|
|
150
|
-
}), t.getIsExpanded() && /* @__PURE__ */ s(Se, { children:
|
|
151
|
-
rows:
|
|
162
|
+
}), t.getIsExpanded() && /* @__PURE__ */ s(Se, { children: A && J?.({
|
|
163
|
+
rows: A.get(t.original.id.toString()) ?? [],
|
|
152
164
|
row: t.original
|
|
153
165
|
}) })] }, t.id);
|
|
154
166
|
}
|
|
155
|
-
var
|
|
167
|
+
var ke = () => /* @__PURE__ */ b("svg", {
|
|
156
168
|
xmlns: "http://www.w3.org/2000/svg",
|
|
157
169
|
width: "20",
|
|
158
170
|
height: "20",
|
|
@@ -164,5 +176,5 @@ var ye = () => /* @__PURE__ */ x("svg", {
|
|
|
164
176
|
})]
|
|
165
177
|
});
|
|
166
178
|
export {
|
|
167
|
-
|
|
179
|
+
Oe as TableRow
|
|
168
180
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { TableRow as
|
|
2
|
-
import { Fragment as
|
|
3
|
-
function R({ styledTableProps:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { TableRow as m } from "./TableRow.js";
|
|
2
|
+
import { Fragment as w, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
function R({ styledTableProps: e, table: r, columnWindow: n }) {
|
|
4
|
+
const s = e.hideFooter ? r.getExpandedRowModel().rows : r.getRowModel().rows, d = s.some((o) => o.isFocused());
|
|
5
|
+
return /* @__PURE__ */ t(w, { children: s.map((o, i) => /* @__PURE__ */ t(m, {
|
|
6
|
+
styledTableProps: e,
|
|
7
|
+
row: o,
|
|
8
|
+
index: i,
|
|
9
|
+
hasFocusedRow: d,
|
|
8
10
|
columnWindow: n
|
|
9
|
-
},
|
|
11
|
+
}, o.id)) });
|
|
10
12
|
}
|
|
11
13
|
export {
|
|
12
14
|
R as TableRows
|