@midas-ds/components 14.0.0 → 15.0.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/AccordionItem-DTbu3lqx.js +343 -0
- package/AccordionItem-tWS22wDv.cjs +1 -0
- package/{Breadcrumbs-DpUPChG9.cjs → Breadcrumbs-BBDGxc68.cjs} +1 -1
- package/{Breadcrumbs-CV3rVTjR.js → Breadcrumbs-BenPNv8Z.js} +4 -4
- package/Button-1sEX8jKn.cjs +1 -0
- package/{Button-xc8A29pm.cjs → Button-BEWKXjlP.cjs} +1 -1
- package/{Button-B6lxIKPk.js → Button-BbfVT9Yl.js} +122 -116
- package/{Button-CRIYvCRM.js → Button-DdXFHfXw.js} +1 -1
- package/CHANGELOG.md +49 -0
- package/{Card-CfosvMF5.js → Card-CdqGFff2.js} +3 -3
- package/{Card-D2E3gviQ.cjs → Card-Db9xdzJ0.cjs} +1 -1
- package/{CharacterCounter-C-PFKoGg.cjs → CharacterCounter-CTpQ12f7.cjs} +1 -1
- package/{CharacterCounter-DpFONstE.js → CharacterCounter-gbDGfize.js} +2 -2
- package/Checkbox-BgrLxY6P.cjs +1 -0
- package/{Checkbox-Cr3MmHPE.js → Checkbox-CdN1D5pD.js} +94 -90
- package/{CheckboxGroup-DEY3JDEL.js → CheckboxGroup-CtJJqk_q.js} +7 -7
- package/{CheckboxGroup-f9Oa1MhQ.cjs → CheckboxGroup-thvsvOqD.cjs} +1 -1
- package/{Collection-j_iWeuZo.js → Collection-BkxwF21i.js} +205 -213
- package/Collection-vGO6v3_U.cjs +1 -0
- package/{ColorSchemeSwitch-Cur7zN5_.cjs → ColorSchemeSwitch-Ckna0otR.cjs} +1 -1
- package/{ColorSchemeSwitch-ChFSNntp.js → ColorSchemeSwitch-aF2UxI20.js} +2 -2
- package/{ComboBox-D7eKe-M5.js → ComboBox-BDX4BYWJ.js} +244 -229
- package/ComboBox-DFPrJUoV.cjs +1 -0
- package/{DateField-BszKZodr.cjs → DateField-B92Cqf9K.cjs} +1 -1
- package/{DateField-xyhyDy7u.js → DateField-BPRWrVcu.js} +4 -4
- package/DateInputDivider-CCrXjsUB.cjs +1 -0
- package/{DateInputDivider-2Wf2hlXA.js → DateInputDivider-DOHpVaNE.js} +191 -188
- package/DateRangePicker-COSTCOt8.cjs +6 -0
- package/{DateRangePicker-YwKi0ukr.js → DateRangePicker-Cmt9NC35.js} +119 -115
- package/Dialog-CPuJA2fm.js +256 -0
- package/{Dialog-DOyFzvUa.js → Dialog-D4Py85wi.js} +712 -694
- package/Dialog-DtOf0vWx.cjs +1 -0
- package/Dialog-DycTLpdr.cjs +6 -0
- package/{DragAndDrop-DQ_6tl6K.cjs → DragAndDrop-Cs-V-9ak.cjs} +1 -1
- package/{DragAndDrop-DPRU3Y0Y.js → DragAndDrop-DF0VoPJw.js} +1 -1
- package/{Dropdown-uC9wc8vd.js → Dropdown-B4lwe0Hn.js} +2 -2
- package/{Dropdown-5rmvcHD_.cjs → Dropdown-_g9l5k07.cjs} +1 -1
- package/{FieldError-C4kD4yJZ.js → FieldError-CIxlNQCM.js} +13 -13
- package/{FieldError-C4WBoCRc.cjs → FieldError-JWxR_EqN.cjs} +1 -1
- package/{FileUpload-CTbh7Gic.cjs → FileUpload-C0TjNkuh.cjs} +2 -2
- package/{FileUpload-01wGpykv.js → FileUpload-DLBP3VPp.js} +260 -534
- package/Group-B0Wj9pI8.cjs +1 -0
- package/Group-BAd7alBM.js +46 -0
- package/{Heading-CEx2LJyM.js → Heading-CCoGfKQ8.js} +9 -9
- package/{Heading-CUShN98j.cjs → Heading-x7y3xadc.cjs} +1 -1
- package/{InfoBanner-CRSz8DK2.js → InfoBanner-D7Ta-7PI.js} +1 -1
- package/{InfoBanner-D_pNj1J2.cjs → InfoBanner-_M_rGQiu.cjs} +1 -1
- package/{Input-CCuE9Sc5.cjs → Input-Bda0PCu5.cjs} +1 -1
- package/{Input-CkTOajNJ.js → Input-CQzv-D9g.js} +3 -3
- package/{Label-CkIRTC0_.cjs → Label-DpY2SZdQ.cjs} +1 -1
- package/{Label-CV9p0K2n.js → Label-FfEnd4ai.js} +4 -4
- package/Layout-BrEuHajQ.cjs +16 -0
- package/{Layout-IeVrHpT0.js → Layout-Hd1e_MEA.js} +62 -63
- package/{Link-BFvUN5Sq.js → Link-BudFjYrw.js} +1 -1
- package/{Link-D2K7bDd3.cjs → Link-BvUSTIip.cjs} +1 -1
- package/{Link-a3Ymcnoa.cjs → Link-DRU6Qzia.cjs} +1 -1
- package/{Link-B9CQXWzE.js → Link-l-nMP-Zd.js} +5 -5
- package/{LinkButton-BCn5gR10.cjs → LinkButton-DGdnbTgR.cjs} +1 -1
- package/{LinkButton-DN3J1Agu.js → LinkButton-DP9W-E32.js} +1 -1
- package/{ListBox-2eEa1l0M.js → ListBox-5GK4ZRj1.js} +189 -178
- package/ListBox-FD30iELk.cjs +1 -0
- package/{ListBoxSection-dksiACMZ.js → ListBox-LJ3VgZMr.js} +230 -266
- package/ListBox-u6ZXp5Yi.cjs +1 -0
- package/{ListBoxLoadMoreItem-IcGb_XwN.js → ListBoxLoadMoreItem-B4GFbdYf.js} +3 -3
- package/ListBoxLoadMoreItem-DMUOzVtt.cjs +1 -0
- package/ListBoxSection-CBlpg0AG.cjs +1 -0
- package/ListBoxSection-DjGs1ndn.js +51 -0
- package/ListKeyboardDelegate-8zuIfwQ7.cjs +1 -0
- package/{ListKeyboardDelegate-Dyu4eFtP.js → ListKeyboardDelegate-BBmpJ-2O.js} +36 -40
- package/{OverlayArrow-Bh_G2tJ3.js → OverlayArrow-CjGslX2c.js} +2 -2
- package/{OverlayArrow-DJ4nNscD.cjs → OverlayArrow-bcrb_syE.cjs} +1 -1
- package/Popover-CS8Yyfrq.js +39 -0
- package/Popover-DpB0XDBp.cjs +1 -0
- package/{PressResponder-DUhG97jJ.js → PressResponder-BMj6Zvbn.js} +3 -3
- package/{PressResponder-AXK2I_yx.cjs → PressResponder-ChvCuOue.cjs} +1 -1
- package/{ProgressBar-B-TOuoAC.cjs → ProgressBar-BZqAQTV3.cjs} +1 -1
- package/{ProgressBar-B0WEQkyq.js → ProgressBar-BpsvPCKk.js} +12 -12
- package/{RSPContexts-BW2SEIqe.js → RSPContexts-B0lEq7qq.js} +5 -3
- package/RSPContexts-XUvspq3j.cjs +1 -0
- package/Radio-B3FBTn4F.cjs +1 -0
- package/Radio-LevFYAg4.js +340 -0
- package/{RangeCalendar-B6zKSDju.cjs → RangeCalendar-CH0CyBui.cjs} +2 -2
- package/{RangeCalendar-D5TMu8GI.js → RangeCalendar-DT_KVd80.js} +58 -58
- package/{SearchField-DnBBlPT7.cjs → SearchField-BX7P7BgV.cjs} +1 -1
- package/{SearchField-wojUSY2S.js → SearchField-C-TFzcJF.js} +3 -3
- package/Select-C-ykeY_T.js +773 -0
- package/Select-CiCng7ZP.js +678 -0
- package/Select-D4wi-0Jw.cjs +1 -0
- package/Select-JIDW2mN8.cjs +1 -0
- package/{FocusScope-8ILtcq9W.js → SelectionIndicator-C2E23-zO.js} +270 -174
- package/SelectionIndicator-ClG0GpJu.cjs +1 -0
- package/SelectionManager-CNJmHeCF.cjs +1 -0
- package/SelectionManager-DoNLJm8c.js +1063 -0
- package/{Separator-COlhRmJF.js → Separator-CQfDz_zr.js} +10 -10
- package/{Separator-DcbM84B8.cjs → Separator-CSyYDGNE.cjs} +1 -1
- package/{Separator-BQkxEZC9.cjs → Separator-DCi4bnBr.cjs} +1 -1
- package/{Separator--4b7vckr.js → Separator-DLr4kUJD.js} +2 -2
- package/Spinner-D6Fcu_Dp.js +54 -0
- package/Spinner-DIapnvIz.cjs +6 -0
- package/TabList-BBmBumm6.js +394 -0
- package/TabList-DVzXuGXA.cjs +1 -0
- package/Table-B1nxmW14.cjs +16 -0
- package/{Table-cCSOrPkK.js → Table-DxqKDp7N.js} +707 -703
- package/Tag-BL-_PONN.cjs +1 -0
- package/Tag-DX1X_NZE.js +774 -0
- package/{Text-CkhG15SU.cjs → Text-0wXj3J8E.cjs} +1 -1
- package/{Text-BQe1I4-r.js → Text-BBFWBNAH.js} +1 -1
- package/{Text-CkhZTTV5.cjs → Text-D5OSv6Uv.cjs} +1 -1
- package/{Text-BpERRete.js → Text-bqP9NeVg.js} +1 -1
- package/{TextArea-B5TsyJxa.cjs → TextArea-Bjf8CBp0.cjs} +1 -1
- package/{TextArea-Cado2arG.js → TextArea-CJPBvogq.js} +8 -8
- package/TextField-DtD9-arA.cjs +1 -0
- package/{TextField-5AI6T1ol.js → TextField-DyR61bjZ.js} +10 -10
- package/{Toast-CgXRE33Y.js → Toast-B99bLWnh.js} +12 -12
- package/{Toast-Cs-Uvf1p.cjs → Toast-DUZ5jfG1.cjs} +1 -1
- package/{ToggleButtonGroup-SKGgfFs4.js → ToggleButtonGroup-CFRutAZ4.js} +82 -78
- package/ToggleButtonGroup-dnvnzkaD.cjs +1 -0
- package/{Tooltip-txk48Qof.js → Tooltip-CUdmOznK.js} +4 -4
- package/{Tooltip-BrupFzaI.cjs → Tooltip-D-ATlbIM.cjs} +1 -1
- package/{VisuallyHidden-Awup6QxT.cjs → VisuallyHidden-BMelU6B0.cjs} +1 -1
- package/{VisuallyHidden-D2ZXHTJs.js → VisuallyHidden-DuW70K-5.js} +1 -1
- package/accordion/index.cjs +1 -1
- package/accordion/index.js +1 -1
- package/assets/AccordionItem.css +1 -1
- package/assets/FieldError.css +1 -1
- package/assets/ListBox.css +1 -0
- package/assets/Popover.css +1 -1
- package/assets/RangeCalendar.css +1 -1
- package/assets/Select.css +1 -1
- package/assets/Select2.css +1 -0
- package/assets/Spinner.css +1 -1
- package/assets/TabList.css +1 -1
- package/assets/Tag.css +1 -1
- package/assets/default.css +1 -1
- package/breadcrumbs/index.cjs +1 -1
- package/breadcrumbs/index.js +1 -1
- package/button/index.cjs +1 -1
- package/button/index.js +1 -1
- package/calendar/index.cjs +1 -1
- package/calendar/index.js +1 -1
- package/card/index.cjs +1 -1
- package/card/index.js +1 -1
- package/character-counter/index.cjs +1 -1
- package/character-counter/index.js +1 -1
- package/checkbox/index.cjs +1 -1
- package/checkbox/index.js +2 -2
- package/color-scheme-switch/index.cjs +1 -1
- package/color-scheme-switch/index.js +1 -1
- package/combobox/index.cjs +1 -1
- package/combobox/index.js +1 -1
- package/date-field/index.cjs +1 -1
- package/date-field/index.js +2 -2
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +1 -1
- package/dropdown/index.cjs +1 -1
- package/dropdown/index.js +1 -1
- package/field-error/index.cjs +1 -1
- package/field-error/index.js +1 -1
- package/file-upload/index.cjs +1 -1
- package/file-upload/index.js +1 -1
- package/{getScrollParent-Ru2U2LlM.js → getScrollParent-DFCzfqHG.js} +1 -1
- package/{getScrollParent-DuKmPmUa.cjs → getScrollParent-DjULaF_q.cjs} +1 -1
- package/heading/index.cjs +1 -1
- package/heading/index.js +1 -1
- package/index.cjs +1 -1
- package/index.d.ts +1 -0
- package/index.js +99 -95
- package/info-banner/index.cjs +1 -1
- package/info-banner/index.js +1 -1
- package/intlStrings-Cd44R5hT.js +278 -0
- package/intlStrings-ClBuC6xN.cjs +1 -0
- package/label/index.cjs +1 -1
- package/label/index.js +1 -1
- package/layout/index.cjs +1 -1
- package/layout/index.js +1 -1
- package/legacy-select/Select.d.ts +8 -0
- package/legacy-select/SelectTrigger.d.ts +10 -0
- package/legacy-select/index.cjs +1 -0
- package/legacy-select/index.d.ts +2 -0
- package/legacy-select/index.js +4 -0
- package/legacy-select/intl/translations.json.d.ts +17 -0
- package/{select → legacy-select}/types.d.ts +2 -2
- package/legacy-select/useMultiSelect.d.ts +5 -0
- package/link/index.cjs +1 -1
- package/link/index.js +2 -2
- package/link-button/index.cjs +1 -1
- package/link-button/index.js +2 -2
- package/list-box/ListBox.d.ts +1 -2
- package/list-box/ListBoxHeader.d.ts +3 -0
- package/list-box/ListBoxItem.d.ts +9 -3
- package/list-box/ListBoxSection.d.ts +1 -1
- package/list-box/index.cjs +1 -1
- package/list-box/index.d.ts +1 -0
- package/list-box/index.js +9 -7
- package/menu/index.cjs +1 -1
- package/menu/index.js +2 -2
- package/modal/index.cjs +1 -1
- package/modal/index.js +2 -2
- package/package.json +4 -4
- package/popover/Popover.d.ts +2 -1
- package/popover/index.cjs +1 -1
- package/popover/index.js +1 -1
- package/progress-bar/index.cjs +1 -1
- package/progress-bar/index.js +1 -1
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/scrollIntoView-BVI21Y4-.js +65 -0
- package/scrollIntoView-BueMOyGp.cjs +1 -0
- package/search-field/index.cjs +1 -1
- package/search-field/index.js +1 -1
- package/select/Select.d.ts +33 -4
- package/select/SelectAll.d.ts +1 -0
- package/select/SelectTags.d.ts +4 -0
- package/select/SelectTrigger.d.ts +4 -8
- package/select/SelectValueTag.d.ts +5 -0
- package/select/index.cjs +1 -1
- package/select/index.d.ts +1 -2
- package/select/index.js +1 -1
- package/select/intl/translations.json.d.ts +2 -2
- package/spinner/Spinner.d.ts +5 -1
- package/spinner/index.cjs +1 -1
- package/spinner/index.js +1 -1
- package/table/index.cjs +1 -1
- package/table/index.js +1 -1
- package/tabs/Tabs.d.ts +2 -9
- package/tabs/index.cjs +1 -1
- package/tabs/index.d.ts +0 -1
- package/tabs/index.js +1 -1
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/text/index.cjs +1 -1
- package/text/index.js +1 -1
- package/textfield/TextArea.d.ts +3 -2
- package/textfield/TextField.d.ts +3 -2
- package/textfield/index.cjs +1 -1
- package/textfield/index.js +1 -1
- package/toast/index.cjs +1 -1
- package/toast/index.js +1 -1
- package/toggle-button/index.cjs +1 -1
- package/toggle-button/index.js +1 -1
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/{useButton-Bh3duhYL.cjs → useButton-C0r5nrqs.cjs} +1 -1
- package/{useButton-A-VOfwuT.js → useButton-CRgN6aZf.js} +2 -2
- package/useDateFormatter-BrrFo4nY.cjs +1 -0
- package/{useDateFormatter-CxlJTAki.js → useDateFormatter-Bs5A6Xtu.js} +353 -322
- package/{useField-sSWPm-He.js → useField-Bx76iuoW.js} +1 -1
- package/{useField-CY4OYE5a.cjs → useField-DvszkIMx.cjs} +1 -1
- package/{useFilter-DHcouDzv.js → useFilter-Dn4vTT3G.js} +1 -1
- package/{useFilter-DlZLqsJD.cjs → useFilter-eOgdlVLd.cjs} +1 -1
- package/{useFocusRing-Cig5Y0l-.cjs → useFocusRing-C-XVcAE5.cjs} +1 -1
- package/{useFocusRing-Copf_tx8.js → useFocusRing-CcxI7nbg.js} +2 -2
- package/{useFocusWithin-BKopz9sr.js → useFocusWithin-DhXBuB2O.js} +1 -1
- package/{useFocusWithin-TryC2Kkw.cjs → useFocusWithin-GBjoTL5o.cjs} +1 -1
- package/{useFocusable-CCh54GIw.js → useFocusable-BJj-Bkig.js} +3 -3
- package/{useFocusable-DhdAtEw8.cjs → useFocusable-M4se1KJt.cjs} +1 -1
- package/{useFormValidation-DdIIVZ5j.js → useFormValidation-By7G-T7y.js} +1 -1
- package/{useFormValidation-BJNizNDf.cjs → useFormValidation-DV2Ioblb.cjs} +1 -1
- package/useHasTabbableChild-BJ_VejL5.cjs +1 -0
- package/{useHasTabbableChild-BbgOpdGQ.js → useHasTabbableChild-DpISgPsS.js} +1 -1
- package/{useHighlightSelectionDescription-D6F-YO6b.cjs → useHighlightSelectionDescription-CBZfyrhy.cjs} +1 -1
- package/{useHighlightSelectionDescription-BL_02EKv.js → useHighlightSelectionDescription-Zvo5KTxM.js} +2 -2
- package/{useHover-eU40luVI.cjs → useHover-DULSfLuK.cjs} +1 -1
- package/{useHover-zCCNtF6g.js → useHover-DkC5FyNd.js} +4 -4
- package/{useListState-D2yPZrFZ.js → useListState-CP7AKhOX.js} +1 -1
- package/{useListState-BdC308Sq.cjs → useListState-DZFWpD-x.cjs} +1 -1
- package/{usePress-4yZ5a87p.js → usePress-BqQIhkNY.js} +43 -43
- package/usePress-DmU79HEg.cjs +7 -0
- package/{useSingleSelectListState-lyai-bC_.js → useSingleSelectListState-GSY0f4qW.js} +1 -1
- package/{useSingleSelectListState-b_SPhYG4.cjs → useSingleSelectListState-JCvbhUVI.cjs} +1 -1
- package/{useTextField-DUEQl6sr.cjs → useTextField-CiWV3eeD.cjs} +1 -1
- package/{useTextField-DjxrmW7d.js → useTextField-I3QVGvyX.js} +4 -4
- package/utils/types.d.ts +5 -0
- package/utils-CtICjCYt.cjs +1 -0
- package/{utils-BMBoiyL7.js → utils-D2iKpxcZ.js} +43 -39
- package/utils-DRIRjPUS.cjs +1 -0
- package/{utils-CrT5PVBA.js → utils-Dxh86KaB.js} +19 -17
- package/AccordionItem-BJw5IKe0.js +0 -334
- package/AccordionItem-DhMimhYo.cjs +0 -1
- package/Button-BTX5G3le.cjs +0 -1
- package/Checkbox-D-CFY6QF.cjs +0 -1
- package/Collection-DaZzboRu.cjs +0 -1
- package/ComboBox-C4NybZ32.cjs +0 -1
- package/DateInputDivider-BgXKFwB0.cjs +0 -1
- package/DateRangePicker-DTPkr3hX.cjs +0 -6
- package/Dialog-DLnopN3Z.js +0 -237
- package/Dialog-DNu42oLH.cjs +0 -1
- package/Dialog-w6EBWT__.cjs +0 -1
- package/FocusScope-Dv0F-mG2.cjs +0 -1
- package/Group-C2hEIsGV.js +0 -45
- package/Group-cuyk9Hsy.cjs +0 -1
- package/Layout-CVnlO10z.cjs +0 -16
- package/ListBox-Bx9M5vqb.cjs +0 -1
- package/ListBoxLoadMoreItem-BBE3OF4J.cjs +0 -1
- package/ListBoxSection-kujY2gUl.cjs +0 -1
- package/ListKeyboardDelegate-DJDPir-w.cjs +0 -1
- package/Popover-BI2Koco0.cjs +0 -1
- package/Popover-D7_IfJ3o.js +0 -38
- package/RSPContexts-D8hmBfGm.cjs +0 -1
- package/Radio-D6KNkSA2.js +0 -333
- package/Radio-DsVsutMH.cjs +0 -1
- package/Select-D9h_RQ2k.cjs +0 -1
- package/Select-Dc6y8gPR.js +0 -654
- package/SelectionManager-D-4ThfPZ.js +0 -1043
- package/SelectionManager-FYrDfe5v.cjs +0 -1
- package/Spinner-CTha503N.js +0 -47
- package/Spinner-DKQ9_SQB.cjs +0 -6
- package/TabList-BhC96APe.cjs +0 -1
- package/TabList-P5HnizZt.js +0 -393
- package/Table-BB8Ag5_3.cjs +0 -16
- package/Tag-D2vh0KRD.js +0 -765
- package/Tag-D32MGLjS.cjs +0 -1
- package/TextField-4xfAzdBI.cjs +0 -1
- package/ToggleButtonGroup-CiX2eXB8.cjs +0 -1
- package/assets/ListBoxSection.css +0 -1
- package/scrollIntoView-ClEACHUk.js +0 -57
- package/scrollIntoView-DRSoJp89.cjs +0 -1
- package/select/useMultiSelect.d.ts +0 -4
- package/useDateFormatter-D0bVjgIb.cjs +0 -1
- package/useHasTabbableChild-wH3RCjTd.cjs +0 -1
- package/useObserveElement-BdI4zgd7.js +0 -27
- package/useObserveElement-BzEr5D32.cjs +0 -1
- package/usePress-Dj3t18Pf.cjs +0 -7
- package/utils-I-LGXGYH.cjs +0 -1
- package/utils-cBvgilDa.cjs +0 -1
- package/variables-B3KEYyhW.cjs +0 -1
- package/variables-DzXcMW2k.js +0 -5
- /package/{select → legacy-select}/HiddenMultiSelect.d.ts +0 -0
- /package/{select → legacy-select}/MultiSelectValueTag.d.ts +0 -0
- /package/{select → legacy-select}/SelectFieldError.d.ts +0 -0
- /package/{select → legacy-select}/SelectListBox.d.ts +0 -0
- /package/{select → legacy-select}/useMultiSelectListState.d.ts +0 -0
- /package/{select → legacy-select}/useMultiSelectState.d.ts +0 -0
- /package/{select → legacy-select}/utils.d.ts +0 -0
|
@@ -1,1043 +0,0 @@
|
|
|
1
|
-
import V, { useRef as x, useEffect as q, useMemo as j, useState as se } from "react";
|
|
2
|
-
import { $ as Ie, b as we, m as ue, c as xe } from "./utils-CrT5PVBA.js";
|
|
3
|
-
import { $ as he, a as Y, c as Fe, d as ye, e as Ce } from "./mergeProps-Ct8m5-xW.js";
|
|
4
|
-
import { b as Pe, c as De, f as Me } from "./usePress-4yZ5a87p.js";
|
|
5
|
-
import { $ as J } from "./useEvent-smuTnX4G.js";
|
|
6
|
-
import { a as Be, b as pe } from "./scrollIntoView-ClEACHUk.js";
|
|
7
|
-
import { $ as Re } from "./FocusScope-8ILtcq9W.js";
|
|
8
|
-
import { h as Le, o as Oe, f as ve } from "./useHover-zCCNtF6g.js";
|
|
9
|
-
import { b as ae } from "./useFocusable-CCh54GIw.js";
|
|
10
|
-
import { flushSync as ze } from "react-dom";
|
|
11
|
-
import { $ as Ue } from "./context-Dl_saGB6.js";
|
|
12
|
-
import { $ as Ve } from "./useDescription-BFwQx7Rp.js";
|
|
13
|
-
import { $ as He } from "./useControlledState-u436Wbp1.js";
|
|
14
|
-
function be(n, e) {
|
|
15
|
-
const t = x(!0), l = x(null);
|
|
16
|
-
he(() => (t.current = !0, () => {
|
|
17
|
-
t.current = !1;
|
|
18
|
-
}), []), he(() => {
|
|
19
|
-
t.current ? t.current = !1 : (!l.current || e.some((i, c) => !Object.is(i, l[c]))) && n(), l.current = e;
|
|
20
|
-
}, e);
|
|
21
|
-
}
|
|
22
|
-
const We = "react-aria-clear-focus", Ge = "react-aria-focus";
|
|
23
|
-
function H(n) {
|
|
24
|
-
return Le() ? n.metaKey : n.ctrlKey;
|
|
25
|
-
}
|
|
26
|
-
const qe = 500;
|
|
27
|
-
function je(n) {
|
|
28
|
-
let { isDisabled: e, onLongPressStart: t, onLongPressEnd: l, onLongPress: i, threshold: c = qe, accessibilityDescription: r } = n;
|
|
29
|
-
const d = x(void 0);
|
|
30
|
-
let { addGlobalListener: a, removeGlobalListener: K } = Ie(), { pressProps: E } = Pe({
|
|
31
|
-
isDisabled: e,
|
|
32
|
-
onPressStart(v) {
|
|
33
|
-
if (v.continuePropagation(), (v.pointerType === "mouse" || v.pointerType === "touch") && (t && t({
|
|
34
|
-
...v,
|
|
35
|
-
type: "longpressstart"
|
|
36
|
-
}), d.current = setTimeout(() => {
|
|
37
|
-
v.target.dispatchEvent(new PointerEvent("pointercancel", {
|
|
38
|
-
bubbles: !0
|
|
39
|
-
})), we(v.target).activeElement !== v.target && ue(v.target), i && i({
|
|
40
|
-
...v,
|
|
41
|
-
type: "longpress"
|
|
42
|
-
}), d.current = void 0;
|
|
43
|
-
}, c), v.pointerType === "touch")) {
|
|
44
|
-
let m = (b) => {
|
|
45
|
-
b.preventDefault();
|
|
46
|
-
};
|
|
47
|
-
a(v.target, "contextmenu", m, {
|
|
48
|
-
once: !0
|
|
49
|
-
}), a(window, "pointerup", () => {
|
|
50
|
-
setTimeout(() => {
|
|
51
|
-
K(v.target, "contextmenu", m);
|
|
52
|
-
}, 30);
|
|
53
|
-
}, {
|
|
54
|
-
once: !0
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
onPressEnd(v) {
|
|
59
|
-
d.current && clearTimeout(d.current), l && (v.pointerType === "mouse" || v.pointerType === "touch") && l({
|
|
60
|
-
...v,
|
|
61
|
-
type: "longpressend"
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}), $ = Ve(i && !e ? r : void 0);
|
|
65
|
-
return {
|
|
66
|
-
longPressProps: Y(E, $)
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
function Te(n) {
|
|
70
|
-
let e = Ze(we(n));
|
|
71
|
-
e !== n && (e && Ye(e, n), n && Ee(n, e));
|
|
72
|
-
}
|
|
73
|
-
function Ye(n, e) {
|
|
74
|
-
n.dispatchEvent(new FocusEvent("blur", {
|
|
75
|
-
relatedTarget: e
|
|
76
|
-
})), n.dispatchEvent(new FocusEvent("focusout", {
|
|
77
|
-
bubbles: !0,
|
|
78
|
-
relatedTarget: e
|
|
79
|
-
}));
|
|
80
|
-
}
|
|
81
|
-
function Ee(n, e) {
|
|
82
|
-
n.dispatchEvent(new FocusEvent("focus", {
|
|
83
|
-
relatedTarget: e
|
|
84
|
-
})), n.dispatchEvent(new FocusEvent("focusin", {
|
|
85
|
-
bubbles: !0,
|
|
86
|
-
relatedTarget: e
|
|
87
|
-
}));
|
|
88
|
-
}
|
|
89
|
-
function Ze(n) {
|
|
90
|
-
let e = xe(n), t = e == null ? void 0 : e.getAttribute("aria-activedescendant");
|
|
91
|
-
return t && n.getElementById(t) || e;
|
|
92
|
-
}
|
|
93
|
-
function fe(n) {
|
|
94
|
-
return Oe() ? n.altKey : n.ctrlKey;
|
|
95
|
-
}
|
|
96
|
-
function re(n, e) {
|
|
97
|
-
var t, l;
|
|
98
|
-
let i = `[data-key="${CSS.escape(String(e))}"]`, c = (t = n.current) === null || t === void 0 ? void 0 : t.dataset.collection;
|
|
99
|
-
return c && (i = `[data-collection="${CSS.escape(c)}"]${i}`), (l = n.current) === null || l === void 0 ? void 0 : l.querySelector(i);
|
|
100
|
-
}
|
|
101
|
-
const ke = /* @__PURE__ */ new WeakMap();
|
|
102
|
-
function Je(n) {
|
|
103
|
-
let e = Fe();
|
|
104
|
-
return ke.set(n, e), e;
|
|
105
|
-
}
|
|
106
|
-
function Qe(n) {
|
|
107
|
-
return ke.get(n);
|
|
108
|
-
}
|
|
109
|
-
const Xe = 1e3;
|
|
110
|
-
function Ne(n) {
|
|
111
|
-
let { keyboardDelegate: e, selectionManager: t, onTypeSelect: l } = n, i = x({
|
|
112
|
-
search: "",
|
|
113
|
-
timeout: void 0
|
|
114
|
-
}).current, c = (r) => {
|
|
115
|
-
let d = _e(r.key);
|
|
116
|
-
if (!(!d || r.ctrlKey || r.metaKey || !r.currentTarget.contains(r.target) || i.search.length === 0 && d === " ")) {
|
|
117
|
-
if (d === " " && i.search.trim().length > 0 && (r.preventDefault(), "continuePropagation" in r || r.stopPropagation()), i.search += d, e.getKeyForSearch != null) {
|
|
118
|
-
let a = e.getKeyForSearch(i.search, t.focusedKey);
|
|
119
|
-
a == null && (a = e.getKeyForSearch(i.search)), a != null && (t.setFocusedKey(a), l && l(a));
|
|
120
|
-
}
|
|
121
|
-
clearTimeout(i.timeout), i.timeout = setTimeout(() => {
|
|
122
|
-
i.search = "";
|
|
123
|
-
}, Xe);
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
return {
|
|
127
|
-
typeSelectProps: {
|
|
128
|
-
// Using a capturing listener to catch the keydown event before
|
|
129
|
-
// other hooks in order to handle the Spacebar event.
|
|
130
|
-
onKeyDownCapture: e.getKeyForSearch ? c : void 0
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
function _e(n) {
|
|
135
|
-
return n.length === 1 || !/^[A-Z]/i.test(n) ? n : "";
|
|
136
|
-
}
|
|
137
|
-
function mt(n) {
|
|
138
|
-
let { selectionManager: e, keyboardDelegate: t, ref: l, autoFocus: i = !1, shouldFocusWrap: c = !1, disallowEmptySelection: r = !1, disallowSelectAll: d = !1, escapeKeyBehavior: a = "clearSelection", selectOnFocus: K = e.selectionBehavior === "replace", disallowTypeAhead: E = !1, shouldUseVirtualFocus: $, allowsTabNavigation: v = !1, isVirtualized: m, scrollRef: b = l, linkBehavior: k = "action" } = n, { direction: y } = Ue(), h = De(), S = (o) => {
|
|
139
|
-
var f;
|
|
140
|
-
if (o.altKey && o.key === "Tab" && o.preventDefault(), !(!((f = l.current) === null || f === void 0) && f.contains(o.target))) return;
|
|
141
|
-
const s = (u, z) => {
|
|
142
|
-
if (u != null) {
|
|
143
|
-
if (e.isLink(u) && k === "selection" && K && !fe(o)) {
|
|
144
|
-
ze(() => {
|
|
145
|
-
e.setFocusedKey(u, z);
|
|
146
|
-
});
|
|
147
|
-
let U = re(l, u), de = e.getItemProps(u);
|
|
148
|
-
U && h.open(U, o, de.href, de.routerOptions);
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
if (e.setFocusedKey(u, z), e.isLink(u) && k === "override") return;
|
|
152
|
-
o.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(u) : K && !fe(o) && e.replaceSelection(u);
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
switch (o.key) {
|
|
156
|
-
case "ArrowDown":
|
|
157
|
-
if (t.getKeyBelow) {
|
|
158
|
-
var g, T, D;
|
|
159
|
-
let u = e.focusedKey != null ? (g = t.getKeyBelow) === null || g === void 0 ? void 0 : g.call(t, e.focusedKey) : (T = t.getFirstKey) === null || T === void 0 ? void 0 : T.call(t);
|
|
160
|
-
u == null && c && (u = (D = t.getFirstKey) === null || D === void 0 ? void 0 : D.call(t, e.focusedKey)), u != null && (o.preventDefault(), s(u));
|
|
161
|
-
}
|
|
162
|
-
break;
|
|
163
|
-
case "ArrowUp":
|
|
164
|
-
if (t.getKeyAbove) {
|
|
165
|
-
var R, O, N;
|
|
166
|
-
let u = e.focusedKey != null ? (R = t.getKeyAbove) === null || R === void 0 ? void 0 : R.call(t, e.focusedKey) : (O = t.getLastKey) === null || O === void 0 ? void 0 : O.call(t);
|
|
167
|
-
u == null && c && (u = (N = t.getLastKey) === null || N === void 0 ? void 0 : N.call(t, e.focusedKey)), u != null && (o.preventDefault(), s(u));
|
|
168
|
-
}
|
|
169
|
-
break;
|
|
170
|
-
case "ArrowLeft":
|
|
171
|
-
if (t.getKeyLeftOf) {
|
|
172
|
-
var _, ee, te;
|
|
173
|
-
let u = e.focusedKey != null ? (_ = t.getKeyLeftOf) === null || _ === void 0 ? void 0 : _.call(t, e.focusedKey) : null;
|
|
174
|
-
u == null && c && (u = y === "rtl" ? (ee = t.getFirstKey) === null || ee === void 0 ? void 0 : ee.call(t, e.focusedKey) : (te = t.getLastKey) === null || te === void 0 ? void 0 : te.call(t, e.focusedKey)), u != null && (o.preventDefault(), s(u, y === "rtl" ? "first" : "last"));
|
|
175
|
-
}
|
|
176
|
-
break;
|
|
177
|
-
case "ArrowRight":
|
|
178
|
-
if (t.getKeyRightOf) {
|
|
179
|
-
var le, ie, ne;
|
|
180
|
-
let u = e.focusedKey != null ? (le = t.getKeyRightOf) === null || le === void 0 ? void 0 : le.call(t, e.focusedKey) : null;
|
|
181
|
-
u == null && c && (u = y === "rtl" ? (ie = t.getLastKey) === null || ie === void 0 ? void 0 : ie.call(t, e.focusedKey) : (ne = t.getFirstKey) === null || ne === void 0 ? void 0 : ne.call(t, e.focusedKey)), u != null && (o.preventDefault(), s(u, y === "rtl" ? "last" : "first"));
|
|
182
|
-
}
|
|
183
|
-
break;
|
|
184
|
-
case "Home":
|
|
185
|
-
if (t.getFirstKey) {
|
|
186
|
-
if (e.focusedKey === null && o.shiftKey) return;
|
|
187
|
-
o.preventDefault();
|
|
188
|
-
let u = t.getFirstKey(e.focusedKey, H(o));
|
|
189
|
-
e.setFocusedKey(u), u != null && (H(o) && o.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(u) : K && e.replaceSelection(u));
|
|
190
|
-
}
|
|
191
|
-
break;
|
|
192
|
-
case "End":
|
|
193
|
-
if (t.getLastKey) {
|
|
194
|
-
if (e.focusedKey === null && o.shiftKey) return;
|
|
195
|
-
o.preventDefault();
|
|
196
|
-
let u = t.getLastKey(e.focusedKey, H(o));
|
|
197
|
-
e.setFocusedKey(u), u != null && (H(o) && o.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(u) : K && e.replaceSelection(u));
|
|
198
|
-
}
|
|
199
|
-
break;
|
|
200
|
-
case "PageDown":
|
|
201
|
-
if (t.getKeyPageBelow && e.focusedKey != null) {
|
|
202
|
-
let u = t.getKeyPageBelow(e.focusedKey);
|
|
203
|
-
u != null && (o.preventDefault(), s(u));
|
|
204
|
-
}
|
|
205
|
-
break;
|
|
206
|
-
case "PageUp":
|
|
207
|
-
if (t.getKeyPageAbove && e.focusedKey != null) {
|
|
208
|
-
let u = t.getKeyPageAbove(e.focusedKey);
|
|
209
|
-
u != null && (o.preventDefault(), s(u));
|
|
210
|
-
}
|
|
211
|
-
break;
|
|
212
|
-
case "a":
|
|
213
|
-
H(o) && e.selectionMode === "multiple" && d !== !0 && (o.preventDefault(), e.selectAll());
|
|
214
|
-
break;
|
|
215
|
-
case "Escape":
|
|
216
|
-
a === "clearSelection" && !r && e.selectedKeys.size !== 0 && (o.stopPropagation(), o.preventDefault(), e.clearSelection());
|
|
217
|
-
break;
|
|
218
|
-
case "Tab":
|
|
219
|
-
if (!v) {
|
|
220
|
-
if (o.shiftKey) l.current.focus();
|
|
221
|
-
else {
|
|
222
|
-
let u = Re(l.current, {
|
|
223
|
-
tabbable: !0
|
|
224
|
-
}), z, U;
|
|
225
|
-
do
|
|
226
|
-
U = u.lastChild(), U && (z = U);
|
|
227
|
-
while (U);
|
|
228
|
-
z && !z.contains(document.activeElement) && ue(z);
|
|
229
|
-
}
|
|
230
|
-
break;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}, p = x({
|
|
234
|
-
top: 0,
|
|
235
|
-
left: 0
|
|
236
|
-
});
|
|
237
|
-
J(b, "scroll", m ? void 0 : () => {
|
|
238
|
-
var o, f, s, g;
|
|
239
|
-
p.current = {
|
|
240
|
-
top: (s = (o = b.current) === null || o === void 0 ? void 0 : o.scrollTop) !== null && s !== void 0 ? s : 0,
|
|
241
|
-
left: (g = (f = b.current) === null || f === void 0 ? void 0 : f.scrollLeft) !== null && g !== void 0 ? g : 0
|
|
242
|
-
};
|
|
243
|
-
});
|
|
244
|
-
let F = (o) => {
|
|
245
|
-
if (e.isFocused) {
|
|
246
|
-
o.currentTarget.contains(o.target) || e.setFocused(!1);
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
249
|
-
if (o.currentTarget.contains(o.target)) {
|
|
250
|
-
if (e.setFocused(!0), e.focusedKey == null) {
|
|
251
|
-
var f, s;
|
|
252
|
-
let D = (O) => {
|
|
253
|
-
O != null && (e.setFocusedKey(O), K && !e.isSelected(O) && e.replaceSelection(O));
|
|
254
|
-
}, R = o.relatedTarget;
|
|
255
|
-
var g, T;
|
|
256
|
-
R && o.currentTarget.compareDocumentPosition(R) & Node.DOCUMENT_POSITION_FOLLOWING ? D((g = e.lastSelectedKey) !== null && g !== void 0 ? g : (f = t.getLastKey) === null || f === void 0 ? void 0 : f.call(t)) : D((T = e.firstSelectedKey) !== null && T !== void 0 ? T : (s = t.getFirstKey) === null || s === void 0 ? void 0 : s.call(t));
|
|
257
|
-
} else !m && b.current && (b.current.scrollTop = p.current.top, b.current.scrollLeft = p.current.left);
|
|
258
|
-
if (e.focusedKey != null && b.current) {
|
|
259
|
-
let D = re(l, e.focusedKey);
|
|
260
|
-
D instanceof HTMLElement && (!D.contains(document.activeElement) && !$ && ue(D), ve() === "keyboard" && pe(D, {
|
|
261
|
-
containingElement: l.current
|
|
262
|
-
}));
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}, A = (o) => {
|
|
266
|
-
o.currentTarget.contains(o.relatedTarget) || e.setFocused(!1);
|
|
267
|
-
}, I = x(!1);
|
|
268
|
-
J(l, Ge, $ ? (o) => {
|
|
269
|
-
let { detail: f } = o;
|
|
270
|
-
o.stopPropagation(), e.setFocused(!0), (f == null ? void 0 : f.focusStrategy) === "first" && (I.current = !0);
|
|
271
|
-
} : void 0);
|
|
272
|
-
let M = ye(() => {
|
|
273
|
-
var o, f;
|
|
274
|
-
let s = (f = (o = t.getFirstKey) === null || o === void 0 ? void 0 : o.call(t)) !== null && f !== void 0 ? f : null;
|
|
275
|
-
if (s == null) {
|
|
276
|
-
let g = xe();
|
|
277
|
-
Te(l.current), Ee(g, null), e.collection.size > 0 && (I.current = !1);
|
|
278
|
-
} else
|
|
279
|
-
e.setFocusedKey(s), I.current = !1;
|
|
280
|
-
});
|
|
281
|
-
be(() => {
|
|
282
|
-
I.current && M();
|
|
283
|
-
}, [
|
|
284
|
-
e.collection,
|
|
285
|
-
M
|
|
286
|
-
]);
|
|
287
|
-
let P = ye(() => {
|
|
288
|
-
e.collection.size > 0 && (I.current = !1);
|
|
289
|
-
});
|
|
290
|
-
be(() => {
|
|
291
|
-
P();
|
|
292
|
-
}, [
|
|
293
|
-
e.focusedKey,
|
|
294
|
-
P
|
|
295
|
-
]), J(l, We, $ ? (o) => {
|
|
296
|
-
var f;
|
|
297
|
-
o.stopPropagation(), e.setFocused(!1), !((f = o.detail) === null || f === void 0) && f.clearFocusKey && e.setFocusedKey(null);
|
|
298
|
-
} : void 0);
|
|
299
|
-
const W = x(i), B = x(!1);
|
|
300
|
-
q(() => {
|
|
301
|
-
if (W.current) {
|
|
302
|
-
var o, f;
|
|
303
|
-
let T = null;
|
|
304
|
-
var s;
|
|
305
|
-
i === "first" && (T = (s = (o = t.getFirstKey) === null || o === void 0 ? void 0 : o.call(t)) !== null && s !== void 0 ? s : null);
|
|
306
|
-
var g;
|
|
307
|
-
i === "last" && (T = (g = (f = t.getLastKey) === null || f === void 0 ? void 0 : f.call(t)) !== null && g !== void 0 ? g : null);
|
|
308
|
-
let D = e.selectedKeys;
|
|
309
|
-
if (D.size) {
|
|
310
|
-
for (let R of D) if (e.canSelectItem(R)) {
|
|
311
|
-
T = R;
|
|
312
|
-
break;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
e.setFocused(!0), e.setFocusedKey(T), T == null && !$ && l.current && ae(l.current), e.collection.size > 0 && (W.current = !1, B.current = !0);
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
let L = x(e.focusedKey), w = x(null);
|
|
319
|
-
q(() => {
|
|
320
|
-
if (e.isFocused && e.focusedKey != null && (e.focusedKey !== L.current || B.current) && b.current && l.current) {
|
|
321
|
-
let o = ve(), f = re(l, e.focusedKey);
|
|
322
|
-
if (!(f instanceof HTMLElement))
|
|
323
|
-
return;
|
|
324
|
-
(o === "keyboard" || B.current) && (w.current && cancelAnimationFrame(w.current), w.current = requestAnimationFrame(() => {
|
|
325
|
-
b.current && (Be(b.current, f), o !== "virtual" && pe(f, {
|
|
326
|
-
containingElement: l.current
|
|
327
|
-
}));
|
|
328
|
-
}));
|
|
329
|
-
}
|
|
330
|
-
!$ && e.isFocused && e.focusedKey == null && L.current != null && l.current && ae(l.current), L.current = e.focusedKey, B.current = !1;
|
|
331
|
-
}), q(() => () => {
|
|
332
|
-
w.current && cancelAnimationFrame(w.current);
|
|
333
|
-
}, []), J(l, "react-aria-focus-scope-restore", (o) => {
|
|
334
|
-
o.preventDefault(), e.setFocused(!0);
|
|
335
|
-
});
|
|
336
|
-
let G = {
|
|
337
|
-
onKeyDown: S,
|
|
338
|
-
onFocus: F,
|
|
339
|
-
onBlur: A,
|
|
340
|
-
onMouseDown(o) {
|
|
341
|
-
b.current === o.target && o.preventDefault();
|
|
342
|
-
}
|
|
343
|
-
}, { typeSelectProps: Q } = Ne({
|
|
344
|
-
keyboardDelegate: t,
|
|
345
|
-
selectionManager: e
|
|
346
|
-
});
|
|
347
|
-
E || (G = Y(Q, G));
|
|
348
|
-
let Z;
|
|
349
|
-
$ || (Z = e.focusedKey == null ? 0 : -1);
|
|
350
|
-
let X = Je(e.collection);
|
|
351
|
-
return {
|
|
352
|
-
collectionProps: Y(G, {
|
|
353
|
-
tabIndex: Z,
|
|
354
|
-
"data-collection": X
|
|
355
|
-
})
|
|
356
|
-
};
|
|
357
|
-
}
|
|
358
|
-
function gt(n) {
|
|
359
|
-
let { id: e, selectionManager: t, key: l, ref: i, shouldSelectOnPressUp: c, shouldUseVirtualFocus: r, focus: d, isDisabled: a, onAction: K, allowsDifferentPressOrigin: E, linkBehavior: $ = "action" } = n, v = De();
|
|
360
|
-
e = Fe(e);
|
|
361
|
-
let m = (s) => {
|
|
362
|
-
if (s.pointerType === "keyboard" && fe(s)) t.toggleSelection(l);
|
|
363
|
-
else {
|
|
364
|
-
if (t.selectionMode === "none") return;
|
|
365
|
-
if (t.isLink(l)) {
|
|
366
|
-
if ($ === "selection" && i.current) {
|
|
367
|
-
let g = t.getItemProps(l);
|
|
368
|
-
v.open(i.current, s, g.href, g.routerOptions), t.setSelectedKeys(t.selectedKeys);
|
|
369
|
-
return;
|
|
370
|
-
} else if ($ === "override" || $ === "none") return;
|
|
371
|
-
}
|
|
372
|
-
t.selectionMode === "single" ? t.isSelected(l) && !t.disallowEmptySelection ? t.toggleSelection(l) : t.replaceSelection(l) : s && s.shiftKey ? t.extendSelection(l) : t.selectionBehavior === "toggle" || s && (H(s) || s.pointerType === "touch" || s.pointerType === "virtual") ? t.toggleSelection(l) : t.replaceSelection(l);
|
|
373
|
-
}
|
|
374
|
-
};
|
|
375
|
-
q(() => {
|
|
376
|
-
l === t.focusedKey && t.isFocused && (r ? Te(i.current) : d ? d() : document.activeElement !== i.current && i.current && ae(i.current));
|
|
377
|
-
}, [
|
|
378
|
-
i,
|
|
379
|
-
l,
|
|
380
|
-
t.focusedKey,
|
|
381
|
-
t.childFocusStrategy,
|
|
382
|
-
t.isFocused,
|
|
383
|
-
r
|
|
384
|
-
]), a = a || t.isDisabled(l);
|
|
385
|
-
let b = {};
|
|
386
|
-
!r && !a ? b = {
|
|
387
|
-
tabIndex: l === t.focusedKey ? 0 : -1,
|
|
388
|
-
onFocus(s) {
|
|
389
|
-
s.target === i.current && t.setFocusedKey(l);
|
|
390
|
-
}
|
|
391
|
-
} : a && (b.onMouseDown = (s) => {
|
|
392
|
-
s.preventDefault();
|
|
393
|
-
});
|
|
394
|
-
let k = t.isLink(l) && $ === "override", y = t.isLink(l) && $ !== "selection" && $ !== "none", h = !a && t.canSelectItem(l) && !k, S = (K || y) && !a, p = S && (t.selectionBehavior === "replace" ? !h : !h || t.isEmpty), F = S && h && t.selectionBehavior === "replace", A = p || F, I = x(null), M = A && h, P = x(!1), W = x(!1), B = t.getItemProps(l), L = (s) => {
|
|
395
|
-
K && K(), y && i.current && v.open(i.current, s, B.href, B.routerOptions);
|
|
396
|
-
}, w = {
|
|
397
|
-
ref: i
|
|
398
|
-
};
|
|
399
|
-
if (c ? (w.onPressStart = (s) => {
|
|
400
|
-
I.current = s.pointerType, P.current = M, s.pointerType === "keyboard" && (!A || me()) && m(s);
|
|
401
|
-
}, E ? (w.onPressUp = p ? void 0 : (s) => {
|
|
402
|
-
s.pointerType === "mouse" && h && m(s);
|
|
403
|
-
}, w.onPress = p ? L : (s) => {
|
|
404
|
-
s.pointerType !== "keyboard" && s.pointerType !== "mouse" && h && m(s);
|
|
405
|
-
}) : w.onPress = (s) => {
|
|
406
|
-
if (p || F && s.pointerType !== "mouse") {
|
|
407
|
-
if (s.pointerType === "keyboard" && !$e()) return;
|
|
408
|
-
L(s);
|
|
409
|
-
} else s.pointerType !== "keyboard" && h && m(s);
|
|
410
|
-
}) : (w.onPressStart = (s) => {
|
|
411
|
-
I.current = s.pointerType, P.current = M, W.current = p, h && (s.pointerType === "mouse" && !p || s.pointerType === "keyboard" && (!S || me())) && m(s);
|
|
412
|
-
}, w.onPress = (s) => {
|
|
413
|
-
(s.pointerType === "touch" || s.pointerType === "pen" || s.pointerType === "virtual" || s.pointerType === "keyboard" && A && $e() || s.pointerType === "mouse" && W.current) && (A ? L(s) : h && m(s));
|
|
414
|
-
}), b["data-collection"] = Qe(t.collection), b["data-key"] = l, w.preventFocusOnPress = r, r && (w = Y(w, {
|
|
415
|
-
onPressStart(s) {
|
|
416
|
-
s.pointerType !== "touch" && (t.setFocused(!0), t.setFocusedKey(l));
|
|
417
|
-
},
|
|
418
|
-
onPress(s) {
|
|
419
|
-
s.pointerType === "touch" && (t.setFocused(!0), t.setFocusedKey(l));
|
|
420
|
-
}
|
|
421
|
-
})), B)
|
|
422
|
-
for (let s of [
|
|
423
|
-
"onPressStart",
|
|
424
|
-
"onPressEnd",
|
|
425
|
-
"onPressChange",
|
|
426
|
-
"onPress",
|
|
427
|
-
"onPressUp",
|
|
428
|
-
"onClick"
|
|
429
|
-
]) B[s] && (w[s] = Ce(w[s], B[s]));
|
|
430
|
-
let { pressProps: G, isPressed: Q } = Pe(w), Z = F ? (s) => {
|
|
431
|
-
I.current === "mouse" && (s.stopPropagation(), s.preventDefault(), L(s));
|
|
432
|
-
} : void 0, { longPressProps: X } = je({
|
|
433
|
-
isDisabled: !M,
|
|
434
|
-
onLongPress(s) {
|
|
435
|
-
s.pointerType === "touch" && (m(s), t.setSelectionBehavior("toggle"));
|
|
436
|
-
}
|
|
437
|
-
}), o = (s) => {
|
|
438
|
-
I.current === "touch" && P.current && s.preventDefault();
|
|
439
|
-
}, f = $ !== "none" && t.isLink(l) ? (s) => {
|
|
440
|
-
Me.isOpening || s.preventDefault();
|
|
441
|
-
} : void 0;
|
|
442
|
-
return {
|
|
443
|
-
itemProps: Y(
|
|
444
|
-
b,
|
|
445
|
-
h || p || r && !a ? G : {},
|
|
446
|
-
M ? X : {},
|
|
447
|
-
{
|
|
448
|
-
onDoubleClick: Z,
|
|
449
|
-
onDragStartCapture: o,
|
|
450
|
-
onClick: f,
|
|
451
|
-
id: e
|
|
452
|
-
},
|
|
453
|
-
// Prevent DOM focus from moving on mouse down when using virtual focus
|
|
454
|
-
r ? {
|
|
455
|
-
onMouseDown: (s) => s.preventDefault()
|
|
456
|
-
} : void 0
|
|
457
|
-
),
|
|
458
|
-
isPressed: Q,
|
|
459
|
-
isSelected: t.isSelected(l),
|
|
460
|
-
isFocused: t.isFocused && t.focusedKey === l,
|
|
461
|
-
isDisabled: a,
|
|
462
|
-
allowsSelection: h,
|
|
463
|
-
hasAction: A
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
function $e() {
|
|
467
|
-
let n = window.event;
|
|
468
|
-
return (n == null ? void 0 : n.key) === "Enter";
|
|
469
|
-
}
|
|
470
|
-
function me() {
|
|
471
|
-
let n = window.event;
|
|
472
|
-
return (n == null ? void 0 : n.key) === " " || (n == null ? void 0 : n.code) === "Space";
|
|
473
|
-
}
|
|
474
|
-
class et {
|
|
475
|
-
build(e, t) {
|
|
476
|
-
return this.context = t, ge(() => this.iterateCollection(e));
|
|
477
|
-
}
|
|
478
|
-
*iterateCollection(e) {
|
|
479
|
-
let { children: t, items: l } = e;
|
|
480
|
-
if (V.isValidElement(t) && t.type === V.Fragment) yield* this.iterateCollection({
|
|
481
|
-
children: t.props.children,
|
|
482
|
-
items: l
|
|
483
|
-
});
|
|
484
|
-
else if (typeof t == "function") {
|
|
485
|
-
if (!l) throw new Error("props.children was a function but props.items is missing");
|
|
486
|
-
let i = 0;
|
|
487
|
-
for (let c of l)
|
|
488
|
-
yield* this.getFullNode({
|
|
489
|
-
value: c,
|
|
490
|
-
index: i
|
|
491
|
-
}, {
|
|
492
|
-
renderer: t
|
|
493
|
-
}), i++;
|
|
494
|
-
} else {
|
|
495
|
-
let i = [];
|
|
496
|
-
V.Children.forEach(t, (r) => {
|
|
497
|
-
r && i.push(r);
|
|
498
|
-
});
|
|
499
|
-
let c = 0;
|
|
500
|
-
for (let r of i) {
|
|
501
|
-
let d = this.getFullNode({
|
|
502
|
-
element: r,
|
|
503
|
-
index: c
|
|
504
|
-
}, {});
|
|
505
|
-
for (let a of d)
|
|
506
|
-
c++, yield a;
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
getKey(e, t, l, i) {
|
|
511
|
-
if (e.key != null) return e.key;
|
|
512
|
-
if (t.type === "cell" && t.key != null) return `${i}${t.key}`;
|
|
513
|
-
let c = t.value;
|
|
514
|
-
if (c != null) {
|
|
515
|
-
var r;
|
|
516
|
-
let d = (r = c.key) !== null && r !== void 0 ? r : c.id;
|
|
517
|
-
if (d == null) throw new Error("No key found for item");
|
|
518
|
-
return d;
|
|
519
|
-
}
|
|
520
|
-
return i ? `${i}.${t.index}` : `$.${t.index}`;
|
|
521
|
-
}
|
|
522
|
-
getChildState(e, t) {
|
|
523
|
-
return {
|
|
524
|
-
renderer: t.renderer || e.renderer
|
|
525
|
-
};
|
|
526
|
-
}
|
|
527
|
-
*getFullNode(e, t, l, i) {
|
|
528
|
-
if (V.isValidElement(e.element) && e.element.type === V.Fragment) {
|
|
529
|
-
let y = [];
|
|
530
|
-
V.Children.forEach(e.element.props.children, (S) => {
|
|
531
|
-
y.push(S);
|
|
532
|
-
});
|
|
533
|
-
var c;
|
|
534
|
-
let h = (c = e.index) !== null && c !== void 0 ? c : 0;
|
|
535
|
-
for (const S of y) yield* this.getFullNode({
|
|
536
|
-
element: S,
|
|
537
|
-
index: h++
|
|
538
|
-
}, t, l, i);
|
|
539
|
-
return;
|
|
540
|
-
}
|
|
541
|
-
let r = e.element;
|
|
542
|
-
if (!r && e.value && t && t.renderer) {
|
|
543
|
-
let y = this.cache.get(e.value);
|
|
544
|
-
if (y && (!y.shouldInvalidate || !y.shouldInvalidate(this.context))) {
|
|
545
|
-
y.index = e.index, y.parentKey = i ? i.key : null, yield y;
|
|
546
|
-
return;
|
|
547
|
-
}
|
|
548
|
-
r = t.renderer(e.value);
|
|
549
|
-
}
|
|
550
|
-
if (V.isValidElement(r)) {
|
|
551
|
-
let y = r.type;
|
|
552
|
-
if (typeof y != "function" && typeof y.getCollectionNode != "function") {
|
|
553
|
-
let F = r.type;
|
|
554
|
-
throw new Error(`Unknown element <${F}> in collection.`);
|
|
555
|
-
}
|
|
556
|
-
let h = y.getCollectionNode(r.props, this.context);
|
|
557
|
-
var d;
|
|
558
|
-
let S = (d = e.index) !== null && d !== void 0 ? d : 0, p = h.next();
|
|
559
|
-
for (; !p.done && p.value; ) {
|
|
560
|
-
let F = p.value;
|
|
561
|
-
e.index = S;
|
|
562
|
-
var a;
|
|
563
|
-
let A = (a = F.key) !== null && a !== void 0 ? a : null;
|
|
564
|
-
A == null && (A = F.element ? null : this.getKey(r, e, t, l));
|
|
565
|
-
let M = [
|
|
566
|
-
...this.getFullNode({
|
|
567
|
-
...F,
|
|
568
|
-
key: A,
|
|
569
|
-
index: S,
|
|
570
|
-
wrapper: tt(e.wrapper, F.wrapper)
|
|
571
|
-
}, this.getChildState(t, F), l ? `${l}${r.key}` : r.key, i)
|
|
572
|
-
];
|
|
573
|
-
for (let P of M) {
|
|
574
|
-
var K, E;
|
|
575
|
-
P.value = (E = (K = F.value) !== null && K !== void 0 ? K : e.value) !== null && E !== void 0 ? E : null, P.value && this.cache.set(P.value, P);
|
|
576
|
-
var $;
|
|
577
|
-
if (e.type && P.type !== e.type) throw new Error(`Unsupported type <${oe(P.type)}> in <${oe(($ = i == null ? void 0 : i.type) !== null && $ !== void 0 ? $ : "unknown parent type")}>. Only <${oe(e.type)}> is supported.`);
|
|
578
|
-
S++, yield P;
|
|
579
|
-
}
|
|
580
|
-
p = h.next(M);
|
|
581
|
-
}
|
|
582
|
-
return;
|
|
583
|
-
}
|
|
584
|
-
if (e.key == null || e.type == null) return;
|
|
585
|
-
let v = this;
|
|
586
|
-
var m, b;
|
|
587
|
-
let k = {
|
|
588
|
-
type: e.type,
|
|
589
|
-
props: e.props,
|
|
590
|
-
key: e.key,
|
|
591
|
-
parentKey: i ? i.key : null,
|
|
592
|
-
value: (m = e.value) !== null && m !== void 0 ? m : null,
|
|
593
|
-
level: i ? i.level + 1 : 0,
|
|
594
|
-
index: e.index,
|
|
595
|
-
rendered: e.rendered,
|
|
596
|
-
textValue: (b = e.textValue) !== null && b !== void 0 ? b : "",
|
|
597
|
-
"aria-label": e["aria-label"],
|
|
598
|
-
wrapper: e.wrapper,
|
|
599
|
-
shouldInvalidate: e.shouldInvalidate,
|
|
600
|
-
hasChildNodes: e.hasChildNodes || !1,
|
|
601
|
-
childNodes: ge(function* () {
|
|
602
|
-
if (!e.hasChildNodes || !e.childNodes) return;
|
|
603
|
-
let y = 0;
|
|
604
|
-
for (let h of e.childNodes()) {
|
|
605
|
-
h.key != null && (h.key = `${k.key}${h.key}`);
|
|
606
|
-
let S = v.getFullNode({
|
|
607
|
-
...h,
|
|
608
|
-
index: y
|
|
609
|
-
}, v.getChildState(t, h), k.key, k);
|
|
610
|
-
for (let p of S)
|
|
611
|
-
y++, yield p;
|
|
612
|
-
}
|
|
613
|
-
})
|
|
614
|
-
};
|
|
615
|
-
yield k;
|
|
616
|
-
}
|
|
617
|
-
constructor() {
|
|
618
|
-
this.cache = /* @__PURE__ */ new WeakMap();
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
function ge(n) {
|
|
622
|
-
let e = [], t = null;
|
|
623
|
-
return {
|
|
624
|
-
*[Symbol.iterator]() {
|
|
625
|
-
for (let l of e) yield l;
|
|
626
|
-
t || (t = n());
|
|
627
|
-
for (let l of t)
|
|
628
|
-
e.push(l), yield l;
|
|
629
|
-
}
|
|
630
|
-
};
|
|
631
|
-
}
|
|
632
|
-
function tt(n, e) {
|
|
633
|
-
if (n && e) return (t) => n(e(t));
|
|
634
|
-
if (n) return n;
|
|
635
|
-
if (e) return e;
|
|
636
|
-
}
|
|
637
|
-
function oe(n) {
|
|
638
|
-
return n[0].toUpperCase() + n.slice(1);
|
|
639
|
-
}
|
|
640
|
-
function Kt(n, e, t) {
|
|
641
|
-
let l = j(() => new et(), []), { children: i, items: c, collection: r } = n;
|
|
642
|
-
return j(() => {
|
|
643
|
-
if (r) return r;
|
|
644
|
-
let a = l.build({
|
|
645
|
-
children: i,
|
|
646
|
-
items: c
|
|
647
|
-
}, t);
|
|
648
|
-
return e(a);
|
|
649
|
-
}, [
|
|
650
|
-
l,
|
|
651
|
-
i,
|
|
652
|
-
c,
|
|
653
|
-
r,
|
|
654
|
-
t,
|
|
655
|
-
e
|
|
656
|
-
]);
|
|
657
|
-
}
|
|
658
|
-
function lt(n, e) {
|
|
659
|
-
return typeof e.getChildren == "function" ? e.getChildren(n.key) : n.childNodes;
|
|
660
|
-
}
|
|
661
|
-
function it(n) {
|
|
662
|
-
return nt(n, 0);
|
|
663
|
-
}
|
|
664
|
-
function nt(n, e) {
|
|
665
|
-
if (e < 0) return;
|
|
666
|
-
let t = 0;
|
|
667
|
-
for (let l of n) {
|
|
668
|
-
if (t === e) return l;
|
|
669
|
-
t++;
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
function St(n) {
|
|
673
|
-
let e;
|
|
674
|
-
for (let t of n) e = t;
|
|
675
|
-
return e;
|
|
676
|
-
}
|
|
677
|
-
function ce(n, e, t) {
|
|
678
|
-
if (e.parentKey === t.parentKey) return e.index - t.index;
|
|
679
|
-
let l = [
|
|
680
|
-
...Ke(n, e),
|
|
681
|
-
e
|
|
682
|
-
], i = [
|
|
683
|
-
...Ke(n, t),
|
|
684
|
-
t
|
|
685
|
-
], c = l.slice(0, i.length).findIndex((r, d) => r !== i[d]);
|
|
686
|
-
return c !== -1 ? (e = l[c], t = i[c], e.index - t.index) : l.findIndex((r) => r === t) >= 0 ? 1 : (i.findIndex((r) => r === e) >= 0, -1);
|
|
687
|
-
}
|
|
688
|
-
function Ke(n, e) {
|
|
689
|
-
let t = [], l = e;
|
|
690
|
-
for (; (l == null ? void 0 : l.parentKey) != null; )
|
|
691
|
-
l = n.getItem(l.parentKey), l && t.unshift(l);
|
|
692
|
-
return t;
|
|
693
|
-
}
|
|
694
|
-
class C extends Set {
|
|
695
|
-
constructor(e, t, l) {
|
|
696
|
-
super(e), e instanceof C ? (this.anchorKey = t ?? e.anchorKey, this.currentKey = l ?? e.currentKey) : (this.anchorKey = t ?? null, this.currentKey = l ?? null);
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
function st(n, e) {
|
|
700
|
-
if (n.size !== e.size) return !1;
|
|
701
|
-
for (let t of n)
|
|
702
|
-
if (!e.has(t)) return !1;
|
|
703
|
-
return !0;
|
|
704
|
-
}
|
|
705
|
-
function wt(n) {
|
|
706
|
-
let { selectionMode: e = "none", disallowEmptySelection: t = !1, allowDuplicateSelectionEvents: l, selectionBehavior: i = "toggle", disabledBehavior: c = "all" } = n, r = x(!1), [, d] = se(!1), a = x(null), K = x(null), [, E] = se(null), $ = j(() => Se(n.selectedKeys), [
|
|
707
|
-
n.selectedKeys
|
|
708
|
-
]), v = j(() => Se(n.defaultSelectedKeys, new C()), [
|
|
709
|
-
n.defaultSelectedKeys
|
|
710
|
-
]), [m, b] = He($, v, n.onSelectionChange), k = j(() => n.disabledKeys ? new Set(n.disabledKeys) : /* @__PURE__ */ new Set(), [
|
|
711
|
-
n.disabledKeys
|
|
712
|
-
]), [y, h] = se(i);
|
|
713
|
-
i === "replace" && y === "toggle" && typeof m == "object" && m.size === 0 && h("replace");
|
|
714
|
-
let S = x(i);
|
|
715
|
-
return q(() => {
|
|
716
|
-
i !== S.current && (h(i), S.current = i);
|
|
717
|
-
}, [
|
|
718
|
-
i
|
|
719
|
-
]), {
|
|
720
|
-
selectionMode: e,
|
|
721
|
-
disallowEmptySelection: t,
|
|
722
|
-
selectionBehavior: y,
|
|
723
|
-
setSelectionBehavior: h,
|
|
724
|
-
get isFocused() {
|
|
725
|
-
return r.current;
|
|
726
|
-
},
|
|
727
|
-
setFocused(p) {
|
|
728
|
-
r.current = p, d(p);
|
|
729
|
-
},
|
|
730
|
-
get focusedKey() {
|
|
731
|
-
return a.current;
|
|
732
|
-
},
|
|
733
|
-
get childFocusStrategy() {
|
|
734
|
-
return K.current;
|
|
735
|
-
},
|
|
736
|
-
setFocusedKey(p, F = "first") {
|
|
737
|
-
a.current = p, K.current = F, E(p);
|
|
738
|
-
},
|
|
739
|
-
selectedKeys: m,
|
|
740
|
-
setSelectedKeys(p) {
|
|
741
|
-
(l || !st(p, m)) && b(p);
|
|
742
|
-
},
|
|
743
|
-
disabledKeys: k,
|
|
744
|
-
disabledBehavior: c
|
|
745
|
-
};
|
|
746
|
-
}
|
|
747
|
-
function Se(n, e) {
|
|
748
|
-
return n ? n === "all" ? "all" : new C(n) : e;
|
|
749
|
-
}
|
|
750
|
-
class Ae {
|
|
751
|
-
/**
|
|
752
|
-
* The type of selection that is allowed in the collection.
|
|
753
|
-
*/
|
|
754
|
-
get selectionMode() {
|
|
755
|
-
return this.state.selectionMode;
|
|
756
|
-
}
|
|
757
|
-
/**
|
|
758
|
-
* Whether the collection allows empty selection.
|
|
759
|
-
*/
|
|
760
|
-
get disallowEmptySelection() {
|
|
761
|
-
return this.state.disallowEmptySelection;
|
|
762
|
-
}
|
|
763
|
-
/**
|
|
764
|
-
* The selection behavior for the collection.
|
|
765
|
-
*/
|
|
766
|
-
get selectionBehavior() {
|
|
767
|
-
return this.state.selectionBehavior;
|
|
768
|
-
}
|
|
769
|
-
/**
|
|
770
|
-
* Sets the selection behavior for the collection.
|
|
771
|
-
*/
|
|
772
|
-
setSelectionBehavior(e) {
|
|
773
|
-
this.state.setSelectionBehavior(e);
|
|
774
|
-
}
|
|
775
|
-
/**
|
|
776
|
-
* Whether the collection is currently focused.
|
|
777
|
-
*/
|
|
778
|
-
get isFocused() {
|
|
779
|
-
return this.state.isFocused;
|
|
780
|
-
}
|
|
781
|
-
/**
|
|
782
|
-
* Sets whether the collection is focused.
|
|
783
|
-
*/
|
|
784
|
-
setFocused(e) {
|
|
785
|
-
this.state.setFocused(e);
|
|
786
|
-
}
|
|
787
|
-
/**
|
|
788
|
-
* The current focused key in the collection.
|
|
789
|
-
*/
|
|
790
|
-
get focusedKey() {
|
|
791
|
-
return this.state.focusedKey;
|
|
792
|
-
}
|
|
793
|
-
/** Whether the first or last child of the focused key should receive focus. */
|
|
794
|
-
get childFocusStrategy() {
|
|
795
|
-
return this.state.childFocusStrategy;
|
|
796
|
-
}
|
|
797
|
-
/**
|
|
798
|
-
* Sets the focused key.
|
|
799
|
-
*/
|
|
800
|
-
setFocusedKey(e, t) {
|
|
801
|
-
(e == null || this.collection.getItem(e)) && this.state.setFocusedKey(e, t);
|
|
802
|
-
}
|
|
803
|
-
/**
|
|
804
|
-
* The currently selected keys in the collection.
|
|
805
|
-
*/
|
|
806
|
-
get selectedKeys() {
|
|
807
|
-
return this.state.selectedKeys === "all" ? new Set(this.getSelectAllKeys()) : this.state.selectedKeys;
|
|
808
|
-
}
|
|
809
|
-
/**
|
|
810
|
-
* The raw selection value for the collection.
|
|
811
|
-
* Either 'all' for select all, or a set of keys.
|
|
812
|
-
*/
|
|
813
|
-
get rawSelection() {
|
|
814
|
-
return this.state.selectedKeys;
|
|
815
|
-
}
|
|
816
|
-
/**
|
|
817
|
-
* Returns whether a key is selected.
|
|
818
|
-
*/
|
|
819
|
-
isSelected(e) {
|
|
820
|
-
if (this.state.selectionMode === "none") return !1;
|
|
821
|
-
let t = this.getKey(e);
|
|
822
|
-
return t == null ? !1 : this.state.selectedKeys === "all" ? this.canSelectItem(t) : this.state.selectedKeys.has(t);
|
|
823
|
-
}
|
|
824
|
-
/**
|
|
825
|
-
* Whether the selection is empty.
|
|
826
|
-
*/
|
|
827
|
-
get isEmpty() {
|
|
828
|
-
return this.state.selectedKeys !== "all" && this.state.selectedKeys.size === 0;
|
|
829
|
-
}
|
|
830
|
-
/**
|
|
831
|
-
* Whether all items in the collection are selected.
|
|
832
|
-
*/
|
|
833
|
-
get isSelectAll() {
|
|
834
|
-
if (this.isEmpty) return !1;
|
|
835
|
-
if (this.state.selectedKeys === "all") return !0;
|
|
836
|
-
if (this._isSelectAll != null) return this._isSelectAll;
|
|
837
|
-
let e = this.getSelectAllKeys(), t = this.state.selectedKeys;
|
|
838
|
-
return this._isSelectAll = e.every((l) => t.has(l)), this._isSelectAll;
|
|
839
|
-
}
|
|
840
|
-
get firstSelectedKey() {
|
|
841
|
-
let e = null;
|
|
842
|
-
for (let l of this.state.selectedKeys) {
|
|
843
|
-
let i = this.collection.getItem(l);
|
|
844
|
-
(!e || i && ce(this.collection, i, e) < 0) && (e = i);
|
|
845
|
-
}
|
|
846
|
-
var t;
|
|
847
|
-
return (t = e == null ? void 0 : e.key) !== null && t !== void 0 ? t : null;
|
|
848
|
-
}
|
|
849
|
-
get lastSelectedKey() {
|
|
850
|
-
let e = null;
|
|
851
|
-
for (let l of this.state.selectedKeys) {
|
|
852
|
-
let i = this.collection.getItem(l);
|
|
853
|
-
(!e || i && ce(this.collection, i, e) > 0) && (e = i);
|
|
854
|
-
}
|
|
855
|
-
var t;
|
|
856
|
-
return (t = e == null ? void 0 : e.key) !== null && t !== void 0 ? t : null;
|
|
857
|
-
}
|
|
858
|
-
get disabledKeys() {
|
|
859
|
-
return this.state.disabledKeys;
|
|
860
|
-
}
|
|
861
|
-
get disabledBehavior() {
|
|
862
|
-
return this.state.disabledBehavior;
|
|
863
|
-
}
|
|
864
|
-
/**
|
|
865
|
-
* Extends the selection to the given key.
|
|
866
|
-
*/
|
|
867
|
-
extendSelection(e) {
|
|
868
|
-
if (this.selectionMode === "none") return;
|
|
869
|
-
if (this.selectionMode === "single") {
|
|
870
|
-
this.replaceSelection(e);
|
|
871
|
-
return;
|
|
872
|
-
}
|
|
873
|
-
let t = this.getKey(e);
|
|
874
|
-
if (t == null) return;
|
|
875
|
-
let l;
|
|
876
|
-
if (this.state.selectedKeys === "all") l = new C([
|
|
877
|
-
t
|
|
878
|
-
], t, t);
|
|
879
|
-
else {
|
|
880
|
-
let r = this.state.selectedKeys;
|
|
881
|
-
var i;
|
|
882
|
-
let d = (i = r.anchorKey) !== null && i !== void 0 ? i : t;
|
|
883
|
-
l = new C(r, d, t);
|
|
884
|
-
var c;
|
|
885
|
-
for (let a of this.getKeyRange(d, (c = r.currentKey) !== null && c !== void 0 ? c : t)) l.delete(a);
|
|
886
|
-
for (let a of this.getKeyRange(t, d)) this.canSelectItem(a) && l.add(a);
|
|
887
|
-
}
|
|
888
|
-
this.state.setSelectedKeys(l);
|
|
889
|
-
}
|
|
890
|
-
getKeyRange(e, t) {
|
|
891
|
-
let l = this.collection.getItem(e), i = this.collection.getItem(t);
|
|
892
|
-
return l && i ? ce(this.collection, l, i) <= 0 ? this.getKeyRangeInternal(e, t) : this.getKeyRangeInternal(t, e) : [];
|
|
893
|
-
}
|
|
894
|
-
getKeyRangeInternal(e, t) {
|
|
895
|
-
var l;
|
|
896
|
-
if (!((l = this.layoutDelegate) === null || l === void 0) && l.getKeyRange) return this.layoutDelegate.getKeyRange(e, t);
|
|
897
|
-
let i = [], c = e;
|
|
898
|
-
for (; c != null; ) {
|
|
899
|
-
let r = this.collection.getItem(c);
|
|
900
|
-
if (r && (r.type === "item" || r.type === "cell" && this.allowsCellSelection) && i.push(c), c === t) return i;
|
|
901
|
-
c = this.collection.getKeyAfter(c);
|
|
902
|
-
}
|
|
903
|
-
return [];
|
|
904
|
-
}
|
|
905
|
-
getKey(e) {
|
|
906
|
-
let t = this.collection.getItem(e);
|
|
907
|
-
if (!t || t.type === "cell" && this.allowsCellSelection) return e;
|
|
908
|
-
for (; t && t.type !== "item" && t.parentKey != null; ) t = this.collection.getItem(t.parentKey);
|
|
909
|
-
return !t || t.type !== "item" ? null : t.key;
|
|
910
|
-
}
|
|
911
|
-
/**
|
|
912
|
-
* Toggles whether the given key is selected.
|
|
913
|
-
*/
|
|
914
|
-
toggleSelection(e) {
|
|
915
|
-
if (this.selectionMode === "none") return;
|
|
916
|
-
if (this.selectionMode === "single" && !this.isSelected(e)) {
|
|
917
|
-
this.replaceSelection(e);
|
|
918
|
-
return;
|
|
919
|
-
}
|
|
920
|
-
let t = this.getKey(e);
|
|
921
|
-
if (t == null) return;
|
|
922
|
-
let l = new C(this.state.selectedKeys === "all" ? this.getSelectAllKeys() : this.state.selectedKeys);
|
|
923
|
-
l.has(t) ? l.delete(t) : this.canSelectItem(t) && (l.add(t), l.anchorKey = t, l.currentKey = t), !(this.disallowEmptySelection && l.size === 0) && this.state.setSelectedKeys(l);
|
|
924
|
-
}
|
|
925
|
-
/**
|
|
926
|
-
* Replaces the selection with only the given key.
|
|
927
|
-
*/
|
|
928
|
-
replaceSelection(e) {
|
|
929
|
-
if (this.selectionMode === "none") return;
|
|
930
|
-
let t = this.getKey(e);
|
|
931
|
-
if (t == null) return;
|
|
932
|
-
let l = this.canSelectItem(t) ? new C([
|
|
933
|
-
t
|
|
934
|
-
], t, t) : new C();
|
|
935
|
-
this.state.setSelectedKeys(l);
|
|
936
|
-
}
|
|
937
|
-
/**
|
|
938
|
-
* Replaces the selection with the given keys.
|
|
939
|
-
*/
|
|
940
|
-
setSelectedKeys(e) {
|
|
941
|
-
if (this.selectionMode === "none") return;
|
|
942
|
-
let t = new C();
|
|
943
|
-
for (let l of e) {
|
|
944
|
-
let i = this.getKey(l);
|
|
945
|
-
if (i != null && (t.add(i), this.selectionMode === "single"))
|
|
946
|
-
break;
|
|
947
|
-
}
|
|
948
|
-
this.state.setSelectedKeys(t);
|
|
949
|
-
}
|
|
950
|
-
getSelectAllKeys() {
|
|
951
|
-
let e = [], t = (l) => {
|
|
952
|
-
for (; l != null; ) {
|
|
953
|
-
if (this.canSelectItem(l)) {
|
|
954
|
-
var i;
|
|
955
|
-
let r = this.collection.getItem(l);
|
|
956
|
-
(r == null ? void 0 : r.type) === "item" && e.push(l);
|
|
957
|
-
var c;
|
|
958
|
-
r != null && r.hasChildNodes && (this.allowsCellSelection || r.type !== "item") && t((c = (i = it(lt(r, this.collection))) === null || i === void 0 ? void 0 : i.key) !== null && c !== void 0 ? c : null);
|
|
959
|
-
}
|
|
960
|
-
l = this.collection.getKeyAfter(l);
|
|
961
|
-
}
|
|
962
|
-
};
|
|
963
|
-
return t(this.collection.getFirstKey()), e;
|
|
964
|
-
}
|
|
965
|
-
/**
|
|
966
|
-
* Selects all items in the collection.
|
|
967
|
-
*/
|
|
968
|
-
selectAll() {
|
|
969
|
-
!this.isSelectAll && this.selectionMode === "multiple" && this.state.setSelectedKeys("all");
|
|
970
|
-
}
|
|
971
|
-
/**
|
|
972
|
-
* Removes all keys from the selection.
|
|
973
|
-
*/
|
|
974
|
-
clearSelection() {
|
|
975
|
-
!this.disallowEmptySelection && (this.state.selectedKeys === "all" || this.state.selectedKeys.size > 0) && this.state.setSelectedKeys(new C());
|
|
976
|
-
}
|
|
977
|
-
/**
|
|
978
|
-
* Toggles between select all and an empty selection.
|
|
979
|
-
*/
|
|
980
|
-
toggleSelectAll() {
|
|
981
|
-
this.isSelectAll ? this.clearSelection() : this.selectAll();
|
|
982
|
-
}
|
|
983
|
-
select(e, t) {
|
|
984
|
-
this.selectionMode !== "none" && (this.selectionMode === "single" ? this.isSelected(e) && !this.disallowEmptySelection ? this.toggleSelection(e) : this.replaceSelection(e) : this.selectionBehavior === "toggle" || t && (t.pointerType === "touch" || t.pointerType === "virtual") ? this.toggleSelection(e) : this.replaceSelection(e));
|
|
985
|
-
}
|
|
986
|
-
/**
|
|
987
|
-
* Returns whether the current selection is equal to the given selection.
|
|
988
|
-
*/
|
|
989
|
-
isSelectionEqual(e) {
|
|
990
|
-
if (e === this.state.selectedKeys) return !0;
|
|
991
|
-
let t = this.selectedKeys;
|
|
992
|
-
if (e.size !== t.size) return !1;
|
|
993
|
-
for (let l of e)
|
|
994
|
-
if (!t.has(l)) return !1;
|
|
995
|
-
for (let l of t)
|
|
996
|
-
if (!e.has(l)) return !1;
|
|
997
|
-
return !0;
|
|
998
|
-
}
|
|
999
|
-
canSelectItem(e) {
|
|
1000
|
-
var t;
|
|
1001
|
-
if (this.state.selectionMode === "none" || this.state.disabledKeys.has(e)) return !1;
|
|
1002
|
-
let l = this.collection.getItem(e);
|
|
1003
|
-
return !(!l || !(l == null || (t = l.props) === null || t === void 0) && t.isDisabled || l.type === "cell" && !this.allowsCellSelection);
|
|
1004
|
-
}
|
|
1005
|
-
isDisabled(e) {
|
|
1006
|
-
var t, l;
|
|
1007
|
-
return this.state.disabledBehavior === "all" && (this.state.disabledKeys.has(e) || !!(!((l = this.collection.getItem(e)) === null || l === void 0 || (t = l.props) === null || t === void 0) && t.isDisabled));
|
|
1008
|
-
}
|
|
1009
|
-
isLink(e) {
|
|
1010
|
-
var t, l;
|
|
1011
|
-
return !!(!((l = this.collection.getItem(e)) === null || l === void 0 || (t = l.props) === null || t === void 0) && t.href);
|
|
1012
|
-
}
|
|
1013
|
-
getItemProps(e) {
|
|
1014
|
-
var t;
|
|
1015
|
-
return (t = this.collection.getItem(e)) === null || t === void 0 ? void 0 : t.props;
|
|
1016
|
-
}
|
|
1017
|
-
withCollection(e) {
|
|
1018
|
-
return new Ae(e, this.state, {
|
|
1019
|
-
allowsCellSelection: this.allowsCellSelection,
|
|
1020
|
-
layoutDelegate: this.layoutDelegate || void 0
|
|
1021
|
-
});
|
|
1022
|
-
}
|
|
1023
|
-
constructor(e, t, l) {
|
|
1024
|
-
this.collection = e, this.state = t;
|
|
1025
|
-
var i;
|
|
1026
|
-
this.allowsCellSelection = (i = l == null ? void 0 : l.allowsCellSelection) !== null && i !== void 0 ? i : !1, this._isSelectAll = null, this.layoutDelegate = (l == null ? void 0 : l.layoutDelegate) || null;
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
export {
|
|
1030
|
-
wt as $,
|
|
1031
|
-
Kt as a,
|
|
1032
|
-
Ae as b,
|
|
1033
|
-
re as c,
|
|
1034
|
-
gt as d,
|
|
1035
|
-
mt as e,
|
|
1036
|
-
lt as f,
|
|
1037
|
-
Ne as g,
|
|
1038
|
-
Ee as h,
|
|
1039
|
-
St as i,
|
|
1040
|
-
it as j,
|
|
1041
|
-
nt as k,
|
|
1042
|
-
je as l
|
|
1043
|
-
};
|