asma-ui-core 3.78.12 → 3.79.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asma-ui-core.css +1 -1
- package/dist/components/custom/module/header-layout/DynamicToolbar.js +14 -14
- package/dist/components/custom/module/header-layout/ToolbarActionGroup.js +23 -21
- package/dist/components/custom/module/header-layout/ToolbarRows.js +4 -4
- package/dist/components/data-display/chip/StyledChip.js +41 -41
- package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +105 -0
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +6 -6
- 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/index.js +176 -174
- package/dist/src/components/feedback/dialog/dialog-footer/StyledDialogFooter.d.ts +62 -0
- package/dist/src/components/feedback/dialog/dialog-footer/StyledDialogFooter.test.d.ts +1 -0
- package/dist/src/components/feedback/dialog/dialog-footer/index.d.ts +2 -0
- package/dist/src/components/feedback/dialog/index.d.ts +1 -0
- package/dist/src/components/inputs/select/StyledSelectItem.d.ts +3 -1
- package/dist/src/components/inputs/select-autocomplete/StyledSelectAutocomplete.d.ts +1 -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/columns/action-column/components/HeaderActionMenu.js +4 -4
- 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
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { StyledButtonType } from '../../../inputs/button';
|
|
3
|
+
import { DynamicToolbarAction } from '../../../custom/module/header-layout/planToolbarActions';
|
|
4
|
+
import { ToolbarLocale } from '../../../custom/module/header-layout/useTranslations';
|
|
5
|
+
/** One of the two right-cluster buttons (Figma "Right": Cancel + primary). */
|
|
6
|
+
export interface StyledDialogFooterButton {
|
|
7
|
+
label: string;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** `submit` lets the footer drive the surrounding `<form>` without a click handler. */
|
|
11
|
+
type?: 'button' | 'submit' | 'reset';
|
|
12
|
+
/** Overrides the cluster default (`contained` for primary, `outlined` for secondary). */
|
|
13
|
+
variant?: StyledButtonType;
|
|
14
|
+
/** Renders in the destructive palette (Figma `Danger = on`). */
|
|
15
|
+
tone?: 'default' | 'danger';
|
|
16
|
+
icon?: ReactNode;
|
|
17
|
+
dataTest?: string;
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface StyledDialogFooterProps {
|
|
21
|
+
/**
|
|
22
|
+
* Left cluster (Figma "Left"): destructive and utility actions. They keep their
|
|
23
|
+
* labels while they fit, collapse to icon-only next, and move into an icon-only
|
|
24
|
+
* "More" menu once even that overflows — so 1, 2, 3 and 3+ actions all resolve to
|
|
25
|
+
* the approved layout without the caller branching on width.
|
|
26
|
+
*/
|
|
27
|
+
leftActions?: DynamicToolbarAction[];
|
|
28
|
+
/** Replaces the planned left cluster with arbitrary content — Figma's "Checkbox+Label" left variant, or footer info text. */
|
|
29
|
+
leadingSlot?: ReactNode;
|
|
30
|
+
/** Outlined action left of the primary — Cancel. */
|
|
31
|
+
secondaryAction?: StyledDialogFooterButton;
|
|
32
|
+
/** Rightmost contained action — Save changes / Add new …. */
|
|
33
|
+
primaryAction?: StyledDialogFooterButton;
|
|
34
|
+
/** Pins the footer to the bottom of its scroll container with the DS `Fixed bottom` shadow. */
|
|
35
|
+
fixed?: boolean;
|
|
36
|
+
/** Bottom corners rounded to sit flush inside a dialog paper. Pass `false` for a full-bleed page footer. */
|
|
37
|
+
rounded?: boolean;
|
|
38
|
+
locale?: ToolbarLocale;
|
|
39
|
+
className?: string;
|
|
40
|
+
dataTest?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Developer: alexandr.doicov@carasent.com
|
|
44
|
+
*
|
|
45
|
+
* @figmaNode wXrXt5uKNNzV2DnQCgyYZH#26769-135283
|
|
46
|
+
* @remarks Figma "Dialog footer" component set. The Figma `State` property
|
|
47
|
+
* (Create/Edit/More/Reset filter) is **not** a prop — it is the emergent result of which
|
|
48
|
+
* actions the caller passes and how much room the container leaves, which is the whole
|
|
49
|
+
* point of ASMA-7099. `Mobile` is likewise derived from the **container** width, not the
|
|
50
|
+
* viewport, so a footer inside a narrow popover compacts even on a desktop screen.
|
|
51
|
+
*
|
|
52
|
+
* Layout: `Left` cluster (planned, adaptive) · `Right` cluster (Cancel + primary, always
|
|
53
|
+
* visible and never overflowed — the primary action must stay reachable).
|
|
54
|
+
*
|
|
55
|
+
* @param leftActions - adaptive left cluster; label → icon-only → More menu
|
|
56
|
+
* @param leadingSlot - arbitrary left content, replaces `leftActions`
|
|
57
|
+
* @param secondaryAction - outlined Cancel
|
|
58
|
+
* @param primaryAction - contained primary
|
|
59
|
+
* @param fixed - sticky bottom + `Fixed bottom` shadow
|
|
60
|
+
* @param rounded - rounded bottom corners (default `true`)
|
|
61
|
+
*/
|
|
62
|
+
export declare function StyledDialogFooter({ leftActions, leadingSlot, secondaryAction, primaryAction, fixed, rounded, locale, className, dataTest, }: StyledDialogFooterProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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;
|
|
@@ -43,7 +43,7 @@ type AutocompleteValue<T, Multiple, DisableClearable, FreeSolo> = Multiple exten
|
|
|
43
43
|
* so the field **State** (Enabled/Hovered/Focused/Error/Read-only) ← focus/open + `error`/`readOnly`/
|
|
44
44
|
* `disabled`. **Filled** ← selected value(s): single fills the input text, multiple renders **Tag
|
|
45
45
|
* chips** (`StyledChip`: h32, radius25, label 16/delta-700 — node 20475-29954). The dropdown is the
|
|
46
|
-
* **Menus** surface (node 16073-19226):
|
|
46
|
+
* **Menus** surface (node 16073-19226): radius 4 (Figma `menus` token), border delta-300, Menus shadow. Popup indicator =
|
|
47
47
|
* `+` (`PlusIconCircle`, multiple) or chevron (single); clear = `CloseIcon`. Non-annotated props are
|
|
48
48
|
*/
|
|
49
49
|
export interface StyledSelectAutocompleteProps<T, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false> {
|
|
@@ -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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn as v } from "../../../../../helpers/cn.js";
|
|
2
2
|
import { PinIcon as D } from "../../../../../components/icons/pin-icon/PinIcon.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { StyledPopover as _ } from "../../../../../components/utils/popover/StyledPopover.js";
|
|
4
|
+
import { message as T } from "../../../../../components/feedback/snack-bar/message.js";
|
|
5
5
|
import { INTERNAL_COLUMN_IDS as S } from "../../../../types.js";
|
|
6
6
|
import { StyledCheckbox as A } from "../../../../shared-components/StyledCheckbox.js";
|
|
7
7
|
import { StyledTooltip as L } from "../../../../shared-components/tooltip/index.js";
|
|
@@ -53,7 +53,7 @@ function fe({ headerData: n, locale: u }) {
|
|
|
53
53
|
className: m["actions-header"],
|
|
54
54
|
onClick: b,
|
|
55
55
|
children: [/* @__PURE__ */ o(D, { className: m["pin-icon"] }), g && /* @__PURE__ */ o("div", { className: m["pin-indicator"] })]
|
|
56
|
-
}), /* @__PURE__ */ f(
|
|
56
|
+
}), /* @__PURE__ */ f(_, {
|
|
57
57
|
anchorEl: p,
|
|
58
58
|
anchorOrigin: {
|
|
59
59
|
horizontal: "left",
|
|
@@ -135,7 +135,7 @@ function fe({ headerData: n, locale: u }) {
|
|
|
135
135
|
variant: "text",
|
|
136
136
|
className: "h-10",
|
|
137
137
|
onClick: () => {
|
|
138
|
-
n.table.resetColumnOrder(),
|
|
138
|
+
n.table.resetColumnOrder(), T.info(s.column_order_reset, { closeButton: !0 });
|
|
139
139
|
},
|
|
140
140
|
children: s.reset_order
|
|
141
141
|
})
|