@servicetitan/anvil2 3.0.8 → 3.0.9

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 (71) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/Combobox.js +1 -1
  3. package/dist/{DataTable-Dwhwvm6R.js → DataTable-FG0Kjx0d.js} +1163 -402
  4. package/dist/DataTable-FG0Kjx0d.js.map +1 -0
  5. package/dist/DataTable.css +301 -233
  6. package/dist/{Divider-CxtTyw8_.js → Divider-Dz27DFuE.js} +17 -17
  7. package/dist/{Divider-CxtTyw8_.js.map → Divider-Dz27DFuE.js.map} +1 -1
  8. package/dist/Divider.css +21 -24
  9. package/dist/Divider.js +1 -1
  10. package/dist/Dnd.js +2 -2
  11. package/dist/{DndHandleButton-CHTOYRlq.js → DndHandleButton-BW9xLWQm.js} +2 -4
  12. package/dist/DndHandleButton-BW9xLWQm.js.map +1 -0
  13. package/dist/DndSort.js +2 -2
  14. package/dist/{FilterBar-CXGsoWw5.js → FilterBar-B3c_VGDk.js} +2 -2
  15. package/dist/{FilterBar-CXGsoWw5.js.map → FilterBar-B3c_VGDk.js.map} +1 -1
  16. package/dist/FilterBar.js +1 -1
  17. package/dist/MultiSelectField.js +1 -1
  18. package/dist/{MultiSelectFieldSync-CIuy3aRD.js → MultiSelectFieldSync-CzHj9Qvy.js} +3 -3
  19. package/dist/{MultiSelectFieldSync-CIuy3aRD.js.map → MultiSelectFieldSync-CzHj9Qvy.js.map} +1 -1
  20. package/dist/MultiSelectMenu.js +1 -1
  21. package/dist/{MultiSelectMenuSync-Drz8SEk9.js → MultiSelectMenuSync-BGcrYjby.js} +3 -3
  22. package/dist/{MultiSelectMenuSync-Drz8SEk9.js.map → MultiSelectMenuSync-BGcrYjby.js.map} +1 -1
  23. package/dist/{RichTextEditor-CoPXdaWI.js → RichTextEditor-FSWAVmTe.js} +4 -4
  24. package/dist/{RichTextEditor-CoPXdaWI.js.map → RichTextEditor-FSWAVmTe.js.map} +1 -1
  25. package/dist/RichTextEditor.js +1 -1
  26. package/dist/{SavedFiltersButton-DzJijqHz.js → SavedFiltersButton-Cr829guv.js} +4 -4
  27. package/dist/{SavedFiltersButton-DzJijqHz.js.map → SavedFiltersButton-Cr829guv.js.map} +1 -1
  28. package/dist/SavedFiltersButton.js +1 -1
  29. package/dist/SelectField.js +1 -1
  30. package/dist/{SelectFieldSync-DlGiJ-Iy.js → SelectFieldSync-C65VFWGm.js} +3 -3
  31. package/dist/{SelectFieldSync-DlGiJ-Iy.js.map → SelectFieldSync-C65VFWGm.js.map} +1 -1
  32. package/dist/SelectMenu.js +1 -1
  33. package/dist/{SelectMenuSync-CAweNjRL.js → SelectMenuSync-CF49L12-.js} +3 -3
  34. package/dist/{SelectMenuSync-CAweNjRL.js.map → SelectMenuSync-CF49L12-.js.map} +1 -1
  35. package/dist/{SelectOptions-BGCap9fZ.js → SelectOptions-C7skDFj2.js} +2 -2
  36. package/dist/{SelectOptions-BGCap9fZ.js.map → SelectOptions-C7skDFj2.js.map} +1 -1
  37. package/dist/Table.js +1 -1
  38. package/dist/beta.js +8 -8
  39. package/dist/drag_indicator-BRHAPLSJ.js +6 -0
  40. package/dist/drag_indicator-BRHAPLSJ.js.map +1 -0
  41. package/dist/{filter-state-DyMDjdRS.js → filter-state-CE8t3-Q7.js} +7 -7
  42. package/dist/filter-state-CE8t3-Q7.js.map +1 -0
  43. package/dist/{index-CukEaIHB.js → index-CKdC7x1S.js} +2 -2
  44. package/dist/{index-CukEaIHB.js.map → index-CKdC7x1S.js.map} +1 -1
  45. package/dist/{index-fSKD4ey4.js → index-DN_iqxhF.js} +2 -2
  46. package/dist/{index-fSKD4ey4.js.map → index-DN_iqxhF.js.map} +1 -1
  47. package/dist/index.js +3 -3
  48. package/dist/src/beta/components/Table/DataTable/DataTable.d.ts +4 -25
  49. package/dist/src/beta/components/Table/DataTable/internal/DataTableBody.d.ts +2 -19
  50. package/dist/src/beta/components/Table/DataTable/internal/DataTableBodyRow.d.ts +12 -13
  51. package/dist/src/beta/components/Table/DataTable/internal/context/surface/DataTableSurfaceCoordinatorContext.d.ts +13 -0
  52. package/dist/src/beta/components/Table/DataTable/internal/context/surface/DataTableSurfaceCoordinatorProvider.d.ts +7 -0
  53. package/dist/src/beta/components/Table/DataTable/internal/context/surface/useDataTableSurfaceCoordinator.d.ts +1 -0
  54. package/dist/src/beta/components/Table/DataTable/internal/editable-cells/useCustomEditHelpers.d.ts +8 -6
  55. package/dist/src/beta/components/Table/createColumnHelper.d.ts +4 -2
  56. package/dist/src/beta/components/Table/formatters/htmlFormatter.d.ts +4 -2
  57. package/dist/src/beta/components/Table/formatters/htmlToMarkdown.d.ts +5 -2
  58. package/dist/src/beta/components/Table/formatters/markdownFormatter.d.ts +3 -2
  59. package/dist/src/beta/components/Table/types.d.ts +47 -30
  60. package/dist/src/internal/components/Surface/Surface.d.ts +4 -0
  61. package/dist/src/internal/components/Surface/surfaceGeometry.d.ts +31 -0
  62. package/dist/{syncFilterUtils-DZqeVWTS.js → syncFilterUtils-CgHB-l6A.js} +2 -2
  63. package/dist/{syncFilterUtils-DZqeVWTS.js.map → syncFilterUtils-CgHB-l6A.js.map} +1 -1
  64. package/dist/{useInfiniteCombobox-C6TDFfds.js → useInfiniteCombobox-BqJm-CdN.js} +2 -2
  65. package/dist/{useInfiniteCombobox-C6TDFfds.js.map → useInfiniteCombobox-BqJm-CdN.js.map} +1 -1
  66. package/dist/{useToggleSelection-Bn7h-gGD.js → useToggleSelection-BGc5OiZF.js} +2 -2
  67. package/dist/{useToggleSelection-Bn7h-gGD.js.map → useToggleSelection-BGc5OiZF.js.map} +1 -1
  68. package/package.json +1 -1
  69. package/dist/DataTable-Dwhwvm6R.js.map +0 -1
  70. package/dist/DndHandleButton-CHTOYRlq.js.map +0 -1
  71. package/dist/filter-state-DyMDjdRS.js.map +0 -1
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ export { a as Calendar, g as CalendarMonth, f as CalendarMonthButton, e as Calen
14
14
  export { C as Card } from './Card-fBqg853U.js';
15
15
  export { C as Checkbox } from './Checkbox-BYWhkYoK.js';
16
16
  export { C as Chip } from './Chip-CyMNyEPR.js';
17
- export { C as Combobox, a as ComboboxElement, c as ComboboxList, b as ComboboxSelect, u as useInfiniteCombobox } from './useInfiniteCombobox-C6TDFfds.js';
17
+ export { C as Combobox, a as ComboboxElement, c as ComboboxList, b as ComboboxSelect, u as useInfiniteCombobox } from './useInfiniteCombobox-BqJm-CdN.js';
18
18
  export { D as DateFieldRange } from './DateFieldRange-BUug1tUy.js';
19
19
  export { D as DateFieldSingle } from './DateFieldSingle-DR7faQGD.js';
20
20
  export { D as DateFieldYearless } from './DateFieldYearless-7MFcR7L6.js';
@@ -22,8 +22,8 @@ export { D as DateFieldYearlessRange } from './DateFieldYearlessRange-DGtdyISH.j
22
22
  export { D as DaysOfTheWeek } from './DaysOfTheWeek-C7oN9nIe.js';
23
23
  export { D as Details } from './Details-s2pVu-YL.js';
24
24
  export { D as Dialog } from './Dialog-dE9c90iR.js';
25
- export { D as Divider } from './Divider-CxtTyw8_.js';
26
- export { D as Dnd } from './index-CukEaIHB.js';
25
+ export { D as Divider } from './Divider-Dz27DFuE.js';
26
+ export { D as Dnd } from './index-CKdC7x1S.js';
27
27
  export { D as Drawer } from './Drawer-Dk0MsaOU.js';
28
28
  export { D as DrillDown, b as DrillDownContent, c as DrillDownFooter, a as DrillDownHeader, d as DrillDownNextButton, e as DrillDownPrevButton, u as useDrillDown } from './useDrilldown-BJ2dHHKV.js';
29
29
  export { E as EditCard } from './EditCard-DV2N7zWr.js';
@@ -32,10 +32,6 @@ export type DataTableProps<T extends DataTableRowData> = LayoutUtilProps & Compo
32
32
  * @default false
33
33
  */
34
34
  disableExpandAll?: boolean;
35
- /**
36
- * The default active row ids.
37
- */
38
- defaultActiveRowIds?: TableRow<T>["id"][];
39
35
  /**
40
36
  * The default selected row ids.
41
37
  */
@@ -54,23 +50,11 @@ export type DataTableProps<T extends DataTableRowData> = LayoutUtilProps & Compo
54
50
  * @default false
55
51
  */
56
52
  disableSelectAll?: boolean;
57
- /**
58
- * Whether rows can be activated by clicking. When enabled, rows receive
59
- * a pointer cursor and hover background, and clicking a row toggles it
60
- * into the active set. Can be a boolean to apply to all rows, or a
61
- * function to opt specific rows in.
62
- * @default false
63
- */
64
- isActivatable?: boolean | ((row: T) => boolean);
65
53
  /**
66
54
  * Whether the table is selectable. Can be a boolean or a function to customize the selection logic.
67
55
  * @default false
68
56
  */
69
57
  isSelectable?: boolean | ((row: T) => boolean);
70
- /**
71
- * Called when the row activation state changes. Passes the active row ids.
72
- */
73
- onActivateRow?: (activeRowIds: TableRow<T>["id"][]) => void;
74
58
  /**
75
59
  * Called when the row expansion state changes. Passes the expanded row ids.
76
60
  */
@@ -89,18 +73,13 @@ export type DataTableProps<T extends DataTableRowData> = LayoutUtilProps & Compo
89
73
  * When `false` or `undefined`, no pagination is applied and all data is shown.
90
74
  */
91
75
  pagination?: boolean | DataTablePaginationConfig<T>;
92
- /**
93
- * The active row ids.
94
- */
95
- activeRowIds?: TableRow<T>["id"][];
96
76
  /**
97
77
  * Row ids that should render as read-only. Read-only rows gray their
98
- * plain text content, show a `not-allowed` cursor when they would
99
- * otherwise be activatable, and disable the selection checkbox.
100
- * Links, chips, and custom cell content are unaffected.
78
+ * plain-text cell content and render their selection checkbox as disabled
79
+ * and read-only. Links, chips, and custom cell content are unaffected.
101
80
  *
102
- * Pre-seeded `selectedRowIds` / `activeRowIds` are still accepted
103
- * read-only only gates user interaction, not the visual state.
81
+ * Pre-seeded `selectedRowIds` is still honored `readOnlyRowIds` only
82
+ * gates user interaction (checkbox toggling), not the visual state.
104
83
  */
105
84
  readOnlyRowIds?: TableRow<T>["id"][];
106
85
  /**
@@ -1,7 +1,6 @@
1
1
  import { ComponentPropsWithoutRef } from 'react';
2
2
  import { Table as TanstackTable } from '@tanstack/react-table';
3
3
  import { DataTableVirtualizer } from './useDataTableVirtualizer';
4
- import { TableRow } from '../../types';
5
4
  /**
6
5
  * Props for the DataTableBody component
7
6
  * @property {TanstackTable<T>} table - The table instance from @tanstack/react-table to render
@@ -34,25 +33,9 @@ export type DataTableBodyProps<T> = {
34
33
  */
35
34
  getRowVersion?: (row: T) => unknown;
36
35
  /**
37
- * Whether rows can be activated. Mirrors the DataTable `isActivatable`
38
- * prop a boolean applies to every row, a function opts specific rows in.
39
- */
40
- isActivatable?: boolean | ((row: T) => boolean);
41
- /**
42
- * Map of currently active row ids keyed by id. An entry set to `true`
43
- * marks the row as active.
44
- */
45
- activeRowMap: Record<string, boolean>;
46
- /**
47
- * Map of read-only row ids keyed by id. Read-only rows gray their text
48
- * and ignore activation clicks; their selection checkbox is disabled.
36
+ * Map of read-only row ids keyed by id. Read-only rows gray their plain
37
+ * text content and render disabled, read-only selection checkboxes.
49
38
  */
50
39
  readOnlyRowMap: Record<string, boolean>;
51
- /**
52
- * Called when an activatable row is clicked. Receives the row id and the
53
- * ids of all descendant rows (flattened, any depth) so the parent's state
54
- * can cascade to its sub-rows.
55
- */
56
- onToggleActive: (rowId: TableRow<T>["id"], descendantIds: TableRow<T>["id"][]) => void;
57
40
  } & ComponentPropsWithoutRef<"div">;
