@servicetitan/anvil2 3.0.0 → 3.0.2
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 +45 -0
- package/README.md +8 -6
- package/dist/{AiMark-B1-M3ZgP.js → AiMark-DiMotaq3.js} +3 -3
- package/dist/{AiMark-B1-M3ZgP.js.map → AiMark-DiMotaq3.js.map} +1 -1
- package/dist/AiMark.css +3 -3
- package/dist/AiMark.js +1 -1
- package/dist/{Alert-DmbqtMg_.js → Alert-DhhVURcl.js} +2 -2
- package/dist/{Alert-DmbqtMg_.js.map → Alert-DhhVURcl.js.map} +1 -1
- package/dist/Alert.css +1 -1
- package/dist/Alert.js +1 -1
- package/dist/Announcement.css +1 -1
- package/dist/AnvilProvider.css +1 -2
- package/dist/{Avatar-NbFc4Ovc.js → Avatar-BmNcLUg-.js} +2 -2
- package/dist/{Avatar-NbFc4Ovc.js.map → Avatar-BmNcLUg-.js.map} +1 -1
- package/dist/{Avatar-B4hRHku9.js → Avatar-Cw8B8xZV.js} +2 -2
- package/dist/Avatar-Cw8B8xZV.js.map +1 -0
- package/dist/Avatar.css +2 -2
- package/dist/Avatar.js +2 -2
- package/dist/Badge.css +1 -1
- package/dist/{Breadcrumbs-CYmciJ1D.js → Breadcrumbs-vvKOtFwN.js} +2 -2
- package/dist/{Breadcrumbs-CYmciJ1D.js.map → Breadcrumbs-vvKOtFwN.js.map} +1 -1
- package/dist/Breadcrumbs.css +1 -1
- package/dist/Breadcrumbs.js +1 -1
- package/dist/Button.css +1 -1
- package/dist/ButtonCompound.css +1 -1
- package/dist/ButtonToggle.css +1 -1
- package/dist/{Calendar-BAbAagIx.js → Calendar-BLvBN8Ou.js} +2 -2
- package/dist/{Calendar-BAbAagIx.js.map → Calendar-BLvBN8Ou.js.map} +1 -1
- package/dist/{Calendar-CaCMa_jq.js → Calendar-Dtn07sfJ.js} +2 -2
- package/dist/{Calendar-CaCMa_jq.js.map → Calendar-Dtn07sfJ.js.map} +1 -1
- package/dist/Calendar.css +2 -2
- package/dist/Calendar.js +2 -2
- package/dist/Card.css +1 -1
- package/dist/{Checkbox-BSAS8-DM.js → Checkbox-BngBrjEV.js} +3 -3
- package/dist/{Checkbox-BSAS8-DM.js.map → Checkbox-BngBrjEV.js.map} +1 -1
- package/dist/{Checkbox-Ckl8EFpF.js → Checkbox-lSwl_u26.js} +2 -2
- package/dist/{Checkbox-Ckl8EFpF.js.map → Checkbox-lSwl_u26.js.map} +1 -1
- package/dist/Checkbox.css +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/{Chip-CR5i8mQW.js → Chip-DBn3KRak.js} +3 -3
- package/dist/{Chip-CR5i8mQW.js.map → Chip-DBn3KRak.js.map} +1 -1
- package/dist/Chip.css +1 -1
- package/dist/Chip.js +1 -1
- package/dist/{Combobox-BffGTugd.js → Combobox-BqhvHG9H.js} +5 -5
- package/dist/{Combobox-BffGTugd.js.map → Combobox-BqhvHG9H.js.map} +1 -1
- package/dist/Combobox.css +1 -1
- package/dist/Combobox.js +1 -1
- package/dist/{DataTable-D9Xj1nq5.js → DataTable-CB-exG-7.js} +1173 -142
- package/dist/DataTable-CB-exG-7.js.map +1 -0
- package/dist/DataTable.css +274 -118
- package/dist/{DateFieldRange-DPTC3EZz.js → DateFieldRange-Ci-OHK6g.js} +4 -4
- package/dist/{DateFieldRange-DPTC3EZz.js.map → DateFieldRange-Ci-OHK6g.js.map} +1 -1
- package/dist/DateFieldRange.js +1 -1
- package/dist/{DateFieldSingle-w1G-zd9G.js → DateFieldSingle-JOEy4kSL.js} +4 -4
- package/dist/{DateFieldSingle-w1G-zd9G.js.map → DateFieldSingle-JOEy4kSL.js.map} +1 -1
- package/dist/DateFieldSingle.js +1 -1
- package/dist/{DateFieldYearless-DHNVc7Sd.js → DateFieldYearless-CIqPup6O.js} +4 -4
- package/dist/{DateFieldYearless-DHNVc7Sd.js.map → DateFieldYearless-CIqPup6O.js.map} +1 -1
- package/dist/DateFieldYearless.js +1 -1
- package/dist/{DateFieldYearlessRange-C5ktVUgG.js → DateFieldYearlessRange-Cf11uZhk.js} +3 -3
- package/dist/{DateFieldYearlessRange-C5ktVUgG.js.map → DateFieldYearlessRange-Cf11uZhk.js.map} +1 -1
- package/dist/DateFieldYearlessRange.css +1 -1
- package/dist/DateFieldYearlessRange.js +1 -1
- package/dist/{DaysOfTheWeek-BubWkBZ0.js → DaysOfTheWeek-R2-y7cqh.js} +3 -3
- package/dist/{DaysOfTheWeek-BubWkBZ0.js.map → DaysOfTheWeek-R2-y7cqh.js.map} +1 -1
- package/dist/DaysOfTheWeek.css +1 -1
- package/dist/DaysOfTheWeek.js +1 -1
- package/dist/Details.css +1 -1
- package/dist/{Dialog-DGmF6qx3.js → Dialog-C3yST7Ly.js} +5 -5
- package/dist/Dialog-C3yST7Ly.js.map +1 -0
- package/dist/Dialog.css +1 -1
- package/dist/Dialog.js +1 -1
- package/dist/Divider.css +1 -1
- package/dist/Dnd.js +2 -1
- package/dist/Dnd.js.map +1 -1
- package/dist/DndHandleButton-Dgt9G-dF.js +43 -0
- package/dist/DndHandleButton-Dgt9G-dF.js.map +1 -0
- package/dist/DndHandleButton.css +22 -0
- package/dist/DndSort.css +1 -1
- package/dist/DndSort.js +2 -1
- package/dist/DndSort.js.map +1 -1
- package/dist/{Drawer-iewBy1DW.js → Drawer-CouIrQ8u.js} +6 -6
- package/dist/{Drawer-iewBy1DW.js.map → Drawer-CouIrQ8u.js.map} +1 -1
- package/dist/Drawer.css +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/DrillDown.css +1 -1
- package/dist/DrillDown.js +1 -1
- package/dist/{EditCard-D7-Ye7R0.js → EditCard-DFBjxF9l.js} +2 -2
- package/dist/{EditCard-D7-Ye7R0.js.map → EditCard-DFBjxF9l.js.map} +1 -1
- package/dist/EditCard.css +1 -1
- package/dist/EditCard.js +1 -1
- package/dist/{FieldLabel-DZWu5dMp.js → FieldLabel-rHPbiyR3.js} +3 -3
- package/dist/{FieldLabel-DZWu5dMp.js.map → FieldLabel-rHPbiyR3.js.map} +1 -1
- package/dist/FieldLabel.css +2 -2
- package/dist/FieldLabel.js +1 -1
- package/dist/FieldMessage.css +1 -1
- package/dist/{Toolbar-C1_etxss.js → FilterBar-kVue-bVK.js} +127 -939
- package/dist/FilterBar-kVue-bVK.js.map +1 -0
- package/dist/FilterBar.css +59 -0
- package/dist/FilterBar.d.ts +6 -0
- package/dist/FilterBar.js +2 -0
- package/dist/FilterBar.js.map +1 -0
- package/dist/Flex.css +1 -1
- package/dist/Grid.css +1 -1
- package/dist/Helper.css +1 -1
- package/dist/Icon.css +1 -1
- package/dist/{InputMask-EwEJlW-t.js → InputMask-DxbFpzo7.js} +3 -3
- package/dist/{InputMask-EwEJlW-t.js.map → InputMask-DxbFpzo7.js.map} +1 -1
- package/dist/InputMask.js +1 -1
- package/dist/InteractiveCard-KGs2b_al.js +119 -0
- package/dist/InteractiveCard-KGs2b_al.js.map +1 -0
- package/dist/InteractiveCard.css +22 -29
- package/dist/InteractiveCard.js +1 -1
- package/dist/Layout.css +1 -1
- package/dist/Link.css +1 -1
- package/dist/List.css +1 -1
- package/dist/{ListView-DBO9Bl1H.js → ListView-CYkuvkAy.js} +2 -2
- package/dist/{ListView-DBO9Bl1H.js.map → ListView-CYkuvkAy.js.map} +1 -1
- package/dist/ListView.css +1 -1
- package/dist/ListView.js +1 -1
- package/dist/{Listbox-DDlxpVu9.js → Listbox-BBrsMfO3.js} +2 -2
- package/dist/{Listbox-DDlxpVu9.js.map → Listbox-BBrsMfO3.js.map} +1 -1
- package/dist/Listbox.css +1 -1
- package/dist/Listbox.js +1 -1
- package/dist/Menu.css +1 -1
- package/dist/MultiSelectField.js +1 -1
- package/dist/{MultiSelectFieldSync-DZ3tm7zt.js → MultiSelectFieldSync-BWZQ4MFC.js} +5 -5
- package/dist/{MultiSelectFieldSync-DZ3tm7zt.js.map → MultiSelectFieldSync-BWZQ4MFC.js.map} +1 -1
- package/dist/MultiSelectFieldSync.css +1 -1
- package/dist/MultiSelectMenu.js +1 -1
- package/dist/{MultiSelectMenuSync-dgO9SmHi.js → MultiSelectMenuSync-Bl4ty0je.js} +4 -4
- package/dist/{MultiSelectMenuSync-dgO9SmHi.js.map → MultiSelectMenuSync-Bl4ty0je.js.map} +1 -1
- package/dist/{NumberField-DJbdyatF.js → NumberField-DMHJ2Cyi.js} +4 -5
- package/dist/NumberField-DMHJ2Cyi.js.map +1 -0
- package/dist/NumberField.css +1 -1
- package/dist/NumberField.js +1 -1
- package/dist/Overflow.css +2 -2
- package/dist/Overflow.js +1 -1
- package/dist/{Page-Be1Blwme.js → Page-Blw4TE5J.js} +9 -9
- package/dist/{Page-Be1Blwme.js.map → Page-Blw4TE5J.js.map} +1 -1
- package/dist/Page.css +1 -1
- package/dist/Page.js +1 -1
- package/dist/{Pagination-USDJM5vi.js → Pagination-DYNH3WeU.js} +2 -2
- package/dist/{Pagination-USDJM5vi.js.map → Pagination-DYNH3WeU.js.map} +1 -1
- package/dist/Pagination.css +6 -6
- package/dist/Pagination.js +1 -1
- package/dist/{Popover-CyB7yzSf.js → Popover-C_XdNvAZ.js} +2 -2
- package/dist/{Popover-CyB7yzSf.js.map → Popover-C_XdNvAZ.js.map} +1 -1
- package/dist/Popover.css +1 -1
- package/dist/Popover.js +1 -1
- package/dist/{ProgressBar-DSrjgLTx.js → ProgressBar-BwHaAD25.js} +2 -2
- package/dist/{ProgressBar-DSrjgLTx.js.map → ProgressBar-BwHaAD25.js.map} +1 -1
- package/dist/ProgressBar.css +1 -1
- package/dist/ProgressBar.js +1 -1
- package/dist/{Radio-CQaXJ72d.js → Radio-DJ6KgfcS.js} +2 -2
- package/dist/{Radio-CQaXJ72d.js.map → Radio-DJ6KgfcS.js.map} +1 -1
- package/dist/{Radio-DO4UhbBE.js → Radio-IksHWkBl.js} +3 -3
- package/dist/{Radio-DO4UhbBE.js.map → Radio-IksHWkBl.js.map} +1 -1
- package/dist/Radio.css +1 -1
- package/dist/Radio.js +1 -1
- package/dist/RichTextEditor-C_Boj8QP.js +30852 -0
- package/dist/RichTextEditor-C_Boj8QP.js.map +1 -0
- package/dist/RichTextEditor.css +178 -0
- package/dist/RichTextEditor.d.ts +2 -0
- package/dist/RichTextEditor.js +2 -0
- package/dist/RichTextEditor.js.map +1 -0
- package/dist/{SearchField-CsRGYZx3.js → SearchField-BKJOW-vI.js} +3 -10
- package/dist/SearchField-BKJOW-vI.js.map +1 -0
- package/dist/SearchField-BplvDpBG.js +13 -0
- package/dist/SearchField-BplvDpBG.js.map +1 -0
- package/dist/SearchField.css +1 -1
- package/dist/SearchField.js +1 -1
- package/dist/SegmentedControl.css +1 -1
- package/dist/{SelectCard-CtXwY8FZ.js → SelectCard-E-13CjHS.js} +3 -3
- package/dist/{SelectCard-CtXwY8FZ.js.map → SelectCard-E-13CjHS.js.map} +1 -1
- package/dist/SelectCard.css +1 -1
- package/dist/SelectCard.js +1 -1
- package/dist/SelectField.js +1 -1
- package/dist/{SelectFieldLabel-DLT5dKbx.js → SelectFieldLabel-C-MrQm-n.js} +2 -2
- package/dist/{SelectFieldLabel-DLT5dKbx.js.map → SelectFieldLabel-C-MrQm-n.js.map} +1 -1
- package/dist/{SelectFieldSync-C44hPeeS.js → SelectFieldSync-BbJFd_bV.js} +4 -4
- package/dist/{SelectFieldSync-C44hPeeS.js.map → SelectFieldSync-BbJFd_bV.js.map} +1 -1
- package/dist/SelectMenu.js +1 -1
- package/dist/{SelectMenuSync-V97oN85V.js → SelectMenuSync-CBMdmGTU.js} +4 -4
- package/dist/{SelectMenuSync-V97oN85V.js.map → SelectMenuSync-CBMdmGTU.js.map} +1 -1
- package/dist/{SelectOptions-CDoo4AUu.js → SelectOptions-BT9OCfPh.js} +2 -2
- package/dist/{SelectOptions-CDoo4AUu.js.map → SelectOptions-BT9OCfPh.js.map} +1 -1
- package/dist/{SelectTrigger-BWN3Tx43.js → SelectTrigger-DtyxYDzP.js} +3 -3
- package/dist/{SelectTrigger-BWN3Tx43.js.map → SelectTrigger-DtyxYDzP.js.map} +1 -1
- package/dist/SelectTrigger.js +1 -1
- package/dist/{SelectTriggerBase-Do7lQ5rw.js → SelectTriggerBase-Xwq929Wr.js} +3 -3
- package/dist/{SelectTriggerBase-Do7lQ5rw.js.map → SelectTriggerBase-Xwq929Wr.js.map} +1 -1
- package/dist/SelectTriggerBase.css +1 -1
- package/dist/SideNav.css +1 -1
- package/dist/Skeleton.css +1 -1
- package/dist/Spinner.css +1 -1
- package/dist/SrOnly.css +1 -1
- package/dist/StatusIcon.css +1 -1
- package/dist/Stepper.css +4 -4
- package/dist/{Switch-DeBu4Ucg.js → Switch-CElshQ9N.js} +2 -2
- package/dist/{Switch-DeBu4Ucg.js.map → Switch-CElshQ9N.js.map} +1 -1
- package/dist/Switch.css +1 -1
- package/dist/Switch.js +1 -1
- package/dist/Tab.css +1 -1
- package/dist/Table.js +1 -1
- package/dist/{Text-J5YtSSXY.js → Text-C0F8AkvH.js} +5 -5
- package/dist/Text-C0F8AkvH.js.map +1 -0
- package/dist/Text.css +1 -1
- package/dist/Text.js +1 -1
- package/dist/{TextField-CRDTnuUN.js → TextField-CLZEj0aI.js} +3 -3
- package/dist/{TextField-CRDTnuUN.js.map → TextField-CLZEj0aI.js.map} +1 -1
- package/dist/{TextField-YlMkDHp-.js → TextField-yL52fx5R.js} +2 -2
- package/dist/{TextField-YlMkDHp-.js.map → TextField-yL52fx5R.js.map} +1 -1
- package/dist/TextField.css +1 -1
- package/dist/TextField.js +1 -1
- package/dist/{Textarea-CxXmr_Gx.js → Textarea-CGgyvnM8.js} +3 -3
- package/dist/{Textarea-CxXmr_Gx.js.map → Textarea-CGgyvnM8.js.map} +1 -1
- package/dist/Textarea.css +1 -1
- package/dist/Textarea.js +1 -1
- package/dist/ThemeProvider.css +0 -1
- package/dist/{TimeField-DTg0CE5L.js → TimeField-BEvxjjFp.js} +4 -4
- package/dist/{TimeField-DTg0CE5L.js.map → TimeField-BEvxjjFp.js.map} +1 -1
- package/dist/TimeField.css +1 -1
- package/dist/TimeField.js +1 -1
- package/dist/TimezoneMessage.css +1 -1
- package/dist/Toast.js +2 -2
- package/dist/{Toaster-Bq42x6Gx.js → Toaster-DllJAOK8.js} +3 -3
- package/dist/{Toaster-Bq42x6Gx.js.map → Toaster-DllJAOK8.js.map} +1 -1
- package/dist/{Toaster-Dly3rfva.js → Toaster-DuadB8pq.js} +2 -2
- package/dist/{Toaster-Dly3rfva.js.map → Toaster-DuadB8pq.js.map} +1 -1
- package/dist/Toaster.css +1 -1
- package/dist/Toolbar-J5cakHba.js +588 -0
- package/dist/Toolbar-J5cakHba.js.map +1 -0
- package/dist/Toolbar-QYRQv45Y.js +780 -0
- package/dist/Toolbar-QYRQv45Y.js.map +1 -0
- package/dist/Toolbar.css +2 -96
- package/dist/Toolbar.js +2 -1
- package/dist/Toolbar.js.map +1 -1
- package/dist/{index2.css → Toolbar2.css} +1 -1
- package/dist/ToolbarButtonToggle-Ch0SH4oH.js +285 -0
- package/dist/ToolbarButtonToggle-Ch0SH4oH.js.map +1 -0
- package/dist/ToolbarButtonToggle.css +41 -0
- package/dist/{Tooltip-BlStOXN3.js → Tooltip-lBmgi5ZB.js} +7 -6
- package/dist/Tooltip-lBmgi5ZB.js.map +1 -0
- package/dist/Tooltip.css +7 -6
- package/dist/Tooltip.js +1 -1
- package/dist/{YearlessDateInputWithPicker-DyytWt0x.js → YearlessDateInputWithPicker-DryLX8sA.js} +2 -2
- package/dist/{YearlessDateInputWithPicker-DyytWt0x.js.map → YearlessDateInputWithPicker-DryLX8sA.js.map} +1 -1
- package/dist/YearlessDateInputWithPicker.css +2 -2
- package/dist/add-BcQkAUip.js +6 -0
- package/dist/add-BcQkAUip.js.map +1 -0
- package/dist/assets/css-utils/a2-border.css +23 -53
- package/dist/assets/css-utils/a2-color.css +221 -449
- package/dist/assets/css-utils/a2-font.css +21 -47
- package/dist/assets/css-utils/a2-spacing.css +238 -481
- package/dist/assets/css-utils/a2-utils.css +497 -1002
- package/dist/assets/css-utils/border.css +23 -53
- package/dist/assets/css-utils/color.css +221 -449
- package/dist/assets/css-utils/font.css +21 -47
- package/dist/assets/css-utils/spacing.css +238 -481
- package/dist/assets/css-utils/utils.css +497 -1002
- package/dist/assets/icons/st/unsorted.svg +1 -1
- package/dist/beta/components/FilterBar/FilterBar.d.ts +87 -0
- package/dist/beta/components/{Toolbar/Filters → FilterBar}/FilterToggleButton.d.ts +1 -1
- package/dist/beta/components/FilterBar/index.d.ts +3 -0
- package/dist/beta/components/{Toolbar/Filters → FilterBar}/internal/FilterGroupContext.d.ts +5 -5
- package/dist/beta/components/{Toolbar/Filters → FilterBar}/internal/types.d.ts +2 -2
- package/dist/beta/components/{Toolbar/Filters → FilterBar}/internal/utils/test.d.ts +1 -0
- package/dist/beta/components/InteractiveCard/InteractiveCard.d.ts +3 -1
- package/dist/beta/components/RichTextEditor/RichTextEditor.d.ts +27 -0
- package/dist/beta/components/RichTextEditor/index.d.ts +2 -0
- package/dist/beta/components/RichTextEditor/internal/LinkPopover.d.ts +14 -0
- package/dist/beta/components/RichTextEditor/internal/MentionList.d.ts +14 -0
- package/dist/beta/components/RichTextEditor/internal/MentionNodeView.d.ts +11 -0
- package/dist/beta/components/RichTextEditor/internal/MentionPopover.d.ts +16 -0
- package/dist/beta/components/RichTextEditor/internal/RichTextEditorContext.d.ts +57 -0
- package/dist/beta/components/RichTextEditor/internal/RichTextEditorDragHandle.d.ts +6 -0
- package/dist/beta/components/RichTextEditor/internal/RichTextEditorMockData.d.ts +8 -0
- package/dist/beta/components/RichTextEditor/internal/RichTextEditorProvider.d.ts +8 -0
- package/dist/beta/components/RichTextEditor/internal/RichTextEditorToolbar.d.ts +1 -0
- package/dist/beta/components/RichTextEditor/internal/YouTubeEmbedPrompt.d.ts +11 -0
- package/dist/beta/components/RichTextEditor/internal/YouTubePopover.d.ts +11 -0
- package/dist/beta/components/RichTextEditor/internal/extensions/ImageUploadExtension.d.ts +3 -0
- package/dist/beta/components/RichTextEditor/internal/extensions/LinkKeyboardShortcutExtension.d.ts +8 -0
- package/dist/beta/components/RichTextEditor/internal/extensions/MentionExtension.d.ts +18 -0
- package/dist/beta/components/RichTextEditor/internal/extensions/YoutubeExtension.d.ts +8 -0
- package/dist/beta/components/RichTextEditor/internal/useRichTextEditor.d.ts +32 -0
- package/dist/beta/components/RichTextEditor/types.d.ts +103 -0
- package/dist/beta/components/Table/DataTable/DataTable.d.ts +40 -1
- package/dist/beta/components/Table/DataTable/internal/DataTableBody.d.ts +22 -0
- package/dist/beta/components/Table/DataTable/internal/DataTableBodyRow.d.ts +18 -1
- package/dist/beta/components/Table/DataTable/internal/cells/CellFocusContext.d.ts +16 -0
- package/dist/beta/components/Table/DataTable/internal/editable-cells/DataTableEditableCustomCell.d.ts +8 -0
- package/dist/beta/components/Table/DataTable/internal/editable-cells/useCustomEditHelpers.d.ts +49 -0
- package/dist/beta/components/Table/DataTable/internal/useDataTableVirtualizer.d.ts +9 -5
- package/dist/beta/components/Table/DataTable/internal/util/cellTypeHelpers.d.ts +3 -0
- package/dist/beta/components/Table/DataTable/internal/util/getTanStackColumnDef.d.ts +13 -1
- package/dist/beta/components/Table/createColumnHelper.d.ts +48 -22
- package/dist/beta/components/Table/internal/getCommonPinningClasses.d.ts +1 -1
- package/dist/beta/components/Table/types.d.ts +311 -7
- package/dist/beta/components/Toolbar/Toolbar.d.ts +0 -54
- package/dist/beta/components/Toolbar/index.d.ts +0 -1
- package/dist/beta/components/index.d.ts +2 -0
- package/dist/beta.js +13 -10
- package/dist/beta.js.map +1 -1
- package/dist/components/Toolbar/internal/utils/accessibility.d.ts +5 -0
- package/dist/getKeyboardFocusableElements-B_U9rt6y.js +11 -0
- package/dist/getKeyboardFocusableElements-B_U9rt6y.js.map +1 -0
- package/dist/index-DUzqzmOX.js +17044 -0
- package/dist/index-DUzqzmOX.js.map +1 -0
- package/dist/index-DtsM4pjR.js +71 -0
- package/dist/index-DtsM4pjR.js.map +1 -0
- package/dist/index.css +1 -22
- package/dist/index.js +49 -813
- package/dist/index.js.map +1 -1
- package/dist/internal/components/Surface/Surface.d.ts +141 -0
- package/dist/internal/components/Surface/index.d.ts +1 -0
- package/dist/internal/components/index.d.ts +1 -0
- package/dist/internal/functions/getKeyboardFocusableElements.d.ts +11 -0
- package/dist/{stripInlineMarkdown-BWbMy7r_.js → stripInlineMarkdown-BOi-eJO3.js} +2 -2
- package/dist/{stripInlineMarkdown-BWbMy7r_.js.map → stripInlineMarkdown-BOi-eJO3.js.map} +1 -1
- package/dist/{syncFilterUtils-BLcRXQfd.js → syncFilterUtils-Gvm81gyv.js} +5 -5
- package/dist/{syncFilterUtils-BLcRXQfd.js.map → syncFilterUtils-Gvm81gyv.js.map} +1 -1
- package/dist/syncFilterUtils.css +4 -4
- package/dist/token/core/css-utils/a2-border.css +0 -30
- package/dist/token/core/css-utils/a2-color.css +0 -228
- package/dist/token/core/css-utils/a2-font.css +1 -27
- package/dist/token/core/css-utils/a2-spacing.css +1 -244
- package/dist/token/core/css-utils/a2-utils.css +0 -505
- package/dist/token/core/css-utils/border.css +0 -30
- package/dist/token/core/css-utils/color.css +0 -228
- package/dist/token/core/css-utils/font.css +1 -27
- package/dist/token/core/css-utils/spacing.css +1 -244
- package/dist/token/core/css-utils/utils.css +0 -505
- package/dist/{useDrilldown-D5WWJRU2.js → useDrilldown-6SfknQ2s.js} +3 -3
- package/dist/{useDrilldown-D5WWJRU2.js.map → useDrilldown-6SfknQ2s.js.map} +1 -1
- package/dist/{useInitialFocus-BUxEDMEG.js → useInitialFocus-BIvXK1Rp.js} +2 -2
- package/dist/{useInitialFocus-BUxEDMEG.js.map → useInitialFocus-BIvXK1Rp.js.map} +1 -1
- package/dist/{usePopoverTransitionStates-CDXCdyKa.js → usePopoverTransitionStates-B1opfxxn.js} +1 -2
- package/dist/{usePopoverTransitionStates-CDXCdyKa.js.map → usePopoverTransitionStates-B1opfxxn.js.map} +1 -1
- package/dist/{useToggleSelection-D_2qS0P1.js → useToggleSelection-odFvSS5t.js} +2 -2
- package/dist/{useToggleSelection-D_2qS0P1.js.map → useToggleSelection-odFvSS5t.js.map} +1 -1
- package/package.json +26 -11
- package/dist/Avatar-B4hRHku9.js.map +0 -1
- package/dist/DataTable-D9Xj1nq5.js.map +0 -1
- package/dist/Dialog-DGmF6qx3.js.map +0 -1
- package/dist/InteractiveCard-CnW0m_F-.js +0 -87
- package/dist/InteractiveCard-CnW0m_F-.js.map +0 -1
- package/dist/NumberField-DJbdyatF.js.map +0 -1
- package/dist/SearchField-CsRGYZx3.js.map +0 -1
- package/dist/Text-J5YtSSXY.js.map +0 -1
- package/dist/Toolbar-C1_etxss.js.map +0 -1
- package/dist/Tooltip-BlStOXN3.js.map +0 -1
- package/dist/beta/components/Toolbar/Filters/FilterGroup.d.ts +0 -25
- package/dist/getKeyboardFocusableElements-QqcABz0D.js +0 -12
- package/dist/getKeyboardFocusableElements-QqcABz0D.js.map +0 -1
- package/dist/index-ByMdotWU.js +0 -107
- package/dist/index-ByMdotWU.js.map +0 -1
- /package/dist/beta/components/{Toolbar/Filters → FilterBar}/FilterButton.d.ts +0 -0
- /package/dist/beta/components/{Toolbar/Filters → FilterBar}/FilterDateRange.d.ts +0 -0
- /package/dist/beta/components/{Toolbar/Filters → FilterBar}/FilterDateSingle.d.ts +0 -0
- /package/dist/beta/components/{Toolbar/Filters → FilterBar}/FilterDrawer.d.ts +0 -0
- /package/dist/beta/components/{Toolbar/Filters → FilterBar}/FilterItemWrapper.d.ts +0 -0
- /package/dist/beta/components/{Toolbar/Filters → FilterBar}/FilterSelect.d.ts +0 -0
- /package/dist/beta/components/{Toolbar/Filters → FilterBar}/internal/utils/filter-state.d.ts +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { C as Chip } from './Chip-
|
|
2
|
+
import { C as Chip } from './Chip-DBn3KRak.js';
|
|
3
3
|
import { F as Flex } from './Flex-DOUtHiPi.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import { useRef,
|
|
5
|
+
import { useId, useRef, useCallback, useMemo, createContext, forwardRef, useEffect, useContext, useState, useLayoutEffect, useImperativeHandle, memo as memo$1, Fragment as Fragment$1, isValidElement } from 'react';
|
|
6
6
|
import { c as cx } from './index-De1g9FRV.js';
|
|
7
7
|
import { D as DateTime } from './luxon-wpz4A-OQ.js';
|
|
8
|
-
import { C as Checkbox } from './Checkbox-
|
|
8
|
+
import { C as Checkbox } from './Checkbox-lSwl_u26.js';
|
|
9
9
|
import { B as Button } from './Button-Bnt8XUI7.js';
|
|
10
10
|
import { S as SvgChevronRight } from './chevron_right-BdpsxX7x.js';
|
|
11
11
|
import { S as SvgEdit } from './edit-DQOiktcu.js';
|
|
@@ -13,22 +13,293 @@ import { I as Icon } from './Icon-BMMbp40n.js';
|
|
|
13
13
|
import { S as SrOnly } from './SrOnly-pnf8ajnh.js';
|
|
14
14
|
import { u as useNumberField } from './useNumberField-eMyk7MB8.js';
|
|
15
15
|
import { u as useMergeRefs, m as mergeRefs } from './useMergeRefs-Dfmtq9cI.js';
|
|
16
|
-
import { a as SelectMenuSync, S as SelectMenu } from './SelectMenuSync-
|
|
17
|
-
import { a as MultiSelectMenuSync, M as MultiSelectMenu } from './MultiSelectMenuSync-
|
|
18
|
-
import {
|
|
16
|
+
import { a as SelectMenuSync, S as SelectMenu } from './SelectMenuSync-CBMdmGTU.js';
|
|
17
|
+
import { a as MultiSelectMenuSync, M as MultiSelectMenu } from './MultiSelectMenuSync-Bl4ty0je.js';
|
|
18
|
+
import { S as SvgClose } from './close-DZj38AEh.js';
|
|
19
|
+
import { a as useOnClickOutside, r as registerLayer, u as unregisterLayer } from './useOnClickOutside-Zw5vzxSq.js';
|
|
20
|
+
import { c as computePosition, o as offset, v as autoPlacement, d as shift, g as size, a as autoUpdate, s as safeShowPopover, b as safeHidePopover } from './floating-ui.react-dom-CHrYz13o.js';
|
|
21
|
+
import { F as FieldLabel } from './FieldLabel-rHPbiyR3.js';
|
|
19
22
|
import { S as SvgError } from './error-DR_wWdYY.js';
|
|
20
23
|
import { S as SvgWarning } from './warning-c4Wj1rI4.js';
|
|
21
|
-
import { T as Tooltip } from './Tooltip-
|
|
24
|
+
import { T as Tooltip } from './Tooltip-lBmgi5ZB.js';
|
|
22
25
|
import { flushSync } from 'react-dom';
|
|
23
26
|
import { u as useLayoutPropsUtil } from './useLayoutPropsUtil-CB_zHDbW.js';
|
|
24
|
-
import { P as Pagination } from './Pagination-
|
|
27
|
+
import { P as Pagination } from './Pagination-DYNH3WeU.js';
|
|
25
28
|
import { T as ThemeProviderContext } from './ThemeProviderContext-l52GohYT.js';
|
|
26
29
|
import { u as useVirtualizer } from './index-DXeGMe23.js';
|
|
27
|
-
import { S as Spinner } from './Spinner-lPMo68yW.js';
|
|
28
30
|
import { u as useOptionallyControlledState } from './useOptionallyControlledState-DbDuos5L.js';
|
|
29
31
|
import { u as usePrefersColorScheme } from './usePrefersColorScheme-_hT7dK7_.js';
|
|
32
|
+
import { S as Spinner } from './Spinner-lPMo68yW.js';
|
|
33
|
+
|
|
34
|
+
import './DataTable.css';const surface = "_surface_c2g1l_2";
|
|
35
|
+
const header = "_header_c2g1l_37";
|
|
36
|
+
const title = "_title_c2g1l_56";
|
|
37
|
+
const content = "_content_c2g1l_72";
|
|
38
|
+
const styles$g = {
|
|
39
|
+
surface: surface,
|
|
40
|
+
header: header,
|
|
41
|
+
"header-bottom-border": "_header-bottom-border_c2g1l_46",
|
|
42
|
+
"header-copy": "_header-copy_c2g1l_49",
|
|
43
|
+
title: title,
|
|
44
|
+
"header-actions": "_header-actions_c2g1l_63",
|
|
45
|
+
"close-button": "_close-button_c2g1l_69",
|
|
46
|
+
content: content,
|
|
47
|
+
"content-title-spacing": "_content-title-spacing_c2g1l_82"
|
|
48
|
+
};
|
|
30
49
|
|
|
31
|
-
|
|
50
|
+
const SurfaceContext = createContext(null);
|
|
51
|
+
function useSurfaceContext() {
|
|
52
|
+
const context = useContext(SurfaceContext);
|
|
53
|
+
if (!context) {
|
|
54
|
+
throw new Error(
|
|
55
|
+
"Surface compound components must be used within a <Surface> component."
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
return context;
|
|
59
|
+
}
|
|
60
|
+
function SurfaceTrigger({ children }) {
|
|
61
|
+
const { open, setReference, surfaceId, triggerId } = useSurfaceContext();
|
|
62
|
+
return children({
|
|
63
|
+
ref: setReference,
|
|
64
|
+
id: triggerId,
|
|
65
|
+
"aria-controls": surfaceId,
|
|
66
|
+
"aria-haspopup": "dialog",
|
|
67
|
+
"aria-expanded": open,
|
|
68
|
+
"data-state": open ? "open" : "closed"
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function resolveCssDimension(value, fallback) {
|
|
72
|
+
if (typeof value === "number") return `${value}px`;
|
|
73
|
+
if (typeof value === "string") return value;
|
|
74
|
+
return fallback;
|
|
75
|
+
}
|
|
76
|
+
const SurfaceContent = forwardRef(
|
|
77
|
+
function SurfaceContent2(props, ref) {
|
|
78
|
+
const {
|
|
79
|
+
children,
|
|
80
|
+
onClose,
|
|
81
|
+
onCancel,
|
|
82
|
+
title,
|
|
83
|
+
headerContent,
|
|
84
|
+
initialFocusRef,
|
|
85
|
+
width,
|
|
86
|
+
maxHeight,
|
|
87
|
+
closeButtonLabel = "Close surface",
|
|
88
|
+
className,
|
|
89
|
+
style,
|
|
90
|
+
onKeyDown,
|
|
91
|
+
...rest
|
|
92
|
+
} = props;
|
|
93
|
+
const { open, referenceElement, surfaceId } = useSurfaceContext();
|
|
94
|
+
const localRef = useRef(null);
|
|
95
|
+
const surfaceRef = useMergeRefs([localRef, ref]);
|
|
96
|
+
const layerId = `${surfaceId}-layer`;
|
|
97
|
+
const titleId = `${surfaceId}-title`;
|
|
98
|
+
const resolvedWidth = resolveCssDimension(width, "325px");
|
|
99
|
+
const resolvedMaxHeight = resolveCssDimension(maxHeight, "450px");
|
|
100
|
+
const handleCancel = onCancel ?? onClose;
|
|
101
|
+
useOnClickOutside({
|
|
102
|
+
targets: [
|
|
103
|
+
localRef.current ?? void 0,
|
|
104
|
+
referenceElement.current ?? void 0
|
|
105
|
+
],
|
|
106
|
+
onClickOutside: () => {
|
|
107
|
+
onClose();
|
|
108
|
+
},
|
|
109
|
+
disable: !open,
|
|
110
|
+
layerId
|
|
111
|
+
});
|
|
112
|
+
const updatePosition = useCallback(async () => {
|
|
113
|
+
if (!localRef.current || !referenceElement.current) return;
|
|
114
|
+
const position = await computePosition(
|
|
115
|
+
referenceElement.current,
|
|
116
|
+
localRef.current,
|
|
117
|
+
{
|
|
118
|
+
placement: "bottom-start",
|
|
119
|
+
middleware: [
|
|
120
|
+
offset(8),
|
|
121
|
+
autoPlacement({
|
|
122
|
+
allowedPlacements: [
|
|
123
|
+
"bottom-start",
|
|
124
|
+
"bottom-end",
|
|
125
|
+
"top-start",
|
|
126
|
+
"top-end"
|
|
127
|
+
],
|
|
128
|
+
padding: 8
|
|
129
|
+
}),
|
|
130
|
+
shift({ padding: 8 }),
|
|
131
|
+
size({
|
|
132
|
+
padding: 8,
|
|
133
|
+
apply({ availableHeight, availableWidth, elements }) {
|
|
134
|
+
Object.assign(elements.floating.style, {
|
|
135
|
+
width: resolvedWidth,
|
|
136
|
+
maxWidth: `${Math.max(0, availableWidth)}px`,
|
|
137
|
+
maxHeight: `min(${resolvedMaxHeight}, ${Math.max(0, availableHeight)}px)`
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
localRef.current.style.left = `${position.x}px`;
|
|
145
|
+
localRef.current.style.top = `${position.y}px`;
|
|
146
|
+
}, [referenceElement, resolvedMaxHeight, resolvedWidth]);
|
|
147
|
+
useEffect(() => {
|
|
148
|
+
if (!open || !localRef.current || !referenceElement.current) return;
|
|
149
|
+
return autoUpdate(referenceElement.current, localRef.current, () => {
|
|
150
|
+
void updatePosition();
|
|
151
|
+
});
|
|
152
|
+
}, [open, referenceElement, updatePosition]);
|
|
153
|
+
useEffect(() => {
|
|
154
|
+
if (!localRef.current) return;
|
|
155
|
+
if (open) {
|
|
156
|
+
safeShowPopover(localRef.current);
|
|
157
|
+
void updatePosition();
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
safeHidePopover(localRef.current);
|
|
161
|
+
}, [open, updatePosition]);
|
|
162
|
+
useEffect(() => {
|
|
163
|
+
if (!open) return;
|
|
164
|
+
registerLayer(layerId);
|
|
165
|
+
return () => {
|
|
166
|
+
unregisterLayer(layerId);
|
|
167
|
+
};
|
|
168
|
+
}, [layerId, open]);
|
|
169
|
+
useEffect(() => {
|
|
170
|
+
if (!open || !initialFocusRef?.current) return;
|
|
171
|
+
const focusHandle = window.requestAnimationFrame(() => {
|
|
172
|
+
initialFocusRef.current?.focus();
|
|
173
|
+
});
|
|
174
|
+
return () => {
|
|
175
|
+
window.cancelAnimationFrame(focusHandle);
|
|
176
|
+
};
|
|
177
|
+
}, [initialFocusRef, open]);
|
|
178
|
+
useEffect(() => {
|
|
179
|
+
const surfaceElement = localRef.current;
|
|
180
|
+
if (!surfaceElement) return;
|
|
181
|
+
const handleSurfaceKeyDown = (event) => {
|
|
182
|
+
onKeyDown?.(event);
|
|
183
|
+
if (event.defaultPrevented) return;
|
|
184
|
+
if (event.key === "Escape") {
|
|
185
|
+
event.preventDefault();
|
|
186
|
+
event.stopPropagation();
|
|
187
|
+
handleCancel();
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
surfaceElement.addEventListener("keydown", handleSurfaceKeyDown);
|
|
191
|
+
return () => {
|
|
192
|
+
surfaceElement.removeEventListener("keydown", handleSurfaceKeyDown);
|
|
193
|
+
};
|
|
194
|
+
}, [handleCancel, onKeyDown]);
|
|
195
|
+
const defaultLabelProps = !("aria-label" in rest) && !("aria-labelledby" in rest) && title ? { "aria-labelledby": titleId } : {};
|
|
196
|
+
const dialogProps = {
|
|
197
|
+
role: "dialog",
|
|
198
|
+
"aria-modal": false
|
|
199
|
+
};
|
|
200
|
+
return /* @__PURE__ */ jsxs(
|
|
201
|
+
"div",
|
|
202
|
+
{
|
|
203
|
+
...rest,
|
|
204
|
+
...defaultLabelProps,
|
|
205
|
+
id: surfaceId,
|
|
206
|
+
ref: surfaceRef,
|
|
207
|
+
popover: "manual",
|
|
208
|
+
...dialogProps,
|
|
209
|
+
tabIndex: -1,
|
|
210
|
+
className: cx(className, styles$g["surface"]),
|
|
211
|
+
style: {
|
|
212
|
+
...style,
|
|
213
|
+
width: resolvedWidth,
|
|
214
|
+
maxHeight: resolvedMaxHeight
|
|
215
|
+
},
|
|
216
|
+
"data-anv": "surface-content",
|
|
217
|
+
children: [
|
|
218
|
+
/* @__PURE__ */ jsxs(
|
|
219
|
+
"div",
|
|
220
|
+
{
|
|
221
|
+
className: cx(styles$g["header"], {
|
|
222
|
+
[styles$g["header-bottom-border"]]: title
|
|
223
|
+
}),
|
|
224
|
+
children: [
|
|
225
|
+
/* @__PURE__ */ jsx("div", { className: styles$g["header-copy"], children: title ? /* @__PURE__ */ jsx("div", { id: titleId, className: styles$g["title"], children: title }) : null }),
|
|
226
|
+
/* @__PURE__ */ jsxs("div", { className: styles$g["header-actions"], children: [
|
|
227
|
+
headerContent,
|
|
228
|
+
/* @__PURE__ */ jsx(
|
|
229
|
+
Button,
|
|
230
|
+
{
|
|
231
|
+
appearance: "ghost",
|
|
232
|
+
"aria-label": closeButtonLabel,
|
|
233
|
+
className: styles$g["close-button"],
|
|
234
|
+
"data-anv": "surface-close-button",
|
|
235
|
+
icon: SvgClose,
|
|
236
|
+
onClick: onClose,
|
|
237
|
+
size: "small",
|
|
238
|
+
type: "button"
|
|
239
|
+
}
|
|
240
|
+
)
|
|
241
|
+
] })
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
),
|
|
245
|
+
/* @__PURE__ */ jsx(
|
|
246
|
+
"div",
|
|
247
|
+
{
|
|
248
|
+
className: cx(styles$g["content"], {
|
|
249
|
+
[styles$g["content-title-spacing"]]: title
|
|
250
|
+
}),
|
|
251
|
+
children
|
|
252
|
+
}
|
|
253
|
+
)
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
);
|
|
259
|
+
SurfaceContent.displayName = "SurfaceContent";
|
|
260
|
+
const Surface = Object.assign(
|
|
261
|
+
function Surface2({ children, open, id }) {
|
|
262
|
+
const generatedId = useId();
|
|
263
|
+
const cleanId = generatedId.replace(/:/g, "");
|
|
264
|
+
const surfaceId = id ?? `surface-${cleanId}`;
|
|
265
|
+
const triggerId = `${surfaceId}-trigger`;
|
|
266
|
+
const referenceElement = useRef(null);
|
|
267
|
+
const setReference = useCallback((node) => {
|
|
268
|
+
referenceElement.current = node;
|
|
269
|
+
}, []);
|
|
270
|
+
const value = useMemo(
|
|
271
|
+
() => ({
|
|
272
|
+
open,
|
|
273
|
+
surfaceId,
|
|
274
|
+
triggerId,
|
|
275
|
+
referenceElement,
|
|
276
|
+
setReference
|
|
277
|
+
}),
|
|
278
|
+
[open, setReference, surfaceId, triggerId]
|
|
279
|
+
);
|
|
280
|
+
return /* @__PURE__ */ jsx(SurfaceContext.Provider, { value, children });
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
/**
|
|
284
|
+
* SurfaceTrigger component for wiring a trigger element to Surface content.
|
|
285
|
+
*
|
|
286
|
+
* Features:
|
|
287
|
+
* - Provides ARIA attributes and open state for the trigger.
|
|
288
|
+
* - Registers the trigger as the positioning reference.
|
|
289
|
+
*/
|
|
290
|
+
Trigger: SurfaceTrigger,
|
|
291
|
+
/**
|
|
292
|
+
* SurfaceContent component for rendering positioned, non-modal content as a manual popover.
|
|
293
|
+
*
|
|
294
|
+
* Features:
|
|
295
|
+
* - Positions content relative to the Surface trigger.
|
|
296
|
+
* - Supports accessible labels, close behavior, and viewport-aware sizing.
|
|
297
|
+
*/
|
|
298
|
+
Content: SurfaceContent
|
|
299
|
+
}
|
|
300
|
+
);
|
|
301
|
+
|
|
302
|
+
const booleanFormatter = (value, { trueLabel = "True", falseLabel = "False" } = {}) => {
|
|
32
303
|
if (value == null) {
|
|
33
304
|
return null;
|
|
34
305
|
}
|
|
@@ -36,17 +307,19 @@ import './DataTable.css';const booleanFormatter = (value, { trueLabel = "True",
|
|
|
36
307
|
};
|
|
37
308
|
|
|
38
309
|
const styles$f = {
|
|
39
|
-
"table-header-cell": "_table-header-
|
|
40
|
-
"table-body-cell": "_table-body-
|
|
41
|
-
"table-footer-cell": "_table-footer-
|
|
42
|
-
"last-pinned-left-column": "_last-pinned-left-
|
|
43
|
-
"first-pinned-right-column": "_first-pinned-right-
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"table-
|
|
48
|
-
"table-
|
|
49
|
-
"table-header-cell-
|
|
310
|
+
"table-header-cell": "_table-header-cell_w7b9a_4",
|
|
311
|
+
"table-body-cell": "_table-body-cell_w7b9a_5",
|
|
312
|
+
"table-footer-cell": "_table-footer-cell_w7b9a_6",
|
|
313
|
+
"last-pinned-left-column": "_last-pinned-left-column_w7b9a_31",
|
|
314
|
+
"first-pinned-right-column": "_first-pinned-right-column_w7b9a_31",
|
|
315
|
+
"first-pinned-left-column": "_first-pinned-left-column_w7b9a_52",
|
|
316
|
+
"last-pinned-right-column": "_last-pinned-right-column_w7b9a_57",
|
|
317
|
+
"empty-cell": "_empty-cell_w7b9a_66",
|
|
318
|
+
"table-cell-internal-select": "_table-cell-internal-select_w7b9a_83",
|
|
319
|
+
"table-cell-internal-expand": "_table-cell-internal-expand_w7b9a_87",
|
|
320
|
+
"table-header-cell-sortable": "_table-header-cell-sortable_w7b9a_92",
|
|
321
|
+
"table-header-cell-interactive": "_table-header-cell-interactive_w7b9a_93",
|
|
322
|
+
"table-header-cell-group": "_table-header-cell-group_w7b9a_97"
|
|
50
323
|
};
|
|
51
324
|
|
|
52
325
|
const TableEmptyCellContent = () => {
|
|
@@ -647,15 +920,19 @@ function getColumnTypeDefaults(type) {
|
|
|
647
920
|
}
|
|
648
921
|
|
|
649
922
|
function createColumnHelper$1() {
|
|
650
|
-
|
|
923
|
+
function createColumn(id, column) {
|
|
651
924
|
if (typeof id === "object" && "group" in id) {
|
|
652
925
|
return {
|
|
653
926
|
id: id.group,
|
|
654
927
|
...column
|
|
655
928
|
};
|
|
656
929
|
}
|
|
657
|
-
return {
|
|
658
|
-
|
|
930
|
+
return {
|
|
931
|
+
id,
|
|
932
|
+
...column
|
|
933
|
+
};
|
|
934
|
+
}
|
|
935
|
+
return createColumn;
|
|
659
936
|
}
|
|
660
937
|
|
|
661
938
|
/**
|
|
@@ -4014,6 +4291,7 @@ function TableBody({ type, children, ...rest }) {
|
|
|
4014
4291
|
Element,
|
|
4015
4292
|
{
|
|
4016
4293
|
...rest,
|
|
4294
|
+
"data-anv": "table-body",
|
|
4017
4295
|
className: classes,
|
|
4018
4296
|
role: type === "simple" ? void 0 : "rowgroup",
|
|
4019
4297
|
children
|
|
@@ -4023,32 +4301,30 @@ function TableBody({ type, children, ...rest }) {
|
|
|
4023
4301
|
|
|
4024
4302
|
const getCommonPinningClasses = (column) => {
|
|
4025
4303
|
const isPinned = column.getIsPinned();
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
}
|
|
4304
|
+
if (!isPinned) return void 0;
|
|
4305
|
+
return cx({
|
|
4306
|
+
[styles$f["first-pinned-left-column"]]: isPinned === "left" && column.getIsFirstColumn("left"),
|
|
4307
|
+
[styles$f["last-pinned-left-column"]]: isPinned === "left" && column.getIsLastColumn("left"),
|
|
4308
|
+
[styles$f["first-pinned-right-column"]]: isPinned === "right" && column.getIsFirstColumn("right"),
|
|
4309
|
+
[styles$f["last-pinned-right-column"]]: isPinned === "right" && column.getIsLastColumn("right")
|
|
4310
|
+
});
|
|
4034
4311
|
};
|
|
4035
4312
|
|
|
4036
4313
|
const styles$a = {
|
|
4037
|
-
"data-table-body-cell-input": "_data-table-body-cell-
|
|
4038
|
-
"data-table-body-cell-editable": "_data-table-body-cell-
|
|
4039
|
-
"data-table-body-cell-edit-icon-container": "_data-table-body-cell-edit-icon-
|
|
4314
|
+
"data-table-body-cell-input": "_data-table-body-cell-input_1nano_4",
|
|
4315
|
+
"data-table-body-cell-editable": "_data-table-body-cell-editable_1nano_39",
|
|
4316
|
+
"data-table-body-cell-edit-icon-container": "_data-table-body-cell-edit-icon-container_1nano_39"
|
|
4040
4317
|
};
|
|
4041
4318
|
|
|
4042
4319
|
const DataTableEditableCellEditIcon = () => {
|
|
4043
|
-
return /* @__PURE__ */ jsx(
|
|
4044
|
-
|
|
4320
|
+
return /* @__PURE__ */ jsx(
|
|
4321
|
+
"span",
|
|
4045
4322
|
{
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
color: "subtle"
|
|
4049
|
-
"aria-label": "Edit cell value"
|
|
4323
|
+
className: styles$a["data-table-body-cell-edit-icon-container"],
|
|
4324
|
+
"aria-hidden": "true",
|
|
4325
|
+
children: /* @__PURE__ */ jsx(Icon, { svg: SvgEdit, size: "small", color: "subtle" })
|
|
4050
4326
|
}
|
|
4051
|
-
)
|
|
4327
|
+
);
|
|
4052
4328
|
};
|
|
4053
4329
|
|
|
4054
4330
|
const TableBodyCell = forwardRef(({ type, children, className, isExpandCell, isSelectCell, ...rest }, ref) => {
|
|
@@ -4072,19 +4348,19 @@ const TableBodyCell = forwardRef(({ type, children, className, isExpandCell, isS
|
|
|
4072
4348
|
TableBodyCell.displayName = "TableBodyCell";
|
|
4073
4349
|
|
|
4074
4350
|
const styles$9 = {
|
|
4075
|
-
"data-table-body-cell": "_data-table-body-
|
|
4076
|
-
"data-table-body-cell-input": "_data-table-body-cell-
|
|
4077
|
-
"table-body-cell": "_table-body-
|
|
4078
|
-
"table-header-cell": "_table-header-
|
|
4079
|
-
"table-footer-cell": "_table-footer-
|
|
4080
|
-
"data-table-cell-content": "_data-table-cell-
|
|
4081
|
-
"data-table-body-cell-editing": "_data-table-body-cell-
|
|
4082
|
-
"data-table-header-cell": "_data-table-header-
|
|
4083
|
-
"data-table-footer-cell": "_data-table-footer-
|
|
4084
|
-
"data-table-body-cell-error": "_data-table-body-cell-
|
|
4085
|
-
"data-table-body-cell-warning": "_data-table-body-cell-
|
|
4086
|
-
"cell-error-icon": "_cell-error-
|
|
4087
|
-
"cell-warning-icon": "_cell-warning-
|
|
4351
|
+
"data-table-body-cell": "_data-table-body-cell_1fjsi_4",
|
|
4352
|
+
"data-table-body-cell-input": "_data-table-body-cell-input_1fjsi_5",
|
|
4353
|
+
"table-body-cell": "_table-body-cell_1fjsi_10",
|
|
4354
|
+
"table-header-cell": "_table-header-cell_1fjsi_11",
|
|
4355
|
+
"table-footer-cell": "_table-footer-cell_1fjsi_12",
|
|
4356
|
+
"data-table-cell-content": "_data-table-cell-content_1fjsi_24",
|
|
4357
|
+
"data-table-body-cell-editing": "_data-table-body-cell-editing_1fjsi_49",
|
|
4358
|
+
"data-table-header-cell": "_data-table-header-cell_1fjsi_50",
|
|
4359
|
+
"data-table-footer-cell": "_data-table-footer-cell_1fjsi_53",
|
|
4360
|
+
"data-table-body-cell-error": "_data-table-body-cell-error_1fjsi_103",
|
|
4361
|
+
"data-table-body-cell-warning": "_data-table-body-cell-warning_1fjsi_118",
|
|
4362
|
+
"cell-error-icon": "_cell-error-icon_1fjsi_128",
|
|
4363
|
+
"cell-warning-icon": "_cell-warning-icon_1fjsi_133"
|
|
4088
4364
|
};
|
|
4089
4365
|
|
|
4090
4366
|
function formatCellPositionString(cellPosition) {
|
|
@@ -5352,6 +5628,496 @@ const DataTableEditableBooleanCell = Object.assign(
|
|
|
5352
5628
|
{ displayName: "DataTableEditableBooleanCell" }
|
|
5353
5629
|
);
|
|
5354
5630
|
|
|
5631
|
+
function isCustomDraftValueUpdater(nextValue) {
|
|
5632
|
+
return typeof nextValue === "function";
|
|
5633
|
+
}
|
|
5634
|
+
function isCustomFieldValueUpdater(nextValue) {
|
|
5635
|
+
return typeof nextValue === "function";
|
|
5636
|
+
}
|
|
5637
|
+
function deriveChangedFields(initialValue, draftValue) {
|
|
5638
|
+
const orderedKeys = Array.from(
|
|
5639
|
+
/* @__PURE__ */ new Set([...Object.keys(initialValue), ...Object.keys(draftValue)])
|
|
5640
|
+
);
|
|
5641
|
+
return orderedKeys.filter(
|
|
5642
|
+
(field) => !Object.is(initialValue[field], draftValue[field])
|
|
5643
|
+
);
|
|
5644
|
+
}
|
|
5645
|
+
function deriveValidation(validateDraft, draftValue, rowId) {
|
|
5646
|
+
return validateDraft?.(draftValue, rowId) ?? {};
|
|
5647
|
+
}
|
|
5648
|
+
function hasValidationErrors(validation) {
|
|
5649
|
+
if (validation.formError) {
|
|
5650
|
+
return true;
|
|
5651
|
+
}
|
|
5652
|
+
return Object.values(validation.fieldErrors ?? {}).some(
|
|
5653
|
+
(fieldError) => fieldError != null
|
|
5654
|
+
);
|
|
5655
|
+
}
|
|
5656
|
+
function useCustomEditControllerState({
|
|
5657
|
+
row,
|
|
5658
|
+
columnId,
|
|
5659
|
+
editConfig,
|
|
5660
|
+
onCloseEditor
|
|
5661
|
+
}) {
|
|
5662
|
+
const rowId = String(row.id);
|
|
5663
|
+
const initialValueRef = useRef(row[columnId]);
|
|
5664
|
+
const initialValue = initialValueRef.current;
|
|
5665
|
+
const [draftValue, setDraftValueState] = useState(initialValue);
|
|
5666
|
+
const draftValueRef = useRef(draftValue);
|
|
5667
|
+
const initialFocusRef = useRef(null);
|
|
5668
|
+
const getValidation = useCallback(
|
|
5669
|
+
(nextDraftValue) => deriveValidation(editConfig.validateDraft, nextDraftValue, rowId),
|
|
5670
|
+
[editConfig.validateDraft, rowId]
|
|
5671
|
+
);
|
|
5672
|
+
const setDraftValue = useCallback(
|
|
5673
|
+
(nextValue) => {
|
|
5674
|
+
let resolvedValue = draftValueRef.current;
|
|
5675
|
+
setDraftValueState((previousValue) => {
|
|
5676
|
+
resolvedValue = isCustomDraftValueUpdater(nextValue) ? nextValue(previousValue) : nextValue;
|
|
5677
|
+
draftValueRef.current = resolvedValue;
|
|
5678
|
+
return resolvedValue;
|
|
5679
|
+
});
|
|
5680
|
+
editConfig.onDraftUpdate?.(resolvedValue, rowId);
|
|
5681
|
+
return resolvedValue;
|
|
5682
|
+
},
|
|
5683
|
+
[editConfig, rowId]
|
|
5684
|
+
);
|
|
5685
|
+
const setDraftField = useCallback(
|
|
5686
|
+
(field, nextValue) => {
|
|
5687
|
+
return setDraftValue((previousValue) => ({
|
|
5688
|
+
...previousValue,
|
|
5689
|
+
[field]: isCustomFieldValueUpdater(nextValue) ? nextValue(previousValue[field], previousValue) : nextValue
|
|
5690
|
+
}));
|
|
5691
|
+
},
|
|
5692
|
+
[setDraftValue]
|
|
5693
|
+
);
|
|
5694
|
+
const performClose = useCallback(
|
|
5695
|
+
(reason, action) => {
|
|
5696
|
+
const currentDraftValue = draftValueRef.current;
|
|
5697
|
+
const validation2 = getValidation(currentDraftValue);
|
|
5698
|
+
const changedFields2 = deriveChangedFields(
|
|
5699
|
+
initialValue,
|
|
5700
|
+
currentDraftValue
|
|
5701
|
+
);
|
|
5702
|
+
const request = {
|
|
5703
|
+
reason,
|
|
5704
|
+
draftValue: currentDraftValue,
|
|
5705
|
+
initialValue,
|
|
5706
|
+
isDirty: changedFields2.length > 0,
|
|
5707
|
+
validation: validation2
|
|
5708
|
+
};
|
|
5709
|
+
if (action === "submit" && editConfig.blockOnValidationError === true && hasValidationErrors(validation2)) {
|
|
5710
|
+
return false;
|
|
5711
|
+
}
|
|
5712
|
+
if (editConfig.onRequestClose?.(request) === false) {
|
|
5713
|
+
return false;
|
|
5714
|
+
}
|
|
5715
|
+
if (action === "submit") {
|
|
5716
|
+
editConfig.onCommit(currentDraftValue, rowId);
|
|
5717
|
+
} else {
|
|
5718
|
+
draftValueRef.current = initialValue;
|
|
5719
|
+
setDraftValueState(initialValue);
|
|
5720
|
+
editConfig.onDraftUpdate?.(initialValue, rowId);
|
|
5721
|
+
}
|
|
5722
|
+
onCloseEditor?.();
|
|
5723
|
+
return true;
|
|
5724
|
+
},
|
|
5725
|
+
[editConfig, getValidation, initialValue, onCloseEditor, rowId]
|
|
5726
|
+
);
|
|
5727
|
+
const requestClose = useCallback(
|
|
5728
|
+
(reason) => {
|
|
5729
|
+
void performClose(reason, reason === "escape" ? "discard" : "submit");
|
|
5730
|
+
},
|
|
5731
|
+
[performClose]
|
|
5732
|
+
);
|
|
5733
|
+
const submit = useCallback(() => {
|
|
5734
|
+
void performClose("programmatic", "submit");
|
|
5735
|
+
}, [performClose]);
|
|
5736
|
+
const discard = useCallback(() => {
|
|
5737
|
+
void performClose("programmatic", "discard");
|
|
5738
|
+
}, [performClose]);
|
|
5739
|
+
const setInitialFocus = useCallback((focus) => {
|
|
5740
|
+
initialFocusRef.current = focus;
|
|
5741
|
+
}, []);
|
|
5742
|
+
const handleSubmit = useCallback(
|
|
5743
|
+
(event) => {
|
|
5744
|
+
event?.preventDefault?.();
|
|
5745
|
+
requestClose("submit");
|
|
5746
|
+
},
|
|
5747
|
+
[requestClose]
|
|
5748
|
+
);
|
|
5749
|
+
const changedFields = useMemo(
|
|
5750
|
+
() => deriveChangedFields(initialValue, draftValue),
|
|
5751
|
+
[draftValue, initialValue]
|
|
5752
|
+
);
|
|
5753
|
+
const validation = useMemo(
|
|
5754
|
+
() => getValidation(draftValue),
|
|
5755
|
+
[draftValue, getValidation]
|
|
5756
|
+
);
|
|
5757
|
+
const controller = useMemo(
|
|
5758
|
+
() => ({
|
|
5759
|
+
draftValue,
|
|
5760
|
+
initialValue,
|
|
5761
|
+
isDirty: changedFields.length > 0,
|
|
5762
|
+
changedFields,
|
|
5763
|
+
validation,
|
|
5764
|
+
setDraftValue,
|
|
5765
|
+
setDraftField,
|
|
5766
|
+
submit,
|
|
5767
|
+
discard,
|
|
5768
|
+
requestClose,
|
|
5769
|
+
setInitialFocus,
|
|
5770
|
+
handleSubmit
|
|
5771
|
+
}),
|
|
5772
|
+
[
|
|
5773
|
+
changedFields,
|
|
5774
|
+
discard,
|
|
5775
|
+
draftValue,
|
|
5776
|
+
handleSubmit,
|
|
5777
|
+
initialValue,
|
|
5778
|
+
requestClose,
|
|
5779
|
+
setDraftValue,
|
|
5780
|
+
setInitialFocus,
|
|
5781
|
+
setDraftField,
|
|
5782
|
+
submit,
|
|
5783
|
+
validation
|
|
5784
|
+
]
|
|
5785
|
+
);
|
|
5786
|
+
const runInitialFocus = useCallback(() => {
|
|
5787
|
+
initialFocusRef.current?.();
|
|
5788
|
+
}, []);
|
|
5789
|
+
return {
|
|
5790
|
+
controller,
|
|
5791
|
+
runInitialFocus
|
|
5792
|
+
};
|
|
5793
|
+
}
|
|
5794
|
+
|
|
5795
|
+
const NON_SUBMIT_INPUT_TYPES = /* @__PURE__ */ new Set([
|
|
5796
|
+
"button",
|
|
5797
|
+
"submit",
|
|
5798
|
+
"reset",
|
|
5799
|
+
"checkbox",
|
|
5800
|
+
"radio",
|
|
5801
|
+
"file"
|
|
5802
|
+
]);
|
|
5803
|
+
function isNativeInteractiveElement(target) {
|
|
5804
|
+
const interactiveSelector = [
|
|
5805
|
+
"button",
|
|
5806
|
+
"a[href]",
|
|
5807
|
+
"summary",
|
|
5808
|
+
"select",
|
|
5809
|
+
'input[type="button"]',
|
|
5810
|
+
'input[type="submit"]',
|
|
5811
|
+
'input[type="reset"]',
|
|
5812
|
+
'input[type="checkbox"]',
|
|
5813
|
+
'input[type="radio"]',
|
|
5814
|
+
'input[type="file"]'
|
|
5815
|
+
].join(", ");
|
|
5816
|
+
return Boolean(target.closest(interactiveSelector));
|
|
5817
|
+
}
|
|
5818
|
+
function isEnterOwnedByTextEntry(target) {
|
|
5819
|
+
if (target.isContentEditable || target.closest('[contenteditable="true"]')) {
|
|
5820
|
+
return false;
|
|
5821
|
+
}
|
|
5822
|
+
if (target instanceof HTMLTextAreaElement || target.closest("textarea")) {
|
|
5823
|
+
return false;
|
|
5824
|
+
}
|
|
5825
|
+
if (target.closest("select")) {
|
|
5826
|
+
return false;
|
|
5827
|
+
}
|
|
5828
|
+
if (target instanceof HTMLInputElement) {
|
|
5829
|
+
return !NON_SUBMIT_INPUT_TYPES.has(target.type);
|
|
5830
|
+
}
|
|
5831
|
+
const input = target.closest("input");
|
|
5832
|
+
if (input instanceof HTMLInputElement) {
|
|
5833
|
+
return !NON_SUBMIT_INPUT_TYPES.has(input.type);
|
|
5834
|
+
}
|
|
5835
|
+
return Boolean(
|
|
5836
|
+
target.closest(
|
|
5837
|
+
'input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="file"])'
|
|
5838
|
+
)
|
|
5839
|
+
);
|
|
5840
|
+
}
|
|
5841
|
+
function findSubmitForm(target) {
|
|
5842
|
+
return target.closest("form");
|
|
5843
|
+
}
|
|
5844
|
+
function getCustomEditorSubmitForm(target) {
|
|
5845
|
+
if (!(target instanceof HTMLElement)) {
|
|
5846
|
+
return null;
|
|
5847
|
+
}
|
|
5848
|
+
const interactiveRole = target.closest(
|
|
5849
|
+
'[role="button"], [role="link"], [role="menuitem"], [role="option"], [role="switch"], [role="checkbox"], [role="radio"], [role="tab"], [role="combobox"], [role="listbox"]'
|
|
5850
|
+
);
|
|
5851
|
+
if (interactiveRole || isNativeInteractiveElement(target)) {
|
|
5852
|
+
return null;
|
|
5853
|
+
}
|
|
5854
|
+
if (!isEnterOwnedByTextEntry(target)) {
|
|
5855
|
+
return null;
|
|
5856
|
+
}
|
|
5857
|
+
return findSubmitForm(target);
|
|
5858
|
+
}
|
|
5859
|
+
function CustomEditorContent({
|
|
5860
|
+
cell,
|
|
5861
|
+
columnId,
|
|
5862
|
+
editConfig,
|
|
5863
|
+
onControllerChange,
|
|
5864
|
+
onRequestCloseEditor
|
|
5865
|
+
}) {
|
|
5866
|
+
const row = cell.row.original;
|
|
5867
|
+
const rowId = String(cell.row.id);
|
|
5868
|
+
const { controller, runInitialFocus } = useCustomEditControllerState({
|
|
5869
|
+
row,
|
|
5870
|
+
columnId,
|
|
5871
|
+
editConfig,
|
|
5872
|
+
onCloseEditor: onRequestCloseEditor
|
|
5873
|
+
});
|
|
5874
|
+
useEffect(() => {
|
|
5875
|
+
onControllerChange(controller);
|
|
5876
|
+
return () => {
|
|
5877
|
+
onControllerChange(null);
|
|
5878
|
+
};
|
|
5879
|
+
}, [controller, onControllerChange]);
|
|
5880
|
+
useEffect(() => {
|
|
5881
|
+
const focusHandle = window.requestAnimationFrame(() => {
|
|
5882
|
+
runInitialFocus();
|
|
5883
|
+
});
|
|
5884
|
+
return () => {
|
|
5885
|
+
window.cancelAnimationFrame(focusHandle);
|
|
5886
|
+
};
|
|
5887
|
+
}, [runInitialFocus]);
|
|
5888
|
+
const renderContext = {
|
|
5889
|
+
row,
|
|
5890
|
+
rowId,
|
|
5891
|
+
value: row[columnId],
|
|
5892
|
+
controller
|
|
5893
|
+
};
|
|
5894
|
+
return /* @__PURE__ */ jsx(Fragment, { children: editConfig.renderEditor(renderContext) });
|
|
5895
|
+
}
|
|
5896
|
+
function DataTableEditableCustomCellInner(props, ref) {
|
|
5897
|
+
const { cell, cellProps, cellPosition, children } = props;
|
|
5898
|
+
const { onKeyDown: onCellKeyDown } = cellProps;
|
|
5899
|
+
const cellRef = useRef(null);
|
|
5900
|
+
const customEditControllerRef = useRef(null);
|
|
5901
|
+
const closeReasonRef = useRef(
|
|
5902
|
+
"outside-click"
|
|
5903
|
+
);
|
|
5904
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
5905
|
+
const [tabIndex, setTabIndex] = useState(-1);
|
|
5906
|
+
const { moveFocusToCell } = useDTFocusDispatchContext();
|
|
5907
|
+
const columnId = getColumnId(cell);
|
|
5908
|
+
const cellValue = getCellValue(cell);
|
|
5909
|
+
const meta = cell.column.columnDef.meta;
|
|
5910
|
+
const editConfig = meta?.editConfig;
|
|
5911
|
+
const customEditConfig = editConfig?.mode === "custom" ? editConfig : void 0;
|
|
5912
|
+
const isValidValueType = useMemo(() => {
|
|
5913
|
+
if (cellValue !== null && typeof cellValue === "object" && !Array.isArray(cellValue)) {
|
|
5914
|
+
return true;
|
|
5915
|
+
}
|
|
5916
|
+
logWarningForInvalidCellValueType({
|
|
5917
|
+
columnId: String(columnId),
|
|
5918
|
+
editMode: "custom",
|
|
5919
|
+
expectedType: "non-null object",
|
|
5920
|
+
receivedType: cellValue === null ? "null" : Array.isArray(cellValue) ? "array" : typeof cellValue
|
|
5921
|
+
});
|
|
5922
|
+
return false;
|
|
5923
|
+
}, [cellValue, columnId]);
|
|
5924
|
+
const surfaceId = useMemo(
|
|
5925
|
+
() => `data-table-custom-surface-${String(cell.id).replace(/[^a-zA-Z0-9_-]/g, "-")}`,
|
|
5926
|
+
[cell.id]
|
|
5927
|
+
);
|
|
5928
|
+
const cellInstructionsId = `${surfaceId}-cell-instructions`;
|
|
5929
|
+
const surfaceInstructionsId = `${surfaceId}-surface-instructions`;
|
|
5930
|
+
const defaultSurfaceTitle = String(
|
|
5931
|
+
cell.column.columnDef.meta?.columnDef?.header?.label ?? cell.column.columnDef.meta?.columnDef?.headerLabel ?? columnId
|
|
5932
|
+
);
|
|
5933
|
+
const surfaceTitle = customEditConfig?.surface?.title ?? null;
|
|
5934
|
+
const accessibleSurfaceLabel = `Edit ${defaultSurfaceTitle}`;
|
|
5935
|
+
const closeButtonLabel = customEditConfig?.surface?.closeButtonLabel ?? `Commit changes and close ${defaultSurfaceTitle} custom editable cell`;
|
|
5936
|
+
const beginEditing = useCallback(() => {
|
|
5937
|
+
setIsOpen(true);
|
|
5938
|
+
setTabIndex(0);
|
|
5939
|
+
moveFocusToCell(cellPosition);
|
|
5940
|
+
}, [cellPosition, moveFocusToCell]);
|
|
5941
|
+
const restoreFocusToOriginCell = useCallback(() => {
|
|
5942
|
+
window.requestAnimationFrame(() => {
|
|
5943
|
+
moveFocusToCell(cellPosition);
|
|
5944
|
+
cellRef.current?.focus();
|
|
5945
|
+
setTabIndex(0);
|
|
5946
|
+
});
|
|
5947
|
+
}, [cellPosition, moveFocusToCell]);
|
|
5948
|
+
const closeSurface = useCallback(() => {
|
|
5949
|
+
customEditControllerRef.current = null;
|
|
5950
|
+
setIsOpen(false);
|
|
5951
|
+
restoreFocusToOriginCell();
|
|
5952
|
+
}, [restoreFocusToOriginCell]);
|
|
5953
|
+
const handleSurfaceClose = useCallback(() => {
|
|
5954
|
+
const controller = customEditControllerRef.current;
|
|
5955
|
+
const reason = closeReasonRef.current;
|
|
5956
|
+
closeReasonRef.current = "outside-click";
|
|
5957
|
+
if (!controller) {
|
|
5958
|
+
return;
|
|
5959
|
+
}
|
|
5960
|
+
controller.requestClose(reason);
|
|
5961
|
+
}, []);
|
|
5962
|
+
const handleSurfaceCancel = useCallback(() => {
|
|
5963
|
+
customEditControllerRef.current?.requestClose("escape");
|
|
5964
|
+
}, []);
|
|
5965
|
+
const handleSurfaceClickCapture = useCallback(
|
|
5966
|
+
(event) => {
|
|
5967
|
+
if (event.target?.closest(
|
|
5968
|
+
'[data-anv="surface-close-button"]'
|
|
5969
|
+
)) {
|
|
5970
|
+
closeReasonRef.current = "close-button";
|
|
5971
|
+
}
|
|
5972
|
+
},
|
|
5973
|
+
[]
|
|
5974
|
+
);
|
|
5975
|
+
const handleSurfaceKeyDown = useCallback(
|
|
5976
|
+
(event) => {
|
|
5977
|
+
customEditConfig?.surface?.onKeyDown?.(event);
|
|
5978
|
+
if (event.defaultPrevented) {
|
|
5979
|
+
return;
|
|
5980
|
+
}
|
|
5981
|
+
const submitForm = getCustomEditorSubmitForm(event.target);
|
|
5982
|
+
if (event.key !== "Enter" || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey || "isComposing" in event && event.isComposing || !submitForm) {
|
|
5983
|
+
return;
|
|
5984
|
+
}
|
|
5985
|
+
event.preventDefault();
|
|
5986
|
+
event.stopPropagation();
|
|
5987
|
+
submitForm.requestSubmit();
|
|
5988
|
+
},
|
|
5989
|
+
[customEditConfig]
|
|
5990
|
+
);
|
|
5991
|
+
useImperativeHandle(
|
|
5992
|
+
ref,
|
|
5993
|
+
() => ({
|
|
5994
|
+
invoke: beginEditing,
|
|
5995
|
+
focus: () => {
|
|
5996
|
+
cellRef.current?.focus();
|
|
5997
|
+
setTabIndex(0);
|
|
5998
|
+
}
|
|
5999
|
+
}),
|
|
6000
|
+
[beginEditing]
|
|
6001
|
+
);
|
|
6002
|
+
const classes = cx(
|
|
6003
|
+
styles$a["data-table-body-cell-editable"],
|
|
6004
|
+
cellProps.className,
|
|
6005
|
+
{
|
|
6006
|
+
[styles$9["data-table-body-cell-editing"]]: isOpen
|
|
6007
|
+
}
|
|
6008
|
+
);
|
|
6009
|
+
const handleCellKeyDown = useCallback(
|
|
6010
|
+
(event) => {
|
|
6011
|
+
if (isOpen) {
|
|
6012
|
+
return;
|
|
6013
|
+
}
|
|
6014
|
+
onCellKeyDown?.(event);
|
|
6015
|
+
},
|
|
6016
|
+
[isOpen, onCellKeyDown]
|
|
6017
|
+
);
|
|
6018
|
+
const handleCellFocus = useCallback(
|
|
6019
|
+
(event) => {
|
|
6020
|
+
if (event.target !== cellRef.current) {
|
|
6021
|
+
return;
|
|
6022
|
+
}
|
|
6023
|
+
event.preventDefault();
|
|
6024
|
+
setTabIndex(0);
|
|
6025
|
+
},
|
|
6026
|
+
[]
|
|
6027
|
+
);
|
|
6028
|
+
const handleCellBlur = useCallback(
|
|
6029
|
+
(event) => {
|
|
6030
|
+
const nextTarget = event.relatedTarget;
|
|
6031
|
+
const surfaceElement = document.getElementById(surfaceId);
|
|
6032
|
+
if (nextTarget && cellRef.current?.contains(nextTarget) || nextTarget && surfaceElement?.contains(nextTarget)) {
|
|
6033
|
+
return;
|
|
6034
|
+
}
|
|
6035
|
+
setTabIndex(-1);
|
|
6036
|
+
},
|
|
6037
|
+
[surfaceId]
|
|
6038
|
+
);
|
|
6039
|
+
const handleCellPointerDown = useCallback(
|
|
6040
|
+
(event) => {
|
|
6041
|
+
if (event.pointerType === "mouse" && event.button !== 0) {
|
|
6042
|
+
return;
|
|
6043
|
+
}
|
|
6044
|
+
event.preventDefault();
|
|
6045
|
+
event.stopPropagation();
|
|
6046
|
+
beginEditing();
|
|
6047
|
+
},
|
|
6048
|
+
[beginEditing]
|
|
6049
|
+
);
|
|
6050
|
+
if (!isValidValueType || !customEditConfig) {
|
|
6051
|
+
const { cellProps: _cellProps, ...immutableCellProps } = props;
|
|
6052
|
+
return /* @__PURE__ */ jsx(DataTableBodyImmutableCell, { ...immutableCellProps });
|
|
6053
|
+
}
|
|
6054
|
+
return /* @__PURE__ */ jsxs(Surface, { id: surfaceId, open: isOpen, children: [
|
|
6055
|
+
/* @__PURE__ */ jsx(Surface.Trigger, { children: (triggerProps) => /* @__PURE__ */ jsxs(
|
|
6056
|
+
TableBodyCell,
|
|
6057
|
+
{
|
|
6058
|
+
ref: mergeRefs([
|
|
6059
|
+
triggerProps.ref,
|
|
6060
|
+
cellRef
|
|
6061
|
+
]),
|
|
6062
|
+
id: triggerProps.id,
|
|
6063
|
+
type: "data-table",
|
|
6064
|
+
className: classes,
|
|
6065
|
+
style: cellProps.style,
|
|
6066
|
+
tabIndex,
|
|
6067
|
+
onFocus: handleCellFocus,
|
|
6068
|
+
onBlur: handleCellBlur,
|
|
6069
|
+
onPointerDown: handleCellPointerDown,
|
|
6070
|
+
onKeyDown: handleCellKeyDown,
|
|
6071
|
+
"data-cell-pos": formatCellPositionString(cellPosition),
|
|
6072
|
+
"aria-controls": triggerProps["aria-controls"],
|
|
6073
|
+
"aria-expanded": triggerProps["aria-expanded"],
|
|
6074
|
+
"aria-haspopup": triggerProps["aria-haspopup"],
|
|
6075
|
+
"aria-describedby": cellInstructionsId,
|
|
6076
|
+
"data-state": triggerProps["data-state"],
|
|
6077
|
+
children: [
|
|
6078
|
+
children,
|
|
6079
|
+
!isOpen && /* @__PURE__ */ jsx(DataTableEditableCellEditIcon, {}),
|
|
6080
|
+
/* @__PURE__ */ jsx(SrOnly, { id: cellInstructionsId, children: isOpen ? "Custom editable cell editor is open. Press Escape to discard changes. Click outside, close the editor, or use editor controls to save current changes." : "Custom editable cell. Press Enter, Space, or F2 to open the editor." })
|
|
6081
|
+
]
|
|
6082
|
+
}
|
|
6083
|
+
) }),
|
|
6084
|
+
/* @__PURE__ */ jsxs(
|
|
6085
|
+
Surface.Content,
|
|
6086
|
+
{
|
|
6087
|
+
onClose: handleSurfaceClose,
|
|
6088
|
+
onCancel: handleSurfaceCancel,
|
|
6089
|
+
onClickCapture: handleSurfaceClickCapture,
|
|
6090
|
+
onKeyDown: handleSurfaceKeyDown,
|
|
6091
|
+
"aria-describedby": surfaceInstructionsId,
|
|
6092
|
+
...surfaceTitle ? {} : { "aria-label": accessibleSurfaceLabel },
|
|
6093
|
+
closeButtonLabel,
|
|
6094
|
+
title: surfaceTitle,
|
|
6095
|
+
width: customEditConfig.surface?.width,
|
|
6096
|
+
maxHeight: customEditConfig.surface?.maxHeight,
|
|
6097
|
+
children: [
|
|
6098
|
+
/* @__PURE__ */ jsx(SrOnly, { id: surfaceInstructionsId, children: "Custom editable cell dialog. Press Escape to discard changes. Clicking outside or the close button commits the current draft." }),
|
|
6099
|
+
isOpen ? /* @__PURE__ */ jsx(
|
|
6100
|
+
CustomEditorContent,
|
|
6101
|
+
{
|
|
6102
|
+
cell,
|
|
6103
|
+
columnId,
|
|
6104
|
+
editConfig: customEditConfig,
|
|
6105
|
+
onControllerChange: (controller) => {
|
|
6106
|
+
customEditControllerRef.current = controller;
|
|
6107
|
+
},
|
|
6108
|
+
onRequestCloseEditor: closeSurface
|
|
6109
|
+
}
|
|
6110
|
+
) : null
|
|
6111
|
+
]
|
|
6112
|
+
}
|
|
6113
|
+
)
|
|
6114
|
+
] });
|
|
6115
|
+
}
|
|
6116
|
+
const DataTableEditableCustomCell = Object.assign(
|
|
6117
|
+
forwardRef(DataTableEditableCustomCellInner),
|
|
6118
|
+
{ displayName: "DataTableEditableCustomCell" }
|
|
6119
|
+
);
|
|
6120
|
+
|
|
5355
6121
|
function DataTableBodyMutableCell(props) {
|
|
5356
6122
|
const { cell, cellPosition, children, ...rest } = props;
|
|
5357
6123
|
const editableCellRef = useRef(null);
|
|
@@ -5439,6 +6205,9 @@ function DataTableBodyMutableCell(props) {
|
|
|
5439
6205
|
if (editMode === "boolean") {
|
|
5440
6206
|
return DataTableEditableBooleanCell;
|
|
5441
6207
|
}
|
|
6208
|
+
if (editMode === "custom") {
|
|
6209
|
+
return DataTableEditableCustomCell;
|
|
6210
|
+
}
|
|
5442
6211
|
}, [editMode]);
|
|
5443
6212
|
if (!EditableComponent) {
|
|
5444
6213
|
return null;
|
|
@@ -5478,15 +6247,37 @@ function DataTableBodyCell(props) {
|
|
|
5478
6247
|
}
|
|
5479
6248
|
|
|
5480
6249
|
const styles$8 = {
|
|
5481
|
-
"data-table-body-row": "_data-table-body-
|
|
5482
|
-
"data-table-body-sub-component-row": "_data-table-body-sub-component-
|
|
5483
|
-
"data-table-body-virtualized": "_data-table-body-
|
|
5484
|
-
"data-table-body-row-virtualized": "_data-table-body-row-
|
|
5485
|
-
"data-table-body-sub-component-container": "_data-table-body-sub-component-
|
|
5486
|
-
"data-table-body-sub-component-content": "_data-table-body-sub-component-
|
|
5487
|
-
"data-table-body-cell-group": "_data-table-body-cell-
|
|
6250
|
+
"data-table-body-row": "_data-table-body-row_1aqzx_4",
|
|
6251
|
+
"data-table-body-sub-component-row": "_data-table-body-sub-component-row_1aqzx_24",
|
|
6252
|
+
"data-table-body-virtualized": "_data-table-body-virtualized_1aqzx_32",
|
|
6253
|
+
"data-table-body-row-virtualized": "_data-table-body-row-virtualized_1aqzx_38",
|
|
6254
|
+
"data-table-body-sub-component-container": "_data-table-body-sub-component-container_1aqzx_47",
|
|
6255
|
+
"data-table-body-sub-component-content": "_data-table-body-sub-component-content_1aqzx_53",
|
|
6256
|
+
"data-table-body-cell-group": "_data-table-body-cell-group_1aqzx_61",
|
|
6257
|
+
"data-table-body-cell-depth-indent": "_data-table-body-cell-depth-indent_1aqzx_71",
|
|
6258
|
+
"data-table-body-cell-action-depth-indent": "_data-table-body-cell-action-depth-indent_1aqzx_77",
|
|
6259
|
+
"data-table-body-row-activatable": "_data-table-body-row-activatable_1aqzx_90",
|
|
6260
|
+
"data-table-body-row-active": "_data-table-body-row-active_1aqzx_97",
|
|
6261
|
+
"data-table-body-row-ancestor-hovered": "_data-table-body-row-ancestor-hovered_1aqzx_108",
|
|
6262
|
+
"data-table-body-sub-component-row-active": "_data-table-body-sub-component-row-active_1aqzx_112",
|
|
6263
|
+
"data-table-body-row-read-only": "_data-table-body-row-read-only_1aqzx_116",
|
|
6264
|
+
"data-table-body-row-top-active": "_data-table-body-row-top-active_1aqzx_132"
|
|
5488
6265
|
};
|
|
5489
6266
|
|
|
6267
|
+
const ACTIVATE_IGNORE_SELECTOR = 'button, a, input, select, textarea, label, [role="button"], [role="checkbox"], [role="menuitem"], [data-anv="checkbox"], [class*="data-table-body-cell-editable"]';
|
|
6268
|
+
function collectDescendantIds(row) {
|
|
6269
|
+
const out = [];
|
|
6270
|
+
const stack = [...row.subRows ?? []];
|
|
6271
|
+
while (stack.length) {
|
|
6272
|
+
const current = stack.pop();
|
|
6273
|
+
if (!current) continue;
|
|
6274
|
+
out.push(current.id);
|
|
6275
|
+
if (current.subRows?.length) {
|
|
6276
|
+
stack.push(...current.subRows);
|
|
6277
|
+
}
|
|
6278
|
+
}
|
|
6279
|
+
return out;
|
|
6280
|
+
}
|
|
5490
6281
|
function DataTableBodyRowInner({
|
|
5491
6282
|
columnOrder,
|
|
5492
6283
|
row,
|
|
@@ -5495,40 +6286,128 @@ function DataTableBodyRowInner({
|
|
|
5495
6286
|
isExpanded,
|
|
5496
6287
|
canExpand,
|
|
5497
6288
|
depth,
|
|
5498
|
-
parentRowCanExpand
|
|
6289
|
+
parentRowCanExpand,
|
|
6290
|
+
isActivatable,
|
|
6291
|
+
isActive,
|
|
6292
|
+
isTopMostActive,
|
|
6293
|
+
isReadOnly,
|
|
6294
|
+
onToggleActive
|
|
5499
6295
|
}) {
|
|
5500
6296
|
const visibleCells = row.getVisibleCells();
|
|
5501
6297
|
const id = row.id;
|
|
5502
6298
|
const original = row.original;
|
|
5503
6299
|
const { focusSubComponent, blurSubComponent } = useDTFocusDispatchContext();
|
|
6300
|
+
const handleRowClick = useCallback(
|
|
6301
|
+
(event) => {
|
|
6302
|
+
if (!isActivatable) return;
|
|
6303
|
+
if (isReadOnly) return;
|
|
6304
|
+
const target = event.target;
|
|
6305
|
+
if (target?.closest(ACTIVATE_IGNORE_SELECTOR)) return;
|
|
6306
|
+
onToggleActive(
|
|
6307
|
+
row.id,
|
|
6308
|
+
collectDescendantIds(row)
|
|
6309
|
+
);
|
|
6310
|
+
},
|
|
6311
|
+
[isActivatable, isReadOnly, onToggleActive, row]
|
|
6312
|
+
);
|
|
6313
|
+
const shouldCascadeHover = isActivatable && canExpand;
|
|
6314
|
+
const handleMouseEnter = useCallback(
|
|
6315
|
+
(event) => {
|
|
6316
|
+
if (!shouldCascadeHover) return;
|
|
6317
|
+
const doc = event.currentTarget.ownerDocument ?? document;
|
|
6318
|
+
const className = styles$8["data-table-body-row-ancestor-hovered"];
|
|
6319
|
+
for (const descendantId of collectDescendantIds(row)) {
|
|
6320
|
+
const el = doc.querySelector(
|
|
6321
|
+
`[data-row-id="${CSS.escape(String(descendantId))}"]`
|
|
6322
|
+
);
|
|
6323
|
+
el?.classList.add(className);
|
|
6324
|
+
}
|
|
6325
|
+
},
|
|
6326
|
+
[shouldCascadeHover, row]
|
|
6327
|
+
);
|
|
6328
|
+
const handleMouseLeave = useCallback(
|
|
6329
|
+
(event) => {
|
|
6330
|
+
if (!shouldCascadeHover) return;
|
|
6331
|
+
const doc = event.currentTarget.ownerDocument ?? document;
|
|
6332
|
+
const className = styles$8["data-table-body-row-ancestor-hovered"];
|
|
6333
|
+
for (const descendantId of collectDescendantIds(row)) {
|
|
6334
|
+
const el = doc.querySelector(
|
|
6335
|
+
`[data-row-id="${CSS.escape(String(descendantId))}"]`
|
|
6336
|
+
);
|
|
6337
|
+
el?.classList.remove(className);
|
|
6338
|
+
}
|
|
6339
|
+
},
|
|
6340
|
+
[shouldCascadeHover, row]
|
|
6341
|
+
);
|
|
6342
|
+
const rowRef = useRef(null);
|
|
6343
|
+
useLayoutEffect(() => {
|
|
6344
|
+
const el = rowRef.current;
|
|
6345
|
+
if (!el) return;
|
|
6346
|
+
const ownerDoc = el.ownerDocument ?? document;
|
|
6347
|
+
const className = styles$8["data-table-body-row-ancestor-hovered"];
|
|
6348
|
+
let ancestor = row.getParentRow();
|
|
6349
|
+
while (ancestor) {
|
|
6350
|
+
const ancestorEl = ownerDoc.querySelector(
|
|
6351
|
+
`[data-row-id="${CSS.escape(String(ancestor.id))}"]`
|
|
6352
|
+
);
|
|
6353
|
+
if (ancestorEl?.matches(":hover")) {
|
|
6354
|
+
el.classList.add(className);
|
|
6355
|
+
return;
|
|
6356
|
+
}
|
|
6357
|
+
ancestor = ancestor.getParentRow();
|
|
6358
|
+
}
|
|
6359
|
+
}, [row]);
|
|
5504
6360
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
5505
6361
|
/* @__PURE__ */ jsx(
|
|
5506
6362
|
"div",
|
|
5507
6363
|
{
|
|
6364
|
+
ref: rowRef,
|
|
5508
6365
|
role: "row",
|
|
5509
6366
|
"aria-rowindex": rowIndex + 1,
|
|
5510
6367
|
"aria-expanded": tableHasSubRows && canExpand ? isExpanded : void 0,
|
|
5511
6368
|
"aria-level": tableHasSubRows && (canExpand || parentRowCanExpand) ? depth + 1 : void 0,
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
6369
|
+
"data-row-id": row.id,
|
|
6370
|
+
className: cx(styles$8["data-table-body-row"], {
|
|
6371
|
+
[styles$8["data-table-body-row-activatable"]]: isActivatable,
|
|
6372
|
+
[styles$8["data-table-body-row-active"]]: isActive,
|
|
6373
|
+
[styles$8["data-table-body-row-top-active"]]: isTopMostActive,
|
|
6374
|
+
[styles$8["data-table-body-row-read-only"]]: isReadOnly
|
|
6375
|
+
}),
|
|
6376
|
+
style: depth > 0 ? { "--a2-row-depth": depth } : void 0,
|
|
6377
|
+
onClick: isActivatable ? handleRowClick : void 0,
|
|
6378
|
+
onMouseEnter: shouldCascadeHover ? handleMouseEnter : void 0,
|
|
6379
|
+
onMouseLeave: shouldCascadeHover ? handleMouseLeave : void 0,
|
|
6380
|
+
children: (() => {
|
|
6381
|
+
let firstDataCellClaimed = false;
|
|
6382
|
+
return visibleCells.map((cell) => {
|
|
6383
|
+
const isLastInParentGroup = cell.column.parent ? cell.column.parent.getLeafColumns().slice(-1)[0] === cell.column : false;
|
|
6384
|
+
const isExpandColumn = cell.column.id === INTERNAL_ROW_ACTION_PRIMARY_COLUMN_ID;
|
|
6385
|
+
const isCheckboxColumn = cell.column.id === INTERNAL_ROW_ACTION_SECONDARY_COLUMN_ID;
|
|
6386
|
+
const isInternalActionColumn = isExpandColumn || isCheckboxColumn;
|
|
6387
|
+
const isFirstDataCell = !isInternalActionColumn && !firstDataCellClaimed;
|
|
6388
|
+
if (!isInternalActionColumn) {
|
|
6389
|
+
firstDataCellClaimed = true;
|
|
6390
|
+
}
|
|
6391
|
+
const cellClasses = cx(getCommonPinningClasses(cell.column), {
|
|
6392
|
+
[styles$8["data-table-body-cell-group"]]: "columns" in cell.column.columnDef || cell.column.parent && isLastInParentGroup,
|
|
6393
|
+
[styles$8["data-table-body-cell-depth-indent"]]: isFirstDataCell,
|
|
6394
|
+
[styles$8["data-table-body-cell-action-depth-indent"]]: isExpandColumn
|
|
6395
|
+
});
|
|
6396
|
+
const columnIndex = columnOrder.indexOf(cell.column.getIndex());
|
|
6397
|
+
return /* @__PURE__ */ jsx(
|
|
6398
|
+
DataTableBodyCell,
|
|
6399
|
+
{
|
|
6400
|
+
cell,
|
|
6401
|
+
cellPosition: { rowIndex, columnIndex },
|
|
6402
|
+
"aria-colindex": columnIndex + 1,
|
|
6403
|
+
className: cellClasses,
|
|
6404
|
+
"data-anv-column-id": cell.column.id,
|
|
6405
|
+
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
6406
|
+
},
|
|
6407
|
+
cell.id
|
|
6408
|
+
);
|
|
5517
6409
|
});
|
|
5518
|
-
|
|
5519
|
-
return /* @__PURE__ */ jsx(
|
|
5520
|
-
DataTableBodyCell,
|
|
5521
|
-
{
|
|
5522
|
-
cell,
|
|
5523
|
-
cellPosition: { rowIndex, columnIndex },
|
|
5524
|
-
"aria-colindex": columnIndex + 1,
|
|
5525
|
-
className: cellClasses,
|
|
5526
|
-
"data-anv-column-id": cell.column.id,
|
|
5527
|
-
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
5528
|
-
},
|
|
5529
|
-
cell.id
|
|
5530
|
-
);
|
|
5531
|
-
})
|
|
6410
|
+
})()
|
|
5532
6411
|
}
|
|
5533
6412
|
),
|
|
5534
6413
|
isExpanded && "subComponent" in original && /* @__PURE__ */ jsx(
|
|
@@ -5536,7 +6415,9 @@ function DataTableBodyRowInner({
|
|
|
5536
6415
|
{
|
|
5537
6416
|
id: `${id}-sub-component`,
|
|
5538
6417
|
"aria-hidden": !isExpanded,
|
|
5539
|
-
className: styles$8["data-table-body-sub-component-row"],
|
|
6418
|
+
className: cx(styles$8["data-table-body-sub-component-row"], {
|
|
6419
|
+
[styles$8["data-table-body-sub-component-row-active"]]: isActive
|
|
6420
|
+
}),
|
|
5540
6421
|
onFocus: () => {
|
|
5541
6422
|
focusSubComponent();
|
|
5542
6423
|
},
|
|
@@ -5553,7 +6434,7 @@ function areRowPropsEqual(prev, next) {
|
|
|
5553
6434
|
if (!getRowVersion) {
|
|
5554
6435
|
return false;
|
|
5555
6436
|
}
|
|
5556
|
-
return prev.row.id === next.row.id && getRowVersion(prev.row.original) === getRowVersion(next.row.original) && prev.rowIndex === next.rowIndex && prev.isExpanded === next.isExpanded && prev.canExpand === next.canExpand && prev.depth === next.depth && prev.parentRowCanExpand === next.parentRowCanExpand && prev.tableHasSubRows === next.tableHasSubRows && prev.columnOrder === next.columnOrder && prev.isSelected === next.isSelected && prev.isSomeSelected === next.isSomeSelected;
|
|
6437
|
+
return prev.row.id === next.row.id && getRowVersion(prev.row.original) === getRowVersion(next.row.original) && prev.rowIndex === next.rowIndex && prev.isExpanded === next.isExpanded && prev.canExpand === next.canExpand && prev.depth === next.depth && prev.parentRowCanExpand === next.parentRowCanExpand && prev.tableHasSubRows === next.tableHasSubRows && prev.columnOrder === next.columnOrder && prev.isSelected === next.isSelected && prev.isSomeSelected === next.isSomeSelected && prev.isActivatable === next.isActivatable && prev.isActive === next.isActive && prev.isTopMostActive === next.isTopMostActive && prev.isReadOnly === next.isReadOnly && prev.onToggleActive === next.onToggleActive;
|
|
5557
6438
|
}
|
|
5558
6439
|
const DataTableBodyRow = memo$1(
|
|
5559
6440
|
DataTableBodyRowInner,
|
|
@@ -5587,10 +6468,31 @@ const useColumnOrder = ({ table }) => {
|
|
|
5587
6468
|
};
|
|
5588
6469
|
};
|
|
5589
6470
|
|
|
6471
|
+
function getIsRowActivatable(row, isActivatable) {
|
|
6472
|
+
if (!isActivatable) return false;
|
|
6473
|
+
if (typeof isActivatable === "function") {
|
|
6474
|
+
return isActivatable(row.original);
|
|
6475
|
+
}
|
|
6476
|
+
return true;
|
|
6477
|
+
}
|
|
6478
|
+
function getIsRowTopMostActive(row, activeRowMap) {
|
|
6479
|
+
if (!activeRowMap[row.id]) return false;
|
|
6480
|
+
if (!row.getCanExpand()) return false;
|
|
6481
|
+
let ancestor = row.getParentRow();
|
|
6482
|
+
while (ancestor) {
|
|
6483
|
+
if (activeRowMap[ancestor.id]) return false;
|
|
6484
|
+
ancestor = ancestor.getParentRow();
|
|
6485
|
+
}
|
|
6486
|
+
return true;
|
|
6487
|
+
}
|
|
5590
6488
|
function NonVirtualizedContent({
|
|
5591
6489
|
table,
|
|
5592
6490
|
hasSubRows,
|
|
5593
|
-
getRowVersion
|
|
6491
|
+
getRowVersion,
|
|
6492
|
+
isActivatable,
|
|
6493
|
+
activeRowMap,
|
|
6494
|
+
readOnlyRowMap,
|
|
6495
|
+
onToggleActive
|
|
5594
6496
|
}) {
|
|
5595
6497
|
const { columnOrder } = useColumnOrder({ table });
|
|
5596
6498
|
const headerCount = table.getHeaderGroups().length;
|
|
@@ -5607,6 +6509,11 @@ function NonVirtualizedContent({
|
|
|
5607
6509
|
parentRowCanExpand: row.getParentRow()?.getCanExpand() ?? false,
|
|
5608
6510
|
isSelected: row.getIsSelected(),
|
|
5609
6511
|
isSomeSelected: row.getIsSomeSelected(),
|
|
6512
|
+
isActivatable: getIsRowActivatable(row, isActivatable),
|
|
6513
|
+
isActive: !!activeRowMap[row.id],
|
|
6514
|
+
isTopMostActive: getIsRowTopMostActive(row, activeRowMap),
|
|
6515
|
+
isReadOnly: !!readOnlyRowMap[row.id],
|
|
6516
|
+
onToggleActive,
|
|
5610
6517
|
getRowVersion
|
|
5611
6518
|
},
|
|
5612
6519
|
row.id
|
|
@@ -5616,7 +6523,11 @@ function VirtualizedContent({
|
|
|
5616
6523
|
table,
|
|
5617
6524
|
hasSubRows,
|
|
5618
6525
|
virtualizer,
|
|
5619
|
-
getRowVersion
|
|
6526
|
+
getRowVersion,
|
|
6527
|
+
isActivatable,
|
|
6528
|
+
activeRowMap,
|
|
6529
|
+
readOnlyRowMap,
|
|
6530
|
+
onToggleActive
|
|
5620
6531
|
}) {
|
|
5621
6532
|
const { columnOrder } = useColumnOrder({ table });
|
|
5622
6533
|
const headerCount = table.getHeaderGroups().length;
|
|
@@ -5657,6 +6568,11 @@ function VirtualizedContent({
|
|
|
5657
6568
|
parentRowCanExpand: row.getParentRow()?.getCanExpand() ?? false,
|
|
5658
6569
|
isSelected: row.getIsSelected(),
|
|
5659
6570
|
isSomeSelected: row.getIsSomeSelected(),
|
|
6571
|
+
isActivatable: getIsRowActivatable(row, isActivatable),
|
|
6572
|
+
isActive: !!activeRowMap[row.id],
|
|
6573
|
+
isTopMostActive: getIsRowTopMostActive(row, activeRowMap),
|
|
6574
|
+
isReadOnly: !!readOnlyRowMap[row.id],
|
|
6575
|
+
onToggleActive,
|
|
5660
6576
|
getRowVersion
|
|
5661
6577
|
}
|
|
5662
6578
|
)
|
|
@@ -5668,21 +6584,39 @@ function VirtualizedContent({
|
|
|
5668
6584
|
);
|
|
5669
6585
|
}
|
|
5670
6586
|
function DataTableBody(props) {
|
|
5671
|
-
const {
|
|
6587
|
+
const {
|
|
6588
|
+
table,
|
|
6589
|
+
hasSubRows,
|
|
6590
|
+
virtualizer,
|
|
6591
|
+
getRowVersion,
|
|
6592
|
+
isActivatable,
|
|
6593
|
+
activeRowMap,
|
|
6594
|
+
readOnlyRowMap,
|
|
6595
|
+
onToggleActive,
|
|
6596
|
+
...rest
|
|
6597
|
+
} = props;
|
|
5672
6598
|
return /* @__PURE__ */ jsx(TableBody, { type: "data-table", ...rest, children: virtualizer ? /* @__PURE__ */ jsx(
|
|
5673
6599
|
VirtualizedContent,
|
|
5674
6600
|
{
|
|
5675
6601
|
table,
|
|
5676
6602
|
hasSubRows,
|
|
5677
6603
|
virtualizer,
|
|
5678
|
-
getRowVersion
|
|
6604
|
+
getRowVersion,
|
|
6605
|
+
isActivatable,
|
|
6606
|
+
activeRowMap,
|
|
6607
|
+
readOnlyRowMap,
|
|
6608
|
+
onToggleActive
|
|
5679
6609
|
}
|
|
5680
6610
|
) : /* @__PURE__ */ jsx(
|
|
5681
6611
|
NonVirtualizedContent,
|
|
5682
6612
|
{
|
|
5683
6613
|
table,
|
|
5684
6614
|
hasSubRows,
|
|
5685
|
-
getRowVersion
|
|
6615
|
+
getRowVersion,
|
|
6616
|
+
isActivatable,
|
|
6617
|
+
activeRowMap,
|
|
6618
|
+
readOnlyRowMap,
|
|
6619
|
+
onToggleActive
|
|
5686
6620
|
}
|
|
5687
6621
|
) });
|
|
5688
6622
|
}
|
|
@@ -5985,7 +6919,29 @@ function CellStatus({ status, variant }) {
|
|
|
5985
6919
|
] });
|
|
5986
6920
|
}
|
|
5987
6921
|
|
|
5988
|
-
|
|
6922
|
+
function getColumnReadRenderResult({
|
|
6923
|
+
value,
|
|
6924
|
+
context,
|
|
6925
|
+
renderCell,
|
|
6926
|
+
getCellText,
|
|
6927
|
+
getReadRenderResult
|
|
6928
|
+
}) {
|
|
6929
|
+
if (getReadRenderResult) {
|
|
6930
|
+
return getReadRenderResult(value, context);
|
|
6931
|
+
}
|
|
6932
|
+
const rawString = getCellText?.(value, context);
|
|
6933
|
+
if (renderCell) {
|
|
6934
|
+
const content = renderCell(value, context);
|
|
6935
|
+
return {
|
|
6936
|
+
content,
|
|
6937
|
+
rawString: rawString ?? (typeof content === "string" ? content : void 0)
|
|
6938
|
+
};
|
|
6939
|
+
}
|
|
6940
|
+
return {
|
|
6941
|
+
content: renderRawCellValue(value),
|
|
6942
|
+
rawString: rawString ?? (typeof value === "string" ? value : void 0)
|
|
6943
|
+
};
|
|
6944
|
+
}
|
|
5989
6945
|
function resolveHeaderAlign(align, isGroup = false) {
|
|
5990
6946
|
if (isGroup) {
|
|
5991
6947
|
return "start";
|
|
@@ -6077,8 +7033,9 @@ function getTanStackColumnDef({
|
|
|
6077
7033
|
emptyCellContent
|
|
6078
7034
|
}) {
|
|
6079
7035
|
const normalizedHeader = normalizeColumnHeader(columnDef);
|
|
7036
|
+
const columnHelper = createColumnHelper();
|
|
6080
7037
|
if (columnDef.columns && columnDef.columns.length > 0) {
|
|
6081
|
-
return
|
|
7038
|
+
return columnHelper.group({
|
|
6082
7039
|
id: columnDef.id,
|
|
6083
7040
|
header: () => renderColumnHeader(normalizedHeader, {
|
|
6084
7041
|
align: columnDef.align,
|
|
@@ -6120,19 +7077,23 @@ function getTanStackColumnDef({
|
|
|
6120
7077
|
...columnDef,
|
|
6121
7078
|
headerLabel: normalizedHeader.label
|
|
6122
7079
|
};
|
|
6123
|
-
|
|
7080
|
+
const resolveReadRenderResult = (value, context) => getColumnReadRenderResult({
|
|
7081
|
+
value,
|
|
7082
|
+
context,
|
|
7083
|
+
renderCell: resolvedRenderCell,
|
|
7084
|
+
getCellText: columnDef.getCellText,
|
|
7085
|
+
getReadRenderResult: columnDef.getReadRenderResult
|
|
7086
|
+
});
|
|
7087
|
+
const shouldUseCustomReadStringSorting = columnDef.editConfig?.mode === "custom" && columnDef.sortable === true;
|
|
7088
|
+
return columnHelper.accessor((row) => row[columnDef.id], {
|
|
6124
7089
|
id: columnDef.id,
|
|
6125
7090
|
cell: (info) => {
|
|
6126
7091
|
const rawCellValue = info.row.original[columnDef.id];
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
});
|
|
6133
|
-
} else {
|
|
6134
|
-
cellContent = renderRawCellValue(rawCellValue);
|
|
6135
|
-
}
|
|
7092
|
+
const readRenderResult = resolveReadRenderResult(rawCellValue, {
|
|
7093
|
+
row: info.row.original,
|
|
7094
|
+
depth: info.row.depth
|
|
7095
|
+
});
|
|
7096
|
+
let cellContent = readRenderResult.content;
|
|
6136
7097
|
if (cellContent === "") {
|
|
6137
7098
|
cellContent = resolvedEmptyContent;
|
|
6138
7099
|
}
|
|
@@ -6168,16 +7129,39 @@ function getTanStackColumnDef({
|
|
|
6168
7129
|
editConfig: columnDef.editConfig,
|
|
6169
7130
|
columnDef: metaColumnDef,
|
|
6170
7131
|
// Store original for type narrowing
|
|
7132
|
+
getReadRenderResult: (value, context) => resolveReadRenderResult(value, context),
|
|
6171
7133
|
headerAlign: resolveHeaderAlign(resolvedAlign),
|
|
6172
7134
|
isGroupHeader: false
|
|
6173
7135
|
},
|
|
7136
|
+
...shouldUseCustomReadStringSorting ? {
|
|
7137
|
+
sortingFn: (rowA, rowB) => {
|
|
7138
|
+
const rawStringA = resolveReadRenderResult(
|
|
7139
|
+
rowA.original[columnDef.id],
|
|
7140
|
+
{
|
|
7141
|
+
row: rowA.original,
|
|
7142
|
+
depth: rowA.depth
|
|
7143
|
+
}
|
|
7144
|
+
).rawString;
|
|
7145
|
+
const rawStringB = resolveReadRenderResult(
|
|
7146
|
+
rowB.original[columnDef.id],
|
|
7147
|
+
{
|
|
7148
|
+
row: rowB.original,
|
|
7149
|
+
depth: rowB.depth
|
|
7150
|
+
}
|
|
7151
|
+
).rawString;
|
|
7152
|
+
if (typeof rawStringA !== "string" || typeof rawStringB !== "string") {
|
|
7153
|
+
return 0;
|
|
7154
|
+
}
|
|
7155
|
+
return rawStringA.localeCompare(rawStringB);
|
|
7156
|
+
}
|
|
7157
|
+
} : void 0,
|
|
6174
7158
|
// If custom sorting function is provided, use it
|
|
6175
7159
|
...columnDef.sortable && typeof columnDef.sortable === "function" ? {
|
|
6176
|
-
sortingFn: (rowA, rowB
|
|
7160
|
+
sortingFn: (rowA, rowB) => {
|
|
6177
7161
|
if (typeof columnDef.sortable === "function") {
|
|
6178
7162
|
return columnDef.sortable(
|
|
6179
|
-
rowA.
|
|
6180
|
-
rowB.
|
|
7163
|
+
rowA.original[columnDef.id],
|
|
7164
|
+
rowB.original[columnDef.id]
|
|
6181
7165
|
);
|
|
6182
7166
|
}
|
|
6183
7167
|
return 0;
|
|
@@ -6638,7 +7622,7 @@ const TableContainer = forwardRef(
|
|
|
6638
7622
|
);
|
|
6639
7623
|
TableContainer.displayName = "TableContainer";
|
|
6640
7624
|
|
|
6641
|
-
const pagination = "
|
|
7625
|
+
const pagination = "_pagination_n9r8d_4";
|
|
6642
7626
|
const styles$1 = {
|
|
6643
7627
|
pagination: pagination
|
|
6644
7628
|
};
|
|
@@ -6771,6 +7755,8 @@ function scrollCellIntoView(element, stickyDimensions) {
|
|
|
6771
7755
|
leftWidth: stickyDimensions.leftWidth,
|
|
6772
7756
|
rightWidth: stickyDimensions.rightWidth
|
|
6773
7757
|
};
|
|
7758
|
+
const cellStyle = window.getComputedStyle(element);
|
|
7759
|
+
const isHorizontallySticky = cellStyle.position === "sticky" && (cellStyle.left !== "auto" || cellStyle.right !== "auto");
|
|
6774
7760
|
const elementRect = element.getBoundingClientRect();
|
|
6775
7761
|
const scrollContainerRect = scrollContainer.getBoundingClientRect();
|
|
6776
7762
|
const contentWidth = scrollContainer.clientWidth;
|
|
@@ -6782,6 +7768,7 @@ function scrollCellIntoView(element, stickyDimensions) {
|
|
|
6782
7768
|
const isFullyVisible = elementRect.x >= visibleLeft && elementRect.x + elementRect.width <= visibleRight && (isBodyCell ? elementRect.y >= visibleTop && elementRect.y + elementRect.height <= visibleBottom : true);
|
|
6783
7769
|
if (isFullyVisible) return;
|
|
6784
7770
|
const getScrollByLeft = () => {
|
|
7771
|
+
if (isHorizontallySticky) return 0;
|
|
6785
7772
|
if (elementRect.x < visibleLeft) {
|
|
6786
7773
|
return elementRect.x - visibleLeft;
|
|
6787
7774
|
}
|
|
@@ -7039,14 +8026,15 @@ function DTFocusProvider({
|
|
|
7039
8026
|
return /* @__PURE__ */ jsx(DTFocusStateContext.Provider, { value: state, children: /* @__PURE__ */ jsx(DTFocusDispatchContext.Provider, { value: dispatch, children }) });
|
|
7040
8027
|
}
|
|
7041
8028
|
|
|
7042
|
-
const VIRTUALIZATION_THRESHOLD =
|
|
8029
|
+
const VIRTUALIZATION_THRESHOLD = 50;
|
|
7043
8030
|
const DEFAULT_ESTIMATED_ROW_HEIGHT = 35;
|
|
7044
8031
|
function useDataTableVirtualizer({
|
|
7045
8032
|
rowCount,
|
|
7046
8033
|
scrollRef,
|
|
7047
|
-
disabled
|
|
8034
|
+
disabled,
|
|
8035
|
+
forced
|
|
7048
8036
|
}) {
|
|
7049
|
-
const shouldVirtualize = !disabled && rowCount >= VIRTUALIZATION_THRESHOLD;
|
|
8037
|
+
const shouldVirtualize = !disabled && (forced || rowCount >= VIRTUALIZATION_THRESHOLD);
|
|
7050
8038
|
const virtualizer = useVirtualizer({
|
|
7051
8039
|
count: shouldVirtualize ? rowCount : 0,
|
|
7052
8040
|
// `scrollRef` points at the outer TableContainer div, which does not
|
|
@@ -7078,14 +8066,19 @@ function DataTableInner(props, ref) {
|
|
|
7078
8066
|
data: dataProp,
|
|
7079
8067
|
columns: columnsProp,
|
|
7080
8068
|
customFooter,
|
|
8069
|
+
defaultActiveRowIds,
|
|
7081
8070
|
defaultExpandedRowIds,
|
|
7082
8071
|
defaultSelectedRowIds,
|
|
7083
8072
|
defaultSortedColumn,
|
|
7084
8073
|
disableExpandAll,
|
|
7085
8074
|
disableSelectAll,
|
|
7086
8075
|
expandedRowIds,
|
|
8076
|
+
activeRowIds,
|
|
8077
|
+
isActivatable,
|
|
7087
8078
|
isSelectable,
|
|
8079
|
+
onActivateRow,
|
|
7088
8080
|
onSelectRow,
|
|
8081
|
+
readOnlyRowIds,
|
|
7089
8082
|
onSort,
|
|
7090
8083
|
onExpandRow,
|
|
7091
8084
|
pagination,
|
|
@@ -7094,6 +8087,7 @@ function DataTableInner(props, ref) {
|
|
|
7094
8087
|
emptyState,
|
|
7095
8088
|
emptyCellContent,
|
|
7096
8089
|
disableVirtualization,
|
|
8090
|
+
forceVirtualization,
|
|
7097
8091
|
getRowVersion,
|
|
7098
8092
|
className,
|
|
7099
8093
|
style,
|
|
@@ -7104,6 +8098,7 @@ function DataTableInner(props, ref) {
|
|
|
7104
8098
|
...layoutStyles
|
|
7105
8099
|
};
|
|
7106
8100
|
const tableRef = useRef(null);
|
|
8101
|
+
const lastBodyHeightRef = useRef(null);
|
|
7107
8102
|
const [rowSelection, setRowSelection] = useOptionallyControlledState({
|
|
7108
8103
|
controlledValue: isSelectable && selectedRowIds ? Object.fromEntries(selectedRowIds.map((id) => [id, true])) : void 0,
|
|
7109
8104
|
defaultValue: isSelectable ? defaultSelectedRowIds ? Object.fromEntries(defaultSelectedRowIds.map((id) => [id, true])) : {} : {},
|
|
@@ -7111,6 +8106,41 @@ function DataTableInner(props, ref) {
|
|
|
7111
8106
|
onSelectRow?.(Object.keys(newRowSelection));
|
|
7112
8107
|
}
|
|
7113
8108
|
});
|
|
8109
|
+
const [rowActivation, setRowActivation] = useOptionallyControlledState({
|
|
8110
|
+
controlledValue: isActivatable && activeRowIds ? Object.fromEntries(activeRowIds.map((id) => [id, true])) : void 0,
|
|
8111
|
+
defaultValue: isActivatable ? defaultActiveRowIds ? Object.fromEntries(defaultActiveRowIds.map((id) => [id, true])) : {} : {},
|
|
8112
|
+
onChange: (newRowActivation) => {
|
|
8113
|
+
onActivateRow?.(Object.keys(newRowActivation));
|
|
8114
|
+
}
|
|
8115
|
+
});
|
|
8116
|
+
const activeRowMap = rowActivation ?? {};
|
|
8117
|
+
const readOnlyRowMap = useMemo(
|
|
8118
|
+
() => readOnlyRowIds ? Object.fromEntries(readOnlyRowIds.map((id) => [String(id), true])) : {},
|
|
8119
|
+
[readOnlyRowIds]
|
|
8120
|
+
);
|
|
8121
|
+
const setRowActivationRef = useRef(setRowActivation);
|
|
8122
|
+
setRowActivationRef.current = setRowActivation;
|
|
8123
|
+
const toggleRowActivation = useCallback(
|
|
8124
|
+
(rowId, descendantIds = []) => {
|
|
8125
|
+
setRowActivationRef.current((prev) => {
|
|
8126
|
+
const prevMap = prev ?? {};
|
|
8127
|
+
const rowKey = String(rowId);
|
|
8128
|
+
const descendantKeys = descendantIds.map(String);
|
|
8129
|
+
const next = { ...prevMap };
|
|
8130
|
+
if (prevMap[rowKey]) {
|
|
8131
|
+
delete next[rowKey];
|
|
8132
|
+
descendantKeys.forEach((key) => delete next[key]);
|
|
8133
|
+
} else {
|
|
8134
|
+
next[rowKey] = true;
|
|
8135
|
+
descendantKeys.forEach((key) => {
|
|
8136
|
+
next[key] = true;
|
|
8137
|
+
});
|
|
8138
|
+
}
|
|
8139
|
+
return next;
|
|
8140
|
+
});
|
|
8141
|
+
},
|
|
8142
|
+
[]
|
|
8143
|
+
);
|
|
7114
8144
|
const [sorting, setSorting] = useOptionallyControlledState({
|
|
7115
8145
|
controlledValue: sortedColumn ? [sortedColumn] : void 0,
|
|
7116
8146
|
defaultValue: defaultSortedColumn ? [defaultSortedColumn] : void 0,
|
|
@@ -7204,6 +8234,15 @@ function DataTableInner(props, ref) {
|
|
|
7204
8234
|
}
|
|
7205
8235
|
});
|
|
7206
8236
|
const tableData = isLoading ? EMPTY_DATA : resolvedData;
|
|
8237
|
+
useLayoutEffect(() => {
|
|
8238
|
+
if (isLoading) return;
|
|
8239
|
+
const body = tableRef.current?.querySelector(
|
|
8240
|
+
'[data-anv="table-body"]'
|
|
8241
|
+
);
|
|
8242
|
+
if (body && body.offsetHeight > 0) {
|
|
8243
|
+
lastBodyHeightRef.current = body.offsetHeight;
|
|
8244
|
+
}
|
|
8245
|
+
}, [isLoading]);
|
|
7207
8246
|
const hasRowStatus = useMemo(() => {
|
|
7208
8247
|
return tableData?.some((row) => {
|
|
7209
8248
|
const meta = row.meta;
|
|
@@ -7300,20 +8339,8 @@ function DataTableInner(props, ref) {
|
|
|
7300
8339
|
"data-cell-action": "expand"
|
|
7301
8340
|
}
|
|
7302
8341
|
);
|
|
7303
|
-
} else if (row.getParentRow()?.getCanExpand() && isSelectable) {
|
|
7304
|
-
return /* @__PURE__ */ jsx(
|
|
7305
|
-
Checkbox,
|
|
7306
|
-
{
|
|
7307
|
-
tabIndex: -1,
|
|
7308
|
-
"aria-label": row.getIsSelected() ? "Deselect row" : "Select row",
|
|
7309
|
-
checked: row.getIsSelected(),
|
|
7310
|
-
disabled: !row.getCanSelect(),
|
|
7311
|
-
indeterminate: row.getIsSomeSelected(),
|
|
7312
|
-
onChange: row.getToggleSelectedHandler(),
|
|
7313
|
-
"data-cell-action": "select"
|
|
7314
|
-
}
|
|
7315
|
-
);
|
|
7316
8342
|
}
|
|
8343
|
+
return null;
|
|
7317
8344
|
}
|
|
7318
8345
|
});
|
|
7319
8346
|
}
|
|
@@ -7338,23 +8365,18 @@ function DataTableInner(props, ref) {
|
|
|
7338
8365
|
}
|
|
7339
8366
|
) });
|
|
7340
8367
|
},
|
|
7341
|
-
cell: ({ row }) =>
|
|
7342
|
-
|
|
7343
|
-
|
|
8368
|
+
cell: ({ row }) => /* @__PURE__ */ jsx(
|
|
8369
|
+
Checkbox,
|
|
8370
|
+
{
|
|
8371
|
+
tabIndex: -1,
|
|
8372
|
+
"aria-label": row.getIsSelected() ? "Deselect row" : "Select row",
|
|
8373
|
+
checked: row.getIsSelected(),
|
|
8374
|
+
disabled: !row.getCanSelect(),
|
|
8375
|
+
indeterminate: row.getIsSomeSelected(),
|
|
8376
|
+
onChange: row.getToggleSelectedHandler(),
|
|
8377
|
+
"data-cell-action": "select"
|
|
7344
8378
|
}
|
|
7345
|
-
|
|
7346
|
-
Checkbox,
|
|
7347
|
-
{
|
|
7348
|
-
tabIndex: -1,
|
|
7349
|
-
"aria-label": row.getIsSelected() ? "Deselect row" : "Select row",
|
|
7350
|
-
checked: row.getIsSelected(),
|
|
7351
|
-
disabled: !row.getCanSelect(),
|
|
7352
|
-
indeterminate: row.getIsSomeSelected(),
|
|
7353
|
-
onChange: row.getToggleSelectedHandler(),
|
|
7354
|
-
"data-cell-action": "select"
|
|
7355
|
-
}
|
|
7356
|
-
);
|
|
7357
|
-
}
|
|
8379
|
+
)
|
|
7358
8380
|
});
|
|
7359
8381
|
}
|
|
7360
8382
|
return tableColumns;
|
|
@@ -7399,7 +8421,11 @@ function DataTableInner(props, ref) {
|
|
|
7399
8421
|
manualSorting: isAsyncPaginated,
|
|
7400
8422
|
autoResetPageIndex: false,
|
|
7401
8423
|
columnResizeMode: "onChange",
|
|
7402
|
-
enableRowSelection:
|
|
8424
|
+
enableRowSelection: !isSelectable ? false : (row) => {
|
|
8425
|
+
const original = row.original;
|
|
8426
|
+
if (readOnlyRowMap[String(original.id)]) return false;
|
|
8427
|
+
return typeof isSelectable === "function" ? isSelectable(original) : true;
|
|
8428
|
+
},
|
|
7403
8429
|
onRowSelectionChange: (newRowSelection) => {
|
|
7404
8430
|
setRowSelection(newRowSelection);
|
|
7405
8431
|
},
|
|
@@ -7420,7 +8446,8 @@ function DataTableInner(props, ref) {
|
|
|
7420
8446
|
const rowVirtualizer = useDataTableVirtualizer({
|
|
7421
8447
|
rowCount: table.getRowModel().rows.length,
|
|
7422
8448
|
scrollRef: tableRef,
|
|
7423
|
-
disabled: disableVirtualization
|
|
8449
|
+
disabled: disableVirtualization,
|
|
8450
|
+
forced: forceVirtualization
|
|
7424
8451
|
});
|
|
7425
8452
|
const headers = table.getFlatHeaders();
|
|
7426
8453
|
const headerRowCount = table.getHeaderGroups().length;
|
|
@@ -7530,7 +8557,11 @@ function DataTableInner(props, ref) {
|
|
|
7530
8557
|
table,
|
|
7531
8558
|
hasSubRows,
|
|
7532
8559
|
virtualizer: rowVirtualizer,
|
|
7533
|
-
getRowVersion
|
|
8560
|
+
getRowVersion,
|
|
8561
|
+
isActivatable,
|
|
8562
|
+
activeRowMap,
|
|
8563
|
+
readOnlyRowMap,
|
|
8564
|
+
onToggleActive: toggleRowActivation
|
|
7534
8565
|
}
|
|
7535
8566
|
),
|
|
7536
8567
|
isEmpty && emptyState && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -7555,7 +8586,7 @@ function DataTableInner(props, ref) {
|
|
|
7555
8586
|
"div",
|
|
7556
8587
|
{
|
|
7557
8588
|
style: {
|
|
7558
|
-
height: rowsPerPage ?
|
|
8589
|
+
height: `${lastBodyHeightRef.current ?? (rowsPerPage ? rowsPerPage * 35 : 200)}px`
|
|
7559
8590
|
},
|
|
7560
8591
|
role: "presentation",
|
|
7561
8592
|
"aria-hidden": "true",
|
|
@@ -7616,4 +8647,4 @@ function DataTableInner(props, ref) {
|
|
|
7616
8647
|
const DataTable = forwardRef(DataTableInner);
|
|
7617
8648
|
|
|
7618
8649
|
export { COLUMN_TYPE_DEFAULTS as C, DataTable as D, chipsFormatter as a, booleanFormatter as b, createColumnHelper$1 as c, currencyFormatter as d, dateFormatter as e, dateTimeFormatter as f, getColumnTypeDefaults as g, htmlFormatter as h, dateFormatPresets as i, timeFormatter as j, markdownFormatter as m, numberFormatter as n, percentFormatter as p, resolveColumnTypeConfig as r, timeFormatPresets as t, yearlessDateFormatter as y };
|
|
7619
|
-
//# sourceMappingURL=DataTable-
|
|
8650
|
+
//# sourceMappingURL=DataTable-CB-exG-7.js.map
|