@vavt/react-ui 1.0.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/README.md +137 -0
- package/dist/Alert-BGyLKuv0.js +52 -0
- package/dist/Alert-tPSJmCXK.cjs +1 -0
- package/dist/Anchor-QZROepM_.js +197 -0
- package/dist/Anchor-iriRYxEs.cjs +1 -0
- package/dist/Announcement-D_NccvTm.js +212 -0
- package/dist/Announcement-XjJyJ28N.cjs +1 -0
- package/dist/Button-CwkWSWau.js +96 -0
- package/dist/Button-qURrKHQ0.cjs +1 -0
- package/dist/Card-DlztNV-6.js +48 -0
- package/dist/Card-nILlh9c_.cjs +1 -0
- package/dist/Checkbox-BCXbK1-8.cjs +1 -0
- package/dist/Checkbox-CQZSg9Xu.cjs +1 -0
- package/dist/Checkbox-CQeqLO0S.js +46 -0
- package/dist/Checkbox-cnXHW9Oz.js +61 -0
- package/dist/Col-CZjR94ac.js +55 -0
- package/dist/Col-qcq7T83y.cjs +1 -0
- package/dist/Cron-CoO2Vnnm.cjs +1 -0
- package/dist/Cron-Di7k2FTL.js +1187 -0
- package/dist/DatePicker-DAxv2h-d.cjs +1 -0
- package/dist/DatePicker-M-MwejjV.js +15 -0
- package/dist/DateTimePicker-B3C3v99L.cjs +1 -0
- package/dist/DateTimePicker-BcT3FtN-.js +16 -0
- package/dist/Divider-BfvQ6BVP.cjs +1 -0
- package/dist/Divider-vyftxh3F.js +47 -0
- package/dist/Drawer-D28QbyA3.js +103 -0
- package/dist/Drawer-OmMfdgKN.cjs +1 -0
- package/dist/Dropdown-CYx6RxVv.js +311 -0
- package/dist/Dropdown-swfND4yK.cjs +1 -0
- package/dist/Form-7un_DeDk.cjs +1 -0
- package/dist/Form-CwgaAZWr.js +323 -0
- package/dist/Input-CIB_TY2n.js +113 -0
- package/dist/Input-CoDZggqc.cjs +1 -0
- package/dist/Loading-C2pY-4fA.cjs +1 -0
- package/dist/Loading-CL0wUgYK.js +45 -0
- package/dist/MessageBox-CrIifoig.js +141 -0
- package/dist/MessageBox-Ddn-R2MS.cjs +1 -0
- package/dist/Modal-B_VqN16m.js +201 -0
- package/dist/Modal-Dm48HmGu.cjs +1 -0
- package/dist/NumberInput-CYVj89_s.cjs +1 -0
- package/dist/NumberInput-C_vLULbX.js +134 -0
- package/dist/Pagination-B7a9v6BU.js +167 -0
- package/dist/Pagination-mj-pO6ql.cjs +1 -0
- package/dist/Progress-D2C6LCml.js +40 -0
- package/dist/Progress-DTAjlgwZ.cjs +1 -0
- package/dist/RadioGroup-BRcNi5Oc.js +98 -0
- package/dist/RadioGroup-q2Aa50NV.cjs +1 -0
- package/dist/Row-BJZtEKxG.cjs +1 -0
- package/dist/Row-DpEse7PJ.js +24 -0
- package/dist/Scrollbar-BdMGZrYi.js +235 -0
- package/dist/Scrollbar-CEQT6Ao_.cjs +1 -0
- package/dist/Select-DQLup8Y-.cjs +1 -0
- package/dist/Select-DccM9YpB.js +458 -0
- package/dist/Sidebar-BPXVnP7y.cjs +1 -0
- package/dist/Sidebar-u980T-QB.js +76 -0
- package/dist/Slider-BzlZc0p4.js +256 -0
- package/dist/Slider-DCIUxcBa.cjs +1 -0
- package/dist/Space-DJGRG2rt.cjs +1 -0
- package/dist/Space-gnVH7rEt.js +35 -0
- package/dist/Switch-7yJ-Q_o_.cjs +1 -0
- package/dist/Switch-DOO2tiYR.js +58 -0
- package/dist/Table-C8cSyts5.js +440 -0
- package/dist/Table-JoJ9vpu-.cjs +1 -0
- package/dist/Tabs-BhjvKN84.cjs +1 -0
- package/dist/Tabs-VT6nQ63W.js +106 -0
- package/dist/Tag-Cf9M_HT6.cjs +1 -0
- package/dist/Tag-CkfqoSwA.js +42 -0
- package/dist/Textarea-BEd7ToXv.js +68 -0
- package/dist/Textarea-C2dNYM0F.cjs +1 -0
- package/dist/TimePicker-ClQCHa6M.js +199 -0
- package/dist/TimePicker-DNBo2Rn5.cjs +1 -0
- package/dist/Timeline-ROggEQnD.cjs +1 -0
- package/dist/Timeline-euWvUS4e.js +70 -0
- package/dist/Tooltip-CbPYYr6R.cjs +1 -0
- package/dist/Tooltip-Ds4Odm7K.js +197 -0
- package/dist/Transition-DiO4GsP3.js +125 -0
- package/dist/Transition-X_89ga-e.cjs +1 -0
- package/dist/base.css +1 -0
- package/dist/cjs/Alert.cjs +1 -0
- package/dist/cjs/Anchor.cjs +1 -0
- package/dist/cjs/Announcement.cjs +1 -0
- package/dist/cjs/Button.cjs +1 -0
- package/dist/cjs/Card.cjs +1 -0
- package/dist/cjs/Checkbox.cjs +1 -0
- package/dist/cjs/Col.cjs +1 -0
- package/dist/cjs/Cron.cjs +1 -0
- package/dist/cjs/DatePicker.cjs +1 -0
- package/dist/cjs/DateTimePicker.cjs +1 -0
- package/dist/cjs/Divider.cjs +1 -0
- package/dist/cjs/Drawer.cjs +1 -0
- package/dist/cjs/Dropdown.cjs +1 -0
- package/dist/cjs/Form.cjs +1 -0
- package/dist/cjs/Input.cjs +1 -0
- package/dist/cjs/Loading.cjs +1 -0
- package/dist/cjs/MessageBox.cjs +1 -0
- package/dist/cjs/Modal.cjs +1 -0
- package/dist/cjs/NumberInput.cjs +1 -0
- package/dist/cjs/Pagination.cjs +1 -0
- package/dist/cjs/Progress.cjs +1 -0
- package/dist/cjs/Radio.cjs +1 -0
- package/dist/cjs/Row.cjs +1 -0
- package/dist/cjs/Scrollbar.cjs +1 -0
- package/dist/cjs/Select.cjs +1 -0
- package/dist/cjs/Sidebar.cjs +1 -0
- package/dist/cjs/Slider.cjs +1 -0
- package/dist/cjs/Space.cjs +1 -0
- package/dist/cjs/Switch.cjs +1 -0
- package/dist/cjs/Table.cjs +1 -0
- package/dist/cjs/Tabs.cjs +1 -0
- package/dist/cjs/Tag.cjs +1 -0
- package/dist/cjs/Textarea.cjs +1 -0
- package/dist/cjs/TimePicker.cjs +1 -0
- package/dist/cjs/Timeline.cjs +1 -0
- package/dist/cjs/Tooltip.cjs +1 -0
- package/dist/cjs/Transition.cjs +1 -0
- package/dist/cjs/global.cjs +1 -0
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/register.cjs +1 -0
- package/dist/client-BkoqeUs3.cjs +1 -0
- package/dist/client-pj_wzx28.js +8 -0
- package/dist/css/Alert.css +1 -0
- package/dist/css/Anchor.css +1 -0
- package/dist/css/Announcement.css +1 -0
- package/dist/css/Button.css +1 -0
- package/dist/css/Card.css +1 -0
- package/dist/css/Checkbox.css +1 -0
- package/dist/css/Col.css +1 -0
- package/dist/css/Cron.css +1 -0
- package/dist/css/DatePicker.css +1 -0
- package/dist/css/DateTimePicker.css +1 -0
- package/dist/css/Divider.css +1 -0
- package/dist/css/Drawer.css +1 -0
- package/dist/css/Dropdown.css +1 -0
- package/dist/css/Form.css +1 -0
- package/dist/css/Input.css +1 -0
- package/dist/css/Loading.css +1 -0
- package/dist/css/MessageBox.css +1 -0
- package/dist/css/Modal.css +1 -0
- package/dist/css/NumberInput.css +1 -0
- package/dist/css/Pagination.css +1 -0
- package/dist/css/Progress.css +1 -0
- package/dist/css/Radio.css +1 -0
- package/dist/css/Row.css +1 -0
- package/dist/css/Scrollbar.css +1 -0
- package/dist/css/Select.css +1 -0
- package/dist/css/Sidebar.css +1 -0
- package/dist/css/Slider.css +1 -0
- package/dist/css/Space.css +1 -0
- package/dist/css/Switch.css +1 -0
- package/dist/css/Table.css +1 -0
- package/dist/css/Tabs.css +1 -0
- package/dist/css/Tag.css +1 -0
- package/dist/css/Textarea.css +1 -0
- package/dist/css/TimePicker.css +1 -0
- package/dist/css/Timeline.css +1 -0
- package/dist/css/Tooltip.css +1 -0
- package/dist/css/Transition.css +0 -0
- package/dist/date-picker-DkRwNu2m.js +584 -0
- package/dist/date-picker-DyGLrw5H.cjs +1 -0
- package/dist/dialog-shell-DT1EoKQG.cjs +1 -0
- package/dist/dialog-shell-DehX3PNh.js +111 -0
- package/dist/effect-BpNxm_06.cjs +1 -0
- package/dist/effect-nifYL_rH.js +5 -0
- package/dist/es/Alert.mjs +3 -0
- package/dist/es/Anchor.mjs +3 -0
- package/dist/es/Announcement.mjs +3 -0
- package/dist/es/Button.mjs +3 -0
- package/dist/es/Card.mjs +3 -0
- package/dist/es/Checkbox.mjs +3 -0
- package/dist/es/Col.mjs +3 -0
- package/dist/es/Cron.mjs +3 -0
- package/dist/es/DatePicker.mjs +3 -0
- package/dist/es/DateTimePicker.mjs +3 -0
- package/dist/es/Divider.mjs +3 -0
- package/dist/es/Drawer.mjs +3 -0
- package/dist/es/Dropdown.mjs +3 -0
- package/dist/es/Form.mjs +3 -0
- package/dist/es/Input.mjs +3 -0
- package/dist/es/Loading.mjs +3 -0
- package/dist/es/MessageBox.mjs +3 -0
- package/dist/es/Modal.mjs +3 -0
- package/dist/es/NumberInput.mjs +3 -0
- package/dist/es/Pagination.mjs +3 -0
- package/dist/es/Progress.mjs +3 -0
- package/dist/es/Radio.mjs +6 -0
- package/dist/es/Row.mjs +6 -0
- package/dist/es/Scrollbar.mjs +3 -0
- package/dist/es/Select.mjs +3 -0
- package/dist/es/Sidebar.mjs +3 -0
- package/dist/es/Slider.mjs +3 -0
- package/dist/es/Space.mjs +3 -0
- package/dist/es/Switch.mjs +3 -0
- package/dist/es/Table.mjs +3 -0
- package/dist/es/Tabs.mjs +3 -0
- package/dist/es/Tag.mjs +3 -0
- package/dist/es/Textarea.mjs +3 -0
- package/dist/es/TimePicker.mjs +3 -0
- package/dist/es/Timeline.mjs +3 -0
- package/dist/es/Tooltip.mjs +3 -0
- package/dist/es/Transition.mjs +3 -0
- package/dist/es/global.mjs +3 -0
- package/dist/es/index.mjs +40 -0
- package/dist/es/register.mjs +7 -0
- package/dist/floating-DBAmeQIq.js +157 -0
- package/dist/floating-DXRnx48N.cjs +1 -0
- package/dist/focus-BDDJyKk3.js +9 -0
- package/dist/focus-D-h8CbGr.cjs +1 -0
- package/dist/icon-Cbvuv4yF.js +25 -0
- package/dist/icon-DRLyKu8p.cjs +1 -0
- package/dist/id-CF0zOP1G.cjs +1 -0
- package/dist/id-CHixuHb7.js +8 -0
- package/dist/index.css +1 -0
- package/dist/number-B7qJF_ZY.cjs +1 -0
- package/dist/number-BN2jHM6Z.js +6 -0
- package/dist/refs-D5IYOBaf.js +14 -0
- package/dist/refs-DCqd87V8.cjs +1 -0
- package/dist/registry-CkiH1x-J.js +79 -0
- package/dist/registry-YCz7D-2R.cjs +1 -0
- package/dist/state-ZBA75xZ_.cjs +1 -0
- package/dist/state-oH-YwB7_.js +15 -0
- package/dist/style/Alert.cjs +7 -0
- package/dist/style/Alert.mjs +7 -0
- package/dist/style/Anchor.cjs +7 -0
- package/dist/style/Anchor.mjs +7 -0
- package/dist/style/Announcement.cjs +7 -0
- package/dist/style/Announcement.mjs +7 -0
- package/dist/style/Button.cjs +7 -0
- package/dist/style/Button.mjs +7 -0
- package/dist/style/Card.cjs +7 -0
- package/dist/style/Card.mjs +7 -0
- package/dist/style/Checkbox.cjs +7 -0
- package/dist/style/Checkbox.mjs +7 -0
- package/dist/style/Col.cjs +7 -0
- package/dist/style/Col.mjs +7 -0
- package/dist/style/Cron.cjs +13 -0
- package/dist/style/Cron.mjs +13 -0
- package/dist/style/DatePicker.cjs +10 -0
- package/dist/style/DatePicker.mjs +10 -0
- package/dist/style/DateTimePicker.cjs +10 -0
- package/dist/style/DateTimePicker.mjs +10 -0
- package/dist/style/Divider.cjs +7 -0
- package/dist/style/Divider.mjs +7 -0
- package/dist/style/Drawer.cjs +8 -0
- package/dist/style/Drawer.mjs +8 -0
- package/dist/style/Dropdown.cjs +8 -0
- package/dist/style/Dropdown.mjs +8 -0
- package/dist/style/Form.cjs +7 -0
- package/dist/style/Form.mjs +7 -0
- package/dist/style/Input.cjs +7 -0
- package/dist/style/Input.mjs +7 -0
- package/dist/style/Loading.cjs +8 -0
- package/dist/style/Loading.mjs +8 -0
- package/dist/style/MessageBox.cjs +9 -0
- package/dist/style/MessageBox.mjs +9 -0
- package/dist/style/Modal.cjs +8 -0
- package/dist/style/Modal.mjs +8 -0
- package/dist/style/NumberInput.cjs +7 -0
- package/dist/style/NumberInput.mjs +7 -0
- package/dist/style/Pagination.cjs +7 -0
- package/dist/style/Pagination.mjs +7 -0
- package/dist/style/Progress.cjs +7 -0
- package/dist/style/Progress.mjs +7 -0
- package/dist/style/Radio.cjs +7 -0
- package/dist/style/Radio.mjs +7 -0
- package/dist/style/Row.cjs +7 -0
- package/dist/style/Row.mjs +7 -0
- package/dist/style/Scrollbar.cjs +7 -0
- package/dist/style/Scrollbar.mjs +7 -0
- package/dist/style/Select.cjs +8 -0
- package/dist/style/Select.mjs +8 -0
- package/dist/style/Sidebar.cjs +7 -0
- package/dist/style/Sidebar.mjs +7 -0
- package/dist/style/Slider.cjs +7 -0
- package/dist/style/Slider.mjs +7 -0
- package/dist/style/Space.cjs +7 -0
- package/dist/style/Space.mjs +7 -0
- package/dist/style/Switch.cjs +7 -0
- package/dist/style/Switch.mjs +7 -0
- package/dist/style/Table.cjs +9 -0
- package/dist/style/Table.mjs +9 -0
- package/dist/style/Tabs.cjs +7 -0
- package/dist/style/Tabs.mjs +7 -0
- package/dist/style/Tag.cjs +7 -0
- package/dist/style/Tag.mjs +7 -0
- package/dist/style/Textarea.cjs +7 -0
- package/dist/style/Textarea.mjs +7 -0
- package/dist/style/TimePicker.cjs +8 -0
- package/dist/style/TimePicker.mjs +8 -0
- package/dist/style/Timeline.cjs +7 -0
- package/dist/style/Timeline.mjs +7 -0
- package/dist/style/Tooltip.cjs +8 -0
- package/dist/style/Tooltip.mjs +8 -0
- package/dist/style/Transition.cjs +6 -0
- package/dist/style/Transition.mjs +6 -0
- package/dist/time-wheel-BaCcA9nk.cjs +1 -0
- package/dist/time-wheel-BtvYZI6H.js +291 -0
- package/dist/types/Alert/Alert.d.cts +3 -0
- package/dist/types/Alert/Alert.d.ts +3 -0
- package/dist/types/Alert/index.d.cts +5 -0
- package/dist/types/Alert/index.d.ts +5 -0
- package/dist/types/Alert/type.d.cts +21 -0
- package/dist/types/Alert/type.d.ts +21 -0
- package/dist/types/Anchor/Anchor.d.cts +3 -0
- package/dist/types/Anchor/Anchor.d.ts +3 -0
- package/dist/types/Anchor/index.d.cts +5 -0
- package/dist/types/Anchor/index.d.ts +5 -0
- package/dist/types/Anchor/type.d.cts +42 -0
- package/dist/types/Anchor/type.d.ts +42 -0
- package/dist/types/Announcement/Announcement.d.cts +3 -0
- package/dist/types/Announcement/Announcement.d.ts +3 -0
- package/dist/types/Announcement/host.d.cts +12 -0
- package/dist/types/Announcement/host.d.ts +12 -0
- package/dist/types/Announcement/index.d.cts +5 -0
- package/dist/types/Announcement/index.d.ts +5 -0
- package/dist/types/Announcement/type.d.cts +63 -0
- package/dist/types/Announcement/type.d.ts +63 -0
- package/dist/types/Button/Button.d.cts +23 -0
- package/dist/types/Button/Button.d.ts +23 -0
- package/dist/types/Button/ButtonGroup.d.cts +14 -0
- package/dist/types/Button/ButtonGroup.d.ts +14 -0
- package/dist/types/Button/context.d.cts +15 -0
- package/dist/types/Button/context.d.ts +15 -0
- package/dist/types/Button/index.d.cts +7 -0
- package/dist/types/Button/index.d.ts +7 -0
- package/dist/types/Button/type.d.cts +66 -0
- package/dist/types/Button/type.d.ts +66 -0
- package/dist/types/Card/Card.d.cts +15 -0
- package/dist/types/Card/Card.d.ts +15 -0
- package/dist/types/Card/index.d.cts +5 -0
- package/dist/types/Card/index.d.ts +5 -0
- package/dist/types/Card/type.d.cts +40 -0
- package/dist/types/Card/type.d.ts +40 -0
- package/dist/types/Checkbox/Checkbox.d.cts +3 -0
- package/dist/types/Checkbox/Checkbox.d.ts +3 -0
- package/dist/types/Checkbox/CheckboxGroup.d.cts +3 -0
- package/dist/types/Checkbox/CheckboxGroup.d.ts +3 -0
- package/dist/types/Checkbox/context.d.cts +19 -0
- package/dist/types/Checkbox/context.d.ts +19 -0
- package/dist/types/Checkbox/index.d.cts +7 -0
- package/dist/types/Checkbox/index.d.ts +7 -0
- package/dist/types/Checkbox/type.d.cts +55 -0
- package/dist/types/Checkbox/type.d.ts +55 -0
- package/dist/types/Col/Col.d.cts +3 -0
- package/dist/types/Col/Col.d.ts +3 -0
- package/dist/types/Col/index.d.cts +5 -0
- package/dist/types/Col/index.d.ts +5 -0
- package/dist/types/Col/type.d.cts +41 -0
- package/dist/types/Col/type.d.ts +41 -0
- package/dist/types/Cron/Cron.d.cts +3 -0
- package/dist/types/Cron/Cron.d.ts +3 -0
- package/dist/types/Cron/CronField.d.cts +14 -0
- package/dist/types/Cron/CronField.d.ts +14 -0
- package/dist/types/Cron/CronPanel.d.cts +27 -0
- package/dist/types/Cron/CronPanel.d.ts +27 -0
- package/dist/types/Cron/describe.d.cts +10 -0
- package/dist/types/Cron/describe.d.ts +10 -0
- package/dist/types/Cron/expression.d.cts +188 -0
- package/dist/types/Cron/expression.d.ts +188 -0
- package/dist/types/Cron/index.d.cts +5 -0
- package/dist/types/Cron/index.d.ts +5 -0
- package/dist/types/Cron/schedule.d.cts +15 -0
- package/dist/types/Cron/schedule.d.ts +15 -0
- package/dist/types/Cron/type.d.cts +65 -0
- package/dist/types/Cron/type.d.ts +65 -0
- package/dist/types/DatePicker/DatePicker.d.cts +3 -0
- package/dist/types/DatePicker/DatePicker.d.ts +3 -0
- package/dist/types/DatePicker/index.d.cts +5 -0
- package/dist/types/DatePicker/index.d.ts +5 -0
- package/dist/types/DatePicker/type.d.cts +89 -0
- package/dist/types/DatePicker/type.d.ts +89 -0
- package/dist/types/DateTimePicker/DateTimePicker.d.cts +3 -0
- package/dist/types/DateTimePicker/DateTimePicker.d.ts +3 -0
- package/dist/types/DateTimePicker/index.d.cts +5 -0
- package/dist/types/DateTimePicker/index.d.ts +5 -0
- package/dist/types/DateTimePicker/type.d.cts +64 -0
- package/dist/types/DateTimePicker/type.d.ts +64 -0
- package/dist/types/Divider/Divider.d.cts +3 -0
- package/dist/types/Divider/Divider.d.ts +3 -0
- package/dist/types/Divider/index.d.cts +5 -0
- package/dist/types/Divider/index.d.ts +5 -0
- package/dist/types/Divider/type.d.cts +20 -0
- package/dist/types/Divider/type.d.ts +20 -0
- package/dist/types/Drawer/Drawer.d.cts +3 -0
- package/dist/types/Drawer/Drawer.d.ts +3 -0
- package/dist/types/Drawer/index.d.cts +5 -0
- package/dist/types/Drawer/index.d.ts +5 -0
- package/dist/types/Drawer/type.d.cts +46 -0
- package/dist/types/Drawer/type.d.ts +46 -0
- package/dist/types/Dropdown/Dropdown.d.cts +3 -0
- package/dist/types/Dropdown/Dropdown.d.ts +3 -0
- package/dist/types/Dropdown/index.d.cts +5 -0
- package/dist/types/Dropdown/index.d.ts +5 -0
- package/dist/types/Dropdown/type.d.cts +67 -0
- package/dist/types/Dropdown/type.d.ts +67 -0
- package/dist/types/Form/Form.d.cts +3 -0
- package/dist/types/Form/Form.d.ts +3 -0
- package/dist/types/Form/FormItem.d.cts +3 -0
- package/dist/types/Form/FormItem.d.ts +3 -0
- package/dist/types/Form/context.d.cts +39 -0
- package/dist/types/Form/context.d.ts +39 -0
- package/dist/types/Form/index.d.cts +8 -0
- package/dist/types/Form/index.d.ts +8 -0
- package/dist/types/Form/type.d.cts +119 -0
- package/dist/types/Form/type.d.ts +119 -0
- package/dist/types/Input/Input.d.cts +3 -0
- package/dist/types/Input/Input.d.ts +3 -0
- package/dist/types/Input/index.d.cts +5 -0
- package/dist/types/Input/index.d.ts +5 -0
- package/dist/types/Input/type.d.cts +43 -0
- package/dist/types/Input/type.d.ts +43 -0
- package/dist/types/Loading/Loading.d.cts +3 -0
- package/dist/types/Loading/Loading.d.ts +3 -0
- package/dist/types/Loading/index.d.cts +5 -0
- package/dist/types/Loading/index.d.ts +5 -0
- package/dist/types/Loading/type.d.cts +18 -0
- package/dist/types/Loading/type.d.ts +18 -0
- package/dist/types/MessageBox/MessageBox.d.cts +3 -0
- package/dist/types/MessageBox/MessageBox.d.ts +3 -0
- package/dist/types/MessageBox/index.d.cts +5 -0
- package/dist/types/MessageBox/index.d.ts +5 -0
- package/dist/types/MessageBox/service.d.cts +12 -0
- package/dist/types/MessageBox/service.d.ts +12 -0
- package/dist/types/MessageBox/type.d.cts +62 -0
- package/dist/types/MessageBox/type.d.ts +62 -0
- package/dist/types/Modal/Modal.d.cts +3 -0
- package/dist/types/Modal/Modal.d.ts +3 -0
- package/dist/types/Modal/index.d.cts +5 -0
- package/dist/types/Modal/index.d.ts +5 -0
- package/dist/types/Modal/type.d.cts +50 -0
- package/dist/types/Modal/type.d.ts +50 -0
- package/dist/types/NumberInput/NumberInput.d.cts +3 -0
- package/dist/types/NumberInput/NumberInput.d.ts +3 -0
- package/dist/types/NumberInput/index.d.cts +5 -0
- package/dist/types/NumberInput/index.d.ts +5 -0
- package/dist/types/NumberInput/type.d.cts +40 -0
- package/dist/types/NumberInput/type.d.ts +40 -0
- package/dist/types/Pagination/Pagination.d.cts +3 -0
- package/dist/types/Pagination/Pagination.d.ts +3 -0
- package/dist/types/Pagination/index.d.cts +5 -0
- package/dist/types/Pagination/index.d.ts +5 -0
- package/dist/types/Pagination/type.d.cts +38 -0
- package/dist/types/Pagination/type.d.ts +38 -0
- package/dist/types/Progress/Progress.d.cts +3 -0
- package/dist/types/Progress/Progress.d.ts +3 -0
- package/dist/types/Progress/index.d.cts +5 -0
- package/dist/types/Progress/index.d.ts +5 -0
- package/dist/types/Progress/type.d.cts +30 -0
- package/dist/types/Progress/type.d.ts +30 -0
- package/dist/types/Radio/Radio.d.cts +3 -0
- package/dist/types/Radio/Radio.d.ts +3 -0
- package/dist/types/Radio/RadioGroup.d.cts +3 -0
- package/dist/types/Radio/RadioGroup.d.ts +3 -0
- package/dist/types/Radio/context.d.cts +19 -0
- package/dist/types/Radio/context.d.ts +19 -0
- package/dist/types/Radio/index.d.cts +7 -0
- package/dist/types/Radio/index.d.ts +7 -0
- package/dist/types/Radio/type.d.cts +53 -0
- package/dist/types/Radio/type.d.ts +53 -0
- package/dist/types/Row/Row.d.cts +8 -0
- package/dist/types/Row/Row.d.ts +8 -0
- package/dist/types/Row/index.d.cts +5 -0
- package/dist/types/Row/index.d.ts +5 -0
- package/dist/types/Row/type.d.cts +20 -0
- package/dist/types/Row/type.d.ts +20 -0
- package/dist/types/Scrollbar/Scrollbar.d.cts +3 -0
- package/dist/types/Scrollbar/Scrollbar.d.ts +3 -0
- package/dist/types/Scrollbar/index.d.cts +5 -0
- package/dist/types/Scrollbar/index.d.ts +5 -0
- package/dist/types/Scrollbar/type.d.cts +60 -0
- package/dist/types/Scrollbar/type.d.ts +60 -0
- package/dist/types/Select/Select.d.cts +3 -0
- package/dist/types/Select/Select.d.ts +3 -0
- package/dist/types/Select/index.d.cts +5 -0
- package/dist/types/Select/index.d.ts +5 -0
- package/dist/types/Select/type.d.cts +91 -0
- package/dist/types/Select/type.d.ts +91 -0
- package/dist/types/Sidebar/Sidebar.d.cts +3 -0
- package/dist/types/Sidebar/Sidebar.d.ts +3 -0
- package/dist/types/Sidebar/index.d.cts +5 -0
- package/dist/types/Sidebar/index.d.ts +5 -0
- package/dist/types/Sidebar/type.d.cts +54 -0
- package/dist/types/Sidebar/type.d.ts +54 -0
- package/dist/types/Slider/Slider.d.cts +3 -0
- package/dist/types/Slider/Slider.d.ts +3 -0
- package/dist/types/Slider/index.d.cts +5 -0
- package/dist/types/Slider/index.d.ts +5 -0
- package/dist/types/Slider/type.d.cts +47 -0
- package/dist/types/Slider/type.d.ts +47 -0
- package/dist/types/Space/Space.d.cts +3 -0
- package/dist/types/Space/Space.d.ts +3 -0
- package/dist/types/Space/index.d.cts +5 -0
- package/dist/types/Space/index.d.ts +5 -0
- package/dist/types/Space/type.d.cts +28 -0
- package/dist/types/Space/type.d.ts +28 -0
- package/dist/types/Switch/Switch.d.cts +3 -0
- package/dist/types/Switch/Switch.d.ts +3 -0
- package/dist/types/Switch/index.d.cts +5 -0
- package/dist/types/Switch/index.d.ts +5 -0
- package/dist/types/Switch/type.d.cts +28 -0
- package/dist/types/Switch/type.d.ts +28 -0
- package/dist/types/Table/Table.d.cts +8 -0
- package/dist/types/Table/Table.d.ts +8 -0
- package/dist/types/Table/index.d.cts +8 -0
- package/dist/types/Table/index.d.ts +8 -0
- package/dist/types/Table/type.d.cts +135 -0
- package/dist/types/Table/type.d.ts +135 -0
- package/dist/types/Tabs/Tabs.d.cts +3 -0
- package/dist/types/Tabs/Tabs.d.ts +3 -0
- package/dist/types/Tabs/index.d.cts +5 -0
- package/dist/types/Tabs/index.d.ts +5 -0
- package/dist/types/Tabs/type.d.cts +45 -0
- package/dist/types/Tabs/type.d.ts +45 -0
- package/dist/types/Tag/Tag.d.cts +3 -0
- package/dist/types/Tag/Tag.d.ts +3 -0
- package/dist/types/Tag/index.d.cts +5 -0
- package/dist/types/Tag/index.d.ts +5 -0
- package/dist/types/Tag/type.d.cts +24 -0
- package/dist/types/Tag/type.d.ts +24 -0
- package/dist/types/Textarea/Textarea.d.cts +3 -0
- package/dist/types/Textarea/Textarea.d.ts +3 -0
- package/dist/types/Textarea/index.d.cts +5 -0
- package/dist/types/Textarea/index.d.ts +5 -0
- package/dist/types/Textarea/type.d.cts +32 -0
- package/dist/types/Textarea/type.d.ts +32 -0
- package/dist/types/TimePicker/TimePicker.d.cts +3 -0
- package/dist/types/TimePicker/TimePicker.d.ts +3 -0
- package/dist/types/TimePicker/index.d.cts +5 -0
- package/dist/types/TimePicker/index.d.ts +5 -0
- package/dist/types/TimePicker/type.d.cts +55 -0
- package/dist/types/TimePicker/type.d.ts +55 -0
- package/dist/types/Timeline/Timeline.d.cts +3 -0
- package/dist/types/Timeline/Timeline.d.ts +3 -0
- package/dist/types/Timeline/index.d.cts +5 -0
- package/dist/types/Timeline/index.d.ts +5 -0
- package/dist/types/Timeline/type.d.cts +49 -0
- package/dist/types/Timeline/type.d.ts +49 -0
- package/dist/types/Tooltip/Tooltip.d.cts +3 -0
- package/dist/types/Tooltip/Tooltip.d.ts +3 -0
- package/dist/types/Tooltip/index.d.cts +5 -0
- package/dist/types/Tooltip/index.d.ts +5 -0
- package/dist/types/Tooltip/type.d.cts +40 -0
- package/dist/types/Tooltip/type.d.ts +40 -0
- package/dist/types/Transition/Transition.d.cts +6 -0
- package/dist/types/Transition/Transition.d.ts +6 -0
- package/dist/types/Transition/index.d.cts +8 -0
- package/dist/types/Transition/index.d.ts +8 -0
- package/dist/types/Transition/type.d.cts +22 -0
- package/dist/types/Transition/type.d.ts +22 -0
- package/dist/types/_shared/client.d.cts +9 -0
- package/dist/types/_shared/client.d.ts +9 -0
- package/dist/types/_shared/date-picker.d.cts +17 -0
- package/dist/types/_shared/date-picker.d.ts +17 -0
- package/dist/types/_shared/date.d.cts +55 -0
- package/dist/types/_shared/date.d.ts +55 -0
- package/dist/types/_shared/dialog-shell.d.cts +59 -0
- package/dist/types/_shared/dialog-shell.d.ts +59 -0
- package/dist/types/_shared/dialog.d.cts +20 -0
- package/dist/types/_shared/dialog.d.ts +20 -0
- package/dist/types/_shared/effect.d.cts +8 -0
- package/dist/types/_shared/effect.d.ts +8 -0
- package/dist/types/_shared/floating.d.cts +88 -0
- package/dist/types/_shared/floating.d.ts +88 -0
- package/dist/types/_shared/focus.d.cts +33 -0
- package/dist/types/_shared/focus.d.ts +33 -0
- package/dist/types/_shared/icon.d.cts +15 -0
- package/dist/types/_shared/icon.d.ts +15 -0
- package/dist/types/_shared/id.d.cts +10 -0
- package/dist/types/_shared/id.d.ts +10 -0
- package/dist/types/_shared/number.d.cts +22 -0
- package/dist/types/_shared/number.d.ts +22 -0
- package/dist/types/_shared/refs.d.cts +18 -0
- package/dist/types/_shared/refs.d.ts +18 -0
- package/dist/types/_shared/state.d.cts +15 -0
- package/dist/types/_shared/state.d.ts +15 -0
- package/dist/types/_shared/time-constraints.d.cts +31 -0
- package/dist/types/_shared/time-constraints.d.ts +31 -0
- package/dist/types/_shared/time-wheel.d.cts +34 -0
- package/dist/types/_shared/time-wheel.d.ts +34 -0
- package/dist/types/_vars.d.cts +7 -0
- package/dist/types/_vars.d.ts +7 -0
- package/dist/types/global.d.cts +86 -0
- package/dist/types/global.d.ts +86 -0
- package/dist/types/index.d.cts +42 -0
- package/dist/types/index.d.ts +42 -0
- package/dist/types/register.d.cts +1 -0
- package/dist/types/register.d.ts +1 -0
- package/dist/types/registry.d.cts +66 -0
- package/dist/types/registry.d.ts +66 -0
- package/dist/types/style.d.cts +7 -0
- package/dist/types/style.d.ts +7 -0
- package/package.json +165 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./effect-BpNxm_06.cjs"),t=require("./id-CF0zOP1G.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=/YYYY|MM|DD|HH|mm|ss/g,a=(e,t=2)=>String(e).padStart(t,`0`),o=e=>new Date(e.getTime()),s=e=>e instanceof Date&&!Number.isNaN(e.getTime()),c=e=>{let t=o(e);return t.setHours(0,0,0,0),t},l=e=>{let t=o(e);return t.setDate(1),t.setHours(0,0,0,0),t},u=(e,t)=>{let n=o(e);return n.setDate(n.getDate()+t),n},d=(e,t)=>{let n=o(e),r=n.getDate();n.setDate(1),n.setMonth(n.getMonth()+t);let i=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(r,i)),n},f=(e,t)=>new Date(e,t+1,0).getDate(),p=(e,t)=>e.getTime()-t.getTime(),m=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),h=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth(),g=(e,t)=>{let n={YYYY:a(e.getFullYear(),4),MM:a(e.getMonth()+1),DD:a(e.getDate()),HH:a(e.getHours()),mm:a(e.getMinutes()),ss:a(e.getSeconds())};return t.replace(i,e=>n[e])},_=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),v=(e,t)=>{let n=[],r=0,a=``;t.replace(i,(e,i)=>(a+=_(t.slice(r,i)),n.push(e),a+=e===`YYYY`?`(\\d{4})`:`(\\d{2})`,r=i+e.length,e)),a+=_(t.slice(r));let o=RegExp(`^${a}$`).exec(e);if(!o)return null;let s={};n.forEach((e,t)=>{s[e]=Number(o[t+1])});let c=new Date,l=s.YYYY??c.getFullYear(),u=s.MM??c.getMonth()+1,d=s.DD??1,p=s.HH??0,m=s.mm??0,h=s.ss??0;if(u<1||u>12||d<1||d>f(l,u-1)||p>23||m>59||h>59)return null;let g=new Date(l,u-1,d,p,m,h,0);return g.getFullYear()===l&&g.getMonth()===u-1&&g.getDate()===d&&g.getHours()===p&&g.getMinutes()===m&&g.getSeconds()===h?g:null},y=(e,t)=>e instanceof Date?s(e)?o(e):null:typeof e==`string`?v(e,t):null,b=e=>{let t=l(e),n=t.getDay(),r=[];for(let e=0;e<42;e+=1)r.push(u(t,e-n));return r},x=(e,t,n,r)=>{let i=o(e);return i.setHours(t,n,r,0),i},S=e=>{let t=/^(\d{2}):(\d{2}):(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]);return n>23||r>59||i>59?null:n*3600+r*60+i},C=e=>{let t=Math.min(Math.max(Math.floor(e),0),86399),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return`${a(n)}:${a(r)}:${a(i)}`},w=(e,t,n,r)=>{let i=Math.max(0,Math.ceil(e)),a=Math.min(86399,Math.floor(t));if(i>a)return null;let o=Math.min(Math.max(Math.floor(n),i),a),s=Math.max(o-i,a-o);for(let e=0;e<=s;e+=1){let t=o+e;if(t<=a&&!r(C(t)))return t;let n=o-e;if(e>0&&n>=i&&!r(C(n)))return n}return null},T=(e,t=new Date)=>{let n=S(e);if(n===null)return null;let r=o(t);return r.setHours(Math.floor(n/3600),Math.floor(n%3600/60),n%60,0),r},E=(e,t)=>{let n=S(e);return n===null||t.minSeconds!==null&&n<t.minSeconds||t.maxSeconds!==null&&n>t.maxSeconds?!0:t.disabledTime?.(e)??!1},D=(e,t,n,r)=>w(Math.max(e,r.minSeconds??0),Math.min(t,r.maxSeconds??86399),n,e=>E(e,r)),O=(e,t,n)=>{let r=e===`hours`?t*3600+n.minutes*60+n.seconds:e===`minutes`?n.hours*3600+t*60+n.seconds:n.hours*3600+n.minutes*60+t,i=e===`hours`?t*3600:e===`minutes`?n.hours*3600+t*60:r;return{start:i,end:e===`hours`?i+3599:e===`minutes`?i+59:r,preferred:r}},k=(e,t,n,r)=>{let{start:i,end:a,preferred:o}=O(e,t,n);return r(i,a,o)===null},A=(e,t,n,r)=>{let{start:i,end:a,preferred:o}=O(e,t,n),s=r(i,a,o);return s===null?null:C(s)},j=36,M=5,N=5,P=Math.floor(N/2),F=120,I=[{part:`hours`,label:`小时`,shortLabel:`时`,optionCount:24},{part:`minutes`,label:`分钟`,shortLabel:`分`,optionCount:60},{part:`seconds`,label:`秒`,shortLabel:`秒`,optionCount:60}],L=(e,t)=>(e%t+t)%t,R=(e,t)=>P*t+e,z=({id:t,part:i,label:o,shortLabel:s,value:c,optionCount:l,itemHeight:u,disabled:d,isOptionDisabled:f,onChange:p,onMoveFocus:m,setListElement:h})=>{let g=(0,n.useRef)(null),_=(0,n.useRef)(null),v=(0,n.useRef)(0),y=(0,n.useRef)(null),b=(0,n.useRef)(1),x=(0,n.useRef)(null),S=(0,n.useRef)(c),[C,w]=(0,n.useState)(c),T=(0,n.useMemo)(()=>Array.from({length:l},(e,t)=>f(i,t)),[f,l,i]),E=T.some(e=>!e),D=d||!E,O=(0,n.useCallback)(e=>{g.current=e,h(i,e)},[i,h]),k=(0,n.useCallback)(e=>{let t=g.current;if(!t)return;let n=R(e,l)*u;v.current=n,y.current=n,t.scrollTop=n},[u,l]),A=(0,n.useCallback)((e,t)=>{for(let n=0;n<l;n+=1){let r=L(e+n*t,l);if(!T[r])return r}return null},[T,l]),j=(0,n.useCallback)(()=>{S.current=null},[]),M=(0,n.useCallback)(e=>{w(e),k(e),e!==c&&e!==S.current&&(S.current=e,p(i,e))},[p,i,k,c]),I=(0,n.useCallback)(()=>{let e=g.current;if(!e||D)return;let t=L(Math.round(e.scrollTop/u),l),n=A(t,b.current);if(n===null){k(c),w(c);return}M(n)},[D,M,A,u,l,k,c]);e.t(()=>{_.current!==null&&window.clearTimeout(_.current),S.current=c,w(c),k(c)},[k,c]),(0,n.useEffect)(()=>()=>{_.current!==null&&window.clearTimeout(_.current)},[]);let z=e=>{let t=e.currentTarget.scrollTop,n=y.current;if(n!==null&&(y.current=null,Math.abs(t-n)<.5)){v.current=t,w(L(Math.round(t/u),l)),_.current!==null&&(window.clearTimeout(_.current),_.current=null);return}j(),t!==v.current&&(b.current=t>v.current?1:-1),v.current=t,w(L(Math.round(t/u),l)),_.current!==null&&window.clearTimeout(_.current),_.current=window.setTimeout(I,F)},B=e=>{e.pointerType===`touch`||e.button!==0||D||(j(),x.current={pointerId:e.pointerId,startY:e.clientY,startScrollTop:e.currentTarget.scrollTop},e.currentTarget.setPointerCapture?.(e.pointerId))},V=e=>{let t=x.current;!t||t.pointerId!==e.pointerId||(e.currentTarget.scrollTop=t.startScrollTop-(e.clientY-t.startY))},H=e=>{let t=x.current;!t||t.pointerId!==e.pointerId||(x.current=null,e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture?.(e.pointerId))};return(0,r.jsxs)(`div`,{className:`vl-time-wheel__column`,children:[(0,r.jsx)(`span`,{className:`vl-time-wheel__label`,"aria-hidden":`true`,children:s}),(0,r.jsxs)(`div`,{ref:O,className:`vl-time-wheel__list`,role:`listbox`,"aria-label":o,"aria-orientation":`vertical`,"aria-disabled":D||void 0,"aria-activedescendant":`${t}-option-${C}`,tabIndex:D?-1:0,onScroll:z,onPointerDown:B,onPointerMove:V,onPointerUp:H,onPointerCancel:H,onKeyDown:e=>{j();let t=null;if(e.key===`ArrowUp`)t=A(C-1,-1);else if(e.key===`ArrowDown`)t=A(C+1,1);else if(e.key===`Home`)t=T.findIndex(e=>!e);else if(e.key===`End`){for(let e=l-1;e>=0;--e)if(!T[e]){t=e;break}}else if(e.key===`ArrowLeft`||e.key===`ArrowRight`){e.preventDefault(),m(i,e.key===`ArrowLeft`?-1:1);return}else if(e.key===`Enter`||e.key===` `){e.preventDefault();let t=A(C,b.current);t!==null&&M(t);return}else return;e.preventDefault(),t!==null&&t>=0&&M(t)},children:[(0,r.jsx)(`div`,{className:`vl-time-wheel__spacer`,"aria-hidden":`true`}),Array.from({length:N*l},(e,n)=>{let o=L(n,l),s=Math.floor(n/l)===P,c=T[o];return(0,r.jsx)(`div`,{id:s?`${t}-option-${o}`:void 0,className:[`vl-time-wheel__option`,C===o?`is-active`:``,c?`is-disabled`:``].filter(Boolean).join(` `),role:s?`option`:void 0,"aria-selected":s?C===o:void 0,"aria-disabled":s?c:void 0,"aria-hidden":!s||void 0,"data-part":i,"data-value":o,"data-wheel-index":n,onClick:()=>{D||c||(j(),M(o))},children:a(o)},n)}),(0,r.jsx)(`div`,{className:`vl-time-wheel__spacer`,"aria-hidden":`true`})]})]})},B=({value:e,disabled:i=!1,ariaLabel:a=`时间`,visibleItemCount:o=M,itemHeight:s=j,isOptionDisabled:c,onChange:l})=>{let u=t.t(`vl-time-wheel`),d=(0,n.useRef)({}),f=(o-1)/2,p=(0,n.useCallback)((e,t)=>c?.(e,t)??!1,[c]),m=(0,n.useCallback)((e,t)=>{d.current[e]=t},[]),h=(0,n.useCallback)((e,t)=>{let n=I[I.findIndex(t=>t.part===e)+t]?.part;n&&d.current[n]?.focus()},[]);return(0,r.jsx)(`div`,{className:`vl-time-wheel${i?` is-disabled`:``}`,role:`group`,"aria-label":a,style:{"--vl-time-wheel-visible-items":o,"--vl-time-wheel-edge-items":f,"--vl-time-wheel-item-height":`${s}px`},children:(0,r.jsx)(`div`,{className:`vl-time-wheel__columns`,children:I.map(({part:t,label:n,shortLabel:a,optionCount:o})=>(0,r.jsx)(z,{id:`${u}-${t}`,part:t,label:n,shortLabel:a,value:e[t],optionCount:o,itemHeight:s,disabled:i,isOptionDisabled:p,onChange:l,onMoveFocus:h,setListElement:m},t))})})};Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return S}});
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { t as e } from "./effect-nifYL_rH.js";
|
|
2
|
+
import { t } from "./id-CHixuHb7.js";
|
|
3
|
+
import { useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
|
|
4
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
5
|
+
//#region components/_shared/date.ts
|
|
6
|
+
var l = /YYYY|MM|DD|HH|mm|ss/g, u = (e, t = 2) => String(e).padStart(t, "0"), d = (e) => new Date(e.getTime()), f = (e) => e instanceof Date && !Number.isNaN(e.getTime()), p = (e) => {
|
|
7
|
+
let t = d(e);
|
|
8
|
+
return t.setHours(0, 0, 0, 0), t;
|
|
9
|
+
}, m = (e) => {
|
|
10
|
+
let t = d(e);
|
|
11
|
+
return t.setDate(1), t.setHours(0, 0, 0, 0), t;
|
|
12
|
+
}, h = (e, t) => {
|
|
13
|
+
let n = d(e);
|
|
14
|
+
return n.setDate(n.getDate() + t), n;
|
|
15
|
+
}, g = (e, t) => {
|
|
16
|
+
let n = d(e), r = n.getDate();
|
|
17
|
+
n.setDate(1), n.setMonth(n.getMonth() + t);
|
|
18
|
+
let i = new Date(n.getFullYear(), n.getMonth() + 1, 0).getDate();
|
|
19
|
+
return n.setDate(Math.min(r, i)), n;
|
|
20
|
+
}, _ = (e, t) => new Date(e, t + 1, 0).getDate(), v = (e, t) => e.getTime() - t.getTime(), y = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(), b = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth(), x = (e, t) => {
|
|
21
|
+
let n = {
|
|
22
|
+
YYYY: u(e.getFullYear(), 4),
|
|
23
|
+
MM: u(e.getMonth() + 1),
|
|
24
|
+
DD: u(e.getDate()),
|
|
25
|
+
HH: u(e.getHours()),
|
|
26
|
+
mm: u(e.getMinutes()),
|
|
27
|
+
ss: u(e.getSeconds())
|
|
28
|
+
};
|
|
29
|
+
return t.replace(l, (e) => n[e]);
|
|
30
|
+
}, S = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), C = (e, t) => {
|
|
31
|
+
let n = [], r = 0, i = "";
|
|
32
|
+
t.replace(l, (e, a) => (i += S(t.slice(r, a)), n.push(e), i += e === "YYYY" ? "(\\d{4})" : "(\\d{2})", r = a + e.length, e)), i += S(t.slice(r));
|
|
33
|
+
let a = RegExp(`^${i}$`).exec(e);
|
|
34
|
+
if (!a) return null;
|
|
35
|
+
let o = {};
|
|
36
|
+
n.forEach((e, t) => {
|
|
37
|
+
o[e] = Number(a[t + 1]);
|
|
38
|
+
});
|
|
39
|
+
let s = /* @__PURE__ */ new Date(), c = o.YYYY ?? s.getFullYear(), u = o.MM ?? s.getMonth() + 1, d = o.DD ?? 1, f = o.HH ?? 0, p = o.mm ?? 0, m = o.ss ?? 0;
|
|
40
|
+
if (u < 1 || u > 12 || d < 1 || d > _(c, u - 1) || f > 23 || p > 59 || m > 59) return null;
|
|
41
|
+
let h = new Date(c, u - 1, d, f, p, m, 0);
|
|
42
|
+
return h.getFullYear() === c && h.getMonth() === u - 1 && h.getDate() === d && h.getHours() === f && h.getMinutes() === p && h.getSeconds() === m ? h : null;
|
|
43
|
+
}, w = (e, t) => e instanceof Date ? f(e) ? d(e) : null : typeof e == "string" ? C(e, t) : null, T = (e) => {
|
|
44
|
+
let t = m(e), n = t.getDay(), r = [];
|
|
45
|
+
for (let e = 0; e < 42; e += 1) r.push(h(t, e - n));
|
|
46
|
+
return r;
|
|
47
|
+
}, E = (e, t, n, r) => {
|
|
48
|
+
let i = d(e);
|
|
49
|
+
return i.setHours(t, n, r, 0), i;
|
|
50
|
+
}, D = (e) => {
|
|
51
|
+
let t = /^(\d{2}):(\d{2}):(\d{2})$/.exec(e);
|
|
52
|
+
if (!t) return null;
|
|
53
|
+
let n = Number(t[1]), r = Number(t[2]), i = Number(t[3]);
|
|
54
|
+
return n > 23 || r > 59 || i > 59 ? null : n * 3600 + r * 60 + i;
|
|
55
|
+
}, O = (e) => {
|
|
56
|
+
let t = Math.min(Math.max(Math.floor(e), 0), 86399), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
|
|
57
|
+
return `${u(n)}:${u(r)}:${u(i)}`;
|
|
58
|
+
}, k = (e, t, n, r) => {
|
|
59
|
+
let i = Math.max(0, Math.ceil(e)), a = Math.min(86399, Math.floor(t));
|
|
60
|
+
if (i > a) return null;
|
|
61
|
+
let o = Math.min(Math.max(Math.floor(n), i), a), s = Math.max(o - i, a - o);
|
|
62
|
+
for (let e = 0; e <= s; e += 1) {
|
|
63
|
+
let t = o + e;
|
|
64
|
+
if (t <= a && !r(O(t))) return t;
|
|
65
|
+
let n = o - e;
|
|
66
|
+
if (e > 0 && n >= i && !r(O(n))) return n;
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
}, A = (e, t = /* @__PURE__ */ new Date()) => {
|
|
70
|
+
let n = D(e);
|
|
71
|
+
if (n === null) return null;
|
|
72
|
+
let r = d(t);
|
|
73
|
+
return r.setHours(Math.floor(n / 3600), Math.floor(n % 3600 / 60), n % 60, 0), r;
|
|
74
|
+
}, j = (e, t) => {
|
|
75
|
+
let n = D(e);
|
|
76
|
+
return n === null || t.minSeconds !== null && n < t.minSeconds || t.maxSeconds !== null && n > t.maxSeconds ? !0 : t.disabledTime?.(e) ?? !1;
|
|
77
|
+
}, M = (e, t, n, r) => k(Math.max(e, r.minSeconds ?? 0), Math.min(t, r.maxSeconds ?? 86399), n, (e) => j(e, r)), N = (e, t, n) => {
|
|
78
|
+
let r = e === "hours" ? t * 3600 + n.minutes * 60 + n.seconds : e === "minutes" ? n.hours * 3600 + t * 60 + n.seconds : n.hours * 3600 + n.minutes * 60 + t, i = e === "hours" ? t * 3600 : e === "minutes" ? n.hours * 3600 + t * 60 : r;
|
|
79
|
+
return {
|
|
80
|
+
start: i,
|
|
81
|
+
end: e === "hours" ? i + 3599 : e === "minutes" ? i + 59 : r,
|
|
82
|
+
preferred: r
|
|
83
|
+
};
|
|
84
|
+
}, P = (e, t, n, r) => {
|
|
85
|
+
let { start: i, end: a, preferred: o } = N(e, t, n);
|
|
86
|
+
return r(i, a, o) === null;
|
|
87
|
+
}, F = (e, t, n, r) => {
|
|
88
|
+
let { start: i, end: a, preferred: o } = N(e, t, n), s = r(i, a, o);
|
|
89
|
+
return s === null ? null : O(s);
|
|
90
|
+
}, I = 36, L = 5, R = 5, z = Math.floor(R / 2), B = 120, V = [
|
|
91
|
+
{
|
|
92
|
+
part: "hours",
|
|
93
|
+
label: "小时",
|
|
94
|
+
shortLabel: "时",
|
|
95
|
+
optionCount: 24
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
part: "minutes",
|
|
99
|
+
label: "分钟",
|
|
100
|
+
shortLabel: "分",
|
|
101
|
+
optionCount: 60
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
part: "seconds",
|
|
105
|
+
label: "秒",
|
|
106
|
+
shortLabel: "秒",
|
|
107
|
+
optionCount: 60
|
|
108
|
+
}
|
|
109
|
+
], H = (e, t) => (e % t + t) % t, U = (e, t) => z * t + e, W = ({ id: t, part: l, label: d, shortLabel: f, value: p, optionCount: m, itemHeight: h, disabled: g, isOptionDisabled: _, onChange: v, onMoveFocus: y, setListElement: b }) => {
|
|
110
|
+
let x = a(null), S = a(null), C = a(0), w = a(null), T = a(1), E = a(null), D = a(p), [O, k] = o(p), A = i(() => Array.from({ length: m }, (e, t) => _(l, t)), [
|
|
111
|
+
_,
|
|
112
|
+
m,
|
|
113
|
+
l
|
|
114
|
+
]), j = A.some((e) => !e), M = g || !j, N = n((e) => {
|
|
115
|
+
x.current = e, b(l, e);
|
|
116
|
+
}, [l, b]), P = n((e) => {
|
|
117
|
+
let t = x.current;
|
|
118
|
+
if (!t) return;
|
|
119
|
+
let n = U(e, m) * h;
|
|
120
|
+
C.current = n, w.current = n, t.scrollTop = n;
|
|
121
|
+
}, [h, m]), F = n((e, t) => {
|
|
122
|
+
for (let n = 0; n < m; n += 1) {
|
|
123
|
+
let r = H(e + n * t, m);
|
|
124
|
+
if (!A[r]) return r;
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
}, [A, m]), I = n(() => {
|
|
128
|
+
D.current = null;
|
|
129
|
+
}, []), L = n((e) => {
|
|
130
|
+
k(e), P(e), e !== p && e !== D.current && (D.current = e, v(l, e));
|
|
131
|
+
}, [
|
|
132
|
+
v,
|
|
133
|
+
l,
|
|
134
|
+
P,
|
|
135
|
+
p
|
|
136
|
+
]), V = n(() => {
|
|
137
|
+
let e = x.current;
|
|
138
|
+
if (!e || M) return;
|
|
139
|
+
let t = H(Math.round(e.scrollTop / h), m), n = F(t, T.current);
|
|
140
|
+
if (n === null) {
|
|
141
|
+
P(p), k(p);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
L(n);
|
|
145
|
+
}, [
|
|
146
|
+
M,
|
|
147
|
+
L,
|
|
148
|
+
F,
|
|
149
|
+
h,
|
|
150
|
+
m,
|
|
151
|
+
P,
|
|
152
|
+
p
|
|
153
|
+
]);
|
|
154
|
+
e(() => {
|
|
155
|
+
S.current !== null && window.clearTimeout(S.current), D.current = p, k(p), P(p);
|
|
156
|
+
}, [P, p]), r(() => () => {
|
|
157
|
+
S.current !== null && window.clearTimeout(S.current);
|
|
158
|
+
}, []);
|
|
159
|
+
let W = (e) => {
|
|
160
|
+
let t = e.currentTarget.scrollTop, n = w.current;
|
|
161
|
+
if (n !== null && (w.current = null, Math.abs(t - n) < .5)) {
|
|
162
|
+
C.current = t, k(H(Math.round(t / h), m)), S.current !== null && (window.clearTimeout(S.current), S.current = null);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
I(), t !== C.current && (T.current = t > C.current ? 1 : -1), C.current = t, k(H(Math.round(t / h), m)), S.current !== null && window.clearTimeout(S.current), S.current = window.setTimeout(V, B);
|
|
166
|
+
}, G = (e) => {
|
|
167
|
+
e.pointerType === "touch" || e.button !== 0 || M || (I(), E.current = {
|
|
168
|
+
pointerId: e.pointerId,
|
|
169
|
+
startY: e.clientY,
|
|
170
|
+
startScrollTop: e.currentTarget.scrollTop
|
|
171
|
+
}, e.currentTarget.setPointerCapture?.(e.pointerId));
|
|
172
|
+
}, K = (e) => {
|
|
173
|
+
let t = E.current;
|
|
174
|
+
!t || t.pointerId !== e.pointerId || (e.currentTarget.scrollTop = t.startScrollTop - (e.clientY - t.startY));
|
|
175
|
+
}, q = (e) => {
|
|
176
|
+
let t = E.current;
|
|
177
|
+
!t || t.pointerId !== e.pointerId || (E.current = null, e.currentTarget.hasPointerCapture?.(e.pointerId) && e.currentTarget.releasePointerCapture?.(e.pointerId));
|
|
178
|
+
};
|
|
179
|
+
return /* @__PURE__ */ c("div", {
|
|
180
|
+
className: "vl-time-wheel__column",
|
|
181
|
+
children: [/* @__PURE__ */ s("span", {
|
|
182
|
+
className: "vl-time-wheel__label",
|
|
183
|
+
"aria-hidden": "true",
|
|
184
|
+
children: f
|
|
185
|
+
}), /* @__PURE__ */ c("div", {
|
|
186
|
+
ref: N,
|
|
187
|
+
className: "vl-time-wheel__list",
|
|
188
|
+
role: "listbox",
|
|
189
|
+
"aria-label": d,
|
|
190
|
+
"aria-orientation": "vertical",
|
|
191
|
+
"aria-disabled": M || void 0,
|
|
192
|
+
"aria-activedescendant": `${t}-option-${O}`,
|
|
193
|
+
tabIndex: M ? -1 : 0,
|
|
194
|
+
onScroll: W,
|
|
195
|
+
onPointerDown: G,
|
|
196
|
+
onPointerMove: K,
|
|
197
|
+
onPointerUp: q,
|
|
198
|
+
onPointerCancel: q,
|
|
199
|
+
onKeyDown: (e) => {
|
|
200
|
+
I();
|
|
201
|
+
let t = null;
|
|
202
|
+
if (e.key === "ArrowUp") t = F(O - 1, -1);
|
|
203
|
+
else if (e.key === "ArrowDown") t = F(O + 1, 1);
|
|
204
|
+
else if (e.key === "Home") t = A.findIndex((e) => !e);
|
|
205
|
+
else if (e.key === "End") {
|
|
206
|
+
for (let e = m - 1; e >= 0; --e) if (!A[e]) {
|
|
207
|
+
t = e;
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
} else if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
211
|
+
e.preventDefault(), y(l, e.key === "ArrowLeft" ? -1 : 1);
|
|
212
|
+
return;
|
|
213
|
+
} else if (e.key === "Enter" || e.key === " ") {
|
|
214
|
+
e.preventDefault();
|
|
215
|
+
let t = F(O, T.current);
|
|
216
|
+
t !== null && L(t);
|
|
217
|
+
return;
|
|
218
|
+
} else return;
|
|
219
|
+
e.preventDefault(), t !== null && t >= 0 && L(t);
|
|
220
|
+
},
|
|
221
|
+
children: [
|
|
222
|
+
/* @__PURE__ */ s("div", {
|
|
223
|
+
className: "vl-time-wheel__spacer",
|
|
224
|
+
"aria-hidden": "true"
|
|
225
|
+
}),
|
|
226
|
+
Array.from({ length: R * m }, (e, n) => {
|
|
227
|
+
let r = H(n, m), i = Math.floor(n / m) === z, a = A[r];
|
|
228
|
+
return /* @__PURE__ */ s("div", {
|
|
229
|
+
id: i ? `${t}-option-${r}` : void 0,
|
|
230
|
+
className: [
|
|
231
|
+
"vl-time-wheel__option",
|
|
232
|
+
O === r ? "is-active" : "",
|
|
233
|
+
a ? "is-disabled" : ""
|
|
234
|
+
].filter(Boolean).join(" "),
|
|
235
|
+
role: i ? "option" : void 0,
|
|
236
|
+
"aria-selected": i ? O === r : void 0,
|
|
237
|
+
"aria-disabled": i ? a : void 0,
|
|
238
|
+
"aria-hidden": !i || void 0,
|
|
239
|
+
"data-part": l,
|
|
240
|
+
"data-value": r,
|
|
241
|
+
"data-wheel-index": n,
|
|
242
|
+
onClick: () => {
|
|
243
|
+
M || a || (I(), L(r));
|
|
244
|
+
},
|
|
245
|
+
children: u(r)
|
|
246
|
+
}, n);
|
|
247
|
+
}),
|
|
248
|
+
/* @__PURE__ */ s("div", {
|
|
249
|
+
className: "vl-time-wheel__spacer",
|
|
250
|
+
"aria-hidden": "true"
|
|
251
|
+
})
|
|
252
|
+
]
|
|
253
|
+
})]
|
|
254
|
+
});
|
|
255
|
+
}, G = ({ value: e, disabled: r = !1, ariaLabel: i = "时间", visibleItemCount: o = L, itemHeight: c = I, isOptionDisabled: l, onChange: u }) => {
|
|
256
|
+
let d = t("vl-time-wheel"), f = a({}), p = (o - 1) / 2, m = n((e, t) => l?.(e, t) ?? !1, [l]), h = n((e, t) => {
|
|
257
|
+
f.current[e] = t;
|
|
258
|
+
}, []), g = n((e, t) => {
|
|
259
|
+
let n = V[V.findIndex((t) => t.part === e) + t]?.part;
|
|
260
|
+
n && f.current[n]?.focus();
|
|
261
|
+
}, []);
|
|
262
|
+
return /* @__PURE__ */ s("div", {
|
|
263
|
+
className: `vl-time-wheel${r ? " is-disabled" : ""}`,
|
|
264
|
+
role: "group",
|
|
265
|
+
"aria-label": i,
|
|
266
|
+
style: {
|
|
267
|
+
"--vl-time-wheel-visible-items": o,
|
|
268
|
+
"--vl-time-wheel-edge-items": p,
|
|
269
|
+
"--vl-time-wheel-item-height": `${c}px`
|
|
270
|
+
},
|
|
271
|
+
children: /* @__PURE__ */ s("div", {
|
|
272
|
+
className: "vl-time-wheel__columns",
|
|
273
|
+
children: V.map(({ part: t, label: n, shortLabel: i, optionCount: a }) => /* @__PURE__ */ s(W, {
|
|
274
|
+
id: `${d}-${t}`,
|
|
275
|
+
part: t,
|
|
276
|
+
label: n,
|
|
277
|
+
shortLabel: i,
|
|
278
|
+
value: e[t],
|
|
279
|
+
optionCount: a,
|
|
280
|
+
itemHeight: c,
|
|
281
|
+
disabled: r,
|
|
282
|
+
isOptionDisabled: m,
|
|
283
|
+
onChange: u,
|
|
284
|
+
onMoveFocus: g,
|
|
285
|
+
setListElement: h
|
|
286
|
+
}, t))
|
|
287
|
+
})
|
|
288
|
+
});
|
|
289
|
+
};
|
|
290
|
+
//#endregion
|
|
291
|
+
export { m as _, P as a, w as b, g as c, x as d, T as f, p as g, E as h, j as i, d as l, b as m, M as n, F as o, y as p, N as r, h as s, G as t, v as u, A as v, D as y };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Alert from './Alert.cjs';
|
|
2
|
+
/** Alert 警告提示组件 */
|
|
3
|
+
export declare const VlAlert: import("react").ForwardRefExoticComponent<import("./type.cjs").AlertProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export type { AlertProps, AlertStatus, AlertRef } from './type.cjs';
|
|
5
|
+
export default Alert;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Alert from './Alert.js';
|
|
2
|
+
/** Alert 警告提示组件 */
|
|
3
|
+
export declare const VlAlert: import("react").ForwardRefExoticComponent<import("./type.js").AlertProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export type { AlertProps, AlertStatus, AlertRef } from './type.js';
|
|
5
|
+
export default Alert;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { HTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import type { DecorativeIcon } from '../_shared/icon.cjs';
|
|
3
|
+
/** 警告提示的语义状态类型 */
|
|
4
|
+
export type AlertStatus = 'info' | 'success' | 'warning' | 'error';
|
|
5
|
+
/**
|
|
6
|
+
* Alert 组件属性接口
|
|
7
|
+
*/
|
|
8
|
+
export interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
9
|
+
/** 提示的语义状态,决定背景色与默认图标,默认为 `info` */
|
|
10
|
+
status?: AlertStatus;
|
|
11
|
+
/** 提示标题,展示在正文上方 */
|
|
12
|
+
title?: ReactNode;
|
|
13
|
+
/** 自定义提示图标;传入 null 可隐藏默认状态图标 */
|
|
14
|
+
icon?: DecorativeIcon | null;
|
|
15
|
+
/** 是否显示关闭按钮,默认为 false */
|
|
16
|
+
closable?: boolean;
|
|
17
|
+
/** 点击关闭按钮时的回调函数 */
|
|
18
|
+
onClose?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
19
|
+
}
|
|
20
|
+
/** Alert 根 DOM 元素类型 */
|
|
21
|
+
export type AlertRef = HTMLDivElement;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { HTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import type { DecorativeIcon } from '../_shared/icon.js';
|
|
3
|
+
/** 警告提示的语义状态类型 */
|
|
4
|
+
export type AlertStatus = 'info' | 'success' | 'warning' | 'error';
|
|
5
|
+
/**
|
|
6
|
+
* Alert 组件属性接口
|
|
7
|
+
*/
|
|
8
|
+
export interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
9
|
+
/** 提示的语义状态,决定背景色与默认图标,默认为 `info` */
|
|
10
|
+
status?: AlertStatus;
|
|
11
|
+
/** 提示标题,展示在正文上方 */
|
|
12
|
+
title?: ReactNode;
|
|
13
|
+
/** 自定义提示图标;传入 null 可隐藏默认状态图标 */
|
|
14
|
+
icon?: DecorativeIcon | null;
|
|
15
|
+
/** 是否显示关闭按钮,默认为 false */
|
|
16
|
+
closable?: boolean;
|
|
17
|
+
/** 点击关闭按钮时的回调函数 */
|
|
18
|
+
onClose?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
19
|
+
}
|
|
20
|
+
/** Alert 根 DOM 元素类型 */
|
|
21
|
+
export type AlertRef = HTMLDivElement;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Anchor from './Anchor.cjs';
|
|
2
|
+
/** Anchor 锚点导航组件 */
|
|
3
|
+
export declare const VlAnchor: import("react").ForwardRefExoticComponent<import("./type.cjs").AnchorProps & import("react").RefAttributes<import("./type.cjs").AnchorRef>>;
|
|
4
|
+
export type { AnchorContainer, AnchorItem, AnchorProps, AnchorRef, AnchorScrollBehavior } from './type.cjs';
|
|
5
|
+
export default Anchor;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Anchor from './Anchor.js';
|
|
2
|
+
/** Anchor 锚点导航组件 */
|
|
3
|
+
export declare const VlAnchor: import("react").ForwardRefExoticComponent<import("./type.js").AnchorProps & import("react").RefAttributes<import("./type.js").AnchorRef>>;
|
|
4
|
+
export type { AnchorContainer, AnchorItem, AnchorProps, AnchorRef, AnchorScrollBehavior } from './type.js';
|
|
5
|
+
export default Anchor;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/** 锚点跳转滚动行为:平滑滚动 (smooth) 或 立即定位 (auto) */
|
|
3
|
+
export type AnchorScrollBehavior = 'auto' | 'smooth';
|
|
4
|
+
/** 锚点监听的滚动容器:DOM 元素或返回 DOM 元素的函数 */
|
|
5
|
+
export type AnchorContainer = HTMLElement | (() => HTMLElement | null);
|
|
6
|
+
/** 锚点目录项定义 */
|
|
7
|
+
export interface AnchorItem {
|
|
8
|
+
/** 当前页面中目标元素的 fragment 地址,例如 `#api` */
|
|
9
|
+
href: string;
|
|
10
|
+
/** 目录项显示的标题文本或自定义节点 */
|
|
11
|
+
title: ReactNode;
|
|
12
|
+
/** 子级锚点项列表,支持多级目录嵌套 */
|
|
13
|
+
children?: AnchorItem[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Anchor 组件属性接口
|
|
17
|
+
*/
|
|
18
|
+
export interface AnchorProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange' | 'title'> {
|
|
19
|
+
/** 锚点目录数据列表 */
|
|
20
|
+
items?: AnchorItem[];
|
|
21
|
+
/** 锚点面板顶部的标题文案 */
|
|
22
|
+
title?: ReactNode;
|
|
23
|
+
/** 受控模式:当前高亮激活的锚点 href */
|
|
24
|
+
activeHref?: string;
|
|
25
|
+
/** 非受控模式:初始高亮激活的锚点 href */
|
|
26
|
+
defaultActiveHref?: string;
|
|
27
|
+
/** 指定滚动的宿主容器,默认为 window */
|
|
28
|
+
getContainer?: AnchorContainer;
|
|
29
|
+
/** 触发锚点高亮计算的顶部偏移量(px),默认为 0 */
|
|
30
|
+
offsetTop?: number;
|
|
31
|
+
/** 点击锚点时的滚动跳转行为,默认为 `smooth` */
|
|
32
|
+
scrollBehavior?: AnchorScrollBehavior;
|
|
33
|
+
/** 激活的锚点发生变化时的回调函数 */
|
|
34
|
+
onChange?: (href: string) => void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Anchor 导出的 Ref 句柄接口
|
|
38
|
+
*/
|
|
39
|
+
export interface AnchorRef {
|
|
40
|
+
/** 动态增加或替换正文标题后,重新绑定并刷新观察目标元素的位置信息 */
|
|
41
|
+
refresh: () => void;
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/** 锚点跳转滚动行为:平滑滚动 (smooth) 或 立即定位 (auto) */
|
|
3
|
+
export type AnchorScrollBehavior = 'auto' | 'smooth';
|
|
4
|
+
/** 锚点监听的滚动容器:DOM 元素或返回 DOM 元素的函数 */
|
|
5
|
+
export type AnchorContainer = HTMLElement | (() => HTMLElement | null);
|
|
6
|
+
/** 锚点目录项定义 */
|
|
7
|
+
export interface AnchorItem {
|
|
8
|
+
/** 当前页面中目标元素的 fragment 地址,例如 `#api` */
|
|
9
|
+
href: string;
|
|
10
|
+
/** 目录项显示的标题文本或自定义节点 */
|
|
11
|
+
title: ReactNode;
|
|
12
|
+
/** 子级锚点项列表,支持多级目录嵌套 */
|
|
13
|
+
children?: AnchorItem[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Anchor 组件属性接口
|
|
17
|
+
*/
|
|
18
|
+
export interface AnchorProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange' | 'title'> {
|
|
19
|
+
/** 锚点目录数据列表 */
|
|
20
|
+
items?: AnchorItem[];
|
|
21
|
+
/** 锚点面板顶部的标题文案 */
|
|
22
|
+
title?: ReactNode;
|
|
23
|
+
/** 受控模式:当前高亮激活的锚点 href */
|
|
24
|
+
activeHref?: string;
|
|
25
|
+
/** 非受控模式:初始高亮激活的锚点 href */
|
|
26
|
+
defaultActiveHref?: string;
|
|
27
|
+
/** 指定滚动的宿主容器,默认为 window */
|
|
28
|
+
getContainer?: AnchorContainer;
|
|
29
|
+
/** 触发锚点高亮计算的顶部偏移量(px),默认为 0 */
|
|
30
|
+
offsetTop?: number;
|
|
31
|
+
/** 点击锚点时的滚动跳转行为,默认为 `smooth` */
|
|
32
|
+
scrollBehavior?: AnchorScrollBehavior;
|
|
33
|
+
/** 激活的锚点发生变化时的回调函数 */
|
|
34
|
+
onChange?: (href: string) => void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Anchor 导出的 Ref 句柄接口
|
|
38
|
+
*/
|
|
39
|
+
export interface AnchorRef {
|
|
40
|
+
/** 动态增加或替换正文标题后,重新绑定并刷新观察目标元素的位置信息 */
|
|
41
|
+
refresh: () => void;
|
|
42
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const createAnnouncementId: () => number;
|
|
2
|
+
/**
|
|
3
|
+
* 注册一个公告实例,并选择最高优先级中最近注册的实例作为 active。
|
|
4
|
+
*
|
|
5
|
+
* 文档站的全局公告使用 priority 1,因此组件示例只能共享同一个 host,不能把站点级提示顶掉;
|
|
6
|
+
* 普通业务实例维持默认 priority 0。该函数是纯仲裁操作,实际 DOM 由 useActiveAnnouncement 的订阅者渲染。
|
|
7
|
+
*/
|
|
8
|
+
export declare const registerAnnouncement: (id: number, priority?: number) => void;
|
|
9
|
+
export declare const unregisterAnnouncement: (id: number) => void;
|
|
10
|
+
export declare const useActiveAnnouncement: (id: number) => boolean;
|
|
11
|
+
export declare const getAnnouncementHost: () => HTMLDivElement | null;
|
|
12
|
+
export declare const releaseAnnouncementHost: () => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const createAnnouncementId: () => number;
|
|
2
|
+
/**
|
|
3
|
+
* 注册一个公告实例,并选择最高优先级中最近注册的实例作为 active。
|
|
4
|
+
*
|
|
5
|
+
* 文档站的全局公告使用 priority 1,因此组件示例只能共享同一个 host,不能把站点级提示顶掉;
|
|
6
|
+
* 普通业务实例维持默认 priority 0。该函数是纯仲裁操作,实际 DOM 由 useActiveAnnouncement 的订阅者渲染。
|
|
7
|
+
*/
|
|
8
|
+
export declare const registerAnnouncement: (id: number, priority?: number) => void;
|
|
9
|
+
export declare const unregisterAnnouncement: (id: number) => void;
|
|
10
|
+
export declare const useActiveAnnouncement: (id: number) => boolean;
|
|
11
|
+
export declare const getAnnouncementHost: () => HTMLDivElement | null;
|
|
12
|
+
export declare const releaseAnnouncementHost: () => void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Announcement from './Announcement.cjs';
|
|
2
|
+
/** Announcement 公告条组件 */
|
|
3
|
+
export declare const VlAnnouncement: import("react").ForwardRefExoticComponent<import("./type.cjs").AnnouncementProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export type { AnnouncementItem, AnnouncementKey, AnnouncementProps, AnnouncementRef, AnnouncementStatus } from './type.cjs';
|
|
5
|
+
export default Announcement;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import Announcement from './Announcement.js';
|
|
2
|
+
/** Announcement 公告条组件 */
|
|
3
|
+
export declare const VlAnnouncement: import("react").ForwardRefExoticComponent<import("./type.js").AnnouncementProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export type { AnnouncementItem, AnnouncementKey, AnnouncementProps, AnnouncementRef, AnnouncementStatus } from './type.js';
|
|
5
|
+
export default Announcement;
|