58
41
  export declare function DataTableBody<T>(props: DataTableBodyProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,4 @@
1
1
  import { Row } from '@tanstack/react-table';
2
- import { TableRow } from '../../types';
3
2
  import { useColumnOrder } from './useColumnOrder';
4
3
  export type DataTableBodyRowProps<T> = {
5
4
  columnOrder: ReturnType<typeof useColumnOrder>["columnOrder"];
@@ -17,22 +16,22 @@ export type DataTableBodyRowProps<T> = {
17
16
  parentRowCanExpand: boolean;
18
17
  isSelected: boolean;
19
18
  isSomeSelected: boolean;
20
- isActivatable: boolean;
21
- isActive: boolean;
22
19
  /**
23
- * True when the row is the topmost active ancestor in its active chain
24
- * (itself active, has sub-rows, and no ancestor row is active). Drives
25
- * the darker blue/100 background; non-topmost active rows use blue/50.
20
+ * True when any ancestor row (parent, grandparent, etc.) is currently
21
+ * selected. Combined with `isSelected` to drive the row's
22
+ * `data-anv-is-selected-row` attribute so descendants visually adopt
23
+ * an ancestor's selection state without painting the ancestor itself.
24
+ * Computed at the parent level (`DataTableBody.tsx`) so the prop
25
+ * remains a serializable boolean — preserving `React.memo`
26
+ * comparator semantics in `areRowPropsEqual`.
26
27
  */
27
- isTopMostActive: boolean;
28
+ isAncestorSelected: boolean;
28
29
  /**
29
- * True when the row is flagged read-only via `readOnlyRowIds`. Grays
30
- * plain text, shows `not-allowed` cursor on activatable rows, and
31
- * disables the activation click (checkbox disabling is gated at the
32
- * DataTable level via `enableRowSelection`).
30
+ * True when the row is flagged read-only via `readOnlyRowIds`. Grays the
31
+ * row's plain-text cell content. Checkbox disabling is gated separately
32
+ * at the DataTable level via `enableRowSelection`.
33
33
  */
34
34
  isReadOnly: boolean;
35
- onToggleActive: (rowId: TableRow<T>["id"], descendantIds: TableRow<T>["id"][]) => void;
36
35
  /**
37
36
  * Optional consumer-provided function that returns a value expressing
38
37
  * "this row has changed." When supplied, the row is memoized: a row will
@@ -43,6 +42,6 @@ export type DataTableBodyRowProps<T> = {
43
42
  */
44
43
  getRowVersion?: (row: T) => unknown;
45
44
  };
46
- declare function DataTableBodyRowInner<T>({ columnOrder: _columnOrder, columnIndexMap, row, rowIndex, tableHasSubRows, isExpanded, canExpand, depth, parentRowCanExpand, isActivatable, isActive, isTopMostActive, isReadOnly, onToggleActive, }: DataTableBodyRowProps<T>): import("react/jsx-runtime").JSX.Element;
45
+ declare function DataTableBodyRowInner<T>({ columnOrder: _columnOrder, columnIndexMap, row, rowIndex, tableHasSubRows, isExpanded, canExpand, depth, parentRowCanExpand, isSelected, isSomeSelected, isAncestorSelected, isReadOnly, }: DataTableBodyRowProps<T>): import("react/jsx-runtime").JSX.Element;
47
46
  export declare const DataTableBodyRow: typeof DataTableBodyRowInner;
48
47
  export {};
@@ -0,0 +1,13 @@
1
+ import { RefObject } from 'react';
2
+ export type DataTableSurfaceRegistration = {
3
+ id: string;
4
+ close: (options?: {
5
+ restoreFocus?: boolean;
6
+ }) => void;
7
+ };
8
+ export type DataTableSurfaceCoordinator = {
9
+ requestOpen: (registration: DataTableSurfaceRegistration) => void;
10
+ clear: (id: string) => void;
11
+ intersectionBoundaryRef?: RefObject<HTMLElement | null>;
12
+ };
13
+ export declare const DataTableSurfaceCoordinatorContext: import('react').Context<DataTableSurfaceCoordinator | null>;
@@ -0,0 +1,7 @@
1
+ import { RefObject } from 'react';
2
+ type DataTableSurfaceCoordinatorProviderProps = {
3
+ children: React.ReactNode;
4
+ intersectionBoundaryRef?: RefObject<HTMLElement | null>;
5
+ };
6
+ export declare function DataTableSurfaceCoordinatorProvider({ children, intersectionBoundaryRef, }: DataTableSurfaceCoordinatorProviderProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1 @@
1
+ export declare function useDataTableSurfaceCoordinator(): import('./DataTableSurfaceCoordinatorContext').DataTableSurfaceCoordinator | null;
@@ -1,13 +1,15 @@
1
- import { CustomEditConfig, CustomEditController, CustomEditRenderContext, TableRow } from '../../../types';
1
+ import { CustomEditConfig, CustomEditController, CustomEditDraftValue, CustomEditInitialValue, CustomEditPresentObjectValue, TableRow } from '../../../types';
2
2
  type CustomObjectValue = object;
3
- type CustomEditHelperValue<T, K extends keyof T> = CustomEditRenderContext<T, K>["controller"]["draftValue"];
3
+ type CustomEditHelperValue<T, K extends keyof T> = CustomEditDraftValue<T, K>;
4
+ type CustomEditHelperPresentValue<T, K extends keyof T> = CustomEditPresentObjectValue<T, K>;
5
+ type CustomEditHelperInitialValue<T, K extends keyof T> = CustomEditInitialValue<T, K>;
4
6
  /**
5
7
  * State returned by custom edit controller helpers.
6
8
  * @property {CustomEditController<TValue>} controller - Controller object exposed to custom edit renderers.
7
9
  * @property {() => void} runInitialFocus - Runs the initial focus callback registered by the custom editor.
8
10
  */
9
- export type CustomEditControllerState<TValue extends CustomObjectValue> = {
10
- controller: CustomEditController<TValue>;
11
+ export type CustomEditControllerState<TValue extends CustomObjectValue, TDraftValue = Partial<TValue>, TInitialValue = TValue> = {
12
+ controller: CustomEditController<TValue, TDraftValue, TInitialValue>;
11
13
  runInitialFocus: () => void;
12
14
  };
13
15
  /**
@@ -30,7 +32,7 @@ export type UseCustomEditHelperStateOptions<T, K extends keyof T> = UseCustomEdi
30
32
  * @param options Row, column, edit configuration, and close callback for the editable cell.
31
33
  * @returns Controller state with draft value helpers and initial focus runner.
32
34
  */
33
- export declare function useCustomEditControllerState<T, K extends keyof T>({ row, columnId, editConfig, onCloseEditor, }: UseCustomEditControllerStateOptions<T, K>): CustomEditControllerState<CustomEditHelperValue<T, K>>;
35
+ export declare function useCustomEditControllerState<T, K extends keyof T>({ row, columnId, editConfig, onCloseEditor, }: UseCustomEditControllerStateOptions<T, K>): CustomEditControllerState<CustomEditHelperPresentValue<T, K>, CustomEditHelperValue<T, K>, CustomEditHelperInitialValue<T, K>>;
34
36
  /**
35
37
  * Backward-compatible alias for the custom edit controller hook.
36
38
  */
@@ -41,7 +43,7 @@ export declare const useCustomEditHelperState: typeof useCustomEditControllerSta
41
43
  * @param options Row, column, edit configuration, and close callback for the editable cell.
42
44
  * @returns Controller state with mutable draft value helpers and initial focus runner.
43
45
  */
44
- export declare function createCustomEditControllerState<T, K extends keyof T>({ row, columnId, editConfig, onCloseEditor, }: UseCustomEditControllerStateOptions<T, K>): CustomEditControllerState<CustomEditHelperValue<T, K>>;
46
+ export declare function createCustomEditControllerState<T, K extends keyof T>({ row, columnId, editConfig, onCloseEditor, }: UseCustomEditControllerStateOptions<T, K>): CustomEditControllerState<CustomEditHelperPresentValue<T, K>, CustomEditHelperValue<T, K>, CustomEditHelperInitialValue<T, K>>;
45
47
  /**
46
48
  * Backward-compatible alias for the imperative custom edit controller factory.
47
49
  */
@@ -182,8 +182,10 @@ type ColumnConfig<T, K extends keyof T> = ReadOnlyColumnConfig<T, K> | TextEditC
182
182
  * - `editConfig.mode: "number"` can only be used with number columns
183
183
  * - `editConfig.mode: "multiselect"` can only be used with array columns
184
184
  * - `editConfig.mode: "select"` options values must match the column's value type
185
- * - `editConfig.mode: "custom"` preserves object-valued canonical state and typed draft helpers
186
- * - `editConfig.onChange` callback receives the correct value type for the column
185
+ * - `editConfig.mode: "custom"` can only be used with structured object columns;
186
+ * drafts may be partial objects, plus null/undefined when declared by the row type
187
+ * - non-custom `editConfig.onChange` callbacks receive the correct value type;
188
+ * custom mode uses `onCommit` and `onDraftUpdate`
187
189
  * - `getCellText` provides a simple sortable read string when `renderCell` returns rich content
188
190
  *
189
191
  * @template T - The type of the row data
@@ -3,8 +3,10 @@ import { ReactNode } from 'react';
3
3
  * Formats an HTML string value for DataTable cells by converting to markdown
4
4
  * and rendering through the markdown formatter.
5
5
  *
6
- * Supported HTML: strong, b, em, i, code, mark, ul, ol, li, br, p.
7
- * Unsupported tags and their content are dropped entirely.
6
+ * Supported HTML: strong, b, em, i, code, mark, s, strike, del, h1, h2, h3,
7
+ * ul, ol, li, br, p. The u and span tags, along with text-align styling on
8
+ * p/h1-h3, are rendered as plain text (styling ignored, content preserved).
9
+ * Other unsupported tags and their content are dropped entirely.
8
10
  * HTML entities are decoded to plain text.
9
11
  *
10
12
  * @param value - The HTML string to format
@@ -1,8 +1,11 @@
1
1
  /**
2
2
  * Converts an HTML string to the markdown subset supported by markdownFormatter.
3
3
  *
4
- * Supported tags: strong, b, em, i, code, mark, ul, ol, li, br, p.
5
- * Unsupported tags and their content are dropped entirely.
4
+ * Supported tags: strong, b, em, i, code, mark, s, strike, del, h1, h2, h3,
5
+ * ul, ol, li, br, p.
6
+ * The u and span tags, along with text-align styling on p/h1-h3, are rendered
7
+ * as plain text: their styling is ignored but their content is preserved.
8
+ * Other unsupported tags and their content are dropped entirely.
6
9
  * HTML entities are decoded to plain text.
7
10
  *
8
11
  * @param value - The HTML string to convert
@@ -2,8 +2,9 @@ import { ReactNode } from 'react';
2
2
  /**
3
3
  * Formats a string value as markdown content for DataTable cells.
4
4
  *
5
- * Supports inline constructs (bold, italic, bold+italic, inline code, highlight)
6
- * and block-level flat lists (unordered with `- `, ordered with `N. `).
5
+ * Supports inline constructs (bold, italic, bold+italic, strikethrough, inline
6
+ * code, highlight) and block-level constructs: headings (`# ` through `### `)
7
+ * and flat lists (unordered with `- `, ordered with `N. `).
7
8
  *
8
9
  * @param value - The markdown string to format
9
10
  * @returns Formatted React nodes, or null for empty/null/undefined values
@@ -61,9 +61,19 @@ type BaseEditConfig<T, K extends keyof T> = {
61
61
  */
62
62
  onChange: (value: T[K], rowId: string) => void;
63
63
  };
64
- type CustomEditCanonicalValueForValue<TValue> = TValue extends readonly (infer _Element)[] ? never : TValue extends object ? NonNullable<TValue> : never;
65
- type CustomEditCanonicalValue<T, K extends keyof T> = CustomEditCanonicalValueForValue<NonNullable<T[K]>>;
66
- export type CustomEditFieldValueUpdater<TValue extends object, TField extends keyof TValue> = TValue[TField] | ((previousValue: TValue[TField], draftValue: TValue) => TValue[TField]);
64
+ type CustomEditInvalidPresentValue<TValue> = Extract<NonNullable<TValue>, readonly unknown[]> | Extract<NonNullable<TValue>, (...args: never[]) => unknown> | Exclude<NonNullable<TValue>, object>;
65
+ type CustomEditPresentObjectValueForValue<TValue> = [
66
+ CustomEditInvalidPresentValue<TValue>
67
+ ] extends [never] ? NonNullable<TValue> extends object ? NonNullable<TValue> : never : never;
68
+ type CustomEditPartialPresentValue<TValue extends object> = TValue extends object ? Partial<TValue> : never;
69
+ export type CustomEditAllowedNullishValue<TValue> = Extract<TValue, null | undefined>;
70
+ export type CustomEditPresentObjectValue<T, K extends keyof T> = CustomEditPresentObjectValueForValue<T[K]>;
71
+ export type CustomEditDraftValueForValue<TValue> = [
72
+ CustomEditPresentObjectValueForValue<TValue>
73
+ ] extends [never] ? never : CustomEditPartialPresentValue<CustomEditPresentObjectValueForValue<TValue>> | CustomEditAllowedNullishValue<TValue>;
74
+ export type CustomEditDraftValue<T, K extends keyof T> = CustomEditDraftValueForValue<T[K]>;
75
+ export type CustomEditInitialValue<T, K extends keyof T> = T[K];
76
+ export type CustomEditFieldValueUpdater<TValue extends object, TField extends keyof TValue> = TValue[TField] | ((previousValue: TValue[TField] | undefined, draftValue: Partial<TValue>) => TValue[TField]);
67
77
  export type CustomEditCloseReason = "submit" | "escape" | "outside-click" | "close-button" | "programmatic";
68
78
  export type CustomEditValidation<TValue extends object> = {
69
79
  /**
@@ -97,7 +107,7 @@ export type CustomEditSurfaceConfig = {
97
107
  */
98
108
  onKeyDown?: (event: ReactKeyboardEvent<HTMLDivElement>) => void;
99
109
  };
100
- export type CustomEditCloseRequest<TValue extends object> = {
110
+ export type CustomEditCloseRequest<TValue extends object, TDraftValue = Partial<TValue>, TInitialValue = TValue> = {
101
111
  /**
102
112
  * Why the close was requested.
103
113
  */
@@ -105,11 +115,11 @@ export type CustomEditCloseRequest<TValue extends object> = {
105
115
  /**
106
116
  * Draft value at the time the request is evaluated.
107
117
  */
108
- draftValue: TValue;
118
+ draftValue: TDraftValue;
109
119
  /**
110
120
  * Original committed value when editing began.
111
121
  */
112
- initialValue: TValue;
122
+ initialValue: TInitialValue;
113
123
  /**
114
124
  * Whether the draft differs from the initial value.
115
125
  */
@@ -119,21 +129,23 @@ export type CustomEditCloseRequest<TValue extends object> = {
119
129
  */
120
130
  validation: CustomEditValidation<TValue>;
121
131
  };
122
- export type CustomEditController<TValue extends object> = {
132
+ export type CustomEditController<TValue extends object, TDraftValue = Partial<TValue>, TInitialValue = TValue> = {
123
133
  /**
124
- * Current local draft value owned by the custom editor.
134
+ * Current local draft. Custom editors may hold a partial object, or a
135
+ * row-type-supported nullish value.
125
136
  */
126
- draftValue: TValue;
137
+ draftValue: TDraftValue;
127
138
  /**
128
139
  * Original value before editing began.
129
140
  */
130
- initialValue: TValue;
141
+ initialValue: TInitialValue;
131
142
  /**
132
143
  * Whether the draft differs from the initial value.
133
144
  */
134
145
  isDirty: boolean;
135
146
  /**
136
- * Ordered list of changed fields.
147
+ * Ordered list of changed object fields. Whole-value nullish changes are
148
+ * represented by `isDirty`, not by synthetic field names.
137
149
  */
138
150
  changedFields: ReadonlyArray<keyof TValue>;
139
151
  /**
@@ -141,13 +153,15 @@ export type CustomEditController<TValue extends object> = {
141
153
  */
142
154
  validation: CustomEditValidation<TValue>;
143
155
  /**
144
- * Replace the entire draft value.
156
+ * Replace the entire draft value. Null and undefined are accepted only when
157
+ * the column's row value type includes that nullish value.
145
158
  */
146
- setDraftValue: (nextValue: SetStateAction<TValue>) => TValue;
159
+ setDraftValue: (nextValue: SetStateAction<TDraftValue>) => TDraftValue;
147
160
  /**
148
- * Update a single field in the current draft value.
161
+ * Update a single field in the current draft value. If the current draft is
162
+ * nullish, a partial object containing this field is synthesized.
149
163
  */
150
- setDraftField: <TField extends keyof TValue>(field: TField, nextValue: CustomEditFieldValueUpdater<TValue, TField>) => TValue;
164
+ setDraftField: <TField extends keyof TValue>(field: TField, nextValue: CustomEditFieldValueUpdater<TValue, TField>) => TDraftValue;
151
165
  /**
152
166
  * Submit the current draft and close the editor.
153
167
  */
@@ -197,41 +211,43 @@ export type CustomEditRenderContext<T, K extends keyof T> = {
197
211
  */
198
212
  rowId: string;
199
213
  /**
200
- * Canonical committed value for the cell.
214
+ * Committed value for the cell, exactly as declared by the row type.
201
215
  */
202
216
  value: T[K];
203
217
  /**
204
218
  * Typed controller for draft mutation, validation, focus, and lifecycle control.
205
219
  */
206
- controller: CustomEditController<CustomEditCanonicalValue<T, K>>;
220
+ controller: CustomEditController<CustomEditPresentObjectValue<T, K>, CustomEditDraftValue<T, K>, CustomEditInitialValue<T, K>>;
207
221
  };
208
222
  /**
209
223
  * Edit configuration for custom mode cells.
210
- * Preserves canonical object values while continuing to use `renderCell`
211
- * for the read path.
224
+ * Custom mode is for structured object-valued columns. The committed read
225
+ * value remains `T[K]`; editable drafts may be partial objects, plus `null`
226
+ * or `undefined` when those values are part of `T[K]`.
212
227
  *
213
228
  * @template T - The row data type
214
229
  * @template K - The column key
215
230
  */
216
231
  export type CustomEditConfig<T, K extends keyof T> = [
217
- CustomEditCanonicalValue<T, K>
232
+ CustomEditPresentObjectValue<T, K>
218
233
  ] extends [never] ? never : Omit<BaseEditConfig<T, K>, "onChange"> & {
219
234
  /**
220
235
  * Custom edit mode - renders a multi-field editor surface.
221
236
  */
222
237
  mode: "custom";
223
238
  /**
224
- * Callback fired when the draft is committed.
239
+ * Callback fired when the current draft is committed. The value is the
240
+ * exact draft state: partial object, full object, or allowed nullish value.
225
241
  */
226
- onCommit: (value: T[K], rowId: string) => void;
242
+ onCommit: (value: CustomEditDraftValue<T, K>, rowId: string) => void;
227
243
  /**
228
- * Callback fired on every local draft mutation.
244
+ * Callback fired on every local draft mutation with the exact draft state.
229
245
  */
230
- onDraftUpdate?: (value: T[K], rowId: string) => void;
246
+ onDraftUpdate?: (value: CustomEditDraftValue<T, K>, rowId: string) => void;
231
247
  /**
232
248
  * Optional validation metadata derived from the current draft.
233
249
  */
234
- validateDraft?: (draftValue: CustomEditCanonicalValue<T, K>, rowId: string) => CustomEditValidation<CustomEditCanonicalValue<T, K>> | undefined;
250
+ validateDraft?: (draftValue: CustomEditDraftValue<T, K>, rowId: string) => CustomEditValidation<CustomEditPresentObjectValue<T, K>> | undefined;
235
251
  /**
236
252
  * When true, submit-style close requests are blocked while validation contains
237
253
  * a form error or any field error. Defaults to `false`.
@@ -241,13 +257,14 @@ export type CustomEditConfig<T, K extends keyof T> = [
241
257
  * Optional close interception hook.
242
258
  * Return `false` to keep the editor open.
243
259
  */
244
- onRequestClose?: (request: CustomEditCloseRequest<CustomEditCanonicalValue<T, K>>) => boolean | void;
260
+ onRequestClose?: (request: CustomEditCloseRequest<CustomEditPresentObjectValue<T, K>, CustomEditDraftValue<T, K>, CustomEditInitialValue<T, K>>) => boolean | void;
245
261
  /**
246
262
  * Optional surface presentation overrides.
247
263
  */
248
264
  surface?: CustomEditSurfaceConfig;
249
265
  /**
250
- * Consumer-owned renderer for the custom editor contents.
266
+ * Consumer-owned renderer for the custom editor contents. Editors should
267
+ * handle partial and row-type-supported nullish draft values defensively.
251
268
  */
252
269
  renderEditor: (context: CustomEditRenderContext<T, K>) => ReactNode;
253
270
  };
@@ -601,9 +618,9 @@ export type BooleanEditConfig<T, K extends keyof T> = BaseEditConfig<T, K> & {
601
618
  * // Custom editing keeps renderCell as the read path
602
619
  * editConfig: {
603
620
  * mode: "custom",
604
- * onChange: (value, rowId) => save(value, rowId),
605
- * onDraftChange: (value, rowId) => saveDraft(value, rowId),
606
- * renderEditor: ({ helpers }) => renderAddressEditor(helpers)
621
+ * onCommit: (draft, rowId) => saveDraft(draft, rowId),
622
+ * onDraftUpdate: (draft, rowId) => previewDraft(draft, rowId),
623
+ * renderEditor: ({ controller }) => renderAddressEditor(controller)
607
624
  * }
608
625
  * ```
609
626
  */
@@ -53,6 +53,7 @@ export declare function SurfaceTrigger({ children }: SurfaceTriggerProps): React
53
53
  * @property {ReactNode} [title] - Header title used as the default accessible label.
54
54
  * @property {ReactNode} [headerContent] - Additional header actions rendered before the close button.
55
55
  * @property {RefObject<HTMLElement | null>} [initialFocusRef] - Element focused after the surface opens.
56
+ * @property {RefObject<HTMLElement | null>} [intersectionBoundaryRef] - Optional element that positioned content should intersect after placement or drag.
56
57
  * @property {number | string} [width] - Surface width as pixels or a CSS dimension.
57
58
  * @property {number | string} [maxHeight] - Maximum surface height as pixels or a CSS dimension.
58
59
  * @property {string} [closeButtonLabel] - Accessible label for the header close button.
@@ -65,6 +66,7 @@ export type SurfaceContentProps = Omit<ComponentPropsWithoutRef<"div">, "childre
65
66
  title?: ReactNode;
66
67
  headerContent?: ReactNode;
67
68
  initialFocusRef?: RefObject<HTMLElement | null>;
69
+ intersectionBoundaryRef?: RefObject<HTMLElement | null>;
68
70
  width?: number | string;
69
71
  maxHeight?: number | string;
70
72
  closeButtonLabel?: string;
@@ -87,6 +89,7 @@ export declare const SurfaceContent: import('react').ForwardRefExoticComponent<O
87
89
  title?: ReactNode;
88
90
  headerContent?: ReactNode;
89
91
  initialFocusRef?: RefObject<HTMLElement | null>;
92
+ intersectionBoundaryRef?: RefObject<HTMLElement | null>;
90
93
  width?: number | string;
91
94
  maxHeight?: number | string;
92
95
  closeButtonLabel?: string;
@@ -134,6 +137,7 @@ export declare const Surface: (({ children, open, id }: SurfaceProps) => import(
134
137
  title?: ReactNode;
135
138
  headerContent?: ReactNode;
136
139
  initialFocusRef?: RefObject<HTMLElement | null>;
140
+ intersectionBoundaryRef?: RefObject<HTMLElement | null>;
137
141
  width?: number | string;
138
142
  maxHeight?: number | string;
139
143
  closeButtonLabel?: string;
@@ -0,0 +1,31 @@
1
+ export declare const SURFACE_VIEWPORT_PADDING = 8;
2
+ export declare const SURFACE_MIN_WIDTH = 240;
3
+ export declare const SURFACE_MIN_HEIGHT = 120;
4
+ export type SurfaceGeometry = {
5
+ x: number;
6
+ y: number;
7
+ width: number;
8
+ height: number | null;
9
+ isUserModified: boolean;
10
+ hasUserResized: boolean;
11
+ };
12
+ export type SurfaceViewport = {
13
+ width: number;
14
+ height: number;
15
+ };
16
+ export type SurfaceRect = {
17
+ x: number;
18
+ y: number;
19
+ width: number;
20
+ height: number;
21
+ };
22
+ export type ClampSurfaceGeometryOptions = {
23
+ measuredHeight?: number;
24
+ intersectionBoundary?: SurfaceRect | null;
25
+ };
26
+ export declare function getMaxSurfaceWidth(viewport: SurfaceViewport, x: number): number;
27
+ export declare function getMaxSurfaceHeight(viewport: SurfaceViewport, y: number): number;
28
+ export declare function hasStrictRectIntersection(rect: SurfaceRect, boundary: SurfaceRect): boolean;
29
+ export declare function clampSurfaceGeometry(geometry: SurfaceGeometry, viewport: SurfaceViewport, options?: ClampSurfaceGeometryOptions): SurfaceGeometry;
30
+ export declare function clampActiveResizeSurfaceGeometry(geometry: SurfaceGeometry, viewport: SurfaceViewport): SurfaceGeometry;
31
+ export declare function restoreSurfaceGeometryIntersection(geometry: SurfaceGeometry, viewport: SurfaceViewport, options?: ClampSurfaceGeometryOptions): SurfaceGeometry;
@@ -5,7 +5,7 @@ import { c as cx } from './index-De1g9FRV.js';
5
5
  import { useState, useRef, useCallback, useEffect, useMemo, forwardRef, useId, useImperativeHandle } from 'react';
6
6
  import { u as useIntersectionObserver } from './useIntersectionObserver-BEmMDO3P.js';
7
7
  import { T as Text } from './Text-w2gWn4K6.js';
8
- import { D as Divider } from './Divider-CxtTyw8_.js';
8
+ import { D as Divider } from './Divider-Dz27DFuE.js';
9
9
  import { u as useMergeRefs } from './useMergeRefs-Dfmtq9cI.js';
10
10
  import { S as SrOnly } from './SrOnly-pnf8ajnh.js';
11
11
  import { I as Icon } from './Icon-feeG7gXA.js';
@@ -1238,4 +1238,4 @@ const sortByGroup = (options, groupSorter) => {
1238
1238
  };
1239
1239
 
1240
1240
  export { AddNewItemButton as A, OptionsPanel as O, VirtualizedOptionsPanel as V, useProcessedOptions as a, buildSelectItems as b, useDebouncedCallback as c, defaultSyncFilter as d, toSelectItem as e, sortByGroup as s, toSyncFilterFn as t, useSelectOrchestration as u };
1241
- //# sourceMappingURL=syncFilterUtils-DZqeVWTS.js.map
1241
+ //# sourceMappingURL=syncFilterUtils-CgHB-l6A.js.map