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.
Files changed (56) hide show
  1. package/dist/asma-ui-core.css +1 -1
  2. package/dist/components/custom/module/header-layout/DynamicToolbar.js +14 -14
  3. package/dist/components/custom/module/header-layout/ToolbarActionGroup.js +23 -21
  4. package/dist/components/custom/module/header-layout/ToolbarRows.js +4 -4
  5. package/dist/components/data-display/chip/StyledChip.js +41 -41
  6. package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +105 -0
  7. package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +6 -6
  8. package/dist/components/inputs/button/StyledButton.module.js +8 -8
  9. package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.js +45 -42
  10. package/dist/components/inputs/checkbox/base-ui/StyledCheckbox.module.js +8 -8
  11. package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +25 -17
  12. package/dist/components/inputs/field-styles.js +3 -3
  13. package/dist/components/inputs/radio-button/base-ui/StyledRadio.js +34 -31
  14. package/dist/components/inputs/radio-button/base-ui/StyledRadio.module.js +10 -10
  15. package/dist/components/inputs/select/StyledSelect.js +147 -135
  16. package/dist/components/inputs/select/StyledSelectItem.js +29 -19
  17. package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +195 -162
  18. package/dist/components/inputs/switch/base-ui/StyledSwitch.module.js +4 -4
  19. package/dist/components/inputs/textarea/StyledTextarea.module.js +4 -4
  20. package/dist/components/navigation/link/StyledLink.js +11 -10
  21. package/dist/components/navigation/link/StyledLink.module.js +5 -5
  22. package/dist/components/navigation/menu/StyledMenuList.js +27 -19
  23. package/dist/components/navigation/tabs/StyledTab.js +7 -7
  24. package/dist/components/utils/accordion/base-ui/StyledAccordion.module.js +3 -3
  25. package/dist/datetime/shared-components/button/StyledButton.module.js +12 -12
  26. package/dist/index.js +176 -174
  27. package/dist/src/components/feedback/dialog/dialog-footer/StyledDialogFooter.d.ts +62 -0
  28. package/dist/src/components/feedback/dialog/dialog-footer/StyledDialogFooter.test.d.ts +1 -0
  29. package/dist/src/components/feedback/dialog/dialog-footer/index.d.ts +2 -0
  30. package/dist/src/components/feedback/dialog/index.d.ts +1 -0
  31. package/dist/src/components/inputs/select/StyledSelectItem.d.ts +3 -1
  32. package/dist/src/components/inputs/select-autocomplete/StyledSelectAutocomplete.d.ts +1 -1
  33. package/dist/src/components/navigation/menu/StyledMenuList.d.ts +3 -1
  34. package/dist/src/table/components/TableRow.d.ts +2 -1
  35. package/dist/src/table/custom-features/focus-rows/types.d.ts +2 -2
  36. package/dist/src/table/hooks/useToggleMenuVisibility.hook.d.ts +14 -1
  37. package/dist/table/components/StyledTable.module.js +52 -52
  38. package/dist/table/components/TableRow.js +92 -80
  39. package/dist/table/components/TableRows.js +10 -8
  40. package/dist/table/components/columns/action-column/components/HeaderActionMenu.js +4 -4
  41. package/dist/table/components/table-footer/TablePagination.js +77 -64
  42. package/dist/table/components/table-footer/TableRowCountSelect.js +63 -44
  43. package/dist/table/components/table-header/TableHeader.js +72 -64
  44. package/dist/table/custom-features/focus-rows/FocusRowsFeature.js +4 -4
  45. package/dist/table/hooks/useToggleMenuVisibility.hook.js +77 -11
  46. package/dist/table/shared-components/button/StyledButton.module.js +9 -9
  47. package/dist/tailwind.config.d.ts +1 -0
  48. package/package.json +1 -1
  49. package/src/styles/_focus.scss +23 -0
  50. package/src/styles/color-variables/defaultTokens.css +2 -4
  51. package/src/styles/color-variables/fretexTokens.css +6 -7
  52. package/src/styles/color-variables/jadeTokens.css +2 -4
  53. package/src/styles/components-colors/inputVariables.css +2 -2
  54. package/tw-configs/twConfigs.json +1 -0
  55. package/dist/table/shared-components/CheckIcon.js +0 -12
  56. 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,2 @@
