@ryuzaki13/react-foundation-ui 1.5.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/advanced-search/index.js +4 -4
- package/dist/base-table/index.js +1 -1
- package/dist/chunks/CalendarView-Cfih7hjD.js +439 -0
- package/dist/chunks/{CalendarView-DtacoN_c.js.map → CalendarView-Cfih7hjD.js.map} +1 -1
- package/dist/chunks/CheckBox.module-C5SjPwSj.js.map +1 -1
- package/dist/chunks/{TextEditorLexicalClient-DVML-Nhd.js → TextEditorLexicalClient-BSafrkLJ.js} +241 -275
- package/dist/chunks/TextEditorLexicalClient-BSafrkLJ.js.map +1 -0
- package/dist/chunks/{base-table-BPcdSitC.js → base-table-X7aSSjXa.js} +2 -2
- package/dist/chunks/{base-table-BPcdSitC.js.map → base-table-X7aSSjXa.js.map} +1 -1
- package/dist/chunks/{context-menu-BY4pYGwB.js → context-menu-tcD3kVAc.js} +58 -62
- package/dist/chunks/context-menu-tcD3kVAc.js.map +1 -0
- package/dist/chunks/date-input-Bsl9dxxY.js +341 -0
- package/dist/chunks/date-input-Bsl9dxxY.js.map +1 -0
- package/dist/chunks/{input-BWCaVC06.js → input-CAw1Loze.js} +54 -47
- package/dist/chunks/input-CAw1Loze.js.map +1 -0
- package/dist/chunks/{input-files-62qH2TMj.js → input-files-CLtQ7p8j.js} +2 -2
- package/dist/chunks/{input-files-62qH2TMj.js.map → input-files-CLtQ7p8j.js.map} +1 -1
- package/dist/chunks/{input-search-CdPI1cb6.js → input-search-F6MPrUGF.js} +2 -2
- package/dist/chunks/{input-search-CdPI1cb6.js.map → input-search-F6MPrUGF.js.map} +1 -1
- package/dist/chunks/modal-DPIXoMkB.js.map +1 -1
- package/dist/chunks/{multi-select-01xmD1nZ.js → multi-select-CZPB8H6v.js} +61 -60
- package/dist/chunks/multi-select-CZPB8H6v.js.map +1 -0
- package/dist/chunks/{picker-Mdb73_uW.js → picker-TYLwgl1c.js} +82 -92
- package/dist/chunks/{picker-Mdb73_uW.js.map → picker-TYLwgl1c.js.map} +1 -1
- package/dist/chunks/{select-DRf4_a1Z.js → select-BwbljzU9.js} +35 -34
- package/dist/chunks/select-BwbljzU9.js.map +1 -0
- package/dist/chunks/{table-DSg9gi_l.js → table-DihiNNJt.js} +2 -2
- package/dist/chunks/{table-DSg9gi_l.js.map → table-DihiNNJt.js.map} +1 -1
- package/dist/chunks/types-CxXyru6U.js.map +1 -1
- package/dist/chunks/{useODataSelectBase-DI_wwKgw.js → useODataSelectBase-Bfljwe39.js} +16 -24
- package/dist/chunks/{useODataSelectBase-DI_wwKgw.js.map → useODataSelectBase-Bfljwe39.js.map} +1 -1
- package/dist/context-menu/components/MenuRoot.d.ts.map +1 -1
- package/dist/context-menu/index.js +1 -1
- package/dist/date-input/index.js +2 -2
- package/dist/date-input/lib/dateInputValue.d.ts +2 -6
- package/dist/date-input/lib/dateInputValue.d.ts.map +1 -1
- package/dist/date-input/lib/types.d.ts +0 -4
- package/dist/date-input/lib/types.d.ts.map +1 -1
- package/dist/date-input/model/useDateInput.d.ts +2 -2
- package/dist/date-input/model/useDateInput.d.ts.map +1 -1
- package/dist/date-input/ui/CalendarView.d.ts.map +1 -1
- package/dist/date-input/ui/DateInput.d.ts +0 -4
- package/dist/date-input/ui/DateInput.d.ts.map +1 -1
- package/dist/date-time-input/index.js +229 -234
- package/dist/date-time-input/index.js.map +1 -1
- package/dist/date-time-input/model/useDateTimeSegments.d.ts.map +1 -1
- package/dist/date-time-input/ui/SingleDateTimeInput.d.ts.map +1 -1
- package/dist/disclosure/index.js.map +1 -1
- package/dist/drop-zone/index.js +1 -1
- package/dist/image/index.js +2 -2
- package/dist/input/Input.d.ts.map +1 -1
- package/dist/input/index.js +1 -1
- package/dist/input-date-time/index.js +1 -1
- package/dist/input-file/index.js +1 -1
- package/dist/input-files/index.js +1 -1
- package/dist/input-image/index.js +1 -1
- package/dist/input-search/index.js +1 -1
- package/dist/layout-picker/index.js +1 -1
- package/dist/list/List.d.ts.map +1 -1
- package/dist/list/index.js +74 -45
- package/dist/list/index.js.map +1 -1
- package/dist/list/useListVirtualizer.d.ts +13 -0
- package/dist/list/useListVirtualizer.d.ts.map +1 -0
- package/dist/multi-select/index.js +1 -1
- package/dist/multi-select/ui/MultiSelect.d.ts.map +1 -1
- package/dist/picker/index.js +1 -1
- package/dist/picker/model/usePickerQuery.d.ts +6 -2
- package/dist/picker/model/usePickerQuery.d.ts.map +1 -1
- package/dist/picker/model/usePickerSelectionLifecycle.d.ts.map +1 -1
- package/dist/preset-range-date-input/index.js +1 -1
- package/dist/preset-select/index.js +1 -1
- package/dist/select/Select.d.ts.map +1 -1
- package/dist/select/index.js +1 -1
- package/dist/simple-table/index.js +1 -1
- package/dist/slider/SliderInput.d.ts.map +1 -1
- package/dist/slider/index.js +333 -290
- package/dist/slider/index.js.map +1 -1
- package/dist/state-select/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/table/index.js +1 -1
- package/dist/table-sorting/index.js +1 -1
- package/dist/tabs/index.js.map +1 -1
- package/dist/tag-input/TagInput.d.ts.map +1 -1
- package/dist/tag-input/index.js +1 -1
- package/dist/tag-input/index.js.map +1 -1
- package/dist/text-editor/EmailDialog.d.ts +1 -2
- package/dist/text-editor/EmailDialog.d.ts.map +1 -1
- package/dist/text-editor/LinkDialog.d.ts +1 -2
- package/dist/text-editor/LinkDialog.d.ts.map +1 -1
- package/dist/text-editor/PhoneDialog.d.ts +1 -2
- package/dist/text-editor/PhoneDialog.d.ts.map +1 -1
- package/dist/text-editor/SemanticDialog.d.ts +1 -2
- package/dist/text-editor/SemanticDialog.d.ts.map +1 -1
- package/dist/text-editor/TextEditorDialogs.d.ts +2 -1
- package/dist/text-editor/TextEditorDialogs.d.ts.map +1 -1
- package/dist/text-editor/TimeDialog.d.ts +1 -2
- package/dist/text-editor/TimeDialog.d.ts.map +1 -1
- package/dist/text-editor/index.js +1 -1
- package/dist/text-editor/nodes/AccessibleLinkNode.d.ts.map +1 -1
- package/dist/text-editor/nodes/SemanticTagNode.d.ts.map +1 -1
- package/dist/text-editor/toolbar/types.d.ts.map +1 -1
- package/dist/textarea/index.js +1 -1
- package/dist/tree-select/TreePickerBase.d.ts.map +1 -1
- package/dist/tree-select/index.js +244 -249
- package/dist/tree-select/index.js.map +1 -1
- package/dist/tree-table/index.js +1 -1
- package/package.json +1 -1
- package/storybook-static/assets/{Badge-CblO4qSx.js → Badge-DdvnnE8F.js} +1 -1
- package/storybook-static/assets/{Badge.stories-CtRrqjAo.js → Badge.stories-BUKUom98.js} +1 -1
- package/storybook-static/assets/{Button-Bzc9jBAF.js → Button-CghMveZ5.js} +1 -1
- package/storybook-static/assets/{Button-BVt4jmN4.js → Button-Co_JCRHU.js} +1 -1
- package/storybook-static/assets/{Button.stories-tqfxm0ox.js → Button.stories-CGj8XyOO.js} +1 -1
- package/storybook-static/assets/{CalendarView-MkrPd5D-.js → CalendarView-CaphwAt-.js} +1 -1
- package/storybook-static/assets/{CheckBox-0BK2dgdD.js → CheckBox-BQcaUjLx.js} +1 -1
- package/storybook-static/assets/{CheckBox-CWipX4CI.js → CheckBox-DAffOBou.js} +1 -1
- package/storybook-static/assets/CheckBox-Dw4nDCv8.css +1 -0
- package/storybook-static/assets/{CheckBox.stories-B5yWzlQa.js → CheckBox.stories-D_pMeQfu.js} +1 -1
- package/storybook-static/assets/{Color-6AOWCN3U-WdTzF_2p.js → Color-6AOWCN3U--6e3-dEn.js} +1 -1
- package/storybook-static/assets/{ContextMenu-kbSWsoCE.js → ContextMenu-CCuLOUEi.js} +1 -1
- package/storybook-static/assets/ContextMenu-CCwVy2bU.js +1 -0
- package/storybook-static/assets/{ContextMenu.stories-CQcrX3sj.js → ContextMenu.stories-DvArgxXF.js} +1 -1
- package/storybook-static/assets/{DateInput-CyNIW9Md.js → DateInput-2WtbeZR7.js} +1 -1
- package/storybook-static/assets/DateInput-DNJ3WoMQ.js +1 -0
- package/storybook-static/assets/{DateInput.stories-DyB3PjTl.js → DateInput.stories-v5ti6IEo.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect-CBZ0OAmn.js → DateRangePresetSelect-CPxgZfAB.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect-BwibZk_q.js → DateRangePresetSelect-q30Gumdf.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect.stories-kmmKl-3j.js → DateRangePresetSelect.stories-DdOS7cEa.js} +1 -1
- package/storybook-static/assets/{Detail-pHBZ5bkR.js → Detail-DIuLwIa1.js} +1 -1
- package/storybook-static/assets/{Detail.stories-Bs5YNmLn.js → Detail.stories-D3P1LkKH.js} +1 -1
- package/storybook-static/assets/{Dialog-DbFhCtF1.js → Dialog-zOHAVMnY.js} +1 -1
- package/storybook-static/assets/{Dialog-DBTU-LRR.js → Dialog-zxssjiyA.js} +1 -1
- package/storybook-static/assets/{Dialog.stories-_WQW8YNs.js → Dialog.stories-CPdleZZG.js} +1 -1
- package/storybook-static/assets/{Disclosure-vOJWmhLt.js → Disclosure-X-fwyTOO.js} +1 -1
- package/storybook-static/assets/{Disclosure.stories-wyulIOoJ.js → Disclosure.stories-DhBj8XEl.js} +1 -1
- package/storybook-static/assets/{DisclosureGroup-DjObX5Qs.css → DisclosureGroup-CNoH2D1R.css} +1 -1
- package/storybook-static/assets/{DisclosureGroup-BUDxwl5C.js → DisclosureGroup-COBTA8iF.js} +1 -1
- package/storybook-static/assets/{DocsRenderer-JROSPFPF-B7vhvrpB.js → DocsRenderer-JROSPFPF-DBKu16F9.js} +1 -1
- package/storybook-static/assets/{DropZone-BvRT0gUm.js → DropZone-BxSCEj48.js} +1 -1
- package/storybook-static/assets/{DropZone-B7Q1qQqP.js → DropZone-C8pMmwdl.js} +1 -1
- package/storybook-static/assets/{DropZone.stories-WmoR3uPj.js → DropZone.stories-BCAhhItK.js} +1 -1
- package/storybook-static/assets/{DropdownMenu-BW35W6_U.js → DropdownMenu-Bi3Tiwls.js} +1 -1
- package/storybook-static/assets/{ExpandableActionPanel-C9G9PsZx.js → ExpandableActionPanel-CBwWx_Nv.js} +1 -1
- package/storybook-static/assets/{ExpandableActionPanel.stories-Dllpmeu_.js → ExpandableActionPanel.stories-BkYsUqoo.js} +1 -1
- package/storybook-static/assets/{Flex-Cydb-4MR.js → Flex-CO947dLM.js} +1 -1
- package/storybook-static/assets/{Flex.stories-Dczj9g4W.js → Flex.stories-DMUThbwO.js} +1 -1
- package/storybook-static/assets/{FloatingPopover-C-W77AcJ.js → FloatingPopover-BlMi_zjk.js} +1 -1
- package/storybook-static/assets/{FormattedTableCell-fePg_bmP.js → FormattedTableCell-DDNLMP5K.js} +1 -1
- package/storybook-static/assets/{Grid-Dal3v5dj.js → Grid-39TY8m4Z.js} +1 -1
- package/storybook-static/assets/{Grid.stories-Byb4mMpE.js → Grid.stories-DYvrXiSG.js} +1 -1
- package/storybook-static/assets/{ImageCropper.stories-B9OD2pur.js → ImageCropper.stories-B9ltINOC.js} +1 -1
- package/storybook-static/assets/{ImageRenderer-BcUjptiu.js → ImageRenderer-DA--Akcn.js} +1 -1
- package/storybook-static/assets/{ImageRenderer.stories-BuO2nhom.js → ImageRenderer.stories-BVdd0zeh.js} +1 -1
- package/storybook-static/assets/{ImageView.stories-mSkR535R.js → ImageView.stories-DIQCaBWQ.js} +1 -1
- package/storybook-static/assets/{ImageViewer.stories-DVdR3-_j.js → ImageViewer.stories-CyYc6RrG.js} +2 -2
- package/storybook-static/assets/{ImageViewerRuntime-DiR_HwIE.js → ImageViewerRuntime-eZU4pDw8.js} +1 -1
- package/storybook-static/assets/{Input-DZQKV4DP.js → Input-DvVsbr8K.js} +1 -1
- package/storybook-static/assets/{Input-BdCavSu1.js → Input-VmS-QVKm.js} +1 -1
- package/storybook-static/assets/{Input.stories-Cu66SvKb.js → Input.stories-mATd9a0c.js} +1 -1
- package/storybook-static/assets/{InputDateTime-Day94W-O.js → InputDateTime-BSnv1V99.js} +1 -1
- package/storybook-static/assets/{InputDateTime.stories-990MuicZ.js → InputDateTime.stories-BHseZWJW.js} +1 -1
- package/storybook-static/assets/{InputFile-CJll5mC-.js → InputFile-Du6kJw8h.js} +1 -1
- package/storybook-static/assets/{InputFile-Cp8x84ZG.js → InputFile-YpStVIKr.js} +1 -1
- package/storybook-static/assets/{InputFile.stories-fNNwbNfa.js → InputFile.stories-B9bGCSU3.js} +1 -1
- package/storybook-static/assets/{InputFiles-OusF5Lfq.js → InputFiles-BNhs2jEI.js} +1 -1
- package/storybook-static/assets/{InputFiles-CBvR3Szf.js → InputFiles-PUk0s7uQ.js} +1 -1
- package/storybook-static/assets/{InputFiles.stories-DcpEbOOo.js → InputFiles.stories-CxVfsYaA.js} +1 -1
- package/storybook-static/assets/{InputFilesList-zuNP1QIB.js → InputFilesList-_rwKzQPQ.js} +1 -1
- package/storybook-static/assets/{InputImage-CjMAL3uq.js → InputImage-Trwkv0rb.js} +1 -1
- package/storybook-static/assets/{InputImage-Dl2bJNZk.js → InputImage-XAl4ina5.js} +1 -1
- package/storybook-static/assets/{InputImage.stories-BzxEndIe.js → InputImage.stories-Dddz-oRL.js} +1 -1
- package/storybook-static/assets/{InteractiveComponents.stories-CXF1nGLl.js → InteractiveComponents.stories-BZZTxt_C.js} +1 -1
- package/storybook-static/assets/{LayoutPicker-DzAN3gGO.js → LayoutPicker-BzGJmYT0.js} +1 -1
- package/storybook-static/assets/{LayoutPicker-BahcFBzK.js → LayoutPicker-z5o3xDMb.js} +1 -1
- package/storybook-static/assets/{LayoutPicker.stories-ByamaGlv.js → LayoutPicker.stories-Du2gCRWE.js} +1 -1
- package/storybook-static/assets/{Listbox-C5hwzE4s.js → Listbox-C4QRr_MP.js} +1 -1
- package/storybook-static/assets/{Listbox-CHsNGsDc.js → Listbox-DuZWJ8ZZ.js} +1 -1
- package/storybook-static/assets/{Listbox.stories-CvXZeESb.js → Listbox.stories-Y-8RgXM_.js} +1 -1
- package/storybook-static/assets/{Modal-Dib11Lzy.js → Modal-D9Zfvpww.js} +1 -1
- package/storybook-static/assets/{Modal.stories-DYMy-kLP.js → Modal.stories-BnFP5Zrr.js} +1 -1
- package/storybook-static/assets/{ModalManagerProvider-BL_cTIW7.css → ModalManagerProvider-C5bd7SFD.css} +1 -1
- package/storybook-static/assets/{ModalManagerProvider-natWXnSM.js → ModalManagerProvider-Duey-HBY.js} +1 -1
- package/storybook-static/assets/{MultiSelect-DlCZ7dhH.js → MultiSelect-BeQ2iAxN.js} +1 -1
- package/storybook-static/assets/{MultiSelect-Cl9MkPZw.js → MultiSelect-BhMW5jH5.js} +1 -1
- package/storybook-static/assets/{MultiSelect.stories-202TRBKq.js → MultiSelect.stories-Cayi9A_V.js} +1 -1
- package/storybook-static/assets/{NoData-DcHZdLTJ.js → NoData-CeHT8LTg.js} +1 -1
- package/storybook-static/assets/{NotificationsHost-DzqEi2vc.js → NotificationsHost-_4XSnTo2.js} +1 -1
- package/storybook-static/assets/{NotificationsHost.stories-CvoQfIjj.js → NotificationsHost.stories-C-2ucbpq.js} +1 -1
- package/storybook-static/assets/{ODataMultiSelect-CHQguikm.js → ODataMultiSelect-DILkVUzB.js} +1 -1
- package/storybook-static/assets/{ODataMultiSelect.stories-BZbWK4CP.js → ODataMultiSelect.stories-odWzDl6l.js} +1 -1
- package/storybook-static/assets/{ODataSelect-C1YGDpg_.js → ODataSelect-BUAhfvPU.js} +1 -1
- package/storybook-static/assets/{ODataSelect.stories-D4tQXs2c.js → ODataSelect.stories-PpNPmCz2.js} +1 -1
- package/storybook-static/assets/{ODataTreeMultiSelect-BjR7zhyJ.js → ODataTreeMultiSelect-BH7nIL9w.js} +1 -1
- package/storybook-static/assets/{ODataTreeMultiSelect.stories-Drg8mLhi.js → ODataTreeMultiSelect.stories-C4zOROB1.js} +1 -1
- package/storybook-static/assets/{ODataTreeSelect-D_fcT3Aw.js → ODataTreeSelect-CkJq3807.js} +1 -1
- package/storybook-static/assets/{ODataTreeSelect.stories-BWFdmmvf.js → ODataTreeSelect.stories-BcbRGbmJ.js} +1 -1
- package/storybook-static/assets/{OneStepScroller-DWCRXFHq.js → OneStepScroller-BGIjsObI.js} +1 -1
- package/storybook-static/assets/{PeriodSelect-DtfTzrNK.js → PeriodSelect-BcG6A50F.js} +1 -1
- package/storybook-static/assets/{PeriodSelect-C7QQKxZ4.js → PeriodSelect-DvAMLr40.js} +1 -1
- package/storybook-static/assets/{PeriodSelect.stories-CF65LIHm.js → PeriodSelect.stories-DmvK-wEi.js} +1 -1
- package/storybook-static/assets/{PickerSelectionToolbar-D9atWyWj.js → PickerSelectionToolbar-Cas1QrbP.js} +1 -1
- package/storybook-static/assets/{PickerTriggerActions-C7WeaOKN.js → PickerTriggerActions-DUcQfADH.js} +1 -1
- package/storybook-static/assets/{Popover-CUJF-IMC.js → Popover-Dl9KlVW0.js} +1 -1
- package/storybook-static/assets/{Popover-DQJIeny_.js → Popover-mm3LuMCX.js} +1 -1
- package/storybook-static/assets/{Popover.stories-BON0z3PX.js → Popover.stories-BqlULHhR.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput-D3_uzWzQ.js → PresetRangeDateInput-84a4mW00.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput-DpA1KOCo.js → PresetRangeDateInput-Dp-RORYt.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput.stories-CDDJDiei.js → PresetRangeDateInput.stories-Bw3dSWVM.js} +1 -1
- package/storybook-static/assets/{PresetSelect-DlV2eC-b.js → PresetSelect-DbMc37dQ.js} +1 -1
- package/storybook-static/assets/{RadioButton-BLyqp88m.js → RadioButton-Ceuq5i6x.js} +1 -1
- package/storybook-static/assets/{RadioButton-wkLEwRaH.js → RadioButton-DhaK8UUD.js} +1 -1
- package/storybook-static/assets/{RadioButton.stories-DS9RYBEJ.js → RadioButton.stories-S98_hDUl.js} +1 -1
- package/storybook-static/assets/{RadioGroup-CsWIje1J.js → RadioGroup-BqSOcKQI.js} +1 -1
- package/storybook-static/assets/{RadioGroup-DERcyzA0.js → RadioGroup-Di55rXi_.js} +1 -1
- package/storybook-static/assets/{RadioGroup.stories-DkgUPavS.js → RadioGroup.stories-7RFD3uHM.js} +1 -1
- package/storybook-static/assets/{Scrollable-DvJ3T3Ik.js → Scrollable-B0p5mrx8.js} +1 -1
- package/storybook-static/assets/Select-BS9Its_r.js +12 -0
- package/storybook-static/assets/{Select-DmEm2boi.js → Select-CIqhX4mK.js} +1 -1
- package/storybook-static/assets/{Select.stories-BEPJovVd.js → Select.stories-DNhv8-zb.js} +1 -1
- package/storybook-static/assets/{SelectOptionContent-B5E2W8PZ.js → SelectOptionContent-DXq8ymaG.js} +1 -1
- package/storybook-static/assets/{SerializableSelect-wgzDfqEi.js → SerializableSelect-Wq154MOD.js} +1 -1
- package/storybook-static/assets/{SerializableSelect.stories-V8IqyO9Y.js → SerializableSelect.stories-5sc1J9RV.js} +1 -1
- package/storybook-static/assets/{SingleDateTimeInput-B7v0t9f5.js → SingleDateTimeInput-Bkv6gIle.js} +1 -1
- package/storybook-static/assets/SingleDateTimeInput-D7sbOu36.js +1 -0
- package/storybook-static/assets/{SingleDateTimeInput.stories-FOoEMoyF.js → SingleDateTimeInput.stories-DWWk1ufW.js} +1 -1
- package/storybook-static/assets/{Slider-24H5ASxG.js → Slider-BGsWuJAm.js} +1 -1
- package/storybook-static/assets/{Slider-3HQKHpoi.js → Slider-BxM1AhD9.js} +1 -1
- package/storybook-static/assets/{Slider.stories-DeeP8cmV.js → Slider.stories-VJI4Rnlr.js} +1 -1
- package/storybook-static/assets/{SliderInput-CFbx-GW7.js → SliderInput-CzLa4eqn.js} +1 -1
- package/storybook-static/assets/SliderInput-D4y-O8R2.js +2 -0
- package/storybook-static/assets/{SliderInput.stories-Djli653m.js → SliderInput.stories-g0Kwo7dl.js} +1 -1
- package/storybook-static/assets/{Sortable-CMo2PMKX.js → Sortable-CgA1YBUW.js} +1 -1
- package/storybook-static/assets/{Sortable.stories-BFsQvwMx.js → Sortable.stories-x3gePcSZ.js} +1 -1
- package/storybook-static/assets/{Splitter-dwOhGuIg.js → Splitter-BgFyt-RI.js} +1 -1
- package/storybook-static/assets/{Splitter.stories-DZ3nAxpo.js → Splitter.stories-CkN8ukyN.js} +1 -1
- package/storybook-static/assets/{StateSelect-j3gi4kbM.js → StateSelect-Ce4t44r8.js} +1 -1
- package/storybook-static/assets/{StateSelect-IigEzRom.js → StateSelect-DSuIDlz9.js} +1 -1
- package/storybook-static/assets/{StateSelect.stories-Bj-2m2hS.js → StateSelect.stories-BPomWgn7.js} +1 -1
- package/storybook-static/assets/{StringToggle.stories-ClSl76ts.js → StringToggle.stories-CnMi5EAT.js} +1 -1
- package/storybook-static/assets/{Switch-C9OAPzUM.js → Switch-DDCJrhcQ.js} +1 -1
- package/storybook-static/assets/{Switch-BDbBZjMA.js → Switch-OWLmHmHZ.js} +1 -1
- package/storybook-static/assets/{Switch.stories-CQ3ueThx.js → Switch.stories-BDu-Afks.js} +1 -1
- package/storybook-static/assets/{Table-BbGcLQ81.js → Table-DZg-HjgT.js} +1 -1
- package/storybook-static/assets/{Table.stories-DvaHP59R.js → Table.stories-C1tWXfqI.js} +1 -1
- package/storybook-static/assets/{Tabs-CNEYvzUv.js → Tabs-DRfMQ8Jx.js} +1 -1
- package/storybook-static/assets/{Tabs.stories-BpyQokl8.js → Tabs.stories-Dgdc1lZD.js} +1 -1
- package/storybook-static/assets/TabsBox-B5ugO318.css +1 -0
- package/storybook-static/assets/{TabsBox-ClZCbgKB.js → TabsBox-DljUVTsd.js} +1 -1
- package/storybook-static/assets/{TagInput-DorsSF_V.js → TagInput-BCS6WLcW.js} +1 -1
- package/storybook-static/assets/{TagInput.stories-ChgRz4Co.js → TagInput.stories-Dy5AVzAj.js} +1 -1
- package/storybook-static/assets/{Text-DUqtop-c.js → Text-C4TWqy0Q.js} +1 -1
- package/storybook-static/assets/{Textarea-ZfZJmHsp.js → Textarea-5Gx2U0_d.js} +1 -1
- package/storybook-static/assets/{Textarea-yZWv6QdW.js → Textarea-BZrJEPN7.js} +1 -1
- package/storybook-static/assets/{Textarea.stories-B5Q7syxH.js → Textarea.stories-BvdLNmb_.js} +1 -1
- package/storybook-static/assets/{TimePanel-C39f__j8.js → TimePanel-D3QC0eS8.js} +1 -1
- package/storybook-static/assets/{TimePanel.stories-DtjILTPk.js → TimePanel.stories-BZOB234n.js} +1 -1
- package/storybook-static/assets/{Toggle-CdpPJI_O.js → Toggle-BpzUjB13.js} +1 -1
- package/storybook-static/assets/{Toggle-BndjhQFY.js → Toggle-DarFnpF4.js} +1 -1
- package/storybook-static/assets/{Toggle.stories-BD_C0YTw.js → Toggle.stories-DyPUelGH.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect--M1WiE_f.js → TreeMultiSelect-DNjTWvVq.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect-BPz5kISi.js → TreeMultiSelect-DqpIhAuh.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect.stories-BgkDJur9.js → TreeMultiSelect.stories-Uc9jwEfE.js} +1 -1
- package/storybook-static/assets/TreePickerBase-BRKipsrA.js +22 -0
- package/storybook-static/assets/{TreeSelect-B0RWsDT4.js → TreeSelect-Bp1Zik9B.js} +1 -1
- package/storybook-static/assets/{TreeSelect-BrQGgG40.js → TreeSelect-CrLx5V7M.js} +1 -1
- package/storybook-static/assets/{TreeSelect.stories-DkgdJ5XX.js → TreeSelect.stories-RlHKzmuz.js} +1 -1
- package/storybook-static/assets/{TreeTable-HQr8pb9r.js → TreeTable-DhQ6u1Pe.js} +1 -1
- package/storybook-static/assets/{TreeTable.stories-C4hcph6x.js → TreeTable.stories-CAs-UAM0.js} +1 -1
- package/storybook-static/assets/{async-lzSWdC34.js → async-B2DliTcn.js} +1 -1
- package/storybook-static/assets/{blocks-D8l_hmHU.js → blocks-CGuhQMXa.js} +3 -3
- package/storybook-static/assets/{browserAndReact-BwvRFhzI.js → browserAndReact-C-OypV8y.js} +1 -1
- package/storybook-static/assets/{check-DpX8PMs_.js → check-Bw0XnpCV.js} +1 -1
- package/storybook-static/assets/{chevron-down-DE8FRR-h.js → chevron-down-CfrX73tO.js} +1 -1
- package/storybook-static/assets/{chevron-left-Cy3TEG_Y.js → chevron-left-DpeXiQaY.js} +1 -1
- package/storybook-static/assets/{chevron-right-CZ4-4s1X.js → chevron-right-BFJM6q51.js} +1 -1
- package/storybook-static/assets/{chunk-W22LQPXL-Ci-XApFb.js → chunk-W22LQPXL-Bt3_v9HM.js} +1 -1
- package/storybook-static/assets/{circle-alert-CWbgc3Jn.js → circle-alert-y52RJRUz.js} +1 -1
- package/storybook-static/assets/{circle-check-DODquDnH.js → circle-check-D-VabHaY.js} +1 -1
- package/storybook-static/assets/{components-BdUOCBP9.js → components-I69uHPsH.js} +3 -3
- package/storybook-static/assets/{contextMenu-XvvXJEpW.js → contextMenu-DfPU9cBt.js} +1 -1
- package/storybook-static/assets/defaultRenderers-Bkg6olnb.js +1 -0
- package/storybook-static/assets/{download-BEGaHxQc.js → download-CtH__7oe.js} +1 -1
- package/storybook-static/assets/{filesAndExcel-C9FnZv9P.js → filesAndExcel-BkVmFKKv.js} +1 -1
- package/storybook-static/assets/{floating-ui.react-GziJy4gA.js → floating-ui.react-CxI0EsOT.js} +1 -1
- package/storybook-static/assets/{formatters-CVj-3Vn0-C5-BLq9O.js → formatters-CVj-3Vn0-BFaHJqZL.js} +1 -1
- package/storybook-static/assets/{formatters-vWial7jf.js → formatters-D37vYORi.js} +1 -1
- package/storybook-static/assets/{formatters-runtime-DO0szrYr.js → formatters-runtime-D3X8TbPs.js} +1 -1
- package/storybook-static/assets/{foundationLib-CIqc9fhG.js → foundationLib-DozGtKQB.js} +1 -1
- package/storybook-static/assets/{hooks-DfgvMSqN.js → hooks-Df19Nsi2.js} +1 -1
- package/storybook-static/assets/{iframe-BHhbrImE.js → iframe-BQrLcg06.js} +3 -3
- package/storybook-static/assets/iframe-lJqBcWzL.js +1 -0
- package/storybook-static/assets/{info-DSZ4aUvi.js → info-BeGxRQvx.js} +1 -1
- package/storybook-static/assets/{odata-DmijE2H9.js → odata-BDmwSB0b.js} +1 -1
- package/storybook-static/assets/odata-service-B5w4YBao-BW9QLSrS.js +3 -0
- package/storybook-static/assets/{odataAndTables-m2AMS6oI.js → odataAndTables-CdiAn8YJ.js} +1 -1
- package/storybook-static/assets/{odataFetchFn-CwpkgKoz.js → odataFetchFn-B4sQvu6J.js} +1 -1
- package/storybook-static/assets/{odataStoryFixtures-CBtJYQsv.js → odataStoryFixtures-DJ_pv2Rq.js} +1 -1
- package/storybook-static/assets/{persisted-DpSU25AR.js → persisted-Cryvs_Te.js} +1 -1
- package/storybook-static/assets/{pureUtilities-BG4ZSO63.js → pureUtilities-YEJFcbIT.js} +1 -1
- package/storybook-static/assets/{react-Bz35HWpn.js → react-D5HGS0WP.js} +1 -1
- package/storybook-static/assets/{refresh-cw-ltgf4cUB.js → refresh-cw-BtYtkXmi.js} +1 -1
- package/storybook-static/assets/{runtimeAndState-C_GrWjr8.js → runtimeAndState-Bc0p1zM-.js} +1 -1
- package/storybook-static/assets/{settings-2-qpVYfZn_.js → settings-2-BTaug5uU.js} +1 -1
- package/storybook-static/assets/{sortable-CrCQ3H1V.js → sortable-CV5Mg3jp.js} +1 -1
- package/storybook-static/assets/{syntaxhighlighter-T5IQBZDB-eOr9ght-.js → syntaxhighlighter-T5IQBZDB-CyWSuE24.js} +1 -1
- package/storybook-static/assets/{trash-2-lfhUDclN.js → trash-2-Bcxa3Ezm.js} +1 -1
- package/storybook-static/assets/{triangle-alert-D9YGTafY.js → triangle-alert-Cy0xZ6CK.js} +1 -1
- package/storybook-static/assets/{useODataSelectBase-BVgxJPNn.js → useODataSelectBase-rnvEwUEf.js} +1 -1
- package/storybook-static/assets/{useODataTreeData-CdLHOBnD.js → useODataTreeData-DFL7fNez.js} +1 -1
- package/storybook-static/assets/{usePickerQuery-B6U-oOS6.js → usePickerQuery-BpbIXzlf.js} +1 -1
- package/storybook-static/assets/{usePickerTriggerController-C-VxrzSe.js → usePickerTriggerController-CLjquchr.js} +1 -1
- package/storybook-static/assets/{x-CNM39xuu.js → x-CTu2RxD8.js} +1 -1
- package/storybook-static/iframe.html +2 -2
- package/storybook-static/project.json +1 -1
- package/dist/chunks/CalendarView-DtacoN_c.js +0 -439
- package/dist/chunks/TextEditorLexicalClient-DVML-Nhd.js.map +0 -1
- package/dist/chunks/context-menu-BY4pYGwB.js.map +0 -1
- package/dist/chunks/date-input-DKkJO_-h.js +0 -340
- package/dist/chunks/date-input-DKkJO_-h.js.map +0 -1
- package/dist/chunks/input-BWCaVC06.js.map +0 -1
- package/dist/chunks/multi-select-01xmD1nZ.js.map +0 -1
- package/dist/chunks/select-DRf4_a1Z.js.map +0 -1
- package/storybook-static/assets/CheckBox-8XczNrjq.css +0 -1
- package/storybook-static/assets/ContextMenu-BjWu5DHB.js +0 -1
- package/storybook-static/assets/DateInput-BUgBb3aH.js +0 -1
- package/storybook-static/assets/Select-g0c0XGQY.js +0 -12
- package/storybook-static/assets/SingleDateTimeInput-CN7PyOsb.js +0 -1
- package/storybook-static/assets/SliderInput-bqFr-Lyp.js +0 -2
- package/storybook-static/assets/TabsBox-Co1vxD90.css +0 -1
- package/storybook-static/assets/TreePickerBase-Dup03AiC.js +0 -22
- package/storybook-static/assets/defaultRenderers-lMEgLPIU.js +0 -1
- package/storybook-static/assets/iframe-oIP1aL7X.js +0 -1
- package/storybook-static/assets/odata-service-B5w4YBao-BcP2cvfZ.js +0 -3
- /package/storybook-static/assets/{CheckBox.module-DPvJxTHD.js → CheckBox.module-CM_GPl_E.js} +0 -0
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { t as e } from "./ui.module-BfaIVBba.js";
|
|
2
2
|
import { t } from "./grid-dI94AAbi.js";
|
|
3
|
-
import { i as n, l as r, s as i } from "./input-
|
|
3
|
+
import { i as n, l as r, s as i } from "./input-CAw1Loze.js";
|
|
4
4
|
import { t as a } from "./separator-B72Aq-6a.js";
|
|
5
|
-
import { forwardRef as o, useEffect as s,
|
|
6
|
-
import { cn as
|
|
7
|
-
import { ChevronDownIcon as
|
|
8
|
-
import { jsx as
|
|
9
|
-
import { normalizeTextToLower as
|
|
10
|
-
import { FloatingFocusManager as
|
|
11
|
-
import { useFloatingListbox as
|
|
12
|
-
import { AnimatePresence as
|
|
5
|
+
import { forwardRef as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
6
|
+
import { cn as d } from "@ryuzaki13/react-foundation-lib/utils";
|
|
7
|
+
import { ChevronDownIcon as f } from "lucide-react";
|
|
8
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
9
|
+
import { normalizeTextToLower as h } from "@ryuzaki13/react-foundation-lib/formatters";
|
|
10
|
+
import { FloatingFocusManager as g, FloatingPortal as _ } from "@floating-ui/react";
|
|
11
|
+
import { useFloatingListbox as v } from "@ryuzaki13/react-foundation-lib/hooks";
|
|
12
|
+
import { AnimatePresence as y, motion as b } from "motion/react";
|
|
13
13
|
//#region src/picker/PickerField.tsx
|
|
14
|
-
function
|
|
15
|
-
let { controlId: u, labelId: d, descriptionId: f, errorId:
|
|
14
|
+
function x({ id: e, label: t, description: n, disabled: a, size: o, className: s, error: c, children: l }) {
|
|
15
|
+
let { controlId: u, labelId: d, descriptionId: f, errorId: m, describedBy: h } = r({
|
|
16
16
|
id: e,
|
|
17
17
|
hasLabel: t != null,
|
|
18
18
|
hasDescription: !!n,
|
|
19
19
|
hasError: !!c
|
|
20
20
|
});
|
|
21
|
-
return /* @__PURE__ */
|
|
21
|
+
return /* @__PURE__ */ p(i, {
|
|
22
22
|
label: t,
|
|
23
23
|
description: n,
|
|
24
24
|
disabled: a,
|
|
@@ -28,17 +28,17 @@ function S({ id: e, label: t, description: n, disabled: a, size: o, className: s
|
|
|
28
28
|
controlId: u,
|
|
29
29
|
labelId: d,
|
|
30
30
|
descriptionId: f,
|
|
31
|
-
errorId:
|
|
31
|
+
errorId: m,
|
|
32
32
|
children: l({
|
|
33
33
|
controlId: u,
|
|
34
34
|
labelId: d,
|
|
35
35
|
descriptionId: f,
|
|
36
|
-
errorId:
|
|
36
|
+
errorId: m,
|
|
37
37
|
describedBy: h
|
|
38
38
|
})
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
var
|
|
41
|
+
var S = {
|
|
42
42
|
popupLayout: "DRJ4hy",
|
|
43
43
|
popupBody: "U4CULi",
|
|
44
44
|
status: "bupTWA",
|
|
@@ -48,17 +48,17 @@ var C = {
|
|
|
48
48
|
};
|
|
49
49
|
//#endregion
|
|
50
50
|
//#region src/picker/PickerPopup.tsx
|
|
51
|
-
function
|
|
51
|
+
function C(e) {
|
|
52
52
|
e.stopPropagation();
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
return /* @__PURE__ */
|
|
54
|
+
function w({ open: e, context: t, floatingStyles: n, listId: r, labelId: i, popupAriaLabel: o, descriptionId: s, activeOptionId: c, ariaMultiselectable: l, popupRole: u = "listbox", setFloating: f, getFloatingProps: h, onKeyDown: v, initialFocus: x = -1, returnFocus: w = !1, tabIndex: T = 0, className: E, maxWidth: D, layoutClassName: O, headerClassName: k, bodyClassName: A, header: j, children: M }) {
|
|
55
|
+
return /* @__PURE__ */ p(y, { children: e && /* @__PURE__ */ p(_, { children: /* @__PURE__ */ p(g, {
|
|
56
56
|
context: t,
|
|
57
57
|
modal: !1,
|
|
58
|
-
initialFocus:
|
|
59
|
-
returnFocus:
|
|
60
|
-
children: /* @__PURE__ */
|
|
61
|
-
ref:
|
|
58
|
+
initialFocus: x,
|
|
59
|
+
returnFocus: w,
|
|
60
|
+
children: /* @__PURE__ */ p(b.div, {
|
|
61
|
+
ref: f,
|
|
62
62
|
style: {
|
|
63
63
|
...n,
|
|
64
64
|
maxWidth: D
|
|
@@ -75,7 +75,7 @@ function T({ open: e, context: t, floatingStyles: n, listId: r, labelId: i, popu
|
|
|
75
75
|
opacity: 0,
|
|
76
76
|
scale: .95
|
|
77
77
|
},
|
|
78
|
-
...
|
|
78
|
+
...h({
|
|
79
79
|
id: r,
|
|
80
80
|
role: u,
|
|
81
81
|
tabIndex: T,
|
|
@@ -84,17 +84,17 @@ function T({ open: e, context: t, floatingStyles: n, listId: r, labelId: i, popu
|
|
|
84
84
|
"aria-describedby": s,
|
|
85
85
|
"aria-activedescendant": c,
|
|
86
86
|
"aria-multiselectable": l || void 0,
|
|
87
|
-
onMouseDown:
|
|
88
|
-
onKeyDown:
|
|
87
|
+
onMouseDown: C,
|
|
88
|
+
onKeyDown: v,
|
|
89
89
|
className: E
|
|
90
90
|
}),
|
|
91
|
-
children: /* @__PURE__ */
|
|
92
|
-
className:
|
|
93
|
-
children: [j ? /* @__PURE__ */
|
|
91
|
+
children: /* @__PURE__ */ m("div", {
|
|
92
|
+
className: d(S.popupLayout, O),
|
|
93
|
+
children: [j ? /* @__PURE__ */ m("div", {
|
|
94
94
|
className: k,
|
|
95
|
-
children: [j, /* @__PURE__ */
|
|
96
|
-
}) : /* @__PURE__ */
|
|
97
|
-
className:
|
|
95
|
+
children: [j, /* @__PURE__ */ p(a, { className: "marginBlockSm" })]
|
|
96
|
+
}) : /* @__PURE__ */ p("div", {}), /* @__PURE__ */ p("div", {
|
|
97
|
+
className: d(S.popupBody, A),
|
|
98
98
|
children: M
|
|
99
99
|
})]
|
|
100
100
|
})
|
|
@@ -103,21 +103,21 @@ function T({ open: e, context: t, floatingStyles: n, listId: r, labelId: i, popu
|
|
|
103
103
|
}
|
|
104
104
|
//#endregion
|
|
105
105
|
//#region src/picker/PickerSelectionToolbar.tsx
|
|
106
|
-
function
|
|
107
|
-
return /* @__PURE__ */
|
|
106
|
+
function T({ onSelectAll: e, onDeselectAll: n, selectAllButtonRef: r }) {
|
|
107
|
+
return /* @__PURE__ */ m(t.Container, {
|
|
108
108
|
gap: "xs",
|
|
109
109
|
templateColumns: "1fr 1fr",
|
|
110
|
-
children: [/* @__PURE__ */
|
|
110
|
+
children: [/* @__PURE__ */ p("button", {
|
|
111
111
|
ref: r,
|
|
112
112
|
type: "button",
|
|
113
|
-
className:
|
|
113
|
+
className: S.selectionActionButton,
|
|
114
114
|
onClick: e,
|
|
115
115
|
"data-ui": "picker-select-all",
|
|
116
116
|
"data-action": "select-all",
|
|
117
117
|
children: "Выбрать все"
|
|
118
|
-
}), /* @__PURE__ */
|
|
118
|
+
}), /* @__PURE__ */ p("button", {
|
|
119
119
|
type: "button",
|
|
120
|
-
className:
|
|
120
|
+
className: S.selectionActionButton,
|
|
121
121
|
onClick: n,
|
|
122
122
|
"data-ui": "picker-deselect-all",
|
|
123
123
|
"data-action": "deselect-all",
|
|
@@ -127,52 +127,52 @@ function E({ onSelectAll: e, onDeselectAll: n, selectAllButtonRef: r }) {
|
|
|
127
127
|
}
|
|
128
128
|
//#endregion
|
|
129
129
|
//#region src/picker/PickerStatus.tsx
|
|
130
|
-
function
|
|
130
|
+
function E({ emptyState: t, loadingState: n, errorState: r }) {
|
|
131
131
|
let i = r ?? n ?? t;
|
|
132
|
-
return i == null ? null : /* @__PURE__ */
|
|
133
|
-
className:
|
|
132
|
+
return i == null ? null : /* @__PURE__ */ p("div", {
|
|
133
|
+
className: d(e.uiPopupOption, S.status, r !== void 0 && S.statusError),
|
|
134
134
|
"aria-disabled": !0,
|
|
135
135
|
children: i
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
//#endregion
|
|
139
139
|
//#region src/picker/PickerTriggerActions.tsx
|
|
140
|
-
function
|
|
141
|
-
return /* @__PURE__ */
|
|
140
|
+
function D({ open: t, disabled: n, children: r, onToggleMouseDown: i, onToggleClick: a, openAriaLabel: o = "Открыть список", closeAriaLabel: s = "Закрыть список" }) {
|
|
141
|
+
return /* @__PURE__ */ m("div", {
|
|
142
142
|
className: e.uiToggleButtonContainer,
|
|
143
143
|
"data-disabled": n || void 0,
|
|
144
144
|
children: [
|
|
145
145
|
r,
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ p("div", { className: e.uiButtonSeparator }),
|
|
147
|
+
/* @__PURE__ */ p("button", {
|
|
148
148
|
type: "button",
|
|
149
149
|
"aria-label": t ? s : o,
|
|
150
150
|
className: e.uiToggleButton,
|
|
151
151
|
onMouseDown: i,
|
|
152
152
|
onClick: a,
|
|
153
|
-
children: /* @__PURE__ */
|
|
153
|
+
children: /* @__PURE__ */ p(f, { className: d(e.uiToggleIcon, t && e.uiToggleIconOpen) })
|
|
154
154
|
})
|
|
155
155
|
]
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
//#endregion
|
|
159
159
|
//#region src/picker/PickerTriggerInput.tsx
|
|
160
|
-
var
|
|
160
|
+
var O = o(({ rootRef: t, endAdornment: r, overlay: i, rootClassName: a, inputClassName: o, ...s }, c) => /* @__PURE__ */ m("div", {
|
|
161
161
|
ref: t,
|
|
162
|
-
className:
|
|
163
|
-
children: [/* @__PURE__ */
|
|
162
|
+
className: d(e.uiInputContainer, S.triggerContainer, a),
|
|
163
|
+
children: [/* @__PURE__ */ p(n, {
|
|
164
164
|
endAdornment: r,
|
|
165
|
-
children: ({ controlClassName: t }) => /* @__PURE__ */
|
|
165
|
+
children: ({ controlClassName: t }) => /* @__PURE__ */ p("input", {
|
|
166
166
|
...s,
|
|
167
167
|
ref: c,
|
|
168
|
-
className:
|
|
168
|
+
className: d(e.uiInputWithToggle, t, o)
|
|
169
169
|
})
|
|
170
170
|
}), i]
|
|
171
171
|
}));
|
|
172
|
-
|
|
172
|
+
O.displayName = "PickerTriggerInput";
|
|
173
173
|
//#endregion
|
|
174
174
|
//#region src/picker/model/createPickerTriggerPolicy.ts
|
|
175
|
-
function
|
|
175
|
+
function k(e) {
|
|
176
176
|
switch (e) {
|
|
177
177
|
case "search-single": return {
|
|
178
178
|
focusFloatingOnOpen: !1,
|
|
@@ -205,21 +205,21 @@ function A(e) {
|
|
|
205
205
|
}
|
|
206
206
|
//#endregion
|
|
207
207
|
//#region src/picker/model/extractPickerTextContent.ts
|
|
208
|
-
function
|
|
208
|
+
function A(e) {
|
|
209
209
|
if (typeof e == "string" || typeof e == "number") return String(e);
|
|
210
210
|
if (Array.isArray(e)) {
|
|
211
|
-
let t = e.map(
|
|
211
|
+
let t = e.map(A).filter((e) => !!e);
|
|
212
212
|
return t.length ? t.join(" ") : void 0;
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
//#endregion
|
|
216
216
|
//#region src/picker/model/usePickerDefaultFilter.ts
|
|
217
|
-
function
|
|
218
|
-
return
|
|
217
|
+
function j(e) {
|
|
218
|
+
return h((Array.isArray(e) ? e : [e]).filter(Boolean).join(" "));
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
let i =
|
|
222
|
-
return
|
|
220
|
+
function M({ options: e, query: t, enabled: n = !0, getSearchText: r }) {
|
|
221
|
+
let i = h(t);
|
|
222
|
+
return c(() => !n || !i ? [...e] : e.filter((e) => j(r(e)).includes(i)), [
|
|
223
223
|
n,
|
|
224
224
|
r,
|
|
225
225
|
i,
|
|
@@ -228,9 +228,9 @@ function N({ options: e, query: t, enabled: n = !0, getSearchText: r }) {
|
|
|
228
228
|
}
|
|
229
229
|
//#endregion
|
|
230
230
|
//#region src/picker/model/usePickerFloatingListbox.ts
|
|
231
|
-
function
|
|
232
|
-
let t = e.triggerMode ?
|
|
233
|
-
return
|
|
231
|
+
function N(e) {
|
|
232
|
+
let t = e.triggerMode ? k(e.triggerMode) : void 0;
|
|
233
|
+
return v({
|
|
234
234
|
...e,
|
|
235
235
|
focusFloatingOnOpen: e.focusFloatingOnOpen ?? t?.focusFloatingOnOpen,
|
|
236
236
|
restoreFocusOnClose: e.restoreFocusOnClose ?? t?.restoreFocusOnClose
|
|
@@ -238,57 +238,47 @@ function P(e) {
|
|
|
238
238
|
}
|
|
239
239
|
//#endregion
|
|
240
240
|
//#region src/picker/model/usePickerQuery.ts
|
|
241
|
-
function
|
|
242
|
-
let
|
|
243
|
-
|
|
244
|
-
o.current && !e && g && (l || h(), r?.("")), o.current = e;
|
|
245
|
-
}, [
|
|
246
|
-
l,
|
|
247
|
-
r,
|
|
248
|
-
e,
|
|
249
|
-
g
|
|
250
|
-
]);
|
|
251
|
-
let _ = (e) => {
|
|
252
|
-
l || p(e), r?.(e);
|
|
241
|
+
function P({ query: e, defaultQuery: t, onQuery: n, resetOnClose: r, triggerMode: i }) {
|
|
242
|
+
let a = e !== void 0, [o, s] = u(t ?? ""), c = a ? e ?? "" : o, l = r ?? (!i || k(i).resetQueryOnClose), d = (e) => {
|
|
243
|
+
a || s(e), n?.(e);
|
|
253
244
|
};
|
|
254
245
|
return {
|
|
255
|
-
query:
|
|
256
|
-
setQuery:
|
|
257
|
-
clearQuery: () =>
|
|
246
|
+
query: c,
|
|
247
|
+
setQuery: d,
|
|
248
|
+
clearQuery: () => d(""),
|
|
249
|
+
resetQueryOnClose: l
|
|
258
250
|
};
|
|
259
251
|
}
|
|
260
252
|
//#endregion
|
|
261
253
|
//#region src/picker/model/usePickerSelectionLifecycle.ts
|
|
262
|
-
function
|
|
263
|
-
let o =
|
|
254
|
+
function F({ value: e, open: t, onCommit: n, onOpen: r, onClose: i, isEqual: a }) {
|
|
255
|
+
let o = l(!1), [c, d] = u(e);
|
|
264
256
|
return s(() => {
|
|
265
|
-
t
|
|
266
|
-
}, [t, e]), s(() => {
|
|
267
|
-
o.current && !t && (a(l, e) || n(l), i?.(l)), o.current = t;
|
|
257
|
+
o.current && !t && (a(c, e) || n(c), i?.(c)), o.current = t;
|
|
268
258
|
}, [
|
|
269
|
-
|
|
259
|
+
c,
|
|
270
260
|
a,
|
|
271
261
|
i,
|
|
272
262
|
n,
|
|
273
263
|
t,
|
|
274
264
|
e
|
|
275
265
|
]), {
|
|
276
|
-
draftValue:
|
|
277
|
-
setDraftValue:
|
|
266
|
+
draftValue: c,
|
|
267
|
+
setDraftValue: d,
|
|
278
268
|
prepareOpen: () => {
|
|
279
|
-
|
|
269
|
+
d(e), r?.();
|
|
280
270
|
}
|
|
281
271
|
};
|
|
282
272
|
}
|
|
283
273
|
//#endregion
|
|
284
274
|
//#region src/picker/model/usePickerTriggerController.ts
|
|
285
|
-
function
|
|
275
|
+
function I(e) {
|
|
286
276
|
requestAnimationFrame(() => {
|
|
287
277
|
e.current?.focus();
|
|
288
278
|
});
|
|
289
279
|
}
|
|
290
|
-
function
|
|
291
|
-
let u =
|
|
280
|
+
function L({ mode: e, open: t, currentQuery: n, hasDisplayValue: r, inputRef: i, setQuery: a, openList: o, close: s, toggleOpen: c, onBeforeOpen: l }) {
|
|
281
|
+
let u = k(e), d = () => {
|
|
292
282
|
if (l?.(), o) {
|
|
293
283
|
o();
|
|
294
284
|
return;
|
|
@@ -301,7 +291,7 @@ function R({ mode: e, open: t, currentQuery: n, hasDisplayValue: r, inputRef: i,
|
|
|
301
291
|
}
|
|
302
292
|
c?.();
|
|
303
293
|
}, p = () => {
|
|
304
|
-
t ? f() : d(), u.shouldFocusReferenceOnToggle(t) &&
|
|
294
|
+
t ? f() : d(), u.shouldFocusReferenceOnToggle(t) && I(i);
|
|
305
295
|
};
|
|
306
296
|
return {
|
|
307
297
|
policy: u,
|
|
@@ -345,6 +335,6 @@ function R({ mode: e, open: t, currentQuery: n, hasDisplayValue: r, inputRef: i,
|
|
|
345
335
|
};
|
|
346
336
|
}
|
|
347
337
|
//#endregion
|
|
348
|
-
export {
|
|
338
|
+
export { M as a, O as c, T as d, w as f, N as i, D as l, F as n, A as o, x as p, P as r, k as s, L as t, E as u };
|
|
349
339
|
|
|
350
|
-
//# sourceMappingURL=picker-
|
|
340
|
+
//# sourceMappingURL=picker-TYLwgl1c.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picker-Mdb73_uW.js","names":[],"sources":["../../src/picker/PickerField.tsx","../../src/picker/Picker.module.scss","../../src/picker/PickerPopup.tsx","../../src/picker/PickerSelectionToolbar.tsx","../../src/picker/PickerStatus.tsx","../../src/picker/PickerTriggerActions.tsx","../../src/picker/PickerTriggerInput.tsx","../../src/picker/model/createPickerTriggerPolicy.ts","../../src/picker/model/extractPickerTextContent.ts","../../src/picker/model/usePickerDefaultFilter.ts","../../src/picker/model/usePickerFloatingListbox.ts","../../src/picker/model/usePickerQuery.ts","../../src/picker/model/usePickerSelectionLifecycle.ts","../../src/picker/model/usePickerTriggerController.ts"],"sourcesContent":["import { InputType } from \"@ryuzaki13/react-foundation-lib/types\";\n\nimport { InputUI } from \"../input\";\nimport { useInputFieldIds } from \"../input/lib/useInputFieldIds\";\n\nimport { PickerFieldProps } from \"./types\";\n\nexport function PickerField<TValue extends InputType>({\n\tid,\n\tlabel,\n\tdescription,\n\tdisabled,\n\tsize,\n\tclassName,\n\terror,\n\tchildren\n}: PickerFieldProps<TValue>) {\n\tconst { controlId, labelId, descriptionId, errorId, describedBy } = useInputFieldIds({\n\t\tid,\n\t\thasLabel: label !== undefined && label !== null,\n\t\thasDescription: !!description,\n\t\thasError: !!error\n\t});\n\n\treturn (\n\t\t<InputUI\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled}\n\t\t\tsize={size}\n\t\t\tclassName={className}\n\t\t\terror={error}\n\t\t\tcontrolId={controlId}\n\t\t\tlabelId={labelId}\n\t\t\tdescriptionId={descriptionId}\n\t\t\terrorId={errorId}>\n\t\t\t{children({ controlId, labelId, descriptionId, errorId, describedBy })}\n\t\t</InputUI>\n\t);\n}\n",".popupLayout {\n\tdisplay: grid;\n\tgrid-template-rows: auto 1fr;\n\tmin-height: 0;\n\tmax-height: 75vh;\n\toverflow: hidden;\n\n\tflex: 1 1 auto;\n}\n\n.popupBody {\n\tmin-height: 0;\n}\n\n.status {\n\tpadding: var(--space-xs) var(--space-sm);\n\tcolor: var(--content-2);\n}\n\n.statusError {\n\tcolor: var(--status-error-text);\n}\n\n.triggerContainer {\n\tposition: relative;\n}\n\n.selectionActionButton {\n\tfont-size: var(--font-size-sm);\n\tpadding-block: var(--space-xs);\n\tborder-radius: var(--radius-sm);\n\n\t&:hover {\n\t\tbackground-color: var(--surface-2);\n\t}\n}\n","import { type CSSProperties, type KeyboardEvent, type MouseEvent, type ReactNode } from \"react\";\n\nimport { FloatingContext, FloatingFocusManager, FloatingPortal } from \"@floating-ui/react\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { AnimatePresence, motion } from \"motion/react\";\n\nimport { Separator } from \"../separator\";\n\nimport styles from \"./Picker.module.scss\";\n\ninterface PickerPopupProps {\n\topen: boolean;\n\tcontext: FloatingContext;\n\tfloatingStyles: CSSProperties;\n\tlistId: string;\n\tlabelId?: string;\n\tpopupAriaLabel?: string;\n\tdescriptionId?: string;\n\tactiveOptionId?: string;\n\tariaMultiselectable?: boolean;\n\tpopupRole?: \"listbox\" | \"dialog\";\n\tsetFloating: (node: HTMLElement | null) => void;\n\tgetFloatingProps: (userProps?: Record<string, unknown>) => Record<string, unknown>;\n\tonKeyDown: (event: KeyboardEvent<HTMLElement>) => void;\n\tinitialFocus?: number;\n\treturnFocus?: boolean;\n\ttabIndex?: number;\n\tclassName?: string;\n\tmaxWidth?: CSSProperties[\"maxWidth\"];\n\tlayoutClassName?: string;\n\theaderClassName?: string;\n\tbodyClassName?: string;\n\theader?: ReactNode;\n\tchildren: ReactNode;\n}\n\nfunction stopNestedFloatingMouseDown(event: MouseEvent<HTMLElement>): void {\n\tevent.stopPropagation();\n}\n\nexport function PickerPopup({\n\topen,\n\tcontext,\n\tfloatingStyles,\n\tlistId,\n\tlabelId,\n\tpopupAriaLabel,\n\tdescriptionId,\n\tactiveOptionId,\n\tariaMultiselectable,\n\tpopupRole = \"listbox\",\n\tsetFloating,\n\tgetFloatingProps,\n\tonKeyDown,\n\tinitialFocus = -1,\n\treturnFocus = false,\n\ttabIndex = 0,\n\tclassName,\n\tmaxWidth,\n\tlayoutClassName,\n\theaderClassName,\n\tbodyClassName,\n\theader,\n\tchildren\n}: PickerPopupProps) {\n\treturn (\n\t\t<AnimatePresence>\n\t\t\t{open && (\n\t\t\t\t<FloatingPortal>\n\t\t\t\t\t<FloatingFocusManager context={context} modal={false} initialFocus={initialFocus} returnFocus={returnFocus}>\n\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\tref={setFloating}\n\t\t\t\t\t\t\tstyle={{ ...floatingStyles, maxWidth }}\n\t\t\t\t\t\t\tinitial={{ opacity: 0, scale: 0.95 }}\n\t\t\t\t\t\t\tanimate={{ opacity: 1, scale: 1 }}\n\t\t\t\t\t\t\texit={{ opacity: 0, scale: 0.95 }}\n\t\t\t\t\t\t\t{...getFloatingProps({\n\t\t\t\t\t\t\t\tid: listId,\n\t\t\t\t\t\t\t\trole: popupRole,\n\t\t\t\t\t\t\t\ttabIndex,\n\t\t\t\t\t\t\t\t\"aria-labelledby\": labelId,\n\t\t\t\t\t\t\t\t\"aria-label\": labelId ? undefined : popupAriaLabel,\n\t\t\t\t\t\t\t\t\"aria-describedby\": descriptionId,\n\t\t\t\t\t\t\t\t\"aria-activedescendant\": activeOptionId,\n\t\t\t\t\t\t\t\t\"aria-multiselectable\": ariaMultiselectable || undefined,\n\t\t\t\t\t\t\t\tonMouseDown: stopNestedFloatingMouseDown,\n\t\t\t\t\t\t\t\tonKeyDown,\n\t\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t\t})}>\n\t\t\t\t\t\t\t<div className={cn(styles.popupLayout, layoutClassName)}>\n\t\t\t\t\t\t\t\t{header ? (\n\t\t\t\t\t\t\t\t\t<div className={headerClassName}>\n\t\t\t\t\t\t\t\t\t\t{header}\n\t\t\t\t\t\t\t\t\t\t<Separator className=\"marginBlockSm\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<div />\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t<div className={cn(styles.popupBody, bodyClassName)}>{children}</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t</FloatingFocusManager>\n\t\t\t\t</FloatingPortal>\n\t\t\t)}\n\t\t</AnimatePresence>\n\t);\n}\n","import { type Ref } from \"react\";\n\nimport { Grid } from \"../grid\";\n\nimport styles from \"./Picker.module.scss\";\n\ntype PickerSelectionToolbarProps = {\n\tonSelectAll: () => void;\n\tonDeselectAll: () => void;\n\tselectAllButtonRef?: Ref<HTMLButtonElement>;\n};\n\n/**\n * Общая панель массовых действий для picker-компонентов с множественным выбором.\n * Компонент не знает формат значения и делегирует изменение владельцу selection-модели.\n */\nexport function PickerSelectionToolbar({ onSelectAll, onDeselectAll, selectAllButtonRef }: PickerSelectionToolbarProps) {\n\treturn (\n\t\t<Grid.Container gap=\"xs\" templateColumns=\"1fr 1fr\">\n\t\t\t<button\n\t\t\t\tref={selectAllButtonRef}\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName={styles.selectionActionButton}\n\t\t\t\tonClick={onSelectAll}\n\t\t\t\tdata-ui=\"picker-select-all\"\n\t\t\t\tdata-action=\"select-all\">\n\t\t\t\tВыбрать все\n\t\t\t</button>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName={styles.selectionActionButton}\n\t\t\t\tonClick={onDeselectAll}\n\t\t\t\tdata-ui=\"picker-deselect-all\"\n\t\t\t\tdata-action=\"deselect-all\">\n\t\t\t\tСнять выбор\n\t\t\t</button>\n\t\t</Grid.Container>\n\t);\n}\n","import { ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport uiStyles from \"../ui.module.scss\";\n\nimport styles from \"./Picker.module.scss\";\n\ninterface PickerStatusProps {\n\temptyState?: ReactNode;\n\tloadingState?: ReactNode;\n\terrorState?: ReactNode;\n}\n\nexport function PickerStatus({ emptyState, loadingState, errorState }: PickerStatusProps) {\n\tconst content = errorState ?? loadingState ?? emptyState;\n\n\tif (content === undefined || content === null) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className={cn(uiStyles.uiPopupOption, styles.status, errorState !== undefined && styles.statusError)} aria-disabled={true}>\n\t\t\t{content}\n\t\t</div>\n\t);\n}\n","import { MouseEvent, ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { ChevronDownIcon } from \"lucide-react\";\n\nimport uiStyles from \"../ui.module.scss\";\n\ninterface PickerTriggerActionsProps {\n\topen: boolean;\n\tdisabled?: boolean;\n\tchildren?: ReactNode;\n\tonToggleMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;\n\tonToggleClick: () => void;\n\topenAriaLabel?: string;\n\tcloseAriaLabel?: string;\n}\n\nexport function PickerTriggerActions({\n\topen,\n\tdisabled,\n\tchildren,\n\tonToggleMouseDown,\n\tonToggleClick,\n\topenAriaLabel = \"Открыть список\",\n\tcloseAriaLabel = \"Закрыть список\"\n}: PickerTriggerActionsProps) {\n\treturn (\n\t\t<div className={uiStyles.uiToggleButtonContainer} data-disabled={disabled || undefined}>\n\t\t\t{children}\n\n\t\t\t<div className={uiStyles.uiButtonSeparator} />\n\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\taria-label={open ? closeAriaLabel : openAriaLabel}\n\t\t\t\tclassName={uiStyles.uiToggleButton}\n\t\t\t\tonMouseDown={onToggleMouseDown}\n\t\t\t\tonClick={onToggleClick}>\n\t\t\t\t<ChevronDownIcon className={cn(uiStyles.uiToggleIcon, open && uiStyles.uiToggleIconOpen)} />\n\t\t\t</button>\n\t\t</div>\n\t);\n}\n","import { ComponentPropsWithoutRef, forwardRef, ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { InputControl } from \"../input\";\nimport uiStyles from \"../ui.module.scss\";\n\nimport styles from \"./Picker.module.scss\";\n\ninterface PickerTriggerInputProps extends Omit<ComponentPropsWithoutRef<\"input\">, \"size\"> {\n\trootRef?: (node: HTMLDivElement | null) => void;\n\tendAdornment?: ReactNode;\n\toverlay?: ReactNode;\n\trootClassName?: string;\n\tinputClassName?: string;\n}\n\nexport const PickerTriggerInput = forwardRef<HTMLInputElement, PickerTriggerInputProps>(\n\t({ rootRef, endAdornment, overlay, rootClassName, inputClassName, ...props }, ref) => {\n\t\treturn (\n\t\t\t<div ref={rootRef} className={cn(uiStyles.uiInputContainer, styles.triggerContainer, rootClassName)}>\n\t\t\t\t<InputControl endAdornment={endAdornment}>\n\t\t\t\t\t{({ controlClassName }) => (\n\t\t\t\t\t\t<input {...props} ref={ref} className={cn(uiStyles.uiInputWithToggle, controlClassName, inputClassName)} />\n\t\t\t\t\t)}\n\t\t\t\t</InputControl>\n\t\t\t\t{overlay}\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nPickerTriggerInput.displayName = \"PickerTriggerInput\";\n","export type PickerTriggerMode = \"display\" | \"search-single\" | \"search-multi\";\n\ninterface PickerTriggerTextFocusParams {\n\topen: boolean;\n\tcurrentQuery: string;\n\thasDisplayValue: boolean;\n}\n\nexport interface PickerTriggerPolicy {\n\tfocusFloatingOnOpen: boolean;\n\trestoreFocusOnClose: boolean;\n\tresetQueryOnClose: boolean;\n\tshouldOpenOnTriggerClick: (open: boolean) => boolean;\n\tshouldOpenOnInputChange: (open: boolean) => boolean;\n\tshouldFocusReferenceOnToggle: (open: boolean) => boolean;\n\tshouldSelectTriggerTextOnFocus: (params: PickerTriggerTextFocusParams) => boolean;\n}\n\n/**\n * Единая политика поведения trigger-input для picker-компонентов.\n * Нормализует различия между display-режимом, single-search и multi-search.\n */\nexport function createPickerTriggerPolicy(mode: PickerTriggerMode): PickerTriggerPolicy {\n\tswitch (mode) {\n\t\tcase \"search-single\":\n\t\t\treturn {\n\t\t\t\tfocusFloatingOnOpen: false,\n\t\t\t\trestoreFocusOnClose: false,\n\t\t\t\tresetQueryOnClose: true,\n\t\t\t\tshouldOpenOnTriggerClick: () => false,\n\t\t\t\tshouldOpenOnInputChange: (open) => !open,\n\t\t\t\tshouldFocusReferenceOnToggle: (open) => !open,\n\t\t\t\tshouldSelectTriggerTextOnFocus: ({ open, currentQuery, hasDisplayValue }) =>\n\t\t\t\t\t!open && currentQuery.length === 0 && hasDisplayValue\n\t\t\t};\n\t\tcase \"search-multi\":\n\t\t\treturn {\n\t\t\t\tfocusFloatingOnOpen: false,\n\t\t\t\trestoreFocusOnClose: false,\n\t\t\t\tresetQueryOnClose: true,\n\t\t\t\tshouldOpenOnTriggerClick: () => false,\n\t\t\t\tshouldOpenOnInputChange: (open) => !open,\n\t\t\t\tshouldFocusReferenceOnToggle: (open) => !open,\n\t\t\t\tshouldSelectTriggerTextOnFocus: () => false\n\t\t\t};\n\t\tcase \"display\":\n\t\tdefault:\n\t\t\treturn {\n\t\t\t\tfocusFloatingOnOpen: true,\n\t\t\t\trestoreFocusOnClose: true,\n\t\t\t\tresetQueryOnClose: false,\n\t\t\t\tshouldOpenOnTriggerClick: (open) => !open,\n\t\t\t\tshouldOpenOnInputChange: () => false,\n\t\t\t\tshouldFocusReferenceOnToggle: () => false,\n\t\t\t\tshouldSelectTriggerTextOnFocus: () => false\n\t\t\t};\n\t}\n}\n","import { ReactNode } from \"react\";\n\nexport function extractPickerTextContent(node: ReactNode): string | undefined {\n\tif (typeof node === \"string\" || typeof node === \"number\") {\n\t\treturn String(node);\n\t}\n\n\tif (Array.isArray(node)) {\n\t\tconst values = node.map(extractPickerTextContent).filter((value): value is string => Boolean(value));\n\t\treturn values.length ? values.join(\" \") : undefined;\n\t}\n\n\treturn undefined;\n}\n","import { useMemo } from \"react\";\n\nimport { normalizeTextToLower } from \"@ryuzaki13/react-foundation-lib/formatters\";\n\ninterface UsePickerDefaultFilterOptions<T> {\n\toptions: readonly T[];\n\tquery: string;\n\tenabled?: boolean;\n\tgetSearchText: (option: T) => unknown;\n}\n\nfunction normalizeSearchText(value: unknown) {\n\tconst parts = Array.isArray(value) ? value : [value];\n\n\treturn normalizeTextToLower(parts.filter(Boolean).join(\" \"));\n}\n\nexport function usePickerDefaultFilter<T>({ options, query, enabled = true, getSearchText }: UsePickerDefaultFilterOptions<T>) {\n\tconst normalizedQuery = normalizeTextToLower(query);\n\n\treturn useMemo(() => {\n\t\tif (!enabled || !normalizedQuery) {\n\t\t\treturn [...options];\n\t\t}\n\n\t\treturn options.filter((option) => normalizeSearchText(getSearchText(option)).includes(normalizedQuery));\n\t}, [enabled, getSearchText, normalizedQuery, options]);\n}\n","import { Placement } from \"@floating-ui/react\";\nimport {\n\ttype FloatingListboxPlacementStrategy,\n\ttype FloatingListboxSizeResolver,\n\tuseFloatingListbox\n} from \"@ryuzaki13/react-foundation-lib/hooks\";\n\nimport { PickerTriggerMode, createPickerTriggerPolicy } from \"./createPickerTriggerPolicy\";\n\ninterface UsePickerFloatingListboxParams<T> {\n\toptions: readonly T[];\n\tselectedIndex: number;\n\topen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n\tgetOptionDisabled?: (option: T) => boolean;\n\tonSelect?: (option: T) => void;\n\tdisabled?: boolean;\n\tplacement?: Placement;\n\tplacementStrategy?: FloatingListboxPlacementStrategy;\n\tcloseOnSelect?: boolean;\n\tfocusFloatingOnOpen?: boolean;\n\tallowOpenWithoutOptions?: boolean;\n\trestoreFocusOnClose?: boolean;\n\ttriggerMode?: PickerTriggerMode;\n\tresolveFloatingSize?: FloatingListboxSizeResolver;\n}\n\n/**\n * Единая точка входа для popup/listbox поведения во всех picker-компонентах.\n */\nexport function usePickerFloatingListbox<T>(params: UsePickerFloatingListboxParams<T>) {\n\tconst triggerPolicy = params.triggerMode ? createPickerTriggerPolicy(params.triggerMode) : undefined;\n\n\treturn useFloatingListbox({\n\t\t...params,\n\t\tfocusFloatingOnOpen: params.focusFloatingOnOpen ?? triggerPolicy?.focusFloatingOnOpen,\n\t\trestoreFocusOnClose: params.restoreFocusOnClose ?? triggerPolicy?.restoreFocusOnClose\n\t});\n}\n","import { useEffect, useEffectEvent, useRef, useState } from \"react\";\n\nimport { PickerTriggerMode, createPickerTriggerPolicy } from \"./createPickerTriggerPolicy\";\n\ninterface UsePickerQueryOptions {\n\topen: boolean;\n\tquery?: string;\n\tdefaultQuery?: string;\n\tonQuery?: (value: string) => void;\n\tresetOnClose?: boolean;\n\ttriggerMode?: PickerTriggerMode;\n}\n\nexport function usePickerQuery({ open, query, defaultQuery, onQuery, resetOnClose, triggerMode }: UsePickerQueryOptions) {\n\tconst previousOpenRef = useRef(false);\n\tconst isControlled = query !== undefined;\n\tconst [internalQuery, setInternalQuery] = useState(defaultQuery ?? \"\");\n\tconst currentQuery = isControlled ? (query ?? \"\") : internalQuery;\n\tconst syncResetInternalQuery = useEffectEvent(() => setInternalQuery(\"\"));\n\tconst resolvedResetOnClose = resetOnClose ?? (triggerMode ? createPickerTriggerPolicy(triggerMode).resetQueryOnClose : true);\n\n\tuseEffect(() => {\n\t\tif (previousOpenRef.current && !open && resolvedResetOnClose) {\n\t\t\tif (!isControlled) {\n\t\t\t\tsyncResetInternalQuery();\n\t\t\t}\n\n\t\t\tonQuery?.(\"\");\n\t\t}\n\n\t\tpreviousOpenRef.current = open;\n\t}, [isControlled, onQuery, open, resolvedResetOnClose]);\n\n\tconst setQuery = (nextValue: string) => {\n\t\tif (!isControlled) {\n\t\t\tsetInternalQuery(nextValue);\n\t\t}\n\n\t\tonQuery?.(nextValue);\n\t};\n\n\treturn {\n\t\tquery: currentQuery,\n\t\tsetQuery,\n\t\tclearQuery: () => setQuery(\"\")\n\t};\n}\n","import { useEffect, useEffectEvent, useRef, useState } from \"react\";\n\ninterface UsePickerSelectionLifecycleOptions<TValue> {\n\tvalue: TValue;\n\topen: boolean;\n\tonCommit: (value: TValue) => void;\n\tonOpen?: () => void;\n\tonClose?: (value: TValue) => void;\n\tisEqual: (left: TValue, right: TValue) => boolean;\n}\n\n/**\n * Общий жизненный цикл чернового выбора для picker-компонентов,\n * где изменения подтверждаются при закрытии popup.\n */\nexport function usePickerSelectionLifecycle<TValue>({\n\tvalue,\n\topen,\n\tonCommit,\n\tonOpen,\n\tonClose,\n\tisEqual\n}: UsePickerSelectionLifecycleOptions<TValue>) {\n\tconst previousOpenRef = useRef(false);\n\tconst [draftValue, setDraftValue] = useState(value);\n\tconst syncDraftValue = useEffectEvent((value: TValue) => setDraftValue(value));\n\n\tuseEffect(() => {\n\t\tif (!open) {\n\t\t\tsyncDraftValue(value);\n\t\t}\n\t}, [open, value]);\n\n\tuseEffect(() => {\n\t\tif (previousOpenRef.current && !open) {\n\t\t\tif (!isEqual(draftValue, value)) {\n\t\t\t\tonCommit(draftValue);\n\t\t\t}\n\n\t\t\tonClose?.(draftValue);\n\t\t}\n\n\t\tpreviousOpenRef.current = open;\n\t}, [draftValue, isEqual, onClose, onCommit, open, value]);\n\n\tconst prepareOpen = () => {\n\t\tsetDraftValue(value);\n\t\tonOpen?.();\n\t};\n\n\treturn {\n\t\tdraftValue,\n\t\tsetDraftValue,\n\t\tprepareOpen\n\t};\n}\n","import { MouseEvent, RefObject } from \"react\";\n\nimport { PickerTriggerMode, createPickerTriggerPolicy } from \"./createPickerTriggerPolicy\";\n\ninterface UsePickerTriggerControllerOptions {\n\tmode: PickerTriggerMode;\n\topen: boolean;\n\tcurrentQuery: string;\n\thasDisplayValue: boolean;\n\tinputRef: RefObject<HTMLInputElement | null>;\n\tsetQuery?: (value: string) => void;\n\topenList?: () => void;\n\tclose?: () => void;\n\ttoggleOpen?: () => void;\n\tonBeforeOpen?: () => void;\n}\n\ninterface HandleTriggerKeyDownOptions {\n\tevent: React.KeyboardEvent<HTMLElement>;\n\tonActivateWhenOpen?: () => void;\n\tenableSpaceActivation?: boolean;\n\tenableClosedArrowDownOpen?: boolean;\n\tsuppressClosedArrowUp?: boolean;\n}\n\nfunction focusInput(inputRef: RefObject<HTMLInputElement | null>) {\n\trequestAnimationFrame(() => {\n\t\tinputRef.current?.focus();\n\t});\n}\n\n/**\n * Единый контроллер пользовательских действий на trigger-input.\n * Держит поведение display/search-single/search-multi в одном месте.\n */\nexport function usePickerTriggerController({\n\tmode,\n\topen,\n\tcurrentQuery,\n\thasDisplayValue,\n\tinputRef,\n\tsetQuery,\n\topenList,\n\tclose,\n\ttoggleOpen,\n\tonBeforeOpen\n}: UsePickerTriggerControllerOptions) {\n\tconst policy = createPickerTriggerPolicy(mode);\n\n\tconst openTrigger = () => {\n\t\tonBeforeOpen?.();\n\n\t\tif (openList) {\n\t\t\topenList();\n\t\t\treturn;\n\t\t}\n\n\t\ttoggleOpen?.();\n\t};\n\n\tconst closeTrigger = () => {\n\t\tif (close) {\n\t\t\tclose();\n\t\t\treturn;\n\t\t}\n\n\t\ttoggleOpen?.();\n\t};\n\n\tconst toggleTrigger = () => {\n\t\tif (open) {\n\t\t\tcloseTrigger();\n\t\t} else {\n\t\t\topenTrigger();\n\t\t}\n\n\t\tif (policy.shouldFocusReferenceOnToggle(open)) {\n\t\t\tfocusInput(inputRef);\n\t\t}\n\t};\n\n\treturn {\n\t\tpolicy,\n\t\thandleTriggerInputChange: (nextValue: string) => {\n\t\t\tsetQuery?.(nextValue);\n\n\t\t\tif (policy.shouldOpenOnInputChange(open)) {\n\t\t\t\topenTrigger();\n\t\t\t}\n\t\t},\n\t\thandleTriggerClick: () => {\n\t\t\tif (policy.shouldOpenOnTriggerClick(open)) {\n\t\t\t\topenTrigger();\n\t\t\t}\n\t\t},\n\t\thandleTriggerFocus: (input: HTMLInputElement) => {\n\t\t\tif (\n\t\t\t\tpolicy.shouldSelectTriggerTextOnFocus({\n\t\t\t\t\topen,\n\t\t\t\t\tcurrentQuery,\n\t\t\t\t\thasDisplayValue\n\t\t\t\t})\n\t\t\t) {\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\tinput.select();\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\thandleToggleMouseDown: (event: MouseEvent<HTMLButtonElement>) => {\n\t\t\tevent.preventDefault();\n\t\t},\n\t\thandleToggleClick: () => {\n\t\t\ttoggleTrigger();\n\t\t},\n\t\thandleTriggerKeyDown: ({\n\t\t\tevent,\n\t\t\tonActivateWhenOpen,\n\t\t\tenableSpaceActivation = false,\n\t\t\tenableClosedArrowDownOpen = false,\n\t\t\tsuppressClosedArrowUp = false\n\t\t}: HandleTriggerKeyDownOptions) => {\n\t\t\tif (!open && suppressClosedArrowUp && event.key === \"ArrowUp\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!open && enableClosedArrowDownOpen && event.key === \"ArrowDown\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\ttoggleTrigger();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"Enter\") {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tif (open) {\n\t\t\t\t\tonActivateWhenOpen?.();\n\t\t\t\t} else {\n\t\t\t\t\ttoggleTrigger();\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (enableSpaceActivation && event.key === \" \") {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tif (open) {\n\t\t\t\t\tonActivateWhenOpen?.();\n\t\t\t\t} else {\n\t\t\t\t\ttoggleTrigger();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\ttoggleTrigger\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;AAOA,SAAgB,EAAsC,EACrD,OACA,UACA,gBACA,aACA,SACA,cACA,UACA,eAC4B;CAC5B,IAAM,EAAE,cAAW,YAAS,kBAAe,YAAS,mBAAgB,EAAiB;EACpF;EACA,UAAU,KAAiC;EAC3C,gBAAgB,CAAC,CAAC;EAClB,UAAU,CAAC,CAAC;CACb,CAAC;CAED,OACC,kBAAC,GAAD;EACQ;EACM;EACH;EACJ;EACK;EACJ;EACI;EACF;EACM;EACN;EACR,UAAA,EAAS;GAAE;GAAW;GAAS;GAAe;GAAS;EAAY,CAAC;CAC7D,CAAA;AAEX;;;;;;;;;;;AEHA,SAAS,EAA4B,GAAsC;CAC1E,EAAM,gBAAgB;AACvB;AAEA,SAAgB,EAAY,EAC3B,SACA,YACA,mBACA,WACA,YACA,mBACA,kBACA,mBACA,wBACA,eAAY,WACZ,gBACA,qBACA,cACA,kBAAe,IACf,iBAAc,IACd,cAAW,GACX,cACA,aACA,oBACA,oBACA,kBACA,WACA,eACoB;CACpB,OACC,kBAAC,GAAD,EAAA,UACE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Lwgl1c.js","names":[],"sources":["../../src/picker/PickerField.tsx","../../src/picker/Picker.module.scss","../../src/picker/PickerPopup.tsx","../../src/picker/PickerSelectionToolbar.tsx","../../src/picker/PickerStatus.tsx","../../src/picker/PickerTriggerActions.tsx","../../src/picker/PickerTriggerInput.tsx","../../src/picker/model/createPickerTriggerPolicy.ts","../../src/picker/model/extractPickerTextContent.ts","../../src/picker/model/usePickerDefaultFilter.ts","../../src/picker/model/usePickerFloatingListbox.ts","../../src/picker/model/usePickerQuery.ts","../../src/picker/model/usePickerSelectionLifecycle.ts","../../src/picker/model/usePickerTriggerController.ts"],"sourcesContent":["import { InputType } from \"@ryuzaki13/react-foundation-lib/types\";\n\nimport { InputUI } from \"../input\";\nimport { useInputFieldIds } from \"../input/lib/useInputFieldIds\";\n\nimport { PickerFieldProps } from \"./types\";\n\nexport function PickerField<TValue extends InputType>({\n\tid,\n\tlabel,\n\tdescription,\n\tdisabled,\n\tsize,\n\tclassName,\n\terror,\n\tchildren\n}: PickerFieldProps<TValue>) {\n\tconst { controlId, labelId, descriptionId, errorId, describedBy } = useInputFieldIds({\n\t\tid,\n\t\thasLabel: label !== undefined && label !== null,\n\t\thasDescription: !!description,\n\t\thasError: !!error\n\t});\n\n\treturn (\n\t\t<InputUI\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled}\n\t\t\tsize={size}\n\t\t\tclassName={className}\n\t\t\terror={error}\n\t\t\tcontrolId={controlId}\n\t\t\tlabelId={labelId}\n\t\t\tdescriptionId={descriptionId}\n\t\t\terrorId={errorId}>\n\t\t\t{children({ controlId, labelId, descriptionId, errorId, describedBy })}\n\t\t</InputUI>\n\t);\n}\n",".popupLayout {\n\tdisplay: grid;\n\tgrid-template-rows: auto 1fr;\n\tmin-height: 0;\n\tmax-height: 75vh;\n\toverflow: hidden;\n\n\tflex: 1 1 auto;\n}\n\n.popupBody {\n\tmin-height: 0;\n}\n\n.status {\n\tpadding: var(--space-xs) var(--space-sm);\n\tcolor: var(--content-2);\n}\n\n.statusError {\n\tcolor: var(--status-error-text);\n}\n\n.triggerContainer {\n\tposition: relative;\n}\n\n.selectionActionButton {\n\tfont-size: var(--font-size-sm);\n\tpadding-block: var(--space-xs);\n\tborder-radius: var(--radius-sm);\n\n\t&:hover {\n\t\tbackground-color: var(--surface-2);\n\t}\n}\n","import { type CSSProperties, type KeyboardEvent, type MouseEvent, type ReactNode } from \"react\";\n\nimport { FloatingContext, FloatingFocusManager, FloatingPortal } from \"@floating-ui/react\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { AnimatePresence, motion } from \"motion/react\";\n\nimport { Separator } from \"../separator\";\n\nimport styles from \"./Picker.module.scss\";\n\ninterface PickerPopupProps {\n\topen: boolean;\n\tcontext: FloatingContext;\n\tfloatingStyles: CSSProperties;\n\tlistId: string;\n\tlabelId?: string;\n\tpopupAriaLabel?: string;\n\tdescriptionId?: string;\n\tactiveOptionId?: string;\n\tariaMultiselectable?: boolean;\n\tpopupRole?: \"listbox\" | \"dialog\";\n\tsetFloating: (node: HTMLElement | null) => void;\n\tgetFloatingProps: (userProps?: Record<string, unknown>) => Record<string, unknown>;\n\tonKeyDown: (event: KeyboardEvent<HTMLElement>) => void;\n\tinitialFocus?: number;\n\treturnFocus?: boolean;\n\ttabIndex?: number;\n\tclassName?: string;\n\tmaxWidth?: CSSProperties[\"maxWidth\"];\n\tlayoutClassName?: string;\n\theaderClassName?: string;\n\tbodyClassName?: string;\n\theader?: ReactNode;\n\tchildren: ReactNode;\n}\n\nfunction stopNestedFloatingMouseDown(event: MouseEvent<HTMLElement>): void {\n\tevent.stopPropagation();\n}\n\nexport function PickerPopup({\n\topen,\n\tcontext,\n\tfloatingStyles,\n\tlistId,\n\tlabelId,\n\tpopupAriaLabel,\n\tdescriptionId,\n\tactiveOptionId,\n\tariaMultiselectable,\n\tpopupRole = \"listbox\",\n\tsetFloating,\n\tgetFloatingProps,\n\tonKeyDown,\n\tinitialFocus = -1,\n\treturnFocus = false,\n\ttabIndex = 0,\n\tclassName,\n\tmaxWidth,\n\tlayoutClassName,\n\theaderClassName,\n\tbodyClassName,\n\theader,\n\tchildren\n}: PickerPopupProps) {\n\treturn (\n\t\t<AnimatePresence>\n\t\t\t{open && (\n\t\t\t\t<FloatingPortal>\n\t\t\t\t\t<FloatingFocusManager context={context} modal={false} initialFocus={initialFocus} returnFocus={returnFocus}>\n\t\t\t\t\t\t<motion.div\n\t\t\t\t\t\t\tref={setFloating}\n\t\t\t\t\t\t\tstyle={{ ...floatingStyles, maxWidth }}\n\t\t\t\t\t\t\tinitial={{ opacity: 0, scale: 0.95 }}\n\t\t\t\t\t\t\tanimate={{ opacity: 1, scale: 1 }}\n\t\t\t\t\t\t\texit={{ opacity: 0, scale: 0.95 }}\n\t\t\t\t\t\t\t{...getFloatingProps({\n\t\t\t\t\t\t\t\tid: listId,\n\t\t\t\t\t\t\t\trole: popupRole,\n\t\t\t\t\t\t\t\ttabIndex,\n\t\t\t\t\t\t\t\t\"aria-labelledby\": labelId,\n\t\t\t\t\t\t\t\t\"aria-label\": labelId ? undefined : popupAriaLabel,\n\t\t\t\t\t\t\t\t\"aria-describedby\": descriptionId,\n\t\t\t\t\t\t\t\t\"aria-activedescendant\": activeOptionId,\n\t\t\t\t\t\t\t\t\"aria-multiselectable\": ariaMultiselectable || undefined,\n\t\t\t\t\t\t\t\tonMouseDown: stopNestedFloatingMouseDown,\n\t\t\t\t\t\t\t\tonKeyDown,\n\t\t\t\t\t\t\t\tclassName\n\t\t\t\t\t\t\t})}>\n\t\t\t\t\t\t\t<div className={cn(styles.popupLayout, layoutClassName)}>\n\t\t\t\t\t\t\t\t{header ? (\n\t\t\t\t\t\t\t\t\t<div className={headerClassName}>\n\t\t\t\t\t\t\t\t\t\t{header}\n\t\t\t\t\t\t\t\t\t\t<Separator className=\"marginBlockSm\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<div />\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t<div className={cn(styles.popupBody, bodyClassName)}>{children}</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</motion.div>\n\t\t\t\t\t</FloatingFocusManager>\n\t\t\t\t</FloatingPortal>\n\t\t\t)}\n\t\t</AnimatePresence>\n\t);\n}\n","import { type Ref } from \"react\";\n\nimport { Grid } from \"../grid\";\n\nimport styles from \"./Picker.module.scss\";\n\ntype PickerSelectionToolbarProps = {\n\tonSelectAll: () => void;\n\tonDeselectAll: () => void;\n\tselectAllButtonRef?: Ref<HTMLButtonElement>;\n};\n\n/**\n * Общая панель массовых действий для picker-компонентов с множественным выбором.\n * Компонент не знает формат значения и делегирует изменение владельцу selection-модели.\n */\nexport function PickerSelectionToolbar({ onSelectAll, onDeselectAll, selectAllButtonRef }: PickerSelectionToolbarProps) {\n\treturn (\n\t\t<Grid.Container gap=\"xs\" templateColumns=\"1fr 1fr\">\n\t\t\t<button\n\t\t\t\tref={selectAllButtonRef}\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName={styles.selectionActionButton}\n\t\t\t\tonClick={onSelectAll}\n\t\t\t\tdata-ui=\"picker-select-all\"\n\t\t\t\tdata-action=\"select-all\">\n\t\t\t\tВыбрать все\n\t\t\t</button>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName={styles.selectionActionButton}\n\t\t\t\tonClick={onDeselectAll}\n\t\t\t\tdata-ui=\"picker-deselect-all\"\n\t\t\t\tdata-action=\"deselect-all\">\n\t\t\t\tСнять выбор\n\t\t\t</button>\n\t\t</Grid.Container>\n\t);\n}\n","import { ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport uiStyles from \"../ui.module.scss\";\n\nimport styles from \"./Picker.module.scss\";\n\ninterface PickerStatusProps {\n\temptyState?: ReactNode;\n\tloadingState?: ReactNode;\n\terrorState?: ReactNode;\n}\n\nexport function PickerStatus({ emptyState, loadingState, errorState }: PickerStatusProps) {\n\tconst content = errorState ?? loadingState ?? emptyState;\n\n\tif (content === undefined || content === null) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className={cn(uiStyles.uiPopupOption, styles.status, errorState !== undefined && styles.statusError)} aria-disabled={true}>\n\t\t\t{content}\n\t\t</div>\n\t);\n}\n","import { MouseEvent, ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { ChevronDownIcon } from \"lucide-react\";\n\nimport uiStyles from \"../ui.module.scss\";\n\ninterface PickerTriggerActionsProps {\n\topen: boolean;\n\tdisabled?: boolean;\n\tchildren?: ReactNode;\n\tonToggleMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;\n\tonToggleClick: () => void;\n\topenAriaLabel?: string;\n\tcloseAriaLabel?: string;\n}\n\nexport function PickerTriggerActions({\n\topen,\n\tdisabled,\n\tchildren,\n\tonToggleMouseDown,\n\tonToggleClick,\n\topenAriaLabel = \"Открыть список\",\n\tcloseAriaLabel = \"Закрыть список\"\n}: PickerTriggerActionsProps) {\n\treturn (\n\t\t<div className={uiStyles.uiToggleButtonContainer} data-disabled={disabled || undefined}>\n\t\t\t{children}\n\n\t\t\t<div className={uiStyles.uiButtonSeparator} />\n\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\taria-label={open ? closeAriaLabel : openAriaLabel}\n\t\t\t\tclassName={uiStyles.uiToggleButton}\n\t\t\t\tonMouseDown={onToggleMouseDown}\n\t\t\t\tonClick={onToggleClick}>\n\t\t\t\t<ChevronDownIcon className={cn(uiStyles.uiToggleIcon, open && uiStyles.uiToggleIconOpen)} />\n\t\t\t</button>\n\t\t</div>\n\t);\n}\n","import { ComponentPropsWithoutRef, forwardRef, ReactNode } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { InputControl } from \"../input\";\nimport uiStyles from \"../ui.module.scss\";\n\nimport styles from \"./Picker.module.scss\";\n\ninterface PickerTriggerInputProps extends Omit<ComponentPropsWithoutRef<\"input\">, \"size\"> {\n\trootRef?: (node: HTMLDivElement | null) => void;\n\tendAdornment?: ReactNode;\n\toverlay?: ReactNode;\n\trootClassName?: string;\n\tinputClassName?: string;\n}\n\nexport const PickerTriggerInput = forwardRef<HTMLInputElement, PickerTriggerInputProps>(\n\t({ rootRef, endAdornment, overlay, rootClassName, inputClassName, ...props }, ref) => {\n\t\treturn (\n\t\t\t<div ref={rootRef} className={cn(uiStyles.uiInputContainer, styles.triggerContainer, rootClassName)}>\n\t\t\t\t<InputControl endAdornment={endAdornment}>\n\t\t\t\t\t{({ controlClassName }) => (\n\t\t\t\t\t\t<input {...props} ref={ref} className={cn(uiStyles.uiInputWithToggle, controlClassName, inputClassName)} />\n\t\t\t\t\t)}\n\t\t\t\t</InputControl>\n\t\t\t\t{overlay}\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nPickerTriggerInput.displayName = \"PickerTriggerInput\";\n","export type PickerTriggerMode = \"display\" | \"search-single\" | \"search-multi\";\n\ninterface PickerTriggerTextFocusParams {\n\topen: boolean;\n\tcurrentQuery: string;\n\thasDisplayValue: boolean;\n}\n\nexport interface PickerTriggerPolicy {\n\tfocusFloatingOnOpen: boolean;\n\trestoreFocusOnClose: boolean;\n\tresetQueryOnClose: boolean;\n\tshouldOpenOnTriggerClick: (open: boolean) => boolean;\n\tshouldOpenOnInputChange: (open: boolean) => boolean;\n\tshouldFocusReferenceOnToggle: (open: boolean) => boolean;\n\tshouldSelectTriggerTextOnFocus: (params: PickerTriggerTextFocusParams) => boolean;\n}\n\n/**\n * Единая политика поведения trigger-input для picker-компонентов.\n * Нормализует различия между display-режимом, single-search и multi-search.\n */\nexport function createPickerTriggerPolicy(mode: PickerTriggerMode): PickerTriggerPolicy {\n\tswitch (mode) {\n\t\tcase \"search-single\":\n\t\t\treturn {\n\t\t\t\tfocusFloatingOnOpen: false,\n\t\t\t\trestoreFocusOnClose: false,\n\t\t\t\tresetQueryOnClose: true,\n\t\t\t\tshouldOpenOnTriggerClick: () => false,\n\t\t\t\tshouldOpenOnInputChange: (open) => !open,\n\t\t\t\tshouldFocusReferenceOnToggle: (open) => !open,\n\t\t\t\tshouldSelectTriggerTextOnFocus: ({ open, currentQuery, hasDisplayValue }) =>\n\t\t\t\t\t!open && currentQuery.length === 0 && hasDisplayValue\n\t\t\t};\n\t\tcase \"search-multi\":\n\t\t\treturn {\n\t\t\t\tfocusFloatingOnOpen: false,\n\t\t\t\trestoreFocusOnClose: false,\n\t\t\t\tresetQueryOnClose: true,\n\t\t\t\tshouldOpenOnTriggerClick: () => false,\n\t\t\t\tshouldOpenOnInputChange: (open) => !open,\n\t\t\t\tshouldFocusReferenceOnToggle: (open) => !open,\n\t\t\t\tshouldSelectTriggerTextOnFocus: () => false\n\t\t\t};\n\t\tcase \"display\":\n\t\tdefault:\n\t\t\treturn {\n\t\t\t\tfocusFloatingOnOpen: true,\n\t\t\t\trestoreFocusOnClose: true,\n\t\t\t\tresetQueryOnClose: false,\n\t\t\t\tshouldOpenOnTriggerClick: (open) => !open,\n\t\t\t\tshouldOpenOnInputChange: () => false,\n\t\t\t\tshouldFocusReferenceOnToggle: () => false,\n\t\t\t\tshouldSelectTriggerTextOnFocus: () => false\n\t\t\t};\n\t}\n}\n","import { ReactNode } from \"react\";\n\nexport function extractPickerTextContent(node: ReactNode): string | undefined {\n\tif (typeof node === \"string\" || typeof node === \"number\") {\n\t\treturn String(node);\n\t}\n\n\tif (Array.isArray(node)) {\n\t\tconst values = node.map(extractPickerTextContent).filter((value): value is string => Boolean(value));\n\t\treturn values.length ? values.join(\" \") : undefined;\n\t}\n\n\treturn undefined;\n}\n","import { useMemo } from \"react\";\n\nimport { normalizeTextToLower } from \"@ryuzaki13/react-foundation-lib/formatters\";\n\ninterface UsePickerDefaultFilterOptions<T> {\n\toptions: readonly T[];\n\tquery: string;\n\tenabled?: boolean;\n\tgetSearchText: (option: T) => unknown;\n}\n\nfunction normalizeSearchText(value: unknown) {\n\tconst parts = Array.isArray(value) ? value : [value];\n\n\treturn normalizeTextToLower(parts.filter(Boolean).join(\" \"));\n}\n\nexport function usePickerDefaultFilter<T>({ options, query, enabled = true, getSearchText }: UsePickerDefaultFilterOptions<T>) {\n\tconst normalizedQuery = normalizeTextToLower(query);\n\n\treturn useMemo(() => {\n\t\tif (!enabled || !normalizedQuery) {\n\t\t\treturn [...options];\n\t\t}\n\n\t\treturn options.filter((option) => normalizeSearchText(getSearchText(option)).includes(normalizedQuery));\n\t}, [enabled, getSearchText, normalizedQuery, options]);\n}\n","import { Placement } from \"@floating-ui/react\";\nimport {\n\ttype FloatingListboxPlacementStrategy,\n\ttype FloatingListboxSizeResolver,\n\tuseFloatingListbox\n} from \"@ryuzaki13/react-foundation-lib/hooks\";\n\nimport { PickerTriggerMode, createPickerTriggerPolicy } from \"./createPickerTriggerPolicy\";\n\ninterface UsePickerFloatingListboxParams<T> {\n\toptions: readonly T[];\n\tselectedIndex: number;\n\topen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n\tgetOptionDisabled?: (option: T) => boolean;\n\tonSelect?: (option: T) => void;\n\tdisabled?: boolean;\n\tplacement?: Placement;\n\tplacementStrategy?: FloatingListboxPlacementStrategy;\n\tcloseOnSelect?: boolean;\n\tfocusFloatingOnOpen?: boolean;\n\tallowOpenWithoutOptions?: boolean;\n\trestoreFocusOnClose?: boolean;\n\ttriggerMode?: PickerTriggerMode;\n\tresolveFloatingSize?: FloatingListboxSizeResolver;\n}\n\n/**\n * Единая точка входа для popup/listbox поведения во всех picker-компонентах.\n */\nexport function usePickerFloatingListbox<T>(params: UsePickerFloatingListboxParams<T>) {\n\tconst triggerPolicy = params.triggerMode ? createPickerTriggerPolicy(params.triggerMode) : undefined;\n\n\treturn useFloatingListbox({\n\t\t...params,\n\t\tfocusFloatingOnOpen: params.focusFloatingOnOpen ?? triggerPolicy?.focusFloatingOnOpen,\n\t\trestoreFocusOnClose: params.restoreFocusOnClose ?? triggerPolicy?.restoreFocusOnClose\n\t});\n}\n","import { useState } from \"react\";\n\nimport { PickerTriggerMode, createPickerTriggerPolicy } from \"./createPickerTriggerPolicy\";\n\ninterface UsePickerQueryOptions {\n\tquery?: string;\n\tdefaultQuery?: string;\n\tonQuery?: (value: string) => void;\n\tresetOnClose?: boolean;\n\ttriggerMode?: PickerTriggerMode;\n}\n\n/**\n * Управляет controlled/uncontrolled query и возвращает policy закрытия владельцу open-state.\n * Сброс выполняется самим владельцем в событии close, поэтому hook не зеркалит lifecycle через effect.\n */\nexport function usePickerQuery({ query, defaultQuery, onQuery, resetOnClose, triggerMode }: UsePickerQueryOptions) {\n\tconst isControlled = query !== undefined;\n\tconst [internalQuery, setInternalQuery] = useState(defaultQuery ?? \"\");\n\tconst currentQuery = isControlled ? (query ?? \"\") : internalQuery;\n\tconst resolvedResetOnClose = resetOnClose ?? (triggerMode ? createPickerTriggerPolicy(triggerMode).resetQueryOnClose : true);\n\n\tconst setQuery = (nextValue: string) => {\n\t\tif (!isControlled) {\n\t\t\tsetInternalQuery(nextValue);\n\t\t}\n\n\t\tonQuery?.(nextValue);\n\t};\n\n\treturn {\n\t\tquery: currentQuery,\n\t\tsetQuery,\n\t\tclearQuery: () => setQuery(\"\"),\n\t\tresetQueryOnClose: resolvedResetOnClose\n\t};\n}\n","import { useEffect, useRef, useState } from \"react\";\n\ninterface UsePickerSelectionLifecycleOptions<TValue> {\n\tvalue: TValue;\n\topen: boolean;\n\tonCommit: (value: TValue) => void;\n\tonOpen?: () => void;\n\tonClose?: (value: TValue) => void;\n\tisEqual: (left: TValue, right: TValue) => boolean;\n}\n\n/**\n * Общий жизненный цикл чернового выбора для picker-компонентов,\n * где изменения подтверждаются при закрытии popup.\n */\nexport function usePickerSelectionLifecycle<TValue>({\n\tvalue,\n\topen,\n\tonCommit,\n\tonOpen,\n\tonClose,\n\tisEqual\n}: UsePickerSelectionLifecycleOptions<TValue>) {\n\tconst previousOpenRef = useRef(false);\n\tconst [draftValue, setDraftValue] = useState(value);\n\n\tuseEffect(() => {\n\t\tif (previousOpenRef.current && !open) {\n\t\t\tif (!isEqual(draftValue, value)) {\n\t\t\t\tonCommit(draftValue);\n\t\t\t}\n\n\t\t\tonClose?.(draftValue);\n\t\t}\n\n\t\tpreviousOpenRef.current = open;\n\t}, [draftValue, isEqual, onClose, onCommit, open, value]);\n\n\tconst prepareOpen = () => {\n\t\tsetDraftValue(value);\n\t\tonOpen?.();\n\t};\n\n\treturn {\n\t\tdraftValue,\n\t\tsetDraftValue,\n\t\tprepareOpen\n\t};\n}\n","import { MouseEvent, RefObject } from \"react\";\n\nimport { PickerTriggerMode, createPickerTriggerPolicy } from \"./createPickerTriggerPolicy\";\n\ninterface UsePickerTriggerControllerOptions {\n\tmode: PickerTriggerMode;\n\topen: boolean;\n\tcurrentQuery: string;\n\thasDisplayValue: boolean;\n\tinputRef: RefObject<HTMLInputElement | null>;\n\tsetQuery?: (value: string) => void;\n\topenList?: () => void;\n\tclose?: () => void;\n\ttoggleOpen?: () => void;\n\tonBeforeOpen?: () => void;\n}\n\ninterface HandleTriggerKeyDownOptions {\n\tevent: React.KeyboardEvent<HTMLElement>;\n\tonActivateWhenOpen?: () => void;\n\tenableSpaceActivation?: boolean;\n\tenableClosedArrowDownOpen?: boolean;\n\tsuppressClosedArrowUp?: boolean;\n}\n\nfunction focusInput(inputRef: RefObject<HTMLInputElement | null>) {\n\trequestAnimationFrame(() => {\n\t\tinputRef.current?.focus();\n\t});\n}\n\n/**\n * Единый контроллер пользовательских действий на trigger-input.\n * Держит поведение display/search-single/search-multi в одном месте.\n */\nexport function usePickerTriggerController({\n\tmode,\n\topen,\n\tcurrentQuery,\n\thasDisplayValue,\n\tinputRef,\n\tsetQuery,\n\topenList,\n\tclose,\n\ttoggleOpen,\n\tonBeforeOpen\n}: UsePickerTriggerControllerOptions) {\n\tconst policy = createPickerTriggerPolicy(mode);\n\n\tconst openTrigger = () => {\n\t\tonBeforeOpen?.();\n\n\t\tif (openList) {\n\t\t\topenList();\n\t\t\treturn;\n\t\t}\n\n\t\ttoggleOpen?.();\n\t};\n\n\tconst closeTrigger = () => {\n\t\tif (close) {\n\t\t\tclose();\n\t\t\treturn;\n\t\t}\n\n\t\ttoggleOpen?.();\n\t};\n\n\tconst toggleTrigger = () => {\n\t\tif (open) {\n\t\t\tcloseTrigger();\n\t\t} else {\n\t\t\topenTrigger();\n\t\t}\n\n\t\tif (policy.shouldFocusReferenceOnToggle(open)) {\n\t\t\tfocusInput(inputRef);\n\t\t}\n\t};\n\n\treturn {\n\t\tpolicy,\n\t\thandleTriggerInputChange: (nextValue: string) => {\n\t\t\tsetQuery?.(nextValue);\n\n\t\t\tif (policy.shouldOpenOnInputChange(open)) {\n\t\t\t\topenTrigger();\n\t\t\t}\n\t\t},\n\t\thandleTriggerClick: () => {\n\t\t\tif (policy.shouldOpenOnTriggerClick(open)) {\n\t\t\t\topenTrigger();\n\t\t\t}\n\t\t},\n\t\thandleTriggerFocus: (input: HTMLInputElement) => {\n\t\t\tif (\n\t\t\t\tpolicy.shouldSelectTriggerTextOnFocus({\n\t\t\t\t\topen,\n\t\t\t\t\tcurrentQuery,\n\t\t\t\t\thasDisplayValue\n\t\t\t\t})\n\t\t\t) {\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\tinput.select();\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\thandleToggleMouseDown: (event: MouseEvent<HTMLButtonElement>) => {\n\t\t\tevent.preventDefault();\n\t\t},\n\t\thandleToggleClick: () => {\n\t\t\ttoggleTrigger();\n\t\t},\n\t\thandleTriggerKeyDown: ({\n\t\t\tevent,\n\t\t\tonActivateWhenOpen,\n\t\t\tenableSpaceActivation = false,\n\t\t\tenableClosedArrowDownOpen = false,\n\t\t\tsuppressClosedArrowUp = false\n\t\t}: HandleTriggerKeyDownOptions) => {\n\t\t\tif (!open && suppressClosedArrowUp && event.key === \"ArrowUp\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!open && enableClosedArrowDownOpen && event.key === \"ArrowDown\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\ttoggleTrigger();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"Enter\") {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tif (open) {\n\t\t\t\t\tonActivateWhenOpen?.();\n\t\t\t\t} else {\n\t\t\t\t\ttoggleTrigger();\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (enableSpaceActivation && event.key === \" \") {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tif (open) {\n\t\t\t\t\tonActivateWhenOpen?.();\n\t\t\t\t} else {\n\t\t\t\t\ttoggleTrigger();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\ttoggleTrigger\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;AAOA,SAAgB,EAAsC,EACrD,OACA,UACA,gBACA,aACA,SACA,cACA,UACA,eAC4B;CAC5B,IAAM,EAAE,cAAW,YAAS,kBAAe,YAAS,mBAAgB,EAAiB;EACpF;EACA,UAAU,KAAiC;EAC3C,gBAAgB,CAAC,CAAC;EAClB,UAAU,CAAC,CAAC;CACb,CAAC;CAED,OACC,kBAAC,GAAD;EACQ;EACM;EACH;EACJ;EACK;EACJ;EACI;EACF;EACM;EACN;EACR,UAAA,EAAS;GAAE;GAAW;GAAS;GAAe;GAAS;EAAY,CAAC;CAC7D,CAAA;AAEX;;;;;;;;;;;AEHA,SAAS,EAA4B,GAAsC;CAC1E,EAAM,gBAAgB;AACvB;AAEA,SAAgB,EAAY,EAC3B,SACA,YACA,mBACA,WACA,YACA,mBACA,kBACA,mBACA,wBACA,eAAY,WACZ,gBACA,qBACA,cACA,kBAAe,IACf,iBAAc,IACd,cAAW,GACX,cACA,aACA,oBACA,oBACA,kBACA,WACA,eACoB;CACpB,OACC,kBAAC,GAAD,EAAA,UACE,KACA,kBAAC,GAAD,EAAA,UACC,kBAAC,GAA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