@ryuzaki13/react-foundation-ui 3.2.0 → 3.3.1
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/chunks/table-column-interactions-DzEvVuXe.js.map +1 -1
- package/dist/layout-picker/index.js +91 -60
- package/dist/layout-picker/index.js.map +1 -1
- package/dist/layout-picker/ui/LayoutPicker.d.ts +17 -1
- package/dist/layout-picker/ui/LayoutPicker.d.ts.map +1 -1
- package/dist/layout-picker/ui/LayoutPresetPreview.d.ts +8 -0
- package/dist/layout-picker/ui/LayoutPresetPreview.d.ts.map +1 -0
- package/dist/splitter/SplitterHeightContainer.d.ts +24 -0
- package/dist/splitter/SplitterHeightContainer.d.ts.map +1 -0
- package/dist/splitter/index.d.ts +1 -0
- package/dist/splitter/index.d.ts.map +1 -1
- package/dist/splitter/index.js +161 -64
- package/dist/splitter/index.js.map +1 -1
- package/dist/splitter/useSplitterContainerHeight.d.ts +24 -0
- package/dist/splitter/useSplitterContainerHeight.d.ts.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/styles/mixins/_mixin.scss +54 -0
- package/src/styles/mixins/mixin.test.ts +26 -0
- package/storybook-static/assets/{Badge-B1TTGHWx.js → Badge-WK_mHgPv.js} +1 -1
- package/storybook-static/assets/{Badge.stories-m0BYb22G.js → Badge.stories-C-PG-D9c.js} +1 -1
- package/storybook-static/assets/{BadgeList-slD8D0kC.js → BadgeList-DYGxtQ-O.js} +1 -1
- package/storybook-static/assets/{BarcodeScannerDialog.stories-upAfBzGS.js → BarcodeScannerDialog.stories-B_n4Qliu.js} +1 -1
- package/storybook-static/assets/{Button-wEcm3PeA.js → Button-Cy45Cu2q.js} +1 -1
- package/storybook-static/assets/{Button-mtVz4t8e.js → Button-nDySpXWm.js} +1 -1
- package/storybook-static/assets/{Button.stories-80YoPts7.js → Button.stories-CrPmHY1E.js} +1 -1
- package/storybook-static/assets/{CalendarView-CciHYZbO.js → CalendarView-zL3O-sZf.js} +1 -1
- package/storybook-static/assets/{CheckBox-4LmQO_eu.js → CheckBox-CzqWCe_6.js} +1 -1
- package/storybook-static/assets/{CheckBox-Cuizrqhy.js → CheckBox-CzyeFW5L.js} +1 -1
- package/storybook-static/assets/{CheckBox.stories-BVlzOlCH.js → CheckBox.stories-LPlGgguV.js} +1 -1
- package/storybook-static/assets/{Color-6AOWCN3U-p_cf8_j5.js → Color-6AOWCN3U-CoLFXF3n.js} +1 -1
- package/storybook-static/assets/{ContextMenu-CnlaWMhJ.js → ContextMenu-BGC-gsmk.js} +1 -1
- package/storybook-static/assets/{ContextMenu-Qi9jyPRQ.js → ContextMenu-BtjQnmO8.js} +1 -1
- package/storybook-static/assets/{ContextMenu.stories-8u4LM_VP.js → ContextMenu.stories-B68MHoA5.js} +1 -1
- package/storybook-static/assets/{CustomOptionButton-Be9f_V0i.js → CustomOptionButton-BcUZjl7x.js} +1 -1
- package/storybook-static/assets/{DateInput-BAa-CGeP.js → DateInput-CoUKXwOy.js} +1 -1
- package/storybook-static/assets/{DateInput-CB1YwIXG.js → DateInput-DD0XhNMn.js} +1 -1
- package/storybook-static/assets/{DateInput.stories-D2TdFkNU.js → DateInput.stories-CrxV-NX3.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect-C__hQdoH.js → DateRangePresetSelect-BZkw08X8.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect-DjRdo1nJ.js → DateRangePresetSelect-D0ZuuibO.js} +1 -1
- package/storybook-static/assets/{DateRangePresetSelect.stories-Cfd8knqx.js → DateRangePresetSelect.stories-DN-u5Tf_.js} +1 -1
- package/storybook-static/assets/{Detail-D_eCEfW5.js → Detail-B9c_GmIS.js} +1 -1
- package/storybook-static/assets/{Detail.stories-BaBaaNck.js → Detail.stories-OI3j2cI9.js} +1 -1
- package/storybook-static/assets/{Dialog-CBBa80xk.js → Dialog-CWrmoQUu.js} +1 -1
- package/storybook-static/assets/{Dialog-CoHzabh8.js → Dialog-D4adQAWw.js} +1 -1
- package/storybook-static/assets/{Dialog.stories-8LPXtaFM.js → Dialog.stories-Dz4Egk9W.js} +1 -1
- package/storybook-static/assets/{Disclosure-BE4gJXEI.js → Disclosure-S0o9QUXW.js} +1 -1
- package/storybook-static/assets/{Disclosure.stories-pV92k8Dz.js → Disclosure.stories-CGSmddMi.js} +1 -1
- package/storybook-static/assets/{DisclosureGroup-B81hAh7v.js → DisclosureGroup-DQCcCJ-G.js} +1 -1
- package/storybook-static/assets/{DocsRenderer-JROSPFPF-DWm72idc.js → DocsRenderer-JROSPFPF-DIG1476f.js} +1 -1
- package/storybook-static/assets/{DropZone-1RJBvaFC.js → DropZone-BtvaZTFC.js} +1 -1
- package/storybook-static/assets/{DropZone-DZRf8WwR.js → DropZone-CjbtepX5.js} +1 -1
- package/storybook-static/assets/{DropZone.stories-D1XK6U6E.js → DropZone.stories-CVbQZvnH.js} +1 -1
- package/storybook-static/assets/{DropdownMenu-BSRQUQ4l.js → DropdownMenu-BlVEu2KG.js} +1 -1
- package/storybook-static/assets/{ExpandableActionPanel-DgeVn8wz.js → ExpandableActionPanel-Gtuiz5xO.js} +1 -1
- package/storybook-static/assets/{ExpandableActionPanel.stories-C9Rhq3ki.js → ExpandableActionPanel.stories-BV1AqCzO.js} +1 -1
- package/storybook-static/assets/{Flex-DaZWQHPt.js → Flex-B5m1S2Ds.js} +1 -1
- package/storybook-static/assets/{Flex.stories-Bs__SjCv.js → Flex.stories-CB_h3zMQ.js} +1 -1
- package/storybook-static/assets/{FloatingPopover-Z028tMRL.js → FloatingPopover-nlrLo05o.js} +1 -1
- package/storybook-static/assets/{FormattedTableCell-BQg_ZMEh.js → FormattedTableCell-Bi6btA1Q.js} +1 -1
- package/storybook-static/assets/FormattedTableCell-CXlMRNU9.css +1 -0
- package/storybook-static/assets/{Grid-CnX_bhEG.js → Grid-DtTOdOXE.js} +1 -1
- package/storybook-static/assets/{Grid.stories-B7jXD20g.js → Grid.stories-CzrHwZai.js} +1 -1
- package/storybook-static/assets/{ImageCropper.stories-1DjfXXxs.js → ImageCropper.stories-DgSlmVOW.js} +1 -1
- package/storybook-static/assets/{ImageRenderer-DI9hvpAc.js → ImageRenderer-BcDd54KY.js} +1 -1
- package/storybook-static/assets/{ImageRenderer.stories-B27u6j14.js → ImageRenderer.stories-BK0UaXkn.js} +1 -1
- package/storybook-static/assets/{ImageView.stories-BM0aNseh.js → ImageView.stories-joG-U4Gi.js} +1 -1
- package/storybook-static/assets/{ImageViewer.stories-C5wouJNn.js → ImageViewer.stories-DJKtt5C3.js} +2 -2
- package/storybook-static/assets/{ImageViewerRuntime-CW0NRJa4.js → ImageViewerRuntime-DdqgfTEg.js} +1 -1
- package/storybook-static/assets/{Input-C2bvv3jL.js → Input-DA5VYKk4.js} +1 -1
- package/storybook-static/assets/{Input-C7XSD_dt.js → Input-DCQx5o0q.js} +1 -1
- package/storybook-static/assets/{Input.stories-BbuxMsTz.js → Input.stories-DC4vVoEO.js} +1 -1
- package/storybook-static/assets/{InputDateTime-2nXK3nym.js → InputDateTime-Cqs65WcA.js} +1 -1
- package/storybook-static/assets/{InputDateTime.stories-BbNtupBI.js → InputDateTime.stories-DXMuILTG.js} +1 -1
- package/storybook-static/assets/{InputFile-BEkTqx8y.js → InputFile-C0wD4lBl.js} +1 -1
- package/storybook-static/assets/{InputFile-COZCRhFO.js → InputFile-CcejpGbB.js} +1 -1
- package/storybook-static/assets/{InputFile.stories-Cu8n9jPc.js → InputFile.stories-CZBGHGXL.js} +1 -1
- package/storybook-static/assets/{InputFiles-Fqt7W6Sx.js → InputFiles-Cy7UOEEl.js} +1 -1
- package/storybook-static/assets/{InputFiles-D4UX-p-O.js → InputFiles-Dm9IatOj.js} +1 -1
- package/storybook-static/assets/{InputFiles.stories-AQFSxEo-.js → InputFiles.stories-DF7PZbCW.js} +1 -1
- package/storybook-static/assets/{InputFilesList-Dl9kpcb-.js → InputFilesList-BqDjNhcz.js} +1 -1
- package/storybook-static/assets/{InputImage-OFDcbwsC.js → InputImage-CjkjKRA-.js} +1 -1
- package/storybook-static/assets/{InputImage-By2cPpXy.js → InputImage-DdLmW1Ak.js} +1 -1
- package/storybook-static/assets/{InputImage.stories-CSnV2rMp.js → InputImage.stories-BDHD_d8S.js} +1 -1
- package/storybook-static/assets/{InteractiveComponents-K3FQ5oIY.js → InteractiveComponents-4rezxuPS.js} +1 -1
- package/storybook-static/assets/{InteractiveComponents.stories-B31U1CpF.js → InteractiveComponents.stories-CVBUBZSq.js} +1 -1
- package/storybook-static/assets/LayoutPicker-BVFJE1oc.js +85 -0
- package/storybook-static/assets/{LayoutPicker-Cmw9sDIb.js → LayoutPicker-BXWCpFmA.js} +39 -2
- package/storybook-static/assets/LayoutPicker.stories-C8EwE9PO.js +91 -0
- package/storybook-static/assets/{Listbox-apRjZaS-.js → Listbox-B2klC2J4.js} +1 -1
- package/storybook-static/assets/{Listbox-DlD8gsbi.js → Listbox-CRHfG41-.js} +1 -1
- package/storybook-static/assets/{Listbox.stories-Ccfez6pD.js → Listbox.stories-QYHkM0DW.js} +1 -1
- package/storybook-static/assets/{Modal-DsUFnBz_.js → Modal--ELz0mEU.js} +1 -1
- package/storybook-static/assets/{Modal-C7tZEU45.js → Modal-CKBitHBE.js} +1 -1
- package/storybook-static/assets/{Modal.stories-C7z4-Upz.js → Modal.stories-geHialJZ.js} +1 -1
- package/storybook-static/assets/{ModalManagerProvider-CFSyB9oN.js → ModalManagerProvider-DsMq_tq2.js} +1 -1
- package/storybook-static/assets/{MultiSelect-hG56GrpU.js → MultiSelect-BKRj8NFe.js} +1 -1
- package/storybook-static/assets/{MultiSelect-GKFkNsBv.js → MultiSelect-DtFllTiw.js} +1 -1
- package/storybook-static/assets/{MultiSelect.stories-DDy2bmb6.js → MultiSelect.stories-YDVhnlkm.js} +1 -1
- package/storybook-static/assets/{NoData-BMwLVlW7.js → NoData-ChNrCPgT.js} +1 -1
- package/storybook-static/assets/{NotificationsHost-svZxowAr.js → NotificationsHost-BCLynQi2.js} +1 -1
- package/storybook-static/assets/{NotificationsHost.stories-jyHqSHpV.js → NotificationsHost.stories-BToRwZ5L.js} +1 -1
- package/storybook-static/assets/{ODataMultiSelect-CDZl1LYK.js → ODataMultiSelect-CHkxeCzC.js} +1 -1
- package/storybook-static/assets/{ODataMultiSelect.stories-BRV8hqOa.js → ODataMultiSelect.stories-BnNlvPrF.js} +1 -1
- package/storybook-static/assets/{ODataSelect-CH_KEIgG.js → ODataSelect-BGuLBvVZ.js} +1 -1
- package/storybook-static/assets/{ODataSelect.stories-CdJ4ueMz.js → ODataSelect.stories-pVtqhn6u.js} +1 -1
- package/storybook-static/assets/{ODataTreeMultiSelect-DoDprp2D.js → ODataTreeMultiSelect-D29MXqhJ.js} +1 -1
- package/storybook-static/assets/{ODataTreeMultiSelect.stories-BBa6dAWY.js → ODataTreeMultiSelect.stories-BhkSzORg.js} +1 -1
- package/storybook-static/assets/{ODataTreeSelect-jBq76QJv.js → ODataTreeSelect-BObAKFiJ.js} +1 -1
- package/storybook-static/assets/{ODataTreeSelect.stories-B0kASy4Q.js → ODataTreeSelect.stories-4fKQO9gD.js} +1 -1
- package/storybook-static/assets/{OneStepScroller-DgK5zRf5.js → OneStepScroller-Dpf5KqZ6.js} +1 -1
- package/storybook-static/assets/{Option-C0S3Jhd2.js → Option-Xtt1DH-W.js} +1 -1
- package/storybook-static/assets/{OptionButton-Bw4h_7Fd.js → OptionButton-D7HaYa0p.js} +1 -1
- package/storybook-static/assets/{PeriodSelect-iAqhhTCd.js → PeriodSelect-D7tLuCU0.js} +1 -1
- package/storybook-static/assets/{PeriodSelect-BUZlKThq.js → PeriodSelect-DCQuU1LH.js} +1 -1
- package/storybook-static/assets/{PeriodSelect.stories-Cqu2cvpS.js → PeriodSelect.stories-Ca-GX9Tz.js} +1 -1
- package/storybook-static/assets/{PickerField-kCraJolS.js → PickerField-CKhIV-GD.js} +1 -1
- package/storybook-static/assets/{PickerTriggerActions-DCrbv85j.js → PickerTriggerActions-BOiWWSOd.js} +1 -1
- package/storybook-static/assets/{Popover-D2M0JiO7.js → Popover-CVg25yB5.js} +1 -1
- package/storybook-static/assets/{Popover-CAobkmJT.js → Popover-DxTWZuo8.js} +1 -1
- package/storybook-static/assets/{Popover.stories-BWrN-v1w.js → Popover.stories-DsORnhKo.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput-BskW--2E.js → PresetRangeDateInput-DA74INX8.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput-BrsrppQR.js → PresetRangeDateInput-cSxPuCCQ.js} +1 -1
- package/storybook-static/assets/{PresetRangeDateInput.stories-B4cQ8O68.js → PresetRangeDateInput.stories-B_HF3Ga7.js} +1 -1
- package/storybook-static/assets/{PresetSelect-DEOf0a4I.js → PresetSelect-mOzpojJJ.js} +1 -1
- package/storybook-static/assets/{README-CtBT6KJo.js → README-3aQahOxk.js} +1 -1
- package/storybook-static/assets/{README-BDZ-UeI_.js → README-98iaASHF.js} +1 -1
- package/storybook-static/assets/{README-CRfW_mwG.js → README-B03JihpF.js} +1 -1
- package/storybook-static/assets/{README-DGnQ3O8r.js → README-BH8L06ZO.js} +1 -1
- package/storybook-static/assets/{README-C04l6A_V.js → README-BRll88aK.js} +1 -1
- package/storybook-static/assets/{README-D5Wgm_6F.js → README-BZSwzwlc.js} +1 -1
- package/storybook-static/assets/{README-PYQ__oB1.js → README-BcwfiwHw.js} +1 -1
- package/storybook-static/assets/{README-h_Ia4l0F.js → README-BdZ-RGTC.js} +1 -1
- package/storybook-static/assets/{README-DEB7jN2G.js → README-BeEsLwyR.js} +1 -1
- package/storybook-static/assets/{README-DEYu86HB.js → README-Bg1Ebtfe.js} +1 -1
- package/storybook-static/assets/{README-CjDR0DCT.js → README-Bi5I_SME.js} +1 -1
- package/storybook-static/assets/{README-tEKPrWDG.js → README-BlcouEvm.js} +1 -1
- package/storybook-static/assets/{README-UBWohyzP.js → README-Bu0nPFap.js} +1 -1
- package/storybook-static/assets/{README-tneYNBR2.js → README-BxfNnbql.js} +1 -1
- package/storybook-static/assets/{README-Cr5pvD2a.js → README-C-4Gq6Yz.js} +1 -1
- package/storybook-static/assets/{README-BRy5W4qi.js → README-CSUr03fm.js} +1 -1
- package/storybook-static/assets/{README-DYHYOkUz.js → README-CSWAkoQQ.js} +1 -1
- package/storybook-static/assets/{README-DOpYTKui.js → README-CUOOxq8d.js} +1 -1
- package/storybook-static/assets/{README-CLKKSnvI.js → README-CVMJBCAl.js} +1 -1
- package/storybook-static/assets/{README-Bczkeo4S.js → README-Cd4O_-P0.js} +1 -1
- package/storybook-static/assets/{README-BWG_J-15.js → README-ChSHKah1.js} +1 -1
- package/storybook-static/assets/{README-CPE-B9NJ.js → README-Cj63ppIL.js} +1 -1
- package/storybook-static/assets/{README-CrSfz44u.js → README-Cl070DLH.js} +1 -1
- package/storybook-static/assets/{README-BkqBbuZP.js → README-CniV1rqU.js} +1 -1
- package/storybook-static/assets/{README-BZkpUcN4.js → README-CvKoManm.js} +1 -1
- package/storybook-static/assets/{README-CPB57-BD.js → README-CxKLNi3e.js} +1 -1
- package/storybook-static/assets/{README-CwOlh0x_.js → README-CxwpwliD.js} +1 -1
- package/storybook-static/assets/{README-CKYbHRQu.js → README-D53klY6j.js} +1 -1
- package/storybook-static/assets/{README-DL8HYHzC.js → README-DQQXGVUQ.js} +1 -1
- package/storybook-static/assets/{README-BVm2h5gQ.js → README-DUk2JF_b.js} +1 -1
- package/storybook-static/assets/{README-CXhg-Avp.js → README-DXic5ngi.js} +1 -1
- package/storybook-static/assets/{README-CcYawVkC.js → README-DmmYh6hO.js} +1 -1
- package/storybook-static/assets/{README-HfXKFrXY.js → README-Dr9SOwgU.js} +1 -1
- package/storybook-static/assets/{README-BlP3CzTg.js → README-DvhjlyjA.js} +1 -1
- package/storybook-static/assets/{README-BedW-6Qh.js → README-GBDFjDKR.js} +1 -1
- package/storybook-static/assets/{README-eoM28QGj.js → README-IYwlje5o.js} +1 -1
- package/storybook-static/assets/{README-BbqX48ZX.js → README-QJBm6wYx.js} +1 -1
- package/storybook-static/assets/{README-CUXxO9Db.js → README-SyFOtISa.js} +1 -1
- package/storybook-static/assets/{README-pJNBrsHp.js → README-YZ2NIMYx.js} +1 -1
- package/storybook-static/assets/{README-C2j_R02h.js → README-YlX9cWES.js} +1 -1
- package/storybook-static/assets/{README-DjPRryHg.js → README-cQ_H4dLu.js} +1 -1
- package/storybook-static/assets/{README-ChM2WYvT.js → README-dRk5FvxV.js} +1 -1
- package/storybook-static/assets/{README-DzzON1ye.js → README-dzP0SVFn.js} +1 -1
- package/storybook-static/assets/{README-Weoeni8A.js → README-fxpsAKlj.js} +1 -1
- package/storybook-static/assets/{README-C5ESwpCt.js → README-gmC53Xi_.js} +1 -1
- package/storybook-static/assets/{README-FC7XUYVa.js → README-kGtl2KUp.js} +1 -1
- package/storybook-static/assets/{README-Dh4uSHUd.js → README-kYv_tOTc.js} +1 -1
- package/storybook-static/assets/{README-CZdf7Jyj.js → README-nBHaLC_F.js} +1 -1
- package/storybook-static/assets/{README-CJ-L25gm.js → README-oDk_9qv5.js} +1 -1
- package/storybook-static/assets/{README-77pVTGG0.js → README-uyzCxo9T.js} +1 -1
- package/storybook-static/assets/{README-DzhqH1NW.js → README-vL1xEM7S.js} +1 -1
- package/storybook-static/assets/{README-CdRI75Jm.js → README-vwgzSNs9.js} +1 -1
- package/storybook-static/assets/{README-DOju-G9e.js → README-wHEBUmRN.js} +1 -1
- package/storybook-static/assets/{RadioButton-C_7MrkSd.js → RadioButton-Di3E0WqK.js} +1 -1
- package/storybook-static/assets/{RadioButton-zjLDV_vA.js → RadioButton-zHQaixrg.js} +1 -1
- package/storybook-static/assets/{RadioButton.stories-C81aMJWs.js → RadioButton.stories-Db-Ng16j.js} +1 -1
- package/storybook-static/assets/{RadioGroup-G1nrB231.js → RadioGroup-CFdBOgXY.js} +1 -1
- package/storybook-static/assets/{RadioGroup-BmMpfAxw.js → RadioGroup-COyCIEhw.js} +1 -1
- package/storybook-static/assets/{RadioGroup.stories-U8Q6ChKN.js → RadioGroup.stories-cTyxlNoV.js} +1 -1
- package/storybook-static/assets/{Scrollable-7F5dqi9H.js → Scrollable-C_mydMBJ.js} +1 -1
- package/storybook-static/assets/{Select-Cr6CgIIx.js → Select--Cur_ice.js} +1 -1
- package/storybook-static/assets/{Select-CEfw0HMD.js → Select-euD4GyNW.js} +1 -1
- package/storybook-static/assets/{Select.stories-DgA0I8m1.js → Select.stories-DpMWO0V3.js} +1 -1
- package/storybook-static/assets/{SerializableSelect-CQyHtiSK.js → SerializableSelect-XxpMPv8U.js} +1 -1
- package/storybook-static/assets/{SerializableSelect.stories-Dj0qXUbg.js → SerializableSelect.stories-Bd5j2VBn.js} +1 -1
- package/storybook-static/assets/{SingleDateTimeInput-C96e9Bnk.js → SingleDateTimeInput-25IqNBq8.js} +1 -1
- package/storybook-static/assets/{SingleDateTimeInput-k6cU5HTO.js → SingleDateTimeInput-CdpxDJ19.js} +1 -1
- package/storybook-static/assets/{SingleDateTimeInput.stories-DW1owBoF.js → SingleDateTimeInput.stories-DgHdtJ7N.js} +1 -1
- package/storybook-static/assets/Slider-CKL1KUMn.js +1 -0
- package/storybook-static/assets/{Slider-Bq2uMF2q.js → Slider-NZ1Vxv4R.js} +1 -1
- package/storybook-static/assets/{Slider.stories-VjnPqsrP.js → Slider.stories-DvY4QR6_.js} +1 -1
- package/storybook-static/assets/SliderInput-BFsNx6Wh.js +2 -0
- package/storybook-static/assets/{SliderInput-BeAfEJOt.js → SliderInput-eCc-F5hi.js} +1 -1
- package/storybook-static/assets/{SliderInput.stories-DBlgmZyR.js → SliderInput.stories-Cxr-MTsf.js} +1 -1
- package/storybook-static/assets/{Sortable-4hmW6aYf.js → Sortable-BcSak25T.js} +1 -1
- package/storybook-static/assets/{Sortable.stories-BQ8KVECH.js → Sortable.stories-CVppTSXD.js} +1 -1
- package/storybook-static/assets/Splitter-BQ5oBMYt.css +1 -0
- package/storybook-static/assets/Splitter-DG142Oen.js +105 -0
- package/storybook-static/assets/Splitter.stories--DIJIEL6.js +52 -0
- package/storybook-static/assets/{StateSelect-DNu5sYFr.js → StateSelect-C6zBMmxJ.js} +1 -1
- package/storybook-static/assets/{StateSelect-CIbsxjVP.js → StateSelect-CNK8Pui1.js} +1 -1
- package/storybook-static/assets/{StateSelect.stories-BrgfGby7.js → StateSelect.stories-oE0A8q1A.js} +1 -1
- package/storybook-static/assets/{StatusIndicator-BAJHtEXU.js → StatusIndicator-67_V0D2V.js} +1 -1
- package/storybook-static/assets/{StatusIndicator.stories-ELJXgKGF.js → StatusIndicator.stories-D23wtI8L.js} +1 -1
- package/storybook-static/assets/{StringToggle.stories-Bp4AH2PM.js → StringToggle.stories-ChM5pBoA.js} +1 -1
- package/storybook-static/assets/{Switch-Dp2mfJMY.js → Switch-B7J03FEH.js} +1 -1
- package/storybook-static/assets/{Switch-CEMTONNK.js → Switch-Dt-wBbLj.js} +1 -1
- package/storybook-static/assets/{Switch.stories-CxSCdM1U.js → Switch.stories-DqIkALkm.js} +1 -1
- package/storybook-static/assets/{Table-DFenIYxk.js → Table-CpRAQK2S.js} +1 -1
- package/storybook-static/assets/{Table.stories-D4hfPD50.js → Table.stories-CxtAcebJ.js} +1 -1
- package/storybook-static/assets/{TableEditor.stories-FUN04jRt.js → TableEditor.stories-BuZEjZEx.js} +1 -1
- package/storybook-static/assets/{Tabs-DQITegdm.js → Tabs-DMu6s5kP.js} +1 -1
- package/storybook-static/assets/{Tabs.stories-iOhYWtXS.js → Tabs.stories-CYq_iLCY.js} +1 -1
- package/storybook-static/assets/{TabsBox-Cu2hSQ0_.js → TabsBox-BROVW2Dh.js} +1 -1
- package/storybook-static/assets/{TagInput-BSHH7VHG.js → TagInput-C80bG0KQ.js} +1 -1
- package/storybook-static/assets/{TagInput.stories-CMvjjSGz.js → TagInput.stories-fkHl001f.js} +1 -1
- package/storybook-static/assets/{Text-BSnmJ5Rc.js → Text-C6rUK4R7.js} +1 -1
- package/storybook-static/assets/{Textarea-DCko2hh9.js → Textarea-D2RHX8Dd.js} +1 -1
- package/storybook-static/assets/{Textarea-BURqjbfm.js → Textarea-PZU9sdiC.js} +1 -1
- package/storybook-static/assets/{Textarea.stories-D9bD-zxp.js → Textarea.stories-OgHE7THz.js} +1 -1
- package/storybook-static/assets/{TimePanel-ZM6IEZ23.js → TimePanel--knkJLOD.js} +1 -1
- package/storybook-static/assets/{TimePanel.stories-BPFzdjrk.js → TimePanel.stories-B3R_YCoA.js} +1 -1
- package/storybook-static/assets/{Toggle-Co-9WIQM.js → Toggle-DkEiYYRr.js} +1 -1
- package/storybook-static/assets/{Toggle-BGYpWyl-.js → Toggle-Dp8pjg73.js} +1 -1
- package/storybook-static/assets/{Toggle.stories-DH28lc09.js → Toggle.stories-BH-J32ih.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect-BiNv5d9H.js → TreeMultiSelect-BbK5FA7l.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect-DbqIa68V.js → TreeMultiSelect-vsXA3U3N.js} +1 -1
- package/storybook-static/assets/{TreeMultiSelect.stories-CBbmYs0g.js → TreeMultiSelect.stories-PRgWAflt.js} +1 -1
- package/storybook-static/assets/{TreePickerBase-DtDat39S.js → TreePickerBase-kkKccRAO.js} +1 -1
- package/storybook-static/assets/{TreeSelect-BWHuf3sH.js → TreeSelect-BA3Scm6z.js} +1 -1
- package/storybook-static/assets/{TreeSelect-tQtWX3eZ.js → TreeSelect-C0c9HX9-.js} +1 -1
- package/storybook-static/assets/{TreeSelect.stories-BFefku3r.js → TreeSelect.stories-B58cM0T1.js} +1 -1
- package/storybook-static/assets/{TreeTable-ZOKoR3S8.js → TreeTable-C1gGTK5r.js} +1 -1
- package/storybook-static/assets/{TreeTable.stories-jWFBqYVA.js → TreeTable.stories-DQvDrA7c.js} +1 -1
- package/storybook-static/assets/{blocks-CkyPJxFn.js → blocks-BhZUMkxi.js} +3 -3
- package/storybook-static/assets/{check-DuSyNDf0.js → check-Um3pz6QW.js} +1 -1
- package/storybook-static/assets/{chevron-down-T_Hptvkv.js → chevron-down-C4pZu3-1.js} +1 -1
- package/storybook-static/assets/{chevron-left-BcH0yrC3.js → chevron-left-KyBqJM8-.js} +1 -1
- package/storybook-static/assets/{chevron-right-Dk1ulWkk.js → chevron-right-oI2LTilN.js} +1 -1
- package/storybook-static/assets/{chunk-W22LQPXL-CdmMdLH3.js → chunk-W22LQPXL-bvuIlt4y.js} +1 -1
- package/storybook-static/assets/{circle-alert-CiZtyFLl.js → circle-alert-DFDIH93R.js} +1 -1
- package/storybook-static/assets/{circle-check-N8FNJhb5.js → circle-check-DZeVcfHM.js} +1 -1
- package/storybook-static/assets/{components-BuQ4azTo.js → components-CpXLfKcs.js} +3 -3
- package/storybook-static/assets/{contextMenu-ChdzMmup.js → contextMenu-D4heHbPg.js} +1 -1
- package/storybook-static/assets/{download-CEAUuG15.js → download-CPsxMj2z.js} +1 -1
- package/storybook-static/assets/{floating-ui.react-DO4IuDDt.js → floating-ui.react-D7Ih47KV.js} +1 -1
- package/storybook-static/assets/{foundationApi-D4_39zNT.js → foundationApi-DzxX_zcI.js} +1 -1
- package/storybook-static/assets/{foundationLib-D36HDBKZ.js → foundationLib-B_4x6m9e.js} +1 -1
- package/storybook-static/assets/{hooks-DaCAWteV.js → hooks-CWB4fTHd.js} +1 -1
- package/storybook-static/assets/{iframe-C3wMnNgT.js → iframe-D4af5fSd.js} +4 -4
- package/storybook-static/assets/iframe-DknFwD9Q.js +1 -0
- package/storybook-static/assets/{info-CgD0dwe7.js → info-BhfFFk_8.js} +1 -1
- package/storybook-static/assets/number-scale-D2KTkjVQ.js +1 -0
- package/storybook-static/assets/{odata-DuWK9X6F.js → odata-B0XFCq-i.js} +1 -1
- package/storybook-static/assets/{odataStoryFixtures-BlYK5gCH.js → odataStoryFixtures-CkPWq4NL.js} +1 -1
- package/storybook-static/assets/{react-6aa8UN0d.js → react-ZfTvoUfy.js} +1 -1
- package/storybook-static/assets/{refresh-cw-C-kY50XM.js → refresh-cw-8BVohVPh.js} +1 -1
- package/storybook-static/assets/{settings-2-Lw5jPpcm.js → settings-2-nstxmhiz.js} +1 -1
- package/storybook-static/assets/{sortable-BMxBXOba.js → sortable-BCZQY8EJ.js} +1 -1
- package/storybook-static/assets/{syntaxhighlighter-QEQV7K2Y-C6nhsm5S.js → syntaxhighlighter-QEQV7K2Y-K4A9UiBg.js} +1 -1
- package/storybook-static/assets/{trash-2-DDRTzebt.js → trash-2-jSs-ANm-.js} +1 -1
- package/storybook-static/assets/{triangle-alert--SWMyXwt.js → triangle-alert-I-2OIxjF.js} +1 -1
- package/storybook-static/assets/{useODataSelectBase-B_3Zl3-d.js → useODataSelectBase-gLARCYCg.js} +1 -1
- package/storybook-static/assets/{useODataTreeData-D5U-f8-Y.js → useODataTreeData-BtdWnsDY.js} +1 -1
- package/storybook-static/assets/{usePickerQuery-BQ85tBVK.js → usePickerQuery-C_HdhBSo.js} +1 -1
- package/storybook-static/assets/{usePickerTriggerController-DUaswv5t.js → usePickerTriggerController-m8RMepZQ.js} +1 -1
- package/storybook-static/assets/{x-B4c2IwTW.js → x-CSECsIAb.js} +1 -1
- package/storybook-static/iframe.html +2 -2
- package/storybook-static/index.json +1 -1
- package/storybook-static/project.json +1 -1
- package/storybook-static/assets/FormattedTableCell-CTIL_ueu.css +0 -1
- package/storybook-static/assets/LayoutPicker-RN42vmef.js +0 -66
- package/storybook-static/assets/LayoutPicker.stories-C5nHgi9s.js +0 -74
- package/storybook-static/assets/Slider-B1T2FRiM.js +0 -1
- package/storybook-static/assets/SliderInput-DJpNIGZl.js +0 -2
- package/storybook-static/assets/Splitter-08NDE539.js +0 -84
- package/storybook-static/assets/Splitter-D-LmmQad.css +0 -1
- package/storybook-static/assets/Splitter.stories-DOVSidH9.js +0 -39
- package/storybook-static/assets/iframe-VKLQYnIk.js +0 -1
package/dist/splitter/index.js
CHANGED
|
@@ -1,47 +1,48 @@
|
|
|
1
|
-
import { Children as e, useCallback as t, useEffect as n,
|
|
2
|
-
import { cn as
|
|
3
|
-
import { jsx as
|
|
4
|
-
|
|
1
|
+
import { Children as e, useCallback as t, useEffect as n, useId as r, useLayoutEffect as i, useRef as a, useState as o } from "react";
|
|
2
|
+
import { cn as s } from "@ryuzaki13/react-foundation-lib/utils";
|
|
3
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
4
|
+
import { clampNumberScaleValue as u, offsetNumberScaleValue as d, resolveNumberScaleBounds as f } from "@ryuzaki13/react-foundation-lib/number-scale";
|
|
5
|
+
var p = {
|
|
5
6
|
splitter: "wAovST",
|
|
6
7
|
vertical: "QVVMwe",
|
|
7
8
|
separator: "H43AJ8",
|
|
8
9
|
horizontal: "pgo8sW",
|
|
9
10
|
topLeft: "_8fCvqA",
|
|
10
11
|
bottomRight: "t6RFcI"
|
|
11
|
-
},
|
|
12
|
-
function
|
|
12
|
+
}, m = .1, h = .9, g = .7, _ = .02;
|
|
13
|
+
function v(e, t, n) {
|
|
13
14
|
return Math.min(n, Math.max(t, e));
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
return Number.isFinite(e) ?
|
|
16
|
+
function y(e, t) {
|
|
17
|
+
return Number.isFinite(e) ? v(e, 0, 1) : t;
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
-
let n =
|
|
19
|
+
function b(e, t) {
|
|
20
|
+
let n = y(e, m), r = y(t, h);
|
|
20
21
|
return n <= r ? [n, r] : [r, n];
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
+
function x(e, t) {
|
|
23
24
|
return e === "vertical" ? t.clientX : t.clientY;
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
+
function S(e, t) {
|
|
26
27
|
return e === "vertical" ? t.width : t.height;
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
+
function C(e, t) {
|
|
29
30
|
if (e === "vertical") {
|
|
30
31
|
if (t === "ArrowLeft") return -.02;
|
|
31
|
-
if (t === "ArrowRight") return
|
|
32
|
+
if (t === "ArrowRight") return _;
|
|
32
33
|
}
|
|
33
34
|
if (e === "horizontal") {
|
|
34
35
|
if (t === "ArrowUp") return -.02;
|
|
35
|
-
if (t === "ArrowDown") return
|
|
36
|
+
if (t === "ArrowDown") return _;
|
|
36
37
|
}
|
|
37
38
|
return null;
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
+
function w(e, t) {
|
|
40
41
|
return t === "start" ? 0 : t === "end" ? 1 : e;
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
-
let [d,
|
|
44
|
-
M.current = e,
|
|
43
|
+
function T({ direction: e, initial: r, min: s, max: c, onChange: l, collapsedPane: u }) {
|
|
44
|
+
let [d, f] = b(s, c), p = a(null), m = a(null), h = a(null), _ = a(null), T = a(null), E = a(null), D = a(0), O = a(v(y(r, g), d, f)), k = a(r), [A, j] = o(() => v(y(r, g), d, f)), M = a(A), N = t((e) => {
|
|
45
|
+
M.current = e, m.current?.style.setProperty("flex-basis", `${w(e, u) * 100}%`), h.current?.setAttribute("aria-valuenow", `${Math.round(e * 100)}`);
|
|
45
46
|
}, [u]), P = () => {
|
|
46
47
|
if (E.current !== null && (cancelAnimationFrame(E.current), E.current = null), T.current === null) return M.current;
|
|
47
48
|
let e = T.current;
|
|
@@ -51,56 +52,56 @@ function x({ direction: e, initial: o, min: s, max: c, onChange: l, collapsedPan
|
|
|
51
52
|
E.current = null, T.current !== null && N(T.current);
|
|
52
53
|
}));
|
|
53
54
|
}, I = () => {
|
|
54
|
-
|
|
55
|
+
_.current?.(), _.current = null;
|
|
55
56
|
}, L = (e, t = M.current) => {
|
|
56
57
|
P();
|
|
57
|
-
let n =
|
|
58
|
+
let n = v(e, d, f);
|
|
58
59
|
j(n), n !== t && l?.(n);
|
|
59
60
|
};
|
|
60
|
-
return
|
|
61
|
+
return i(() => {
|
|
61
62
|
N(A);
|
|
62
63
|
}, [N, A]), n(() => {
|
|
63
64
|
j((e) => {
|
|
64
|
-
let t = k.current !==
|
|
65
|
-
return k.current =
|
|
65
|
+
let t = k.current !== r;
|
|
66
|
+
return k.current = r, v(t ? y(r, g) : e, d, f);
|
|
66
67
|
});
|
|
67
68
|
}, [
|
|
68
|
-
|
|
69
|
+
r,
|
|
69
70
|
d,
|
|
70
|
-
|
|
71
|
+
f
|
|
71
72
|
]), n(() => () => {
|
|
72
73
|
I(), E.current !== null && cancelAnimationFrame(E.current);
|
|
73
74
|
}, []), {
|
|
74
|
-
containerRef:
|
|
75
|
-
topLeftRef:
|
|
76
|
-
separatorRef:
|
|
75
|
+
containerRef: p,
|
|
76
|
+
topLeftRef: m,
|
|
77
|
+
separatorRef: h,
|
|
77
78
|
ratio: A,
|
|
78
79
|
minRatio: d,
|
|
79
|
-
maxRatio:
|
|
80
|
+
maxRatio: f,
|
|
80
81
|
handleSeparatorPointerDown: (t) => {
|
|
81
82
|
if (t.button !== 0) return;
|
|
82
83
|
t.preventDefault();
|
|
83
|
-
let n =
|
|
84
|
+
let n = p.current;
|
|
84
85
|
if (!n) return;
|
|
85
86
|
I();
|
|
86
87
|
try {
|
|
87
88
|
t.currentTarget.setPointerCapture?.(t.pointerId);
|
|
88
89
|
} catch {}
|
|
89
|
-
D.current =
|
|
90
|
+
D.current = x(e, t), O.current = M.current;
|
|
90
91
|
let r = (t) => {
|
|
91
|
-
let r =
|
|
92
|
+
let r = S(e, n.getBoundingClientRect());
|
|
92
93
|
if (r <= 0) return;
|
|
93
|
-
let i =
|
|
94
|
+
let i = x(e, t) - D.current, a = v(O.current + i / r, d, f);
|
|
94
95
|
F(a);
|
|
95
96
|
}, i = () => {
|
|
96
97
|
I(), L(P(), O.current);
|
|
97
98
|
};
|
|
98
|
-
|
|
99
|
+
_.current = () => {
|
|
99
100
|
document.removeEventListener("pointermove", r), document.removeEventListener("pointerup", i), document.removeEventListener("pointercancel", i);
|
|
100
101
|
}, document.addEventListener("pointermove", r), document.addEventListener("pointerup", i), document.addEventListener("pointercancel", i);
|
|
101
102
|
},
|
|
102
103
|
handleSeparatorKeyDown: (t) => {
|
|
103
|
-
let n =
|
|
104
|
+
let n = C(e, t.key);
|
|
104
105
|
if (n !== null) {
|
|
105
106
|
t.preventDefault(), L(M.current + n);
|
|
106
107
|
return;
|
|
@@ -109,63 +110,159 @@ function x({ direction: e, initial: o, min: s, max: c, onChange: l, collapsedPan
|
|
|
109
110
|
t.preventDefault(), L(d);
|
|
110
111
|
return;
|
|
111
112
|
}
|
|
112
|
-
t.key === "End" && (t.preventDefault(), L(
|
|
113
|
+
t.key === "End" && (t.preventDefault(), L(f));
|
|
113
114
|
}
|
|
114
115
|
};
|
|
115
116
|
}
|
|
116
|
-
function
|
|
117
|
-
let { containerRef:
|
|
118
|
-
return /* @__PURE__ */
|
|
119
|
-
ref:
|
|
120
|
-
className:
|
|
117
|
+
function E({ className: e, direction: t, left: n, right: r, collapsedPane: i, logic: a }) {
|
|
118
|
+
let { containerRef: o, topLeftRef: u, separatorRef: d, ratio: f, minRatio: m, maxRatio: h, handleSeparatorPointerDown: g, handleSeparatorKeyDown: _ } = a, v = w(f, i), y = i === "start", b = i === "end", x = i === null;
|
|
119
|
+
return /* @__PURE__ */ l("div", {
|
|
120
|
+
ref: o,
|
|
121
|
+
className: s(p.splitter, p[t], e),
|
|
121
122
|
children: [
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
ref:
|
|
124
|
-
className:
|
|
123
|
+
/* @__PURE__ */ c("div", {
|
|
124
|
+
ref: u,
|
|
125
|
+
className: p.topLeft,
|
|
125
126
|
style: { flexBasis: `${v * 100}%` },
|
|
126
127
|
hidden: y,
|
|
127
128
|
children: n
|
|
128
129
|
}),
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
ref:
|
|
131
|
-
hidden: !
|
|
130
|
+
/* @__PURE__ */ c("div", {
|
|
131
|
+
ref: d,
|
|
132
|
+
hidden: !x,
|
|
132
133
|
role: "separator",
|
|
133
134
|
"aria-orientation": t === "vertical" ? "vertical" : "horizontal",
|
|
134
135
|
"aria-valuemin": Math.round(m * 100),
|
|
135
136
|
"aria-valuemax": Math.round(h * 100),
|
|
136
|
-
"aria-valuenow": Math.round(
|
|
137
|
-
tabIndex:
|
|
137
|
+
"aria-valuenow": Math.round(f * 100),
|
|
138
|
+
tabIndex: x ? 0 : -1,
|
|
138
139
|
onPointerDown: g,
|
|
139
140
|
onKeyDown: _,
|
|
140
|
-
className:
|
|
141
|
+
className: p.separator
|
|
141
142
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
className:
|
|
144
|
-
hidden:
|
|
143
|
+
/* @__PURE__ */ c("div", {
|
|
144
|
+
className: p.bottomRight,
|
|
145
|
+
hidden: b,
|
|
145
146
|
children: r
|
|
146
147
|
})
|
|
147
148
|
]
|
|
148
149
|
});
|
|
149
150
|
}
|
|
150
|
-
function
|
|
151
|
-
let [
|
|
151
|
+
function D({ direction: t = "vertical", initial: n = g, min: r = m, max: i = h, onChange: a, className: o, collapsedPane: s = null, children: l }) {
|
|
152
|
+
let [u, d] = e.toArray(l), f = T({
|
|
152
153
|
direction: t,
|
|
153
154
|
initial: n,
|
|
154
155
|
min: r,
|
|
155
156
|
max: i,
|
|
156
157
|
onChange: a,
|
|
157
|
-
collapsedPane:
|
|
158
|
+
collapsedPane: s
|
|
158
159
|
});
|
|
159
|
-
return
|
|
160
|
+
return d ? /* @__PURE__ */ c(E, {
|
|
160
161
|
className: o,
|
|
161
162
|
direction: t,
|
|
162
|
-
left:
|
|
163
|
-
right:
|
|
164
|
-
collapsedPane:
|
|
165
|
-
logic:
|
|
166
|
-
}) :
|
|
163
|
+
left: u,
|
|
164
|
+
right: d,
|
|
165
|
+
collapsedPane: s,
|
|
166
|
+
logic: f
|
|
167
|
+
}) : u;
|
|
168
|
+
}
|
|
169
|
+
var O = {
|
|
170
|
+
container: "dN78Fa",
|
|
171
|
+
viewport: "q7Yvg9",
|
|
172
|
+
separator: "yP9UOD"
|
|
173
|
+
};
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region src/splitter/useSplitterContainerHeight.ts
|
|
176
|
+
function k({ height: e, defaultHeight: t, minHeight: r, maxHeight: s, heightStep: c, onHeightChange: l }) {
|
|
177
|
+
let p = f(r, s), m = {
|
|
178
|
+
...p,
|
|
179
|
+
step: c
|
|
180
|
+
}, h = e !== void 0, [g, _] = o(() => u(t, p.min, p.max)), [v, y] = o(null), b = u(e ?? g, p.min, p.max), x = v ?? b, S = a(null), C = a(null), w = a(null), T = a(x), E = a(x), D = a(0), O = () => {
|
|
181
|
+
if (C.current !== null && (cancelAnimationFrame(C.current), C.current = null), w.current === null) return T.current;
|
|
182
|
+
let e = w.current;
|
|
183
|
+
return w.current = null, T.current = e, e;
|
|
184
|
+
}, k = (e) => {
|
|
185
|
+
w.current = e, C.current === null && (C.current = requestAnimationFrame(() => {
|
|
186
|
+
if (C.current = null, w.current === null) return;
|
|
187
|
+
let e = w.current;
|
|
188
|
+
w.current = null, T.current = e, y(e);
|
|
189
|
+
}));
|
|
190
|
+
}, A = (e, t = T.current) => {
|
|
191
|
+
let n = u(e, p.min, p.max);
|
|
192
|
+
T.current = n, y(null), n !== t && (h || _(n), l?.(n));
|
|
193
|
+
}, j = () => {
|
|
194
|
+
S.current?.(), S.current = null;
|
|
195
|
+
};
|
|
196
|
+
return i(() => {
|
|
197
|
+
T.current = x;
|
|
198
|
+
}, [x]), n(() => () => {
|
|
199
|
+
j(), C.current !== null && cancelAnimationFrame(C.current);
|
|
200
|
+
}, []), {
|
|
201
|
+
height: x,
|
|
202
|
+
minHeight: p.min,
|
|
203
|
+
maxHeight: p.max,
|
|
204
|
+
handleSeparatorPointerDown: (e) => {
|
|
205
|
+
if (e.button !== 0) return;
|
|
206
|
+
e.preventDefault(), j();
|
|
207
|
+
try {
|
|
208
|
+
e.currentTarget.setPointerCapture?.(e.pointerId);
|
|
209
|
+
} catch {}
|
|
210
|
+
D.current = e.clientY, E.current = T.current;
|
|
211
|
+
let t = (e) => {
|
|
212
|
+
let t = e.clientY - D.current, n = u(E.current + t, p.min, p.max);
|
|
213
|
+
k(n);
|
|
214
|
+
}, n = () => {
|
|
215
|
+
j(), A(O(), E.current);
|
|
216
|
+
};
|
|
217
|
+
S.current = () => {
|
|
218
|
+
document.removeEventListener("pointermove", t), document.removeEventListener("pointerup", n), document.removeEventListener("pointercancel", n);
|
|
219
|
+
}, document.addEventListener("pointermove", t), document.addEventListener("pointerup", n), document.addEventListener("pointercancel", n);
|
|
220
|
+
},
|
|
221
|
+
handleSeparatorKeyDown: (e) => {
|
|
222
|
+
let t;
|
|
223
|
+
e.key === "ArrowUp" && (t = d(x, -1, m)), e.key === "ArrowDown" && (t = d(x, 1, m)), e.key === "Home" && (t = p.min), e.key === "End" && (t = p.max), t !== void 0 && (e.preventDefault(), A(t, x));
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
//#endregion
|
|
228
|
+
//#region src/splitter/SplitterHeightContainer.tsx
|
|
229
|
+
var A = 480, j = 240, M = 1200, N = 20;
|
|
230
|
+
function P({ height: e, defaultHeight: t = A, minHeight: n = j, maxHeight: i = M, heightStep: a = N, onHeightChange: o, className: u, viewportClassName: d, separatorClassName: f, separatorAriaLabel: p = "Изменить высоту рабочей области", children: m }) {
|
|
231
|
+
let h = `${r()}-viewport`, g = k({
|
|
232
|
+
height: e,
|
|
233
|
+
defaultHeight: t,
|
|
234
|
+
minHeight: n,
|
|
235
|
+
maxHeight: i,
|
|
236
|
+
heightStep: a,
|
|
237
|
+
onHeightChange: o
|
|
238
|
+
});
|
|
239
|
+
return /* @__PURE__ */ l("div", {
|
|
240
|
+
className: s(O.container, u),
|
|
241
|
+
"data-ui": "splitter-height-container",
|
|
242
|
+
children: [/* @__PURE__ */ c("div", {
|
|
243
|
+
id: h,
|
|
244
|
+
className: s(O.viewport, d),
|
|
245
|
+
style: { height: g.height },
|
|
246
|
+
"data-ui": "splitter-height-viewport",
|
|
247
|
+
children: m
|
|
248
|
+
}), /* @__PURE__ */ c("div", {
|
|
249
|
+
role: "separator",
|
|
250
|
+
"aria-label": p,
|
|
251
|
+
"aria-orientation": "horizontal",
|
|
252
|
+
"aria-controls": h,
|
|
253
|
+
"aria-valuemin": g.minHeight,
|
|
254
|
+
"aria-valuemax": g.maxHeight,
|
|
255
|
+
"aria-valuenow": g.height,
|
|
256
|
+
"aria-valuetext": `${g.height} px`,
|
|
257
|
+
tabIndex: 0,
|
|
258
|
+
className: s(O.separator, f),
|
|
259
|
+
onPointerDown: g.handleSeparatorPointerDown,
|
|
260
|
+
onKeyDown: g.handleSeparatorKeyDown,
|
|
261
|
+
"data-ui": "splitter-height-separator"
|
|
262
|
+
})]
|
|
263
|
+
});
|
|
167
264
|
}
|
|
168
265
|
//#endregion
|
|
169
|
-
export {
|
|
266
|
+
export { D as Splitter, P as SplitterHeightContainer };
|
|
170
267
|
|
|
171
268
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/splitter/Splitter.module.scss","../../src/splitter/Splitter.tsx"],"sourcesContent":[".splitter {\n\tdisplay: flex;\n\twidth: 100%;\n\theight: 100%;\n\toverflow: hidden;\n\n\t&.vertical {\n\t\tflex-direction: row;\n\n\t\t.separator {\n\t\t\tcursor: col-resize;\n\n\t\t\tborder-left: var(--border);\n\t\t\tborder-right: var(--border);\n\n\t\t\tmargin-inline: var(--space-md);\n\t\t}\n\t}\n\n\t&.horizontal {\n\t\tflex-direction: column;\n\n\t\t.separator {\n\t\t\tcursor: row-resize;\n\n\t\t\t// border-top: var(--border);\n\t\t\t// border-bottom: var(--border);\n\n\t\t\tmargin-block: var(--space-md);\n\t\t}\n\t}\n}\n\n.topLeft {\n\tflex-grow: 0;\n\tflex-shrink: 0;\n}\n\n.bottomRight {\n\tflex-grow: 1;\n}\n\n.topLeft,\n.bottomRight {\n\tmin-width: 0;\n\tmin-height: 0;\n\toverflow: auto;\n}\n\n.separator {\n\tflex-basis: var(--space-sm);\n\tflex-grow: 0;\n\tflex-shrink: 0;\n\n\tborder-radius: var(--radius-sm);\n\tborder: var(--border);\n\tbackground-color: var(--border-0);\n\n\tuser-select: none;\n\ttouch-action: none;\n\tposition: relative;\n\n\t&:hover {\n\t\tborder-color: var(--border-1);\n\t\tbackground-color: var(--border-1);\n\t}\n\t&:active {\n\t\tborder-color: var(--border-2);\n\t\tbackground-color: var(--border-2);\n\t}\n}\n","import {\n\tChildren,\n\ttype PropsWithChildren,\n\ttype KeyboardEvent as ReactKeyboardEvent,\n\ttype ReactNode,\n\ttype PointerEvent as ReactPointerEvent,\n\ttype RefObject,\n\tuseCallback,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseState\n} from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport styles from \"./Splitter.module.scss\";\n\ntype SplitterDirection = \"vertical\" | \"horizontal\";\ntype SplitterPane = \"start\" | \"end\";\n\nexport type SplitterProps = PropsWithChildren<{\n\tdirection?: SplitterDirection;\n\tinitial?: number; // от 0 до 1\n\tmin?: number; // минимальная доля первой панели\n\tmax?: number; // максимальная доля первой панели\n\t/** Сообщает итоговую долю первой панели после завершения drag или шага с клавиатуры. */\n\tonChange?: (ratio: number) => void;\n\tclassName?: string;\n\tcollapsedPane?: SplitterPane | null;\n}>;\n\ntype SplitterLogicParams = {\n\tdirection: SplitterDirection;\n\tinitial: number;\n\tmin: number;\n\tmax: number;\n\tonChange?: (ratio: number) => void;\n\tcollapsedPane: SplitterPane | null;\n};\n\ntype SplitterLogic = {\n\tcontainerRef: RefObject<HTMLDivElement | null>;\n\ttopLeftRef: RefObject<HTMLDivElement | null>;\n\tseparatorRef: RefObject<HTMLDivElement | null>;\n\tratio: number;\n\tminRatio: number;\n\tmaxRatio: number;\n\thandleSeparatorPointerDown: (event: ReactPointerEvent<HTMLDivElement>) => void;\n\thandleSeparatorKeyDown: (event: ReactKeyboardEvent<HTMLDivElement>) => void;\n};\n\ntype SplitterViewProps = {\n\tclassName?: string;\n\tdirection: SplitterDirection;\n\tleft: ReactNode;\n\tright: ReactNode;\n\tcollapsedPane: SplitterPane | null;\n\tlogic: SplitterLogic;\n};\n\nconst DEFAULT_MIN = 0.1;\nconst DEFAULT_MAX = 0.9;\nconst DEFAULT_INITIAL = 0.7;\nconst KEYBOARD_STEP = 0.02;\n\nfunction clampRatio(value: number, min: number, max: number) {\n\treturn Math.min(max, Math.max(min, value));\n}\n\nfunction normalizeRatioValue(value: number, fallback: number) {\n\tif (!Number.isFinite(value)) return fallback;\n\n\treturn clampRatio(value, 0, 1);\n}\n\nfunction normalizeBounds(min: number, max: number) {\n\tconst safeMin = normalizeRatioValue(min, DEFAULT_MIN);\n\tconst safeMax = normalizeRatioValue(max, DEFAULT_MAX);\n\n\tif (safeMin <= safeMax) return [safeMin, safeMax] as const;\n\n\treturn [safeMax, safeMin] as const;\n}\n\nfunction getPointerCoordinate(direction: SplitterDirection, event: PointerEvent | ReactPointerEvent<HTMLDivElement>) {\n\treturn direction === \"vertical\" ? event.clientX : event.clientY;\n}\n\nfunction getContainerDimension(direction: SplitterDirection, rect: DOMRect) {\n\treturn direction === \"vertical\" ? rect.width : rect.height;\n}\n\nfunction getKeyboardDelta(direction: SplitterDirection, key: string) {\n\tif (direction === \"vertical\") {\n\t\tif (key === \"ArrowLeft\") return -KEYBOARD_STEP;\n\t\tif (key === \"ArrowRight\") return KEYBOARD_STEP;\n\t}\n\n\tif (direction === \"horizontal\") {\n\t\tif (key === \"ArrowUp\") return -KEYBOARD_STEP;\n\t\tif (key === \"ArrowDown\") return KEYBOARD_STEP;\n\t}\n\n\treturn null;\n}\n\nfunction resolveTopLeftBasis(ratio: number, collapsedPane: SplitterPane | null) {\n\tif (collapsedPane === \"start\") return 0;\n\tif (collapsedPane === \"end\") return 1;\n\n\treturn ratio;\n}\n\nfunction useSplitterLogic({ direction, initial, min, max, onChange, collapsedPane }: SplitterLogicParams): SplitterLogic {\n\tconst [minRatio, maxRatio] = normalizeBounds(min, max);\n\n\tconst containerRef = useRef<HTMLDivElement | null>(null);\n\tconst topLeftRef = useRef<HTMLDivElement | null>(null);\n\tconst separatorRef = useRef<HTMLDivElement | null>(null);\n\tconst cleanupDragRef = useRef<(() => void) | null>(null);\n\tconst pendingRatioRef = useRef<number | null>(null);\n\tconst frameRef = useRef<number | null>(null);\n\tconst startPosRef = useRef(0);\n\tconst startRatioRef = useRef(clampRatio(normalizeRatioValue(initial, DEFAULT_INITIAL), minRatio, maxRatio));\n\tconst previousInitialRef = useRef(initial);\n\n\tconst [ratio, setRatio] = useState(() => clampRatio(normalizeRatioValue(initial, DEFAULT_INITIAL), minRatio, maxRatio));\n\tconst ratioRef = useRef(ratio);\n\n\tconst applyRatio = useCallback(\n\t\t(nextRatio: number) => {\n\t\t\tratioRef.current = nextRatio;\n\t\t\ttopLeftRef.current?.style.setProperty(\"flex-basis\", `${resolveTopLeftBasis(nextRatio, collapsedPane) * 100}%`);\n\t\t\tseparatorRef.current?.setAttribute(\"aria-valuenow\", `${Math.round(nextRatio * 100)}`);\n\t\t},\n\t\t[collapsedPane]\n\t);\n\n\tconst flushPendingRatio = () => {\n\t\tif (frameRef.current !== null) {\n\t\t\tcancelAnimationFrame(frameRef.current);\n\t\t\tframeRef.current = null;\n\t\t}\n\n\t\tif (pendingRatioRef.current === null) return ratioRef.current;\n\n\t\tconst nextRatio = pendingRatioRef.current;\n\t\tpendingRatioRef.current = null;\n\t\tapplyRatio(nextRatio);\n\n\t\treturn nextRatio;\n\t};\n\n\tconst scheduleRatioUpdate = (nextRatio: number) => {\n\t\tpendingRatioRef.current = nextRatio;\n\n\t\tif (frameRef.current !== null) return;\n\n\t\tframeRef.current = requestAnimationFrame(() => {\n\t\t\tframeRef.current = null;\n\n\t\t\tif (pendingRatioRef.current === null) return;\n\n\t\t\tapplyRatio(pendingRatioRef.current);\n\t\t});\n\t};\n\n\tconst stopDragging = () => {\n\t\tcleanupDragRef.current?.();\n\t\tcleanupDragRef.current = null;\n\t};\n\n\tconst commitRatio = (nextRatio: number, previousRatio = ratioRef.current) => {\n\t\tflushPendingRatio();\n\t\tconst committedRatio = clampRatio(nextRatio, minRatio, maxRatio);\n\t\tsetRatio(committedRatio);\n\t\tif (committedRatio !== previousRatio) onChange?.(committedRatio);\n\t};\n\n\tconst handleSeparatorPointerDown = (event: ReactPointerEvent<HTMLDivElement>) => {\n\t\tif (event.button !== 0) return;\n\n\t\tevent.preventDefault();\n\n\t\tconst container = containerRef.current;\n\t\tif (!container) return;\n\n\t\tstopDragging();\n\n\t\ttry {\n\t\t\tevent.currentTarget.setPointerCapture?.(event.pointerId);\n\t\t} catch {\n\t\t\t// Игнорировать, если браузер не поддерживает pointer capture.\n\t\t}\n\n\t\tstartPosRef.current = getPointerCoordinate(direction, event);\n\t\tstartRatioRef.current = ratioRef.current;\n\n\t\tconst handlePointerMove = (moveEvent: PointerEvent) => {\n\t\t\tconst rect = container.getBoundingClientRect();\n\t\t\tconst dimension = getContainerDimension(direction, rect);\n\t\t\tif (dimension <= 0) return;\n\n\t\t\tconst delta = getPointerCoordinate(direction, moveEvent) - startPosRef.current;\n\t\t\tconst nextRatio = clampRatio(startRatioRef.current + delta / dimension, minRatio, maxRatio);\n\n\t\t\tscheduleRatioUpdate(nextRatio);\n\t\t};\n\n\t\tconst handlePointerUp = () => {\n\t\t\tstopDragging();\n\t\t\tcommitRatio(flushPendingRatio(), startRatioRef.current);\n\t\t};\n\n\t\tcleanupDragRef.current = () => {\n\t\t\tdocument.removeEventListener(\"pointermove\", handlePointerMove);\n\t\t\tdocument.removeEventListener(\"pointerup\", handlePointerUp);\n\t\t\tdocument.removeEventListener(\"pointercancel\", handlePointerUp);\n\t\t};\n\n\t\tdocument.addEventListener(\"pointermove\", handlePointerMove);\n\t\tdocument.addEventListener(\"pointerup\", handlePointerUp);\n\t\tdocument.addEventListener(\"pointercancel\", handlePointerUp);\n\t};\n\n\tconst handleSeparatorKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n\t\tconst keyboardDelta = getKeyboardDelta(direction, event.key);\n\n\t\tif (keyboardDelta !== null) {\n\t\t\tevent.preventDefault();\n\t\t\tcommitRatio(ratioRef.current + keyboardDelta);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (event.key === \"Home\") {\n\t\t\tevent.preventDefault();\n\t\t\tcommitRatio(minRatio);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (event.key === \"End\") {\n\t\t\tevent.preventDefault();\n\t\t\tcommitRatio(maxRatio);\n\t\t}\n\t};\n\n\tuseLayoutEffect(() => {\n\t\tapplyRatio(ratio);\n\t}, [applyRatio, ratio]);\n\n\tuseEffect(() => {\n\t\tsetRatio((currentRatio) => {\n\t\t\tconst initialChanged = previousInitialRef.current !== initial;\n\t\t\tpreviousInitialRef.current = initial;\n\n\t\t\tif (initialChanged) {\n\t\t\t\treturn clampRatio(normalizeRatioValue(initial, DEFAULT_INITIAL), minRatio, maxRatio);\n\t\t\t}\n\n\t\t\treturn clampRatio(currentRatio, minRatio, maxRatio);\n\t\t});\n\t}, [initial, minRatio, maxRatio]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tstopDragging();\n\n\t\t\tif (frameRef.current !== null) {\n\t\t\t\tcancelAnimationFrame(frameRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\treturn {\n\t\tcontainerRef,\n\t\ttopLeftRef,\n\t\tseparatorRef,\n\t\tratio,\n\t\tminRatio,\n\t\tmaxRatio,\n\t\thandleSeparatorPointerDown,\n\t\thandleSeparatorKeyDown\n\t};\n}\n\nfunction SplitterView({ className, direction, left, right, collapsedPane, logic }: SplitterViewProps) {\n\tconst { containerRef, topLeftRef, separatorRef, ratio, minRatio, maxRatio, handleSeparatorPointerDown, handleSeparatorKeyDown } = logic;\n\tconst topLeftBasis = resolveTopLeftBasis(ratio, collapsedPane);\n\tconst isStartPaneCollapsed = collapsedPane === \"start\";\n\tconst isEndPaneCollapsed = collapsedPane === \"end\";\n\tconst isSeparatorVisible = collapsedPane === null;\n\n\treturn (\n\t\t<div ref={containerRef} className={cn(styles.splitter, styles[direction], className)}>\n\t\t\t<div ref={topLeftRef} className={styles.topLeft} style={{ flexBasis: `${topLeftBasis * 100}%` }} hidden={isStartPaneCollapsed}>\n\t\t\t\t{left}\n\t\t\t</div>\n\n\t\t\t<div\n\t\t\t\tref={separatorRef}\n\t\t\t\thidden={!isSeparatorVisible}\n\t\t\t\trole=\"separator\"\n\t\t\t\taria-orientation={direction === \"vertical\" ? \"vertical\" : \"horizontal\"}\n\t\t\t\taria-valuemin={Math.round(minRatio * 100)}\n\t\t\t\taria-valuemax={Math.round(maxRatio * 100)}\n\t\t\t\taria-valuenow={Math.round(ratio * 100)}\n\t\t\t\ttabIndex={isSeparatorVisible ? 0 : -1}\n\t\t\t\tonPointerDown={handleSeparatorPointerDown}\n\t\t\t\tonKeyDown={handleSeparatorKeyDown}\n\t\t\t\tclassName={styles.separator}></div>\n\n\t\t\t<div className={styles.bottomRight} hidden={isEndPaneCollapsed}>\n\t\t\t\t{right}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport function Splitter({\n\tdirection = \"vertical\",\n\tinitial = DEFAULT_INITIAL,\n\tmin = DEFAULT_MIN,\n\tmax = DEFAULT_MAX,\n\tonChange,\n\tclassName,\n\tcollapsedPane = null,\n\tchildren\n}: SplitterProps) {\n\tconst [left, right] = Children.toArray(children);\n\tconst logic = useSplitterLogic({ direction, initial, min, max, onChange, collapsedPane });\n\n\tif (!right) return left;\n\n\treturn (\n\t\t<SplitterView className={className} direction={direction} left={left} right={right} collapsedPane={collapsedPane} logic={logic} />\n\t);\n}\n"],"mappings":";;;;;;;;;;GC6DM,IAAc,IACd,IAAc,IACd,IAAkB,IAClB,IAAgB;AAEtB,SAAS,EAAW,GAAe,GAAa,GAAa;CAC5D,OAAO,KAAK,IAAI,GAAK,KAAK,IAAI,GAAK,CAAK,CAAC;AAC1C;AAEA,SAAS,EAAoB,GAAe,GAAkB;CAG7D,OAFK,OAAO,SAAS,CAAK,IAEnB,EAAW,GAAO,GAAG,CAAC,IAFO;AAGrC;AAEA,SAAS,EAAgB,GAAa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AAe,EAAoB,GAAO,CAAa,GACvD,IAAuB,MAAkB,SACzC,IAAqB,MAAkB,OACvC,IAAqB,MAAkB;CAE7C,OACC,kBAAC,OAAD;EAAK,KAAK;EAAc,WAAW,EAAG,EAAO,UAAU,EAAO,IAAY,CAAS;EAAnF,UAAA;GACC,kBAAC,OAAD;IAAK,KAAK;IAAY,WAAW,EAAO;IAAS,OAAO,EAAE,WAAW,GAAG,IAAe,IAAI,GAAG;IAAG,QAAQ;IACvG,UAAA;GACG,CAAA;GAEL,kBAAC,OAAD;IACC,KAAK;IACL,QAAQ,CAAC;IACT,MAAK;IACL,oBAAkB,MAAc,aAAa,aAAa;IAC1D,iBAAe,KAAK,MAAM,IAAW,GAAG;IACxC,iBAAe,KAAK,MAAM,IAAW,GAAG;IACxC,iBAAe,KAAK,MAAM,IAAQ,GAAG;IACrC,UAAU,IAAqB,IAAI;IACnC,eAAe;IACf,WAAW;IACX,WAAW,EAAO;GAAgB,CAAA;GAEnC,kBAAC,OAAD;IAAK,WAAW,EAAO;IAAa,QAAQ;IAC1C,UAAA;GACG,CAAA;EACD;;AAEP;AAEA,SAAgB,EAAS,EACxB,eAAY,YACZ,aAAU,GACV,SAAM,GACN,SAAM,GACN,aACA,cACA,mBAAgB,MAChB,eACiB;CACjB,IAAM,CAAC,GAAM,KAAS,EAAS,QAAQ,CAAQ,GACzC,IAAQ,EAAiB;EAAE;EAAW;EAAS;EAAK;EAAK;EAAU;CAAc,CAAC;CAIxF,OAFK,IAGJ,kBAAC,GAAD;EAAyB;EAAsB;EAAiB;EAAa;EAAsB;EAAsB;CAAQ,CAAA,IAH/G;AAKpB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/splitter/Splitter.module.scss","../../src/splitter/Splitter.tsx","../../src/splitter/SplitterHeightContainer.module.scss","../../src/splitter/useSplitterContainerHeight.ts","../../src/splitter/SplitterHeightContainer.tsx"],"sourcesContent":["@use \"@/styles/mixins\" as *;\n\n.splitter {\n\tdisplay: flex;\n\twidth: 100%;\n\theight: 100%;\n\toverflow: hidden;\n\n\t&.vertical {\n\t\tflex-direction: row;\n\n\t\t.separator {\n\t\t\t@include resize-separator(vertical);\n\n\t\t\tcursor: col-resize;\n\n\t\t\t// border-left: var(--border);\n\t\t\t// border-right: var(--border);\n\n\t\t\tmargin-inline: var(--space-xs);\n\t\t}\n\t}\n\n\t&.horizontal {\n\t\tflex-direction: column;\n\n\t\t.separator {\n\t\t\t@include resize-separator(horizontal);\n\n\t\t\tcursor: row-resize;\n\n\t\t\t// border-top: var(--border);\n\t\t\t// border-bottom: var(--border);\n\n\t\t\tmargin-block: var(--space-xs);\n\t\t}\n\t}\n}\n\n.topLeft {\n\tflex-grow: 0;\n\tflex-shrink: 0;\n}\n\n.bottomRight {\n\tflex-grow: 1;\n}\n\n.topLeft,\n.bottomRight {\n\tmin-width: 0;\n\tmin-height: 0;\n\toverflow: auto;\n}\n\n.separator {\n\tflex-basis: var(--space-sm);\n\tflex-grow: 0;\n\tflex-shrink: 0;\n}\n","import {\n\tChildren,\n\ttype PropsWithChildren,\n\ttype KeyboardEvent as ReactKeyboardEvent,\n\ttype ReactNode,\n\ttype PointerEvent as ReactPointerEvent,\n\ttype RefObject,\n\tuseCallback,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseState\n} from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport styles from \"./Splitter.module.scss\";\n\ntype SplitterDirection = \"vertical\" | \"horizontal\";\ntype SplitterPane = \"start\" | \"end\";\n\nexport type SplitterProps = PropsWithChildren<{\n\tdirection?: SplitterDirection;\n\tinitial?: number; // от 0 до 1\n\tmin?: number; // минимальная доля первой панели\n\tmax?: number; // максимальная доля первой панели\n\t/** Сообщает итоговую долю первой панели после завершения drag или шага с клавиатуры. */\n\tonChange?: (ratio: number) => void;\n\tclassName?: string;\n\tcollapsedPane?: SplitterPane | null;\n}>;\n\ntype SplitterLogicParams = {\n\tdirection: SplitterDirection;\n\tinitial: number;\n\tmin: number;\n\tmax: number;\n\tonChange?: (ratio: number) => void;\n\tcollapsedPane: SplitterPane | null;\n};\n\ntype SplitterLogic = {\n\tcontainerRef: RefObject<HTMLDivElement | null>;\n\ttopLeftRef: RefObject<HTMLDivElement | null>;\n\tseparatorRef: RefObject<HTMLDivElement | null>;\n\tratio: number;\n\tminRatio: number;\n\tmaxRatio: number;\n\thandleSeparatorPointerDown: (event: ReactPointerEvent<HTMLDivElement>) => void;\n\thandleSeparatorKeyDown: (event: ReactKeyboardEvent<HTMLDivElement>) => void;\n};\n\ntype SplitterViewProps = {\n\tclassName?: string;\n\tdirection: SplitterDirection;\n\tleft: ReactNode;\n\tright: ReactNode;\n\tcollapsedPane: SplitterPane | null;\n\tlogic: SplitterLogic;\n};\n\nconst DEFAULT_MIN = 0.1;\nconst DEFAULT_MAX = 0.9;\nconst DEFAULT_INITIAL = 0.7;\nconst KEYBOARD_STEP = 0.02;\n\nfunction clampRatio(value: number, min: number, max: number) {\n\treturn Math.min(max, Math.max(min, value));\n}\n\nfunction normalizeRatioValue(value: number, fallback: number) {\n\tif (!Number.isFinite(value)) return fallback;\n\n\treturn clampRatio(value, 0, 1);\n}\n\nfunction normalizeBounds(min: number, max: number) {\n\tconst safeMin = normalizeRatioValue(min, DEFAULT_MIN);\n\tconst safeMax = normalizeRatioValue(max, DEFAULT_MAX);\n\n\tif (safeMin <= safeMax) return [safeMin, safeMax] as const;\n\n\treturn [safeMax, safeMin] as const;\n}\n\nfunction getPointerCoordinate(direction: SplitterDirection, event: PointerEvent | ReactPointerEvent<HTMLDivElement>) {\n\treturn direction === \"vertical\" ? event.clientX : event.clientY;\n}\n\nfunction getContainerDimension(direction: SplitterDirection, rect: DOMRect) {\n\treturn direction === \"vertical\" ? rect.width : rect.height;\n}\n\nfunction getKeyboardDelta(direction: SplitterDirection, key: string) {\n\tif (direction === \"vertical\") {\n\t\tif (key === \"ArrowLeft\") return -KEYBOARD_STEP;\n\t\tif (key === \"ArrowRight\") return KEYBOARD_STEP;\n\t}\n\n\tif (direction === \"horizontal\") {\n\t\tif (key === \"ArrowUp\") return -KEYBOARD_STEP;\n\t\tif (key === \"ArrowDown\") return KEYBOARD_STEP;\n\t}\n\n\treturn null;\n}\n\nfunction resolveTopLeftBasis(ratio: number, collapsedPane: SplitterPane | null) {\n\tif (collapsedPane === \"start\") return 0;\n\tif (collapsedPane === \"end\") return 1;\n\n\treturn ratio;\n}\n\nfunction useSplitterLogic({ direction, initial, min, max, onChange, collapsedPane }: SplitterLogicParams): SplitterLogic {\n\tconst [minRatio, maxRatio] = normalizeBounds(min, max);\n\n\tconst containerRef = useRef<HTMLDivElement | null>(null);\n\tconst topLeftRef = useRef<HTMLDivElement | null>(null);\n\tconst separatorRef = useRef<HTMLDivElement | null>(null);\n\tconst cleanupDragRef = useRef<(() => void) | null>(null);\n\tconst pendingRatioRef = useRef<number | null>(null);\n\tconst frameRef = useRef<number | null>(null);\n\tconst startPosRef = useRef(0);\n\tconst startRatioRef = useRef(clampRatio(normalizeRatioValue(initial, DEFAULT_INITIAL), minRatio, maxRatio));\n\tconst previousInitialRef = useRef(initial);\n\n\tconst [ratio, setRatio] = useState(() => clampRatio(normalizeRatioValue(initial, DEFAULT_INITIAL), minRatio, maxRatio));\n\tconst ratioRef = useRef(ratio);\n\n\tconst applyRatio = useCallback(\n\t\t(nextRatio: number) => {\n\t\t\tratioRef.current = nextRatio;\n\t\t\ttopLeftRef.current?.style.setProperty(\"flex-basis\", `${resolveTopLeftBasis(nextRatio, collapsedPane) * 100}%`);\n\t\t\tseparatorRef.current?.setAttribute(\"aria-valuenow\", `${Math.round(nextRatio * 100)}`);\n\t\t},\n\t\t[collapsedPane]\n\t);\n\n\tconst flushPendingRatio = () => {\n\t\tif (frameRef.current !== null) {\n\t\t\tcancelAnimationFrame(frameRef.current);\n\t\t\tframeRef.current = null;\n\t\t}\n\n\t\tif (pendingRatioRef.current === null) return ratioRef.current;\n\n\t\tconst nextRatio = pendingRatioRef.current;\n\t\tpendingRatioRef.current = null;\n\t\tapplyRatio(nextRatio);\n\n\t\treturn nextRatio;\n\t};\n\n\tconst scheduleRatioUpdate = (nextRatio: number) => {\n\t\tpendingRatioRef.current = nextRatio;\n\n\t\tif (frameRef.current !== null) return;\n\n\t\tframeRef.current = requestAnimationFrame(() => {\n\t\t\tframeRef.current = null;\n\n\t\t\tif (pendingRatioRef.current === null) return;\n\n\t\t\tapplyRatio(pendingRatioRef.current);\n\t\t});\n\t};\n\n\tconst stopDragging = () => {\n\t\tcleanupDragRef.current?.();\n\t\tcleanupDragRef.current = null;\n\t};\n\n\tconst commitRatio = (nextRatio: number, previousRatio = ratioRef.current) => {\n\t\tflushPendingRatio();\n\t\tconst committedRatio = clampRatio(nextRatio, minRatio, maxRatio);\n\t\tsetRatio(committedRatio);\n\t\tif (committedRatio !== previousRatio) onChange?.(committedRatio);\n\t};\n\n\tconst handleSeparatorPointerDown = (event: ReactPointerEvent<HTMLDivElement>) => {\n\t\tif (event.button !== 0) return;\n\n\t\tevent.preventDefault();\n\n\t\tconst container = containerRef.current;\n\t\tif (!container) return;\n\n\t\tstopDragging();\n\n\t\ttry {\n\t\t\tevent.currentTarget.setPointerCapture?.(event.pointerId);\n\t\t} catch {\n\t\t\t// Игнорировать, если браузер не поддерживает pointer capture.\n\t\t}\n\n\t\tstartPosRef.current = getPointerCoordinate(direction, event);\n\t\tstartRatioRef.current = ratioRef.current;\n\n\t\tconst handlePointerMove = (moveEvent: PointerEvent) => {\n\t\t\tconst rect = container.getBoundingClientRect();\n\t\t\tconst dimension = getContainerDimension(direction, rect);\n\t\t\tif (dimension <= 0) return;\n\n\t\t\tconst delta = getPointerCoordinate(direction, moveEvent) - startPosRef.current;\n\t\t\tconst nextRatio = clampRatio(startRatioRef.current + delta / dimension, minRatio, maxRatio);\n\n\t\t\tscheduleRatioUpdate(nextRatio);\n\t\t};\n\n\t\tconst handlePointerUp = () => {\n\t\t\tstopDragging();\n\t\t\tcommitRatio(flushPendingRatio(), startRatioRef.current);\n\t\t};\n\n\t\tcleanupDragRef.current = () => {\n\t\t\tdocument.removeEventListener(\"pointermove\", handlePointerMove);\n\t\t\tdocument.removeEventListener(\"pointerup\", handlePointerUp);\n\t\t\tdocument.removeEventListener(\"pointercancel\", handlePointerUp);\n\t\t};\n\n\t\tdocument.addEventListener(\"pointermove\", handlePointerMove);\n\t\tdocument.addEventListener(\"pointerup\", handlePointerUp);\n\t\tdocument.addEventListener(\"pointercancel\", handlePointerUp);\n\t};\n\n\tconst handleSeparatorKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n\t\tconst keyboardDelta = getKeyboardDelta(direction, event.key);\n\n\t\tif (keyboardDelta !== null) {\n\t\t\tevent.preventDefault();\n\t\t\tcommitRatio(ratioRef.current + keyboardDelta);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (event.key === \"Home\") {\n\t\t\tevent.preventDefault();\n\t\t\tcommitRatio(minRatio);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (event.key === \"End\") {\n\t\t\tevent.preventDefault();\n\t\t\tcommitRatio(maxRatio);\n\t\t}\n\t};\n\n\tuseLayoutEffect(() => {\n\t\tapplyRatio(ratio);\n\t}, [applyRatio, ratio]);\n\n\tuseEffect(() => {\n\t\tsetRatio((currentRatio) => {\n\t\t\tconst initialChanged = previousInitialRef.current !== initial;\n\t\t\tpreviousInitialRef.current = initial;\n\n\t\t\tif (initialChanged) {\n\t\t\t\treturn clampRatio(normalizeRatioValue(initial, DEFAULT_INITIAL), minRatio, maxRatio);\n\t\t\t}\n\n\t\t\treturn clampRatio(currentRatio, minRatio, maxRatio);\n\t\t});\n\t}, [initial, minRatio, maxRatio]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tstopDragging();\n\n\t\t\tif (frameRef.current !== null) {\n\t\t\t\tcancelAnimationFrame(frameRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\treturn {\n\t\tcontainerRef,\n\t\ttopLeftRef,\n\t\tseparatorRef,\n\t\tratio,\n\t\tminRatio,\n\t\tmaxRatio,\n\t\thandleSeparatorPointerDown,\n\t\thandleSeparatorKeyDown\n\t};\n}\n\nfunction SplitterView({ className, direction, left, right, collapsedPane, logic }: SplitterViewProps) {\n\tconst { containerRef, topLeftRef, separatorRef, ratio, minRatio, maxRatio, handleSeparatorPointerDown, handleSeparatorKeyDown } = logic;\n\tconst topLeftBasis = resolveTopLeftBasis(ratio, collapsedPane);\n\tconst isStartPaneCollapsed = collapsedPane === \"start\";\n\tconst isEndPaneCollapsed = collapsedPane === \"end\";\n\tconst isSeparatorVisible = collapsedPane === null;\n\n\treturn (\n\t\t<div ref={containerRef} className={cn(styles.splitter, styles[direction], className)}>\n\t\t\t<div ref={topLeftRef} className={styles.topLeft} style={{ flexBasis: `${topLeftBasis * 100}%` }} hidden={isStartPaneCollapsed}>\n\t\t\t\t{left}\n\t\t\t</div>\n\n\t\t\t<div\n\t\t\t\tref={separatorRef}\n\t\t\t\thidden={!isSeparatorVisible}\n\t\t\t\trole=\"separator\"\n\t\t\t\taria-orientation={direction === \"vertical\" ? \"vertical\" : \"horizontal\"}\n\t\t\t\taria-valuemin={Math.round(minRatio * 100)}\n\t\t\t\taria-valuemax={Math.round(maxRatio * 100)}\n\t\t\t\taria-valuenow={Math.round(ratio * 100)}\n\t\t\t\ttabIndex={isSeparatorVisible ? 0 : -1}\n\t\t\t\tonPointerDown={handleSeparatorPointerDown}\n\t\t\t\tonKeyDown={handleSeparatorKeyDown}\n\t\t\t\tclassName={styles.separator}></div>\n\n\t\t\t<div className={styles.bottomRight} hidden={isEndPaneCollapsed}>\n\t\t\t\t{right}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport function Splitter({\n\tdirection = \"vertical\",\n\tinitial = DEFAULT_INITIAL,\n\tmin = DEFAULT_MIN,\n\tmax = DEFAULT_MAX,\n\tonChange,\n\tclassName,\n\tcollapsedPane = null,\n\tchildren\n}: SplitterProps) {\n\tconst [left, right] = Children.toArray(children);\n\tconst logic = useSplitterLogic({ direction, initial, min, max, onChange, collapsedPane });\n\n\tif (!right) return left;\n\n\treturn (\n\t\t<SplitterView className={className} direction={direction} left={left} right={right} collapsedPane={collapsedPane} logic={logic} />\n\t);\n}\n","@use \"@/styles/mixins\" as *;\n\n.container {\n\tmin-width: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.viewport {\n\twidth: 100%;\n\tmin-width: 0;\n\tmin-height: 0;\n\toverflow: hidden;\n}\n\n.separator {\n\t@include resize-separator(horizontal);\n\n\twidth: 100%;\n\theight: var(--space-sm);\n\tflex: 0 0 var(--space-sm);\n\tmargin-block: var(--space-xs);\n\tcursor: row-resize;\n}\n","import {\n\ttype KeyboardEvent as ReactKeyboardEvent,\n\ttype PointerEvent as ReactPointerEvent,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseRef,\n\tuseState\n} from \"react\";\n\nimport { clampNumberScaleValue, offsetNumberScaleValue, resolveNumberScaleBounds } from \"@ryuzaki13/react-foundation-lib/number-scale\";\n\ntype UseSplitterContainerHeightParams = {\n\theight?: number;\n\tdefaultHeight: number;\n\tminHeight: number;\n\tmaxHeight: number;\n\theightStep: number;\n\tonHeightChange?: (height: number) => void;\n};\n\ntype SplitterContainerHeightState = {\n\theight: number;\n\tminHeight: number;\n\tmaxHeight: number;\n\thandleSeparatorPointerDown: (event: ReactPointerEvent<HTMLDivElement>) => void;\n\thandleSeparatorKeyDown: (event: ReactKeyboardEvent<HTMLDivElement>) => void;\n};\n\n/**\n * Управляет controlled/uncontrolled-высотой внешнего контейнера Splitter.\n * Pointer-изменения обновляют только локальный draft, а `onHeightChange`\n * получает итоговое значение после завершения жеста или клавиатурного шага.\n */\nexport function useSplitterContainerHeight({\n\theight,\n\tdefaultHeight,\n\tminHeight,\n\tmaxHeight,\n\theightStep,\n\tonHeightChange\n}: UseSplitterContainerHeightParams): SplitterContainerHeightState {\n\tconst bounds = resolveNumberScaleBounds(minHeight, maxHeight);\n\tconst scale = { ...bounds, step: heightStep };\n\tconst controlled = height !== undefined;\n\tconst [uncontrolledHeight, setUncontrolledHeight] = useState(() => clampNumberScaleValue(defaultHeight, bounds.min, bounds.max));\n\tconst [dragHeight, setDragHeight] = useState<number | null>(null);\n\tconst resolvedHeight = clampNumberScaleValue(height ?? uncontrolledHeight, bounds.min, bounds.max);\n\tconst currentHeight = dragHeight ?? resolvedHeight;\n\n\tconst cleanupDragRef = useRef<(() => void) | null>(null);\n\tconst frameRef = useRef<number | null>(null);\n\tconst pendingHeightRef = useRef<number | null>(null);\n\tconst currentHeightRef = useRef(currentHeight);\n\tconst startHeightRef = useRef(currentHeight);\n\tconst startPointerYRef = useRef(0);\n\n\tconst flushPendingHeight = () => {\n\t\tif (frameRef.current !== null) {\n\t\t\tcancelAnimationFrame(frameRef.current);\n\t\t\tframeRef.current = null;\n\t\t}\n\n\t\tif (pendingHeightRef.current === null) return currentHeightRef.current;\n\n\t\tconst nextHeight = pendingHeightRef.current;\n\t\tpendingHeightRef.current = null;\n\t\tcurrentHeightRef.current = nextHeight;\n\n\t\treturn nextHeight;\n\t};\n\n\tconst scheduleHeightUpdate = (nextHeight: number) => {\n\t\tpendingHeightRef.current = nextHeight;\n\n\t\tif (frameRef.current !== null) return;\n\n\t\tframeRef.current = requestAnimationFrame(() => {\n\t\t\tframeRef.current = null;\n\n\t\t\tif (pendingHeightRef.current === null) return;\n\n\t\t\tconst scheduledHeight = pendingHeightRef.current;\n\t\t\tpendingHeightRef.current = null;\n\t\t\tcurrentHeightRef.current = scheduledHeight;\n\t\t\tsetDragHeight(scheduledHeight);\n\t\t});\n\t};\n\n\tconst commitHeight = (nextHeight: number, previousHeight = currentHeightRef.current) => {\n\t\tconst committedHeight = clampNumberScaleValue(nextHeight, bounds.min, bounds.max);\n\t\tcurrentHeightRef.current = committedHeight;\n\t\tsetDragHeight(null);\n\n\t\tif (committedHeight === previousHeight) return;\n\n\t\tif (!controlled) {\n\t\t\tsetUncontrolledHeight(committedHeight);\n\t\t}\n\n\t\tonHeightChange?.(committedHeight);\n\t};\n\n\tconst stopDragging = () => {\n\t\tcleanupDragRef.current?.();\n\t\tcleanupDragRef.current = null;\n\t};\n\n\tconst handleSeparatorPointerDown = (event: ReactPointerEvent<HTMLDivElement>) => {\n\t\tif (event.button !== 0) return;\n\n\t\tevent.preventDefault();\n\t\tstopDragging();\n\n\t\ttry {\n\t\t\tevent.currentTarget.setPointerCapture?.(event.pointerId);\n\t\t} catch {\n\t\t\t// Браузер может не поддерживать pointer capture для synthetic-события.\n\t\t}\n\n\t\tstartPointerYRef.current = event.clientY;\n\t\tstartHeightRef.current = currentHeightRef.current;\n\n\t\tconst handlePointerMove = (moveEvent: PointerEvent) => {\n\t\t\tconst pointerDelta = moveEvent.clientY - startPointerYRef.current;\n\t\t\tconst nextHeight = clampNumberScaleValue(startHeightRef.current + pointerDelta, bounds.min, bounds.max);\n\t\t\tscheduleHeightUpdate(nextHeight);\n\t\t};\n\n\t\tconst handlePointerUp = () => {\n\t\t\tstopDragging();\n\t\t\tcommitHeight(flushPendingHeight(), startHeightRef.current);\n\t\t};\n\n\t\tcleanupDragRef.current = () => {\n\t\t\tdocument.removeEventListener(\"pointermove\", handlePointerMove);\n\t\t\tdocument.removeEventListener(\"pointerup\", handlePointerUp);\n\t\t\tdocument.removeEventListener(\"pointercancel\", handlePointerUp);\n\t\t};\n\n\t\tdocument.addEventListener(\"pointermove\", handlePointerMove);\n\t\tdocument.addEventListener(\"pointerup\", handlePointerUp);\n\t\tdocument.addEventListener(\"pointercancel\", handlePointerUp);\n\t};\n\n\tconst handleSeparatorKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n\t\tlet nextHeight: number | undefined;\n\n\t\tif (event.key === \"ArrowUp\") nextHeight = offsetNumberScaleValue(currentHeight, -1, scale);\n\t\tif (event.key === \"ArrowDown\") nextHeight = offsetNumberScaleValue(currentHeight, 1, scale);\n\t\tif (event.key === \"Home\") nextHeight = bounds.min;\n\t\tif (event.key === \"End\") nextHeight = bounds.max;\n\t\tif (nextHeight === undefined) return;\n\n\t\tevent.preventDefault();\n\t\tcommitHeight(nextHeight, currentHeight);\n\t};\n\n\tuseLayoutEffect(() => {\n\t\tcurrentHeightRef.current = currentHeight;\n\t}, [currentHeight]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tstopDragging();\n\n\t\t\tif (frameRef.current !== null) {\n\t\t\t\tcancelAnimationFrame(frameRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\treturn {\n\t\theight: currentHeight,\n\t\tminHeight: bounds.min,\n\t\tmaxHeight: bounds.max,\n\t\thandleSeparatorPointerDown,\n\t\thandleSeparatorKeyDown\n\t};\n}\n","import { type PropsWithChildren, useId } from \"react\";\n\nimport { cn } from \"@ryuzaki13/react-foundation-lib/utils\";\n\nimport styles from \"./SplitterHeightContainer.module.scss\";\nimport { useSplitterContainerHeight } from \"./useSplitterContainerHeight\";\n\nexport type SplitterHeightContainerProps = PropsWithChildren<{\n\t/** Controlled-высота области со Splitter в CSS-пикселях. */\n\theight?: number;\n\t/** Начальная высота для uncontrolled-режима в CSS-пикселях. */\n\tdefaultHeight?: number;\n\tminHeight?: number;\n\tmaxHeight?: number;\n\t/** Шаг изменения высоты с клавиатуры в CSS-пикселях. */\n\theightStep?: number;\n\t/** Сообщает итоговую высоту после завершения drag или клавиатурного шага. */\n\tonHeightChange?: (height: number) => void;\n\tclassName?: string;\n\tviewportClassName?: string;\n\tseparatorClassName?: string;\n\tseparatorAriaLabel?: string;\n}>;\n\nconst DEFAULT_HEIGHT = 480;\nconst DEFAULT_MIN_HEIGHT = 240;\nconst DEFAULT_MAX_HEIGHT = 1200;\nconst DEFAULT_HEIGHT_STEP = 20;\n\n/**\n * Опциональная внешняя композиция для Splitter: область панелей получает\n * независимую высоту, а расположенный снизу separator изменяет весь viewport.\n * Внутренние Splitter при этом продолжают управлять только своими пропорциями.\n */\nexport function SplitterHeightContainer({\n\theight,\n\tdefaultHeight = DEFAULT_HEIGHT,\n\tminHeight = DEFAULT_MIN_HEIGHT,\n\tmaxHeight = DEFAULT_MAX_HEIGHT,\n\theightStep = DEFAULT_HEIGHT_STEP,\n\tonHeightChange,\n\tclassName,\n\tviewportClassName,\n\tseparatorClassName,\n\tseparatorAriaLabel = \"Изменить высоту рабочей области\",\n\tchildren\n}: SplitterHeightContainerProps) {\n\tconst generatedViewportId = useId();\n\tconst viewportId = `${generatedViewportId}-viewport`;\n\tconst state = useSplitterContainerHeight({\n\t\theight,\n\t\tdefaultHeight,\n\t\tminHeight,\n\t\tmaxHeight,\n\t\theightStep,\n\t\tonHeightChange\n\t});\n\n\treturn (\n\t\t<div className={cn(styles.container, className)} data-ui=\"splitter-height-container\">\n\t\t\t<div\n\t\t\t\tid={viewportId}\n\t\t\t\tclassName={cn(styles.viewport, viewportClassName)}\n\t\t\t\tstyle={{ height: state.height }}\n\t\t\t\tdata-ui=\"splitter-height-viewport\">\n\t\t\t\t{children}\n\t\t\t</div>\n\n\t\t\t<div\n\t\t\t\trole=\"separator\"\n\t\t\t\taria-label={separatorAriaLabel}\n\t\t\t\taria-orientation=\"horizontal\"\n\t\t\t\taria-controls={viewportId}\n\t\t\t\taria-valuemin={state.minHeight}\n\t\t\t\taria-valuemax={state.maxHeight}\n\t\t\t\taria-valuenow={state.height}\n\t\t\t\taria-valuetext={`${state.height} px`}\n\t\t\t\ttabIndex={0}\n\t\t\t\tclassName={cn(styles.separator, separatorClassName)}\n\t\t\t\tonPointerDown={state.handleSeparatorPointerDown}\n\t\t\t\tonKeyDown={state.handleSeparatorKeyDown}\n\t\t\t\tdata-ui=\"splitter-height-separator\"\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;;;GC6DM,IAAc,IACd,IAAc,IACd,IAAkB,IAClB,IAAgB;AAEtB,SAAS,EAAW,GAAe,GAAa,GAAa;CAC5D,OAAO,KAAK,IAAI,GAAK,KAAK,IAAI,GAAK,CAAK,CAAC;AAC1C;AAEA,SAA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A,mBAAgB,GAChB,eAAY,GACZ,eAAY,GACZ,gBAAa,GACb,mBACA,cACA,sBACA,uBACA,wBAAqB,mCACrB,eACgC;CAEhC,IAAM,IAAa,GADS,EACN,EAAoB,YACpC,IAAQ,EAA2B;EACxC;EACA;EACA;EACA;EACA;EACA;CACD,CAAC;CAED,OACC,kBAAC,OAAD;EAAK,WAAW,EAAG,EAAO,WAAW,CAAS;EAAG,WAAQ;EAAzD,UAAA,CACC,kBAAC,OAAD;GACC,IAAI;GACJ,WAAW,EAAG,EAAO,UAAU,CAAiB;GAChD,OAAO,EAAE,QAAQ,EAAM,OAAO;GAC9B,WAAQ;GACP;EACG,CAAA,GAEL,kBAAC,OAAD;GACC,MAAK;GACL,cAAY;GACZ,oBAAiB;GACjB,iBAAe;GACf,iBAAe,EAAM;GACrB,iBAAe,EAAM;GACrB,iBAAe,EAAM;GACrB,kBAAgB,GAAG,EAAM,OAAO;GAChC,UAAU;GACV,WAAW,EAAG,EAAO,WAAW,CAAkB;GAClD,eAAe,EAAM;GACrB,WAAW,EAAM;GACjB,WAAQ;EACR,CAAA,CACG;;AAEP"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type KeyboardEvent as ReactKeyboardEvent, type PointerEvent as ReactPointerEvent } from "react";
|
|
2
|
+
type UseSplitterContainerHeightParams = {
|
|
3
|
+
height?: number;
|
|
4
|
+
defaultHeight: number;
|
|
5
|
+
minHeight: number;
|
|
6
|
+
maxHeight: number;
|
|
7
|
+
heightStep: number;
|
|
8
|
+
onHeightChange?: (height: number) => void;
|
|
9
|
+
};
|
|
10
|
+
type SplitterContainerHeightState = {
|
|
11
|
+
height: number;
|
|
12
|
+
minHeight: number;
|
|
13
|
+
maxHeight: number;
|
|
14
|
+
handleSeparatorPointerDown: (event: ReactPointerEvent<HTMLDivElement>) => void;
|
|
15
|
+
handleSeparatorKeyDown: (event: ReactKeyboardEvent<HTMLDivElement>) => void;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Управляет controlled/uncontrolled-высотой внешнего контейнера Splitter.
|
|
19
|
+
* Pointer-изменения обновляют только локальный draft, а `onHeightChange`
|
|
20
|
+
* получает итоговое значение после завершения жеста или клавиатурного шага.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useSplitterContainerHeight({ height, defaultHeight, minHeight, maxHeight, heightStep, onHeightChange }: UseSplitterContainerHeightParams): SplitterContainerHeightState;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=useSplitterContainerHeight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSplitterContainerHeight.d.ts","sourceRoot":"","sources":["../../src/splitter/useSplitterContainerHeight.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,aAAa,IAAI,kBAAkB,EACxC,KAAK,YAAY,IAAI,iBAAiB,EAKtC,MAAM,OAAO,CAAC;AAIf,KAAK,gCAAgC,GAAG;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEF,KAAK,4BAA4B,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,0BAA0B,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IAC/E,sBAAsB,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;CAC5E,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,EAC1C,MAAM,EACN,aAAa,EACb,SAAS,EACT,SAAS,EACT,UAAU,EACV,cAAc,EACd,EAAE,gCAAgC,GAAG,4BAA4B,CA0IjE"}
|