1
+ export { StyledDialogFooter } from './StyledDialogFooter';
2
+ export type { StyledDialogFooterProps, StyledDialogFooterButton } from './StyledDialogFooter';
@@ -2,3 +2,4 @@ export * from './StyledDialog';
2
2
  export * from './StyledDialogActions';
3
3
  export * from './StyledDialogContent';
4
4
  export * from './StyledDialogTitle';
5
+ export * from './dialog-footer';
@@ -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): rounded-lg, border delta-300, Menus shadow. Popup indicator =
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: () => void;
10
- focusPrevRow: () => void;
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: React.MouseEvent<HTMLElement | SVGSVGElement>) => void;
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 = "_tbody_qdh8h_124", _ = "_expanded_row_qdh8h_187", l = "_selected_qdh8h_205", h = "_shadowed_qdh8h_228", t = "_resizer_qdh8h_282", a = "_isResizing_qdh8h_294", d = {
2
- "asma-ui-table-styled-table": "_asma-ui-table-styled-table_qdh8h_1",
3
- "table-wrapper": "_table-wrapper_qdh8h_26",
4
- "table-shell": "_table-shell_qdh8h_33",
5
- "table-wrapper--no-rows": "_table-wrapper--no-rows_qdh8h_39",
6
- "table-wrapper--proxy": "_table-wrapper--proxy_qdh8h_42",
7
- "table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_qdh8h_43",
8
- "table-wrapper-fetching": "_table-wrapper-fetching_qdh8h_53",
9
- "table-scroll": "_table-scroll_qdh8h_56",
10
- "table-x--fill-height": "_table-x--fill-height_qdh8h_65",
11
- "table-x": "_table-x_qdh8h_65",
12
- "table-content": "_table-content_qdh8h_80",
13
- "table-header--sticky": "_table-header--sticky_qdh8h_85",
14
- "table-hscroll": "_table-hscroll_qdh8h_90",
15
- "table-hscroll__content": "_table-hscroll__content_qdh8h_100",
16
- "no-rows-overlay-container": "_no-rows-overlay-container_qdh8h_103",
17
- "no-rows-overlay-content": "_no-rows-overlay-content_qdh8h_111",
18
- "styled-table": "_styled-table_qdh8h_115",
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-icon_qdh8h_129",
21
- "t-row": "_t-row_qdh8h_136",
22
- "t-cell": "_t-cell_qdh8h_136",
23
- "action-cell": "_action-cell_qdh8h_146",
24
- "fixed-cell": "_fixed-cell_qdh8h_150",
25
- "fixed-right-cell": "_fixed-right-cell_qdh8h_153",
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-selection_qdh8h_208",
29
- "action-cell--no-shadow": "_action-cell--no-shadow_qdh8h_225",
30
- shadowed: h,
31
- "shadowed-right": "_shadowed-right_qdh8h_262",
32
- "is-loading": "_is-loading_qdh8h_266",
33
- "action-cell-default-background": "_action-cell-default-background_qdh8h_269",
34
- "fixed-cell-default-background": "_fixed-cell-default-background_qdh8h_272",
35
- "fixed-right-cell-default-background": "_fixed-right-cell-default-background_qdh8h_275",
36
- "sortable-column": "_sortable-column_qdh8h_278",
37
- resizer: t,
38
- isResizing: a,
39
- "hide-table-header": "_hide-table-header_qdh8h_306",
40
- "show-table-header": "_show-table-header_qdh8h_310",
41
- "table-header": "_table-header_qdh8h_85",
42
- "hide-header": "_hide-header_qdh8h_346",
43
- "t-cell__actions": "_t-cell__actions_qdh8h_349",
44
- "t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_qdh8h_357",
45
- "t-cell__fixed": "_t-cell__fixed_qdh8h_361",
46
- "t-cell__fixed-right": "_t-cell__fixed-right_qdh8h_368",
47
- "sort-icon": "_sort-icon_qdh8h_375",
48
- "header-content": "_header-content_qdh8h_379",
49
- "table-footer--sticky": "_table-footer--sticky_qdh8h_394",
50
- "table-footer--inline": "_table-footer--inline_qdh8h_405",
51
- "table-bottom": "_table-bottom_qdh8h_416",
52
- "table-bottom--sticky": "_table-bottom--sticky_qdh8h_430",
53
- "cursor-not-allowed": "_cursor-not-allowed_qdh8h_434",
54
- "select-control": "_select-control_qdh8h_438"
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
- d as default
57
+ h as default
58
58
  };
