@persona/design-system 0.1.5-pre.4
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 +461 -0
- package/LICENSE +77 -0
- package/README.md +9 -0
- package/dist/Action-B10lxofb.d.mts +35 -0
- package/dist/Action-uduFOh2m.d.cts +35 -0
- package/dist/Action.d.cts +2 -0
- package/dist/Action.d.mts +2 -0
- package/dist/Attribute.d.cts +107 -0
- package/dist/Attribute.d.mts +107 -0
- package/dist/AttributeGrid.d.cts +40 -0
- package/dist/AttributeGrid.d.mts +41 -0
- package/dist/Badge-BqLnhb4n.mjs +34 -0
- package/dist/Badge-BqLnhb4n.mjs.map +1 -0
- package/dist/Badge-BwAZD9BH.cjs +41 -0
- package/dist/Badge-BwAZD9BH.cjs.map +1 -0
- package/dist/Badge.d.cts +25 -0
- package/dist/Badge.d.mts +25 -0
- package/dist/Banner.d.cts +48 -0
- package/dist/Banner.d.mts +48 -0
- package/dist/Button-C_3p5Xfi.d.cts +101 -0
- package/dist/Button-DqDLGURJ.d.mts +101 -0
- package/dist/Button.d.cts +2 -0
- package/dist/Button.d.mts +2 -0
- package/dist/ButtonGroup.d.cts +20 -0
- package/dist/ButtonGroup.d.mts +20 -0
- package/dist/Calendar.d.cts +11 -0
- package/dist/Calendar.d.mts +12 -0
- package/dist/CalendarBase.d.mts +12 -0
- package/dist/CalendarCell.d.mts +18 -0
- package/dist/CalendarGrid.d.mts +18 -0
- package/dist/Card-CcU9cKCd.d.mts +52 -0
- package/dist/Card-CrQL0hXm.d.cts +52 -0
- package/dist/Card-CyCKL-M5.cjs +248 -0
- package/dist/Card-CyCKL-M5.cjs.map +1 -0
- package/dist/Card-DeJSt5ys.mjs +205 -0
- package/dist/Card-DeJSt5ys.mjs.map +1 -0
- package/dist/Card.d.cts +2 -0
- package/dist/Card.d.mts +2 -0
- package/dist/Card2.d.cts +95 -0
- package/dist/Card2.d.mts +96 -0
- package/dist/Checkbox-BWJNAP27.d.mts +46 -0
- package/dist/Checkbox-BmjK0Wac.d.cts +46 -0
- package/dist/Checkbox-C5bGcb-r.mjs +176 -0
- package/dist/Checkbox-C5bGcb-r.mjs.map +1 -0
- package/dist/Checkbox-D4nv7eNs.cjs +183 -0
- package/dist/Checkbox-D4nv7eNs.cjs.map +1 -0
- package/dist/Checkbox.d.cts +2 -0
- package/dist/Checkbox.d.mts +2 -0
- package/dist/CheckboxGroupField.d.cts +24 -0
- package/dist/CheckboxGroupField.d.mts +25 -0
- package/dist/Combobox-B_-swcix.mjs +1672 -0
- package/dist/Combobox-B_-swcix.mjs.map +1 -0
- package/dist/Combobox-B_oe33Re.cjs +1692 -0
- package/dist/Combobox-B_oe33Re.cjs.map +1 -0
- package/dist/Combobox-DjbJYK_u.d.mts +11 -0
- package/dist/Combobox.d.cts +12 -0
- package/dist/Combobox.d.mts +3 -0
- package/dist/ComboboxBase-D2wypeXf.d.cts +320 -0
- package/dist/ComboboxBase-INya0Csa.d.mts +320 -0
- package/dist/ComboboxBase.d.cts +2 -0
- package/dist/ComboboxBase.d.mts +2 -0
- package/dist/ComboboxMultiSelect-Dn8cRZ6Z.d.cts +47 -0
- package/dist/ComboboxMultiSelect-Dq9DGH8S.d.mts +47 -0
- package/dist/ComboboxMultiSelect.d.cts +2 -0
- package/dist/ComboboxMultiSelect.d.mts +2 -0
- package/dist/ComboboxSingleSelect-D8YM7GKP.d.cts +35 -0
- package/dist/ComboboxSingleSelect-WwBJRb0e.d.mts +35 -0
- package/dist/ComboboxSingleSelect.d.cts +2 -0
- package/dist/ComboboxSingleSelect.d.mts +2 -0
- package/dist/ConfigFormGroup.d.cts +7 -0
- package/dist/ConfigFormGroup.d.mts +7 -0
- package/dist/DateField-Bwe_0qm9.d.cts +24 -0
- package/dist/DateField-Chko9oLb.d.mts +24 -0
- package/dist/DateField.d.cts +2 -0
- package/dist/DateField.d.mts +2 -0
- package/dist/DatePicker.d.cts +19 -0
- package/dist/DatePicker.d.mts +19 -0
- package/dist/DateRangePicker.d.cts +46 -0
- package/dist/DateRangePicker.d.mts +47 -0
- package/dist/DropdownButton-DO4NqvWR.cjs +33 -0
- package/dist/DropdownButton-DO4NqvWR.cjs.map +1 -0
- package/dist/DropdownButton-k9kEcexu.mjs +27 -0
- package/dist/DropdownButton-k9kEcexu.mjs.map +1 -0
- package/dist/DropdownButton.d.cts +26 -0
- package/dist/DropdownButton.d.mts +26 -0
- package/dist/DropdownMenu-BTk--LWo.mjs +60 -0
- package/dist/DropdownMenu-BTk--LWo.mjs.map +1 -0
- package/dist/DropdownMenu-Bm2QqLEq.d.cts +75 -0
- package/dist/DropdownMenu-D2fzpkX2.cjs +74 -0
- package/dist/DropdownMenu-D2fzpkX2.cjs.map +1 -0
- package/dist/DropdownMenu-rWgROxQe.d.mts +75 -0
- package/dist/DropdownMenu.d.cts +2 -0
- package/dist/DropdownMenu.d.mts +2 -0
- package/dist/ErrorProps-DLdVsYlk.d.cts +8 -0
- package/dist/ErrorProps-DYUKygmd.d.mts +8 -0
- package/dist/ErrorProps.d.cts +2 -0
- package/dist/ErrorProps.d.mts +2 -0
- package/dist/FormControl-BXHqI_2D.mjs +168 -0
- package/dist/FormControl-BXHqI_2D.mjs.map +1 -0
- package/dist/FormControl-CM7wTn1P.d.mts +60 -0
- package/dist/FormControl-DiR2e7Od.cjs +212 -0
- package/dist/FormControl-DiR2e7Od.cjs.map +1 -0
- package/dist/FormControl-KkeIYuBa.d.cts +60 -0
- package/dist/FormControl.d.cts +2 -0
- package/dist/FormControl.d.mts +2 -0
- package/dist/FormField-19ownwjH.d.cts +69 -0
- package/dist/FormField-CdMru4s5.d.mts +69 -0
- package/dist/FormField.d.cts +2 -0
- package/dist/FormField.d.mts +2 -0
- package/dist/Header-D8oDtnIL.d.cts +35 -0
- package/dist/Header-t1plnZc0.d.mts +35 -0
- package/dist/Header.d.cts +2 -0
- package/dist/Header.d.mts +2 -0
- package/dist/HelperTooltip-Cd7I0Ucq.d.mts +20 -0
- package/dist/HelperTooltip-oXdyk2At.d.cts +20 -0
- package/dist/HelperTooltip.d.cts +2 -0
- package/dist/HelperTooltip.d.mts +2 -0
- package/dist/IconButton-B1ZL8BqW.cjs +372 -0
- package/dist/IconButton-B1ZL8BqW.cjs.map +1 -0
- package/dist/IconButton-C28qxOdi.mjs +341 -0
- package/dist/IconButton-C28qxOdi.mjs.map +1 -0
- package/dist/IconButton-DsXbc3nQ.d.mts +24 -0
- package/dist/IconButton-ZcyTFjPn.d.cts +24 -0
- package/dist/IconButton.d.cts +2 -0
- package/dist/IconButton.d.mts +2 -0
- package/dist/ImageTile.d.cts +60 -0
- package/dist/ImageTile.d.mts +60 -0
- package/dist/Input-Cv5qieRg.d.mts +65 -0
- package/dist/Input-DHOsR4cl.cjs +210 -0
- package/dist/Input-DHOsR4cl.cjs.map +1 -0
- package/dist/Input-XppkvfUf.d.cts +65 -0
- package/dist/Input-eoFk39bE.mjs +191 -0
- package/dist/Input-eoFk39bE.mjs.map +1 -0
- package/dist/Input.d.cts +2 -0
- package/dist/Input.d.mts +2 -0
- package/dist/InputProps-BHu05fX0.d.mts +16 -0
- package/dist/InputProps-CitGo8QA.d.cts +16 -0
- package/dist/InputProps.d.cts +2 -0
- package/dist/InputProps.d.mts +2 -0
- package/dist/Link.d.cts +43 -0
- package/dist/Link.d.mts +43 -0
- package/dist/ListBox-AyjzT6ra.d.mts +138 -0
- package/dist/ListBox-CE3mfDSB.cjs +383 -0
- package/dist/ListBox-CE3mfDSB.cjs.map +1 -0
- package/dist/ListBox-DbyZFy2W.d.cts +138 -0
- package/dist/ListBox-Z1y0LG1H.mjs +369 -0
- package/dist/ListBox-Z1y0LG1H.mjs.map +1 -0
- package/dist/ListBox.d.cts +2 -0
- package/dist/ListBox.d.mts +2 -0
- package/dist/ListBoxField.d.cts +46 -0
- package/dist/ListBoxField.d.mts +47 -0
- package/dist/LoadingShimmer-CNE6JUVF.mjs +67 -0
- package/dist/LoadingShimmer-CNE6JUVF.mjs.map +1 -0
- package/dist/LoadingShimmer-DMK9RC4N.cjs +92 -0
- package/dist/LoadingShimmer-DMK9RC4N.cjs.map +1 -0
- package/dist/LoadingShimmer.d.cts +38 -0
- package/dist/LoadingShimmer.d.mts +38 -0
- package/dist/MaskedInput.d.cts +10 -0
- package/dist/MaskedInput.d.mts +10 -0
- package/dist/MatchHighlight.d.cts +11 -0
- package/dist/MatchHighlight.d.mts +11 -0
- package/dist/Menu-BpkjNO81.cjs +217 -0
- package/dist/Menu-BpkjNO81.cjs.map +1 -0
- package/dist/Menu-DIFkRQ6x.d.mts +70 -0
- package/dist/Menu-DNRHo2i_.mjs +167 -0
- package/dist/Menu-DNRHo2i_.mjs.map +1 -0
- package/dist/Menu-DPrNMatb.d.cts +70 -0
- package/dist/Menu.d.cts +2 -0
- package/dist/Menu.d.mts +2 -0
- package/dist/Modal.d.cts +141 -0
- package/dist/Modal.d.mts +141 -0
- package/dist/PageHeader.d.cts +26 -0
- package/dist/PageHeader.d.mts +26 -0
- package/dist/PageSelector.d.cts +30 -0
- package/dist/PageSelector.d.mts +30 -0
- package/dist/PageSizeSelector.d.mts +22 -0
- package/dist/Pagination.d.cts +33 -0
- package/dist/Pagination.d.mts +33 -0
- package/dist/Pii.d.cts +16 -0
- package/dist/Pii.d.mts +17 -0
- package/dist/Popover-BSdyxuja.mjs +124 -0
- package/dist/Popover-BSdyxuja.mjs.map +1 -0
- package/dist/Popover-C2dBSwiU.cjs +168 -0
- package/dist/Popover-C2dBSwiU.cjs.map +1 -0
- package/dist/Popover.d.cts +90 -0
- package/dist/Popover.d.mts +90 -0
- package/dist/ProgressBar.d.cts +83 -0
- package/dist/ProgressBar.d.mts +83 -0
- package/dist/ProgressIndicator.d.cts +64 -0
- package/dist/ProgressIndicator.d.mts +64 -0
- package/dist/PseudoClassProps-C5jpj6Rp.d.cts +12 -0
- package/dist/PseudoClassProps-mZgO_iZJ.d.mts +12 -0
- package/dist/PseudoClassProps.d.cts +2 -0
- package/dist/PseudoClassProps.d.mts +2 -0
- package/dist/Radio-mFfT6G3d.cjs +154 -0
- package/dist/Radio-mFfT6G3d.cjs.map +1 -0
- package/dist/Radio-w-L3Otuk.mjs +147 -0
- package/dist/Radio-w-L3Otuk.mjs.map +1 -0
- package/dist/Radio.d.cts +21 -0
- package/dist/Radio.d.mts +21 -0
- package/dist/RadioGroup-B8htTzsS.mjs +50 -0
- package/dist/RadioGroup-B8htTzsS.mjs.map +1 -0
- package/dist/RadioGroup-BjDmweRK.cjs +57 -0
- package/dist/RadioGroup-BjDmweRK.cjs.map +1 -0
- package/dist/RadioGroup-D5ueuC6a.d.cts +21 -0
- package/dist/RadioGroup-Ls0vPsP_.d.mts +21 -0
- package/dist/RadioGroup.d.cts +2 -0
- package/dist/RadioGroup.d.mts +2 -0
- package/dist/RangeCalendar.d.mts +33 -0
- package/dist/RangeCalendarPresets.d.mts +25 -0
- package/dist/RegisterComponent-BDb43KvI.d.mts +34 -0
- package/dist/RegisterComponent-CpXIR-51.d.cts +34 -0
- package/dist/Section.d.mts +67 -0
- package/dist/SectionHeading-DVSXofwK.d.cts +72 -0
- package/dist/SectionHeading-QvAmhVmD.d.mts +72 -0
- package/dist/SectionHeading.d.cts +2 -0
- package/dist/SectionHeading.d.mts +2 -0
- package/dist/SegmentedControl-CvznPXgC.cjs +124 -0
- package/dist/SegmentedControl-CvznPXgC.cjs.map +1 -0
- package/dist/SegmentedControl-DRtXdbLe.d.cts +59 -0
- package/dist/SegmentedControl-Dk5S4Dhz.d.mts +59 -0
- package/dist/SegmentedControl-DnwNjYre.mjs +111 -0
- package/dist/SegmentedControl-DnwNjYre.mjs.map +1 -0
- package/dist/SegmentedControl.d.cts +2 -0
- package/dist/SegmentedControl.d.mts +2 -0
- package/dist/Select-BdPdgtfU.d.cts +77 -0
- package/dist/Select-CVB-Q1g1.cjs +266 -0
- package/dist/Select-CVB-Q1g1.cjs.map +1 -0
- package/dist/Select-Cl3AOq0-.mjs +246 -0
- package/dist/Select-Cl3AOq0-.mjs.map +1 -0
- package/dist/Select-DRnRqMAL.d.mts +77 -0
- package/dist/Select.d.cts +2 -0
- package/dist/Select.d.mts +2 -0
- package/dist/Slider-D3gz7otf.d.mts +56 -0
- package/dist/Slider-uH5MOu2D.d.cts +56 -0
- package/dist/Slider.d.cts +2 -0
- package/dist/Slider.d.mts +2 -0
- package/dist/SliderRHF-Cc-9RuPe.d.cts +984 -0
- package/dist/SliderRHF-DIV-tCEv.d.mts +984 -0
- package/dist/SliderRHF.d.cts +2 -0
- package/dist/SliderRHF.d.mts +2 -0
- package/dist/SliderThumb.d.mts +139 -0
- package/dist/Spacer-DWGkX170.cjs +20 -0
- package/dist/Spacer-DWGkX170.cjs.map +1 -0
- package/dist/Spacer-DxH_sQrV.mjs +13 -0
- package/dist/Spacer-DxH_sQrV.mjs.map +1 -0
- package/dist/Spacer.d.cts +17 -0
- package/dist/Spacer.d.mts +18 -0
- package/dist/Spinner-C05An_fn.mjs +41 -0
- package/dist/Spinner-C05An_fn.mjs.map +1 -0
- package/dist/Spinner-z7DrPE1d.cjs +48 -0
- package/dist/Spinner-z7DrPE1d.cjs.map +1 -0
- package/dist/Spinner.d.cts +26 -0
- package/dist/Spinner.d.mts +26 -0
- package/dist/Stack-BHb3ZB2A.cjs +53 -0
- package/dist/Stack-BHb3ZB2A.cjs.map +1 -0
- package/dist/Stack-BntgUvsW.d.mts +47 -0
- package/dist/Stack-hwgS2FU1.mjs +40 -0
- package/dist/Stack-hwgS2FU1.mjs.map +1 -0
- package/dist/Stack-toDRLy--.d.cts +47 -0
- package/dist/Stack.d.cts +2 -0
- package/dist/Stack.d.mts +2 -0
- package/dist/StatusIndicator.d.cts +54 -0
- package/dist/StatusIndicator.d.mts +54 -0
- package/dist/Sticker-Bd7KkekO.d.mts +68 -0
- package/dist/Sticker-D6bwBTGr.mjs +215 -0
- package/dist/Sticker-D6bwBTGr.mjs.map +1 -0
- package/dist/Sticker-D_dutvp_.cjs +246 -0
- package/dist/Sticker-D_dutvp_.cjs.map +1 -0
- package/dist/Sticker-S6QWjlEJ.d.cts +68 -0
- package/dist/Sticker.d.cts +2 -0
- package/dist/Sticker.d.mts +2 -0
- package/dist/SwatchPicker.d.cts +18 -0
- package/dist/SwatchPicker.d.mts +18 -0
- package/dist/Tab.d.cts +26 -0
- package/dist/Tab.d.mts +26 -0
- package/dist/TabBar-BMv8dAS3.cjs +297 -0
- package/dist/TabBar-BMv8dAS3.cjs.map +1 -0
- package/dist/TabBar-Bf89XksH.mjs +266 -0
- package/dist/TabBar-Bf89XksH.mjs.map +1 -0
- package/dist/TabBar.d.cts +33 -0
- package/dist/TabBar.d.mts +33 -0
- package/dist/TabBarContext.d.mts +10 -0
- package/dist/TabBarIconButton.d.cts +10 -0
- package/dist/TabBarIconButton.d.mts +11 -0
- package/dist/Table-34f5m7w5.d.mts +13 -0
- package/dist/Table-DkAA1lt_.d.cts +13 -0
- package/dist/Table.d.cts +2 -0
- package/dist/Table.d.mts +2 -0
- package/dist/TableBody-5QcVMPP_.d.cts +9 -0
- package/dist/TableBody-Clf34yzJ.d.mts +9 -0
- package/dist/TableBody.d.cts +2 -0
- package/dist/TableBody.d.mts +2 -0
- package/dist/TableCell-DIs9h97h.d.cts +75 -0
- package/dist/TableCell-Dog4Blfq.d.mts +75 -0
- package/dist/TableCell.d.cts +2 -0
- package/dist/TableCell.d.mts +2 -0
- package/dist/TableHead-9LLM1B8I.d.cts +12 -0
- package/dist/TableHead-DJBGHoUD.d.mts +12 -0
- package/dist/TableHead.d.cts +2 -0
- package/dist/TableHead.d.mts +2 -0
- package/dist/TableHeaderCell-25lC9tNk.d.cts +17 -0
- package/dist/TableHeaderCell-DzYZq7SG.d.mts +17 -0
- package/dist/TableHeaderCell.d.cts +2 -0
- package/dist/TableHeaderCell.d.mts +2 -0
- package/dist/TableLayout-BA3jbdbi.d.mts +19 -0
- package/dist/TableLayout-CmDKOu10.d.cts +19 -0
- package/dist/TableLayout.d.cts +2 -0
- package/dist/TableLayout.d.mts +2 -0
- package/dist/TableRow-CBKpDeUV.d.mts +13 -0
- package/dist/TableRow-IPjQnK2q.d.cts +13 -0
- package/dist/TableRow.d.cts +2 -0
- package/dist/TableRow.d.mts +2 -0
- package/dist/TableTH.d.cts +2 -0
- package/dist/TableTH.d.mts +2 -0
- package/dist/Text-CnXedFut.d.mts +42 -0
- package/dist/Text-CrGiWG2E.d.cts +42 -0
- package/dist/Text-DOTYjIt0.mjs +58 -0
- package/dist/Text-DOTYjIt0.mjs.map +1 -0
- package/dist/Text-DVz8erdF.cjs +95 -0
- package/dist/Text-DVz8erdF.cjs.map +1 -0
- package/dist/Text.d.cts +2 -0
- package/dist/Text.d.mts +2 -0
- package/dist/TextArea-1bHvaq9p.d.mts +10 -0
- package/dist/TextArea-B1kitxCl.mjs +33 -0
- package/dist/TextArea-B1kitxCl.mjs.map +1 -0
- package/dist/TextArea-MVgGGM6r.cjs +40 -0
- package/dist/TextArea-MVgGGM6r.cjs.map +1 -0
- package/dist/TextArea-j43fhp2P.d.cts +10 -0
- package/dist/TextArea.d.cts +2 -0
- package/dist/TextArea.d.mts +2 -0
- package/dist/TextUnderlineTooltip-BDMs4iXn.d.cts +18 -0
- package/dist/TextUnderlineTooltip-z4sSGL91.d.mts +18 -0
- package/dist/TextUnderlineTooltip.d.cts +2 -0
- package/dist/TextUnderlineTooltip.d.mts +2 -0
- package/dist/Tile.d.cts +63 -0
- package/dist/Tile.d.mts +63 -0
- package/dist/Toast.d.cts +27 -0
- package/dist/Toast.d.mts +27 -0
- package/dist/Toggle-8GNRxyvE.mjs +167 -0
- package/dist/Toggle-8GNRxyvE.mjs.map +1 -0
- package/dist/Toggle-B3Cdyf7T.d.mts +54 -0
- package/dist/Toggle-BjkbL_uf.d.cts +54 -0
- package/dist/Toggle-CVdg5iQ0.cjs +174 -0
- package/dist/Toggle-CVdg5iQ0.cjs.map +1 -0
- package/dist/Toggle.d.cts +2 -0
- package/dist/Toggle.d.mts +2 -0
- package/dist/Tooltip-0i_15ysU.cjs +152 -0
- package/dist/Tooltip-0i_15ysU.cjs.map +1 -0
- package/dist/Tooltip-C0PS5InA.d.mts +100 -0
- package/dist/Tooltip-CE1oH6Iz.d.cts +100 -0
- package/dist/Tooltip-T7RQpy_a.mjs +120 -0
- package/dist/Tooltip-T7RQpy_a.mjs.map +1 -0
- package/dist/Tooltip.d.cts +2 -0
- package/dist/Tooltip.d.mts +2 -0
- package/dist/TruncatedText-0Tf8CwFX.d.mts +18 -0
- package/dist/TruncatedText-D8f3AiBL.d.cts +18 -0
- package/dist/chunk-Bpcn9VDT.mjs +39 -0
- package/dist/chunk-CoPdw6nB.cjs +64 -0
- package/dist/common.d.mts +7 -0
- package/dist/components/Attribute/index.cjs +210 -0
- package/dist/components/Attribute/index.cjs.map +1 -0
- package/dist/components/Attribute/index.d.cts +3 -0
- package/dist/components/Attribute/index.d.mts +3 -0
- package/dist/components/Attribute/index.mjs +198 -0
- package/dist/components/Attribute/index.mjs.map +1 -0
- package/dist/components/Badge/index.cjs +8 -0
- package/dist/components/Badge/index.d.cts +2 -0
- package/dist/components/Badge/index.d.mts +2 -0
- package/dist/components/Badge/index.mjs +2 -0
- package/dist/components/Banner/index.cjs +100 -0
- package/dist/components/Banner/index.cjs.map +1 -0
- package/dist/components/Banner/index.d.cts +2 -0
- package/dist/components/Banner/index.d.mts +2 -0
- package/dist/components/Banner/index.mjs +93 -0
- package/dist/components/Banner/index.mjs.map +1 -0
- package/dist/components/Button/index.cjs +12 -0
- package/dist/components/Button/index.d.cts +3 -0
- package/dist/components/Button/index.d.mts +3 -0
- package/dist/components/Button/index.mjs +2 -0
- package/dist/components/ButtonGroup/index.cjs +112 -0
- package/dist/components/ButtonGroup/index.cjs.map +1 -0
- package/dist/components/ButtonGroup/index.d.cts +2 -0
- package/dist/components/ButtonGroup/index.d.mts +2 -0
- package/dist/components/ButtonGroup/index.mjs +103 -0
- package/dist/components/ButtonGroup/index.mjs.map +1 -0
- package/dist/components/Card/index.cjs +13 -0
- package/dist/components/Card/index.d.cts +3 -0
- package/dist/components/Card/index.d.mts +3 -0
- package/dist/components/Card/index.mjs +2 -0
- package/dist/components/CardV2/index.cjs +512 -0
- package/dist/components/CardV2/index.cjs.map +1 -0
- package/dist/components/CardV2/index.d.cts +3 -0
- package/dist/components/CardV2/index.d.mts +3 -0
- package/dist/components/CardV2/index.mjs +511 -0
- package/dist/components/CardV2/index.mjs.map +1 -0
- package/dist/components/Checkbox/index.cjs +8 -0
- package/dist/components/Checkbox/index.d.cts +2 -0
- package/dist/components/Checkbox/index.d.mts +2 -0
- package/dist/components/Checkbox/index.mjs +2 -0
- package/dist/components/Combobox/index.cjs +10 -0
- package/dist/components/Combobox/index.d.cts +3 -0
- package/dist/components/Combobox/index.d.mts +3 -0
- package/dist/components/Combobox/index.mjs +2 -0
- package/dist/components/ConfigFormGroup/index.cjs +37 -0
- package/dist/components/ConfigFormGroup/index.cjs.map +1 -0
- package/dist/components/ConfigFormGroup/index.d.cts +3 -0
- package/dist/components/ConfigFormGroup/index.d.mts +3 -0
- package/dist/components/ConfigFormGroup/index.mjs +28 -0
- package/dist/components/ConfigFormGroup/index.mjs.map +1 -0
- package/dist/components/DatePicker/index.cjs +11503 -0
- package/dist/components/DatePicker/index.cjs.map +1 -0
- package/dist/components/DatePicker/index.d.cts +5 -0
- package/dist/components/DatePicker/index.d.mts +5 -0
- package/dist/components/DatePicker/index.mjs +11491 -0
- package/dist/components/DatePicker/index.mjs.map +1 -0
- package/dist/components/DropdownButton/index.cjs +8 -0
- package/dist/components/DropdownButton/index.d.cts +2 -0
- package/dist/components/DropdownButton/index.d.mts +2 -0
- package/dist/components/DropdownButton/index.mjs +2 -0
- package/dist/components/DropdownMenu/index.cjs +8 -0
- package/dist/components/DropdownMenu/index.d.cts +2 -0
- package/dist/components/DropdownMenu/index.d.mts +2 -0
- package/dist/components/DropdownMenu/index.mjs +2 -0
- package/dist/components/FormControl/index.cjs +16 -0
- package/dist/components/FormControl/index.d.cts +3 -0
- package/dist/components/FormControl/index.d.mts +3 -0
- package/dist/components/FormControl/index.mjs +3 -0
- package/dist/components/FormField/index.cjs +385 -0
- package/dist/components/FormField/index.cjs.map +1 -0
- package/dist/components/FormField/index.d.cts +5 -0
- package/dist/components/FormField/index.d.mts +5 -0
- package/dist/components/FormField/index.mjs +367 -0
- package/dist/components/FormField/index.mjs.map +1 -0
- package/dist/components/ImageTile/index.cjs +228 -0
- package/dist/components/ImageTile/index.cjs.map +1 -0
- package/dist/components/ImageTile/index.d.cts +2 -0
- package/dist/components/ImageTile/index.d.mts +2 -0
- package/dist/components/ImageTile/index.mjs +221 -0
- package/dist/components/ImageTile/index.mjs.map +1 -0
- package/dist/components/Input/index.cjs +15 -0
- package/dist/components/Input/index.cjs.map +1 -0
- package/dist/components/Input/index.d.cts +2 -0
- package/dist/components/Input/index.d.mts +2 -0
- package/dist/components/Input/index.mjs +7 -0
- package/dist/components/Input/index.mjs.map +1 -0
- package/dist/components/Link/index.cjs +87 -0
- package/dist/components/Link/index.cjs.map +1 -0
- package/dist/components/Link/index.d.cts +2 -0
- package/dist/components/Link/index.d.mts +2 -0
- package/dist/components/Link/index.mjs +80 -0
- package/dist/components/Link/index.mjs.map +1 -0
- package/dist/components/ListBox/index.cjs +9 -0
- package/dist/components/ListBox/index.d.cts +2 -0
- package/dist/components/ListBox/index.d.mts +2 -0
- package/dist/components/ListBox/index.mjs +2 -0
- package/dist/components/LoadingShimmer/index.cjs +7 -0
- package/dist/components/LoadingShimmer/index.d.cts +2 -0
- package/dist/components/LoadingShimmer/index.d.mts +2 -0
- package/dist/components/LoadingShimmer/index.mjs +2 -0
- package/dist/components/MaskedInput/index.cjs +29 -0
- package/dist/components/MaskedInput/index.cjs.map +1 -0
- package/dist/components/MaskedInput/index.d.cts +2 -0
- package/dist/components/MaskedInput/index.d.mts +2 -0
- package/dist/components/MaskedInput/index.mjs +24 -0
- package/dist/components/MaskedInput/index.mjs.map +1 -0
- package/dist/components/MatchHighlight/index.cjs +31 -0
- package/dist/components/MatchHighlight/index.cjs.map +1 -0
- package/dist/components/MatchHighlight/index.d.cts +2 -0
- package/dist/components/MatchHighlight/index.d.mts +2 -0
- package/dist/components/MatchHighlight/index.mjs +24 -0
- package/dist/components/MatchHighlight/index.mjs.map +1 -0
- package/dist/components/Menu/index.cjs +15 -0
- package/dist/components/Menu/index.d.cts +2 -0
- package/dist/components/Menu/index.d.mts +2 -0
- package/dist/components/Menu/index.mjs +2 -0
- package/dist/components/Modal/index.cjs +285 -0
- package/dist/components/Modal/index.cjs.map +1 -0
- package/dist/components/Modal/index.d.cts +2 -0
- package/dist/components/Modal/index.d.mts +2 -0
- package/dist/components/Modal/index.mjs +276 -0
- package/dist/components/Modal/index.mjs.map +1 -0
- package/dist/components/PageHeader/index.cjs +71 -0
- package/dist/components/PageHeader/index.cjs.map +1 -0
- package/dist/components/PageHeader/index.d.cts +2 -0
- package/dist/components/PageHeader/index.d.mts +2 -0
- package/dist/components/PageHeader/index.mjs +64 -0
- package/dist/components/PageHeader/index.mjs.map +1 -0
- package/dist/components/Pagination/index.cjs +211 -0
- package/dist/components/Pagination/index.cjs.map +1 -0
- package/dist/components/Pagination/index.d.cts +3 -0
- package/dist/components/Pagination/index.d.mts +3 -0
- package/dist/components/Pagination/index.mjs +203 -0
- package/dist/components/Pagination/index.mjs.map +1 -0
- package/dist/components/Pii/index.cjs +20 -0
- package/dist/components/Pii/index.cjs.map +1 -0
- package/dist/components/Pii/index.d.cts +2 -0
- package/dist/components/Pii/index.d.mts +2 -0
- package/dist/components/Pii/index.mjs +19 -0
- package/dist/components/Pii/index.mjs.map +1 -0
- package/dist/components/Popover/index.cjs +13 -0
- package/dist/components/Popover/index.d.cts +2 -0
- package/dist/components/Popover/index.d.mts +2 -0
- package/dist/components/Popover/index.mjs +2 -0
- package/dist/components/ProgressBar/index.cjs +177 -0
- package/dist/components/ProgressBar/index.cjs.map +1 -0
- package/dist/components/ProgressBar/index.d.cts +2 -0
- package/dist/components/ProgressBar/index.d.mts +2 -0
- package/dist/components/ProgressBar/index.mjs +168 -0
- package/dist/components/ProgressBar/index.mjs.map +1 -0
- package/dist/components/ProgressIndicator/index.cjs +185 -0
- package/dist/components/ProgressIndicator/index.cjs.map +1 -0
- package/dist/components/ProgressIndicator/index.d.cts +2 -0
- package/dist/components/ProgressIndicator/index.d.mts +2 -0
- package/dist/components/ProgressIndicator/index.mjs +178 -0
- package/dist/components/ProgressIndicator/index.mjs.map +1 -0
- package/dist/components/Radio/index.cjs +8 -0
- package/dist/components/Radio/index.d.cts +2 -0
- package/dist/components/Radio/index.d.mts +2 -0
- package/dist/components/Radio/index.mjs +2 -0
- package/dist/components/RadioGroup/index.cjs +8 -0
- package/dist/components/RadioGroup/index.d.cts +2 -0
- package/dist/components/RadioGroup/index.d.mts +2 -0
- package/dist/components/RadioGroup/index.mjs +2 -0
- package/dist/components/SegmentedControl/index.cjs +9 -0
- package/dist/components/SegmentedControl/index.d.cts +2 -0
- package/dist/components/SegmentedControl/index.d.mts +2 -0
- package/dist/components/SegmentedControl/index.mjs +2 -0
- package/dist/components/Select/index.cjs +10 -0
- package/dist/components/Select/index.d.cts +2 -0
- package/dist/components/Select/index.d.mts +2 -0
- package/dist/components/Select/index.mjs +2 -0
- package/dist/components/Slider/index.cjs +1507 -0
- package/dist/components/Slider/index.cjs.map +1 -0
- package/dist/components/Slider/index.d.cts +3 -0
- package/dist/components/Slider/index.d.mts +3 -0
- package/dist/components/Slider/index.mjs +1497 -0
- package/dist/components/Slider/index.mjs.map +1 -0
- package/dist/components/Spacer/index.cjs +3 -0
- package/dist/components/Spacer/index.d.cts +2 -0
- package/dist/components/Spacer/index.d.mts +2 -0
- package/dist/components/Spacer/index.mjs +2 -0
- package/dist/components/Spinner/index.cjs +8 -0
- package/dist/components/Spinner/index.d.cts +2 -0
- package/dist/components/Spinner/index.d.mts +2 -0
- package/dist/components/Spinner/index.mjs +2 -0
- package/dist/components/Stack/index.cjs +9 -0
- package/dist/components/Stack/index.d.cts +2 -0
- package/dist/components/Stack/index.d.mts +2 -0
- package/dist/components/Stack/index.mjs +2 -0
- package/dist/components/StatusIndicator/index.cjs +174 -0
- package/dist/components/StatusIndicator/index.cjs.map +1 -0
- package/dist/components/StatusIndicator/index.d.cts +2 -0
- package/dist/components/StatusIndicator/index.d.mts +2 -0
- package/dist/components/StatusIndicator/index.mjs +167 -0
- package/dist/components/StatusIndicator/index.mjs.map +1 -0
- package/dist/components/Sticker/index.cjs +12 -0
- package/dist/components/Sticker/index.d.cts +2 -0
- package/dist/components/Sticker/index.d.mts +2 -0
- package/dist/components/Sticker/index.mjs +2 -0
- package/dist/components/SwatchPicker/index.cjs +65 -0
- package/dist/components/SwatchPicker/index.cjs.map +1 -0
- package/dist/components/SwatchPicker/index.d.cts +2 -0
- package/dist/components/SwatchPicker/index.d.mts +2 -0
- package/dist/components/SwatchPicker/index.mjs +58 -0
- package/dist/components/SwatchPicker/index.mjs.map +1 -0
- package/dist/components/TabBar/index.cjs +12 -0
- package/dist/components/TabBar/index.d.cts +4 -0
- package/dist/components/TabBar/index.d.mts +4 -0
- package/dist/components/TabBar/index.mjs +2 -0
- package/dist/components/Table/index.cjs +400 -0
- package/dist/components/Table/index.cjs.map +1 -0
- package/dist/components/Table/index.d.cts +8 -0
- package/dist/components/Table/index.d.mts +8 -0
- package/dist/components/Table/index.mjs +379 -0
- package/dist/components/Table/index.mjs.map +1 -0
- package/dist/components/Text/index.cjs +9 -0
- package/dist/components/Text/index.d.cts +2 -0
- package/dist/components/Text/index.d.mts +2 -0
- package/dist/components/Text/index.mjs +2 -0
- package/dist/components/TextArea/index.cjs +8 -0
- package/dist/components/TextArea/index.d.cts +2 -0
- package/dist/components/TextArea/index.d.mts +2 -0
- package/dist/components/TextArea/index.mjs +2 -0
- package/dist/components/Tile/index.cjs +103 -0
- package/dist/components/Tile/index.cjs.map +1 -0
- package/dist/components/Tile/index.d.cts +2 -0
- package/dist/components/Tile/index.d.mts +2 -0
- package/dist/components/Tile/index.mjs +96 -0
- package/dist/components/Tile/index.mjs.map +1 -0
- package/dist/components/Toast/index.cjs +141 -0
- package/dist/components/Toast/index.cjs.map +1 -0
- package/dist/components/Toast/index.d.cts +2 -0
- package/dist/components/Toast/index.d.mts +2 -0
- package/dist/components/Toast/index.mjs +136 -0
- package/dist/components/Toast/index.mjs.map +1 -0
- package/dist/components/Toggle/index.cjs +8 -0
- package/dist/components/Toggle/index.d.cts +2 -0
- package/dist/components/Toggle/index.d.mts +2 -0
- package/dist/components/Toggle/index.mjs +2 -0
- package/dist/components/Tooltip/index.cjs +12 -0
- package/dist/components/Tooltip/index.d.cts +4 -0
- package/dist/components/Tooltip/index.d.mts +4 -0
- package/dist/components/Tooltip/index.mjs +2 -0
- package/dist/constants.d.mts +5 -0
- package/dist/ids-Cr-NW2RJ.d.mts +11 -0
- package/dist/ids-e4V5Y3Ub.d.cts +11 -0
- package/dist/index-1-AkepUA.d.mts +1 -0
- package/dist/index-7in8TPrM.d.mts +1 -0
- package/dist/index-8R9vlM2B.d.mts +83 -0
- package/dist/index-B2KLYYkM.d.cts +1 -0
- package/dist/index-BBDa5smF.d.cts +1 -0
- package/dist/index-BJ8-FA6N.d.cts +1 -0
- package/dist/index-BM1DqNZf.d.cts +628 -0
- package/dist/index-BPSCxsMC.d.cts +1 -0
- package/dist/index-BPiqSRRl.d.mts +1 -0
- package/dist/index-BUYyA1Xh.d.cts +1 -0
- package/dist/index-CCt0lwyI.d.mts +1 -0
- package/dist/index-CEDY7cmG.d.cts +1 -0
- package/dist/index-CEqOS-7M.d.mts +1 -0
- package/dist/index-CExuKKOI.d.cts +218 -0
- package/dist/index-CIABef8t.d.mts +1 -0
- package/dist/index-CIBxlpQo.d.mts +1 -0
- package/dist/index-CKu60b9I.d.mts +154 -0
- package/dist/index-CP2eJYlK.d.mts +1 -0
- package/dist/index-CRo77wc3.d.mts +1 -0
- package/dist/index-CiBIKhMu.d.cts +1 -0
- package/dist/index-Cii4Qb1X.d.mts +1 -0
- package/dist/index-CspKFJM1.d.cts +1 -0
- package/dist/index-CsuikFeJ.d.mts +1 -0
- package/dist/index-Cz6N-KeS.d.cts +1 -0
- package/dist/index-D-BciAtf.d.cts +1 -0
- package/dist/index-D26lpgQi.d.cts +1 -0
- package/dist/index-D2HUTZ-d.d.cts +1 -0
- package/dist/index-D4DUvwPf.d.mts +1 -0
- package/dist/index-D4ELpJXS.d.cts +1 -0
- package/dist/index-D6CnpA_r.d.cts +1 -0
- package/dist/index-DLoAMD9J.d.cts +1 -0
- package/dist/index-DQvVmqvS.d.mts +628 -0
- package/dist/index-DWfPppPU.d.mts +1 -0
- package/dist/index-DcU87nuJ2.d.cts +1 -0
- package/dist/index-DkrC-i1D.d.mts +1 -0
- package/dist/index-DvuJXuAN.d.mts +1 -0
- package/dist/index-OEBbnNdr.d.mts +1 -0
- package/dist/index-QbUkWSLh.d.mts +1 -0
- package/dist/index-VmEFGBxN.d.cts +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +0 -0
- package/dist/index2.d.cts +1 -0
- package/dist/index2.d.mts +1 -0
- package/dist/input-BCmP106-.d.mts +17 -0
- package/dist/input-Bm_anD8X.d.cts +17 -0
- package/dist/inputFields.d.cts +83 -0
- package/dist/inputFields.d.mts +83 -0
- package/dist/intersperse.d.mts +18 -0
- package/dist/lib/ConfigContext.cjs +15 -0
- package/dist/lib/ConfigContext.cjs.map +1 -0
- package/dist/lib/ConfigContext.d.cts +16 -0
- package/dist/lib/ConfigContext.d.mts +17 -0
- package/dist/lib/ConfigContext.mjs +15 -0
- package/dist/lib/ConfigContext.mjs.map +1 -0
- package/dist/lib/HeadlessAriaButton.cjs +33 -0
- package/dist/lib/HeadlessAriaButton.cjs.map +1 -0
- package/dist/lib/HeadlessAriaButton.d.cts +12 -0
- package/dist/lib/HeadlessAriaButton.d.mts +12 -0
- package/dist/lib/HeadlessAriaButton.mjs +30 -0
- package/dist/lib/HeadlessAriaButton.mjs.map +1 -0
- package/dist/lib/PDSProvider.cjs +20 -0
- package/dist/lib/PDSProvider.cjs.map +1 -0
- package/dist/lib/PDSProvider.d.cts +12 -0
- package/dist/lib/PDSProvider.d.mts +13 -0
- package/dist/lib/PDSProvider.mjs +19 -0
- package/dist/lib/PDSProvider.mjs.map +1 -0
- package/dist/lib/TruncatedText.cjs +39 -0
- package/dist/lib/TruncatedText.cjs.map +1 -0
- package/dist/lib/TruncatedText.d.cts +2 -0
- package/dist/lib/TruncatedText.d.mts +2 -0
- package/dist/lib/TruncatedText.mjs +31 -0
- package/dist/lib/TruncatedText.mjs.map +1 -0
- package/dist/lib/TruncatedTextWithTooltip.cjs +34 -0
- package/dist/lib/TruncatedTextWithTooltip.cjs.map +1 -0
- package/dist/lib/TruncatedTextWithTooltip.d.cts +15 -0
- package/dist/lib/TruncatedTextWithTooltip.d.mts +15 -0
- package/dist/lib/TruncatedTextWithTooltip.mjs +28 -0
- package/dist/lib/TruncatedTextWithTooltip.mjs.map +1 -0
- package/dist/lib/comboboxHelper.cjs +46 -0
- package/dist/lib/comboboxHelper.cjs.map +1 -0
- package/dist/lib/comboboxHelper.d.cts +24 -0
- package/dist/lib/comboboxHelper.d.mts +24 -0
- package/dist/lib/comboboxHelper.mjs +42 -0
- package/dist/lib/comboboxHelper.mjs.map +1 -0
- package/dist/lib/datePickerHelper.cjs +3568 -0
- package/dist/lib/datePickerHelper.cjs.map +1 -0
- package/dist/lib/datePickerHelper.d.cts +19 -0
- package/dist/lib/datePickerHelper.d.mts +19 -0
- package/dist/lib/datePickerHelper.mjs +3566 -0
- package/dist/lib/datePickerHelper.mjs.map +1 -0
- package/dist/lib/pseudoClass.cjs +32 -0
- package/dist/lib/pseudoClass.cjs.map +1 -0
- package/dist/lib/pseudoClass.d.cts +45 -0
- package/dist/lib/pseudoClass.d.mts +45 -0
- package/dist/lib/pseudoClass.mjs +18 -0
- package/dist/lib/pseudoClass.mjs.map +1 -0
- package/dist/lib/register/RegisterComponent.cjs +91 -0
- package/dist/lib/register/RegisterComponent.cjs.map +1 -0
- package/dist/lib/register/RegisterComponent.d.cts +2 -0
- package/dist/lib/register/RegisterComponent.d.mts +2 -0
- package/dist/lib/register/RegisterComponent.mjs +88 -0
- package/dist/lib/register/RegisterComponent.mjs.map +1 -0
- package/dist/lib/register/ids.cjs +31 -0
- package/dist/lib/register/ids.cjs.map +1 -0
- package/dist/lib/register/ids.d.cts +2 -0
- package/dist/lib/register/ids.d.mts +2 -0
- package/dist/lib/register/ids.mjs +28 -0
- package/dist/lib/register/ids.mjs.map +1 -0
- package/dist/lib/register/index.cjs +8 -0
- package/dist/lib/register/index.d.cts +4 -0
- package/dist/lib/register/index.d.mts +4 -0
- package/dist/lib/register/index.mjs +3 -0
- package/dist/lib/register/types.cjs +1 -0
- package/dist/lib/register/types.d.cts +2 -0
- package/dist/lib/register/types.d.mts +2 -0
- package/dist/lib/register/types.mjs +0 -0
- package/dist/lib/reorderItems.cjs +39 -0
- package/dist/lib/reorderItems.cjs.map +1 -0
- package/dist/lib/reorderItems.d.cts +26 -0
- package/dist/lib/reorderItems.d.mts +26 -0
- package/dist/lib/reorderItems.mjs +36 -0
- package/dist/lib/reorderItems.mjs.map +1 -0
- package/dist/lib/selectHelper.cjs +22 -0
- package/dist/lib/selectHelper.cjs.map +1 -0
- package/dist/lib/selectHelper.d.cts +14 -0
- package/dist/lib/selectHelper.d.mts +14 -0
- package/dist/lib/selectHelper.mjs +20 -0
- package/dist/lib/selectHelper.mjs.map +1 -0
- package/dist/lib/useControlled.cjs +20 -0
- package/dist/lib/useControlled.cjs.map +1 -0
- package/dist/lib/useControlled.d.cts +16 -0
- package/dist/lib/useControlled.d.mts +17 -0
- package/dist/lib/useControlled.mjs +19 -0
- package/dist/lib/useControlled.mjs.map +1 -0
- package/dist/lib/useIsOverflow.cjs +58 -0
- package/dist/lib/useIsOverflow.cjs.map +1 -0
- package/dist/lib/useIsOverflow.d.cts +11 -0
- package/dist/lib/useIsOverflow.d.mts +11 -0
- package/dist/lib/useIsOverflow.mjs +56 -0
- package/dist/lib/useIsOverflow.mjs.map +1 -0
- package/dist/lib/useOutsideClick.cjs +19 -0
- package/dist/lib/useOutsideClick.cjs.map +1 -0
- package/dist/lib/useOutsideClick.d.cts +13 -0
- package/dist/lib/useOutsideClick.d.mts +13 -0
- package/dist/lib/useOutsideClick.mjs +17 -0
- package/dist/lib/useOutsideClick.mjs.map +1 -0
- package/dist/lib/zindex.cjs +27 -0
- package/dist/lib/zindex.cjs.map +1 -0
- package/dist/lib/zindex.d.cts +25 -0
- package/dist/lib/zindex.d.mts +25 -0
- package/dist/lib/zindex.mjs +25 -0
- package/dist/lib/zindex.mjs.map +1 -0
- package/dist/mergeRefs-BZinWopc.cjs +31 -0
- package/dist/mergeRefs-BZinWopc.cjs.map +1 -0
- package/dist/mergeRefs-BgcbK0Qy.mjs +26 -0
- package/dist/mergeRefs-BgcbK0Qy.mjs.map +1 -0
- package/dist/mixins/focus.cjs +39 -0
- package/dist/mixins/focus.cjs.map +1 -0
- package/dist/mixins/focus.d.cts +11 -0
- package/dist/mixins/focus.d.mts +11 -0
- package/dist/mixins/focus.mjs +34 -0
- package/dist/mixins/focus.mjs.map +1 -0
- package/dist/mixins/hoverable.cjs +38 -0
- package/dist/mixins/hoverable.cjs.map +1 -0
- package/dist/mixins/hoverable.d.cts +16 -0
- package/dist/mixins/hoverable.d.mts +16 -0
- package/dist/mixins/hoverable.mjs +32 -0
- package/dist/mixins/hoverable.mjs.map +1 -0
- package/dist/mixins/input.cjs +95 -0
- package/dist/mixins/input.cjs.map +1 -0
- package/dist/mixins/input.d.cts +2 -0
- package/dist/mixins/input.d.mts +2 -0
- package/dist/mixins/input.mjs +94 -0
- package/dist/mixins/input.mjs.map +1 -0
- package/dist/mixins/menuItem.cjs +110 -0
- package/dist/mixins/menuItem.cjs.map +1 -0
- package/dist/mixins/menuItem.d.cts +30 -0
- package/dist/mixins/menuItem.d.mts +31 -0
- package/dist/mixins/menuItem.mjs +109 -0
- package/dist/mixins/menuItem.mjs.map +1 -0
- package/dist/mixins/print/index.cjs +25 -0
- package/dist/mixins/print/index.cjs.map +1 -0
- package/dist/mixins/print/index.d.cts +11 -0
- package/dist/mixins/print/index.d.mts +11 -0
- package/dist/mixins/print/index.mjs +23 -0
- package/dist/mixins/print/index.mjs.map +1 -0
- package/dist/mixins/text.cjs +93 -0
- package/dist/mixins/text.cjs.map +1 -0
- package/dist/mixins/text.d.cts +2 -0
- package/dist/mixins/text.d.mts +2 -0
- package/dist/mixins/text.mjs +88 -0
- package/dist/mixins/text.mjs.map +1 -0
- package/dist/motion-DoikasqZ.mjs +7483 -0
- package/dist/motion-DoikasqZ.mjs.map +1 -0
- package/dist/motion-QW6imSxE.cjs +7488 -0
- package/dist/motion-QW6imSxE.cjs.map +1 -0
- package/dist/react.esm-C-es35jP.cjs +11441 -0
- package/dist/react.esm-C-es35jP.cjs.map +1 -0
- package/dist/react.esm-Dv1lMDRs.mjs +11397 -0
- package/dist/react.esm-Dv1lMDRs.mjs.map +1 -0
- package/dist/text-BrSUs-88.d.mts +14 -0
- package/dist/text-PmH5oc61.d.cts +14 -0
- package/dist/theme-Cadb1xzQ.d.cts +154 -0
- package/dist/theme-DGAqgnUa.d.mts +154 -0
- package/dist/theme.cjs +353 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.cts +2 -0
- package/dist/theme.d.mts +2 -0
- package/dist/theme.mjs +346 -0
- package/dist/theme.mjs.map +1 -0
- package/dist/types-DzHQ5MGm.d.mts +69 -0
- package/dist/types-N-cXznfM.d.cts +69 -0
- package/dist/useFormField-Ba0CQ43u.d.cts +30 -0
- package/dist/useFormField-BmtItl8y.d.mts +30 -0
- package/dist/useFormField-DN3gpEEV.cjs +37 -0
- package/dist/useFormField-DN3gpEEV.cjs.map +1 -0
- package/dist/useFormField-eftOPiXj.mjs +25 -0
- package/dist/useFormField-eftOPiXj.mjs.map +1 -0
- package/dist/useFormField.d.cts +2 -0
- package/dist/useFormField.d.mts +2 -0
- package/dist/useFormGroup-BMukAMAd.mjs +14 -0
- package/dist/useFormGroup-BMukAMAd.mjs.map +1 -0
- package/dist/useFormGroup-B_mFNoN9.cjs +26 -0
- package/dist/useFormGroup-B_mFNoN9.cjs.map +1 -0
- package/dist/useFormGroup.d.cts +18 -0
- package/dist/useFormGroup.d.mts +18 -0
- package/dist/useLabel-BcbghpIU.cjs +1465 -0
- package/dist/useLabel-BcbghpIU.cjs.map +1 -0
- package/dist/useLabel-DHGzNIKw.mjs +1212 -0
- package/dist/useLabel-DHGzNIKw.mjs.map +1 -0
- package/dist/useModalInsetRight.d.mts +21 -0
- package/dist/useToggle-0zLL1E7s.mjs +21 -0
- package/dist/useToggle-0zLL1E7s.mjs.map +1 -0
- package/dist/useToggle-DNrEsTpr.cjs +27 -0
- package/dist/useToggle-DNrEsTpr.cjs.map +1 -0
- package/dist/useToggle.d.mts +17 -0
- package/dist/useTruncation.d.mts +12 -0
- package/dist/utilities-C8Jf-xpi.d.cts +9 -0
- package/dist/utilities-w1K54IAy.d.mts +9 -0
- package/dist/utilities.d.cts +2 -0
- package/dist/utilities.d.mts +2 -0
- package/dist/utils/storybook.cjs +13 -0
- package/dist/utils/storybook.cjs.map +1 -0
- package/dist/utils/storybook.mjs +11 -0
- package/dist/utils/storybook.mjs.map +1 -0
- package/dist/utils/testing.cjs +50 -0
- package/dist/utils/testing.cjs.map +1 -0
- package/dist/utils/testing.d.cts +370 -0
- package/dist/utils/testing.d.mts +370 -0
- package/dist/utils/testing.mjs +45 -0
- package/dist/utils/testing.mjs.map +1 -0
- package/dist/variables/color.cjs +23 -0
- package/dist/variables/color.cjs.map +1 -0
- package/dist/variables/color.d.cts +19 -0
- package/dist/variables/color.d.mts +19 -0
- package/dist/variables/color.mjs +21 -0
- package/dist/variables/color.mjs.map +1 -0
- package/dist/variables/effect.cjs +27 -0
- package/dist/variables/effect.cjs.map +1 -0
- package/dist/variables/effect.d.cts +21 -0
- package/dist/variables/effect.d.mts +21 -0
- package/dist/variables/effect.mjs +24 -0
- package/dist/variables/effect.mjs.map +1 -0
- package/dist/variables/keyframes.cjs +22 -0
- package/dist/variables/keyframes.cjs.map +1 -0
- package/dist/variables/keyframes.d.cts +8 -0
- package/dist/variables/keyframes.d.mts +8 -0
- package/dist/variables/keyframes.mjs +19 -0
- package/dist/variables/keyframes.mjs.map +1 -0
- package/dist/variables/spacing.cjs +11 -0
- package/dist/variables/spacing.cjs.map +1 -0
- package/dist/variables/spacing.d.cts +8 -0
- package/dist/variables/spacing.d.mts +8 -0
- package/dist/variables/spacing.mjs +9 -0
- package/dist/variables/spacing.mjs.map +1 -0
- package/dist/variables/text.cjs +14 -0
- package/dist/variables/text.cjs.map +1 -0
- package/dist/variables/text.d.cts +10 -0
- package/dist/variables/text.d.mts +10 -0
- package/dist/variables/text.mjs +12 -0
- package/dist/variables/text.mjs.map +1 -0
- package/dist/variables/transitions.cjs +25 -0
- package/dist/variables/transitions.cjs.map +1 -0
- package/dist/variables/transitions.d.cts +19 -0
- package/dist/variables/transitions.d.mts +19 -0
- package/dist/variables/transitions.mjs +22 -0
- package/dist/variables/transitions.mjs.map +1 -0
- package/package.json +781 -0
|
@@ -0,0 +1,3568 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_chunk = require("../chunk-CoPdw6nB.cjs");
|
|
3
|
+
const require_react_esm = require("../react.esm-C-es35jP.cjs");
|
|
4
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/isElementType.js
|
|
5
|
+
function isElementType(element, tag, props) {
|
|
6
|
+
if (element.namespaceURI && element.namespaceURI !== "http://www.w3.org/1999/xhtml") return false;
|
|
7
|
+
tag = Array.isArray(tag) ? tag : [tag];
|
|
8
|
+
if (!tag.includes(element.tagName.toLowerCase())) return false;
|
|
9
|
+
if (props) return Object.entries(props).every(([k, v]) => element[k] === v);
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/getWindow.js
|
|
14
|
+
function getWindow(node) {
|
|
15
|
+
var _node_ownerDocument;
|
|
16
|
+
if (isDocument$1(node) && node.defaultView) return node.defaultView;
|
|
17
|
+
else if ((_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === void 0 ? void 0 : _node_ownerDocument.defaultView) return node.ownerDocument.defaultView;
|
|
18
|
+
throw new Error(`Could not determine window of node. Node was ${describe(node)}`);
|
|
19
|
+
}
|
|
20
|
+
function isDocument$1(node) {
|
|
21
|
+
return node.nodeType === 9;
|
|
22
|
+
}
|
|
23
|
+
function describe(val) {
|
|
24
|
+
return typeof val === "function" ? `function ${val.name}` : val === null ? "null" : String(val);
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/dataTransfer/Blob.js
|
|
28
|
+
function readBlobText(blob, FileReader) {
|
|
29
|
+
return new Promise((res, rej) => {
|
|
30
|
+
const fr = new FileReader();
|
|
31
|
+
fr.onerror = rej;
|
|
32
|
+
fr.onabort = rej;
|
|
33
|
+
fr.onload = () => {
|
|
34
|
+
res(String(fr.result));
|
|
35
|
+
};
|
|
36
|
+
fr.readAsText(blob);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/dataTransfer/FileList.js
|
|
41
|
+
function createFileList(window, files) {
|
|
42
|
+
const list = {
|
|
43
|
+
...files,
|
|
44
|
+
length: files.length,
|
|
45
|
+
item: (index) => list[index],
|
|
46
|
+
[Symbol.iterator]: function* nextFile() {
|
|
47
|
+
for (let i = 0; i < list.length; i++) yield list[i];
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
list.constructor = window.FileList;
|
|
51
|
+
/* istanbul ignore else */ if (window.FileList) Object.setPrototypeOf(list, window.FileList.prototype);
|
|
52
|
+
Object.freeze(list);
|
|
53
|
+
return list;
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/dataTransfer/DataTransfer.js
|
|
57
|
+
function _define_property$8(obj, key, value) {
|
|
58
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
59
|
+
value,
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true,
|
|
62
|
+
writable: true
|
|
63
|
+
});
|
|
64
|
+
else obj[key] = value;
|
|
65
|
+
return obj;
|
|
66
|
+
}
|
|
67
|
+
var DataTransferItemStub = class {
|
|
68
|
+
getAsFile() {
|
|
69
|
+
return this.file;
|
|
70
|
+
}
|
|
71
|
+
getAsString(callback) {
|
|
72
|
+
if (typeof this.data === "string") callback(this.data);
|
|
73
|
+
}
|
|
74
|
+
/* istanbul ignore next */ webkitGetAsEntry() {
|
|
75
|
+
throw new Error("not implemented");
|
|
76
|
+
}
|
|
77
|
+
constructor(dataOrFile, type) {
|
|
78
|
+
_define_property$8(this, "kind", void 0);
|
|
79
|
+
_define_property$8(this, "type", void 0);
|
|
80
|
+
_define_property$8(this, "file", null);
|
|
81
|
+
_define_property$8(this, "data", void 0);
|
|
82
|
+
if (typeof dataOrFile === "string") {
|
|
83
|
+
this.kind = "string";
|
|
84
|
+
this.type = String(type);
|
|
85
|
+
this.data = dataOrFile;
|
|
86
|
+
} else {
|
|
87
|
+
this.kind = "file";
|
|
88
|
+
this.type = dataOrFile.type;
|
|
89
|
+
this.file = dataOrFile;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
var DataTransferItemListStub = class extends Array {
|
|
94
|
+
add(...args) {
|
|
95
|
+
const item = new DataTransferItemStub(args[0], args[1]);
|
|
96
|
+
this.push(item);
|
|
97
|
+
return item;
|
|
98
|
+
}
|
|
99
|
+
clear() {
|
|
100
|
+
this.splice(0, this.length);
|
|
101
|
+
}
|
|
102
|
+
remove(index) {
|
|
103
|
+
this.splice(index, 1);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
function getTypeMatcher(type, exact) {
|
|
107
|
+
const [group, sub] = type.split("/");
|
|
108
|
+
const isGroup = !sub || sub === "*";
|
|
109
|
+
return (item) => {
|
|
110
|
+
return exact ? item.type === (isGroup ? group : type) : isGroup ? item.type.startsWith(`${group}/`) : item.type === group;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function createDataTransferStub(window) {
|
|
114
|
+
return new class DataTransferStub {
|
|
115
|
+
getData(format) {
|
|
116
|
+
var _this_items_find;
|
|
117
|
+
const match = (_this_items_find = this.items.find(getTypeMatcher(format, true))) !== null && _this_items_find !== void 0 ? _this_items_find : this.items.find(getTypeMatcher(format, false));
|
|
118
|
+
let text = "";
|
|
119
|
+
match === null || match === void 0 || match.getAsString((t) => {
|
|
120
|
+
text = t;
|
|
121
|
+
});
|
|
122
|
+
return text;
|
|
123
|
+
}
|
|
124
|
+
setData(format, data) {
|
|
125
|
+
const matchIndex = this.items.findIndex(getTypeMatcher(format, true));
|
|
126
|
+
const item = new DataTransferItemStub(data, format);
|
|
127
|
+
if (matchIndex >= 0) this.items.splice(matchIndex, 1, item);
|
|
128
|
+
else this.items.push(item);
|
|
129
|
+
}
|
|
130
|
+
clearData(format) {
|
|
131
|
+
if (format) {
|
|
132
|
+
const matchIndex = this.items.findIndex(getTypeMatcher(format, true));
|
|
133
|
+
if (matchIndex >= 0) this.items.remove(matchIndex);
|
|
134
|
+
} else this.items.clear();
|
|
135
|
+
}
|
|
136
|
+
get types() {
|
|
137
|
+
const t = [];
|
|
138
|
+
if (this.files.length) t.push("Files");
|
|
139
|
+
this.items.forEach((i) => t.push(i.type));
|
|
140
|
+
Object.freeze(t);
|
|
141
|
+
return t;
|
|
142
|
+
}
|
|
143
|
+
/* istanbul ignore next */ setDragImage() {}
|
|
144
|
+
constructor() {
|
|
145
|
+
_define_property$8(this, "dropEffect", "none");
|
|
146
|
+
_define_property$8(this, "effectAllowed", "uninitialized");
|
|
147
|
+
_define_property$8(this, "items", new DataTransferItemListStub());
|
|
148
|
+
_define_property$8(this, "files", createFileList(window, []));
|
|
149
|
+
}
|
|
150
|
+
}();
|
|
151
|
+
}
|
|
152
|
+
function createDataTransfer(window, files = []) {
|
|
153
|
+
const dt = typeof window.DataTransfer === "undefined" ? createDataTransferStub(window) : /* istanbul ignore next */ new window.DataTransfer();
|
|
154
|
+
Object.defineProperty(dt, "files", { get: () => createFileList(window, files) });
|
|
155
|
+
return dt;
|
|
156
|
+
}
|
|
157
|
+
async function getBlobFromDataTransferItem(window, item) {
|
|
158
|
+
if (item.kind === "file") return item.getAsFile();
|
|
159
|
+
return new window.Blob([await new Promise((r) => item.getAsString(r))], { type: item.type });
|
|
160
|
+
}
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/dataTransfer/Clipboard.js
|
|
163
|
+
function _define_property$7(obj, key, value) {
|
|
164
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
165
|
+
value,
|
|
166
|
+
enumerable: true,
|
|
167
|
+
configurable: true,
|
|
168
|
+
writable: true
|
|
169
|
+
});
|
|
170
|
+
else obj[key] = value;
|
|
171
|
+
return obj;
|
|
172
|
+
}
|
|
173
|
+
function createClipboardItem(window, ...blobs) {
|
|
174
|
+
const dataMap = Object.fromEntries(blobs.map((b) => [typeof b === "string" ? "text/plain" : b.type, Promise.resolve(b)]));
|
|
175
|
+
/* istanbul ignore if */ if (typeof window.ClipboardItem !== "undefined") return new window.ClipboardItem(dataMap);
|
|
176
|
+
return new class ClipboardItem {
|
|
177
|
+
get types() {
|
|
178
|
+
return Array.from(Object.keys(this.data));
|
|
179
|
+
}
|
|
180
|
+
async getType(type) {
|
|
181
|
+
const value = await this.data[type];
|
|
182
|
+
if (!value) throw new Error(`${type} is not one of the available MIME types on this item.`);
|
|
183
|
+
return value instanceof window.Blob ? value : new window.Blob([value], { type });
|
|
184
|
+
}
|
|
185
|
+
constructor(d) {
|
|
186
|
+
_define_property$7(this, "data", void 0);
|
|
187
|
+
this.data = d;
|
|
188
|
+
}
|
|
189
|
+
}(dataMap);
|
|
190
|
+
}
|
|
191
|
+
const ClipboardStubControl = Symbol("Manage ClipboardSub");
|
|
192
|
+
function createClipboardStub(window, control) {
|
|
193
|
+
return Object.assign(new class Clipboard extends window.EventTarget {
|
|
194
|
+
async read() {
|
|
195
|
+
return Array.from(this.items);
|
|
196
|
+
}
|
|
197
|
+
async readText() {
|
|
198
|
+
let text = "";
|
|
199
|
+
for (const item of this.items) {
|
|
200
|
+
const type = item.types.includes("text/plain") ? "text/plain" : item.types.find((t) => t.startsWith("text/"));
|
|
201
|
+
if (type) text += await item.getType(type).then((b) => readBlobText(b, window.FileReader));
|
|
202
|
+
}
|
|
203
|
+
return text;
|
|
204
|
+
}
|
|
205
|
+
async write(data) {
|
|
206
|
+
this.items = data;
|
|
207
|
+
}
|
|
208
|
+
async writeText(text) {
|
|
209
|
+
this.items = [createClipboardItem(window, text)];
|
|
210
|
+
}
|
|
211
|
+
constructor(...args) {
|
|
212
|
+
super(...args), _define_property$7(this, "items", []);
|
|
213
|
+
}
|
|
214
|
+
}(), { [ClipboardStubControl]: control });
|
|
215
|
+
}
|
|
216
|
+
function isClipboardStub(clipboard) {
|
|
217
|
+
return !!(clipboard === null || clipboard === void 0 ? void 0 : clipboard[ClipboardStubControl]);
|
|
218
|
+
}
|
|
219
|
+
function attachClipboardStubToView(window) {
|
|
220
|
+
if (isClipboardStub(window.navigator.clipboard)) return window.navigator.clipboard[ClipboardStubControl];
|
|
221
|
+
const realClipboard = Object.getOwnPropertyDescriptor(window.navigator, "clipboard");
|
|
222
|
+
let stub;
|
|
223
|
+
const control = {
|
|
224
|
+
resetClipboardStub: () => {
|
|
225
|
+
stub = createClipboardStub(window, control);
|
|
226
|
+
},
|
|
227
|
+
detachClipboardStub: () => {
|
|
228
|
+
/* istanbul ignore if */ if (realClipboard) Object.defineProperty(window.navigator, "clipboard", realClipboard);
|
|
229
|
+
else Object.defineProperty(window.navigator, "clipboard", {
|
|
230
|
+
value: void 0,
|
|
231
|
+
configurable: true
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
stub = createClipboardStub(window, control);
|
|
236
|
+
Object.defineProperty(window.navigator, "clipboard", {
|
|
237
|
+
get: () => stub,
|
|
238
|
+
configurable: true
|
|
239
|
+
});
|
|
240
|
+
return stub[ClipboardStubControl];
|
|
241
|
+
}
|
|
242
|
+
function resetClipboardStubOnView(window) {
|
|
243
|
+
if (isClipboardStub(window.navigator.clipboard)) window.navigator.clipboard[ClipboardStubControl].resetClipboardStub();
|
|
244
|
+
}
|
|
245
|
+
function detachClipboardStubFromView(window) {
|
|
246
|
+
if (isClipboardStub(window.navigator.clipboard)) window.navigator.clipboard[ClipboardStubControl].detachClipboardStub();
|
|
247
|
+
}
|
|
248
|
+
async function readDataTransferFromClipboard(document) {
|
|
249
|
+
const window = document.defaultView;
|
|
250
|
+
const clipboard = window === null || window === void 0 ? void 0 : window.navigator.clipboard;
|
|
251
|
+
const items = clipboard && await clipboard.read();
|
|
252
|
+
if (!items) throw new Error("The Clipboard API is unavailable.");
|
|
253
|
+
const dt = createDataTransfer(window);
|
|
254
|
+
for (const item of items) for (const type of item.types) dt.setData(type, await item.getType(type).then((b) => readBlobText(b, window.FileReader)));
|
|
255
|
+
return dt;
|
|
256
|
+
}
|
|
257
|
+
async function writeDataTransferToClipboard(document, clipboardData) {
|
|
258
|
+
const window = getWindow(document);
|
|
259
|
+
const clipboard = window.navigator.clipboard;
|
|
260
|
+
const items = [];
|
|
261
|
+
for (let i = 0; i < clipboardData.items.length; i++) {
|
|
262
|
+
const dtItem = clipboardData.items[i];
|
|
263
|
+
const blob = await getBlobFromDataTransferItem(window, dtItem);
|
|
264
|
+
items.push(createClipboardItem(window, blob));
|
|
265
|
+
}
|
|
266
|
+
if (!(clipboard && await clipboard.write(items).then(
|
|
267
|
+
() => true,
|
|
268
|
+
/* istanbul ignore next */
|
|
269
|
+
() => false
|
|
270
|
+
))) throw new Error("The Clipboard API is unavailable.");
|
|
271
|
+
}
|
|
272
|
+
const g = globalThis;
|
|
273
|
+
/* istanbul ignore else */ if (typeof g.afterEach === "function") g.afterEach(() => resetClipboardStubOnView(globalThis.window));
|
|
274
|
+
/* istanbul ignore else */ if (typeof g.afterAll === "function") g.afterAll(() => detachClipboardStubFromView(globalThis.window));
|
|
275
|
+
//#endregion
|
|
276
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/focus/selector.js
|
|
277
|
+
const FOCUSABLE_SELECTOR = [
|
|
278
|
+
"input:not([type=hidden]):not([disabled])",
|
|
279
|
+
"button:not([disabled])",
|
|
280
|
+
"select:not([disabled])",
|
|
281
|
+
"textarea:not([disabled])",
|
|
282
|
+
"[contenteditable=\"\"]",
|
|
283
|
+
"[contenteditable=\"true\"]",
|
|
284
|
+
"a[href]",
|
|
285
|
+
"[tabindex]:not([disabled])"
|
|
286
|
+
].join(", ");
|
|
287
|
+
//#endregion
|
|
288
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/focus/isFocusable.js
|
|
289
|
+
function isFocusable(element) {
|
|
290
|
+
return element.matches(FOCUSABLE_SELECTOR);
|
|
291
|
+
}
|
|
292
|
+
//#endregion
|
|
293
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/cloneEvent.js
|
|
294
|
+
function cloneEvent(event) {
|
|
295
|
+
return new event.constructor(event.type, event);
|
|
296
|
+
}
|
|
297
|
+
//#endregion
|
|
298
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/isDisabled.js
|
|
299
|
+
function isDisabled(element) {
|
|
300
|
+
for (let el = element; el; el = el.parentElement) if (isElementType(el, [
|
|
301
|
+
"button",
|
|
302
|
+
"input",
|
|
303
|
+
"select",
|
|
304
|
+
"textarea",
|
|
305
|
+
"optgroup",
|
|
306
|
+
"option"
|
|
307
|
+
])) {
|
|
308
|
+
if (el.hasAttribute("disabled")) return true;
|
|
309
|
+
} else if (isElementType(el, "fieldset")) {
|
|
310
|
+
var _el_querySelector;
|
|
311
|
+
if (el.hasAttribute("disabled") && !((_el_querySelector = el.querySelector(":scope > legend")) === null || _el_querySelector === void 0 ? void 0 : _el_querySelector.contains(element))) return true;
|
|
312
|
+
} else if (el.tagName.includes("-")) {
|
|
313
|
+
if (el.constructor.formAssociated && el.hasAttribute("disabled")) return true;
|
|
314
|
+
}
|
|
315
|
+
return false;
|
|
316
|
+
}
|
|
317
|
+
//#endregion
|
|
318
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/focus/getActiveElement.js
|
|
319
|
+
function getActiveElement(document) {
|
|
320
|
+
const activeElement = document.activeElement;
|
|
321
|
+
if (activeElement === null || activeElement === void 0 ? void 0 : activeElement.shadowRoot) return getActiveElement(activeElement.shadowRoot);
|
|
322
|
+
else {
|
|
323
|
+
if (isDisabled(activeElement)) return document.ownerDocument ? document.ownerDocument.body : document.body;
|
|
324
|
+
return activeElement;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
function getActiveElementOrBody(document) {
|
|
328
|
+
var _getActiveElement;
|
|
329
|
+
return (_getActiveElement = getActiveElement(document)) !== null && _getActiveElement !== void 0 ? _getActiveElement : /* istanbul ignore next */ document.body;
|
|
330
|
+
}
|
|
331
|
+
//#endregion
|
|
332
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/findClosest.js
|
|
333
|
+
function findClosest(element, callback) {
|
|
334
|
+
let el = element;
|
|
335
|
+
do {
|
|
336
|
+
if (callback(el)) return el;
|
|
337
|
+
el = el.parentElement;
|
|
338
|
+
} while (el && el !== element.ownerDocument.body);
|
|
339
|
+
}
|
|
340
|
+
//#endregion
|
|
341
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/edit/isContentEditable.js
|
|
342
|
+
function isContentEditable(element) {
|
|
343
|
+
return element.hasAttribute("contenteditable") && (element.getAttribute("contenteditable") == "true" || element.getAttribute("contenteditable") == "");
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* If a node is a contenteditable or inside one, return that element.
|
|
347
|
+
*/ function getContentEditable(node) {
|
|
348
|
+
const element = getElement$1(node);
|
|
349
|
+
return element && (element.closest("[contenteditable=\"\"]") || element.closest("[contenteditable=\"true\"]"));
|
|
350
|
+
}
|
|
351
|
+
function getElement$1(node) {
|
|
352
|
+
return node.nodeType === 1 ? node : node.parentElement;
|
|
353
|
+
}
|
|
354
|
+
//#endregion
|
|
355
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/click/isClickableInput.js
|
|
356
|
+
var clickableInputTypes = /* @__PURE__ */ function(clickableInputTypes) {
|
|
357
|
+
clickableInputTypes["button"] = "button";
|
|
358
|
+
clickableInputTypes["color"] = "color";
|
|
359
|
+
clickableInputTypes["file"] = "file";
|
|
360
|
+
clickableInputTypes["image"] = "image";
|
|
361
|
+
clickableInputTypes["reset"] = "reset";
|
|
362
|
+
clickableInputTypes["submit"] = "submit";
|
|
363
|
+
clickableInputTypes["checkbox"] = "checkbox";
|
|
364
|
+
clickableInputTypes["radio"] = "radio";
|
|
365
|
+
return clickableInputTypes;
|
|
366
|
+
}(clickableInputTypes || {});
|
|
367
|
+
function isClickableInput(element) {
|
|
368
|
+
return isElementType(element, "button") || isElementType(element, "input") && element.type in clickableInputTypes;
|
|
369
|
+
}
|
|
370
|
+
//#endregion
|
|
371
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/edit/isEditable.js
|
|
372
|
+
function isEditable(element) {
|
|
373
|
+
return isEditableInputOrTextArea(element) && !element.readOnly || isContentEditable(element);
|
|
374
|
+
}
|
|
375
|
+
var editableInputTypes = /* @__PURE__ */ function(editableInputTypes) {
|
|
376
|
+
editableInputTypes["text"] = "text";
|
|
377
|
+
editableInputTypes["date"] = "date";
|
|
378
|
+
editableInputTypes["datetime-local"] = "datetime-local";
|
|
379
|
+
editableInputTypes["email"] = "email";
|
|
380
|
+
editableInputTypes["month"] = "month";
|
|
381
|
+
editableInputTypes["number"] = "number";
|
|
382
|
+
editableInputTypes["password"] = "password";
|
|
383
|
+
editableInputTypes["search"] = "search";
|
|
384
|
+
editableInputTypes["tel"] = "tel";
|
|
385
|
+
editableInputTypes["time"] = "time";
|
|
386
|
+
editableInputTypes["url"] = "url";
|
|
387
|
+
editableInputTypes["week"] = "week";
|
|
388
|
+
return editableInputTypes;
|
|
389
|
+
}(editableInputTypes || {});
|
|
390
|
+
function isEditableInputOrTextArea(element) {
|
|
391
|
+
return isElementType(element, "textarea") || isElementType(element, "input") && element.type in editableInputTypes;
|
|
392
|
+
}
|
|
393
|
+
//#endregion
|
|
394
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/focus/selection.js
|
|
395
|
+
/**
|
|
396
|
+
* Determine if the element has its own selection implementation
|
|
397
|
+
* and does not interact with the Document Selection API.
|
|
398
|
+
*/ function hasOwnSelection(node) {
|
|
399
|
+
return isElement$1(node) && isEditableInputOrTextArea(node);
|
|
400
|
+
}
|
|
401
|
+
function hasNoSelection(node) {
|
|
402
|
+
return isElement$1(node) && isClickableInput(node);
|
|
403
|
+
}
|
|
404
|
+
function isElement$1(node) {
|
|
405
|
+
return node.nodeType === 1;
|
|
406
|
+
}
|
|
407
|
+
//#endregion
|
|
408
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/selection/updateSelectionOnFocus.js
|
|
409
|
+
/**
|
|
410
|
+
* Reset the Document Selection when moving focus into an element
|
|
411
|
+
* with own selection implementation.
|
|
412
|
+
*/ function updateSelectionOnFocus(element) {
|
|
413
|
+
const selection = element.ownerDocument.getSelection();
|
|
414
|
+
/* istanbul ignore if */ if (!(selection === null || selection === void 0 ? void 0 : selection.focusNode)) return;
|
|
415
|
+
if (hasOwnSelection(element)) {
|
|
416
|
+
const contenteditable = getContentEditable(selection.focusNode);
|
|
417
|
+
if (contenteditable) {
|
|
418
|
+
if (!selection.isCollapsed) {
|
|
419
|
+
var _contenteditable_firstChild;
|
|
420
|
+
const focusNode = ((_contenteditable_firstChild = contenteditable.firstChild) === null || _contenteditable_firstChild === void 0 ? void 0 : _contenteditable_firstChild.nodeType) === 3 ? contenteditable.firstChild : contenteditable;
|
|
421
|
+
selection.setBaseAndExtent(focusNode, 0, focusNode, 0);
|
|
422
|
+
}
|
|
423
|
+
} else selection.setBaseAndExtent(element, 0, element, 0);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
//#endregion
|
|
427
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/wrapEvent.js
|
|
428
|
+
function wrapEvent(cb, _element) {
|
|
429
|
+
return require_react_esm.getConfig().eventWrapper(cb);
|
|
430
|
+
}
|
|
431
|
+
//#endregion
|
|
432
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/focus.js
|
|
433
|
+
/**
|
|
434
|
+
* Focus closest focusable element.
|
|
435
|
+
*/ function focusElement(element) {
|
|
436
|
+
const target = findClosest(element, isFocusable);
|
|
437
|
+
const activeElement = getActiveElement(element.ownerDocument);
|
|
438
|
+
if ((target !== null && target !== void 0 ? target : element.ownerDocument.body) === activeElement) return;
|
|
439
|
+
else if (target) wrapEvent(() => target.focus());
|
|
440
|
+
else wrapEvent(() => activeElement === null || activeElement === void 0 ? void 0 : activeElement.blur());
|
|
441
|
+
updateSelectionOnFocus(target !== null && target !== void 0 ? target : element.ownerDocument.body);
|
|
442
|
+
}
|
|
443
|
+
function blurElement(element) {
|
|
444
|
+
if (!isFocusable(element)) return;
|
|
445
|
+
if (!(getActiveElement(element.ownerDocument) === element)) return;
|
|
446
|
+
wrapEvent(() => element.blur());
|
|
447
|
+
}
|
|
448
|
+
//#endregion
|
|
449
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/behavior/registry.js
|
|
450
|
+
const behavior = {};
|
|
451
|
+
//#endregion
|
|
452
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/behavior/click.js
|
|
453
|
+
behavior.click = (event, target, instance) => {
|
|
454
|
+
const context = target.closest("button,input,label,select,textarea");
|
|
455
|
+
const control = context && isElementType(context, "label") && context.control;
|
|
456
|
+
if (control && control !== target) return () => {
|
|
457
|
+
if (isFocusable(control)) {
|
|
458
|
+
focusElement(control);
|
|
459
|
+
instance.dispatchEvent(control, cloneEvent(event));
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
else if (isElementType(target, "input", { type: "file" })) return () => {
|
|
463
|
+
blurElement(target);
|
|
464
|
+
target.dispatchEvent(new (getWindow(target)).Event("fileDialog"));
|
|
465
|
+
focusElement(target);
|
|
466
|
+
};
|
|
467
|
+
};
|
|
468
|
+
//#endregion
|
|
469
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/document/UI.js
|
|
470
|
+
const UIValue = Symbol("Displayed value in UI");
|
|
471
|
+
const UISelection = Symbol("Displayed selection in UI");
|
|
472
|
+
const InitialValue = Symbol("Initial value to compare on blur");
|
|
473
|
+
function isUIValue(value) {
|
|
474
|
+
return typeof value === "object" && UIValue in value;
|
|
475
|
+
}
|
|
476
|
+
function isUISelectionStart(start) {
|
|
477
|
+
return !!start && typeof start === "object" && UISelection in start;
|
|
478
|
+
}
|
|
479
|
+
function setUIValue(element, value) {
|
|
480
|
+
if (element[InitialValue] === void 0) element[InitialValue] = element.value;
|
|
481
|
+
element[UIValue] = value;
|
|
482
|
+
element.value = Object.assign(new String(value), { [UIValue]: true });
|
|
483
|
+
}
|
|
484
|
+
function getUIValue(element) {
|
|
485
|
+
return element[UIValue] === void 0 ? element.value : String(element[UIValue]);
|
|
486
|
+
}
|
|
487
|
+
/** Flag the IDL value as clean. This does not change the value.*/ function setUIValueClean(element) {
|
|
488
|
+
element[UIValue] = void 0;
|
|
489
|
+
}
|
|
490
|
+
function clearInitialValue(element) {
|
|
491
|
+
element[InitialValue] = void 0;
|
|
492
|
+
}
|
|
493
|
+
function getInitialValue(element) {
|
|
494
|
+
return element[InitialValue];
|
|
495
|
+
}
|
|
496
|
+
function setUISelectionRaw(element, selection) {
|
|
497
|
+
element[UISelection] = selection;
|
|
498
|
+
}
|
|
499
|
+
function setUISelection(element, { focusOffset: focusOffsetParam, anchorOffset: anchorOffsetParam = focusOffsetParam }, mode = "replace") {
|
|
500
|
+
const valueLength = getUIValue(element).length;
|
|
501
|
+
const sanitizeOffset = (o) => Math.max(0, Math.min(valueLength, o));
|
|
502
|
+
const anchorOffset = mode === "replace" || element[UISelection] === void 0 ? sanitizeOffset(anchorOffsetParam) : element[UISelection].anchorOffset;
|
|
503
|
+
const focusOffset = sanitizeOffset(focusOffsetParam);
|
|
504
|
+
const startOffset = Math.min(anchorOffset, focusOffset);
|
|
505
|
+
const endOffset = Math.max(anchorOffset, focusOffset);
|
|
506
|
+
element[UISelection] = {
|
|
507
|
+
anchorOffset,
|
|
508
|
+
focusOffset
|
|
509
|
+
};
|
|
510
|
+
if (element.selectionStart === startOffset && element.selectionEnd === endOffset) return;
|
|
511
|
+
const startObj = Object.assign(new Number(startOffset), { [UISelection]: true });
|
|
512
|
+
try {
|
|
513
|
+
element.setSelectionRange(startObj, endOffset);
|
|
514
|
+
} catch {}
|
|
515
|
+
}
|
|
516
|
+
function getUISelection(element) {
|
|
517
|
+
var _element_selectionStart, _element_selectionEnd, _element_UISelection;
|
|
518
|
+
const sel = (_element_UISelection = element[UISelection]) !== null && _element_UISelection !== void 0 ? _element_UISelection : {
|
|
519
|
+
anchorOffset: (_element_selectionStart = element.selectionStart) !== null && _element_selectionStart !== void 0 ? _element_selectionStart : 0,
|
|
520
|
+
focusOffset: (_element_selectionEnd = element.selectionEnd) !== null && _element_selectionEnd !== void 0 ? _element_selectionEnd : 0
|
|
521
|
+
};
|
|
522
|
+
return {
|
|
523
|
+
...sel,
|
|
524
|
+
startOffset: Math.min(sel.anchorOffset, sel.focusOffset),
|
|
525
|
+
endOffset: Math.max(sel.anchorOffset, sel.focusOffset)
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
function hasUISelection(element) {
|
|
529
|
+
return !!element[UISelection];
|
|
530
|
+
}
|
|
531
|
+
/** Flag the IDL selection as clean. This does not change the selection. */ function setUISelectionClean(element) {
|
|
532
|
+
element[UISelection] = void 0;
|
|
533
|
+
}
|
|
534
|
+
//#endregion
|
|
535
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/edit/timeValue.js
|
|
536
|
+
const parseInt = globalThis.parseInt;
|
|
537
|
+
function buildTimeValue(value) {
|
|
538
|
+
const onlyDigitsValue = value.replace(/\D/g, "");
|
|
539
|
+
if (onlyDigitsValue.length < 2) return value;
|
|
540
|
+
const firstDigit = parseInt(onlyDigitsValue[0], 10);
|
|
541
|
+
const secondDigit = parseInt(onlyDigitsValue[1], 10);
|
|
542
|
+
if (firstDigit >= 3 || firstDigit === 2 && secondDigit >= 4) {
|
|
543
|
+
let index;
|
|
544
|
+
if (firstDigit >= 3) index = 1;
|
|
545
|
+
else index = 2;
|
|
546
|
+
return build(onlyDigitsValue, index);
|
|
547
|
+
}
|
|
548
|
+
if (value.length === 2) return value;
|
|
549
|
+
return build(onlyDigitsValue, 2);
|
|
550
|
+
}
|
|
551
|
+
function build(onlyDigitsValue, index) {
|
|
552
|
+
const hours = onlyDigitsValue.slice(0, index);
|
|
553
|
+
const validHours = Math.min(parseInt(hours, 10), 23);
|
|
554
|
+
const parsedMinutes = parseInt(onlyDigitsValue.slice(index), 10);
|
|
555
|
+
const validMinutes = Math.min(parsedMinutes, 59);
|
|
556
|
+
return `${validHours.toString().padStart(2, "0")}:${validMinutes.toString().padStart(2, "0")}`;
|
|
557
|
+
}
|
|
558
|
+
function isValidDateOrTimeValue(element, value) {
|
|
559
|
+
const clone = element.cloneNode();
|
|
560
|
+
clone.value = value;
|
|
561
|
+
return clone.value === value;
|
|
562
|
+
}
|
|
563
|
+
//#endregion
|
|
564
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/edit/maxLength.js
|
|
565
|
+
var maxLengthSupportedTypes = /* @__PURE__ */ function(maxLengthSupportedTypes) {
|
|
566
|
+
maxLengthSupportedTypes["email"] = "email";
|
|
567
|
+
maxLengthSupportedTypes["password"] = "password";
|
|
568
|
+
maxLengthSupportedTypes["search"] = "search";
|
|
569
|
+
maxLengthSupportedTypes["telephone"] = "telephone";
|
|
570
|
+
maxLengthSupportedTypes["text"] = "text";
|
|
571
|
+
maxLengthSupportedTypes["url"] = "url";
|
|
572
|
+
return maxLengthSupportedTypes;
|
|
573
|
+
}(maxLengthSupportedTypes || {});
|
|
574
|
+
function getMaxLength(element) {
|
|
575
|
+
var _element_getAttribute;
|
|
576
|
+
const attr = (_element_getAttribute = element.getAttribute("maxlength")) !== null && _element_getAttribute !== void 0 ? _element_getAttribute : "";
|
|
577
|
+
return /^\d+$/.test(attr) && Number(attr) >= 0 ? Number(attr) : void 0;
|
|
578
|
+
}
|
|
579
|
+
function supportsMaxLength(element) {
|
|
580
|
+
return isElementType(element, "textarea") || isElementType(element, "input") && element.type in maxLengthSupportedTypes;
|
|
581
|
+
}
|
|
582
|
+
//#endregion
|
|
583
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/focus/cursor.js
|
|
584
|
+
function getNextCursorPosition(node, offset, direction, inputType) {
|
|
585
|
+
if (isTextNode(node) && offset + direction >= 0 && offset + direction <= node.nodeValue.length) return {
|
|
586
|
+
node,
|
|
587
|
+
offset: offset + direction
|
|
588
|
+
};
|
|
589
|
+
const nextNode = getNextCharacterContentNode(node, offset, direction);
|
|
590
|
+
if (nextNode) if (isTextNode(nextNode)) return {
|
|
591
|
+
node: nextNode,
|
|
592
|
+
offset: direction > 0 ? Math.min(1, nextNode.nodeValue.length) : Math.max(nextNode.nodeValue.length - 1, 0)
|
|
593
|
+
};
|
|
594
|
+
else if (isElementType(nextNode, "br")) {
|
|
595
|
+
const nextPlusOne = getNextCharacterContentNode(nextNode, void 0, direction);
|
|
596
|
+
if (!nextPlusOne) {
|
|
597
|
+
if (direction < 0 && inputType === "deleteContentBackward") return {
|
|
598
|
+
node: nextNode.parentNode,
|
|
599
|
+
offset: getOffset(nextNode)
|
|
600
|
+
};
|
|
601
|
+
return;
|
|
602
|
+
} else if (isTextNode(nextPlusOne)) return {
|
|
603
|
+
node: nextPlusOne,
|
|
604
|
+
offset: direction > 0 ? 0 : nextPlusOne.nodeValue.length
|
|
605
|
+
};
|
|
606
|
+
else if (direction < 0 && isElementType(nextPlusOne, "br")) return {
|
|
607
|
+
node: nextNode.parentNode,
|
|
608
|
+
offset: getOffset(nextNode)
|
|
609
|
+
};
|
|
610
|
+
else return {
|
|
611
|
+
node: nextPlusOne.parentNode,
|
|
612
|
+
offset: getOffset(nextPlusOne) + (direction > 0 ? 0 : 1)
|
|
613
|
+
};
|
|
614
|
+
} else return {
|
|
615
|
+
node: nextNode.parentNode,
|
|
616
|
+
offset: getOffset(nextNode) + (direction > 0 ? 1 : 0)
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
function getNextCharacterContentNode(node, offset, direction) {
|
|
620
|
+
const nextOffset = Number(offset) + (direction < 0 ? -1 : 0);
|
|
621
|
+
if (offset !== void 0 && isElement(node) && nextOffset >= 0 && nextOffset < node.children.length) node = node.children[nextOffset];
|
|
622
|
+
return walkNodes(node, direction === 1 ? "next" : "previous", isTreatedAsCharacterContent);
|
|
623
|
+
}
|
|
624
|
+
function isTreatedAsCharacterContent(node) {
|
|
625
|
+
if (isTextNode(node)) return true;
|
|
626
|
+
if (isElement(node)) {
|
|
627
|
+
if (isElementType(node, ["input", "textarea"])) return node.type !== "hidden";
|
|
628
|
+
else if (isElementType(node, "br")) return true;
|
|
629
|
+
}
|
|
630
|
+
return false;
|
|
631
|
+
}
|
|
632
|
+
function getOffset(node) {
|
|
633
|
+
let i = 0;
|
|
634
|
+
while (node.previousSibling) {
|
|
635
|
+
i++;
|
|
636
|
+
node = node.previousSibling;
|
|
637
|
+
}
|
|
638
|
+
return i;
|
|
639
|
+
}
|
|
640
|
+
function isElement(node) {
|
|
641
|
+
return node.nodeType === 1;
|
|
642
|
+
}
|
|
643
|
+
function isTextNode(node) {
|
|
644
|
+
return node.nodeType === 3;
|
|
645
|
+
}
|
|
646
|
+
function walkNodes(node, direction, callback) {
|
|
647
|
+
for (;;) {
|
|
648
|
+
var _node_ownerDocument;
|
|
649
|
+
const sibling = node[`${direction}Sibling`];
|
|
650
|
+
if (sibling) {
|
|
651
|
+
node = getDescendant(sibling, direction === "next" ? "first" : "last");
|
|
652
|
+
if (callback(node)) return node;
|
|
653
|
+
} else if (node.parentNode && (!isElement(node.parentNode) || !isContentEditable(node.parentNode) && node.parentNode !== ((_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === void 0 ? void 0 : _node_ownerDocument.body))) node = node.parentNode;
|
|
654
|
+
else break;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
function getDescendant(node, direction) {
|
|
658
|
+
while (node.hasChildNodes()) node = node[`${direction}Child`];
|
|
659
|
+
return node;
|
|
660
|
+
}
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/document/trackValue.js
|
|
663
|
+
const TrackChanges = Symbol("Track programmatic changes for React workaround");
|
|
664
|
+
function isReact17Element(element) {
|
|
665
|
+
return Object.getOwnPropertyNames(element).some((k) => k.startsWith("__react")) && getWindow(element).REACT_VERSION === 17;
|
|
666
|
+
}
|
|
667
|
+
function startTrackValue(element) {
|
|
668
|
+
if (!isReact17Element(element)) return;
|
|
669
|
+
element[TrackChanges] = {
|
|
670
|
+
previousValue: String(element.value),
|
|
671
|
+
tracked: []
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
function trackOrSetValue(element, v) {
|
|
675
|
+
var _element_TrackChanges_tracked, _element_TrackChanges;
|
|
676
|
+
(_element_TrackChanges = element[TrackChanges]) === null || _element_TrackChanges === void 0 || (_element_TrackChanges_tracked = _element_TrackChanges.tracked) == null || _element_TrackChanges_tracked.push(v);
|
|
677
|
+
if (!element[TrackChanges]) {
|
|
678
|
+
setUIValueClean(element);
|
|
679
|
+
setUISelection(element, { focusOffset: v.length });
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
function commitValueAfterInput(element, cursorOffset) {
|
|
683
|
+
var _changes_tracked;
|
|
684
|
+
const changes = element[TrackChanges];
|
|
685
|
+
element[TrackChanges] = void 0;
|
|
686
|
+
if (!(changes === null || changes === void 0 ? void 0 : (_changes_tracked = changes.tracked) === null || _changes_tracked === void 0 ? void 0 : _changes_tracked.length)) return;
|
|
687
|
+
const isJustReactStateUpdate = changes.tracked.length === 2 && changes.tracked[0] === changes.previousValue && changes.tracked[1] === element.value;
|
|
688
|
+
if (!isJustReactStateUpdate) setUIValueClean(element);
|
|
689
|
+
if (hasUISelection(element)) setUISelection(element, { focusOffset: isJustReactStateUpdate ? cursorOffset : element.value.length });
|
|
690
|
+
}
|
|
691
|
+
//#endregion
|
|
692
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/selection/getTargetTypeAndSelection.js
|
|
693
|
+
/**
|
|
694
|
+
* Determine which selection logic and selection ranges to consider.
|
|
695
|
+
*/ function getTargetTypeAndSelection(node) {
|
|
696
|
+
const element = getElement(node);
|
|
697
|
+
if (element && hasOwnSelection(element)) return {
|
|
698
|
+
type: "input",
|
|
699
|
+
selection: getUISelection(element)
|
|
700
|
+
};
|
|
701
|
+
const selection = element === null || element === void 0 ? void 0 : element.ownerDocument.getSelection();
|
|
702
|
+
return {
|
|
703
|
+
type: getContentEditable(node) && (selection === null || selection === void 0 ? void 0 : selection.anchorNode) && getContentEditable(selection.anchorNode) ? "contenteditable" : "default",
|
|
704
|
+
selection
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
function getElement(node) {
|
|
708
|
+
return node.nodeType === 1 ? node : node.parentElement;
|
|
709
|
+
}
|
|
710
|
+
//#endregion
|
|
711
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/selection/getInputRange.js
|
|
712
|
+
/**
|
|
713
|
+
* Get the range that would be overwritten by input.
|
|
714
|
+
*/ function getInputRange(focusNode) {
|
|
715
|
+
const typeAndSelection = getTargetTypeAndSelection(focusNode);
|
|
716
|
+
if (typeAndSelection.type === "input") return typeAndSelection.selection;
|
|
717
|
+
else if (typeAndSelection.type === "contenteditable") {
|
|
718
|
+
var _typeAndSelection_selection;
|
|
719
|
+
return (_typeAndSelection_selection = typeAndSelection.selection) === null || _typeAndSelection_selection === void 0 ? void 0 : _typeAndSelection_selection.getRangeAt(0);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
//#endregion
|
|
723
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/selection/setSelection.js
|
|
724
|
+
/**
|
|
725
|
+
* Set the selection
|
|
726
|
+
*/ function setSelection({ focusNode, focusOffset, anchorNode = focusNode, anchorOffset = focusOffset }) {
|
|
727
|
+
var _anchorNode_ownerDocument_getSelection, _anchorNode_ownerDocument;
|
|
728
|
+
if (getTargetTypeAndSelection(focusNode).type === "input") return setUISelection(focusNode, {
|
|
729
|
+
anchorOffset,
|
|
730
|
+
focusOffset
|
|
731
|
+
});
|
|
732
|
+
(_anchorNode_ownerDocument = anchorNode.ownerDocument) === null || _anchorNode_ownerDocument === void 0 || (_anchorNode_ownerDocument_getSelection = _anchorNode_ownerDocument.getSelection()) == null || _anchorNode_ownerDocument_getSelection.setBaseAndExtent(anchorNode, anchorOffset, focusNode, focusOffset);
|
|
733
|
+
}
|
|
734
|
+
//#endregion
|
|
735
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/input.js
|
|
736
|
+
function isDateOrTime(element) {
|
|
737
|
+
return isElementType(element, "input") && ["date", "time"].includes(element.type);
|
|
738
|
+
}
|
|
739
|
+
function input(instance, element, data, inputType = "insertText") {
|
|
740
|
+
const inputRange = getInputRange(element);
|
|
741
|
+
/* istanbul ignore if */ if (!inputRange) return;
|
|
742
|
+
if (!isDateOrTime(element)) {
|
|
743
|
+
if (!instance.dispatchUIEvent(element, "beforeinput", {
|
|
744
|
+
inputType,
|
|
745
|
+
data
|
|
746
|
+
})) return;
|
|
747
|
+
}
|
|
748
|
+
if ("startContainer" in inputRange) editContenteditable(instance, element, inputRange, data, inputType);
|
|
749
|
+
else editInputElement(instance, element, inputRange, data, inputType);
|
|
750
|
+
}
|
|
751
|
+
function editContenteditable(instance, element, inputRange, data, inputType) {
|
|
752
|
+
let del = false;
|
|
753
|
+
if (!inputRange.collapsed) {
|
|
754
|
+
del = true;
|
|
755
|
+
inputRange.deleteContents();
|
|
756
|
+
} else if (["deleteContentBackward", "deleteContentForward"].includes(inputType)) {
|
|
757
|
+
const nextPosition = getNextCursorPosition(inputRange.startContainer, inputRange.startOffset, inputType === "deleteContentBackward" ? -1 : 1, inputType);
|
|
758
|
+
if (nextPosition) {
|
|
759
|
+
del = true;
|
|
760
|
+
const delRange = inputRange.cloneRange();
|
|
761
|
+
if (delRange.comparePoint(nextPosition.node, nextPosition.offset) < 0) delRange.setStart(nextPosition.node, nextPosition.offset);
|
|
762
|
+
else delRange.setEnd(nextPosition.node, nextPosition.offset);
|
|
763
|
+
delRange.deleteContents();
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
if (data) if (inputRange.endContainer.nodeType === 3) {
|
|
767
|
+
const offset = inputRange.endOffset;
|
|
768
|
+
inputRange.endContainer.insertData(offset, data);
|
|
769
|
+
inputRange.setStart(inputRange.endContainer, offset + data.length);
|
|
770
|
+
inputRange.setEnd(inputRange.endContainer, offset + data.length);
|
|
771
|
+
} else {
|
|
772
|
+
const text = element.ownerDocument.createTextNode(data);
|
|
773
|
+
inputRange.insertNode(text);
|
|
774
|
+
inputRange.setStart(text, data.length);
|
|
775
|
+
inputRange.setEnd(text, data.length);
|
|
776
|
+
}
|
|
777
|
+
if (del || data) instance.dispatchUIEvent(element, "input", { inputType });
|
|
778
|
+
}
|
|
779
|
+
function editInputElement(instance, element, inputRange, data, inputType) {
|
|
780
|
+
let dataToInsert = data;
|
|
781
|
+
if (supportsMaxLength(element)) {
|
|
782
|
+
const maxLength = getMaxLength(element);
|
|
783
|
+
if (maxLength !== void 0 && data.length > 0) {
|
|
784
|
+
const spaceUntilMaxLength = maxLength - element.value.length;
|
|
785
|
+
if (spaceUntilMaxLength > 0) dataToInsert = data.substring(0, spaceUntilMaxLength);
|
|
786
|
+
else return;
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
const { newValue, newOffset, oldValue } = calculateNewValue(dataToInsert, element, inputRange, inputType);
|
|
790
|
+
if (newValue === oldValue && newOffset === inputRange.startOffset && newOffset === inputRange.endOffset) return;
|
|
791
|
+
if (isElementType(element, "input", { type: "number" }) && !isValidNumberInput(newValue)) return;
|
|
792
|
+
setUIValue(element, newValue);
|
|
793
|
+
setSelection({
|
|
794
|
+
focusNode: element,
|
|
795
|
+
anchorOffset: newOffset,
|
|
796
|
+
focusOffset: newOffset
|
|
797
|
+
});
|
|
798
|
+
if (isDateOrTime(element)) {
|
|
799
|
+
if (isValidDateOrTimeValue(element, newValue)) {
|
|
800
|
+
commitInput(instance, element, newOffset, {});
|
|
801
|
+
instance.dispatchUIEvent(element, "change");
|
|
802
|
+
clearInitialValue(element);
|
|
803
|
+
}
|
|
804
|
+
} else commitInput(instance, element, newOffset, {
|
|
805
|
+
data,
|
|
806
|
+
inputType
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
function calculateNewValue(inputData, node, { startOffset, endOffset }, inputType) {
|
|
810
|
+
const value = getUIValue(node);
|
|
811
|
+
const prologEnd = Math.max(0, startOffset === endOffset && inputType === "deleteContentBackward" ? startOffset - 1 : startOffset);
|
|
812
|
+
const prolog = value.substring(0, prologEnd);
|
|
813
|
+
const epilogStart = Math.min(value.length, startOffset === endOffset && inputType === "deleteContentForward" ? startOffset + 1 : endOffset);
|
|
814
|
+
let newValue = `${prolog}${inputData}${value.substring(epilogStart, value.length)}`;
|
|
815
|
+
let newOffset = prologEnd + inputData.length;
|
|
816
|
+
if (isElementType(node, "input", { type: "time" })) {
|
|
817
|
+
const builtValue = buildTimeValue(newValue);
|
|
818
|
+
if (builtValue !== "" && isValidDateOrTimeValue(node, builtValue)) {
|
|
819
|
+
newValue = builtValue;
|
|
820
|
+
newOffset = builtValue.length;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
return {
|
|
824
|
+
oldValue: value,
|
|
825
|
+
newValue,
|
|
826
|
+
newOffset
|
|
827
|
+
};
|
|
828
|
+
}
|
|
829
|
+
function commitInput(instance, element, newOffset, inputInit) {
|
|
830
|
+
instance.dispatchUIEvent(element, "input", inputInit);
|
|
831
|
+
commitValueAfterInput(element, newOffset);
|
|
832
|
+
}
|
|
833
|
+
function isValidNumberInput(value) {
|
|
834
|
+
var _value_match, _value_match1;
|
|
835
|
+
const valueParts = value.split("e", 2);
|
|
836
|
+
return !(/[^\d.\-e]/.test(value) || Number((_value_match = value.match(/-/g)) === null || _value_match === void 0 ? void 0 : _value_match.length) > 2 || Number((_value_match1 = value.match(/\./g)) === null || _value_match1 === void 0 ? void 0 : _value_match1.length) > 1 || valueParts[1] && !/^-?\d*$/.test(valueParts[1]));
|
|
837
|
+
}
|
|
838
|
+
//#endregion
|
|
839
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/behavior/cut.js
|
|
840
|
+
behavior.cut = (event, target, instance) => {
|
|
841
|
+
return () => {
|
|
842
|
+
if (isEditable(target)) input(instance, target, "", "deleteByCut");
|
|
843
|
+
};
|
|
844
|
+
};
|
|
845
|
+
//#endregion
|
|
846
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/document/getValueOrTextContent.js
|
|
847
|
+
function getValueOrTextContent(element) {
|
|
848
|
+
// istanbul ignore if
|
|
849
|
+
if (!element) return null;
|
|
850
|
+
if (isContentEditable(element)) return element.textContent;
|
|
851
|
+
return getUIValue(element);
|
|
852
|
+
}
|
|
853
|
+
//#endregion
|
|
854
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/isVisible.js
|
|
855
|
+
function isVisible(element) {
|
|
856
|
+
const window = getWindow(element);
|
|
857
|
+
for (let el = element; el === null || el === void 0 ? void 0 : el.ownerDocument; el = el.parentElement) {
|
|
858
|
+
const { display, visibility } = window.getComputedStyle(el);
|
|
859
|
+
if (display === "none") return false;
|
|
860
|
+
if (visibility === "hidden") return false;
|
|
861
|
+
}
|
|
862
|
+
return true;
|
|
863
|
+
}
|
|
864
|
+
//#endregion
|
|
865
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/focus/getTabDestination.js
|
|
866
|
+
function getTabDestination(activeElement, shift) {
|
|
867
|
+
const document = activeElement.ownerDocument;
|
|
868
|
+
const focusableElements = document.querySelectorAll(FOCUSABLE_SELECTOR);
|
|
869
|
+
const enabledElements = Array.from(focusableElements).filter((el) => el === activeElement || !(Number(el.getAttribute("tabindex")) < 0 || isDisabled(el)));
|
|
870
|
+
if (Number(activeElement.getAttribute("tabindex")) >= 0) enabledElements.sort((a, b) => {
|
|
871
|
+
const i = Number(a.getAttribute("tabindex"));
|
|
872
|
+
const j = Number(b.getAttribute("tabindex"));
|
|
873
|
+
if (i === j) return 0;
|
|
874
|
+
else if (i === 0) return 1;
|
|
875
|
+
else if (j === 0) return -1;
|
|
876
|
+
return i - j;
|
|
877
|
+
});
|
|
878
|
+
const checkedRadio = {};
|
|
879
|
+
let prunedElements = [document.body];
|
|
880
|
+
const activeRadioGroup = isElementType(activeElement, "input", { type: "radio" }) ? activeElement.name : void 0;
|
|
881
|
+
enabledElements.forEach((currentElement) => {
|
|
882
|
+
const el = currentElement;
|
|
883
|
+
if (isElementType(el, "input", { type: "radio" }) && el.name) {
|
|
884
|
+
if (el === activeElement) {
|
|
885
|
+
prunedElements.push(el);
|
|
886
|
+
return;
|
|
887
|
+
} else if (el.name === activeRadioGroup) return;
|
|
888
|
+
if (el.checked) {
|
|
889
|
+
prunedElements = prunedElements.filter((e) => !isElementType(e, "input", {
|
|
890
|
+
type: "radio",
|
|
891
|
+
name: el.name
|
|
892
|
+
}));
|
|
893
|
+
prunedElements.push(el);
|
|
894
|
+
checkedRadio[el.name] = el;
|
|
895
|
+
return;
|
|
896
|
+
}
|
|
897
|
+
if (typeof checkedRadio[el.name] !== "undefined") return;
|
|
898
|
+
}
|
|
899
|
+
prunedElements.push(el);
|
|
900
|
+
});
|
|
901
|
+
for (let index = prunedElements.findIndex((el) => el === activeElement);;) {
|
|
902
|
+
index += shift ? -1 : 1;
|
|
903
|
+
if (index === prunedElements.length) index = 0;
|
|
904
|
+
else if (index === -1) index = prunedElements.length - 1;
|
|
905
|
+
if (prunedElements[index] === activeElement || prunedElements[index] === document.body || isVisible(prunedElements[index])) return prunedElements[index];
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
//#endregion
|
|
909
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/selection/moveSelection.js
|
|
910
|
+
/**
|
|
911
|
+
* Move the selection
|
|
912
|
+
*/ function moveSelection(node, direction) {
|
|
913
|
+
if (hasOwnSelection(node)) {
|
|
914
|
+
const selection = getUISelection(node);
|
|
915
|
+
setSelection({
|
|
916
|
+
focusNode: node,
|
|
917
|
+
focusOffset: selection.startOffset === selection.endOffset ? selection.focusOffset + direction : direction < 0 ? selection.startOffset : selection.endOffset
|
|
918
|
+
});
|
|
919
|
+
} else {
|
|
920
|
+
const selection = node.ownerDocument.getSelection();
|
|
921
|
+
if (!(selection === null || selection === void 0 ? void 0 : selection.focusNode)) return;
|
|
922
|
+
if (selection.isCollapsed) {
|
|
923
|
+
const nextPosition = getNextCursorPosition(selection.focusNode, selection.focusOffset, direction);
|
|
924
|
+
if (nextPosition) setSelection({
|
|
925
|
+
focusNode: nextPosition.node,
|
|
926
|
+
focusOffset: nextPosition.offset
|
|
927
|
+
});
|
|
928
|
+
} else selection[direction < 0 ? "collapseToStart" : "collapseToEnd"]();
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
//#endregion
|
|
932
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/selection/selectAll.js
|
|
933
|
+
/**
|
|
934
|
+
* Expand a selection like the browser does when pressing Ctrl+A.
|
|
935
|
+
*/ function selectAll(target) {
|
|
936
|
+
if (hasOwnSelection(target)) return setSelection({
|
|
937
|
+
focusNode: target,
|
|
938
|
+
anchorOffset: 0,
|
|
939
|
+
focusOffset: getUIValue(target).length
|
|
940
|
+
});
|
|
941
|
+
var _getContentEditable;
|
|
942
|
+
const focusNode = (_getContentEditable = getContentEditable(target)) !== null && _getContentEditable !== void 0 ? _getContentEditable : target.ownerDocument.body;
|
|
943
|
+
setSelection({
|
|
944
|
+
focusNode,
|
|
945
|
+
anchorOffset: 0,
|
|
946
|
+
focusOffset: focusNode.childNodes.length
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
function isAllSelected(target) {
|
|
950
|
+
if (hasOwnSelection(target)) return getUISelection(target).startOffset === 0 && getUISelection(target).endOffset === getUIValue(target).length;
|
|
951
|
+
var _getContentEditable;
|
|
952
|
+
const focusNode = (_getContentEditable = getContentEditable(target)) !== null && _getContentEditable !== void 0 ? _getContentEditable : target.ownerDocument.body;
|
|
953
|
+
const selection = target.ownerDocument.getSelection();
|
|
954
|
+
return (selection === null || selection === void 0 ? void 0 : selection.anchorNode) === focusNode && selection.focusNode === focusNode && selection.anchorOffset === 0 && selection.focusOffset === focusNode.childNodes.length;
|
|
955
|
+
}
|
|
956
|
+
//#endregion
|
|
957
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/selection/setSelectionRange.js
|
|
958
|
+
/**
|
|
959
|
+
* Backward-compatible selection.
|
|
960
|
+
*
|
|
961
|
+
* Handles input elements and contenteditable if it only contains a single text node.
|
|
962
|
+
*/ function setSelectionRange(element, anchorOffset, focusOffset) {
|
|
963
|
+
var _element_firstChild;
|
|
964
|
+
if (hasOwnSelection(element)) return setSelection({
|
|
965
|
+
focusNode: element,
|
|
966
|
+
anchorOffset,
|
|
967
|
+
focusOffset
|
|
968
|
+
});
|
|
969
|
+
/* istanbul ignore else */ if (isContentEditable(element) && ((_element_firstChild = element.firstChild) === null || _element_firstChild === void 0 ? void 0 : _element_firstChild.nodeType) === 3) return setSelection({
|
|
970
|
+
focusNode: element.firstChild,
|
|
971
|
+
anchorOffset,
|
|
972
|
+
focusOffset
|
|
973
|
+
});
|
|
974
|
+
/* istanbul ignore next */ throw new Error("Not implemented. The result of this interaction is unreliable.");
|
|
975
|
+
}
|
|
976
|
+
//#endregion
|
|
977
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/radio.js
|
|
978
|
+
function walkRadio(instance, el, direction) {
|
|
979
|
+
const window = getWindow(el);
|
|
980
|
+
const group = Array.from(el.ownerDocument.querySelectorAll(el.name ? `input[type="radio"][name="${window.CSS.escape(el.name)}"]` : `input[type="radio"][name=""], input[type="radio"]:not([name])`));
|
|
981
|
+
for (let i = group.findIndex((e) => e === el) + direction;; i += direction) {
|
|
982
|
+
if (!group[i]) i = direction > 0 ? 0 : group.length - 1;
|
|
983
|
+
if (group[i] === el) return;
|
|
984
|
+
if (isDisabled(group[i])) continue;
|
|
985
|
+
focusElement(group[i]);
|
|
986
|
+
instance.dispatchUIEvent(group[i], "click");
|
|
987
|
+
return;
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
//#endregion
|
|
991
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/behavior/keydown.js
|
|
992
|
+
behavior.keydown = (event, target, instance) => {
|
|
993
|
+
var _keydownBehavior_event_key;
|
|
994
|
+
var _keydownBehavior_event_key1;
|
|
995
|
+
return (_keydownBehavior_event_key1 = (_keydownBehavior_event_key = keydownBehavior[event.key]) === null || _keydownBehavior_event_key === void 0 ? void 0 : _keydownBehavior_event_key.call(keydownBehavior, event, target, instance)) !== null && _keydownBehavior_event_key1 !== void 0 ? _keydownBehavior_event_key1 : combinationBehavior(event, target, instance);
|
|
996
|
+
};
|
|
997
|
+
const keydownBehavior = {
|
|
998
|
+
ArrowDown: (event, target, instance) => {
|
|
999
|
+
/* istanbul ignore else */ if (isElementType(target, "input", { type: "radio" })) return () => walkRadio(instance, target, 1);
|
|
1000
|
+
},
|
|
1001
|
+
ArrowLeft: (event, target, instance) => {
|
|
1002
|
+
if (isElementType(target, "input", { type: "radio" })) return () => walkRadio(instance, target, -1);
|
|
1003
|
+
return () => moveSelection(target, -1);
|
|
1004
|
+
},
|
|
1005
|
+
ArrowRight: (event, target, instance) => {
|
|
1006
|
+
if (isElementType(target, "input", { type: "radio" })) return () => walkRadio(instance, target, 1);
|
|
1007
|
+
return () => moveSelection(target, 1);
|
|
1008
|
+
},
|
|
1009
|
+
ArrowUp: (event, target, instance) => {
|
|
1010
|
+
/* istanbul ignore else */ if (isElementType(target, "input", { type: "radio" })) return () => walkRadio(instance, target, -1);
|
|
1011
|
+
},
|
|
1012
|
+
Backspace: (event, target, instance) => {
|
|
1013
|
+
if (isEditable(target)) return () => {
|
|
1014
|
+
input(instance, target, "", "deleteContentBackward");
|
|
1015
|
+
};
|
|
1016
|
+
},
|
|
1017
|
+
Delete: (event, target, instance) => {
|
|
1018
|
+
if (isEditable(target)) return () => {
|
|
1019
|
+
input(instance, target, "", "deleteContentForward");
|
|
1020
|
+
};
|
|
1021
|
+
},
|
|
1022
|
+
End: (event, target) => {
|
|
1023
|
+
if (isElementType(target, ["input", "textarea"]) || isContentEditable(target)) return () => {
|
|
1024
|
+
var _getValueOrTextContent;
|
|
1025
|
+
var _getValueOrTextContent_length;
|
|
1026
|
+
const newPos = (_getValueOrTextContent_length = (_getValueOrTextContent = getValueOrTextContent(target)) === null || _getValueOrTextContent === void 0 ? void 0 : _getValueOrTextContent.length) !== null && _getValueOrTextContent_length !== void 0 ? _getValueOrTextContent_length : /* istanbul ignore next */ 0;
|
|
1027
|
+
setSelectionRange(target, newPos, newPos);
|
|
1028
|
+
};
|
|
1029
|
+
},
|
|
1030
|
+
Home: (event, target) => {
|
|
1031
|
+
if (isElementType(target, ["input", "textarea"]) || isContentEditable(target)) return () => {
|
|
1032
|
+
setSelectionRange(target, 0, 0);
|
|
1033
|
+
};
|
|
1034
|
+
},
|
|
1035
|
+
PageDown: (event, target) => {
|
|
1036
|
+
if (isElementType(target, ["input"])) return () => {
|
|
1037
|
+
const newPos = getUIValue(target).length;
|
|
1038
|
+
setSelectionRange(target, newPos, newPos);
|
|
1039
|
+
};
|
|
1040
|
+
},
|
|
1041
|
+
PageUp: (event, target) => {
|
|
1042
|
+
if (isElementType(target, ["input"])) return () => {
|
|
1043
|
+
setSelectionRange(target, 0, 0);
|
|
1044
|
+
};
|
|
1045
|
+
},
|
|
1046
|
+
Tab: (event, target, instance) => {
|
|
1047
|
+
return () => {
|
|
1048
|
+
const dest = getTabDestination(target, instance.system.keyboard.modifiers.Shift);
|
|
1049
|
+
focusElement(dest);
|
|
1050
|
+
if (hasOwnSelection(dest)) setUISelection(dest, {
|
|
1051
|
+
anchorOffset: 0,
|
|
1052
|
+
focusOffset: dest.value.length
|
|
1053
|
+
});
|
|
1054
|
+
};
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
1057
|
+
const combinationBehavior = (event, target, instance) => {
|
|
1058
|
+
if (event.code === "KeyA" && instance.system.keyboard.modifiers.Control) return () => selectAll(target);
|
|
1059
|
+
};
|
|
1060
|
+
//#endregion
|
|
1061
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/behavior/keypress.js
|
|
1062
|
+
behavior.keypress = (event, target, instance) => {
|
|
1063
|
+
if (event.key === "Enter") {
|
|
1064
|
+
if (isElementType(target, "button") || isElementType(target, "input") && ClickInputOnEnter.includes(target.type) || isElementType(target, "a") && Boolean(target.href)) return () => {
|
|
1065
|
+
instance.dispatchUIEvent(target, "click");
|
|
1066
|
+
};
|
|
1067
|
+
else if (isElementType(target, "input")) {
|
|
1068
|
+
const form = target.form;
|
|
1069
|
+
const submit = form === null || form === void 0 ? void 0 : form.querySelector("input[type=\"submit\"], button:not([type]), button[type=\"submit\"]");
|
|
1070
|
+
if (submit) return () => instance.dispatchUIEvent(submit, "click");
|
|
1071
|
+
else if (form && SubmitSingleInputOnEnter.includes(target.type) && form.querySelectorAll("input").length === 1) return () => instance.dispatchUIEvent(form, "submit");
|
|
1072
|
+
else return;
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
if (isEditable(target)) {
|
|
1076
|
+
const inputType = event.key === "Enter" ? isContentEditable(target) && !instance.system.keyboard.modifiers.Shift ? "insertParagraph" : "insertLineBreak" : "insertText";
|
|
1077
|
+
const inputData = event.key === "Enter" ? "\n" : event.key;
|
|
1078
|
+
return () => input(instance, target, inputData, inputType);
|
|
1079
|
+
}
|
|
1080
|
+
};
|
|
1081
|
+
const ClickInputOnEnter = [
|
|
1082
|
+
"button",
|
|
1083
|
+
"color",
|
|
1084
|
+
"file",
|
|
1085
|
+
"image",
|
|
1086
|
+
"reset",
|
|
1087
|
+
"submit"
|
|
1088
|
+
];
|
|
1089
|
+
const SubmitSingleInputOnEnter = [
|
|
1090
|
+
"email",
|
|
1091
|
+
"month",
|
|
1092
|
+
"password",
|
|
1093
|
+
"search",
|
|
1094
|
+
"tel",
|
|
1095
|
+
"text",
|
|
1096
|
+
"url",
|
|
1097
|
+
"week"
|
|
1098
|
+
];
|
|
1099
|
+
//#endregion
|
|
1100
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/behavior/keyup.js
|
|
1101
|
+
behavior.keyup = (event, target, instance) => {
|
|
1102
|
+
var _keyupBehavior_event_key;
|
|
1103
|
+
return (_keyupBehavior_event_key = keyupBehavior[event.key]) === null || _keyupBehavior_event_key === void 0 ? void 0 : _keyupBehavior_event_key.call(keyupBehavior, event, target, instance);
|
|
1104
|
+
};
|
|
1105
|
+
const keyupBehavior = { " ": (event, target, instance) => {
|
|
1106
|
+
if (isClickableInput(target)) return () => instance.dispatchUIEvent(target, "click");
|
|
1107
|
+
} };
|
|
1108
|
+
//#endregion
|
|
1109
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/behavior/paste.js
|
|
1110
|
+
behavior.paste = (event, target, instance) => {
|
|
1111
|
+
if (isEditable(target)) return () => {
|
|
1112
|
+
var _event_clipboardData;
|
|
1113
|
+
const insertData = (_event_clipboardData = event.clipboardData) === null || _event_clipboardData === void 0 ? void 0 : _event_clipboardData.getData("text");
|
|
1114
|
+
if (insertData) input(instance, target, insertData, "insertFromPaste");
|
|
1115
|
+
};
|
|
1116
|
+
};
|
|
1117
|
+
//#endregion
|
|
1118
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/eventMap.js
|
|
1119
|
+
const eventMap = {
|
|
1120
|
+
auxclick: {
|
|
1121
|
+
EventType: "PointerEvent",
|
|
1122
|
+
defaultInit: {
|
|
1123
|
+
bubbles: true,
|
|
1124
|
+
cancelable: true,
|
|
1125
|
+
composed: true
|
|
1126
|
+
}
|
|
1127
|
+
},
|
|
1128
|
+
beforeinput: {
|
|
1129
|
+
EventType: "InputEvent",
|
|
1130
|
+
defaultInit: {
|
|
1131
|
+
bubbles: true,
|
|
1132
|
+
cancelable: true,
|
|
1133
|
+
composed: true
|
|
1134
|
+
}
|
|
1135
|
+
},
|
|
1136
|
+
blur: {
|
|
1137
|
+
EventType: "FocusEvent",
|
|
1138
|
+
defaultInit: {
|
|
1139
|
+
bubbles: false,
|
|
1140
|
+
cancelable: false,
|
|
1141
|
+
composed: true
|
|
1142
|
+
}
|
|
1143
|
+
},
|
|
1144
|
+
click: {
|
|
1145
|
+
EventType: "PointerEvent",
|
|
1146
|
+
defaultInit: {
|
|
1147
|
+
bubbles: true,
|
|
1148
|
+
cancelable: true,
|
|
1149
|
+
composed: true
|
|
1150
|
+
}
|
|
1151
|
+
},
|
|
1152
|
+
contextmenu: {
|
|
1153
|
+
EventType: "PointerEvent",
|
|
1154
|
+
defaultInit: {
|
|
1155
|
+
bubbles: true,
|
|
1156
|
+
cancelable: true,
|
|
1157
|
+
composed: true
|
|
1158
|
+
}
|
|
1159
|
+
},
|
|
1160
|
+
copy: {
|
|
1161
|
+
EventType: "ClipboardEvent",
|
|
1162
|
+
defaultInit: {
|
|
1163
|
+
bubbles: true,
|
|
1164
|
+
cancelable: true,
|
|
1165
|
+
composed: true
|
|
1166
|
+
}
|
|
1167
|
+
},
|
|
1168
|
+
change: {
|
|
1169
|
+
EventType: "Event",
|
|
1170
|
+
defaultInit: {
|
|
1171
|
+
bubbles: true,
|
|
1172
|
+
cancelable: false
|
|
1173
|
+
}
|
|
1174
|
+
},
|
|
1175
|
+
cut: {
|
|
1176
|
+
EventType: "ClipboardEvent",
|
|
1177
|
+
defaultInit: {
|
|
1178
|
+
bubbles: true,
|
|
1179
|
+
cancelable: true,
|
|
1180
|
+
composed: true
|
|
1181
|
+
}
|
|
1182
|
+
},
|
|
1183
|
+
dblclick: {
|
|
1184
|
+
EventType: "MouseEvent",
|
|
1185
|
+
defaultInit: {
|
|
1186
|
+
bubbles: true,
|
|
1187
|
+
cancelable: true,
|
|
1188
|
+
composed: true
|
|
1189
|
+
}
|
|
1190
|
+
},
|
|
1191
|
+
focus: {
|
|
1192
|
+
EventType: "FocusEvent",
|
|
1193
|
+
defaultInit: {
|
|
1194
|
+
bubbles: false,
|
|
1195
|
+
cancelable: false,
|
|
1196
|
+
composed: true
|
|
1197
|
+
}
|
|
1198
|
+
},
|
|
1199
|
+
focusin: {
|
|
1200
|
+
EventType: "FocusEvent",
|
|
1201
|
+
defaultInit: {
|
|
1202
|
+
bubbles: true,
|
|
1203
|
+
cancelable: false,
|
|
1204
|
+
composed: true
|
|
1205
|
+
}
|
|
1206
|
+
},
|
|
1207
|
+
focusout: {
|
|
1208
|
+
EventType: "FocusEvent",
|
|
1209
|
+
defaultInit: {
|
|
1210
|
+
bubbles: true,
|
|
1211
|
+
cancelable: false,
|
|
1212
|
+
composed: true
|
|
1213
|
+
}
|
|
1214
|
+
},
|
|
1215
|
+
keydown: {
|
|
1216
|
+
EventType: "KeyboardEvent",
|
|
1217
|
+
defaultInit: {
|
|
1218
|
+
bubbles: true,
|
|
1219
|
+
cancelable: true,
|
|
1220
|
+
composed: true
|
|
1221
|
+
}
|
|
1222
|
+
},
|
|
1223
|
+
keypress: {
|
|
1224
|
+
EventType: "KeyboardEvent",
|
|
1225
|
+
defaultInit: {
|
|
1226
|
+
bubbles: true,
|
|
1227
|
+
cancelable: true,
|
|
1228
|
+
composed: true
|
|
1229
|
+
}
|
|
1230
|
+
},
|
|
1231
|
+
keyup: {
|
|
1232
|
+
EventType: "KeyboardEvent",
|
|
1233
|
+
defaultInit: {
|
|
1234
|
+
bubbles: true,
|
|
1235
|
+
cancelable: true,
|
|
1236
|
+
composed: true
|
|
1237
|
+
}
|
|
1238
|
+
},
|
|
1239
|
+
paste: {
|
|
1240
|
+
EventType: "ClipboardEvent",
|
|
1241
|
+
defaultInit: {
|
|
1242
|
+
bubbles: true,
|
|
1243
|
+
cancelable: true,
|
|
1244
|
+
composed: true
|
|
1245
|
+
}
|
|
1246
|
+
},
|
|
1247
|
+
input: {
|
|
1248
|
+
EventType: "InputEvent",
|
|
1249
|
+
defaultInit: {
|
|
1250
|
+
bubbles: true,
|
|
1251
|
+
cancelable: false,
|
|
1252
|
+
composed: true
|
|
1253
|
+
}
|
|
1254
|
+
},
|
|
1255
|
+
mousedown: {
|
|
1256
|
+
EventType: "MouseEvent",
|
|
1257
|
+
defaultInit: {
|
|
1258
|
+
bubbles: true,
|
|
1259
|
+
cancelable: true,
|
|
1260
|
+
composed: true
|
|
1261
|
+
}
|
|
1262
|
+
},
|
|
1263
|
+
mouseenter: {
|
|
1264
|
+
EventType: "MouseEvent",
|
|
1265
|
+
defaultInit: {
|
|
1266
|
+
bubbles: false,
|
|
1267
|
+
cancelable: false,
|
|
1268
|
+
composed: true
|
|
1269
|
+
}
|
|
1270
|
+
},
|
|
1271
|
+
mouseleave: {
|
|
1272
|
+
EventType: "MouseEvent",
|
|
1273
|
+
defaultInit: {
|
|
1274
|
+
bubbles: false,
|
|
1275
|
+
cancelable: false,
|
|
1276
|
+
composed: true
|
|
1277
|
+
}
|
|
1278
|
+
},
|
|
1279
|
+
mousemove: {
|
|
1280
|
+
EventType: "MouseEvent",
|
|
1281
|
+
defaultInit: {
|
|
1282
|
+
bubbles: true,
|
|
1283
|
+
cancelable: true,
|
|
1284
|
+
composed: true
|
|
1285
|
+
}
|
|
1286
|
+
},
|
|
1287
|
+
mouseout: {
|
|
1288
|
+
EventType: "MouseEvent",
|
|
1289
|
+
defaultInit: {
|
|
1290
|
+
bubbles: true,
|
|
1291
|
+
cancelable: true,
|
|
1292
|
+
composed: true
|
|
1293
|
+
}
|
|
1294
|
+
},
|
|
1295
|
+
mouseover: {
|
|
1296
|
+
EventType: "MouseEvent",
|
|
1297
|
+
defaultInit: {
|
|
1298
|
+
bubbles: true,
|
|
1299
|
+
cancelable: true,
|
|
1300
|
+
composed: true
|
|
1301
|
+
}
|
|
1302
|
+
},
|
|
1303
|
+
mouseup: {
|
|
1304
|
+
EventType: "MouseEvent",
|
|
1305
|
+
defaultInit: {
|
|
1306
|
+
bubbles: true,
|
|
1307
|
+
cancelable: true,
|
|
1308
|
+
composed: true
|
|
1309
|
+
}
|
|
1310
|
+
},
|
|
1311
|
+
pointerover: {
|
|
1312
|
+
EventType: "PointerEvent",
|
|
1313
|
+
defaultInit: {
|
|
1314
|
+
bubbles: true,
|
|
1315
|
+
cancelable: true,
|
|
1316
|
+
composed: true
|
|
1317
|
+
}
|
|
1318
|
+
},
|
|
1319
|
+
pointerenter: {
|
|
1320
|
+
EventType: "PointerEvent",
|
|
1321
|
+
defaultInit: {
|
|
1322
|
+
bubbles: false,
|
|
1323
|
+
cancelable: false
|
|
1324
|
+
}
|
|
1325
|
+
},
|
|
1326
|
+
pointerdown: {
|
|
1327
|
+
EventType: "PointerEvent",
|
|
1328
|
+
defaultInit: {
|
|
1329
|
+
bubbles: true,
|
|
1330
|
+
cancelable: true,
|
|
1331
|
+
composed: true
|
|
1332
|
+
}
|
|
1333
|
+
},
|
|
1334
|
+
pointermove: {
|
|
1335
|
+
EventType: "PointerEvent",
|
|
1336
|
+
defaultInit: {
|
|
1337
|
+
bubbles: true,
|
|
1338
|
+
cancelable: true,
|
|
1339
|
+
composed: true
|
|
1340
|
+
}
|
|
1341
|
+
},
|
|
1342
|
+
pointerup: {
|
|
1343
|
+
EventType: "PointerEvent",
|
|
1344
|
+
defaultInit: {
|
|
1345
|
+
bubbles: true,
|
|
1346
|
+
cancelable: true,
|
|
1347
|
+
composed: true
|
|
1348
|
+
}
|
|
1349
|
+
},
|
|
1350
|
+
pointercancel: {
|
|
1351
|
+
EventType: "PointerEvent",
|
|
1352
|
+
defaultInit: {
|
|
1353
|
+
bubbles: true,
|
|
1354
|
+
cancelable: false,
|
|
1355
|
+
composed: true
|
|
1356
|
+
}
|
|
1357
|
+
},
|
|
1358
|
+
pointerout: {
|
|
1359
|
+
EventType: "PointerEvent",
|
|
1360
|
+
defaultInit: {
|
|
1361
|
+
bubbles: true,
|
|
1362
|
+
cancelable: true,
|
|
1363
|
+
composed: true
|
|
1364
|
+
}
|
|
1365
|
+
},
|
|
1366
|
+
pointerleave: {
|
|
1367
|
+
EventType: "PointerEvent",
|
|
1368
|
+
defaultInit: {
|
|
1369
|
+
bubbles: false,
|
|
1370
|
+
cancelable: false
|
|
1371
|
+
}
|
|
1372
|
+
},
|
|
1373
|
+
submit: {
|
|
1374
|
+
EventType: "Event",
|
|
1375
|
+
defaultInit: {
|
|
1376
|
+
bubbles: true,
|
|
1377
|
+
cancelable: true
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
};
|
|
1381
|
+
function getEventClass(type) {
|
|
1382
|
+
return eventMap[type].EventType;
|
|
1383
|
+
}
|
|
1384
|
+
const mouseEvents = ["MouseEvent", "PointerEvent"];
|
|
1385
|
+
function isMouseEvent(type) {
|
|
1386
|
+
return mouseEvents.includes(getEventClass(type));
|
|
1387
|
+
}
|
|
1388
|
+
function isKeyboardEvent(type) {
|
|
1389
|
+
return getEventClass(type) === "KeyboardEvent";
|
|
1390
|
+
}
|
|
1391
|
+
//#endregion
|
|
1392
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/createEvent.js
|
|
1393
|
+
const eventInitializer = {
|
|
1394
|
+
ClipboardEvent: [initClipboardEvent],
|
|
1395
|
+
Event: [],
|
|
1396
|
+
FocusEvent: [initUIEvent, initFocusEvent],
|
|
1397
|
+
InputEvent: [initUIEvent, initInputEvent],
|
|
1398
|
+
MouseEvent: [
|
|
1399
|
+
initUIEvent,
|
|
1400
|
+
initUIEventModifiers,
|
|
1401
|
+
initMouseEvent
|
|
1402
|
+
],
|
|
1403
|
+
PointerEvent: [
|
|
1404
|
+
initUIEvent,
|
|
1405
|
+
initUIEventModifiers,
|
|
1406
|
+
initMouseEvent,
|
|
1407
|
+
initPointerEvent
|
|
1408
|
+
],
|
|
1409
|
+
KeyboardEvent: [
|
|
1410
|
+
initUIEvent,
|
|
1411
|
+
initUIEventModifiers,
|
|
1412
|
+
initKeyboardEvent
|
|
1413
|
+
]
|
|
1414
|
+
};
|
|
1415
|
+
function createEvent(type, target, init) {
|
|
1416
|
+
const window = getWindow(target);
|
|
1417
|
+
const { EventType, defaultInit } = eventMap[type];
|
|
1418
|
+
const event = new (getEventConstructors(window))[EventType](type, defaultInit);
|
|
1419
|
+
eventInitializer[EventType].forEach((f) => f(event, init !== null && init !== void 0 ? init : {}));
|
|
1420
|
+
return event;
|
|
1421
|
+
}
|
|
1422
|
+
/* istanbul ignore next */ function getEventConstructors(window) {
|
|
1423
|
+
var _window_Event;
|
|
1424
|
+
const Event = (_window_Event = window.Event) !== null && _window_Event !== void 0 ? _window_Event : class Event {};
|
|
1425
|
+
var _window_AnimationEvent;
|
|
1426
|
+
const AnimationEvent = (_window_AnimationEvent = window.AnimationEvent) !== null && _window_AnimationEvent !== void 0 ? _window_AnimationEvent : class AnimationEvent extends Event {};
|
|
1427
|
+
var _window_ClipboardEvent;
|
|
1428
|
+
const ClipboardEvent = (_window_ClipboardEvent = window.ClipboardEvent) !== null && _window_ClipboardEvent !== void 0 ? _window_ClipboardEvent : class ClipboardEvent extends Event {};
|
|
1429
|
+
var _window_PopStateEvent;
|
|
1430
|
+
const PopStateEvent = (_window_PopStateEvent = window.PopStateEvent) !== null && _window_PopStateEvent !== void 0 ? _window_PopStateEvent : class PopStateEvent extends Event {};
|
|
1431
|
+
var _window_ProgressEvent;
|
|
1432
|
+
const ProgressEvent = (_window_ProgressEvent = window.ProgressEvent) !== null && _window_ProgressEvent !== void 0 ? _window_ProgressEvent : class ProgressEvent extends Event {};
|
|
1433
|
+
var _window_TransitionEvent;
|
|
1434
|
+
const TransitionEvent = (_window_TransitionEvent = window.TransitionEvent) !== null && _window_TransitionEvent !== void 0 ? _window_TransitionEvent : class TransitionEvent extends Event {};
|
|
1435
|
+
var _window_UIEvent;
|
|
1436
|
+
const UIEvent = (_window_UIEvent = window.UIEvent) !== null && _window_UIEvent !== void 0 ? _window_UIEvent : class UIEvent extends Event {};
|
|
1437
|
+
var _window_CompositionEvent;
|
|
1438
|
+
const CompositionEvent = (_window_CompositionEvent = window.CompositionEvent) !== null && _window_CompositionEvent !== void 0 ? _window_CompositionEvent : class CompositionEvent extends UIEvent {};
|
|
1439
|
+
var _window_FocusEvent;
|
|
1440
|
+
const FocusEvent = (_window_FocusEvent = window.FocusEvent) !== null && _window_FocusEvent !== void 0 ? _window_FocusEvent : class FocusEvent extends UIEvent {};
|
|
1441
|
+
var _window_InputEvent;
|
|
1442
|
+
const InputEvent = (_window_InputEvent = window.InputEvent) !== null && _window_InputEvent !== void 0 ? _window_InputEvent : class InputEvent extends UIEvent {};
|
|
1443
|
+
var _window_KeyboardEvent;
|
|
1444
|
+
const KeyboardEvent = (_window_KeyboardEvent = window.KeyboardEvent) !== null && _window_KeyboardEvent !== void 0 ? _window_KeyboardEvent : class KeyboardEvent extends UIEvent {};
|
|
1445
|
+
var _window_MouseEvent;
|
|
1446
|
+
const MouseEvent = (_window_MouseEvent = window.MouseEvent) !== null && _window_MouseEvent !== void 0 ? _window_MouseEvent : class MouseEvent extends UIEvent {};
|
|
1447
|
+
var _window_DragEvent;
|
|
1448
|
+
const DragEvent = (_window_DragEvent = window.DragEvent) !== null && _window_DragEvent !== void 0 ? _window_DragEvent : class DragEvent extends MouseEvent {};
|
|
1449
|
+
var _window_PointerEvent;
|
|
1450
|
+
const PointerEvent = (_window_PointerEvent = window.PointerEvent) !== null && _window_PointerEvent !== void 0 ? _window_PointerEvent : class PointerEvent extends MouseEvent {};
|
|
1451
|
+
var _window_TouchEvent;
|
|
1452
|
+
return {
|
|
1453
|
+
Event,
|
|
1454
|
+
AnimationEvent,
|
|
1455
|
+
ClipboardEvent,
|
|
1456
|
+
PopStateEvent,
|
|
1457
|
+
ProgressEvent,
|
|
1458
|
+
TransitionEvent,
|
|
1459
|
+
UIEvent,
|
|
1460
|
+
CompositionEvent,
|
|
1461
|
+
FocusEvent,
|
|
1462
|
+
InputEvent,
|
|
1463
|
+
KeyboardEvent,
|
|
1464
|
+
MouseEvent,
|
|
1465
|
+
DragEvent,
|
|
1466
|
+
PointerEvent,
|
|
1467
|
+
TouchEvent: (_window_TouchEvent = window.TouchEvent) !== null && _window_TouchEvent !== void 0 ? _window_TouchEvent : class TouchEvent extends UIEvent {}
|
|
1468
|
+
};
|
|
1469
|
+
}
|
|
1470
|
+
function assignProps(obj, props) {
|
|
1471
|
+
for (const [key, value] of Object.entries(props)) Object.defineProperty(obj, key, { get: () => value !== null && value !== void 0 ? value : null });
|
|
1472
|
+
}
|
|
1473
|
+
function sanitizeNumber(n) {
|
|
1474
|
+
return Number(n !== null && n !== void 0 ? n : 0);
|
|
1475
|
+
}
|
|
1476
|
+
function initClipboardEvent(event, { clipboardData }) {
|
|
1477
|
+
assignProps(event, { clipboardData });
|
|
1478
|
+
}
|
|
1479
|
+
function initFocusEvent(event, { relatedTarget }) {
|
|
1480
|
+
assignProps(event, { relatedTarget });
|
|
1481
|
+
}
|
|
1482
|
+
function initInputEvent(event, { data, inputType, isComposing }) {
|
|
1483
|
+
assignProps(event, {
|
|
1484
|
+
data,
|
|
1485
|
+
isComposing: Boolean(isComposing),
|
|
1486
|
+
inputType: String(inputType)
|
|
1487
|
+
});
|
|
1488
|
+
}
|
|
1489
|
+
function initUIEvent(event, { view, detail }) {
|
|
1490
|
+
assignProps(event, {
|
|
1491
|
+
view,
|
|
1492
|
+
detail: sanitizeNumber(detail !== null && detail !== void 0 ? detail : 0)
|
|
1493
|
+
});
|
|
1494
|
+
}
|
|
1495
|
+
function initUIEventModifiers(event, { altKey, ctrlKey, metaKey, shiftKey, modifierAltGraph, modifierCapsLock, modifierFn, modifierFnLock, modifierNumLock, modifierScrollLock, modifierSymbol, modifierSymbolLock }) {
|
|
1496
|
+
assignProps(event, {
|
|
1497
|
+
altKey: Boolean(altKey),
|
|
1498
|
+
ctrlKey: Boolean(ctrlKey),
|
|
1499
|
+
metaKey: Boolean(metaKey),
|
|
1500
|
+
shiftKey: Boolean(shiftKey),
|
|
1501
|
+
getModifierState(k) {
|
|
1502
|
+
return Boolean({
|
|
1503
|
+
Alt: altKey,
|
|
1504
|
+
AltGraph: modifierAltGraph,
|
|
1505
|
+
CapsLock: modifierCapsLock,
|
|
1506
|
+
Control: ctrlKey,
|
|
1507
|
+
Fn: modifierFn,
|
|
1508
|
+
FnLock: modifierFnLock,
|
|
1509
|
+
Meta: metaKey,
|
|
1510
|
+
NumLock: modifierNumLock,
|
|
1511
|
+
ScrollLock: modifierScrollLock,
|
|
1512
|
+
Shift: shiftKey,
|
|
1513
|
+
Symbol: modifierSymbol,
|
|
1514
|
+
SymbolLock: modifierSymbolLock
|
|
1515
|
+
}[k]);
|
|
1516
|
+
}
|
|
1517
|
+
});
|
|
1518
|
+
}
|
|
1519
|
+
function initKeyboardEvent(event, { key, code, location, repeat, isComposing, charCode }) {
|
|
1520
|
+
assignProps(event, {
|
|
1521
|
+
key: String(key),
|
|
1522
|
+
code: String(code),
|
|
1523
|
+
location: sanitizeNumber(location),
|
|
1524
|
+
repeat: Boolean(repeat),
|
|
1525
|
+
isComposing: Boolean(isComposing),
|
|
1526
|
+
charCode
|
|
1527
|
+
});
|
|
1528
|
+
}
|
|
1529
|
+
function initMouseEvent(event, { x, y, screenX, screenY, clientX = x, clientY = y, button, buttons, relatedTarget, offsetX, offsetY, pageX, pageY }) {
|
|
1530
|
+
assignProps(event, {
|
|
1531
|
+
screenX: sanitizeNumber(screenX),
|
|
1532
|
+
screenY: sanitizeNumber(screenY),
|
|
1533
|
+
clientX: sanitizeNumber(clientX),
|
|
1534
|
+
x: sanitizeNumber(clientX),
|
|
1535
|
+
clientY: sanitizeNumber(clientY),
|
|
1536
|
+
y: sanitizeNumber(clientY),
|
|
1537
|
+
button: sanitizeNumber(button),
|
|
1538
|
+
buttons: sanitizeNumber(buttons),
|
|
1539
|
+
relatedTarget,
|
|
1540
|
+
offsetX: sanitizeNumber(offsetX),
|
|
1541
|
+
offsetY: sanitizeNumber(offsetY),
|
|
1542
|
+
pageX: sanitizeNumber(pageX),
|
|
1543
|
+
pageY: sanitizeNumber(pageY)
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
function initPointerEvent(event, { pointerId, width, height, pressure, tangentialPressure, tiltX, tiltY, twist, pointerType, isPrimary }) {
|
|
1547
|
+
assignProps(event, {
|
|
1548
|
+
pointerId: sanitizeNumber(pointerId),
|
|
1549
|
+
width: sanitizeNumber(width !== null && width !== void 0 ? width : 1),
|
|
1550
|
+
height: sanitizeNumber(height !== null && height !== void 0 ? height : 1),
|
|
1551
|
+
pressure: sanitizeNumber(pressure),
|
|
1552
|
+
tangentialPressure: sanitizeNumber(tangentialPressure),
|
|
1553
|
+
tiltX: sanitizeNumber(tiltX),
|
|
1554
|
+
tiltY: sanitizeNumber(tiltY),
|
|
1555
|
+
twist: sanitizeNumber(twist),
|
|
1556
|
+
pointerType: String(pointerType),
|
|
1557
|
+
isPrimary: Boolean(isPrimary)
|
|
1558
|
+
});
|
|
1559
|
+
}
|
|
1560
|
+
//#endregion
|
|
1561
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/dispatchEvent.js
|
|
1562
|
+
function dispatchUIEvent(target, type, init, preventDefault = false) {
|
|
1563
|
+
if (isMouseEvent(type) || isKeyboardEvent(type)) init = {
|
|
1564
|
+
...init,
|
|
1565
|
+
...this.system.getUIEventModifiers()
|
|
1566
|
+
};
|
|
1567
|
+
const event = createEvent(type, target, init);
|
|
1568
|
+
return dispatchEvent.call(this, target, event, preventDefault);
|
|
1569
|
+
}
|
|
1570
|
+
function dispatchEvent(target, event, preventDefault = false) {
|
|
1571
|
+
var _behavior_type;
|
|
1572
|
+
const type = event.type;
|
|
1573
|
+
const behaviorImplementation = preventDefault ? () => {} : (_behavior_type = behavior[type]) === null || _behavior_type === void 0 ? void 0 : _behavior_type.call(behavior, event, target, this);
|
|
1574
|
+
if (behaviorImplementation) {
|
|
1575
|
+
event.preventDefault();
|
|
1576
|
+
let defaultPrevented = false;
|
|
1577
|
+
Object.defineProperty(event, "defaultPrevented", { get: () => defaultPrevented });
|
|
1578
|
+
Object.defineProperty(event, "preventDefault", { value: () => {
|
|
1579
|
+
defaultPrevented = event.cancelable;
|
|
1580
|
+
} });
|
|
1581
|
+
wrapEvent(() => target.dispatchEvent(event));
|
|
1582
|
+
if (!defaultPrevented) behaviorImplementation();
|
|
1583
|
+
return !defaultPrevented;
|
|
1584
|
+
}
|
|
1585
|
+
return wrapEvent(() => target.dispatchEvent(event));
|
|
1586
|
+
}
|
|
1587
|
+
function dispatchDOMEvent(target, type, init) {
|
|
1588
|
+
const event = createEvent(type, target, init);
|
|
1589
|
+
wrapEvent(() => target.dispatchEvent(event));
|
|
1590
|
+
}
|
|
1591
|
+
//#endregion
|
|
1592
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/document/patchFocus.js
|
|
1593
|
+
const patched = Symbol("patched focus/blur methods");
|
|
1594
|
+
function patchFocus(HTMLElement) {
|
|
1595
|
+
if (HTMLElement.prototype[patched]) return;
|
|
1596
|
+
const { focus, blur } = HTMLElement.prototype;
|
|
1597
|
+
Object.defineProperties(HTMLElement.prototype, {
|
|
1598
|
+
focus: {
|
|
1599
|
+
configurable: true,
|
|
1600
|
+
get: () => patchedFocus
|
|
1601
|
+
},
|
|
1602
|
+
blur: {
|
|
1603
|
+
configurable: true,
|
|
1604
|
+
get: () => patchedBlur
|
|
1605
|
+
},
|
|
1606
|
+
[patched]: {
|
|
1607
|
+
configurable: true,
|
|
1608
|
+
get: () => ({
|
|
1609
|
+
focus,
|
|
1610
|
+
blur
|
|
1611
|
+
})
|
|
1612
|
+
}
|
|
1613
|
+
});
|
|
1614
|
+
let activeCall;
|
|
1615
|
+
function patchedFocus(options) {
|
|
1616
|
+
if (this.ownerDocument.visibilityState !== "hidden") return focus.call(this, options);
|
|
1617
|
+
const blurred = getActiveTarget(this.ownerDocument);
|
|
1618
|
+
if (blurred === this) return;
|
|
1619
|
+
const thisCall = Symbol("focus call");
|
|
1620
|
+
activeCall = thisCall;
|
|
1621
|
+
if (blurred) {
|
|
1622
|
+
blur.call(blurred);
|
|
1623
|
+
dispatchDOMEvent(blurred, "blur", { relatedTarget: this });
|
|
1624
|
+
dispatchDOMEvent(blurred, "focusout", { relatedTarget: activeCall === thisCall ? this : null });
|
|
1625
|
+
}
|
|
1626
|
+
if (activeCall === thisCall) {
|
|
1627
|
+
focus.call(this, options);
|
|
1628
|
+
dispatchDOMEvent(this, "focus", { relatedTarget: blurred });
|
|
1629
|
+
}
|
|
1630
|
+
if (activeCall === thisCall) dispatchDOMEvent(this, "focusin", { relatedTarget: blurred });
|
|
1631
|
+
}
|
|
1632
|
+
function patchedBlur() {
|
|
1633
|
+
if (this.ownerDocument.visibilityState !== "hidden") return blur.call(this);
|
|
1634
|
+
const blurred = getActiveTarget(this.ownerDocument);
|
|
1635
|
+
if (blurred !== this) return;
|
|
1636
|
+
activeCall = Symbol("blur call");
|
|
1637
|
+
blur.call(this);
|
|
1638
|
+
dispatchDOMEvent(blurred, "blur", { relatedTarget: null });
|
|
1639
|
+
dispatchDOMEvent(blurred, "focusout", { relatedTarget: null });
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
function getActiveTarget(document) {
|
|
1643
|
+
const active = getActiveElement(document);
|
|
1644
|
+
return (active === null || active === void 0 ? void 0 : active.tagName) === "BODY" ? null : active;
|
|
1645
|
+
}
|
|
1646
|
+
//#endregion
|
|
1647
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/document/interceptor.js
|
|
1648
|
+
const Interceptor = Symbol("Interceptor for programmatical calls");
|
|
1649
|
+
function prepareInterceptor(element, propName, interceptorImpl) {
|
|
1650
|
+
const prototypeDescriptor = Object.getOwnPropertyDescriptor(element.constructor.prototype, propName);
|
|
1651
|
+
const objectDescriptor = Object.getOwnPropertyDescriptor(element, propName);
|
|
1652
|
+
const target = (prototypeDescriptor === null || prototypeDescriptor === void 0 ? void 0 : prototypeDescriptor.set) ? "set" : "value";
|
|
1653
|
+
/* istanbul ignore if */ if (typeof (prototypeDescriptor === null || prototypeDescriptor === void 0 ? void 0 : prototypeDescriptor[target]) !== "function" || prototypeDescriptor[target][Interceptor]) throw new Error(`Element ${element.tagName} does not implement "${String(propName)}".`);
|
|
1654
|
+
function intercept(...args) {
|
|
1655
|
+
const { applyNative = false, realArgs, then } = interceptorImpl.call(this, ...args);
|
|
1656
|
+
const realFunc = (!applyNative && objectDescriptor || prototypeDescriptor)[target];
|
|
1657
|
+
if (target === "set") realFunc.call(this, realArgs);
|
|
1658
|
+
else realFunc.call(this, ...realArgs);
|
|
1659
|
+
then === null || then === void 0 || then();
|
|
1660
|
+
}
|
|
1661
|
+
intercept[Interceptor] = Interceptor;
|
|
1662
|
+
Object.defineProperty(element, propName, {
|
|
1663
|
+
...objectDescriptor !== null && objectDescriptor !== void 0 ? objectDescriptor : prototypeDescriptor,
|
|
1664
|
+
[target]: intercept
|
|
1665
|
+
});
|
|
1666
|
+
}
|
|
1667
|
+
function prepareValueInterceptor(element) {
|
|
1668
|
+
prepareInterceptor(element, "value", function interceptorImpl(v) {
|
|
1669
|
+
const isUI = isUIValue(v);
|
|
1670
|
+
if (isUI) startTrackValue(this);
|
|
1671
|
+
return {
|
|
1672
|
+
applyNative: !!isUI,
|
|
1673
|
+
realArgs: sanitizeValue(this, v),
|
|
1674
|
+
then: isUI ? void 0 : () => trackOrSetValue(this, String(v))
|
|
1675
|
+
};
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
function sanitizeValue(element, v) {
|
|
1679
|
+
if (isElementType(element, "input", { type: "number" }) && String(v) !== "" && !Number.isNaN(Number(v))) return String(Number(v));
|
|
1680
|
+
return String(v);
|
|
1681
|
+
}
|
|
1682
|
+
function prepareSelectionInterceptor(element) {
|
|
1683
|
+
prepareInterceptor(element, "setSelectionRange", function interceptorImpl(start, ...others) {
|
|
1684
|
+
const isUI = isUISelectionStart(start);
|
|
1685
|
+
return {
|
|
1686
|
+
applyNative: !!isUI,
|
|
1687
|
+
realArgs: [Number(start), ...others],
|
|
1688
|
+
then: () => isUI ? void 0 : setUISelectionClean(element)
|
|
1689
|
+
};
|
|
1690
|
+
});
|
|
1691
|
+
prepareInterceptor(element, "selectionStart", function interceptorImpl(v) {
|
|
1692
|
+
return {
|
|
1693
|
+
realArgs: v,
|
|
1694
|
+
then: () => setUISelectionClean(element)
|
|
1695
|
+
};
|
|
1696
|
+
});
|
|
1697
|
+
prepareInterceptor(element, "selectionEnd", function interceptorImpl(v) {
|
|
1698
|
+
return {
|
|
1699
|
+
realArgs: v,
|
|
1700
|
+
then: () => setUISelectionClean(element)
|
|
1701
|
+
};
|
|
1702
|
+
});
|
|
1703
|
+
prepareInterceptor(element, "select", function interceptorImpl() {
|
|
1704
|
+
return {
|
|
1705
|
+
realArgs: [],
|
|
1706
|
+
then: () => setUISelectionRaw(element, {
|
|
1707
|
+
anchorOffset: 0,
|
|
1708
|
+
focusOffset: getUIValue(element).length
|
|
1709
|
+
})
|
|
1710
|
+
};
|
|
1711
|
+
});
|
|
1712
|
+
}
|
|
1713
|
+
function prepareRangeTextInterceptor(element) {
|
|
1714
|
+
prepareInterceptor(element, "setRangeText", function interceptorImpl(...realArgs) {
|
|
1715
|
+
return {
|
|
1716
|
+
realArgs,
|
|
1717
|
+
then: () => {
|
|
1718
|
+
setUIValueClean(element);
|
|
1719
|
+
setUISelectionClean(element);
|
|
1720
|
+
}
|
|
1721
|
+
};
|
|
1722
|
+
});
|
|
1723
|
+
}
|
|
1724
|
+
//#endregion
|
|
1725
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/document/prepareDocument.js
|
|
1726
|
+
const isPrepared = Symbol("Node prepared with document state workarounds");
|
|
1727
|
+
function prepareDocument(document) {
|
|
1728
|
+
if (document[isPrepared]) return;
|
|
1729
|
+
document.addEventListener("focus", (e) => {
|
|
1730
|
+
const el = e.target;
|
|
1731
|
+
prepareElement(el);
|
|
1732
|
+
}, {
|
|
1733
|
+
capture: true,
|
|
1734
|
+
passive: true
|
|
1735
|
+
});
|
|
1736
|
+
// istanbul ignore else
|
|
1737
|
+
if (document.activeElement) prepareElement(document.activeElement);
|
|
1738
|
+
document.addEventListener("blur", (e) => {
|
|
1739
|
+
const el = e.target;
|
|
1740
|
+
const initialValue = getInitialValue(el);
|
|
1741
|
+
if (initialValue !== void 0) {
|
|
1742
|
+
if (el.value !== initialValue) dispatchDOMEvent(el, "change");
|
|
1743
|
+
clearInitialValue(el);
|
|
1744
|
+
}
|
|
1745
|
+
}, {
|
|
1746
|
+
capture: true,
|
|
1747
|
+
passive: true
|
|
1748
|
+
});
|
|
1749
|
+
document[isPrepared] = isPrepared;
|
|
1750
|
+
}
|
|
1751
|
+
function prepareElement(el) {
|
|
1752
|
+
if (el[isPrepared]) return;
|
|
1753
|
+
if (isElementType(el, ["input", "textarea"])) {
|
|
1754
|
+
prepareValueInterceptor(el);
|
|
1755
|
+
prepareSelectionInterceptor(el);
|
|
1756
|
+
prepareRangeTextInterceptor(el);
|
|
1757
|
+
}
|
|
1758
|
+
el[isPrepared] = isPrepared;
|
|
1759
|
+
}
|
|
1760
|
+
//#endregion
|
|
1761
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/getDocumentFromNode.js
|
|
1762
|
+
function getDocumentFromNode(el) {
|
|
1763
|
+
return isDocument(el) ? el : el.ownerDocument;
|
|
1764
|
+
}
|
|
1765
|
+
function isDocument(node) {
|
|
1766
|
+
return node.nodeType === 9;
|
|
1767
|
+
}
|
|
1768
|
+
//#endregion
|
|
1769
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/level.js
|
|
1770
|
+
var ApiLevel = /* @__PURE__ */ function(ApiLevel) {
|
|
1771
|
+
ApiLevel[ApiLevel["Trigger"] = 2] = "Trigger";
|
|
1772
|
+
ApiLevel[ApiLevel["Call"] = 1] = "Call";
|
|
1773
|
+
return ApiLevel;
|
|
1774
|
+
}({});
|
|
1775
|
+
function setLevelRef(instance, level) {
|
|
1776
|
+
instance.levelRefs[level] = {};
|
|
1777
|
+
}
|
|
1778
|
+
function getLevelRef(instance, level) {
|
|
1779
|
+
return instance.levelRefs[level];
|
|
1780
|
+
}
|
|
1781
|
+
//#endregion
|
|
1782
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/wait.js
|
|
1783
|
+
function wait(config) {
|
|
1784
|
+
const delay = config.delay;
|
|
1785
|
+
if (typeof delay !== "number") return;
|
|
1786
|
+
return Promise.all([new Promise((resolve) => globalThis.setTimeout(() => resolve(), delay)), config.advanceTimers(delay)]);
|
|
1787
|
+
}
|
|
1788
|
+
//#endregion
|
|
1789
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/options.js
|
|
1790
|
+
var PointerEventsCheckLevel = /* @__PURE__ */ function(PointerEventsCheckLevel) {
|
|
1791
|
+
/**
|
|
1792
|
+
* Check pointer events on every user interaction that triggers a bunch of events.
|
|
1793
|
+
* E.g. once for releasing a mouse button even though this triggers `pointerup`, `mouseup`, `click`, etc...
|
|
1794
|
+
*/ PointerEventsCheckLevel[PointerEventsCheckLevel["EachTrigger"] = 4] = "EachTrigger";
|
|
1795
|
+
/** Check each target once per call to pointer (related) API */ PointerEventsCheckLevel[PointerEventsCheckLevel["EachApiCall"] = 2] = "EachApiCall";
|
|
1796
|
+
/** Check each event target once */ PointerEventsCheckLevel[PointerEventsCheckLevel["EachTarget"] = 1] = "EachTarget";
|
|
1797
|
+
/** No pointer events check */ PointerEventsCheckLevel[PointerEventsCheckLevel["Never"] = 0] = "Never";
|
|
1798
|
+
return PointerEventsCheckLevel;
|
|
1799
|
+
}({});
|
|
1800
|
+
//#endregion
|
|
1801
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/system/keyboard.js
|
|
1802
|
+
function _define_property$6(obj, key, value) {
|
|
1803
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
1804
|
+
value,
|
|
1805
|
+
enumerable: true,
|
|
1806
|
+
configurable: true,
|
|
1807
|
+
writable: true
|
|
1808
|
+
});
|
|
1809
|
+
else obj[key] = value;
|
|
1810
|
+
return obj;
|
|
1811
|
+
}
|
|
1812
|
+
var DOM_KEY_LOCATION = /* @__PURE__ */ function(DOM_KEY_LOCATION) {
|
|
1813
|
+
DOM_KEY_LOCATION[DOM_KEY_LOCATION["STANDARD"] = 0] = "STANDARD";
|
|
1814
|
+
DOM_KEY_LOCATION[DOM_KEY_LOCATION["LEFT"] = 1] = "LEFT";
|
|
1815
|
+
DOM_KEY_LOCATION[DOM_KEY_LOCATION["RIGHT"] = 2] = "RIGHT";
|
|
1816
|
+
DOM_KEY_LOCATION[DOM_KEY_LOCATION["NUMPAD"] = 3] = "NUMPAD";
|
|
1817
|
+
return DOM_KEY_LOCATION;
|
|
1818
|
+
}({});
|
|
1819
|
+
const modifierKeys = [
|
|
1820
|
+
"Alt",
|
|
1821
|
+
"AltGraph",
|
|
1822
|
+
"Control",
|
|
1823
|
+
"Fn",
|
|
1824
|
+
"Meta",
|
|
1825
|
+
"Shift",
|
|
1826
|
+
"Symbol"
|
|
1827
|
+
];
|
|
1828
|
+
function isModifierKey(key) {
|
|
1829
|
+
return modifierKeys.includes(key);
|
|
1830
|
+
}
|
|
1831
|
+
const modifierLocks = [
|
|
1832
|
+
"CapsLock",
|
|
1833
|
+
"FnLock",
|
|
1834
|
+
"NumLock",
|
|
1835
|
+
"ScrollLock",
|
|
1836
|
+
"SymbolLock"
|
|
1837
|
+
];
|
|
1838
|
+
function isModifierLock(key) {
|
|
1839
|
+
return modifierLocks.includes(key);
|
|
1840
|
+
}
|
|
1841
|
+
var KeyboardHost = class {
|
|
1842
|
+
isKeyPressed(keyDef) {
|
|
1843
|
+
return this.pressed.has(String(keyDef.code));
|
|
1844
|
+
}
|
|
1845
|
+
getPressedKeys() {
|
|
1846
|
+
return this.pressed.values().map((p) => p.keyDef);
|
|
1847
|
+
}
|
|
1848
|
+
/** Press a key */ async keydown(instance, keyDef) {
|
|
1849
|
+
const key = String(keyDef.key);
|
|
1850
|
+
const code = String(keyDef.code);
|
|
1851
|
+
const target = getActiveElementOrBody(instance.config.document);
|
|
1852
|
+
this.setKeydownTarget(target);
|
|
1853
|
+
this.pressed.add(code, keyDef);
|
|
1854
|
+
if (isModifierKey(key)) this.modifiers[key] = true;
|
|
1855
|
+
const unprevented = instance.dispatchUIEvent(target, "keydown", {
|
|
1856
|
+
key,
|
|
1857
|
+
code
|
|
1858
|
+
});
|
|
1859
|
+
if (isModifierLock(key) && !this.modifiers[key]) {
|
|
1860
|
+
this.modifiers[key] = true;
|
|
1861
|
+
this.modifierLockStart[key] = true;
|
|
1862
|
+
}
|
|
1863
|
+
if (unprevented) this.pressed.setUnprevented(code);
|
|
1864
|
+
if (unprevented && this.hasKeyPress(key)) instance.dispatchUIEvent(getActiveElementOrBody(instance.config.document), "keypress", {
|
|
1865
|
+
key,
|
|
1866
|
+
code,
|
|
1867
|
+
charCode: keyDef.key === "Enter" ? 13 : String(keyDef.key).charCodeAt(0)
|
|
1868
|
+
});
|
|
1869
|
+
}
|
|
1870
|
+
/** Release a key */ async keyup(instance, keyDef) {
|
|
1871
|
+
const key = String(keyDef.key);
|
|
1872
|
+
const code = String(keyDef.code);
|
|
1873
|
+
const unprevented = this.pressed.isUnprevented(code);
|
|
1874
|
+
this.pressed.delete(code);
|
|
1875
|
+
if (isModifierKey(key) && !this.pressed.values().find((p) => p.keyDef.key === key)) this.modifiers[key] = false;
|
|
1876
|
+
instance.dispatchUIEvent(getActiveElementOrBody(instance.config.document), "keyup", {
|
|
1877
|
+
key,
|
|
1878
|
+
code
|
|
1879
|
+
}, !unprevented);
|
|
1880
|
+
if (isModifierLock(key) && this.modifiers[key]) if (this.modifierLockStart[key]) this.modifierLockStart[key] = false;
|
|
1881
|
+
else this.modifiers[key] = false;
|
|
1882
|
+
}
|
|
1883
|
+
setKeydownTarget(target) {
|
|
1884
|
+
if (target !== this.lastKeydownTarget) this.carryChar = "";
|
|
1885
|
+
this.lastKeydownTarget = target;
|
|
1886
|
+
}
|
|
1887
|
+
hasKeyPress(key) {
|
|
1888
|
+
return (key.length === 1 || key === "Enter") && !this.modifiers.Control && !this.modifiers.Alt;
|
|
1889
|
+
}
|
|
1890
|
+
constructor(system) {
|
|
1891
|
+
_define_property$6(this, "system", void 0);
|
|
1892
|
+
_define_property$6(this, "modifiers", {
|
|
1893
|
+
Alt: false,
|
|
1894
|
+
AltGraph: false,
|
|
1895
|
+
CapsLock: false,
|
|
1896
|
+
Control: false,
|
|
1897
|
+
Fn: false,
|
|
1898
|
+
FnLock: false,
|
|
1899
|
+
Meta: false,
|
|
1900
|
+
NumLock: false,
|
|
1901
|
+
ScrollLock: false,
|
|
1902
|
+
Shift: false,
|
|
1903
|
+
Symbol: false,
|
|
1904
|
+
SymbolLock: false
|
|
1905
|
+
});
|
|
1906
|
+
_define_property$6(this, "pressed", new class {
|
|
1907
|
+
add(code, keyDef) {
|
|
1908
|
+
var _this_registry, _code;
|
|
1909
|
+
var _;
|
|
1910
|
+
(_ = (_this_registry = this.registry)[_code = code]) !== null && _ !== void 0 || (_this_registry[_code] = {
|
|
1911
|
+
keyDef,
|
|
1912
|
+
unpreventedDefault: false
|
|
1913
|
+
});
|
|
1914
|
+
}
|
|
1915
|
+
has(code) {
|
|
1916
|
+
return !!this.registry[code];
|
|
1917
|
+
}
|
|
1918
|
+
setUnprevented(code) {
|
|
1919
|
+
const o = this.registry[code];
|
|
1920
|
+
if (o) o.unpreventedDefault = true;
|
|
1921
|
+
}
|
|
1922
|
+
isUnprevented(code) {
|
|
1923
|
+
var _this_registry_code;
|
|
1924
|
+
return !!((_this_registry_code = this.registry[code]) === null || _this_registry_code === void 0 ? void 0 : _this_registry_code.unpreventedDefault);
|
|
1925
|
+
}
|
|
1926
|
+
delete(code) {
|
|
1927
|
+
delete this.registry[code];
|
|
1928
|
+
}
|
|
1929
|
+
values() {
|
|
1930
|
+
return Object.values(this.registry);
|
|
1931
|
+
}
|
|
1932
|
+
constructor() {
|
|
1933
|
+
_define_property$6(this, "registry", {});
|
|
1934
|
+
}
|
|
1935
|
+
}());
|
|
1936
|
+
_define_property$6(this, "carryChar", "");
|
|
1937
|
+
_define_property$6(this, "lastKeydownTarget", void 0);
|
|
1938
|
+
_define_property$6(this, "modifierLockStart", {});
|
|
1939
|
+
this.system = system;
|
|
1940
|
+
}
|
|
1941
|
+
};
|
|
1942
|
+
//#endregion
|
|
1943
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/keyboard/keyMap.js
|
|
1944
|
+
/**
|
|
1945
|
+
* Mapping for a default US-104-QWERTY keyboard
|
|
1946
|
+
*/ const defaultKeyMap$1 = [
|
|
1947
|
+
..."0123456789".split("").map((c) => ({
|
|
1948
|
+
code: `Digit${c}`,
|
|
1949
|
+
key: c
|
|
1950
|
+
})),
|
|
1951
|
+
...")!@#$%^&*(".split("").map((c, i) => ({
|
|
1952
|
+
code: `Digit${i}`,
|
|
1953
|
+
key: c,
|
|
1954
|
+
shiftKey: true
|
|
1955
|
+
})),
|
|
1956
|
+
..."abcdefghijklmnopqrstuvwxyz".split("").map((c) => ({
|
|
1957
|
+
code: `Key${c.toUpperCase()}`,
|
|
1958
|
+
key: c
|
|
1959
|
+
})),
|
|
1960
|
+
..."ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").map((c) => ({
|
|
1961
|
+
code: `Key${c}`,
|
|
1962
|
+
key: c,
|
|
1963
|
+
shiftKey: true
|
|
1964
|
+
})),
|
|
1965
|
+
{
|
|
1966
|
+
code: "BracketLeft",
|
|
1967
|
+
key: "["
|
|
1968
|
+
},
|
|
1969
|
+
{
|
|
1970
|
+
code: "BracketLeft",
|
|
1971
|
+
key: "{",
|
|
1972
|
+
shiftKey: true
|
|
1973
|
+
},
|
|
1974
|
+
{
|
|
1975
|
+
code: "BracketRight",
|
|
1976
|
+
key: "]"
|
|
1977
|
+
},
|
|
1978
|
+
{
|
|
1979
|
+
code: "BracketRight",
|
|
1980
|
+
key: "}",
|
|
1981
|
+
shiftKey: true
|
|
1982
|
+
},
|
|
1983
|
+
{
|
|
1984
|
+
code: "Space",
|
|
1985
|
+
key: " "
|
|
1986
|
+
},
|
|
1987
|
+
{
|
|
1988
|
+
code: "AltLeft",
|
|
1989
|
+
key: "Alt",
|
|
1990
|
+
location: DOM_KEY_LOCATION.LEFT
|
|
1991
|
+
},
|
|
1992
|
+
{
|
|
1993
|
+
code: "AltRight",
|
|
1994
|
+
key: "Alt",
|
|
1995
|
+
location: DOM_KEY_LOCATION.RIGHT
|
|
1996
|
+
},
|
|
1997
|
+
{
|
|
1998
|
+
code: "ShiftLeft",
|
|
1999
|
+
key: "Shift",
|
|
2000
|
+
location: DOM_KEY_LOCATION.LEFT
|
|
2001
|
+
},
|
|
2002
|
+
{
|
|
2003
|
+
code: "ShiftRight",
|
|
2004
|
+
key: "Shift",
|
|
2005
|
+
location: DOM_KEY_LOCATION.RIGHT
|
|
2006
|
+
},
|
|
2007
|
+
{
|
|
2008
|
+
code: "ControlLeft",
|
|
2009
|
+
key: "Control",
|
|
2010
|
+
location: DOM_KEY_LOCATION.LEFT
|
|
2011
|
+
},
|
|
2012
|
+
{
|
|
2013
|
+
code: "ControlRight",
|
|
2014
|
+
key: "Control",
|
|
2015
|
+
location: DOM_KEY_LOCATION.RIGHT
|
|
2016
|
+
},
|
|
2017
|
+
{
|
|
2018
|
+
code: "MetaLeft",
|
|
2019
|
+
key: "Meta",
|
|
2020
|
+
location: DOM_KEY_LOCATION.LEFT
|
|
2021
|
+
},
|
|
2022
|
+
{
|
|
2023
|
+
code: "MetaRight",
|
|
2024
|
+
key: "Meta",
|
|
2025
|
+
location: DOM_KEY_LOCATION.RIGHT
|
|
2026
|
+
},
|
|
2027
|
+
{
|
|
2028
|
+
code: "OSLeft",
|
|
2029
|
+
key: "OS",
|
|
2030
|
+
location: DOM_KEY_LOCATION.LEFT
|
|
2031
|
+
},
|
|
2032
|
+
{
|
|
2033
|
+
code: "OSRight",
|
|
2034
|
+
key: "OS",
|
|
2035
|
+
location: DOM_KEY_LOCATION.RIGHT
|
|
2036
|
+
},
|
|
2037
|
+
{
|
|
2038
|
+
code: "ContextMenu",
|
|
2039
|
+
key: "ContextMenu"
|
|
2040
|
+
},
|
|
2041
|
+
{
|
|
2042
|
+
code: "Tab",
|
|
2043
|
+
key: "Tab"
|
|
2044
|
+
},
|
|
2045
|
+
{
|
|
2046
|
+
code: "CapsLock",
|
|
2047
|
+
key: "CapsLock"
|
|
2048
|
+
},
|
|
2049
|
+
{
|
|
2050
|
+
code: "Backspace",
|
|
2051
|
+
key: "Backspace"
|
|
2052
|
+
},
|
|
2053
|
+
{
|
|
2054
|
+
code: "Enter",
|
|
2055
|
+
key: "Enter"
|
|
2056
|
+
},
|
|
2057
|
+
{
|
|
2058
|
+
code: "Escape",
|
|
2059
|
+
key: "Escape"
|
|
2060
|
+
},
|
|
2061
|
+
{
|
|
2062
|
+
code: "ArrowUp",
|
|
2063
|
+
key: "ArrowUp"
|
|
2064
|
+
},
|
|
2065
|
+
{
|
|
2066
|
+
code: "ArrowDown",
|
|
2067
|
+
key: "ArrowDown"
|
|
2068
|
+
},
|
|
2069
|
+
{
|
|
2070
|
+
code: "ArrowLeft",
|
|
2071
|
+
key: "ArrowLeft"
|
|
2072
|
+
},
|
|
2073
|
+
{
|
|
2074
|
+
code: "ArrowRight",
|
|
2075
|
+
key: "ArrowRight"
|
|
2076
|
+
},
|
|
2077
|
+
{
|
|
2078
|
+
code: "Home",
|
|
2079
|
+
key: "Home"
|
|
2080
|
+
},
|
|
2081
|
+
{
|
|
2082
|
+
code: "End",
|
|
2083
|
+
key: "End"
|
|
2084
|
+
},
|
|
2085
|
+
{
|
|
2086
|
+
code: "Delete",
|
|
2087
|
+
key: "Delete"
|
|
2088
|
+
},
|
|
2089
|
+
{
|
|
2090
|
+
code: "PageUp",
|
|
2091
|
+
key: "PageUp"
|
|
2092
|
+
},
|
|
2093
|
+
{
|
|
2094
|
+
code: "PageDown",
|
|
2095
|
+
key: "PageDown"
|
|
2096
|
+
},
|
|
2097
|
+
{
|
|
2098
|
+
code: "Fn",
|
|
2099
|
+
key: "Fn"
|
|
2100
|
+
},
|
|
2101
|
+
{
|
|
2102
|
+
code: "Symbol",
|
|
2103
|
+
key: "Symbol"
|
|
2104
|
+
},
|
|
2105
|
+
{
|
|
2106
|
+
code: "AltRight",
|
|
2107
|
+
key: "AltGraph"
|
|
2108
|
+
}
|
|
2109
|
+
];
|
|
2110
|
+
//#endregion
|
|
2111
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/pointer/keyMap.js
|
|
2112
|
+
const defaultKeyMap = [
|
|
2113
|
+
{
|
|
2114
|
+
name: "MouseLeft",
|
|
2115
|
+
pointerType: "mouse",
|
|
2116
|
+
button: "primary"
|
|
2117
|
+
},
|
|
2118
|
+
{
|
|
2119
|
+
name: "MouseRight",
|
|
2120
|
+
pointerType: "mouse",
|
|
2121
|
+
button: "secondary"
|
|
2122
|
+
},
|
|
2123
|
+
{
|
|
2124
|
+
name: "MouseMiddle",
|
|
2125
|
+
pointerType: "mouse",
|
|
2126
|
+
button: "auxiliary"
|
|
2127
|
+
},
|
|
2128
|
+
{
|
|
2129
|
+
name: "TouchA",
|
|
2130
|
+
pointerType: "touch"
|
|
2131
|
+
},
|
|
2132
|
+
{
|
|
2133
|
+
name: "TouchB",
|
|
2134
|
+
pointerType: "touch"
|
|
2135
|
+
},
|
|
2136
|
+
{
|
|
2137
|
+
name: "TouchC",
|
|
2138
|
+
pointerType: "touch"
|
|
2139
|
+
}
|
|
2140
|
+
];
|
|
2141
|
+
//#endregion
|
|
2142
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/system/pointer/buttons.js
|
|
2143
|
+
function _define_property$5(obj, key, value) {
|
|
2144
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
2145
|
+
value,
|
|
2146
|
+
enumerable: true,
|
|
2147
|
+
configurable: true,
|
|
2148
|
+
writable: true
|
|
2149
|
+
});
|
|
2150
|
+
else obj[key] = value;
|
|
2151
|
+
return obj;
|
|
2152
|
+
}
|
|
2153
|
+
var Buttons = class {
|
|
2154
|
+
getButtons() {
|
|
2155
|
+
let v = 0;
|
|
2156
|
+
for (const button of Object.keys(this.pressed)) v |= 2 ** Number(button);
|
|
2157
|
+
return v;
|
|
2158
|
+
}
|
|
2159
|
+
down(keyDef) {
|
|
2160
|
+
const button = getMouseButtonId(keyDef.button);
|
|
2161
|
+
if (button in this.pressed) {
|
|
2162
|
+
this.pressed[button].push(keyDef);
|
|
2163
|
+
return;
|
|
2164
|
+
}
|
|
2165
|
+
this.pressed[button] = [keyDef];
|
|
2166
|
+
return button;
|
|
2167
|
+
}
|
|
2168
|
+
up(keyDef) {
|
|
2169
|
+
const button = getMouseButtonId(keyDef.button);
|
|
2170
|
+
if (button in this.pressed) {
|
|
2171
|
+
this.pressed[button] = this.pressed[button].filter((k) => k.name !== keyDef.name);
|
|
2172
|
+
if (this.pressed[button].length === 0) {
|
|
2173
|
+
delete this.pressed[button];
|
|
2174
|
+
return button;
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
constructor() {
|
|
2179
|
+
_define_property$5(this, "pressed", {});
|
|
2180
|
+
}
|
|
2181
|
+
};
|
|
2182
|
+
const MouseButton = {
|
|
2183
|
+
primary: 0,
|
|
2184
|
+
secondary: 1,
|
|
2185
|
+
auxiliary: 2,
|
|
2186
|
+
back: 3,
|
|
2187
|
+
X1: 3,
|
|
2188
|
+
forward: 4,
|
|
2189
|
+
X2: 4
|
|
2190
|
+
};
|
|
2191
|
+
function getMouseButtonId(button = 0) {
|
|
2192
|
+
if (button in MouseButton) return MouseButton[button];
|
|
2193
|
+
return Number(button);
|
|
2194
|
+
}
|
|
2195
|
+
const MouseButtonFlip = {
|
|
2196
|
+
1: 2,
|
|
2197
|
+
2: 1
|
|
2198
|
+
};
|
|
2199
|
+
function getMouseEventButton(button) {
|
|
2200
|
+
button = getMouseButtonId(button);
|
|
2201
|
+
if (button in MouseButtonFlip) return MouseButtonFlip[button];
|
|
2202
|
+
return button;
|
|
2203
|
+
}
|
|
2204
|
+
//#endregion
|
|
2205
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/system/pointer/device.js
|
|
2206
|
+
function _define_property$4(obj, key, value) {
|
|
2207
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
2208
|
+
value,
|
|
2209
|
+
enumerable: true,
|
|
2210
|
+
configurable: true,
|
|
2211
|
+
writable: true
|
|
2212
|
+
});
|
|
2213
|
+
else obj[key] = value;
|
|
2214
|
+
return obj;
|
|
2215
|
+
}
|
|
2216
|
+
var Device = class {
|
|
2217
|
+
get countPressed() {
|
|
2218
|
+
return this.pressedKeys.size;
|
|
2219
|
+
}
|
|
2220
|
+
isPressed(keyDef) {
|
|
2221
|
+
return this.pressedKeys.has(keyDef.name);
|
|
2222
|
+
}
|
|
2223
|
+
addPressed(keyDef) {
|
|
2224
|
+
return this.pressedKeys.add(keyDef.name);
|
|
2225
|
+
}
|
|
2226
|
+
removePressed(keyDef) {
|
|
2227
|
+
return this.pressedKeys.delete(keyDef.name);
|
|
2228
|
+
}
|
|
2229
|
+
constructor() {
|
|
2230
|
+
_define_property$4(this, "pressedKeys", /* @__PURE__ */ new Set());
|
|
2231
|
+
}
|
|
2232
|
+
};
|
|
2233
|
+
//#endregion
|
|
2234
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/misc/getTreeDiff.js
|
|
2235
|
+
function getTreeDiff(a, b) {
|
|
2236
|
+
const treeA = [];
|
|
2237
|
+
for (let el = a; el; el = el.parentElement) treeA.push(el);
|
|
2238
|
+
const treeB = [];
|
|
2239
|
+
for (let el = b; el; el = el.parentElement) treeB.push(el);
|
|
2240
|
+
let i = 0;
|
|
2241
|
+
for (;; i++) if (i >= treeA.length || i >= treeB.length || treeA[treeA.length - 1 - i] !== treeB[treeB.length - 1 - i]) break;
|
|
2242
|
+
return [
|
|
2243
|
+
treeA.slice(0, treeA.length - i),
|
|
2244
|
+
treeB.slice(0, treeB.length - i),
|
|
2245
|
+
treeB.slice(treeB.length - i)
|
|
2246
|
+
];
|
|
2247
|
+
}
|
|
2248
|
+
//#endregion
|
|
2249
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/selection/resolveCaretPosition.js
|
|
2250
|
+
function resolveCaretPosition({ target, node, offset }) {
|
|
2251
|
+
if (hasOwnSelection(target)) return {
|
|
2252
|
+
node: target,
|
|
2253
|
+
offset: offset !== null && offset !== void 0 ? offset : getUIValue(target).length
|
|
2254
|
+
};
|
|
2255
|
+
else if (node) return {
|
|
2256
|
+
node,
|
|
2257
|
+
offset: offset !== null && offset !== void 0 ? offset : node.nodeType === 3 ? node.nodeValue.length : node.childNodes.length
|
|
2258
|
+
};
|
|
2259
|
+
return findNodeAtTextOffset(target, offset);
|
|
2260
|
+
}
|
|
2261
|
+
function findNodeAtTextOffset(node, offset, isRoot = true) {
|
|
2262
|
+
let i = offset === void 0 ? node.childNodes.length - 1 : 0;
|
|
2263
|
+
const step = offset === void 0 ? -1 : 1;
|
|
2264
|
+
while (offset === void 0 ? i >= (isRoot ? Math.max(node.childNodes.length - 1, 0) : 0) : i <= node.childNodes.length) {
|
|
2265
|
+
if (offset && i === node.childNodes.length) throw new Error("The given offset is out of bounds.");
|
|
2266
|
+
const c = node.childNodes.item(i);
|
|
2267
|
+
const text = String(c.textContent);
|
|
2268
|
+
if (text.length) {
|
|
2269
|
+
if (offset !== void 0 && text.length < offset) offset -= text.length;
|
|
2270
|
+
else if (c.nodeType === 1) return findNodeAtTextOffset(c, offset, false);
|
|
2271
|
+
else if (c.nodeType === 3) return {
|
|
2272
|
+
node: c,
|
|
2273
|
+
offset: offset !== null && offset !== void 0 ? offset : c.nodeValue.length
|
|
2274
|
+
};
|
|
2275
|
+
}
|
|
2276
|
+
i += step;
|
|
2277
|
+
}
|
|
2278
|
+
return {
|
|
2279
|
+
node,
|
|
2280
|
+
offset: node.childNodes.length
|
|
2281
|
+
};
|
|
2282
|
+
}
|
|
2283
|
+
//#endregion
|
|
2284
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/selection/setSelectionPerMouse.js
|
|
2285
|
+
function setSelectionPerMouseDown({ document, target, clickCount, node, offset }) {
|
|
2286
|
+
if (hasNoSelection(target)) return;
|
|
2287
|
+
const targetHasOwnSelection = hasOwnSelection(target);
|
|
2288
|
+
const text = String(targetHasOwnSelection ? getUIValue(target) : target.textContent);
|
|
2289
|
+
const [start, end] = node ? [offset, offset] : getTextRange(text, offset, clickCount);
|
|
2290
|
+
if (targetHasOwnSelection) {
|
|
2291
|
+
setUISelection(target, {
|
|
2292
|
+
anchorOffset: start !== null && start !== void 0 ? start : text.length,
|
|
2293
|
+
focusOffset: end !== null && end !== void 0 ? end : text.length
|
|
2294
|
+
});
|
|
2295
|
+
return {
|
|
2296
|
+
node: target,
|
|
2297
|
+
start: start !== null && start !== void 0 ? start : 0,
|
|
2298
|
+
end: end !== null && end !== void 0 ? end : text.length
|
|
2299
|
+
};
|
|
2300
|
+
} else {
|
|
2301
|
+
const { node: startNode, offset: startOffset } = resolveCaretPosition({
|
|
2302
|
+
target,
|
|
2303
|
+
node,
|
|
2304
|
+
offset: start
|
|
2305
|
+
});
|
|
2306
|
+
const { node: endNode, offset: endOffset } = resolveCaretPosition({
|
|
2307
|
+
target,
|
|
2308
|
+
node,
|
|
2309
|
+
offset: end
|
|
2310
|
+
});
|
|
2311
|
+
const range = target.ownerDocument.createRange();
|
|
2312
|
+
try {
|
|
2313
|
+
range.setStart(startNode, startOffset);
|
|
2314
|
+
range.setEnd(endNode, endOffset);
|
|
2315
|
+
} catch (e) {
|
|
2316
|
+
throw new Error("The given offset is out of bounds.");
|
|
2317
|
+
}
|
|
2318
|
+
const selection = document.getSelection();
|
|
2319
|
+
selection === null || selection === void 0 || selection.removeAllRanges();
|
|
2320
|
+
selection === null || selection === void 0 || selection.addRange(range.cloneRange());
|
|
2321
|
+
return range;
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
function getTextRange(text, pos, clickCount) {
|
|
2325
|
+
if (clickCount % 3 === 1 || text.length === 0) return [pos, pos];
|
|
2326
|
+
const textPos = pos !== null && pos !== void 0 ? pos : text.length;
|
|
2327
|
+
if (clickCount % 3 === 2) return [textPos - text.substr(0, pos).match(/(\w+|\s+|\W)?$/)[0].length, pos === void 0 ? pos : pos + text.substr(pos).match(/^(\w+|\s+|\W)?/)[0].length];
|
|
2328
|
+
return [textPos - text.substr(0, pos).match(/[^\r\n]*$/)[0].length, pos === void 0 ? pos : pos + text.substr(pos).match(/^[^\r\n]*/)[0].length];
|
|
2329
|
+
}
|
|
2330
|
+
//#endregion
|
|
2331
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/event/selection/modifySelectionPerMouse.js
|
|
2332
|
+
function modifySelectionPerMouseMove(selectionRange, { document, target, node, offset }) {
|
|
2333
|
+
const selectionFocus = resolveCaretPosition({
|
|
2334
|
+
target,
|
|
2335
|
+
node,
|
|
2336
|
+
offset
|
|
2337
|
+
});
|
|
2338
|
+
if ("node" in selectionRange) {
|
|
2339
|
+
/* istanbul ignore else */ if (selectionFocus.node === selectionRange.node) {
|
|
2340
|
+
const anchorOffset = selectionFocus.offset < selectionRange.start ? selectionRange.end : selectionRange.start;
|
|
2341
|
+
const focusOffset = selectionFocus.offset > selectionRange.end || selectionFocus.offset < selectionRange.start ? selectionFocus.offset : selectionRange.end;
|
|
2342
|
+
setUISelection(selectionRange.node, {
|
|
2343
|
+
anchorOffset,
|
|
2344
|
+
focusOffset
|
|
2345
|
+
});
|
|
2346
|
+
}
|
|
2347
|
+
} else {
|
|
2348
|
+
const range = selectionRange.cloneRange();
|
|
2349
|
+
const cmp = range.comparePoint(selectionFocus.node, selectionFocus.offset);
|
|
2350
|
+
if (cmp < 0) range.setStart(selectionFocus.node, selectionFocus.offset);
|
|
2351
|
+
else if (cmp > 0) range.setEnd(selectionFocus.node, selectionFocus.offset);
|
|
2352
|
+
const selection = document.getSelection();
|
|
2353
|
+
selection === null || selection === void 0 || selection.removeAllRanges();
|
|
2354
|
+
selection === null || selection === void 0 || selection.addRange(range.cloneRange());
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
//#endregion
|
|
2358
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/system/pointer/shared.js
|
|
2359
|
+
function isDifferentPointerPosition(positionA, positionB) {
|
|
2360
|
+
var _positionA_coords, _positionB_coords, _positionA_coords1, _positionB_coords1, _positionA_coords2, _positionB_coords2, _positionA_coords3, _positionB_coords3, _positionA_coords4, _positionB_coords4, _positionA_coords5, _positionB_coords5, _positionA_coords6, _positionB_coords6, _positionA_coords7, _positionB_coords7, _positionA_coords8, _positionB_coords8, _positionA_coords9, _positionB_coords9, _positionA_caret, _positionB_caret, _positionA_caret1, _positionB_caret1;
|
|
2361
|
+
return positionA.target !== positionB.target || ((_positionA_coords = positionA.coords) === null || _positionA_coords === void 0 ? void 0 : _positionA_coords.x) !== ((_positionB_coords = positionB.coords) === null || _positionB_coords === void 0 ? void 0 : _positionB_coords.x) || ((_positionA_coords1 = positionA.coords) === null || _positionA_coords1 === void 0 ? void 0 : _positionA_coords1.y) !== ((_positionB_coords1 = positionB.coords) === null || _positionB_coords1 === void 0 ? void 0 : _positionB_coords1.y) || ((_positionA_coords2 = positionA.coords) === null || _positionA_coords2 === void 0 ? void 0 : _positionA_coords2.clientX) !== ((_positionB_coords2 = positionB.coords) === null || _positionB_coords2 === void 0 ? void 0 : _positionB_coords2.clientX) || ((_positionA_coords3 = positionA.coords) === null || _positionA_coords3 === void 0 ? void 0 : _positionA_coords3.clientY) !== ((_positionB_coords3 = positionB.coords) === null || _positionB_coords3 === void 0 ? void 0 : _positionB_coords3.clientY) || ((_positionA_coords4 = positionA.coords) === null || _positionA_coords4 === void 0 ? void 0 : _positionA_coords4.offsetX) !== ((_positionB_coords4 = positionB.coords) === null || _positionB_coords4 === void 0 ? void 0 : _positionB_coords4.offsetX) || ((_positionA_coords5 = positionA.coords) === null || _positionA_coords5 === void 0 ? void 0 : _positionA_coords5.offsetY) !== ((_positionB_coords5 = positionB.coords) === null || _positionB_coords5 === void 0 ? void 0 : _positionB_coords5.offsetY) || ((_positionA_coords6 = positionA.coords) === null || _positionA_coords6 === void 0 ? void 0 : _positionA_coords6.pageX) !== ((_positionB_coords6 = positionB.coords) === null || _positionB_coords6 === void 0 ? void 0 : _positionB_coords6.pageX) || ((_positionA_coords7 = positionA.coords) === null || _positionA_coords7 === void 0 ? void 0 : _positionA_coords7.pageY) !== ((_positionB_coords7 = positionB.coords) === null || _positionB_coords7 === void 0 ? void 0 : _positionB_coords7.pageY) || ((_positionA_coords8 = positionA.coords) === null || _positionA_coords8 === void 0 ? void 0 : _positionA_coords8.screenX) !== ((_positionB_coords8 = positionB.coords) === null || _positionB_coords8 === void 0 ? void 0 : _positionB_coords8.screenX) || ((_positionA_coords9 = positionA.coords) === null || _positionA_coords9 === void 0 ? void 0 : _positionA_coords9.screenY) !== ((_positionB_coords9 = positionB.coords) === null || _positionB_coords9 === void 0 ? void 0 : _positionB_coords9.screenY) || ((_positionA_caret = positionA.caret) === null || _positionA_caret === void 0 ? void 0 : _positionA_caret.node) !== ((_positionB_caret = positionB.caret) === null || _positionB_caret === void 0 ? void 0 : _positionB_caret.node) || ((_positionA_caret1 = positionA.caret) === null || _positionA_caret1 === void 0 ? void 0 : _positionA_caret1.offset) !== ((_positionB_caret1 = positionB.caret) === null || _positionB_caret1 === void 0 ? void 0 : _positionB_caret1.offset);
|
|
2362
|
+
}
|
|
2363
|
+
//#endregion
|
|
2364
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/system/pointer/mouse.js
|
|
2365
|
+
function _define_property$3(obj, key, value) {
|
|
2366
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
2367
|
+
value,
|
|
2368
|
+
enumerable: true,
|
|
2369
|
+
configurable: true,
|
|
2370
|
+
writable: true
|
|
2371
|
+
});
|
|
2372
|
+
else obj[key] = value;
|
|
2373
|
+
return obj;
|
|
2374
|
+
}
|
|
2375
|
+
/**
|
|
2376
|
+
* This object is the single "virtual" mouse that might be controlled by multiple different pointer devices.
|
|
2377
|
+
*/ var Mouse = class {
|
|
2378
|
+
move(instance, position, isPrevented) {
|
|
2379
|
+
const prevPosition = this.position;
|
|
2380
|
+
const prevTarget = this.getTarget(instance);
|
|
2381
|
+
this.position = position;
|
|
2382
|
+
if (!isDifferentPointerPosition(prevPosition, position)) return;
|
|
2383
|
+
const nextTarget = this.getTarget(instance);
|
|
2384
|
+
const init = this.getEventInit("mousemove");
|
|
2385
|
+
const [leave, enter] = getTreeDiff(prevTarget, nextTarget);
|
|
2386
|
+
return {
|
|
2387
|
+
leave: () => {
|
|
2388
|
+
if (prevTarget !== nextTarget) {
|
|
2389
|
+
instance.dispatchUIEvent(prevTarget, "mouseout", init);
|
|
2390
|
+
leave.forEach((el) => instance.dispatchUIEvent(el, "mouseleave", init));
|
|
2391
|
+
}
|
|
2392
|
+
},
|
|
2393
|
+
enter: () => {
|
|
2394
|
+
if (prevTarget !== nextTarget) {
|
|
2395
|
+
instance.dispatchUIEvent(nextTarget, "mouseover", init);
|
|
2396
|
+
enter.forEach((el) => instance.dispatchUIEvent(el, "mouseenter", init));
|
|
2397
|
+
}
|
|
2398
|
+
},
|
|
2399
|
+
move: () => {
|
|
2400
|
+
if (isPrevented) return;
|
|
2401
|
+
instance.dispatchUIEvent(nextTarget, "mousemove", init);
|
|
2402
|
+
this.modifySelecting(instance);
|
|
2403
|
+
}
|
|
2404
|
+
};
|
|
2405
|
+
}
|
|
2406
|
+
down(instance, keyDef, isPrevented) {
|
|
2407
|
+
const button = this.buttons.down(keyDef);
|
|
2408
|
+
if (button === void 0) return;
|
|
2409
|
+
const target = this.getTarget(instance);
|
|
2410
|
+
this.buttonDownTarget[button] = target;
|
|
2411
|
+
const init = this.getEventInit("mousedown", keyDef.button);
|
|
2412
|
+
const disabled = isDisabled(target);
|
|
2413
|
+
if (!isPrevented && (disabled || instance.dispatchUIEvent(target, "mousedown", init))) {
|
|
2414
|
+
this.startSelecting(instance, init.detail);
|
|
2415
|
+
focusElement(target);
|
|
2416
|
+
}
|
|
2417
|
+
if (!disabled && getMouseEventButton(keyDef.button) === 2) instance.dispatchUIEvent(target, "contextmenu", this.getEventInit("contextmenu", keyDef.button));
|
|
2418
|
+
}
|
|
2419
|
+
up(instance, keyDef, isPrevented) {
|
|
2420
|
+
const button = this.buttons.up(keyDef);
|
|
2421
|
+
if (button === void 0) return;
|
|
2422
|
+
const target = this.getTarget(instance);
|
|
2423
|
+
if (!isDisabled(target)) {
|
|
2424
|
+
if (!isPrevented) {
|
|
2425
|
+
const mouseUpInit = this.getEventInit("mouseup", keyDef.button);
|
|
2426
|
+
instance.dispatchUIEvent(target, "mouseup", mouseUpInit);
|
|
2427
|
+
this.endSelecting();
|
|
2428
|
+
}
|
|
2429
|
+
const clickTarget = getTreeDiff(this.buttonDownTarget[button], target)[2][0];
|
|
2430
|
+
if (clickTarget) {
|
|
2431
|
+
const init = this.getEventInit("click", keyDef.button);
|
|
2432
|
+
if (init.detail) {
|
|
2433
|
+
instance.dispatchUIEvent(clickTarget, init.button === 0 ? "click" : "auxclick", init);
|
|
2434
|
+
if (init.button === 0 && init.detail === 2) instance.dispatchUIEvent(clickTarget, "dblclick", {
|
|
2435
|
+
...this.getEventInit("dblclick", keyDef.button),
|
|
2436
|
+
detail: init.detail
|
|
2437
|
+
});
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
resetClickCount() {
|
|
2443
|
+
this.clickCount.reset();
|
|
2444
|
+
}
|
|
2445
|
+
getEventInit(type, button) {
|
|
2446
|
+
const init = { ...this.position.coords };
|
|
2447
|
+
init.button = getMouseEventButton(button);
|
|
2448
|
+
init.buttons = this.buttons.getButtons();
|
|
2449
|
+
if (type === "mousedown") init.detail = this.clickCount.getOnDown(init.button);
|
|
2450
|
+
else if (type === "mouseup") init.detail = this.clickCount.getOnUp(init.button);
|
|
2451
|
+
else if (type === "click" || type === "auxclick") init.detail = this.clickCount.incOnClick(init.button);
|
|
2452
|
+
return init;
|
|
2453
|
+
}
|
|
2454
|
+
getTarget(instance) {
|
|
2455
|
+
var _this_position_target;
|
|
2456
|
+
return (_this_position_target = this.position.target) !== null && _this_position_target !== void 0 ? _this_position_target : instance.config.document.body;
|
|
2457
|
+
}
|
|
2458
|
+
startSelecting(instance, clickCount) {
|
|
2459
|
+
var _this_position_caret, _this_position_caret1;
|
|
2460
|
+
this.selecting = setSelectionPerMouseDown({
|
|
2461
|
+
document: instance.config.document,
|
|
2462
|
+
target: this.getTarget(instance),
|
|
2463
|
+
node: (_this_position_caret = this.position.caret) === null || _this_position_caret === void 0 ? void 0 : _this_position_caret.node,
|
|
2464
|
+
offset: (_this_position_caret1 = this.position.caret) === null || _this_position_caret1 === void 0 ? void 0 : _this_position_caret1.offset,
|
|
2465
|
+
clickCount
|
|
2466
|
+
});
|
|
2467
|
+
}
|
|
2468
|
+
modifySelecting(instance) {
|
|
2469
|
+
var _this_position_caret, _this_position_caret1;
|
|
2470
|
+
if (!this.selecting) return;
|
|
2471
|
+
modifySelectionPerMouseMove(this.selecting, {
|
|
2472
|
+
document: instance.config.document,
|
|
2473
|
+
target: this.getTarget(instance),
|
|
2474
|
+
node: (_this_position_caret = this.position.caret) === null || _this_position_caret === void 0 ? void 0 : _this_position_caret.node,
|
|
2475
|
+
offset: (_this_position_caret1 = this.position.caret) === null || _this_position_caret1 === void 0 ? void 0 : _this_position_caret1.offset
|
|
2476
|
+
});
|
|
2477
|
+
}
|
|
2478
|
+
endSelecting() {
|
|
2479
|
+
this.selecting = void 0;
|
|
2480
|
+
}
|
|
2481
|
+
constructor() {
|
|
2482
|
+
_define_property$3(this, "position", {});
|
|
2483
|
+
_define_property$3(this, "buttons", new Buttons());
|
|
2484
|
+
_define_property$3(this, "selecting", void 0);
|
|
2485
|
+
_define_property$3(this, "buttonDownTarget", {});
|
|
2486
|
+
_define_property$3(this, "clickCount", new class {
|
|
2487
|
+
incOnClick(button) {
|
|
2488
|
+
const current = this.down[button] === void 0 ? void 0 : Number(this.down[button]) + 1;
|
|
2489
|
+
this.count = this.count[button] === void 0 ? {} : { [button]: Number(this.count[button]) + 1 };
|
|
2490
|
+
return current;
|
|
2491
|
+
}
|
|
2492
|
+
getOnDown(button) {
|
|
2493
|
+
var _this_count_button;
|
|
2494
|
+
this.down = { [button]: (_this_count_button = this.count[button]) !== null && _this_count_button !== void 0 ? _this_count_button : 0 };
|
|
2495
|
+
var _this_count_button1;
|
|
2496
|
+
this.count = { [button]: (_this_count_button1 = this.count[button]) !== null && _this_count_button1 !== void 0 ? _this_count_button1 : 0 };
|
|
2497
|
+
return Number(this.count[button]) + 1;
|
|
2498
|
+
}
|
|
2499
|
+
getOnUp(button) {
|
|
2500
|
+
return this.down[button] === void 0 ? void 0 : Number(this.down[button]) + 1;
|
|
2501
|
+
}
|
|
2502
|
+
reset() {
|
|
2503
|
+
this.count = {};
|
|
2504
|
+
}
|
|
2505
|
+
constructor() {
|
|
2506
|
+
_define_property$3(this, "down", {});
|
|
2507
|
+
_define_property$3(this, "count", {});
|
|
2508
|
+
}
|
|
2509
|
+
}());
|
|
2510
|
+
}
|
|
2511
|
+
};
|
|
2512
|
+
//#endregion
|
|
2513
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/pointer/cssPointerEvents.js
|
|
2514
|
+
function hasPointerEvents(instance, element) {
|
|
2515
|
+
var _checkPointerEvents;
|
|
2516
|
+
return ((_checkPointerEvents = checkPointerEvents(instance, element)) === null || _checkPointerEvents === void 0 ? void 0 : _checkPointerEvents.pointerEvents) !== "none";
|
|
2517
|
+
}
|
|
2518
|
+
function closestPointerEventsDeclaration(element) {
|
|
2519
|
+
const window = getWindow(element);
|
|
2520
|
+
for (let el = element, tree = []; el === null || el === void 0 ? void 0 : el.ownerDocument; el = el.parentElement) {
|
|
2521
|
+
tree.push(el);
|
|
2522
|
+
const pointerEvents = window.getComputedStyle(el).pointerEvents;
|
|
2523
|
+
if (pointerEvents && !["inherit", "unset"].includes(pointerEvents)) return {
|
|
2524
|
+
pointerEvents,
|
|
2525
|
+
tree
|
|
2526
|
+
};
|
|
2527
|
+
}
|
|
2528
|
+
}
|
|
2529
|
+
const PointerEventsCheck = Symbol("Last check for pointer-events");
|
|
2530
|
+
function checkPointerEvents(instance, element) {
|
|
2531
|
+
const lastCheck = element[PointerEventsCheck];
|
|
2532
|
+
if (!(instance.config.pointerEventsCheck !== PointerEventsCheckLevel.Never && (!lastCheck || hasBitFlag(instance.config.pointerEventsCheck, PointerEventsCheckLevel.EachApiCall) && lastCheck[ApiLevel.Call] !== getLevelRef(instance, ApiLevel.Call) || hasBitFlag(instance.config.pointerEventsCheck, PointerEventsCheckLevel.EachTrigger) && lastCheck[ApiLevel.Trigger] !== getLevelRef(instance, ApiLevel.Trigger)))) return lastCheck === null || lastCheck === void 0 ? void 0 : lastCheck.result;
|
|
2533
|
+
const declaration = closestPointerEventsDeclaration(element);
|
|
2534
|
+
element[PointerEventsCheck] = {
|
|
2535
|
+
[ApiLevel.Call]: getLevelRef(instance, ApiLevel.Call),
|
|
2536
|
+
[ApiLevel.Trigger]: getLevelRef(instance, ApiLevel.Trigger),
|
|
2537
|
+
result: declaration
|
|
2538
|
+
};
|
|
2539
|
+
return declaration;
|
|
2540
|
+
}
|
|
2541
|
+
function assertPointerEvents(instance, element) {
|
|
2542
|
+
const declaration = checkPointerEvents(instance, element);
|
|
2543
|
+
if ((declaration === null || declaration === void 0 ? void 0 : declaration.pointerEvents) === "none") throw new Error([
|
|
2544
|
+
`Unable to perform pointer interaction as the element ${declaration.tree.length > 1 ? "inherits" : "has"} \`pointer-events: none\`:`,
|
|
2545
|
+
"",
|
|
2546
|
+
printTree(declaration.tree)
|
|
2547
|
+
].join("\n"));
|
|
2548
|
+
}
|
|
2549
|
+
function printTree(tree) {
|
|
2550
|
+
return tree.reverse().map((el, i) => [
|
|
2551
|
+
"".padEnd(i),
|
|
2552
|
+
el.tagName,
|
|
2553
|
+
el.id && `#${el.id}`,
|
|
2554
|
+
el.hasAttribute("data-testid") && `(testId=${el.getAttribute("data-testid")})`,
|
|
2555
|
+
getLabelDescr(el),
|
|
2556
|
+
tree.length > 1 && i === 0 && " <-- This element declared `pointer-events: none`",
|
|
2557
|
+
tree.length > 1 && i === tree.length - 1 && " <-- Asserted pointer events here"
|
|
2558
|
+
].filter(Boolean).join("")).join("\n");
|
|
2559
|
+
}
|
|
2560
|
+
function getLabelDescr(element) {
|
|
2561
|
+
var _element_labels;
|
|
2562
|
+
let label;
|
|
2563
|
+
if (element.hasAttribute("aria-label")) label = element.getAttribute("aria-label");
|
|
2564
|
+
else if (element.hasAttribute("aria-labelledby")) {
|
|
2565
|
+
var _element_ownerDocument_getElementById_textContent, _element_ownerDocument_getElementById;
|
|
2566
|
+
label = (_element_ownerDocument_getElementById = element.ownerDocument.getElementById(element.getAttribute("aria-labelledby"))) === null || _element_ownerDocument_getElementById === void 0 ? void 0 : (_element_ownerDocument_getElementById_textContent = _element_ownerDocument_getElementById.textContent) === null || _element_ownerDocument_getElementById_textContent === void 0 ? void 0 : _element_ownerDocument_getElementById_textContent.trim();
|
|
2567
|
+
} else if (isElementType(element, [
|
|
2568
|
+
"button",
|
|
2569
|
+
"input",
|
|
2570
|
+
"meter",
|
|
2571
|
+
"output",
|
|
2572
|
+
"progress",
|
|
2573
|
+
"select",
|
|
2574
|
+
"textarea"
|
|
2575
|
+
]) && ((_element_labels = element.labels) === null || _element_labels === void 0 ? void 0 : _element_labels.length)) label = Array.from(element.labels).map((el) => {
|
|
2576
|
+
var _el_textContent;
|
|
2577
|
+
return (_el_textContent = el.textContent) === null || _el_textContent === void 0 ? void 0 : _el_textContent.trim();
|
|
2578
|
+
}).join("|");
|
|
2579
|
+
else if (isElementType(element, "button")) {
|
|
2580
|
+
var _element_textContent;
|
|
2581
|
+
label = (_element_textContent = element.textContent) === null || _element_textContent === void 0 ? void 0 : _element_textContent.trim();
|
|
2582
|
+
}
|
|
2583
|
+
label = label === null || label === void 0 ? void 0 : label.replace(/\n/g, " ");
|
|
2584
|
+
if (Number(label === null || label === void 0 ? void 0 : label.length) > 30) label = `${label === null || label === void 0 ? void 0 : label.substring(0, 29)}…`;
|
|
2585
|
+
return label ? `(label=${label})` : "";
|
|
2586
|
+
}
|
|
2587
|
+
function hasBitFlag(conf, flag) {
|
|
2588
|
+
return (conf & flag) > 0;
|
|
2589
|
+
}
|
|
2590
|
+
//#endregion
|
|
2591
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/system/pointer/pointer.js
|
|
2592
|
+
function _define_property$2(obj, key, value) {
|
|
2593
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
2594
|
+
value,
|
|
2595
|
+
enumerable: true,
|
|
2596
|
+
configurable: true,
|
|
2597
|
+
writable: true
|
|
2598
|
+
});
|
|
2599
|
+
else obj[key] = value;
|
|
2600
|
+
return obj;
|
|
2601
|
+
}
|
|
2602
|
+
var Pointer = class {
|
|
2603
|
+
init(instance) {
|
|
2604
|
+
const target = this.getTarget(instance);
|
|
2605
|
+
const [, enter] = getTreeDiff(null, target);
|
|
2606
|
+
const init = this.getEventInit();
|
|
2607
|
+
assertPointerEvents(instance, target);
|
|
2608
|
+
instance.dispatchUIEvent(target, "pointerover", init);
|
|
2609
|
+
enter.forEach((el) => instance.dispatchUIEvent(el, "pointerenter", init));
|
|
2610
|
+
return this;
|
|
2611
|
+
}
|
|
2612
|
+
move(instance, position) {
|
|
2613
|
+
const prevPosition = this.position;
|
|
2614
|
+
const prevTarget = this.getTarget(instance);
|
|
2615
|
+
this.position = position;
|
|
2616
|
+
if (!isDifferentPointerPosition(prevPosition, position)) return;
|
|
2617
|
+
const nextTarget = this.getTarget(instance);
|
|
2618
|
+
const init = this.getEventInit(-1);
|
|
2619
|
+
const [leave, enter] = getTreeDiff(prevTarget, nextTarget);
|
|
2620
|
+
return {
|
|
2621
|
+
leave: () => {
|
|
2622
|
+
if (hasPointerEvents(instance, prevTarget)) {
|
|
2623
|
+
if (prevTarget !== nextTarget) {
|
|
2624
|
+
instance.dispatchUIEvent(prevTarget, "pointerout", init);
|
|
2625
|
+
leave.forEach((el) => instance.dispatchUIEvent(el, "pointerleave", init));
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2628
|
+
},
|
|
2629
|
+
enter: () => {
|
|
2630
|
+
assertPointerEvents(instance, nextTarget);
|
|
2631
|
+
if (prevTarget !== nextTarget) {
|
|
2632
|
+
instance.dispatchUIEvent(nextTarget, "pointerover", init);
|
|
2633
|
+
enter.forEach((el) => instance.dispatchUIEvent(el, "pointerenter", init));
|
|
2634
|
+
}
|
|
2635
|
+
},
|
|
2636
|
+
move: () => {
|
|
2637
|
+
instance.dispatchUIEvent(nextTarget, "pointermove", init);
|
|
2638
|
+
}
|
|
2639
|
+
};
|
|
2640
|
+
}
|
|
2641
|
+
down(instance, button = 0) {
|
|
2642
|
+
if (this.isDown) return;
|
|
2643
|
+
const target = this.getTarget(instance);
|
|
2644
|
+
assertPointerEvents(instance, target);
|
|
2645
|
+
this.isDown = true;
|
|
2646
|
+
this.isPrevented = !instance.dispatchUIEvent(target, "pointerdown", this.getEventInit(button));
|
|
2647
|
+
}
|
|
2648
|
+
up(instance, button = 0) {
|
|
2649
|
+
if (!this.isDown) return;
|
|
2650
|
+
const target = this.getTarget(instance);
|
|
2651
|
+
assertPointerEvents(instance, target);
|
|
2652
|
+
this.isPrevented = false;
|
|
2653
|
+
this.isDown = false;
|
|
2654
|
+
instance.dispatchUIEvent(target, "pointerup", this.getEventInit(button));
|
|
2655
|
+
}
|
|
2656
|
+
release(instance) {
|
|
2657
|
+
const target = this.getTarget(instance);
|
|
2658
|
+
const [leave] = getTreeDiff(target, null);
|
|
2659
|
+
const init = this.getEventInit();
|
|
2660
|
+
/* istanbul ignore else */ if (hasPointerEvents(instance, target)) {
|
|
2661
|
+
instance.dispatchUIEvent(target, "pointerout", init);
|
|
2662
|
+
leave.forEach((el) => instance.dispatchUIEvent(el, "pointerleave", init));
|
|
2663
|
+
}
|
|
2664
|
+
this.isCancelled = true;
|
|
2665
|
+
}
|
|
2666
|
+
getTarget(instance) {
|
|
2667
|
+
var _this_position_target;
|
|
2668
|
+
return (_this_position_target = this.position.target) !== null && _this_position_target !== void 0 ? _this_position_target : instance.config.document.body;
|
|
2669
|
+
}
|
|
2670
|
+
getEventInit(button) {
|
|
2671
|
+
return {
|
|
2672
|
+
...this.position.coords,
|
|
2673
|
+
pointerId: this.pointerId,
|
|
2674
|
+
pointerType: this.pointerType,
|
|
2675
|
+
isPrimary: this.isPrimary,
|
|
2676
|
+
button: getMouseEventButton(button),
|
|
2677
|
+
buttons: this.buttons.getButtons()
|
|
2678
|
+
};
|
|
2679
|
+
}
|
|
2680
|
+
constructor({ pointerId, pointerType, isPrimary }, buttons) {
|
|
2681
|
+
_define_property$2(this, "pointerId", void 0);
|
|
2682
|
+
_define_property$2(this, "pointerType", void 0);
|
|
2683
|
+
_define_property$2(this, "isPrimary", void 0);
|
|
2684
|
+
_define_property$2(this, "buttons", void 0);
|
|
2685
|
+
_define_property$2(this, "isMultitouch", false);
|
|
2686
|
+
_define_property$2(this, "isCancelled", false);
|
|
2687
|
+
_define_property$2(this, "isDown", false);
|
|
2688
|
+
_define_property$2(this, "isPrevented", false);
|
|
2689
|
+
_define_property$2(this, "position", {});
|
|
2690
|
+
this.pointerId = pointerId;
|
|
2691
|
+
this.pointerType = pointerType;
|
|
2692
|
+
this.isPrimary = isPrimary;
|
|
2693
|
+
this.isMultitouch = !isPrimary;
|
|
2694
|
+
this.buttons = buttons;
|
|
2695
|
+
}
|
|
2696
|
+
};
|
|
2697
|
+
//#endregion
|
|
2698
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/system/pointer/index.js
|
|
2699
|
+
function _define_property$1(obj, key, value) {
|
|
2700
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
2701
|
+
value,
|
|
2702
|
+
enumerable: true,
|
|
2703
|
+
configurable: true,
|
|
2704
|
+
writable: true
|
|
2705
|
+
});
|
|
2706
|
+
else obj[key] = value;
|
|
2707
|
+
return obj;
|
|
2708
|
+
}
|
|
2709
|
+
var PointerHost = class {
|
|
2710
|
+
isKeyPressed(keyDef) {
|
|
2711
|
+
return this.devices.get(keyDef.pointerType).isPressed(keyDef);
|
|
2712
|
+
}
|
|
2713
|
+
async press(instance, keyDef, position) {
|
|
2714
|
+
this.devices.get(keyDef.pointerType).addPressed(keyDef);
|
|
2715
|
+
this.buttons.down(keyDef);
|
|
2716
|
+
const pointerName = this.getPointerName(keyDef);
|
|
2717
|
+
const pointer = keyDef.pointerType === "touch" ? this.pointers.new(pointerName, keyDef.pointerType, this.buttons) : this.pointers.get(pointerName);
|
|
2718
|
+
pointer.position = position;
|
|
2719
|
+
if (pointer.pointerType !== "touch") this.mouse.position = position;
|
|
2720
|
+
if (pointer.pointerType === "touch") pointer.init(instance);
|
|
2721
|
+
pointer.down(instance, keyDef.button);
|
|
2722
|
+
if (pointer.pointerType !== "touch") this.mouse.down(instance, keyDef, pointer.isPrevented);
|
|
2723
|
+
}
|
|
2724
|
+
async move(instance, pointerName, position) {
|
|
2725
|
+
const pointer = this.pointers.get(pointerName);
|
|
2726
|
+
const pointermove = pointer.move(instance, position);
|
|
2727
|
+
const mousemove = pointer.pointerType === "touch" ? void 0 : this.mouse.move(instance, position, pointer.isPrevented);
|
|
2728
|
+
pointermove === null || pointermove === void 0 || pointermove.leave();
|
|
2729
|
+
mousemove === null || mousemove === void 0 || mousemove.leave();
|
|
2730
|
+
pointermove === null || pointermove === void 0 || pointermove.enter();
|
|
2731
|
+
mousemove === null || mousemove === void 0 || mousemove.enter();
|
|
2732
|
+
pointermove === null || pointermove === void 0 || pointermove.move();
|
|
2733
|
+
mousemove === null || mousemove === void 0 || mousemove.move();
|
|
2734
|
+
}
|
|
2735
|
+
async release(instance, keyDef, position) {
|
|
2736
|
+
const device = this.devices.get(keyDef.pointerType);
|
|
2737
|
+
device.removePressed(keyDef);
|
|
2738
|
+
this.buttons.up(keyDef);
|
|
2739
|
+
const pointer = this.pointers.get(this.getPointerName(keyDef));
|
|
2740
|
+
const isPrevented = pointer.isPrevented;
|
|
2741
|
+
pointer.position = position;
|
|
2742
|
+
if (pointer.pointerType !== "touch") this.mouse.position = position;
|
|
2743
|
+
if (device.countPressed === 0) pointer.up(instance, keyDef.button);
|
|
2744
|
+
if (pointer.pointerType === "touch") pointer.release(instance);
|
|
2745
|
+
if (pointer.pointerType === "touch" && !pointer.isMultitouch) {
|
|
2746
|
+
const mousemove = this.mouse.move(instance, position, isPrevented);
|
|
2747
|
+
mousemove === null || mousemove === void 0 || mousemove.leave();
|
|
2748
|
+
mousemove === null || mousemove === void 0 || mousemove.enter();
|
|
2749
|
+
mousemove === null || mousemove === void 0 || mousemove.move();
|
|
2750
|
+
this.mouse.down(instance, keyDef, isPrevented);
|
|
2751
|
+
}
|
|
2752
|
+
if (!pointer.isMultitouch) {
|
|
2753
|
+
const mousemove = this.mouse.move(instance, position, isPrevented);
|
|
2754
|
+
mousemove === null || mousemove === void 0 || mousemove.leave();
|
|
2755
|
+
mousemove === null || mousemove === void 0 || mousemove.enter();
|
|
2756
|
+
mousemove === null || mousemove === void 0 || mousemove.move();
|
|
2757
|
+
this.mouse.up(instance, keyDef, isPrevented);
|
|
2758
|
+
}
|
|
2759
|
+
}
|
|
2760
|
+
getPointerName(keyDef) {
|
|
2761
|
+
return keyDef.pointerType === "touch" ? keyDef.name : keyDef.pointerType;
|
|
2762
|
+
}
|
|
2763
|
+
getPreviousPosition(pointerName) {
|
|
2764
|
+
return this.pointers.has(pointerName) ? this.pointers.get(pointerName).position : void 0;
|
|
2765
|
+
}
|
|
2766
|
+
resetClickCount() {
|
|
2767
|
+
this.mouse.resetClickCount();
|
|
2768
|
+
}
|
|
2769
|
+
getMouseTarget(instance) {
|
|
2770
|
+
var _this_mouse_position_target;
|
|
2771
|
+
return (_this_mouse_position_target = this.mouse.position.target) !== null && _this_mouse_position_target !== void 0 ? _this_mouse_position_target : instance.config.document.body;
|
|
2772
|
+
}
|
|
2773
|
+
setMousePosition(position) {
|
|
2774
|
+
this.mouse.position = position;
|
|
2775
|
+
this.pointers.get("mouse").position = position;
|
|
2776
|
+
}
|
|
2777
|
+
constructor(system) {
|
|
2778
|
+
_define_property$1(this, "system", void 0);
|
|
2779
|
+
_define_property$1(this, "mouse", void 0);
|
|
2780
|
+
_define_property$1(this, "buttons", void 0);
|
|
2781
|
+
_define_property$1(this, "devices", new class {
|
|
2782
|
+
get(k) {
|
|
2783
|
+
var _this_registry, _k;
|
|
2784
|
+
var _;
|
|
2785
|
+
return (_ = (_this_registry = this.registry)[_k = k]) !== null && _ !== void 0 ? _ : _this_registry[_k] = new Device();
|
|
2786
|
+
}
|
|
2787
|
+
constructor() {
|
|
2788
|
+
_define_property$1(this, "registry", {});
|
|
2789
|
+
}
|
|
2790
|
+
}());
|
|
2791
|
+
_define_property$1(this, "pointers", new class {
|
|
2792
|
+
new(pointerName, pointerType, buttons) {
|
|
2793
|
+
const isPrimary = pointerType !== "touch" || !Object.values(this.registry).some((p) => p.pointerType === "touch" && !p.isCancelled);
|
|
2794
|
+
if (!isPrimary) Object.values(this.registry).forEach((p) => {
|
|
2795
|
+
if (p.pointerType === pointerType && !p.isCancelled) p.isMultitouch = true;
|
|
2796
|
+
});
|
|
2797
|
+
this.registry[pointerName] = new Pointer({
|
|
2798
|
+
pointerId: this.nextId++,
|
|
2799
|
+
pointerType,
|
|
2800
|
+
isPrimary
|
|
2801
|
+
}, buttons);
|
|
2802
|
+
return this.registry[pointerName];
|
|
2803
|
+
}
|
|
2804
|
+
get(pointerName) {
|
|
2805
|
+
if (!this.has(pointerName)) throw new Error(`Trying to access pointer "${pointerName}" which does not exist.`);
|
|
2806
|
+
return this.registry[pointerName];
|
|
2807
|
+
}
|
|
2808
|
+
has(pointerName) {
|
|
2809
|
+
return pointerName in this.registry;
|
|
2810
|
+
}
|
|
2811
|
+
constructor() {
|
|
2812
|
+
_define_property$1(this, "registry", {});
|
|
2813
|
+
_define_property$1(this, "nextId", 1);
|
|
2814
|
+
}
|
|
2815
|
+
}());
|
|
2816
|
+
this.system = system;
|
|
2817
|
+
this.buttons = new Buttons();
|
|
2818
|
+
this.mouse = new Mouse();
|
|
2819
|
+
this.pointers.new("mouse", "mouse", this.buttons);
|
|
2820
|
+
}
|
|
2821
|
+
};
|
|
2822
|
+
//#endregion
|
|
2823
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/system/index.js
|
|
2824
|
+
function _define_property(obj, key, value) {
|
|
2825
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
2826
|
+
value,
|
|
2827
|
+
enumerable: true,
|
|
2828
|
+
configurable: true,
|
|
2829
|
+
writable: true
|
|
2830
|
+
});
|
|
2831
|
+
else obj[key] = value;
|
|
2832
|
+
return obj;
|
|
2833
|
+
}
|
|
2834
|
+
/**
|
|
2835
|
+
* @internal Do not create/alter this by yourself as this type might be subject to changes.
|
|
2836
|
+
*/ var System = class {
|
|
2837
|
+
getUIEventModifiers() {
|
|
2838
|
+
return {
|
|
2839
|
+
altKey: this.keyboard.modifiers.Alt,
|
|
2840
|
+
ctrlKey: this.keyboard.modifiers.Control,
|
|
2841
|
+
metaKey: this.keyboard.modifiers.Meta,
|
|
2842
|
+
shiftKey: this.keyboard.modifiers.Shift,
|
|
2843
|
+
modifierAltGraph: this.keyboard.modifiers.AltGraph,
|
|
2844
|
+
modifierCapsLock: this.keyboard.modifiers.CapsLock,
|
|
2845
|
+
modifierFn: this.keyboard.modifiers.Fn,
|
|
2846
|
+
modifierFnLock: this.keyboard.modifiers.FnLock,
|
|
2847
|
+
modifierNumLock: this.keyboard.modifiers.NumLock,
|
|
2848
|
+
modifierScrollLock: this.keyboard.modifiers.ScrollLock,
|
|
2849
|
+
modifierSymbol: this.keyboard.modifiers.Symbol,
|
|
2850
|
+
modifierSymbolLock: this.keyboard.modifiers.SymbolLock
|
|
2851
|
+
};
|
|
2852
|
+
}
|
|
2853
|
+
constructor() {
|
|
2854
|
+
_define_property(this, "keyboard", new KeyboardHost(this));
|
|
2855
|
+
_define_property(this, "pointer", new PointerHost(this));
|
|
2856
|
+
}
|
|
2857
|
+
};
|
|
2858
|
+
//#endregion
|
|
2859
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/convenience/click.js
|
|
2860
|
+
async function click$1(element) {
|
|
2861
|
+
const pointerIn = [];
|
|
2862
|
+
if (!this.config.skipHover) pointerIn.push({ target: element });
|
|
2863
|
+
pointerIn.push({
|
|
2864
|
+
keys: "[MouseLeft]",
|
|
2865
|
+
target: element
|
|
2866
|
+
});
|
|
2867
|
+
return this.pointer(pointerIn);
|
|
2868
|
+
}
|
|
2869
|
+
async function dblClick$1(element) {
|
|
2870
|
+
return this.pointer([{ target: element }, "[MouseLeft][MouseLeft]"]);
|
|
2871
|
+
}
|
|
2872
|
+
async function tripleClick$1(element) {
|
|
2873
|
+
return this.pointer([{ target: element }, "[MouseLeft][MouseLeft][MouseLeft]"]);
|
|
2874
|
+
}
|
|
2875
|
+
//#endregion
|
|
2876
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/convenience/hover.js
|
|
2877
|
+
async function hover$1(element) {
|
|
2878
|
+
return this.pointer({ target: element });
|
|
2879
|
+
}
|
|
2880
|
+
async function unhover$1(element) {
|
|
2881
|
+
assertPointerEvents(this, this.system.pointer.getMouseTarget(this));
|
|
2882
|
+
return this.pointer({ target: element.ownerDocument.body });
|
|
2883
|
+
}
|
|
2884
|
+
//#endregion
|
|
2885
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/convenience/tab.js
|
|
2886
|
+
async function tab$1({ shift } = {}) {
|
|
2887
|
+
return this.keyboard(shift === true ? "{Shift>}{Tab}{/Shift}" : shift === false ? "[/ShiftLeft][/ShiftRight]{Tab}" : "{Tab}");
|
|
2888
|
+
}
|
|
2889
|
+
//#endregion
|
|
2890
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/keyDef/readNextDescriptor.js
|
|
2891
|
+
var bracketDict = /* @__PURE__ */ function(bracketDict) {
|
|
2892
|
+
bracketDict["{"] = "}";
|
|
2893
|
+
bracketDict["["] = "]";
|
|
2894
|
+
return bracketDict;
|
|
2895
|
+
}(bracketDict || {});
|
|
2896
|
+
/**
|
|
2897
|
+
* Read the next key definition from user input
|
|
2898
|
+
*
|
|
2899
|
+
* Describe key per `{descriptor}` or `[descriptor]`.
|
|
2900
|
+
* Everything else will be interpreted as a single character as descriptor - e.g. `a`.
|
|
2901
|
+
* Brackets `{` and `[` can be escaped by doubling - e.g. `foo[[bar` translates to `foo[bar`.
|
|
2902
|
+
* A previously pressed key can be released per `{/descriptor}`.
|
|
2903
|
+
* Keeping the key pressed can be written as `{descriptor>}`.
|
|
2904
|
+
* When keeping the key pressed you can choose how long the key is pressed `{descriptor>3}`.
|
|
2905
|
+
* You can then release the key per `{descriptor>3/}` or keep it pressed and continue with the next key.
|
|
2906
|
+
*/ function readNextDescriptor(text, context) {
|
|
2907
|
+
let pos = 0;
|
|
2908
|
+
const startBracket = text[pos] in bracketDict ? text[pos] : "";
|
|
2909
|
+
pos += startBracket.length;
|
|
2910
|
+
const type = new RegExp(`^\\${startBracket}{2}`).test(text) ? "" : startBracket;
|
|
2911
|
+
return {
|
|
2912
|
+
type,
|
|
2913
|
+
...type === "" ? readPrintableChar(text, pos, context) : readTag(text, pos, type, context)
|
|
2914
|
+
};
|
|
2915
|
+
}
|
|
2916
|
+
function readPrintableChar(text, pos, context) {
|
|
2917
|
+
const descriptor = text[pos];
|
|
2918
|
+
assertDescriptor(descriptor, text, pos, context);
|
|
2919
|
+
pos += descriptor.length;
|
|
2920
|
+
return {
|
|
2921
|
+
consumedLength: pos,
|
|
2922
|
+
descriptor,
|
|
2923
|
+
releasePrevious: false,
|
|
2924
|
+
releaseSelf: true,
|
|
2925
|
+
repeat: 1
|
|
2926
|
+
};
|
|
2927
|
+
}
|
|
2928
|
+
function readTag(text, pos, startBracket, context) {
|
|
2929
|
+
var _text_slice_match, _text_slice_match1;
|
|
2930
|
+
const releasePreviousModifier = text[pos] === "/" ? "/" : "";
|
|
2931
|
+
pos += releasePreviousModifier.length;
|
|
2932
|
+
const escapedDescriptor = startBracket === "{" && text[pos] === "\\";
|
|
2933
|
+
pos += Number(escapedDescriptor);
|
|
2934
|
+
const descriptor = escapedDescriptor ? text[pos] : (_text_slice_match = text.slice(pos).match(startBracket === "{" ? /^\w+|^[^}>/]/ : /^\w+/)) === null || _text_slice_match === void 0 ? void 0 : _text_slice_match[0];
|
|
2935
|
+
assertDescriptor(descriptor, text, pos, context);
|
|
2936
|
+
pos += descriptor.length;
|
|
2937
|
+
var _text_slice_match_;
|
|
2938
|
+
const repeatModifier = (_text_slice_match_ = (_text_slice_match1 = text.slice(pos).match(/^>\d+/)) === null || _text_slice_match1 === void 0 ? void 0 : _text_slice_match1[0]) !== null && _text_slice_match_ !== void 0 ? _text_slice_match_ : "";
|
|
2939
|
+
pos += repeatModifier.length;
|
|
2940
|
+
const releaseSelfModifier = text[pos] === "/" || !repeatModifier && text[pos] === ">" ? text[pos] : "";
|
|
2941
|
+
pos += releaseSelfModifier.length;
|
|
2942
|
+
const expectedEndBracket = bracketDict[startBracket];
|
|
2943
|
+
const endBracket = text[pos] === expectedEndBracket ? expectedEndBracket : "";
|
|
2944
|
+
if (!endBracket) throw new Error(getErrorMessage([
|
|
2945
|
+
!repeatModifier && "repeat modifier",
|
|
2946
|
+
!releaseSelfModifier && "release modifier",
|
|
2947
|
+
`"${expectedEndBracket}"`
|
|
2948
|
+
].filter(Boolean).join(" or "), text[pos], text, context));
|
|
2949
|
+
pos += endBracket.length;
|
|
2950
|
+
return {
|
|
2951
|
+
consumedLength: pos,
|
|
2952
|
+
descriptor,
|
|
2953
|
+
releasePrevious: !!releasePreviousModifier,
|
|
2954
|
+
repeat: repeatModifier ? Math.max(Number(repeatModifier.substr(1)), 1) : 1,
|
|
2955
|
+
releaseSelf: hasReleaseSelf(releaseSelfModifier, repeatModifier)
|
|
2956
|
+
};
|
|
2957
|
+
}
|
|
2958
|
+
function assertDescriptor(descriptor, text, pos, context) {
|
|
2959
|
+
if (!descriptor) throw new Error(getErrorMessage("key descriptor", text[pos], text, context));
|
|
2960
|
+
}
|
|
2961
|
+
function hasReleaseSelf(releaseSelfModifier, repeatModifier) {
|
|
2962
|
+
if (releaseSelfModifier) return releaseSelfModifier === "/";
|
|
2963
|
+
if (repeatModifier) return false;
|
|
2964
|
+
}
|
|
2965
|
+
function getErrorMessage(expected, found, text, context) {
|
|
2966
|
+
return `Expected ${expected} but found "${found !== null && found !== void 0 ? found : ""}" in "${text}"
|
|
2967
|
+
See ${context === "pointer" ? `https://testing-library.com/docs/user-event/pointer#pressing-a-button-or-touching-the-screen` : `https://testing-library.com/docs/user-event/keyboard`}
|
|
2968
|
+
for more information about how userEvent parses your input.`;
|
|
2969
|
+
}
|
|
2970
|
+
//#endregion
|
|
2971
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/keyboard/parseKeyDef.js
|
|
2972
|
+
/**
|
|
2973
|
+
* Parse key definitions per `keyboardMap`
|
|
2974
|
+
*
|
|
2975
|
+
* Keys can be referenced by `{key}` or `{special}` as well as physical locations per `[code]`.
|
|
2976
|
+
* Everything else will be interpreted as a typed character - e.g. `a`.
|
|
2977
|
+
* Brackets `{` and `[` can be escaped by doubling - e.g. `foo[[bar` translates to `foo[bar`.
|
|
2978
|
+
* Keeping the key pressed can be written as `{key>}`.
|
|
2979
|
+
* When keeping the key pressed you can choose how long (how many keydown and keypress) the key is pressed `{key>3}`.
|
|
2980
|
+
* You can then release the key per `{key>3/}` or keep it pressed and continue with the next key.
|
|
2981
|
+
*/ function parseKeyDef$1(keyboardMap, text) {
|
|
2982
|
+
const defs = [];
|
|
2983
|
+
do {
|
|
2984
|
+
const { type, descriptor, consumedLength, releasePrevious, releaseSelf = true, repeat } = readNextDescriptor(text, "keyboard");
|
|
2985
|
+
var _keyboardMap_find;
|
|
2986
|
+
const keyDef = (_keyboardMap_find = keyboardMap.find((def) => {
|
|
2987
|
+
if (type === "[") {
|
|
2988
|
+
var _def_code;
|
|
2989
|
+
return ((_def_code = def.code) === null || _def_code === void 0 ? void 0 : _def_code.toLowerCase()) === descriptor.toLowerCase();
|
|
2990
|
+
} else if (type === "{") {
|
|
2991
|
+
var _def_key;
|
|
2992
|
+
return ((_def_key = def.key) === null || _def_key === void 0 ? void 0 : _def_key.toLowerCase()) === descriptor.toLowerCase();
|
|
2993
|
+
}
|
|
2994
|
+
return def.key === descriptor;
|
|
2995
|
+
})) !== null && _keyboardMap_find !== void 0 ? _keyboardMap_find : {
|
|
2996
|
+
key: "Unknown",
|
|
2997
|
+
code: "Unknown",
|
|
2998
|
+
[type === "[" ? "code" : "key"]: descriptor
|
|
2999
|
+
};
|
|
3000
|
+
defs.push({
|
|
3001
|
+
keyDef,
|
|
3002
|
+
releasePrevious,
|
|
3003
|
+
releaseSelf,
|
|
3004
|
+
repeat
|
|
3005
|
+
});
|
|
3006
|
+
text = text.slice(consumedLength);
|
|
3007
|
+
} while (text);
|
|
3008
|
+
return defs;
|
|
3009
|
+
}
|
|
3010
|
+
//#endregion
|
|
3011
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/keyboard/index.js
|
|
3012
|
+
async function keyboard$1(text) {
|
|
3013
|
+
const actions = parseKeyDef$1(this.config.keyboardMap, text);
|
|
3014
|
+
for (let i = 0; i < actions.length; i++) {
|
|
3015
|
+
await wait(this.config);
|
|
3016
|
+
await keyboardAction(this, actions[i]);
|
|
3017
|
+
}
|
|
3018
|
+
}
|
|
3019
|
+
async function keyboardAction(instance, { keyDef, releasePrevious, releaseSelf, repeat }) {
|
|
3020
|
+
const { system } = instance;
|
|
3021
|
+
if (system.keyboard.isKeyPressed(keyDef)) await system.keyboard.keyup(instance, keyDef);
|
|
3022
|
+
if (!releasePrevious) {
|
|
3023
|
+
for (let i = 1; i <= repeat; i++) {
|
|
3024
|
+
await system.keyboard.keydown(instance, keyDef);
|
|
3025
|
+
if (i < repeat) await wait(instance.config);
|
|
3026
|
+
}
|
|
3027
|
+
if (releaseSelf) await system.keyboard.keyup(instance, keyDef);
|
|
3028
|
+
}
|
|
3029
|
+
}
|
|
3030
|
+
async function releaseAllKeys(instance) {
|
|
3031
|
+
for (const k of instance.system.keyboard.getPressedKeys()) await instance.system.keyboard.keyup(instance, k);
|
|
3032
|
+
}
|
|
3033
|
+
//#endregion
|
|
3034
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/document/copySelection.js
|
|
3035
|
+
function copySelection(target) {
|
|
3036
|
+
const data = hasOwnSelection(target) ? { "text/plain": readSelectedValueFromInput(target) } : { "text/plain": String(target.ownerDocument.getSelection()) };
|
|
3037
|
+
const dt = createDataTransfer(getWindow(target));
|
|
3038
|
+
for (const type in data) if (data[type]) dt.setData(type, data[type]);
|
|
3039
|
+
return dt;
|
|
3040
|
+
}
|
|
3041
|
+
function readSelectedValueFromInput(target) {
|
|
3042
|
+
const sel = getUISelection(target);
|
|
3043
|
+
return getUIValue(target).substring(sel.startOffset, sel.endOffset);
|
|
3044
|
+
}
|
|
3045
|
+
//#endregion
|
|
3046
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/clipboard/copy.js
|
|
3047
|
+
async function copy$1() {
|
|
3048
|
+
const doc = this.config.document;
|
|
3049
|
+
var _doc_activeElement;
|
|
3050
|
+
const target = (_doc_activeElement = doc.activeElement) !== null && _doc_activeElement !== void 0 ? _doc_activeElement : /* istanbul ignore next */ doc.body;
|
|
3051
|
+
const clipboardData = copySelection(target);
|
|
3052
|
+
if (clipboardData.items.length === 0) return;
|
|
3053
|
+
if (this.dispatchUIEvent(target, "copy", { clipboardData }) && this.config.writeToClipboard) await writeDataTransferToClipboard(doc, clipboardData);
|
|
3054
|
+
return clipboardData;
|
|
3055
|
+
}
|
|
3056
|
+
//#endregion
|
|
3057
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/clipboard/cut.js
|
|
3058
|
+
async function cut$1() {
|
|
3059
|
+
const doc = this.config.document;
|
|
3060
|
+
var _doc_activeElement;
|
|
3061
|
+
const target = (_doc_activeElement = doc.activeElement) !== null && _doc_activeElement !== void 0 ? _doc_activeElement : /* istanbul ignore next */ doc.body;
|
|
3062
|
+
const clipboardData = copySelection(target);
|
|
3063
|
+
if (clipboardData.items.length === 0) return;
|
|
3064
|
+
if (this.dispatchUIEvent(target, "cut", { clipboardData }) && this.config.writeToClipboard) await writeDataTransferToClipboard(target.ownerDocument, clipboardData);
|
|
3065
|
+
return clipboardData;
|
|
3066
|
+
}
|
|
3067
|
+
//#endregion
|
|
3068
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/clipboard/paste.js
|
|
3069
|
+
async function paste$1(clipboardData) {
|
|
3070
|
+
const doc = this.config.document;
|
|
3071
|
+
var _doc_activeElement;
|
|
3072
|
+
const target = (_doc_activeElement = doc.activeElement) !== null && _doc_activeElement !== void 0 ? _doc_activeElement : /* istanbul ignore next */ doc.body;
|
|
3073
|
+
var _ref;
|
|
3074
|
+
const dataTransfer = (_ref = typeof clipboardData === "string" ? getClipboardDataFromString(doc, clipboardData) : clipboardData) !== null && _ref !== void 0 ? _ref : await readDataTransferFromClipboard(doc).catch(() => {
|
|
3075
|
+
throw new Error("`userEvent.paste()` without `clipboardData` requires the `ClipboardAPI` to be available.");
|
|
3076
|
+
});
|
|
3077
|
+
this.dispatchUIEvent(target, "paste", { clipboardData: dataTransfer });
|
|
3078
|
+
}
|
|
3079
|
+
function getClipboardDataFromString(doc, text) {
|
|
3080
|
+
const dt = createDataTransfer(getWindow(doc));
|
|
3081
|
+
dt.setData("text", text);
|
|
3082
|
+
return dt;
|
|
3083
|
+
}
|
|
3084
|
+
//#endregion
|
|
3085
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/pointer/parseKeyDef.js
|
|
3086
|
+
function parseKeyDef(pointerMap, keys) {
|
|
3087
|
+
const defs = [];
|
|
3088
|
+
do {
|
|
3089
|
+
const { descriptor, consumedLength, releasePrevious, releaseSelf = true } = readNextDescriptor(keys, "pointer");
|
|
3090
|
+
const keyDef = pointerMap.find((p) => p.name === descriptor);
|
|
3091
|
+
if (keyDef) defs.push({
|
|
3092
|
+
keyDef,
|
|
3093
|
+
releasePrevious,
|
|
3094
|
+
releaseSelf
|
|
3095
|
+
});
|
|
3096
|
+
keys = keys.slice(consumedLength);
|
|
3097
|
+
} while (keys);
|
|
3098
|
+
return defs;
|
|
3099
|
+
}
|
|
3100
|
+
//#endregion
|
|
3101
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/pointer/index.js
|
|
3102
|
+
async function pointer$1(input) {
|
|
3103
|
+
const { pointerMap } = this.config;
|
|
3104
|
+
const actions = [];
|
|
3105
|
+
(Array.isArray(input) ? input : [input]).forEach((actionInput) => {
|
|
3106
|
+
if (typeof actionInput === "string") actions.push(...parseKeyDef(pointerMap, actionInput));
|
|
3107
|
+
else if ("keys" in actionInput) actions.push(...parseKeyDef(pointerMap, actionInput.keys).map((i) => ({
|
|
3108
|
+
...actionInput,
|
|
3109
|
+
...i
|
|
3110
|
+
})));
|
|
3111
|
+
else actions.push(actionInput);
|
|
3112
|
+
});
|
|
3113
|
+
for (let i = 0; i < actions.length; i++) {
|
|
3114
|
+
await wait(this.config);
|
|
3115
|
+
await pointerAction(this, actions[i]);
|
|
3116
|
+
}
|
|
3117
|
+
this.system.pointer.resetClickCount();
|
|
3118
|
+
}
|
|
3119
|
+
async function pointerAction(instance, action) {
|
|
3120
|
+
var _previousPosition_caret, _previousPosition_caret1;
|
|
3121
|
+
const pointerName = "pointerName" in action && action.pointerName ? action.pointerName : "keyDef" in action ? instance.system.pointer.getPointerName(action.keyDef) : "mouse";
|
|
3122
|
+
const previousPosition = instance.system.pointer.getPreviousPosition(pointerName);
|
|
3123
|
+
var _action_target, _action_coords, _action_node, _action_offset;
|
|
3124
|
+
const position = {
|
|
3125
|
+
target: (_action_target = action.target) !== null && _action_target !== void 0 ? _action_target : getPrevTarget(instance, previousPosition),
|
|
3126
|
+
coords: (_action_coords = action.coords) !== null && _action_coords !== void 0 ? _action_coords : previousPosition === null || previousPosition === void 0 ? void 0 : previousPosition.coords,
|
|
3127
|
+
caret: {
|
|
3128
|
+
node: (_action_node = action.node) !== null && _action_node !== void 0 ? _action_node : hasCaretPosition(action) ? void 0 : previousPosition === null || previousPosition === void 0 ? void 0 : (_previousPosition_caret = previousPosition.caret) === null || _previousPosition_caret === void 0 ? void 0 : _previousPosition_caret.node,
|
|
3129
|
+
offset: (_action_offset = action.offset) !== null && _action_offset !== void 0 ? _action_offset : hasCaretPosition(action) ? void 0 : previousPosition === null || previousPosition === void 0 ? void 0 : (_previousPosition_caret1 = previousPosition.caret) === null || _previousPosition_caret1 === void 0 ? void 0 : _previousPosition_caret1.offset
|
|
3130
|
+
}
|
|
3131
|
+
};
|
|
3132
|
+
if ("keyDef" in action) {
|
|
3133
|
+
if (instance.system.pointer.isKeyPressed(action.keyDef)) {
|
|
3134
|
+
setLevelRef(instance, ApiLevel.Trigger);
|
|
3135
|
+
await instance.system.pointer.release(instance, action.keyDef, position);
|
|
3136
|
+
}
|
|
3137
|
+
if (!action.releasePrevious) {
|
|
3138
|
+
setLevelRef(instance, ApiLevel.Trigger);
|
|
3139
|
+
await instance.system.pointer.press(instance, action.keyDef, position);
|
|
3140
|
+
if (action.releaseSelf) {
|
|
3141
|
+
setLevelRef(instance, ApiLevel.Trigger);
|
|
3142
|
+
await instance.system.pointer.release(instance, action.keyDef, position);
|
|
3143
|
+
}
|
|
3144
|
+
}
|
|
3145
|
+
} else {
|
|
3146
|
+
setLevelRef(instance, ApiLevel.Trigger);
|
|
3147
|
+
await instance.system.pointer.move(instance, pointerName, position);
|
|
3148
|
+
}
|
|
3149
|
+
}
|
|
3150
|
+
function hasCaretPosition(action) {
|
|
3151
|
+
var _action_target, _ref;
|
|
3152
|
+
return !!((_ref = (_action_target = action.target) !== null && _action_target !== void 0 ? _action_target : action.node) !== null && _ref !== void 0 ? _ref : action.offset !== void 0);
|
|
3153
|
+
}
|
|
3154
|
+
function getPrevTarget(instance, position) {
|
|
3155
|
+
if (!position) throw new Error("This pointer has no previous position. Provide a target property!");
|
|
3156
|
+
var _position_target;
|
|
3157
|
+
return (_position_target = position.target) !== null && _position_target !== void 0 ? _position_target : instance.config.document.body;
|
|
3158
|
+
}
|
|
3159
|
+
//#endregion
|
|
3160
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utility/clear.js
|
|
3161
|
+
async function clear$1(element) {
|
|
3162
|
+
if (!isEditable(element) || isDisabled(element)) throw new Error("clear()` is only supported on editable elements.");
|
|
3163
|
+
focusElement(element);
|
|
3164
|
+
if (element.ownerDocument.activeElement !== element) throw new Error("The element to be cleared could not be focused.");
|
|
3165
|
+
selectAll(element);
|
|
3166
|
+
if (!isAllSelected(element)) throw new Error("The element content to be cleared could not be selected.");
|
|
3167
|
+
input(this, element, "", "deleteContentBackward");
|
|
3168
|
+
}
|
|
3169
|
+
//#endregion
|
|
3170
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utility/selectOptions.js
|
|
3171
|
+
async function selectOptions$1(select, values) {
|
|
3172
|
+
return selectOptionsBase.call(this, true, select, values);
|
|
3173
|
+
}
|
|
3174
|
+
async function deselectOptions$1(select, values) {
|
|
3175
|
+
return selectOptionsBase.call(this, false, select, values);
|
|
3176
|
+
}
|
|
3177
|
+
async function selectOptionsBase(newValue, select, values) {
|
|
3178
|
+
if (!newValue && !select.multiple) throw require_react_esm.getConfig().getElementError(`Unable to deselect an option in a non-multiple select. Use selectOptions to change the selection instead.`, select);
|
|
3179
|
+
const valArray = Array.isArray(values) ? values : [values];
|
|
3180
|
+
const allOptions = Array.from(select.querySelectorAll("option, [role=\"option\"]"));
|
|
3181
|
+
const selectedOptions = valArray.map((val) => {
|
|
3182
|
+
if (typeof val !== "string" && allOptions.includes(val)) return val;
|
|
3183
|
+
else {
|
|
3184
|
+
const matchingOption = allOptions.find((o) => o.value === val || o.innerHTML === val);
|
|
3185
|
+
if (matchingOption) return matchingOption;
|
|
3186
|
+
else throw require_react_esm.getConfig().getElementError(`Value "${String(val)}" not found in options`, select);
|
|
3187
|
+
}
|
|
3188
|
+
}).filter((option) => !isDisabled(option));
|
|
3189
|
+
if (isDisabled(select) || !selectedOptions.length) return;
|
|
3190
|
+
const selectOption = (option) => {
|
|
3191
|
+
option.selected = newValue;
|
|
3192
|
+
this.dispatchUIEvent(select, "input", {
|
|
3193
|
+
bubbles: true,
|
|
3194
|
+
cancelable: false,
|
|
3195
|
+
composed: true
|
|
3196
|
+
});
|
|
3197
|
+
this.dispatchUIEvent(select, "change");
|
|
3198
|
+
};
|
|
3199
|
+
if (isElementType(select, "select")) if (select.multiple) for (const option of selectedOptions) {
|
|
3200
|
+
const withPointerEvents = this.config.pointerEventsCheck === 0 ? true : hasPointerEvents(this, option);
|
|
3201
|
+
if (withPointerEvents) {
|
|
3202
|
+
this.dispatchUIEvent(option, "pointerover");
|
|
3203
|
+
this.dispatchUIEvent(select, "pointerenter");
|
|
3204
|
+
this.dispatchUIEvent(option, "mouseover");
|
|
3205
|
+
this.dispatchUIEvent(select, "mouseenter");
|
|
3206
|
+
this.dispatchUIEvent(option, "pointermove");
|
|
3207
|
+
this.dispatchUIEvent(option, "mousemove");
|
|
3208
|
+
this.dispatchUIEvent(option, "pointerdown");
|
|
3209
|
+
this.dispatchUIEvent(option, "mousedown");
|
|
3210
|
+
}
|
|
3211
|
+
focusElement(select);
|
|
3212
|
+
if (withPointerEvents) {
|
|
3213
|
+
this.dispatchUIEvent(option, "pointerup");
|
|
3214
|
+
this.dispatchUIEvent(option, "mouseup");
|
|
3215
|
+
}
|
|
3216
|
+
selectOption(option);
|
|
3217
|
+
if (withPointerEvents) this.dispatchUIEvent(option, "click");
|
|
3218
|
+
await wait(this.config);
|
|
3219
|
+
}
|
|
3220
|
+
else if (selectedOptions.length === 1) {
|
|
3221
|
+
const withPointerEvents = this.config.pointerEventsCheck === 0 ? true : hasPointerEvents(this, select);
|
|
3222
|
+
if (withPointerEvents) await this.click(select);
|
|
3223
|
+
else focusElement(select);
|
|
3224
|
+
selectOption(selectedOptions[0]);
|
|
3225
|
+
if (withPointerEvents) {
|
|
3226
|
+
this.dispatchUIEvent(select, "pointerover");
|
|
3227
|
+
this.dispatchUIEvent(select, "pointerenter");
|
|
3228
|
+
this.dispatchUIEvent(select, "mouseover");
|
|
3229
|
+
this.dispatchUIEvent(select, "mouseenter");
|
|
3230
|
+
this.dispatchUIEvent(select, "pointerup");
|
|
3231
|
+
this.dispatchUIEvent(select, "mouseup");
|
|
3232
|
+
this.dispatchUIEvent(select, "click");
|
|
3233
|
+
}
|
|
3234
|
+
await wait(this.config);
|
|
3235
|
+
} else throw require_react_esm.getConfig().getElementError(`Cannot select multiple options on a non-multiple select`, select);
|
|
3236
|
+
else if (select.getAttribute("role") === "listbox") for (const option of selectedOptions) {
|
|
3237
|
+
await this.click(option);
|
|
3238
|
+
await this.unhover(option);
|
|
3239
|
+
}
|
|
3240
|
+
else throw require_react_esm.getConfig().getElementError(`Cannot select options on elements that are neither select nor listbox elements`, select);
|
|
3241
|
+
}
|
|
3242
|
+
//#endregion
|
|
3243
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utility/type.js
|
|
3244
|
+
async function type$1(element, text, { skipClick = this.config.skipClick, skipAutoClose = this.config.skipAutoClose, initialSelectionStart, initialSelectionEnd } = {}) {
|
|
3245
|
+
if (element.disabled) return;
|
|
3246
|
+
if (!skipClick) await this.click(element);
|
|
3247
|
+
if (initialSelectionStart !== void 0) setSelectionRange(element, initialSelectionStart, initialSelectionEnd !== null && initialSelectionEnd !== void 0 ? initialSelectionEnd : initialSelectionStart);
|
|
3248
|
+
await this.keyboard(text);
|
|
3249
|
+
if (!skipAutoClose) await releaseAllKeys(this);
|
|
3250
|
+
}
|
|
3251
|
+
//#endregion
|
|
3252
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utils/edit/setFiles.js
|
|
3253
|
+
const fakeFiles = Symbol("files and value properties are mocked");
|
|
3254
|
+
function restoreProperty(obj, prop, descriptor) {
|
|
3255
|
+
if (descriptor) Object.defineProperty(obj, prop, descriptor);
|
|
3256
|
+
else delete obj[prop];
|
|
3257
|
+
}
|
|
3258
|
+
function setFiles(el, files) {
|
|
3259
|
+
var _el_fakeFiles;
|
|
3260
|
+
(_el_fakeFiles = el[fakeFiles]) === null || _el_fakeFiles === void 0 || _el_fakeFiles.restore();
|
|
3261
|
+
const typeDescr = Object.getOwnPropertyDescriptor(el, "type");
|
|
3262
|
+
const valueDescr = Object.getOwnPropertyDescriptor(el, "value");
|
|
3263
|
+
const filesDescr = Object.getOwnPropertyDescriptor(el, "files");
|
|
3264
|
+
function restore() {
|
|
3265
|
+
restoreProperty(el, "type", typeDescr);
|
|
3266
|
+
restoreProperty(el, "value", valueDescr);
|
|
3267
|
+
restoreProperty(el, "files", filesDescr);
|
|
3268
|
+
}
|
|
3269
|
+
el[fakeFiles] = { restore };
|
|
3270
|
+
Object.defineProperties(el, {
|
|
3271
|
+
files: {
|
|
3272
|
+
configurable: true,
|
|
3273
|
+
get: () => files
|
|
3274
|
+
},
|
|
3275
|
+
value: {
|
|
3276
|
+
configurable: true,
|
|
3277
|
+
get: () => files.length ? `C:\\fakepath\\${files[0].name}` : "",
|
|
3278
|
+
set(v) {
|
|
3279
|
+
if (v === "") restore();
|
|
3280
|
+
else {
|
|
3281
|
+
var _valueDescr_set;
|
|
3282
|
+
valueDescr === null || valueDescr === void 0 || (_valueDescr_set = valueDescr.set) == null || _valueDescr_set.call(el, v);
|
|
3283
|
+
}
|
|
3284
|
+
}
|
|
3285
|
+
},
|
|
3286
|
+
type: {
|
|
3287
|
+
configurable: true,
|
|
3288
|
+
get: () => "file",
|
|
3289
|
+
set(v) {
|
|
3290
|
+
if (v !== "file") {
|
|
3291
|
+
restore();
|
|
3292
|
+
el.type = v;
|
|
3293
|
+
}
|
|
3294
|
+
}
|
|
3295
|
+
}
|
|
3296
|
+
});
|
|
3297
|
+
}
|
|
3298
|
+
//#endregion
|
|
3299
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/utility/upload.js
|
|
3300
|
+
async function upload$1(element, fileOrFiles) {
|
|
3301
|
+
const input = isElementType(element, "label") ? element.control : element;
|
|
3302
|
+
if (!input || !isElementType(input, "input", { type: "file" })) throw new TypeError(`The ${input === element ? "given" : "associated"} ${input === null || input === void 0 ? void 0 : input.tagName} element does not accept file uploads`);
|
|
3303
|
+
if (isDisabled(element)) return;
|
|
3304
|
+
const files = (Array.isArray(fileOrFiles) ? fileOrFiles : [fileOrFiles]).filter((file) => !this.config.applyAccept || isAcceptableFile(file, input.accept)).slice(0, input.multiple ? void 0 : 1);
|
|
3305
|
+
const fileDialog = () => {
|
|
3306
|
+
var _input_files;
|
|
3307
|
+
if (files.length === ((_input_files = input.files) === null || _input_files === void 0 ? void 0 : _input_files.length) && files.every((f, i) => {
|
|
3308
|
+
var _input_files;
|
|
3309
|
+
return f === ((_input_files = input.files) === null || _input_files === void 0 ? void 0 : _input_files.item(i));
|
|
3310
|
+
})) return;
|
|
3311
|
+
setFiles(input, createFileList(getWindow(element), files));
|
|
3312
|
+
this.dispatchUIEvent(input, "input");
|
|
3313
|
+
this.dispatchUIEvent(input, "change");
|
|
3314
|
+
};
|
|
3315
|
+
input.addEventListener("fileDialog", fileDialog);
|
|
3316
|
+
await this.click(element);
|
|
3317
|
+
input.removeEventListener("fileDialog", fileDialog);
|
|
3318
|
+
}
|
|
3319
|
+
function normalize(nameOrType) {
|
|
3320
|
+
return nameOrType.toLowerCase().replace(/(\.|\/)jpg\b/g, "$1jpeg");
|
|
3321
|
+
}
|
|
3322
|
+
function isAcceptableFile(file, accept) {
|
|
3323
|
+
if (!accept) return true;
|
|
3324
|
+
const wildcards = [
|
|
3325
|
+
"audio/*",
|
|
3326
|
+
"image/*",
|
|
3327
|
+
"video/*"
|
|
3328
|
+
];
|
|
3329
|
+
return normalize(accept).trim().split(/\s*,\s*/).some((acceptToken) => {
|
|
3330
|
+
if (acceptToken.startsWith(".")) return normalize(file.name).endsWith(acceptToken);
|
|
3331
|
+
else if (wildcards.includes(acceptToken)) return normalize(file.type).startsWith(acceptToken.replace("*", ""));
|
|
3332
|
+
return normalize(file.type) === acceptToken;
|
|
3333
|
+
});
|
|
3334
|
+
}
|
|
3335
|
+
//#endregion
|
|
3336
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/setup/api.js
|
|
3337
|
+
const userEventApi = {
|
|
3338
|
+
click: click$1,
|
|
3339
|
+
dblClick: dblClick$1,
|
|
3340
|
+
tripleClick: tripleClick$1,
|
|
3341
|
+
hover: hover$1,
|
|
3342
|
+
unhover: unhover$1,
|
|
3343
|
+
tab: tab$1,
|
|
3344
|
+
keyboard: keyboard$1,
|
|
3345
|
+
copy: copy$1,
|
|
3346
|
+
cut: cut$1,
|
|
3347
|
+
paste: paste$1,
|
|
3348
|
+
pointer: pointer$1,
|
|
3349
|
+
clear: clear$1,
|
|
3350
|
+
deselectOptions: deselectOptions$1,
|
|
3351
|
+
selectOptions: selectOptions$1,
|
|
3352
|
+
type: type$1,
|
|
3353
|
+
upload: upload$1
|
|
3354
|
+
};
|
|
3355
|
+
//#endregion
|
|
3356
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/setup/wrapAsync.js
|
|
3357
|
+
/**
|
|
3358
|
+
* Wrap an internal Promise
|
|
3359
|
+
*/ function wrapAsync(implementation) {
|
|
3360
|
+
return require_react_esm.getConfig().asyncWrapper(implementation);
|
|
3361
|
+
}
|
|
3362
|
+
//#endregion
|
|
3363
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/setup/setup.js
|
|
3364
|
+
/**
|
|
3365
|
+
* Default options applied when API is called per `userEvent.anyApi()`
|
|
3366
|
+
*/ const defaultOptionsDirect = {
|
|
3367
|
+
applyAccept: true,
|
|
3368
|
+
autoModify: true,
|
|
3369
|
+
delay: 0,
|
|
3370
|
+
document: globalThis.document,
|
|
3371
|
+
keyboardMap: defaultKeyMap$1,
|
|
3372
|
+
pointerMap: defaultKeyMap,
|
|
3373
|
+
pointerEventsCheck: PointerEventsCheckLevel.EachApiCall,
|
|
3374
|
+
skipAutoClose: false,
|
|
3375
|
+
skipClick: false,
|
|
3376
|
+
skipHover: false,
|
|
3377
|
+
writeToClipboard: false,
|
|
3378
|
+
advanceTimers: () => Promise.resolve()
|
|
3379
|
+
};
|
|
3380
|
+
/**
|
|
3381
|
+
* Default options applied when API is called per `userEvent().anyApi()`
|
|
3382
|
+
*/ const defaultOptionsSetup = {
|
|
3383
|
+
...defaultOptionsDirect,
|
|
3384
|
+
writeToClipboard: true
|
|
3385
|
+
};
|
|
3386
|
+
function createConfig(options = {}, defaults = defaultOptionsSetup, node) {
|
|
3387
|
+
const document = getDocument(options, node, defaults);
|
|
3388
|
+
return {
|
|
3389
|
+
...defaults,
|
|
3390
|
+
...options,
|
|
3391
|
+
document
|
|
3392
|
+
};
|
|
3393
|
+
}
|
|
3394
|
+
/**
|
|
3395
|
+
* Start a "session" with userEvent.
|
|
3396
|
+
* All APIs returned by this function share an input device state and a default configuration.
|
|
3397
|
+
*/ function setupMain(options = {}) {
|
|
3398
|
+
const config = createConfig(options);
|
|
3399
|
+
prepareDocument(config.document);
|
|
3400
|
+
patchFocus(getWindow(config.document).HTMLElement);
|
|
3401
|
+
var _config_document_defaultView;
|
|
3402
|
+
attachClipboardStubToView((_config_document_defaultView = config.document.defaultView) !== null && _config_document_defaultView !== void 0 ? _config_document_defaultView : /* istanbul ignore next */ globalThis.window);
|
|
3403
|
+
return createInstance(config).api;
|
|
3404
|
+
}
|
|
3405
|
+
/**
|
|
3406
|
+
* Setup in direct call per `userEvent.anyApi()`
|
|
3407
|
+
*/ function setupDirect({ keyboardState, pointerState, ...options } = {}, node) {
|
|
3408
|
+
const config = createConfig(options, defaultOptionsDirect, node);
|
|
3409
|
+
prepareDocument(config.document);
|
|
3410
|
+
patchFocus(getWindow(config.document).HTMLElement);
|
|
3411
|
+
var _ref;
|
|
3412
|
+
const system = (_ref = pointerState !== null && pointerState !== void 0 ? pointerState : keyboardState) !== null && _ref !== void 0 ? _ref : new System();
|
|
3413
|
+
return {
|
|
3414
|
+
api: createInstance(config, system).api,
|
|
3415
|
+
system
|
|
3416
|
+
};
|
|
3417
|
+
}
|
|
3418
|
+
/**
|
|
3419
|
+
* Create a set of callbacks with different default settings but the same state.
|
|
3420
|
+
*/ function setupSub(options) {
|
|
3421
|
+
return createInstance({
|
|
3422
|
+
...this.config,
|
|
3423
|
+
...options
|
|
3424
|
+
}, this.system).api;
|
|
3425
|
+
}
|
|
3426
|
+
function wrapAndBindImpl(instance, impl) {
|
|
3427
|
+
function method(...args) {
|
|
3428
|
+
setLevelRef(instance, ApiLevel.Call);
|
|
3429
|
+
return wrapAsync(() => impl.apply(instance, args).then(async (ret) => {
|
|
3430
|
+
await wait(instance.config);
|
|
3431
|
+
return ret;
|
|
3432
|
+
}));
|
|
3433
|
+
}
|
|
3434
|
+
Object.defineProperty(method, "name", { get: () => impl.name });
|
|
3435
|
+
return method;
|
|
3436
|
+
}
|
|
3437
|
+
function createInstance(config, system = new System()) {
|
|
3438
|
+
const instance = {};
|
|
3439
|
+
Object.assign(instance, {
|
|
3440
|
+
config,
|
|
3441
|
+
dispatchEvent: dispatchEvent.bind(instance),
|
|
3442
|
+
dispatchUIEvent: dispatchUIEvent.bind(instance),
|
|
3443
|
+
system,
|
|
3444
|
+
levelRefs: {},
|
|
3445
|
+
...userEventApi
|
|
3446
|
+
});
|
|
3447
|
+
return {
|
|
3448
|
+
instance,
|
|
3449
|
+
api: {
|
|
3450
|
+
...Object.fromEntries(Object.entries(userEventApi).map(([name, api]) => [name, wrapAndBindImpl(instance, api)])),
|
|
3451
|
+
setup: setupSub.bind(instance)
|
|
3452
|
+
}
|
|
3453
|
+
};
|
|
3454
|
+
}
|
|
3455
|
+
function getDocument(options, node, defaults) {
|
|
3456
|
+
var _options_document, _ref;
|
|
3457
|
+
return (_ref = (_options_document = options.document) !== null && _options_document !== void 0 ? _options_document : node && getDocumentFromNode(node)) !== null && _ref !== void 0 ? _ref : defaults.document;
|
|
3458
|
+
}
|
|
3459
|
+
//#endregion
|
|
3460
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/setup/directApi.js
|
|
3461
|
+
var directApi_exports = /* @__PURE__ */ require_chunk.__exportAll({
|
|
3462
|
+
clear: () => clear,
|
|
3463
|
+
click: () => click,
|
|
3464
|
+
copy: () => copy,
|
|
3465
|
+
cut: () => cut,
|
|
3466
|
+
dblClick: () => dblClick,
|
|
3467
|
+
deselectOptions: () => deselectOptions,
|
|
3468
|
+
hover: () => hover,
|
|
3469
|
+
keyboard: () => keyboard,
|
|
3470
|
+
paste: () => paste,
|
|
3471
|
+
pointer: () => pointer,
|
|
3472
|
+
selectOptions: () => selectOptions,
|
|
3473
|
+
tab: () => tab,
|
|
3474
|
+
tripleClick: () => tripleClick,
|
|
3475
|
+
type: () => type,
|
|
3476
|
+
unhover: () => unhover,
|
|
3477
|
+
upload: () => upload
|
|
3478
|
+
});
|
|
3479
|
+
function clear(element) {
|
|
3480
|
+
return setupDirect().api.clear(element);
|
|
3481
|
+
}
|
|
3482
|
+
function click(element, options = {}) {
|
|
3483
|
+
return setupDirect(options, element).api.click(element);
|
|
3484
|
+
}
|
|
3485
|
+
function copy(options = {}) {
|
|
3486
|
+
return setupDirect(options).api.copy();
|
|
3487
|
+
}
|
|
3488
|
+
function cut(options = {}) {
|
|
3489
|
+
return setupDirect(options).api.cut();
|
|
3490
|
+
}
|
|
3491
|
+
function dblClick(element, options = {}) {
|
|
3492
|
+
return setupDirect(options).api.dblClick(element);
|
|
3493
|
+
}
|
|
3494
|
+
function deselectOptions(select, values, options = {}) {
|
|
3495
|
+
return setupDirect(options).api.deselectOptions(select, values);
|
|
3496
|
+
}
|
|
3497
|
+
function hover(element, options = {}) {
|
|
3498
|
+
return setupDirect(options).api.hover(element);
|
|
3499
|
+
}
|
|
3500
|
+
async function keyboard(text, options = {}) {
|
|
3501
|
+
const { api, system } = setupDirect(options);
|
|
3502
|
+
return api.keyboard(text).then(() => system);
|
|
3503
|
+
}
|
|
3504
|
+
async function pointer(input, options = {}) {
|
|
3505
|
+
const { api, system } = setupDirect(options);
|
|
3506
|
+
return api.pointer(input).then(() => system);
|
|
3507
|
+
}
|
|
3508
|
+
function paste(clipboardData, options) {
|
|
3509
|
+
return setupDirect(options).api.paste(clipboardData);
|
|
3510
|
+
}
|
|
3511
|
+
function selectOptions(select, values, options = {}) {
|
|
3512
|
+
return setupDirect(options).api.selectOptions(select, values);
|
|
3513
|
+
}
|
|
3514
|
+
function tripleClick(element, options = {}) {
|
|
3515
|
+
return setupDirect(options).api.tripleClick(element);
|
|
3516
|
+
}
|
|
3517
|
+
function type(element, text, options = {}) {
|
|
3518
|
+
return setupDirect(options, element).api.type(element, text, options);
|
|
3519
|
+
}
|
|
3520
|
+
function unhover(element, options = {}) {
|
|
3521
|
+
const { api, system } = setupDirect(options);
|
|
3522
|
+
system.pointer.setMousePosition({ target: element });
|
|
3523
|
+
return api.unhover(element);
|
|
3524
|
+
}
|
|
3525
|
+
function upload(element, fileOrFiles, options = {}) {
|
|
3526
|
+
return setupDirect(options).api.upload(element, fileOrFiles);
|
|
3527
|
+
}
|
|
3528
|
+
function tab(options = {}) {
|
|
3529
|
+
return setupDirect().api.tab(options);
|
|
3530
|
+
}
|
|
3531
|
+
//#endregion
|
|
3532
|
+
//#region ../../node_modules/@testing-library/user-event/dist/esm/setup/index.js
|
|
3533
|
+
const userEvent = {
|
|
3534
|
+
...directApi_exports,
|
|
3535
|
+
setup: setupMain
|
|
3536
|
+
};
|
|
3537
|
+
//#endregion
|
|
3538
|
+
//#region lib/datePickerHelper.ts
|
|
3539
|
+
/**
|
|
3540
|
+
* Open a PDS DateRangePicker calendar by clicking its month segment and wait for the
|
|
3541
|
+
* calendar dialog to appear.
|
|
3542
|
+
*
|
|
3543
|
+
* In React 18 + jsdom, clicking the wrapper label element (getByLabelText(fieldLabel))
|
|
3544
|
+
* does not reliably move focus into the date field. Targeting the "month" segment directly
|
|
3545
|
+
* works around this.
|
|
3546
|
+
*/
|
|
3547
|
+
const openDateRangePicker = async (fieldLabel) => {
|
|
3548
|
+
await userEvent.click(require_react_esm.screen.getByLabelText(`month, ${fieldLabel},`));
|
|
3549
|
+
await require_react_esm.waitForWrapper(() => {
|
|
3550
|
+
expect(require_react_esm.screen.getByRole("dialog")).toBeVisible();
|
|
3551
|
+
});
|
|
3552
|
+
};
|
|
3553
|
+
/**
|
|
3554
|
+
* Click an enabled calendar date button whose aria-label includes dateString.
|
|
3555
|
+
* dateString should be in "MMMM d, yyyy" format (e.g. "April 14, 2026").
|
|
3556
|
+
* Requires the calendar dialog to already be open (call openDateRangePicker first).
|
|
3557
|
+
*/
|
|
3558
|
+
const clickCalendarDate = async (dateString) => {
|
|
3559
|
+
const dateButton = require_react_esm.screen.getAllByRole("button").filter((button) => !button.getAttribute("aria-disabled")).find((button) => button.getAttribute("aria-label")?.includes(dateString));
|
|
3560
|
+
if (dateButton == null) throw new Error(`Calendar date button not found for "${dateString}"`);
|
|
3561
|
+
expect(dateButton).toBeVisible();
|
|
3562
|
+
await userEvent.click(dateButton);
|
|
3563
|
+
};
|
|
3564
|
+
//#endregion
|
|
3565
|
+
exports.clickCalendarDate = clickCalendarDate;
|
|
3566
|
+
exports.openDateRangePicker = openDateRangePicker;
|
|
3567
|
+
|
|
3568
|
+
//# sourceMappingURL=datePickerHelper.cjs.map
|