@ioca/react 1.4.78 → 1.4.80
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/_virtual/_rolldown/runtime.js +23 -0
- package/lib/cjs/components/affix/affix.js +66 -0
- package/lib/cjs/components/affix/affix.js.map +1 -0
- package/lib/cjs/components/affix/index.js +6 -0
- package/lib/cjs/components/affix/index.js.map +1 -0
- package/lib/cjs/components/affix/totop.js +25 -0
- package/lib/cjs/components/affix/totop.js.map +1 -0
- package/lib/cjs/components/badge/badge.js +24 -0
- package/lib/cjs/components/badge/badge.js.map +1 -0
- package/lib/cjs/components/badge/index.js +6 -0
- package/lib/cjs/components/badge/index.js.map +1 -0
- package/lib/cjs/components/button/button.js +64 -0
- package/lib/cjs/components/button/button.js.map +1 -0
- package/lib/cjs/components/button/confirm.js +60 -0
- package/lib/cjs/components/button/confirm.js.map +1 -0
- package/lib/cjs/components/button/group.js +26 -0
- package/lib/cjs/components/button/group.js.map +1 -0
- package/lib/cjs/components/button/index.js +6 -0
- package/lib/cjs/components/button/index.js.map +1 -0
- package/lib/cjs/components/button/toggle.js +46 -0
- package/lib/cjs/components/button/toggle.js.map +1 -0
- package/lib/cjs/components/card/card.js +33 -0
- package/lib/cjs/components/card/card.js.map +1 -0
- package/lib/cjs/components/card/index.js +6 -0
- package/lib/cjs/components/card/index.js.map +1 -0
- package/lib/cjs/components/checkbox/checkbox.js +66 -0
- package/lib/cjs/components/checkbox/checkbox.js.map +1 -0
- package/lib/cjs/components/checkbox/index.js +6 -0
- package/lib/cjs/components/checkbox/index.js.map +1 -0
- package/lib/cjs/components/checkbox/item.js +59 -0
- package/lib/cjs/components/checkbox/item.js.map +1 -0
- package/lib/cjs/components/collapse/collapse.js +84 -0
- package/lib/cjs/components/collapse/collapse.js.map +1 -0
- package/lib/cjs/components/collapse/index.js +6 -0
- package/lib/cjs/components/collapse/index.js.map +1 -0
- package/lib/cjs/components/collapse/item.js +10 -0
- package/lib/cjs/components/collapse/item.js.map +1 -0
- package/lib/cjs/components/datagrid/cell.js +39 -0
- package/lib/cjs/components/datagrid/cell.js.map +1 -0
- package/lib/cjs/components/datagrid/datagrid.js +140 -0
- package/lib/cjs/components/datagrid/datagrid.js.map +1 -0
- package/lib/cjs/components/datagrid/index.js +6 -0
- package/lib/cjs/components/datagrid/index.js.map +1 -0
- package/lib/cjs/components/datagrid/resize.js +42 -0
- package/lib/cjs/components/datagrid/resize.js.map +1 -0
- package/lib/cjs/components/datagrid/row.js +68 -0
- package/lib/cjs/components/datagrid/row.js.map +1 -0
- package/lib/cjs/components/datagrid/sorter.js +28 -0
- package/lib/cjs/components/datagrid/sorter.js.map +1 -0
- package/lib/cjs/components/description/description.js +43 -0
- package/lib/cjs/components/description/description.js.map +1 -0
- package/lib/cjs/components/description/index.js +6 -0
- package/lib/cjs/components/description/index.js.map +1 -0
- package/lib/cjs/components/drawer/drawer.js +84 -0
- package/lib/cjs/components/drawer/drawer.js.map +1 -0
- package/lib/cjs/components/drawer/index.js +6 -0
- package/lib/cjs/components/drawer/index.js.map +1 -0
- package/lib/cjs/components/dropdown/dropdown.js +38 -0
- package/lib/cjs/components/dropdown/dropdown.js.map +1 -0
- package/lib/cjs/components/dropdown/index.js +6 -0
- package/lib/cjs/components/dropdown/index.js.map +1 -0
- package/lib/cjs/components/dropdown/item.js +36 -0
- package/lib/cjs/components/dropdown/item.js.map +1 -0
- package/lib/cjs/components/editor/controls.js +89 -0
- package/lib/cjs/components/editor/controls.js.map +1 -0
- package/lib/cjs/components/editor/editor.js +91 -0
- package/lib/cjs/components/editor/editor.js.map +1 -0
- package/lib/cjs/components/editor/index.js +6 -0
- package/lib/cjs/components/editor/index.js.map +1 -0
- package/lib/cjs/components/flex/flex.js +31 -0
- package/lib/cjs/components/flex/flex.js.map +1 -0
- package/lib/cjs/components/flex/index.js +6 -0
- package/lib/cjs/components/flex/index.js.map +1 -0
- package/lib/cjs/components/form/context.js +7 -0
- package/lib/cjs/components/form/context.js.map +1 -0
- package/lib/cjs/components/form/field.js +71 -0
- package/lib/cjs/components/form/field.js.map +1 -0
- package/lib/cjs/components/form/form.js +64 -0
- package/lib/cjs/components/form/form.js.map +1 -0
- package/lib/cjs/components/form/index.js +6 -0
- package/lib/cjs/components/form/index.js.map +1 -0
- package/lib/cjs/components/form/useConfig.js +45 -0
- package/lib/cjs/components/form/useConfig.js.map +1 -0
- package/lib/cjs/components/form/useForm.js +123 -0
- package/lib/cjs/components/form/useForm.js.map +1 -0
- package/lib/cjs/components/icon/icon.js +24 -0
- package/lib/cjs/components/icon/icon.js.map +1 -0
- package/lib/cjs/components/icon/index.js +6 -0
- package/lib/cjs/components/icon/index.js.map +1 -0
- package/lib/cjs/components/image/image.js +86 -0
- package/lib/cjs/components/image/image.js.map +1 -0
- package/lib/cjs/components/image/index.js +6 -0
- package/lib/cjs/components/image/index.js.map +1 -0
- package/lib/cjs/components/image/list.js +49 -0
- package/lib/cjs/components/image/list.js.map +1 -0
- package/lib/cjs/components/input/container.js +30 -0
- package/lib/cjs/components/input/container.js.map +1 -0
- package/lib/cjs/components/input/index.js +6 -0
- package/lib/cjs/components/input/index.js.map +1 -0
- package/lib/cjs/components/input/input.js +113 -0
- package/lib/cjs/components/input/input.js.map +1 -0
- package/lib/cjs/components/input/number.js +138 -0
- package/lib/cjs/components/input/number.js.map +1 -0
- package/lib/cjs/components/input/range.js +134 -0
- package/lib/cjs/components/input/range.js.map +1 -0
- package/lib/cjs/components/input/textarea.js +61 -0
- package/lib/cjs/components/input/textarea.js.map +1 -0
- package/lib/cjs/components/list/index.js +6 -0
- package/lib/cjs/components/list/index.js.map +1 -0
- package/lib/cjs/components/list/item.js +30 -0
- package/lib/cjs/components/list/item.js.map +1 -0
- package/lib/cjs/components/list/list.js +30 -0
- package/lib/cjs/components/list/list.js.map +1 -0
- package/lib/cjs/components/loading/index.js +6 -0
- package/lib/cjs/components/loading/index.js.map +1 -0
- package/lib/cjs/components/loading/loading.js +39 -0
- package/lib/cjs/components/loading/loading.js.map +1 -0
- package/lib/cjs/components/message/index.js +6 -0
- package/lib/cjs/components/message/index.js.map +1 -0
- package/lib/cjs/components/message/message.js +197 -0
- package/lib/cjs/components/message/message.js.map +1 -0
- package/lib/cjs/components/modal/content.js +57 -0
- package/lib/cjs/components/modal/content.js.map +1 -0
- package/lib/cjs/components/modal/context.js +7 -0
- package/lib/cjs/components/modal/context.js.map +1 -0
- package/lib/cjs/components/modal/hookModal.js +28 -0
- package/lib/cjs/components/modal/hookModal.js.map +1 -0
- package/lib/cjs/components/modal/index.js +6 -0
- package/lib/cjs/components/modal/index.js.map +1 -0
- package/lib/cjs/components/modal/modal.js +117 -0
- package/lib/cjs/components/modal/modal.js.map +1 -0
- package/lib/cjs/components/modal/useModal.js +39 -0
- package/lib/cjs/components/modal/useModal.js.map +1 -0
- package/lib/cjs/components/pagination/index.js +6 -0
- package/lib/cjs/components/pagination/index.js.map +1 -0
- package/lib/cjs/components/pagination/page.js +31 -0
- package/lib/cjs/components/pagination/page.js.map +1 -0
- package/lib/cjs/components/pagination/pagination.js +86 -0
- package/lib/cjs/components/pagination/pagination.js.map +1 -0
- package/lib/cjs/components/picker/colors/footer.js +64 -0
- package/lib/cjs/components/picker/colors/footer.js.map +1 -0
- package/lib/cjs/components/picker/colors/handle.js +25 -0
- package/lib/cjs/components/picker/colors/handle.js.map +1 -0
- package/lib/cjs/components/picker/colors/index.js +81 -0
- package/lib/cjs/components/picker/colors/index.js.map +1 -0
- package/lib/cjs/components/picker/dates/dates.js +68 -0
- package/lib/cjs/components/picker/dates/dates.js.map +1 -0
- package/lib/cjs/components/picker/dates/index.js +97 -0
- package/lib/cjs/components/picker/dates/index.js.map +1 -0
- package/lib/cjs/components/picker/dates/panel.js +151 -0
- package/lib/cjs/components/picker/dates/panel.js.map +1 -0
- package/lib/cjs/components/picker/time/index.js +73 -0
- package/lib/cjs/components/picker/time/index.js.map +1 -0
- package/lib/cjs/components/picker/time/item.js +20 -0
- package/lib/cjs/components/picker/time/item.js.map +1 -0
- package/lib/cjs/components/picker/time/panel.js +144 -0
- package/lib/cjs/components/picker/time/panel.js.map +1 -0
- package/lib/cjs/components/popconfirm/index.js +6 -0
- package/lib/cjs/components/popconfirm/index.js.map +1 -0
- package/lib/cjs/components/popconfirm/popconfirm.js +86 -0
- package/lib/cjs/components/popconfirm/popconfirm.js.map +1 -0
- package/lib/cjs/components/popup/content.js +56 -0
- package/lib/cjs/components/popup/content.js.map +1 -0
- package/lib/cjs/components/popup/index.js +6 -0
- package/lib/cjs/components/popup/index.js.map +1 -0
- package/lib/cjs/components/popup/popup.js +425 -0
- package/lib/cjs/components/popup/popup.js.map +1 -0
- package/lib/cjs/components/progress/circle.js +45 -0
- package/lib/cjs/components/progress/circle.js.map +1 -0
- package/lib/cjs/components/progress/index.js +6 -0
- package/lib/cjs/components/progress/index.js.map +1 -0
- package/lib/cjs/components/progress/line.js +27 -0
- package/lib/cjs/components/progress/line.js.map +1 -0
- package/lib/cjs/components/progress/progress.js +100 -0
- package/lib/cjs/components/progress/progress.js.map +1 -0
- package/lib/cjs/components/radio/index.js +6 -0
- package/lib/cjs/components/radio/index.js.map +1 -0
- package/lib/cjs/components/radio/item.js +34 -0
- package/lib/cjs/components/radio/item.js.map +1 -0
- package/lib/cjs/components/radio/radio.js +62 -0
- package/lib/cjs/components/radio/radio.js.map +1 -0
- package/lib/cjs/components/resizable/index.js +6 -0
- package/lib/cjs/components/resizable/index.js.map +1 -0
- package/lib/cjs/components/resizable/resizable.js +81 -0
- package/lib/cjs/components/resizable/resizable.js.map +1 -0
- package/lib/cjs/components/river/index.js +6 -0
- package/lib/cjs/components/river/index.js.map +1 -0
- package/lib/cjs/components/river/river.js +116 -0
- package/lib/cjs/components/river/river.js.map +1 -0
- package/lib/cjs/components/select/index.js +6 -0
- package/lib/cjs/components/select/index.js.map +1 -0
- package/lib/cjs/components/select/options.js +76 -0
- package/lib/cjs/components/select/options.js.map +1 -0
- package/lib/cjs/components/select/select.js +155 -0
- package/lib/cjs/components/select/select.js.map +1 -0
- package/lib/cjs/components/step/divider.js +10 -0
- package/lib/cjs/components/step/divider.js.map +1 -0
- package/lib/cjs/components/step/index.js +6 -0
- package/lib/cjs/components/step/index.js.map +1 -0
- package/lib/cjs/components/step/item.js +60 -0
- package/lib/cjs/components/step/item.js.map +1 -0
- package/lib/cjs/components/step/step.js +42 -0
- package/lib/cjs/components/step/step.js.map +1 -0
- package/lib/cjs/components/swiper/index.js +6 -0
- package/lib/cjs/components/swiper/index.js.map +1 -0
- package/lib/cjs/components/swiper/item.js +39 -0
- package/lib/cjs/components/swiper/item.js.map +1 -0
- package/lib/cjs/components/swiper/swiper.js +262 -0
- package/lib/cjs/components/swiper/swiper.js.map +1 -0
- package/lib/cjs/components/tabs/index.js +6 -0
- package/lib/cjs/components/tabs/index.js.map +1 -0
- package/lib/cjs/components/tabs/item.js +10 -0
- package/lib/cjs/components/tabs/item.js.map +1 -0
- package/lib/cjs/components/tabs/tabs.js +272 -0
- package/lib/cjs/components/tabs/tabs.js.map +1 -0
- package/lib/cjs/components/tag/index.js +6 -0
- package/lib/cjs/components/tag/index.js.map +1 -0
- package/lib/cjs/components/tag/tag.js +32 -0
- package/lib/cjs/components/tag/tag.js.map +1 -0
- package/lib/cjs/components/text/highlight.js +35 -0
- package/lib/cjs/components/text/highlight.js.map +1 -0
- package/lib/cjs/components/text/index.js +6 -0
- package/lib/cjs/components/text/index.js.map +1 -0
- package/lib/cjs/components/text/number.js +32 -0
- package/lib/cjs/components/text/number.js.map +1 -0
- package/lib/cjs/components/text/text.js +39 -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 +6 -0
- package/lib/cjs/components/tree/index.js.map +1 -0
- package/lib/cjs/components/tree/item.js +136 -0
- package/lib/cjs/components/tree/item.js.map +1 -0
- package/lib/cjs/components/tree/tree.js +127 -0
- package/lib/cjs/components/tree/tree.js.map +1 -0
- package/lib/cjs/components/upload/index.js +6 -0
- package/lib/cjs/components/upload/index.js.map +1 -0
- package/lib/cjs/components/upload/renderFile.js +99 -0
- package/lib/cjs/components/upload/renderFile.js.map +1 -0
- package/lib/cjs/components/upload/upload.js +165 -0
- package/lib/cjs/components/upload/upload.js.map +1 -0
- package/lib/cjs/components/utils/empty/index.js +17 -0
- package/lib/cjs/components/utils/empty/index.js.map +1 -0
- package/lib/cjs/components/utils/helpericon/helpericon.js +24 -0
- package/lib/cjs/components/utils/helpericon/helpericon.js.map +1 -0
- package/lib/cjs/components/utils/helpericon/index.js +6 -0
- package/lib/cjs/components/utils/helpericon/index.js.map +1 -0
- package/lib/cjs/components/video/index.js +6 -0
- package/lib/cjs/components/video/index.js.map +1 -0
- package/lib/cjs/components/video/video.js +237 -0
- package/lib/cjs/components/video/video.js.map +1 -0
- package/lib/cjs/index.js +83 -0
- package/lib/cjs/js/hooks.js +259 -0
- package/lib/cjs/js/hooks.js.map +1 -0
- package/lib/cjs/js/usePreview/content.js +197 -0
- package/lib/cjs/js/usePreview/content.js.map +1 -0
- package/lib/cjs/js/usePreview/index.js +39 -0
- package/lib/cjs/js/usePreview/index.js.map +1 -0
- package/lib/cjs/js/usePreview/renderFile.js +28 -0
- package/lib/cjs/js/usePreview/renderFile.js.map +1 -0
- package/lib/cjs/js/usePreview/type.js +15 -0
- package/lib/cjs/js/usePreview/type.js.map +1 -0
- package/lib/cjs/js/useRipple/index.js +45 -0
- package/lib/cjs/js/useRipple/index.js.map +1 -0
- package/lib/cjs/js/useTheme/index.js +30 -0
- package/lib/cjs/js/useTheme/index.js.map +1 -0
- package/lib/cjs/js/utils.js +284 -0
- package/lib/cjs/js/utils.js.map +1 -0
- package/lib/es/components/affix/affix.js +1 -1
- package/lib/es/components/affix/affix.js.map +1 -1
- package/lib/es/components/affix/totop.js +1 -1
- package/lib/es/components/affix/totop.js.map +1 -1
- package/lib/es/components/badge/badge.js.map +1 -1
- package/lib/es/components/button/button.js.map +1 -1
- package/lib/es/components/card/card.js.map +1 -1
- package/lib/es/components/checkbox/checkbox.js.map +1 -1
- package/lib/es/components/collapse/collapse.js +1 -2
- package/lib/es/components/collapse/collapse.js.map +1 -1
- package/lib/es/components/datagrid/datagrid.js.map +1 -1
- package/lib/es/components/description/description.js.map +1 -1
- package/lib/es/components/drawer/drawer.js.map +1 -1
- package/lib/es/components/dropdown/dropdown.js.map +1 -1
- package/lib/es/components/editor/controls.js +1 -7
- package/lib/es/components/editor/controls.js.map +1 -1
- package/lib/es/components/editor/editor.js.map +1 -1
- package/lib/es/components/flex/flex.js.map +1 -1
- package/lib/es/components/form/field.js +1 -1
- package/lib/es/components/form/form.js +1 -1
- package/lib/es/components/form/form.js.map +1 -1
- package/lib/es/components/form/useForm.js +2 -2
- package/lib/es/components/icon/icon.js.map +1 -1
- package/lib/es/components/image/image.js.map +1 -1
- package/lib/es/components/input/input.js +1 -2
- package/lib/es/components/input/input.js.map +1 -1
- package/lib/es/components/input/number.js +1 -3
- package/lib/es/components/input/number.js.map +1 -1
- package/lib/es/components/input/range.js +1 -3
- package/lib/es/components/input/range.js.map +1 -1
- package/lib/es/components/input/textarea.js.map +1 -1
- package/lib/es/components/list/list.js.map +1 -1
- package/lib/es/components/loading/loading.js.map +1 -1
- package/lib/es/components/message/message.js +2 -2
- package/lib/es/components/message/message.js.map +1 -1
- package/lib/es/components/modal/content.js.map +1 -1
- package/lib/es/components/modal/modal.js.map +1 -1
- package/lib/es/components/pagination/pagination.js +1 -3
- package/lib/es/components/pagination/pagination.js.map +1 -1
- package/lib/es/components/picker/colors/footer.js +1 -1
- package/lib/es/components/picker/colors/footer.js.map +1 -1
- package/lib/es/components/picker/colors/index.js.map +1 -1
- package/lib/es/components/picker/dates/index.js +2 -2
- package/lib/es/components/picker/dates/index.js.map +1 -1
- package/lib/es/components/picker/dates/panel.js +2 -3
- package/lib/es/components/picker/dates/panel.js.map +1 -1
- package/lib/es/components/picker/time/index.js +1 -1
- package/lib/es/components/picker/time/index.js.map +1 -1
- package/lib/es/components/picker/time/panel.js.map +1 -1
- package/lib/es/components/popconfirm/popconfirm.js +1 -1
- package/lib/es/components/popconfirm/popconfirm.js.map +1 -1
- package/lib/es/components/popup/popup.js +1 -1
- package/lib/es/components/popup/popup.js.map +1 -1
- package/lib/es/components/progress/progress.js.map +1 -1
- package/lib/es/components/radio/radio.js.map +1 -1
- package/lib/es/components/resizable/resizable.js.map +1 -1
- package/lib/es/components/river/river.js.map +1 -1
- package/lib/es/components/select/options.js +1 -2
- package/lib/es/components/select/options.js.map +1 -1
- package/lib/es/components/select/select.js +2 -2
- package/lib/es/components/select/select.js.map +1 -1
- package/lib/es/components/step/divider.js.map +1 -1
- package/lib/es/components/step/item.js +1 -1
- package/lib/es/components/step/item.js.map +1 -1
- package/lib/es/components/step/step.js.map +1 -1
- package/lib/es/components/swiper/swiper.js +1 -2
- package/lib/es/components/swiper/swiper.js.map +1 -1
- package/lib/es/components/tabs/tabs.js +1 -1
- package/lib/es/components/tabs/tabs.js.map +1 -1
- package/lib/es/components/tag/tag.js.map +1 -1
- package/lib/es/components/text/highlight.js +1 -1
- package/lib/es/components/text/text.js.map +1 -1
- package/lib/es/components/tree/item.js +1 -1
- package/lib/es/components/tree/item.js.map +1 -1
- package/lib/es/components/tree/tree.js.map +1 -1
- package/lib/es/components/upload/renderFile.js +2 -2
- package/lib/es/components/upload/renderFile.js.map +1 -1
- package/lib/es/components/upload/upload.js +2 -3
- package/lib/es/components/upload/upload.js.map +1 -1
- package/lib/es/components/utils/empty/index.js +1 -1
- package/lib/es/components/utils/empty/index.js.map +1 -1
- package/lib/es/components/utils/helpericon/helpericon.js +2 -2
- package/lib/es/components/utils/helpericon/helpericon.js.map +1 -1
- package/lib/es/components/video/video.js +2 -8
- package/lib/es/components/video/video.js.map +1 -1
- package/lib/es/js/usePreview/content.js +2 -9
- package/lib/es/js/usePreview/content.js.map +1 -1
- package/lib/es/js/usePreview/index.js.map +1 -1
- package/lib/es/js/usePreview/renderFile.js +1 -1
- package/lib/es/js/usePreview/renderFile.js.map +1 -1
- package/lib/es/js/useRipple/index.js.map +1 -1
- package/lib/es/js/utils.js +1 -1
- package/lib/types/components/affix/affix.js +1 -2
- package/lib/types/components/affix/totop.js +1 -1
- package/lib/types/components/badge/badge.js +0 -1
- package/lib/types/components/button/button.js +0 -1
- package/lib/types/components/card/card.js +0 -1
- package/lib/types/components/checkbox/checkbox.js +0 -2
- package/lib/types/components/collapse/collapse.js +1 -3
- package/lib/types/components/datagrid/datagrid.js +0 -1
- package/lib/types/components/description/description.js +0 -1
- package/lib/types/components/drawer/drawer.js +0 -1
- package/lib/types/components/dropdown/dropdown.js +0 -1
- package/lib/types/components/editor/controls.js +1 -7
- package/lib/types/components/editor/editor.js +0 -1
- package/lib/types/components/flex/flex.js +0 -1
- package/lib/types/components/form/field.js +1 -1
- package/lib/types/components/form/form.js +1 -2
- package/lib/types/components/form/useForm.js +2 -2
- package/lib/types/components/icon/icon.js +0 -1
- package/lib/types/components/image/image.js +0 -1
- package/lib/types/components/input/input.js +1 -3
- package/lib/types/components/input/number.js +1 -4
- package/lib/types/components/input/range.js +1 -4
- package/lib/types/components/input/textarea.js +0 -1
- package/lib/types/components/list/list.js +0 -1
- package/lib/types/components/loading/loading.js +0 -1
- package/lib/types/components/message/message.js +2 -3
- package/lib/types/components/modal/content.js +0 -1
- package/lib/types/components/modal/modal.js +0 -1
- package/lib/types/components/pagination/pagination.js +1 -4
- package/lib/types/components/picker/colors/footer.js +1 -1
- package/lib/types/components/picker/colors/index.js +0 -1
- package/lib/types/components/picker/dates/index.js +2 -3
- package/lib/types/components/picker/dates/panel.js +2 -3
- package/lib/types/components/picker/time/index.js +1 -1
- package/lib/types/components/picker/time/panel.js +0 -1
- package/lib/types/components/popconfirm/popconfirm.js +1 -2
- package/lib/types/components/popup/popup.js +1 -2
- package/lib/types/components/progress/progress.js +0 -2
- package/lib/types/components/radio/radio.js +0 -2
- package/lib/types/components/resizable/resizable.js +0 -1
- package/lib/types/components/river/river.js +0 -1
- package/lib/types/components/select/options.js +1 -2
- package/lib/types/components/select/select.js +2 -4
- package/lib/types/components/step/divider.js +0 -1
- package/lib/types/components/step/item.js +1 -1
- package/lib/types/components/step/step.js +0 -1
- package/lib/types/components/swiper/swiper.js +1 -3
- package/lib/types/components/tabs/tabs.js +1 -2
- package/lib/types/components/tag/tag.js +0 -1
- package/lib/types/components/text/highlight.js +1 -1
- package/lib/types/components/text/text.js +0 -1
- package/lib/types/components/tree/item.js +1 -1
- package/lib/types/components/tree/tree.js +0 -1
- package/lib/types/components/upload/renderFile.js +2 -2
- package/lib/types/components/upload/upload.js +2 -4
- package/lib/types/components/utils/empty/index.js +1 -2
- package/lib/types/components/utils/helpericon/helpericon.js +2 -3
- package/lib/types/components/video/video.js +2 -9
- package/lib/types/index.js +0 -1
- package/lib/types/js/usePreview/content.js +2 -9
- package/lib/types/js/usePreview/index.js +0 -1
- package/lib/types/js/usePreview/renderFile.js +1 -1
- package/lib/types/js/useRipple/index.js +0 -1
- package/lib/types/js/utils.js +1 -1
- package/package.json +8 -3
- package/lib/css/index.css +0 -1
- package/lib/types/components/affix/affix.d.ts +0 -7
- package/lib/types/components/affix/index.d.ts +0 -2
- package/lib/types/components/affix/totop.d.ts +0 -3
- package/lib/types/components/affix/type.d.ts +0 -10
- package/lib/types/components/area/area.d.ts +0 -3
- package/lib/types/components/area/index.d.ts +0 -2
- package/lib/types/components/area/item.d.ts +0 -3
- package/lib/types/components/area/type.d.ts +0 -12
- package/lib/types/components/badge/badge.d.ts +0 -3
- package/lib/types/components/badge/index.d.ts +0 -2
- package/lib/types/components/badge/type.d.ts +0 -12
- package/lib/types/components/button/button.d.ts +0 -3
- package/lib/types/components/button/confirm.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 -51
- package/lib/types/components/card/card.d.ts +0 -3
- package/lib/types/components/card/index.d.ts +0 -2
- package/lib/types/components/card/type.d.ts +0 -10
- package/lib/types/components/checkbox/checkbox.d.ts +0 -7
- 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 -22
- package/lib/types/components/collapse/collapse.d.ts +0 -7
- 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 -20
- package/lib/types/components/datagrid/cell.d.ts +0 -13
- package/lib/types/components/datagrid/datagrid.d.ts +0 -3
- package/lib/types/components/datagrid/index.d.ts +0 -2
- package/lib/types/components/datagrid/resize.d.ts +0 -1
- package/lib/types/components/datagrid/row.d.ts +0 -3
- package/lib/types/components/datagrid/sorter.d.ts +0 -1
- package/lib/types/components/datagrid/type.d.ts +0 -61
- package/lib/types/components/description/description.d.ts +0 -3
- package/lib/types/components/description/index.d.ts +0 -2
- package/lib/types/components/description/type.d.ts +0 -23
- package/lib/types/components/drawer/drawer.d.ts +0 -3
- package/lib/types/components/drawer/index.d.ts +0 -2
- package/lib/types/components/drawer/type.d.ts +0 -13
- package/lib/types/components/drawer/useDrawer.d.ts +0 -0
- package/lib/types/components/dropdown/dropdown.d.ts +0 -6
- package/lib/types/components/dropdown/index.d.ts +0 -2
- package/lib/types/components/dropdown/item.d.ts +0 -3
- package/lib/types/components/dropdown/type.d.ts +0 -11
- package/lib/types/components/editor/controls.d.ts +0 -5
- package/lib/types/components/editor/editor.d.ts +0 -3
- package/lib/types/components/editor/index.d.ts +0 -2
- package/lib/types/components/editor/type.d.ts +0 -17
- package/lib/types/components/flex/flex.d.ts +0 -3
- package/lib/types/components/flex/index.d.ts +0 -2
- package/lib/types/components/flex/type.d.ts +0 -10
- package/lib/types/components/form/context.d.ts +0 -3
- package/lib/types/components/form/field.d.ts +0 -3
- package/lib/types/components/form/form.d.ts +0 -11
- package/lib/types/components/form/index.d.ts +0 -2
- package/lib/types/components/form/type.d.ts +0 -40
- package/lib/types/components/form/useConfig.d.ts +0 -5
- package/lib/types/components/form/useForm.d.ts +0 -14
- package/lib/types/components/icon/icon.d.ts +0 -3
- package/lib/types/components/icon/index.d.ts +0 -2
- package/lib/types/components/icon/type.d.ts +0 -9
- package/lib/types/components/image/image.d.ts +0 -3
- 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 -30
- package/lib/types/components/input/container.d.ts +0 -2
- package/lib/types/components/input/index.d.ts +0 -2
- package/lib/types/components/input/input.d.ts +0 -3
- package/lib/types/components/input/number.d.ts +0 -3
- package/lib/types/components/input/range.d.ts +0 -3
- package/lib/types/components/input/textarea.d.ts +0 -3
- package/lib/types/components/input/type.d.ts +0 -61
- package/lib/types/components/list/index.d.ts +0 -2
- package/lib/types/components/list/item.d.ts +0 -3
- package/lib/types/components/list/list.d.ts +0 -6
- package/lib/types/components/list/type.d.ts +0 -13
- package/lib/types/components/loading/index.d.ts +0 -2
- package/lib/types/components/loading/loading.d.ts +0 -3
- package/lib/types/components/loading/type.d.ts +0 -7
- package/lib/types/components/message/index.d.ts +0 -2
- package/lib/types/components/message/message.d.ts +0 -27
- package/lib/types/components/message/type.d.ts +0 -29
- package/lib/types/components/modal/content.d.ts +0 -2
- package/lib/types/components/modal/context.d.ts +0 -2
- package/lib/types/components/modal/hookModal.d.ts +0 -6
- package/lib/types/components/modal/index.d.ts +0 -2
- package/lib/types/components/modal/modal.d.ts +0 -3
- package/lib/types/components/modal/type.d.ts +0 -34
- package/lib/types/components/modal/useModal.d.ts +0 -6
- package/lib/types/components/pagination/index.d.ts +0 -2
- package/lib/types/components/pagination/page.d.ts +0 -3
- package/lib/types/components/pagination/pagination.d.ts +0 -3
- package/lib/types/components/pagination/type.d.ts +0 -20
- package/lib/types/components/picker/colors/footer.d.ts +0 -6
- package/lib/types/components/picker/colors/handle.d.ts +0 -2
- package/lib/types/components/picker/colors/index.d.ts +0 -2
- package/lib/types/components/picker/dates/dates.d.ts +0 -5
- package/lib/types/components/picker/dates/index.d.ts +0 -3
- package/lib/types/components/picker/dates/panel.d.ts +0 -3
- package/lib/types/components/picker/index.d.ts +0 -10
- package/lib/types/components/picker/time/index.d.ts +0 -2
- package/lib/types/components/picker/time/item.d.ts +0 -1
- package/lib/types/components/picker/time/panel.d.ts +0 -1
- package/lib/types/components/picker/type.d.ts +0 -38
- package/lib/types/components/popconfirm/index.d.ts +0 -2
- package/lib/types/components/popconfirm/popconfirm.d.ts +0 -3
- package/lib/types/components/popconfirm/type.d.ts +0 -11
- package/lib/types/components/popup/content.d.ts +0 -3
- 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 -25
- package/lib/types/components/progress/circle.d.ts +0 -2
- package/lib/types/components/progress/index.d.ts +0 -2
- package/lib/types/components/progress/line.d.ts +0 -9
- package/lib/types/components/progress/progress.d.ts +0 -3
- package/lib/types/components/progress/type.d.ts +0 -20
- 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 -7
- package/lib/types/components/radio/type.d.ts +0 -18
- package/lib/types/components/resizable/index.d.ts +0 -2
- package/lib/types/components/resizable/resizable.d.ts +0 -3
- package/lib/types/components/resizable/type.d.ts +0 -16
- package/lib/types/components/river/index.d.ts +0 -2
- package/lib/types/components/river/river.d.ts +0 -3
- package/lib/types/components/river/type.d.ts +0 -5
- package/lib/types/components/select/index.d.ts +0 -2
- package/lib/types/components/select/options.d.ts +0 -5
- package/lib/types/components/select/select.d.ts +0 -3
- package/lib/types/components/select/type.d.ts +0 -24
- package/lib/types/components/step/divider.d.ts +0 -1
- package/lib/types/components/step/index.d.ts +0 -2
- package/lib/types/components/step/item.d.ts +0 -3
- package/lib/types/components/step/step.d.ts +0 -7
- package/lib/types/components/step/type.d.ts +0 -16
- package/lib/types/components/swiper/index.d.ts +0 -2
- package/lib/types/components/swiper/item.d.ts +0 -3
- package/lib/types/components/swiper/swiper.d.ts +0 -3
- package/lib/types/components/swiper/type.d.ts +0 -49
- package/lib/types/components/tabs/index.d.ts +0 -2
- package/lib/types/components/tabs/item.d.ts +0 -3
- package/lib/types/components/tabs/tabs.d.ts +0 -3
- package/lib/types/components/tabs/type.d.ts +0 -41
- package/lib/types/components/tag/index.d.ts +0 -2
- package/lib/types/components/tag/tag.d.ts +0 -3
- package/lib/types/components/tag/type.d.ts +0 -11
- 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 -3
- package/lib/types/components/text/time.d.ts +0 -2
- package/lib/types/components/text/type.d.ts +0 -40
- package/lib/types/components/tree/index.d.ts +0 -2
- package/lib/types/components/tree/item.d.ts +0 -11
- package/lib/types/components/tree/tree.d.ts +0 -3
- package/lib/types/components/tree/type.d.ts +0 -60
- package/lib/types/components/upload/index.d.ts +0 -2
- package/lib/types/components/upload/renderFile.d.ts +0 -7
- package/lib/types/components/upload/type.d.ts +0 -41
- package/lib/types/components/upload/upload.d.ts +0 -3
- package/lib/types/components/utils/empty/index.d.ts +0 -1
- package/lib/types/components/utils/helpericon/helpericon.d.ts +0 -3
- package/lib/types/components/utils/helpericon/index.d.ts +0 -2
- package/lib/types/components/utils/helpericon/type.d.ts +0 -11
- package/lib/types/components/video/index.d.ts +0 -2
- package/lib/types/components/video/type.d.ts +0 -24
- package/lib/types/components/video/video.d.ts +0 -3
- package/lib/types/index.d.ts +0 -40
- package/lib/types/js/hooks.d.ts +0 -36
- package/lib/types/js/usePreview/content.d.ts +0 -2
- package/lib/types/js/usePreview/index.d.ts +0 -2
- package/lib/types/js/usePreview/renderFile.d.ts +0 -2
- package/lib/types/js/usePreview/type.d.ts +0 -36
- package/lib/types/js/useRipple/index.d.ts +0 -2
- package/lib/types/js/useTheme/index.d.ts +0 -6
- package/lib/types/js/useTheme/type.d.ts +0 -9
- package/lib/types/js/utils.d.ts +0 -36
- package/lib/types/type/index.d.ts +0 -34
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.js");
|
|
2
|
+
let _Users_iann_codes_ioca_react_node_modules__pnpm_radash_12_1_1_node_modules_radash_dist_esm_index_mjs = require("/Users/iann/codes/ioca-react/node_modules/.pnpm/radash@12.1.1/node_modules/radash/dist/esm/index.mjs");
|
|
3
|
+
let react = require("react");
|
|
4
|
+
let _Users_iann_codes_ioca_react_node_modules__pnpm_pubsub_js_1_9_5_node_modules_pubsub_js_src_pubsub_js = require("/Users/iann/codes/ioca-react/node_modules/.pnpm/pubsub-js@1.9.5/node_modules/pubsub-js/src/pubsub.js");
|
|
5
|
+
_Users_iann_codes_ioca_react_node_modules__pnpm_pubsub_js_1_9_5_node_modules_pubsub_js_src_pubsub_js = require_runtime.__toESM(_Users_iann_codes_ioca_react_node_modules__pnpm_pubsub_js_1_9_5_node_modules_pubsub_js_src_pubsub_js);
|
|
6
|
+
//#region packages/components/form/useForm.ts
|
|
7
|
+
var IFormInstance = class {
|
|
8
|
+
id;
|
|
9
|
+
data = {};
|
|
10
|
+
cacheData = {};
|
|
11
|
+
rules = {};
|
|
12
|
+
constructor() {
|
|
13
|
+
this.id = (0, _Users_iann_codes_ioca_react_node_modules__pnpm_radash_12_1_1_node_modules_radash_dist_esm_index_mjs.uid)(8);
|
|
14
|
+
this.data = {};
|
|
15
|
+
}
|
|
16
|
+
get(field) {
|
|
17
|
+
return field ? this.data[field] : this.data;
|
|
18
|
+
}
|
|
19
|
+
set(field, value) {
|
|
20
|
+
const id = this.id;
|
|
21
|
+
if (!this.data) return;
|
|
22
|
+
if (typeof field === "string") {
|
|
23
|
+
this.data[field] = value;
|
|
24
|
+
this.cacheData[field] = value;
|
|
25
|
+
_Users_iann_codes_ioca_react_node_modules__pnpm_pubsub_js_1_9_5_node_modules_pubsub_js_src_pubsub_js.default.publish(`${id}:set:${field}`, value);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
Object.keys(field).map((name) => {
|
|
29
|
+
this.data[name] = field[name];
|
|
30
|
+
this.cacheData[name] = field[name];
|
|
31
|
+
_Users_iann_codes_ioca_react_node_modules__pnpm_pubsub_js_1_9_5_node_modules_pubsub_js_src_pubsub_js.default.publish(`${id}:set:${name}`, field[name]);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
delete(field) {
|
|
35
|
+
delete this.data[field];
|
|
36
|
+
}
|
|
37
|
+
clear() {
|
|
38
|
+
if (!this.data) return;
|
|
39
|
+
this.cacheData = {};
|
|
40
|
+
Object.keys(this.data).map((name) => {
|
|
41
|
+
_Users_iann_codes_ioca_react_node_modules__pnpm_pubsub_js_1_9_5_node_modules_pubsub_js_src_pubsub_js.default.publish(`${this.id}:set:${name}`, void 0);
|
|
42
|
+
this.data[name] = void 0;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
async validate(field) {
|
|
46
|
+
const { id, rules, data } = this;
|
|
47
|
+
if (!rules) return data;
|
|
48
|
+
if (field) {
|
|
49
|
+
const o = rules[field];
|
|
50
|
+
const rule = {
|
|
51
|
+
validator: (v) => Array.isArray(v) ? v.length > 0 : ![
|
|
52
|
+
void 0,
|
|
53
|
+
null,
|
|
54
|
+
""
|
|
55
|
+
].includes(v),
|
|
56
|
+
message: void 0
|
|
57
|
+
};
|
|
58
|
+
if (typeof o === "function") rule.validator = o;
|
|
59
|
+
else if (o === true) {
|
|
60
|
+
rule.validator = (v) => ![
|
|
61
|
+
void 0,
|
|
62
|
+
null,
|
|
63
|
+
""
|
|
64
|
+
].includes(v);
|
|
65
|
+
rule.message = "required";
|
|
66
|
+
} else Object.assign(rule, o);
|
|
67
|
+
const isValid = rule.validator?.(data[field], this);
|
|
68
|
+
if (typeof isValid === "string") rule.message = isValid;
|
|
69
|
+
if (isValid !== true) {
|
|
70
|
+
_Users_iann_codes_ioca_react_node_modules__pnpm_pubsub_js_1_9_5_node_modules_pubsub_js_src_pubsub_js.default.publish(`${id}:invalid:${field}`, {
|
|
71
|
+
message: rule.message,
|
|
72
|
+
status: "error"
|
|
73
|
+
});
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
_Users_iann_codes_ioca_react_node_modules__pnpm_pubsub_js_1_9_5_node_modules_pubsub_js_src_pubsub_js.default.publish(`${id}:invalid:${name}`, {
|
|
77
|
+
message: null,
|
|
78
|
+
status: "normal"
|
|
79
|
+
});
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
let isAllValid = true;
|
|
83
|
+
Object.keys(data).map((name) => {
|
|
84
|
+
const o = rules[name];
|
|
85
|
+
if (o === void 0) return;
|
|
86
|
+
const rule = {
|
|
87
|
+
validator: (v) => Array.isArray(v) ? v.length > 0 : !!v,
|
|
88
|
+
message: void 0
|
|
89
|
+
};
|
|
90
|
+
if (typeof o === "function") rule.validator = o;
|
|
91
|
+
else if (o === true) {
|
|
92
|
+
rule.validator = (v) => ![
|
|
93
|
+
void 0,
|
|
94
|
+
null,
|
|
95
|
+
""
|
|
96
|
+
].includes(v);
|
|
97
|
+
rule.message = "required";
|
|
98
|
+
} else Object.assign(rule, o);
|
|
99
|
+
const isValid = rule.validator?.(data[name], this);
|
|
100
|
+
if (typeof isValid === "string") rule.message = isValid;
|
|
101
|
+
if (isValid !== true) {
|
|
102
|
+
_Users_iann_codes_ioca_react_node_modules__pnpm_pubsub_js_1_9_5_node_modules_pubsub_js_src_pubsub_js.default.publish(`${id}:invalid:${name}`, {
|
|
103
|
+
message: rule.message,
|
|
104
|
+
status: "error"
|
|
105
|
+
});
|
|
106
|
+
isAllValid = false;
|
|
107
|
+
} else _Users_iann_codes_ioca_react_node_modules__pnpm_pubsub_js_1_9_5_node_modules_pubsub_js_src_pubsub_js.default.publish(`${id}:invalid:${name}`, {
|
|
108
|
+
message: null,
|
|
109
|
+
status: "normal"
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
return isAllValid ? Promise.resolve(data) : false;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
function useForm(form) {
|
|
116
|
+
const formRef = (0, react.useRef)(null);
|
|
117
|
+
if (!formRef.current) formRef.current = form ?? new IFormInstance();
|
|
118
|
+
return formRef.current;
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
exports.default = useForm;
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=useForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useForm.js","names":[],"sources":["../../../../packages/components/form/useForm.ts"],"sourcesContent":["import PubSub from \"pubsub-js\";\nimport { uid } from \"radash\";\nimport { useRef } from \"react\";\nimport { IForm, TRule } from \"./type\";\n\nexport class IFormInstance {\n\treadonly id?: string;\n\tdata: Record<string, any> = {};\n\tcacheData: Record<string, any> = {};\n\trules?: Pick<IForm, \"rules\"> = {};\n\n\tconstructor() {\n\t\tthis.id = uid(8);\n\t\tthis.data = {};\n\t}\n\n\tget(field?: string) {\n\t\treturn field ? this.data[field] : this.data;\n\t}\n\n\tset(field: any, value?: any) {\n\t\tconst id = this.id;\n\t\tif (!this.data) return;\n\n\t\tif (typeof field === \"string\") {\n\t\t\tthis.data[field] = value;\n\t\t\tthis.cacheData[field] = value;\n\t\t\tPubSub.publish(`${id}:set:${field}`, value);\n\t\t\treturn;\n\t\t}\n\n\t\tObject.keys(field).map((name) => {\n\t\t\tthis.data[name] = field[name];\n\t\t\tthis.cacheData[name] = field[name];\n\t\t\tPubSub.publish(`${id}:set:${name}`, field[name]);\n\t\t});\n\t}\n\n\tdelete(field) {\n\t\tdelete this.data[field];\n\t}\n\n\tclear() {\n\t\tif (!this.data) return;\n\t\tthis.cacheData = {};\n\n\t\tObject.keys(this.data).map((name) => {\n\t\t\tPubSub.publish(`${this.id}:set:${name}`, undefined);\n\t\t\tthis.data[name] = undefined;\n\t\t});\n\t}\n\n\tasync validate(field?: string) {\n\t\tconst { id, rules, data } = this;\n\t\tif (!rules) return data;\n\n\t\tif (field) {\n\t\t\tconst o = rules[field];\n\t\t\tconst rule: TRule = {\n\t\t\t\tvalidator: (v) =>\n\t\t\t\t\tArray.isArray(v)\n\t\t\t\t\t\t? v.length > 0\n\t\t\t\t\t\t: ![undefined, null, \"\"].includes(v),\n\t\t\t\tmessage: undefined,\n\t\t\t};\n\n\t\t\tif (typeof o === \"function\") {\n\t\t\t\trule.validator = o;\n\t\t\t} else if (o === true) {\n\t\t\t\trule.validator = (v) => ![undefined, null, \"\"].includes(v);\n\t\t\t\trule.message = \"required\";\n\t\t\t} else {\n\t\t\t\tObject.assign(rule, o);\n\t\t\t}\n\n\t\t\tconst isValid = rule.validator?.(data[field], this);\n\t\t\tif (typeof isValid === \"string\") {\n\t\t\t\trule.message = isValid;\n\t\t\t}\n\n\t\t\tif (isValid !== true) {\n\t\t\t\tPubSub.publish(`${id}:invalid:${field}`, {\n\t\t\t\t\tmessage: rule.message,\n\t\t\t\t\tstatus: \"error\",\n\t\t\t\t});\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tPubSub.publish(`${id}:invalid:${name}`, {\n\t\t\t\tmessage: null,\n\t\t\t\tstatus: \"normal\",\n\t\t\t});\n\t\t\treturn true;\n\t\t}\n\n\t\tlet isAllValid = true;\n\n\t\tObject.keys(data).map((name) => {\n\t\t\tconst o = rules[name];\n\t\t\tif (o === undefined) return;\n\n\t\t\tconst rule: TRule = {\n\t\t\t\tvalidator: (v) => (Array.isArray(v) ? v.length > 0 : !!v),\n\t\t\t\tmessage: undefined,\n\t\t\t};\n\n\t\t\tif (typeof o === \"function\") {\n\t\t\t\trule.validator = o;\n\t\t\t} else if (o === true) {\n\t\t\t\trule.validator = (v) => ![undefined, null, \"\"].includes(v);\n\t\t\t\trule.message = \"required\";\n\t\t\t} else {\n\t\t\t\tObject.assign(rule, o);\n\t\t\t}\n\n\t\t\tconst isValid = rule.validator?.(data[name], this);\n\t\t\tif (typeof isValid === \"string\") {\n\t\t\t\trule.message = isValid;\n\t\t\t}\n\n\t\t\tif (isValid !== true) {\n\t\t\t\tPubSub.publish(`${id}:invalid:${name}`, {\n\t\t\t\t\tmessage: rule.message,\n\t\t\t\t\tstatus: \"error\",\n\t\t\t\t});\n\t\t\t\tisAllValid = false;\n\t\t\t} else {\n\t\t\t\tPubSub.publish(`${id}:invalid:${name}`, {\n\t\t\t\t\tmessage: null,\n\t\t\t\t\tstatus: \"normal\",\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\treturn isAllValid ? Promise.resolve(data) : false;\n\t}\n}\n\nexport default function useForm(form?: IFormInstance) {\n\tconst formRef = useRef<IFormInstance>(null);\n\n\tif (!formRef.current) {\n\t\tformRef.current = form ?? new IFormInstance();\n\t}\n\n\treturn formRef.current;\n}\n"],"mappings":";;;;;;AAKA,IAAa,gBAAb,MAA2B;CAC1B;CACA,OAA4B,EAAE;CAC9B,YAAiC,EAAE;CACnC,QAA+B,EAAE;CAEjC,cAAc;AACb,OAAK,MAAA,GAAA,qGAAA,KAAS,EAAE;AAChB,OAAK,OAAO,EAAE;;CAGf,IAAI,OAAgB;AACnB,SAAO,QAAQ,KAAK,KAAK,SAAS,KAAK;;CAGxC,IAAI,OAAY,OAAa;EAC5B,MAAM,KAAK,KAAK;AAChB,MAAI,CAAC,KAAK,KAAM;AAEhB,MAAI,OAAO,UAAU,UAAU;AAC9B,QAAK,KAAK,SAAS;AACnB,QAAK,UAAU,SAAS;AACxB,wGAAA,QAAO,QAAQ,GAAG,GAAG,OAAO,SAAS,MAAM;AAC3C;;AAGD,SAAO,KAAK,MAAM,CAAC,KAAK,SAAS;AAChC,QAAK,KAAK,QAAQ,MAAM;AACxB,QAAK,UAAU,QAAQ,MAAM;AAC7B,wGAAA,QAAO,QAAQ,GAAG,GAAG,OAAO,QAAQ,MAAM,MAAM;IAC/C;;CAGH,OAAO,OAAO;AACb,SAAO,KAAK,KAAK;;CAGlB,QAAQ;AACP,MAAI,CAAC,KAAK,KAAM;AAChB,OAAK,YAAY,EAAE;AAEnB,SAAO,KAAK,KAAK,KAAK,CAAC,KAAK,SAAS;AACpC,wGAAA,QAAO,QAAQ,GAAG,KAAK,GAAG,OAAO,QAAQ,KAAA,EAAU;AACnD,QAAK,KAAK,QAAQ,KAAA;IACjB;;CAGH,MAAM,SAAS,OAAgB;EAC9B,MAAM,EAAE,IAAI,OAAO,SAAS;AAC5B,MAAI,CAAC,MAAO,QAAO;AAEnB,MAAI,OAAO;GACV,MAAM,IAAI,MAAM;GAChB,MAAM,OAAc;IACnB,YAAY,MACX,MAAM,QAAQ,EAAE,GACb,EAAE,SAAS,IACX,CAAC;KAAC,KAAA;KAAW;KAAM;KAAG,CAAC,SAAS,EAAE;IACtC,SAAS,KAAA;IACT;AAED,OAAI,OAAO,MAAM,WAChB,MAAK,YAAY;YACP,MAAM,MAAM;AACtB,SAAK,aAAa,MAAM,CAAC;KAAC,KAAA;KAAW;KAAM;KAAG,CAAC,SAAS,EAAE;AAC1D,SAAK,UAAU;SAEf,QAAO,OAAO,MAAM,EAAE;GAGvB,MAAM,UAAU,KAAK,YAAY,KAAK,QAAQ,KAAK;AACnD,OAAI,OAAO,YAAY,SACtB,MAAK,UAAU;AAGhB,OAAI,YAAY,MAAM;AACrB,yGAAA,QAAO,QAAQ,GAAG,GAAG,WAAW,SAAS;KACxC,SAAS,KAAK;KACd,QAAQ;KACR,CAAC;AACF,WAAO;;AAGR,wGAAA,QAAO,QAAQ,GAAG,GAAG,WAAW,QAAQ;IACvC,SAAS;IACT,QAAQ;IACR,CAAC;AACF,UAAO;;EAGR,IAAI,aAAa;AAEjB,SAAO,KAAK,KAAK,CAAC,KAAK,SAAS;GAC/B,MAAM,IAAI,MAAM;AAChB,OAAI,MAAM,KAAA,EAAW;GAErB,MAAM,OAAc;IACnB,YAAY,MAAO,MAAM,QAAQ,EAAE,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC;IACvD,SAAS,KAAA;IACT;AAED,OAAI,OAAO,MAAM,WAChB,MAAK,YAAY;YACP,MAAM,MAAM;AACtB,SAAK,aAAa,MAAM,CAAC;KAAC,KAAA;KAAW;KAAM;KAAG,CAAC,SAAS,EAAE;AAC1D,SAAK,UAAU;SAEf,QAAO,OAAO,MAAM,EAAE;GAGvB,MAAM,UAAU,KAAK,YAAY,KAAK,OAAO,KAAK;AAClD,OAAI,OAAO,YAAY,SACtB,MAAK,UAAU;AAGhB,OAAI,YAAY,MAAM;AACrB,yGAAA,QAAO,QAAQ,GAAG,GAAG,WAAW,QAAQ;KACvC,SAAS,KAAK;KACd,QAAQ;KACR,CAAC;AACF,iBAAa;SAEb,sGAAA,QAAO,QAAQ,GAAG,GAAG,WAAW,QAAQ;IACvC,SAAS;IACT,QAAQ;IACR,CAAC;IAEF;AAEF,SAAO,aAAa,QAAQ,QAAQ,KAAK,GAAG;;;AAI9C,SAAwB,QAAQ,MAAsB;CACrD,MAAM,WAAA,GAAA,MAAA,QAAgC,KAAK;AAE3C,KAAI,CAAC,QAAQ,QACZ,SAAQ,UAAU,QAAQ,IAAI,eAAe;AAG9C,QAAO,QAAQ"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.js");
|
|
2
|
+
let classnames = require("classnames");
|
|
3
|
+
classnames = require_runtime.__toESM(classnames);
|
|
4
|
+
let react = require("react");
|
|
5
|
+
//#region packages/components/icon/icon.tsx
|
|
6
|
+
const Icon = (props) => {
|
|
7
|
+
const { ref, icon, size = "1.425em", rotate, style, className, ...restProps } = props;
|
|
8
|
+
if (!(0, react.isValidElement)(icon)) return icon;
|
|
9
|
+
return (0, react.cloneElement)(icon, {
|
|
10
|
+
ref,
|
|
11
|
+
style: {
|
|
12
|
+
transform: rotate ? `rotate(${rotate}deg)` : void 0,
|
|
13
|
+
...style,
|
|
14
|
+
width: size,
|
|
15
|
+
height: size
|
|
16
|
+
},
|
|
17
|
+
className: (0, classnames.default)("i-icon", className),
|
|
18
|
+
...restProps
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
exports.default = Icon;
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.js","names":[],"sources":["../../../../packages/components/icon/icon.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { cloneElement, isValidElement } from \"react\";\nimport \"./index.css\";\nimport { IIcon } from \"./type\";\n\nconst Icon = (props: IIcon) => {\n\tconst {\n\t\tref,\n\t\ticon,\n\t\tsize = \"1.425em\",\n\t\trotate,\n\t\tstyle,\n\t\tclassName,\n\t\t...restProps\n\t} = props;\n\n\tif (!isValidElement(icon)) return icon;\n\n\tconst iconProps = {\n\t\tref,\n\t\tstyle: {\n\t\t\ttransform: rotate ? `rotate(${rotate}deg)` : undefined,\n\t\t\t...style,\n\t\t\twidth: size,\n\t\t\theight: size,\n\t\t},\n\t\tclassName: classNames(\"i-icon\", className),\n\t\t...restProps,\n\t};\n\n\treturn cloneElement(icon, iconProps);\n};\n\nexport default Icon;\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["Icon"],"sources":["../../../../packages/components/icon/index.tsx"],"sourcesContent":["import Icon from \"./icon\";\n\nexport default Icon;\n"],"mappings":";AAEA,IAAA,oCAAeA"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.js");
|
|
2
|
+
const require_index = require("../loading/index.js");
|
|
3
|
+
const require_hooks = require("../../js/hooks.js");
|
|
4
|
+
const require_index$1 = require("../../js/usePreview/index.js");
|
|
5
|
+
const require_list = require("./list.js");
|
|
6
|
+
let classnames = require("classnames");
|
|
7
|
+
classnames = require_runtime.__toESM(classnames);
|
|
8
|
+
let react = require("react");
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
//#region packages/components/image/image.tsx
|
|
11
|
+
const Image = (props) => {
|
|
12
|
+
const { src, thumb, round, size, height, width, ratio, initSize, lazyload, fallback, fit, style, className, cover, coverClass, usePreview: previewable, onLoad, onError, onClick, ...restProps } = props;
|
|
13
|
+
const state = require_hooks.useReactive({ status: "loading" });
|
|
14
|
+
const ref = (0, react.useRef)(null);
|
|
15
|
+
const { observe, unobserve } = require_hooks.useIntersectionObserver();
|
|
16
|
+
const preview = require_index$1.default();
|
|
17
|
+
const handleError = (err) => {
|
|
18
|
+
onError?.(err);
|
|
19
|
+
state.status = "error";
|
|
20
|
+
};
|
|
21
|
+
const handleLoad = (e) => {
|
|
22
|
+
onLoad?.(e);
|
|
23
|
+
state.status = void 0;
|
|
24
|
+
};
|
|
25
|
+
const handleClick = (e) => {
|
|
26
|
+
onClick?.(e);
|
|
27
|
+
if (!previewable || !src) return;
|
|
28
|
+
preview({
|
|
29
|
+
...typeof previewable === "boolean" ? {} : previewable,
|
|
30
|
+
items: [{
|
|
31
|
+
src,
|
|
32
|
+
type: "IMAGE"
|
|
33
|
+
}]
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
(0, react.useEffect)(() => {
|
|
37
|
+
if (!src || typeof window === "undefined") return;
|
|
38
|
+
const img = ref.current;
|
|
39
|
+
const hasSrcAttr = img?.getAttribute("src");
|
|
40
|
+
if (Boolean(img && (!lazyload || hasSrcAttr)) && img?.complete) state.status = img.naturalWidth > 0 ? void 0 : "error";
|
|
41
|
+
if (!ref.current?.complete && observe && lazyload) state.status = "loading";
|
|
42
|
+
if (!lazyload || !ref.current || !observe) return;
|
|
43
|
+
observe(ref.current, (tar, visible) => {
|
|
44
|
+
if (!visible) return;
|
|
45
|
+
tar.setAttribute("src", tar.dataset.src || "");
|
|
46
|
+
unobserve(tar);
|
|
47
|
+
});
|
|
48
|
+
return () => {
|
|
49
|
+
ref.current && unobserve(ref.current);
|
|
50
|
+
};
|
|
51
|
+
}, [src]);
|
|
52
|
+
restProps[lazyload ? "data-src" : "src"] = thumb ?? src;
|
|
53
|
+
const iSize = state.status === "loading" ? initSize : void 0;
|
|
54
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
55
|
+
style: {
|
|
56
|
+
width: width ?? size ?? iSize,
|
|
57
|
+
height: height ?? size ?? iSize,
|
|
58
|
+
aspectRatio: ratio,
|
|
59
|
+
...style
|
|
60
|
+
},
|
|
61
|
+
className: (0, classnames.default)("i-image", className, {
|
|
62
|
+
rounded: round,
|
|
63
|
+
[`i-image-${state.status}`]: state.status
|
|
64
|
+
}),
|
|
65
|
+
onClick: handleClick,
|
|
66
|
+
children: state.status === "error" ? fallback ?? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
67
|
+
src && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
68
|
+
ref,
|
|
69
|
+
style: { objectFit: fit },
|
|
70
|
+
...restProps,
|
|
71
|
+
onLoad: handleLoad,
|
|
72
|
+
onError: handleError
|
|
73
|
+
}),
|
|
74
|
+
src && state.status === "loading" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.default, { absolute: true }),
|
|
75
|
+
cover && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
76
|
+
className: (0, classnames.default)("i-image-cover", coverClass),
|
|
77
|
+
children: cover
|
|
78
|
+
})
|
|
79
|
+
] })
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
Image.List = require_list.default;
|
|
83
|
+
//#endregion
|
|
84
|
+
exports.default = Image;
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.js","names":[],"sources":["../../../../packages/components/image/image.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { useEffect, useRef } from \"react\";\nimport { useIntersectionObserver, useReactive } from \"../../js/hooks\";\nimport usePreview from \"../../js/usePreview\";\nimport Loading from \"../loading\";\nimport \"./index.css\";\nimport List from \"./list\";\nimport type { CompositionImage, IImage } from \"./type\";\n\nconst Image = (props: IImage) => {\n\tconst {\n\t\tsrc,\n\t\tthumb,\n\t\tround,\n\t\tsize,\n\t\theight,\n\t\twidth,\n\t\tratio,\n\t\tinitSize,\n\t\tlazyload,\n\t\tfallback,\n\t\tfit,\n\t\tstyle,\n\t\tclassName,\n\t\tcover,\n\t\tcoverClass,\n\t\tusePreview: previewable,\n\t\tonLoad,\n\t\tonError,\n\t\tonClick,\n\t\t...restProps\n\t} = props;\n\n\tconst state = useReactive<{ status?: string }>({\n\t\tstatus: \"loading\",\n\t});\n\tconst ref = useRef<HTMLImageElement>(null);\n\n\tconst { observe, unobserve } = useIntersectionObserver();\n\tconst preview = usePreview();\n\n\tconst handleError = (err) => {\n\t\tonError?.(err);\n\t\tstate.status = \"error\";\n\t};\n\n\tconst handleLoad = (e) => {\n\t\tonLoad?.(e);\n\t\tstate.status = undefined;\n\t};\n\n\tconst handleClick = (e) => {\n\t\tonClick?.(e);\n\n\t\tif (!previewable || !src) return;\n\n\t\tconst previewConfigs =\n\t\t\ttypeof previewable === \"boolean\" ? {} : previewable;\n\n\t\tpreview({\n\t\t\t...previewConfigs,\n\t\t\titems: [\n\t\t\t\t{\n\t\t\t\t\tsrc,\n\t\t\t\t\ttype: \"IMAGE\",\n\t\t\t\t},\n\t\t\t],\n\t\t});\n\t};\n\n\tuseEffect(() => {\n\t\tif (!src || typeof window === \"undefined\") return;\n\n\t\tconst img = ref.current;\n\t\tconst hasSrcAttr = img?.getAttribute(\"src\");\n\t\tconst canSyncStatus = Boolean(img && (!lazyload || hasSrcAttr));\n\t\tif (canSyncStatus && img?.complete) {\n\t\t\tstate.status = img.naturalWidth > 0 ? undefined : \"error\";\n\t\t}\n\n\t\tif (!ref.current?.complete && observe && lazyload) {\n\t\t\tstate.status = \"loading\";\n\t\t}\n\n\t\tif (!lazyload || !ref.current || !observe) return;\n\n\t\tobserve(ref.current, (tar: HTMLElement, visible: boolean) => {\n\t\t\tif (!visible) return;\n\n\t\t\ttar.setAttribute(\"src\", tar.dataset.src || \"\");\n\t\t\tunobserve(tar);\n\t\t});\n\n\t\treturn () => {\n\t\t\tref.current && unobserve(ref.current);\n\t\t};\n\t}, [src]);\n\n\trestProps[lazyload ? \"data-src\" : \"src\"] = thumb ?? src;\n\tconst iSize = state.status === \"loading\" ? initSize : undefined;\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\twidth: width ?? size ?? iSize,\n\t\t\t\theight: height ?? size ?? iSize,\n\t\t\t\taspectRatio: ratio,\n\t\t\t\t...style,\n\t\t\t}}\n\t\t\tclassName={classNames(\"i-image\", className, {\n\t\t\t\trounded: round,\n\t\t\t\t[`i-image-${state.status}`]: state.status,\n\t\t\t})}\n\t\t\tonClick={handleClick}\n\t\t>\n\t\t\t{state.status === \"error\" ? (\n\t\t\t\t(fallback ?? null)\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t{src && (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\t\tstyle={{ objectFit: fit }}\n\t\t\t\t\t\t\t{...restProps}\n\t\t\t\t\t\t\tonLoad={handleLoad}\n\t\t\t\t\t\t\tonError={handleError}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{src && state.status === \"loading\" && <Loading absolute />}\n\n\t\t\t\t\t{cover && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={classNames(\"i-image-cover\", coverClass)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{cover}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nImage.List = List;\n\nexport default Image as CompositionImage;\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["Image"],"sources":["../../../../packages/components/image/index.tsx"],"sourcesContent":["import Image from \"./image\";\n\nexport default Image;\n"],"mappings":";AAEA,IAAA,sCAAeA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require("../../_virtual/_rolldown/runtime.js");
|
|
2
|
+
const require_utils = require("../../js/utils.js");
|
|
3
|
+
const require_index = require("../flex/index.js");
|
|
4
|
+
const require_index$1 = require("../../js/usePreview/index.js");
|
|
5
|
+
const require_image = require("./image.js");
|
|
6
|
+
let react = require("react");
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
//#region packages/components/image/list.tsx
|
|
9
|
+
function List(props) {
|
|
10
|
+
const { items = [], gap = 8, columns, wrap, direction, usePreview: previewable, onClick, ...restProps } = props;
|
|
11
|
+
const preview = require_index$1.default();
|
|
12
|
+
const files = (0, react.useMemo)(() => {
|
|
13
|
+
return items.map((item) => {
|
|
14
|
+
const o = { src: "" };
|
|
15
|
+
if (typeof item === "string") o.src = item;
|
|
16
|
+
else Object.assign(o, item);
|
|
17
|
+
o.suffix = require_utils.getSuffixByUrl(o.src) || "";
|
|
18
|
+
o.type = require_utils.getFileType(o.suffix, item["type"]);
|
|
19
|
+
return o;
|
|
20
|
+
});
|
|
21
|
+
}, [items]);
|
|
22
|
+
const handleClick = (e, i) => {
|
|
23
|
+
onClick?.(e);
|
|
24
|
+
previewable && preview({
|
|
25
|
+
items: files,
|
|
26
|
+
initial: i
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
if (!files.length) return "";
|
|
30
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.default, {
|
|
31
|
+
className: "i-image-list",
|
|
32
|
+
gap,
|
|
33
|
+
columns,
|
|
34
|
+
wrap,
|
|
35
|
+
direction,
|
|
36
|
+
children: files.map((img, i) => {
|
|
37
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_image.default, {
|
|
38
|
+
src: img.src,
|
|
39
|
+
usePreview: false,
|
|
40
|
+
onClick: (e) => handleClick(e, i),
|
|
41
|
+
...restProps
|
|
42
|
+
}, i);
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
exports.default = List;
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","names":["usePreview","getSuffixByUrl","getFileType","Flex","Image"],"sources":["../../../../packages/components/image/list.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport usePreview from \"../../js/usePreview\";\nimport { TPreviewItem } from \"../../js/usePreview/type\";\nimport { getFileType, getSuffixByUrl } from \"../../js/utils\";\nimport Flex from \"../flex\";\nimport Image from \"./image\";\nimport { IImageList } from \"./type\";\n\nexport default function List(props: IImageList) {\n\tconst {\n\t\titems = [],\n\t\tgap = 8,\n\t\tcolumns,\n\t\twrap,\n\t\tdirection,\n\t\tusePreview: previewable,\n\t\tonClick,\n\t\t...restProps\n\t} = props;\n\tconst preview = usePreview();\n\n\tconst files = useMemo(() => {\n\t\treturn items.map((item) => {\n\t\t\tconst o: TPreviewItem = {\n\t\t\t\tsrc: \"\",\n\t\t\t};\n\t\t\tif (typeof item === \"string\") {\n\t\t\t\to.src = item;\n\t\t\t} else {\n\t\t\t\tObject.assign(o, item);\n\t\t\t}\n\n\t\t\to.suffix = getSuffixByUrl(o.src) || \"\";\n\t\t\to.type = getFileType(o.suffix, item[\"type\"]);\n\n\t\t\treturn o;\n\t\t});\n\t}, [items]);\n\n\tconst handleClick = (e, i) => {\n\t\tonClick?.(e);\n\n\t\tpreviewable &&\n\t\t\tpreview({\n\t\t\t\titems: files,\n\t\t\t\tinitial: i,\n\t\t\t});\n\t};\n\n\tif (!files.length) return \"\";\n\n\treturn (\n\t\t<Flex\n\t\t\tclassName='i-image-list'\n\t\t\tgap={gap}\n\t\t\tcolumns={columns}\n\t\t\twrap={wrap}\n\t\t\tdirection={direction}\n\t\t>\n\t\t\t{files.map((img, i) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Image\n\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\tsrc={img.src}\n\t\t\t\t\t\tusePreview={false}\n\t\t\t\t\t\tonClick={(e) => handleClick(e, i)}\n\t\t\t\t\t\t{...restProps}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t})}\n\t\t</Flex>\n\t);\n}\n"],"mappings":";;;;;;;;AAQA,SAAwB,KAAK,OAAmB;CAC/C,MAAM,EACL,QAAQ,EAAE,EACV,MAAM,GACN,SACA,MACA,WACA,YAAY,aACZ,SACA,GAAG,cACA;CACJ,MAAM,UAAUA,gBAAAA,SAAY;CAE5B,MAAM,SAAA,GAAA,MAAA,eAAsB;AAC3B,SAAO,MAAM,KAAK,SAAS;GAC1B,MAAM,IAAkB,EACvB,KAAK,IACL;AACD,OAAI,OAAO,SAAS,SACnB,GAAE,MAAM;OAER,QAAO,OAAO,GAAG,KAAK;AAGvB,KAAE,SAASC,cAAAA,eAAe,EAAE,IAAI,IAAI;AACpC,KAAE,OAAOC,cAAAA,YAAY,EAAE,QAAQ,KAAK,QAAQ;AAE5C,UAAO;IACN;IACA,CAAC,MAAM,CAAC;CAEX,MAAM,eAAe,GAAG,MAAM;AAC7B,YAAU,EAAE;AAEZ,iBACC,QAAQ;GACP,OAAO;GACP,SAAS;GACT,CAAC;;AAGJ,KAAI,CAAC,MAAM,OAAQ,QAAO;AAE1B,QACC,iBAAA,GAAA,kBAAA,KAACC,cAAAA,SAAD;EACC,WAAU;EACL;EACI;EACH;EACK;YAEV,MAAM,KAAK,KAAK,MAAM;AACtB,UACC,iBAAA,GAAA,kBAAA,KAACC,cAAAA,SAAD;IAEC,KAAK,IAAI;IACT,YAAY;IACZ,UAAU,MAAM,YAAY,GAAG,EAAE;IACjC,GAAI;IACH,EALI,EAKJ;IAEF;EACI,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.js");
|
|
2
|
+
let classnames = require("classnames");
|
|
3
|
+
classnames = require_runtime.__toESM(classnames);
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
//#region packages/components/input/container.tsx
|
|
6
|
+
function InputContainer(props) {
|
|
7
|
+
const { as: As = "label", label, className, labelInline, style, children, status, tip, required } = props;
|
|
8
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(As, {
|
|
9
|
+
className: (0, classnames.default)("i-input-label", className, { "i-input-inline": labelInline }),
|
|
10
|
+
style,
|
|
11
|
+
children: [
|
|
12
|
+
label && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
13
|
+
className: "i-input-label-text",
|
|
14
|
+
children: [required && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
15
|
+
className: "error",
|
|
16
|
+
children: "*"
|
|
17
|
+
}), label]
|
|
18
|
+
}),
|
|
19
|
+
children,
|
|
20
|
+
tip && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
21
|
+
className: (0, classnames.default)("i-input-message", { [`i-input-${status}`]: status !== "normal" }),
|
|
22
|
+
children: tip
|
|
23
|
+
})
|
|
24
|
+
]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
exports.default = InputContainer;
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.js","names":[],"sources":["../../../../packages/components/input/container.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { IInputContainer } from \"./type\";\n\nexport default function InputContainer(props: IInputContainer) {\n\tconst {\n\t\tas: As = \"label\",\n\t\tlabel,\n\t\tclassName,\n\t\tlabelInline,\n\t\tstyle,\n\t\tchildren,\n\t\tstatus,\n\t\ttip,\n\t\trequired,\n\t} = props;\n\n\treturn (\n\t\t<As\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 && (\n\t\t\t\t<span className='i-input-label-text'>\n\t\t\t\t\t{required && <span className='error'>*</span>}\n\t\t\t\t\t{label}\n\t\t\t\t</span>\n\t\t\t)}\n\n\t\t\t{children}\n\n\t\t\t{tip && (\n\t\t\t\t<span\n\t\t\t\t\tclassName={classNames(\"i-input-message\", {\n\t\t\t\t\t\t[`i-input-${status}`]: status !== \"normal\",\n\t\t\t\t\t})}\n\t\t\t\t>\n\t\t\t\t\t{tip}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</As>\n\t);\n}\n"],"mappings":";;;;;AAGA,SAAwB,eAAe,OAAwB;CAC9D,MAAM,EACL,IAAI,KAAK,SACT,OACA,WACA,aACA,OACA,UACA,QACA,KACA,aACG;AAEJ,QACC,iBAAA,GAAA,kBAAA,MAAC,IAAD;EACC,YAAA,GAAA,WAAA,SAAsB,iBAAiB,WAAW,EACjD,kBAAkB,aAClB,CAAC;EACK;YAJR;GAME,SACA,iBAAA,GAAA,kBAAA,MAAC,QAAD;IAAM,WAAU;cAAhB,CACE,YAAY,iBAAA,GAAA,kBAAA,KAAC,QAAD;KAAM,WAAU;eAAQ;KAAQ,CAAA,EAC5C,MACK;;GAGP;GAEA,OACA,iBAAA,GAAA,kBAAA,KAAC,QAAD;IACC,YAAA,GAAA,WAAA,SAAsB,mBAAmB,GACvC,WAAW,WAAW,WAAW,UAClC,CAAC;cAED;IACK,CAAA;GAEJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["Input"],"sources":["../../../../packages/components/input/index.tsx"],"sourcesContent":["import Input from \"./input\";\n\nexport default Input;\n"],"mappings":";AAEA,IAAA,sCAAeA"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.js");
|
|
2
|
+
const require_index = require("../utils/helpericon/index.js");
|
|
3
|
+
const require_container = require("./container.js");
|
|
4
|
+
const require_number = require("./number.js");
|
|
5
|
+
const require_range = require("./range.js");
|
|
6
|
+
const require_textarea = require("./textarea.js");
|
|
7
|
+
let classnames = require("classnames");
|
|
8
|
+
classnames = require_runtime.__toESM(classnames);
|
|
9
|
+
let react = require("react");
|
|
10
|
+
let _ricons_material = require("@ricons/material");
|
|
11
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
|
+
//#region packages/components/input/input.tsx
|
|
13
|
+
const Input = ((props) => {
|
|
14
|
+
const { ref, type = "text", label, name, value = "", prepend, append, labelInline, className, status = "normal", message, tip, clear, width, hideVisible, border, underline, required, maxLength, onChange, onEnter, onClear, style, ...restProps } = props;
|
|
15
|
+
const [inputValue, setInputValue] = (0, react.useState)(value);
|
|
16
|
+
const [inputType, setInputType] = (0, react.useState)(type);
|
|
17
|
+
const [visible, setVisible] = (0, react.useState)(false);
|
|
18
|
+
const handleChange = (e) => {
|
|
19
|
+
const v = e.target.value;
|
|
20
|
+
setInputValue(v);
|
|
21
|
+
onChange?.(v, e);
|
|
22
|
+
};
|
|
23
|
+
const handleKeydown = (e) => {
|
|
24
|
+
e.code === "Enter" && onEnter?.(e);
|
|
25
|
+
};
|
|
26
|
+
const handleHelperClick = () => {
|
|
27
|
+
if (type === "password" && !hideVisible) {
|
|
28
|
+
setVisible((v) => {
|
|
29
|
+
const next = !v;
|
|
30
|
+
setInputType(next ? "text" : "password");
|
|
31
|
+
return next;
|
|
32
|
+
});
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const v = "";
|
|
36
|
+
setInputValue(v);
|
|
37
|
+
onChange?.(v);
|
|
38
|
+
onClear?.();
|
|
39
|
+
};
|
|
40
|
+
const HelperIcon = (0, react.useMemo)(() => {
|
|
41
|
+
if (type === "password") return visible ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ricons_material.VisibilityRound, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ricons_material.VisibilityOffRound, {});
|
|
42
|
+
}, [type, visible]);
|
|
43
|
+
(0, react.useEffect)(() => {
|
|
44
|
+
setInputValue(value);
|
|
45
|
+
}, [value]);
|
|
46
|
+
const inputProps = {
|
|
47
|
+
ref,
|
|
48
|
+
type: inputType,
|
|
49
|
+
name,
|
|
50
|
+
value: inputValue,
|
|
51
|
+
maxLength,
|
|
52
|
+
className: (0, classnames.default)("i-input", `i-input-${type}`),
|
|
53
|
+
onChange: handleChange,
|
|
54
|
+
onKeyDown: handleKeydown,
|
|
55
|
+
...restProps
|
|
56
|
+
};
|
|
57
|
+
(0, react.useEffect)(() => {
|
|
58
|
+
setInputType(type);
|
|
59
|
+
setVisible(false);
|
|
60
|
+
}, [type]);
|
|
61
|
+
const clearable = clear && inputValue;
|
|
62
|
+
const showHelper = type === "password" && !!inputValue;
|
|
63
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_container.default, {
|
|
64
|
+
label,
|
|
65
|
+
labelInline,
|
|
66
|
+
className,
|
|
67
|
+
style: {
|
|
68
|
+
width,
|
|
69
|
+
...style
|
|
70
|
+
},
|
|
71
|
+
tip: message ?? tip,
|
|
72
|
+
status,
|
|
73
|
+
required,
|
|
74
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
75
|
+
className: (0, classnames.default)("i-input-item", {
|
|
76
|
+
[`i-input-${status}`]: status !== "normal",
|
|
77
|
+
"i-input-borderless": !border,
|
|
78
|
+
"i-input-underline": underline
|
|
79
|
+
}),
|
|
80
|
+
children: [
|
|
81
|
+
prepend && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
82
|
+
className: "i-input-prepend",
|
|
83
|
+
children: prepend
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", { ...inputProps }),
|
|
86
|
+
maxLength && inputValue?.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
87
|
+
className: "color-8 pr-4 font-sm",
|
|
88
|
+
children: [
|
|
89
|
+
inputValue.length,
|
|
90
|
+
" / ",
|
|
91
|
+
maxLength
|
|
92
|
+
]
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.default, {
|
|
95
|
+
active: !!clearable || showHelper,
|
|
96
|
+
icon: HelperIcon,
|
|
97
|
+
onClick: handleHelperClick
|
|
98
|
+
}),
|
|
99
|
+
append && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
100
|
+
className: "i-input-append",
|
|
101
|
+
children: append
|
|
102
|
+
})
|
|
103
|
+
]
|
|
104
|
+
})
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
Input.Textarea = require_textarea.default;
|
|
108
|
+
Input.Number = require_number.default;
|
|
109
|
+
Input.Range = require_range.default;
|
|
110
|
+
//#endregion
|
|
111
|
+
exports.default = Input;
|
|
112
|
+
|
|
113
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","names":[],"sources":["../../../../packages/components/input/input.tsx"],"sourcesContent":["import { VisibilityOffRound, VisibilityRound } from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport {\n\tChangeEvent,\n\tuseEffect,\n\tuseMemo,\n\tuseState,\n\ttype KeyboardEvent,\n} from \"react\";\nimport \"../../css/input.css\";\nimport Helpericon from \"../utils/helpericon\";\nimport InputContainer from \"./container\";\nimport Number from \"./number\";\nimport Range from \"./range\";\nimport Textarea from \"./textarea\";\nimport type { CompositionInput, IInput } from \"./type\";\n\nconst Input = ((props: IInput) => {\n\tconst {\n\t\tref,\n\t\ttype = \"text\",\n\t\tlabel,\n\t\tname,\n\t\tvalue = \"\",\n\t\tprepend,\n\t\tappend,\n\t\tlabelInline,\n\t\tclassName,\n\t\tstatus = \"normal\",\n\t\tmessage,\n\t\ttip,\n\t\tclear,\n\t\twidth,\n\t\thideVisible,\n\t\tborder,\n\t\tunderline,\n\t\trequired,\n\t\tmaxLength,\n\t\tonChange,\n\t\tonEnter,\n\t\tonClear,\n\t\tstyle,\n\t\t...restProps\n\t} = props;\n\n\tconst [inputValue, setInputValue] = useState(value);\n\tconst [inputType, setInputType] = useState(type);\n\tconst [visible, setVisible] = useState(false);\n\n\tconst handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n\t\tconst v = e.target.value;\n\n\t\tsetInputValue(v);\n\t\tonChange?.(v, e);\n\t};\n\n\tconst handleKeydown = (e: KeyboardEvent<HTMLInputElement>) => {\n\t\te.code === \"Enter\" && onEnter?.(e);\n\t};\n\n\tconst handleHelperClick = () => {\n\t\tif (type === \"password\" && !hideVisible) {\n\t\t\tsetVisible((v) => {\n\t\t\t\tconst next = !v;\n\t\t\t\tsetInputType(next ? \"text\" : \"password\");\n\t\t\t\treturn next;\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tconst v = \"\";\n\t\tsetInputValue(v);\n\t\tonChange?.(v);\n\t\tonClear?.();\n\t};\n\n\tconst HelperIcon = useMemo(() => {\n\t\tif (type === \"password\") {\n\t\t\treturn visible ? <VisibilityRound /> : <VisibilityOffRound />;\n\t\t}\n\n\t\treturn undefined;\n\t}, [type, visible]);\n\n\tuseEffect(() => {\n\t\tsetInputValue(value);\n\t}, [value]);\n\n\tconst inputProps = {\n\t\tref,\n\t\ttype: inputType,\n\t\tname,\n\t\tvalue: inputValue,\n\t\tmaxLength,\n\t\tclassName: classNames(\"i-input\", `i-input-${type}`),\n\t\tonChange: handleChange,\n\t\tonKeyDown: handleKeydown,\n\t\t...restProps,\n\t};\n\n\tuseEffect(() => {\n\t\tsetInputType(type);\n\t\tsetVisible(false);\n\t}, [type]);\n\n\tconst clearable = clear && inputValue;\n\tconst showHelper = type === \"password\" && !!inputValue;\n\n\treturn (\n\t\t<InputContainer\n\t\t\tlabel={label}\n\t\t\tlabelInline={labelInline}\n\t\t\tclassName={className}\n\t\t\tstyle={{ width, ...style }}\n\t\t\ttip={message ?? tip}\n\t\t\tstatus={status}\n\t\t\trequired={required}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames(\"i-input-item\", {\n\t\t\t\t\t[`i-input-${status}`]: status !== \"normal\",\n\t\t\t\t\t\"i-input-borderless\": !border,\n\t\t\t\t\t\"i-input-underline\": underline,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{prepend && <div className='i-input-prepend'>{prepend}</div>}\n\n\t\t\t\t<input {...inputProps} />\n\n\t\t\t\t{maxLength && inputValue?.length > 0 && (\n\t\t\t\t\t<span className='color-8 pr-4 font-sm'>\n\t\t\t\t\t\t{inputValue.length} / {maxLength}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\n\t\t\t\t<Helpericon\n\t\t\t\t\tactive={!!clearable || showHelper}\n\t\t\t\t\ticon={HelperIcon}\n\t\t\t\t\tonClick={handleHelperClick}\n\t\t\t\t/>\n\n\t\t\t\t{append && <div className='i-input-append'>{append}</div>}\n\t\t\t</div>\n\t\t</InputContainer>\n\t);\n}) as CompositionInput;\n\nInput.Textarea = Textarea;\nInput.Number = Number;\nInput.Range = Range;\n\nexport default Input;\n"],"mappings":""}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.js");
|
|
2
|
+
const require_utils = require("../../js/utils.js");
|
|
3
|
+
const require_index = require("../utils/helpericon/index.js");
|
|
4
|
+
const require_container = require("./container.js");
|
|
5
|
+
let classnames = require("classnames");
|
|
6
|
+
classnames = require_runtime.__toESM(classnames);
|
|
7
|
+
let react = require("react");
|
|
8
|
+
let _ricons_material = require("@ricons/material");
|
|
9
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
+
//#region packages/components/input/number.tsx
|
|
11
|
+
const Number = (props) => {
|
|
12
|
+
const { ref, label, name, value = "", labelInline, step = 1, min = -Infinity, max = Infinity, thousand, precision, type, className, width, status = "normal", append, border, prepend, disabled, message, tip, hideControl, showMax, style, onChange, onEnter, onInput, onBlur, ...restProps } = props;
|
|
13
|
+
const [inputValue, setInputValue] = (0, react.useState)(value === void 0 || value === null ? "" : String(value));
|
|
14
|
+
const formatOut = (num) => {
|
|
15
|
+
const v = require_utils.clamp(num, min, max);
|
|
16
|
+
if (precision !== void 0) return require_utils.formatNumber(v, {
|
|
17
|
+
precision,
|
|
18
|
+
thousand
|
|
19
|
+
});
|
|
20
|
+
const s = String(v);
|
|
21
|
+
if (!thousand) return s;
|
|
22
|
+
const negative = s.startsWith("-");
|
|
23
|
+
const [integer, decimal] = (negative ? s.slice(1) : s).split(".");
|
|
24
|
+
const withThousand = integer.replace(/\B(?=(\d{3})+(?!\d))/g, thousand);
|
|
25
|
+
return decimal ? `${negative ? "-" : ""}${withThousand}.${decimal}` : `${negative ? "-" : ""}${withThousand}`;
|
|
26
|
+
};
|
|
27
|
+
const sanitizeNumberInput = (raw) => {
|
|
28
|
+
const hasMinus = raw.startsWith("-");
|
|
29
|
+
let v = raw.replace(/[^\d.]/g, "");
|
|
30
|
+
if (hasMinus) v = `-${v}`;
|
|
31
|
+
const parts = v.split(".");
|
|
32
|
+
if (parts.length > 1) v = `${parts.shift()}.${parts.join("")}`;
|
|
33
|
+
return v;
|
|
34
|
+
};
|
|
35
|
+
const formatInputValue = (v) => {
|
|
36
|
+
if (!v) return "";
|
|
37
|
+
if (typeof v === "number") return v.toString();
|
|
38
|
+
if (!thousand) return v;
|
|
39
|
+
return v.split(thousand).join("");
|
|
40
|
+
};
|
|
41
|
+
const handleChange = (e) => {
|
|
42
|
+
const { value } = e.target;
|
|
43
|
+
const v = sanitizeNumberInput(formatInputValue(value));
|
|
44
|
+
const isIntermediate = v === "" || v === "-" || v === "." || v === "-." || v.endsWith(".");
|
|
45
|
+
setInputValue(v);
|
|
46
|
+
if (isIntermediate) return;
|
|
47
|
+
const num = parseFloat(v);
|
|
48
|
+
if (globalThis.Number.isNaN(num)) return;
|
|
49
|
+
onChange?.(require_utils.clamp(num, min, max), e);
|
|
50
|
+
if (precision !== void 0) setInputValue(formatOut(num));
|
|
51
|
+
};
|
|
52
|
+
const handleOperate = (param) => {
|
|
53
|
+
const result = (parseFloat(formatInputValue(inputValue)) || 0) + param;
|
|
54
|
+
setInputValue(formatOut(result));
|
|
55
|
+
onChange?.(require_utils.clamp(result, min, max));
|
|
56
|
+
};
|
|
57
|
+
const handleMax = () => {
|
|
58
|
+
setInputValue(formatOut(max));
|
|
59
|
+
onChange?.(require_utils.clamp(max, min, max));
|
|
60
|
+
};
|
|
61
|
+
const handleBlur = (e) => {
|
|
62
|
+
onBlur?.(e);
|
|
63
|
+
const v = sanitizeNumberInput(formatInputValue(inputValue));
|
|
64
|
+
if (!v || v === "-" || v === "." || v === "-.") {
|
|
65
|
+
setInputValue("");
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const num = parseFloat(v);
|
|
69
|
+
if (globalThis.Number.isNaN(num)) return;
|
|
70
|
+
const numValue = require_utils.clamp(num, min, max);
|
|
71
|
+
setInputValue(formatOut(numValue));
|
|
72
|
+
onChange?.(numValue, e);
|
|
73
|
+
};
|
|
74
|
+
(0, react.useEffect)(() => {
|
|
75
|
+
setInputValue(value === void 0 || value === null ? "" : String(value));
|
|
76
|
+
}, [value]);
|
|
77
|
+
const inputProps = {
|
|
78
|
+
ref,
|
|
79
|
+
name,
|
|
80
|
+
disabled,
|
|
81
|
+
value: inputValue,
|
|
82
|
+
className: "i-input i-input-number",
|
|
83
|
+
onChange: handleChange,
|
|
84
|
+
onKeyDown: (e) => {
|
|
85
|
+
e.code === "Enter" && onEnter?.(e);
|
|
86
|
+
},
|
|
87
|
+
onInput,
|
|
88
|
+
onBlur: handleBlur,
|
|
89
|
+
...restProps
|
|
90
|
+
};
|
|
91
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_container.default, {
|
|
92
|
+
label,
|
|
93
|
+
labelInline,
|
|
94
|
+
className,
|
|
95
|
+
style: {
|
|
96
|
+
width,
|
|
97
|
+
...style
|
|
98
|
+
},
|
|
99
|
+
tip: message ?? tip,
|
|
100
|
+
status,
|
|
101
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
102
|
+
className: (0, classnames.default)("i-input-item", {
|
|
103
|
+
[`i-input-${status}`]: status !== "normal",
|
|
104
|
+
"i-input-borderless": !border
|
|
105
|
+
}),
|
|
106
|
+
children: [
|
|
107
|
+
prepend && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
108
|
+
className: "i-input-prepend",
|
|
109
|
+
children: prepend
|
|
110
|
+
}),
|
|
111
|
+
!hideControl && !disabled && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.default, {
|
|
112
|
+
active: true,
|
|
113
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ricons_material.MinusRound, {}),
|
|
114
|
+
onClick: () => handleOperate(-step)
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", { ...inputProps }),
|
|
117
|
+
!hideControl && !disabled && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.default, {
|
|
118
|
+
active: true,
|
|
119
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ricons_material.PlusRound, {}),
|
|
120
|
+
onClick: () => handleOperate(step)
|
|
121
|
+
}),
|
|
122
|
+
showMax && max && !disabled && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.default, {
|
|
123
|
+
active: true,
|
|
124
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ricons_material.KeyboardDoubleArrowUpRound, {}),
|
|
125
|
+
onClick: handleMax
|
|
126
|
+
}),
|
|
127
|
+
append && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
128
|
+
className: "i-input-append",
|
|
129
|
+
children: append
|
|
130
|
+
})
|
|
131
|
+
]
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
//#endregion
|
|
136
|
+
exports.default = Number;
|
|
137
|
+
|
|
138
|
+
//# sourceMappingURL=number.js.map
|