@@ -1,62 +1,66 @@
1
- import { ACTIONS_COLUMN_ID as O } from "../types.js";
2
- import { useRootContext as ue } from "../context/RootContext.js";
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 fe } from "../../helpers/arrays.js";
5
- import $ from "clsx";
6
- import { Fragment as he, useCallback as j, useEffect as pe, useLayoutEffect as xe, useMemo as g, useRef as Ce, useState as Re } from "react";
7
- import { Fragment as Se, jsx as s, jsxs as x } from "react/jsx-runtime";
8
- import { useSortable as be } from "@dnd-kit/sortable";
9
- import { flexRender as De } from "@tanstack/react-table";
10
- import { CSS as ke } from "@dnd-kit/utilities";
11
- function Me({ styledTableProps: P, row: t, index: K, columnWindow: { paddingLeft: u, paddingRight: f, indexes: v } }) {
12
- const { loading: V, getRowClassName: l, rowHeight: h, onRowClick: C, expandArrow: Y, enableDnd: N, disableDndForRow: q, tdClassName: I, customSubRowData: w, renderSubRows: G, defaultExpanded: J, actions: R, customActionsNode: Q, textExpandArrow: B, enableMultiRowSelection: X, enableRowSelection: Z, singleSelectionRow: ee } = P, S = q?.(t), { transform: te, transition: ne, setNodeRef: A, isDragging: H } = be({
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: !N || S
18
+ disabled: !T || D
15
19
  }), ie = {
16
- transform: ke.Transform.toString(te),
17
- transition: ne,
18
- opacity: H ? 0.8 : 1,
19
- zIndex: H ? 1 : 0,
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: oe, disableResizingFlag: se } = ue(), b = t.isExpanded(), p = Ce(null), [le, ae] = Re(void 0);
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
- !b && p.current && ae(p.current.cells[0]?.clientHeight ?? p.current.offsetHeight);
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 M = (e) => {
32
- t.getCanExpand() && !Y && t.getToggleExpandedHandler()(), document.getElementById(t.id)?.focus();
33
- const i = window.getSelection()?.type !== "Range" && !oe, o = C instanceof Function;
34
- !o && B && i ? t.toggleExpand() : o && i && C(e, t), se();
35
- }, ce = (e) => {
36
- e.target.classList.contains("MuiModal-backdrop") || e.target.nodeName === "INPUT" || e.target.nodeName === "BUTTON" || e.target.nodeName === "LI" || e.target.closest("li") || M(e);
37
- }, r = t.getVisibleCells().map((e, i, o) => ({
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: o.slice(0, i).reduce((d, c) => d + (c.column.getSize() ?? 0), 0)
40
- })), T = g(() => r.filter((e) => !e.column.columnDef.fixedLeft && !e.column.columnDef.fixedRight && e.column.id !== "actions"), [r]), a = g(() => r.filter((e) => !!e.column.columnDef.fixedRight || e.column.id === "actions").map((e, i, o) => ({
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: o.slice(i + 1).reduce((d, c) => d + (c.column.getSize() ?? 0), 0)
43
- })), [r]), z = g(() => a.some((e) => e.column.id === O), [a]), U = !!R || !!Q, W = g(() => a.some((e) => !!e.column.columnDef.fixedRight), [a]), m = g(() => r.filter((e) => e.column.columnDef.fixedLeft), [r]), D = !X && !Z && ee, k = t.getIsSelected() && D, y = C instanceof Function, _ = v.length > 0 ? fe(v.map((e) => T[e])) : T, F = j((e, i) => {
44
- const o = e.column.id === O, d = e.column.columnDef.fixedLeft, c = !!e.column.columnDef.fixedRight, re = e.id === m.at(-1)?.id, me = e.id === a.at(0)?.id && !o, ge = t.isExpanded(), E = i === 0;
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: $(n["t-cell"], y && "cursor-pointer", I, o && n["action-cell"], o && (!U || W) && n["action-cell--no-shadow"], o && !!R && m.length && n.shadowed, o && (l?.(t) ? l?.(t) : n["action-cell-default-background"]), d && n["fixed-cell"], c && n["fixed-right-cell"], re && n.shadowed, me && n["shadowed-right"], t.getIsSelected() && n.selected, d && (l?.(t) ? l?.(t) : n["fixed-cell-default-background"]), c && (l?.(t) ? l?.(t) : n["fixed-right-cell-default-background"]), ge && n.expanded_row, (!!k || t.isFocused()) && n["single-selection"]),
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: d ? e.left : void 0,
49
- right: c ? e.right + (z ? -1 : 0) : void 0
52
+ left: c ? e.left : void 0,
53
+ right: d ? e.right + (W ? -1 : 0) : void 0
50
54
  },
51
- children: /* @__PURE__ */ x("div", {
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: L,
60
+ minHeight: H,
57
61
  position: "relative"
58
62
  },
59
- children: [E && k && /* @__PURE__ */ s("span", {
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(ye, {})
72
+ children: /* @__PURE__ */ s(ke, {})
69
73
  }), /* @__PURE__ */ s("span", {
70
74
  style: {
71
- marginLeft: E && D ? 30 : 0,
75
+ marginLeft: E && N ? 30 : 0,
72
76
  width: "100%"
73
77
  },
74
- children: De(e.column.columnDef.cell, e.getContext())
78
+ children: ye(e.column.columnDef.cell, e.getContext())
75
79
  })]
76
80
  })
77
81
  }, e.id);
