@wrdagency/blockout 1.0.35 → 1.0.36
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/dist/{2NBKRL7C-DBbnghCe.js → 2NBKRL7C-CHy8TNQM.js} +20 -20
- package/dist/{2RSXSRCN-BxQ_v-Je.js → 2RSXSRCN-DO41jkxy.js} +17 -17
- package/dist/{4CMBR7SL-DezfZPUS.js → 4CMBR7SL-eq3_MGhO.js} +30 -30
- package/dist/{5JTVDSTH-CZ7mfyUK.js → 5JTVDSTH-Cb-3mCyv.js} +4 -4
- package/dist/{5VQZOHHZ-DLX-ulBK.js → 5VQZOHHZ-D1gSZFY3.js} +1 -1
- package/dist/{6VRAQV3D-BYmT0QTl.js → 6VRAQV3D-Dzur8C7A.js} +19 -19
- package/dist/{A3WPL2ZJ-24tGIJIQ.js → A3WPL2ZJ-BZG8SEll.js} +2 -2
- package/dist/{BM6PGYQY-DCbkDr5N.js → BM6PGYQY-CCtFEKyb.js} +4 -4
- package/dist/{EM5CXX6A-B4ZS4Hs_.js → EM5CXX6A-DJQcGr5c.js} +2 -2
- package/dist/F5MUBM3I-6mXn4Fpb.js +54 -0
- package/dist/{G7GW6PWC-Dk4hVbAk.js → G7GW6PWC-BbXlQk2u.js} +106 -106
- package/dist/{J2LQO3EC-BXJIaM2U.js → J2LQO3EC-CvdDteYO.js} +7 -7
- package/dist/JMHAJKUZ-B_CxAFEI.js +136 -0
- package/dist/{KFH4SEIX-DaQeP5D_.js → KFH4SEIX-CEb2cs5b.js} +16 -16
- package/dist/{LMDWO4NN-CpSMaD5G.js → LMDWO4NN-5r0-Qq-x.js} +59 -59
- package/dist/{MR26YJYP-CTh6rCwA.js → MR26YJYP-ev1_As0E.js} +82 -82
- package/dist/{MTZPJQMC-D2i4-LA_.js → MTZPJQMC-CeWFa7M2.js} +2 -2
- package/dist/{O2PQ2652-DIoegIkE.js → O2PQ2652-Cf1Ld8NU.js} +11 -11
- package/dist/{P7GR5CS5-3RsPGPTy.js → P7GR5CS5-DFBp00bC.js} +3 -5
- package/dist/{PFRGBC2K-BdRJd-gU.js → PFRGBC2K-a0iGk9xp.js} +78 -78
- package/dist/{RS7LB2H4-COOfOq9w.js → RS7LB2H4-C2VEpoD3.js} +1 -1
- package/dist/RZ4GPYOB-2HMGtCSt.js +37 -0
- package/dist/{S43UC3DV-HCi6u_G4.js → S43UC3DV-0FmlYtUL.js} +8 -8
- package/dist/SquaresFour.es-iDUIyl5P.js +38 -0
- package/dist/{TIW3GMFC-BF0w2_9R.js → TIW3GMFC-DwYhiC0Y.js} +18 -18
- package/dist/{TP7N7UIH-C4jXJDlO.js → TP7N7UIH-BtuT6Y_M.js} +2 -2
- package/dist/{UQQRIHDV-DEGlgATx.js → UQQRIHDV-DtNzoFEE.js} +23 -23
- package/dist/{UYGDZTLQ-HiDKLOW5.js → UYGDZTLQ-BBLp-g5T.js} +2 -2
- package/dist/{VIIRIBF3-B-djNAU9.js → VIIRIBF3-Ds5aiXIU.js} +5 -5
- package/dist/{WMYDSCNQ-pGjWB-Pk.js → WMYDSCNQ-BdMfJmVD.js} +8 -8
- package/dist/{WYCIER3C-CxfgpZG_.js → WYCIER3C-eiMqR6-L.js} +4 -4
- package/dist/{YORGHBM4-D_fOXG5Y.js → YORGHBM4-DycYf9gS.js} +11 -11
- package/dist/{YV4JVR4I-CQnJhUSg.js → YV4JVR4I-BqDRuYuU.js} +60 -60
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/style.css +1 -1
- package/dist/assets/style10.css +1 -1
- package/dist/assets/style11.css +1 -1
- package/dist/assets/style2.css +1 -1
- package/dist/assets/style3.css +1 -1
- package/dist/assets/style4.css +1 -1
- package/dist/assets/style5.css +1 -1
- package/dist/assets/style6.css +1 -1
- package/dist/assets/style7.css +1 -1
- package/dist/assets/style8.css +1 -1
- package/dist/assets/style9.css +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/{base-jB1DIMnz.js → base-CPhsnNBF.js} +6 -6
- package/dist/combobox-popover-C6rwSpgq.js +1116 -0
- package/dist/components/avatar/index.js +13 -12
- package/dist/components/badge/index.js +9 -8
- package/dist/components/breadcrumbs/index.js +20 -19
- package/dist/components/button/button.js +12 -28
- package/dist/components/button/icon.js +12 -28
- package/dist/components/button/index.js +3 -8
- package/dist/components/button/row.js +4 -4
- package/dist/components/command-palette/dialog.js +8 -31
- package/dist/components/command-palette/index.js +3 -8
- package/dist/components/command-palette/presets.js +4 -5
- package/dist/components/command-palette/static.js +17 -70
- package/dist/components/controls/base-control/index.js +2 -3
- package/dist/components/controls/base-popover-control/index.js +20 -21
- package/dist/components/controls/card-number-control/index.js +1 -1
- package/dist/components/controls/checkbox-control/index.js +3 -4
- package/dist/components/controls/choice-control/choice.js +22 -22
- package/dist/components/controls/choice-control/index.js +1 -1
- package/dist/components/controls/date-control/index.js +16 -17
- package/dist/components/controls/date-control/picker.js +8 -9
- package/dist/components/controls/index.js +21 -22
- package/dist/components/controls/list-control/index.js +1 -1
- package/dist/components/controls/list-control/item.js +19 -18
- package/dist/components/controls/list-control/list.js +2 -2
- package/dist/components/controls/markdown-control/editor.js +3 -3
- package/dist/components/controls/markdown-control/index.js +1 -1
- package/dist/components/controls/markdown-control/slash/base.js +1 -1
- package/dist/components/controls/markdown-control/slash/mentions.js +1 -1
- package/dist/components/controls/markdown-control/toolbar.js +2 -2
- package/dist/components/controls/number-control/index.js +1 -1
- package/dist/components/controls/password-control/index.js +1 -1
- package/dist/components/controls/recurrence-control/index.js +37 -41
- package/dist/components/controls/select-control/control.js +8 -49
- package/dist/components/controls/select-control/index.js +3 -4
- package/dist/components/controls/select-control/select.js +23 -166
- package/dist/components/controls/tag-control/ariakit-experimental.js +550 -558
- package/dist/components/controls/tag-control/index.js +32 -36
- package/dist/components/controls/tag-control/props.js +14 -13
- package/dist/components/controls/text-control/index.js +1 -1
- package/dist/components/controls/textarea-control/index.js +1 -1
- package/dist/components/controls/toggle-control/index.js +8 -8
- package/dist/components/controls/toggle-group-control/index.js +8 -8
- package/dist/components/dashboard/context.d.ts +15 -0
- package/dist/components/dashboard/context.js +6 -0
- package/dist/components/dashboard/grid.d.ts +9 -0
- package/dist/components/dashboard/grid.js +123 -0
- package/dist/components/dashboard/index.d.ts +2 -0
- package/dist/components/dashboard/index.js +6 -0
- package/dist/components/dashboard/item.d.ts +9 -0
- package/dist/components/dashboard/item.js +5268 -0
- package/dist/components/dashboard/types.d.ts +8 -0
- package/dist/components/dashboard/types.js +1 -0
- package/dist/components/data-form/autosave.js +3 -3
- package/dist/components/data-form/index.js +5 -12
- package/dist/components/data-form/status.js +14 -32
- package/dist/components/data-form/submit.js +13 -31
- package/dist/components/data-view/api.js +1 -1
- package/dist/components/data-view/data/apply.js +139 -296
- package/dist/components/data-view/data/filter.js +21 -35
- package/dist/components/data-view/data/layout.js +9 -13
- package/dist/components/data-view/data/options.js +82 -114
- package/dist/components/data-view/index.js +1 -1
- package/dist/components/data-view/layouts/grid/empty.js +1 -1
- package/dist/components/data-view/layouts/grid/group.js +15 -42
- package/dist/components/data-view/layouts/grid/index.js +4 -6
- package/dist/components/data-view/layouts/grid/item.js +17 -87
- package/dist/components/data-view/layouts/grid/root.js +1 -1
- package/dist/components/data-view/layouts/kanban/empty.js +2 -3
- package/dist/components/data-view/layouts/kanban/group.js +16 -43
- package/dist/components/data-view/layouts/kanban/index.js +3 -6
- package/dist/components/data-view/layouts/kanban/item.js +17 -87
- package/dist/components/data-view/layouts/kanban/root.js +13 -13
- package/dist/components/data-view/layouts/list/empty.js +1 -1
- package/dist/components/data-view/layouts/list/group.js +15 -42
- package/dist/components/data-view/layouts/list/index.js +4 -6
- package/dist/components/data-view/layouts/list/item.js +17 -66
- package/dist/components/data-view/layouts/list/root.js +1 -1
- package/dist/components/data-view/layouts/table/empty.js +15 -41
- package/dist/components/data-view/layouts/table/group.js +15 -61
- package/dist/components/data-view/layouts/table/index.js +2 -6
- package/dist/components/data-view/layouts/table/item.js +17 -67
- package/dist/components/data-view/layouts/table/root.js +17 -122
- package/dist/components/data-view/layouts/tile/empty.js +1 -1
- package/dist/components/data-view/layouts/tile/group.js +15 -42
- package/dist/components/data-view/layouts/tile/index.js +4 -6
- package/dist/components/data-view/layouts/tile/item.js +17 -69
- package/dist/components/data-view/layouts/tile/root.js +1 -1
- package/dist/components/data-view/parts/body/empty.js +13 -12
- package/dist/components/data-view/parts/body/index.js +20 -37
- package/dist/components/data-view/parts/controls/index.js +54 -73
- package/dist/components/data-view/parts/controls/search.js +24 -44
- package/dist/components/data-view/parts/filters/chip.js +14 -49
- package/dist/components/data-view/parts/filters/editor.js +17 -79
- package/dist/components/data-view/parts/filters/index.js +2 -7
- package/dist/components/data-view/parts/filters/list.js +6 -72
- package/dist/components/data-view/parts/footer/actions.js +33 -52
- package/dist/components/data-view/parts/footer/index.js +15 -33
- package/dist/components/data-view/parts/footer/selection.js +14 -32
- package/dist/components/data-view/parts/index.js +3 -3
- package/dist/components/data-view/parts/view-control/index.js +44 -60
- package/dist/components/data-view/root.js +18 -38
- package/dist/components/data-view/slots/group/checkbox.js +13 -28
- package/dist/components/data-view/slots/group/context.js +5 -21
- package/dist/components/data-view/slots/group/header.js +3 -10
- package/dist/components/data-view/slots/group/icon.js +2 -2
- package/dist/components/data-view/slots/group/index.js +2 -4
- package/dist/components/data-view/slots/group/label.js +1 -1
- package/dist/components/data-view/slots/index.js +4 -6
- package/dist/components/data-view/slots/item/actions.js +6 -28
- package/dist/components/data-view/slots/item/checkbox.js +17 -77
- package/dist/components/data-view/slots/item/depth.js +2 -4
- package/dist/components/data-view/slots/item/description.js +1 -1
- package/dist/components/data-view/slots/item/index.js +2 -5
- package/dist/components/data-view/slots/item/properties.js +2 -3
- package/dist/components/data-view/slots/item/relations.js +7 -9
- package/dist/components/data-view/slots/item/tags.js +2 -3
- package/dist/components/data-view/slots/item/thumbnail.js +2 -2
- package/dist/components/data-view/slots/item/title.js +8 -8
- package/dist/components/data-view/slots/item/util.js +2 -3
- package/dist/components/data-view/slots/property/field/editable.js +14 -29
- package/dist/components/data-view/slots/property/field/index.js +2 -3
- package/dist/components/data-view/slots/property/field/static.js +1 -1
- package/dist/components/data-view/slots/property/index.js +2 -2
- package/dist/components/data-view/slots/property/label.js +1 -1
- package/dist/components/data-view/slots/root/checkbox.js +13 -27
- package/dist/components/data-view/slots/root/index.js +1 -1
- package/dist/components/dialog/index.js +32 -33
- package/dist/components/filesystem/file.js +5 -5
- package/dist/components/filesystem/folder.js +5 -5
- package/dist/components/filesystem/icon.js +3 -863
- package/dist/components/filesystem/index.js +2 -2
- package/dist/components/filesystem/list.js +1 -1
- package/dist/components/filesystem/root.js +1 -1
- package/dist/components/form/components/index.js +7 -16
- package/dist/components/form/components/pagination.js +5 -106
- package/dist/components/form/components/progress.js +4 -19
- package/dist/components/form/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +65 -73
- package/dist/components/menu/index.d.ts +10 -1
- package/dist/components/menu/index.js +9 -45
- package/dist/components/menu/item.js +1 -1
- package/dist/components/menu/items/action.js +1 -1
- package/dist/components/menu/items/spacer.js +1 -1
- package/dist/components/menu/items/submenu.js +4 -5
- package/dist/components/menu/items/toggle.js +1 -1
- package/dist/components/pagination/index.js +8 -8
- package/dist/components/progress/index.js +12 -50
- package/dist/components/shell/context.js +1 -1
- package/dist/components/shell/index.js +6 -16
- package/dist/components/shell/navigation.js +5 -49
- package/dist/components/shell/pane.js +13 -26
- package/dist/components/shell/sidebar-item.js +13 -45
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/list.js +1 -1
- package/dist/components/tabs/panel.js +1 -1
- package/dist/components/tabs/root.js +1 -1
- package/dist/components/tabs/tab.js +1 -1
- package/dist/components/tag/index.js +2 -6
- package/dist/components/tag/list.js +4 -8
- package/dist/components/tag/tag.js +12 -20
- package/dist/components/toolbar/divider.js +1 -1
- package/dist/components/toolbar/index.js +6 -15
- package/dist/components/toolbar/root.js +1 -1
- package/dist/components/window/index.js +20 -20
- package/dist/{composite-provider-BPIeS4Cg.js → composite-provider-DlANhpbV.js} +2 -2
- package/dist/{disclosure-provider-cEVysvZT.js → disclosure-provider-Whga0UAw.js} +2 -2
- package/dist/filter-ClQxRPQl.js +120 -0
- package/dist/hooks/state.js +1 -1
- package/dist/hooks/theme.js +1 -1
- package/dist/icon-D6VWNg1e.js +909 -0
- package/dist/index-CcV1laBm.js +10 -0
- package/dist/{sortable.esm-BuV7eW2H.js → index-CrDFDRMM.js} +1247 -1089
- package/dist/{index-D7vLJIGX.js → index-D0xboB4V.js} +2 -2
- package/dist/index.js +140 -141
- package/dist/item-BHwNOBly.js +91 -0
- package/dist/menu-button-C7Wtq_Ny.js +488 -0
- package/dist/{menu-separator-Z6pSHpX5.js → menu-separator-1CpNYvfe.js} +3 -3
- package/dist/{picker-DyJogHYh.js → picker-BHIm3Cmb.js} +31 -32
- package/dist/{popover-provider-BJEfhgr1.js → popover-provider-DsS2XUBC.js} +2 -2
- package/dist/{presets-BDIhXP0C.js → presets-DevAa76r.js} +9 -10
- package/dist/primitives/colourway/index.js +8 -9
- package/dist/primitives/context-menu/index.d.ts +7 -0
- package/dist/primitives/context-menu/index.js +37 -0
- package/dist/primitives/icon-label/index.js +18 -19
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.js +34 -32
- package/dist/primitives/link/index.js +5 -6
- package/dist/primitives/nav-link/index.js +6 -7
- package/dist/primitives/popover/index.js +1 -1
- package/dist/primitives/popover/root.js +1 -1
- package/dist/primitives/popover/target.js +1 -1
- package/dist/primitives/popover/window.js +9 -9
- package/dist/primitives/resizable/index.d.ts +9 -2
- package/dist/primitives/resizable/index.js +120 -62
- package/dist/primitives/scroll-area/index.js +1 -1
- package/dist/primitives/tooltip/index.js +9 -10
- package/dist/primitives/truncate/index.d.ts +3 -2
- package/dist/primitives/truncate/index.js +30 -24
- package/dist/primitives/typography/heading.js +1 -1
- package/dist/primitives/typography/paragraph.js +1 -1
- package/dist/primitives/visually-hidden/index.js +6 -7
- package/dist/{style-CWAa57kN.js → style-DH642ww9.js} +1 -1
- package/dist/style-nHUEFY3u.js +4229 -0
- package/dist/{tab-DejwS4C8.js → tab-Cz1Iy2-6.js} +7 -7
- package/dist/{tab-list-CndMWcVv.js → tab-list-C-qZAxsl.js} +9 -9
- package/dist/{tab-panel-DedzuWUA.js → tab-panel-BaWZ3QU6.js} +11 -11
- package/dist/tab-provider-BqxRaJtd.js +170 -0
- package/dist/{tag-remove-Dz-sGbyZ.js → tag-remove-BgRiBB8K.js} +59 -59
- package/dist/{toolbar-PSaF1mdF.js → toolbar-BlMTPulL.js} +23 -23
- package/dist/{toolbar-CCiZ_PIy.js → toolbar-jAQLS8tL.js} +1 -1
- package/dist/toolbar-separator-ehmZmA72.js +16 -0
- package/dist/{tooltip-arrow-BVwULA6B.js → tooltip-arrow-gMwnY9fV.js} +47 -47
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +20 -14
- package/dist/utils/math.d.ts +5 -0
- package/dist/utils/math.js +11 -0
- package/package.json +2 -1
- package/dist/CaretRight.es-vnr78BGI.js +0 -32
- package/dist/Circle.es-B6Ug9Tpf.js +0 -30
- package/dist/DG5U6ZEL-DB0iwihy.js +0 -17
- package/dist/DotsThreeVertical.es-uadrGk3y.js +0 -36
- package/dist/F5MUBM3I-75qY3y0N.js +0 -54
- package/dist/IWEFDH56-BACkQ6dc.js +0 -19
- package/dist/IconBase.es-rM5tt24D.js +0 -48
- package/dist/JMHAJKUZ-D5KCN1Aj.js +0 -114
- package/dist/MAXQOH4L-BYWBWXpb.js +0 -459
- package/dist/MagnifyingGlass.es-CLstwG_v.js +0 -32
- package/dist/Plus.es-DJ5SuqNv.js +0 -38
- package/dist/RZ4GPYOB-CovncfhJ.js +0 -37
- package/dist/RadioButton.es-D3QVjfF9.js +0 -36
- package/dist/T7VMP3TM-C8D6mVva.js +0 -77
- package/dist/X.es-TbGOnXOO.js +0 -38
- package/dist/assets/button.css +0 -1
- package/dist/assets/index15.css +0 -1
- package/dist/assets/index16.css +0 -1
- package/dist/assets/index17.css +0 -1
- package/dist/assets/index18.css +0 -1
- package/dist/assets/index19.css +0 -1
- package/dist/assets/index20.css +0 -1
- package/dist/assets/index21.css +0 -1
- package/dist/assets/prosemirror.css +0 -1
- package/dist/assets/root.css +0 -1
- package/dist/assets/static.css +0 -1
- package/dist/assets/style12.css +0 -1
- package/dist/assets/style13.css +0 -1
- package/dist/assets/style14.css +0 -1
- package/dist/assets/style15.css +0 -1
- package/dist/assets/style16.css +0 -1
- package/dist/assets/style17.css +0 -1
- package/dist/assets/style18.css +0 -1
- package/dist/assets/style19.css +0 -1
- package/dist/assets/style20.css +0 -1
- package/dist/assets/style21.css +0 -1
- package/dist/assets/style23.css +0 -1
- package/dist/assets/style24.css +0 -1
- package/dist/assets/style25.css +0 -1
- package/dist/assets/style26.css +0 -1
- package/dist/assets/style27.css +0 -1
- package/dist/assets/style28.css +0 -1
- package/dist/assets/styles2.css +0 -1
- package/dist/assets/styles3.css +0 -1
- package/dist/assets/styles4.css +0 -1
- package/dist/assets/styles5.css +0 -1
- package/dist/combobox-group-hNvv1WJm.js +0 -27
- package/dist/combobox-popover-BZ_1wNrj.js +0 -95
- package/dist/filter-DHK0UoZG.js +0 -134
- package/dist/index-BLCPauyN.js +0 -76
- package/dist/index-BnbjJBS4.js +0 -252
- package/dist/index-CLl-PPjx.js +0 -56
- package/dist/item-CCOXuQUx.js +0 -62
- package/dist/match-sorter.esm-MNVE8H_6.js +0 -670
- package/dist/menu-button-GQO5dB3U.js +0 -416
- package/dist/select-popover-CGgkyRb4.js +0 -559
- package/dist/select-value-B3DYk9eV.js +0 -15
- package/dist/style-D1AX7G7x.js +0 -1735
- package/dist/tab-provider-B0BoLfST.js +0 -158
- package/dist/toolbar-separator-DJHiHbGj.js +0 -16
- /package/dist/assets/{style22.css → empty.css} +0 -0
|
@@ -0,0 +1,1116 @@
|
|
|
1
|
+
import { u as Lt } from "./A3WPL2ZJ-BZG8SEll.js";
|
|
2
|
+
import { u as Ue } from "./6VRAQV3D-Dzur8C7A.js";
|
|
3
|
+
import { s as qe, f as W, c as z, a as Q, _ as X, m as x, i as ae, k as M, r as We, U as ze, R as re, Q as I, S as F, T as Ie, h as $, e as te, G as Qe, j as pe, l as he, V as Ze, q as ge, t as kt, M as _t, N as Tt, O as Kt, n as Mt, u as Ft, ag as Je, I as Nt, $ as Rt, z as Ht, ac as Bt, ah as $t, ai as jt, w as Fe, af as ye, ab as Gt, A as Ut, b as Oe, a3 as Xe, Z as qt, a4 as Wt, C as zt } from "./LMDWO4NN-5r0-Qq-x.js";
|
|
4
|
+
import { u as Ve, a as Ae, S as Ye, b as Qt, c as Zt, d as Jt, e as Ne } from "./tab-provider-BqxRaJtd.js";
|
|
5
|
+
import { u as Xt } from "./MTZPJQMC-CeWFa7M2.js";
|
|
6
|
+
import { useMemo as Ce, useState as fe, useRef as oe, useEffect as ne, useCallback as Yt, useContext as Re, createContext as De } from "react";
|
|
7
|
+
import { jsx as N, jsxs as Ee, Fragment as He } from "react/jsx-runtime";
|
|
8
|
+
import { c as et } from "./menu-button-C7Wtq_Ny.js";
|
|
9
|
+
import { u as eo, a as to } from "./WMYDSCNQ-BdMfJmVD.js";
|
|
10
|
+
import { t as tt } from "./7PRQYBBV-91wrWGjk.js";
|
|
11
|
+
import { c as ot, a as nt } from "./O2PQ2652-Cf1Ld8NU.js";
|
|
12
|
+
import { c as rt, d as st, a as lt } from "./4CMBR7SL-eq3_MGhO.js";
|
|
13
|
+
import { d as xe, e as oo, u as no, c as ro, f as so, b as lo } from "./S43UC3DV-0FmlYtUL.js";
|
|
14
|
+
import { m as at, o as ao, t as ut, c as it, s as Z, d as J, g as ct, b as dt, f as me, u as uo, a as mt, p as io } from "./YV4JVR4I-BqDRuYuU.js";
|
|
15
|
+
import { u as co, a as mo } from "./YORGHBM4-DycYf9gS.js";
|
|
16
|
+
import { u as fo } from "./UQQRIHDV-DtNzoFEE.js";
|
|
17
|
+
import { i as ft } from "./KFH4SEIX-CEb2cs5b.js";
|
|
18
|
+
import { u as vt } from "./5JTVDSTH-Cb-3mCyv.js";
|
|
19
|
+
import { c as pt, u as bt } from "./G7GW6PWC-BbXlQk2u.js";
|
|
20
|
+
import { h as Be } from "./PFRGBC2K-a0iGk9xp.js";
|
|
21
|
+
import { e as vo, C as po } from "./P7GR5CS5-DFBp00bC.js";
|
|
22
|
+
var bo = "button", So = z(
|
|
23
|
+
function(n) {
|
|
24
|
+
var o = n, { store: e } = o, r = X(o, ["store"]);
|
|
25
|
+
const l = Lt();
|
|
26
|
+
return e = e || l, r = Ue(x({ store: e }, r)), r;
|
|
27
|
+
}
|
|
28
|
+
), Pn = qe(
|
|
29
|
+
W(function(n) {
|
|
30
|
+
const o = So(n);
|
|
31
|
+
return Q(bo, o);
|
|
32
|
+
})
|
|
33
|
+
), ho = "span", go = {
|
|
34
|
+
top: "4,10 8,6 12,10",
|
|
35
|
+
right: "6,4 10,8 6,12",
|
|
36
|
+
bottom: "4,6 8,10 12,6",
|
|
37
|
+
left: "10,4 6,8 10,12"
|
|
38
|
+
}, St = z(function(n) {
|
|
39
|
+
var o = n, { store: e, placement: r } = o, l = X(o, ["store", "placement"]);
|
|
40
|
+
const i = Xt();
|
|
41
|
+
e = e || i, ae(
|
|
42
|
+
e,
|
|
43
|
+
process.env.NODE_ENV !== "production" && "PopoverDisclosureArrow must be wrapped in a PopoverDisclosure component."
|
|
44
|
+
);
|
|
45
|
+
const E = e.useState((a) => r || a.placement).split("-")[0], m = go[E], c = Ce(
|
|
46
|
+
() => /* @__PURE__ */ N(
|
|
47
|
+
"svg",
|
|
48
|
+
{
|
|
49
|
+
display: "block",
|
|
50
|
+
fill: "none",
|
|
51
|
+
stroke: "currentColor",
|
|
52
|
+
strokeLinecap: "round",
|
|
53
|
+
strokeLinejoin: "round",
|
|
54
|
+
strokeWidth: 1.5,
|
|
55
|
+
viewBox: "0 0 16 16",
|
|
56
|
+
height: "1em",
|
|
57
|
+
width: "1em",
|
|
58
|
+
children: /* @__PURE__ */ N("polyline", { points: m })
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
[m]
|
|
62
|
+
);
|
|
63
|
+
return l = M(x({
|
|
64
|
+
children: c,
|
|
65
|
+
"aria-hidden": !0
|
|
66
|
+
}, l), {
|
|
67
|
+
style: x({
|
|
68
|
+
width: "1em",
|
|
69
|
+
height: "1em",
|
|
70
|
+
pointerEvents: "none"
|
|
71
|
+
}, l.style)
|
|
72
|
+
}), We(l);
|
|
73
|
+
}), yn = W(
|
|
74
|
+
function(n) {
|
|
75
|
+
const o = St(n);
|
|
76
|
+
return Q(ho, o);
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
function Co(t = {}) {
|
|
80
|
+
var n = t, {
|
|
81
|
+
combobox: o
|
|
82
|
+
} = n, e = ze(n, [
|
|
83
|
+
"combobox"
|
|
84
|
+
]);
|
|
85
|
+
const r = at(
|
|
86
|
+
e.store,
|
|
87
|
+
ao(o, [
|
|
88
|
+
"value",
|
|
89
|
+
"items",
|
|
90
|
+
"renderedItems",
|
|
91
|
+
"baseElement",
|
|
92
|
+
"arrowElement",
|
|
93
|
+
"anchorElement",
|
|
94
|
+
"contentElement",
|
|
95
|
+
"popoverElement",
|
|
96
|
+
"disclosureElement"
|
|
97
|
+
])
|
|
98
|
+
);
|
|
99
|
+
ut(e, r);
|
|
100
|
+
const l = r.getState(), i = rt(re(F({}, e), {
|
|
101
|
+
store: r,
|
|
102
|
+
virtualFocus: I(
|
|
103
|
+
e.virtualFocus,
|
|
104
|
+
l.virtualFocus,
|
|
105
|
+
!0
|
|
106
|
+
),
|
|
107
|
+
includesBaseElement: I(
|
|
108
|
+
e.includesBaseElement,
|
|
109
|
+
l.includesBaseElement,
|
|
110
|
+
!1
|
|
111
|
+
),
|
|
112
|
+
activeId: I(
|
|
113
|
+
e.activeId,
|
|
114
|
+
l.activeId,
|
|
115
|
+
e.defaultActiveId,
|
|
116
|
+
null
|
|
117
|
+
),
|
|
118
|
+
orientation: I(
|
|
119
|
+
e.orientation,
|
|
120
|
+
l.orientation,
|
|
121
|
+
"vertical"
|
|
122
|
+
)
|
|
123
|
+
})), w = ot(re(F({}, e), {
|
|
124
|
+
store: r,
|
|
125
|
+
placement: I(
|
|
126
|
+
e.placement,
|
|
127
|
+
l.placement,
|
|
128
|
+
"bottom-start"
|
|
129
|
+
)
|
|
130
|
+
})), E = new String(""), m = re(F(F({}, i.getState()), w.getState()), {
|
|
131
|
+
value: I(
|
|
132
|
+
e.value,
|
|
133
|
+
l.value,
|
|
134
|
+
e.defaultValue,
|
|
135
|
+
E
|
|
136
|
+
),
|
|
137
|
+
setValueOnMove: I(
|
|
138
|
+
e.setValueOnMove,
|
|
139
|
+
l.setValueOnMove,
|
|
140
|
+
!1
|
|
141
|
+
),
|
|
142
|
+
labelElement: I(l.labelElement, null),
|
|
143
|
+
selectElement: I(l.selectElement, null),
|
|
144
|
+
listElement: I(l.listElement, null)
|
|
145
|
+
}), c = it(m, i, w, r);
|
|
146
|
+
return Z(
|
|
147
|
+
c,
|
|
148
|
+
() => J(c, ["value", "items"], (a) => {
|
|
149
|
+
if (a.value !== E || !a.items.length) return;
|
|
150
|
+
const g = a.items.find(
|
|
151
|
+
(P) => !P.disabled && P.value != null
|
|
152
|
+
);
|
|
153
|
+
(g == null ? void 0 : g.value) != null && c.setState("value", g.value);
|
|
154
|
+
})
|
|
155
|
+
), Z(
|
|
156
|
+
c,
|
|
157
|
+
() => J(c, ["mounted"], (a) => {
|
|
158
|
+
a.mounted || c.setState("activeId", m.activeId);
|
|
159
|
+
})
|
|
160
|
+
), Z(
|
|
161
|
+
c,
|
|
162
|
+
() => J(c, ["mounted", "items", "value"], (a) => {
|
|
163
|
+
if (o || a.mounted) return;
|
|
164
|
+
const g = tt(a.value), P = g[g.length - 1];
|
|
165
|
+
if (P == null) return;
|
|
166
|
+
const u = a.items.find(
|
|
167
|
+
(d) => !d.disabled && d.value === P
|
|
168
|
+
);
|
|
169
|
+
u && c.setState("activeId", u.id);
|
|
170
|
+
})
|
|
171
|
+
), Z(
|
|
172
|
+
c,
|
|
173
|
+
() => ct(c, ["setValueOnMove", "moves"], (a) => {
|
|
174
|
+
const { mounted: g, value: P, activeId: u } = c.getState();
|
|
175
|
+
if (!a.setValueOnMove && g || Array.isArray(P) || !a.moves || !u) return;
|
|
176
|
+
const d = i.item(u);
|
|
177
|
+
!d || d.disabled || d.value == null || c.setState("value", d.value);
|
|
178
|
+
})
|
|
179
|
+
), re(F(F(F({}, i), w), c), {
|
|
180
|
+
combobox: o,
|
|
181
|
+
setValue: (a) => c.setState("value", a),
|
|
182
|
+
setLabelElement: (a) => c.setState("labelElement", a),
|
|
183
|
+
setSelectElement: (a) => c.setState("selectElement", a),
|
|
184
|
+
setListElement: (a) => c.setState("listElement", a)
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
function xo(t) {
|
|
188
|
+
const n = xe();
|
|
189
|
+
return t = M(x({}, t), {
|
|
190
|
+
combobox: t.combobox !== void 0 ? t.combobox : n
|
|
191
|
+
}), st(t);
|
|
192
|
+
}
|
|
193
|
+
function wo(t, n, o) {
|
|
194
|
+
return Ie(n, [o.combobox]), me(t, o, "value", "setValue"), me(t, o, "setValueOnMove"), Object.assign(
|
|
195
|
+
nt(
|
|
196
|
+
lt(t, n, o),
|
|
197
|
+
n,
|
|
198
|
+
o
|
|
199
|
+
),
|
|
200
|
+
{ combobox: o.combobox }
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
function Po(t = {}) {
|
|
204
|
+
t = xo(t);
|
|
205
|
+
const [n, o] = dt(Co, t);
|
|
206
|
+
return wo(n, o, t);
|
|
207
|
+
}
|
|
208
|
+
var yo = "span", Eo = z(
|
|
209
|
+
function(n) {
|
|
210
|
+
var o = n, { store: e } = o, r = X(o, ["store"]);
|
|
211
|
+
const l = Ve();
|
|
212
|
+
return e = e || l, r = St(x({ store: e }, r)), r;
|
|
213
|
+
}
|
|
214
|
+
), Oo = W(function(n) {
|
|
215
|
+
const o = Eo(n);
|
|
216
|
+
return Q(yo, o);
|
|
217
|
+
}), Io = "button";
|
|
218
|
+
function Vo(t) {
|
|
219
|
+
return Array.from(t.selectedOptions).map((n) => n.value);
|
|
220
|
+
}
|
|
221
|
+
function Se(t, n) {
|
|
222
|
+
return () => {
|
|
223
|
+
const o = n();
|
|
224
|
+
if (!o) return;
|
|
225
|
+
let e = 0, r = t.item(o);
|
|
226
|
+
const l = r;
|
|
227
|
+
for (; r && r.value == null; ) {
|
|
228
|
+
const i = n(++e);
|
|
229
|
+
if (!i) return;
|
|
230
|
+
if (r = t.item(i), r === l) break;
|
|
231
|
+
}
|
|
232
|
+
return r == null ? void 0 : r.id;
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
var Ao = z(function(n) {
|
|
236
|
+
var o = n, {
|
|
237
|
+
store: e,
|
|
238
|
+
name: r,
|
|
239
|
+
form: l,
|
|
240
|
+
required: i,
|
|
241
|
+
showOnKeyDown: w = !0,
|
|
242
|
+
moveOnKeyDown: E = !0,
|
|
243
|
+
toggleOnPress: m = !0,
|
|
244
|
+
toggleOnClick: c = m
|
|
245
|
+
} = o, a = X(o, [
|
|
246
|
+
"store",
|
|
247
|
+
"name",
|
|
248
|
+
"form",
|
|
249
|
+
"required",
|
|
250
|
+
"showOnKeyDown",
|
|
251
|
+
"moveOnKeyDown",
|
|
252
|
+
"toggleOnPress",
|
|
253
|
+
"toggleOnClick"
|
|
254
|
+
]);
|
|
255
|
+
const g = Ae();
|
|
256
|
+
e = e || g, ae(
|
|
257
|
+
e,
|
|
258
|
+
process.env.NODE_ENV !== "production" && "Select must receive a `store` prop or be wrapped in a SelectProvider component."
|
|
259
|
+
);
|
|
260
|
+
const P = a.onKeyDown, u = $(w), d = $(E), S = e.useState("placement").split("-")[0], p = e.useState("value"), T = Array.isArray(p), A = te((v) => {
|
|
261
|
+
var b;
|
|
262
|
+
if (P == null || P(v), v.defaultPrevented || !e) return;
|
|
263
|
+
const { orientation: G, items: U, activeId: Y } = e.getState(), ie = G !== "horizontal", se = G !== "vertical", O = !!((b = U.find((be) => !be.disabled && be.value != null)) != null && b.rowId), de = {
|
|
264
|
+
ArrowUp: (O || ie) && Se(e, e.up),
|
|
265
|
+
ArrowRight: (O || se) && Se(e, e.next),
|
|
266
|
+
ArrowDown: (O || ie) && Se(e, e.down),
|
|
267
|
+
ArrowLeft: (O || se) && Se(e, e.previous)
|
|
268
|
+
}[v.key];
|
|
269
|
+
de && d(v) && (v.preventDefault(), e.move(de()));
|
|
270
|
+
const ve = S === "top" || S === "bottom";
|
|
271
|
+
({
|
|
272
|
+
ArrowDown: ve,
|
|
273
|
+
ArrowUp: ve,
|
|
274
|
+
ArrowLeft: S === "left",
|
|
275
|
+
ArrowRight: S === "right"
|
|
276
|
+
})[v.key] && u(v) && (v.preventDefault(), e.move(Y), Qe(v.currentTarget, "keyup", e.show));
|
|
277
|
+
});
|
|
278
|
+
a = pe(
|
|
279
|
+
a,
|
|
280
|
+
(v) => /* @__PURE__ */ N(Ye, { value: e, children: v }),
|
|
281
|
+
[e]
|
|
282
|
+
);
|
|
283
|
+
const [j, D] = fe(!1), y = oe(!1);
|
|
284
|
+
ne(() => {
|
|
285
|
+
const v = y.current;
|
|
286
|
+
y.current = !1, !v && D(!1);
|
|
287
|
+
}, [p]);
|
|
288
|
+
const R = e.useState((v) => {
|
|
289
|
+
var b;
|
|
290
|
+
return (b = v.labelElement) == null ? void 0 : b.id;
|
|
291
|
+
}), f = a["aria-label"], C = a["aria-labelledby"] || R, H = e.useState((v) => {
|
|
292
|
+
if (r)
|
|
293
|
+
return v.items;
|
|
294
|
+
}), B = Ce(() => [...new Set(H == null ? void 0 : H.map((v) => v.value).filter((v) => v != null))], [H]);
|
|
295
|
+
a = pe(
|
|
296
|
+
a,
|
|
297
|
+
(v) => r ? /* @__PURE__ */ Ee(He, { children: [
|
|
298
|
+
/* @__PURE__ */ Ee(
|
|
299
|
+
"select",
|
|
300
|
+
{
|
|
301
|
+
style: {
|
|
302
|
+
border: 0,
|
|
303
|
+
clip: "rect(0 0 0 0)",
|
|
304
|
+
height: "1px",
|
|
305
|
+
margin: "-1px",
|
|
306
|
+
overflow: "hidden",
|
|
307
|
+
padding: 0,
|
|
308
|
+
position: "absolute",
|
|
309
|
+
whiteSpace: "nowrap",
|
|
310
|
+
width: "1px"
|
|
311
|
+
},
|
|
312
|
+
tabIndex: -1,
|
|
313
|
+
"aria-hidden": !0,
|
|
314
|
+
"aria-label": f,
|
|
315
|
+
"aria-labelledby": C,
|
|
316
|
+
name: r,
|
|
317
|
+
form: l,
|
|
318
|
+
required: i,
|
|
319
|
+
disabled: a.disabled,
|
|
320
|
+
value: p,
|
|
321
|
+
multiple: T,
|
|
322
|
+
onFocus: () => {
|
|
323
|
+
var b;
|
|
324
|
+
return (b = e == null ? void 0 : e.getState().selectElement) == null ? void 0 : b.focus();
|
|
325
|
+
},
|
|
326
|
+
onChange: (b) => {
|
|
327
|
+
y.current = !0, D(!0), e == null || e.setValue(
|
|
328
|
+
T ? Vo(b.target) : b.target.value
|
|
329
|
+
);
|
|
330
|
+
},
|
|
331
|
+
children: [
|
|
332
|
+
tt(p).map((b) => b == null || B.includes(b) ? null : /* @__PURE__ */ N("option", { value: b, children: b }, b)),
|
|
333
|
+
B.map((b) => /* @__PURE__ */ N("option", { value: b, children: b }, b))
|
|
334
|
+
]
|
|
335
|
+
}
|
|
336
|
+
),
|
|
337
|
+
v
|
|
338
|
+
] }) : v,
|
|
339
|
+
[
|
|
340
|
+
e,
|
|
341
|
+
f,
|
|
342
|
+
C,
|
|
343
|
+
r,
|
|
344
|
+
l,
|
|
345
|
+
i,
|
|
346
|
+
p,
|
|
347
|
+
T,
|
|
348
|
+
B,
|
|
349
|
+
a.disabled
|
|
350
|
+
]
|
|
351
|
+
);
|
|
352
|
+
const L = /* @__PURE__ */ Ee(He, { children: [
|
|
353
|
+
p,
|
|
354
|
+
/* @__PURE__ */ N(Oo, {})
|
|
355
|
+
] }), ue = e.useState("contentElement");
|
|
356
|
+
return a = M(x({
|
|
357
|
+
role: "combobox",
|
|
358
|
+
"aria-autocomplete": "none",
|
|
359
|
+
"aria-labelledby": R,
|
|
360
|
+
"aria-haspopup": Ze(ue, "listbox"),
|
|
361
|
+
"data-autofill": j || void 0,
|
|
362
|
+
"data-name": r,
|
|
363
|
+
children: L
|
|
364
|
+
}, a), {
|
|
365
|
+
ref: he(e.setSelectElement, a.ref),
|
|
366
|
+
onKeyDown: A
|
|
367
|
+
}), a = eo(x({ store: e, toggleOnClick: c }, a)), a = et(x({ store: e }, a)), a;
|
|
368
|
+
}), En = W(function(n) {
|
|
369
|
+
const o = Ao(n);
|
|
370
|
+
return Q(Io, o);
|
|
371
|
+
});
|
|
372
|
+
function On(t = {}) {
|
|
373
|
+
const n = Po(t);
|
|
374
|
+
return /* @__PURE__ */ N(Qt, { value: n, children: t.children });
|
|
375
|
+
}
|
|
376
|
+
var Do = "div", Lo = z(
|
|
377
|
+
function(n) {
|
|
378
|
+
return n = co(n), n;
|
|
379
|
+
}
|
|
380
|
+
), In = W(function(n) {
|
|
381
|
+
const o = Lo(n);
|
|
382
|
+
return Q(Do, o);
|
|
383
|
+
}), ko = "div", _o = z(
|
|
384
|
+
function(n) {
|
|
385
|
+
return n = mo(n), n;
|
|
386
|
+
}
|
|
387
|
+
), Vn = W(function(n) {
|
|
388
|
+
const o = _o(n);
|
|
389
|
+
return Q(ko, o);
|
|
390
|
+
}), To = "div";
|
|
391
|
+
function Ko(t, n) {
|
|
392
|
+
if (n != null)
|
|
393
|
+
return t == null ? !1 : Array.isArray(t) ? t.includes(n) : t === n;
|
|
394
|
+
}
|
|
395
|
+
var Mo = z(
|
|
396
|
+
function(n) {
|
|
397
|
+
var o = n, {
|
|
398
|
+
store: e,
|
|
399
|
+
value: r,
|
|
400
|
+
getItem: l,
|
|
401
|
+
hideOnClick: i,
|
|
402
|
+
setValueOnClick: w = r != null,
|
|
403
|
+
preventScrollOnKeyDown: E = !0,
|
|
404
|
+
focusOnHover: m = !0
|
|
405
|
+
} = o, c = X(o, [
|
|
406
|
+
"store",
|
|
407
|
+
"value",
|
|
408
|
+
"getItem",
|
|
409
|
+
"hideOnClick",
|
|
410
|
+
"setValueOnClick",
|
|
411
|
+
"preventScrollOnKeyDown",
|
|
412
|
+
"focusOnHover"
|
|
413
|
+
]), a;
|
|
414
|
+
const g = Zt();
|
|
415
|
+
e = e || g, ae(
|
|
416
|
+
e,
|
|
417
|
+
process.env.NODE_ENV !== "production" && "SelectItem must be wrapped in a SelectList or SelectPopover component."
|
|
418
|
+
);
|
|
419
|
+
const P = ge(c.id), u = kt(c), { listElement: d, multiSelectable: V, selected: S, autoFocus: p } = uo(e, {
|
|
420
|
+
listElement: "listElement",
|
|
421
|
+
multiSelectable(f) {
|
|
422
|
+
return Array.isArray(f.value);
|
|
423
|
+
},
|
|
424
|
+
selected(f) {
|
|
425
|
+
return Ko(f.value, r);
|
|
426
|
+
},
|
|
427
|
+
autoFocus(f) {
|
|
428
|
+
return r == null || f.value == null || f.activeId !== P && (e != null && e.item(f.activeId)) ? !1 : Array.isArray(f.value) ? f.value[f.value.length - 1] === r : f.value === r;
|
|
429
|
+
}
|
|
430
|
+
}), T = Yt(
|
|
431
|
+
(f) => {
|
|
432
|
+
const C = M(x({}, f), {
|
|
433
|
+
value: u ? void 0 : r,
|
|
434
|
+
children: r
|
|
435
|
+
});
|
|
436
|
+
return l ? l(C) : C;
|
|
437
|
+
},
|
|
438
|
+
[u, r, l]
|
|
439
|
+
);
|
|
440
|
+
i = i ?? (r != null && !V);
|
|
441
|
+
const A = c.onClick, j = $(w), D = $(i), y = te((f) => {
|
|
442
|
+
A == null || A(f), !f.defaultPrevented && (_t(f) || Tt(f) || (j(f) && r != null && (e == null || e.setValue((C) => Array.isArray(C) ? C.includes(r) ? C.filter((H) => H !== r) : [...C, r] : r)), D(f) && (e == null || e.hide())));
|
|
443
|
+
});
|
|
444
|
+
c = pe(
|
|
445
|
+
c,
|
|
446
|
+
(f) => /* @__PURE__ */ N(Jt.Provider, { value: S ?? !1, children: f }),
|
|
447
|
+
[S]
|
|
448
|
+
), c = M(x({
|
|
449
|
+
id: P,
|
|
450
|
+
role: Kt(d),
|
|
451
|
+
"aria-selected": S,
|
|
452
|
+
children: r
|
|
453
|
+
}, c), {
|
|
454
|
+
autoFocus: (a = c.autoFocus) != null ? a : p,
|
|
455
|
+
onClick: y
|
|
456
|
+
}), c = Ue(x({
|
|
457
|
+
store: e,
|
|
458
|
+
getItem: T,
|
|
459
|
+
preventScrollOnKeyDown: E
|
|
460
|
+
}, c));
|
|
461
|
+
const R = $(m);
|
|
462
|
+
return c = fo(M(x({
|
|
463
|
+
store: e
|
|
464
|
+
}, c), {
|
|
465
|
+
// We have to disable focusOnHover when the popup is closed, otherwise
|
|
466
|
+
// the active item will change to null (the container) when the popup is
|
|
467
|
+
// closed by clicking on an item.
|
|
468
|
+
focusOnHover(f) {
|
|
469
|
+
if (!R(f)) return !1;
|
|
470
|
+
const C = e == null ? void 0 : e.getState();
|
|
471
|
+
return !!(C != null && C.open);
|
|
472
|
+
}
|
|
473
|
+
})), c;
|
|
474
|
+
}
|
|
475
|
+
), An = qe(
|
|
476
|
+
W(function(n) {
|
|
477
|
+
const o = Mo(n);
|
|
478
|
+
return Q(To, o);
|
|
479
|
+
})
|
|
480
|
+
), Fo = "div", $e = De(null), ht = z(
|
|
481
|
+
function(n) {
|
|
482
|
+
var o = n, {
|
|
483
|
+
store: e,
|
|
484
|
+
resetOnEscape: r = !0,
|
|
485
|
+
hideOnEnter: l = !0,
|
|
486
|
+
focusOnMove: i = !0,
|
|
487
|
+
composite: w,
|
|
488
|
+
alwaysVisible: E
|
|
489
|
+
} = o, m = X(o, [
|
|
490
|
+
"store",
|
|
491
|
+
"resetOnEscape",
|
|
492
|
+
"hideOnEnter",
|
|
493
|
+
"focusOnMove",
|
|
494
|
+
"composite",
|
|
495
|
+
"alwaysVisible"
|
|
496
|
+
]);
|
|
497
|
+
const c = Ve();
|
|
498
|
+
e = e || c, ae(
|
|
499
|
+
e,
|
|
500
|
+
process.env.NODE_ENV !== "production" && "SelectList must receive a `store` prop or be wrapped in a SelectProvider component."
|
|
501
|
+
);
|
|
502
|
+
const a = ge(m.id), g = e.useState("value"), P = Array.isArray(g), [u, d] = fe(g), V = e.useState("mounted");
|
|
503
|
+
ne(() => {
|
|
504
|
+
V || d(g);
|
|
505
|
+
}, [V, g]), r = r && !P;
|
|
506
|
+
const S = m.onKeyDown, p = $(r), T = $(l), A = te((O) => {
|
|
507
|
+
S == null || S(O), !O.defaultPrevented && (O.key === "Escape" && p(O) && (e == null || e.setValue(u)), (O.key === " " || O.key === "Enter") && Mt(O) && T(O) && (O.preventDefault(), e == null || e.hide()));
|
|
508
|
+
}), j = Re(Ne), D = fe(), [y, R] = j || D, f = Ce(
|
|
509
|
+
() => [y, R],
|
|
510
|
+
[y]
|
|
511
|
+
), [C, H] = fe(null), B = Re($e);
|
|
512
|
+
ne(() => {
|
|
513
|
+
if (B)
|
|
514
|
+
return B(e), () => B(null);
|
|
515
|
+
}, [B, e]), m = pe(
|
|
516
|
+
m,
|
|
517
|
+
(O) => /* @__PURE__ */ N(Ye, { value: e, children: /* @__PURE__ */ N($e.Provider, { value: H, children: /* @__PURE__ */ N(Ne.Provider, { value: f, children: O }) }) }),
|
|
518
|
+
[e, f]
|
|
519
|
+
);
|
|
520
|
+
const L = !!e.combobox;
|
|
521
|
+
w = w ?? (!L && C !== e);
|
|
522
|
+
const [ue, v] = Ft(
|
|
523
|
+
w ? e.setListElement : null
|
|
524
|
+
), b = Je(ue, "role", m.role), U = (w || (b === "listbox" || b === "menu" || b === "tree" || b === "grid")) && P || void 0, Y = ft(V, m.hidden, E), ie = Y ? M(x({}, m.style), { display: "none" }) : m.style;
|
|
525
|
+
w && (m = x({
|
|
526
|
+
role: "listbox",
|
|
527
|
+
"aria-multiselectable": U
|
|
528
|
+
}, m));
|
|
529
|
+
const se = e.useState(
|
|
530
|
+
(O) => {
|
|
531
|
+
var ce;
|
|
532
|
+
return y || ((ce = O.labelElement) == null ? void 0 : ce.id);
|
|
533
|
+
}
|
|
534
|
+
);
|
|
535
|
+
return m = M(x({
|
|
536
|
+
id: a,
|
|
537
|
+
"aria-labelledby": se,
|
|
538
|
+
hidden: Y
|
|
539
|
+
}, m), {
|
|
540
|
+
ref: he(v, m.ref),
|
|
541
|
+
style: ie,
|
|
542
|
+
onKeyDown: A
|
|
543
|
+
}), m = vt(M(x({ store: e }, m), { composite: w })), m = et(x({ store: e, typeahead: !L }, m)), m;
|
|
544
|
+
}
|
|
545
|
+
), Dn = W(function(n) {
|
|
546
|
+
const o = ht(n);
|
|
547
|
+
return Q(Fo, o);
|
|
548
|
+
}), No = "div", Ro = z(
|
|
549
|
+
function(n) {
|
|
550
|
+
var o = n, { store: e, alwaysVisible: r } = o, l = X(o, ["store", "alwaysVisible"]);
|
|
551
|
+
const i = Ae();
|
|
552
|
+
return e = e || i, l = ht(x({ store: e, alwaysVisible: r }, l)), l = bt(x({ store: e, alwaysVisible: r }, l)), l;
|
|
553
|
+
}
|
|
554
|
+
), Ln = pt(
|
|
555
|
+
W(function(n) {
|
|
556
|
+
const o = Ro(n);
|
|
557
|
+
return Q(No, o);
|
|
558
|
+
}),
|
|
559
|
+
Ae
|
|
560
|
+
);
|
|
561
|
+
function kn({
|
|
562
|
+
store: t,
|
|
563
|
+
fallback: n,
|
|
564
|
+
children: o
|
|
565
|
+
} = {}) {
|
|
566
|
+
const e = Ve();
|
|
567
|
+
t = t || e;
|
|
568
|
+
const r = mt(t, (l) => l != null && l.value.length ? l.value : n);
|
|
569
|
+
return o ? o(r || "") : r;
|
|
570
|
+
}
|
|
571
|
+
var _n = De(null), Tn = De(
|
|
572
|
+
null
|
|
573
|
+
), we = Nt(
|
|
574
|
+
[po],
|
|
575
|
+
[vo]
|
|
576
|
+
), Ho = we.useContext, Kn = we.useProviderContext, Mn = we.ContextProvider, Fn = we.ScopedContextProvider, Bo = Ht() && Bt();
|
|
577
|
+
function $o(t = {}) {
|
|
578
|
+
var n = t, {
|
|
579
|
+
tag: o
|
|
580
|
+
} = n, e = ze(n, [
|
|
581
|
+
"tag"
|
|
582
|
+
]);
|
|
583
|
+
const r = at(e.store, io(o, ["value", "rtl"]));
|
|
584
|
+
ut(e, r);
|
|
585
|
+
const l = o == null ? void 0 : o.getState(), i = r == null ? void 0 : r.getState(), w = I(
|
|
586
|
+
e.activeId,
|
|
587
|
+
i == null ? void 0 : i.activeId,
|
|
588
|
+
e.defaultActiveId,
|
|
589
|
+
null
|
|
590
|
+
), E = rt(re(F({}, e), {
|
|
591
|
+
activeId: w,
|
|
592
|
+
includesBaseElement: I(
|
|
593
|
+
e.includesBaseElement,
|
|
594
|
+
i == null ? void 0 : i.includesBaseElement,
|
|
595
|
+
!0
|
|
596
|
+
),
|
|
597
|
+
orientation: I(
|
|
598
|
+
e.orientation,
|
|
599
|
+
i == null ? void 0 : i.orientation,
|
|
600
|
+
"vertical"
|
|
601
|
+
),
|
|
602
|
+
focusLoop: I(e.focusLoop, i == null ? void 0 : i.focusLoop, !0),
|
|
603
|
+
focusWrap: I(e.focusWrap, i == null ? void 0 : i.focusWrap, !0),
|
|
604
|
+
virtualFocus: I(
|
|
605
|
+
e.virtualFocus,
|
|
606
|
+
i == null ? void 0 : i.virtualFocus,
|
|
607
|
+
!0
|
|
608
|
+
)
|
|
609
|
+
})), m = ot(re(F({}, e), {
|
|
610
|
+
placement: I(
|
|
611
|
+
e.placement,
|
|
612
|
+
i == null ? void 0 : i.placement,
|
|
613
|
+
"bottom-start"
|
|
614
|
+
)
|
|
615
|
+
})), c = I(
|
|
616
|
+
e.value,
|
|
617
|
+
i == null ? void 0 : i.value,
|
|
618
|
+
e.defaultValue,
|
|
619
|
+
""
|
|
620
|
+
), a = I(
|
|
621
|
+
e.selectedValue,
|
|
622
|
+
i == null ? void 0 : i.selectedValue,
|
|
623
|
+
l == null ? void 0 : l.values,
|
|
624
|
+
e.defaultSelectedValue,
|
|
625
|
+
""
|
|
626
|
+
), g = Array.isArray(a), P = re(F(F({}, E.getState()), m.getState()), {
|
|
627
|
+
value: c,
|
|
628
|
+
selectedValue: a,
|
|
629
|
+
resetValueOnSelect: I(
|
|
630
|
+
e.resetValueOnSelect,
|
|
631
|
+
i == null ? void 0 : i.resetValueOnSelect,
|
|
632
|
+
g
|
|
633
|
+
),
|
|
634
|
+
resetValueOnHide: I(
|
|
635
|
+
e.resetValueOnHide,
|
|
636
|
+
i == null ? void 0 : i.resetValueOnHide,
|
|
637
|
+
g && !o
|
|
638
|
+
),
|
|
639
|
+
activeValue: i == null ? void 0 : i.activeValue
|
|
640
|
+
}), u = it(P, E, m, r);
|
|
641
|
+
return Bo && Z(
|
|
642
|
+
u,
|
|
643
|
+
() => J(u, ["virtualFocus"], () => {
|
|
644
|
+
u.setState("virtualFocus", !1);
|
|
645
|
+
})
|
|
646
|
+
), Z(u, () => {
|
|
647
|
+
if (o)
|
|
648
|
+
return Rt(
|
|
649
|
+
J(u, ["selectedValue"], (d) => {
|
|
650
|
+
Array.isArray(d.selectedValue) && o.setValues(d.selectedValue);
|
|
651
|
+
}),
|
|
652
|
+
J(o, ["values"], (d) => {
|
|
653
|
+
u.setState("selectedValue", d.values);
|
|
654
|
+
})
|
|
655
|
+
);
|
|
656
|
+
}), Z(
|
|
657
|
+
u,
|
|
658
|
+
() => J(u, ["resetValueOnHide", "mounted"], (d) => {
|
|
659
|
+
d.resetValueOnHide && (d.mounted || u.setState("value", c));
|
|
660
|
+
})
|
|
661
|
+
), Z(
|
|
662
|
+
u,
|
|
663
|
+
() => J(u, ["open"], (d) => {
|
|
664
|
+
d.open || (u.setState("activeId", w), u.setState("moves", 0));
|
|
665
|
+
})
|
|
666
|
+
), Z(
|
|
667
|
+
u,
|
|
668
|
+
() => J(u, ["moves", "activeId"], (d, V) => {
|
|
669
|
+
d.moves === V.moves && u.setState("activeValue", void 0);
|
|
670
|
+
})
|
|
671
|
+
), Z(
|
|
672
|
+
u,
|
|
673
|
+
() => ct(u, ["moves", "renderedItems"], (d, V) => {
|
|
674
|
+
if (d.moves === V.moves) return;
|
|
675
|
+
const { activeId: S } = u.getState(), p = E.item(S);
|
|
676
|
+
u.setState("activeValue", p == null ? void 0 : p.value);
|
|
677
|
+
})
|
|
678
|
+
), re(F(F(F({}, m), E), u), {
|
|
679
|
+
tag: o,
|
|
680
|
+
setValue: (d) => u.setState("value", d),
|
|
681
|
+
resetValue: () => u.setState("value", P.value),
|
|
682
|
+
setSelectedValue: (d) => u.setState("selectedValue", d)
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
function jo(t) {
|
|
686
|
+
const n = Ho();
|
|
687
|
+
return t = M(x({}, t), {
|
|
688
|
+
tag: t.tag !== void 0 ? t.tag : n
|
|
689
|
+
}), st(t);
|
|
690
|
+
}
|
|
691
|
+
function Go(t, n, o) {
|
|
692
|
+
return Ie(n, [o.tag]), me(t, o, "value", "setValue"), me(t, o, "selectedValue", "setSelectedValue"), me(t, o, "resetValueOnHide"), me(t, o, "resetValueOnSelect"), Object.assign(
|
|
693
|
+
lt(
|
|
694
|
+
nt(t, n, o),
|
|
695
|
+
n,
|
|
696
|
+
o
|
|
697
|
+
),
|
|
698
|
+
{ tag: o.tag }
|
|
699
|
+
);
|
|
700
|
+
}
|
|
701
|
+
function Uo(t = {}) {
|
|
702
|
+
t = jo(t);
|
|
703
|
+
const [n, o] = dt($o, t);
|
|
704
|
+
return Go(n, o, t);
|
|
705
|
+
}
|
|
706
|
+
var qo = "input";
|
|
707
|
+
function je(t, n, o) {
|
|
708
|
+
if (!o) return !1;
|
|
709
|
+
const e = t.find((r) => !r.disabled && r.value);
|
|
710
|
+
return (e == null ? void 0 : e.value) === n;
|
|
711
|
+
}
|
|
712
|
+
function Ge(t, n) {
|
|
713
|
+
return !n || t == null ? !1 : (t = Wt(t), n.length > t.length && n.toLowerCase().indexOf(t.toLowerCase()) === 0);
|
|
714
|
+
}
|
|
715
|
+
function Wo(t) {
|
|
716
|
+
return t.type === "input";
|
|
717
|
+
}
|
|
718
|
+
function zo(t) {
|
|
719
|
+
return t === "inline" || t === "list" || t === "both" || t === "none";
|
|
720
|
+
}
|
|
721
|
+
function Qo(t) {
|
|
722
|
+
const n = t.find((o) => {
|
|
723
|
+
var e;
|
|
724
|
+
return o.disabled ? !1 : ((e = o.element) == null ? void 0 : e.getAttribute("role")) !== "tab";
|
|
725
|
+
});
|
|
726
|
+
return n == null ? void 0 : n.id;
|
|
727
|
+
}
|
|
728
|
+
var Zo = z(
|
|
729
|
+
function(n) {
|
|
730
|
+
var o = n, {
|
|
731
|
+
store: e,
|
|
732
|
+
focusable: r = !0,
|
|
733
|
+
autoSelect: l = !1,
|
|
734
|
+
getAutoSelectId: i,
|
|
735
|
+
setValueOnChange: w,
|
|
736
|
+
showMinLength: E = 0,
|
|
737
|
+
showOnChange: m,
|
|
738
|
+
showOnMouseDown: c,
|
|
739
|
+
showOnClick: a = c,
|
|
740
|
+
showOnKeyDown: g,
|
|
741
|
+
showOnKeyPress: P = g,
|
|
742
|
+
blurActiveItemOnClick: u,
|
|
743
|
+
setValueOnClick: d = !0,
|
|
744
|
+
moveOnKeyPress: V = !0,
|
|
745
|
+
autoComplete: S = "list"
|
|
746
|
+
} = o, p = X(o, [
|
|
747
|
+
"store",
|
|
748
|
+
"focusable",
|
|
749
|
+
"autoSelect",
|
|
750
|
+
"getAutoSelectId",
|
|
751
|
+
"setValueOnChange",
|
|
752
|
+
"showMinLength",
|
|
753
|
+
"showOnChange",
|
|
754
|
+
"showOnMouseDown",
|
|
755
|
+
"showOnClick",
|
|
756
|
+
"showOnKeyDown",
|
|
757
|
+
"showOnKeyPress",
|
|
758
|
+
"blurActiveItemOnClick",
|
|
759
|
+
"setValueOnClick",
|
|
760
|
+
"moveOnKeyPress",
|
|
761
|
+
"autoComplete"
|
|
762
|
+
]);
|
|
763
|
+
const T = xe();
|
|
764
|
+
e = e || T, ae(
|
|
765
|
+
e,
|
|
766
|
+
process.env.NODE_ENV !== "production" && "Combobox must receive a `store` prop or be wrapped in a ComboboxProvider component."
|
|
767
|
+
);
|
|
768
|
+
const A = oe(null), [j, D] = $t(), y = oe(!1), R = oe(!1), f = e.useState(
|
|
769
|
+
(s) => s.virtualFocus && l
|
|
770
|
+
), C = S === "inline" || S === "both", [H, B] = fe(C);
|
|
771
|
+
jt(() => {
|
|
772
|
+
C && B(!0);
|
|
773
|
+
}, [C]);
|
|
774
|
+
const L = e.useState("value"), ue = oe();
|
|
775
|
+
ne(() => J(e, ["selectedValue", "activeId"], (s, h) => {
|
|
776
|
+
ue.current = h.selectedValue;
|
|
777
|
+
}), []);
|
|
778
|
+
const v = e.useState((s) => {
|
|
779
|
+
var h;
|
|
780
|
+
if (C && H && !(s.activeValue && Array.isArray(s.selectedValue) && (s.selectedValue.includes(s.activeValue) || (h = ue.current) != null && h.includes(s.activeValue))))
|
|
781
|
+
return s.activeValue;
|
|
782
|
+
}), b = e.useState("renderedItems"), G = e.useState("open"), U = e.useState("contentElement"), Y = Ce(() => {
|
|
783
|
+
if (!C || !H) return L;
|
|
784
|
+
if (je(
|
|
785
|
+
b,
|
|
786
|
+
v,
|
|
787
|
+
f
|
|
788
|
+
)) {
|
|
789
|
+
if (Ge(L, v)) {
|
|
790
|
+
const h = (v == null ? void 0 : v.slice(L.length)) || "";
|
|
791
|
+
return L + h;
|
|
792
|
+
}
|
|
793
|
+
return L;
|
|
794
|
+
}
|
|
795
|
+
return v || L;
|
|
796
|
+
}, [C, H, b, v, f, L]);
|
|
797
|
+
ne(() => {
|
|
798
|
+
const s = A.current;
|
|
799
|
+
if (!s) return;
|
|
800
|
+
const h = () => B(!0);
|
|
801
|
+
return s.addEventListener("combobox-item-move", h), () => {
|
|
802
|
+
s.removeEventListener("combobox-item-move", h);
|
|
803
|
+
};
|
|
804
|
+
}, []), ne(() => {
|
|
805
|
+
if (!C || !H || !v || !je(
|
|
806
|
+
b,
|
|
807
|
+
v,
|
|
808
|
+
f
|
|
809
|
+
) || !Ge(L, v)) return;
|
|
810
|
+
let h = Gt;
|
|
811
|
+
return queueMicrotask(() => {
|
|
812
|
+
const k = A.current;
|
|
813
|
+
if (!k) return;
|
|
814
|
+
const { start: _, end: q } = Fe(k), ee = L.length, K = v.length;
|
|
815
|
+
ye(k, ee, K), h = () => {
|
|
816
|
+
if (!Be(k)) return;
|
|
817
|
+
const { start: le, end: Dt } = Fe(k);
|
|
818
|
+
le === ee && Dt === K && ye(k, _, q);
|
|
819
|
+
};
|
|
820
|
+
}), () => h();
|
|
821
|
+
}, [
|
|
822
|
+
j,
|
|
823
|
+
C,
|
|
824
|
+
H,
|
|
825
|
+
v,
|
|
826
|
+
b,
|
|
827
|
+
f,
|
|
828
|
+
L
|
|
829
|
+
]);
|
|
830
|
+
const ie = oe(null), se = te(i), O = oe(null);
|
|
831
|
+
ne(() => {
|
|
832
|
+
if (!G || !U) return;
|
|
833
|
+
const s = Ut(U);
|
|
834
|
+
if (!s) return;
|
|
835
|
+
ie.current = s;
|
|
836
|
+
const h = () => {
|
|
837
|
+
y.current = !1;
|
|
838
|
+
}, k = () => {
|
|
839
|
+
if (!e || !y.current) return;
|
|
840
|
+
const { activeId: q } = e.getState();
|
|
841
|
+
q !== null && q !== O.current && (y.current = !1);
|
|
842
|
+
}, _ = { passive: !0, capture: !0 };
|
|
843
|
+
return s.addEventListener("wheel", h, _), s.addEventListener("touchmove", h, _), s.addEventListener("scroll", k, _), () => {
|
|
844
|
+
s.removeEventListener("wheel", h, !0), s.removeEventListener("touchmove", h, !0), s.removeEventListener("scroll", k, !0);
|
|
845
|
+
};
|
|
846
|
+
}, [G, U, e]), Oe(() => {
|
|
847
|
+
L && (R.current || (y.current = !0));
|
|
848
|
+
}, [L]), Oe(() => {
|
|
849
|
+
f !== "always" && G || (y.current = G);
|
|
850
|
+
}, [f, G]);
|
|
851
|
+
const ce = e.useState("resetValueOnSelect");
|
|
852
|
+
Ie(() => {
|
|
853
|
+
var s, h;
|
|
854
|
+
const k = y.current;
|
|
855
|
+
if (!e || !G || !k && !ce) return;
|
|
856
|
+
const { baseElement: _, contentElement: q, activeId: ee } = e.getState();
|
|
857
|
+
if (!(_ && !Be(_))) {
|
|
858
|
+
if (q != null && q.hasAttribute("data-placing")) {
|
|
859
|
+
const K = new MutationObserver(D);
|
|
860
|
+
return K.observe(q, { attributeFilter: ["data-placing"] }), () => K.disconnect();
|
|
861
|
+
}
|
|
862
|
+
if (f && k) {
|
|
863
|
+
const K = se(b), le = K !== void 0 ? K : (s = Qo(b)) != null ? s : e.first();
|
|
864
|
+
O.current = le, e.move(le ?? null);
|
|
865
|
+
} else {
|
|
866
|
+
const K = (h = e.item(ee || e.first())) == null ? void 0 : h.element;
|
|
867
|
+
K && "scrollIntoView" in K && K.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
}, [
|
|
871
|
+
e,
|
|
872
|
+
G,
|
|
873
|
+
j,
|
|
874
|
+
L,
|
|
875
|
+
f,
|
|
876
|
+
ce,
|
|
877
|
+
se,
|
|
878
|
+
b
|
|
879
|
+
]), ne(() => {
|
|
880
|
+
if (!C) return;
|
|
881
|
+
const s = A.current;
|
|
882
|
+
if (!s) return;
|
|
883
|
+
const h = [s, U].filter(
|
|
884
|
+
(_) => !!_
|
|
885
|
+
), k = (_) => {
|
|
886
|
+
h.every((q) => qt(_, q)) && (e == null || e.setValue(Y));
|
|
887
|
+
};
|
|
888
|
+
for (const _ of h)
|
|
889
|
+
_.addEventListener("focusout", k);
|
|
890
|
+
return () => {
|
|
891
|
+
for (const _ of h)
|
|
892
|
+
_.removeEventListener("focusout", k);
|
|
893
|
+
};
|
|
894
|
+
}, [C, U, e, Y]);
|
|
895
|
+
const de = (s) => s.currentTarget.value.length >= E, ve = p.onChange, Le = $(m ?? de), ke = $(
|
|
896
|
+
// If the combobox is combined with tags, the value will be set by the tag
|
|
897
|
+
// input component.
|
|
898
|
+
w ?? !e.tag
|
|
899
|
+
), _e = te((s) => {
|
|
900
|
+
if (ve == null || ve(s), s.defaultPrevented || !e) return;
|
|
901
|
+
const h = s.currentTarget, { value: k, selectionStart: _, selectionEnd: q } = h, ee = s.nativeEvent;
|
|
902
|
+
if (y.current = !0, Wo(ee) && (ee.isComposing && (y.current = !1, R.current = !0), C)) {
|
|
903
|
+
const K = ee.inputType === "insertText" || ee.inputType === "insertCompositionText", le = _ === k.length;
|
|
904
|
+
B(K && le);
|
|
905
|
+
}
|
|
906
|
+
if (ke(s)) {
|
|
907
|
+
const K = k === e.getState().value;
|
|
908
|
+
e.setValue(k), queueMicrotask(() => {
|
|
909
|
+
ye(h, _, q);
|
|
910
|
+
}), C && f && K && D();
|
|
911
|
+
}
|
|
912
|
+
Le(s) && e.show(), (!f || !y.current) && e.setActiveId(null);
|
|
913
|
+
}), Pe = p.onCompositionEnd, be = te((s) => {
|
|
914
|
+
y.current = !0, R.current = !1, Pe == null || Pe(s), !s.defaultPrevented && f && D();
|
|
915
|
+
}), Te = p.onMouseDown, Ct = $(
|
|
916
|
+
u ?? (() => !!(e != null && e.getState().includesBaseElement))
|
|
917
|
+
), xt = $(d), wt = $(a ?? de), Pt = te((s) => {
|
|
918
|
+
Te == null || Te(s), !s.defaultPrevented && (s.button || s.ctrlKey || e && (Ct(s) && e.setActiveId(null), xt(s) && e.setValue(Y), wt(s) && Qe(s.currentTarget, "mouseup", e.show)));
|
|
919
|
+
}), Ke = p.onKeyDown, yt = $(P ?? de), Et = te((s) => {
|
|
920
|
+
if (Ke == null || Ke(s), s.repeat || (y.current = !1), s.defaultPrevented || s.ctrlKey || s.altKey || s.shiftKey || s.metaKey || !e) return;
|
|
921
|
+
const { open: h } = e.getState();
|
|
922
|
+
h || (s.key === "ArrowUp" || s.key === "ArrowDown") && yt(s) && (s.preventDefault(), e.show());
|
|
923
|
+
}), Me = p.onBlur, Ot = te((s) => {
|
|
924
|
+
y.current = !1, Me == null || Me(s), s.defaultPrevented;
|
|
925
|
+
}), It = ge(p.id), Vt = zo(S) ? S : void 0, At = e.useState((s) => s.activeId === null);
|
|
926
|
+
return p = M(x({
|
|
927
|
+
id: It,
|
|
928
|
+
role: "combobox",
|
|
929
|
+
"aria-autocomplete": Vt,
|
|
930
|
+
"aria-haspopup": Ze(U, "listbox"),
|
|
931
|
+
"aria-expanded": G,
|
|
932
|
+
"aria-controls": U == null ? void 0 : U.id,
|
|
933
|
+
"data-active-item": At || void 0,
|
|
934
|
+
value: Y
|
|
935
|
+
}, p), {
|
|
936
|
+
ref: he(A, p.ref),
|
|
937
|
+
onChange: _e,
|
|
938
|
+
onCompositionEnd: be,
|
|
939
|
+
onMouseDown: Pt,
|
|
940
|
+
onKeyDown: Et,
|
|
941
|
+
onBlur: Ot
|
|
942
|
+
}), p = vt(M(x({
|
|
943
|
+
store: e,
|
|
944
|
+
focusable: r
|
|
945
|
+
}, p), {
|
|
946
|
+
// Enable inline autocomplete when the user moves from the combobox input
|
|
947
|
+
// to an item.
|
|
948
|
+
moveOnKeyPress: (s) => Xe(V, s) ? !1 : (C && B(!0), !0)
|
|
949
|
+
})), p = to(x({ store: e }, p)), x({ autoComplete: "off" }, p);
|
|
950
|
+
}
|
|
951
|
+
), Nn = W(function(n) {
|
|
952
|
+
const o = Zo(n);
|
|
953
|
+
return Q(qo, o);
|
|
954
|
+
});
|
|
955
|
+
function Rn(t = {}) {
|
|
956
|
+
const n = Uo(t);
|
|
957
|
+
return /* @__PURE__ */ N(oo, { value: n, children: t.children });
|
|
958
|
+
}
|
|
959
|
+
var Jo = "div", gt = z(
|
|
960
|
+
function(n) {
|
|
961
|
+
var o = n, { store: e, alwaysVisible: r } = o, l = X(o, ["store", "alwaysVisible"]);
|
|
962
|
+
const i = no(!0), w = ro();
|
|
963
|
+
e = e || w;
|
|
964
|
+
const E = !!e && e === i;
|
|
965
|
+
ae(
|
|
966
|
+
e,
|
|
967
|
+
process.env.NODE_ENV !== "production" && "ComboboxList must receive a `store` prop or be wrapped in a ComboboxProvider component."
|
|
968
|
+
);
|
|
969
|
+
const m = oe(null), c = ge(l.id), a = e.useState("mounted"), g = ft(a, l.hidden, r), P = g ? M(x({}, l.style), { display: "none" }) : l.style, u = e.useState(
|
|
970
|
+
(D) => Array.isArray(D.selectedValue)
|
|
971
|
+
), d = Je(m, "role", l.role), S = (d === "listbox" || d === "tree" || d === "grid") && u || void 0, [p, T] = fe(!1), A = e.useState("contentElement");
|
|
972
|
+
Oe(() => {
|
|
973
|
+
if (!a) return;
|
|
974
|
+
const D = m.current;
|
|
975
|
+
if (!D || A !== D) return;
|
|
976
|
+
const y = () => {
|
|
977
|
+
T(!!D.querySelector("[role='listbox']"));
|
|
978
|
+
}, R = new MutationObserver(y);
|
|
979
|
+
return R.observe(D, {
|
|
980
|
+
subtree: !0,
|
|
981
|
+
childList: !0,
|
|
982
|
+
attributeFilter: ["role"]
|
|
983
|
+
}), y(), () => R.disconnect();
|
|
984
|
+
}, [a, A]), p || (l = x({
|
|
985
|
+
role: "listbox",
|
|
986
|
+
"aria-multiselectable": S
|
|
987
|
+
}, l)), l = pe(
|
|
988
|
+
l,
|
|
989
|
+
(D) => /* @__PURE__ */ N(so, { value: e, children: /* @__PURE__ */ N(lo.Provider, { value: d, children: D }) }),
|
|
990
|
+
[e, d]
|
|
991
|
+
);
|
|
992
|
+
const j = c && (!i || !E) ? e.setContentElement : null;
|
|
993
|
+
return l = M(x({
|
|
994
|
+
id: c,
|
|
995
|
+
hidden: g
|
|
996
|
+
}, l), {
|
|
997
|
+
ref: he(j, m, l.ref),
|
|
998
|
+
style: P
|
|
999
|
+
}), We(l);
|
|
1000
|
+
}
|
|
1001
|
+
), Hn = W(function(n) {
|
|
1002
|
+
const o = gt(n);
|
|
1003
|
+
return Q(Jo, o);
|
|
1004
|
+
}), Xo = "div";
|
|
1005
|
+
function Yo(t, ...n) {
|
|
1006
|
+
if (!t) return !1;
|
|
1007
|
+
if ("id" in t) {
|
|
1008
|
+
const o = n.filter(Boolean).map((e) => `[aria-controls~="${e}"]`).join(", ");
|
|
1009
|
+
return o ? t.matches(o) : !1;
|
|
1010
|
+
}
|
|
1011
|
+
return !1;
|
|
1012
|
+
}
|
|
1013
|
+
var en = z(
|
|
1014
|
+
function(n) {
|
|
1015
|
+
var o = n, {
|
|
1016
|
+
store: e,
|
|
1017
|
+
modal: r,
|
|
1018
|
+
tabIndex: l,
|
|
1019
|
+
alwaysVisible: i,
|
|
1020
|
+
autoFocusOnHide: w = !0,
|
|
1021
|
+
hideOnInteractOutside: E = !0
|
|
1022
|
+
} = o, m = X(o, [
|
|
1023
|
+
"store",
|
|
1024
|
+
"modal",
|
|
1025
|
+
"tabIndex",
|
|
1026
|
+
"alwaysVisible",
|
|
1027
|
+
"autoFocusOnHide",
|
|
1028
|
+
"hideOnInteractOutside"
|
|
1029
|
+
]);
|
|
1030
|
+
const c = xe();
|
|
1031
|
+
e = e || c, ae(
|
|
1032
|
+
e,
|
|
1033
|
+
process.env.NODE_ENV !== "production" && "ComboboxPopover must receive a `store` prop or be wrapped in a ComboboxProvider component."
|
|
1034
|
+
);
|
|
1035
|
+
const a = e.useState("baseElement"), g = oe(!1), P = mt(
|
|
1036
|
+
e.tag,
|
|
1037
|
+
(u) => u == null ? void 0 : u.renderedItems.length
|
|
1038
|
+
);
|
|
1039
|
+
return m = gt(x({ store: e, alwaysVisible: i }, m)), m = bt(M(x({
|
|
1040
|
+
store: e,
|
|
1041
|
+
modal: r,
|
|
1042
|
+
alwaysVisible: i,
|
|
1043
|
+
backdrop: !1,
|
|
1044
|
+
autoFocusOnShow: !1,
|
|
1045
|
+
finalFocus: a,
|
|
1046
|
+
preserveTabOrderAnchor: null,
|
|
1047
|
+
unstable_treeSnapshotKey: P
|
|
1048
|
+
}, m), {
|
|
1049
|
+
// When the combobox popover is modal, we make sure to include the
|
|
1050
|
+
// combobox input and all the combobox controls (cancel, disclosure) in
|
|
1051
|
+
// the list of persistent elements so they make part of the modal context,
|
|
1052
|
+
// allowing users to tab through them.
|
|
1053
|
+
getPersistentElements() {
|
|
1054
|
+
var u;
|
|
1055
|
+
const d = ((u = m.getPersistentElements) == null ? void 0 : u.call(m)) || [];
|
|
1056
|
+
if (!r || !e) return d;
|
|
1057
|
+
const { contentElement: V, baseElement: S } = e.getState();
|
|
1058
|
+
if (!S) return d;
|
|
1059
|
+
const p = zt(S), T = [];
|
|
1060
|
+
if (V != null && V.id && T.push(`[aria-controls~="${V.id}"]`), S != null && S.id && T.push(`[aria-controls~="${S.id}"]`), !T.length) return [...d, S];
|
|
1061
|
+
const A = T.join(","), j = p.querySelectorAll(A);
|
|
1062
|
+
return [...d, ...j];
|
|
1063
|
+
},
|
|
1064
|
+
// The combobox popover should focus on the combobox input when it hides,
|
|
1065
|
+
// unless the event was triggered by a click outside the popover, in which
|
|
1066
|
+
// case the input shouldn't be re-focused.
|
|
1067
|
+
autoFocusOnHide(u) {
|
|
1068
|
+
return Xe(w, u) ? !1 : g.current ? (g.current = !1, !1) : !0;
|
|
1069
|
+
},
|
|
1070
|
+
// Make sure we don't hide the popover when the user interacts with the
|
|
1071
|
+
// combobox cancel or the combobox disclosure buttons. They will have the
|
|
1072
|
+
// aria-controls attribute pointing to either the combobox input or the
|
|
1073
|
+
// combobox popover elements.
|
|
1074
|
+
hideOnInteractOutside(u) {
|
|
1075
|
+
var d, V;
|
|
1076
|
+
const S = e == null ? void 0 : e.getState(), p = (d = S == null ? void 0 : S.contentElement) == null ? void 0 : d.id, T = (V = S == null ? void 0 : S.baseElement) == null ? void 0 : V.id;
|
|
1077
|
+
if (Yo(u.target, p, T)) return !1;
|
|
1078
|
+
const A = typeof E == "function" ? E(u) : E;
|
|
1079
|
+
return A && (g.current = u.type === "click"), A;
|
|
1080
|
+
}
|
|
1081
|
+
})), m;
|
|
1082
|
+
}
|
|
1083
|
+
), Bn = pt(
|
|
1084
|
+
W(function(n) {
|
|
1085
|
+
const o = en(n);
|
|
1086
|
+
return Q(Xo, o);
|
|
1087
|
+
}),
|
|
1088
|
+
xe
|
|
1089
|
+
);
|
|
1090
|
+
export {
|
|
1091
|
+
Rn as C,
|
|
1092
|
+
yn as P,
|
|
1093
|
+
En as S,
|
|
1094
|
+
_n as T,
|
|
1095
|
+
Nn as a,
|
|
1096
|
+
Bn as b,
|
|
1097
|
+
Tn as c,
|
|
1098
|
+
Kn as d,
|
|
1099
|
+
Fn as e,
|
|
1100
|
+
Mn as f,
|
|
1101
|
+
So as g,
|
|
1102
|
+
St as h,
|
|
1103
|
+
Hn as i,
|
|
1104
|
+
Oo as j,
|
|
1105
|
+
Vn as k,
|
|
1106
|
+
In as l,
|
|
1107
|
+
An as m,
|
|
1108
|
+
Dn as n,
|
|
1109
|
+
Ln as o,
|
|
1110
|
+
On as p,
|
|
1111
|
+
kn as q,
|
|
1112
|
+
Pn as r,
|
|
1113
|
+
Uo as s,
|
|
1114
|
+
Po as t,
|
|
1115
|
+
Ho as u
|
|
1116
|
+
};
|