@servicetitan/anvil2 3.0.7 → 3.0.8
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 +22 -0
- package/dist/{AiMark-BXL0sWIV.js → AiMark-CS6MvraM.js} +5 -4
- package/dist/{AiMark-BXL0sWIV.js.map → AiMark-CS6MvraM.js.map} +1 -1
- package/dist/AiMark.js +1 -1
- package/dist/{Alert-BNH0UD2s.js → Alert-CNDLoh6b.js} +2 -2
- package/dist/{Alert-BNH0UD2s.js.map → Alert-CNDLoh6b.js.map} +1 -1
- package/dist/Alert.js +1 -1
- package/dist/{AnvilProvider-J9DjoJiB.js → AnvilProvider-BFK29dL5.js} +3 -2
- package/dist/{AnvilProvider-J9DjoJiB.js.map → AnvilProvider-BFK29dL5.js.map} +1 -1
- package/dist/AnvilProvider.js +1 -1
- package/dist/{Avatar-FDHyqiCy.js → Avatar-Bl-Dxbhf.js} +7 -2
- package/dist/Avatar-Bl-Dxbhf.js.map +1 -0
- package/dist/{Avatar-B_cRQqKR.js → Avatar-CdAIJ5VK.js} +2 -2
- package/dist/{Avatar-B_cRQqKR.js.map → Avatar-CdAIJ5VK.js.map} +1 -1
- package/dist/Avatar.js +2 -2
- package/dist/{Breadcrumbs-Bzxbdu-S.js → Breadcrumbs--Xt6l_2L.js} +2 -2
- package/dist/{Breadcrumbs-Bzxbdu-S.js.map → Breadcrumbs--Xt6l_2L.js.map} +1 -1
- package/dist/Breadcrumbs.js +1 -1
- package/dist/{Calendar-DS5eWpGF.js → Calendar-5mAxtdNh.js} +2 -2
- package/dist/{Calendar-DS5eWpGF.js.map → Calendar-5mAxtdNh.js.map} +1 -1
- package/dist/{Calendar-BYNFAWpZ.js → Calendar-rITorBvD.js} +5 -3
- package/dist/{Calendar-BYNFAWpZ.js.map → Calendar-rITorBvD.js.map} +1 -1
- package/dist/Calendar.js +2 -2
- package/dist/{Checkbox-BeIzx_ZX.js → Checkbox-BYWhkYoK.js} +2 -2
- package/dist/{Checkbox-BeIzx_ZX.js.map → Checkbox-BYWhkYoK.js.map} +1 -1
- package/dist/{Checkbox-BB3BDJsK.js → Checkbox-DTzoDcJl.js} +3 -3
- package/dist/{Checkbox-BB3BDJsK.js.map → Checkbox-DTzoDcJl.js.map} +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/{Chip-D2k5X_wX.js → Chip-CyMNyEPR.js} +3 -3
- package/dist/{Chip-D2k5X_wX.js.map → Chip-CyMNyEPR.js.map} +1 -1
- package/dist/Chip.js +1 -1
- package/dist/Combobox.js +1 -1
- package/dist/{DataTable-E8z0H8c7.js → DataTable-Dwhwvm6R.js} +70 -70
- package/dist/DataTable-Dwhwvm6R.js.map +1 -0
- package/dist/{DateFieldRange-BN_uIvHI.js → DateFieldRange-BUug1tUy.js} +4 -4
- package/dist/{DateFieldRange-BN_uIvHI.js.map → DateFieldRange-BUug1tUy.js.map} +1 -1
- package/dist/DateFieldRange.js +1 -1
- package/dist/{DateFieldSingle-h3YkdwPo.js → DateFieldSingle-DR7faQGD.js} +4 -4
- package/dist/{DateFieldSingle-h3YkdwPo.js.map → DateFieldSingle-DR7faQGD.js.map} +1 -1
- package/dist/DateFieldSingle.js +1 -1
- package/dist/{DateFieldYearless-m_Hl2gMY.js → DateFieldYearless-7MFcR7L6.js} +4 -4
- package/dist/{DateFieldYearless-m_Hl2gMY.js.map → DateFieldYearless-7MFcR7L6.js.map} +1 -1
- package/dist/DateFieldYearless.js +1 -1
- package/dist/{DateFieldYearlessRange-DNqSTBDr.js → DateFieldYearlessRange-DGtdyISH.js} +3 -3
- package/dist/{DateFieldYearlessRange-DNqSTBDr.js.map → DateFieldYearlessRange-DGtdyISH.js.map} +1 -1
- package/dist/DateFieldYearlessRange.js +1 -1
- package/dist/{DaysOfTheWeek-D58z_eF3.js → DaysOfTheWeek-C7oN9nIe.js} +3 -3
- package/dist/{DaysOfTheWeek-D58z_eF3.js.map → DaysOfTheWeek-C7oN9nIe.js.map} +1 -1
- package/dist/DaysOfTheWeek.js +1 -1
- package/dist/{Dialog-CvYSMvfD.js → Dialog-dE9c90iR.js} +3 -3
- package/dist/{Dialog-CvYSMvfD.js.map → Dialog-dE9c90iR.js.map} +1 -1
- package/dist/Dialog.js +1 -1
- package/dist/{Drawer-s2y0xcgV.js → Drawer-Dk0MsaOU.js} +3 -3
- package/dist/{Drawer-s2y0xcgV.js.map → Drawer-Dk0MsaOU.js.map} +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/DrillDown.js +1 -1
- package/dist/{EditCard-B25pj0Jx.js → EditCard-DV2N7zWr.js} +2 -2
- package/dist/{EditCard-B25pj0Jx.js.map → EditCard-DV2N7zWr.js.map} +1 -1
- package/dist/EditCard.js +1 -1
- package/dist/{FieldLabel-D1qPAGtB.js → FieldLabel-VVn8GR64.js} +3 -3
- package/dist/{FieldLabel-D1qPAGtB.js.map → FieldLabel-VVn8GR64.js.map} +1 -1
- package/dist/FieldLabel.js +1 -1
- package/dist/{FilterBar-B4ZAs73g.js → FilterBar-CXGsoWw5.js} +6 -5
- package/dist/{FilterBar-B4ZAs73g.js.map → FilterBar-CXGsoWw5.js.map} +1 -1
- package/dist/FilterBar.js +1 -1
- package/dist/{InputMask-BDl09V4u.js → InputMask-VBHWGZGN.js} +3 -3
- package/dist/{InputMask-BDl09V4u.js.map → InputMask-VBHWGZGN.js.map} +1 -1
- package/dist/InputMask.js +1 -1
- package/dist/{ListView-DO5psxd4.js → ListView-BUrfz75g.js} +2 -2
- package/dist/{ListView-DO5psxd4.js.map → ListView-BUrfz75g.js.map} +1 -1
- package/dist/ListView.js +1 -1
- package/dist/{Listbox-CvQHBFWb.js → Listbox-CRY-0BkS.js} +2 -2
- package/dist/{Listbox-CvQHBFWb.js.map → Listbox-CRY-0BkS.js.map} +1 -1
- package/dist/Listbox.js +1 -1
- package/dist/{Menu-W0c-xKdX.js → Menu-DNJ0YqjA.js} +11 -7
- package/dist/Menu-DNJ0YqjA.js.map +1 -0
- package/dist/Menu.js +1 -1
- package/dist/MenuFooter-CrsZdXvN.js +115 -0
- package/dist/MenuFooter-CrsZdXvN.js.map +1 -0
- package/dist/MultiSelectField.js +1 -1
- package/dist/{MultiSelectFieldSync-CXX2F0ru.js → MultiSelectFieldSync-CIuy3aRD.js} +8 -53
- package/dist/MultiSelectFieldSync-CIuy3aRD.js.map +1 -0
- package/dist/MultiSelectMenu.js +1 -1
- package/dist/{MultiSelectMenuSync-EKtvlL62.js → MultiSelectMenuSync-Drz8SEk9.js} +9 -76
- package/dist/MultiSelectMenuSync-Drz8SEk9.js.map +1 -0
- package/dist/{NumberField-BymFZhIJ.js → NumberField-bgYX7JGs.js} +3 -3
- package/dist/{NumberField-BymFZhIJ.js.map → NumberField-bgYX7JGs.js.map} +1 -1
- package/dist/NumberField.js +1 -1
- package/dist/{Page-C2_Hm27h.js → Page-BSHydn4p.js} +9 -9
- package/dist/{Page-C2_Hm27h.js.map → Page-BSHydn4p.js.map} +1 -1
- package/dist/Page.js +1 -1
- package/dist/{Pagination-Bmd4JORe.js → Pagination-CAeyJ7Pl.js} +192 -26
- package/dist/Pagination-CAeyJ7Pl.js.map +1 -0
- package/dist/Pagination.css +4 -2
- package/dist/Pagination.js +1 -1
- package/dist/{Popover-8mTJoMy7.js → Popover-Cq5tirFz.js} +11 -5
- package/dist/Popover-Cq5tirFz.js.map +1 -0
- package/dist/Popover.js +1 -1
- package/dist/{ProgressBar-C1CkQHV5.js → ProgressBar-ByR50ln7.js} +2 -2
- package/dist/{ProgressBar-C1CkQHV5.js.map → ProgressBar-ByR50ln7.js.map} +1 -1
- package/dist/ProgressBar.js +1 -1
- package/dist/{Radio-BcHMk8dD.js → Radio-CPuctRpl.js} +2 -2
- package/dist/{Radio-BcHMk8dD.js.map → Radio-CPuctRpl.js.map} +1 -1
- package/dist/{Radio-D5WyQN2i.js → Radio-WlsZFRzX.js} +3 -3
- package/dist/{Radio-D5WyQN2i.js.map → Radio-WlsZFRzX.js.map} +1 -1
- package/dist/Radio.js +1 -1
- package/dist/{RichTextEditor-DstVbYch.js → RichTextEditor-CoPXdaWI.js} +78 -42
- package/dist/RichTextEditor-CoPXdaWI.js.map +1 -0
- package/dist/RichTextEditor.js +1 -1
- package/dist/{SavedFiltersButton-2qba2Cgu.js → SavedFiltersButton-DzJijqHz.js} +11 -10
- package/dist/SavedFiltersButton-DzJijqHz.js.map +1 -0
- package/dist/SavedFiltersButton.js +1 -1
- package/dist/{SelectCard-BN-LI14f.js → SelectCard-DLWLHi_i.js} +3 -3
- package/dist/{SelectCard-BN-LI14f.js.map → SelectCard-DLWLHi_i.js.map} +1 -1
- package/dist/SelectCard.js +1 -1
- package/dist/SelectField.js +1 -1
- package/dist/{SelectFieldLabel-UbQT7fDD.js → SelectFieldLabel-vemffdmu.js} +2 -2
- package/dist/{SelectFieldLabel-UbQT7fDD.js.map → SelectFieldLabel-vemffdmu.js.map} +1 -1
- package/dist/{SelectFieldSync-DykGkR_w.js → SelectFieldSync-DlGiJ-Iy.js} +5 -4
- package/dist/{SelectFieldSync-DykGkR_w.js.map → SelectFieldSync-DlGiJ-Iy.js.map} +1 -1
- package/dist/SelectMenu.js +1 -1
- package/dist/{SelectMenuSync-DTQ8Ofoz.js → SelectMenuSync-CAweNjRL.js} +6 -4
- package/dist/{SelectMenuSync-DTQ8Ofoz.js.map → SelectMenuSync-CAweNjRL.js.map} +1 -1
- package/dist/{SelectOptions-DVSOJwRy.js → SelectOptions-BGCap9fZ.js} +2 -2
- package/dist/{SelectOptions-DVSOJwRy.js.map → SelectOptions-BGCap9fZ.js.map} +1 -1
- package/dist/{SelectTrigger-CHk0KO-P.js → SelectTrigger-BbneVXMz.js} +3 -3
- package/dist/{SelectTrigger-CHk0KO-P.js.map → SelectTrigger-BbneVXMz.js.map} +1 -1
- package/dist/SelectTrigger.js +1 -1
- package/dist/{SelectTriggerBase-B2S5SOZr.js → SelectTriggerBase-BjIOERXr.js} +3 -3
- package/dist/{SelectTriggerBase-B2S5SOZr.js.map → SelectTriggerBase-BjIOERXr.js.map} +1 -1
- package/dist/{Switch-onmiKoRd.js → Switch-B6bKmpwN.js} +3 -3
- package/dist/{Switch-onmiKoRd.js.map → Switch-B6bKmpwN.js.map} +1 -1
- package/dist/Switch.js +1 -1
- package/dist/Table.js +1 -1
- package/dist/{Text-BTzgTpqu.js → Text-w2gWn4K6.js} +2 -2
- package/dist/{Text-BTzgTpqu.js.map → Text-w2gWn4K6.js.map} +1 -1
- package/dist/Text.js +1 -1
- package/dist/{TextField-WTYZJlX3.js → TextField-BQsCh5Nb.js} +2 -2
- package/dist/{TextField-WTYZJlX3.js.map → TextField-BQsCh5Nb.js.map} +1 -1
- package/dist/{TextField-rVfctM1E.js → TextField-DJ3gEIP6.js} +3 -3
- package/dist/{TextField-rVfctM1E.js.map → TextField-DJ3gEIP6.js.map} +1 -1
- package/dist/TextField.js +1 -1
- package/dist/{Textarea-PXjppEQ6.js → Textarea-BK4Vf84K.js} +3 -3
- package/dist/{Textarea-PXjppEQ6.js.map → Textarea-BK4Vf84K.js.map} +1 -1
- package/dist/Textarea.js +1 -1
- package/dist/{ThemeProvider-D4KdGCaP.js → ThemeProvider-BC6wbuLU.js} +4 -9
- package/dist/{ThemeProvider-D4KdGCaP.js.map → ThemeProvider-BC6wbuLU.js.map} +1 -1
- package/dist/ThemeProvider.js +1 -1
- package/dist/ThemeProvider.module-D9pNGYjP.js +8 -0
- package/dist/ThemeProvider.module-D9pNGYjP.js.map +1 -0
- package/dist/{TimeField-BJPXIv6W.js → TimeField-B4IW2B_o.js} +4 -4
- package/dist/{TimeField-BJPXIv6W.js.map → TimeField-B4IW2B_o.js.map} +1 -1
- package/dist/TimeField.js +1 -1
- package/dist/Toast.js +2 -2
- package/dist/{Toaster-CoChsMD0.js → Toaster-BGY2IzF5.js} +53 -48
- package/dist/Toaster-BGY2IzF5.js.map +1 -0
- package/dist/{Toaster-DXLc86VD.js → Toaster-DTF9qnTy.js} +2 -2
- package/dist/{Toaster-DXLc86VD.js.map → Toaster-DTF9qnTy.js.map} +1 -1
- package/dist/{Toolbar-Bt3kShho.js → Toolbar-DObrJ_S5.js} +5 -4
- package/dist/{Toolbar-Bt3kShho.js.map → Toolbar-DObrJ_S5.js.map} +1 -1
- package/dist/{Toolbar-DaUKbbsL.js → Toolbar-DRJGKk8D.js} +6 -5
- package/dist/{Toolbar-DaUKbbsL.js.map → Toolbar-DRJGKk8D.js.map} +1 -1
- package/dist/Toolbar.js +2 -2
- package/dist/{ToolbarButtonToggle-BPu81Wuv.js → ToolbarButtonToggle-BCKgA8FE.js} +2 -2
- package/dist/{ToolbarButtonToggle-BPu81Wuv.js.map → ToolbarButtonToggle-BCKgA8FE.js.map} +1 -1
- package/dist/{Tooltip-yr1D06BE.js → Tooltip-DqS6xDUf.js} +27 -25
- package/dist/Tooltip-DqS6xDUf.js.map +1 -0
- package/dist/Tooltip.js +1 -1
- package/dist/TreeSelectField.d.ts +1 -0
- package/dist/TreeSelectField.js +2 -0
- package/dist/TreeSelectField.js.map +1 -0
- package/dist/TreeSelectFieldSync-Do5ffU0b.js +609 -0
- package/dist/TreeSelectFieldSync-Do5ffU0b.js.map +1 -0
- package/dist/TreeSelectFieldSync.css +173 -0
- package/dist/TreeSelectMenu.d.ts +1 -0
- package/dist/TreeSelectMenu.js +2 -0
- package/dist/TreeSelectMenu.js.map +1 -0
- package/dist/TreeSelectMenuSync-s05Ly6lj.js +413 -0
- package/dist/TreeSelectMenuSync-s05Ly6lj.js.map +1 -0
- package/dist/{YearlessDateInputWithPicker-BIcVgz-J.js → YearlessDateInputWithPicker-BHfFjCqE.js} +2 -2
- package/dist/{YearlessDateInputWithPicker-BIcVgz-J.js.map → YearlessDateInputWithPicker-BHfFjCqE.js.map} +1 -1
- package/dist/beta.js +15 -13
- package/dist/beta.js.map +1 -1
- package/dist/confirmationTypes-CG7xl50f.js +75 -0
- package/dist/confirmationTypes-CG7xl50f.js.map +1 -0
- package/dist/{filter-state-Bx3aYS1r.js → filter-state-DyMDjdRS.js} +322 -82
- package/dist/filter-state-DyMDjdRS.js.map +1 -0
- package/dist/{floating-ui.react-dom-CHrYz13o.js → floating-ui.react-dom-BIKT960u.js} +2 -2
- package/dist/{floating-ui.react-dom-CHrYz13o.js.map → floating-ui.react-dom-BIKT960u.js.map} +1 -1
- package/dist/{index-DVYRUKtW.js → index-fSKD4ey4.js} +79 -109
- package/dist/{index-DVYRUKtW.js.map → index-fSKD4ey4.js.map} +1 -1
- package/dist/index.js +42 -42
- package/dist/keyboard_arrow_left-CiE1n99w.js +6 -0
- package/dist/keyboard_arrow_left-CiE1n99w.js.map +1 -0
- package/dist/keyboard_arrow_right-DMloHg_F.js +6 -0
- package/dist/keyboard_arrow_right-DMloHg_F.js.map +1 -0
- package/dist/portalScopeClassNames-jlZkdug_.js +7 -0
- package/dist/portalScopeClassNames-jlZkdug_.js.map +1 -0
- package/dist/src/beta/components/FilterBar/FilterTextInput.d.ts +29 -0
- package/dist/src/beta/components/FilterBar/index.d.ts +1 -1
- package/dist/src/beta/components/FilterBar/internal/adapters/asyncTree.d.ts +6 -0
- package/dist/src/beta/components/FilterBar/internal/adapters/textInput.d.ts +3 -0
- package/dist/src/beta/components/FilterBar/internal/adapters/tree.d.ts +6 -0
- package/dist/src/beta/components/FilterBar/internal/adapters/types.d.ts +4 -1
- package/dist/src/beta/components/FilterBar/internal/types.d.ts +69 -12
- package/dist/src/beta/components/FilterBar/internal/utils/test.d.ts +4 -1
- package/dist/src/beta/components/Table/DataTable/DataTable.d.ts +4 -6
- package/dist/src/beta/components/Table/DataTable/internal/DataTableBodyRow.d.ts +6 -1
- package/dist/src/beta/components/Table/DataTable/internal/context/focus/DTFocusContext.d.ts +1 -11
- package/dist/src/beta/components/Table/DataTable/internal/context/focus/useDTFocusDispatchContext.d.ts +0 -2
- package/dist/src/beta/components/Table/DataTable/internal/useColumnOrder.d.ts +1 -0
- package/dist/src/beta/components/TreeSelectField/TreeSelectField.d.ts +68 -0
- package/dist/src/beta/components/TreeSelectField/TreeSelectFieldSync.d.ts +64 -0
- package/dist/src/beta/components/TreeSelectField/index.d.ts +3 -0
- package/dist/src/beta/components/TreeSelectField/internal/TreeContent.d.ts +31 -0
- package/dist/src/beta/components/TreeSelectField/internal/TreePanel.d.ts +56 -0
- package/dist/src/beta/components/TreeSelectField/internal/TreeRow.d.ts +56 -0
- package/dist/src/beta/components/TreeSelectField/internal/TreeSelectFieldInput.d.ts +82 -0
- package/dist/src/beta/components/TreeSelectField/internal/VirtualizedTreePanel.d.ts +57 -0
- package/dist/src/beta/components/TreeSelectField/internal/treeSync.d.ts +33 -0
- package/dist/src/beta/components/TreeSelectField/internal/treeUtils.d.ts +25 -0
- package/dist/src/beta/components/TreeSelectField/internal/types.d.ts +12 -0
- package/dist/src/beta/components/TreeSelectField/internal/useTree.d.ts +99 -0
- package/dist/src/beta/components/TreeSelectField/internal/useTreeCascade.d.ts +93 -0
- package/dist/src/beta/components/TreeSelectField/internal/useTreeKeyboard.d.ts +42 -0
- package/dist/src/beta/components/TreeSelectField/internal/useTreeLazyCascade.d.ts +56 -0
- package/dist/src/beta/components/TreeSelectField/internal/useTreeLoader.d.ts +58 -0
- package/dist/src/beta/components/TreeSelectField/stories/TreeSelectField.stories.data.d.ts +21 -0
- package/dist/src/beta/components/TreeSelectField/types.d.ts +124 -0
- package/dist/src/beta/components/TreeSelectMenu/TreeSelectMenu.d.ts +29 -0
- package/dist/src/beta/components/TreeSelectMenu/TreeSelectMenuSync.d.ts +65 -0
- package/dist/src/beta/components/TreeSelectMenu/index.d.ts +4 -0
- package/dist/src/beta/components/TreeSelectMenu/types.d.ts +103 -0
- package/dist/src/beta/components/index.d.ts +2 -0
- package/dist/src/components/Pagination/internal/Pagination.d.ts +1 -0
- package/dist/src/components/Pagination/internal/PaginationOverflowMenu.d.ts +12 -1
- package/dist/src/internal/functions/portalScopeClassNames.d.ts +14 -0
- package/dist/src/internal/utils/arrayIdsEqual.d.ts +10 -0
- package/dist/src/internal/utils/index.d.ts +1 -0
- package/dist/{stripInlineMarkdown-C5DNxxwf.js → stripInlineMarkdown-C0bVmYgG.js} +2 -2
- package/dist/{stripInlineMarkdown-C5DNxxwf.js.map → stripInlineMarkdown-C0bVmYgG.js.map} +1 -1
- package/dist/{syncFilterUtils-BEKek64h.js → syncFilterUtils-DZqeVWTS.js} +34 -409
- package/dist/syncFilterUtils-DZqeVWTS.js.map +1 -0
- package/dist/syncFilterUtils.css +0 -180
- package/dist/treeSync-Cz3H08cr.js +1453 -0
- package/dist/treeSync-Cz3H08cr.js.map +1 -0
- package/dist/treeSync.css +40 -0
- package/dist/useAdaptiveView-CeYKH0Me.js +386 -0
- package/dist/useAdaptiveView-CeYKH0Me.js.map +1 -0
- package/dist/useAdaptiveView.css +181 -0
- package/dist/useChipLayout-BWZfKDgd.js +51 -0
- package/dist/useChipLayout-BWZfKDgd.js.map +1 -0
- package/dist/{useDrilldown-KZ9rRsXQ.js → useDrilldown-BJ2dHHKV.js} +2 -2
- package/dist/{useDrilldown-KZ9rRsXQ.js.map → useDrilldown-BJ2dHHKV.js.map} +1 -1
- package/dist/{useInfiniteCombobox-CknXmqlQ.js → useInfiniteCombobox-C6TDFfds.js} +23 -23
- package/dist/useInfiniteCombobox-C6TDFfds.js.map +1 -0
- package/dist/{useMenuInteraction-CpAOHSJu.js → useMenuInteraction-NEJXUD4I.js} +2 -114
- package/dist/useMenuInteraction-NEJXUD4I.js.map +1 -0
- package/dist/{useToggleSelection-B-Z80gy2.js → useToggleSelection-Bn7h-gGD.js} +2 -2
- package/dist/{useToggleSelection-B-Z80gy2.js.map → useToggleSelection-Bn7h-gGD.js.map} +1 -1
- package/package.json +5 -7
- package/dist/Avatar-FDHyqiCy.js.map +0 -1
- package/dist/DataTable-E8z0H8c7.js.map +0 -1
- package/dist/Menu-W0c-xKdX.js.map +0 -1
- package/dist/MultiSelectFieldSync-CXX2F0ru.js.map +0 -1
- package/dist/MultiSelectMenuSync-EKtvlL62.js.map +0 -1
- package/dist/Pagination-Bmd4JORe.js.map +0 -1
- package/dist/Popover-8mTJoMy7.js.map +0 -1
- package/dist/RichTextEditor-DstVbYch.js.map +0 -1
- package/dist/SavedFiltersButton-2qba2Cgu.js.map +0 -1
- package/dist/Toaster-CoChsMD0.js.map +0 -1
- package/dist/Tooltip-yr1D06BE.js.map +0 -1
- package/dist/filter-state-Bx3aYS1r.js.map +0 -1
- package/dist/keyboard_arrow_right-DZWNVytH.js +0 -8
- package/dist/keyboard_arrow_right-DZWNVytH.js.map +0 -1
- package/dist/syncFilterUtils-BEKek64h.js.map +0 -1
- package/dist/useInfiniteCombobox-CknXmqlQ.js.map +0 -1
- package/dist/useMenuInteraction-CpAOHSJu.js.map +0 -1
- /package/dist/{useMenuInteraction.css → MenuFooter.css} +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TreePanelProps } from './TreePanel';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the TreeContent component.
|
|
4
|
+
*
|
|
5
|
+
* @property loading - Whether the tree is currently loading data; renders a spinner while true.
|
|
6
|
+
* @property hasNoVisibleNodes - True when there are no nodes to render (e.g. a search returned no matches); renders an empty-state message.
|
|
7
|
+
* @property virtualize - When true, renders the virtualized panel; otherwise renders the standard panel.
|
|
8
|
+
* @property panelProps - Props forwarded to the underlying TreePanel or VirtualizedTreePanel.
|
|
9
|
+
*/
|
|
10
|
+
export type TreeContentProps = {
|
|
11
|
+
loading: boolean;
|
|
12
|
+
hasNoVisibleNodes: boolean;
|
|
13
|
+
virtualize?: boolean;
|
|
14
|
+
panelProps: TreePanelProps;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Renders the body of a tree select popover or dialog: a centered spinner
|
|
18
|
+
* while loading, a "No match found" message when there are no visible
|
|
19
|
+
* nodes, or the (optionally virtualized) tree panel.
|
|
20
|
+
*
|
|
21
|
+
* Used by both TreeSelectField and TreeSelectMenu to keep the three
|
|
22
|
+
* states consistent across the field's dialog and popover branches and
|
|
23
|
+
* the menu's render path.
|
|
24
|
+
*
|
|
25
|
+
* Features:
|
|
26
|
+
* - Centered medium Spinner while loading
|
|
27
|
+
* - "No match found" empty state (small, subdued text)
|
|
28
|
+
* - Switches between TreePanel and VirtualizedTreePanel via the `virtualize` flag
|
|
29
|
+
* - Forwards a ref to the underlying tree panel for focus management
|
|
30
|
+
*/
|
|
31
|
+
export declare const TreeContent: import('react').ForwardRefExoticComponent<TreeContentProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { TreeSelectFieldNode } from '../types';
|
|
2
|
+
import { VisibleNode } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the TreePanel component.
|
|
5
|
+
* @property {VisibleNode[]} visibleNodes - Flat list of nodes currently visible in the tree.
|
|
6
|
+
* @property {(id: string | number) => "checked" | "unchecked" | "indeterminate" | "loading"} getCheckState - Returns the check state for a given node id.
|
|
7
|
+
* @property {(id: string | number) => void} toggleNode - Toggles the selection state of a node.
|
|
8
|
+
* @property {(id: string | number) => void} toggleExpand - Toggles the expanded state of a branch node.
|
|
9
|
+
* @property {(id: string | number) => Record<string, unknown>} getTreeItemProps - Returns ARIA/accessibility props for a tree item.
|
|
10
|
+
* @property {Record<string, unknown>} treeProps - Props to spread onto the tree container element.
|
|
11
|
+
* @property {string | undefined} activeDescendantId - The id of the currently active/focused tree item.
|
|
12
|
+
* @property {boolean} [branchesSelectable] - When true, branch nodes can be selected.
|
|
13
|
+
* @property {boolean} [leavesSelectable] - When true, leaf nodes can be selected.
|
|
14
|
+
* @property {boolean} [emptyBranchesSelectable] - When true, empty branches can be selected.
|
|
15
|
+
* @property {(node: TreeSelectFieldNode) => void} [onLoadChildren] - Callback to trigger lazy loading of children.
|
|
16
|
+
*/
|
|
17
|
+
export type TreePanelProps = {
|
|
18
|
+
visibleNodes: VisibleNode[];
|
|
19
|
+
getCheckState: (id: string | number) => "checked" | "unchecked" | "indeterminate" | "loading";
|
|
20
|
+
toggleNode: (id: string | number) => void;
|
|
21
|
+
toggleExpand: (id: string | number) => void;
|
|
22
|
+
getTreeItemProps: (id: string | number) => Record<string, unknown>;
|
|
23
|
+
treeProps: Record<string, unknown>;
|
|
24
|
+
activeDescendantId: string | undefined;
|
|
25
|
+
branchesSelectable?: boolean;
|
|
26
|
+
leavesSelectable?: boolean;
|
|
27
|
+
emptyBranchesSelectable?: boolean;
|
|
28
|
+
readOnly?: boolean;
|
|
29
|
+
onHover?: (id: string | number) => void;
|
|
30
|
+
onLoadChildren?: (node: TreeSelectFieldNode) => void;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* TreePanel component that renders the tree dropdown content.
|
|
34
|
+
*
|
|
35
|
+
* Features:
|
|
36
|
+
* - Renders a flat list of visible nodes with depth-based indentation
|
|
37
|
+
* - Supports expand/collapse controls for branch nodes
|
|
38
|
+
* - Shows loading indicator for lazily-loaded branches
|
|
39
|
+
* - Checkboxes for multi-select mode (hidden in single-select mode)
|
|
40
|
+
* - Optional breadcrumb display for flattened search results
|
|
41
|
+
* - Optional child count display for branch nodes
|
|
42
|
+
* - Full accessibility support with ARIA tree/treeitem roles
|
|
43
|
+
* - Focusable container via forwardRef
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* <TreePanel
|
|
47
|
+
* visibleNodes={visibleNodes}
|
|
48
|
+
* getCheckState={getCheckState}
|
|
49
|
+
* toggleNode={toggleNode}
|
|
50
|
+
* toggleExpand={toggleExpand}
|
|
51
|
+
* getTreeItemProps={getTreeItemProps}
|
|
52
|
+
* treeProps={treeProps}
|
|
53
|
+
* activeDescendantId={activeDescendantId}
|
|
54
|
+
* />
|
|
55
|
+
*/
|
|
56
|
+
export declare const TreePanel: import('react').ForwardRefExoticComponent<TreePanelProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { TreeSelectFieldNode } from '../types';
|
|
2
|
+
import { VisibleNode } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the TreeRow component.
|
|
5
|
+
* @property {VisibleNode} visible - The visible node data including depth, expand state, and branch info.
|
|
6
|
+
* @property {"checked" | "unchecked" | "indeterminate"} checkState - The checkbox state for this row.
|
|
7
|
+
* @property {Record<string, unknown>} itemProps - ARIA/accessibility props from getTreeItemProps.
|
|
8
|
+
* @property {boolean} [branchesSelectable] - When true, branch nodes can be selected. Defaults to true.
|
|
9
|
+
* @property {boolean} [leavesSelectable] - When true, leaf nodes can be selected. Defaults to true.
|
|
10
|
+
* @property {boolean} [emptyBranchesSelectable] - When true, empty branches (children: []) can be selected. Defaults to true.
|
|
11
|
+
* @property {boolean} [isActive] - When true, applies a highlight background for keyboard focus.
|
|
12
|
+
* @property {(id: string | number) => void} onToggleNode - Callback to toggle selection of the node.
|
|
13
|
+
* @property {(id: string | number) => void} onToggleExpand - Callback to toggle expansion of a branch node.
|
|
14
|
+
* @property {(node: TreeSelectFieldNode) => void} [onLoadChildren] - Callback to trigger lazy loading of children.
|
|
15
|
+
* @property {number} depth - Depth of the node in the tree, used to calculate indentation.
|
|
16
|
+
*/
|
|
17
|
+
export type TreeRowProps = {
|
|
18
|
+
visible: VisibleNode;
|
|
19
|
+
checkState: "checked" | "unchecked" | "indeterminate" | "loading";
|
|
20
|
+
itemProps: Record<string, unknown>;
|
|
21
|
+
branchesSelectable?: boolean;
|
|
22
|
+
leavesSelectable?: boolean;
|
|
23
|
+
emptyBranchesSelectable?: boolean;
|
|
24
|
+
readOnly?: boolean;
|
|
25
|
+
isActive?: boolean;
|
|
26
|
+
onToggleNode: (id: string | number) => void;
|
|
27
|
+
onToggleExpand: (id: string | number) => void;
|
|
28
|
+
onHover?: (id: string | number) => void;
|
|
29
|
+
onLoadChildren?: (node: TreeSelectFieldNode) => void;
|
|
30
|
+
depth: number;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* TreeRow renders a single row in the tree dropdown.
|
|
34
|
+
*
|
|
35
|
+
* Features:
|
|
36
|
+
* - Depth-based indentation via inline paddingInlineStart
|
|
37
|
+
* - Expand/collapse icon using Icon component with keyboard_arrow_right/down icons
|
|
38
|
+
* - Spinning icon animation for lazy-loading branch nodes
|
|
39
|
+
* - Checkbox in multi-select mode, hidden in single-select mode
|
|
40
|
+
* - Rich content support via node.content (title, description, chips, avatar, icon)
|
|
41
|
+
* - Label text with overflow ellipsis
|
|
42
|
+
* - Disabled state with reduced opacity and default cursor
|
|
43
|
+
* - Active (keyboard focus) state with highlight background
|
|
44
|
+
* - Full ARIA semantics via spread itemProps
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* <TreeRow
|
|
48
|
+
* visible={visibleNode}
|
|
49
|
+
* checkState={getCheckState(visibleNode.node.id)}
|
|
50
|
+
* itemProps={getTreeItemProps(visibleNode.node.id)}
|
|
51
|
+
* onToggleNode={toggleNode}
|
|
52
|
+
* onToggleExpand={toggleExpand}
|
|
53
|
+
* depth={visibleNode.depth}
|
|
54
|
+
* />
|
|
55
|
+
*/
|
|
56
|
+
export declare function TreeRow({ visible, checkState, itemProps, branchesSelectable, leavesSelectable, emptyBranchesSelectable, readOnly, isActive, onToggleNode, onToggleExpand, onHover, onLoadChildren, depth, }: TreeRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ReactElement, RefObject } from 'react';
|
|
2
|
+
import { TreeSelectFieldValue } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the TreeSelectFieldInput component.
|
|
5
|
+
* @property {string} [id] - HTML id attribute for the input element
|
|
6
|
+
* @property {string} [placeholder] - Placeholder text displayed when no options are selected
|
|
7
|
+
* @property {"small" | "medium" | "large"} [size] - Size variant of the input
|
|
8
|
+
* @property {boolean} [disabled] - Disables the input entirely
|
|
9
|
+
* @property {boolean} [readOnly] - Cannot be modified but remains interactive
|
|
10
|
+
* @property {boolean} [error] - Shows error styling on the input when true
|
|
11
|
+
* @property {boolean} [single] - When true, renders single-select text display instead of chips
|
|
12
|
+
* @property {boolean} [singleRow] - When true, restricts chip display to a single row
|
|
13
|
+
* @property {number} [maxChips] - Maximum number of chips to display before showing +N indicator
|
|
14
|
+
* @property {string | ReactElement} [prefix] - Content to display before the input area
|
|
15
|
+
* @property {string | ReactElement} [suffix] - Content to display after the input area
|
|
16
|
+
* @property {TreeSelectFieldValue[]} selectedOptions - Array of currently selected options
|
|
17
|
+
* @property {(option: TreeSelectFieldValue) => void} onRemoveOption - Callback fired when a chip is removed
|
|
18
|
+
* @property {RefObject<HTMLInputElement>} [inputRef] - Ref for the input element
|
|
19
|
+
* @property {RefObject<HTMLDivElement>} [inputWrapperRef] - Ref for the input wrapper div element
|
|
20
|
+
* @property {string} [searchValue] - Current search input value
|
|
21
|
+
* @property {(e: React.ChangeEvent<HTMLInputElement>) => void} [onSearchChange] - Callback fired when search input changes
|
|
22
|
+
* @property {(e: React.KeyboardEvent) => void} [onInputKeyDown] - Callback fired on key down in the search input
|
|
23
|
+
* @property {() => void} [onWrapperClick] - Callback fired when the input wrapper is clicked
|
|
24
|
+
* @property {boolean} [isOpen] - Whether the dropdown is currently open
|
|
25
|
+
* @property {boolean} [disableSearch] - When true, hides the search input
|
|
26
|
+
* @property {Record<string, unknown>} [comboboxProps] - Additional ARIA props for the combobox input role
|
|
27
|
+
*/
|
|
28
|
+
export type TreeSelectFieldInputProps = {
|
|
29
|
+
id?: string;
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
size?: "small" | "medium" | "large";
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
readOnly?: boolean;
|
|
34
|
+
error?: boolean;
|
|
35
|
+
single?: boolean;
|
|
36
|
+
singleRow?: boolean;
|
|
37
|
+
maxChips?: number;
|
|
38
|
+
prefix?: string | ReactElement;
|
|
39
|
+
suffix?: string | ReactElement;
|
|
40
|
+
selectedOptions: TreeSelectFieldValue[];
|
|
41
|
+
onRemoveOption: (option: TreeSelectFieldValue) => void;
|
|
42
|
+
inputRef?: RefObject<HTMLInputElement>;
|
|
43
|
+
inputWrapperRef?: RefObject<HTMLDivElement>;
|
|
44
|
+
searchValue?: string;
|
|
45
|
+
onSearchChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
46
|
+
onInputKeyDown?: (e: React.KeyboardEvent) => void;
|
|
47
|
+
onWrapperClick?: () => void;
|
|
48
|
+
isOpen?: boolean;
|
|
49
|
+
ariaControls?: string;
|
|
50
|
+
disableSearch?: boolean;
|
|
51
|
+
comboboxProps?: Record<string, unknown>;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Internal input component for the TreeSelectField that renders the trigger area
|
|
55
|
+
* with chips, search input, single-select text, and the toggle button.
|
|
56
|
+
*
|
|
57
|
+
* Features:
|
|
58
|
+
* - Chip display for selected options in multi-select mode with remove functionality
|
|
59
|
+
* - Single-row chip overflow detection with +N hidden chip indicator
|
|
60
|
+
* - Text input for filtering tree options when search is enabled
|
|
61
|
+
* - Plain text display for single-select mode
|
|
62
|
+
* - Chevron toggle button to open/close the dropdown
|
|
63
|
+
* - Optional prefix and suffix content slots
|
|
64
|
+
* - Supports small, medium, and large size variants
|
|
65
|
+
* - Error state styling
|
|
66
|
+
* - Disabled and read-only state styling
|
|
67
|
+
* - Accessible combobox role with aria-expanded and aria-haspopup
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* <TreeSelectFieldInput
|
|
71
|
+
* placeholder="Select categories..."
|
|
72
|
+
* size="medium"
|
|
73
|
+
* selectedOptions={[{ id: 1, label: "Category A" }]}
|
|
74
|
+
* onRemoveOption={(option) => handleRemove(option)}
|
|
75
|
+
* isOpen={isOpen}
|
|
76
|
+
* onWrapperClick={() => setIsOpen(true)}
|
|
77
|
+
* />
|
|
78
|
+
*/
|
|
79
|
+
export declare const TreeSelectFieldInput: {
|
|
80
|
+
({ id, placeholder, size, disabled, readOnly, error, single, singleRow, maxChips, prefix, suffix, selectedOptions, onRemoveOption, inputRef, inputWrapperRef, searchValue, onSearchChange, onInputKeyDown, onWrapperClick, isOpen, ariaControls, disableSearch, comboboxProps, }: TreeSelectFieldInputProps): import("react/jsx-runtime").JSX.Element;
|
|
81
|
+
displayName: string;
|
|
82
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { TreeSelectFieldNode } from '../types';
|
|
2
|
+
import { VisibleNode } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the VirtualizedTreePanel component.
|
|
5
|
+
* @property visibleNodes - Flat list of currently visible tree nodes.
|
|
6
|
+
* @property getCheckState - Returns the visual check state for a node ID.
|
|
7
|
+
* @property toggleNode - Toggles selection for the given node ID.
|
|
8
|
+
* @property toggleExpand - Expands or collapses the given branch node ID.
|
|
9
|
+
* @property getTreeItemProps - Returns ARIA props for a given node ID.
|
|
10
|
+
* @property treeProps - ARIA props for the tree container element.
|
|
11
|
+
* @property activeDescendantId - The id attribute of the focused treeitem, for aria-activedescendant.
|
|
12
|
+
* @property branchesSelectable - When true, branch nodes can be selected.
|
|
13
|
+
* @property leavesSelectable - When true, leaf nodes can be selected.
|
|
14
|
+
* @property onLoadChildren - Callback to lazily load children for a node with children===null.
|
|
15
|
+
*/
|
|
16
|
+
export type VirtualizedTreePanelProps = {
|
|
17
|
+
visibleNodes: VisibleNode[];
|
|
18
|
+
getCheckState: (id: string | number) => "checked" | "unchecked" | "indeterminate" | "loading";
|
|
19
|
+
toggleNode: (id: string | number) => void;
|
|
20
|
+
toggleExpand: (id: string | number) => void;
|
|
21
|
+
getTreeItemProps: (id: string | number) => Record<string, unknown>;
|
|
22
|
+
treeProps: Record<string, unknown>;
|
|
23
|
+
activeDescendantId: string | undefined;
|
|
24
|
+
branchesSelectable?: boolean;
|
|
25
|
+
leavesSelectable?: boolean;
|
|
26
|
+
emptyBranchesSelectable?: boolean;
|
|
27
|
+
readOnly?: boolean;
|
|
28
|
+
onHover?: (id: string | number) => void;
|
|
29
|
+
onLoadChildren?: (node: TreeSelectFieldNode) => void;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* VirtualizedTreePanel renders a virtualized tree list using @tanstack/react-virtual,
|
|
33
|
+
* only mounting DOM nodes for visible rows. Intended for large tree datasets.
|
|
34
|
+
*
|
|
35
|
+
* Features:
|
|
36
|
+
* - Only renders visible rows via @tanstack/react-virtual for performance
|
|
37
|
+
* - Same visual output and interaction model as a non-virtualized tree panel
|
|
38
|
+
* - Supports multi-select checkboxes and single-select modes
|
|
39
|
+
* - Expand/collapse branch nodes with optional lazy loading
|
|
40
|
+
* - Keyboard navigation via onKeyDown handler
|
|
41
|
+
* - Full ARIA tree semantics (role, aria-level, aria-expanded, etc.)
|
|
42
|
+
* - Optional child count display on branch nodes
|
|
43
|
+
* - Breadcrumb display for flattened search results
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* <VirtualizedTreePanel
|
|
47
|
+
* visibleNodes={visibleNodes}
|
|
48
|
+
* getCheckState={getCheckState}
|
|
49
|
+
* toggleNode={toggleNode}
|
|
50
|
+
* toggleExpand={toggleExpand}
|
|
51
|
+
* getTreeItemProps={getTreeItemProps}
|
|
52
|
+
* treeProps={treeProps}
|
|
53
|
+
* onKeyDown={onKeyDown}
|
|
54
|
+
* activeDescendantId={activeDescendantId}
|
|
55
|
+
* />
|
|
56
|
+
*/
|
|
57
|
+
export declare const VirtualizedTreePanel: import('react').ForwardRefExoticComponent<VirtualizedTreePanelProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MatchSorterOptions } from 'match-sorter';
|
|
2
|
+
import { TreeSelectFieldNode } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Filter function for narrowing tree options against a search value.
|
|
5
|
+
* Receives the full options tree and returns the (possibly pruned) tree to display.
|
|
6
|
+
*/
|
|
7
|
+
export type TreeSyncFilterFn = (options: TreeSelectFieldNode[], searchValue: string) => TreeSelectFieldNode[];
|
|
8
|
+
/**
|
|
9
|
+
* Recursively populates `childCount` (number of immediate children) on every
|
|
10
|
+
* loaded branch that doesn't already declare one, returning a new tree.
|
|
11
|
+
*
|
|
12
|
+
* This is computed from the full static `options` *before* any search filter
|
|
13
|
+
* runs, so the count reflects the real child set rather than the filtered
|
|
14
|
+
* subset. `computeCheckStates` relies on `childCount` to detect that a branch
|
|
15
|
+
* is only partially represented (e.g. during search) and avoid showing a
|
|
16
|
+
* partially-selected branch as fully checked.
|
|
17
|
+
*
|
|
18
|
+
* @param nodes - The tree nodes to process.
|
|
19
|
+
* @returns A new array of nodes with childCount set on branch nodes.
|
|
20
|
+
*/
|
|
21
|
+
export declare function applyChildCounts(nodes: TreeSelectFieldNode[]): TreeSelectFieldNode[];
|
|
22
|
+
/**
|
|
23
|
+
* Default tree-aware filter. Matches on label and searchText, preserving
|
|
24
|
+
* ancestors of matched nodes.
|
|
25
|
+
*/
|
|
26
|
+
export declare function defaultTreeSyncFilter(nodes: TreeSelectFieldNode[], searchValue: string): TreeSelectFieldNode[];
|
|
27
|
+
/**
|
|
28
|
+
* Coerces a `TreeSyncFilterFn` or `MatchSorterOptions` into a
|
|
29
|
+
* `TreeSyncFilterFn`. When given options, the resulting filter flattens the
|
|
30
|
+
* tree, runs match-sorter, and prunes the original tree to keep ancestors of
|
|
31
|
+
* matched nodes.
|
|
32
|
+
*/
|
|
33
|
+
export declare function toTreeSyncFilterFn(filter: TreeSyncFilterFn | MatchSorterOptions<TreeSelectFieldNode>): TreeSyncFilterFn;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TreeSelectFieldNode } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Recursively finds the first node in the tree matching the given id.
|
|
4
|
+
*
|
|
5
|
+
* @param nodes - The tree nodes to search.
|
|
6
|
+
* @param id - The id of the node to find.
|
|
7
|
+
* @returns The matching node, or undefined if no node has the given id.
|
|
8
|
+
*/
|
|
9
|
+
export declare function findNode(nodes: TreeSelectFieldNode[], id: string | number): TreeSelectFieldNode | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Returns true when the given node or any of its descendants still need to
|
|
12
|
+
* be lazy-loaded (i.e. has `children: null`).
|
|
13
|
+
*
|
|
14
|
+
* @param node - The node to inspect.
|
|
15
|
+
* @returns Whether any descendant branch is still unloaded.
|
|
16
|
+
*/
|
|
17
|
+
export declare function hasUnloadedDescendants(node: TreeSelectFieldNode): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Returns all descendant branches of the given node whose children have not
|
|
20
|
+
* yet been loaded (i.e. `children: null`). The node itself is not included.
|
|
21
|
+
*
|
|
22
|
+
* @param node - The ancestor node to walk.
|
|
23
|
+
* @returns Every descendant branch that still requires lazy loading.
|
|
24
|
+
*/
|
|
25
|
+
export declare function findUnloadedDescendants(node: TreeSelectFieldNode): TreeSelectFieldNode[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TreeSelectFieldNode } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Internal representation of a visible node in the flattened tree.
|
|
4
|
+
*/
|
|
5
|
+
export type VisibleNode = {
|
|
6
|
+
node: TreeSelectFieldNode;
|
|
7
|
+
depth: number;
|
|
8
|
+
isExpanded: boolean;
|
|
9
|
+
isBranch: boolean;
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
isEmptyPlaceholder?: boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { KeyboardEvent } from 'react';
|
|
2
|
+
import { TreeSelectFieldNode, TreeSelectFieldValue, TreeSelectFieldValueConsistsOf } from '../types';
|
|
3
|
+
import { VisibleNode } from './types';
|
|
4
|
+
import { CheckState } from './useTreeCascade';
|
|
5
|
+
/**
|
|
6
|
+
* Options for the useTree hook.
|
|
7
|
+
* @property nodes - The full tree data.
|
|
8
|
+
* @property value - Controlled selected values.
|
|
9
|
+
* @property onSelectedOptionsChange - Callback when selection changes.
|
|
10
|
+
* @property selectionMode - "single", "independent", or "linked" (default).
|
|
11
|
+
* @property valueConsistsOf - Controls which nodes are selectable and how the value is shaped.
|
|
12
|
+
* @property defaultExpandLevel - Initial expand depth. 0 = collapsed, Infinity = all.
|
|
13
|
+
* @property expandedIds - Controlled set of expanded node IDs.
|
|
14
|
+
* @property onExpandedIdsChange - Callback when expanded IDs change (controlled mode).
|
|
15
|
+
* @property searchValue - Filter string applied to the tree.
|
|
16
|
+
* @property ancestry - childId → parentId map from the loader, used to attribute
|
|
17
|
+
* off-screen ("orphan") selections to their ancestor branches.
|
|
18
|
+
* @property loadingChildrenIds - Set of node IDs whose children are currently being fetched.
|
|
19
|
+
*/
|
|
20
|
+
export type UseTreeOptions = {
|
|
21
|
+
nodes: TreeSelectFieldNode[];
|
|
22
|
+
value: TreeSelectFieldValue[];
|
|
23
|
+
onSelectedOptionsChange: (nodes: TreeSelectFieldValue[]) => void;
|
|
24
|
+
selectionMode?: "single" | "independent" | "linked";
|
|
25
|
+
valueConsistsOf?: TreeSelectFieldValueConsistsOf;
|
|
26
|
+
defaultExpandLevel?: number;
|
|
27
|
+
expandedIds?: Set<string | number>;
|
|
28
|
+
onExpandedIdsChange?: (ids: Set<string | number>) => void;
|
|
29
|
+
searchValue?: string;
|
|
30
|
+
ancestry?: Map<string | number, string | number>;
|
|
31
|
+
loadingChildrenIds?: Set<string | number>;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* ARIA props returned per tree item.
|
|
35
|
+
*/
|
|
36
|
+
export type TreeItemProps = {
|
|
37
|
+
id: string;
|
|
38
|
+
role: "treeitem";
|
|
39
|
+
"aria-level": number;
|
|
40
|
+
"aria-setsize": number;
|
|
41
|
+
"aria-posinset": number;
|
|
42
|
+
"aria-expanded"?: boolean;
|
|
43
|
+
"aria-selected": boolean;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* ARIA props for the tree container.
|
|
47
|
+
*/
|
|
48
|
+
export type TreeContainerProps = {
|
|
49
|
+
role: "tree";
|
|
50
|
+
"aria-activedescendant": string | undefined;
|
|
51
|
+
"aria-multiselectable": boolean;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Return value from the useTree hook.
|
|
55
|
+
* @property visibleNodes - Flat list of currently visible nodes.
|
|
56
|
+
* @property getCheckState - Returns the visual check state for a node ID.
|
|
57
|
+
* @property toggleNode - Toggles selection for the given node ID.
|
|
58
|
+
* @property isExpanded - Returns whether the given node ID is expanded.
|
|
59
|
+
* @property toggleExpand - Expands or collapses the given branch node ID.
|
|
60
|
+
* @property expandAll - Expands all branch nodes.
|
|
61
|
+
* @property collapseAll - Collapses all branch nodes.
|
|
62
|
+
* @property activeDescendantId - The id attribute of the focused treeitem, for aria-activedescendant.
|
|
63
|
+
* @property onKeyDown - Keyboard event handler for the tree container.
|
|
64
|
+
* @property getTreeItemProps - Returns ARIA props for a given node ID.
|
|
65
|
+
* @property treeProps - ARIA props for the tree container element.
|
|
66
|
+
*/
|
|
67
|
+
export type UseTreeReturn = {
|
|
68
|
+
nodes: TreeSelectFieldNode[];
|
|
69
|
+
visibleNodes: VisibleNode[];
|
|
70
|
+
getCheckState: (id: string | number) => CheckState;
|
|
71
|
+
toggleNode: (id: string | number) => void;
|
|
72
|
+
isExpanded: (id: string | number) => boolean;
|
|
73
|
+
toggleExpand: (id: string | number) => void;
|
|
74
|
+
expandAll: () => void;
|
|
75
|
+
collapseAll: () => void;
|
|
76
|
+
activeDescendantId: string | undefined;
|
|
77
|
+
setActiveNodeId: (id: string | number) => void;
|
|
78
|
+
onKeyDown: (e: KeyboardEvent) => void;
|
|
79
|
+
getTreeItemProps: (id: string | number) => TreeItemProps;
|
|
80
|
+
treeProps: TreeContainerProps;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Core tree state hook that manages expansion, selection, keyboard navigation,
|
|
84
|
+
* search filtering, and ARIA attributes for a tree widget.
|
|
85
|
+
*
|
|
86
|
+
* Features:
|
|
87
|
+
* - Uncontrolled expansion state by default; fully controlled via expandedIds/onExpandedIdsChange
|
|
88
|
+
* - defaultExpandLevel for initial expansion depth
|
|
89
|
+
* - expandAll / collapseAll helpers
|
|
90
|
+
* - Delegates selection logic to computeCheckStates and toggleNodeSelection from useTreeCascade
|
|
91
|
+
* - valueConsistsOf determines which nodes are selectable
|
|
92
|
+
* - Search filtering that preserves tree structure
|
|
93
|
+
* - Full keyboard navigation (WAI-ARIA tree pattern)
|
|
94
|
+
* - ARIA attribute generation for tree container and tree items
|
|
95
|
+
*
|
|
96
|
+
* @param options - Configuration options for the tree state.
|
|
97
|
+
* @returns Tree state and handlers.
|
|
98
|
+
*/
|
|
99
|
+
export declare function useTree(options: UseTreeOptions): UseTreeReturn;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { TreeSelectFieldNode, TreeSelectFieldValue, TreeSelectFieldValueConsistsOf } from '../types';
|
|
2
|
+
import { CheckState } from '../../../../types';
|
|
3
|
+
export type { CheckState };
|
|
4
|
+
/**
|
|
5
|
+
* Computes the visual check state for every node in the tree.
|
|
6
|
+
*
|
|
7
|
+
* In "linked" mode parents reflect the aggregate state of their children:
|
|
8
|
+
* - checked — all non-disabled children are checked
|
|
9
|
+
* - indeterminate — some but not all non-disabled children are checked
|
|
10
|
+
* - unchecked — no children are checked
|
|
11
|
+
*
|
|
12
|
+
* In "independent" / "single" mode (and for BRANCH_ONLY) each node is checked
|
|
13
|
+
* only when its id appears in the value array; no cascade is applied. A node's
|
|
14
|
+
* own selection lives in `value` regardless of what is loaded, so these modes
|
|
15
|
+
* are unaffected by lazy/filtered loading.
|
|
16
|
+
*
|
|
17
|
+
* ## Under-represented branches (lazy / filtered)
|
|
18
|
+
*
|
|
19
|
+
* In linked mode a branch's aggregate state is derived from its children. But
|
|
20
|
+
* the tree passed in is only ever what is currently *loaded* — during search it
|
|
21
|
+
* is the filtered subset, and lazy branches (`children === null`) or partially
|
|
22
|
+
* loaded branches don't expose their full child set. A branch is
|
|
23
|
+
* "under-represented" when its loaded children are known to be fewer than its
|
|
24
|
+
* real children (`children === null`, or `loadedCount < childCount`). For these
|
|
25
|
+
* we infer rather than aggregate:
|
|
26
|
+
* - the branch's own id is checked → `checked`
|
|
27
|
+
* - any *loaded* descendant is checked/indeterminate → `indeterminate`
|
|
28
|
+
* (it can't be fully checked because unknown children exist)
|
|
29
|
+
* - otherwise, if the branch is a known ancestor of an "orphan" selection (a
|
|
30
|
+
* checked id that isn't in the currently-loaded tree — e.g. a descendant of a
|
|
31
|
+
* collapsed lazy branch), via `orphanAncestorIds` → `indeterminate`
|
|
32
|
+
* - otherwise → `unchecked`
|
|
33
|
+
*
|
|
34
|
+
* Orphan attribution is *path-scoped*: only branches on the resolved ancestor
|
|
35
|
+
* path of an orphaned selection are marked, so unrelated collapsed siblings stay
|
|
36
|
+
* `unchecked`. The caller resolves those ancestors (from a value's `path` or the
|
|
37
|
+
* loader's ancestry map) and passes them in `orphanAncestorIds`. An orphan whose
|
|
38
|
+
* ancestry is unknown contributes nothing (its branch shows `unchecked` until
|
|
39
|
+
* its parent loads, then self-corrects).
|
|
40
|
+
*
|
|
41
|
+
* One limitation remains: accurate filtered-branch state requires
|
|
42
|
+
* server-/consumer-provided `childCount` — a partially-loaded branch without a
|
|
43
|
+
* `childCount` falls back to aggregating only its visible children.
|
|
44
|
+
*
|
|
45
|
+
* @param nodes - The currently loaded (possibly filtered) tree.
|
|
46
|
+
* @param value - The current value array.
|
|
47
|
+
* @param selectionMode - "single", "independent", or "linked".
|
|
48
|
+
* @param valueConsistsOf - Strategy used when computing check states.
|
|
49
|
+
* @param orphanAncestorIds - Branch ids that lie on the resolved ancestor path
|
|
50
|
+
* of an orphaned selection. Such under-represented branches render
|
|
51
|
+
* `indeterminate`. Defaults to empty (no orphan inference).
|
|
52
|
+
* @returns A Map from node id to CheckState.
|
|
53
|
+
*/
|
|
54
|
+
export declare function computeCheckStates(nodes: TreeSelectFieldNode[], value: TreeSelectFieldValue[], selectionMode: "single" | "independent" | "linked", valueConsistsOf: TreeSelectFieldValueConsistsOf, orphanAncestorIds?: Set<string | number>): Map<string | number, CheckState>;
|
|
55
|
+
/**
|
|
56
|
+
* Given a set of checked node IDs and a value strategy, returns the value
|
|
57
|
+
* array according to the strategy.
|
|
58
|
+
*
|
|
59
|
+
* - "ALL" — every checked node
|
|
60
|
+
* - "BRANCH_PRIORITY" — branch replaces its leaves when all non-disabled
|
|
61
|
+
* children are checked; otherwise individual leaves
|
|
62
|
+
* - "LEAF_PRIORITY" — leaves only, unless the node is a branch with an empty
|
|
63
|
+
* or null children list (leaf-less branch)
|
|
64
|
+
* - "LEAF_ONLY" — strictly leaves; branches are never included
|
|
65
|
+
*
|
|
66
|
+
* @param nodes - The full tree.
|
|
67
|
+
* @param checkedIds - Set of IDs that are checked.
|
|
68
|
+
* @param valueConsistsOf - Strategy to apply.
|
|
69
|
+
* @returns The value array.
|
|
70
|
+
*/
|
|
71
|
+
export declare function computeValue(nodes: TreeSelectFieldNode[], checkedIds: Set<string | number>, valueConsistsOf: TreeSelectFieldValueConsistsOf): TreeSelectFieldValue[];
|
|
72
|
+
/**
|
|
73
|
+
* Toggles a node's selection and returns the new value array.
|
|
74
|
+
*
|
|
75
|
+
* In "single" mode:
|
|
76
|
+
* - Replaces the entire selection with the clicked node (or empties if already selected).
|
|
77
|
+
*
|
|
78
|
+
* In "independent" mode:
|
|
79
|
+
* - Only the clicked node is toggled; no cascade.
|
|
80
|
+
*
|
|
81
|
+
* In "linked" mode:
|
|
82
|
+
* - Selecting a branch selects all non-disabled descendants recursively.
|
|
83
|
+
* - Deselecting a branch deselects all non-disabled descendants recursively.
|
|
84
|
+
* - Disabled nodes are never modified.
|
|
85
|
+
*
|
|
86
|
+
* @param nodes - The full tree.
|
|
87
|
+
* @param currentValue - The current value array.
|
|
88
|
+
* @param nodeId - The id of the node to toggle.
|
|
89
|
+
* @param selectionMode - "single", "independent", or "linked".
|
|
90
|
+
* @param valueConsistsOf - Strategy to apply when computing the returned value.
|
|
91
|
+
* @returns The new value array.
|
|
92
|
+
*/
|
|
93
|
+
export declare function toggleNodeSelection(nodes: TreeSelectFieldNode[], currentValue: TreeSelectFieldValue[], nodeId: string | number, selectionMode: "single" | "independent" | "linked", valueConsistsOf: TreeSelectFieldValueConsistsOf): TreeSelectFieldValue[];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { KeyboardEvent } from 'react';
|
|
2
|
+
import { VisibleNode } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Options for the keyboard event handler.
|
|
5
|
+
* @property visibleNodes - The current flat list of visible nodes.
|
|
6
|
+
* @property activeIndex - Index into visibleNodes of the currently focused node, or -1.
|
|
7
|
+
* @property setActiveIndex - Setter for the active index.
|
|
8
|
+
* @property isExpanded - Returns whether a node is expanded.
|
|
9
|
+
* @property toggleExpand - Expands or collapses a branch node.
|
|
10
|
+
* @property toggleNode - Toggles selection for a node.
|
|
11
|
+
*/
|
|
12
|
+
export type UseTreeKeyboardOptions = {
|
|
13
|
+
visibleNodes: VisibleNode[];
|
|
14
|
+
activeIndex: number;
|
|
15
|
+
setActiveIndex: (index: number) => void;
|
|
16
|
+
isExpanded: (id: string | number) => boolean;
|
|
17
|
+
toggleExpand: (id: string | number) => void;
|
|
18
|
+
toggleNode: (id: string | number) => void;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Handles keyboard navigation for a tree widget rooted on a combobox input.
|
|
22
|
+
*
|
|
23
|
+
* Focus stays on the input at all times; the tree uses aria-activedescendant
|
|
24
|
+
* to convey the focused node. Returns `true` when the key was handled so the
|
|
25
|
+
* caller can decide whether to let the event propagate (e.g. ArrowLeft/Right
|
|
26
|
+
* falling through to cursor movement inside the input).
|
|
27
|
+
*
|
|
28
|
+
* - ArrowDown: move to next visible node
|
|
29
|
+
* - ArrowUp: move to previous visible node
|
|
30
|
+
* - ArrowRight: expand collapsed branch or move to first child; returns false
|
|
31
|
+
* when there is nothing to do so the cursor can move inside the input
|
|
32
|
+
* - ArrowLeft: collapse expanded branch or move to parent; returns false when
|
|
33
|
+
* there is nothing to do so the cursor can move inside the input
|
|
34
|
+
* - Home: move to first visible node
|
|
35
|
+
* - End: move to last visible node
|
|
36
|
+
* - Enter: toggle selection of focused node
|
|
37
|
+
*
|
|
38
|
+
* @param e - The keyboard event.
|
|
39
|
+
* @param options - The current tree state and callbacks.
|
|
40
|
+
* @returns Whether the key was handled by tree navigation.
|
|
41
|
+
*/
|
|
42
|
+
export declare function handleTreeKeyDown(e: KeyboardEvent, options: UseTreeKeyboardOptions): boolean;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { UseTreeReturn } from './useTree';
|
|
2
|
+
import { UseTreeLoaderReturn } from './useTreeLoader';
|
|
3
|
+
/**
|
|
4
|
+
* Options for {@link useTreeLazyCascade}.
|
|
5
|
+
*
|
|
6
|
+
* @property tree - Tree state from useTree, used to read nodes and run toggles.
|
|
7
|
+
* @property loader - Tree loader, used to lazy-load unloaded descendants.
|
|
8
|
+
* @property isSingleSelect - Whether the consumer is in single-select mode; controls auto-close after a successful toggle.
|
|
9
|
+
* @property branchesSelectable - Whether branch nodes can be selected (vs only expanded).
|
|
10
|
+
* @property leavesSelectable - Whether leaf nodes can be selected.
|
|
11
|
+
* @property emptyBranchesSelectable - Whether branches with an empty children array can be selected.
|
|
12
|
+
* @property readOnly - When true, all toggle attempts no-op.
|
|
13
|
+
* @property onCloseAfterSingleSelect - Called after a successful single-select toggle so the consumer can close its menu and restore focus.
|
|
14
|
+
*/
|
|
15
|
+
export type UseTreeLazyCascadeOptions = {
|
|
16
|
+
tree: UseTreeReturn;
|
|
17
|
+
loader: UseTreeLoaderReturn;
|
|
18
|
+
isSingleSelect: boolean;
|
|
19
|
+
branchesSelectable: boolean;
|
|
20
|
+
leavesSelectable: boolean;
|
|
21
|
+
emptyBranchesSelectable: boolean;
|
|
22
|
+
readOnly?: boolean;
|
|
23
|
+
onCloseAfterSingleSelect?: () => void;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Return value of {@link useTreeLazyCascade}.
|
|
27
|
+
*
|
|
28
|
+
* @property handleToggleNode - Click/Space handler for a tree row that respects selectability and loads any unloaded descendants before cascading.
|
|
29
|
+
* @property pendingToggleNodeId - The id of the node currently waiting on lazy loads to complete (used to render a loading checkbox), or null.
|
|
30
|
+
* @property reset - Clears any in-flight pending toggle. Call from the consumer's closeMenu so reopening starts clean.
|
|
31
|
+
*/
|
|
32
|
+
export type UseTreeLazyCascadeReturn = {
|
|
33
|
+
handleToggleNode: (nodeId: string | number) => void;
|
|
34
|
+
pendingToggleNodeId: string | number | null;
|
|
35
|
+
reset: () => void;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Coordinates "toggle a tree node, but lazy-load any unloaded descendants
|
|
39
|
+
* first" — the bit of orchestration that sits between useTree and
|
|
40
|
+
* useTreeLoader and is shared between TreeSelectField and TreeSelectMenu.
|
|
41
|
+
*
|
|
42
|
+
* When the consumer clicks a branch whose subtree isn't fully loaded, the
|
|
43
|
+
* hook records the pending toggle, kicks off loadChildren for every
|
|
44
|
+
* unloaded descendant, and then — once all loads are complete — fires
|
|
45
|
+
* tree.toggleNode so cascade selection can run against the now-complete
|
|
46
|
+
* subtree. While loads are in flight, pendingToggleNodeId points at the
|
|
47
|
+
* originally-clicked node so the consumer can render a loading state on
|
|
48
|
+
* its checkbox.
|
|
49
|
+
*
|
|
50
|
+
* Non-selectable branches expand instead of toggling; non-selectable
|
|
51
|
+
* leaves no-op. Read-only consumers can pass readOnly to short-circuit.
|
|
52
|
+
*
|
|
53
|
+
* @param options - See {@link UseTreeLazyCascadeOptions}.
|
|
54
|
+
* @returns Toggle handler, current pending node id, and a reset function.
|
|
55
|
+
*/
|
|
56
|
+
export declare function useTreeLazyCascade(options: UseTreeLazyCascadeOptions): UseTreeLazyCascadeReturn;
|