78
82
  }, [
79
- k,
80
- R,
81
- L,
83
+ F,
84
+ S,
85
+ H,
82
86
  l,
83
- y,
84
- z,
87
+ k,
85
88
  W,
86
- m,
89
+ z,
90
+ u,
87
91
  a,
88
92
  t,
89
- U,
90
- D,
91
- I
93
+ _,
94
+ N,
95
+ w
92
96
  ]);
93
- return /* @__PURE__ */ x(he, { children: [/* @__PURE__ */ x("tr", {
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": K,
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: $(n["t-row"], V && n["is-loading"], l?.(t)),
103
+ className: j(n["t-row"], G && n["is-loading"], l?.(t)),
100
104
  style: {
101
- height: h ? `${h}px` : "inherit",
102
- ...N && ie
105
+ height: p ? `${p}px` : "inherit",
106
+ ...T && ie
103
107
  },
104
108
  ref: de,
105
- onMouseUp: ce,
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 && !y && B && e.preventDefault();
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(), e.preventDefault();
125
+ t.focusNextRow() && e.preventDefault();
114
126
  break;
115
127
  case "ArrowUp":
116
- t.focusPrevRow(), e.preventDefault();
128
+ t.focusPrevRow() && e.preventDefault();
117
129
  break;
118
130
  case "Enter":
119
- M(e);
131
+ O(e);
120
132
  break;
121
133
  }
122
134
  },
123
135
  children: [
124
- m.map((e, i) => F(e, i)),
125
- u > 0 && /* @__PURE__ */ s("td", {
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(u) + "px",
130
- minWidth: String(u) + "px",
131
- maxWidth: String(u) + "px",
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
- _.map((e, i) => F(e, m.length + i)),
137
- f > 0 && /* @__PURE__ */ s("td", {
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(f) + "px",
142
- minWidth: String(f) + "px",
143
- maxWidth: String(f) + "px",
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, i) => F(e, m.length + _.length + i))
160
+ a.map((e, o) => v(e, u.length + P.length + o))
149
161
  ]
150
- }), t.getIsExpanded() && /* @__PURE__ */ s(Se, { children: w && G?.({
151
- rows: w.get(t.original.id.toString()) ?? [],
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 ye = () => /* @__PURE__ */ x("svg", {
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
- Me as TableRow
179
+ Oe as TableRow
168
180
  };
@@ -1,12 +1,14 @@
1
- import { TableRow as i } from "./TableRow.js";
2
- import { Fragment as m, jsx as t } from "react/jsx-runtime";
3
- function R({ styledTableProps: o, table: r, columnWindow: n }) {
4
- return /* @__PURE__ */ t(m, { children: (o.hideFooter ? r.getExpandedRowModel().rows : r.getRowModel().rows).map((e, d) => /* @__PURE__ */ t(i, {
5
- styledTableProps: o,
6
- row: e,
7
- index: d,
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
- }, e.id)) });
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 { message as _ } from "../../../../../components/feedback/snack-bar/message.js";
4
- import { StyledPopover as T } from "../../../../../components/utils/popover/StyledPopover.js";
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(T, {
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(), _.info(s.column_order_reset, { closeButton: !0 });
138
+ n.table.resetColumnOrder(), T.info(s.column_order_reset, { closeButton: !0 });
139
139
  },
140
140
  children: s.reset_order
141
141
  })