@servicetitan/anvil2 3.16.1 → 3.18.0
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 +88 -0
- package/dist/{AiMark-BfmK30vL.js → AiMark-Ca7WmL-9.js} +114 -33
- package/dist/AiMark-Ca7WmL-9.js.map +1 -0
- package/dist/AiMark.js +1 -1
- package/dist/{Alert-lLo1N7Tj.js → Alert-BOqBFMUV.js} +3 -3
- package/dist/{Alert-lLo1N7Tj.js.map → Alert-BOqBFMUV.js.map} +1 -1
- package/dist/Alert.js +1 -1
- package/dist/{Announcement-PfnsVVz1.js → Announcement-AN9HnhZ-.js} +2 -2
- package/dist/{Announcement-PfnsVVz1.js.map → Announcement-AN9HnhZ-.js.map} +1 -1
- package/dist/Announcement.js +1 -1
- package/dist/{AnvilProvider-DagOuc9c.js → AnvilProvider-BVTxXzoS.js} +3 -3
- package/dist/{AnvilProvider-DagOuc9c.js.map → AnvilProvider-BVTxXzoS.js.map} +1 -1
- package/dist/AnvilProvider.js +1 -1
- package/dist/{Breadcrumbs-RdL4Fvmu.js → Breadcrumbs-1MCqy-gU.js} +2 -2
- package/dist/{Breadcrumbs-RdL4Fvmu.js.map → Breadcrumbs-1MCqy-gU.js.map} +1 -1
- package/dist/Breadcrumbs.js +1 -1
- package/dist/{Button-Dn6-01xl.js → Button-B_E6ybA-.js} +3 -3
- package/dist/{Button-Dn6-01xl.js.map → Button-B_E6ybA-.js.map} +1 -1
- package/dist/Button.js +1 -1
- package/dist/{ButtonToggle-BSU8GBxr.js → ButtonToggle-D0eXySEM.js} +2 -2
- package/dist/{ButtonToggle-BSU8GBxr.js.map → ButtonToggle-D0eXySEM.js.map} +1 -1
- package/dist/ButtonToggle.js +1 -1
- package/dist/{luxon-wpz4A-OQ.js → Calendar-BcsuV4Xv.js} +1761 -3
- package/dist/Calendar-BcsuV4Xv.js.map +1 -0
- package/dist/{Calendar-DoLRAWLp.js → Calendar-oBRbQqnG.js} +2 -2
- package/dist/{Calendar-DoLRAWLp.js.map → Calendar-oBRbQqnG.js.map} +1 -1
- package/dist/Calendar.js +2 -2
- package/dist/{Checkbox-U-kuWhgc.js → Checkbox-BCaUzwF_.js} +2 -2
- package/dist/{Checkbox-U-kuWhgc.js.map → Checkbox-BCaUzwF_.js.map} +1 -1
- package/dist/{Checkbox-CVxbe-iN.js → Checkbox-BocPrjKC.js} +4 -4
- package/dist/{Checkbox-CVxbe-iN.js.map → Checkbox-BocPrjKC.js.map} +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/{Chip-2OydLs66.js → Chip-BWqgUX71.js} +11 -24
- package/dist/Chip-BWqgUX71.js.map +1 -0
- package/dist/Chip.js +1 -1
- package/dist/Combobox.js +1 -1
- package/dist/{DataTable-DIXP9-Bx.js → DataTableEditColumnsDrawer-C7OHRsJU.js} +1373 -289
- package/dist/DataTableEditColumnsDrawer-C7OHRsJU.js.map +1 -0
- package/dist/{DataTable.css → DataTableEditColumnsDrawer.css} +90 -33
- package/dist/{DateFieldRange-X2jdOTYY.js → DateFieldRange-BPcsS6TW.js} +6 -7
- package/dist/{DateFieldRange-X2jdOTYY.js.map → DateFieldRange-BPcsS6TW.js.map} +1 -1
- package/dist/DateFieldRange.js +1 -1
- package/dist/{DateFieldSingle-BJ16tpOz.js → DateFieldSingle-BRMhe0OM.js} +6 -7
- package/dist/{DateFieldSingle-BJ16tpOz.js.map → DateFieldSingle-BRMhe0OM.js.map} +1 -1
- package/dist/DateFieldSingle.js +1 -1
- package/dist/{DateFieldYearless-CMm8vtz_.js → DateFieldYearless-NOgDKzrJ.js} +6 -6
- package/dist/{DateFieldYearless-CMm8vtz_.js.map → DateFieldYearless-NOgDKzrJ.js.map} +1 -1
- package/dist/DateFieldYearless.js +1 -1
- package/dist/{DateFieldYearlessRange-BHHs-Z1Q.js → DateFieldYearlessRange-ChvypgXC.js} +5 -5
- package/dist/{DateFieldYearlessRange-BHHs-Z1Q.js.map → DateFieldYearlessRange-ChvypgXC.js.map} +1 -1
- package/dist/DateFieldYearlessRange.js +1 -1
- package/dist/{DaysOfTheWeek-BHXxs0Bo.js → DaysOfTheWeek-nYitIKnQ.js} +4 -4
- package/dist/{DaysOfTheWeek-BHXxs0Bo.js.map → DaysOfTheWeek-nYitIKnQ.js.map} +1 -1
- package/dist/DaysOfTheWeek.js +1 -1
- package/dist/Details-B2F3auTX.js +216 -0
- package/dist/Details-B2F3auTX.js.map +1 -0
- package/dist/{Details-BxqP-5vp.js → Details-DQ-_Mg4o.js} +3 -3
- package/dist/{Details-BxqP-5vp.js.map → Details-DQ-_Mg4o.js.map} +1 -1
- package/dist/Details.css +92 -68
- package/dist/Details.js +1 -1
- package/dist/Details2.css +137 -0
- package/dist/{Dialog-_tHqOsbr.js → Dialog-BgWoV2on.js} +10 -7
- package/dist/Dialog-BgWoV2on.js.map +1 -0
- package/dist/Dialog.js +1 -1
- package/dist/{DialogCancelButton-C0r8hJ8Z.js → DialogCancelButton-CplrFu69.js} +2 -2
- package/dist/{DialogCancelButton-C0r8hJ8Z.js.map → DialogCancelButton-CplrFu69.js.map} +1 -1
- package/dist/Dnd.js +2 -2
- package/dist/{DndHandleButton-BRlodkDO.js → DndHandleButton-BJqj2hc0.js} +6 -4
- package/dist/DndHandleButton-BJqj2hc0.js.map +1 -0
- package/dist/DndSort.js +2 -2
- package/dist/{Drawer-D-ThWNp0.js → Drawer-BVBLtGn_.js} +12 -9
- package/dist/Drawer-BVBLtGn_.js.map +1 -0
- package/dist/Drawer.js +1 -1
- package/dist/DrillDown.css +41 -34
- package/dist/DrillDown.js +1 -1
- package/dist/DrillDown.module-BFE5BcJB.js +28 -0
- package/dist/DrillDown.module-BFE5BcJB.js.map +1 -0
- package/dist/{EditCard-B6l2vhBS.js → EditCard-hivZDPZh.js} +3 -3
- package/dist/{EditCard-B6l2vhBS.js.map → EditCard-hivZDPZh.js.map} +1 -1
- package/dist/EditCard.js +1 -1
- package/dist/{FieldLabel-ThEmUiAq.js → FieldLabel-Cn559Brf.js} +8 -58
- package/dist/FieldLabel-Cn559Brf.js.map +1 -0
- package/dist/FieldLabel.css +1 -12
- package/dist/FieldLabel.js +1 -1
- package/dist/FieldMessage.js +1 -1
- package/dist/{FilterBar-CGsDg6Hy.js → FilterBar-COd38Ent.js} +7 -7
- package/dist/{FilterBar-CGsDg6Hy.js.map → FilterBar-COd38Ent.js.map} +1 -1
- package/dist/FilterBar.js +1 -1
- package/dist/InlineMarkdown-CL1tKR01.js +87 -0
- package/dist/InlineMarkdown-CL1tKR01.js.map +1 -0
- package/dist/InlineMarkdown.css +12 -0
- package/dist/{InputMask-BQigi5oW.js → InputMask-DICWdeiF.js} +3 -3
- package/dist/{InputMask-BQigi5oW.js.map → InputMask-DICWdeiF.js.map} +1 -1
- package/dist/InputMask.js +1 -1
- package/dist/{ListView-YJscfG4x.js → ListView-BeGBn5Vk.js} +87 -108
- package/dist/ListView-BeGBn5Vk.js.map +1 -0
- package/dist/ListView.js +1 -1
- package/dist/{Listbox-CD9ZptSZ.js → Listbox-n1CmJ2gh.js} +2 -2
- package/dist/{Listbox-CD9ZptSZ.js.map → Listbox-n1CmJ2gh.js.map} +1 -1
- package/dist/Listbox.js +1 -1
- package/dist/{Menu-Da2OEN0o.js → Menu-DqP7YQgE.js} +2 -2
- package/dist/{Menu-Da2OEN0o.js.map → Menu-DqP7YQgE.js.map} +1 -1
- package/dist/Menu.js +1 -1
- package/dist/{MenuFooter-D__gg92C.js → MenuFooter-Dzhv0EfD.js} +2 -2
- package/dist/{MenuFooter-D__gg92C.js.map → MenuFooter-Dzhv0EfD.js.map} +1 -1
- package/dist/MultiSelectField.js +1 -1
- package/dist/{MultiSelectFieldSync-Cq5sena6.js → MultiSelectFieldSync-CWsOdu-o.js} +45 -63
- package/dist/MultiSelectFieldSync-CWsOdu-o.js.map +1 -0
- package/dist/MultiSelectFieldSync.css +107 -69
- package/dist/MultiSelectMenu.js +1 -1
- package/dist/{MultiSelectMenuSync-BhNXsgAN.js → MultiSelectMenuSync-AVcf8ZUZ.js} +17 -30
- package/dist/MultiSelectMenuSync-AVcf8ZUZ.js.map +1 -0
- package/dist/{useNumberField-CXFYUZ_n.js → NumberField-DjOvcCa1.js} +251 -5
- package/dist/NumberField-DjOvcCa1.js.map +1 -0
- package/dist/NumberField.js +1 -1
- package/dist/{Page-ZSHNJs7z.js → Page-_dh-JesM.js} +134 -85
- package/dist/Page-_dh-JesM.js.map +1 -0
- package/dist/Page.css +85 -80
- package/dist/Page.js +1 -1
- package/dist/{Pagination-Bsl99RRI.js → Pagination-CsSpaTCs.js} +5 -5
- package/dist/{Pagination-Bsl99RRI.js.map → Pagination-CsSpaTCs.js.map} +1 -1
- package/dist/Pagination.js +1 -1
- package/dist/{Popover-CIh1CsoJ.js → Popover-CEKl0WY3.js} +4 -4
- package/dist/{Popover-CIh1CsoJ.js.map → Popover-CEKl0WY3.js.map} +1 -1
- package/dist/Popover.js +1 -1
- package/dist/{ProgressBar-zPKYv4Il.js → ProgressBar-ubCKKewC.js} +3 -3
- package/dist/{ProgressBar-zPKYv4Il.js.map → ProgressBar-ubCKKewC.js.map} +1 -1
- package/dist/ProgressBar.js +1 -1
- package/dist/{Radio-C1VnatcL.js → Radio-DkB6zFsS.js} +2 -2
- package/dist/{Radio-C1VnatcL.js.map → Radio-DkB6zFsS.js.map} +1 -1
- package/dist/{Radio-BYowelK2.js → Radio-q1Vp_ZQG.js} +4 -4
- package/dist/{Radio-BYowelK2.js.map → Radio-q1Vp_ZQG.js.map} +1 -1
- package/dist/Radio.js +1 -1
- package/dist/{RichTextEditor-DcAVqd2d.js → RichTextEditor-BHt6sWMA.js} +11 -11
- package/dist/{RichTextEditor-DcAVqd2d.js.map → RichTextEditor-BHt6sWMA.js.map} +1 -1
- package/dist/RichTextEditor.js +1 -1
- package/dist/{SavedFiltersButton-BLvi8j1T.js → SavedFiltersButton-Cl58iHZe.js} +10 -10
- package/dist/{SavedFiltersButton-BLvi8j1T.js.map → SavedFiltersButton-Cl58iHZe.js.map} +1 -1
- package/dist/SavedFiltersButton.js +1 -1
- package/dist/{SearchField-ChoNtw8w.js → SearchField-Bk-Ltu4v.js} +2 -2
- package/dist/{SearchField-ChoNtw8w.js.map → SearchField-Bk-Ltu4v.js.map} +1 -1
- package/dist/{SearchField-DX8hZyo2.js → SearchField-INVftpNM.js} +2 -2
- package/dist/{SearchField-DX8hZyo2.js.map → SearchField-INVftpNM.js.map} +1 -1
- package/dist/SearchField.js +1 -1
- package/dist/{SegmentedControl-BHVJmmTH.js → SegmentedControl-BCqWq65N.js} +3 -3
- package/dist/{SegmentedControl-BHVJmmTH.js.map → SegmentedControl-BCqWq65N.js.map} +1 -1
- package/dist/SegmentedControl.js +1 -1
- package/dist/{SelectCard-DrmMU_GD.js → SelectCard-DeAUW1bL.js} +3 -3
- package/dist/{SelectCard-DrmMU_GD.js.map → SelectCard-DeAUW1bL.js.map} +1 -1
- package/dist/SelectCard.js +1 -1
- package/dist/SelectField.js +1 -1
- package/dist/{SelectFieldLabel-BxsKvfqo.js → SelectFieldLabel-DaXwIFZj.js} +2 -2
- package/dist/{SelectFieldLabel-BxsKvfqo.js.map → SelectFieldLabel-DaXwIFZj.js.map} +1 -1
- package/dist/{SelectFieldSync-CeazN-gI.js → SelectFieldSync-DpZL4wDo.js} +48 -69
- package/dist/SelectFieldSync-DpZL4wDo.js.map +1 -0
- package/dist/SelectMenu.js +1 -1
- package/dist/{SelectMenuSync-CPpE6vUG.js → SelectMenuSync-Klna2oqs.js} +17 -36
- package/dist/SelectMenuSync-Klna2oqs.js.map +1 -0
- package/dist/{SelectOptions-BDAu_9dv.js → SelectOptions-DGYYFU8i.js} +2 -2
- package/dist/{SelectOptions-BDAu_9dv.js.map → SelectOptions-DGYYFU8i.js.map} +1 -1
- package/dist/{SelectTrigger-B4OUTO9S.js → SelectTrigger-DKY7rpZn.js} +2 -2
- package/dist/{SelectTrigger-B4OUTO9S.js.map → SelectTrigger-DKY7rpZn.js.map} +1 -1
- package/dist/SelectTrigger.js +1 -1
- package/dist/{SelectTriggerBase-BTWSaiQ-.js → SelectTriggerBase-DUYq_L-6.js} +6 -6
- package/dist/{SelectTriggerBase-BTWSaiQ-.js.map → SelectTriggerBase-DUYq_L-6.js.map} +1 -1
- package/dist/SelectTriggerBase.css +94 -56
- package/dist/SelectTriggerBase.module-C-NmZbg4.js +41 -0
- package/dist/SelectTriggerBase.module-C-NmZbg4.js.map +1 -0
- package/dist/{Stepper-l_P6VPOv.js → Stepper-D3SHXfX1.js} +3 -3
- package/dist/{Stepper-l_P6VPOv.js.map → Stepper-D3SHXfX1.js.map} +1 -1
- package/dist/Stepper.js +1 -1
- package/dist/{Switch-1iNdXTik.js → Switch-C9yQgF4w.js} +2 -2
- package/dist/{Switch-1iNdXTik.js.map → Switch-C9yQgF4w.js.map} +1 -1
- package/dist/Switch.js +1 -1
- package/dist/{Tab-DR5YYXkq.js → Tab-CXwVQ5-G.js} +11 -7
- package/dist/Tab-CXwVQ5-G.js.map +1 -0
- package/dist/Tab.js +1 -1
- package/dist/Table.js +1 -1
- package/dist/{Text-rihxXHSe.js → Text-D4SWT4u-.js} +2 -2
- package/dist/{Text-rihxXHSe.js.map → Text-D4SWT4u-.js.map} +1 -1
- package/dist/Text.js +1 -1
- package/dist/{TextField-vuS7xeo-.js → TextField-CKXSxube.js} +5 -5
- package/dist/{TextField-vuS7xeo-.js.map → TextField-CKXSxube.js.map} +1 -1
- package/dist/{TextField-Bxd-Qzoi.js → TextField-DmdT2k0w.js} +2 -2
- package/dist/{TextField-Bxd-Qzoi.js.map → TextField-DmdT2k0w.js.map} +1 -1
- package/dist/TextField.css +38 -23
- package/dist/TextField.js +1 -1
- package/dist/TextField.module-B3y6caP9.js +25 -0
- package/dist/TextField.module-B3y6caP9.js.map +1 -0
- package/dist/{Textarea-ppapJUwh.js → Textarea-Dv__veBJ.js} +11 -11
- package/dist/{Textarea-ppapJUwh.js.map → Textarea-Dv__veBJ.js.map} +1 -1
- package/dist/Textarea.css +26 -11
- package/dist/Textarea.js +1 -1
- package/dist/{ThemeProvider-DW-Mflv6.js → ThemeProvider-DS2aL89d.js} +2 -2
- package/dist/{ThemeProvider-DW-Mflv6.js.map → ThemeProvider-DS2aL89d.js.map} +1 -1
- package/dist/ThemeProvider.css +6 -4
- package/dist/ThemeProvider.js +1 -1
- package/dist/ThemeProvider.module-BkKwAw2f.js +8 -0
- package/dist/ThemeProvider.module-BkKwAw2f.js.map +1 -0
- package/dist/{TimeField-Hwt_oRbg.js → TimeField-De9qBimk.js} +49 -11
- package/dist/TimeField-De9qBimk.js.map +1 -0
- package/dist/TimeField.js +1 -1
- package/dist/{TimezoneMessage-BrKB_psP.js → TimezoneMessage-DEJX87S3.js} +2 -2
- package/dist/{TimezoneMessage-BrKB_psP.js.map → TimezoneMessage-DEJX87S3.js.map} +1 -1
- package/dist/Toast.js +2 -2
- package/dist/{Toaster-dVGVVcat.js → Toaster-BlwTxTLf.js} +2 -2
- package/dist/{Toaster-dVGVVcat.js.map → Toaster-BlwTxTLf.js.map} +1 -1
- package/dist/{Toaster-SqkX0Kes.js → Toaster-sO16N9b5.js} +26 -14
- package/dist/Toaster-sO16N9b5.js.map +1 -0
- package/dist/{Toolbar-DGHZpFi9.js → Toolbar-BhrHuIN7.js} +7 -7
- package/dist/{Toolbar-DGHZpFi9.js.map → Toolbar-BhrHuIN7.js.map} +1 -1
- package/dist/{Toolbar-CMulzswf.js → Toolbar-Buq2zze0.js} +6 -6
- package/dist/{Toolbar-CMulzswf.js.map → Toolbar-Buq2zze0.js.map} +1 -1
- package/dist/Toolbar.js +2 -2
- package/dist/{ToolbarButtonToggle-T8YnSJ5x.js → ToolbarButtonToggle-CNIaqVWl.js} +3 -3
- package/dist/{ToolbarButtonToggle-T8YnSJ5x.js.map → ToolbarButtonToggle-CNIaqVWl.js.map} +1 -1
- package/dist/{Tooltip-C_VcYS9P.js → Tooltip-CsTkZqMg.js} +3 -3
- package/dist/{Tooltip-C_VcYS9P.js.map → Tooltip-CsTkZqMg.js.map} +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/TreeSelectField.js +1 -1
- package/dist/{TreeSelectFieldSync-DT6uZ3Ca.js → TreeSelectFieldSync-B7w31kbz.js} +23 -23
- package/dist/{TreeSelectFieldSync-DT6uZ3Ca.js.map → TreeSelectFieldSync-B7w31kbz.js.map} +1 -1
- package/dist/TreeSelectFieldSync.css +57 -34
- package/dist/TreeSelectMenu.js +1 -1
- package/dist/{TreeSelectMenuSync-D2TvKxP-.js → TreeSelectMenuSync-EjxlvDZp.js} +5 -5
- package/dist/{TreeSelectMenuSync-D2TvKxP-.js.map → TreeSelectMenuSync-EjxlvDZp.js.map} +1 -1
- package/dist/{TypeaheadTextField-DgazozK7.js → TypeaheadTextField-DTOkaJda.js} +3 -3
- package/dist/{TypeaheadTextField-DgazozK7.js.map → TypeaheadTextField-DTOkaJda.js.map} +1 -1
- package/dist/TypeaheadTextField.js +1 -1
- package/dist/{YearlessDateInputWithPicker-Bc8a33D5.js → YearlessDateInputWithPicker-DJUQypnF.js} +4 -4
- package/dist/{YearlessDateInputWithPicker-Bc8a33D5.js.map → YearlessDateInputWithPicker-DJUQypnF.js.map} +1 -1
- package/dist/assets/icons/st/gnav_messages_active.svg +1 -0
- package/dist/assets/icons/st/gnav_messages_inactive.svg +1 -0
- package/dist/assets/icons/st.ts +2 -0
- package/dist/beta.js +19 -18
- package/dist/beta.js.map +1 -1
- package/dist/{bulkActionTypes-SukoplGV.js → bulkActionTypes-bznuvizE.js} +2 -2
- package/dist/{bulkActionTypes-SukoplGV.js.map → bulkActionTypes-bznuvizE.js.map} +1 -1
- package/dist/{filter-state-D3-SYfuy.js → filter-state-DxwL15y1.js} +25 -25
- package/dist/{filter-state-D3-SYfuy.js.map → filter-state-DxwL15y1.js.map} +1 -1
- package/dist/{index-C2dOrf4N.js → index-Bn56UnMm.js} +2 -2
- package/dist/{index-C2dOrf4N.js.map → index-Bn56UnMm.js.map} +1 -1
- package/dist/{index-Bldaza5t.js → index-CyN5oapA.js} +2 -2
- package/dist/{index-Bldaza5t.js.map → index-CyN5oapA.js.map} +1 -1
- package/dist/index-DfZCfS0S.js +36 -0
- package/dist/index-DfZCfS0S.js.map +1 -0
- package/dist/{index.esm-C2ZhC_8d.js → index.esm-CQXMoq5w.js} +2 -2
- package/dist/{index.esm-C2ZhC_8d.js.map → index.esm-CQXMoq5w.js.map} +1 -1
- package/dist/index.js +171 -127
- package/dist/index.js.map +1 -1
- package/dist/index2.css +78 -73
- package/dist/{portalScopeClassNames-DA28LrXe.js → portalScopeClassNames-CMdDYHE0.js} +2 -2
- package/dist/{portalScopeClassNames-DA28LrXe.js.map → portalScopeClassNames-CMdDYHE0.js.map} +1 -1
- package/dist/{react-ORV84FjM.js → react-CG1BUt2y.js} +5 -38
- package/dist/react-CG1BUt2y.js.map +1 -0
- package/dist/src/beta/components/Details/Details.d.ts +25 -0
- package/dist/src/beta/components/Details/DetailsSummary.d.ts +121 -0
- package/dist/src/beta/components/Details/index.d.ts +4 -0
- package/dist/src/beta/components/Details/internal/DetailsArrow.d.ts +11 -0
- package/dist/src/beta/components/Details/internal/DetailsSummaryCells.d.ts +5 -0
- package/dist/src/beta/components/Page/Page.d.ts +1 -0
- package/dist/src/beta/components/Page/PageSidebar.d.ts +12 -0
- package/dist/src/beta/components/Table/DataTable/DataTable.d.ts +31 -4
- package/dist/src/beta/components/Table/DataTable/DataTableEditColumnsDrawer.d.ts +18 -0
- package/dist/src/beta/components/Table/DataTable/index.d.ts +1 -0
- package/dist/src/beta/components/Table/DataTable/internal/DataTableAddRow.d.ts +11 -0
- package/dist/src/beta/components/Table/DataTable/internal/DataTableBulkActionBar.d.ts +23 -0
- package/dist/src/beta/components/Table/DataTable/internal/DataTableFilterToolbar.d.ts +12 -0
- package/dist/src/beta/components/Table/DataTable/internal/DataTablePagination.d.ts +3 -3
- package/dist/src/beta/components/Table/DataTable/internal/columnEditing/EditColumnsDrawer.d.ts +29 -0
- package/dist/src/beta/components/Table/DataTable/internal/columnEditing/columnLayout.d.ts +43 -0
- package/dist/src/beta/components/Table/DataTable/internal/columnEditing/toEditColumnsSection.d.ts +7 -0
- package/dist/src/beta/components/Table/DataTable/internal/context/tabbables/CellTabbablesQueue.d.ts +23 -0
- package/dist/src/beta/components/Table/DataTable/parts.d.ts +17 -0
- package/dist/src/beta/components/Table/DataTable/types.d.ts +256 -2
- package/dist/src/beta/components/Table/types.d.ts +6 -0
- package/dist/src/beta/components/deprecatedReexports/MultiSelectField.d.ts +4 -4
- package/dist/src/beta/components/deprecatedReexports/MultiSelectMenu.d.ts +4 -4
- package/dist/src/beta/components/deprecatedReexports/SelectField.d.ts +4 -4
- package/dist/src/beta/components/deprecatedReexports/SelectMenu.d.ts +4 -4
- package/dist/src/beta/components/index.d.ts +1 -0
- package/dist/src/components/DrillDown/DrillDownHeader.d.ts +11 -2
- package/dist/src/components/DrillDown/index.d.ts +1 -1
- package/dist/src/components/DrillDown/internal/DrillDownContext.d.ts +7 -2
- package/dist/src/components/DrillDown/internal/useDrillDownContextState.d.ts +6 -3
- package/dist/src/components/MultiSelectField/internal/MultiSelectFieldComboboxMode.d.ts +1 -1
- package/dist/src/components/MultiSelectField/internal/MultiSelectFieldSelectMode.d.ts +1 -1
- package/dist/src/components/MultiSelectField/internal/types.d.ts +0 -1
- package/dist/src/components/Page/Page.d.ts +1 -0
- package/dist/src/components/Page/PageSidebar.d.ts +12 -0
- package/dist/src/components/SelectField/internal/SelectFieldComboboxMode.d.ts +1 -1
- package/dist/src/components/SelectField/internal/SelectFieldSelectMode.d.ts +1 -1
- package/dist/src/hooks/usePrefersReducedMotion/index.d.ts +2 -0
- package/dist/src/hooks/usePrefersReducedMotion/prefersReducedMotion.d.ts +6 -0
- package/dist/src/hooks/usePrefersReducedMotion/useReducedMotion.d.ts +5 -0
- package/dist/src/internal/components/InlineMarkdown/InlineMarkdown.d.ts +8 -1
- package/dist/src/internal/components/InlineMarkdown/index.d.ts +1 -1
- package/dist/src/internal/components/Popover/Popover.d.ts +10 -5
- package/dist/src/internal/components/Popover/internal/verticalPlacement.d.ts +9 -0
- package/dist/src/internal/contexts/DisableConditionalUnmountWarningContext.d.ts +6 -0
- package/dist/src/internal/contexts/SuppressPanelSwapWarningContext.d.ts +13 -0
- package/dist/src/internal/functions/inlineMarkdown.d.ts +5 -2
- package/dist/src/internal/functions/stripInlineMarkdown.d.ts +4 -2
- package/dist/src/internal/hooks/index.d.ts +1 -0
- package/dist/src/internal/hooks/useSelectFieldLoading/useSelectFieldLoading.d.ts +9 -1
- package/dist/src/internal/hooks/useSelectOrchestration.d.ts +0 -1
- package/dist/src/internal/hooks/useWarnOnConditionalUnmount/index.d.ts +1 -0
- package/dist/src/internal/hooks/useWarnOnConditionalUnmount/useWarnOnConditionalUnmount.d.ts +1 -0
- package/dist/src/internal/testing/keepMutationObserversAlive.d.ts +9 -0
- package/dist/src/internal/types/selectFieldInternalTypes.d.ts +0 -1
- package/dist/src/internal/utils/inlineMarkdownRegex.d.ts +5 -0
- package/dist/stripInlineMarkdown-BV12XXzl.js +35 -0
- package/dist/stripInlineMarkdown-BV12XXzl.js.map +1 -0
- package/dist/{syncFilterUtils-SMop8ckR.js → syncFilterUtils-BNbAB0jz.js} +110 -39
- package/dist/syncFilterUtils-BNbAB0jz.js.map +1 -0
- package/dist/token/core/component-variables.scss +52 -49
- package/dist/token/core/component.d.ts +2 -0
- package/dist/token/core/component.js +66 -49
- package/dist/token/core/component.scss +42 -40
- package/dist/token/core/semantic-variables.scss +2 -0
- package/dist/token/core/semantic.d.ts +1 -0
- package/dist/token/core/semantic.js +13 -0
- package/dist/token/core/semantic.scss +1 -0
- package/dist/token.js +82 -49
- package/dist/token.js.map +1 -1
- package/dist/{treeSync-B38r1dRQ.js → treeSync-BELsX1gY.js} +3 -3
- package/dist/{treeSync-B38r1dRQ.js.map → treeSync-BELsX1gY.js.map} +1 -1
- package/dist/{use-reduced-motion-yYB9Tb0D.js → use-reduced-motion-CUshwaEW.js} +2 -2
- package/dist/{use-reduced-motion-yYB9Tb0D.js.map → use-reduced-motion-CUshwaEW.js.map} +1 -1
- package/dist/{useDrillDownContext-D5_NjqY4.js → useDrillDownContext-BLDjyNEt.js} +2 -2
- package/dist/{useDrillDownContext-D5_NjqY4.js.map → useDrillDownContext-BLDjyNEt.js.map} +1 -1
- package/dist/{useDrilldown-BOeeNUsy.js → useDrilldown-B8pIhfWa.js} +55 -22
- package/dist/{useDrilldown-BOeeNUsy.js.map → useDrilldown-B8pIhfWa.js.map} +1 -1
- package/dist/{useInfiniteCombobox-ynkeFngn.js → useInfiniteCombobox-ZZalag0-.js} +4 -4
- package/dist/{useInfiniteCombobox-ynkeFngn.js.map → useInfiniteCombobox-ZZalag0-.js.map} +1 -1
- package/dist/{useInitialFocus-CGybEc6x.js → useInitialFocus-KdirjHEb.js} +51 -16
- package/dist/useInitialFocus-KdirjHEb.js.map +1 -0
- package/dist/{useInvalidateOnOptionsChange-BD2VBpbK.js → useInvalidateOnOptionsChange-ChrPmbtS.js} +6 -6
- package/dist/{useInvalidateOnOptionsChange-BD2VBpbK.js.map → useInvalidateOnOptionsChange-ChrPmbtS.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/{usePrefersReducedMotion-DR9B_D6w.js → usePrefersReducedMotion-BLoVFiJL.js} +11 -3
- package/dist/usePrefersReducedMotion-BLoVFiJL.js.map +1 -0
- package/dist/usePrefersReducedMotion.js +2 -1
- package/dist/usePrefersReducedMotion.js.map +1 -1
- package/dist/{utils-CM48ODEJ.js → utils-DwLrXpmt.js} +2 -2
- package/dist/{utils-CM48ODEJ.js.map → utils-DwLrXpmt.js.map} +1 -1
- package/package.json +4 -4
- package/dist/AiMark-BfmK30vL.js.map +0 -1
- package/dist/Calendar-IzXG1aJw.js +0 -1761
- package/dist/Calendar-IzXG1aJw.js.map +0 -1
- package/dist/Chip-2OydLs66.js.map +0 -1
- package/dist/DataTable-DIXP9-Bx.js.map +0 -1
- package/dist/Dialog-_tHqOsbr.js.map +0 -1
- package/dist/DndHandleButton-BRlodkDO.js.map +0 -1
- package/dist/Drawer-D-ThWNp0.js.map +0 -1
- package/dist/DrillDown.module-1VBKDZRA.js +0 -27
- package/dist/DrillDown.module-1VBKDZRA.js.map +0 -1
- package/dist/FieldLabel-ThEmUiAq.js.map +0 -1
- package/dist/Lato.css +0 -24
- package/dist/ListView-YJscfG4x.js.map +0 -1
- package/dist/MultiSelectFieldSync-Cq5sena6.js.map +0 -1
- package/dist/MultiSelectMenuSync-BhNXsgAN.js.map +0 -1
- package/dist/NumberField-CxmJx4gs.js +0 -252
- package/dist/NumberField-CxmJx4gs.js.map +0 -1
- package/dist/Page-ZSHNJs7z.js.map +0 -1
- package/dist/SelectFieldSync-CeazN-gI.js.map +0 -1
- package/dist/SelectMenuSync-CPpE6vUG.js.map +0 -1
- package/dist/SelectTriggerBase.module-Dt4-6YvC.js +0 -40
- package/dist/SelectTriggerBase.module-Dt4-6YvC.js.map +0 -1
- package/dist/Tab-DR5YYXkq.js.map +0 -1
- package/dist/TextField.module-DklyLNKz.js +0 -25
- package/dist/TextField.module-DklyLNKz.js.map +0 -1
- package/dist/ThemeProvider.module-B9qgsQ8S.js +0 -8
- package/dist/ThemeProvider.module-B9qgsQ8S.js.map +0 -1
- package/dist/TimeField-Hwt_oRbg.js.map +0 -1
- package/dist/Toaster-SqkX0Kes.js.map +0 -1
- package/dist/app-css.379821199ec8105f2efd.bundle.css +0 -57579
- package/dist/bugfix-71.1orion.css +0 -491
- package/dist/design-system.859a127fc3b66175f0f0.bundle.css +0 -34599
- package/dist/drag_indicator-BRHAPLSJ.js +0 -6
- package/dist/drag_indicator-BRHAPLSJ.js.map +0 -1
- package/dist/favicon.ico +0 -0
- package/dist/kendo-css.ed976099efbbcc8b0639.bundle.css +0 -20601
- package/dist/luxon-wpz4A-OQ.js.map +0 -1
- package/dist/main.e26f249642be9a4bd747.bundle.css +0 -50386
- package/dist/react-ORV84FjM.js.map +0 -1
- package/dist/stripInlineMarkdown-BhYLEiXu.js +0 -25
- package/dist/stripInlineMarkdown-BhYLEiXu.js.map +0 -1
- package/dist/sui.a9dc22e36a27b7ea1ee8.bundle.css +0 -41149
- package/dist/syncFilterUtils-SMop8ckR.js.map +0 -1
- package/dist/useInitialFocus-CGybEc6x.js.map +0 -1
- package/dist/useNumberField-CXFYUZ_n.js.map +0 -1
- package/dist/usePrefersReducedMotion-DR9B_D6w.js.map +0 -1
- package/dist/vite.svg +0 -1
package/dist/FilterBar.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { F as FilterBar, F as default } from './FilterBar-
|
|
1
|
+
export { F as FilterBar, F as default } from './FilterBar-COd38Ent.js';
|
|
2
2
|
//# sourceMappingURL=FilterBar.js.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
|
+
import { Fragment, useMemo } from 'react';
|
|
3
|
+
|
|
4
|
+
import './InlineMarkdown.css';const INLINE_MARKDOWN_REGEX = /\*\*\*(.+?)\*\*\*|\*\*(.+?)\*\*|\*(.+?)\*|==(.+?)==|`(.+?)`/g;
|
|
5
|
+
const INLINE_MARKDOWN_MARKERS = ["", "***", "**", "*", "==", "`"];
|
|
6
|
+
const GROUP_FORMATS = [
|
|
7
|
+
[],
|
|
8
|
+
["bold", "italic"],
|
|
9
|
+
["bold"],
|
|
10
|
+
["italic"],
|
|
11
|
+
["highlight"],
|
|
12
|
+
["code"]
|
|
13
|
+
];
|
|
14
|
+
const isGroupAllowed = (group, allowedFormats) => !allowedFormats || GROUP_FORMATS[group].every((format) => allowedFormats.includes(format));
|
|
15
|
+
|
|
16
|
+
const highlight = "_highlight_1v2if_1";
|
|
17
|
+
const code = "_code_1v2if_7";
|
|
18
|
+
const styles = {
|
|
19
|
+
highlight: highlight,
|
|
20
|
+
code: code
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const parseInlineMarkdown = (text, allowedFormats) => {
|
|
24
|
+
const parts = [];
|
|
25
|
+
let lastIndex = 0;
|
|
26
|
+
INLINE_MARKDOWN_REGEX.lastIndex = 0;
|
|
27
|
+
let match;
|
|
28
|
+
while ((match = INLINE_MARKDOWN_REGEX.exec(text)) !== null) {
|
|
29
|
+
if (match.index > lastIndex) {
|
|
30
|
+
parts.push(text.substring(lastIndex, match.index));
|
|
31
|
+
}
|
|
32
|
+
const key = match.index;
|
|
33
|
+
const savedIndex = INLINE_MARKDOWN_REGEX.lastIndex;
|
|
34
|
+
const group = match.findIndex((value, i) => i > 0 && value !== void 0);
|
|
35
|
+
if (!isGroupAllowed(group, allowedFormats)) {
|
|
36
|
+
const marker = INLINE_MARKDOWN_MARKERS[group];
|
|
37
|
+
parts.push(
|
|
38
|
+
group === 5 ? match[0] : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39
|
+
marker,
|
|
40
|
+
parseInlineMarkdown(match[group], allowedFormats),
|
|
41
|
+
marker
|
|
42
|
+
] }, key)
|
|
43
|
+
);
|
|
44
|
+
} else if (match[1]) {
|
|
45
|
+
parts.push(
|
|
46
|
+
/* @__PURE__ */ jsx("strong", { children: /* @__PURE__ */ jsx("em", { children: parseInlineMarkdown(match[1], allowedFormats) }) }, key)
|
|
47
|
+
);
|
|
48
|
+
} else if (match[2]) {
|
|
49
|
+
parts.push(
|
|
50
|
+
/* @__PURE__ */ jsx("strong", { children: parseInlineMarkdown(match[2], allowedFormats) }, key)
|
|
51
|
+
);
|
|
52
|
+
} else if (match[3]) {
|
|
53
|
+
parts.push(
|
|
54
|
+
/* @__PURE__ */ jsx("em", { children: parseInlineMarkdown(match[3], allowedFormats) }, key)
|
|
55
|
+
);
|
|
56
|
+
} else if (match[4]) {
|
|
57
|
+
parts.push(
|
|
58
|
+
/* @__PURE__ */ jsx("mark", { className: styles.highlight, children: parseInlineMarkdown(match[4], allowedFormats) }, key)
|
|
59
|
+
);
|
|
60
|
+
} else if (match[5]) {
|
|
61
|
+
parts.push(
|
|
62
|
+
/* @__PURE__ */ jsx("code", { className: styles.code, children: match[5] }, key)
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
INLINE_MARKDOWN_REGEX.lastIndex = savedIndex;
|
|
66
|
+
lastIndex = savedIndex;
|
|
67
|
+
}
|
|
68
|
+
if (lastIndex < text.length) {
|
|
69
|
+
parts.push(text.substring(lastIndex));
|
|
70
|
+
}
|
|
71
|
+
return parts;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const InlineMarkdown = ({
|
|
75
|
+
value = "",
|
|
76
|
+
allowedFormats
|
|
77
|
+
}) => {
|
|
78
|
+
const formatsKey = allowedFormats?.join();
|
|
79
|
+
const content = useMemo(
|
|
80
|
+
() => parseInlineMarkdown(value, allowedFormats),
|
|
81
|
+
[value, formatsKey]
|
|
82
|
+
);
|
|
83
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: content });
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export { INLINE_MARKDOWN_REGEX as I, INLINE_MARKDOWN_MARKERS as a, InlineMarkdown as b, isGroupAllowed as i };
|
|
87
|
+
//# sourceMappingURL=InlineMarkdown-CL1tKR01.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InlineMarkdown-CL1tKR01.js","sources":["../src/internal/utils/inlineMarkdownRegex.ts","../src/internal/functions/inlineMarkdown.tsx","../src/internal/components/InlineMarkdown/InlineMarkdown.tsx"],"sourcesContent":["export const INLINE_MARKDOWN_REGEX =\n /\\*\\*\\*(.+?)\\*\\*\\*|\\*\\*(.+?)\\*\\*|\\*(.+?)\\*|==(.+?)==|`(.+?)`/g;\n\nexport type InlineMarkdownFormat = \"bold\" | \"italic\" | \"highlight\" | \"code\";\n\n/** Marker text for each capture group of `INLINE_MARKDOWN_REGEX`, by group number. */\nexport const INLINE_MARKDOWN_MARKERS = [\"\", \"***\", \"**\", \"*\", \"==\", \"`\"];\n\n/** The formats a match's capture group stands for. `***` is bold and italic. */\nconst GROUP_FORMATS: InlineMarkdownFormat[][] = [\n [],\n [\"bold\", \"italic\"],\n [\"bold\"],\n [\"italic\"],\n [\"highlight\"],\n [\"code\"],\n];\n\n/** Whether the match's capture group is a format the caller allows. */\nexport const isGroupAllowed = (\n group: number,\n allowedFormats?: readonly InlineMarkdownFormat[],\n): boolean =>\n !allowedFormats ||\n GROUP_FORMATS[group].every((format) => allowedFormats.includes(format));\n","import { Fragment, type ReactNode } from \"react\";\nimport styles from \"../components/InlineMarkdown/InlineMarkdown.module.scss\";\nimport {\n INLINE_MARKDOWN_MARKERS,\n INLINE_MARKDOWN_REGEX,\n isGroupAllowed,\n type InlineMarkdownFormat,\n} from \"../utils/inlineMarkdownRegex\";\n\n/**\n * Turns limited inline markdown into React nodes (`***` / `**` / `*` / `==` / `` ` ``).\n * The shared global regex needs `lastIndex` reset per call and saved around\n * nested parses. Code spans are not reparsed. Markers for formats outside\n * `allowedFormats` stay literal text, though the formats nested inside them\n * still render.\n */\nexport const parseInlineMarkdown = (\n text: string,\n allowedFormats?: readonly InlineMarkdownFormat[],\n): ReactNode[] => {\n const parts: ReactNode[] = [];\n let lastIndex = 0;\n\n INLINE_MARKDOWN_REGEX.lastIndex = 0;\n let match: RegExpExecArray | null;\n\n while ((match = INLINE_MARKDOWN_REGEX.exec(text)) !== null) {\n if (match.index > lastIndex) {\n parts.push(text.substring(lastIndex, match.index));\n }\n\n const key = match.index;\n const savedIndex = INLINE_MARKDOWN_REGEX.lastIndex;\n const group = match.findIndex((value, i) => i > 0 && value !== undefined);\n\n if (!isGroupAllowed(group, allowedFormats)) {\n const marker = INLINE_MARKDOWN_MARKERS[group];\n parts.push(\n group === 5 ? (\n match[0]\n ) : (\n <Fragment key={key}>\n {marker}\n {parseInlineMarkdown(match[group], allowedFormats)}\n {marker}\n </Fragment>\n ),\n );\n } else if (match[1]) {\n parts.push(\n <strong key={key}>\n <em>{parseInlineMarkdown(match[1], allowedFormats)}</em>\n </strong>,\n );\n } else if (match[2]) {\n parts.push(\n <strong key={key}>\n {parseInlineMarkdown(match[2], allowedFormats)}\n </strong>,\n );\n } else if (match[3]) {\n parts.push(\n <em key={key}>{parseInlineMarkdown(match[3], allowedFormats)}</em>,\n );\n } else if (match[4]) {\n parts.push(\n <mark key={key} className={styles.highlight}>\n {parseInlineMarkdown(match[4], allowedFormats)}\n </mark>,\n );\n } else if (match[5]) {\n parts.push(\n <code key={key} className={styles.code}>\n {match[5]}\n </code>,\n );\n }\n\n INLINE_MARKDOWN_REGEX.lastIndex = savedIndex;\n lastIndex = savedIndex;\n }\n\n if (lastIndex < text.length) {\n parts.push(text.substring(lastIndex));\n }\n\n return parts;\n};\n","import { useMemo } from \"react\";\nimport { parseInlineMarkdown } from \"../../functions/inlineMarkdown\";\nimport type { InlineMarkdownFormat } from \"../../utils/inlineMarkdownRegex\";\n\nexport type { InlineMarkdownFormat };\n\nexport interface InlineMarkdownProps {\n /** Markdown source. Defaults to `\"\"`. */\n value?: string;\n /**\n * The formats to render. Markers for any other format stay literal text.\n * Defaults to all of them.\n */\n allowedFormats?: readonly InlineMarkdownFormat[];\n}\n\n/** Turns limited inline markdown into React nodes. */\nexport const InlineMarkdown = ({\n value = \"\",\n allowedFormats,\n}: InlineMarkdownProps) => {\n const formatsKey = allowedFormats?.join();\n const content = useMemo(\n () => parseInlineMarkdown(value, allowedFormats),\n [value, formatsKey],\n );\n return <>{content}</>;\n};\n"],"names":[],"mappings":";;;AAAO,MAAM,qBAAA,GACX;AAKK,MAAM,0BAA0B,CAAC,EAAA,EAAI,OAAO,IAAA,EAAM,GAAA,EAAK,MAAM,GAAG;AAGvE,MAAM,aAAA,GAA0C;AAAA,EAC9C,EAAC;AAAA,EACD,CAAC,QAAQ,QAAQ,CAAA;AAAA,EACjB,CAAC,MAAM,CAAA;AAAA,EACP,CAAC,QAAQ,CAAA;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AA,CAAsB,SAAA,GAAY,UAAA;AAClC,IAAA,SAAA,GAAY,UAAA;AAAA,EACd;AAEA,EAAA,IAAI,SAAA,GAAY,KAAK,MAAA,EAAQ;AAC3B,IAAA,KAAA,CAAM,IAAA,CAAK,IAAA,CAAK,SAAA,CAAU,SAAS,CAAC,CAAA;AAAA,EACtC;AAEA,EAAA,OAAO,KAAA;AACT,CAAA;;ACtEO,MAAM,iBAAiB,CAAC;AAAA,EAC7B,KAAA,GAAQ,EAAA;AAAA,EACR;AACF,CAAA,KAA2B;AACzB,EAAA,MAAM,UAAA,GAAa,gBAAgB,IAAA,EAAK;AACxC,EAAA,MAAM,OAAA,GAAU,OAAA;AAAA,IACd,MAAM,mBAAA,CAAoB,KAAA,EAAO,cAAc,CAAA;AAAA,IAC/C,CAAC,OAAO,UAAU;AAAA,GACpB;AACA,EAAA,yCAAU,QAAA,EAAA,OAAA,EAAQ,CAAA;AACpB;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
.anvil2 {._highlight_1v2if_1 {
|
|
2
|
+
background-color: var(--a2-background-color-warning, var(--a2-status-color-warning, light-dark(var(--a2-color-yellow-500, #ffbe00), var(--a2-color-yellow-300, #ffe278))));
|
|
3
|
+
border-radius: var(--a2-border-radius-small, var(--a2-radius-1, 0.1875rem));
|
|
4
|
+
padding-inline: var(--a2-size-half, 0.125rem);
|
|
5
|
+
}code._code_1v2if_7 {
|
|
6
|
+
font-family: monospace;
|
|
7
|
+
font-size: var(--a2-font-size-200, 0.75rem);
|
|
8
|
+
background-color: var(--a2-background-color-stronger, light-dark(var(--a2-color-neutral-50, #eeeeee), var(--a2-color-neutral-700, #404040)));
|
|
9
|
+
border-radius: var(--a2-border-radius-small, var(--a2-radius-1, 0.1875rem));
|
|
10
|
+
padding: var(--a2-size-half, 0.125rem);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef, useRef, useMemo, isValidElement, cloneElement } from 'react';
|
|
3
|
-
import { u as useMergeRefs } from './AiMark-
|
|
4
|
-
import { T as TextField } from './TextField-
|
|
3
|
+
import { u as useMergeRefs } from './AiMark-Ca7WmL-9.js';
|
|
4
|
+
import { T as TextField } from './TextField-CKXSxube.js';
|
|
5
5
|
import { u as useOptionallyControlledState } from './useOptionallyControlledState-DbDuos5L.js';
|
|
6
6
|
import { c as childrenToString } from './childrenToString-Bz9MqbHb.js';
|
|
7
7
|
import { useTrackingId } from './useTrackingId.js';
|
|
@@ -261,4 +261,4 @@ const InputMask = forwardRef(
|
|
|
261
261
|
InputMask.displayName = "InputMask";
|
|
262
262
|
|
|
263
263
|
export { InputMask as I };
|
|
264
|
-
//# sourceMappingURL=InputMask-
|
|
264
|
+
//# sourceMappingURL=InputMask-DICWdeiF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputMask-BQigi5oW.js","sources":["../src/components/InputMask/internal/constants.ts","../src/components/InputMask/internal/utils.ts","../src/components/InputMask/InputMask.tsx"],"sourcesContent":["export const MASK_CHARS = [\"a\", \"9\", \"*\"];\n","import { MASK_CHARS } from \"./constants\";\n\n/**\n * This function applies the mask to the input value, returning a new string that matches the mask's format.\n * @param value - a string representing the raw input value (e.g., what the user typed)\n * @param mask - a string representing the desired input mask (e.g., \"99/99/9999\" for a date)\n * @param defaultMaskCharacter - a string representing the default mask character (e.g., \"_\")\n * @returns a string representing the masked value (e.g., \"12/31/2025\" for a date)\n *\n * @example\n * applyMask(\"1234567890\", \"99/99/9999\", \"_\") // \"12/31/2025\"\n * applyMask(\"1234567890\", \"999-999-9999\", \"-\") // \"123-456-7890\"\n * applyMask(\"123\", \"99/99\", \"_\") // \"12/3_\"\n */\nexport function applyMask(\n value: string,\n mask: string,\n defaultMaskCharacter: string,\n) {\n let maskedValue = \"\";\n let valueIndex = 0;\n for (let i = 0; i < mask.length; i++) {\n const maskChar = mask[i];\n if (MASK_CHARS.includes(maskChar)) {\n // Find next acceptable char in value\n while (\n valueIndex < value.length &&\n !isAcceptableChar(value[valueIndex], maskChar)\n ) {\n valueIndex++;\n }\n if (valueIndex < value.length) {\n maskedValue += value[valueIndex];\n valueIndex++;\n } else {\n maskedValue += defaultMaskCharacter;\n }\n } else {\n maskedValue += maskChar;\n }\n }\n return maskedValue;\n}\n/**\n * This function checks if a character is acceptable for a given mask character.\n * @param char - a string representing the character to check\n * @param maskChar - a string representing the mask character\n * @returns a boolean indicating if the character is acceptable\n */\nfunction isAcceptableChar(char: string, maskChar: string) {\n if (maskChar === \"9\") {\n return /\\d/.test(char);\n }\n if (maskChar === \"a\") {\n return /[a-zA-Z]/.test(char);\n }\n if (maskChar === \"*\") {\n return /[a-zA-Z0-9]/.test(char);\n }\n return false;\n}\n/**\n * This function finds the next open character in a given value.\n * @param value - a string representing the value to search\n * @param defaultMaskCharacter - a string representing the default mask character (e.g., \"_\")\n * @returns a number representing the index of the next open character\n */\nexport function getNextOpenCharacterIndex(\n value: string,\n defaultMaskCharacter: string,\n) {\n let idx = value.indexOf(defaultMaskCharacter);\n if (idx < 0) {\n idx = value.length;\n }\n return idx;\n}\n/**\n * This function finds the first non-fixed character in the value.\n * @param startingIndex - a number representing the index to start searching from\n * @param fixedCharacterIndices - an array of numbers representing the indices of the fixed characters\n * @returns a number representing the index of the first non-fixed character\n */\nexport function getFirstNonFixedCharacterIndex(\n startingIndex: number,\n fixedCharacterIndices: number[],\n) {\n let idx = startingIndex;\n while (fixedCharacterIndices.includes(idx)) {\n idx++;\n }\n return idx;\n}\n/**\n * This function finds the last filled character in a given value.\n * @param value - a string representing the value to search\n * @param mask - a string representing the mask\n * @returns a number representing the index of the last filled character\n */\nexport function getLastFilledCharacterIndex(value: string, mask: string) {\n let idx = value\n .split(\"\")\n .findLastIndex((char, i) => isAcceptableChar(char, mask[i]));\n if (idx < 0) {\n idx = 0;\n }\n return idx;\n}\n/**\n * This function finds the first filled character in a given value.\n * @param value - a string representing the value to search\n * @param mask - a string representing the mask\n * @returns a number representing the index of the first filled character\n */\nexport function getFirstFilledCharacterIndex(value: string, mask: string) {\n let idx = value\n .split(\"\")\n .findIndex((char, i) => isAcceptableChar(char, mask[i]));\n if (idx < 0) {\n idx = 0;\n }\n return idx;\n}\n","import {\n type ChangeEvent,\n type ChangeEventHandler,\n type FocusEvent,\n type KeyboardEvent,\n type InputHTMLAttributes,\n type ReactElement,\n cloneElement,\n forwardRef,\n isValidElement,\n useRef,\n useMemo,\n type MouseEvent,\n} from \"react\";\nimport { useMergeRefs } from \"@floating-ui/react\";\nimport { useOptionallyControlledState } from \"../../internal/hooks\";\nimport { useTrackingId } from \"../../hooks\";\nimport {\n TextField,\n type TextFieldProps,\n} from \"../TextField/internal/TextField\";\nimport { childrenToString } from \"../../internal/functions\";\nimport {\n applyMask,\n getLastFilledCharacterIndex,\n getFirstFilledCharacterIndex,\n getFirstNonFixedCharacterIndex,\n getNextOpenCharacterIndex,\n} from \"./internal/utils\";\nimport { MASK_CHARS } from \"./internal/constants\";\nimport type { DataTrackingId } from \"../../types\";\n\n/**\n * Props for InputMask when using with children\n */\ninterface InputMaskPropsWithChildren {\n /**\n * Custom input element to be wrapped with mask functionality.\n */\n children: ReactElement<InputHTMLAttributes<HTMLInputElement>>;\n /**\n * Additional props to pass to the input element.\n */\n inputProps?: InputHTMLAttributes<HTMLInputElement>;\n}\n\n/**\n * Props for InputMask when using without children\n */\ninterface InputMaskPropsWithoutChildren {\n /**\n * No children allowed when using default TextField.\n */\n children?: never;\n /**\n * Props to pass to the default TextField component.\n */\n inputProps?: TextFieldProps;\n}\n\n/**\n * Configuration for custom mask handler matching\n */\ninterface ICustomMaskHandlerMatch {\n /**\n * Regular expression pattern to match against input.\n */\n matchPattern: RegExp;\n /**\n * Starting position in the input string.\n */\n startPosition: number;\n /**\n * Ending position in the input string.\n */\n endPosition: number;\n}\n\n/**\n * Configuration for custom mask handler application\n */\ninterface ICustomMaskHandlerApply {\n /**\n * Pattern to apply when match is found.\n */\n applyPattern: string;\n /**\n * Offset to apply to cursor position after transformation.\n */\n caretOffset: number;\n}\n\n/**\n * Custom mask handler for advanced input transformations\n */\ninterface ICustomMaskHandler {\n /**\n * Matching configuration for the handler.\n */\n match: ICustomMaskHandlerMatch;\n /**\n * Application configuration for the handler.\n */\n apply: ICustomMaskHandlerApply;\n}\n\n/**\n * Shared props for InputMask component\n */\ninterface SharedInputMaskProps {\n /**\n * The mask pattern to apply to the input.\n * - \"9\" for digits only\n * - \"a\" for letters only\n * - \"*\" for alphanumeric\n * - Any other character is treated as a fixed character\n */\n mask: string;\n /**\n * Character to display for unfilled mask positions.\n * @default \"_\"\n */\n defaultMaskCharacter?: string;\n /**\n * Controlled value for the input.\n */\n value?: string;\n /**\n * Default value for uncontrolled input.\n */\n defaultValue?: string;\n /**\n * Callback function called when input value changes.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Array of custom mask handlers for advanced transformations.\n */\n customMaskHandler?: ICustomMaskHandler[];\n}\n\ntype SpecialChange = {\n reason: \"Backspace\" | \"Delete\" | \"Edit\";\n start: number;\n end: number;\n};\n\n/**\n * Props for the InputMask component\n * @property {string} mask - The mask pattern to apply to the input (9 for digits, a for letters, * for alphanumeric)\n * @property {string} [defaultMaskCharacter] - Character to display for unfilled mask positions\n * @property {array} [customMaskHandler] - Array of custom mask handlers for advanced transformations\n * @property {object} [inputProps] - Props to pass to the input component\n * @property {ReactElement} [children] - Custom input element to be wrapped with mask functionality\n * @property {string} [data-tracking-id] - Custom tracking ID for analytics\n */\nexport type InputMaskProps = SharedInputMaskProps &\n (InputMaskPropsWithChildren | InputMaskPropsWithoutChildren) &\n DataTrackingId;\n\n/**\n * InputMask component for applying input masks and formatting to text inputs.\n *\n * @deprecated Use the TextField component with custom masking instead. Over time, we intend to release additional components with built-in masking.\n */\nexport const InputMask = forwardRef<HTMLInputElement, InputMaskProps>(\n (\n {\n children,\n mask,\n defaultMaskCharacter = \"_\",\n value,\n defaultValue,\n onChange,\n inputProps,\n \"data-tracking-id\": dataTrackingId,\n },\n ref,\n ) => {\n const [v, setV] = useOptionallyControlledState({\n controlledValue:\n value !== undefined\n ? applyMask(value, mask, defaultMaskCharacter)\n : undefined,\n defaultValue: applyMask(defaultValue || \"\", mask, defaultMaskCharacter),\n // Omitting the onChange handler here because we want to handle it ourselves (i.e. send an event instead of just the value)\n });\n const specialChange = useRef<SpecialChange | null>(null);\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n const passInRef = useMergeRefs([inputRef, ref]);\n\n const currentOpenCharacterCount = useMemo(() => {\n return v.split(\"\").filter((char) => char === defaultMaskCharacter).length;\n }, [v, defaultMaskCharacter]);\n\n const fixedCharacterIndices = useMemo(() => {\n const fixedIndices: number[] = [];\n mask.split(\"\").forEach((char, i) => {\n if (!MASK_CHARS.includes(char)) {\n fixedIndices.push(i);\n }\n });\n return fixedIndices;\n }, [mask]);\n\n const moveCursorTo = (start: number, end: number = start) => {\n requestAnimationFrame(() => {\n inputRef.current?.setSelectionRange(start, end);\n });\n };\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n let newVal = applyMask(e.target.value, mask, defaultMaskCharacter);\n if (\n // A single character was backspaced\n specialChange.current?.reason === \"Backspace\" &&\n specialChange.current.start === specialChange.current.end\n ) {\n // If the character before the backspace is a fixed character, we need to remove the filled character before the fixed character\n if (fixedCharacterIndices.includes(specialChange.current.start - 1)) {\n const removeIndex = getLastFilledCharacterIndex(\n newVal.slice(0, specialChange.current.start),\n mask,\n );\n newVal = applyMask(\n newVal.slice(0, removeIndex) + newVal.slice(removeIndex + 1),\n mask,\n defaultMaskCharacter,\n );\n moveCursorTo(removeIndex, removeIndex);\n } else {\n const idx = Math.min(\n getLastFilledCharacterIndex(newVal, mask) + 1,\n specialChange.current.start - 1,\n );\n moveCursorTo(idx, idx);\n }\n } else if (\n // A single character was deleted\n specialChange.current?.reason === \"Delete\" &&\n specialChange.current.start === specialChange.current.end\n ) {\n // If the character after the delete is a fixed character, we need to remove the filled character after the fixed character\n if (fixedCharacterIndices.includes(specialChange.current.start)) {\n const removeIndex = getFirstFilledCharacterIndex(\n newVal.slice(specialChange.current.start + 1),\n mask,\n );\n newVal = applyMask(\n newVal.slice(0, removeIndex) + newVal.slice(removeIndex + 1),\n mask,\n defaultMaskCharacter,\n );\n }\n const firstFilledIdx = getFirstFilledCharacterIndex(newVal, mask);\n const targetIdx = Math.max(firstFilledIdx, specialChange.current.start);\n moveCursorTo(targetIdx, targetIdx);\n } else if (\n specialChange.current?.reason === \"Edit\" &&\n specialChange.current.start === specialChange.current.end // A single character was edited\n ) {\n const firstNonFixedIdx = getFirstNonFixedCharacterIndex(\n specialChange.current.start + 1,\n fixedCharacterIndices,\n );\n moveCursorTo(firstNonFixedIdx, firstNonFixedIdx);\n } else {\n const newIndex = getNextOpenCharacterIndex(\n newVal,\n defaultMaskCharacter,\n );\n moveCursorTo(newIndex, newIndex);\n }\n\n setV(newVal);\n if (inputRef.current) {\n inputRef.current.value = newVal;\n }\n onChange?.({ ...e, target: { ...e.target, value: newVal } });\n };\n\n const handleFocus = (e: FocusEvent<HTMLInputElement>) => {\n requestAnimationFrame(() => {\n if (\n e.target.selectionStart === null ||\n e.target.selectionStart === undefined ||\n e.target.selectionStart >= v.length\n ) {\n const newIndex = getNextOpenCharacterIndex(v, defaultMaskCharacter);\n moveCursorTo(newIndex, newIndex);\n }\n });\n inputProps?.onFocus?.(e);\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n const target = e.target as HTMLInputElement;\n if (target.selectionStart === null || target.selectionEnd === null) {\n return;\n }\n if (e.key === \"Backspace\") {\n specialChange.current = {\n reason: \"Backspace\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else if (e.key === \"Delete\") {\n specialChange.current = {\n reason: \"Delete\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else if (currentOpenCharacterCount === 0) {\n specialChange.current = {\n reason: \"Edit\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else {\n specialChange.current = null;\n }\n inputProps?.onKeyDown?.(e);\n };\n\n const handleClick = (e: MouseEvent<HTMLInputElement>) => {\n // For future use.\n e.preventDefault();\n e.stopPropagation();\n inputProps?.onClick?.(e);\n };\n\n const handleBlur = (e: FocusEvent<HTMLInputElement>) => {\n // For future use.\n e.preventDefault();\n e.stopPropagation();\n inputProps?.onBlur?.(e);\n };\n\n const mergedInputProps = {\n ...inputProps,\n ...(children && isValidElement(children) ? children.props : {}),\n value: v,\n onChange: handleChange,\n onFocus: handleFocus,\n onKeyDown: handleKeyDown,\n onClick: handleClick,\n onBlur: handleBlur,\n ref: passInRef,\n };\n\n const isInputEmpty = useMemo(() => {\n if (v.length === 0) {\n return true;\n }\n return v === applyMask(\"\", mask, defaultMaskCharacter);\n }, [v, defaultMaskCharacter, mask]);\n\n const data = {\n label:\n \"label\" in mergedInputProps\n ? childrenToString(mergedInputProps.label)\n : null,\n labelProps:\n \"labelProps\" in mergedInputProps ? mergedInputProps.labelProps : null,\n prefix: childrenToString(mergedInputProps.prefix),\n hint:\n \"hint\" in mergedInputProps\n ? childrenToString(mergedInputProps.hint)\n : null,\n description:\n \"description\" in mergedInputProps\n ? childrenToString(mergedInputProps.description)\n : null,\n size: mergedInputProps.size,\n type: mergedInputProps.type,\n };\n\n const trackingId = useTrackingId({\n name: \"InputMask\",\n data,\n hasOverride: !!dataTrackingId,\n });\n\n return children && isValidElement(children) && children.type === \"input\" ? (\n cloneElement(children, {\n ...mergedInputProps,\n \"data-tracking-id\": trackingId,\n } as InputHTMLAttributes<HTMLInputElement> & {\n \"data-tracking-id\"?: string;\n })\n ) : (\n <TextField\n data-input-empty={isInputEmpty}\n data-tracking-id={trackingId}\n {...(mergedInputProps as TextFieldProps)}\n />\n );\n },\n);\n\nInputMask.displayName = \"InputMask\";\n"],"names":[],"mappings":";;;;;;;;AAAO,MAAM,UAAA,GAAa,CAAC,GAAA,EAAK,GAAA,EAAK,GAAG,CAAA;;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GACP,gBAAA,CAAiB,gBAAA,CAAiB,KAAK,CAAA,GACvC,IAAA;AAAA,MACN,UAAA,EACE,YAAA,IAAgB,gBAAA,GAAmB,gBAAA,CAAiB,UAAA,GAAa,IAAA;AAAA,MACnE,MAAA,EAAQ,gBAAA,CAAiB,gBAAA,CAAiB,MAAM,CAAA;AAAA,MAChD,MACE,MAAA,IAAU,gBAAA,GACN,gBAAA,CAAiB,gBAAA,CAAiB,IAAI,CAAA,GACtC,IAAA;AAAA,MACN,aACE,aAAA,IAAiB,gBAAA,GACb,gBAAA,CAAiB,gBAAA,CAAiB,WAAW,CAAA,GAC7C,IAAA;AAAA,MACN,MAAM,gBAAA,CAAiB,IAAA;AAAA,MACvB,MAAM,gBAAA,CAAiB;AAAA,KACzB;AAEA,IAAA,MAAM,aAAa,aAAA,CAAc;AAAA,MAC/B,IAAA,EAAM,WAAA;AAAA,MACN,IAAA;AAAA,MACA,WAAA,EAAa,CAAC,CAAC;AAAA,KAChB,CAAA;AAED,IAAA,OAAO,QAAA,IAAY,eAAe,QAAQ,CAAA,IAAK,SAAS,IAAA,KAAS,OAAA,GAC/D,aAAa,QAAA,EAAU;AAAA,MACrB,GAAG,gBAAA;AAAA,MACH,kBAAA,EAAoB;AAAA,KAGrB,CAAA,mBAED,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,kBAAA,EAAkB,YAAA;AAAA,QAClB,kBAAA,EAAkB,UAAA;AAAA,QACjB,GAAI;AAAA;AAAA,KACP;AAAA,EAEJ;AACF;AAEA,SAAA,CAAU,WAAA,GAAc,WAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"InputMask-DICWdeiF.js","sources":["../src/components/InputMask/internal/constants.ts","../src/components/InputMask/internal/utils.ts","../src/components/InputMask/InputMask.tsx"],"sourcesContent":["export const MASK_CHARS = [\"a\", \"9\", \"*\"];\n","import { MASK_CHARS } from \"./constants\";\n\n/**\n * This function applies the mask to the input value, returning a new string that matches the mask's format.\n * @param value - a string representing the raw input value (e.g., what the user typed)\n * @param mask - a string representing the desired input mask (e.g., \"99/99/9999\" for a date)\n * @param defaultMaskCharacter - a string representing the default mask character (e.g., \"_\")\n * @returns a string representing the masked value (e.g., \"12/31/2025\" for a date)\n *\n * @example\n * applyMask(\"1234567890\", \"99/99/9999\", \"_\") // \"12/31/2025\"\n * applyMask(\"1234567890\", \"999-999-9999\", \"-\") // \"123-456-7890\"\n * applyMask(\"123\", \"99/99\", \"_\") // \"12/3_\"\n */\nexport function applyMask(\n value: string,\n mask: string,\n defaultMaskCharacter: string,\n) {\n let maskedValue = \"\";\n let valueIndex = 0;\n for (let i = 0; i < mask.length; i++) {\n const maskChar = mask[i];\n if (MASK_CHARS.includes(maskChar)) {\n // Find next acceptable char in value\n while (\n valueIndex < value.length &&\n !isAcceptableChar(value[valueIndex], maskChar)\n ) {\n valueIndex++;\n }\n if (valueIndex < value.length) {\n maskedValue += value[valueIndex];\n valueIndex++;\n } else {\n maskedValue += defaultMaskCharacter;\n }\n } else {\n maskedValue += maskChar;\n }\n }\n return maskedValue;\n}\n/**\n * This function checks if a character is acceptable for a given mask character.\n * @param char - a string representing the character to check\n * @param maskChar - a string representing the mask character\n * @returns a boolean indicating if the character is acceptable\n */\nfunction isAcceptableChar(char: string, maskChar: string) {\n if (maskChar === \"9\") {\n return /\\d/.test(char);\n }\n if (maskChar === \"a\") {\n return /[a-zA-Z]/.test(char);\n }\n if (maskChar === \"*\") {\n return /[a-zA-Z0-9]/.test(char);\n }\n return false;\n}\n/**\n * This function finds the next open character in a given value.\n * @param value - a string representing the value to search\n * @param defaultMaskCharacter - a string representing the default mask character (e.g., \"_\")\n * @returns a number representing the index of the next open character\n */\nexport function getNextOpenCharacterIndex(\n value: string,\n defaultMaskCharacter: string,\n) {\n let idx = value.indexOf(defaultMaskCharacter);\n if (idx < 0) {\n idx = value.length;\n }\n return idx;\n}\n/**\n * This function finds the first non-fixed character in the value.\n * @param startingIndex - a number representing the index to start searching from\n * @param fixedCharacterIndices - an array of numbers representing the indices of the fixed characters\n * @returns a number representing the index of the first non-fixed character\n */\nexport function getFirstNonFixedCharacterIndex(\n startingIndex: number,\n fixedCharacterIndices: number[],\n) {\n let idx = startingIndex;\n while (fixedCharacterIndices.includes(idx)) {\n idx++;\n }\n return idx;\n}\n/**\n * This function finds the last filled character in a given value.\n * @param value - a string representing the value to search\n * @param mask - a string representing the mask\n * @returns a number representing the index of the last filled character\n */\nexport function getLastFilledCharacterIndex(value: string, mask: string) {\n let idx = value\n .split(\"\")\n .findLastIndex((char, i) => isAcceptableChar(char, mask[i]));\n if (idx < 0) {\n idx = 0;\n }\n return idx;\n}\n/**\n * This function finds the first filled character in a given value.\n * @param value - a string representing the value to search\n * @param mask - a string representing the mask\n * @returns a number representing the index of the first filled character\n */\nexport function getFirstFilledCharacterIndex(value: string, mask: string) {\n let idx = value\n .split(\"\")\n .findIndex((char, i) => isAcceptableChar(char, mask[i]));\n if (idx < 0) {\n idx = 0;\n }\n return idx;\n}\n","import {\n type ChangeEvent,\n type ChangeEventHandler,\n type FocusEvent,\n type KeyboardEvent,\n type InputHTMLAttributes,\n type ReactElement,\n cloneElement,\n forwardRef,\n isValidElement,\n useRef,\n useMemo,\n type MouseEvent,\n} from \"react\";\nimport { useMergeRefs } from \"@floating-ui/react\";\nimport { useOptionallyControlledState } from \"../../internal/hooks\";\nimport { useTrackingId } from \"../../hooks\";\nimport {\n TextField,\n type TextFieldProps,\n} from \"../TextField/internal/TextField\";\nimport { childrenToString } from \"../../internal/functions\";\nimport {\n applyMask,\n getLastFilledCharacterIndex,\n getFirstFilledCharacterIndex,\n getFirstNonFixedCharacterIndex,\n getNextOpenCharacterIndex,\n} from \"./internal/utils\";\nimport { MASK_CHARS } from \"./internal/constants\";\nimport type { DataTrackingId } from \"../../types\";\n\n/**\n * Props for InputMask when using with children\n */\ninterface InputMaskPropsWithChildren {\n /**\n * Custom input element to be wrapped with mask functionality.\n */\n children: ReactElement<InputHTMLAttributes<HTMLInputElement>>;\n /**\n * Additional props to pass to the input element.\n */\n inputProps?: InputHTMLAttributes<HTMLInputElement>;\n}\n\n/**\n * Props for InputMask when using without children\n */\ninterface InputMaskPropsWithoutChildren {\n /**\n * No children allowed when using default TextField.\n */\n children?: never;\n /**\n * Props to pass to the default TextField component.\n */\n inputProps?: TextFieldProps;\n}\n\n/**\n * Configuration for custom mask handler matching\n */\ninterface ICustomMaskHandlerMatch {\n /**\n * Regular expression pattern to match against input.\n */\n matchPattern: RegExp;\n /**\n * Starting position in the input string.\n */\n startPosition: number;\n /**\n * Ending position in the input string.\n */\n endPosition: number;\n}\n\n/**\n * Configuration for custom mask handler application\n */\ninterface ICustomMaskHandlerApply {\n /**\n * Pattern to apply when match is found.\n */\n applyPattern: string;\n /**\n * Offset to apply to cursor position after transformation.\n */\n caretOffset: number;\n}\n\n/**\n * Custom mask handler for advanced input transformations\n */\ninterface ICustomMaskHandler {\n /**\n * Matching configuration for the handler.\n */\n match: ICustomMaskHandlerMatch;\n /**\n * Application configuration for the handler.\n */\n apply: ICustomMaskHandlerApply;\n}\n\n/**\n * Shared props for InputMask component\n */\ninterface SharedInputMaskProps {\n /**\n * The mask pattern to apply to the input.\n * - \"9\" for digits only\n * - \"a\" for letters only\n * - \"*\" for alphanumeric\n * - Any other character is treated as a fixed character\n */\n mask: string;\n /**\n * Character to display for unfilled mask positions.\n * @default \"_\"\n */\n defaultMaskCharacter?: string;\n /**\n * Controlled value for the input.\n */\n value?: string;\n /**\n * Default value for uncontrolled input.\n */\n defaultValue?: string;\n /**\n * Callback function called when input value changes.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Array of custom mask handlers for advanced transformations.\n */\n customMaskHandler?: ICustomMaskHandler[];\n}\n\ntype SpecialChange = {\n reason: \"Backspace\" | \"Delete\" | \"Edit\";\n start: number;\n end: number;\n};\n\n/**\n * Props for the InputMask component\n * @property {string} mask - The mask pattern to apply to the input (9 for digits, a for letters, * for alphanumeric)\n * @property {string} [defaultMaskCharacter] - Character to display for unfilled mask positions\n * @property {array} [customMaskHandler] - Array of custom mask handlers for advanced transformations\n * @property {object} [inputProps] - Props to pass to the input component\n * @property {ReactElement} [children] - Custom input element to be wrapped with mask functionality\n * @property {string} [data-tracking-id] - Custom tracking ID for analytics\n */\nexport type InputMaskProps = SharedInputMaskProps &\n (InputMaskPropsWithChildren | InputMaskPropsWithoutChildren) &\n DataTrackingId;\n\n/**\n * InputMask component for applying input masks and formatting to text inputs.\n *\n * @deprecated Use the TextField component with custom masking instead. Over time, we intend to release additional components with built-in masking.\n */\nexport const InputMask = forwardRef<HTMLInputElement, InputMaskProps>(\n (\n {\n children,\n mask,\n defaultMaskCharacter = \"_\",\n value,\n defaultValue,\n onChange,\n inputProps,\n \"data-tracking-id\": dataTrackingId,\n },\n ref,\n ) => {\n const [v, setV] = useOptionallyControlledState({\n controlledValue:\n value !== undefined\n ? applyMask(value, mask, defaultMaskCharacter)\n : undefined,\n defaultValue: applyMask(defaultValue || \"\", mask, defaultMaskCharacter),\n // Omitting the onChange handler here because we want to handle it ourselves (i.e. send an event instead of just the value)\n });\n const specialChange = useRef<SpecialChange | null>(null);\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n const passInRef = useMergeRefs([inputRef, ref]);\n\n const currentOpenCharacterCount = useMemo(() => {\n return v.split(\"\").filter((char) => char === defaultMaskCharacter).length;\n }, [v, defaultMaskCharacter]);\n\n const fixedCharacterIndices = useMemo(() => {\n const fixedIndices: number[] = [];\n mask.split(\"\").forEach((char, i) => {\n if (!MASK_CHARS.includes(char)) {\n fixedIndices.push(i);\n }\n });\n return fixedIndices;\n }, [mask]);\n\n const moveCursorTo = (start: number, end: number = start) => {\n requestAnimationFrame(() => {\n inputRef.current?.setSelectionRange(start, end);\n });\n };\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n let newVal = applyMask(e.target.value, mask, defaultMaskCharacter);\n if (\n // A single character was backspaced\n specialChange.current?.reason === \"Backspace\" &&\n specialChange.current.start === specialChange.current.end\n ) {\n // If the character before the backspace is a fixed character, we need to remove the filled character before the fixed character\n if (fixedCharacterIndices.includes(specialChange.current.start - 1)) {\n const removeIndex = getLastFilledCharacterIndex(\n newVal.slice(0, specialChange.current.start),\n mask,\n );\n newVal = applyMask(\n newVal.slice(0, removeIndex) + newVal.slice(removeIndex + 1),\n mask,\n defaultMaskCharacter,\n );\n moveCursorTo(removeIndex, removeIndex);\n } else {\n const idx = Math.min(\n getLastFilledCharacterIndex(newVal, mask) + 1,\n specialChange.current.start - 1,\n );\n moveCursorTo(idx, idx);\n }\n } else if (\n // A single character was deleted\n specialChange.current?.reason === \"Delete\" &&\n specialChange.current.start === specialChange.current.end\n ) {\n // If the character after the delete is a fixed character, we need to remove the filled character after the fixed character\n if (fixedCharacterIndices.includes(specialChange.current.start)) {\n const removeIndex = getFirstFilledCharacterIndex(\n newVal.slice(specialChange.current.start + 1),\n mask,\n );\n newVal = applyMask(\n newVal.slice(0, removeIndex) + newVal.slice(removeIndex + 1),\n mask,\n defaultMaskCharacter,\n );\n }\n const firstFilledIdx = getFirstFilledCharacterIndex(newVal, mask);\n const targetIdx = Math.max(firstFilledIdx, specialChange.current.start);\n moveCursorTo(targetIdx, targetIdx);\n } else if (\n specialChange.current?.reason === \"Edit\" &&\n specialChange.current.start === specialChange.current.end // A single character was edited\n ) {\n const firstNonFixedIdx = getFirstNonFixedCharacterIndex(\n specialChange.current.start + 1,\n fixedCharacterIndices,\n );\n moveCursorTo(firstNonFixedIdx, firstNonFixedIdx);\n } else {\n const newIndex = getNextOpenCharacterIndex(\n newVal,\n defaultMaskCharacter,\n );\n moveCursorTo(newIndex, newIndex);\n }\n\n setV(newVal);\n if (inputRef.current) {\n inputRef.current.value = newVal;\n }\n onChange?.({ ...e, target: { ...e.target, value: newVal } });\n };\n\n const handleFocus = (e: FocusEvent<HTMLInputElement>) => {\n requestAnimationFrame(() => {\n if (\n e.target.selectionStart === null ||\n e.target.selectionStart === undefined ||\n e.target.selectionStart >= v.length\n ) {\n const newIndex = getNextOpenCharacterIndex(v, defaultMaskCharacter);\n moveCursorTo(newIndex, newIndex);\n }\n });\n inputProps?.onFocus?.(e);\n };\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n const target = e.target as HTMLInputElement;\n if (target.selectionStart === null || target.selectionEnd === null) {\n return;\n }\n if (e.key === \"Backspace\") {\n specialChange.current = {\n reason: \"Backspace\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else if (e.key === \"Delete\") {\n specialChange.current = {\n reason: \"Delete\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else if (currentOpenCharacterCount === 0) {\n specialChange.current = {\n reason: \"Edit\",\n start: target.selectionStart,\n end: target.selectionEnd,\n };\n } else {\n specialChange.current = null;\n }\n inputProps?.onKeyDown?.(e);\n };\n\n const handleClick = (e: MouseEvent<HTMLInputElement>) => {\n // For future use.\n e.preventDefault();\n e.stopPropagation();\n inputProps?.onClick?.(e);\n };\n\n const handleBlur = (e: FocusEvent<HTMLInputElement>) => {\n // For future use.\n e.preventDefault();\n e.stopPropagation();\n inputProps?.onBlur?.(e);\n };\n\n const mergedInputProps = {\n ...inputProps,\n ...(children && isValidElement(children) ? children.props : {}),\n value: v,\n onChange: handleChange,\n onFocus: handleFocus,\n onKeyDown: handleKeyDown,\n onClick: handleClick,\n onBlur: handleBlur,\n ref: passInRef,\n };\n\n const isInputEmpty = useMemo(() => {\n if (v.length === 0) {\n return true;\n }\n return v === applyMask(\"\", mask, defaultMaskCharacter);\n }, [v, defaultMaskCharacter, mask]);\n\n const data = {\n label:\n \"label\" in mergedInputProps\n ? childrenToString(mergedInputProps.label)\n : null,\n labelProps:\n \"labelProps\" in mergedInputProps ? mergedInputProps.labelProps : null,\n prefix: childrenToString(mergedInputProps.prefix),\n hint:\n \"hint\" in mergedInputProps\n ? childrenToString(mergedInputProps.hint)\n : null,\n description:\n \"description\" in mergedInputProps\n ? childrenToString(mergedInputProps.description)\n : null,\n size: mergedInputProps.size,\n type: mergedInputProps.type,\n };\n\n const trackingId = useTrackingId({\n name: \"InputMask\",\n data,\n hasOverride: !!dataTrackingId,\n });\n\n return children && isValidElement(children) && children.type === \"input\" ? (\n cloneElement(children, {\n ...mergedInputProps,\n \"data-tracking-id\": trackingId,\n } as InputHTMLAttributes<HTMLInputElement> & {\n \"data-tracking-id\"?: string;\n })\n ) : (\n <TextField\n data-input-empty={isInputEmpty}\n data-tracking-id={trackingId}\n {...(mergedInputProps as TextFieldProps)}\n />\n );\n },\n);\n\nInputMask.displayName = \"InputMask\";\n"],"names":[],"mappings":";;;;;;;;AAAO,MAAM,UAAA,GAAa,CAAC,GAAA,EAAK,GAAA,EAAK,GAAG,CAAA;;ACcjC,SAAS,SAAA,CACd,KAAA,EACA,IAAA,EACA,oBAAA,EACA;AACA,EAAA,IAAI,WAAA,GAAc,EAAA;AAClB,EAAA,IAAI,UAAA,GAAa,CAAA;AACjB,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,IAAA,CAAK,QAAQ,CAAA,EAAA,EAAK;AACpC,IAAA,MAAM,QAAA,GAAW,KAAK,CAAC,CAAA;AACvB,IAAA,IAAI,UAAA,CAAW,QAAA,CAAS,QAAQ,CAAA,EAAG;AAEjC,MAAA,OACE,UAAA,GAAa,MAAM,MAAA,IACnB,CAAC,iBAAiB,KAAA,CAAM,UAAU,CAAA,EAAG,QAAQ,CAAA,EAC7C;AACA,QAAA,UAAA,EAAA;AAAA,MACF;AACA,MAAA,IAAI,UAAA,GAAa,MAAM,MAAA,EAAQ;AAC7B,QAAA,WAAA,IAAe,MAAM,UAAU,CAAA;AAC/B,QAAA,UAAA,EAAA;AAAA,MACF,CAAA,MAAO;AACL,QAAA,WAAA,IAAe,oBAAA;AAAA,MACjB;AAAA,IACF,CAAA,MAAO;AACL,MAAA,WAAA,IAAe,QAAA;AAAA,IACjB;AAAA,EACF;AACA,EAAA,OAAO,WAAA;AACT;AAOA,SAAS,gBAAA,CAAiB,MAAc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;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,kBAAA,EAAkB,YAAA;AAAA,QAClB,kBAAA,EAAkB,UAAA;AAAA,QACjB,GAAI;AAAA;AAAA,KACP;AAAA,EAEJ;AACF;AAEA,SAAA,CAAU,WAAA,GAAc,WAAA;;;;"}
|
package/dist/InputMask.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { I as InputMask, I as default } from './InputMask-
|
|
1
|
+
export { I as InputMask, I as default } from './InputMask-DICWdeiF.js';
|
|
2
2
|
//# sourceMappingURL=InputMask.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { createContext, useContext, forwardRef, useRef, useId, useEffect, useMemo, useState } from 'react';
|
|
3
|
-
import { C as Checkbox } from './Checkbox-
|
|
3
|
+
import { C as Checkbox } from './Checkbox-BCaUzwF_.js';
|
|
4
4
|
import { c as cx } from './index-De1g9FRV.js';
|
|
5
5
|
import { s as styles } from './ListView.module-DfqtCL3Q.js';
|
|
6
6
|
import { u as useMergeRefs } from './useMergeRefs-Dfmtq9cI.js';
|
|
@@ -162,131 +162,77 @@ ListViewOptionCell.displayName = "ListViewOptionCell";
|
|
|
162
162
|
|
|
163
163
|
const listViewKeyboardNavigation = (e, options, focusedItem, setFocusedItem, parent, currentFocusId) => {
|
|
164
164
|
if (!options) return;
|
|
165
|
+
if (!options[focusedItem.row]) return;
|
|
165
166
|
let activeElement;
|
|
166
167
|
switch (e.code) {
|
|
167
168
|
case "Enter":
|
|
168
169
|
case "Space":
|
|
169
|
-
options[focusedItem.row].focusables[focusedItem.col]
|
|
170
|
+
options[focusedItem.row].focusables[focusedItem.col]?.click();
|
|
170
171
|
activeElement = getActiveElement(document);
|
|
171
172
|
if (!activeElement) break;
|
|
172
173
|
activeElement.click();
|
|
173
174
|
e.preventDefault();
|
|
174
175
|
break;
|
|
175
|
-
case "ArrowDown":
|
|
176
|
+
case "ArrowDown": {
|
|
176
177
|
parent?.focus();
|
|
177
|
-
options[focusedItem.row].focusables[focusedItem.col]
|
|
178
|
+
options[focusedItem.row].focusables[focusedItem.col]?.removeAttribute(
|
|
178
179
|
"data-interactive"
|
|
179
180
|
);
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
setFocusedItem((prev) => {
|
|
187
|
-
return { ...prev, row: 0 };
|
|
188
|
-
});
|
|
189
|
-
break;
|
|
190
|
-
}
|
|
191
|
-
options[focusedItem.row + 1].focusables[focusedItem.col].setAttribute(
|
|
181
|
+
const row = focusedItem.row === options.length - 1 ? 0 : focusedItem.row + 1;
|
|
182
|
+
const col = Math.min(
|
|
183
|
+
focusedItem.col,
|
|
184
|
+
Math.max(0, options[row].focusables.length - 1)
|
|
185
|
+
);
|
|
186
|
+
options[row].focusables[col]?.setAttribute(
|
|
192
187
|
"data-interactive",
|
|
193
188
|
"focus-visible"
|
|
194
189
|
);
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
);
|
|
198
|
-
setFocusedItem((prev) => {
|
|
199
|
-
return { ...prev, row: focusedItem.row + 1 };
|
|
200
|
-
});
|
|
190
|
+
const id = options[row].focusables[col]?.id;
|
|
191
|
+
if (id) currentFocusId(id);
|
|
192
|
+
setFocusedItem({ row, col });
|
|
201
193
|
break;
|
|
202
|
-
|
|
194
|
+
}
|
|
195
|
+
case "ArrowUp": {
|
|
203
196
|
parent?.focus();
|
|
204
|
-
options[focusedItem.row].focusables[focusedItem.col]
|
|
197
|
+
options[focusedItem.row].focusables[focusedItem.col]?.removeAttribute(
|
|
205
198
|
"data-interactive"
|
|
206
199
|
);
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
options[options.length - 1].focusables[focusedItem.col].id
|
|
214
|
-
);
|
|
215
|
-
setFocusedItem((prev) => {
|
|
216
|
-
return { ...prev, row: options.length - 1 };
|
|
217
|
-
});
|
|
218
|
-
break;
|
|
219
|
-
}
|
|
220
|
-
options[focusedItem.row - 1].focusables[focusedItem.col].setAttribute(
|
|
200
|
+
const row = focusedItem.row === 0 ? options.length - 1 : focusedItem.row - 1;
|
|
201
|
+
const col = Math.min(
|
|
202
|
+
focusedItem.col,
|
|
203
|
+
Math.max(0, options[row].focusables.length - 1)
|
|
204
|
+
);
|
|
205
|
+
options[row].focusables[col]?.setAttribute(
|
|
221
206
|
"data-interactive",
|
|
222
207
|
"focus-visible"
|
|
223
208
|
);
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
);
|
|
227
|
-
setFocusedItem((prev) => {
|
|
228
|
-
return { ...prev, row: focusedItem.row - 1 };
|
|
229
|
-
});
|
|
209
|
+
const id = options[row].focusables[col]?.id;
|
|
210
|
+
if (id) currentFocusId(id);
|
|
211
|
+
setFocusedItem({ row, col });
|
|
230
212
|
break;
|
|
231
|
-
|
|
213
|
+
}
|
|
214
|
+
case "ArrowRight": {
|
|
232
215
|
parent?.focus();
|
|
233
|
-
options[focusedItem.row].focusables
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
);
|
|
241
|
-
currentFocusId(options[focusedItem.row].focusables[0].id);
|
|
242
|
-
setFocusedItem((prev) => {
|
|
243
|
-
return {
|
|
244
|
-
...prev,
|
|
245
|
-
col: 0
|
|
246
|
-
};
|
|
247
|
-
});
|
|
248
|
-
break;
|
|
249
|
-
}
|
|
250
|
-
options[focusedItem.row].focusables[focusedItem.col + 1].setAttribute(
|
|
251
|
-
"data-interactive",
|
|
252
|
-
"focus-visible"
|
|
253
|
-
);
|
|
254
|
-
currentFocusId(
|
|
255
|
-
options[focusedItem.row].focusables[focusedItem.col + 1].id
|
|
256
|
-
);
|
|
257
|
-
setFocusedItem((prev) => {
|
|
258
|
-
return { ...prev, col: focusedItem.col + 1 };
|
|
259
|
-
});
|
|
216
|
+
const focusables = options[focusedItem.row].focusables;
|
|
217
|
+
focusables[focusedItem.col]?.removeAttribute("data-interactive");
|
|
218
|
+
const col = focusedItem.col >= focusables.length - 1 ? 0 : focusedItem.col + 1;
|
|
219
|
+
focusables[col]?.setAttribute("data-interactive", "focus-visible");
|
|
220
|
+
const id = focusables[col]?.id;
|
|
221
|
+
if (id) currentFocusId(id);
|
|
222
|
+
setFocusedItem((prev) => ({ ...prev, col }));
|
|
260
223
|
break;
|
|
261
|
-
|
|
224
|
+
}
|
|
225
|
+
case "ArrowLeft": {
|
|
262
226
|
parent?.focus();
|
|
263
|
-
options[focusedItem.row].focusables
|
|
264
|
-
|
|
265
|
-
);
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
);
|
|
271
|
-
setFocusedItem((prev) => {
|
|
272
|
-
return {
|
|
273
|
-
...prev,
|
|
274
|
-
col: options[focusedItem.row].focusables.length - 1
|
|
275
|
-
};
|
|
276
|
-
});
|
|
277
|
-
break;
|
|
278
|
-
}
|
|
279
|
-
options[focusedItem.row].focusables[focusedItem.col - 1].setAttribute(
|
|
280
|
-
"data-interactive",
|
|
281
|
-
"focus-visible"
|
|
282
|
-
);
|
|
283
|
-
currentFocusId(
|
|
284
|
-
options[focusedItem.row].focusables[focusedItem.col - 1].id
|
|
285
|
-
);
|
|
286
|
-
setFocusedItem((prev) => {
|
|
287
|
-
return { ...prev, col: focusedItem.col - 1 };
|
|
288
|
-
});
|
|
227
|
+
const focusables = options[focusedItem.row].focusables;
|
|
228
|
+
focusables[focusedItem.col]?.removeAttribute("data-interactive");
|
|
229
|
+
const col = focusedItem.col <= 0 ? Math.max(0, focusables.length - 1) : focusedItem.col - 1;
|
|
230
|
+
focusables[col]?.setAttribute("data-interactive", "focus-visible");
|
|
231
|
+
const id = focusables[col]?.id;
|
|
232
|
+
if (id) currentFocusId(id);
|
|
233
|
+
setFocusedItem((prev) => ({ ...prev, col }));
|
|
289
234
|
break;
|
|
235
|
+
}
|
|
290
236
|
}
|
|
291
237
|
};
|
|
292
238
|
const getFocusables = (el) => {
|
|
@@ -319,6 +265,8 @@ function ListViewInner(props, ref) {
|
|
|
319
265
|
row: 0,
|
|
320
266
|
col: 0
|
|
321
267
|
});
|
|
268
|
+
const latest = useRef({ focusedItem, options, currentActive });
|
|
269
|
+
latest.current = { focusedItem, options, currentActive };
|
|
322
270
|
const styleCombined = {
|
|
323
271
|
...style,
|
|
324
272
|
...layoutStyles
|
|
@@ -326,7 +274,7 @@ function ListViewInner(props, ref) {
|
|
|
326
274
|
const onFocusHandler = () => {
|
|
327
275
|
if (!isFocusVisible.current) return;
|
|
328
276
|
if (!options) return;
|
|
329
|
-
options[focusedItem.row]
|
|
277
|
+
options[focusedItem.row]?.focusables[focusedItem.col]?.setAttribute(
|
|
330
278
|
"data-interactive",
|
|
331
279
|
"focus-visible"
|
|
332
280
|
);
|
|
@@ -334,7 +282,7 @@ function ListViewInner(props, ref) {
|
|
|
334
282
|
};
|
|
335
283
|
const onBlurHandler = () => {
|
|
336
284
|
if (!options) return;
|
|
337
|
-
options[focusedItem.row]
|
|
285
|
+
options[focusedItem.row]?.focusables[focusedItem.col]?.removeAttribute(
|
|
338
286
|
"data-interactive"
|
|
339
287
|
);
|
|
340
288
|
return;
|
|
@@ -355,7 +303,7 @@ function ListViewInner(props, ref) {
|
|
|
355
303
|
const onMouseDownHandler = (e) => {
|
|
356
304
|
isFocusVisible.current = false;
|
|
357
305
|
if (options && ListViewRef.current) {
|
|
358
|
-
options[focusedItem.row]
|
|
306
|
+
options[focusedItem.row]?.focusables[focusedItem.col]?.removeAttribute(
|
|
359
307
|
"data-interactive"
|
|
360
308
|
);
|
|
361
309
|
const closestFocusable = e.target.closest(
|
|
@@ -364,15 +312,18 @@ function ListViewInner(props, ref) {
|
|
|
364
312
|
const optionRow = e.target.closest(
|
|
365
313
|
'[data-anv="listview-option"]'
|
|
366
314
|
);
|
|
367
|
-
if (!optionRow || optionRow.
|
|
315
|
+
if (!optionRow || optionRow.getAttribute("aria-disabled") === "true")
|
|
316
|
+
return;
|
|
368
317
|
const row = options.findIndex((option) => option.node === optionRow);
|
|
318
|
+
if (row === -1) return;
|
|
369
319
|
if (!closestFocusable) {
|
|
370
|
-
options[row].focusables[0]
|
|
320
|
+
options[row].focusables[0]?.click();
|
|
371
321
|
return;
|
|
372
322
|
}
|
|
373
|
-
const
|
|
374
|
-
|
|
375
|
-
|
|
323
|
+
const clicked = closestFocusable.getAttribute("data-anv") === "checkbox" ? closestFocusable.querySelector("input") : closestFocusable;
|
|
324
|
+
const col = Math.max(
|
|
325
|
+
0,
|
|
326
|
+
Array.prototype.indexOf.call(options[row].focusables, clicked)
|
|
376
327
|
);
|
|
377
328
|
setFocusedItem({ row, col });
|
|
378
329
|
}
|
|
@@ -390,6 +341,34 @@ function ListViewInner(props, ref) {
|
|
|
390
341
|
};
|
|
391
342
|
});
|
|
392
343
|
setOptions(makeTree);
|
|
344
|
+
const {
|
|
345
|
+
focusedItem: prev,
|
|
346
|
+
options: prevOptions,
|
|
347
|
+
currentActive: active
|
|
348
|
+
} = latest.current;
|
|
349
|
+
const staleCell = prevOptions?.[prev.row]?.focusables[prev.col];
|
|
350
|
+
if (makeTree.length === 0) {
|
|
351
|
+
if (active) {
|
|
352
|
+
staleCell?.removeAttribute("data-interactive");
|
|
353
|
+
setCurrentActive(void 0);
|
|
354
|
+
}
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
const prevNode = prevOptions?.[prev.row]?.node;
|
|
358
|
+
const survivingRow = prevNode ? makeTree.findIndex((o) => o.node === prevNode) : -1;
|
|
359
|
+
const row = survivingRow === -1 ? Math.min(prev.row, makeTree.length - 1) : survivingRow;
|
|
360
|
+
const col = Math.min(
|
|
361
|
+
prev.col,
|
|
362
|
+
Math.max(0, makeTree[row].focusables.length - 1)
|
|
363
|
+
);
|
|
364
|
+
if (row !== prev.row || col !== prev.col) setFocusedItem({ row, col });
|
|
365
|
+
if (prevNode && survivingRow === -1) {
|
|
366
|
+
staleCell?.removeAttribute("data-interactive");
|
|
367
|
+
const target = makeTree[row].focusables[col];
|
|
368
|
+
if (isFocusVisible.current)
|
|
369
|
+
target?.setAttribute("data-interactive", "focus-visible");
|
|
370
|
+
if (active) setCurrentActive(target?.id);
|
|
371
|
+
}
|
|
393
372
|
}, [props.children]);
|
|
394
373
|
const prevCallbackItems = useRef([]);
|
|
395
374
|
const prevControlledItems = useRef(
|
|
@@ -514,4 +493,4 @@ const ListView = Object.assign(
|
|
|
514
493
|
);
|
|
515
494
|
|
|
516
495
|
export { ListView as L, ListViewOption as a, ListViewOptionCell as b };
|
|
517
|
-
//# sourceMappingURL=ListView-
|
|
496
|
+
//# sourceMappingURL=ListView-BeGBn5Vk.js.map
|