@ioca/react 1.3.4 → 1.3.6
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/lib/cjs/components/affix/affix.js +63 -0
- package/lib/cjs/components/affix/affix.js.map +1 -0
- package/lib/cjs/components/affix/index.js +10 -0
- package/lib/cjs/components/affix/index.js.map +1 -0
- package/lib/cjs/components/affix/totop.js +18 -0
- package/lib/cjs/components/affix/totop.js.map +1 -0
- package/lib/cjs/components/badge/badge.js +17 -0
- package/lib/cjs/components/badge/badge.js.map +1 -0
- package/lib/cjs/components/badge/index.js +10 -0
- package/lib/cjs/components/badge/index.js.map +1 -0
- package/lib/cjs/components/button/button.js +62 -0
- package/lib/cjs/components/button/button.js.map +1 -0
- package/lib/cjs/components/button/group.js +25 -0
- package/lib/cjs/components/button/group.js.map +1 -0
- package/lib/cjs/components/button/index.js +13 -0
- package/lib/cjs/components/button/index.js.map +1 -0
- package/lib/cjs/components/button/toggle.js +50 -0
- package/lib/cjs/components/button/toggle.js.map +1 -0
- package/lib/cjs/components/card/card.js +17 -0
- package/lib/cjs/components/card/card.js.map +1 -0
- package/lib/cjs/components/card/index.js +10 -0
- package/lib/cjs/components/card/index.js.map +1 -0
- package/lib/cjs/components/checkbox/checkbox.js +46 -0
- package/lib/cjs/components/checkbox/checkbox.js.map +1 -0
- package/lib/cjs/components/checkbox/index.js +10 -0
- package/lib/cjs/components/checkbox/index.js.map +1 -0
- package/lib/cjs/components/checkbox/item.js +40 -0
- package/lib/cjs/components/checkbox/item.js.map +1 -0
- package/lib/cjs/components/collapse/collapse.js +78 -0
- package/lib/cjs/components/collapse/collapse.js.map +1 -0
- package/lib/cjs/components/collapse/index.js +10 -0
- package/lib/cjs/components/collapse/index.js.map +1 -0
- package/lib/cjs/components/collapse/item.js +12 -0
- package/lib/cjs/components/collapse/item.js.map +1 -0
- package/lib/cjs/components/datagrid/cell.js +27 -0
- package/lib/cjs/components/datagrid/cell.js.map +1 -0
- package/lib/cjs/components/datagrid/datagrid.js +117 -0
- package/lib/cjs/components/datagrid/datagrid.js.map +1 -0
- package/lib/cjs/components/datagrid/index.js +10 -0
- package/lib/cjs/components/datagrid/index.js.map +1 -0
- package/lib/cjs/components/datagrid/resize.js +45 -0
- package/lib/cjs/components/datagrid/resize.js.map +1 -0
- package/lib/cjs/components/datagrid/row.js +37 -0
- package/lib/cjs/components/datagrid/row.js.map +1 -0
- package/lib/cjs/components/datagrid/sorter.js +17 -0
- package/lib/cjs/components/datagrid/sorter.js.map +1 -0
- package/lib/cjs/components/description/description.js +32 -0
- package/lib/cjs/components/description/description.js.map +1 -0
- package/lib/cjs/components/description/index.js +10 -0
- package/lib/cjs/components/description/index.js.map +1 -0
- package/lib/cjs/components/drawer/drawer.js +66 -0
- package/lib/cjs/components/drawer/drawer.js.map +1 -0
- package/lib/cjs/components/drawer/index.js +10 -0
- package/lib/cjs/components/drawer/index.js.map +1 -0
- package/lib/cjs/components/dropdown/dropdown.js +17 -0
- package/lib/cjs/components/dropdown/dropdown.js.map +1 -0
- package/lib/cjs/components/dropdown/index.js +10 -0
- package/lib/cjs/components/dropdown/index.js.map +1 -0
- package/lib/cjs/components/dropdown/item.js +22 -0
- package/lib/cjs/components/dropdown/item.js.map +1 -0
- package/lib/cjs/components/editor/controls.js +87 -0
- package/lib/cjs/components/editor/controls.js.map +1 -0
- package/lib/cjs/components/editor/editor.js +83 -0
- package/lib/cjs/components/editor/editor.js.map +1 -0
- package/lib/cjs/components/editor/index.js +10 -0
- package/lib/cjs/components/editor/index.js.map +1 -0
- package/lib/cjs/components/flex/flex.js +32 -0
- package/lib/cjs/components/flex/flex.js.map +1 -0
- package/lib/cjs/components/flex/index.js +10 -0
- package/lib/cjs/components/flex/index.js.map +1 -0
- package/lib/cjs/components/form/context.js +10 -0
- package/lib/cjs/components/form/context.js.map +1 -0
- package/lib/cjs/components/form/field.js +77 -0
- package/lib/cjs/components/form/field.js.map +1 -0
- package/lib/cjs/components/form/form.js +57 -0
- package/lib/cjs/components/form/form.js.map +1 -0
- package/lib/cjs/components/form/index.js +10 -0
- package/lib/cjs/components/form/index.js.map +1 -0
- package/lib/cjs/components/form/useForm.js +130 -0
- package/lib/cjs/components/form/useForm.js.map +1 -0
- package/lib/cjs/components/icon/icon.js +27 -0
- package/lib/cjs/components/icon/icon.js.map +1 -0
- package/lib/cjs/components/icon/index.js +10 -0
- package/lib/cjs/components/icon/index.js.map +1 -0
- package/lib/cjs/components/image/image.js +76 -0
- package/lib/cjs/components/image/image.js.map +1 -0
- package/lib/cjs/components/image/index.js +11 -0
- package/lib/cjs/components/image/index.js.map +1 -0
- package/lib/cjs/components/image/list.js +47 -0
- package/lib/cjs/components/image/list.js.map +1 -0
- package/lib/cjs/components/input/container.js +18 -0
- package/lib/cjs/components/input/container.js.map +1 -0
- package/lib/cjs/components/input/index.js +15 -0
- package/lib/cjs/components/input/index.js.map +1 -0
- package/lib/cjs/components/input/input.js +67 -0
- package/lib/cjs/components/input/input.js.map +1 -0
- package/lib/cjs/components/input/number.js +58 -0
- package/lib/cjs/components/input/number.js.map +1 -0
- package/lib/cjs/components/input/range.js +71 -0
- package/lib/cjs/components/input/range.js.map +1 -0
- package/lib/cjs/components/input/textarea.js +51 -0
- package/lib/cjs/components/input/textarea.js.map +1 -0
- package/lib/cjs/components/list/index.js +10 -0
- package/lib/cjs/components/list/index.js.map +1 -0
- package/lib/cjs/components/list/item.js +18 -0
- package/lib/cjs/components/list/item.js.map +1 -0
- package/lib/cjs/components/list/list.js +28 -0
- package/lib/cjs/components/list/list.js.map +1 -0
- package/lib/cjs/components/loading/index.js +10 -0
- package/lib/cjs/components/loading/index.js.map +1 -0
- package/lib/cjs/components/loading/loading.js +21 -0
- package/lib/cjs/components/loading/loading.js.map +1 -0
- package/lib/cjs/components/message/index.js +10 -0
- package/lib/cjs/components/message/index.js.map +1 -0
- package/lib/cjs/components/message/message.js +178 -0
- package/lib/cjs/components/message/message.js.map +1 -0
- package/lib/cjs/components/modal/hookModal.js +31 -0
- package/lib/cjs/components/modal/hookModal.js.map +1 -0
- package/lib/cjs/components/modal/index.js +11 -0
- package/lib/cjs/components/modal/index.js.map +1 -0
- package/lib/cjs/components/modal/modal.js +108 -0
- package/lib/cjs/components/modal/modal.js.map +1 -0
- package/lib/cjs/components/modal/useModal.js +38 -0
- package/lib/cjs/components/modal/useModal.js.map +1 -0
- package/lib/cjs/components/pagination/index.js +10 -0
- package/lib/cjs/components/pagination/index.js.map +1 -0
- package/lib/cjs/components/pagination/page.js +28 -0
- package/lib/cjs/components/pagination/page.js.map +1 -0
- package/lib/cjs/components/pagination/pagination.js +48 -0
- package/lib/cjs/components/pagination/pagination.js.map +1 -0
- package/lib/cjs/components/picker/colors/footer.js +44 -0
- package/lib/cjs/components/picker/colors/footer.js.map +1 -0
- package/lib/cjs/components/picker/colors/handle.js +14 -0
- package/lib/cjs/components/picker/colors/handle.js.map +1 -0
- package/lib/cjs/components/picker/colors/index.js +61 -0
- package/lib/cjs/components/picker/colors/index.js.map +1 -0
- package/lib/cjs/components/picker/dates/dates.js +50 -0
- package/lib/cjs/components/picker/dates/dates.js.map +1 -0
- package/lib/cjs/components/picker/dates/index.js +66 -0
- package/lib/cjs/components/picker/dates/index.js.map +1 -0
- package/lib/cjs/components/picker/dates/panel.js +81 -0
- package/lib/cjs/components/picker/dates/panel.js.map +1 -0
- package/lib/cjs/components/picker/time/index.js +50 -0
- package/lib/cjs/components/picker/time/index.js.map +1 -0
- package/lib/cjs/components/picker/time/item.js +19 -0
- package/lib/cjs/components/picker/time/item.js.map +1 -0
- package/lib/cjs/components/picker/time/panel.js +87 -0
- package/lib/cjs/components/picker/time/panel.js.map +1 -0
- package/lib/cjs/components/popconfirm/index.js +10 -0
- package/lib/cjs/components/popconfirm/index.js.map +1 -0
- package/lib/cjs/components/popconfirm/popconfirm.js +58 -0
- package/lib/cjs/components/popconfirm/popconfirm.js.map +1 -0
- package/lib/cjs/components/popup/content.js +44 -0
- package/lib/cjs/components/popup/content.js.map +1 -0
- package/lib/cjs/components/popup/index.js +10 -0
- package/lib/cjs/components/popup/index.js.map +1 -0
- package/lib/cjs/components/popup/popup.js +223 -0
- package/lib/cjs/components/popup/popup.js.map +1 -0
- package/lib/cjs/components/progress/circle.js +17 -0
- package/lib/cjs/components/progress/circle.js.map +1 -0
- package/lib/cjs/components/progress/index.js +10 -0
- package/lib/cjs/components/progress/index.js.map +1 -0
- package/lib/cjs/components/progress/line.js +18 -0
- package/lib/cjs/components/progress/line.js.map +1 -0
- package/lib/cjs/components/progress/progress.js +87 -0
- package/lib/cjs/components/progress/progress.js.map +1 -0
- package/lib/cjs/components/radio/index.js +10 -0
- package/lib/cjs/components/radio/index.js.map +1 -0
- package/lib/cjs/components/radio/item.js +21 -0
- package/lib/cjs/components/radio/item.js.map +1 -0
- package/lib/cjs/components/radio/radio.js +39 -0
- package/lib/cjs/components/radio/radio.js.map +1 -0
- package/lib/cjs/components/resizable/index.js +10 -0
- package/lib/cjs/components/resizable/index.js.map +1 -0
- package/lib/cjs/components/resizable/resizable.js +65 -0
- package/lib/cjs/components/resizable/resizable.js.map +1 -0
- package/lib/cjs/components/select/index.js +10 -0
- package/lib/cjs/components/select/index.js.map +1 -0
- package/lib/cjs/components/select/options.js +51 -0
- package/lib/cjs/components/select/options.js.map +1 -0
- package/lib/cjs/components/select/select.js +97 -0
- package/lib/cjs/components/select/select.js.map +1 -0
- package/lib/cjs/components/step/divider.js +12 -0
- package/lib/cjs/components/step/divider.js.map +1 -0
- package/lib/cjs/components/step/index.js +10 -0
- package/lib/cjs/components/step/index.js.map +1 -0
- package/lib/cjs/components/step/item.js +26 -0
- package/lib/cjs/components/step/item.js.map +1 -0
- package/lib/cjs/components/step/step.js +40 -0
- package/lib/cjs/components/step/step.js.map +1 -0
- package/lib/cjs/components/swiper/index.js +10 -0
- package/lib/cjs/components/swiper/index.js.map +1 -0
- package/lib/cjs/components/swiper/item.js +29 -0
- package/lib/cjs/components/swiper/item.js.map +1 -0
- package/lib/cjs/components/swiper/swiper.js +238 -0
- package/lib/cjs/components/swiper/swiper.js.map +1 -0
- package/lib/cjs/components/tabs/index.js +10 -0
- package/lib/cjs/components/tabs/index.js.map +1 -0
- package/lib/cjs/components/tabs/item.js +12 -0
- package/lib/cjs/components/tabs/item.js.map +1 -0
- package/lib/cjs/components/tabs/tabs.js +215 -0
- package/lib/cjs/components/tabs/tabs.js.map +1 -0
- package/lib/cjs/components/tag/index.js +10 -0
- package/lib/cjs/components/tag/index.js.map +1 -0
- package/lib/cjs/components/tag/tag.js +22 -0
- package/lib/cjs/components/tag/tag.js.map +1 -0
- package/lib/cjs/components/text/highlight.js +32 -0
- package/lib/cjs/components/text/highlight.js.map +1 -0
- package/lib/cjs/components/text/index.js +15 -0
- package/lib/cjs/components/text/index.js.map +1 -0
- package/lib/cjs/components/text/number.js +31 -0
- package/lib/cjs/components/text/number.js.map +1 -0
- package/lib/cjs/components/text/text.js +32 -0
- package/lib/cjs/components/text/text.js.map +1 -0
- package/lib/cjs/components/text/time.js +24 -0
- package/lib/cjs/components/text/time.js.map +1 -0
- package/lib/cjs/components/tree/index.js +10 -0
- package/lib/cjs/components/tree/index.js.map +1 -0
- package/lib/cjs/components/tree/item.js +76 -0
- package/lib/cjs/components/tree/item.js.map +1 -0
- package/lib/cjs/components/tree/tree.js +136 -0
- package/lib/cjs/components/tree/tree.js.map +1 -0
- package/lib/cjs/components/upload/index.js +10 -0
- package/lib/cjs/components/upload/index.js.map +1 -0
- package/lib/cjs/components/upload/renderFile.js +66 -0
- package/lib/cjs/components/upload/renderFile.js.map +1 -0
- package/lib/cjs/components/upload/upload.js +127 -0
- package/lib/cjs/components/upload/upload.js.map +1 -0
- package/lib/cjs/components/utils/empty/index.js +15 -0
- package/lib/cjs/components/utils/empty/index.js.map +1 -0
- package/lib/cjs/components/utils/helpericon/helpericon.js +28 -0
- package/lib/cjs/components/utils/helpericon/helpericon.js.map +1 -0
- package/lib/cjs/components/utils/helpericon/index.js +10 -0
- package/lib/cjs/components/utils/helpericon/index.js.map +1 -0
- package/lib/cjs/components/video/index.js +10 -0
- package/lib/cjs/components/video/index.js.map +1 -0
- package/lib/cjs/components/video/video.js +175 -0
- package/lib/cjs/components/video/video.js.map +1 -0
- package/lib/cjs/index.js +89 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/js/hooks.js +115 -0
- package/lib/cjs/js/hooks.js.map +1 -0
- package/lib/cjs/js/usePreview/content.js +148 -0
- package/lib/cjs/js/usePreview/content.js.map +1 -0
- package/lib/cjs/js/usePreview/index.js +27 -0
- package/lib/cjs/js/usePreview/index.js.map +1 -0
- package/lib/cjs/js/usePreview/renderFile.js +24 -0
- package/lib/cjs/js/usePreview/renderFile.js.map +1 -0
- package/lib/cjs/js/usePreview/type.js +13 -0
- package/lib/cjs/js/usePreview/type.js.map +1 -0
- package/lib/cjs/js/useRipple/index.js +47 -0
- package/lib/cjs/js/useRipple/index.js.map +1 -0
- package/lib/cjs/js/utils.js +281 -0
- package/lib/cjs/js/utils.js.map +1 -0
- package/lib/css/index.css +1 -1
- package/lib/css/index.css.map +1 -1
- package/lib/es/components/affix/affix.js +59 -0
- package/lib/es/components/affix/affix.js.map +1 -0
- package/lib/es/components/affix/index.js +6 -0
- package/lib/{components/badge → es/components/affix}/index.js.map +1 -1
- package/lib/es/components/affix/totop.js +14 -0
- package/lib/es/components/affix/totop.js.map +1 -0
- package/lib/es/components/badge/badge.js +13 -0
- package/lib/es/components/badge/badge.js.map +1 -0
- package/lib/es/components/badge/index.js +6 -0
- package/lib/{components/checkbox → es/components/badge}/index.js.map +1 -1
- package/lib/es/components/button/button.js +58 -0
- package/lib/es/components/button/button.js.map +1 -0
- package/lib/es/components/button/group.js +21 -0
- package/lib/es/components/button/group.js.map +1 -0
- package/lib/es/components/button/index.js +9 -0
- package/lib/es/components/button/index.js.map +1 -0
- package/lib/es/components/button/toggle.js +46 -0
- package/lib/es/components/button/toggle.js.map +1 -0
- package/lib/es/components/card/card.js +13 -0
- package/lib/es/components/card/card.js.map +1 -0
- package/lib/es/components/card/index.js +6 -0
- package/lib/{components → es/components}/card/index.js.map +1 -1
- package/lib/es/components/checkbox/checkbox.js +42 -0
- package/lib/es/components/checkbox/checkbox.js.map +1 -0
- package/lib/es/components/checkbox/index.js +6 -0
- package/lib/{components/affix → es/components/checkbox}/index.js.map +1 -1
- package/lib/es/components/checkbox/item.js +36 -0
- package/lib/es/components/checkbox/item.js.map +1 -0
- package/lib/es/components/collapse/collapse.js +74 -0
- package/lib/es/components/collapse/collapse.js.map +1 -0
- package/lib/es/components/collapse/index.js +6 -0
- package/lib/es/components/collapse/index.js.map +1 -0
- package/lib/es/components/collapse/item.js +8 -0
- package/lib/es/components/collapse/item.js.map +1 -0
- package/lib/es/components/datagrid/cell.js +24 -0
- package/lib/es/components/datagrid/cell.js.map +1 -0
- package/lib/es/components/datagrid/datagrid.js +113 -0
- package/lib/es/components/datagrid/datagrid.js.map +1 -0
- package/lib/es/components/datagrid/index.js +6 -0
- package/lib/es/components/datagrid/index.js.map +1 -0
- package/lib/es/components/datagrid/resize.js +41 -0
- package/lib/es/components/datagrid/resize.js.map +1 -0
- package/lib/es/components/datagrid/row.js +32 -0
- package/lib/es/components/datagrid/row.js.map +1 -0
- package/lib/es/components/datagrid/sorter.js +13 -0
- package/lib/es/components/datagrid/sorter.js.map +1 -0
- package/lib/es/components/description/description.js +28 -0
- package/lib/es/components/description/description.js.map +1 -0
- package/lib/es/components/description/index.js +6 -0
- package/lib/es/components/description/index.js.map +1 -0
- package/lib/es/components/drawer/drawer.js +62 -0
- package/lib/es/components/drawer/drawer.js.map +1 -0
- package/lib/es/components/drawer/index.js +6 -0
- package/lib/es/components/drawer/index.js.map +1 -0
- package/lib/es/components/dropdown/dropdown.js +13 -0
- package/lib/es/components/dropdown/dropdown.js.map +1 -0
- package/lib/es/components/dropdown/index.js +6 -0
- package/lib/es/components/dropdown/index.js.map +1 -0
- package/lib/es/components/dropdown/item.js +18 -0
- package/lib/es/components/dropdown/item.js.map +1 -0
- package/lib/es/components/editor/controls.js +81 -0
- package/lib/es/components/editor/controls.js.map +1 -0
- package/lib/es/components/editor/editor.js +79 -0
- package/lib/es/components/editor/editor.js.map +1 -0
- package/lib/es/components/editor/index.js +6 -0
- package/lib/es/components/editor/index.js.map +1 -0
- package/lib/es/components/flex/flex.js +28 -0
- package/lib/es/components/flex/flex.js.map +1 -0
- package/lib/es/components/flex/index.js +6 -0
- package/lib/es/components/flex/index.js.map +1 -0
- package/lib/es/components/form/context.js +6 -0
- package/lib/es/components/form/context.js.map +1 -0
- package/lib/es/components/form/field.js +73 -0
- package/lib/es/components/form/field.js.map +1 -0
- package/lib/es/components/form/form.js +53 -0
- package/lib/es/components/form/form.js.map +1 -0
- package/lib/es/components/form/index.js +6 -0
- package/lib/es/components/form/index.js.map +1 -0
- package/lib/es/components/form/useForm.js +125 -0
- package/lib/es/components/form/useForm.js.map +1 -0
- package/lib/es/components/icon/icon.js +23 -0
- package/lib/es/components/icon/icon.js.map +1 -0
- package/lib/es/components/icon/index.js +6 -0
- package/lib/es/components/icon/index.js.map +1 -0
- package/lib/es/components/image/image.js +72 -0
- package/lib/es/components/image/image.js.map +1 -0
- package/lib/es/components/image/index.js +7 -0
- package/lib/es/components/image/index.js.map +1 -0
- package/lib/es/components/image/list.js +43 -0
- package/lib/es/components/image/list.js.map +1 -0
- package/lib/es/components/input/container.js +14 -0
- package/lib/es/components/input/container.js.map +1 -0
- package/lib/es/components/input/index.js +11 -0
- package/lib/es/components/input/index.js.map +1 -0
- package/lib/es/components/input/input.js +63 -0
- package/lib/es/components/input/input.js.map +1 -0
- package/lib/es/components/input/number.js +54 -0
- package/lib/es/components/input/number.js.map +1 -0
- package/lib/es/components/input/range.js +67 -0
- package/lib/es/components/input/range.js.map +1 -0
- package/lib/es/components/input/textarea.js +47 -0
- package/lib/es/components/input/textarea.js.map +1 -0
- package/lib/es/components/list/index.js +6 -0
- package/lib/es/components/list/index.js.map +1 -0
- package/lib/es/components/list/item.js +14 -0
- package/lib/es/components/list/item.js.map +1 -0
- package/lib/es/components/list/list.js +24 -0
- package/lib/es/components/list/list.js.map +1 -0
- package/lib/es/components/loading/index.js +6 -0
- package/lib/es/components/loading/index.js.map +1 -0
- package/lib/es/components/loading/loading.js +17 -0
- package/lib/es/components/loading/loading.js.map +1 -0
- package/lib/es/components/message/index.js +6 -0
- package/lib/es/components/message/index.js.map +1 -0
- package/lib/es/components/message/message.js +174 -0
- package/lib/es/components/message/message.js.map +1 -0
- package/lib/es/components/modal/hookModal.js +27 -0
- package/lib/es/components/modal/hookModal.js.map +1 -0
- package/lib/es/components/modal/index.js +7 -0
- package/lib/es/components/modal/index.js.map +1 -0
- package/lib/es/components/modal/modal.js +104 -0
- package/lib/es/components/modal/modal.js.map +1 -0
- package/lib/es/components/modal/useModal.js +34 -0
- package/lib/es/components/modal/useModal.js.map +1 -0
- package/lib/es/components/pagination/index.js +6 -0
- package/lib/es/components/pagination/index.js.map +1 -0
- package/lib/es/components/pagination/page.js +24 -0
- package/lib/es/components/pagination/page.js.map +1 -0
- package/lib/es/components/pagination/pagination.js +44 -0
- package/lib/es/components/pagination/pagination.js.map +1 -0
- package/lib/es/components/picker/colors/footer.js +39 -0
- package/lib/es/components/picker/colors/footer.js.map +1 -0
- package/lib/es/components/picker/colors/handle.js +10 -0
- package/lib/es/components/picker/colors/handle.js.map +1 -0
- package/lib/es/components/picker/colors/index.js +57 -0
- package/lib/es/components/picker/colors/index.js.map +1 -0
- package/lib/es/components/picker/dates/dates.js +46 -0
- package/lib/es/components/picker/dates/dates.js.map +1 -0
- package/lib/es/components/picker/dates/index.js +62 -0
- package/lib/es/components/picker/dates/index.js.map +1 -0
- package/lib/es/components/picker/dates/panel.js +77 -0
- package/lib/es/components/picker/dates/panel.js.map +1 -0
- package/lib/es/components/picker/time/index.js +46 -0
- package/lib/es/components/picker/time/index.js.map +1 -0
- package/lib/es/components/picker/time/item.js +15 -0
- package/lib/es/components/picker/time/item.js.map +1 -0
- package/lib/es/components/picker/time/panel.js +83 -0
- package/lib/es/components/picker/time/panel.js.map +1 -0
- package/lib/es/components/popconfirm/index.js +6 -0
- package/lib/es/components/popconfirm/index.js.map +1 -0
- package/lib/es/components/popconfirm/popconfirm.js +54 -0
- package/lib/es/components/popconfirm/popconfirm.js.map +1 -0
- package/lib/es/components/popup/content.js +40 -0
- package/lib/es/components/popup/content.js.map +1 -0
- package/lib/es/components/popup/index.js +6 -0
- package/lib/es/components/popup/index.js.map +1 -0
- package/lib/es/components/popup/popup.js +219 -0
- package/lib/es/components/popup/popup.js.map +1 -0
- package/lib/es/components/progress/circle.js +13 -0
- package/lib/es/components/progress/circle.js.map +1 -0
- package/lib/es/components/progress/index.js +6 -0
- package/lib/es/components/progress/index.js.map +1 -0
- package/lib/es/components/progress/line.js +14 -0
- package/lib/es/components/progress/line.js.map +1 -0
- package/lib/es/components/progress/progress.js +83 -0
- package/lib/es/components/progress/progress.js.map +1 -0
- package/lib/es/components/radio/index.js +6 -0
- package/lib/es/components/radio/index.js.map +1 -0
- package/lib/es/components/radio/item.js +17 -0
- package/lib/es/components/radio/item.js.map +1 -0
- package/lib/es/components/radio/radio.js +35 -0
- package/lib/es/components/radio/radio.js.map +1 -0
- package/lib/es/components/resizable/index.js +6 -0
- package/lib/es/components/resizable/index.js.map +1 -0
- package/lib/es/components/resizable/resizable.js +61 -0
- package/lib/es/components/resizable/resizable.js.map +1 -0
- package/lib/es/components/select/index.js +6 -0
- package/lib/es/components/select/index.js.map +1 -0
- package/lib/es/components/select/options.js +47 -0
- package/lib/es/components/select/options.js.map +1 -0
- package/lib/es/components/select/select.js +93 -0
- package/lib/es/components/select/select.js.map +1 -0
- package/lib/es/components/step/divider.js +8 -0
- package/lib/es/components/step/divider.js.map +1 -0
- package/lib/es/components/step/index.js +6 -0
- package/lib/es/components/step/index.js.map +1 -0
- package/lib/es/components/step/item.js +22 -0
- package/lib/es/components/step/item.js.map +1 -0
- package/lib/es/components/step/step.js +36 -0
- package/lib/es/components/step/step.js.map +1 -0
- package/lib/es/components/swiper/index.js +6 -0
- package/lib/es/components/swiper/index.js.map +1 -0
- package/lib/es/components/swiper/item.js +25 -0
- package/lib/es/components/swiper/item.js.map +1 -0
- package/lib/es/components/swiper/swiper.js +234 -0
- package/lib/es/components/swiper/swiper.js.map +1 -0
- package/lib/es/components/tabs/index.js +6 -0
- package/lib/es/components/tabs/index.js.map +1 -0
- package/lib/es/components/tabs/item.js +8 -0
- package/lib/es/components/tabs/item.js.map +1 -0
- package/lib/es/components/tabs/tabs.js +211 -0
- package/lib/es/components/tabs/tabs.js.map +1 -0
- package/lib/es/components/tag/index.js +6 -0
- package/lib/es/components/tag/index.js.map +1 -0
- package/lib/es/components/tag/tag.js +18 -0
- package/lib/es/components/tag/tag.js.map +1 -0
- package/lib/es/components/text/highlight.js +28 -0
- package/lib/es/components/text/highlight.js.map +1 -0
- package/lib/es/components/text/index.js +11 -0
- package/lib/es/components/text/index.js.map +1 -0
- package/lib/es/components/text/number.js +27 -0
- package/lib/es/components/text/number.js.map +1 -0
- package/lib/es/components/text/text.js +28 -0
- package/lib/es/components/text/text.js.map +1 -0
- package/lib/es/components/text/time.js +20 -0
- package/lib/es/components/text/time.js.map +1 -0
- package/lib/es/components/tree/index.js +6 -0
- package/lib/es/components/tree/index.js.map +1 -0
- package/lib/es/components/tree/item.js +73 -0
- package/lib/es/components/tree/item.js.map +1 -0
- package/lib/es/components/tree/tree.js +132 -0
- package/lib/es/components/tree/tree.js.map +1 -0
- package/lib/es/components/upload/index.js +6 -0
- package/lib/es/components/upload/index.js.map +1 -0
- package/lib/es/components/upload/renderFile.js +61 -0
- package/lib/es/components/upload/renderFile.js.map +1 -0
- package/lib/es/components/upload/upload.js +123 -0
- package/lib/es/components/upload/upload.js.map +1 -0
- package/lib/es/components/utils/empty/index.js +11 -0
- package/lib/es/components/utils/empty/index.js.map +1 -0
- package/lib/es/components/utils/helpericon/helpericon.js +24 -0
- package/lib/es/components/utils/helpericon/helpericon.js.map +1 -0
- package/lib/es/components/utils/helpericon/index.js +6 -0
- package/lib/es/components/utils/helpericon/index.js.map +1 -0
- package/lib/es/components/video/index.js +6 -0
- package/lib/es/components/video/index.js.map +1 -0
- package/lib/es/components/video/video.js +171 -0
- package/lib/es/components/video/video.js.map +1 -0
- package/lib/es/index.js +45 -0
- package/lib/es/index.js.map +1 -0
- package/lib/es/js/hooks.js +109 -0
- package/lib/es/js/hooks.js.map +1 -0
- package/lib/es/js/usePreview/content.js +144 -0
- package/lib/es/js/usePreview/content.js.map +1 -0
- package/lib/es/js/usePreview/index.js +23 -0
- package/lib/es/js/usePreview/index.js.map +1 -0
- package/lib/es/js/usePreview/renderFile.js +20 -0
- package/lib/es/js/usePreview/renderFile.js.map +1 -0
- package/lib/es/js/usePreview/type.js +13 -0
- package/lib/es/js/usePreview/type.js.map +1 -0
- package/lib/es/js/useRipple/index.js +43 -0
- package/lib/es/js/useRipple/index.js.map +1 -0
- package/lib/es/js/utils.js +265 -0
- package/lib/es/js/utils.js.map +1 -0
- package/lib/index.js +4317 -2
- package/lib/types/components/affix/affix.d.ts +0 -2
- package/lib/types/components/affix/index.d.ts +0 -2
- package/lib/types/components/affix/totop.d.ts +0 -2
- package/lib/types/components/affix/type.d.ts +0 -2
- package/lib/types/components/badge/badge.d.ts +0 -2
- package/lib/types/components/badge/index.d.ts +0 -2
- package/lib/types/components/badge/type.d.ts +0 -2
- package/lib/types/components/button/button.d.ts +0 -2
- package/lib/types/components/button/group.d.ts +0 -2
- package/lib/types/components/button/index.d.ts +0 -2
- package/lib/types/components/button/toggle.d.ts +0 -2
- package/lib/types/components/button/type.d.ts +0 -2
- package/lib/types/components/card/card.d.ts +0 -2
- package/lib/types/components/card/index.d.ts +0 -2
- package/lib/types/components/card/type.d.ts +0 -2
- package/lib/types/components/checkbox/checkbox.d.ts +0 -2
- package/lib/types/components/checkbox/index.d.ts +0 -2
- package/lib/types/components/checkbox/item.d.ts +0 -2
- package/lib/types/components/checkbox/type.d.ts +0 -2
- package/lib/types/components/collapse/collapse.d.ts +0 -2
- package/lib/types/components/collapse/index.d.ts +0 -2
- package/lib/types/components/collapse/item.d.ts +0 -2
- package/lib/types/components/collapse/type.d.ts +0 -2
- package/lib/types/components/datagrid/datagrid.d.ts +0 -2
- package/lib/types/components/datagrid/index.d.ts +0 -2
- package/lib/types/components/datagrid/type.d.ts +0 -2
- package/lib/types/components/description/description.d.ts +0 -2
- package/lib/types/components/description/index.d.ts +0 -2
- package/lib/types/components/description/type.d.ts +0 -2
- package/lib/types/components/drawer/drawer.d.ts +0 -2
- package/lib/types/components/drawer/index.d.ts +0 -2
- package/lib/types/components/drawer/type.d.ts +0 -2
- package/lib/types/components/dropdown/dropdown.d.ts +0 -2
- package/lib/types/components/dropdown/index.d.ts +0 -2
- package/lib/types/components/dropdown/type.d.ts +0 -2
- package/lib/types/components/editor/editor.d.ts +0 -2
- package/lib/types/components/editor/index.d.ts +0 -2
- package/lib/types/components/editor/type.d.ts +0 -2
- package/lib/types/components/flex/flex.d.ts +0 -2
- package/lib/types/components/flex/index.d.ts +0 -2
- package/lib/types/components/flex/type.d.ts +0 -2
- package/lib/types/components/form/field.d.ts +0 -2
- package/lib/types/components/form/form.d.ts +0 -2
- package/lib/types/components/form/index.d.ts +0 -2
- package/lib/types/components/form/type.d.ts +0 -2
- package/lib/types/components/form/useForm.d.ts +0 -2
- package/lib/types/components/icon/icon.d.ts +0 -2
- package/lib/types/components/icon/index.d.ts +0 -2
- package/lib/types/components/icon/type.d.ts +0 -2
- package/lib/types/components/image/image.d.ts +0 -2
- package/lib/types/components/image/index.d.ts +0 -2
- package/lib/types/components/image/list.d.ts +0 -2
- package/lib/types/components/image/type.d.ts +0 -2
- package/lib/types/components/input/index.d.ts +0 -2
- package/lib/types/components/input/input.d.ts +0 -2
- package/lib/types/components/input/number.d.ts +0 -2
- package/lib/types/components/input/range.d.ts +0 -2
- package/lib/types/components/input/textarea.d.ts +0 -2
- package/lib/types/components/input/type.d.ts +0 -2
- package/lib/types/components/list/index.d.ts +0 -2
- package/lib/types/components/list/list.d.ts +0 -2
- package/lib/types/components/list/type.d.ts +0 -2
- package/lib/types/components/loading/index.d.ts +0 -2
- package/lib/types/components/loading/loading.d.ts +0 -2
- package/lib/types/components/loading/type.d.ts +0 -2
- package/lib/types/components/message/index.d.ts +0 -2
- package/lib/types/components/message/message.d.ts +0 -2
- package/lib/types/components/message/type.d.ts +0 -2
- package/lib/types/components/modal/index.d.ts +0 -2
- package/lib/types/components/modal/modal.d.ts +0 -2
- package/lib/types/components/modal/type.d.ts +0 -2
- package/lib/types/components/modal/useModal.d.ts +0 -2
- package/lib/types/components/pagination/index.d.ts +0 -2
- package/lib/types/components/pagination/pagination.d.ts +0 -2
- package/lib/types/components/pagination/type.d.ts +0 -2
- package/lib/types/components/picker/colors/index.d.ts +0 -2
- package/lib/types/components/picker/dates/index.d.ts +0 -2
- package/lib/types/components/picker/time/index.d.ts +0 -2
- package/lib/types/components/picker/type.d.ts +2 -4
- package/lib/types/components/popconfirm/index.d.ts +0 -2
- package/lib/types/components/popconfirm/popconfirm.d.ts +0 -2
- package/lib/types/components/popconfirm/type.d.ts +0 -2
- package/lib/types/components/popup/index.d.ts +0 -2
- package/lib/types/components/popup/popup.d.ts +0 -2
- package/lib/types/components/popup/type.d.ts +0 -2
- package/lib/types/components/progress/index.d.ts +0 -2
- package/lib/types/components/progress/progress.d.ts +0 -2
- package/lib/types/components/progress/type.d.ts +0 -2
- package/lib/types/components/radio/index.d.ts +0 -2
- package/lib/types/components/radio/item.d.ts +0 -2
- package/lib/types/components/radio/radio.d.ts +0 -2
- package/lib/types/components/radio/type.d.ts +0 -2
- package/lib/types/components/resizable/index.d.ts +0 -2
- package/lib/types/components/resizable/resizable.d.ts +0 -2
- package/lib/types/components/resizable/type.d.ts +0 -2
- package/lib/types/components/select/index.d.ts +0 -2
- package/lib/types/components/select/select.d.ts +0 -2
- package/lib/types/components/select/type.d.ts +0 -2
- package/lib/types/components/step/index.d.ts +0 -2
- package/lib/types/components/step/item.d.ts +0 -2
- package/lib/types/components/step/step.d.ts +0 -2
- package/lib/types/components/step/type.d.ts +0 -2
- package/lib/types/components/swiper/index.d.ts +0 -2
- package/lib/types/components/swiper/item.d.ts +0 -2
- package/lib/types/components/swiper/swiper.d.ts +0 -2
- package/lib/types/components/swiper/type.d.ts +0 -2
- package/lib/types/components/tabs/index.d.ts +0 -2
- package/lib/types/components/tabs/item.d.ts +0 -2
- package/lib/types/components/tabs/tabs.d.ts +0 -2
- package/lib/types/components/tabs/type.d.ts +0 -2
- package/lib/types/components/tag/index.d.ts +0 -2
- package/lib/types/components/tag/tag.d.ts +0 -2
- package/lib/types/components/tag/type.d.ts +0 -2
- package/lib/types/components/text/highlight.d.ts +0 -2
- package/lib/types/components/text/index.d.ts +0 -2
- package/lib/types/components/text/number.d.ts +0 -2
- package/lib/types/components/text/text.d.ts +0 -2
- package/lib/types/components/text/time.d.ts +0 -2
- package/lib/types/components/text/type.d.ts +0 -2
- package/lib/types/components/tree/index.d.ts +0 -2
- package/lib/types/components/tree/tree.d.ts +0 -2
- package/lib/types/components/tree/type.d.ts +0 -2
- package/lib/types/components/upload/index.d.ts +0 -2
- package/lib/types/components/upload/type.d.ts +0 -2
- package/lib/types/components/upload/upload.d.ts +0 -2
- package/lib/types/components/video/index.d.ts +0 -2
- package/lib/types/components/video/type.d.ts +0 -2
- package/lib/types/components/video/video.d.ts +0 -2
- package/lib/types/index.d.ts +0 -2
- package/lib/types/js/usePreview/index.d.ts +0 -2
- package/lib/types/js/usePreview/type.d.ts +0 -2
- package/lib/types/type/index.d.ts +0 -2
- package/package.json +20 -11
- package/lib/components/affix/affix.js +0 -2
- package/lib/components/affix/affix.js.map +0 -1
- package/lib/components/affix/index.js +0 -2
- package/lib/components/affix/totop.js +0 -2
- package/lib/components/affix/totop.js.map +0 -1
- package/lib/components/badge/badge.js +0 -2
- package/lib/components/badge/badge.js.map +0 -1
- package/lib/components/badge/index.js +0 -2
- package/lib/components/button/button.js +0 -2
- package/lib/components/button/button.js.map +0 -1
- package/lib/components/button/group.js +0 -2
- package/lib/components/button/group.js.map +0 -1
- package/lib/components/button/index.js +0 -2
- package/lib/components/button/index.js.map +0 -1
- package/lib/components/button/toggle.js +0 -2
- package/lib/components/button/toggle.js.map +0 -1
- package/lib/components/card/card.js +0 -2
- package/lib/components/card/card.js.map +0 -1
- package/lib/components/card/index.js +0 -2
- package/lib/components/checkbox/checkbox.js +0 -2
- package/lib/components/checkbox/checkbox.js.map +0 -1
- package/lib/components/checkbox/index.js +0 -2
- package/lib/components/checkbox/item.js +0 -2
- package/lib/components/checkbox/item.js.map +0 -1
- package/lib/components/collapse/collapse.js +0 -2
- package/lib/components/collapse/collapse.js.map +0 -1
- package/lib/components/collapse/index.js +0 -2
- package/lib/components/collapse/index.js.map +0 -1
- package/lib/components/collapse/item.js +0 -2
- package/lib/components/collapse/item.js.map +0 -1
- package/lib/components/datagrid/cell.js +0 -2
- package/lib/components/datagrid/cell.js.map +0 -1
- package/lib/components/datagrid/datagrid.js +0 -2
- package/lib/components/datagrid/datagrid.js.map +0 -1
- package/lib/components/datagrid/index.js +0 -2
- package/lib/components/datagrid/index.js.map +0 -1
- package/lib/components/datagrid/resize.js +0 -2
- package/lib/components/datagrid/resize.js.map +0 -1
- package/lib/components/datagrid/row.js +0 -2
- package/lib/components/datagrid/row.js.map +0 -1
- package/lib/components/datagrid/sorter.js +0 -2
- package/lib/components/datagrid/sorter.js.map +0 -1
- package/lib/components/description/description.js +0 -2
- package/lib/components/description/description.js.map +0 -1
- package/lib/components/description/index.js +0 -2
- package/lib/components/description/index.js.map +0 -1
- package/lib/components/drawer/drawer.js +0 -2
- package/lib/components/drawer/drawer.js.map +0 -1
- package/lib/components/drawer/index.js +0 -2
- package/lib/components/drawer/index.js.map +0 -1
- package/lib/components/dropdown/dropdown.js +0 -2
- package/lib/components/dropdown/dropdown.js.map +0 -1
- package/lib/components/dropdown/index.js +0 -2
- package/lib/components/dropdown/index.js.map +0 -1
- package/lib/components/dropdown/item.js +0 -2
- package/lib/components/dropdown/item.js.map +0 -1
- package/lib/components/editor/controls.js +0 -2
- package/lib/components/editor/controls.js.map +0 -1
- package/lib/components/editor/editor.js +0 -2
- package/lib/components/editor/editor.js.map +0 -1
- package/lib/components/editor/index.js +0 -2
- package/lib/components/editor/index.js.map +0 -1
- package/lib/components/flex/flex.js +0 -2
- package/lib/components/flex/flex.js.map +0 -1
- package/lib/components/flex/index.js +0 -2
- package/lib/components/flex/index.js.map +0 -1
- package/lib/components/form/context.js +0 -2
- package/lib/components/form/context.js.map +0 -1
- package/lib/components/form/field.js +0 -2
- package/lib/components/form/field.js.map +0 -1
- package/lib/components/form/form.js +0 -2
- package/lib/components/form/form.js.map +0 -1
- package/lib/components/form/index.js +0 -2
- package/lib/components/form/index.js.map +0 -1
- package/lib/components/form/useForm.js +0 -2
- package/lib/components/form/useForm.js.map +0 -1
- package/lib/components/icon/icon.js +0 -2
- package/lib/components/icon/icon.js.map +0 -1
- package/lib/components/icon/index.js +0 -2
- package/lib/components/icon/index.js.map +0 -1
- package/lib/components/image/image.js +0 -2
- package/lib/components/image/image.js.map +0 -1
- package/lib/components/image/index.js +0 -2
- package/lib/components/image/index.js.map +0 -1
- package/lib/components/image/list.js +0 -2
- package/lib/components/image/list.js.map +0 -1
- package/lib/components/input/container.js +0 -2
- package/lib/components/input/container.js.map +0 -1
- package/lib/components/input/index.js +0 -2
- package/lib/components/input/index.js.map +0 -1
- package/lib/components/input/input.js +0 -2
- package/lib/components/input/input.js.map +0 -1
- package/lib/components/input/number.js +0 -2
- package/lib/components/input/number.js.map +0 -1
- package/lib/components/input/range.js +0 -2
- package/lib/components/input/range.js.map +0 -1
- package/lib/components/input/textarea.js +0 -2
- package/lib/components/input/textarea.js.map +0 -1
- package/lib/components/list/index.js +0 -2
- package/lib/components/list/index.js.map +0 -1
- package/lib/components/list/item.js +0 -2
- package/lib/components/list/item.js.map +0 -1
- package/lib/components/list/list.js +0 -2
- package/lib/components/list/list.js.map +0 -1
- package/lib/components/loading/index.js +0 -2
- package/lib/components/loading/index.js.map +0 -1
- package/lib/components/loading/loading.js +0 -2
- package/lib/components/loading/loading.js.map +0 -1
- package/lib/components/message/index.js +0 -2
- package/lib/components/message/index.js.map +0 -1
- package/lib/components/message/message.js +0 -2
- package/lib/components/message/message.js.map +0 -1
- package/lib/components/modal/hookModal.js +0 -2
- package/lib/components/modal/hookModal.js.map +0 -1
- package/lib/components/modal/index.js +0 -2
- package/lib/components/modal/index.js.map +0 -1
- package/lib/components/modal/modal.js +0 -2
- package/lib/components/modal/modal.js.map +0 -1
- package/lib/components/modal/useModal.js +0 -2
- package/lib/components/modal/useModal.js.map +0 -1
- package/lib/components/pagination/index.js +0 -2
- package/lib/components/pagination/index.js.map +0 -1
- package/lib/components/pagination/page.js +0 -2
- package/lib/components/pagination/page.js.map +0 -1
- package/lib/components/pagination/pagination.js +0 -2
- package/lib/components/pagination/pagination.js.map +0 -1
- package/lib/components/picker/colors/footer.js +0 -2
- package/lib/components/picker/colors/footer.js.map +0 -1
- package/lib/components/picker/colors/handle.js +0 -2
- package/lib/components/picker/colors/handle.js.map +0 -1
- package/lib/components/picker/colors/index.js +0 -2
- package/lib/components/picker/colors/index.js.map +0 -1
- package/lib/components/picker/dates/dates.js +0 -2
- package/lib/components/picker/dates/dates.js.map +0 -1
- package/lib/components/picker/dates/index.js +0 -2
- package/lib/components/picker/dates/index.js.map +0 -1
- package/lib/components/picker/dates/panel.js +0 -2
- package/lib/components/picker/dates/panel.js.map +0 -1
- package/lib/components/picker/time/index.js +0 -2
- package/lib/components/picker/time/index.js.map +0 -1
- package/lib/components/picker/time/item.js +0 -2
- package/lib/components/picker/time/item.js.map +0 -1
- package/lib/components/picker/time/panel.js +0 -2
- package/lib/components/picker/time/panel.js.map +0 -1
- package/lib/components/popconfirm/index.js +0 -2
- package/lib/components/popconfirm/index.js.map +0 -1
- package/lib/components/popconfirm/popconfirm.js +0 -2
- package/lib/components/popconfirm/popconfirm.js.map +0 -1
- package/lib/components/popup/content.js +0 -2
- package/lib/components/popup/content.js.map +0 -1
- package/lib/components/popup/index.js +0 -2
- package/lib/components/popup/index.js.map +0 -1
- package/lib/components/popup/popup.js +0 -2
- package/lib/components/popup/popup.js.map +0 -1
- package/lib/components/progress/circle.js +0 -2
- package/lib/components/progress/circle.js.map +0 -1
- package/lib/components/progress/index.js +0 -2
- package/lib/components/progress/index.js.map +0 -1
- package/lib/components/progress/line.js +0 -2
- package/lib/components/progress/line.js.map +0 -1
- package/lib/components/progress/progress.js +0 -2
- package/lib/components/progress/progress.js.map +0 -1
- package/lib/components/radio/index.js +0 -2
- package/lib/components/radio/index.js.map +0 -1
- package/lib/components/radio/item.js +0 -2
- package/lib/components/radio/item.js.map +0 -1
- package/lib/components/radio/radio.js +0 -2
- package/lib/components/radio/radio.js.map +0 -1
- package/lib/components/resizable/index.js +0 -2
- package/lib/components/resizable/index.js.map +0 -1
- package/lib/components/resizable/resizable.js +0 -2
- package/lib/components/resizable/resizable.js.map +0 -1
- package/lib/components/select/index.js +0 -2
- package/lib/components/select/index.js.map +0 -1
- package/lib/components/select/options.js +0 -2
- package/lib/components/select/options.js.map +0 -1
- package/lib/components/select/select.js +0 -2
- package/lib/components/select/select.js.map +0 -1
- package/lib/components/step/divider.js +0 -2
- package/lib/components/step/divider.js.map +0 -1
- package/lib/components/step/index.js +0 -2
- package/lib/components/step/index.js.map +0 -1
- package/lib/components/step/item.js +0 -2
- package/lib/components/step/item.js.map +0 -1
- package/lib/components/step/step.js +0 -2
- package/lib/components/step/step.js.map +0 -1
- package/lib/components/swiper/index.js +0 -2
- package/lib/components/swiper/index.js.map +0 -1
- package/lib/components/swiper/item.js +0 -2
- package/lib/components/swiper/item.js.map +0 -1
- package/lib/components/swiper/swiper.js +0 -2
- package/lib/components/swiper/swiper.js.map +0 -1
- package/lib/components/tabs/index.js +0 -2
- package/lib/components/tabs/index.js.map +0 -1
- package/lib/components/tabs/item.js +0 -2
- package/lib/components/tabs/item.js.map +0 -1
- package/lib/components/tabs/tabs.js +0 -2
- package/lib/components/tabs/tabs.js.map +0 -1
- package/lib/components/tag/index.js +0 -2
- package/lib/components/tag/index.js.map +0 -1
- package/lib/components/tag/tag.js +0 -2
- package/lib/components/tag/tag.js.map +0 -1
- package/lib/components/text/highlight.js +0 -2
- package/lib/components/text/highlight.js.map +0 -1
- package/lib/components/text/index.js +0 -2
- package/lib/components/text/index.js.map +0 -1
- package/lib/components/text/number.js +0 -2
- package/lib/components/text/number.js.map +0 -1
- package/lib/components/text/text.js +0 -2
- package/lib/components/text/text.js.map +0 -1
- package/lib/components/text/time.js +0 -2
- package/lib/components/text/time.js.map +0 -1
- package/lib/components/tree/index.js +0 -2
- package/lib/components/tree/index.js.map +0 -1
- package/lib/components/tree/item.js +0 -2
- package/lib/components/tree/item.js.map +0 -1
- package/lib/components/tree/tree.js +0 -2
- package/lib/components/tree/tree.js.map +0 -1
- package/lib/components/upload/index.js +0 -2
- package/lib/components/upload/index.js.map +0 -1
- package/lib/components/upload/renderFile.js +0 -2
- package/lib/components/upload/renderFile.js.map +0 -1
- package/lib/components/upload/upload.js +0 -2
- package/lib/components/upload/upload.js.map +0 -1
- package/lib/components/utils/empty/index.js +0 -2
- package/lib/components/utils/empty/index.js.map +0 -1
- package/lib/components/utils/helpericon/helpericon.js +0 -2
- package/lib/components/utils/helpericon/helpericon.js.map +0 -1
- package/lib/components/utils/helpericon/index.js +0 -2
- package/lib/components/utils/helpericon/index.js.map +0 -1
- package/lib/components/video/index.js +0 -2
- package/lib/components/video/index.js.map +0 -1
- package/lib/components/video/video.js +0 -2
- package/lib/components/video/video.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/js/hooks.js +0 -2
- package/lib/js/hooks.js.map +0 -1
- package/lib/js/usePreview/content.js +0 -2
- package/lib/js/usePreview/content.js.map +0 -1
- package/lib/js/usePreview/index.js +0 -2
- package/lib/js/usePreview/index.js.map +0 -1
- package/lib/js/usePreview/renderFile.js +0 -2
- package/lib/js/usePreview/renderFile.js.map +0 -1
- package/lib/js/usePreview/type.js +0 -2
- package/lib/js/usePreview/type.js.map +0 -1
- package/lib/js/useRipple/index.js +0 -2
- package/lib/js/useRipple/index.js.map +0 -1
- package/lib/js/utils.js +0 -2
- package/lib/js/utils.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as s}from"react/jsx-runtime";import t from"classnames";const o=o=>{const{icon:i,text:r,size:a,absolute:n,style:l,className:c,...m}=o;return e("div",{className:t("i-loading-container",{absolute:n},c),style:{...l,inset:n?0:"unset"},...m,children:[i??s("svg",{width:"24",height:"24",stroke:"#000",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:"i-loading-icon",style:{fontSize:a},children:s("circle",{cx:"12",cy:"12",r:"9.5",fill:"none",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:40,strokeDashoffset:0})}),r]})};export{o as default};
|
|
2
|
-
//# sourceMappingURL=loading.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loading.js","sources":["../../../packages/components/loading/loading.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport \"./index.css\";\nimport { ILoading } from \"./type\";\n\nconst Loading = (props: ILoading) => {\n\tconst { icon, text, size, absolute, style, className, ...restProps } =\n\t\tprops;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t\"i-loading-container\",\n\t\t\t\t{\n\t\t\t\t\tabsolute,\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tstyle={{\n\t\t\t\t...style,\n\t\t\t\tinset: absolute ? 0 : \"unset\",\n\t\t\t}}\n\t\t\t{...restProps}\n\t\t>\n\t\t\t{icon ?? (\n\t\t\t\t<svg\n\t\t\t\t\twidth='24'\n\t\t\t\t\theight='24'\n\t\t\t\t\tstroke='#000'\n\t\t\t\t\tviewBox='0 0 24 24'\n\t\t\t\t\txmlns='http://www.w3.org/2000/svg'\n\t\t\t\t\tclassName='i-loading-icon'\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tfontSize: size,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<circle\n\t\t\t\t\t\tcx='12'\n\t\t\t\t\t\tcy='12'\n\t\t\t\t\t\tr='9.5'\n\t\t\t\t\t\tfill='none'\n\t\t\t\t\t\tstrokeWidth='3'\n\t\t\t\t\t\tstrokeLinecap='round'\n\t\t\t\t\t\tstrokeDasharray={40}\n\t\t\t\t\t\tstrokeDashoffset={0}\n\t\t\t\t\t/>\n\t\t\t\t</svg>\n\t\t\t)}\n\n\t\t\t{text}\n\t\t</div>\n\t);\n};\n\nexport default Loading;\n"],"names":["Loading","props","icon","text","size","absolute","style","className","restProps","_jsxs","classNames","inset","children","_jsx","width","height","stroke","viewBox","xmlns","fontSize","cx","cy","r","fill","strokeWidth","strokeLinecap","strokeDasharray","strokeDashoffset"],"mappings":"4EAIA,MAAMA,EAAWC,IAChB,MAAMC,KAAEA,EAAIC,KAAEA,EAAIC,KAAEA,EAAIC,SAAEA,EAAQC,MAAEA,EAAKC,UAAEA,KAAcC,GACxDP,EAED,OACCQ,EACC,MAAA,CAAAF,UAAWG,EACV,sBACA,CACCL,YAEDE,GAEDD,MAAO,IACHA,EACHK,MAAON,EAAW,EAAI,YAEnBG,EAASI,SAAA,CAEZV,GACAW,EAAA,MAAA,CACCC,MAAM,KACNC,OAAO,KACPC,OAAO,OACPC,QAAQ,YACRC,MAAM,6BACNX,UAAU,iBACVD,MAAO,CACNa,SAAUf,GACVQ,SAEDC,YACCO,GAAG,KACHC,GAAG,KACHC,EAAE,MACFC,KAAK,OACLC,YAAY,IACZC,cAAc,QACdC,gBAAiB,GACjBC,iBAAkB,MAKpBxB,IACI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useReactive as s}from"ahooks";import i from"classnames";import{uid as c}from"radash";import{useRef as o,useEffect as r,isValidElement as a}from"react";import{createRoot as l}from"react-dom/client";const m={left:"flex-start",center:"center",right:"flex-end"},u=12,d={duration:3e3,closable:!0,active:!1},f=function(){const e=document.createElement("div");return e.dataset.id="messages",document.body.append(e),e}(),g={oneInstance:null,callout(e){},close(){}},p={left:[],center:[],right:[]},h={left:[],center:[],right:[]};l(f).render(e((function(){const i=o(null),c=s({items:{left:[],center:[],right:[]},tops:{left:[],center:[],right:[]}}),a={left:0,center:0,right:0};r((()=>{Object.assign(g,{callout:function(e){const{align:t="center",unshift:n,onShow:s}=e,o=p[t][n?"unshift":"push"](e);c.items[t]=[...p[t]],e.close=this.close.bind(e),setTimeout((()=>{const e=i.current?.offsetHeight||0;p[t][n?0:o-1].active=!0,c.items[t]=[...p[t]],h[t][n?"unshift":"push"](e),c.tops[t]=[...h[t]],s?.()}),12),0!==e.duration&&(e.timer=setTimeout((()=>{this.close.call(e)}),e.duration))},close:function(){const e=this,{align:t="center",onHide:n}=e,s=p[t].findIndex((t=>t.id===e.id));s<0||(p[t][s].active=!1,c.items[t]=[...p[t]],e.timer=setTimeout((()=>{const s=p[t].findIndex((t=>t.id===e.id));p[t].splice(s,1),h[t].splice(s,1),c.tops[t]=[...h[t]],c.items[t]=[...p[t]],e.timer&&clearTimeout(e.timer),n?.()}),240))}})}),[]);const l=(t,s)=>{if(!t)return e(n,{});const{id:o,active:r,content:l,align:d="center",className:f}=t;a[d]+=c.tops[d][s-1]||0;const p=u*s+a[d];return e(b,{ref:i,active:r,content:l,top:p,className:f,style:{alignSelf:m[d]},onClick:g.close.bind(t)},o)};return t("div",{className:"i-messages",children:[c.items.left.map(l),c.items.center.map(l),c.items.right.map(l)]})}),{}));const b=function({ref:t,active:n,content:s,top:c,className:o,style:r,onClick:a}){return e("div",{ref:t,className:i("i-message",o,{"i-message-active":n}),style:{...r,top:c},onClick:a,children:s})};function v(e){return(["string","number"].includes(typeof e)||a(e))&&(e={content:e}),e=Object.assign({id:c(7)},d,e),g.callout(e),{instance:e,close:g.close.bind(e)}}v.error=e=>v({content:e,className:"bg-error"}),v.success=e=>v({content:e,className:"bg-success"}),v.warning=e=>v({content:e,className:"bg-warning"}),v.one=e=>{const t=g.oneInstance;if(t)t.active&&0!==t.duration?(clearTimeout(t.timer),t.timer=setTimeout((()=>{t.close?.()}),t.duration)):g.callout(t);else{const{instance:t}=v(e);g.oneInstance=t}};export{v as default};
|
|
2
|
-
//# sourceMappingURL=message.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","sources":["../../../packages/components/message/message.tsx"],"sourcesContent":["import { useReactive } from \"ahooks\";\nimport classNames from \"classnames\";\nimport { uid } from \"radash\";\nimport { ReactNode, isValidElement, useEffect, useRef } from \"react\";\nimport { createRoot } from \"react-dom/client\";\nimport \"./index.css\";\nimport type { IMessage, IMessageItem, THeights, TMessageQueue } from \"./type\";\n\nconst AlignMap = {\n\tleft: \"flex-start\",\n\tcenter: \"center\",\n\tright: \"flex-end\",\n};\n\nconst GlobalConfig = {\n\talign: \"center\",\n\toffset: \"12px\",\n\tgap: 12,\n};\n\nconst ItemDefaultConfig = {\n\tduration: 3000,\n\tclosable: true,\n\tactive: false,\n};\n\nconst container = createContainer();\nconst handler: {\n\toneInstance: null | IMessage;\n\tcallout: (item: IMessage) => void;\n\tclose: () => void;\n} = {\n\toneInstance: null,\n\tcallout(item: IMessage) {},\n\tclose() {},\n};\n\nconst queue: TMessageQueue = {\n\tleft: [],\n\tcenter: [],\n\tright: [],\n};\nconst heights: THeights = {\n\tleft: [],\n\tcenter: [],\n\tright: [],\n};\n\ncreateRoot(container).render(<Messages />);\n\nconst MessageItem = function ({\n\tref,\n\tactive,\n\tcontent,\n\ttop,\n\tclassName,\n\tstyle,\n\tonClick,\n}: IMessageItem) {\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={classNames(\"i-message\", className, {\n\t\t\t\t\"i-message-active\": active,\n\t\t\t})}\n\t\t\tstyle={{\n\t\t\t\t...style,\n\t\t\t\ttop,\n\t\t\t}}\n\t\t\tonClick={onClick}\n\t\t>\n\t\t\t{content}\n\t\t</div>\n\t);\n};\n\nfunction Messages() {\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst state = useReactive<{\n\t\ttops: THeights;\n\t\titems: TMessageQueue;\n\t}>({\n\t\titems: {\n\t\t\tleft: [],\n\t\t\tcenter: [],\n\t\t\tright: [],\n\t\t},\n\t\ttops: {\n\t\t\tleft: [],\n\t\t\tcenter: [],\n\t\t\tright: [],\n\t\t},\n\t});\n\tconst offsetTop = {\n\t\tleft: 0,\n\t\tcenter: 0,\n\t\tright: 0,\n\t};\n\n\tuseEffect(() => {\n\t\tObject.assign(handler, {\n\t\t\tcallout: function (item: IMessage) {\n\t\t\t\tconst { align = \"center\", unshift, onShow } = item;\n\t\t\t\tconst size = queue[align][unshift ? \"unshift\" : \"push\"](item);\n\t\t\t\tstate.items[align] = [...queue[align]];\n\t\t\t\titem.close = this.close.bind(item);\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tconst h = ref.current?.offsetHeight || 0;\n\n\t\t\t\t\tqueue[align][unshift ? 0 : size - 1].active = true;\n\t\t\t\t\tstate.items[align] = [...queue[align]];\n\t\t\t\t\theights[align][unshift ? \"unshift\" : \"push\"](h);\n\t\t\t\t\tstate.tops[align] = [...heights[align]];\n\t\t\t\t\tonShow?.();\n\t\t\t\t}, 12);\n\n\t\t\t\tif (item.duration !== 0) {\n\t\t\t\t\titem.timer = setTimeout(() => {\n\t\t\t\t\t\tthis.close.call(item);\n\t\t\t\t\t}, item.duration);\n\t\t\t\t}\n\t\t\t},\n\t\t\tclose: function () {\n\t\t\t\tconst item = this as IMessage;\n\t\t\t\tconst { align = \"center\", onHide } = item;\n\t\t\t\tconst index = queue[align].findIndex((i) => i.id === item.id);\n\t\t\t\tif (index < 0) return;\n\n\t\t\t\tqueue[align][index].active = false;\n\t\t\t\tstate.items[align] = [...queue[align]];\n\n\t\t\t\titem.timer = setTimeout(() => {\n\t\t\t\t\tconst index = queue[align].findIndex(\n\t\t\t\t\t\t(i) => i.id === item.id\n\t\t\t\t\t);\n\n\t\t\t\t\tqueue[align].splice(index, 1);\n\t\t\t\t\theights[align].splice(index, 1);\n\t\t\t\t\tstate.tops[align] = [...heights[align]];\n\t\t\t\t\tstate.items[align] = [...queue[align]];\n\t\t\t\t\titem.timer && clearTimeout(item.timer);\n\t\t\t\t\tonHide?.();\n\t\t\t\t}, 240);\n\t\t\t},\n\t\t});\n\t}, []);\n\n\tconst renderItems = (item, i) => {\n\t\tif (!item) return <></>;\n\n\t\tconst { id, active, content, align = \"center\", className } = item;\n\t\toffsetTop[align] += state.tops[align][i - 1] || 0;\n\t\tconst top = GlobalConfig.gap * i + offsetTop[align];\n\n\t\treturn (\n\t\t\t<MessageItem\n\t\t\t\tkey={id}\n\t\t\t\tref={ref}\n\t\t\t\tactive={active}\n\t\t\t\tcontent={content}\n\t\t\t\ttop={top}\n\t\t\t\tclassName={className}\n\t\t\t\tstyle={{ alignSelf: AlignMap[align] }}\n\t\t\t\tonClick={handler.close.bind(item)}\n\t\t\t/>\n\t\t);\n\t};\n\n\treturn (\n\t\t<div className='i-messages'>\n\t\t\t{state.items.left.map(renderItems)}\n\t\t\t{state.items.center.map(renderItems)}\n\t\t\t{state.items.right.map(renderItems)}\n\t\t</div>\n\t);\n}\n\nexport function setMessageConfig(config: IMessage) {\n\tObject.assign(GlobalConfig, config);\n}\n\nfunction message(config: IMessage | ReactNode) {\n\tif (\n\t\t[\"string\", \"number\"].includes(typeof config) ||\n\t\tisValidElement(config)\n\t) {\n\t\tconfig = { content: config as ReactNode };\n\t}\n\n\tconfig = Object.assign(\n\t\t{ id: uid(7) },\n\t\tItemDefaultConfig,\n\t\tconfig as IMessage\n\t);\n\n\thandler.callout(config as IMessage);\n\n\treturn {\n\t\tinstance: config,\n\t\tclose: handler.close.bind(config),\n\t};\n}\n\nfunction createContainer() {\n\tconst container = document.createElement(\"div\");\n\tcontainer.dataset.id = \"messages\";\n\tdocument.body.append(container);\n\n\treturn container;\n}\n\nmessage.error = (content: ReactNode) => {\n\treturn message({\n\t\tcontent,\n\t\tclassName: \"bg-error\",\n\t});\n};\n\nmessage.success = (content: ReactNode) => {\n\treturn message({\n\t\tcontent,\n\t\tclassName: \"bg-success\",\n\t});\n};\n\nmessage.warning = (content: ReactNode) => {\n\treturn message({\n\t\tcontent,\n\t\tclassName: \"bg-warning\",\n\t});\n};\n\nmessage.one = (config: IMessage) => {\n\tconst o = handler.oneInstance;\n\n\tif (o) {\n\t\tif (o.active && o.duration !== 0) {\n\t\t\tclearTimeout(o.timer);\n\t\t\to.timer = setTimeout(() => {\n\t\t\t\to.close?.();\n\t\t\t}, o.duration);\n\t\t} else {\n\t\t\thandler.callout(o);\n\t\t}\n\t} else {\n\t\tconst { instance } = message(config);\n\t\thandler.oneInstance = instance;\n\t}\n};\n\nexport default message;\n"],"names":["AlignMap","left","center","right","GlobalConfig","ItemDefaultConfig","duration","closable","active","container","document","createElement","dataset","id","body","append","createContainer","handler","oneInstance","callout","item","close","queue","heights","createRoot","render","_jsx","ref","useRef","state","useReactive","items","tops","offsetTop","useEffect","Object","assign","align","unshift","onShow","size","this","bind","setTimeout","h","current","offsetHeight","timer","call","onHide","index","findIndex","i","splice","clearTimeout","renderItems","content","className","top","MessageItem","style","alignSelf","onClick","_jsxs","children","map","classNames","message","config","includes","isValidElement","uid","instance","error","success","warning","one","o"],"mappings":"4QAQA,MAAMA,EAAW,CAChBC,KAAM,aACNC,OAAQ,SACRC,MAAO,YAGFC,EAGA,GAGAC,EAAoB,CACzBC,SAAU,IACVC,UAAU,EACVC,QAAQ,GAGHC,EAkLN,WACC,MAAMA,EAAYC,S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E,IACPA,EAAGD,UACHA,EAASG,MACTA,EAAKE,QACLA,IAEA,OACCpC,EAAA,MAAA,CACCC,IAAKA,EACL8B,UAAWS,EAAW,YAAaT,EAAW,CAC7C,mBAAoBjD,IAErBoD,MAAO,IACHA,EACHF,OAEDI,QAASA,WAERN,GAGJ,EA4GA,SAASW,EAAQC,GAgBhB,OAdC,CAAC,SAAU,UAAUC,gBAAgBD,IACrCE,EAAeF,MAEfA,EAAS,CAAEZ,QAASY,IAGrBA,EAASjC,OAAOC,OACf,CAAEvB,GAAI0D,EAAI,IACVlE,EACA+D,GAGDnD,EAAQE,QAAQiD,GAET,CACNI,SAAUJ,EACV/C,MAAOJ,EAAQI,MAAMqB,KAAK0B,GAE5B,CAUAD,EAAQM,MAASjB,GACTW,EAAQ,CACdX,UACAC,UAAW,aAIbU,EAAQO,QAAWlB,GACXW,EAAQ,CACdX,UACAC,UAAW,eAIbU,EAAQQ,QAAWnB,GACXW,EAAQ,CACdX,UACAC,UAAW,eAIbU,EAAQS,IAAOR,IACd,MAAMS,EAAI5D,EAAQC,YAElB,GAAI2D,EACCA,EAAErE,QAAyB,IAAfqE,EAAEvE,UACjBgD,aAAauB,EAAE9B,OACf8B,EAAE9B,MAAQJ,YAAW,KACpBkC,EAAExD,SAAS,GACTwD,EAAEvE,WAELW,EAAQE,QAAQ0D,OAEX,CACN,MAAML,SAAEA,GAAaL,EAAQC,GAC7BnD,EAAQC,YAAcsD"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useReactive as o}from"ahooks";import{useImperativeHandle as r}from"react";import s from"./modal.js";const t=t=>{const{ref:i}=t,m=o({}),a=Object.assign({},t,m);return r(i,(()=>({update:(e={})=>{Object.assign(m,e)},close:()=>{m.visible=!1,a.closable||Promise.resolve().then((()=>{m.visible=!0}))}}))),e(s,{...a})};export{t as default};
|
|
2
|
-
//# sourceMappingURL=hookModal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hookModal.js","sources":["../../../packages/components/modal/hookModal.tsx"],"sourcesContent":["import { useReactive } from \"ahooks\";\nimport type { RefObject } from \"react\";\nimport { useImperativeHandle } from \"react\";\nimport Modal from \"./modal\";\nimport type { IModal, RefHookModal } from \"./type\";\n\nconst HookModal = (\n\tprops: IModal & { ref?: RefObject<RefHookModal | null> }\n) => {\n\tconst { ref } = props;\n\tconst state = useReactive<IModal>({});\n\n\tconst mergedProps = Object.assign({}, props, state);\n\n\tuseImperativeHandle(ref, () => ({\n\t\tupdate: (config: IModal = {}) => {\n\t\t\tObject.assign(state, config);\n\t\t},\n\n\t\tclose: () => {\n\t\t\tstate.visible = false;\n\n\t\t\tif (mergedProps.closable) return;\n\t\t\tPromise.resolve().then(() => {\n\t\t\t\tstate.visible = true;\n\t\t\t});\n\t\t},\n\t}));\n\n\treturn <Modal {...mergedProps} />;\n};\n\nexport default HookModal;\n"],"names":["HookModal","props","ref","state","useReactive","mergedProps","Object","assign","useImperativeHandle","update","config","close","visible","closable","Promise","resolve","then","_jsx","Modal"],"mappings":"mJAMA,MAAMA,EACLC,IAEA,MAAMC,IAAEA,GAAQD,EACVE,EAAQC,EAAoB,IAE5BC,EAAcC,OAAOC,OAAO,CAAA,EAAIN,EAAOE,GAiB7C,OAfAK,EAAoBN,GAAK,KAAO,CAC/BO,OAAQ,CAACC,EAAiB,MACzBJ,OAAOC,OAAOJ,EAAOO,EAAO,EAG7BC,MAAO,KACNR,EAAMS,SAAU,EAEZP,EAAYQ,UAChBC,QAAQC,UAAUC,MAAK,KACtBb,EAAMS,SAAU,CAAI,GACnB,MAIGK,EAACC,EAAU,IAAAb,GAAe"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../packages/components/modal/index.tsx"],"sourcesContent":["import Modal from \"./modal\";\nimport useModal from \"./useModal\";\n\nModal.useModal = useModal;\n\nexport default Modal;\n"],"names":["Modal","useModal"],"mappings":"uDAGAA,EAAMC,SAAWA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as o,jsxs as e,Fragment as t}from"react/jsx-runtime";import i from"classnames";import{useState as n,useRef as r,useEffect as c,useMemo as l}from"react";import{createPortal as s}from"react-dom";import{useKeydown as a}from"../../js/hooks.js";import"../button/index.js";import d from"../utils/helpericon/helpericon.js";import m from"../button/button.js";function u(i){const{title:n,footer:r,hideCloseButton:c,footerLeft:s,okButtonProps:a,cancelButtonProps:u,children:h,onOk:f,onClose:p}=i,k=n||!c,b=async()=>{await(f?.())||p?.()},C=l((()=>{if(r||null===r)return r;const i=Object.assign({children:"确定",onClick:b},a),n=Object.assign({secondary:!0,children:"关闭",onClick:p},u);return e(t,{children:[s,o(m,{...i}),o(m,{...n})]})}),[r,a,u]);return e(t,{children:[k&&e("header",{className:"i-modal-header",children:[n&&o("b",{children:n}),o(d,{active:!c,className:"i-modal-close",onClick:p})]}),o("div",{className:"i-modal-content",children:h}),o("footer",{className:"i-modal-footer",children:C})]})}function h(t){const{visible:l,title:d,footer:m,okButtonProps:h,cancelButtonProps:f,closable:p=!0,hideBackdrop:k,backdropClosable:b=!0,hideCloseButton:C,disableEsc:B,width:j,height:v,customized:N,fixed:P,hideShadow:g,children:y,style:O,className:w,keepDOM:x,footerLeft:E,onClick:L,onVisibleChange:T,onClose:z,onOk:D,...M}=t,[S,V]=n(l),[q,A]=n(!1),[F,G]=n(!1),H=r(!0),I=()=>{if(H.current){if(H.current=!1,!p)return G(!0),void setTimeout((()=>{G(!1),H.current=!0}),400);A(!1),setTimeout((()=>{!x&&V(!1),H.current=!0,T?.(!1),z?.()}),240)}};return a((o=>{"Escape"===o.code&&l&&I()}),{disabled:B}),c((()=>{l?H.current&&((!x||!S)&&V(!0),H.current=!1,setTimeout((()=>{A(!0),T?.(!0),H.current=!0}),24)):I()}),[l]),S?s(o("div",{className:i("i-modal-container",{"i-modal-backdrop":!k,"i-modal-customized":N,"i-modal-active":q,fixed:P},w),style:O,onClick:function(){b&&I()},children:e("div",{className:i("i-modal",{bounced:F,shadow:!g}),style:{width:j,height:v},onClick:o=>{o.stopPropagation(),document.documentElement.click(),L?.(o)},...M,children:[N&&y,!N&&o(u,{title:d,hideCloseButton:C,footer:m,okButtonProps:h,cancelButtonProps:f,children:y,footerLeft:E,onOk:D,onClose:I})]})}),document.body):null}export{h as default};
|
|
2
|
-
//# sourceMappingURL=modal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modal.js","sources":["../../../packages/components/modal/modal.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { useKeydown } from \"../../js/hooks\";\nimport Button from \"../button\";\nimport Helpericon from \"../utils/helpericon\";\nimport \"./index.css\";\nimport { CompositionModal, IModal, IModalContent } from \"./type\";\n\nfunction DefaultContent(props: IModalContent) {\n\tconst {\n\t\ttitle,\n\t\tfooter,\n\t\thideCloseButton,\n\t\tfooterLeft,\n\t\tokButtonProps,\n\t\tcancelButtonProps,\n\t\tchildren,\n\t\tonOk,\n\t\tonClose,\n\t} = props;\n\tconst showHeader = title || !hideCloseButton;\n\n\tconst handleOk = async () => {\n\t\tconst ret = await onOk?.();\n\n\t\tif (ret) return;\n\n\t\tonClose?.();\n\t};\n\n\tconst renderFooter = useMemo(() => {\n\t\tif (footer || footer === null) return footer;\n\n\t\tconst propsOk = Object.assign(\n\t\t\t{\n\t\t\t\tchildren: \"确定\",\n\t\t\t\tonClick: handleOk,\n\t\t\t},\n\t\t\tokButtonProps\n\t\t);\n\t\tconst propsCancel = Object.assign(\n\t\t\t{\n\t\t\t\tsecondary: true,\n\t\t\t\tchildren: \"关闭\",\n\t\t\t\tonClick: onClose,\n\t\t\t},\n\t\t\tcancelButtonProps\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{footerLeft}\n\t\t\t\t<Button {...propsOk} />\n\t\t\t\t<Button {...propsCancel} />\n\t\t\t</>\n\t\t);\n\t}, [footer, okButtonProps, cancelButtonProps]);\n\n\treturn (\n\t\t<>\n\t\t\t{showHeader && (\n\t\t\t\t<header className='i-modal-header'>\n\t\t\t\t\t{title && <b>{title}</b>}\n\n\t\t\t\t\t<Helpericon\n\t\t\t\t\t\tactive={!hideCloseButton}\n\t\t\t\t\t\tclassName='i-modal-close'\n\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t/>\n\t\t\t\t</header>\n\t\t\t)}\n\n\t\t\t<div className='i-modal-content'>{children}</div>\n\n\t\t\t<footer className='i-modal-footer'>{renderFooter}</footer>\n\t\t</>\n\t);\n}\n\nfunction Modal(props: IModal) {\n\tconst {\n\t\tvisible,\n\t\ttitle,\n\t\tfooter,\n\t\tokButtonProps,\n\t\tcancelButtonProps,\n\t\tclosable = true,\n\t\thideBackdrop,\n\t\tbackdropClosable = true,\n\t\thideCloseButton,\n\t\tdisableEsc,\n\t\twidth,\n\t\theight,\n\t\tcustomized,\n\t\tfixed,\n\t\thideShadow,\n\t\tchildren,\n\t\tstyle,\n\t\tclassName,\n\t\tkeepDOM,\n\t\tfooterLeft,\n\t\tonClick,\n\t\tonVisibleChange,\n\t\tonClose,\n\t\tonOk,\n\t\t...restProps\n\t} = props;\n\tconst [show, setShow] = useState(visible);\n\tconst [active, setActive] = useState(false);\n\tconst [bounced, setBounced] = useState(false);\n\tconst toggable = useRef(true);\n\n\tconst handleShow = () => {\n\t\tif (!toggable.current) return;\n\n\t\t(!keepDOM || !show) && setShow(true);\n\t\ttoggable.current = false;\n\t\tsetTimeout(() => {\n\t\t\tsetActive(true);\n\t\t\tonVisibleChange?.(true);\n\t\t\ttoggable.current = true;\n\t\t}, 24);\n\t};\n\n\tconst handleHide = () => {\n\t\tif (!toggable.current) return;\n\t\ttoggable.current = false;\n\n\t\tif (!closable) {\n\t\t\tsetBounced(true);\n\t\t\tsetTimeout(() => {\n\t\t\t\tsetBounced(false);\n\t\t\t\ttoggable.current = true;\n\t\t\t}, 400);\n\t\t\treturn;\n\t\t}\n\n\t\tsetActive(false);\n\t\tsetTimeout(() => {\n\t\t\t!keepDOM && setShow(false);\n\t\t\ttoggable.current = true;\n\t\t\tonVisibleChange?.(false);\n\t\t\tonClose?.();\n\t\t}, 240);\n\t};\n\n\tconst handleBackdropClick = function () {\n\t\tbackdropClosable && handleHide();\n\t};\n\n\tuseKeydown(\n\t\t(e) => {\n\t\t\tif (e.code !== \"Escape\" || !visible) return;\n\t\t\thandleHide();\n\t\t},\n\t\t{ disabled: disableEsc }\n\t);\n\n\tuseEffect(() => {\n\t\tvisible ? handleShow() : handleHide();\n\t}, [visible]);\n\n\tif (!show) return null;\n\n\treturn createPortal(\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t\"i-modal-container\",\n\t\t\t\t{\n\t\t\t\t\t\"i-modal-backdrop\": !hideBackdrop,\n\t\t\t\t\t\"i-modal-customized\": customized,\n\t\t\t\t\t\"i-modal-active\": active,\n\t\t\t\t\tfixed,\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tstyle={style}\n\t\t\tonClick={handleBackdropClick}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames(\"i-modal\", {\n\t\t\t\t\tbounced,\n\t\t\t\t\tshadow: !hideShadow,\n\t\t\t\t})}\n\t\t\t\tstyle={{\n\t\t\t\t\twidth,\n\t\t\t\t\theight,\n\t\t\t\t}}\n\t\t\t\tonClick={(e) => {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\tdocument.documentElement.click();\n\t\t\t\t\tonClick?.(e);\n\t\t\t\t}}\n\t\t\t\t{...restProps}\n\t\t\t>\n\t\t\t\t{customized && children}\n\n\t\t\t\t{!customized && (\n\t\t\t\t\t<DefaultContent\n\t\t\t\t\t\ttitle={title}\n\t\t\t\t\t\thideCloseButton={hideCloseButton}\n\t\t\t\t\t\tfooter={footer}\n\t\t\t\t\t\tokButtonProps={okButtonProps}\n\t\t\t\t\t\tcancelButtonProps={cancelButtonProps}\n\t\t\t\t\t\tchildren={children}\n\t\t\t\t\t\tfooterLeft={footerLeft}\n\t\t\t\t\t\tonOk={onOk}\n\t\t\t\t\t\tonClose={handleHide}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>,\n\t\tdocument.body\n\t);\n}\n\nexport default Modal as CompositionModal;\n"],"names":["DefaultContent","props","title","footer","hideCloseButton","footerLeft","okButtonProps","cancelButtonProps","children","onOk","onClose","showHeader","handleOk","async","renderFooter","useMemo","propsOk","Object","assign","onClick","propsCancel","secondary","_jsxs","_Fragment","_jsx","Button","className","Helpericon","active","Modal","visible","closable","hideBackdrop","backdropClosable","disableEsc","width","height","customized","fixed","hideShadow","style","keepDOM","onVisibleChange","restProps","show","setShow","useState","setActive","bounced","setBounced","toggable","useRef","handleHide","current","setTimeout","useKeydown","e","code","disabled","useEffect","createPortal","classNames","shadow","stopPropagation","document","documentElement","click","body"],"mappings":"0WASA,SAASA,EAAeC,GACvB,MAAMC,MACLA,EAAKC,OACLA,EAAMC,gBACNA,EAAeC,WACfA,EAAUC,cACVA,EAAaC,kBACbA,EAAiBC,SACjBA,EAAQC,KACRA,EAAIC,QACJA,GACGT,EACEU,EAAaT,IAAUE,EAEvBQ,EAAWC,gBACEJ,QAIlBC,KAAW,EAGNI,EAAeC,GAAQ,KAC5B,GAAIZ,GAAqB,OAAXA,EAAiB,OAAOA,EAEtC,MAAMa,EAAUC,OAAOC,OACtB,CACCV,SAAU,KACVW,QAASP,GAEVN,GAEKc,EAAcH,OAAOC,OAC1B,CACCG,WAAW,EACXb,SAAU,KACVW,QAAST,GAEVH,GAGD,OACCe,EACEC,EAAA,CAAAf,SAAA,CAAAH,EACDmB,EAACC,EAAW,IAAAT,IACZQ,EAACC,EAAM,IAAKL,MACV,GAEF,CAACjB,EAAQG,EAAeC,IAE3B,OACCe,EACEC,EAAA,CAAAf,SAAA,CAAAG,GACAW,YAAQI,UAAU,iBAAgBlB,SAAA,CAChCN,GAASs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,MAAA,CAAAE,UAAWmC,EACV,oBACA,CACC,oBAAqB7B,EACrB,qBAAsBK,EACtB,iBAAkBT,EAClBU,SAEDZ,GAEDc,MAAOA,EACPrB,QA/B0B,WAC3Bc,GAAoBmB,GACpB,WA+BC9B,EACC,MAAA,CAAAI,UAAWmC,EAAW,UAAW,CAChCb,UACAc,QAASvB,IAEVC,MAAO,CACNL,QACAC,UAEDjB,QAAUqC,IACTA,EAAEO,kBACFC,SAASC,gBAAgBC,QACzB/C,IAAUqC,EAAE,KAETb,EAASnC,SAAA,CAEZ6B,GAAc7B,GAEb6B,GACDb,EAACxB,EACA,CAAAE,MAAOA,EACPE,gBAAiBA,EACjBD,OAAQA,EACRG,cAAeA,EACfC,kBAAmBA,EACnBC,SAAUA,EACVH,WAAYA,EACZI,KAAMA,EACNC,QAAS0C,SAKbY,SAASG,MAlDQ,IAoDnB"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{useRef as o}from"react";import{renderNode as t}from"../../js/utils.js";import e from"./hookModal.js";function n(){const n=o(null);return{open:o=>{const s=t(r(e,{ref:n,visible:!0,...o,onClose:()=>{o.onClose?.(),s?.()}}))},update:r=>{if(!n.current)return;const{update:o}=n.current;o(r)},close:()=>{if(!n.current)return;const{close:r}=n.current;r()}}}export{n as default};
|
|
2
|
-
//# sourceMappingURL=useModal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useModal.js","sources":["../../../packages/components/modal/useModal.tsx"],"sourcesContent":["import { useRef } from \"react\";\nimport { renderNode } from \"../../js/utils\";\nimport HookModal from \"./hookModal\";\nimport { IModal, RefHookModal } from \"./type\";\n\nexport default function useModal() {\n\tconst ref = useRef<RefHookModal>(null);\n\n\tconst handleOpen = (props: IModal) => {\n\t\tconst unMount = renderNode(\n\t\t\t<HookModal\n\t\t\t\tref={ref}\n\t\t\t\tvisible\n\t\t\t\t{...props}\n\t\t\t\tonClose={() => {\n\t\t\t\t\tprops.onClose?.();\n\t\t\t\t\tunMount?.();\n\t\t\t\t}}\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst handleUpdate = (props: IModal) => {\n\t\tif (!ref.current) return;\n\n\t\tconst { update } = ref.current;\n\t\tupdate(props);\n\t};\n\n\tconst handleClose = () => {\n\t\tif (!ref.current) return;\n\n\t\tconst { close } = ref.current;\n\t\tclose();\n\t};\n\n\treturn {\n\t\topen: handleOpen,\n\t\tupdate: handleUpdate,\n\t\tclose: handleClose,\n\t};\n}\n"],"names":["useModal","ref","useRef","open","props","unMount","renderNode","_jsx","HookModal","visible","onClose","update","current","close"],"mappings":"oJAKc,SAAUA,IACvB,MAAMC,EAAMC,EAAqB,MA8BjC,MAAO,CACNC,KA7BmBC,IACnB,MAAMC,EAAUC,EACfC,EAACC,GACAP,IAAKA,EACLQ,SACI,KAAAL,EACJM,QAAS,KACRN,EAAMM,YACNL,KAAW,IAGb,EAmBDM,OAhBqBP,IACrB,IAAKH,EAAIW,QAAS,OAElB,MAAMD,OAAEA,GAAWV,EAAIW,QACvBD,EAAOP,EAAM,EAabS,MAVmB,KACnB,IAAKZ,EAAIW,QAAS,OAElB,MAAMC,MAAEA,GAAUZ,EAAIW,QACtBC,GAAO,EAQT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as a,jsx as e}from"react/jsx-runtime";import i from"classnames";import{useState as o}from"react";import r from"../loading/loading.js";const t=t=>{const{page:n,active:c,children:s,onChange:m}=t,[p,g]=o(!1);return a("a",{className:i("i-page",{"i-page-active":c,"i-page-loading":p,"i-page-disabled":!1}),"data-page":n,onClick:async()=>{c||p||(g(!0),await(m?.(n)),g(!1))},children:[p&&e(r,{}),s]})};export{t as default};
|
|
2
|
-
//# sourceMappingURL=page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sources":["../../../packages/components/pagination/page.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { useState } from \"react\";\nimport Loading from \"../loading\";\nimport { IPageItem } from \"./type\";\n\nconst Page = (props: IPageItem) => {\n\tconst { page, active, children, onChange } = props;\n\tconst [loading, setLoading] = useState(false);\n\n\tconst handleClick = async () => {\n\t\tif (active || loading) return;\n\n\t\tsetLoading(true);\n\t\tawait onChange?.(page);\n\t\tsetLoading(false);\n\t};\n\n\treturn (\n\t\t<a\n\t\t\tclassName={classNames(\"i-page\", {\n\t\t\t\t\"i-page-active\": active,\n\t\t\t\t\"i-page-loading\": loading,\n\t\t\t\t\"i-page-disabled\": false,\n\t\t\t})}\n\t\t\tdata-page={page}\n\t\t\tonClick={handleClick}\n\t\t>\n\t\t\t{loading && <Loading />}\n\t\t\t{children}\n\t\t</a>\n\t);\n};\n\nexport default Page;\n"],"names":["Page","props","page","active","children","onChange","loading","setLoading","useState","_jsxs","className","classNames","onClick","async","_jsx","Loading"],"mappings":"kJAKA,MAAMA,EAAQC,IACb,MAAMC,KAAEA,EAAIC,OAAEA,EAAMC,SAAEA,EAAQC,SAAEA,GAAaJ,GACtCK,EAASC,GAAcC,GAAS,GAUvC,OACCC,EACC,IAAA,CAAAC,UAAWC,EAAW,SAAU,CAC/B,gBAAiBR,EACjB,iBAAkBG,EAClB,mBAAmB,gBAETJ,EACXU,QAhBkBC,UACfV,GAAUG,IAEdC,GAAW,SACLF,IAAWH,IACjBK,GAAW,GAAM,EAafH,SAAA,CAAAE,GAAWQ,EAACC,EAAU,CAAA,GACtBX,IACE"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e,Fragment as n,jsxs as a}from"react/jsx-runtime";import{KeyboardArrowLeftRound as r,KeyboardArrowRightRound as i,MoreHorizRound as o}from"@ricons/material";import t from"classnames";import{useState as c,useMemo as m,useEffect as s}from"react";import p from"../icon/icon.js";import l from"./page.js";const g=g=>{const{page:h=1,size:d=10,total:f=0,sibling:u=2,prev:C=e(p,{icon:e(r,{})}),next:j=e(p,{icon:e(i,{})}),simple:v,jumper:x,className:y,renderEllipsis:M=()=>e(p,{icon:e(o,{}),className:"color-7"}),renderPage:N=e=>e,onChange:w,...P}=g,[b,z]=c(h),[A,E]=c(!1),k=m((()=>Math.ceil(f/d)),[d,f]),[q,B,D]=m((()=>{const e=Math.max(1,b-u),n=Math.min(k,b+u);return[e,n,Array.from({length:n-e+1}).map(((n,a)=>e+a))]}),[b,k,u]);if(k<=b&&1===b)return e(n,{});const F=async e=>{if(w&&!A)return E(!0),new Promise((async n=>{void 0!==e&&(await w(e),z(e),E(!1),n())}))};return s((()=>z(h)),[h]),a("div",{className:t("i-pagination",y),...P,children:[C&&e(l,{page:b-1||1,onChange:F,children:C}),q>1&&e(l,{page:1,onChange:F,children:N(1)}),q>2&&M(),D.map((n=>e(l,{page:n,active:n===b,onChange:F,children:N(n)},n))),B<k-1&&M(),B<k&&e(l,{page:k,onChange:F,children:N(k)}),j&&e(l,{page:b+1,onChange:F,children:j})]})};export{g as default};
|
|
2
|
-
//# sourceMappingURL=pagination.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.js","sources":["../../../packages/components/pagination/pagination.tsx"],"sourcesContent":["import {\n\tKeyboardArrowLeftRound,\n\tKeyboardArrowRightRound,\n\tMoreHorizRound,\n} from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport Icon from \"../icon\";\nimport \"./index.css\";\nimport Page from \"./page\";\nimport { IPagination } from \"./type\";\n\nconst Pagination = (props: IPagination) => {\n\tconst {\n\t\tpage: defaultPage = 1,\n\t\tsize = 10,\n\t\ttotal = 0,\n\t\tsibling = 2,\n\t\tprev = <Icon icon={<KeyboardArrowLeftRound />} />,\n\t\tnext = <Icon icon={<KeyboardArrowRightRound />} />,\n\t\tsimple,\n\t\tjumper,\n\t\tclassName,\n\t\trenderEllipsis = () => (\n\t\t\t<Icon icon={<MoreHorizRound />} className='color-7' />\n\t\t),\n\t\trenderPage = (i) => i,\n\t\tonChange,\n\t\t...restProps\n\t} = props;\n\n\tconst [page, setPage] = useState(defaultPage);\n\tconst [loading, setLoading] = useState(false);\n\n\tconst totalPage = useMemo(() => Math.ceil(total / size), [size, total]);\n\n\tconst [start, end, loop] = useMemo(() => {\n\t\tconst start = Math.max(1, page - sibling);\n\t\tconst end = Math.min(totalPage, page + sibling);\n\n\t\treturn [\n\t\t\tstart,\n\t\t\tend,\n\t\t\tArray.from({ length: end - start + 1 }).map((n, i) => start + i),\n\t\t];\n\t}, [page, totalPage, sibling]);\n\n\tif (totalPage <= page && page === 1) return <></>;\n\n\tconst handlePageChange = async (p?: number) => {\n\t\tif (!onChange || loading) return;\n\t\tsetLoading(true);\n\n\t\treturn new Promise<void>(async (resolve) => {\n\t\t\tif (p === undefined) return;\n\t\t\tawait onChange(p);\n\t\t\tsetPage(p);\n\t\t\tsetLoading(false);\n\t\t\tresolve();\n\t\t});\n\t};\n\n\tuseEffect(() => setPage(defaultPage), [defaultPage]);\n\n\treturn (\n\t\t<div className={classNames(\"i-pagination\", className)} {...restProps}>\n\t\t\t{prev && (\n\t\t\t\t<Page page={page - 1 || 1} onChange={handlePageChange}>\n\t\t\t\t\t{prev}\n\t\t\t\t</Page>\n\t\t\t)}\n\n\t\t\t{start > 1 && (\n\t\t\t\t<Page page={1} onChange={handlePageChange}>\n\t\t\t\t\t{renderPage(1)}\n\t\t\t\t</Page>\n\t\t\t)}\n\n\t\t\t{start > 2 && renderEllipsis()}\n\n\t\t\t{loop.map((p) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Page\n\t\t\t\t\t\tkey={p}\n\t\t\t\t\t\tpage={p}\n\t\t\t\t\t\tactive={p === page}\n\t\t\t\t\t\tonChange={handlePageChange}\n\t\t\t\t\t>\n\t\t\t\t\t\t{renderPage(p)}\n\t\t\t\t\t</Page>\n\t\t\t\t);\n\t\t\t})}\n\n\t\t\t{end < totalPage - 1 && renderEllipsis()}\n\n\t\t\t{end < totalPage && (\n\t\t\t\t<Page page={totalPage} onChange={handlePageChange}>\n\t\t\t\t\t{renderPage(totalPage)}\n\t\t\t\t</Page>\n\t\t\t)}\n\n\t\t\t{next && (\n\t\t\t\t<Page page={page + 1} onChange={handlePageChange}>\n\t\t\t\t\t{next}\n\t\t\t\t</Page>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport default Pagination;\n"],"names":["Pagination","props","page","defaultPage","size","total","sibling","prev","_jsx","Icon","icon","KeyboardArrowLeftRound","next","KeyboardArrowRightRound","simple","jumper","className","renderEllipsis","MoreHorizRound","renderPage","i","onChange","restProps","setPage","useState","loading","setLoading","totalPage","useMemo","Math","ceil","start","end","loop","max","min","Array","from","length","map","n","handlePageChange","async","p","Promise","resolve","undefined","useEffect","_jsxs","classNames","children","Page","active"],"mappings":"0TAYA,MAAMA,EAAcC,IACnB,MACCC,KAAMC,EAAc,EAACC,KACrBA,EAAO,GAAEC,MACTA,EAAQ,EAACC,QACTA,EAAU,EAACC,KACXA,EAAOC,EAACC,EAAK,CAAAC,KAAMF,EAACG,QAA6BC,KACjDA,EAAOJ,EAACC,EAAK,CAAAC,KAAMF,EAACK,QAA8BC,OAClDA,EAAMC,OACNA,EAAMC,UACNA,EAASC,eACTA,EAAiB,IAChBT,EAACC,EAAK,CAAAC,KAAMF,EAACU,MAAmBF,UAAU,YAC1CG,WACDA,EAAcC,GAAMA,EAACC,SACrBA,KACGC,GACArB,GAEGC,EAAMqB,GAAWC,EAASrB,IAC1BsB,EAASC,GAAcF,GAAS,GAEjCG,EAAYC,GAAQ,IAAMC,KAAKC,KAAKzB,EAAQD,IAAO,CAACA,EAAMC,KAEzD0B,EAAOC,EAAKC,GAAQL,GAAQ,KAClC,MAAMG,EAAQF,KAAKK,IAAI,EAAGhC,EAAOI,GAC3B0B,EAAMH,KAAKM,IAAIR,EAAWzB,EAAOI,GAEvC,MAAO,CACNyB,EACAC,EACAI,MAAMC,KAAK,CAAEC,OAAQN,EAAMD,EAAQ,IAAKQ,KAAI,CAACC,EAAGpB,IAAMW,EAAQX,IAC9D,GACC,CAAClB,EAAMyB,EAAWrB,IAErB,GAAIqB,GAAazB,GAAiB,IAATA,EAAY,OAAOM,QAE5C,MAAMiC,EAAmBC,MAAOC,IAC/B,GAAKtB,IAAYI,EAGjB,OAFAC,GAAW,GAEJ,IAAIkB,SAAcF,MAAOG,SACrBC,IAANH,UACEtB,EAASsB,GACfpB,EAAQoB,GACRjB,GAAW,GACXmB,IAAS,GACR,EAKH,OAFAE,GAAU,IAAMxB,EAAQpB,IAAc,CAACA,IAGtC6C,EAAA,MAAA,CAAKhC,UAAWiC,EAAW,eAAgBjC,MAAgBM,EACzD4B,SAAA,CAAA3C,GACAC,EAAC2C,EAAI,CAACjD,KAAMA,EAAO,GAAK,EAAGmB,SAAUoB,EAAgBS,SACnD3C,IAIFwB,EAAQ,GACRvB,EAAC2C,GAAKjD,KAAM,EAAGmB,SAAUoB,EACvBS,SAAA/B,EAAW,KAIbY,EAAQ,GAAKd,IAEbgB,EAAKM,KAAKI,GAETnC,EAAC2C,EAEA,CAAAjD,KAAMyC,EACNS,OAAQT,IAAMzC,EACdmB,SAAUoB,EAAgBS,SAEzB/B,EAAWwB,IALPA,KAUPX,EAAML,EAAY,GAAKV,IAEvBe,EAAML,GACNnB,EAAC2C,EAAI,CAACjD,KAAMyB,EAAWN,SAAUoB,EAAgBS,SAC/C/B,EAAWQ,KAIbf,GACAJ,EAAC2C,EAAI,CAACjD,KAAMA,EAAO,EAAGmB,SAAUoB,EAC9BS,SAAAtC,MAGE"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as o,jsx as t}from"react/jsx-runtime";import{CheckRound as e}from"@ricons/material";import{useReactive as r}from"ahooks";import{useEffect as i}from"react";import"../../button/index.js";import n from"../../icon/icon.js";import"../../input/index.js";import a from"../../select/select.js";import p from"../../input/input.js";import l from"../../button/button.js";const m={HEX:"toHexString",RGB:"toRgbString",HSB:"toHsbString"};function s(m){const{value:s,type:c,onTypeChange:u,onChange:d,onOk:f}=m,h=r({value:s,type:c});return i((()=>{h.value=s,h.type=c}),[s,c]),o("div",{className:"i-colorpicker-footer",children:[t(a,{readOnly:!0,hideClear:!0,hideArrow:!0,style:{width:"5.6em"},options:["RGB","HEX","HSB"],value:h.type,onChange:o=>{h.type=o,u(o)}}),t(p,{placeholder:"color",value:h.value,onChange:o=>{h.value=o,d(o)}}),t(l,{square:!0,onClick:f,children:t(n,{icon:t(e,{})})})]})}export{m as ColorMethods,s as default};
|
|
2
|
-
//# sourceMappingURL=footer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"footer.js","sources":["../../../../packages/components/picker/colors/footer.tsx"],"sourcesContent":["import { CheckRound } from \"@ricons/material\";\nimport { useReactive } from \"ahooks\";\nimport { useEffect } from \"react\";\nimport Button from \"../../button\";\nimport Icon from \"../../icon\";\nimport Input from \"../../input\";\nimport Select from \"../../select\";\n\nexport const ColorMethods = {\n\tHEX: \"toHexString\",\n\tRGB: \"toRgbString\",\n\tHSB: \"toHsbString\",\n};\n\nexport default function Footer(props) {\n\tconst { value, type, onTypeChange, onChange, onOk } = props;\n\tconst state = useReactive({\n\t\tvalue,\n\t\ttype,\n\t});\n\n\tconst handleChange = (v) => {\n\t\tstate.value = v;\n\t\tonChange(v);\n\t};\n\n\tconst handleTypeChange = (t) => {\n\t\tstate.type = t;\n\t\tonTypeChange(t);\n\t};\n\n\tuseEffect(() => {\n\t\tstate.value = value;\n\t\tstate.type = type;\n\t}, [value, type]);\n\n\treturn (\n\t\t<div className='i-colorpicker-footer'>\n\t\t\t<Select\n\t\t\t\treadOnly\n\t\t\t\thideClear\n\t\t\t\thideArrow\n\t\t\t\tstyle={{ width: \"5.6em\" }}\n\t\t\t\toptions={[\"RGB\", \"HEX\", \"HSB\"]}\n\t\t\t\tvalue={state.type}\n\t\t\t\tonChange={handleTypeChange}\n\t\t\t/>\n\t\t\t<Input\n\t\t\t\tplaceholder='color'\n\t\t\t\tvalue={state.value}\n\t\t\t\tonChange={handleChange}\n\t\t\t/>\n\t\t\t<Button square onClick={onOk}>\n\t\t\t\t<Icon icon={<CheckRound />} />\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n"],"names":["ColorMethods","HEX","RGB","HSB","Footer","props","value","type","onTypeChange","onChange","onOk","state","useReactive","useEffect","_jsxs","className","_jsx","Select","readOnly","hideClear","hideArrow","style","width","options","t","Input","placeholder","v","Button","square","onClick","children","Icon","icon","CheckRound"],"mappings":"oXAQa,MAAAA,EAAe,CAC3BC,IAAK,cACLC,IAAK,cACLC,IAAK,eAGkB,SAAAC,EAAOC,GAC9B,MAAMC,MAAEA,EAAKC,KAAEA,EAAIC,aAAEA,EAAYC,SAAEA,EAAQC,KAAEA,GAASL,EAChDM,EAAQC,EAAY,CACzBN,QACAC,SAkBD,OALAM,GAAU,KACTF,EAAML,MAAQA,EACdK,EAAMJ,KAAOA,CAAI,GACf,CAACD,EAAOC,IAGVO,EAAK,MAAA,CAAAC,UAAU,iCACdC,EAACC,EACA,CAAAC,YACAC,WAAS,EACTC,WACA,EAAAC,MAAO,CAAEC,MAAO,SAChBC,QAAS,CAAC,MAAO,MAAO,OACxBjB,MAAOK,EAAMJ,KACbE,SAnBuBe,IACzBb,EAAMJ,KAAOiB,EACbhB,EAAagB,EAAE,IAmBdR,EAACS,GACAC,YAAY,QACZpB,MAAOK,EAAML,MACbG,SA7BmBkB,IACrBhB,EAAML,MAAQqB,EACdlB,EAASkB,EAAE,IA6BVX,EAACY,EAAM,CAACC,QAAO,EAAAC,QAASpB,EAAIqB,SAC3Bf,EAACgB,EAAI,CAACC,KAAMjB,EAACkB,EAAU,CAAA,SAI3B"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as r}from"react/jsx-runtime";import a from"classnames";const c=c=>{const{ref:s,color:l,handle:o,placeholder:t,className:i,...n}=c;return e("div",{ref:s,className:a("i-colorpicker-handle",i),...n,children:["text"!==o&&r("i",{className:"i-colorpicker-square",style:{background:l}}),"square"!==o&&r("span",{className:"i-colorpicker-text",style:{color:l},children:l??t})]})};export{c as default};
|
|
2
|
-
//# sourceMappingURL=handle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handle.js","sources":["../../../../packages/components/picker/colors/handle.tsx"],"sourcesContent":["import classNames from \"classnames\";\n\nconst Handle = (props) => {\n\tconst { ref, color, handle, placeholder, className, ...restProps } = props;\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={classNames(\"i-colorpicker-handle\", className)}\n\t\t\t{...restProps}\n\t\t>\n\t\t\t{handle !== \"text\" && (\n\t\t\t\t<i\n\t\t\t\t\tclassName='i-colorpicker-square'\n\t\t\t\t\tstyle={{ background: color }}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{handle !== \"square\" && (\n\t\t\t\t<span className='i-colorpicker-text' style={{ color }}>\n\t\t\t\t\t{color ?? placeholder}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport default Handle;\n"],"names":["Handle","props","ref","color","handle","placeholder","className","restProps","_jsxs","classNames","children","_jsx","style","background"],"mappings":"4EAEA,MAAMA,EAAUC,IACf,MAAMC,IAAEA,EAAGC,MAAEA,EAAKC,OAAEA,EAAMC,YAAEA,EAAWC,UAAEA,KAAcC,GAAcN,EAErE,OACCO,EAAA,MAAA,CACCN,IAAKA,EACLI,UAAWG,EAAW,uBAAwBH,MAC1CC,EAEHG,SAAA,CAAW,SAAXN,GACAO,EACC,IAAA,CAAAL,UAAU,uBACVM,MAAO,CAAEC,WAAYV,KAIX,WAAXC,GACAO,EAAM,OAAA,CAAAL,UAAU,qBAAqBM,MAAO,CAAET,SAC5CO,SAAAP,GAASE,MAGP"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o,Fragment as l}from"react/jsx-runtime";import a from"@rc-component/color-picker";import{useReactive as n}from"ahooks";import{useEffect as i}from"react";import r from"../../popup/popup.js";import t,{ColorMethods as p}from"./footer.js";import s from"./handle.js";function c(c){const{value:u,type:h="HEX",disabledAlpha:m,children:v,usePanel:d,handle:b="both",placeholder:y="Colors",popupProps:f,onChange:g}=c,C=n({type:h,value:u,syncValue:u,visible:f?.visible}),V=e=>{const o=p[e];C.type=e,C.value=C.syncValue[o]?.()},j=e=>{C.value=e,C.syncValue=e},k=()=>{g?.(C.value),C.visible=!1};return i((()=>{C.syncValue=u,C.value=u}),[u]),d?e(a,{...c}):e(r,{trigger:"click",touchable:!0,position:"bottom",...f,visible:C.visible,content:e(a,{value:C.syncValue,disabledAlpha:m,panelRender:a=>o(l,{children:[a,e(t,{value:C.value,type:C.type,onTypeChange:V,onChange:j,onOk:k})]}),onChange:e=>{C.syncValue=e},onChangeComplete:e=>{const o=p[C.type];1!==e.a&&(e.a=parseFloat(e.a.toFixed(3))),C.value=e[o]?.()}}),onVisibleChange:e=>{C.visible=e,f?.onVisibleChange?.(e)},children:v??e(s,{color:u,handle:b,placeholder:y})})}export{c as default};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../packages/components/picker/colors/index.tsx"],"sourcesContent":["import ColorsPanel from \"@rc-component/color-picker\";\nimport { useReactive } from \"ahooks\";\nimport { useEffect } from \"react\";\nimport Popup from \"../../popup\";\nimport { IColorPicker } from \"../type\";\nimport Footer, { ColorMethods } from \"./footer\";\nimport Handle from \"./handle\";\nimport \"./index.css\";\n\nexport default function ColorPicker(props: IColorPicker) {\n\tconst {\n\t\tvalue,\n\t\ttype = \"HEX\",\n\t\tdisabledAlpha,\n\t\tchildren,\n\t\tusePanel,\n\t\thandle = \"both\",\n\t\tplaceholder = \"Colors\",\n\t\tpopupProps,\n\t\tonChange,\n\t} = props;\n\n\tconst state = useReactive({\n\t\ttype,\n\t\tvalue,\n\t\tsyncValue: value,\n\t\tvisible: popupProps?.visible,\n\t});\n\n\tconst handleChange = (target) => {\n\t\tstate.syncValue = target;\n\t};\n\n\tconst handleComplete = (target) => {\n\t\tconst method = ColorMethods[state.type];\n\n\t\tif (target.a !== 1) {\n\t\t\ttarget.a = parseFloat(target.a.toFixed(3));\n\t\t}\n\n\t\tstate.value = target[method]?.();\n\t};\n\n\tconst handleVisibleChange = (v: boolean) => {\n\t\tstate.visible = v;\n\t\tpopupProps?.onVisibleChange?.(v);\n\t};\n\n\tconst handleTypeChange = (t) => {\n\t\tconst method = ColorMethods[t];\n\n\t\tstate.type = t;\n\t\tstate.value = state.syncValue[method]?.();\n\t};\n\n\tconst handleValueChange = (v) => {\n\t\tstate.value = v;\n\t\tstate.syncValue = v;\n\t};\n\n\tconst handleOk = () => {\n\t\tonChange?.(state.value);\n\t\tstate.visible = false;\n\t};\n\n\tuseEffect(() => {\n\t\tstate.syncValue = value;\n\t\tstate.value = value;\n\t}, [value]);\n\n\tif (usePanel) {\n\t\treturn <ColorsPanel {...props} />;\n\t}\n\n\treturn (\n\t\t<Popup\n\t\t\ttrigger='click'\n\t\t\ttouchable\n\t\t\tposition='bottom'\n\t\t\t{...popupProps}\n\t\t\tvisible={state.visible}\n\t\t\tcontent={\n\t\t\t\t<ColorsPanel\n\t\t\t\t\tvalue={state.syncValue}\n\t\t\t\t\tdisabledAlpha={disabledAlpha}\n\t\t\t\t\tpanelRender={(panel) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{panel}\n\t\t\t\t\t\t\t\t<Footer\n\t\t\t\t\t\t\t\t\tvalue={state.value}\n\t\t\t\t\t\t\t\t\ttype={state.type}\n\t\t\t\t\t\t\t\t\tonTypeChange={handleTypeChange}\n\t\t\t\t\t\t\t\t\tonChange={handleValueChange}\n\t\t\t\t\t\t\t\t\tonOk={handleOk}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t);\n\t\t\t\t\t}}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tonChangeComplete={handleComplete}\n\t\t\t\t/>\n\t\t\t}\n\t\t\tonVisibleChange={handleVisibleChange}\n\t\t>\n\t\t\t{children ?? (\n\t\t\t\t<Handle\n\t\t\t\t\tcolor={value}\n\t\t\t\t\thandle={handle}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</Popup>\n\t);\n}\n"],"names":["ColorPicker","props","value","type","disabledAlpha","children","usePanel","handle","placeholder","popupProps","onChange","state","useReactive","syncValue","visible","handleTypeChange","t","method","ColorMethods","handleValueChange","v","handleOk","useEffect","_jsx","ColorsPanel","Popup","trigger","touchable","position","content","panelRender","panel","_jsxs","_Fragment","Footer","onTypeChange","onOk","target","onChangeComplete","a","parseFloat","toFixed","onVisibleChange","Handle","color"],"mappings":"8RASwB,SAAAA,EAAYC,GACnC,MAAMC,MACLA,EAAKC,KACLA,EAAO,MAAKC,cACZA,EAAaC,SACbA,EAAQC,SACRA,EAAQC,OACRA,EAAS,OAAMC,YACfA,EAAc,SAAQC,WACtBA,EAAUC,SACVA,GACGT,EAEEU,EAAQC,EAAY,CACzBT,OACAD,QACAW,UAAWX,EACXY,QAASL,GAAYK,UAsBhBC,EAAoBC,IACzB,MAAMC,EAASC,EAAaF,GAE5BL,EAAMR,KAAOa,EACbL,EAAMT,MAAQS,EAAME,UAAUI,MAAW,EAGpCE,EAAqBC,IAC1BT,EAAMT,MAAQkB,EACdT,EAAME,UAAYO,CAAC,EAGdC,EAAW,KAChBX,IAAWC,EAAMT,OACjBS,EAAMG,SAAU,CAAK,EAQtB,OALAQ,GAAU,KACTX,EAAME,UAAYX,EAClBS,EAAMT,MAAQA,CAAK,GACjB,CAACA,IAEAI,EACIiB,EAACC,EAAgB,IAAAvB,IAIxBsB,EAACE,GACAC,QAAQ,QACRC,aACAC,SAAS,YACLnB,EACJK,QAASH,EAAMG,QACfe,QACCN,EAACC,GACAtB,MAAOS,EAAME,UACbT,cAAeA,EACf0B,YAAcC,GAEZC,EAAAC,EAAA,CAAA5B,SAAA,CACE0B,EACDR,EAACW,EAAM,CACNhC,MAAOS,EAAMT,MACbC,KAAMQ,EAAMR,KACZgC,aAAcpB,EACdL,SAAUS,EACViB,KAAMf,OAKVX,SAtEkB2B,IACrB1B,EAAME,UAAYwB,CAAM,EAsErBC,iBAnEoBD,IACvB,MAAMpB,EAASC,EAAaP,EAAMR,MAEjB,IAAbkC,EAAOE,IACVF,EAAOE,EAAIC,WAAWH,EAAOE,EAAEE,QAAQ,KAGxC9B,EAAMT,MAAQmC,EAAOpB,MAAW,IA+D/ByB,gBA5D2BtB,IAC5BT,EAAMG,QAAUM,EAChBX,GAAYiC,kBAAkBtB,EAAE,EA0DKf,SAEnCA,GACAkB,EAACoB,GACAC,MAAO1C,EACPK,OAAQA,EACRC,YAAaA,KAKlB"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as a,jsx as t}from"react/jsx-runtime";import r from"classnames";import d from"dayjs";import{useMemo as i}from"react";const m=m=>{const{value:s,month:n,weeks:c=["一","二","三","四","五","六","日"],renderDate:o=e=>e.date(),disabledDate:p,onDateClick:l}=m,h=d(),k=i((()=>{const e=[],a=n.add(-1,"month").endOf("month");let{$W:t,$D:r}=a;if(0!==t){const r=Array.from({length:t}).map(((e,r)=>a.add(r+1-t,"day")));e.push(...r)}const d=n.endOf("month");return r=d.$D,t=d.$W,e.push(...Array.from({length:r}).map(((e,a)=>d.add(a+1-r,"day")))),0!==t&&e.push(...Array.from({length:7-t}).map(((e,a)=>d.add(a+1,"day")))),e}),[n]);return e(a,{children:[t("div",{className:"i-datepicker-weeks",children:c.map(((e,a)=>t("span",{className:"i-datepicker-week",children:e},a)))}),t("div",{className:"i-datepicker-dates",children:k.map(((e,a)=>{const d=e.isSame(s,"day"),i=e.isSame(n,"month"),m=e.isSame(h,"day"),c=p?.(e);return t("div",{className:r("i-datepicker-item",{"i-datepicker-active":d,"i-datepicker-same-month":i,"i-datepicker-today":m,"i-datepicker-disabled":c}),onClick:()=>(e=>{p?.(e)||l?.(e)})(e),children:o(e)},a)}))})]})};export{m as default};
|
|
2
|
-
//# sourceMappingURL=dates.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dates.js","sources":["../../../../packages/components/picker/dates/dates.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport dayjs, { Dayjs } from \"dayjs\";\nimport { ReactNode, useMemo } from \"react\";\nimport { IBaseDates } from \"../type\";\n\nconst Dates = (\n\tprops: IBaseDates & {\n\t\tmonth: any;\n\t}\n) => {\n\tconst {\n\t\tvalue,\n\t\tmonth,\n\t\tweeks = [\"一\", \"二\", \"三\", \"四\", \"五\", \"六\", \"日\"],\n\t\trenderDate = (date: Dayjs) => date.date(),\n\t\tdisabledDate,\n\t\tonDateClick,\n\t} = props;\n\tconst today = dayjs();\n\n\tconst dates = useMemo(() => {\n\t\tconst dates: Dayjs[] = [];\n\n\t\tconst lastDateOfLastMonth = month.add(-1, \"month\").endOf(\"month\");\n\t\tlet { $W, $D } = lastDateOfLastMonth;\n\n\t\tif ($W !== 0) {\n\t\t\tconst lastMonthDates = Array.from({ length: $W }).map(\n\t\t\t\t(whatever, i) => lastDateOfLastMonth.add(i + 1 - $W, \"day\")\n\t\t\t);\n\t\t\tdates.push(...lastMonthDates);\n\t\t}\n\n\t\tconst lastDate = month.endOf(\"month\");\n\t\t$D = lastDate.$D;\n\t\t$W = lastDate.$W;\n\t\tdates.push(\n\t\t\t...Array.from({ length: $D }).map((whatever, i) =>\n\t\t\t\tlastDate.add(i + 1 - $D, \"day\")\n\t\t\t)\n\t\t);\n\n\t\tif ($W !== 0) {\n\t\t\tdates.push(\n\t\t\t\t...Array.from({ length: 7 - $W }).map((whatever, i) =>\n\t\t\t\t\tlastDate.add(i + 1, \"day\")\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn dates;\n\t}, [month]);\n\n\tconst handleDateClick = (date: Dayjs) => {\n\t\tif (disabledDate?.(date)) return;\n\n\t\tonDateClick?.(date);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<div className='i-datepicker-weeks'>\n\t\t\t\t{weeks.map((week: ReactNode, i: number) => (\n\t\t\t\t\t<span key={i} className='i-datepicker-week'>\n\t\t\t\t\t\t{week}\n\t\t\t\t\t</span>\n\t\t\t\t))}\n\t\t\t</div>\n\t\t\t<div className='i-datepicker-dates'>\n\t\t\t\t{dates.map((date, i: number) => {\n\t\t\t\t\tconst active = date.isSame(value, \"day\");\n\t\t\t\t\tconst isSameMonth = date.isSame(month, \"month\");\n\t\t\t\t\tconst isToday = date.isSame(today, \"day\");\n\t\t\t\t\tconst disabled = disabledDate?.(date);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\t\tclassName={classNames(\"i-datepicker-item\", {\n\t\t\t\t\t\t\t\t\"i-datepicker-active\": active,\n\t\t\t\t\t\t\t\t\"i-datepicker-same-month\": isSameMonth,\n\t\t\t\t\t\t\t\t\"i-datepicker-today\": isToday,\n\t\t\t\t\t\t\t\t\"i-datepicker-disabled\": disabled,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tonClick={() => handleDateClick(date)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{renderDate(date)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default Dates;\n"],"names":["Dates","props","value","month","weeks","renderDate","date","disabledDate","onDateClick","today","dayjs","dates","useMemo","lastDateOfLastMonth","add","endOf","$W","$D","lastMonthDates","Array","from","length","map","whatever","i","push","lastDate","_jsxs","_jsx","className","children","week","active","isSame","isSameMonth","isToday","disabled","classNames","onClick","handleDateClick"],"mappings":"+IAKA,MAAMA,EACLC,IAIA,MAAMC,MACLA,EAAKC,MACLA,EA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ACvB,0BAA2BE,EAC3B,qBAAsBC,EACtB,wBAAyBC,IAE1BE,QAAS,IA/BS,CAAChC,IACpBC,IAAeD,IAEnBE,IAAcF,EAAK,EA4BCiC,CAAgBjC,GAE9BwB,SAAAzB,EAAWC,IATPkB,EAUA,QAIP"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{CalendarMonthTwotone as r}from"@ricons/material";import{useReactive as o}from"ahooks";import a from"dayjs";import t from"dayjs/plugin/customParseFormat.js";import{useState as n,useMemo as i,useEffect as l}from"react";import s from"../../icon/icon.js";import"../../input/index.js";import m from"../../popup/popup.js";import p from"./panel.js";import u from"../../input/input.js";a.extend(t);const c=["YYYY-MM-DD","YYYY-M-D","YYYY/MM/DD","YYYY/M/D"],d="YYYY-MM-DD",Y=t=>{const{name:Y,value:f,weeks:D,format:v=d,placeholder:h=t.format??d,renderDate:M,renderMonth:j,renderYear:g,popupProps:k,disabledDate:b,onDateClick:C,onChange:w,onBlur:x,...V}=t,y=o({value:f}),[z,B]=n(!1),P=i((()=>{if(!y.value)return null;const e=a(y.value,v,!0);return e.isValid()?e:null}),[y.value]),E=e=>{y.value=e,w?.(e)},F=()=>{if(!y.value)return;const e=a(y.value,c,!0);e.isValid()?E(e.format(v)):E("")};return l((()=>{y.value=f}),[f]),e(m,{visible:z,trigger:"click",position:"bottom",arrow:!1,align:"start",onVisibleChange:e=>{k?.onVisibleChange?.(e),B(e)},watchResize:!0,content:e(p,{value:P,weeks:D,renderDate:M,renderMonth:j,renderYear:g,disabledDate:b,onDateClick:e=>{E(e.format(v))}}),...k,children:e(u,{value:y.value,append:e(s,{icon:e(r,{}),className:"i-datepicker-icon",size:"1em"}),placeholder:h,onChange:E,onBlur:e=>{x?.(e),F()},onEnter:F,...V})})};export{Y as default};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../packages/components/picker/dates/index.tsx"],"sourcesContent":["import { CalendarMonthTwotone } from \"@ricons/material\";\nimport { useReactive } from \"ahooks\";\nimport dayjs, { Dayjs } from \"dayjs\";\nimport customParseFormat from \"dayjs/plugin/customParseFormat.js\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport Icon from \"../../icon\";\nimport Input from \"../../input\";\nimport Popup from \"../../popup\";\nimport { IDatePicker } from \"../type\";\nimport \"./index.css\";\nimport Panel from \"./panel\";\n\ndayjs.extend(customParseFormat);\n\nconst FORMATTYPES = [\"YYYY-MM-DD\", \"YYYY-M-D\", \"YYYY/MM/DD\", \"YYYY/M/D\"];\nconst FORMAT = \"YYYY-MM-DD\";\n\nconst Datepicker = (props: IDatePicker) => {\n\tconst {\n\t\tname,\n\t\tvalue,\n\t\tweeks,\n\t\tformat = FORMAT,\n\t\tplaceholder = props.format ?? FORMAT,\n\t\trenderDate,\n\t\trenderMonth,\n\t\trenderYear,\n\t\tpopupProps,\n\t\tdisabledDate,\n\t\tonDateClick,\n\t\tonChange,\n\t\tonBlur,\n\t\t...restProps\n\t} = props;\n\n\tconst state = useReactive({\n\t\tvalue,\n\t});\n\n\tconst [active, setActive] = useState<boolean>(false);\n\n\tconst dayJsValue = useMemo(() => {\n\t\tif (!state.value) return null;\n\n\t\tconst date = dayjs(state.value as string, format, true);\n\n\t\tif (date.isValid()) return date;\n\n\t\treturn null;\n\t}, [state.value]);\n\n\tconst handleDateClick = (date: Dayjs) => {\n\t\thandleChange(date.format(format));\n\t};\n\n\tconst handleChange = (v) => {\n\t\tstate.value = v;\n\t\tonChange?.(v);\n\t};\n\n\tconst handleSetDate = () => {\n\t\tif (!state.value) return;\n\n\t\tconst date = dayjs(state.value as string, FORMATTYPES, true);\n\n\t\tif (date.isValid()) {\n\t\t\thandleChange(date.format(format));\n\t\t\treturn;\n\t\t}\n\n\t\thandleChange(\"\");\n\t};\n\n\tconst handleBlur = (e) => {\n\t\tonBlur?.(e);\n\t\thandleSetDate();\n\t};\n\n\tconst handleVisibleChange = (v) => {\n\t\tpopupProps?.onVisibleChange?.(v);\n\t\tsetActive(v);\n\t};\n\n\tuseEffect(() => {\n\t\tstate.value = value;\n\t}, [value]);\n\n\treturn (\n\t\t<Popup\n\t\t\tvisible={active}\n\t\t\ttrigger='click'\n\t\t\tposition='bottom'\n\t\t\tarrow={false}\n\t\t\talign='start'\n\t\t\tonVisibleChange={handleVisibleChange}\n\t\t\twatchResize\n\t\t\tcontent={\n\t\t\t\t<Panel\n\t\t\t\t\tvalue={dayJsValue}\n\t\t\t\t\tweeks={weeks}\n\t\t\t\t\trenderDate={renderDate}\n\t\t\t\t\trenderMonth={renderMonth}\n\t\t\t\t\trenderYear={renderYear}\n\t\t\t\t\tdisabledDate={disabledDate}\n\t\t\t\t\tonDateClick={handleDateClick}\n\t\t\t\t/>\n\t\t\t}\n\t\t\t{...popupProps}\n\t\t>\n\t\t\t<Input\n\t\t\t\tvalue={state.value}\n\t\t\t\tappend={\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={<CalendarMonthTwotone />}\n\t\t\t\t\t\tclassName='i-datepicker-icon'\n\t\t\t\t\t\tsize='1em'\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tonBlur={handleBlur}\n\t\t\t\tonEnter={handleSetDate}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t</Popup>\n\t);\n};\n\nexport default Datepicker;\n"],"names":["dayjs","extend","customParseFormat","FORMATTYPES","FORMAT","Datepicker","props","name","value","weeks","format","placeholder","renderDate","renderMonth","renderYear","popupProps","disabledDate","onDateClick","onChange","onBlur","restProps","state","useReactive","active","setActive","useState","dayJsValue","useMemo","date","isValid","handleChange","v","handleSetDate","useEffect","_jsx","Popup","visible","trigger","position","arrow","align","onVisibleChange","watchResize","content","Panel","children","Input","append","Icon","icon","CalendarMonthTwotone","className","size","e","onEnter"],"mappings":"yaAYAA,EAAMC,OAAOC,GAEb,M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C3BC,UAAU,oBACVC,KAAK,QAGPzC,YAAaA,EACbO,SAAUY,EACVX,OA/CiBkC,IACnBlC,IAASkC,GACTrB,GAAe,EA8CbsB,QAAStB,KACLZ,KAEE"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as a}from"react/jsx-runtime";import{KeyboardArrowLeftRound as t,KeyboardArrowRightRound as r}from"@ricons/material";import{useReactive as i}from"ahooks";import n from"classnames";import o from"dayjs";import{throttle as c}from"radash";import{useRef as l,useEffect as s}from"react";import d from"../../icon/icon.js";import m from"../../utils/helpericon/helpericon.js";import h from"./dates.js";const p=[1,2,3,4,5,6,7,8,9,10,11,12],k=t=>{const{value:r,unitMonth:i="月",unitYear:n="年",renderYear:o,renderMonth:c,onClick:l}=t;return e("a",{className:"i-datepicker-action","data-ripple":!0,onClick:l,children:[a("span",{children:o?.(r.year())}),n,a("span",{children:c?.(r.month()+1)}),i]})},y=y=>{const{value:u,unitYear:v,unitMonth:f,renderDate:Y,renderMonth:N=e=>e,renderYear:b=e=>e,disabledDate:C,onDateClick:D}=y,M=i({today:u,month:u||o(),selectedYear:o(),years:[],selectable:!1}),j=l(null),g=e=>{M.month=M.month[e?"add":"subtract"](1,"month")},x=c({interval:100},(e=>{const a=e.deltaY<0;M.years=M.years.map((e=>e+(a?-1:1)))}));return s((()=>{if(!M.selectable)return;M.selectedYear=M.month;const e=M.selectedYear.year(),a=Array.from({length:7}).map(((a,t)=>e-3+t));M.years=[...a]}),[M.selectable]),s((()=>{M.today=u,M.month=u||o()}),[u]),e("div",{className:"i-datepicker",children:[e("div",{className:"i-datepicker-units",children:[a(k,{value:M.month,unitYear:v,unitMonth:f,renderMonth:N,renderYear:b,onClick:()=>M.selectable=!0}),a("a",{className:"ml-auto i-datepicker-action","data-ripple":!0,onClick:()=>g(!1),children:a(d,{icon:a(t,{})})}),a("a",{className:"i-datepicker-action","data-ripple":!0,onClick:()=>g(!0),children:a(d,{icon:a(r,{})})})]}),e("div",{className:n("i-datepicker-ym",{"i-datepicker-active":M.selectable}),children:[a(m,{active:!0,className:"i-datepicker-close",onClick:e=>{e.stopPropagation(),M.selectable=!1}}),a("div",{ref:j,className:"i-datepicker-years",onWheel:x,children:M.years.map((e=>a("a",{className:n("i-datepicker-year",{"i-datepicker-active":e===M.selectedYear.year()}),onClick:()=>M.selectedYear=M.selectedYear.year(e),children:b(e)},e)))}),a("div",{className:"i-datepicker-months",children:p.map((e=>a("a",{className:n("i-datepicker-month",{"i-datepicker-active":e===M.month.month()+1}),onClick:()=>{return a=e,M.month=M.month.year(M.selectedYear.year()).month(a-1),void(M.selectable=!1);var a},children:N(e)},e)))})]}),a(h,{value:M.today,month:M.month,disabledDate:C,onDateClick:e=>{e.isSame(M.today,"day")||(e.isSame(M.month,"month")||(M.month=e),M.today=e,D?.(e))},renderDate:Y})]})};export{y as default};
|
|
2
|
-
//# sourceMappingURL=panel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"panel.js","sources":["../../../../packages/components/picker/dates/panel.tsx"],"sourcesContent":["import {\n\tKeyboardArrowLeftRound,\n\tKeyboardArrowRightRound,\n} from \"@ricons/material\";\nimport { useReactive } from \"ahooks\";\nimport classNames from \"classnames\";\nimport dayjs, { Dayjs } from \"dayjs\";\nimport { throttle } from \"radash\";\nimport { ReactNode, useEffect, useRef } from \"react\";\nimport Icon from \"../../icon\";\nimport Helpericon from \"../../utils/helpericon\";\nimport { IBaseDates } from \"../type\";\nimport Dates from \"./dates\";\n\nconst MONTHS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];\n\nconst YearMonth = (\n\tprops: IBaseDates & {\n\t\tonClick?: () => void;\n\t}\n) => {\n\tconst {\n\t\tvalue,\n\t\tunitMonth = \"月\",\n\t\tunitYear = \"年\",\n\t\trenderYear,\n\t\trenderMonth,\n\t\tonClick,\n\t} = props;\n\n\treturn (\n\t\t<a className='i-datepicker-action' data-ripple onClick={onClick}>\n\t\t\t<span>{renderYear?.(value.year())}</span>\n\t\t\t{unitYear}\n\t\t\t<span>{renderMonth?.(value.month() + 1)}</span>\n\t\t\t{unitMonth}\n\t\t</a>\n\t);\n};\n\nconst Panel = (props: IBaseDates) => {\n\tconst {\n\t\tvalue,\n\t\tunitYear,\n\t\tunitMonth,\n\t\trenderDate,\n\t\trenderMonth = (m: ReactNode) => m,\n\t\trenderYear = (y: ReactNode) => y,\n\t\tdisabledDate,\n\t\tonDateClick,\n\t} = props;\n\n\tconst state = useReactive({\n\t\ttoday: value,\n\t\tmonth: value || dayjs(),\n\t\tselectedYear: dayjs(),\n\t\tyears: [] as number[],\n\t\tselectable: false,\n\t});\n\n\tconst $years = useRef<HTMLDivElement>(null);\n\n\tconst handleOperateMonth = (next: boolean) => {\n\t\tstate.month = state.month[next ? \"add\" : \"subtract\"](1, \"month\");\n\t};\n\n\tconst handleChangeDate = (date: Dayjs) => {\n\t\tif (date.isSame(state.today, \"day\")) return;\n\n\t\tif (!date.isSame(state.month, \"month\")) {\n\t\t\tstate.month = date;\n\t\t}\n\n\t\tstate.today = date;\n\t\tonDateClick?.(date);\n\t};\n\n\tconst handleChangeMonth = (month: number) => {\n\t\tstate.month = state.month\n\t\t\t.year(state.selectedYear.year())\n\t\t\t.month(month - 1);\n\t\tstate.selectable = false;\n\t};\n\n\tconst getMoreYears = throttle({ interval: 100 }, (e) => {\n\t\tconst isUp = e.deltaY < 0;\n\n\t\tstate.years = state.years.map((y) => (y += isUp ? -1 : 1));\n\t});\n\n\tuseEffect(() => {\n\t\tif (!state.selectable) return;\n\n\t\tstate.selectedYear = state.month;\n\t\tconst y = state.selectedYear.year();\n\t\tconst years = Array.from({ length: 7 }).map((_, i) => y - 3 + i);\n\n\t\tstate.years = [...years];\n\t}, [state.selectable]);\n\n\tuseEffect(() => {\n\t\tstate.today = value;\n\t\tstate.month = value || dayjs();\n\t}, [value]);\n\n\treturn (\n\t\t<div className='i-datepicker'>\n\t\t\t<div className='i-datepicker-units'>\n\t\t\t\t<YearMonth\n\t\t\t\t\tvalue={state.month}\n\t\t\t\t\tunitYear={unitYear}\n\t\t\t\t\tunitMonth={unitMonth}\n\t\t\t\t\trenderMonth={renderMonth}\n\t\t\t\t\trenderYear={renderYear}\n\t\t\t\t\tonClick={() => (state.selectable = true)}\n\t\t\t\t/>\n\t\t\t\t<a\n\t\t\t\t\tclassName='ml-auto i-datepicker-action'\n\t\t\t\t\tdata-ripple\n\t\t\t\t\tonClick={() => handleOperateMonth(false)}\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={<KeyboardArrowLeftRound />} />\n\t\t\t\t</a>\n\t\t\t\t<a\n\t\t\t\t\tclassName='i-datepicker-action'\n\t\t\t\t\tdata-ripple\n\t\t\t\t\tonClick={() => handleOperateMonth(true)}\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={<KeyboardArrowRightRound />} />\n\t\t\t\t</a>\n\t\t\t</div>\n\n\t\t\t<div\n\t\t\t\tclassName={classNames(\"i-datepicker-ym\", {\n\t\t\t\t\t\"i-datepicker-active\": state.selectable,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<Helpericon\n\t\t\t\t\tactive\n\t\t\t\t\tclassName='i-datepicker-close'\n\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\tstate.selectable = false;\n\t\t\t\t\t}}\n\t\t\t\t/>\n\n\t\t\t\t<div\n\t\t\t\t\tref={$years}\n\t\t\t\t\tclassName='i-datepicker-years'\n\t\t\t\t\tonWheel={getMoreYears}\n\t\t\t\t>\n\t\t\t\t\t{state.years.map((y) => (\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tkey={y}\n\t\t\t\t\t\t\tclassName={classNames(\"i-datepicker-year\", {\n\t\t\t\t\t\t\t\t\"i-datepicker-active\":\n\t\t\t\t\t\t\t\t\ty === state.selectedYear.year(),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t(state.selectedYear =\n\t\t\t\t\t\t\t\t\tstate.selectedYear.year(y))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{renderYear(y)}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\n\t\t\t\t<div className='i-datepicker-months'>\n\t\t\t\t\t{MONTHS.map((m) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\tkey={m}\n\t\t\t\t\t\t\t\tclassName={classNames(\"i-datepicker-month\", {\n\t\t\t\t\t\t\t\t\t\"i-datepicker-active\":\n\t\t\t\t\t\t\t\t\t\tm === state.month.month() + 1,\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\tonClick={() => handleChangeMonth(m)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{renderMonth(m)}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<Dates\n\t\t\t\tvalue={state.today}\n\t\t\t\tmonth={state.month}\n\t\t\t\tdisabledDate={disabledDate}\n\t\t\t\tonDateClick={handleChangeDate}\n\t\t\t\trenderDate={renderDate}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nexport default Panel;\n"],"names":["MONTHS","YearMonth","props","value","unitMonth","unitYear","renderYear","renderMonth","onClick","_jsxs","className","children","_jsx","year","month","Panel","renderDate","m","y","disabledDate","onDateClick","state","useReactive","today","dayjs","selectedYear","years","selectable","$years","useRef","handleOperateMonth","next","getMoreYears","throttle","interval","e","isUp","deltaY","map","useEffect","Array","from","length","_","i","Icon","icon","KeyboardArrowLeftRound","KeyboardArrowRightRound","classNames","Helpericon","active","stopPropagation","ref","onWheel","handleChangeMonth","Dates","date","isSame"],"mappings":"6ZAcA,MAAMA,EAAS,CAAC,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,GAAI,GAAI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,CACLrD,MAAOkB,EAAME,MACbT,MAAOO,EAAMP,MACbK,aAAcA,EACdC,YA5HuBqC,IACrBA,EAAKC,OAAOrC,EAAME,MAAO,SAExBkC,EAAKC,OAAOrC,EAAMP,MAAO,WAC7BO,EAAMP,MAAQ2C,GAGfpC,EAAME,MAAQkC,EACdrC,IAAcqC,GAAK,EAqHjBzC,WAAYA,MAER"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{AccessTimeRound as o}from"@ricons/material";import{useReactive as a}from"ahooks";import{useState as r,useEffect as i}from"react";import n from"../../icon/icon.js";import"../../input/index.js";import t from"../../popup/popup.js";import l from"./panel.js";import p from"../../input/input.js";const m="hh:mm:ss";function s(s){const{name:u,value:c,format:f=m,periods:h,placeholder:v=s.format??m,renderItem:d,onChange:g,onBlur:j,popupProps:V,...b}=s,C=a({value:c,safeValue:void 0}),[k,x]=r(!1),w=e=>{C.value=e};return i((()=>{C.value=c}),[c]),e(t,{visible:k,trigger:"click",position:"bottom",arrow:!1,align:"start",watchResize:!0,...V,onVisibleChange:e=>{V?.onVisibleChange?.(e),x(e)},content:e(l,{value:C.value,format:f,periods:h,renderItem:d,onChange:w,onFallback:e=>{C.safeValue=e}}),children:e(p,{value:C.value,placeholder:v,append:e(n,{icon:e(o,{}),className:"i-timepicker-icon",size:"1em"}),onChange:w,onBlur:e=>{j?.(e),C.value&&(C.value=C.safeValue,w(C.safeValue))},...b})})}export{s as default};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../packages/components/picker/time/index.tsx"],"sourcesContent":["import { AccessTimeRound } from \"@ricons/material\";\nimport { useReactive } from \"ahooks\";\nimport { useEffect, useState } from \"react\";\nimport Icon from \"../../icon\";\nimport Input from \"../../input\";\nimport Popup from \"../../popup\";\nimport { ITimePicker } from \"../type\";\nimport Panel from \"./panel\";\n\nconst FORMAT = \"hh:mm:ss\";\n\nexport default function TimePicker(props: ITimePicker) {\n\tconst {\n\t\tname,\n\t\tvalue,\n\t\tformat = FORMAT,\n\t\tperiods,\n\t\tplaceholder = props.format ?? FORMAT,\n\t\trenderItem,\n\t\tonChange,\n\t\tonBlur,\n\t\tpopupProps,\n\t\t...restProps\n\t} = props;\n\tconst state = useReactive({\n\t\tvalue,\n\t\tsafeValue: undefined,\n\t});\n\tconst [active, setActive] = useState<boolean>(false);\n\n\tconst handleChange = (v) => {\n\t\tstate.value = v;\n\t};\n\n\tconst handleFallback = (v) => {\n\t\tstate.safeValue = v;\n\t};\n\n\tconst handleValidTime = () => {\n\t\tif (!state.value) return;\n\n\t\tstate.value = state.safeValue;\n\t\thandleChange(state.safeValue);\n\t};\n\n\tconst handleBlur = (e) => {\n\t\tonBlur?.(e);\n\t\thandleValidTime();\n\t};\n\n\tconst handleVisibleChange = (v) => {\n\t\tpopupProps?.onVisibleChange?.(v);\n\t\tsetActive(v);\n\t};\n\n\tuseEffect(() => {\n\t\tstate.value = value;\n\t}, [value]);\n\n\treturn (\n\t\t<Popup\n\t\t\tvisible={active}\n\t\t\ttrigger='click'\n\t\t\tposition='bottom'\n\t\t\tarrow={false}\n\t\t\talign='start'\n\t\t\twatchResize\n\t\t\t{...popupProps}\n\t\t\tonVisibleChange={handleVisibleChange}\n\t\t\tcontent={\n\t\t\t\t<Panel\n\t\t\t\t\tvalue={state.value}\n\t\t\t\t\tformat={format}\n\t\t\t\t\tperiods={periods}\n\t\t\t\t\trenderItem={renderItem}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tonFallback={handleFallback}\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t<Input\n\t\t\t\tvalue={state.value}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tappend={\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={<AccessTimeRound />}\n\t\t\t\t\t\tclassName='i-timepicker-icon'\n\t\t\t\t\t\tsize='1em'\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tonBlur={handleBlur}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t</Popup>\n\t);\n}\n"],"names":["FORMAT","TimePicker","props","name","value","format","periods","placeholder","renderItem","onChange","onBlur","popupProps","restProps","state","useReactive","safeValue","undefined","active","setActive","useState","handleChange","v","useEffect","_jsx","Popup","visible","trigger","position","arrow","align","watchResize","onVisibleChange","content","Panel","onFallback","children","Input","append","Icon","icon","AccessTimeRound","className","size","e"],"mappings":"iVASA,MAAMA,EAAS,WAES,SAAAC,EAAWC,GAClC,MAAMC,KACLA,EAAIC,MACJA,EAAKC,OACLA,EAASL,EAAMM,QACfA,EAAOC,YACPA,EAAcL,EAAMG,QAAUL,EAAMQ,WACpCA,EAAUC,SACVA,EAAQC,OACRA,EAAMC,WACNA,KACGC,GACAV,EACEW,EAAQC,EAAY,CACzBV,QACAW,eAAWC,KAELC,EAAQC,GAAaC,GAAkB,GAExCC,EAAgBC,IACrBR,EAAMT,MAAQiB,CAAC,EA4BhB,OAJAC,GAAU,KACTT,EAAMT,MAAQA,CAAK,GACjB,CAACA,IAGHmB,EAACC,EACA,CAAAC,QAASR,EACTS,QAAQ,QACRC,SAAS,SACTC,OAAO,EACPC,MAAM,QACNC,aAAW,KACPnB,EACJoB,gBAlB2BV,IAC5BV,GAAYoB,kBAAkBV,GAC9BH,EAAUG,EAAE,EAiBXW,QACCT,EAACU,EACA,CAAA7B,MAAOS,EAAMT,MACbC,OAAQA,EACRC,QAASA,EACTE,WAAYA,EACZC,SAAUW,EACVc,WA1CoBb,IACvBR,EAAME,UAAYM,CAAC,IA0Cfc,SAGHZ,EAACa,EACA,CAAAhC,MAAOS,EAAMT,MACbG,YAAaA,EACb8B,OACCd,EAACe,EAAI,CACJC,KAAMhB,EAACiB,EAAe,CAAA,GACtBC,UAAU,oBACVC,KAAK,QAGPjC,SAAUW,EACVV,OA9CiBiC,IACnBjC,IAASiC,GAPJ9B,EAAMT,QAEXS,EAAMT,MAAQS,EAAME,UACpBK,EAAaP,EAAME,WAKF,KA6CXH,KAIR"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import t from"classnames";function i(i){const{items:r=[],active:m,renderItem:c,unit:n,onClick:a}=i;return r.map((i=>{const r=i===m;return e("a",{className:t("i-timepicker-item",{"i-timepicker-item-active":r}),onClick:()=>a(i),children:c?.(i,r,n)??(i<10?`0${i}`:i)},i)}))}export{i as default};
|
|
2
|
-
//# sourceMappingURL=item.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sources":["../../../../packages/components/picker/time/item.tsx"],"sourcesContent":["import classNames from \"classnames\";\n\nexport default function Items(props) {\n\tconst { items = [], active, renderItem, unit, onClick } = props;\n\n\treturn items.map((n) => {\n\t\tconst isActive = n === active;\n\n\t\treturn (\n\t\t\t<a\n\t\t\t\tkey={n}\n\t\t\t\tclassName={classNames(\"i-timepicker-item\", {\n\t\t\t\t\t\"i-timepicker-item-active\": isActive,\n\t\t\t\t})}\n\t\t\t\tonClick={() => onClick(n)}\n\t\t\t>\n\t\t\t\t{renderItem?.(n, isActive, unit) ?? (n < 10 ? `0${n}` : n)}\n\t\t\t</a>\n\t\t);\n\t});\n}\n"],"names":["Items","props","items","active","renderItem","unit","onClick","map","n","isActive","_jsx","className","classNames","children"],"mappings":"kEAEwB,SAAAA,EAAMC,GAC7B,MAAMC,MAAEA,EAAQ,GAAEC,OAAEA,EAAMC,WAAEA,EAAUC,KAAEA,EAAIC,QAAEA,GAAYL,EAE1D,OAAOC,EAAMK,KAAKC,IACjB,MAAMC,EAAWD,IAAML,EAEvB,OACCO,EAEC,IAAA,CAAAC,UAAWC,EAAW,oBAAqB,CAC1C,2BAA4BH,IAE7BH,QAAS,IAAMA,EAAQE,GAAEK,SAExBT,IAAaI,EAAGC,EAAUJ,KAAUG,EAAI,GAAK,IAAIA,IAAMA,IANnDA,EAOF,GAGP"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as i,jsx as t}from"react/jsx-runtime";import{useReactive as r}from"ahooks";import{useMemo as n,useEffect as o}from"react";import s from"./item.js";const m={h:"hour",hh:"hour",m:"minute",mm:"minute",s:"second",ss:"second"};function c(c){const{value:l,stepH:d=1,stepM:h=1,stepS:a=1,format:u,periods:p,renderItem:v,onChange:g,onFallback:f}=c,k=r({period:void 0,hour:void 0,minute:void 0,second:void 0}),[C,N,I]=n((()=>{const e=u.includes("h"),i=u.includes("m"),t=u.includes("s");return[e?Array.from({length:(p?12:24)/d},((e,i)=>i*d)):[],i?Array.from({length:60/h},((e,i)=>i*h)):[],t?Array.from({length:60/a},((e,i)=>i*a)):[]]}),[d,h,a,u,p]),$=(e,i)=>{k[i]=e,(()=>{let e=u.replace(/(hh|h){1}|(mm|m){1}|(ss|s){1}/gi,(e=>{const i=e.toLowerCase(),t=k[m[i]]??0;return i.length>1&&t<10?`0${t??0}`:t??0}));p&&C.length>0&&(e=`${k.period??p[0]} ${e}`),g(e)})()};return o((()=>{let e=l??"";if(p&&C.length>0&&l){const[i,t]=l.split(" ");e=t??"",k.period=p.includes(i)?i:void 0}const i=e.match(/\d+/g)??[];if(!i.length)return void f("");let t=0;const r=u.replace(/(hh|h)+|(mm|m)+|(ss|s)+/gi,(e=>{const r=i[t++]??0;let n=e;return"hour"===m[e]&&(n=Math.min(p?11:23,r)),n=Math.min(59,r),k[m[e]]=n,e.length>1&&n<10?`0${n}`:n}));f(r)}),[l]),e("div",{className:"i-timepicker",children:[C.length>0&&e(i,{children:[p&&t("div",{className:"i-timepicker-list",children:t(s,{items:p,active:k.period,onClick:e=>$(e,"period")})}),t("div",{className:"i-timepicker-list",children:t(s,{items:C,active:k.hour,unit:"hour",renderItem:v,onClick:e=>$(e,"hour")})})]}),N.length>0&&t("div",{className:"i-timepicker-list",children:t(s,{items:N,active:k.minute,unit:"minute",renderItem:v,onClick:e=>$(e,"minute")})}),I.length>0&&t("div",{className:"i-timepicker-list",children:t(s,{items:I,active:k.second,unit:"second",renderItem:v,onClick:e=>$(e,"second")})})]})}export{c as default};
|
|
2
|
-
//# sourceMappingURL=panel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"panel.js","sources":["../../../../packages/components/picker/time/panel.tsx"],"sourcesContent":["import { useReactive } from \"ahooks\";\nimport { useEffect, useMemo } from \"react\";\nimport \"./index.css\";\nimport Items from \"./item\";\n\nconst UnitMaps = {\n\th: \"hour\",\n\thh: \"hour\",\n\tm: \"minute\",\n\tmm: \"minute\",\n\ts: \"second\",\n\tss: \"second\",\n};\n\nexport default function Panel(props) {\n\tconst {\n\t\tvalue,\n\t\tstepH = 1,\n\t\tstepM = 1,\n\t\tstepS = 1,\n\t\tformat,\n\t\tperiods,\n\t\trenderItem,\n\t\tonChange,\n\t\tonFallback,\n\t} = props;\n\tconst state = useReactive<any>({\n\t\tperiod: undefined,\n\t\thour: undefined,\n\t\tminute: undefined,\n\t\tsecond: undefined,\n\t});\n\n\tconst [hours, minutes, seconds] = useMemo(() => {\n\t\tconst hasH = format.includes(\"h\");\n\t\tconst hasM = format.includes(\"m\");\n\t\tconst hasS = format.includes(\"s\");\n\t\tconst hours = hasH\n\t\t\t? Array.from(\n\t\t\t\t\t{ length: (periods ? 12 : 24) / stepH },\n\t\t\t\t\t(_, i) => i * stepH\n\t\t\t )\n\t\t\t: [];\n\t\tconst minutes = hasM\n\t\t\t? Array.from({ length: 60 / stepM }, (_, i) => i * stepM)\n\t\t\t: [];\n\t\tconst seconds = hasS\n\t\t\t? Array.from({ length: 60 / stepS }, (_, i) => i * stepS)\n\t\t\t: [];\n\n\t\treturn [hours, minutes, seconds];\n\t}, [stepH, stepM, stepS, format, periods]);\n\n\tconst updateValue = () => {\n\t\tconst reg = /(hh|h){1}|(mm|m){1}|(ss|s){1}/gi;\n\t\tlet result = format.replace(reg, (pattern) => {\n\t\t\tconst p = pattern.toLowerCase();\n\t\t\tconst u = UnitMaps[p];\n\t\t\tconst n = state[u] ?? 0;\n\n\t\t\treturn p.length > 1 && n < 10 ? `0${n ?? 0}` : n ?? 0;\n\t\t});\n\n\t\tif (periods && hours.length > 0) {\n\t\t\tresult = `${state.period ?? periods[0]} ${result}`;\n\t\t}\n\n\t\tonChange(result);\n\t};\n\n\tconst handleSetTime = (v, unit) => {\n\t\tstate[unit] = v;\n\t\tupdateValue();\n\t};\n\n\tuseEffect(() => {\n\t\tlet time = value ?? \"\";\n\n\t\tif (periods && hours.length > 0 && value) {\n\t\t\tconst [p, t] = value.split(\" \");\n\t\t\ttime = t ?? \"\";\n\t\t\tstate.period = periods.includes(p) ? p : undefined;\n\t\t}\n\n\t\tconst nums = time.match(/\\d+/g) ?? [];\n\n\t\tif (!nums.length) {\n\t\t\tonFallback(\"\");\n\t\t\treturn;\n\t\t}\n\n\t\tlet i = 0;\n\t\tconst r = format.replace(/(hh|h)+|(mm|m)+|(ss|s)+/gi, (p) => {\n\t\t\tconst n = nums[i++] ?? 0;\n\t\t\tlet o = p;\n\n\t\t\tif (UnitMaps[p] === \"hour\") {\n\t\t\t\to = Math.min(periods ? 11 : 23, n);\n\t\t\t}\n\n\t\t\to = Math.min(59, n);\n\n\t\t\tstate[UnitMaps[p]] = o;\n\t\t\treturn p.length > 1 && o < 10 ? `0${o}` : o;\n\t\t});\n\n\t\tonFallback(r);\n\t}, [value]);\n\n\treturn (\n\t\t<div className='i-timepicker'>\n\t\t\t{hours.length > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t{periods && (\n\t\t\t\t\t\t<div className='i-timepicker-list'>\n\t\t\t\t\t\t\t<Items\n\t\t\t\t\t\t\t\titems={periods}\n\t\t\t\t\t\t\t\tactive={state.period}\n\t\t\t\t\t\t\t\tonClick={(p) => handleSetTime(p, \"period\")}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t<div className='i-timepicker-list'>\n\t\t\t\t\t\t<Items\n\t\t\t\t\t\t\titems={hours}\n\t\t\t\t\t\t\tactive={state.hour}\n\t\t\t\t\t\t\tunit='hour'\n\t\t\t\t\t\t\trenderItem={renderItem}\n\t\t\t\t\t\t\tonClick={(h) => handleSetTime(h, \"hour\")}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t{minutes.length > 0 && (\n\t\t\t\t<div className='i-timepicker-list'>\n\t\t\t\t\t<Items\n\t\t\t\t\t\titems={minutes}\n\t\t\t\t\t\tactive={state.minute}\n\t\t\t\t\t\tunit='minute'\n\t\t\t\t\t\trenderItem={renderItem}\n\t\t\t\t\t\tonClick={(m) => handleSetTime(m, \"minute\")}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{seconds.length > 0 && (\n\t\t\t\t<div className='i-timepicker-list'>\n\t\t\t\t\t<Items\n\t\t\t\t\t\titems={seconds}\n\t\t\t\t\t\tactive={state.second}\n\t\t\t\t\t\tunit='second'\n\t\t\t\t\t\trenderItem={renderItem}\n\t\t\t\t\t\tonClick={(s) => handleSetTime(s, \"second\")}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n"],"names":["UnitMaps","h","hh","m","mm","s","ss","Panel","props","value","stepH","stepM","stepS","format","periods","renderItem","onChange","onFallback","state","useReactive","period","undefined","hour","minute","second","hours","minutes","seconds","useMemo","hasH","includes","hasM","hasS","Array","from","length","_","i","handleSetTime","v","unit","result","replace","pattern","p","toLowerCase","n","updateValue","useEffect","time","t","split","nums","match","r","o","Math","min","_jsxs","className","children","_jsx","Items","items","active","onClick"],"mappings":"6KAKA,MAAMA,EAAW,CAChBC,EAAG,OACHC,GAAI,OACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAGmB,SAAAC,EAAMC,GAC7B,MAAMC,MACLA,EAAKC,MACLA,EAAQ,EAACC,MACTA,EAAQ,EA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],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as i,jsxs as o}from"react/jsx-runtime";import{InfoOutlined as n}from"@ricons/material";import{useReactive as e}from"ahooks";import"../button/index.js";import t from"../flex/flex.js";import l from"../icon/icon.js";import r from"../popup/popup.js";import s from"../button/button.js";const c={children:"确定"},a={children:"取消",secondary:!0},p=p=>{const{trigger:m="click",visible:f,icon:d=i(l,{icon:i(n,{}),className:"error"}),content:g,okButtonProps:b,cancelButtonProps:u,children:h,align:j="end",position:v="top",offset:k=12,extra:x,onOk:C,onClose:y,...N}=p,O=e({loading:!1,visible:f}),B=b?Object.assign({},c,b):c,P=u?Object.assign({},a,u):a,V=o("div",{className:"i-popconfirm",children:[o(t,{gap:12,children:[d,i("div",{className:"i-popconfirm-content",children:g})]}),o(t,{gap:12,justify:"flex-end",className:"mt-8 i-popconfirm-footer",children:[null!==u&&i(s,{...P,onClick:async i=>{P.onClick?.(i),await(y?.()),O.visible=!1}}),x,null!==b&&i(s,{loading:O.loading,...B,onClick:async i=>{O.loading=!0,B.onClick?.(i),C?.()?.then((()=>{O.visible=!1})).finally((()=>{O.loading=!1}))}})]})]});return i(r,{content:V,...N,trigger:m,visible:O.visible,align:j,offset:k,position:v,onVisibleChange:i=>{O.visible=i,N.onVisibleChange?.(i)},children:h})};export{p as default};
|
|
2
|
-
//# sourceMappingURL=popconfirm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"popconfirm.js","sources":["../../../packages/components/popconfirm/popconfirm.tsx"],"sourcesContent":["import { InfoOutlined } from \"@ricons/material\";\nimport { useReactive } from \"ahooks\";\nimport { MouseEvent } from \"react\";\nimport Button from \"../button\";\nimport { IButton } from \"../button/type\";\nimport Flex from \"../flex\";\nimport Icon from \"../icon\";\nimport Popup from \"../popup\";\nimport \"./index.css\";\nimport { IPopconfirm } from \"./type\";\n\nconst defaultOk = {\n\tchildren: \"确定\",\n};\n\nconst defaultCancel = {\n\tchildren: \"取消\",\n\tsecondary: true,\n};\n\nconst Popconfirm = (props: IPopconfirm) => {\n\tconst {\n\t\ttrigger = \"click\",\n\t\tvisible,\n\t\ticon = <Icon icon={<InfoOutlined />} className='error' />,\n\t\tcontent,\n\t\tokButtonProps,\n\t\tcancelButtonProps,\n\t\tchildren,\n\t\talign = \"end\",\n\t\tposition = \"top\",\n\t\toffset = 12,\n\t\textra,\n\t\tonOk,\n\t\tonClose,\n\t\t...restProps\n\t} = props;\n\n\tconst state = useReactive({\n\t\tloading: false,\n\t\tvisible,\n\t});\n\n\tconst ok: IButton = okButtonProps\n\t\t? Object.assign({}, defaultOk, okButtonProps)\n\t\t: defaultOk;\n\tconst cancel: IButton = cancelButtonProps\n\t\t? Object.assign({}, defaultCancel, cancelButtonProps)\n\t\t: defaultCancel;\n\n\tconst handleVisibleChange = (v: boolean) => {\n\t\tstate.visible = v;\n\t\trestProps.onVisibleChange?.(v);\n\t};\n\n\tconst handleOk = async (e: MouseEvent<HTMLElement>) => {\n\t\tstate.loading = true;\n\t\tok.onClick?.(e);\n\n\t\tonOk?.()\n\t\t\t?.then(() => {\n\t\t\t\tstate.visible = false;\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tstate.loading = false;\n\t\t\t});\n\t};\n\n\tconst handleCancel = async (e: MouseEvent<HTMLElement>) => {\n\t\tcancel.onClick?.(e);\n\t\tawait onClose?.();\n\t\tstate.visible = false;\n\t};\n\n\tconst popconfirmContent = (\n\t\t<div className='i-popconfirm'>\n\t\t\t<Flex gap={12}>\n\t\t\t\t{icon}\n\t\t\t\t<div className='i-popconfirm-content'>{content}</div>\n\t\t\t</Flex>\n\n\t\t\t<Flex\n\t\t\t\tgap={12}\n\t\t\t\tjustify='flex-end'\n\t\t\t\tclassName='mt-8 i-popconfirm-footer'\n\t\t\t>\n\t\t\t\t{cancelButtonProps !== null && (\n\t\t\t\t\t<Button {...cancel} onClick={handleCancel} />\n\t\t\t\t)}\n\t\t\t\t{extra}\n\t\t\t\t{okButtonProps !== null && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tloading={state.loading}\n\t\t\t\t\t\t{...ok}\n\t\t\t\t\t\tonClick={handleOk}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Flex>\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<Popup\n\t\t\tcontent={popconfirmContent}\n\t\t\t{...restProps}\n\t\t\ttrigger={trigger}\n\t\t\tvisible={state.visible}\n\t\t\talign={align}\n\t\t\toffset={offset}\n\t\t\tposition={position}\n\t\t\tonVisibleChange={handleVisibleChange}\n\t\t>\n\t\t\t{children}\n\t\t</Popup>\n\t);\n};\n\nexport default Popconfirm;\n"],"names":["defaultOk","children","defaultCancel","secondary","Popconfirm","props","trigger","visible","icon","_jsx","Icon","InfoOutlined","className","content","okButtonProps","cancelButtonProps","align","position","offset","extra","onOk","onClose","restProps","state","useReactive","loading","ok","Object","assign","cancel","popconfirmContent","_jsxs","Flex","gap","justify","Button","onClick","async","e","then","finally","Popup","onVisibleChange","v"],"mappings":"oSAWA,MAAMA,EAAY,CACjBC,SAAU,MAGLC,EAAgB,CACrBD,SAAU,KACVE,WAAW,GAGNC,EAAcC,IACnB,MAAMC,QACLA,EAAU,QAAOC,QACjBA,EAAOC,KACPA,EAAOC,EAACC,EAAI,CAACF,KAAMC,EAACE,EAAY,CAAA,GAAKC,UAAU,UAAUC,QACzDA,EAAOC,cACPA,EAAaC,kBACbA,EAAiBd,SACjBA,EAAQe,MACRA,EAAQ,MAAKC,SACbA,EAAW,MAAKC,OAChBA,EAAS,GAAEC,MACXA,EAAKC,KACLA,EAAIC,QACJA,KACGC,GACAjB,EAEEkB,EAAQC,EAAY,CACzBC,SAAS,EACTlB,YAGKmB,EAAcZ,EACjBa,OAAOC,OAAO,GAAI5B,EAAWc,GAC7Bd,EACG6B,EAAkBd,EACrBY,OAAOC,OAAO,GAAI1B,EAAea,GACjCb,EA0BG4B,EACLC,EAAK,MAAA,CAAAnB,UAAU,eAAcX,SAAA,CAC5B8B,EAACC,GAAKC,IAAK,GACThC,SAAA,CAAAO,EACDC,EAAK,MAAA,CAAAG,UAAU,gCAAwBC,OAGxCkB,EAACC,EACA,CAAAC,IAAK,GACLC,QAAQ,WACRtB,UAAU,2BAA0BX,SAAA,CAEb,OAAtBc,GACAN,EAAC0B,EAAM,IAAKN,EAAQO,QAnBHC,MAAOC,IAC3BT,EAAOO,UAAUE,SACXjB,OACNE,EAAMhB,SAAU,CAAK,IAkBlBY,EACkB,OAAlBL,GACAL,EAAC0B,EACA,CAAAV,QAASF,EAAME,WACXC,EACJU,QAvCYC,MAAOC,IACvBf,EAAME,SAAU,EAChBC,EAAGU,UAAUE,GAEblB,OACGmB,MAAK,KACNhB,EAAMhB,SAAU,CAAK,IAErBiC,SAAQ,KACRjB,EAAME,SAAU,CAAK,GACpB,UAoCJ,OACChB,EAACgC,EACA,CAAA5B,QAASiB,KACLR,EACJhB,QAASA,EACTC,QAASgB,EAAMhB,QACfS,MAAOA,EACPE,OAAQA,EACRD,SAAUA,EACVyB,gBA5D2BC,IAC5BpB,EAAMhB,QAAUoC,EAChBrB,EAAUoB,kBAAkBC,EAAE,WA4D5B1C,GACM"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as t,jsx as r}from"react/jsx-runtime";import e from"classnames";import{useMemo as a}from"react";import{createPortal as o}from"react-dom";const s=s=>{const{ref:n,getContainer:c=t=>t?.offsetParent??document.body,trigger:l,arrow:m,arrowProps:p={},className:i,children:f,...d}=s,g=a((()=>{let{left:t,top:r,pos:e}=p,a="";switch(e){case"left":t+=2,a="translate(-100%, -50%) rotate(180deg)";break;case"right":t-=2,a="translate(0, -50%)";break;case"top":r-=2,a="translate(-50%, -50%) rotate(-90deg)";break;case"bottom":r+=2,a="translate(-50%, -50%) rotate(90deg)"}return{left:t,top:r,transform:a}}),[p]),w=t("div",{ref:n,className:e("i-popup",i),...d,children:[m&&r("svg",{xmlns:"http://www.w3.org/2000/svg",className:"i-popup-arrow",style:g,children:r("path",{d:"M0.5 0L1.5 0C1.5 4, 3 5.5, 5 7.5S8,10 8,12S7 14.5, 5 16.5S1.5,20 1.5,24L0.5 24L0.5 0z"})}),f]});return o(w,c(l))};export{s as default};
|
|
2
|
-
//# sourceMappingURL=content.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sources":["../../../packages/components/popup/content.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { useMemo } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { IPopupContent } from \"./type\";\n\nconst Content = (props: IPopupContent) => {\n\tconst {\n\t\tref,\n\t\tgetContainer = (trigger) => trigger?.offsetParent ?? document.body,\n\t\ttrigger,\n\t\tarrow,\n\t\tarrowProps = {},\n\t\tclassName,\n\t\tchildren,\n\t\t...restProps\n\t} = props;\n\n\tconst arrowCSS = useMemo(() => {\n\t\tlet { left, top, pos } = arrowProps;\n\t\tlet transform = \"\";\n\n\t\tswitch (pos) {\n\t\t\tcase \"left\":\n\t\t\t\tleft += 2;\n\t\t\t\ttransform = `translate(-100%, -50%) rotate(180deg)`;\n\t\t\t\tbreak;\n\t\t\tcase \"right\":\n\t\t\t\tleft -= 2;\n\t\t\t\ttransform = `translate(0, -50%)`;\n\t\t\t\tbreak;\n\t\t\tcase \"top\":\n\t\t\t\ttop -= 2;\n\t\t\t\ttransform = `translate(-50%, -50%) rotate(-90deg)`;\n\t\t\t\tbreak;\n\t\t\tcase \"bottom\":\n\t\t\t\ttop += 2;\n\t\t\t\ttransform = `translate(-50%, -50%) rotate(90deg)`;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn {\n\t\t\tleft,\n\t\t\ttop,\n\t\t\ttransform,\n\t\t};\n\t}, [arrowProps]);\n\n\tconst content = (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={classNames(\"i-popup\", className)}\n\t\t\t{...restProps}\n\t\t>\n\t\t\t{arrow && (\n\t\t\t\t<svg\n\t\t\t\t\txmlns='http://www.w3.org/2000/svg'\n\t\t\t\t\tclassName='i-popup-arrow'\n\t\t\t\t\tstyle={arrowCSS}\n\t\t\t\t>\n\t\t\t\t\t<path d='M0.5 0L1.5 0C1.5 4, 3 5.5, 5 7.5S8,10 8,12S7 14.5, 5 16.5S1.5,20 1.5,24L0.5 24L0.5 0z' />\n\t\t\t\t</svg>\n\t\t\t)}\n\n\t\t\t{children}\n\t\t</div>\n\t);\n\n\treturn createPortal(content, getContainer(trigger));\n};\n\nexport default Content;\n"],"names":["Content","props","ref","getContainer","trigger","offsetParent","document","body","arrow","arrowProps","className","children","restProps","arrowCSS","useMemo","left","top","pos","transform","content","_jsxs","classNames","_jsx","xmlns","style","d","createPortal"],"mappings":"qJAKA,MAAMA,EAAWC,IAChB,MAAMC,IACLA,EAAGC,aACHA,EAAgBC,GAAYA,GAASC,cAAgBC,SAASC,KAAIH,QAClEA,EAAOI,MACPA,EAAKC,WACLA,EAAa,CAAE,EAAAC,UACfA,EAASC,SACTA,KACGC,GACAX,EAEEY,EAAWC,GAAQ,KACxB,IAAIC,KAAEA,EAAIC,IAAEA,EAAGC,IAAEA,GAAQR,EACrBS,EAAY,GAEhB,OAAQD,GACP,IAAK,OACJF,GAAQ,EACRG,EAAY,wCACZ,MACD,IAAK,QACJH,GAAQ,EACRG,EAAY,qBACZ,MACD,IAAK,MACJF,GAAO,EACPE,EAAY,uCACZ,MACD,IAAK,SACJF,GAAO,EACPE,EAAY,sCAMd,MAAO,CACNH,OACAC,MACAE,YACA,GACC,CAACT,IAEEU,EACLC,EAAA,MAAA,CACClB,IAAKA,EACLQ,UAAWW,EAAW,UAAWX,MAC7BE,EAASD,SAAA,CAEZH,GACAc,EAAA,MAAA,CACCC,MAAM,6BACNb,UAAU,gBACVc,MAAOX,EAAQF,SAEfW,UAAMG,EAAE,4FAITd,KAIH,OAAOe,EAAaP,EAAShB,EAAaC,GAAS"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as r,Fragment as t,jsx as e}from"react/jsx-runtime";import{useReactive as o,useCreation as n}from"ahooks";import{useRef as s,useMemo as c,useEffect as i,useLayoutEffect as u,Children as a,isValidElement as l,cloneElement as f}from"react";import{useMouseUp as p,useResizeObserver as h}from"../../js/hooks.js";import{getPointPosition as w,getPosition as m}from"../../js/utils.js";import g from"./content.js";function y(y){const{visible:d=!1,content:v,trigger:b="hover",gap:x=12,offset:j=8,fixed:P,position:k="top",showDelay:T=16,hideDelay:C=12,touchable:M,arrow:N=!0,align:W,fitSize:D,watchResize:O,clickOutside:z=!0,disabled:E,referToWindow:L,style:X,className:Y,getContainer:B,children:F,onVisibleChange:H}=y,R=s(null),S=s(null),V=s(null),q=s(""),A=o({show:!1,style:{position:P?"fixed":"absolute"},arrowProps:{}});p((r=>{if(!R.current||!S.current||!z)return;const t=r.target,e=R.current.contains(t)||S.current.contains(t);A.show&&!e&&K(!1)}));const G=()=>{V.current&&(clearTimeout(V.current),V.current=null)},I=()=>{E||A.show&&("hover"!==b||"hover"===b&&!M)||(A.show=!0,q.current="showing",V.current=setTimeout((()=>{if("showing"!==q.current)return;const[r,t,{arrowX:e,arrowY:o,arrowPos:n}]=m(R.current,S.current,{position:k,gap:x,offset:j,align:W,refWindow:L});A.style={...A.style,opacity:1,transform:"none",left:r,top:t},A.arrowProps={left:e,top:o,pos:n},H?.(!0),G(),q.current=""}),T))},J=()=>{A.show&&(q.current="hiding",V.current=setTimeout((()=>{"hiding"===q.current?(A.style={...A.style,opacity:0,transform:"translate(0, 2px)"},setTimeout((()=>{A.show=!1,G(),H?.(!1),q.current=""}),160)):G()}),C))},K=r=>{void 0===r?A.show?J():I():r?I():J()},Q=n((()=>({click:{onClick:()=>K(!0)},hover:{onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1)},focus:{onFocus:()=>K(!0),onBlur:()=>K(!1)},contextmenu:{onContextMenu:r=>{if(r.preventDefault(),r.stopPropagation(),A.show){const[t,e]=w(r,S.current);A.style={...A.style,left:t,top:e}}else A.show=!0,V.current=setTimeout((()=>{const[t,e]=w(r,S.current);A.style={...A.style,opacity:1,transform:"none",left:t,top:e},G(),H?.(!0)}),T)}},none:{}})),[]),U=c((()=>{if(!M)return{};const r={};return"hover"===b&&(r.onMouseEnter=()=>{G()},r.onMouseLeave=()=>K(!1)),r}),[M,b]),Z=()=>{if(!A.show)return;const[r,t,{arrowX:e,arrowY:o,arrowPos:n}]=m(R.current,S.current,{position:k,gap:x,offset:j,align:W,refWindow:L});Object.assign(A,{style:{...A.style,left:r,top:t},arrowProps:{left:e,top:o,pos:n}})};return i((()=>{if("contextmenu"===b)return;const{observe:r,unobserve:t,disconnect:e}=h();return R.current&&r(R.current,Z),O&&S.current?(r(S.current,Z),()=>{O&&S.current&&(t(S.current),R.current&&t(R.current),e())}):void 0}),[O,S.current,R.current]),u((()=>{if(!D||!A.show)return;const r=["top","bottom"].includes(k),t=R.current?.[r?"offsetWidth":"offsetHeight"];A.style={...A.style,[r?"width":"height"]:t}}),[A.show,D]),u((()=>{K(d)}),[d]),r(t,{children:[a.map(F,(r=>{if(!l(r))return;const{className:t,...e}=r.props;return Object.keys(Q[b]).map((r=>{if(!e[r])return;const t=Q[b][r];Q[b][r]=o=>{t(),e[r](o)}})),f(r,{ref:R,className:t,...e,...Q[b]})})),A.show&&e(g,{ref:S,arrow:N&&"contextmenu"!==b,style:{...X,...A.style},arrowProps:A.arrowProps,className:Y,...U,trigger:R.current,getContainer:B,children:v})]})}export{y as default};
|
|
2
|
-
//# sourceMappingURL=popup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"popup.js","sources":["../../../packages/components/popup/popup.tsx"],"sourcesContent":["import { useCreation, useReactive } from \"ahooks\";\nimport {\n\tCSSProperties,\n\tChildren,\n\tMouseEvent,\n\tcloneElement,\n\tisValidElement,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseMemo,\n\tuseRef,\n} from \"react\";\nimport { useMouseUp, useResizeObserver } from \"../../js/hooks\";\nimport { getPointPosition, getPosition } from \"../../js/utils\";\nimport Content from \"./content\";\nimport \"./index.css\";\nimport { IPopup } from \"./type\";\n\nexport default function Popup(props: IPopup) {\n\tconst {\n\t\tvisible = false,\n\t\tcontent,\n\t\ttrigger = \"hover\",\n\t\tgap = 12,\n\t\toffset = 8,\n\t\tfixed,\n\t\tposition = \"top\",\n\t\tshowDelay = 16,\n\t\thideDelay = 12,\n\t\ttouchable,\n\t\tarrow = true,\n\t\talign,\n\t\tfitSize,\n\t\twatchResize,\n\t\tclickOutside = true,\n\t\tdisabled,\n\t\treferToWindow,\n\t\tstyle,\n\t\tclassName,\n\t\tgetContainer,\n\t\tchildren,\n\t\tonVisibleChange,\n\t} = props;\n\n\tconst triggerRef = useRef<HTMLElement>(null);\n\tconst contentRef = useRef<HTMLDivElement>(null);\n\tconst timerRef = useRef<any>(null);\n\tconst statusRef = useRef<string>(\"\");\n\tconst state = useReactive<{\n\t\tshow: boolean;\n\t\tstyle: CSSProperties;\n\t\tarrowProps: Record<string, any>;\n\t}>({\n\t\tshow: false,\n\t\tstyle: { position: fixed ? \"fixed\" : \"absolute\" },\n\t\tarrowProps: {},\n\t});\n\n\tuseMouseUp((e) => {\n\t\tif (!triggerRef.current || !contentRef.current || !clickOutside) return;\n\n\t\tconst tar = e.target as HTMLElement;\n\t\tconst isContain =\n\t\t\ttriggerRef.current.contains(tar) ||\n\t\t\tcontentRef.current.contains(tar);\n\n\t\tif (!state.show || isContain) return;\n\n\t\thandleToggle(false);\n\t});\n\n\tconst clearTimer = () => {\n\t\tif (!timerRef.current) return;\n\t\tclearTimeout(timerRef.current);\n\t\ttimerRef.current = null;\n\t};\n\n\tconst handleShow = () => {\n\t\tif (disabled) return;\n\t\tif (\n\t\t\tstate.show &&\n\t\t\t(trigger !== \"hover\" || (trigger === \"hover\" && !touchable))\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tstate.show = true;\n\t\tstatusRef.current = \"showing\";\n\t\ttimerRef.current = setTimeout(() => {\n\t\t\tif (statusRef.current !== \"showing\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst [left, top, { arrowX, arrowY, arrowPos }] = getPosition(\n\t\t\t\ttriggerRef.current,\n\t\t\t\tcontentRef.current,\n\t\t\t\t{\n\t\t\t\t\tposition,\n\t\t\t\t\tgap,\n\t\t\t\t\toffset,\n\t\t\t\t\talign,\n\t\t\t\t\trefWindow: referToWindow,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tstate.style = {\n\t\t\t\t...state.style,\n\t\t\t\topacity: 1,\n\t\t\t\ttransform: \"none\",\n\t\t\t\tleft,\n\t\t\t\ttop,\n\t\t\t};\n\t\t\tstate.arrowProps = {\n\t\t\t\tleft: arrowX,\n\t\t\t\ttop: arrowY,\n\t\t\t\tpos: arrowPos,\n\t\t\t};\n\t\t\tonVisibleChange?.(true);\n\t\t\tclearTimer();\n\t\t\tstatusRef.current = \"\";\n\t\t}, showDelay);\n\t};\n\n\tconst handleHide = () => {\n\t\tif (!state.show) return;\n\n\t\tstatusRef.current = \"hiding\";\n\t\ttimerRef.current = setTimeout(() => {\n\t\t\tif (statusRef.current !== \"hiding\") {\n\t\t\t\tclearTimer();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstate.style = {\n\t\t\t\t...state.style,\n\t\t\t\topacity: 0,\n\t\t\t\ttransform: \"translate(0, 2px)\",\n\t\t\t};\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tstate.show = false;\n\t\t\t\tclearTimer();\n\t\t\t\tonVisibleChange?.(false);\n\t\t\t\tstatusRef.current = \"\";\n\t\t\t}, 160);\n\t\t}, hideDelay);\n\t};\n\n\tconst handleToggle = (action?: boolean) => {\n\t\tif (action !== undefined) {\n\t\t\taction ? handleShow() : handleHide();\n\t\t\treturn;\n\t\t}\n\n\t\tstate.show ? handleHide() : handleShow();\n\t};\n\tconst eventMaps = useCreation(\n\t\t() => ({\n\t\t\tclick: {\n\t\t\t\tonClick: () => handleToggle(true),\n\t\t\t},\n\t\t\thover: {\n\t\t\t\tonMouseEnter: () => handleToggle(true),\n\t\t\t\tonMouseLeave: () => handleToggle(false),\n\t\t\t},\n\t\t\tfocus: {\n\t\t\t\tonFocus: () => handleToggle(true),\n\t\t\t\tonBlur: () => handleToggle(false),\n\t\t\t},\n\t\t\tcontextmenu: {\n\t\t\t\tonContextMenu: (e: MouseEvent) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\n\t\t\t\t\tif (state.show) {\n\t\t\t\t\t\tconst [left, top] = getPointPosition(\n\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\tcontentRef.current as HTMLElement\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tstate.style = {\n\t\t\t\t\t\t\t...state.style,\n\t\t\t\t\t\t\tleft,\n\t\t\t\t\t\t\ttop,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.show = true;\n\n\t\t\t\t\ttimerRef.current = setTimeout(() => {\n\t\t\t\t\t\tconst [left, top] = getPointPosition(\n\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\tcontentRef.current as HTMLElement\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tstate.style = {\n\t\t\t\t\t\t\t...state.style,\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransform: \"none\",\n\t\t\t\t\t\t\tleft,\n\t\t\t\t\t\t\ttop,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tclearTimer();\n\t\t\t\t\t\tonVisibleChange?.(true);\n\t\t\t\t\t}, showDelay);\n\t\t\t\t},\n\t\t\t},\n\t\t\tnone: {},\n\t\t}),\n\t\t[]\n\t);\n\n\tconst contentTouch = useMemo(() => {\n\t\tif (!touchable) return {};\n\t\tconst events: { [key: string]: () => void } = {};\n\n\t\tif (trigger === \"hover\") {\n\t\t\tevents[\"onMouseEnter\"] = () => {\n\t\t\t\tclearTimer();\n\t\t\t};\n\t\t\tevents[\"onMouseLeave\"] = () => handleToggle(false);\n\t\t}\n\n\t\treturn events;\n\t}, [touchable, trigger]);\n\n\tconst computePosition = () => {\n\t\tif (!state.show) return;\n\n\t\tconst [left, top, { arrowX, arrowY, arrowPos }] = getPosition(\n\t\t\ttriggerRef.current,\n\t\t\tcontentRef.current,\n\t\t\t{\n\t\t\t\tposition,\n\t\t\t\tgap,\n\t\t\t\toffset,\n\t\t\t\talign,\n\t\t\t\trefWindow: referToWindow,\n\t\t\t}\n\t\t);\n\n\t\tObject.assign(state, {\n\t\t\tstyle: { ...state.style, left, top },\n\t\t\tarrowProps: { left: arrowX, top: arrowY, pos: arrowPos },\n\t\t});\n\t};\n\n\tuseEffect(() => {\n\t\tif (trigger === \"contextmenu\") return;\n\t\tconst { observe, unobserve, disconnect } = useResizeObserver();\n\n\t\ttriggerRef.current && observe(triggerRef.current, computePosition);\n\n\t\tif (!watchResize || !contentRef.current) return;\n\n\t\tobserve(contentRef.current, computePosition);\n\n\t\treturn () => {\n\t\t\tif (!watchResize || !contentRef.current) return;\n\n\t\t\tunobserve(contentRef.current);\n\t\t\ttriggerRef.current && unobserve(triggerRef.current);\n\t\t\tdisconnect();\n\t\t};\n\t}, [watchResize, contentRef.current, triggerRef.current]);\n\n\tuseLayoutEffect(() => {\n\t\tif (!fitSize || !state.show) return;\n\n\t\tconst vertical = [\"top\", \"bottom\"].includes(position);\n\t\tconst size =\n\t\t\ttriggerRef.current?.[vertical ? \"offsetWidth\" : \"offsetHeight\"];\n\t\tstate.style = { ...state.style, [vertical ? \"width\" : \"height\"]: size };\n\t}, [state.show, fitSize]);\n\n\tuseLayoutEffect(() => {\n\t\thandleToggle(visible);\n\t}, [visible]);\n\n\treturn (\n\t\t<>\n\t\t\t{Children.map(children, (child) => {\n\t\t\t\tif (!isValidElement(child)) return;\n\n\t\t\t\tconst { className, ...restProps } = child.props as any;\n\t\t\t\tObject.keys(eventMaps[trigger]).map((evt) => {\n\t\t\t\t\tif (!restProps[evt]) return;\n\t\t\t\t\tconst fn = eventMaps[trigger][evt];\n\n\t\t\t\t\teventMaps[trigger][evt] = (e) => {\n\t\t\t\t\t\tfn();\n\t\t\t\t\t\trestProps[evt](e);\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\treturn cloneElement(child, {\n\t\t\t\t\tref: triggerRef,\n\t\t\t\t\tclassName,\n\t\t\t\t\t...restProps,\n\t\t\t\t\t...eventMaps[trigger],\n\t\t\t\t});\n\t\t\t})}\n\n\t\t\t{state.show && (\n\t\t\t\t<Content\n\t\t\t\t\tref={contentRef}\n\t\t\t\t\tarrow={arrow && trigger !== \"contextmenu\"}\n\t\t\t\t\tstyle={{ ...style, ...state.style }}\n\t\t\t\t\tarrowProps={state.arrowProps}\n\t\t\t\t\tclassName={className}\n\t\t\t\t\t{...contentTouch}\n\t\t\t\t\ttrigger={triggerRef.current as HTMLElement}\n\t\t\t\t\tgetContainer={getContainer}\n\t\t\t\t>\n\t\t\t\t\t{content}\n\t\t\t\t</Content>\n\t\t\t)}\n\t\t</>\n\t);\n}\n"],"names":["Popup","props","visible","content","trigger","gap","offset","fixed","position","showDelay","hideDelay","touchable","arrow","align","fitSize","watchResize","clickOutside","disabled","referToWindow","style","className","getContainer","children","onVisibleChange","triggerRef","useRef","contentRef","timerRef","statusRef","state","useReactive","show","arrowProps","useMouseUp","e","current","tar","target","isContain","contains","handleToggle","clearTimer","clearTimeout","handleShow","setTimeout","left","top","arrowX","arrowY","arrowPos","getPosition","refWindow","opacity","transform","pos","handleHide","action","undefined","eventMaps","useCreation","click","onClick","hover","onMouseEnter","onMouseLeave","focus","onFocus","onBlur","contextmenu","onContextMenu","preventDefault","stopPropagation","getPointPosition","none","contentTouch","useMemo","events","computePosition","Object","assign","useEffect","observe","unobserve","disconnect","useResizeObserver","useLayoutEffect","vertical","includes","size","_jsxs","_Fragment","Children","map","child","isValidElement","restProps","keys","evt","fn","cloneElement","ref","_jsx","Content"],"mappings":"kaAkBwB,SAAAA,EAAMC,GAC7B,MAAMC,QACLA,GAAU,EAAKC,QACfA,EAAOC,QACPA,EAAU,QAAOC,IACjBA,EAAM,GAAEC,OACRA,EAAS,EAACC,MACVA,EAAKC,SACLA,EAAW,MAAKC,UAChBA,EAAY,GAAEC,UACdA,EAAY,GAAEC,UACdA,EAASC,MACTA,GAAQ,EAAIC,MACZA,EAAKC,QACLA,EAAOC,YACPA,EAAWC,aACXA,GAAe,EAAIC,SACnBA,EAAQC,cACRA,EAAaC,MACbA,EAAKC,UACLA,EAASC,aACTA,EAAYC,SACZA,EAAQC,gBACRA,GACGtB,EAEEuB,EAAaC,EAAoB,MACjCC,EAAaD,EAAuB,MACpCE,EAAWF,EAAY,MACvBG,EAAYH,EAAe,IAC3BI,EAAQC,EAIX,CACFC,MAAM,EACNZ,MAAO,CAAEX,SAAUD,EAAQ,QAAU,YACrCyB,WAAY,CAAE,IAGfC,GAAYC,IACX,IAAKV,EAAWW,UAAYT,EAAWS,UAAYnB,EAAc,OAEjE,MAAMoB,EAAMF,EAAEG,OACRC,EACLd,EAAWW,QAAQI,SAASH,IAC5BV,EAAWS,QAAQI,SAASH,GAExBP,EAAME,OAAQO,GAEnBE,GAAa,EAAM,IAGpB,MAAMC,EAAa,KACbd,EAASQ,UACdO,aAAaf,EAASQ,SACtBR,EAASQ,QAAU,KAAI,EAGlBQ,EAAa,KACd1B,GAEHY,EAAME,OACO,UAAZ3B,GAAoC,UAAZA,IAAwBO,KAKlDkB,EAAME,MAAO,EACbH,EAAUO,QAAU,UACpBR,EAASQ,QAAUS,YAAW,KAC7B,GAA0B,YAAtBhB,EAAUO,QACb,OAED,MAAOU,EAAMC,GAAKC,OAAEA,EAAMC,OAAEA,EAAMC,SAAEA,IAAcC,EACjD1B,EAAWW,QACXT,EAAWS,QACX,CACC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ACEC,EAAA,CAAApE,SAAA,CAAAqE,EAASC,IAAItE,GAAWuE,IACxB,IAAKC,EAAeD,GAAQ,OAE5B,MAAMzE,UAAEA,KAAc2E,GAAcF,EAAM5F,MAW1C,OAVA6E,OAAOkB,KAAKtC,EAAUtD,IAAUwF,KAAKK,IACpC,IAAKF,EAAUE,GAAM,OACrB,MAAMC,EAAKxC,EAAUtD,GAAS6F,GAE9BvC,EAAUtD,GAAS6F,GAAQ/D,IAC1BgE,IACAH,EAAUE,GAAK/D,EAAE,CACjB,IAGKiE,EAAaN,EAAO,CAC1BO,IAAK5E,EACLJ,eACG2E,KACArC,EAAUtD,IACZ,IAGFyB,EAAME,MACNsE,EAACC,EAAO,CACPF,IAAK1E,EACLd,MAAOA,GAAqB,gBAAZR,EAChBe,MAAO,IAAKA,KAAUU,EAAMV,OAC5Ba,WAAYH,EAAMG,WAClBZ,UAAWA,KACPsD,EACJtE,QAASoB,EAAWW,QACpBd,aAAcA,EAAYC,SAEzBnB,MAKN"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as r}from"react/jsx-runtime";import"../text/index.js";import c from"../text/text.js";function i(i){const{value:s,circleSize:t=40,lineWidth:a=8}=i;return e("div",{className:"i-progress-circle",children:[e("svg",{width:t,height:t,children:[r("circle",{cx:t/2,cy:t/2,r:t/2-a/2,fill:"none",stroke:"var(--background-opacity-2)",strokeWidth:a}),r("circle",{cx:t/2,cy:t/2,r:t/2-a/2,fill:"none",stroke:"var(--color-main)",strokeWidth:a,strokeDasharray:100,pathLength:100,className:"i-progress-circle-path",strokeLinecap:"round",style:{strokeDashoffset:`calc(100 - ${s})`}})]}),e("span",{className:"i-progress-circle-value",children:[r("span",{children:s}),r(c,{size:".81em",className:"color-7",children:"%"})]})]})}export{i as default};
|
|
2
|
-
//# sourceMappingURL=circle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"circle.js","sources":["../../../packages/components/progress/circle.tsx"],"sourcesContent":["import Text from \"../text\";\nimport { IProgress } from \"./type\";\n\nexport default function Circle(\n\tprops: Pick<IProgress, \"value\" | \"circleSize\" | \"lineWidth\">\n) {\n\tconst { value, circleSize = 40, lineWidth = 8 } = props;\n\n\treturn (\n\t\t<div className='i-progress-circle'>\n\t\t\t<svg width={circleSize} height={circleSize}>\n\t\t\t\t<circle\n\t\t\t\t\tcx={circleSize / 2}\n\t\t\t\t\tcy={circleSize / 2}\n\t\t\t\t\tr={circleSize / 2 - lineWidth / 2}\n\t\t\t\t\tfill='none'\n\t\t\t\t\tstroke='var(--background-opacity-2)'\n\t\t\t\t\tstrokeWidth={lineWidth}\n\t\t\t\t/>\n\t\t\t\t<circle\n\t\t\t\t\tcx={circleSize / 2}\n\t\t\t\t\tcy={circleSize / 2}\n\t\t\t\t\tr={circleSize / 2 - lineWidth / 2}\n\t\t\t\t\tfill='none'\n\t\t\t\t\tstroke='var(--color-main)'\n\t\t\t\t\tstrokeWidth={lineWidth}\n\t\t\t\t\tstrokeDasharray={100}\n\t\t\t\t\tpathLength={100}\n\t\t\t\t\tclassName='i-progress-circle-path'\n\t\t\t\t\tstrokeLinecap='round'\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tstrokeDashoffset: `calc(100 - ${value})`,\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</svg>\n\n\t\t\t<span className='i-progress-circle-value'>\n\t\t\t\t<span>{value}</span>\n\t\t\t\t<Text size='.81em' className='color-7'>\n\t\t\t\t\t%\n\t\t\t\t</Text>\n\t\t\t</span>\n\t\t</div>\n\t);\n}\n"],"names":["Circle","props","value","circleSize","lineWidth","_jsxs","className","children","width","height","_jsx","cx","cy","r","fill","stroke","strokeWidth","strokeDasharray","pathLength","strokeLinecap","style","strokeDashoffset","Text","size"],"mappings":"0GAGwB,SAAAA,EACvBC,GAEA,MAAMC,MAAEA,EAAKC,WAAEA,EAAa,GAAEC,UAAEA,EAAY,GAAMH,EAElD,OACCI,SAAKC,UAAU,oBACdC,SAAA,CAAAF,EAAA,MAAA,CAAKG,MAAOL,EAAYM,OAAQN,YAC/BO,EACC,SAAA,CAAAC,GAAIR,EAAa,EACjBS,GAAIT,EAAa,EACjBU,EAAGV,EAAa,EAAIC,EAAY,EAChCU,KAAK,OACLC,OAAO,8BACPC,YAAaZ,IAEdM,YACCC,GAAIR,EAAa,EACjBS,GAAIT,EAAa,EACjBU,EAAGV,EAAa,EAAIC,EAAY,EAChCU,KAAK,OACLC,OAAO,oBACPC,YAAaZ,EACba,gBAAiB,IACjBC,WAAY,IACZZ,UAAU,yBACVa,cAAc,QACdC,MAAO,CACNC,iBAAkB,cAAcnB,WAKnCG,EAAA,OAAA,CAAMC,UAAU,0BACfC,SAAA,CAAAG,EAAA,OAAA,CAAAH,SAAOL,IACPQ,EAACY,EAAK,CAAAC,KAAK,QAAQjB,UAAU,UAEtBC,SAAA,WAIX"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import e from"classnames";const s=s=>{const{ref:o,value:t,lineWidth:i,vertical:a,barClass:n,dragging:c,renderCursor:l,onMouseDown:h,onTouchStart:d}=s;return r("div",{ref:o,className:e("i-progress",{"i-progress-vertical":a}),style:{[a?"width":"height"]:i},onMouseDown:h,onTouchStart:d,children:r("div",{className:e("i-progress-bar",n,{"no-transition":c}),style:{[a?"height":"width"]:`${t}%`},children:l&&r("a",{className:"i-progress-cursor",children:l(t??0)})})})};export{s as default};
|
|
2
|
-
//# sourceMappingURL=line.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"line.js","sources":["../../../packages/components/progress/line.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { MouseEvent, RefObject } from \"react\";\nimport { IProgress } from \"./type\";\n\nconst Line = (\n\tprops: Pick<\n\t\tIProgress,\n\t\t\"value\" | \"vertical\" | \"lineWidth\" | \"barClass\" | \"renderCursor\"\n\t> & {\n\t\tref: RefObject<HTMLDivElement | null>;\n\t\tdragging: boolean;\n\t\tonMouseDown: (e: MouseEvent) => void;\n\t\tonTouchStart: (e) => void;\n\t}\n) => {\n\tconst {\n\t\tref,\n\t\tvalue,\n\t\tlineWidth,\n\t\tvertical,\n\t\tbarClass,\n\t\tdragging,\n\t\trenderCursor,\n\t\tonMouseDown,\n\t\tonTouchStart,\n\t} = props;\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={classNames(\"i-progress\", {\n\t\t\t\t\"i-progress-vertical\": vertical,\n\t\t\t})}\n\t\t\tstyle={{ [vertical ? \"width\" : \"height\"]: lineWidth }}\n\t\t\tonMouseDown={onMouseDown}\n\t\t\tonTouchStart={onTouchStart}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames(\"i-progress-bar\", barClass, {\n\t\t\t\t\t\"no-transition\": dragging,\n\t\t\t\t})}\n\t\t\t\tstyle={{ [vertical ? \"height\" : \"width\"]: `${value}%` }}\n\t\t\t>\n\t\t\t\t{renderCursor && (\n\t\t\t\t\t<a className='i-progress-cursor'>\n\t\t\t\t\t\t{renderCursor(value ?? 0)}\n\t\t\t\t\t</a>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default Line;\n"],"names":["Line","props","ref","value","lineWidth","vertical","barClass","dragging","renderCursor","onMouseDown","onTouchStart","_jsx","className","classNames","style","children"],"mappings":"kEAIA,MAAMA,EACLC,IAUA,MAAMC,IACLA,EAAGC,MACHA,EAAKC,UACLA,EAASC,SACTA,EAAQC,SACRA,EAAQC,SACRA,EAAQC,aACRA,EAAYC,YACZA,EAAWC,aACXA,GACGT,EAEJ,OACCU,EACC,MAAA,CAAAT,IAAKA,EACLU,UAAWC,EAAW,aAAc,CACnC,sBAAuBR,IAExBS,MAAO,CAAE,CAACT,EAAW,QAAU,UAAWD,GAC1CK,YAAaA,EACbC,aAAcA,EAAYK,SAE1BJ,EACC,MAAA,CAAAC,UAAWC,EAAW,iBAAkBP,EAAU,CACjD,gBAAiBC,IAElBO,MAAO,CAAE,CAACT,EAAW,SAAW,SAAU,GAAGF,MAE5CY,SAAAP,GACAG,EAAA,IAAA,CAAGC,UAAU,6BACXJ,EAAaL,GAAS,QAIrB"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useReactive as t}from"ahooks";import i from"classnames";import{useRef as a,useMemo as n,useEffect as l}from"react";import{useMouseMove as s,useMouseUp as o}from"../../js/hooks.js";import g from"./circle.js";import u from"./line.js";const c=c=>{const{value:m=0,lineWidth:d=8,circleSize:h=40,precision:p=0,style:v,draggable:f=!0,type:b="line",barClass:C,vertical:j,label:x,labelInline:z,className:y,renderCursor:D,onChange:M,onDraggingChange:N}=c,S=a(null),W=t({value:m,dragging:!1,size:0,start:0}),k=j?"pageY":"pageX",w=j?"top":"left",B=j?"height":"width",F=n((()=>{let e=+W.value.toFixed(p);return e=Math.min(100,e),e=Math.max(0,e),e}),[W.value,p]),I=e=>{if(!S.current||!f)return;e.touches&&(e=e.touches[0]);const r=S.current.getBoundingClientRect(),t=100*(e[k]-r[w])/r[B];Object.assign(W,{value:j?100-t:t,size:r[B],start:r[w],dragging:!0}),N?.(!0)};return s((e=>{if(!W.dragging||!f)return;e.preventDefault(),e.touches&&(e=e.touches[0]);const{start:r,size:t}=W,i=e[k]-r;if(i<0||i>t)return;const a=100*(e[k]-r)/t;W.value=j?100-a:a})),o((()=>{W.dragging&&f&&(M?.(F),W.dragging=!1,N?.(!1))})),l((()=>{W.value=m>100?100:m<0?0:m}),[m]),e("div",{className:i("i-input-label",y,{"i-input-inline":z}),style:v,children:[x&&r("span",{className:"i-input-label-text",children:x}),"line"===b&&r(u,{ref:S,vertical:j,lineWidth:d,barClass:C,dragging:W.dragging,value:W.value,renderCursor:D,onMouseDown:I,onTouchStart:I}),"circle"===b&&r(g,{value:W.value,circleSize:h,lineWidth:d})]})};export{c as default};
|
|
2
|
-
//# sourceMappingURL=progress.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","sources":["../../../packages/components/progress/progress.tsx"],"sourcesContent":["import { useReactive } from \"ahooks\";\nimport classNames from \"classnames\";\nimport { useEffect, useMemo, useRef } from \"react\";\nimport \"../../css/input.css\";\nimport { useMouseMove, useMouseUp } from \"../../js/hooks\";\nimport Circle from \"./circle\";\nimport \"./index.css\";\nimport Line from \"./line\";\nimport { IProgress } from \"./type\";\n\nconst Progress = (props: IProgress) => {\n\tconst {\n\t\tvalue = 0,\n\t\tlineWidth = 8,\n\t\tcircleSize = 40,\n\t\tprecision = 0,\n\t\tstyle,\n\t\tdraggable = true,\n\t\ttype = \"line\",\n\t\tbarClass,\n\t\tvertical,\n\t\tlabel,\n\t\tlabelInline,\n\t\tclassName,\n\t\trenderCursor,\n\t\tonChange,\n\t\tonDraggingChange,\n\t} = props;\n\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst state = useReactive({\n\t\tvalue,\n\t\tdragging: false,\n\t\tsize: 0,\n\t\tstart: 0,\n\t});\n\n\tconst pageXY = vertical ? \"pageY\" : \"pageX\";\n\tconst rectTL = vertical ? \"top\" : \"left\";\n\tconst rectWH = vertical ? \"height\" : \"width\";\n\n\tconst toFixedValue = useMemo(() => {\n\t\tlet value = +state.value.toFixed(precision);\n\t\tvalue = Math.min(100, value);\n\t\tvalue = Math.max(0, value);\n\n\t\treturn value;\n\t}, [state.value, precision]);\n\n\tconst handleMouseDown = (e) => {\n\t\tif (!ref.current || !draggable) return;\n\n\t\tif (e.touches) {\n\t\t\te = e.touches[0];\n\t\t}\n\n\t\tconst rect = ref.current.getBoundingClientRect();\n\t\tconst value = ((e[pageXY] - rect[rectTL]) * 100) / rect[rectWH];\n\n\t\tObject.assign(state, {\n\t\t\tvalue: vertical ? 100 - value : value,\n\t\t\tsize: rect[rectWH],\n\t\t\tstart: rect[rectTL],\n\t\t\tdragging: true,\n\t\t});\n\t\tonDraggingChange?.(true);\n\t};\n\n\tconst handleMouseMove = (e) => {\n\t\tif (!state.dragging || !draggable) return;\n\t\te.preventDefault();\n\n\t\tif (e.touches) {\n\t\t\te = e.touches[0];\n\t\t}\n\n\t\tconst { start, size } = state;\n\t\tconst offset = e[pageXY] - start;\n\n\t\tif (offset < 0 || offset > size) return;\n\n\t\tconst value = ((e[pageXY] - start) * 100) / size;\n\t\tstate.value = vertical ? 100 - value : value;\n\t};\n\n\tconst handleMouseUp = () => {\n\t\tif (!state.dragging || !draggable) return;\n\n\t\tonChange?.(toFixedValue);\n\t\tstate.dragging = false;\n\t\tonDraggingChange?.(false);\n\t};\n\n\tuseMouseMove(handleMouseMove);\n\tuseMouseUp(handleMouseUp);\n\n\tuseEffect(() => {\n\t\tif (value > 100) {\n\t\t\tstate.value = 100;\n\t\t\treturn;\n\t\t}\n\n\t\tif (value < 0) {\n\t\t\tstate.value = 0;\n\t\t\treturn;\n\t\t}\n\n\t\tstate.value = value;\n\t}, [value]);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\"i-input-label\", className, {\n\t\t\t\t\"i-input-inline\": labelInline,\n\t\t\t})}\n\t\t\tstyle={style}\n\t\t>\n\t\t\t{label && <span className='i-input-label-text'>{label}</span>}\n\n\t\t\t{type === \"line\" && (\n\t\t\t\t<Line\n\t\t\t\t\tref={ref}\n\t\t\t\t\tvertical={vertical}\n\t\t\t\t\tlineWidth={lineWidth}\n\t\t\t\t\tbarClass={barClass}\n\t\t\t\t\tdragging={state.dragging}\n\t\t\t\t\tvalue={state.value}\n\t\t\t\t\trenderCursor={renderCursor}\n\t\t\t\t\tonMouseDown={handleMouseDown}\n\t\t\t\t\tonTouchStart={handleMouseDown}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{type === \"circle\" && (\n\t\t\t\t<Circle\n\t\t\t\t\tvalue={state.value}\n\t\t\t\t\tcircleSize={circleSize}\n\t\t\t\t\tlineWidth={lineWidth}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport default Progress;\n"],"names":["Progress","props","value","lineWidth","circleSize","precision","style","draggable","type","barClass","vertical","label","labelInline","className","renderCursor","onChange","onDraggingChange","ref","useRef","state","useReactive","dragging","size","start","pageXY","rectTL","rectWH","toFixedValue","useMemo","toFixed","Math","min","max","handleMouseDown","e","current","touches","rect","getBoundingClientRect","Object","assign","useMouseMove","preventDefault","offset","useMouseUp","useEffect","_jsxs","classNames","children","_jsx","Line","onMouseDown","onTouchStart","Circle"],"mappings":"iSAUA,MAAMA,EAAYC,IACjB,MAAMC,MACLA,EAAQ,EAACC,UACTA,EAAY,EAACC,WACbA,EAAa,GAAEC,UACfA,EAAY,EAACC,MACbA,EAAKC,UACLA,GAAY,EAAIC,KAChBA,EAAO,OAAMC,SACbA,EAAQC,SACRA,EAAQC,MACRA,EAAKC,YACLA,EAAWC,UACXA,EAASC,aACTA,EAAYC,SACZA,EAAQC,iBACRA,GACGf,EAEEgB,EAAMC,EAAuB,MAC7BC,EAAQC,EAAY,CACzBlB,QACAmB,UAAU,EACVC,KAAM,EACNC,MAAO,IAGFC,EAASd,EAAW,QAAU,QAC9Be,EAASf,EAAW,MAAQ,OAC5BgB,EAAShB,EAAW,SAAW,QAE/BiB,EAAeC,GAAQ,KAC5B,IAAI1B,GAASiB,EAAMjB,MAAM2B,QAAQxB,GAIjC,OAHAH,EAAQ4B,KAAKC,IAAI,IAAK7B,GACtBA,EAAQ4B,KAAKE,IAAI,EAAG9B,GAEbA,CAAK,GACV,CAACiB,EAAMjB,MAAOG,IAEX4B,EAAmBC,IACxB,IAAKjB,EAAIkB,UAAY5B,EAAW,OAE5B2B,EAAEE,UACLF,EAAIA,EAAEE,QAAQ,IAGf,MAAMC,EAAOpB,EAAIkB,QAAQG,wBACnBpC,EAAsC,KAA5BgC,EAAEV,GAAUa,EAAKZ,IAAkBY,EAAKX,GAExDa,OAAOC,OAAOrB,EAAO,CACpBjB,MAAOQ,EAAW,IAAMR,EAAQA,EAChCoB,KAAMe,EAAKX,GACXH,MAAOc,EAAKZ,GACZJ,UAAU,IAEXL,KAAmB,EAAK,EA6CzB,OAjBAyB,GAzByBP,IACxB,IAAKf,EAAME,WAAad,EAAW,OACnC2B,EAAEQ,iBAEER,EAAEE,UACLF,EAAIA,EAAEE,QAAQ,IAGf,MAAMb,MAAEA,EAAKD,KAAEA,GAASH,EAClBwB,EAAST,EAAEV,GAAUD,EAE3B,GAAIoB,EAAS,GAAKA,EAASrB,EAAM,OAEjC,MAAMpB,EAA+B,KAArBgC,EAAEV,GAAUD,GAAgBD,EAC5CH,EAAMjB,MAAQQ,EAAW,IAAMR,EAAQA,CAAK,IAY7C0C,GATsB,KAChBzB,EAAME,UAAad,IAExBQ,IAAWY,GACXR,EAAME,UAAW,EACjBL,KAAmB,GAAM,IAM1B6B,GAAU,KAER1B,EAAMjB,MADHA,EAAQ,IACG,IAIXA,EAAQ,EACG,EAIDA,CAAK,GACjB,CAACA,IAGH4C,SACCjC,UAAWkC,EAAW,gBAAiBlC,EAAW,CACjD,iBAAkBD,IAEnBN,MAAOA,EAEN0C,SAAA,CAAArC,GAASsC,EAAM,OAAA,CAAApC,UAAU,qBAAoBmC,SAAErC,IAEtC,SAATH,GACAyC,EAACC,EACA,CAAAjC,IAAKA,EACLP,SAAUA,EACVP,UAAWA,EACXM,SAAUA,EACVY,SAAUF,EAAME,SAChBnB,MAAOiB,EAAMjB,MACbY,aAAcA,EACdqC,YAAalB,EACbmB,aAAcnB,IAIN,WAATzB,GACAyC,EAACI,EACA,CAAAnD,MAAOiB,EAAMjB,MACbE,WAAYA,EACZD,UAAWA,MAGR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as a}from"react/jsx-runtime";import i from"classnames";function d(d){const{type:n="default",name:t,value:o,checked:r,disabled:s,children:c,onChange:l}=d,m="function"==typeof c;return e("label",{className:i("i-radio-item",{disabled:s,"i-radio-item-custom":m}),children:[a("input",{type:"radio",name:t,checked:r,className:i("i-radio-input",`i-radio-${n}`),disabled:s,hidden:m,onChange:e=>{l?.(o,e)}}),m?c(!!r,o):a("span",{className:"i-radio-text",children:c})]})}export{d as default};
|
|
2
|
-
//# sourceMappingURL=item.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sources":["../../../packages/components/radio/item.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { ChangeEvent } from \"react\";\nimport { IRadioItem } from \"./type\";\n\nexport default function RadioItem(props: IRadioItem) {\n\tconst {\n\t\ttype = \"default\",\n\t\tname,\n\t\tvalue,\n\t\tchecked,\n\t\tdisabled,\n\t\tchildren,\n\t\tonChange,\n\t} = props;\n\tconst isChildrenFn = typeof children === \"function\";\n\n\tconst handleChange = (e: ChangeEvent) => {\n\t\tonChange?.(value, e);\n\t};\n\n\treturn (\n\t\t<label\n\t\t\tclassName={classNames(\"i-radio-item\", {\n\t\t\t\tdisabled,\n\t\t\t\t\"i-radio-item-custom\": isChildrenFn,\n\t\t\t})}\n\t\t>\n\t\t\t<input\n\t\t\t\ttype='radio'\n\t\t\t\tname={name}\n\t\t\t\tchecked={checked}\n\t\t\t\tclassName={classNames(\"i-radio-input\", `i-radio-${type}`)}\n\t\t\t\tdisabled={disabled}\n\t\t\t\thidden={isChildrenFn}\n\t\t\t\tonChange={handleChange}\n\t\t\t/>\n\n\t\t\t{isChildrenFn ? (\n\t\t\t\tchildren(!!checked, value)\n\t\t\t) : (\n\t\t\t\t<span className='i-radio-text'>{children}</span>\n\t\t\t)}\n\t\t</label>\n\t);\n}\n"],"names":["RadioItem","props","type","name","value","checked","disabled","children","onChange","isChildrenFn","_jsxs","className","classNames","_jsx","hidden","e"],"mappings":"4EAIwB,SAAAA,EAAUC,GACjC,MAAMC,KACLA,EAAO,UAASC,KAChBA,EAAIC,MACJA,EAAKC,QACLA,EAAOC,SACPA,EAAQC,SACRA,EAAQC,SACRA,GACGP,EACEQ,EAAmC,mBAAbF,EAM5B,OACCG,EACC,QAAA,CAAAC,UAAWC,EAAW,eAAgB,CACrCN,WACA,sBAAuBG,IAGxBF,SAAA,CAAAM,EAAA,QAAA,CACCX,KAAK,QACLC,KAAMA,EACNE,QAASA,EACTM,UAAWC,EAAW,gBAAiB,WAAWV,KAClDI,SAAUA,EACVQ,OAAQL,EACRD,SAlBmBO,IACrBP,IAAWJ,EAAOW,EAAE,IAoBlBN,EACAF,IAAWF,EAASD,GAEpBS,UAAMF,UAAU,eAAcJ,SAAEA,MAIpC"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as a}from"react/jsx-runtime";import{useReactive as i}from"ahooks";import l from"classnames";import{useMemo as n,useEffect as o}from"react";import{formatOption as r}from"../../js/utils.js";import s from"./item.js";function t(t){const{label:m,name:d,options:u,value:c,type:p="default",status:b="normal",message:v,optionInline:h=!0,labelInline:f,disabled:N,required:g,className:j,renderItem:I,onChange:k}=t,x=i({value:c}),y=n((()=>r(u)),[u]),C=(e,a)=>{x.value=e,k?.(e,a)};return o((()=>{x.value=c}),[c]),e("div",{className:l("i-radio i-input-label",{[`i-radio-${b}`]:"normal"!==b,"i-input-inline":f},j),children:[m&&e("span",{className:"i-input-label-text",children:[g&&a("span",{className:"error",children:"*"}),m,v&&a("p",{className:"i-radio-message",children:v})]}),a("div",{className:l("i-radio-options",{"i-options-block":!h,"i-radio-options-button":"button"===p}),children:y.map((e=>{const i=x.value===e.value;return a(s,{name:d,value:e.value,checked:i,type:p,disabled:N||e.disabled,onChange:C,children:I??e.label},e.value)}))})]})}t.Item=s;export{t as default};
|
|
2
|
-
//# sourceMappingURL=radio.js.map
|