@servicetitan/anvil2 3.9.0 → 3.10.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/CHANGELOG.md +46 -0
- package/dist/AiMark-2_O4tKv_.js.map +1 -1
- package/dist/Button-Dwh_Nd4l.js.map +1 -1
- package/dist/Combobox.js +1 -1
- package/dist/{DataTable-CRzQKN_P.js → DataTable-D-SKKt5w.js} +53 -16
- package/dist/DataTable-D-SKKt5w.js.map +1 -0
- package/dist/{DateFieldRange-CHbrYgsD.js → DateFieldRange-DUFfyknZ.js} +51 -31
- package/dist/DateFieldRange-DUFfyknZ.js.map +1 -0
- package/dist/DateFieldRange.js +1 -1
- package/dist/{DateFieldSingle-D-KZ3NL0.js → DateFieldSingle-BZjlO0hX.js} +49 -28
- package/dist/DateFieldSingle-BZjlO0hX.js.map +1 -0
- package/dist/DateFieldSingle.js +1 -1
- package/dist/{DateFieldYearless-DouEX24o.js → DateFieldYearless-TcKb9jE2.js} +4 -2
- package/dist/DateFieldYearless-TcKb9jE2.js.map +1 -0
- package/dist/DateFieldYearless.js +1 -1
- package/dist/{DateFieldYearlessRange-B_bImgyn.js → DateFieldYearlessRange-D9XtRNWi.js} +16 -4
- package/dist/DateFieldYearlessRange-D9XtRNWi.js.map +1 -0
- package/dist/DateFieldYearlessRange.js +1 -1
- package/dist/{Dialog-Clh3jaX8.js → Dialog-DjJ9wpeo.js} +2 -2
- package/dist/{Dialog-Clh3jaX8.js.map → Dialog-DjJ9wpeo.js.map} +1 -1
- package/dist/Dialog.js +1 -1
- package/dist/DndSort.js.map +1 -1
- package/dist/{Drawer-h2Mut1lB.js → Drawer-CZITBE8M.js} +2 -2
- package/dist/{Drawer-h2Mut1lB.js.map → Drawer-CZITBE8M.js.map} +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/DrillDown.css +36 -34
- package/dist/DrillDown.js +1 -1
- package/dist/DrillDown.module-1VBKDZRA.js +27 -0
- package/dist/{DrillDown.module-D1Bf9_yP.js.map → DrillDown.module-1VBKDZRA.js.map} +1 -1
- package/dist/{FilterBar-CBTAkEri.js → FilterBar-B_ShYx2G.js} +28 -7
- package/dist/FilterBar-B_ShYx2G.js.map +1 -0
- package/dist/FilterBar.js +1 -1
- package/dist/{MenuFooter-BXcNxNnX.js → MenuFooter--lBF8OjJ.js} +5 -1
- package/dist/MenuFooter--lBF8OjJ.js.map +1 -0
- package/dist/MultiSelectField.js +1 -1
- package/dist/{MultiSelectFieldSync-CpfsWecG.js → MultiSelectFieldSync-B_vuR-ii.js} +220 -156
- package/dist/MultiSelectFieldSync-B_vuR-ii.js.map +1 -0
- package/dist/MultiSelectFieldSync.css +80 -69
- package/dist/MultiSelectMenu.js +1 -1
- package/dist/{MultiSelectMenuSync-CtyLYyDE.js → MultiSelectMenuSync-C3Y7jnJQ.js} +22 -8
- package/dist/MultiSelectMenuSync-C3Y7jnJQ.js.map +1 -0
- package/dist/{Page-B6E3Gbji.js → Page-BHBcuxcE.js} +14 -13
- package/dist/Page-BHBcuxcE.js.map +1 -0
- package/dist/Page.js +1 -1
- package/dist/{Pagination-DF7iMeJe.js → Pagination-Bx_u6Uea.js} +32 -6
- package/dist/Pagination-Bx_u6Uea.js.map +1 -0
- package/dist/Pagination.js +1 -1
- package/dist/{RichTextEditor-CLo8yoUP.js → RichTextEditor-CTIGe6xA.js} +3 -3
- package/dist/{RichTextEditor-CLo8yoUP.js.map → RichTextEditor-CTIGe6xA.js.map} +1 -1
- package/dist/RichTextEditor.js +1 -1
- package/dist/{SavedFiltersButton-FcYVncxU.js → SavedFiltersButton-DV0xxLat.js} +251 -165
- package/dist/SavedFiltersButton-DV0xxLat.js.map +1 -0
- package/dist/SavedFiltersButton.js +1 -1
- package/dist/SelectField.js +1 -1
- package/dist/{SelectFieldSync-Bi8HsMYP.js → SelectFieldSync-rwfeNwN2.js} +45 -11
- package/dist/SelectFieldSync-rwfeNwN2.js.map +1 -0
- package/dist/SelectMenu.js +1 -1
- package/dist/{SelectMenuSync-DKg4g5nN.js → SelectMenuSync-BkC0FD5P.js} +22 -8
- package/dist/SelectMenuSync-BkC0FD5P.js.map +1 -0
- package/dist/{SelectOptions-DszNAjxB.js → SelectOptions-B3Vmtb_k.js} +2 -2
- package/dist/{SelectOptions-DszNAjxB.js.map → SelectOptions-B3Vmtb_k.js.map} +1 -1
- package/dist/{SelectTrigger-DNIc5ttg.js → SelectTrigger-BAnVo4Ln.js} +2 -2
- package/dist/{SelectTrigger-DNIc5ttg.js.map → SelectTrigger-BAnVo4Ln.js.map} +1 -1
- package/dist/SelectTrigger.js +1 -1
- package/dist/{SelectTriggerBase-1Cc6EUBw.js → SelectTriggerBase-D7zAT0UR.js} +8 -3
- package/dist/SelectTriggerBase-D7zAT0UR.js.map +1 -0
- package/dist/SelectTriggerBase.css +49 -47
- package/dist/SelectTriggerBase.module-mYOfdBGA.js +40 -0
- package/dist/SelectTriggerBase.module-mYOfdBGA.js.map +1 -0
- package/dist/Tab-Bqfvg8Ce.js.map +1 -1
- package/dist/Table.js +1 -1
- package/dist/Textarea-B3C7AkPj.js.map +1 -1
- package/dist/{Toolbar-2VQIjU5b.js → Toolbar-BOgHhw7K.js} +12 -3
- package/dist/Toolbar-BOgHhw7K.js.map +1 -0
- package/dist/{Toolbar-BbImThIu.js → Toolbar-DDWUuQm_.js} +24 -2
- package/dist/Toolbar-DDWUuQm_.js.map +1 -0
- package/dist/Toolbar.js +2 -2
- package/dist/{ToolbarButtonToggle-Bc0XvCM9.js → ToolbarButtonToggle-BbtKfezH.js} +18 -2
- package/dist/ToolbarButtonToggle-BbtKfezH.js.map +1 -0
- package/dist/TreeSelectField.js +1 -1
- package/dist/{TreeSelectFieldSync-DUHVmOQa.js → TreeSelectFieldSync-BRQgLPxB.js} +118 -87
- package/dist/TreeSelectFieldSync-BRQgLPxB.js.map +1 -0
- package/dist/TreeSelectFieldSync.css +44 -36
- package/dist/TreeSelectMenu.js +1 -1
- package/dist/{TreeSelectMenuSync-DVoYUG7F.js → TreeSelectMenuSync-88q0ydo5.js} +18 -6
- package/dist/TreeSelectMenuSync-88q0ydo5.js.map +1 -0
- package/dist/{YearlessDateInputWithPicker-CM9mmz8s.js → YearlessDateInputWithPicker-BquY4bCd.js} +19 -5
- package/dist/YearlessDateInputWithPicker-BquY4bCd.js.map +1 -0
- package/dist/anvParts-BGg5dgfl.js +43 -0
- package/dist/anvParts-BGg5dgfl.js.map +1 -0
- package/dist/beta.js +13 -13
- package/dist/{bulkActionTypes-BnZNAru6.js → bulkActionTypes-CWcUhKFS.js} +2 -2
- package/dist/{bulkActionTypes-BnZNAru6.js.map → bulkActionTypes-CWcUhKFS.js.map} +1 -1
- package/dist/downshift.esm-xtSnQp44.js.map +1 -1
- package/dist/{filter-state-XmqhkURU.js → filter-state-zlL4luoE.js} +153 -81
- package/dist/filter-state-zlL4luoE.js.map +1 -0
- package/dist/floating-ui.react-dom-CyrxPiI-.js.map +1 -1
- package/dist/index-DXeGMe23.js.map +1 -1
- package/dist/{index-BwNeldDw.js → index-DjirBR0l.js} +2 -2
- package/dist/{index-BwNeldDw.js.map → index-DjirBR0l.js.map} +1 -1
- package/dist/index.esm-C2ZhC_8d.js.map +1 -1
- package/dist/index.js +16 -16
- package/dist/proxy-DEehATlA.js.map +1 -1
- package/dist/src/beta/components/FilterBar/FilterBar.d.ts +3 -3
- package/dist/src/beta/components/FilterBar/internal/utils/dateListLibraryOptions.d.ts +17 -3
- package/dist/src/beta/components/FilterBar/parts.d.ts +38 -0
- package/dist/src/beta/components/SavedFiltersButton/parts.d.ts +37 -0
- package/dist/src/beta/components/SavedFiltersButton/types.d.ts +2 -1
- package/dist/src/beta/components/Table/DataTable/DataTable.d.ts +3 -2
- package/dist/src/beta/components/Table/DataTable/parts.d.ts +30 -0
- package/dist/src/beta/components/Table/internal/ResizeHandle.d.ts +3 -2
- package/dist/src/beta/components/Toolbar/Toolbar.d.ts +4 -4
- package/dist/src/beta/components/Toolbar/parts.d.ts +19 -0
- package/dist/src/beta/components/TreeSelectField/TreeSelectField.d.ts +6 -5
- package/dist/src/beta/components/TreeSelectField/parts.d.ts +23 -0
- package/dist/src/beta/components/TreeSelectField/types.d.ts +11 -4
- package/dist/src/beta/components/TreeSelectMenu/TreeSelectMenu.d.ts +33 -2
- package/dist/src/beta/components/TreeSelectMenu/parts.d.ts +12 -0
- package/dist/src/beta/components/TreeSelectMenu/types.d.ts +3 -2
- package/dist/src/components/Combobox/ComboboxTypes.d.ts +2 -2
- package/dist/src/components/Combobox/parts.d.ts +19 -0
- package/dist/src/components/DateFieldRange/DateFieldRange.d.ts +2 -2
- package/dist/src/components/DateFieldRange/parts.d.ts +16 -0
- package/dist/src/components/DateFieldSingle/DateFieldSingle.d.ts +2 -2
- package/dist/src/components/DateFieldSingle/parts.d.ts +16 -0
- package/dist/src/components/DateFieldYearless/DateFieldYearless.d.ts +2 -2
- package/dist/src/components/DateFieldYearless/parts.d.ts +15 -0
- package/dist/src/components/DateFieldYearlessRange/DateFieldYearlessRange.d.ts +2 -2
- package/dist/src/components/DateFieldYearlessRange/parts.d.ts +12 -0
- package/dist/src/components/DrillDown/DrillDown.d.ts +11 -0
- package/dist/src/components/MultiSelectField/internal/MultiSelectFieldComboboxMode.d.ts +1 -1
- package/dist/src/components/MultiSelectField/internal/MultiSelectFieldSelectMode.d.ts +1 -1
- package/dist/src/components/MultiSelectField/internal/types.d.ts +3 -1
- package/dist/src/components/MultiSelectField/parts.d.ts +20 -0
- package/dist/src/components/MultiSelectField/types.d.ts +2 -2
- package/dist/src/components/MultiSelectMenu/parts.d.ts +12 -0
- package/dist/src/components/MultiSelectMenu/types.d.ts +3 -2
- package/dist/src/components/Pagination/Pagination.d.ts +4 -3
- package/dist/src/components/Pagination/parts.d.ts +28 -0
- package/dist/src/components/SelectField/internal/SelectFieldComboboxMode.d.ts +1 -1
- package/dist/src/components/SelectField/internal/SelectFieldSelectMode.d.ts +1 -1
- package/dist/src/components/SelectField/parts.d.ts +18 -0
- package/dist/src/components/SelectField/types.d.ts +7 -2
- package/dist/src/components/SelectMenu/internal/useMenuInteraction.d.ts +8 -6
- package/dist/src/components/SelectMenu/parts.d.ts +12 -0
- package/dist/src/components/SelectMenu/types.d.ts +3 -2
- package/dist/src/components/SelectTrigger/internal/SelectTriggerBase.d.ts +6 -5
- package/dist/src/components/Toolbar/Toolbar.d.ts +3 -3
- package/dist/src/components/Toolbar/parts.d.ts +18 -0
- package/dist/src/internal/constants/anvParts.d.ts +81 -0
- package/dist/src/internal/testing/anvPartsContract.d.ts +24 -0
- package/dist/src/internal/types/selectFieldInternalTypes.d.ts +3 -1
- package/dist/{syncFilterUtils-UVNoFsDr.js → syncFilterUtils-YB6gRuuR.js} +11 -4
- package/dist/syncFilterUtils-YB6gRuuR.js.map +1 -0
- package/dist/{treeSync-CiU5d6rF.js → treeSync-DOen59wP.js} +24 -4
- package/dist/treeSync-DOen59wP.js.map +1 -0
- package/dist/use-reduced-motion-CqjZZ5QB.js.map +1 -1
- package/dist/{useAdaptiveView-C_WvM4-P.js → useAdaptiveView-DmhhcX-B.js} +3 -1
- package/dist/useAdaptiveView-DmhhcX-B.js.map +1 -0
- package/dist/useChipLayout-BBe6Tzyl.js +90 -0
- package/dist/useChipLayout-BBe6Tzyl.js.map +1 -0
- package/dist/{useDrillDownContext-iUvoTget.js → useDrillDownContext-D5_NjqY4.js} +2 -2
- package/dist/{useDrillDownContext-iUvoTget.js.map → useDrillDownContext-D5_NjqY4.js.map} +1 -1
- package/dist/{useDrilldown-D7DKSs7E.js → useDrilldown-glecoaI_.js} +45 -19
- package/dist/{useDrilldown-D7DKSs7E.js.map → useDrilldown-glecoaI_.js.map} +1 -1
- package/dist/{useInfiniteCombobox-COJTJxCZ.js → useInfiniteCombobox-CVAYoUvh.js} +70 -23
- package/dist/useInfiniteCombobox-CVAYoUvh.js.map +1 -0
- package/dist/{useMenuInteraction-AgrXU8kv.js → useMenuInteraction-nNF1dsrp.js} +7 -4
- package/dist/useMenuInteraction-nNF1dsrp.js.map +1 -0
- package/dist/useSize.js.map +1 -1
- package/package.json +9 -7
- package/dist/DataTable-CRzQKN_P.js.map +0 -1
- package/dist/DateFieldRange-CHbrYgsD.js.map +0 -1
- package/dist/DateFieldSingle-D-KZ3NL0.js.map +0 -1
- package/dist/DateFieldYearless-DouEX24o.js.map +0 -1
- package/dist/DateFieldYearlessRange-B_bImgyn.js.map +0 -1
- package/dist/DrillDown.module-D1Bf9_yP.js +0 -27
- package/dist/FilterBar-CBTAkEri.js.map +0 -1
- package/dist/MenuFooter-BXcNxNnX.js.map +0 -1
- package/dist/MultiSelectFieldSync-CpfsWecG.js.map +0 -1
- package/dist/MultiSelectMenuSync-CtyLYyDE.js.map +0 -1
- package/dist/Page-B6E3Gbji.js.map +0 -1
- package/dist/Pagination-DF7iMeJe.js.map +0 -1
- package/dist/SavedFiltersButton-FcYVncxU.js.map +0 -1
- package/dist/SelectFieldSync-Bi8HsMYP.js.map +0 -1
- package/dist/SelectMenuSync-DKg4g5nN.js.map +0 -1
- package/dist/SelectTriggerBase-1Cc6EUBw.js.map +0 -1
- package/dist/SelectTriggerBase.module-Brmw1nYG.js +0 -39
- package/dist/SelectTriggerBase.module-Brmw1nYG.js.map +0 -1
- package/dist/Toolbar-2VQIjU5b.js.map +0 -1
- package/dist/Toolbar-BbImThIu.js.map +0 -1
- package/dist/ToolbarButtonToggle-Bc0XvCM9.js.map +0 -1
- package/dist/TreeSelectFieldSync-DUHVmOQa.js.map +0 -1
- package/dist/TreeSelectMenuSync-DVoYUG7F.js.map +0 -1
- package/dist/YearlessDateInputWithPicker-CM9mmz8s.js.map +0 -1
- package/dist/filter-state-XmqhkURU.js.map +0 -1
- package/dist/syncFilterUtils-UVNoFsDr.js.map +0 -1
- package/dist/treeSync-CiU5d6rF.js.map +0 -1
- package/dist/useAdaptiveView-C_WvM4-P.js.map +0 -1
- package/dist/useChipLayout-BWZfKDgd.js +0 -51
- package/dist/useChipLayout-BWZfKDgd.js.map +0 -1
- package/dist/useInfiniteCombobox-COJTJxCZ.js.map +0 -1
- package/dist/useMenuInteraction-AgrXU8kv.js.map +0 -1
|
@@ -10,6 +10,17 @@ import { PassThroughPropsWithRef } from '../../types';
|
|
|
10
10
|
export type DrillDownProps = PassThroughPropsWithRef<"div"> & {
|
|
11
11
|
index: number;
|
|
12
12
|
onClose?: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* Suspends this screen's focus trap while `false`, even though the screen
|
|
15
|
+
* stays mounted and visible. Use when a consumer opens an independent
|
|
16
|
+
* Dialog/Drawer of their own (not a nested `DrillDown` index — e.g. a
|
|
17
|
+
* `DateListDialog` triggered from a form field in this screen) that stacks
|
|
18
|
+
* on top: that overlay isn't a descendant of this screen's trap boundary,
|
|
19
|
+
* so without this escape hatch the trap treats every click inside it as
|
|
20
|
+
* "outside" and blocks it.
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
interactive?: boolean;
|
|
13
24
|
};
|
|
14
25
|
/**
|
|
15
26
|
* Multi-step, hierarchical drill-down navigation component for Dialog, Drawer, and Page.Panel — lets users drill down by selecting a category to go deeper into nested subcategories or screens, and navigate back up.
|
|
@@ -2,4 +2,4 @@ import { MultiSelectFieldComboboxInternalProps } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Combobox mode: searchable multi-select using useCombobox.
|
|
4
4
|
*/
|
|
5
|
-
export declare const MultiSelectFieldComboboxMode: ({ labelAiMark, id, helperUid, selectedOptions, onSelectedOptionsChange, displayAs, isDisabledOrReadOnly, disabled, readOnly, isHighlighted, required, placeholder, size, error, hasHelperText, disableClearButton, prefix, suffix, label, hideLabel, hint, moreInfo, moreInfoId, errorMessages, warning, description, className, style, layoutStyles, pinned, groupToString, groupSorter, virtualize, options, loading, loadingMore, hasMore, loadOptions, loadMore, initialLoad, initialLoadPerformed, setInitialLoadPerformed, inputWrapperRef, debounceMs, selectAll, selectFiltered, bulkPending, onBulkActivate, singleRow, maxChips, getChipProps, onSearchChange, addItemLabel, onAddNewItem, handleRemoveOption, handleClear, }: MultiSelectFieldComboboxInternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const MultiSelectFieldComboboxMode: ({ labelAiMark, id, helperUid, selectedOptions, onSelectedOptionsChange, displayAs, isDisabledOrReadOnly, disabled, readOnly, isHighlighted, required, placeholder, size, error, hasHelperText, disableClearButton, prefix, suffix, label, hideLabel, hint, moreInfo, moreInfoId, errorMessages, warning, description, className, style, layoutStyles, pinned, groupToString, groupSorter, virtualize, options, loading, loadingMore, hasMore, loadOptions, loadMore, initialLoad, initialLoadPerformed, setInitialLoadPerformed, inputWrapperRef, debounceMs, selectAll, selectFiltered, bulkPending, onBulkActivate, singleRow, maxChips, getChipProps, onSearchChange, addItemLabel, onAddNewItem, handleRemoveOption, handleClear, dataAttributes, }: MultiSelectFieldComboboxInternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,4 +3,4 @@ import { MultiSelectFieldBaseInternalProps } from './types';
|
|
|
3
3
|
* Select mode: non-searchable multi-select using useSelect.
|
|
4
4
|
* Active when disableSearch is true.
|
|
5
5
|
*/
|
|
6
|
-
export declare const MultiSelectFieldSelectMode: ({ labelAiMark, id, helperUid, selectedOptions, onSelectedOptionsChange, displayAs, isDisabledOrReadOnly, disabled, readOnly, isHighlighted, required, placeholder, size, error, hasHelperText, disableClearButton, prefix, suffix, label, hideLabel, hint, moreInfo, moreInfoId, errorMessages, warning, description, className, style, layoutStyles, pinned, groupToString, groupSorter, virtualize, options, loading, loadingMore, hasMore, loadOptions, loadMore, initialLoad, initialLoadPerformed, setInitialLoadPerformed, inputWrapperRef, selectAll, bulkPending, onBulkActivate, singleRow, maxChips, getChipProps, addItemLabel, onAddNewItem, handleRemoveOption, handleClear, }: MultiSelectFieldBaseInternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const MultiSelectFieldSelectMode: ({ labelAiMark, id, helperUid, selectedOptions, onSelectedOptionsChange, displayAs, isDisabledOrReadOnly, disabled, readOnly, isHighlighted, required, placeholder, size, error, hasHelperText, disableClearButton, prefix, suffix, label, hideLabel, hint, moreInfo, moreInfoId, errorMessages, warning, description, className, style, layoutStyles, pinned, groupToString, groupSorter, virtualize, options, loading, loadingMore, hasMore, loadOptions, loadMore, initialLoad, initialLoadPerformed, setInitialLoadPerformed, inputWrapperRef, selectAll, bulkPending, onBulkActivate, singleRow, maxChips, getChipProps, addItemLabel, onAddNewItem, handleRemoveOption, handleClear, dataAttributes, }: MultiSelectFieldBaseInternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement, ReactNode, RefObject } from 'react';
|
|
2
|
-
import { AiMarkWithTooltipOrPopoverProps, CheckState } from '../../../types';
|
|
2
|
+
import { AiMarkWithTooltipOrPopoverProps, CheckState, DataAttributes } from '../../../types';
|
|
3
3
|
import { AddNewItemProps } from '../../../internal/types/addNewItemTypes';
|
|
4
4
|
import { MultiSelectFieldChipProps, MultiSelectFieldOption, MultiSelectFieldProps } from '../types';
|
|
5
5
|
export type MultiSelectFieldBaseInternalProps = {
|
|
@@ -63,6 +63,8 @@ export type MultiSelectFieldBaseInternalProps = {
|
|
|
63
63
|
id: string | number;
|
|
64
64
|
}) => void;
|
|
65
65
|
handleClear: () => void;
|
|
66
|
+
/** Consumer-supplied `data-*` attributes forwarded to the field wrapper. */
|
|
67
|
+
dataAttributes?: DataAttributes;
|
|
66
68
|
} & AddNewItemProps;
|
|
67
69
|
export type MultiSelectFieldComboboxInternalProps = MultiSelectFieldBaseInternalProps & {
|
|
68
70
|
debounceMs: number;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `data-anv-part` names for MultiSelectField's interactive sub-elements.
|
|
3
|
+
*
|
|
4
|
+
* Scope a query by the consumer's `data-cy` on the field root
|
|
5
|
+
* (`[data-cy="x"] [data-anv-part="input"]`). Portaled parts (`menu`, `option`,
|
|
6
|
+
* `dialog`, `popover`) come from the shared option internals and render in the
|
|
7
|
+
* top layer — target them by part attribute or the field's `#{id}-popover` /
|
|
8
|
+
* `#{id}-dialog`.
|
|
9
|
+
*
|
|
10
|
+
* Every role MultiSelectField needs is a shared one, so all values come from
|
|
11
|
+
* `COMMON_PART`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PARTS: {
|
|
14
|
+
readonly trigger: "trigger";
|
|
15
|
+
readonly input: "input";
|
|
16
|
+
readonly chip: "chip";
|
|
17
|
+
readonly overflowChip: "overflow-chip";
|
|
18
|
+
readonly clearButton: "clear-button";
|
|
19
|
+
readonly toggleButton: "toggle-button";
|
|
20
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AriaAttributes, CSSProperties, ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { AiMarkWithTooltipOrPopoverProps, LayoutUtilProps, Size } from '../../types';
|
|
2
|
+
import { AiMarkWithTooltipOrPopoverProps, DataAttributes, LayoutUtilProps, Size } from '../../types';
|
|
3
3
|
import { SelectFieldGroupByValue, SelectFieldOption, SelectFieldOptionContent } from '../SelectField/types';
|
|
4
4
|
import { ChipProps } from '../../components/Chip';
|
|
5
5
|
import { AddNewItemProps } from '../../internal/types/addNewItemTypes';
|
|
@@ -294,7 +294,7 @@ type MultiSelectFieldCommonProps = {
|
|
|
294
294
|
* @returns Partial chip props to merge onto the chip
|
|
295
295
|
*/
|
|
296
296
|
getChipProps?: (option: MultiSelectFieldOption) => MultiSelectFieldChipProps;
|
|
297
|
-
} & MultiSelectFieldSearchProps & LayoutUtilProps & AddNewItemProps;
|
|
297
|
+
} & MultiSelectFieldSearchProps & LayoutUtilProps & AddNewItemProps & DataAttributes;
|
|
298
298
|
type MultiSelectFieldGroupingProps = {
|
|
299
299
|
/**
|
|
300
300
|
* Function to convert a group value to a display label.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `data-anv-part` names for MultiSelectMenu interactive sub-elements.
|
|
3
|
+
*
|
|
4
|
+
* There is no wrapper root — attach consumer `data-*` (e.g. `data-cy`) via
|
|
5
|
+
* props; they are merged into the trigger render-prop bag. Portaled
|
|
6
|
+
* `menu` / `option` / `popover` / `dialog` / footer buttons come from shared
|
|
7
|
+
* internals (not redeclared here).
|
|
8
|
+
*/
|
|
9
|
+
export declare const PARTS: {
|
|
10
|
+
readonly trigger: "trigger";
|
|
11
|
+
readonly input: "input";
|
|
12
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { KeyboardEvent, ReactElement, RefObject } from 'react';
|
|
2
|
+
import { DataAttributes } from '../../types';
|
|
2
3
|
import { SelectFieldGroupByValue, SelectFieldOption, SelectFieldOptionContent } from '../SelectField/types';
|
|
3
4
|
import { MultiSelectFieldCacheOptions, MultiSelectFieldEagerLoader, MultiSelectFieldGroupLazyLoader, MultiSelectFieldOffsetLazyLoader, MultiSelectFieldPageLazyLoader, MultiSelectFieldPinnedOptions, MultiSelectFieldSearchProps } from '../MultiSelectField/types';
|
|
4
5
|
import { AddNewItemProps } from '../../internal/types/addNewItemTypes';
|
|
@@ -54,7 +55,7 @@ export type MultiSelectMenuTriggerProps = {
|
|
|
54
55
|
"aria-controls": string;
|
|
55
56
|
"aria-expanded": boolean;
|
|
56
57
|
"data-state": "open" | "close";
|
|
57
|
-
};
|
|
58
|
+
} & DataAttributes;
|
|
58
59
|
type MultiSelectMenuCommonProps = {
|
|
59
60
|
/**
|
|
60
61
|
* The id of the multi-select menu.
|
|
@@ -188,7 +189,7 @@ type MultiSelectMenuCommonProps = {
|
|
|
188
189
|
label?: string;
|
|
189
190
|
disabled?: boolean;
|
|
190
191
|
};
|
|
191
|
-
} & MultiSelectMenuSearchProps & AddNewItemProps;
|
|
192
|
+
} & MultiSelectMenuSearchProps & AddNewItemProps & DataAttributes;
|
|
192
193
|
type MultiSelectMenuGroupingProps = {
|
|
193
194
|
/**
|
|
194
195
|
* Function to convert a group value to a display label.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataTrackingId } from '../../types';
|
|
1
|
+
import { DataAttributes, DataTrackingId } from '../../types';
|
|
2
2
|
import { PaginationProps as BasePaginationProps } from './internal/Pagination';
|
|
3
3
|
/**
|
|
4
4
|
* Props for the Pagination component
|
|
@@ -12,8 +12,9 @@ import { PaginationProps as BasePaginationProps } from './internal/Pagination';
|
|
|
12
12
|
* @property {string} [itemsPerPageLabel] - Custom label displayed before the items-per-page selector. Defaults to "Rows per page"
|
|
13
13
|
* @extends Omit<BasePaginationProps, "children">
|
|
14
14
|
* @extends DataTrackingId
|
|
15
|
+
* @extends DataAttributes
|
|
15
16
|
*/
|
|
16
|
-
export type PaginationProps = Omit<BasePaginationProps, "children"> & DataTrackingId & {
|
|
17
|
+
export type PaginationProps = Omit<BasePaginationProps, "children"> & DataTrackingId & DataAttributes & {
|
|
17
18
|
page: number;
|
|
18
19
|
itemsPerPage: number;
|
|
19
20
|
itemsPerPageOptions?: number[];
|
|
@@ -47,7 +48,7 @@ export type PaginationProps = Omit<BasePaginationProps, "children"> & DataTracki
|
|
|
47
48
|
* onItemsPerPageChange={(itemsPerPage) => console.log('Items per page:', itemsPerPage)}
|
|
48
49
|
* />
|
|
49
50
|
*/
|
|
50
|
-
export declare const Pagination: import('react').ForwardRefExoticComponent<Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "children"> & DataTrackingId & {
|
|
51
|
+
export declare const Pagination: import('react').ForwardRefExoticComponent<Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "children"> & DataTrackingId & DataAttributes & {
|
|
51
52
|
page: number;
|
|
52
53
|
itemsPerPage: number;
|
|
53
54
|
itemsPerPageOptions?: number[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `data-anv-part` names for Pagination's interactive sub-elements.
|
|
3
|
+
*
|
|
4
|
+
* Scope a query by the consumer's `data-cy` on the Pagination root
|
|
5
|
+
* (`[data-cy="x"] [data-anv-part="next-page-button"]`).
|
|
6
|
+
*
|
|
7
|
+
* Repeated parts use secondary discriminators:
|
|
8
|
+
* - page buttons / overflow options: `data-page`
|
|
9
|
+
* - items-per-page options: `data-items-per-page`
|
|
10
|
+
*
|
|
11
|
+
* Overflow and items-per-page menus render in the browser top layer — target
|
|
12
|
+
* `option` parts by attribute (or after opening the matching trigger), not as
|
|
13
|
+
* descendants of the Pagination root.
|
|
14
|
+
*/
|
|
15
|
+
export declare const PARTS: {
|
|
16
|
+
/** Shared role for menu options (overflow pages + items-per-page). */
|
|
17
|
+
readonly option: "option";
|
|
18
|
+
/** Previous-page control. */
|
|
19
|
+
readonly prevPageButton: "prev-page-button";
|
|
20
|
+
/** Next-page control. */
|
|
21
|
+
readonly nextPageButton: "next-page-button";
|
|
22
|
+
/** Numbered page control. Narrow with `data-page`. */
|
|
23
|
+
readonly pageButton: "page-button";
|
|
24
|
+
/** Ellipsis control that opens the overflow page menu. */
|
|
25
|
+
readonly overflowTrigger: "overflow-trigger";
|
|
26
|
+
/** Control that opens the items-per-page menu. */
|
|
27
|
+
readonly itemsPerPageTrigger: "items-per-page-trigger";
|
|
28
|
+
};
|
|
@@ -3,4 +3,4 @@ import { SelectFieldComboboxInternalProps } from '../../../internal/types/select
|
|
|
3
3
|
* Combobox mode: searchable select using useCombobox.
|
|
4
4
|
* This is the default behavior when disableSearch is false.
|
|
5
5
|
*/
|
|
6
|
-
export declare const SelectFieldComboboxMode: ({ id, helperUid, selectedOption, onSelectedOptionChange, displayAs, isDisabledOrReadOnly, disabled, labelAiMark, readOnly, isHighlighted, required, placeholder, size, error, hasHelperText, disableClearButton, prefix, suffix, label, hideLabel, hint, moreInfo, moreInfoId, errorMessages, warning, description, className, style, layoutStyles, pinned, groupToString, groupSorter, virtualize, options, loading, loadingMore, hasMore, loadOptions, loadMore, initialLoad, initialLoadPerformed, setInitialLoadPerformed, inputWrapperRef, debounceMs, addItemLabel, onAddNewItem, }: SelectFieldComboboxInternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const SelectFieldComboboxMode: ({ id, helperUid, selectedOption, onSelectedOptionChange, displayAs, isDisabledOrReadOnly, disabled, labelAiMark, readOnly, isHighlighted, required, placeholder, size, error, hasHelperText, disableClearButton, prefix, suffix, label, hideLabel, hint, moreInfo, moreInfoId, errorMessages, warning, description, className, style, layoutStyles, pinned, groupToString, groupSorter, virtualize, options, loading, loadingMore, hasMore, loadOptions, loadMore, initialLoad, initialLoadPerformed, setInitialLoadPerformed, inputWrapperRef, debounceMs, addItemLabel, onAddNewItem, dataAttributes, }: SelectFieldComboboxInternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,4 +3,4 @@ import { SelectFieldBaseInternalProps } from '../../../internal/types/selectFiel
|
|
|
3
3
|
* Select mode: non-searchable select using useSelect.
|
|
4
4
|
* Active when disableSearch is true.
|
|
5
5
|
*/
|
|
6
|
-
export declare const SelectFieldSelectMode: ({ labelAiMark, id, helperUid, selectedOption, onSelectedOptionChange, displayAs, isDisabledOrReadOnly, disabled, readOnly, isHighlighted, placeholder, size, error, hasHelperText, disableClearButton, prefix, suffix, label, hideLabel, hint, moreInfo, moreInfoId, errorMessages, warning, description, className, style, layoutStyles, pinned, groupToString, groupSorter, virtualize, options, loading, loadingMore, hasMore, loadOptions, loadMore, initialLoad, initialLoadPerformed, setInitialLoadPerformed, inputWrapperRef, required, addItemLabel, onAddNewItem, }: SelectFieldBaseInternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const SelectFieldSelectMode: ({ labelAiMark, id, helperUid, selectedOption, onSelectedOptionChange, displayAs, isDisabledOrReadOnly, disabled, readOnly, isHighlighted, placeholder, size, error, hasHelperText, disableClearButton, prefix, suffix, label, hideLabel, hint, moreInfo, moreInfoId, errorMessages, warning, description, className, style, layoutStyles, pinned, groupToString, groupSorter, virtualize, options, loading, loadingMore, hasMore, loadOptions, loadMore, initialLoad, initialLoadPerformed, setInitialLoadPerformed, inputWrapperRef, required, addItemLabel, onAddNewItem, dataAttributes, }: SelectFieldBaseInternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `data-anv-part` names for SelectField's interactive sub-elements.
|
|
3
|
+
*
|
|
4
|
+
* Scope a query by the consumer's `data-cy` on the field root
|
|
5
|
+
* (`[data-cy="x"] [data-anv-part="input"]`). Portaled parts (`menu`, `option`,
|
|
6
|
+
* `dialog`, `popover`) come from the shared option internals and render in the
|
|
7
|
+
* top layer — target them by part attribute or the field's `#{id}-popover` /
|
|
8
|
+
* `#{id}-dialog`.
|
|
9
|
+
*
|
|
10
|
+
* Every role SelectField needs is a shared one, so all values come from
|
|
11
|
+
* `COMMON_PART`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PARTS: {
|
|
14
|
+
readonly trigger: "trigger";
|
|
15
|
+
readonly input: "input";
|
|
16
|
+
readonly clearButton: "clear-button";
|
|
17
|
+
readonly toggleButton: "toggle-button";
|
|
18
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AriaAttributes, CSSProperties, ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { AiMarkWithTooltipOrPopoverProps, LayoutUtilProps, Size } from '../../types';
|
|
2
|
+
import { AiMarkWithTooltipOrPopoverProps, DataAttributes, LayoutUtilProps, Size } from '../../types';
|
|
3
3
|
import { OptionContent } from '../../internal/types/optionContent';
|
|
4
4
|
import { AddNewItemProps } from '../../internal/types/addNewItemTypes';
|
|
5
5
|
/**
|
|
@@ -31,6 +31,11 @@ export type SelectFieldOption = {
|
|
|
31
31
|
label: string;
|
|
32
32
|
searchText?: string;
|
|
33
33
|
group?: SelectFieldGroupByValue;
|
|
34
|
+
/**
|
|
35
|
+
* When true, the option cannot be selected from the menu. If the option is
|
|
36
|
+
* already in the field `value`, MultiSelectField also treats it as locked:
|
|
37
|
+
* the chip has no close control, and clear / backspace skip it.
|
|
38
|
+
*/
|
|
34
39
|
disabled?: boolean;
|
|
35
40
|
extra?: Record<string, unknown>;
|
|
36
41
|
content?: SelectFieldOptionContent;
|
|
@@ -252,7 +257,7 @@ type SelectFieldCommonSelectFieldProps = {
|
|
|
252
257
|
* @default false
|
|
253
258
|
*/
|
|
254
259
|
disableSearch?: boolean;
|
|
255
|
-
} & SelectFieldSearchProps & SelectFieldAddNewOptionProps & LayoutUtilProps & AddNewItemProps;
|
|
260
|
+
} & SelectFieldSearchProps & SelectFieldAddNewOptionProps & LayoutUtilProps & AddNewItemProps & DataAttributes;
|
|
256
261
|
type SelectFieldGroupingProps = {
|
|
257
262
|
/**
|
|
258
263
|
* Function to convert a group value to a display label.
|
|
@@ -36,12 +36,12 @@ export type MenuTriggerProps = {
|
|
|
36
36
|
"aria-controls": string;
|
|
37
37
|
"aria-expanded": boolean;
|
|
38
38
|
"data-state": "open" | "close";
|
|
39
|
-
}
|
|
39
|
+
} & Record<`data-${string}`, string>;
|
|
40
40
|
type MenuPropsArg = {
|
|
41
41
|
className?: string;
|
|
42
42
|
style?: CSSProperties;
|
|
43
|
-
}
|
|
44
|
-
type MenuReturnProps =
|
|
43
|
+
} & Record<string, unknown>;
|
|
44
|
+
type MenuReturnProps = {
|
|
45
45
|
role: "listbox";
|
|
46
46
|
id: string;
|
|
47
47
|
"aria-label": string;
|
|
@@ -50,13 +50,15 @@ type MenuReturnProps = MenuPropsArg & {
|
|
|
50
50
|
"aria-activedescendant"?: string;
|
|
51
51
|
ref: RefObject<HTMLDivElement>;
|
|
52
52
|
onKeyDown: (e: KeyboardEvent) => void;
|
|
53
|
-
|
|
53
|
+
className?: string;
|
|
54
|
+
style?: CSSProperties;
|
|
55
|
+
} & Record<string, unknown>;
|
|
54
56
|
type ItemPropsArg = {
|
|
55
57
|
item: SelectItem;
|
|
56
58
|
index: number;
|
|
57
59
|
className?: string;
|
|
58
60
|
"data-type"?: string;
|
|
59
|
-
}
|
|
61
|
+
} & Record<string, unknown>;
|
|
60
62
|
type ItemReturnProps = {
|
|
61
63
|
role: "option";
|
|
62
64
|
id: string;
|
|
@@ -66,7 +68,7 @@ type ItemReturnProps = {
|
|
|
66
68
|
onMouseMove: () => void;
|
|
67
69
|
className?: string;
|
|
68
70
|
"data-type"?: string;
|
|
69
|
-
}
|
|
71
|
+
} & Record<string, unknown>;
|
|
70
72
|
export type GetMenuPropsFn = (opts?: MenuPropsArg) => MenuReturnProps;
|
|
71
73
|
export type GetItemPropsFn = (opts: ItemPropsArg) => ItemReturnProps;
|
|
72
74
|
export declare const useMenuInteraction: ({ items, sectionsMeta: _sectionsMeta, onItemActivate, selectedItemIds, displayAs: _displayAs, closeOnActivate, disabled, closeOnDisabled, id, triggerRef, label, isOpen, setIsOpen, onImplicitClose, onExplicitClose, }: UseMenuInteractionConfig) => {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `data-anv-part` names for SelectMenu interactive sub-elements.
|
|
3
|
+
*
|
|
4
|
+
* There is no wrapper root — attach consumer `data-*` (e.g. `data-cy`) via
|
|
5
|
+
* props; they are merged into the trigger render-prop bag. Portaled
|
|
6
|
+
* `menu` / `option` / `popover` / `dialog` / footer buttons come from shared
|
|
7
|
+
* internals (not redeclared here).
|
|
8
|
+
*/
|
|
9
|
+
export declare const PARTS: {
|
|
10
|
+
readonly trigger: "trigger";
|
|
11
|
+
readonly input: "input";
|
|
12
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { KeyboardEvent, ReactElement, RefObject } from 'react';
|
|
2
|
+
import { DataAttributes } from '../../types';
|
|
2
3
|
import { SelectFieldCacheOptions, SelectFieldEagerLoader, SelectFieldGroupByValue, SelectFieldGroupLazyLoader, SelectFieldGroupedOption, SelectFieldOffsetLazyLoader, SelectFieldOption, SelectFieldOptionContent, SelectFieldPageLazyLoader, SelectFieldPinnedOptions, SelectFieldSearchProps } from '../SelectField/types';
|
|
3
4
|
import { AddNewItemProps } from '../../internal/types/addNewItemTypes';
|
|
4
5
|
/**
|
|
@@ -48,7 +49,7 @@ export type SelectMenuTriggerProps = {
|
|
|
48
49
|
"aria-controls": string;
|
|
49
50
|
"aria-expanded": boolean;
|
|
50
51
|
"data-state": "open" | "close";
|
|
51
|
-
};
|
|
52
|
+
} & DataAttributes;
|
|
52
53
|
type SelectMenuCommonProps = {
|
|
53
54
|
/**
|
|
54
55
|
* The id of the select menu.
|
|
@@ -145,7 +146,7 @@ type SelectMenuCommonProps = {
|
|
|
145
146
|
label?: string;
|
|
146
147
|
disabled?: boolean;
|
|
147
148
|
};
|
|
148
|
-
} & SelectMenuSearchProps & AddNewItemProps;
|
|
149
|
+
} & SelectMenuSearchProps & AddNewItemProps & DataAttributes;
|
|
149
150
|
type SelectMenuGroupingProps = {
|
|
150
151
|
/**
|
|
151
152
|
* Function to convert a group value to a display label.
|
|
@@ -2,8 +2,8 @@ import { ComponentPropsWithoutRef, MutableRefObject, MouseEventHandler, ReactNod
|
|
|
2
2
|
import { ChipProps } from '../../Chip';
|
|
3
3
|
import { FieldLabelProps } from '../../FieldLabel';
|
|
4
4
|
import { TextFieldProps } from '../../TextField';
|
|
5
|
-
import { DistributiveOmit } from '../../../types';
|
|
6
|
-
type PartialChipProps = Partial<Omit<ChipProps, "icon" | "avatar">> & ({
|
|
5
|
+
import { DataAttributes, DistributiveOmit } from '../../../types';
|
|
6
|
+
type PartialChipProps = Partial<Omit<ChipProps, "icon" | "avatar">> & DataAttributes & ({
|
|
7
7
|
icon?: ChipProps["icon"];
|
|
8
8
|
avatar?: never;
|
|
9
9
|
} | {
|
|
@@ -30,12 +30,13 @@ export type SelectTriggerBaseProps<Item = unknown> = DistributiveOmit<TextFieldP
|
|
|
30
30
|
onClearButtonClick?: MouseEventHandler<HTMLButtonElement>;
|
|
31
31
|
labelProps?: Partial<FieldLabelProps>;
|
|
32
32
|
inputWrapperProps?: ComponentPropsWithoutRef<"div">;
|
|
33
|
-
toggleButtonProps?: ComponentPropsWithoutRef<"button"
|
|
33
|
+
toggleButtonProps?: ComponentPropsWithoutRef<"button"> & DataAttributes;
|
|
34
|
+
clearButtonProps?: ComponentPropsWithoutRef<"button"> & DataAttributes;
|
|
34
35
|
chipProps?: (item: Item, index: number) => PartialChipProps;
|
|
35
|
-
inputProps?: ComponentPropsWithoutRef<"input" | "div"
|
|
36
|
+
inputProps?: ComponentPropsWithoutRef<"input" | "div"> & DataAttributes;
|
|
36
37
|
disableToggleButton?: boolean;
|
|
37
38
|
} & {
|
|
38
39
|
prefix?: string | ReactNode;
|
|
39
40
|
};
|
|
40
|
-
export declare const SelectTriggerBase: <Item>({ className, label, size, error, hint, description, prefix, suffix, maxRows, selectedItemProps, disabled, readOnly, disableClearSelection, itemToString: itemToStringProp, selectedItem, selectedItems, removeSelectedItem, inputValue, referenceRef, variant, onClearButtonClick, labelProps, inputWrapperProps, toggleButtonProps, inputProps, chipProps, disableToggleButton, warning, placeholder, ...rest }: SelectTriggerBaseProps<Item>) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare const SelectTriggerBase: <Item>({ className, label, size, error, hint, description, prefix, suffix, maxRows, selectedItemProps, disabled, readOnly, disableClearSelection, itemToString: itemToStringProp, selectedItem, selectedItems, removeSelectedItem, inputValue, referenceRef, variant, onClearButtonClick, labelProps, inputWrapperProps, toggleButtonProps, clearButtonProps, inputProps, chipProps, disableToggleButton, warning, placeholder, ...rest }: SelectTriggerBaseProps<Item>) => import("react/jsx-runtime").JSX.Element;
|
|
41
42
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ToolbarOverflowTypes, ToolbarSize } from './types';
|
|
2
2
|
import { ComponentPropsWithoutRef, ReactElement } from 'react';
|
|
3
|
-
import { LayoutUtilProps } from '../../types';
|
|
3
|
+
import { DataAttributes, LayoutUtilProps } from '../../types';
|
|
4
4
|
/**
|
|
5
5
|
* Props for the Toolbar component
|
|
6
6
|
* @extends ComponentPropsWithoutRef<"div">
|
|
7
7
|
* @extends LayoutUtilProps
|
|
8
8
|
*/
|
|
9
|
-
export type ToolbarProps = ComponentPropsWithoutRef<"div"> & LayoutUtilProps & {
|
|
9
|
+
export type ToolbarProps = ComponentPropsWithoutRef<"div"> & LayoutUtilProps & DataAttributes & {
|
|
10
10
|
/**
|
|
11
11
|
* Description of the content this toolbar is associated with, used for accessibility
|
|
12
12
|
*/
|
|
@@ -57,7 +57,7 @@ export type ToolbarProps = ComponentPropsWithoutRef<"div"> & LayoutUtilProps & {
|
|
|
57
57
|
* />
|
|
58
58
|
* </Toolbar>
|
|
59
59
|
*/
|
|
60
|
-
export declare const Toolbar: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & LayoutUtilProps & {
|
|
60
|
+
export declare const Toolbar: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & LayoutUtilProps & DataAttributes & {
|
|
61
61
|
/**
|
|
62
62
|
* Description of the content this toolbar is associated with, used for accessibility
|
|
63
63
|
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `data-anv-part` names for Toolbar's interactive sub-elements.
|
|
3
|
+
*
|
|
4
|
+
* Scope in-wrapper parts by the consumer's `data-cy` on the Toolbar root.
|
|
5
|
+
* Overflow menu/items render in the popover top layer — target them by part
|
|
6
|
+
* attribute directly.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PARTS: {
|
|
9
|
+
readonly trigger: "trigger";
|
|
10
|
+
readonly menu: "menu";
|
|
11
|
+
readonly overflowItem: "overflow-item";
|
|
12
|
+
/**
|
|
13
|
+
* A leaf toolbar control (`Toolbar.Button` / `Toolbar.ButtonToggle`).
|
|
14
|
+
* Discriminate with `aria-label`, `id`, or a consumer `data-*`. Callers may
|
|
15
|
+
* override this (e.g. FilterBar stamps `trigger` on boolean toggles).
|
|
16
|
+
*/
|
|
17
|
+
readonly item: "item";
|
|
18
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `data-anv-part` — the internally-managed test attribute for targeting the
|
|
3
|
+
* interactive sub-elements of complex Anvil2 components in end-to-end tests.
|
|
4
|
+
*
|
|
5
|
+
* Scoping model (two independent axes — use either or both):
|
|
6
|
+
* - **Component type**: the component's existing `data-anv` root value
|
|
7
|
+
* (e.g. `data-anv="data-table-base"`). Stable, already present on most roots.
|
|
8
|
+
* - **Instance**: a consumer-supplied `data-*` (e.g. `data-cy`) forwarded to the
|
|
9
|
+
* root. The consumer owns this.
|
|
10
|
+
*
|
|
11
|
+
* A test then queries `[data-anv="<component>"] [data-anv-part="row"]` or
|
|
12
|
+
* `[data-cy="x"] [data-anv-part="row"]`. Because the part is always read in the
|
|
13
|
+
* context of a component, **part names only need to be unique within a single
|
|
14
|
+
* component** — `header`, `row`, and `item` may repeat across components.
|
|
15
|
+
*
|
|
16
|
+
* Kept separate from `data-anv` (which holds structural/decorative values like
|
|
17
|
+
* "popover-content" or "button"); the two attributes coexist on an element.
|
|
18
|
+
*
|
|
19
|
+
* ## Where part names live
|
|
20
|
+
*
|
|
21
|
+
* Each component owns its part names in a co-located `parts.ts` next to its
|
|
22
|
+
* source (e.g. `beta/components/Table/parts.ts`):
|
|
23
|
+
*
|
|
24
|
+
* import { ANV_PART_ATTR } from "../../../internal/constants/anvParts";
|
|
25
|
+
* export const PARTS = {
|
|
26
|
+
* row: "row",
|
|
27
|
+
* cell: "cell",
|
|
28
|
+
* sortToggle: "sort-toggle",
|
|
29
|
+
* } as const;
|
|
30
|
+
*
|
|
31
|
+
* This file centralizes only (1) the attribute name and (2) the small set of
|
|
32
|
+
* roles that recur across many components, so their *string values* stay
|
|
33
|
+
* identical everywhere. Prefer a `COMMON_PART` value when one fits; otherwise
|
|
34
|
+
* define a component-specific name in that component's `parts.ts`.
|
|
35
|
+
*/
|
|
36
|
+
export declare const ANV_PART_ATTR: "data-anv-part";
|
|
37
|
+
/**
|
|
38
|
+
* Cross-cutting part roles whose string values must match across components so
|
|
39
|
+
* consumers can rely on them. Spread or reference these from a component's
|
|
40
|
+
* co-located `parts.ts` rather than re-typing the literals.
|
|
41
|
+
*/
|
|
42
|
+
export declare const COMMON_PART: {
|
|
43
|
+
/** Element that opens a menu/popover/dialog/drawer. */
|
|
44
|
+
readonly trigger: "trigger";
|
|
45
|
+
/** Free-text entry. */
|
|
46
|
+
readonly input: "input";
|
|
47
|
+
/** Button that clears the current value/selection. */
|
|
48
|
+
readonly clearButton: "clear-button";
|
|
49
|
+
/** Button that opens/closes an adjacent surface. */
|
|
50
|
+
readonly toggleButton: "toggle-button";
|
|
51
|
+
/** Button that commits a pending selection. */
|
|
52
|
+
readonly applyButton: "apply-button";
|
|
53
|
+
/** Button that dismisses a surface without committing. */
|
|
54
|
+
readonly cancelButton: "cancel-button";
|
|
55
|
+
/** Listbox/menu container. */
|
|
56
|
+
readonly menu: "menu";
|
|
57
|
+
/** A single option/row within a menu. */
|
|
58
|
+
readonly option: "option";
|
|
59
|
+
/** A selected-value chip. */
|
|
60
|
+
readonly chip: "chip";
|
|
61
|
+
/** Dialog container (top layer). */
|
|
62
|
+
readonly dialog: "dialog";
|
|
63
|
+
/** Popover container (top layer). */
|
|
64
|
+
readonly popover: "popover";
|
|
65
|
+
/** Drawer container (top layer). */
|
|
66
|
+
readonly drawer: "drawer";
|
|
67
|
+
/** Masked text input of a date / date-range field. */
|
|
68
|
+
readonly dateInput: "date-input";
|
|
69
|
+
/** Calendar surface of a date / date-range field. */
|
|
70
|
+
readonly dateCalendar: "date-calendar";
|
|
71
|
+
/** Affordance that adds a new item from a select/combobox menu. */
|
|
72
|
+
readonly addNewItemButton: "add-new-item-button";
|
|
73
|
+
/** Lazy-load control inside a virtualized/paged options list. */
|
|
74
|
+
readonly loadMoreButton: "load-more-button";
|
|
75
|
+
/**
|
|
76
|
+
* "+N" overflow indicator when selected-value chips exceed the visible
|
|
77
|
+
* budget. Distinct from `chip` (real selected values).
|
|
78
|
+
*/
|
|
79
|
+
readonly overflowChip: "overflow-chip";
|
|
80
|
+
};
|
|
81
|
+
export type CommonPart = (typeof COMMON_PART)[keyof typeof COMMON_PART];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type PartsRecord = Record<string, string>;
|
|
2
|
+
type PartKey<T extends PartsRecord> = Extract<keyof T, string>;
|
|
3
|
+
export type ExpectAnvPartsOptions<T extends PartsRecord> = {
|
|
4
|
+
/** Part keys that must be present in `scope` (default: at least one match). */
|
|
5
|
+
present?: PartKey<T>[];
|
|
6
|
+
/** Part keys that must not appear in `scope`. */
|
|
7
|
+
absent?: PartKey<T>[];
|
|
8
|
+
/**
|
|
9
|
+
* Node to query within. Defaults to `document.body` so portaled parts
|
|
10
|
+
* (menu / popover / dialog / drawer) are found without a wrapper.
|
|
11
|
+
*/
|
|
12
|
+
scope?: ParentNode;
|
|
13
|
+
/** Exact match count for a present key. */
|
|
14
|
+
count?: Partial<Record<PartKey<T>, number>>;
|
|
15
|
+
/** Minimum match count for a present key (ignored when `count` is set). */
|
|
16
|
+
minCount?: Partial<Record<PartKey<T>, number>>;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Assert that `data-anv-part` values from a PARTS / COMMON_PART map are present
|
|
20
|
+
* or absent in the DOM. Prefer this over hard-coded attribute strings so
|
|
21
|
+
* renames in `parts.ts` fail the contract instead of silently drifting.
|
|
22
|
+
*/
|
|
23
|
+
export declare function expectAnvParts<T extends PartsRecord>(parts: T, options?: ExpectAnvPartsOptions<T>): void;
|
|
24
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement, ReactNode, RefObject } from 'react';
|
|
2
|
-
import { AiMarkWithTooltipOrPopoverProps, CheckState } from '../../types';
|
|
2
|
+
import { AiMarkWithTooltipOrPopoverProps, CheckState, DataAttributes } from '../../types';
|
|
3
3
|
import { SelectFieldOption, SelectFieldProps } from '../../components/SelectField/types';
|
|
4
4
|
import { AddNewItemProps } from './addNewItemTypes';
|
|
5
5
|
import { ResolvedConfirmation } from './confirmationTypes';
|
|
@@ -66,6 +66,8 @@ export type SelectFieldBaseInternalProps = {
|
|
|
66
66
|
setInitialLoadPerformed: (val: boolean) => void;
|
|
67
67
|
inputWrapperRef: RefObject<HTMLDivElement>;
|
|
68
68
|
confirmation?: ResolvedConfirmation;
|
|
69
|
+
/** Consumer-supplied `data-*` attributes forwarded to the field wrapper. */
|
|
70
|
+
dataAttributes?: DataAttributes;
|
|
69
71
|
} & AddNewItemProps;
|
|
70
72
|
export type SelectFieldComboboxInternalProps = SelectFieldBaseInternalProps & {
|
|
71
73
|
debounceMs: number;
|
|
@@ -3,6 +3,7 @@ import { S as Spinner } from './Spinner-B7tTWcP6.js';
|
|
|
3
3
|
import { B as Button } from './Button-Dwh_Nd4l.js';
|
|
4
4
|
import { c as cx } from './index-De1g9FRV.js';
|
|
5
5
|
import { useState, useRef, useCallback, useEffect, useMemo, forwardRef, useId, useImperativeHandle } from 'react';
|
|
6
|
+
import { C as COMMON_PART, A as ANV_PART_ATTR } from './anvParts-BGg5dgfl.js';
|
|
6
7
|
import { u as useIntersectionObserver } from './useIntersectionObserver-BEmMDO3P.js';
|
|
7
8
|
import { T as Text } from './Text-CIoD_RK4.js';
|
|
8
9
|
import { D as Divider } from './Divider-C7fp5Xb6.js';
|
|
@@ -10,7 +11,7 @@ import { u as useMergeRefs } from './useMergeRefs-Dfmtq9cI.js';
|
|
|
10
11
|
import { S as SrOnly } from './SrOnly-pnf8ajnh.js';
|
|
11
12
|
import { I as Icon } from './Icon-B5zwN7GD.js';
|
|
12
13
|
import { S as SvgCheck } from './check-Cf67OWrZ.js';
|
|
13
|
-
import { b as OptionRow, c as OptionRowSideContent, d as OptionCheckbox, e as OptionContentArea, u as useAdaptiveView } from './useAdaptiveView-
|
|
14
|
+
import { b as OptionRow, c as OptionRowSideContent, d as OptionCheckbox, e as OptionContentArea, u as useAdaptiveView } from './useAdaptiveView-DmhhcX-B.js';
|
|
14
15
|
import { d as defaultRangeExtractor, u as useVirtualizer } from './index-DXeGMe23.js';
|
|
15
16
|
import { S as SvgAdd } from './add-BcQkAUip.js';
|
|
16
17
|
import { m as matchSorter } from './match-sorter.esm-CGAauEiU.js';
|
|
@@ -214,6 +215,7 @@ const SelectOption = ({
|
|
|
214
215
|
item,
|
|
215
216
|
index,
|
|
216
217
|
"data-type": item.type,
|
|
218
|
+
[ANV_PART_ATTR]: COMMON_PART.option,
|
|
217
219
|
className: cx(styles["select-option"], {
|
|
218
220
|
[styles.highlighted]: highlighted && !isSingleSelected,
|
|
219
221
|
[styles["single-selected"]]: isSingleSelected && !highlighted,
|
|
@@ -489,7 +491,8 @@ const OptionsPanel = forwardRef(
|
|
|
489
491
|
};
|
|
490
492
|
const menuProps = getMenuProps({
|
|
491
493
|
className: cx(styles$1["scroller"], className),
|
|
492
|
-
style
|
|
494
|
+
style,
|
|
495
|
+
[ANV_PART_ATTR]: COMMON_PART.menu
|
|
493
496
|
});
|
|
494
497
|
const menuRef = useMergeRefs([menuProps.ref, scrollerRef]);
|
|
495
498
|
return /* @__PURE__ */ jsx("div", { ...menuProps, ref: menuRef, children: /* @__PURE__ */ jsxs("div", { className: styles$1["select-field-list"], children: [
|
|
@@ -517,6 +520,7 @@ const OptionsPanel = forwardRef(
|
|
|
517
520
|
appearance: "secondary",
|
|
518
521
|
size: "small",
|
|
519
522
|
onClick: onLoadMore,
|
|
523
|
+
...{ [ANV_PART_ATTR]: COMMON_PART.loadMoreButton },
|
|
520
524
|
children: "Load more"
|
|
521
525
|
}
|
|
522
526
|
) })
|
|
@@ -734,6 +738,7 @@ const VirtualizedOptionsPanel = forwardRef(
|
|
|
734
738
|
appearance: "secondary",
|
|
735
739
|
size: "small",
|
|
736
740
|
onClick: () => onLoadMoreRef.current(),
|
|
741
|
+
...{ [ANV_PART_ATTR]: COMMON_PART.loadMoreButton },
|
|
737
742
|
children: "Load more"
|
|
738
743
|
}
|
|
739
744
|
) }) });
|
|
@@ -742,7 +747,8 @@ const VirtualizedOptionsPanel = forwardRef(
|
|
|
742
747
|
};
|
|
743
748
|
const menuProps = getMenuProps({
|
|
744
749
|
className: cx(styles$1["scroller"], className),
|
|
745
|
-
style
|
|
750
|
+
style,
|
|
751
|
+
[ANV_PART_ATTR]: COMMON_PART.menu
|
|
746
752
|
});
|
|
747
753
|
const menuRef = useMergeRefs([menuProps.ref, scrollerRef]);
|
|
748
754
|
return /* @__PURE__ */ jsx("div", { ...menuProps, ref: menuRef, children: /* @__PURE__ */ jsxs("div", { className: styles$1["select-field-list"], children: [
|
|
@@ -1099,6 +1105,7 @@ const AddNewItemButton = ({
|
|
|
1099
1105
|
onAddNewItem(searchText);
|
|
1100
1106
|
},
|
|
1101
1107
|
style: { width: "100%" },
|
|
1108
|
+
...{ [ANV_PART_ATTR]: COMMON_PART.addNewItemButton },
|
|
1102
1109
|
children: resolvedLabel
|
|
1103
1110
|
}
|
|
1104
1111
|
);
|
|
@@ -1220,4 +1227,4 @@ const sortByGroup = (options, groupSorter) => {
|
|
|
1220
1227
|
};
|
|
1221
1228
|
|
|
1222
1229
|
export { AddNewItemButton as A, OptionsPanel as O, VirtualizedOptionsPanel as V, useProcessedOptions as a, buildSelectItems as b, sortByGroup as c, defaultSyncFilter as d, toSelectItem as e, shouldShowAddNewItem as s, toSyncFilterFn as t, useSelectOrchestration as u };
|
|
1223
|
-
//# sourceMappingURL=syncFilterUtils-
|
|
1230
|
+
//# sourceMappingURL=syncFilterUtils-YB6gRuuR.js.map
|