@ryuzaki13/react-foundation-ui 3.4.2 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/badge/index.js +65 -2
- package/dist/badge/index.js.map +1 -0
- package/dist/barcode-scanner/index.js +18 -18
- package/dist/base-table/index.js +2 -2
- package/dist/button/index.js +1 -1
- package/dist/check-box/index.js +1 -1
- package/dist/chunks/{CalendarView-Dm55k0bN.js → CalendarView-CwbPJG2Y.js} +86 -86
- package/dist/chunks/{CalendarView-Dm55k0bN.js.map → CalendarView-CwbPJG2Y.js.map} +1 -1
- package/dist/chunks/{ImageViewerRuntime-HGBWp9NM.js → ImageViewerRuntime-DZpgxzF1.js} +25 -25
- package/dist/chunks/{ImageViewerRuntime-HGBWp9NM.js.map → ImageViewerRuntime-DZpgxzF1.js.map} +1 -1
- package/dist/chunks/{TextEditorLexicalClient-C8nSoz85.js → TextEditorLexicalClient-BRp8jHId.js} +354 -354
- package/dist/chunks/{TextEditorLexicalClient-C8nSoz85.js.map → TextEditorLexicalClient-BRp8jHId.js.map} +1 -1
- package/dist/chunks/{base-table-BWvKfI2W.js → base-table-BHmboNzl.js} +138 -138
- package/dist/chunks/{base-table-BWvKfI2W.js.map → base-table-BHmboNzl.js.map} +1 -1
- package/dist/chunks/{button-DF21yxVp.js → button-D7GAU2Wa.js} +20 -20
- package/dist/chunks/{button-DF21yxVp.js.map → button-D7GAU2Wa.js.map} +1 -1
- package/dist/chunks/{check-box-CZyhzmR0.js → check-box-D_Y6iIWv.js} +19 -19
- package/dist/chunks/{check-box-CZyhzmR0.js.map → check-box-D_Y6iIWv.js.map} +1 -1
- package/dist/chunks/{context-menu-DgvXGCuI.js → context-menu-BQePxRpu.js} +159 -159
- package/dist/chunks/{context-menu-DgvXGCuI.js.map → context-menu-BQePxRpu.js.map} +1 -1
- package/dist/chunks/{date-input-D7aBsPJc.js → date-input-Crijdmmq.js} +67 -67
- package/dist/chunks/{date-input-D7aBsPJc.js.map → date-input-Crijdmmq.js.map} +1 -1
- package/dist/chunks/{date-range-preset-select-BLnY47cv.js → date-range-preset-select-CyzGMvVp.js} +6 -6
- package/dist/chunks/{date-range-preset-select-BLnY47cv.js.map → date-range-preset-select-CyzGMvVp.js.map} +1 -1
- package/dist/chunks/{dialog-1Z1zCNCe.js → dialog-BcQGVNbu.js} +13 -13
- package/dist/chunks/{dialog-1Z1zCNCe.js.map → dialog-BcQGVNbu.js.map} +1 -1
- package/dist/chunks/{flex-C7njxZ74.js → flex-DtXK7OM4.js} +29 -29
- package/dist/chunks/{flex-C7njxZ74.js.map → flex-DtXK7OM4.js.map} +1 -1
- package/dist/chunks/{floating-arrow-DPKwJfww.js → floating-arrow-DKUKx2ZQ.js} +7 -7
- package/dist/chunks/{floating-arrow-DPKwJfww.js.map → floating-arrow-DKUKx2ZQ.js.map} +1 -1
- package/dist/chunks/{input-DSPKgiCK.js → input-CuRK9Vbz.js} +78 -78
- package/dist/chunks/{input-DSPKgiCK.js.map → input-CuRK9Vbz.js.map} +1 -1
- package/dist/chunks/{input-files-tIS17-zX.js → input-files-B8j6Pb_M.js} +31 -31
- package/dist/chunks/{input-files-tIS17-zX.js.map → input-files-B8j6Pb_M.js.map} +1 -1
- package/dist/chunks/{misc-DeGboAt-.js → misc-CGQOXXCy.js} +110 -110
- package/dist/chunks/{misc-DeGboAt-.js.map → misc-CGQOXXCy.js.map} +1 -1
- package/dist/chunks/{modal-dplfAaER.js → modal-febBsMyR.js} +58 -58
- package/dist/chunks/{modal-dplfAaER.js.map → modal-febBsMyR.js.map} +1 -1
- package/dist/chunks/{picker-lvm82d0A.js → picker-BA6okKnz.js} +91 -91
- package/dist/chunks/{picker-lvm82d0A.js.map → picker-BA6okKnz.js.map} +1 -1
- package/dist/chunks/popover-yl5DVe06.js +245 -0
- package/dist/chunks/{popover-Bne-Ljbs.js.map → popover-yl5DVe06.js.map} +1 -1
- package/dist/chunks/radio-group-CW-K1n9c.js +125 -0
- package/dist/chunks/{radio-group-sSnlYjAX.js.map → radio-group-CW-K1n9c.js.map} +1 -1
- package/dist/chunks/select-DblNSc5H.js +363 -0
- package/dist/chunks/{select-aTGupQan.js.map → select-DblNSc5H.js.map} +1 -1
- package/dist/chunks/{separator-B72Aq-6a.js → separator-CIqnk2z9.js} +2 -2
- package/dist/chunks/{separator-B72Aq-6a.js.map → separator-CIqnk2z9.js.map} +1 -1
- package/dist/chunks/{sortable-BKIwlqhI.js → sortable-CQmMHAF8.js} +38 -38
- package/dist/chunks/{sortable-BKIwlqhI.js.map → sortable-CQmMHAF8.js.map} +1 -1
- package/dist/chunks/{table-DxoSOvQK.js → table-BnvjPaE1.js} +18 -18
- package/dist/chunks/{table-DxoSOvQK.js.map → table-BnvjPaE1.js.map} +1 -1
- package/dist/chunks/{table-column-interactions-DzEvVuXe.js → table-column-interactions-Do8LFtiv.js} +20 -20
- package/dist/chunks/{table-column-interactions-DzEvVuXe.js.map → table-column-interactions-Do8LFtiv.js.map} +1 -1
- package/dist/chunks/{types-D9Wj9wrg.js → types-CxXyru6U.js} +21 -21
- package/dist/chunks/{types-D9Wj9wrg.js.map → types-CxXyru6U.js.map} +1 -1
- package/dist/chunks/ui.module-oRwY3Zli.js.map +1 -1
- package/dist/chunks/{useODataSelectBase-DR4PrY1j.js → useODataSelectBase-DwR4Lfv-.js} +5 -5
- package/dist/chunks/{useODataSelectBase-DR4PrY1j.js.map → useODataSelectBase-DwR4Lfv-.js.map} +1 -1
- package/dist/chunks/{wheel-picker-FS58cRsQ.js → wheel-picker-DUHGy7wE.js} +23 -23
- package/dist/chunks/{wheel-picker-FS58cRsQ.js.map → wheel-picker-DUHGy7wE.js.map} +1 -1
- package/dist/context-menu/index.js +1 -1
- package/dist/date-input/index.js +2 -2
- package/dist/date-range-preset-select/index.js +1 -1
- package/dist/date-time-input/index.js +122 -122
- package/dist/date-time-input/index.js.map +1 -1
- package/dist/detail/index.js +22 -22
- package/dist/dialog/index.js +1 -1
- package/dist/disclosure/index.js +9 -9
- package/dist/drop-zone/index.js +21 -21
- package/dist/errors/index.js +50 -50
- package/dist/expandable-action-panel/index.js +24 -24
- package/dist/flex/index.js +1 -1
- package/dist/flex/useFlexClasses.d.ts +1 -1
- package/dist/floating-arrow/index.js +1 -1
- package/dist/fullscreen-portal/index.js +8 -8
- package/dist/image/index.js +119 -119
- package/dist/input/index.js +1 -1
- package/dist/input-date-time/index.js +55 -55
- package/dist/input-file/index.js +16 -16
- package/dist/input-files/index.js +1 -1
- package/dist/input-image/index.js +17 -17
- package/dist/input-search/index.js +30 -2
- package/dist/input-search/index.js.map +1 -0
- package/dist/layout-picker/index.js +93 -93
- package/dist/layout-picker/index.js.map +1 -1
- package/dist/list/index.js +39 -39
- package/dist/listbox/index.js +33 -33
- package/dist/misc/index.js +1 -1
- package/dist/modal/index.js +1 -1
- package/dist/multi-select/index.js +466 -2
- package/dist/multi-select/index.js.map +1 -0
- package/dist/notifications/index.js +45 -45
- package/dist/option/index.js +30 -30
- package/dist/period-select/index.js +7 -7
- package/dist/picker/index.js +1 -1
- package/dist/popover/index.js +1 -1
- package/dist/preset-range-date-input/index.js +10 -10
- package/dist/preset-select/index.js +1 -1
- package/dist/radio-button/index.js +9 -9
- package/dist/radio-group/index.js +1 -1
- package/dist/select/index.js +1 -1
- package/dist/separator/index.js +1 -1
- package/dist/simple-table/index.js +5 -5
- package/dist/slider/index.js +82 -82
- package/dist/slider/index.js.map +1 -1
- package/dist/sortable/index.js +1 -1
- package/dist/splitter/index.js +55 -55
- package/dist/state-select/index.js +17 -17
- package/dist/styles.css +1 -1
- package/dist/switch/index.js +18 -18
- package/dist/table/index.js +1 -1
- package/dist/table-column-interactions/index.js +1 -1
- package/dist/table-editor/index.js +99 -99
- package/dist/table-sorting/index.js +13 -13
- package/dist/tabs/index.js +83 -83
- package/dist/tag-input/index.js +58 -58
- package/dist/tag-input/index.js.map +1 -1
- package/dist/text/index.js +18 -18
- package/dist/text-editor/index.js +3 -3
- package/dist/textarea/index.js +1 -1
- package/dist/three-scene/index.js +7 -7
- package/dist/toggle/index.js +20 -20
- package/dist/toolbar/index.js +16 -16
- package/dist/tree/index.js +24 -24
- package/dist/tree-select/index.js +189 -189
- package/dist/tree-select/index.js.map +1 -1
- package/dist/tree-table/index.js +33 -33
- package/dist/tree-table/index.js.map +1 -1
- package/dist/wheel-picker/index.js +1 -1
- package/package.json +1 -5
- package/storybook-static/assets/{Badge-2sTQGGbc.js → Badge-BKRvorSi.js} +1 -1
- package/storybook-static/assets/{Badge.stories-kpmROzju.js → Badge.stories-19yFfupy.js} +1 -1
- package/storybook-static/assets/{BadgeList-C-3k3Saj.js → BadgeList-DMkfxply.js} +1 -1
- package/storybook-static/assets/{BarcodeScannerDialog.stories-Cs6XF24f.js → BarcodeScannerDialog.stories-DdnHxu5x.js} +1 -1
- package/storybook-static/assets/{Button-DeUhy_Ud.js → Button-CoOZeR_z.js} +1 -1
- package/storybook-static/assets/{Button-BeqDnS0L.js → Button-Di-0Ionw.js} +1 -1
- package/storybook-static/assets/{Button.stories-gaR8Dnpw.js → Button.stories-Bd1To5BN.js} +1 -1
- package/storybook-static/assets/{CalendarView-D6uB72Yq.js → CalendarView-Dz8cY1fo.js} +1 -1
- package/storybook-static/assets/{CheckBox-BfXcsEql.js → CheckBox-DSmGYEML.js} +1 -1
- package/storybook-static/assets/{CheckBox-CziPDk08.js → CheckBox-DfRTTXg1.js} +1 -1
- package/storybook-static/assets/{CheckBox.stories-DUpx14ny.js → CheckBox.stories-DaldWgEI.js} +1 -1
- package/storybook-static/assets/{Color-6AOWCN3U-BKoQthNE.js → Color-6AOWCN3U-DIhia6KS.js} +1 -1
- package/storybook-static/assets/{ContextMenu-CIOw6SnW.js → ContextMenu-BGMQHT9V.js} +1 -1
- package/storybook-static/assets/{ContextMenu-DsCDOqZ-.js → ContextMenu-XS7B8QUC.js} +1 -1
- package/storybook-static/assets/{ContextMenu.stories-Dh1xs1Uu.js → ContextMenu.stories-Dp2t2BZa.js} +1 -1
- package/storybook-static/assets/{CustomOptionButton-DrXFP09z.js → CustomOptionButton-DNd0GDWp.js} +1 -1
- package/storybook-static/assets/{DateInput-ComvHbyD.js → DateInput-DUl5Bb0j.js} +1 -1
- package/storybook-static/assets/{DateInput-DUTiYxVQ.js → DateInput-MgdMtvtr.js} +1 -1
- package/storybook-static/assets/{DateInput.stories-B35ApFC6.js → DateInput.stories-B6Ol0Ak3.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect-BgIwqItz.js → DateRangePresetSelect-C4MVqjXa.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect-bRn8U3vm.js → DateRangePresetSelect-CPj0pSGc.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect.stories-BUMybnsm.js → DateRangePresetSelect.stories-tPaMURtH.js} +1 -1
- package/storybook-static/assets/{Detail-dI6_xrHh.js → Detail-DnHTVRb5.js} +1 -1
- package/storybook-static/assets/{Detail.stories-CNX6haXT.js → Detail.stories-CXg_w4qM.js} +1 -1
- package/storybook-static/assets/{Dialog-1bEZtlvY.js → Dialog-COpvqcXi.js} +1 -1
- package/storybook-static/assets/{Dialog-D6RFj5rJ.js → Dialog-LMnrvBpx.js} +1 -1
- package/storybook-static/assets/{Dialog.stories-C9a315UR.js → Dialog.stories-BE2I5ny2.js} +1 -1
- package/storybook-static/assets/{Disclosure-B4-Kmeyu.js → Disclosure-BZ3jd5nu.js} +1 -1
- package/storybook-static/assets/{Disclosure.stories-vjoHG9v4.js → Disclosure.stories-cMcF8a8I.js} +1 -1
- package/storybook-static/assets/{DisclosureGroup-CkDCnUlh.js → DisclosureGroup-JNnTj18G.js} +1 -1
- package/storybook-static/assets/{DocsRenderer-JROSPFPF-Bnqn8fXJ.js → DocsRenderer-JROSPFPF-CurHdzu8.js} +1 -1
- package/storybook-static/assets/{DropZone-BPeiPXgD.js → DropZone-DGMAbY1z.js} +1 -1
- package/storybook-static/assets/{DropZone-X9NvE8DO.js → DropZone-VEmgdfs6.js} +1 -1
- package/storybook-static/assets/{DropZone.stories-DLzZAaZu.js → DropZone.stories-B8N17-bV.js} +1 -1
- package/storybook-static/assets/{DropdownMenu-Dzukm6bJ.js → DropdownMenu-xjOtBneA.js} +1 -1
- package/storybook-static/assets/{ExpandableActionPanel-Cc2iKoo0.js → ExpandableActionPanel-C7CFQZLD.js} +1 -1
- package/storybook-static/assets/{ExpandableActionPanel.stories-0y46sYe3.js → ExpandableActionPanel.stories-CnBr0s9R.js} +1 -1
- package/storybook-static/assets/{Flex-CWEDnPLk.js → Flex-RpqsC-gQ.js} +1 -1
- package/storybook-static/assets/{Flex.stories-D2efArng.js → Flex.stories-CCVNsX23.js} +1 -1
- package/storybook-static/assets/{FloatingPopover-CPA1unHt.js → FloatingPopover-D6tO24aO.js} +1 -1
- package/storybook-static/assets/{FormattedTableCell-BB70nIi8.js → FormattedTableCell-CDaDfaXy.js} +1 -1
- package/storybook-static/assets/{Grid-K6-e83uN.js → Grid-BRnqEtg1.js} +1 -1
- package/storybook-static/assets/{Grid.stories-CsGVZuyW.js → Grid.stories-DXY7Cvfu.js} +1 -1
- package/storybook-static/assets/{ImageCropper.stories-ByjBQGyU.js → ImageCropper.stories-ZnvbFN71.js} +1 -1
- package/storybook-static/assets/{ImageRenderer-B5bMUohk.js → ImageRenderer-DUOhCfac.js} +1 -1
- package/storybook-static/assets/{ImageRenderer.stories-DZIJ2Cax.js → ImageRenderer.stories-Dj6NQm2k.js} +1 -1
- package/storybook-static/assets/{ImageView.stories-B4NSVfMj.js → ImageView.stories-QTzOsByD.js} +1 -1
- package/storybook-static/assets/{ImageViewer.stories-BnnWhgad.js → ImageViewer.stories-CpnUEgZW.js} +2 -2
- package/storybook-static/assets/{ImageViewerRuntime-DJk8-mMV.js → ImageViewerRuntime-B1PicLUw.js} +1 -1
- package/storybook-static/assets/{Input-C7hd8bju.js → Input-B8eGQXlp.js} +1 -1
- package/storybook-static/assets/{Input-C9NNdePo.js → Input-DnFc_Pwx.js} +1 -1
- package/storybook-static/assets/{Input.stories-8U_h1Dir.js → Input.stories-C6CbYvZP.js} +1 -1
- package/storybook-static/assets/{InputDateTime-BBU37OK4.js → InputDateTime-DoMduRde.js} +1 -1
- package/storybook-static/assets/{InputDateTime.stories-DuRCkCMJ.js → InputDateTime.stories--LHpvJjY.js} +1 -1
- package/storybook-static/assets/{InputFile-BxgxV2cg.js → InputFile-CunQ8F4s.js} +1 -1
- package/storybook-static/assets/{InputFile-iIrq-Xfc.js → InputFile-DFv3WAWa.js} +1 -1
- package/storybook-static/assets/{InputFile.stories-BhiqSiFS.js → InputFile.stories-B0WZhic1.js} +1 -1
- package/storybook-static/assets/{InputFiles-BfEQYQ2w.js → InputFiles-CKDPmjWY.js} +1 -1
- package/storybook-static/assets/{InputFiles-BHVGf3f-.js → InputFiles-DyiPQ_tH.js} +1 -1
- package/storybook-static/assets/{InputFiles.stories-esWVcU98.js → InputFiles.stories-BbP_bEnL.js} +1 -1
- package/storybook-static/assets/{InputFilesList-DjS5rnuM.js → InputFilesList-BAIGwV7V.js} +1 -1
- package/storybook-static/assets/{InputImage-Dbz_y38S.js → InputImage-2G1pRNbw.js} +1 -1
- package/storybook-static/assets/{InputImage-BuvjQZxI.js → InputImage-ZvEB_TIT.js} +1 -1
- package/storybook-static/assets/{InputImage.stories-D1scam1d.js → InputImage.stories-BiShLRcw.js} +1 -1
- package/storybook-static/assets/{InteractiveComponents-CkTp18t3.js → InteractiveComponents-CT99QfHX.js} +1 -1
- package/storybook-static/assets/{InteractiveComponents.stories-CucQ0BGN.js → InteractiveComponents.stories-BPTICQZz.js} +1 -1
- package/storybook-static/assets/{LayoutPicker-CjvnwTcm.js → LayoutPicker-BDpc8LBa.js} +1 -1
- package/storybook-static/assets/{LayoutPicker-CWquZGFb.js → LayoutPicker-Cg_AM-pj.js} +1 -1
- package/storybook-static/assets/{LayoutPicker.stories-DJgcqY8p.js → LayoutPicker.stories-Ca9WZdPW.js} +1 -1
- package/storybook-static/assets/{Listbox-uFeGwaCi.js → Listbox-3Npc4PI_.js} +1 -1
- package/storybook-static/assets/{Listbox-uEULtHhW.js → Listbox-LbbFtte9.js} +1 -1
- package/storybook-static/assets/{Listbox.stories-DBvqBHs-.js → Listbox.stories-xDpbFNZk.js} +1 -1
- package/storybook-static/assets/{Modal-sVegTd2h.js → Modal-CXd2j0up.js} +1 -1
- package/storybook-static/assets/{Modal-Drfce80H.js → Modal-Ddmc8-2-.js} +1 -1
- package/storybook-static/assets/{Modal.stories-BZRJ4cqm.js → Modal.stories-cNLvFjmT.js} +1 -1
- package/storybook-static/assets/{ModalManagerProvider-78nTQBfn.js → ModalManagerProvider-ClXvSB9a.js} +1 -1
- package/storybook-static/assets/{MultiSelect-Bwz9J1Zg.js → MultiSelect-BkLCM22R.js} +1 -1
- package/storybook-static/assets/{MultiSelect-BxfSm5Qy.js → MultiSelect-Na2VdNy3.js} +1 -1
- package/storybook-static/assets/{MultiSelect.stories-C3yG8A_7.js → MultiSelect.stories-4nFshdtz.js} +1 -1
- package/storybook-static/assets/{NoData-BvXwWyJ0.js → NoData-bUonNuRR.js} +1 -1
- package/storybook-static/assets/{NotificationsHost-D1UzFm2s.js → NotificationsHost-CrLL4WK9.js} +1 -1
- package/storybook-static/assets/{NotificationsHost.stories-DOiJGppm.js → NotificationsHost.stories-Ci2q0W9-.js} +1 -1
- package/storybook-static/assets/{ODataMultiSelect-9EzhKm-o.js → ODataMultiSelect-Cc09uTB8.js} +1 -1
- package/storybook-static/assets/{ODataMultiSelect.stories-CeJ-N9Nd.js → ODataMultiSelect.stories-CzGzREa9.js} +1 -1
- package/storybook-static/assets/{ODataSelect-Dxd_7Sr4.js → ODataSelect-DqoRg5pz.js} +1 -1
- package/storybook-static/assets/{ODataSelect.stories-SQFZqYLx.js → ODataSelect.stories-BCcxERn3.js} +1 -1
- package/storybook-static/assets/{ODataTreeMultiSelect-MA-QJUsB.js → ODataTreeMultiSelect-qZEcSE5O.js} +1 -1
- package/storybook-static/assets/{ODataTreeMultiSelect.stories-YvpwnP4d.js → ODataTreeMultiSelect.stories-Bfees7Qr.js} +1 -1
- package/storybook-static/assets/{ODataTreeSelect-BCiiS3IK.js → ODataTreeSelect-IOVS6uQc.js} +1 -1
- package/storybook-static/assets/{ODataTreeSelect.stories-Dq1OhGC3.js → ODataTreeSelect.stories-CO7DClzd.js} +1 -1
- package/storybook-static/assets/{OneStepScroller-im1C5gSg.js → OneStepScroller-B_IRz2Rw.js} +1 -1
- package/storybook-static/assets/{Option-Djau4Ddm.js → Option-fRoOLqLF.js} +1 -1
- package/storybook-static/assets/{OptionButton-B3XT6D5q.js → OptionButton--hnpJ-88.js} +1 -1
- package/storybook-static/assets/{PeriodSelect-Dr9dmlXS.js → PeriodSelect-BAVDztkI.js} +1 -1
- package/storybook-static/assets/{PeriodSelect-pOKCy0SB.js → PeriodSelect-D-jXJf5C.js} +1 -1
- package/storybook-static/assets/{PeriodSelect.stories-BTXlGHGk.js → PeriodSelect.stories-CscsENT9.js} +1 -1
- package/storybook-static/assets/{PickerField-Bu0d3-ft.js → PickerField-CRtltoce.js} +1 -1
- package/storybook-static/assets/{PickerTriggerActions-5-bZTrbi.js → PickerTriggerActions-BDGEQPvP.js} +1 -1
- package/storybook-static/assets/{Popover-CbYmPjQB.js → Popover-BYO0DlBg.js} +1 -1
- package/storybook-static/assets/{Popover-C0MAHY8E.js → Popover-Byy9_Twt.js} +1 -1
- package/storybook-static/assets/{Popover.stories-CNGXHwxk.js → Popover.stories-8RhemIQg.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput-IyUkzhsJ.js → PresetRangeDateInput-CVPMYlEV.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput-Do940cTR.js → PresetRangeDateInput-VZnM8RNV.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput.stories-DAIMF_Y5.js → PresetRangeDateInput.stories-DdBWlSV-.js} +1 -1
- package/storybook-static/assets/{PresetSelect-D65v9bUa.js → PresetSelect-C7YYBjlL.js} +1 -1
- package/storybook-static/assets/{README-CNeFWQp-.js → README-2NTkucdH.js} +1 -1
- package/storybook-static/assets/{README-BRRzrAiY.js → README-6XPUoxFl.js} +1 -1
- package/storybook-static/assets/{README-D9nuOSas.js → README-8L1vpZcz.js} +1 -1
- package/storybook-static/assets/{README-C81BgOtz.js → README-B0FbTpix.js} +1 -1
- package/storybook-static/assets/{README-CGIV17gX.js → README-B0Nb0jf2.js} +1 -1
- package/storybook-static/assets/{README-DB__g4Hv.js → README-BD-WSEvQ.js} +1 -1
- package/storybook-static/assets/{README-dz31ogQc.js → README-BGBxEe4u.js} +1 -1
- package/storybook-static/assets/{README-CmxyJW5E.js → README-BGmO6U9j.js} +1 -1
- package/storybook-static/assets/{README-C67zTaqC.js → README-BL8ZNGNi.js} +1 -1
- package/storybook-static/assets/{README-DnHSfSZk.js → README-BZlnzGAh.js} +1 -1
- package/storybook-static/assets/{README-CnZGcW7V.js → README-BdsFByUw.js} +1 -1
- package/storybook-static/assets/{README-D7cjSdE3.js → README-Bk1oSDWQ.js} +1 -1
- package/storybook-static/assets/{README-BC_Nb6Pt.js → README-Brn9Tjjc.js} +1 -1
- package/storybook-static/assets/{README-DilodlZ3.js → README-Bvo0Qxde.js} +1 -1
- package/storybook-static/assets/{README-Bx2ruIF7.js → README-C-IUw1gX.js} +1 -1
- package/storybook-static/assets/{README-BbD3YcYe.js → README-C7N5_6-c.js} +1 -1
- package/storybook-static/assets/{README-DIMFSBIs.js → README-CB5BpIBF.js} +1 -1
- package/storybook-static/assets/{README-zpjWO9SA.js → README-CTF9mVZL.js} +1 -1
- package/storybook-static/assets/{README-DENJbcin.js → README-CTwfFqJG.js} +1 -1
- package/storybook-static/assets/{README-CuV27eXd.js → README-C_lKreF9.js} +1 -1
- package/storybook-static/assets/{README-bnDO0VvU.js → README-CeNQeTK-.js} +1 -1
- package/storybook-static/assets/{README-DzYVtS48.js → README-CqiNQGIJ.js} +1 -1
- package/storybook-static/assets/{README-BdXitC-v.js → README-CvaizZr1.js} +1 -1
- package/storybook-static/assets/{README-0DfYx1x8.js → README-D2AT2-yD.js} +1 -1
- package/storybook-static/assets/{README-BRfiEuJl.js → README-DADnaXLy.js} +1 -1
- package/storybook-static/assets/{README-Bqi9zL_3.js → README-DC0vNdOD.js} +1 -1
- package/storybook-static/assets/{README-CTHg-0Gf.js → README-DIWsYBR7.js} +1 -1
- package/storybook-static/assets/{README-CMDYHiZ0.js → README-DMwF_O1R.js} +1 -1
- package/storybook-static/assets/{README-kmbY5Eb6.js → README-DOBIWrus.js} +1 -1
- package/storybook-static/assets/{README-BJH7K07w.js → README-DOi6rx7n.js} +1 -1
- package/storybook-static/assets/{README-B1OZSJPW.js → README-DWzfTSuq.js} +1 -1
- package/storybook-static/assets/{README-DF7917zn.js → README-DgXAMdBY.js} +1 -1
- package/storybook-static/assets/{README-0zD_mpK7.js → README-DkBG5Azm.js} +1 -1
- package/storybook-static/assets/{README-D9F11ksa.js → README-DlfWWC7n.js} +1 -1
- package/storybook-static/assets/{README-BOuI52h7.js → README-Dm7CwuVP.js} +1 -1
- package/storybook-static/assets/{README-DGEDdKV9.js → README-Dmu5lsNT.js} +1 -1
- package/storybook-static/assets/{README-B0Ei6BRU.js → README-DoxVtmRh.js} +1 -1
- package/storybook-static/assets/{README-D-EI5fho.js → README-Dr8TxFTe.js} +1 -1
- package/storybook-static/assets/{README-QT9W28h_.js → README-DrTR5pSr.js} +1 -1
- package/storybook-static/assets/{README-CPkK5x0m.js → README-DyWhmOFY.js} +1 -1
- package/storybook-static/assets/{README-Cw9Zfftr.js → README-GChrAHFQ.js} +1 -1
- package/storybook-static/assets/{README-BRLYOV1b.js → README-HWuoKwKL.js} +1 -1
- package/storybook-static/assets/{README-CkuXmfz0.js → README-UcyyK9jn.js} +1 -1
- package/storybook-static/assets/{README-UGL0ffZV.js → README-Wli4AXG5.js} +1 -1
- package/storybook-static/assets/{README-BlU-_6sl.js → README-ZxRwqfIH.js} +1 -1
- package/storybook-static/assets/{README-Dst0aWPQ.js → README-_KzyG4dS.js} +1 -1
- package/storybook-static/assets/{README-B_UsoB-1.js → README-b3wA6wFr.js} +1 -1
- package/storybook-static/assets/{README-CHuQw2Qi.js → README-g1VWHzAJ.js} +1 -1
- package/storybook-static/assets/{README-D8XXY0zG.js → README-jQcGKqqm.js} +1 -1
- package/storybook-static/assets/{README-CTQstqqQ.js → README-jvtwVY_n.js} +1 -1
- package/storybook-static/assets/{README-CI191Srw.js → README-na5mQX4V.js} +1 -1
- package/storybook-static/assets/{README-BZVyxsw_.js → README-oKLTQYfV.js} +1 -1
- package/storybook-static/assets/{README-gvzAURNC.js → README-w9FMhq0X.js} +1 -1
- package/storybook-static/assets/{RadioButton-CGoc9W4C.js → RadioButton-DMn-soQD.js} +1 -1
- package/storybook-static/assets/{RadioButton-oNRpIXOV.js → RadioButton-Dgkz1EWU.js} +1 -1
- package/storybook-static/assets/{RadioButton.stories-Jp8MuGg3.js → RadioButton.stories-DO14jTfm.js} +1 -1
- package/storybook-static/assets/{RadioGroup-Bd_jzY95.js → RadioGroup-BSiqjVai.js} +1 -1
- package/storybook-static/assets/{RadioGroup-D5LTKyRY.js → RadioGroup-Db0AhiKo.js} +1 -1
- package/storybook-static/assets/{RadioGroup.stories-BVu05x_P.js → RadioGroup.stories-C0D6n83q.js} +1 -1
- package/storybook-static/assets/{Scrollable-B_XGYKTj.js → Scrollable-BI3OE8gc.js} +1 -1
- package/storybook-static/assets/{Select-YeZ4L1bU.js → Select-1MNiFkxm.js} +1 -1
- package/storybook-static/assets/{Select-rjczNFii.js → Select-D8X-SkP2.js} +1 -1
- package/storybook-static/assets/{Select.stories-Bmu1mJu_.js → Select.stories-8_zvonmc.js} +1 -1
- package/storybook-static/assets/{SerializableSelect-ByLziMgM.js → SerializableSelect-ii6T140l.js} +1 -1
- package/storybook-static/assets/{SerializableSelect.stories-JlopYf0t.js → SerializableSelect.stories-Ba3ABMGt.js} +1 -1
- package/storybook-static/assets/{ShimmerText-CRfaFnl1.js → ShimmerText-C6vkZwUV.js} +1 -1
- package/storybook-static/assets/{ShimmerText.stories-BAxJ2D6b.js → ShimmerText.stories-CVpSxXHJ.js} +1 -1
- package/storybook-static/assets/{SingleDateTimeInput-Cl4NshG1.js → SingleDateTimeInput-96-mrjq8.js} +1 -1
- package/storybook-static/assets/{SingleDateTimeInput-Dr1LEvZ1.js → SingleDateTimeInput-DpETPR89.js} +1 -1
- package/storybook-static/assets/{SingleDateTimeInput.stories-_hmTygtJ.js → SingleDateTimeInput.stories-JhviurJO.js} +1 -1
- package/storybook-static/assets/{Slider-Du-vgdLs.js → Slider-B27TdvRV.js} +1 -1
- package/storybook-static/assets/{Slider-Bb19a7Lr.js → Slider-DbiDvmoV.js} +1 -1
- package/storybook-static/assets/{Slider.stories-w_4Lm5ja.js → Slider.stories-d1YeKe5r.js} +1 -1
- package/storybook-static/assets/{SliderInput-Lz8YGmmc.js → SliderInput-CzYn9gor.js} +1 -1
- package/storybook-static/assets/{SliderInput-sQbNVUtf.js → SliderInput-D2d23mEI.js} +1 -1
- package/storybook-static/assets/{SliderInput.stories-Bg7Uzt-r.js → SliderInput.stories-CwqT79oE.js} +1 -1
- package/storybook-static/assets/{Sortable-l-Qm6fkT.js → Sortable-DiJuiI6V.js} +1 -1
- package/storybook-static/assets/{Sortable.stories-Cf85BSwF.js → Sortable.stories-DFCzTok0.js} +1 -1
- package/storybook-static/assets/{Splitter-D9n2NIVi.js → Splitter-QwdfWNbm.js} +1 -1
- package/storybook-static/assets/{Splitter.stories-BOPn876G.js → Splitter.stories-C2iDPz8c.js} +1 -1
- package/storybook-static/assets/{StateSelect-B2mel1Gs.js → StateSelect-Bw9H1Cus.js} +1 -1
- package/storybook-static/assets/{StateSelect-DHXDlB2j.js → StateSelect-D1ZDM6bC.js} +1 -1
- package/storybook-static/assets/{StateSelect.stories-DDvGGDOC.js → StateSelect.stories-DEFvQ15O.js} +1 -1
- package/storybook-static/assets/{StatusIndicator-B5Gaj4GM.js → StatusIndicator-D6Pbdz37.js} +1 -1
- package/storybook-static/assets/{StatusIndicator.stories-BhtR4Hq-.js → StatusIndicator.stories-COgpy5cK.js} +1 -1
- package/storybook-static/assets/{StringToggle.stories-uP0F4aSw.js → StringToggle.stories-BFwMh0Yd.js} +1 -1
- package/storybook-static/assets/{Switch-CAXoT6wR.js → Switch-Bmj2AItH.js} +1 -1
- package/storybook-static/assets/{Switch-HQRPpBm8.js → Switch-DyDk152g.js} +1 -1
- package/storybook-static/assets/{Switch.stories-BFiVpNyQ.js → Switch.stories-C10NxPL4.js} +1 -1
- package/storybook-static/assets/{Table-6SgVFSck.js → Table-YcEwF4aO.js} +1 -1
- package/storybook-static/assets/{Table.stories-CPqSL_ou.js → Table.stories-DgxFS9Sa.js} +1 -1
- package/storybook-static/assets/{TableEditor.stories-DTRZRRwP.js → TableEditor.stories-CSMoxO4O.js} +1 -1
- package/storybook-static/assets/{Tabs-Dax2siiY.js → Tabs-DOsPN2X1.js} +1 -1
- package/storybook-static/assets/{Tabs.stories-DfBmhXDe.js → Tabs.stories-BdZilcp2.js} +1 -1
- package/storybook-static/assets/{TabsBox-qxjvoJVK.js → TabsBox-Ovukgo9G.js} +1 -1
- package/storybook-static/assets/{TagInput-CsxMyCrG.js → TagInput-BQBOGr9G.js} +1 -1
- package/storybook-static/assets/{TagInput.stories-DqbzT-v0.js → TagInput.stories-DAAyJlgm.js} +1 -1
- package/storybook-static/assets/{Text-BsN-PQCV.js → Text-fdwuak_J.js} +1 -1
- package/storybook-static/assets/{Textarea-BjuUbYsT.js → Textarea-A22Efyk-.js} +1 -1
- package/storybook-static/assets/{Textarea-CpmzCUxv.js → Textarea-D80ZPpEy.js} +1 -1
- package/storybook-static/assets/{Textarea.stories-CuD6DgcU.js → Textarea.stories-DfaOYMoN.js} +1 -1
- package/storybook-static/assets/{TimePanel-CSSXwKRa.js → TimePanel-Bd5T_SfL.js} +1 -1
- package/storybook-static/assets/{TimePanel.stories-BMCRRMRa.js → TimePanel.stories-D6TIpKp4.js} +1 -1
- package/storybook-static/assets/{Toggle-8kcwuNdV.js → Toggle-BvHMq6f_.js} +1 -1
- package/storybook-static/assets/{Toggle-rgYYwuhK.js → Toggle-DUyCRH0o.js} +1 -1
- package/storybook-static/assets/{Toggle.stories-DwfF0YoD.js → Toggle.stories-ZPgC-EWw.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect-By8L-bm6.js → TreeMultiSelect-DTMybWfP.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect-BoERAVM0.js → TreeMultiSelect-DTmB9s8s.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect.stories-C3jtxDZI.js → TreeMultiSelect.stories-1_HB74Gf.js} +1 -1
- package/storybook-static/assets/{TreePickerBase-DBrjX-bi.js → TreePickerBase-Cu2mneBS.js} +1 -1
- package/storybook-static/assets/{TreeSelect-CaNARWLc.js → TreeSelect-CTN6cRRr.js} +1 -1
- package/storybook-static/assets/{TreeSelect-vsrnMOeK.js → TreeSelect-UsZGYhUO.js} +1 -1
- package/storybook-static/assets/{TreeSelect.stories-BOK-ieA_.js → TreeSelect.stories-B01pZcR9.js} +1 -1
- package/storybook-static/assets/{TreeTable-Zvy1Vc8r.js → TreeTable-dr3jK3Ih.js} +1 -1
- package/storybook-static/assets/{TreeTable.stories-CKGMANAc.js → TreeTable.stories-B1DPasDc.js} +1 -1
- package/storybook-static/assets/{blocks-XON_dw_i.js → blocks-Cw5Dm88b.js} +3 -3
- package/storybook-static/assets/{check-R50Hqsjh.js → check-028VTQ8f.js} +1 -1
- package/storybook-static/assets/{chevron-down-D2lWkc4k.js → chevron-down-CjXVIhzi.js} +1 -1
- package/storybook-static/assets/{chevron-left-DFO06R_I.js → chevron-left-CktI1oFP.js} +1 -1
- package/storybook-static/assets/{chevron-right-DYpO1E4w.js → chevron-right-CF10QSRI.js} +1 -1
- package/storybook-static/assets/{chunk-W22LQPXL-DgsU6Ho0.js → chunk-W22LQPXL-C0ehDnCq.js} +1 -1
- package/storybook-static/assets/{circle-alert-C99j_qdy.js → circle-alert-s0HpHvQO.js} +1 -1
- package/storybook-static/assets/{circle-check-BVoaTMGo.js → circle-check-C7Lv1fv9.js} +1 -1
- package/storybook-static/assets/{components-D2acFX9a.js → components-ClxgOUq5.js} +3 -3
- package/storybook-static/assets/{contextMenu-Rc4xafWY.js → contextMenu-CWGju9qn.js} +1 -1
- package/storybook-static/assets/{download-FS-653X-.js → download-B1U5w3LU.js} +1 -1
- package/storybook-static/assets/{floating-ui.react-9uiNDESW.js → floating-ui.react-CyNWkXBV.js} +1 -1
- package/storybook-static/assets/{foundationApi-hwTxo_aQ.js → foundationApi-CY0sxk8w.js} +1 -1
- package/storybook-static/assets/{foundationLib-CdF_K0ss.js → foundationLib-BCpSUA25.js} +1 -1
- package/storybook-static/assets/{hooks-BktG1SJq.js → hooks-DjR-EyBl.js} +1 -1
- package/storybook-static/assets/iframe-Dyd6jnSv.js +1 -0
- package/storybook-static/assets/{iframe-CmDE2WzV.js → iframe-woVbsQH3.js} +3 -3
- package/storybook-static/assets/{info-aj3qk4-6.js → info-DKbXBIbQ.js} +1 -1
- package/storybook-static/assets/{odata-tQdKpZ8d.js → odata-CMCuN2Rx.js} +1 -1
- package/storybook-static/assets/{odataStoryFixtures-Bpcqh4OD.js → odataStoryFixtures-a4Q2PLas.js} +1 -1
- package/storybook-static/assets/{react-Ci0XWusa.js → react-D3CyilRt.js} +1 -1
- package/storybook-static/assets/{refresh-cw-TDE_PN6T.js → refresh-cw-DXEJelAO.js} +1 -1
- package/storybook-static/assets/{settings-2-AgUmNDAs.js → settings-2-CKbiQBX8.js} +1 -1
- package/storybook-static/assets/{sortable-ULpdqocx.js → sortable-CXLU2ip-.js} +1 -1
- package/storybook-static/assets/{syntaxhighlighter-QEQV7K2Y-Cu4u_nrx.js → syntaxhighlighter-QEQV7K2Y-CLptde2b.js} +1 -1
- package/storybook-static/assets/{trash-2-CRAL6xvg.js → trash-2-CPWRIQlJ.js} +1 -1
- package/storybook-static/assets/{triangle-alert-D_BUPWKQ.js → triangle-alert-XjzWCHp5.js} +1 -1
- package/storybook-static/assets/{ui-Dn5es0s1.css → ui-FA-1R8mO.css} +1 -1
- package/storybook-static/assets/{uiClasses-BxxhVVa_.js → uiClasses-DNnVkKPr.js} +1 -1
- package/storybook-static/assets/{useODataSelectBase-2vllyrJj.js → useODataSelectBase-ZGFa3pdT.js} +1 -1
- package/storybook-static/assets/{useODataTreeData-BZegXh8a.js → useODataTreeData-DAdLowou.js} +1 -1
- package/storybook-static/assets/{usePickerQuery-DWBa3-2z.js → usePickerQuery-CaO8hXyH.js} +1 -1
- package/storybook-static/assets/{usePickerTriggerController-Co3rQjwS.js → usePickerTriggerController-DWjrt_q_.js} +1 -1
- package/storybook-static/assets/{x-DHae85Ss.js → x-D2Q9PGsq.js} +1 -1
- package/storybook-static/iframe.html +2 -2
- package/storybook-static/project.json +1 -1
- package/dist/advanced-search/index.d.ts +0 -3
- package/dist/advanced-search/index.d.ts.map +0 -1
- package/dist/advanced-search/index.js +0 -399
- package/dist/advanced-search/index.js.map +0 -1
- package/dist/advanced-search/lib/index.d.ts +0 -2
- package/dist/advanced-search/lib/index.d.ts.map +0 -1
- package/dist/advanced-search/lib/searchParts.d.ts +0 -3
- package/dist/advanced-search/lib/searchParts.d.ts.map +0 -1
- package/dist/advanced-search/model/index.d.ts +0 -5
- package/dist/advanced-search/model/index.d.ts.map +0 -1
- package/dist/advanced-search/model/types.d.ts +0 -55
- package/dist/advanced-search/model/types.d.ts.map +0 -1
- package/dist/advanced-search/model/useAdvancedSearch.d.ts +0 -11
- package/dist/advanced-search/model/useAdvancedSearch.d.ts.map +0 -1
- package/dist/advanced-search/model/useAdvancedSearchInitialSelected.d.ts +0 -6
- package/dist/advanced-search/model/useAdvancedSearchInitialSelected.d.ts.map +0 -1
- package/dist/advanced-search/model/useAdvancedSearchSelection.d.ts +0 -13
- package/dist/advanced-search/model/useAdvancedSearchSelection.d.ts.map +0 -1
- package/dist/advanced-search/ui/AdvancedSearchModal.d.ts +0 -23
- package/dist/advanced-search/ui/AdvancedSearchModal.d.ts.map +0 -1
- package/dist/advanced-search/ui/AdvancedSearchModalSession.d.ts +0 -16
- package/dist/advanced-search/ui/AdvancedSearchModalSession.d.ts.map +0 -1
- package/dist/advanced-search/ui/AdvancedSearchSelect.d.ts +0 -9
- package/dist/advanced-search/ui/AdvancedSearchSelect.d.ts.map +0 -1
- package/dist/advanced-search/ui/AdvancedSearchSelectUI.d.ts +0 -9
- package/dist/advanced-search/ui/AdvancedSearchSelectUI.d.ts.map +0 -1
- package/dist/advanced-search/ui/index.d.ts +0 -2
- package/dist/advanced-search/ui/index.d.ts.map +0 -1
- package/dist/chunks/badge-6mXO9BWP.js +0 -65
- package/dist/chunks/badge-6mXO9BWP.js.map +0 -1
- package/dist/chunks/input-search-Cat4c7SM.js +0 -30
- package/dist/chunks/input-search-Cat4c7SM.js.map +0 -1
- package/dist/chunks/multi-select-BZ9N6Dal.js +0 -466
- package/dist/chunks/multi-select-BZ9N6Dal.js.map +0 -1
- package/dist/chunks/popover-Bne-Ljbs.js +0 -245
- package/dist/chunks/radio-group-sSnlYjAX.js +0 -125
- package/dist/chunks/select-aTGupQan.js +0 -363
- package/storybook-static/assets/iframe-B54uejyY.js +0 -1
- /package/storybook-static/assets/{ui.module-BpXamlVr.js → ui.module-CyEEibCu.js} +0 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { HighlightText as e } from "../text/index.js";
|
|
2
|
+
import { t } from "./ui.module-oRwY3Zli.js";
|
|
3
|
+
import { u as n } from "./input-CuRK9Vbz.js";
|
|
4
|
+
import { a as r, f as i, i as a, m as o, r as s, s as c, t as l, u, v as d } from "./picker-BA6okKnz.js";
|
|
5
|
+
import { CustomOptionButton as f, Option as p, OptionButton as m, OptionCode as h, OptionText as g } from "../option/index.js";
|
|
6
|
+
import { t as _ } from "./odata-dependent-C_DCbKY2.js";
|
|
7
|
+
import { n as v } from "./useODataSelectBase-DwR4Lfv-.js";
|
|
8
|
+
import { cn as y } from "@ryuzaki13/react-foundation-lib/utils";
|
|
9
|
+
import { CheckIcon as ee } from "lucide-react";
|
|
10
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
11
|
+
import { Fragment as te, useCallback as C, useMemo as w, useRef as ne, useState as re } from "react";
|
|
12
|
+
import { useODataCollectionModel as T } from "@ryuzaki13/react-foundation-api/odata";
|
|
13
|
+
//#region src/select/lib/getOptionSearchText.ts
|
|
14
|
+
function ie({ option: e, getOptionLabel: t, getOptionCode: n, getOptionGroup: r }) {
|
|
15
|
+
return [
|
|
16
|
+
o(t(e)),
|
|
17
|
+
o(n?.(e)),
|
|
18
|
+
o(r?.(e)?.label)
|
|
19
|
+
].filter((e) => !!e).join(" ").toLowerCase();
|
|
20
|
+
}
|
|
21
|
+
function E(e, t, n) {
|
|
22
|
+
return e.find((e) => e.value === t) ?? n;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/select/model/useODataSelect.ts
|
|
26
|
+
function D({ odata: e, segment: t, model: n, value: r, dependencies: i, onChange: a }) {
|
|
27
|
+
let o = v({
|
|
28
|
+
odata: e,
|
|
29
|
+
segment: t,
|
|
30
|
+
model: n,
|
|
31
|
+
value: r ? [r] : [],
|
|
32
|
+
dependencies: i
|
|
33
|
+
}), s = o.selectedItems[0], c = w(() => s ? [s, ...o.filteredItems] : o.filteredItems, [o.filteredItems, s]), l = (e) => {
|
|
34
|
+
a(e?.[o.selectionKey]);
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
...o,
|
|
38
|
+
selectedItem: s,
|
|
39
|
+
options: c,
|
|
40
|
+
handleChange: l
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/select/lib/createSelectOptionSections.ts
|
|
45
|
+
function ae(e, t) {
|
|
46
|
+
let n = [];
|
|
47
|
+
return e.forEach((e, r) => {
|
|
48
|
+
let i = t(e), a = n.at(-1), o = a?.group?.key === i?.key;
|
|
49
|
+
if (a && o) {
|
|
50
|
+
a.items.push({
|
|
51
|
+
option: e,
|
|
52
|
+
index: r
|
|
53
|
+
});
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
n.push({
|
|
57
|
+
group: i,
|
|
58
|
+
items: [{
|
|
59
|
+
option: e,
|
|
60
|
+
index: r
|
|
61
|
+
}]
|
|
62
|
+
});
|
|
63
|
+
}), n;
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/select/Select.tsx
|
|
67
|
+
function O(e) {
|
|
68
|
+
let { label: n, description: h, disabled: g, placeholder: _, size: v, options: T, value: E, onChange: D, getOptionKey: O, getOptionLabel: k, getOptionCode: A, getOptionSearchText: j, getOptionDisabled: M, getOptionAriaLabel: N, getOptionGroup: P, getOptionClassName: F, renderOption: I, renderValue: L, className: oe, buttonClassName: se, optionsClassName: ce, optionsMaxWidth: le, optionsContentClassName: ue, searchable: R = !1, defaultFilter: de = !0, query: fe, defaultQuery: pe, onQuery: me, renderPopupHeader: he, emptyState: ge, isLoading: _e, errorState: ve, placement: ye = "bottom-start", clearable: be = !1 } = e, z = D, B = ne(null), [V, xe] = re(!1), H = R ? "search-single" : "display", U = E === void 0 ? void 0 : O(E), W = U === void 0 ? void 0 : T.find((e) => O(e) === U) ?? E, { query: G, setQuery: K, resetQueryOnClose: Se } = s({
|
|
69
|
+
query: fe,
|
|
70
|
+
defaultQuery: pe,
|
|
71
|
+
onQuery: me,
|
|
72
|
+
triggerMode: H
|
|
73
|
+
}), Ce = (e) => {
|
|
74
|
+
V && !e && Se && K(""), xe(e);
|
|
75
|
+
}, we = C((e) => j?.(e) ?? ie({
|
|
76
|
+
option: e,
|
|
77
|
+
getOptionLabel: k,
|
|
78
|
+
getOptionCode: A,
|
|
79
|
+
getOptionGroup: P
|
|
80
|
+
}), [
|
|
81
|
+
j,
|
|
82
|
+
A,
|
|
83
|
+
P,
|
|
84
|
+
k
|
|
85
|
+
]), q = r({
|
|
86
|
+
options: T,
|
|
87
|
+
query: G,
|
|
88
|
+
enabled: R && de,
|
|
89
|
+
getSearchText: we
|
|
90
|
+
}), J = w(() => P ? ae(q, P) : void 0, [P, q]), Te = U === void 0 ? -1 : q.findIndex((e) => O(e) === U), { activeIndex: Ee, context: De, floatingStyles: Oe, getFloatingProps: ke, setReference: Ae, setFloating: je, setOptionRef: Me, close: Y, openList: Ne, toggleOpen: Pe, selectOption: X, selectActiveOption: Fe, handleReferenceKeyDown: Ie, handleFloatingKeyDown: Le, getOptionId: Re, getActiveOptionId: Z } = a({
|
|
91
|
+
options: q,
|
|
92
|
+
selectedIndex: Te,
|
|
93
|
+
open: V,
|
|
94
|
+
onOpenChange: Ce,
|
|
95
|
+
getOptionDisabled: M,
|
|
96
|
+
onSelect: z,
|
|
97
|
+
disabled: g,
|
|
98
|
+
placement: ye,
|
|
99
|
+
triggerMode: H
|
|
100
|
+
}), Q = q.length > 0, ze = W === void 0 ? void 0 : k(W), Be = W === void 0 ? void 0 : L ? L(W) : ze, Ve = o(ze), He = W === void 0 ? void 0 : o(A?.(W)), Ue = o(Be) ?? Ve ?? He ?? (U === void 0 ? "" : String(U)), We = R && (V || G.length > 0) ? G : W === void 0 ? "" : Ue, $ = l({
|
|
101
|
+
mode: H,
|
|
102
|
+
open: V,
|
|
103
|
+
currentQuery: G,
|
|
104
|
+
hasDisplayValue: W !== void 0,
|
|
105
|
+
inputRef: B,
|
|
106
|
+
setQuery: K,
|
|
107
|
+
openList: Ne,
|
|
108
|
+
close: Y,
|
|
109
|
+
toggleOpen: Pe
|
|
110
|
+
}), Ge = (e) => {
|
|
111
|
+
B.current = e;
|
|
112
|
+
}, Ke = () => {
|
|
113
|
+
be && z(void 0), K(""), Y();
|
|
114
|
+
}, qe = (e, t, n) => {
|
|
115
|
+
let r = O(t), i = U !== void 0 && r === U, a = n === Ee, o = M?.(t) ?? !1, s = {
|
|
116
|
+
active: a,
|
|
117
|
+
selected: i,
|
|
118
|
+
disabled: o
|
|
119
|
+
};
|
|
120
|
+
return /* @__PURE__ */ x(p, {
|
|
121
|
+
id: Re(e, n),
|
|
122
|
+
ref: (e) => Me(n, e),
|
|
123
|
+
role: "option",
|
|
124
|
+
"aria-selected": i,
|
|
125
|
+
"aria-disabled": o || void 0,
|
|
126
|
+
"aria-label": N?.(t),
|
|
127
|
+
active: a,
|
|
128
|
+
selected: i,
|
|
129
|
+
disabled: o,
|
|
130
|
+
className: F?.(t, s),
|
|
131
|
+
children: I ? /* @__PURE__ */ x(f, {
|
|
132
|
+
tabIndex: -1,
|
|
133
|
+
disabled: o,
|
|
134
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
135
|
+
onClick: () => X(t),
|
|
136
|
+
children: I(t, s)
|
|
137
|
+
}) : /* @__PURE__ */ x(m, {
|
|
138
|
+
tabIndex: -1,
|
|
139
|
+
disabled: o,
|
|
140
|
+
icon: x(i ? ee : "span", {}),
|
|
141
|
+
text: k(t),
|
|
142
|
+
code: A?.(t),
|
|
143
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
144
|
+
onClick: () => X(t)
|
|
145
|
+
})
|
|
146
|
+
}, r);
|
|
147
|
+
};
|
|
148
|
+
return /* @__PURE__ */ x(d, {
|
|
149
|
+
label: n,
|
|
150
|
+
description: h,
|
|
151
|
+
disabled: g,
|
|
152
|
+
size: v,
|
|
153
|
+
className: oe,
|
|
154
|
+
children: ({ controlId: e, labelId: r, describedBy: a }) => {
|
|
155
|
+
let o = `${e}-listbox`;
|
|
156
|
+
return /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(c, {
|
|
157
|
+
ref: Ge,
|
|
158
|
+
rootRef: Ae,
|
|
159
|
+
id: e,
|
|
160
|
+
type: "text",
|
|
161
|
+
disabled: g,
|
|
162
|
+
readOnly: !R,
|
|
163
|
+
autoComplete: "off",
|
|
164
|
+
role: "combobox",
|
|
165
|
+
isLoading: _e,
|
|
166
|
+
open: V,
|
|
167
|
+
optionCount: T.length,
|
|
168
|
+
label: n,
|
|
169
|
+
placeholder: _,
|
|
170
|
+
value: We,
|
|
171
|
+
selectedValue: Be ?? Ue,
|
|
172
|
+
hasSelection: W !== void 0,
|
|
173
|
+
showSelectedValue: !1,
|
|
174
|
+
clearable: !!be,
|
|
175
|
+
onClear: Ke,
|
|
176
|
+
onToggleMouseDown: $.handleToggleMouseDown,
|
|
177
|
+
onToggleClick: $.handleToggleClick,
|
|
178
|
+
"aria-labelledby": r,
|
|
179
|
+
"aria-describedby": a,
|
|
180
|
+
"aria-haspopup": "listbox",
|
|
181
|
+
"aria-expanded": V,
|
|
182
|
+
"aria-controls": V ? o : void 0,
|
|
183
|
+
"aria-autocomplete": R ? "list" : "none",
|
|
184
|
+
"aria-activedescendant": V ? Z(o) : void 0,
|
|
185
|
+
inputClassName: y(se, "textOverflow"),
|
|
186
|
+
onChange: (e) => {
|
|
187
|
+
R && $.handleTriggerInputChange(e.target.value);
|
|
188
|
+
},
|
|
189
|
+
onClick: $.handleTriggerClick,
|
|
190
|
+
onFocus: (e) => {
|
|
191
|
+
$.handleTriggerFocus(e.currentTarget);
|
|
192
|
+
},
|
|
193
|
+
onKeyDown: (e) => {
|
|
194
|
+
Ie(e), !e.defaultPrevented && $.handleTriggerKeyDown({
|
|
195
|
+
event: e,
|
|
196
|
+
onActivateWhenOpen: Fe,
|
|
197
|
+
enableSpaceActivation: !R
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}), /* @__PURE__ */ x(i, {
|
|
201
|
+
open: V,
|
|
202
|
+
context: De,
|
|
203
|
+
floatingStyles: Oe,
|
|
204
|
+
listId: o,
|
|
205
|
+
labelId: r,
|
|
206
|
+
descriptionId: a,
|
|
207
|
+
activeOptionId: Q ? Z(o) : void 0,
|
|
208
|
+
setFloating: je,
|
|
209
|
+
getFloatingProps: ke,
|
|
210
|
+
onKeyDown: Le,
|
|
211
|
+
className: ce,
|
|
212
|
+
maxWidth: le,
|
|
213
|
+
toolbar: he,
|
|
214
|
+
children: /* @__PURE__ */ x("div", {
|
|
215
|
+
className: y(ue, "h100 scrollable overscroll"),
|
|
216
|
+
children: Q ? J ? J.map((e, n) => {
|
|
217
|
+
let r = e.group ? `${o}-group-${n}` : void 0, i = e.items.map(({ option: e, index: t }) => qe(o, e, t));
|
|
218
|
+
return e.group ? /* @__PURE__ */ S("div", {
|
|
219
|
+
role: "group",
|
|
220
|
+
"aria-labelledby": r,
|
|
221
|
+
children: [/* @__PURE__ */ x("div", {
|
|
222
|
+
id: r,
|
|
223
|
+
className: t.uiPopupGroupLabel,
|
|
224
|
+
children: e.group.label
|
|
225
|
+
}), i]
|
|
226
|
+
}, `group-${String(e.group.key)}-${n}`) : /* @__PURE__ */ x(te, { children: i }, `options-${n}`);
|
|
227
|
+
}) : q.map((e, t) => qe(o, e, t)) : /* @__PURE__ */ x(u, {
|
|
228
|
+
emptyState: ge,
|
|
229
|
+
errorState: ve
|
|
230
|
+
})
|
|
231
|
+
})
|
|
232
|
+
})] });
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region src/select/SelectOptionContent.tsx
|
|
238
|
+
function k({ label: t, code: n, highlight: r, labelClassName: i, codeClassName: a }) {
|
|
239
|
+
return /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(g, {
|
|
240
|
+
className: y("flexEllipsis", i),
|
|
241
|
+
children: /* @__PURE__ */ x(e, {
|
|
242
|
+
text: t,
|
|
243
|
+
highlight: r
|
|
244
|
+
})
|
|
245
|
+
}), n && /* @__PURE__ */ x(h, {
|
|
246
|
+
className: a,
|
|
247
|
+
children: /* @__PURE__ */ x(e, {
|
|
248
|
+
text: n,
|
|
249
|
+
highlight: r
|
|
250
|
+
})
|
|
251
|
+
})] });
|
|
252
|
+
}
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region src/select/ODataSelect.tsx
|
|
255
|
+
function A(e, t, n) {
|
|
256
|
+
return e ? t || Object.keys(e).find((e) => e !== n) || n : t || n;
|
|
257
|
+
}
|
|
258
|
+
var j = ({ odata: e, segment: t, model: r, size: i, label: a, description: o, disabled: s, value: c, dependencies: l, onChange: u, clearable: d }) => {
|
|
259
|
+
let f = D({
|
|
260
|
+
odata: e,
|
|
261
|
+
segment: t,
|
|
262
|
+
model: T(r),
|
|
263
|
+
value: c,
|
|
264
|
+
dependencies: l,
|
|
265
|
+
onChange: u
|
|
266
|
+
});
|
|
267
|
+
if (f.isLoading) return /* @__PURE__ */ x(n, {
|
|
268
|
+
size: i,
|
|
269
|
+
label: a,
|
|
270
|
+
description: o
|
|
271
|
+
});
|
|
272
|
+
let p = t.hideCode ?? e.hideCode, m = A(f.selectedItem ?? f.options[0], f.textKey, f.codeKey);
|
|
273
|
+
return /* @__PURE__ */ x(O, {
|
|
274
|
+
size: i,
|
|
275
|
+
label: a,
|
|
276
|
+
description: o,
|
|
277
|
+
options: f.options,
|
|
278
|
+
value: f.selectedItem,
|
|
279
|
+
onChange: f.handleChange,
|
|
280
|
+
getOptionKey: (e) => e[f.codeKey],
|
|
281
|
+
getOptionLabel: (e) => e[m],
|
|
282
|
+
getOptionCode: p ? void 0 : (e) => e[f.codeKey],
|
|
283
|
+
getOptionAriaLabel: (e) => p || e[m] === e[f.codeKey] ? String(e[m]) : `${e[m]} ${e[f.codeKey]}`,
|
|
284
|
+
renderValue: (e) => /* @__PURE__ */ x(k, {
|
|
285
|
+
label: e[m],
|
|
286
|
+
code: p ? void 0 : e[f.codeKey]
|
|
287
|
+
}),
|
|
288
|
+
renderOption: (e) => /* @__PURE__ */ x(k, {
|
|
289
|
+
label: e[m],
|
|
290
|
+
code: p ? void 0 : e[f.codeKey],
|
|
291
|
+
highlight: f.debouncedQuery
|
|
292
|
+
}),
|
|
293
|
+
searchable: !0,
|
|
294
|
+
query: f.query,
|
|
295
|
+
onQuery: f.setQuery,
|
|
296
|
+
defaultFilter: !1,
|
|
297
|
+
disabled: s || f.isLoading,
|
|
298
|
+
placeholder: f.placeholder,
|
|
299
|
+
isLoading: f.isLoading,
|
|
300
|
+
errorState: f.isError ? "Ошибка загрузки" : void 0,
|
|
301
|
+
emptyState: !f.isLoading && !f.isError ? "Нет данных" : void 0,
|
|
302
|
+
clearable: d
|
|
303
|
+
});
|
|
304
|
+
};
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region src/select/ODataDependentSegmentSelect.tsx
|
|
307
|
+
function M(e) {
|
|
308
|
+
let { item: t, disabled: n, label: r, description: i, size: a, width: o = 15, clearable: s } = e, c = _(e), { updateSegment: l } = c, u = `calc(${o}em + var(--width-add))`, d = C((e) => {
|
|
309
|
+
l(t.id, e === void 0 ? [] : [e]);
|
|
310
|
+
}, [t.id, l]);
|
|
311
|
+
return /* @__PURE__ */ x("div", {
|
|
312
|
+
style: {
|
|
313
|
+
maxWidth: u,
|
|
314
|
+
minWidth: u
|
|
315
|
+
},
|
|
316
|
+
children: /* @__PURE__ */ x(j, {
|
|
317
|
+
odata: t.odata,
|
|
318
|
+
segment: t.segment,
|
|
319
|
+
model: t.model,
|
|
320
|
+
dependencies: c.values,
|
|
321
|
+
value: c.values[t.id]?.[0],
|
|
322
|
+
onChange: d,
|
|
323
|
+
disabled: n || c.isSegmentDisabled(t.id),
|
|
324
|
+
label: r,
|
|
325
|
+
description: i,
|
|
326
|
+
size: a,
|
|
327
|
+
clearable: s
|
|
328
|
+
})
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
//#endregion
|
|
332
|
+
//#region src/select/SerializableSelect.tsx
|
|
333
|
+
function N(e, t) {
|
|
334
|
+
return String(e[t]);
|
|
335
|
+
}
|
|
336
|
+
function P(e, t, n) {
|
|
337
|
+
let r = e[t];
|
|
338
|
+
if (typeof r == "string" || typeof r == "number") return String(r);
|
|
339
|
+
let i = N(e, n);
|
|
340
|
+
return String(i);
|
|
341
|
+
}
|
|
342
|
+
function F({ label: e, description: t, disabled: n, placeholder: r, size: i, options: a, value: o, onChange: s, optionKey: c, optionLabel: l, renderCode: u, className: d, clearable: f }) {
|
|
343
|
+
let p = o === void 0 ? void 0 : a.find((e) => N(e, c) === o);
|
|
344
|
+
return /* @__PURE__ */ x(O, {
|
|
345
|
+
label: e,
|
|
346
|
+
description: t,
|
|
347
|
+
disabled: n,
|
|
348
|
+
placeholder: r,
|
|
349
|
+
size: i,
|
|
350
|
+
options: a,
|
|
351
|
+
value: p,
|
|
352
|
+
onChange: (e) => s(e ? N(e, c) : void 0),
|
|
353
|
+
getOptionKey: (e) => N(e, c),
|
|
354
|
+
getOptionLabel: (e) => P(e, l, c),
|
|
355
|
+
getOptionCode: u ? (e) => N(e, c) : void 0,
|
|
356
|
+
className: d,
|
|
357
|
+
clearable: f
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
//#endregion
|
|
361
|
+
export { E as a, O as i, M as n, j as r, F as t };
|
|
362
|
+
|
|
363
|
+
//# sourceMappingURL=select-DblNSc5H.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-aTGupQan.js","names":[],"sources":["../../src/select/lib/getOptionSearchText.ts","../../src/select/model/useODataSelect.ts","../../src/select/lib/createSelectOptionSections.ts","../../src/select/Select.tsx","../../src/select/SelectOptionContent.tsx","../../src/select/ODataSelect.tsx","../../src/select/ODataDependentSegmentSelect.tsx","../../src/select/SerializableSelect.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\nimport { InputType } from \"@ryuzaki13/react-foundation-lib/types\";\n\nimport { extractPickerTextContent } from \"../../picker\";\nimport { type SelectOptionGroup } from \"../SelectOptionGroup\";\n\nexport function getOptionSearchText<T extends InputType>({\n\toption,\n\tgetOptionLabel,\n\tgetOptionCode,\n\tgetOptionGroup\n}: {\n\toption: T;\n\tgetOptionLabel: (option: T) => ReactNode;\n\tgetOptionCode?: (option: T) => ReactNode;\n\tgetOptionGroup?: (option: T) => SelectOptionGroup | undefined;\n}) {\n\treturn [\n\t\textractPickerTextContent(getOptionLabel(option)),\n\t\textractPickerTextContent(getOptionCode?.(option)),\n\t\textractPickerTextContent(getOptionGroup?.(option)?.label)\n\t]\n\t\t.filter((part): part is string => Boolean(part))\n\t\t.join(\" \")\n\t\t.toLowerCase();\n}\n\n/** Находит selected option по value и возвращает fallback, если значение еще не нормализовано. */\nexport function resolveSelectedOption<TOption extends { value: string }>(\n\toptions: readonly TOption[],\n\tvalue: string,\n\tfallback: TOption\n): TOption {\n\treturn options.find((option) => option.value === value) ?? fallback;\n}\n","import { useMemo } from \"react\";\n\nimport { ODataCollectionModel, ODataSingleSelectProps } from \"@ryuzaki13/react-foundation-api/odata\";\nimport { CollectionItem } from \"@ryuzaki13/react-foundation-lib/odata-service\";\n\nimport { useODataSelectBase } from \"./useODataSelectBase\";\n\ninterface UseODataSelectOptions extends Omit<ODataSingleSelectProps, \"model\"> {\n\tmodel: Required<ODataCollectionModel>;\n\tonChange: (value: string | undefined) => void;\n}\n\nexport function useODataSelect({ odata, segment, model, value, dependencies, onChange }: UseODataSelectOptions) {\n\tconst odataModel = useODataSelectBase({\n\t\todata,\n\t\tsegment,\n\t\tmodel,\n\t\tvalue: value ? [value] : [],\n\t\tdependencies\n\t});\n\n\tconst selectedItem = odataModel.selectedItems[0];\n\tconst options = useMemo(() => {\n\t\tif (!selectedItem) {\n\t\t\treturn odataModel.filteredItems;\n\t\t}\n\n\t\treturn [selectedItem, ...odataModel.filteredItems];\n\t}, [odataModel.filteredItems, selectedItem]);\n\n\tconst handleChange = (item: CollectionItem | undefined) => {\n\t\tonChange(item?.[odataModel.selectionKey]);\n\t};\n\n\treturn {\n\t\t...odataModel,\n\t\tselectedItem,\n\t\toptions,\n\t\thandleChange\n\t};\n}\n","import { type SelectOptionGroup } from \"../SelectOptionGroup\";\n\nexport type SelectOptionSectionItem<TOption> = {\n\treadonly option: TOption;\n\treadonly index: number;\n};\n\nexport type SelectOptionSection<TOption> = {\n\treadonly group: SelectOptionGroup | undefined;\n\treadonly items: readonly SelectOptionSectionItem<TOption>[];\n};\n\n/**\n * Собирает соседние опции с одинаковым group key в секции, сохраняя исходные индексы для клавиатурной навигации listbox.\n */\nexport function createSelectOptionSections<TOption>(\n\toptions: readonly TOption[],\n\tgetOptionGroup: (option: TOption) => SelectOptionGroup | undefined\n): readonly SelectOptionSection<TOption>[] {\n\tconst sections: Array<{ group: SelectOptionGroup | undefined; items: SelectOptionSectionItem<TOption>[] }> = [];\n\n\toptions.forEach((option, index) => {\n\t\tconst group = getOptionGroup(option);\n\t\tconst currentSection = sections.at(-1);\n\t\tconst belongsToCurrentSection = currentSection?.group?.key === group?.key;\n\n\t\tif (currentSection && belongsToCurrentSection) {\n\t\t\tcurrentSection.items.push({ option, index });\n\t\t\treturn;\n\t\t}\n\n\t\tsections.push({\n\t\t\tgroup,\n\t\t\titems: [{ option, index }]\n\t\t});\n\t});\n\n\treturn sections;\n}\n","import { type CSSProperties, Fragment, ReactNode, useCallback, useMemo, useRef, useState } from \"react\";\n\nimport { Placement } from \"@floating-ui/react\";\nimport { InputType } from \"@ryuzaki13/react-foundation-lib/types\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { CheckIcon } from \"lucide-react\";\n\nimport { CustomOptionButton, Option, OptionButton } from \"../option\";\nimport {\n\textractPickerTextContent,\n\tPickerField,\n\tPickerPopup,\n\tPickerStatus,\n\tPickerTrigger,\n\tusePickerDefaultFilter,\n\tusePickerFloatingListbox,\n\tusePickerQuery,\n\tusePickerTriggerController\n} from \"../picker\";\nimport { ChangeHandler, UiBaseProps } from \"../types\";\nimport uiStyles from \"../ui.module.scss\";\n\nimport { getOptionSearchText } from \"./lib\";\nimport { createSelectOptionSections } from \"./lib/createSelectOptionSections\";\nimport { type SelectOptionGroup, type SelectOptionKey } from \"./SelectOptionGroup\";\n\nexport { type SelectOptionGroup, type SelectOptionKey } from \"./SelectOptionGroup\";\n\nexport type SelectOptionState = {\n\tactive: boolean;\n\tselected: boolean;\n\tdisabled: boolean;\n};\n\ntype SelectSharedProps<TOption extends InputType> = Omit<UiBaseProps<TOption, TOption | undefined>, \"onChange\"> & {\n\toptions: readonly TOption[];\n\tgetOptionKey: (option: TOption) => SelectOptionKey;\n\tgetOptionLabel: (option: TOption) => string;\n\tgetOptionCode?: (option: TOption) => string;\n\t/** Явный поисковый текст для опции с произвольным ReactNode-render. */\n\tgetOptionSearchText?: (option: TOption) => string | readonly string[];\n\tgetOptionDisabled?: (option: TOption) => boolean;\n\tgetOptionAriaLabel?: (option: TOption) => string;\n\tgetOptionGroup?: (option: TOption) => SelectOptionGroup | undefined;\n\tgetOptionClassName?: (option: TOption, state: SelectOptionState) => string | undefined;\n\trenderOption?: (option: TOption, state: SelectOptionState) => ReactNode;\n\trenderValue?: (option: TOption) => ReactNode;\n\tclassName?: string;\n\tbuttonClassName?: string;\n\toptionsClassName?: string;\n\toptionsMaxWidth?: CSSProperties[\"maxWidth\"];\n\toptionsContentClassName?: string;\n\tsearchable?: boolean;\n\tquery?: string;\n\tdefaultQuery?: string;\n\tonQuery?: (value: string) => void;\n\tdefaultFilter?: boolean;\n\tisLoading?: boolean;\n\trenderPopupHeader?: ReactNode;\n\temptyState?: ReactNode;\n\terrorState?: ReactNode;\n\tplacement?: Placement;\n};\n\ntype SelectChangeValue<TOption extends InputType, TClearable extends boolean | undefined> = true extends TClearable\n\t? TOption | undefined\n\t: TOption;\n\nexport type SelectProps<TOption extends InputType, TClearable extends boolean | undefined = false> = SelectSharedProps<TOption> & {\n\tclearable?: TClearable;\n\tonChange: ChangeHandler<SelectChangeValue<TOption, TClearable>>;\n};\n\n/**\n * Выпадающий список выбора значения из набора опций. Подходит для форм, фильтров и простых справочников.\n */\nexport function Select<TOption extends InputType, TClearable extends boolean | undefined = false>(props: SelectProps<TOption, TClearable>) {\n\tconst {\n\t\tlabel,\n\t\tdescription,\n\t\tdisabled,\n\t\tplaceholder,\n\t\tsize,\n\t\toptions,\n\t\tvalue,\n\t\tonChange,\n\t\tgetOptionKey,\n\t\tgetOptionLabel,\n\t\tgetOptionCode,\n\t\tgetOptionSearchText: getExplicitOptionSearchText,\n\t\tgetOptionDisabled,\n\t\tgetOptionAriaLabel,\n\t\tgetOptionGroup,\n\t\tgetOptionClassName,\n\t\trenderOption,\n\t\trenderValue,\n\t\tclassName,\n\t\tbuttonClassName,\n\t\toptionsClassName,\n\t\toptionsMaxWidth,\n\t\toptionsContentClassName,\n\t\tsearchable = false,\n\t\tdefaultFilter = true,\n\t\tquery,\n\t\tdefaultQuery,\n\t\tonQuery,\n\t\trenderPopupHeader,\n\t\temptyState,\n\t\tisLoading,\n\t\terrorState,\n\t\tplacement = \"bottom-start\",\n\t\tclearable = false\n\t} = props;\n\tconst emitChange = onChange as ChangeHandler<TOption | undefined>;\n\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst [open, setOpen] = useState(false);\n\tconst triggerMode = searchable ? \"search-single\" : \"display\";\n\tconst selectedKey = value === undefined ? undefined : getOptionKey(value);\n\tconst selectedOption =\n\t\tselectedKey === undefined ? undefined : (options.find((option) => getOptionKey(option) === selectedKey) ?? value);\n\tconst {\n\t\tquery: currentQuery,\n\t\tsetQuery,\n\t\tresetQueryOnClose\n\t} = usePickerQuery({\n\t\tquery,\n\t\tdefaultQuery,\n\t\tonQuery,\n\t\ttriggerMode\n\t});\n\tconst handleOpenChange = (nextOpen: boolean) => {\n\t\tif (open && !nextOpen && resetQueryOnClose) {\n\t\t\tsetQuery(\"\");\n\t\t}\n\n\t\tsetOpen(nextOpen);\n\t};\n\tconst getSearchText = useCallback(\n\t\t(option: TOption) =>\n\t\t\tgetExplicitOptionSearchText?.(option) ??\n\t\t\tgetOptionSearchText({\n\t\t\t\toption,\n\t\t\t\tgetOptionLabel,\n\t\t\t\tgetOptionCode,\n\t\t\t\tgetOptionGroup\n\t\t\t}),\n\t\t[getExplicitOptionSearchText, getOptionCode, getOptionGroup, getOptionLabel]\n\t);\n\tconst visibleOptions = usePickerDefaultFilter({\n\t\toptions,\n\t\tquery: currentQuery,\n\t\tenabled: searchable && defaultFilter,\n\t\tgetSearchText\n\t});\n\tconst optionSections = useMemo(\n\t\t() => (getOptionGroup ? createSelectOptionSections(visibleOptions, getOptionGroup) : undefined),\n\t\t[getOptionGroup, visibleOptions]\n\t);\n\tconst selectedIndex = selectedKey === undefined ? -1 : visibleOptions.findIndex((option) => getOptionKey(option) === selectedKey);\n\tconst {\n\t\tactiveIndex,\n\t\tcontext,\n\t\tfloatingStyles,\n\t\tgetFloatingProps,\n\t\tsetReference,\n\t\tsetFloating,\n\t\tsetOptionRef,\n\t\tclose,\n\t\topenList,\n\t\ttoggleOpen,\n\t\tselectOption,\n\t\tselectActiveOption,\n\t\thandleReferenceKeyDown,\n\t\thandleFloatingKeyDown,\n\t\tgetOptionId,\n\t\tgetActiveOptionId\n\t} = usePickerFloatingListbox({\n\t\toptions: visibleOptions,\n\t\tselectedIndex,\n\t\topen,\n\t\tonOpenChange: handleOpenChange,\n\t\tgetOptionDisabled,\n\t\tonSelect: emitChange,\n\t\tdisabled,\n\t\tplacement,\n\t\ttriggerMode\n\t});\n\n\tconst hasOptions = visibleOptions.length > 0;\n\tconst labelContent = selectedOption !== undefined ? getOptionLabel(selectedOption) : undefined;\n\tconst displayContent = selectedOption !== undefined ? (renderValue ? renderValue(selectedOption) : labelContent) : undefined;\n\tconst labelText = extractPickerTextContent(labelContent);\n\tconst codeText = selectedOption !== undefined ? extractPickerTextContent(getOptionCode?.(selectedOption)) : undefined;\n\tconst displayText =\n\t\textractPickerTextContent(displayContent) ?? labelText ?? codeText ?? (selectedKey !== undefined ? String(selectedKey) : \"\");\n\tconst showSearchValue = searchable && (open || currentQuery.length > 0);\n\tconst inputValue = showSearchValue ? currentQuery : selectedOption !== undefined ? displayText : \"\";\n\tconst triggerController = usePickerTriggerController({\n\t\tmode: triggerMode,\n\t\topen,\n\t\tcurrentQuery,\n\t\thasDisplayValue: selectedOption !== undefined,\n\t\tinputRef,\n\t\tsetQuery,\n\t\topenList,\n\t\tclose,\n\t\ttoggleOpen\n\t});\n\tconst setInputNode = (node: HTMLInputElement | null) => {\n\t\tinputRef.current = node;\n\t};\n\tconst handleClear = () => {\n\t\tif (clearable) {\n\t\t\temitChange(undefined);\n\t\t}\n\n\t\tsetQuery(\"\");\n\t\tclose();\n\t};\n\tconst renderOptionNode = (listId: string, option: TOption, index: number) => {\n\t\tconst optionKey = getOptionKey(option);\n\t\tconst selected = selectedKey !== undefined && optionKey === selectedKey;\n\t\tconst active = index === activeIndex;\n\t\tconst optionDisabled = getOptionDisabled?.(option) ?? false;\n\t\tconst optionState = { active, selected, disabled: optionDisabled };\n\n\t\treturn (\n\t\t\t<Option\n\t\t\t\tkey={optionKey}\n\t\t\t\tid={getOptionId(listId, index)}\n\t\t\t\tref={(node) => setOptionRef(index, node)}\n\t\t\t\trole=\"option\"\n\t\t\t\taria-selected={selected}\n\t\t\t\taria-disabled={optionDisabled || undefined}\n\t\t\t\taria-label={getOptionAriaLabel?.(option)}\n\t\t\t\tactive={active}\n\t\t\t\tselected={selected}\n\t\t\t\tdisabled={optionDisabled}\n\t\t\t\tclassName={getOptionClassName?.(option, optionState)}>\n\t\t\t\t{renderOption ? (\n\t\t\t\t\t<CustomOptionButton\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\tdisabled={optionDisabled}\n\t\t\t\t\t\tonMouseDown={(event) => event.preventDefault()}\n\t\t\t\t\t\tonClick={() => selectOption(option)}>\n\t\t\t\t\t\t{renderOption(option, optionState)}\n\t\t\t\t\t</CustomOptionButton>\n\t\t\t\t) : (\n\t\t\t\t\t<OptionButton\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\tdisabled={optionDisabled}\n\t\t\t\t\t\ticon={selected ? <CheckIcon /> : <span />}\n\t\t\t\t\t\ttext={getOptionLabel(option)}\n\t\t\t\t\t\tcode={getOptionCode?.(option)}\n\t\t\t\t\t\tonMouseDown={(event) => event.preventDefault()}\n\t\t\t\t\t\tonClick={() => selectOption(option)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Option>\n\t\t);\n\t};\n\n\treturn (\n\t\t<PickerField label={label} description={description} disabled={disabled} size={size} className={className}>\n\t\t\t{({ controlId, labelId, describedBy }) => {\n\t\t\t\tconst listId = `${controlId}-listbox`;\n\n\t\t\t\treturn (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PickerTrigger\n\t\t\t\t\t\t\tref={setInputNode}\n\t\t\t\t\t\t\trootRef={setReference}\n\t\t\t\t\t\t\tid={controlId}\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\treadOnly={!searchable}\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\t\topen={open}\n\t\t\t\t\t\t\toptionCount={options.length}\n\t\t\t\t\t\t\tlabel={label}\n\t\t\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\t\t\tvalue={inputValue}\n\t\t\t\t\t\t\tselectedValue={displayContent ?? displayText}\n\t\t\t\t\t\t\thasSelection={selectedOption !== undefined}\n\t\t\t\t\t\t\tshowSelectedValue={false /*selectedOption !== undefined && !showSearchValue*/}\n\t\t\t\t\t\t\tclearable={Boolean(clearable)}\n\t\t\t\t\t\t\tonClear={handleClear}\n\t\t\t\t\t\t\tonToggleMouseDown={triggerController.handleToggleMouseDown}\n\t\t\t\t\t\t\tonToggleClick={triggerController.handleToggleClick}\n\t\t\t\t\t\t\taria-labelledby={labelId}\n\t\t\t\t\t\t\taria-describedby={describedBy}\n\t\t\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\t\t\taria-expanded={open}\n\t\t\t\t\t\t\taria-controls={open ? listId : undefined}\n\t\t\t\t\t\t\taria-autocomplete={searchable ? \"list\" : \"none\"}\n\t\t\t\t\t\t\taria-activedescendant={open ? getActiveOptionId(listId) : undefined}\n\t\t\t\t\t\t\tinputClassName={cn(buttonClassName, \"textOverflow\")}\n\t\t\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\t\t\tif (!searchable) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttriggerController.handleTriggerInputChange(event.target.value);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonClick={triggerController.handleTriggerClick}\n\t\t\t\t\t\t\tonFocus={(event) => {\n\t\t\t\t\t\t\t\ttriggerController.handleTriggerFocus(event.currentTarget);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\t\t\t\thandleReferenceKeyDown(event);\n\n\t\t\t\t\t\t\t\tif (event.defaultPrevented) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttriggerController.handleTriggerKeyDown({\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\tonActivateWhenOpen: selectActiveOption,\n\t\t\t\t\t\t\t\t\tenableSpaceActivation: !searchable\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<PickerPopup\n\t\t\t\t\t\t\topen={open}\n\t\t\t\t\t\t\tcontext={context}\n\t\t\t\t\t\t\tfloatingStyles={floatingStyles}\n\t\t\t\t\t\t\tlistId={listId}\n\t\t\t\t\t\t\tlabelId={labelId}\n\t\t\t\t\t\t\tdescriptionId={describedBy}\n\t\t\t\t\t\t\tactiveOptionId={hasOptions ? getActiveOptionId(listId) : undefined}\n\t\t\t\t\t\t\tsetFloating={setFloating}\n\t\t\t\t\t\t\tgetFloatingProps={getFloatingProps}\n\t\t\t\t\t\t\tonKeyDown={handleFloatingKeyDown}\n\t\t\t\t\t\t\tclassName={optionsClassName}\n\t\t\t\t\t\t\tmaxWidth={optionsMaxWidth}\n\t\t\t\t\t\t\ttoolbar={renderPopupHeader}>\n\t\t\t\t\t\t\t<div className={cn(optionsContentClassName, \"h100 scrollable overscroll\")}>\n\t\t\t\t\t\t\t\t{hasOptions ? (\n\t\t\t\t\t\t\t\t\toptionSections ? (\n\t\t\t\t\t\t\t\t\t\toptionSections.map((section, sectionIndex) => {\n\t\t\t\t\t\t\t\t\t\t\tconst groupLabelId = section.group ? `${listId}-group-${sectionIndex}` : undefined;\n\t\t\t\t\t\t\t\t\t\t\tconst optionNodes = section.items.map(({ option, index }) =>\n\t\t\t\t\t\t\t\t\t\t\t\trenderOptionNode(listId, option, index)\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\treturn section.group ? (\n\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={`group-${String(section.group.key)}-${sectionIndex}`}\n\t\t\t\t\t\t\t\t\t\t\t\t\trole=\"group\"\n\t\t\t\t\t\t\t\t\t\t\t\t\taria-labelledby={groupLabelId}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div id={groupLabelId} className={uiStyles.uiPopupGroupLabel}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{section.group.label}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{optionNodes}\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t<Fragment key={`options-${sectionIndex}`}>{optionNodes}</Fragment>\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\tvisibleOptions.map((option, index) => renderOptionNode(listId, option, index))\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<PickerStatus emptyState={emptyState} errorState={errorState} />\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</PickerPopup>\n\t\t\t\t\t</>\n\t\t\t\t);\n\t\t\t}}\n\t\t</PickerField>\n\t);\n}\n","import { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { OptionCode, OptionText } from \"../option\";\nimport { HighlightText } from \"../text\";\n\ninterface OptionContentProps {\n\tlabel: string;\n\tcode?: string;\n\thighlight?: string;\n\t/** Приватный визуальный modifier label для специализированного владельца option. */\n\tlabelClassName?: string;\n\t/** Отдельный modifier code, потому что code задаёт собственный variable-font weight. */\n\tcodeClassName?: string;\n}\n\n/**\n * Универсальный рендерер опции. Используется и в single-select, и в multi-select.\n */\nexport function SelectOptionContent({ label, code, highlight, labelClassName, codeClassName }: OptionContentProps) {\n\treturn (\n\t\t<>\n\t\t\t<OptionText className={cn(\"flexEllipsis\", labelClassName)}>\n\t\t\t\t<HighlightText text={label} highlight={highlight} />\n\t\t\t</OptionText>\n\t\t\t{code && (\n\t\t\t\t<OptionCode className={codeClassName}>\n\t\t\t\t\t<HighlightText text={code} highlight={highlight} />\n\t\t\t\t</OptionCode>\n\t\t\t)}\n\t\t</>\n\t);\n}\n","import React from \"react\";\n\nimport { ODataSingleSelectProps, useODataCollectionModel } from \"@ryuzaki13/react-foundation-api/odata\";\nimport { CollectionItem } from \"@ryuzaki13/react-foundation-lib/odata-service\";\n\nimport { InputUILoading } from \"../input\";\nimport { UiBaseProps } from \"../types\";\n\nimport { useODataSelect } from \"./model/useODataSelect\";\nimport { Select } from \"./Select\";\nimport { SelectOptionContent } from \"./SelectOptionContent\";\n\ntype ODataSelectProps = Omit<ODataSingleSelectProps, \"value\"> & UiBaseProps<string | undefined> & { clearable?: boolean };\n\nfunction getODataOptionTextKey(item: CollectionItem | undefined, textKey: string, codeKey: string) {\n\tif (!item) {\n\t\treturn textKey || codeKey;\n\t}\n\n\treturn textKey || Object.keys(item).find((key) => key !== codeKey) || codeKey;\n}\n\nexport const ODataSelect: React.FC<ODataSelectProps> = ({\n\todata,\n\tsegment,\n\tmodel: initialModel,\n\tsize,\n\tlabel,\n\tdescription,\n\tdisabled,\n\tvalue,\n\tdependencies,\n\tonChange,\n\tclearable\n}) => {\n\tconst model = useODataCollectionModel(initialModel);\n\tconst odataModel = useODataSelect({\n\t\todata,\n\t\tsegment,\n\t\tmodel,\n\t\tvalue,\n\t\tdependencies,\n\t\tonChange\n\t});\n\n\tif (odataModel.isLoading) {\n\t\treturn <InputUILoading size={size} label={label} description={description} />;\n\t}\n\n\tconst hideCode = segment.hideCode ?? odata.hideCode;\n\tconst resolvedTextKey = getODataOptionTextKey(odataModel.selectedItem ?? odataModel.options[0], odataModel.textKey, odataModel.codeKey);\n\n\treturn (\n\t\t<Select\n\t\t\tsize={size}\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\toptions={odataModel.options}\n\t\t\tvalue={odataModel.selectedItem}\n\t\t\tonChange={odataModel.handleChange}\n\t\t\tgetOptionKey={(item) => item[odataModel.codeKey]}\n\t\t\tgetOptionLabel={(item) => item[resolvedTextKey]}\n\t\t\tgetOptionCode={hideCode ? undefined : (item) => item[odataModel.codeKey]}\n\t\t\tgetOptionAriaLabel={(item) =>\n\t\t\t\thideCode || item[resolvedTextKey] === item[odataModel.codeKey]\n\t\t\t\t\t? String(item[resolvedTextKey])\n\t\t\t\t\t: `${item[resolvedTextKey]} ${item[odataModel.codeKey]}`\n\t\t\t}\n\t\t\trenderValue={(item) => (\n\t\t\t\t<SelectOptionContent label={item[resolvedTextKey]} code={hideCode ? undefined : item[odataModel.codeKey]} />\n\t\t\t)}\n\t\t\trenderOption={(item) => (\n\t\t\t\t<SelectOptionContent\n\t\t\t\t\tlabel={item[resolvedTextKey]}\n\t\t\t\t\tcode={hideCode ? undefined : item[odataModel.codeKey]}\n\t\t\t\t\thighlight={odataModel.debouncedQuery}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\tsearchable\n\t\t\tquery={odataModel.query}\n\t\t\tonQuery={odataModel.setQuery}\n\t\t\tdefaultFilter={false}\n\t\t\tdisabled={disabled || odataModel.isLoading}\n\t\t\tplaceholder={odataModel.placeholder}\n\t\t\tisLoading={odataModel.isLoading}\n\t\t\terrorState={odataModel.isError ? \"Ошибка загрузки\" : undefined}\n\t\t\temptyState={!odataModel.isLoading && !odataModel.isError ? \"Нет данных\" : undefined}\n\t\t\tclearable={clearable}\n\t\t/>\n\t);\n};\n","import { useCallback } from \"react\";\n\nimport { useODataDependentSelection } from \"../odata-dependent\";\n\nimport { ODataSelect } from \"./ODataSelect\";\n\nimport type { ODataDependentSegmentControlProps } from \"../odata-dependent\";\n\nexport type ODataDependentSegmentSelectProps = ODataDependentSegmentControlProps & {\n\t/** Показывает действие очистки выбранного значения. */\n\tclearable?: boolean;\n};\n\n/**\n * Адаптирует один развёрнутый зависимый OData-сегмент к single-select UI.\n * Общий снимок остаётся массивным, поэтому совместим с `dependencies` и\n * может совместно использоваться с segment-level MultiSelect-контролами.\n */\nexport function ODataDependentSegmentSelect(props: ODataDependentSegmentSelectProps) {\n\tconst { item, disabled, label, description, size, width = 15, clearable } = props;\n\tconst selection = useODataDependentSelection(props);\n\tconst { updateSegment } = selection;\n\tconst widthStyle = `calc(${width}em + var(--width-add))`;\n\n\tconst handleSelectionChange = useCallback(\n\t\t(value: string | undefined) => {\n\t\t\tupdateSegment(item.id, value === undefined ? [] : [value]);\n\t\t},\n\t\t[item.id, updateSegment]\n\t);\n\n\treturn (\n\t\t<div style={{ maxWidth: widthStyle, minWidth: widthStyle }}>\n\t\t\t<ODataSelect\n\t\t\t\todata={item.odata}\n\t\t\t\tsegment={item.segment}\n\t\t\t\tmodel={item.model}\n\t\t\t\tdependencies={selection.values}\n\t\t\t\tvalue={selection.values[item.id]?.[0]}\n\t\t\t\tonChange={handleSelectionChange}\n\t\t\t\tdisabled={disabled || selection.isSegmentDisabled(item.id)}\n\t\t\t\tlabel={label}\n\t\t\t\tdescription={description}\n\t\t\t\tsize={size}\n\t\t\t\tclearable={clearable}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n","import { Select } from \"./Select\";\n\nimport type { UiBaseProps } from \"../types\";\nimport type { SelectOptionKey } from \"./Select\";\n\ntype SerializableOptionRecord = Record<string, unknown>;\n\ntype SerializableOptionKeyField<TOption extends SerializableOptionRecord> = {\n\t[K in keyof TOption]: Extract<TOption[K], SelectOptionKey> extends never ? never : K;\n}[keyof TOption];\n\ntype SerializableOptionValue<TOption extends SerializableOptionRecord, TOptionKey extends SerializableOptionKeyField<TOption>> = Extract<\n\tTOption[TOptionKey],\n\tSelectOptionKey\n>;\n\nexport interface SerializableSelectProps<\n\tTOption extends SerializableOptionRecord,\n\tTOptionKey extends SerializableOptionKeyField<TOption>,\n\tTOptionLabel extends keyof TOption\n> extends Omit<UiBaseProps<SerializableOptionValue<TOption, TOptionKey> | undefined>, \"onChange\"> {\n\toptions: readonly TOption[];\n\tonChange: (value: SerializableOptionValue<TOption, TOptionKey> | undefined) => void;\n\toptionKey: TOptionKey;\n\toptionLabel: TOptionLabel;\n\trenderCode?: true;\n\tclassName?: string;\n\tclearable?: boolean;\n}\n\nfunction getSerializableOptionKey<TOption extends SerializableOptionRecord, TOptionKey extends SerializableOptionKeyField<TOption>>(\n\toption: TOption,\n\toptionKey: TOptionKey\n): Extract<TOption[TOptionKey], SelectOptionKey> {\n\treturn String(option[optionKey]) as Extract<TOption[TOptionKey], SelectOptionKey>;\n}\n\nfunction getSerializableOptionLabel<\n\tTOption extends SerializableOptionRecord,\n\tTOptionKey extends SerializableOptionKeyField<TOption>,\n\tTOptionLabel extends keyof TOption\n>(option: TOption, optionLabel: TOptionLabel, optionKey: TOptionKey): string {\n\tconst label = option[optionLabel];\n\n\tif (typeof label === \"string\" || typeof label === \"number\") {\n\t\treturn String(label);\n\t}\n\n\tconst key = getSerializableOptionKey(option, optionKey);\n\treturn String(key);\n}\n\nexport function SerializableSelect<\n\tTOption extends SerializableOptionRecord,\n\tTOptionKey extends SerializableOptionKeyField<TOption>,\n\tTOptionLabel extends keyof TOption\n>({\n\tlabel,\n\tdescription,\n\tdisabled,\n\tplaceholder,\n\tsize,\n\toptions,\n\tvalue,\n\tonChange,\n\toptionKey,\n\toptionLabel,\n\trenderCode,\n\tclassName,\n\tclearable\n}: SerializableSelectProps<TOption, TOptionKey, TOptionLabel>) {\n\tconst selectedOption =\n\t\tvalue === undefined ? undefined : options.find((option) => getSerializableOptionKey(option, optionKey) === value);\n\n\treturn (\n\t\t<Select\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled}\n\t\t\tplaceholder={placeholder}\n\t\t\tsize={size}\n\t\t\toptions={options}\n\t\t\tvalue={selectedOption}\n\t\t\tonChange={(option: TOption | undefined) => onChange(option ? getSerializableOptionKey(option, optionKey) : undefined)}\n\t\t\tgetOptionKey={(option: TOption) => getSerializableOptionKey(option, optionKey)}\n\t\t\tgetOptionLabel={(option: TOption) => getSerializableOptionLabel(option, optionLabel, optionKey)}\n\t\t\tgetOptionCode={renderCode ? (option: TOption) => getSerializableOptionKey(option, optionKey) : undefined}\n\t\t\tclassName={className}\n\t\t\tclearable={clearable}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;AAOA,SAAgB,GAAyC,EACxD,WACA,mBACA,kBACA,qBAME;CACF,OAAO;EACN,EAAyB,EAAe,CAAM,CAAC;EAC/C,EAAyB,IAAgB,CAAM,CAAC;EAChD,EAAyB,IAAiB,CAAM,CAAC,EAAE,KAAK;CACzD,CAAC,CACC,QAAQ,MAAyB,EAAQ,CAAK,CAAC,CAC/C,KAAK,GAAG,CAAC,CACT,YAAY;AACf;AAGA,SAAgB,EACf,GACA,GACA,GACU;CACV,OAAO,EAAQ,MAAM,MAAW,EAAO,UAAU,CAAK,KAAK;AAC5D;;;ACvBA,SAAgB,EAAe,EAAE,UAAO,YAAS,UAAO,UAAO,iBAAc,eAAmC;CAC/G,IAAM,IAAa,EAAmB;EACrC;EACA;EACA;EACA,OAAO,IAAQ,CAAC,CAAK,IAAI,CAAC;EAC1B;CACD,CAAC,GAEK,IAAe,EAAW,cAAc,IACxC,IAAU,QACV,IAIE,CAAC,GAAc,GAAG,EAAW,a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AAO,EAAO,EAAU;AAChC;AAEA,SAAS,EAIP,GAAiB,GAA2B,GAA+B;CAC5E,IAAM,IAAQ,EAAO;CAErB,IAAI,OAAO,KAAU,YAAY,OAAO,KAAU,UACjD,OAAO,OAAO,CAAK;CAGpB,IAAM,IAAM,EAAyB,GAAQ,CAAS;CACtD,OAAO,OAAO,CAAG;AAClB;AAEA,SAAgB,EAId,EACD,UACA,gBACA,aACA,gBACA,SACA,YACA,UACA,aACA,cACA,gBACA,eACA,cACA,gBAC8D;CAC9D,IAAM,IACL,MAAU,KAAA,IAAY,KAAA,IAAY,EAAQ,MAAM,MAAW,EAAyB,GAAQ,CAAS,MAAM,CAAK;CAEjH,OACC,kBAAC,GAAD;EACQ;EACM;EACH;EACG;EACP;EACG;EACT,OAAO;EACP,WAAW,MAAgC,EAAS,IAAS,EAAyB,GAAQ,CAAS,IAAI,KAAA,CAAS;EACpH,eAAe,MAAoB,EAAyB,GAAQ,CAAS;EAC7E,iBAAiB,MAAoB,EAA2B,GAAQ,GAAa,CAAS;EAC9F,eAAe,KAAc,MAAoB,EAAyB,GAAQ,CAAS,IAAI,KAAA;EACpF;EACA;CACX,CAAA;AAEH"}
|
|
1
|
+
{"version":3,"file":"select-DblNSc5H.js","names":[],"sources":["../../src/select/lib/getOptionSearchText.ts","../../src/select/model/useODataSelect.ts","../../src/select/lib/createSelectOptionSections.ts","../../src/select/Select.tsx","../../src/select/SelectOptionContent.tsx","../../src/select/ODataSelect.tsx","../../src/select/ODataDependentSegmentSelect.tsx","../../src/select/SerializableSelect.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\nimport { InputType } from \"@ryuzaki13/react-foundation-lib/types\";\n\nimport { extractPickerTextContent } from \"../../picker\";\nimport { type SelectOptionGroup } from \"../SelectOptionGroup\";\n\nexport function getOptionSearchText<T extends InputType>({\n\toption,\n\tgetOptionLabel,\n\tgetOptionCode,\n\tgetOptionGroup\n}: {\n\toption: T;\n\tgetOptionLabel: (option: T) => ReactNode;\n\tgetOptionCode?: (option: T) => ReactNode;\n\tgetOptionGroup?: (option: T) => SelectOptionGroup | undefined;\n}) {\n\treturn [\n\t\textractPickerTextContent(getOptionLabel(option)),\n\t\textractPickerTextContent(getOptionCode?.(option)),\n\t\textractPickerTextContent(getOptionGroup?.(option)?.label)\n\t]\n\t\t.filter((part): part is string => Boolean(part))\n\t\t.join(\" \")\n\t\t.toLowerCase();\n}\n\n/** Находит selected option по value и возвращает fallback, если значение еще не нормализовано. */\nexport function resolveSelectedOption<TOption extends { value: string }>(\n\toptions: readonly TOption[],\n\tvalue: string,\n\tfallback: TOption\n): TOption {\n\treturn options.find((option) => option.value === value) ?? fallback;\n}\n","import { useMemo } from \"react\";\n\nimport { ODataCollectionModel, ODataSingleSelectProps } from \"@ryuzaki13/react-foundation-api/odata\";\nimport { CollectionItem } from \"@ryuzaki13/react-foundation-lib/odata-service\";\n\nimport { useODataSelectBase } from \"./useODataSelectBase\";\n\ninterface UseODataSelectOptions extends Omit<ODataSingleSelectProps, \"model\"> {\n\tmodel: Required<ODataCollectionModel>;\n\tonChange: (value: string | undefined) => void;\n}\n\nexport function useODataSelect({ odata, segment, model, value, dependencies, onChange }: UseODataSelectOptions) {\n\tconst odataModel = useODataSelectBase({\n\t\todata,\n\t\tsegment,\n\t\tmodel,\n\t\tvalue: value ? [value] : [],\n\t\tdependencies\n\t});\n\n\tconst selectedItem = odataModel.selectedItems[0];\n\tconst options = useMemo(() => {\n\t\tif (!selectedItem) {\n\t\t\treturn odataModel.filteredItems;\n\t\t}\n\n\t\treturn [selectedItem, ...odataModel.filteredItems];\n\t}, [odataModel.filteredItems, selectedItem]);\n\n\tconst handleChange = (item: CollectionItem | undefined) => {\n\t\tonChange(item?.[odataModel.selectionKey]);\n\t};\n\n\treturn {\n\t\t...odataModel,\n\t\tselectedItem,\n\t\toptions,\n\t\thandleChange\n\t};\n}\n","import { type SelectOptionGroup } from \"../SelectOptionGroup\";\n\nexport type SelectOptionSectionItem<TOption> = {\n\treadonly option: TOption;\n\treadonly index: number;\n};\n\nexport type SelectOptionSection<TOption> = {\n\treadonly group: SelectOptionGroup | undefined;\n\treadonly items: readonly SelectOptionSectionItem<TOption>[];\n};\n\n/**\n * Собирает соседние опции с одинаковым group key в секции, сохраняя исходные индексы для клавиатурной навигации listbox.\n */\nexport function createSelectOptionSections<TOption>(\n\toptions: readonly TOption[],\n\tgetOptionGroup: (option: TOption) => SelectOptionGroup | undefined\n): readonly SelectOptionSection<TOption>[] {\n\tconst sections: Array<{ group: SelectOptionGroup | undefined; items: SelectOptionSectionItem<TOption>[] }> = [];\n\n\toptions.forEach((option, index) => {\n\t\tconst group = getOptionGroup(option);\n\t\tconst currentSection = sections.at(-1);\n\t\tconst belongsToCurrentSection = currentSection?.group?.key === group?.key;\n\n\t\tif (currentSection && belongsToCurrentSection) {\n\t\t\tcurrentSection.items.push({ option, index });\n\t\t\treturn;\n\t\t}\n\n\t\tsections.push({\n\t\t\tgroup,\n\t\t\titems: [{ option, index }]\n\t\t});\n\t});\n\n\treturn sections;\n}\n","import { type CSSProperties, Fragment, ReactNode, useCallback, useMemo, useRef, useState } from \"react\";\n\nimport { Placement } from \"@floating-ui/react\";\nimport { InputType } from \"@ryuzaki13/react-foundation-lib/types\";\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\nimport { CheckIcon } from \"lucide-react\";\n\nimport { CustomOptionButton, Option, OptionButton } from \"../option\";\nimport {\n\textractPickerTextContent,\n\tPickerField,\n\tPickerPopup,\n\tPickerStatus,\n\tPickerTrigger,\n\tusePickerDefaultFilter,\n\tusePickerFloatingListbox,\n\tusePickerQuery,\n\tusePickerTriggerController\n} from \"../picker\";\nimport { ChangeHandler, UiBaseProps } from \"../types\";\nimport uiStyles from \"../ui.module.scss\";\n\nimport { getOptionSearchText } from \"./lib\";\nimport { createSelectOptionSections } from \"./lib/createSelectOptionSections\";\nimport { type SelectOptionGroup, type SelectOptionKey } from \"./SelectOptionGroup\";\n\nexport { type SelectOptionGroup, type SelectOptionKey } from \"./SelectOptionGroup\";\n\nexport type SelectOptionState = {\n\tactive: boolean;\n\tselected: boolean;\n\tdisabled: boolean;\n};\n\ntype SelectSharedProps<TOption extends InputType> = Omit<UiBaseProps<TOption, TOption | undefined>, \"onChange\"> & {\n\toptions: readonly TOption[];\n\tgetOptionKey: (option: TOption) => SelectOptionKey;\n\tgetOptionLabel: (option: TOption) => string;\n\tgetOptionCode?: (option: TOption) => string;\n\t/** Явный поисковый текст для опции с произвольным ReactNode-render. */\n\tgetOptionSearchText?: (option: TOption) => string | readonly string[];\n\tgetOptionDisabled?: (option: TOption) => boolean;\n\tgetOptionAriaLabel?: (option: TOption) => string;\n\tgetOptionGroup?: (option: TOption) => SelectOptionGroup | undefined;\n\tgetOptionClassName?: (option: TOption, state: SelectOptionState) => string | undefined;\n\trenderOption?: (option: TOption, state: SelectOptionState) => ReactNode;\n\trenderValue?: (option: TOption) => ReactNode;\n\tclassName?: string;\n\tbuttonClassName?: string;\n\toptionsClassName?: string;\n\toptionsMaxWidth?: CSSProperties[\"maxWidth\"];\n\toptionsContentClassName?: string;\n\tsearchable?: boolean;\n\tquery?: string;\n\tdefaultQuery?: string;\n\tonQuery?: (value: string) => void;\n\tdefaultFilter?: boolean;\n\tisLoading?: boolean;\n\trenderPopupHeader?: ReactNode;\n\temptyState?: ReactNode;\n\terrorState?: ReactNode;\n\tplacement?: Placement;\n};\n\ntype SelectChangeValue<TOption extends InputType, TClearable extends boolean | undefined> = true extends TClearable\n\t? TOption | undefined\n\t: TOption;\n\nexport type SelectProps<TOption extends InputType, TClearable extends boolean | undefined = false> = SelectSharedProps<TOption> & {\n\tclearable?: TClearable;\n\tonChange: ChangeHandler<SelectChangeValue<TOption, TClearable>>;\n};\n\n/**\n * Выпадающий список выбора значения из набора опций. Подходит для форм, фильтров и простых справочников.\n */\nexport function Select<TOption extends InputType, TClearable extends boolean | undefined = false>(props: SelectProps<TOption, TClearable>) {\n\tconst {\n\t\tlabel,\n\t\tdescription,\n\t\tdisabled,\n\t\tplaceholder,\n\t\tsize,\n\t\toptions,\n\t\tvalue,\n\t\tonChange,\n\t\tgetOptionKey,\n\t\tgetOptionLabel,\n\t\tgetOptionCode,\n\t\tgetOptionSearchText: getExplicitOptionSearchText,\n\t\tgetOptionDisabled,\n\t\tgetOptionAriaLabel,\n\t\tgetOptionGroup,\n\t\tgetOptionClassName,\n\t\trenderOption,\n\t\trenderValue,\n\t\tclassName,\n\t\tbuttonClassName,\n\t\toptionsClassName,\n\t\toptionsMaxWidth,\n\t\toptionsContentClassName,\n\t\tsearchable = false,\n\t\tdefaultFilter = true,\n\t\tquery,\n\t\tdefaultQuery,\n\t\tonQuery,\n\t\trenderPopupHeader,\n\t\temptyState,\n\t\tisLoading,\n\t\terrorState,\n\t\tplacement = \"bottom-start\",\n\t\tclearable = false\n\t} = props;\n\tconst emitChange = onChange as ChangeHandler<TOption | undefined>;\n\n\tconst inputRef = useRef<HTMLInputElement | null>(null);\n\tconst [open, setOpen] = useState(false);\n\tconst triggerMode = searchable ? \"search-single\" : \"display\";\n\tconst selectedKey = value === undefined ? undefined : getOptionKey(value);\n\tconst selectedOption =\n\t\tselectedKey === undefined ? undefined : (options.find((option) => getOptionKey(option) === selectedKey) ?? value);\n\tconst {\n\t\tquery: currentQuery,\n\t\tsetQuery,\n\t\tresetQueryOnClose\n\t} = usePickerQuery({\n\t\tquery,\n\t\tdefaultQuery,\n\t\tonQuery,\n\t\ttriggerMode\n\t});\n\tconst handleOpenChange = (nextOpen: boolean) => {\n\t\tif (open && !nextOpen && resetQueryOnClose) {\n\t\t\tsetQuery(\"\");\n\t\t}\n\n\t\tsetOpen(nextOpen);\n\t};\n\tconst getSearchText = useCallback(\n\t\t(option: TOption) =>\n\t\t\tgetExplicitOptionSearchText?.(option) ??\n\t\t\tgetOptionSearchText({\n\t\t\t\toption,\n\t\t\t\tgetOptionLabel,\n\t\t\t\tgetOptionCode,\n\t\t\t\tgetOptionGroup\n\t\t\t}),\n\t\t[getExplicitOptionSearchText, getOptionCode, getOptionGroup, getOptionLabel]\n\t);\n\tconst visibleOptions = usePickerDefaultFilter({\n\t\toptions,\n\t\tquery: currentQuery,\n\t\tenabled: searchable && defaultFilter,\n\t\tgetSearchText\n\t});\n\tconst optionSections = useMemo(\n\t\t() => (getOptionGroup ? createSelectOptionSections(visibleOptions, getOptionGroup) : undefined),\n\t\t[getOptionGroup, visibleOptions]\n\t);\n\tconst selectedIndex = selectedKey === undefined ? -1 : visibleOptions.findIndex((option) => getOptionKey(option) === selectedKey);\n\tconst {\n\t\tactiveIndex,\n\t\tcontext,\n\t\tfloatingStyles,\n\t\tgetFloatingProps,\n\t\tsetReference,\n\t\tsetFloating,\n\t\tsetOptionRef,\n\t\tclose,\n\t\topenList,\n\t\ttoggleOpen,\n\t\tselectOption,\n\t\tselectActiveOption,\n\t\thandleReferenceKeyDown,\n\t\thandleFloatingKeyDown,\n\t\tgetOptionId,\n\t\tgetActiveOptionId\n\t} = usePickerFloatingListbox({\n\t\toptions: visibleOptions,\n\t\tselectedIndex,\n\t\topen,\n\t\tonOpenChange: handleOpenChange,\n\t\tgetOptionDisabled,\n\t\tonSelect: emitChange,\n\t\tdisabled,\n\t\tplacement,\n\t\ttriggerMode\n\t});\n\n\tconst hasOptions = visibleOptions.length > 0;\n\tconst labelContent = selectedOption !== undefined ? getOptionLabel(selectedOption) : undefined;\n\tconst displayContent = selectedOption !== undefined ? (renderValue ? renderValue(selectedOption) : labelContent) : undefined;\n\tconst labelText = extractPickerTextContent(labelContent);\n\tconst codeText = selectedOption !== undefined ? extractPickerTextContent(getOptionCode?.(selectedOption)) : undefined;\n\tconst displayText =\n\t\textractPickerTextContent(displayContent) ?? labelText ?? codeText ?? (selectedKey !== undefined ? String(selectedKey) : \"\");\n\tconst showSearchValue = searchable && (open || currentQuery.length > 0);\n\tconst inputValue = showSearchValue ? currentQuery : selectedOption !== undefined ? displayText : \"\";\n\tconst triggerController = usePickerTriggerController({\n\t\tmode: triggerMode,\n\t\topen,\n\t\tcurrentQuery,\n\t\thasDisplayValue: selectedOption !== undefined,\n\t\tinputRef,\n\t\tsetQuery,\n\t\topenList,\n\t\tclose,\n\t\ttoggleOpen\n\t});\n\tconst setInputNode = (node: HTMLInputElement | null) => {\n\t\tinputRef.current = node;\n\t};\n\tconst handleClear = () => {\n\t\tif (clearable) {\n\t\t\temitChange(undefined);\n\t\t}\n\n\t\tsetQuery(\"\");\n\t\tclose();\n\t};\n\tconst renderOptionNode = (listId: string, option: TOption, index: number) => {\n\t\tconst optionKey = getOptionKey(option);\n\t\tconst selected = selectedKey !== undefined && optionKey === selectedKey;\n\t\tconst active = index === activeIndex;\n\t\tconst optionDisabled = getOptionDisabled?.(option) ?? false;\n\t\tconst optionState = { active, selected, disabled: optionDisabled };\n\n\t\treturn (\n\t\t\t<Option\n\t\t\t\tkey={optionKey}\n\t\t\t\tid={getOptionId(listId, index)}\n\t\t\t\tref={(node) => setOptionRef(index, node)}\n\t\t\t\trole=\"option\"\n\t\t\t\taria-selected={selected}\n\t\t\t\taria-disabled={optionDisabled || undefined}\n\t\t\t\taria-label={getOptionAriaLabel?.(option)}\n\t\t\t\tactive={active}\n\t\t\t\tselected={selected}\n\t\t\t\tdisabled={optionDisabled}\n\t\t\t\tclassName={getOptionClassName?.(option, optionState)}>\n\t\t\t\t{renderOption ? (\n\t\t\t\t\t<CustomOptionButton\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\tdisabled={optionDisabled}\n\t\t\t\t\t\tonMouseDown={(event) => event.preventDefault()}\n\t\t\t\t\t\tonClick={() => selectOption(option)}>\n\t\t\t\t\t\t{renderOption(option, optionState)}\n\t\t\t\t\t</CustomOptionButton>\n\t\t\t\t) : (\n\t\t\t\t\t<OptionButton\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\tdisabled={optionDisabled}\n\t\t\t\t\t\ticon={selected ? <CheckIcon /> : <span />}\n\t\t\t\t\t\ttext={getOptionLabel(option)}\n\t\t\t\t\t\tcode={getOptionCode?.(option)}\n\t\t\t\t\t\tonMouseDown={(event) => event.preventDefault()}\n\t\t\t\t\t\tonClick={() => selectOption(option)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Option>\n\t\t);\n\t};\n\n\treturn (\n\t\t<PickerField label={label} description={description} disabled={disabled} size={size} className={className}>\n\t\t\t{({ controlId, labelId, describedBy }) => {\n\t\t\t\tconst listId = `${controlId}-listbox`;\n\n\t\t\t\treturn (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PickerTrigger\n\t\t\t\t\t\t\tref={setInputNode}\n\t\t\t\t\t\t\trootRef={setReference}\n\t\t\t\t\t\t\tid={controlId}\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\treadOnly={!searchable}\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\t\topen={open}\n\t\t\t\t\t\t\toptionCount={options.length}\n\t\t\t\t\t\t\tlabel={label}\n\t\t\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\t\t\tvalue={inputValue}\n\t\t\t\t\t\t\tselectedValue={displayContent ?? displayText}\n\t\t\t\t\t\t\thasSelection={selectedOption !== undefined}\n\t\t\t\t\t\t\tshowSelectedValue={false /*selectedOption !== undefined && !showSearchValue*/}\n\t\t\t\t\t\t\tclearable={Boolean(clearable)}\n\t\t\t\t\t\t\tonClear={handleClear}\n\t\t\t\t\t\t\tonToggleMouseDown={triggerController.handleToggleMouseDown}\n\t\t\t\t\t\t\tonToggleClick={triggerController.handleToggleClick}\n\t\t\t\t\t\t\taria-labelledby={labelId}\n\t\t\t\t\t\t\taria-describedby={describedBy}\n\t\t\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\t\t\taria-expanded={open}\n\t\t\t\t\t\t\taria-controls={open ? listId : undefined}\n\t\t\t\t\t\t\taria-autocomplete={searchable ? \"list\" : \"none\"}\n\t\t\t\t\t\t\taria-activedescendant={open ? getActiveOptionId(listId) : undefined}\n\t\t\t\t\t\t\tinputClassName={cn(buttonClassName, \"textOverflow\")}\n\t\t\t\t\t\t\tonChange={(event) => {\n\t\t\t\t\t\t\t\tif (!searchable) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttriggerController.handleTriggerInputChange(event.target.value);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonClick={triggerController.handleTriggerClick}\n\t\t\t\t\t\t\tonFocus={(event) => {\n\t\t\t\t\t\t\t\ttriggerController.handleTriggerFocus(event.currentTarget);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\t\t\t\thandleReferenceKeyDown(event);\n\n\t\t\t\t\t\t\t\tif (event.defaultPrevented) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttriggerController.handleTriggerKeyDown({\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\tonActivateWhenOpen: selectActiveOption,\n\t\t\t\t\t\t\t\t\tenableSpaceActivation: !searchable\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<PickerPopup\n\t\t\t\t\t\t\topen={open}\n\t\t\t\t\t\t\tcontext={context}\n\t\t\t\t\t\t\tfloatingStyles={floatingStyles}\n\t\t\t\t\t\t\tlistId={listId}\n\t\t\t\t\t\t\tlabelId={labelId}\n\t\t\t\t\t\t\tdescriptionId={describedBy}\n\t\t\t\t\t\t\tactiveOptionId={hasOptions ? getActiveOptionId(listId) : undefined}\n\t\t\t\t\t\t\tsetFloating={setFloating}\n\t\t\t\t\t\t\tgetFloatingProps={getFloatingProps}\n\t\t\t\t\t\t\tonKeyDown={handleFloatingKeyDown}\n\t\t\t\t\t\t\tclassName={optionsClassName}\n\t\t\t\t\t\t\tmaxWidth={optionsMaxWidth}\n\t\t\t\t\t\t\ttoolbar={renderPopupHeader}>\n\t\t\t\t\t\t\t<div className={cn(optionsContentClassName, \"h100 scrollable overscroll\")}>\n\t\t\t\t\t\t\t\t{hasOptions ? (\n\t\t\t\t\t\t\t\t\toptionSections ? (\n\t\t\t\t\t\t\t\t\t\toptionSections.map((section, sectionIndex) => {\n\t\t\t\t\t\t\t\t\t\t\tconst groupLabelId = section.group ? `${listId}-group-${sectionIndex}` : undefined;\n\t\t\t\t\t\t\t\t\t\t\tconst optionNodes = section.items.map(({ option, index }) =>\n\t\t\t\t\t\t\t\t\t\t\t\trenderOptionNode(listId, option, index)\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t\treturn section.group ? (\n\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={`group-${String(section.group.key)}-${sectionIndex}`}\n\t\t\t\t\t\t\t\t\t\t\t\t\trole=\"group\"\n\t\t\t\t\t\t\t\t\t\t\t\t\taria-labelledby={groupLabelId}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div id={groupLabelId} className={uiStyles.uiPopupGroupLabel}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{section.group.label}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{optionNodes}\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t<Fragment key={`options-${sectionIndex}`}>{optionNodes}</Fragment>\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\tvisibleOptions.map((option, index) => renderOptionNode(listId, option, index))\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<PickerStatus emptyState={emptyState} errorState={errorState} />\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</PickerPopup>\n\t\t\t\t\t</>\n\t\t\t\t);\n\t\t\t}}\n\t\t</PickerField>\n\t);\n}\n","import { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { OptionCode, OptionText } from \"../option\";\nimport { HighlightText } from \"../text\";\n\ninterface OptionContentProps {\n\tlabel: string;\n\tcode?: string;\n\thighlight?: string;\n\t/** Приватный визуальный modifier label для специализированного владельца option. */\n\tlabelClassName?: string;\n\t/** Отдельный modifier code, потому что code задаёт собственный variable-font weight. */\n\tcodeClassName?: string;\n}\n\n/**\n * Универсальный рендерер опции. Используется и в single-select, и в multi-select.\n */\nexport function SelectOptionContent({ label, code, highlight, labelClassName, codeClassName }: OptionContentProps) {\n\treturn (\n\t\t<>\n\t\t\t<OptionText className={cn(\"flexEllipsis\", labelClassName)}>\n\t\t\t\t<HighlightText text={label} highlight={highlight} />\n\t\t\t</OptionText>\n\t\t\t{code && (\n\t\t\t\t<OptionCode className={codeClassName}>\n\t\t\t\t\t<HighlightText text={code} highlight={highlight} />\n\t\t\t\t</OptionCode>\n\t\t\t)}\n\t\t</>\n\t);\n}\n","import React from \"react\";\n\nimport { ODataSingleSelectProps, useODataCollectionModel } from \"@ryuzaki13/react-foundation-api/odata\";\nimport { CollectionItem } from \"@ryuzaki13/react-foundation-lib/odata-service\";\n\nimport { InputUILoading } from \"../input\";\nimport { UiBaseProps } from \"../types\";\n\nimport { useODataSelect } from \"./model/useODataSelect\";\nimport { Select } from \"./Select\";\nimport { SelectOptionContent } from \"./SelectOptionContent\";\n\ntype ODataSelectProps = Omit<ODataSingleSelectProps, \"value\"> & UiBaseProps<string | undefined> & { clearable?: boolean };\n\nfunction getODataOptionTextKey(item: CollectionItem | undefined, textKey: string, codeKey: string) {\n\tif (!item) {\n\t\treturn textKey || codeKey;\n\t}\n\n\treturn textKey || Object.keys(item).find((key) => key !== codeKey) || codeKey;\n}\n\nexport const ODataSelect: React.FC<ODataSelectProps> = ({\n\todata,\n\tsegment,\n\tmodel: initialModel,\n\tsize,\n\tlabel,\n\tdescription,\n\tdisabled,\n\tvalue,\n\tdependencies,\n\tonChange,\n\tclearable\n}) => {\n\tconst model = useODataCollectionModel(initialModel);\n\tconst odataModel = useODataSelect({\n\t\todata,\n\t\tsegment,\n\t\tmodel,\n\t\tvalue,\n\t\tdependencies,\n\t\tonChange\n\t});\n\n\tif (odataModel.isLoading) {\n\t\treturn <InputUILoading size={size} label={label} description={description} />;\n\t}\n\n\tconst hideCode = segment.hideCode ?? odata.hideCode;\n\tconst resolvedTextKey = getODataOptionTextKey(odataModel.selectedItem ?? odataModel.options[0], odataModel.textKey, odataModel.codeKey);\n\n\treturn (\n\t\t<Select\n\t\t\tsize={size}\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\toptions={odataModel.options}\n\t\t\tvalue={odataModel.selectedItem}\n\t\t\tonChange={odataModel.handleChange}\n\t\t\tgetOptionKey={(item) => item[odataModel.codeKey]}\n\t\t\tgetOptionLabel={(item) => item[resolvedTextKey]}\n\t\t\tgetOptionCode={hideCode ? undefined : (item) => item[odataModel.codeKey]}\n\t\t\tgetOptionAriaLabel={(item) =>\n\t\t\t\thideCode || item[resolvedTextKey] === item[odataModel.codeKey]\n\t\t\t\t\t? String(item[resolvedTextKey])\n\t\t\t\t\t: `${item[resolvedTextKey]} ${item[odataModel.codeKey]}`\n\t\t\t}\n\t\t\trenderValue={(item) => (\n\t\t\t\t<SelectOptionContent label={item[resolvedTextKey]} code={hideCode ? undefined : item[odataModel.codeKey]} />\n\t\t\t)}\n\t\t\trenderOption={(item) => (\n\t\t\t\t<SelectOptionContent\n\t\t\t\t\tlabel={item[resolvedTextKey]}\n\t\t\t\t\tcode={hideCode ? undefined : item[odataModel.codeKey]}\n\t\t\t\t\thighlight={odataModel.debouncedQuery}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\tsearchable\n\t\t\tquery={odataModel.query}\n\t\t\tonQuery={odataModel.setQuery}\n\t\t\tdefaultFilter={false}\n\t\t\tdisabled={disabled || odataModel.isLoading}\n\t\t\tplaceholder={odataModel.placeholder}\n\t\t\tisLoading={odataModel.isLoading}\n\t\t\terrorState={odataModel.isError ? \"Ошибка загрузки\" : undefined}\n\t\t\temptyState={!odataModel.isLoading && !odataModel.isError ? \"Нет данных\" : undefined}\n\t\t\tclearable={clearable}\n\t\t/>\n\t);\n};\n","import { useCallback } from \"react\";\n\nimport { useODataDependentSelection } from \"../odata-dependent\";\n\nimport { ODataSelect } from \"./ODataSelect\";\n\nimport type { ODataDependentSegmentControlProps } from \"../odata-dependent\";\n\nexport type ODataDependentSegmentSelectProps = ODataDependentSegmentControlProps & {\n\t/** Показывает действие очистки выбранного значения. */\n\tclearable?: boolean;\n};\n\n/**\n * Адаптирует один развёрнутый зависимый OData-сегмент к single-select UI.\n * Общий снимок остаётся массивным, поэтому совместим с `dependencies` и\n * может совместно использоваться с segment-level MultiSelect-контролами.\n */\nexport function ODataDependentSegmentSelect(props: ODataDependentSegmentSelectProps) {\n\tconst { item, disabled, label, description, size, width = 15, clearable } = props;\n\tconst selection = useODataDependentSelection(props);\n\tconst { updateSegment } = selection;\n\tconst widthStyle = `calc(${width}em + var(--width-add))`;\n\n\tconst handleSelectionChange = useCallback(\n\t\t(value: string | undefined) => {\n\t\t\tupdateSegment(item.id, value === undefined ? [] : [value]);\n\t\t},\n\t\t[item.id, updateSegment]\n\t);\n\n\treturn (\n\t\t<div style={{ maxWidth: widthStyle, minWidth: widthStyle }}>\n\t\t\t<ODataSelect\n\t\t\t\todata={item.odata}\n\t\t\t\tsegment={item.segment}\n\t\t\t\tmodel={item.model}\n\t\t\t\tdependencies={selection.values}\n\t\t\t\tvalue={selection.values[item.id]?.[0]}\n\t\t\t\tonChange={handleSelectionChange}\n\t\t\t\tdisabled={disabled || selection.isSegmentDisabled(item.id)}\n\t\t\t\tlabel={label}\n\t\t\t\tdescription={description}\n\t\t\t\tsize={size}\n\t\t\t\tclearable={clearable}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n","import { Select } from \"./Select\";\n\nimport type { UiBaseProps } from \"../types\";\nimport type { SelectOptionKey } from \"./Select\";\n\ntype SerializableOptionRecord = Record<string, unknown>;\n\ntype SerializableOptionKeyField<TOption extends SerializableOptionRecord> = {\n\t[K in keyof TOption]: Extract<TOption[K], SelectOptionKey> extends never ? never : K;\n}[keyof TOption];\n\ntype SerializableOptionValue<TOption extends SerializableOptionRecord, TOptionKey extends SerializableOptionKeyField<TOption>> = Extract<\n\tTOption[TOptionKey],\n\tSelectOptionKey\n>;\n\nexport interface SerializableSelectProps<\n\tTOption extends SerializableOptionRecord,\n\tTOptionKey extends SerializableOptionKeyField<TOption>,\n\tTOptionLabel extends keyof TOption\n> extends Omit<UiBaseProps<SerializableOptionValue<TOption, TOptionKey> | undefined>, \"onChange\"> {\n\toptions: readonly TOption[];\n\tonChange: (value: SerializableOptionValue<TOption, TOptionKey> | undefined) => void;\n\toptionKey: TOptionKey;\n\toptionLabel: TOptionLabel;\n\trenderCode?: true;\n\tclassName?: string;\n\tclearable?: boolean;\n}\n\nfunction getSerializableOptionKey<TOption extends SerializableOptionRecord, TOptionKey extends SerializableOptionKeyField<TOption>>(\n\toption: TOption,\n\toptionKey: TOptionKey\n): Extract<TOption[TOptionKey], SelectOptionKey> {\n\treturn String(option[optionKey]) as Extract<TOption[TOptionKey], SelectOptionKey>;\n}\n\nfunction getSerializableOptionLabel<\n\tTOption extends SerializableOptionRecord,\n\tTOptionKey extends SerializableOptionKeyField<TOption>,\n\tTOptionLabel extends keyof TOption\n>(option: TOption, optionLabel: TOptionLabel, optionKey: TOptionKey): string {\n\tconst label = option[optionLabel];\n\n\tif (typeof label === \"string\" || typeof label === \"number\") {\n\t\treturn String(label);\n\t}\n\n\tconst key = getSerializableOptionKey(option, optionKey);\n\treturn String(key);\n}\n\nexport function SerializableSelect<\n\tTOption extends SerializableOptionRecord,\n\tTOptionKey extends SerializableOptionKeyField<TOption>,\n\tTOptionLabel extends keyof TOption\n>({\n\tlabel,\n\tdescription,\n\tdisabled,\n\tplaceholder,\n\tsize,\n\toptions,\n\tvalue,\n\tonChange,\n\toptionKey,\n\toptionLabel,\n\trenderCode,\n\tclassName,\n\tclearable\n}: SerializableSelectProps<TOption, TOptionKey, TOptionLabel>) {\n\tconst selectedOption =\n\t\tvalue === undefined ? undefined : options.find((option) => getSerializableOptionKey(option, optionKey) === value);\n\n\treturn (\n\t\t<Select\n\t\t\tlabel={label}\n\t\t\tdescription={description}\n\t\t\tdisabled={disabled}\n\t\t\tplaceholder={placeholder}\n\t\t\tsize={size}\n\t\t\toptions={options}\n\t\t\tvalue={selectedOption}\n\t\t\tonChange={(option: TOption | undefined) => onChange(option ? getSerializableOptionKey(option, optionKey) : undefined)}\n\t\t\tgetOptionKey={(option: TOption) => getSerializableOptionKey(option, optionKey)}\n\t\t\tgetOptionLabel={(option: TOption) => getSerializableOptionLabel(option, optionLabel, optionKey)}\n\t\t\tgetOptionCode={renderCode ? (option: TOption) => getSerializableOptionKey(option, optionKey) : undefined}\n\t\t\tclassName={className}\n\t\t\tclearable={clearable}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;AAOA,SAAgB,GAAyC,EACxD,WACA,mBACA,kBACA,qBAME;CACF,OAAO;EACN,EAAyB,EAAe,CAAM,CAAC;EAC/C,EAAyB,IAAgB,CAAM,CAAC;EAChD,EAAyB,IAAiB,CAAM,CAAC,EAAE,KAAK;CACzD,CAAC,CACC,QAAQ,MAAyB,EAAQ,CAAK,CAAC,CAC/C,KAAK,GAAG,CAAC,CACT,YAAY;AACf;AAGA,SAAgB,EACf,GACA,GACA,GACU;CACV,OAAO,EAAQ,MAAM,MAAW,EAAO,UAAU,CAAK,KAAK;AAC5D;;;ACvBA,SAAgB,EAAe,EAAE,UAAO,YAAS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,cAAc,EAAU;GACxB,OAAO,EAAU,OAAO,EAAK,GAAG,GAAG;GACnC,UAAU;GACV,UAAU,KAAY,EAAU,kBAAkB,EAAK,EAAE;GAClD;GACM;GACP;GACK;EACX,CAAA;CACG,CAAA;AAEP;;;AClBA,SAAS,EACR,GACA,GACgD;CAChD,OAAO,OAAO,EAAO,EAAU;AAChC;AAEA,SAAS,EAIP,GAAiB,GAA2B,GAA+B;CAC5E,IAAM,IAAQ,EAAO;CAErB,IAAI,OAAO,KAAU,YAAY,OAAO,KAAU,UACjD,OAAO,OAAO,CAAK;CAGpB,IAAM,IAAM,EAAyB,GAAQ,CAAS;CACtD,OAAO,OAAO,CAAG;AAClB;AAEA,SAAgB,EAId,EACD,UACA,gBACA,aACA,gBACA,SACA,YACA,UACA,aACA,cACA,gBACA,eACA,cACA,gBAC8D;CAC9D,IAAM,IACL,MAAU,KAAA,IAAY,KAAA,IAAY,EAAQ,MAAM,MAAW,EAAyB,GAAQ,CAAS,MAAM,CAAK;CAEjH,OACC,kBAAC,GAAD;EACQ;EACM;EACH;EACG;EACP;EACG;EACT,OAAO;EACP,WAAW,MAAgC,EAAS,IAAS,EAAyB,GAAQ,CAAS,IAAI,KAAA,CAAS;EACpH,eAAe,MAAoB,EAAyB,GAAQ,CAAS;EAC7E,iBAAiB,MAAoB,EAA2B,GAAQ,GAAa,CAAS;EAC9F,eAAe,KAAc,MAAoB,EAAyB,GAAQ,CAAS,IAAI,KAAA;EACpF;EACA;CACX,CAAA;AAEH"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PolymorphicComponent as e } from "../polymorphic/index.js";
|
|
2
|
-
import "react";
|
|
3
2
|
import { cn as t } from "@ryuzaki13/react-foundation-lib/utils";
|
|
4
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import "react";
|
|
5
5
|
//#region src/separator/Separator.tsx
|
|
6
6
|
var r = ({ as: r, orientation: i = "horizontal", className: a, ...o }) => /* @__PURE__ */ n(e, {
|
|
7
7
|
as: r,
|
|
@@ -12,4 +12,4 @@ var r = ({ as: r, orientation: i = "horizontal", className: a, ...o }) => /* @__
|
|
|
12
12
|
//#endregion
|
|
13
13
|
export { r as t };
|
|
14
14
|
|
|
15
|
-
//# sourceMappingURL=separator-
|
|
15
|
+
//# sourceMappingURL=separator-CIqnk2z9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"separator-
|
|
1
|
+
{"version":3,"file":"separator-CIqnk2z9.js","names":[],"sources":["../../src/separator/Separator.tsx"],"sourcesContent":["import React from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport { PolymorphicComponent, PolymorphicComponentBaseProps } from \"../polymorphic\";\n\ntype SeparatorOwnProps<E extends React.ElementType = React.ElementType> = PolymorphicComponentBaseProps<E> & {\n\torientation?: \"horizontal\" | \"vertical\";\n\tclassName?: string;\n};\n\ntype SeparatorProps<E extends React.ElementType> = SeparatorOwnProps<E> & Omit<React.ComponentPropsWithRef<E>, keyof SeparatorOwnProps>;\n\nexport const Separator = <E extends React.ElementType>({ as, orientation = \"horizontal\", className, ...props }: SeparatorProps<E>) => {\n\tconst Component = as;\n\n\treturn (\n\t\t<PolymorphicComponent\n\t\t\tas={Component as React.ElementType}\n\t\t\taria-orientation={orientation}\n\t\t\tclassName={cn(className, orientation === \"horizontal\" ? \"separator\" : \"separatorVertical\")}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n"],"mappings":";;;;;AAaA,IAAa,KAA0C,EAAE,OAAI,iBAAc,cAAc,cAAW,GAAG,QAIrG,kBAAC,GAAD;CACK;CACJ,oBAAkB;CAClB,WAAW,EAAG,GAAW,MAAgB,eAAe,cAAc,mBAAmB;CACzF,GAAI;AACJ,CAAA"}
|