@ioca/react 1.5.19 → 1.5.21
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/css/index.css +1 -2
- package/lib/es/components/affix/affix.js +1 -1
- package/lib/es/components/affix/index.js +0 -1
- package/lib/es/components/affix/totop.js +0 -1
- package/lib/es/components/badge/badge.js +1 -1
- package/lib/es/components/badge/index.js +0 -1
- package/lib/es/components/button/button.js +1 -1
- package/lib/es/components/button/confirm.js +0 -1
- package/lib/es/components/button/group.js +0 -1
- package/lib/es/components/button/index.js +0 -1
- package/lib/es/components/button/toggle.js +0 -1
- package/lib/es/components/card/card.js +1 -1
- package/lib/es/components/card/index.js +0 -1
- package/lib/es/components/checkbox/checkbox.js +2 -1
- package/lib/es/components/checkbox/index.js +0 -1
- package/lib/es/components/checkbox/item.js +0 -1
- package/lib/es/components/collapse/collapse.js +1 -1
- package/lib/es/components/collapse/index.js +0 -1
- package/lib/es/components/collapse/item.js +0 -1
- package/lib/es/components/datagrid/cell.js +0 -1
- package/lib/es/components/datagrid/datagrid.js +1 -1
- package/lib/es/components/datagrid/helper.js +0 -1
- package/lib/es/components/datagrid/index.js +0 -1
- package/lib/es/components/datagrid/resize.js +0 -1
- package/lib/es/components/datagrid/row.js +0 -1
- package/lib/es/components/datagrid/sorter.js +0 -1
- package/lib/es/components/datagrid/virtual.js +130 -104
- package/lib/es/components/description/description.js +1 -1
- package/lib/es/components/description/index.js +0 -1
- package/lib/es/components/drawer/drawer.js +1 -1
- package/lib/es/components/drawer/index.js +0 -1
- package/lib/es/components/dropdown/dropdown.js +1 -1
- package/lib/es/components/dropdown/index.js +0 -1
- package/lib/es/components/dropdown/item.js +0 -1
- package/lib/es/components/editor/controls.js +0 -1
- package/lib/es/components/editor/editor.js +1 -1
- package/lib/es/components/editor/index.js +0 -1
- package/lib/es/components/editor/memtion.js +0 -1
- package/lib/es/components/flex/flex.js +1 -1
- package/lib/es/components/flex/index.js +0 -1
- package/lib/es/components/form/context.js +0 -1
- package/lib/es/components/form/field.js +0 -1
- package/lib/es/components/form/form.js +1 -1
- package/lib/es/components/form/index.js +0 -1
- package/lib/es/components/form/useConfig.js +0 -1
- package/lib/es/components/form/useForm.js +1 -2
- package/lib/es/components/form/utils.js +0 -1
- package/lib/es/components/icon/icon.js +1 -1
- package/lib/es/components/icon/index.js +0 -1
- package/lib/es/components/image/image.js +1 -1
- package/lib/es/components/image/index.js +0 -1
- package/lib/es/components/image/list.js +0 -1
- package/lib/es/components/input/container.js +0 -1
- package/lib/es/components/input/index.js +0 -1
- package/lib/es/components/input/input.js +1 -1
- package/lib/es/components/input/number.js +1 -1
- package/lib/es/components/input/range.js +1 -1
- package/lib/es/components/input/textarea.js +1 -1
- package/lib/es/components/list/index.js +0 -1
- package/lib/es/components/list/item.js +0 -1
- package/lib/es/components/list/list.js +1 -1
- package/lib/es/components/loading/index.js +0 -1
- package/lib/es/components/loading/loading.js +1 -1
- package/lib/es/components/message/index.js +0 -1
- package/lib/es/components/message/message.js +1 -1
- package/lib/es/components/modal/content.js +1 -1
- package/lib/es/components/modal/context.js +0 -1
- package/lib/es/components/modal/hookModal.js +0 -1
- package/lib/es/components/modal/index.js +0 -1
- package/lib/es/components/modal/modal.js +1 -1
- package/lib/es/components/modal/modalManager.js +0 -1
- package/lib/es/components/modal/useModal.js +0 -1
- package/lib/es/components/pagination/index.js +0 -1
- package/lib/es/components/pagination/page.js +0 -1
- package/lib/es/components/pagination/pagination.js +1 -1
- package/lib/es/components/picker/colors/footer.js +0 -1
- package/lib/es/components/picker/colors/handle.js +0 -1
- package/lib/es/components/picker/colors/index.js +1 -1
- package/lib/es/components/picker/daterange/daterange.js +2 -1
- package/lib/es/components/picker/daterange/index.js +0 -1
- package/lib/es/components/picker/daterange/panel.js +0 -1
- package/lib/es/components/picker/dates/dates.js +0 -1
- package/lib/es/components/picker/dates/index.js +1 -1
- package/lib/es/components/picker/dates/panel.js +0 -1
- package/lib/es/components/picker/time/index.js +0 -1
- package/lib/es/components/picker/time/item.js +0 -1
- package/lib/es/components/picker/time/panel.js +1 -1
- package/lib/es/components/popconfirm/index.js +0 -1
- package/lib/es/components/popconfirm/popconfirm.js +1 -1
- package/lib/es/components/popup/content.js +0 -1
- package/lib/es/components/popup/index.js +0 -1
- package/lib/es/components/popup/popup.js +1 -1
- package/lib/es/components/progress/circle.js +0 -1
- package/lib/es/components/progress/index.js +0 -1
- package/lib/es/components/progress/line.js +0 -1
- package/lib/es/components/progress/progress.js +2 -1
- package/lib/es/components/radio/index.js +0 -1
- package/lib/es/components/radio/item.js +0 -1
- package/lib/es/components/radio/radio.js +2 -1
- package/lib/es/components/resizable/index.js +0 -1
- package/lib/es/components/resizable/resizable.js +1 -1
- package/lib/es/components/river/index.js +0 -1
- package/lib/es/components/river/river.js +1 -1
- package/lib/es/components/scroll/index.js +0 -1
- package/lib/es/components/scroll/scroll.js +1 -1
- package/lib/es/components/select/index.js +0 -1
- package/lib/es/components/select/options.js +0 -1
- package/lib/es/components/select/select.js +2 -1
- package/lib/es/components/step/divider.js +1 -1
- package/lib/es/components/step/index.js +0 -1
- package/lib/es/components/step/item.js +0 -1
- package/lib/es/components/step/step.js +1 -1
- package/lib/es/components/swiper/index.js +0 -1
- package/lib/es/components/swiper/item.js +0 -1
- package/lib/es/components/swiper/swiper.js +1 -1
- package/lib/es/components/tabs/contents.js +0 -1
- package/lib/es/components/tabs/helper.js +0 -1
- package/lib/es/components/tabs/index.js +0 -1
- package/lib/es/components/tabs/item.js +0 -1
- package/lib/es/components/tabs/navs.js +0 -1
- package/lib/es/components/tabs/tabs.js +9 -18
- package/lib/es/components/tag/index.js +0 -1
- package/lib/es/components/tag/tag.js +1 -1
- package/lib/es/components/text/highlight.js +0 -1
- package/lib/es/components/text/index.js +0 -1
- package/lib/es/components/text/number.js +0 -1
- package/lib/es/components/text/text.js +1 -1
- package/lib/es/components/text/time.js +0 -1
- package/lib/es/components/tree/index.js +0 -1
- package/lib/es/components/tree/item.js +44 -58
- package/lib/es/components/tree/tree.js +123 -20
- package/lib/es/components/tree/virtual.js +43 -0
- package/lib/es/components/upload/dropbox.js +0 -1
- package/lib/es/components/upload/index.js +0 -1
- package/lib/es/components/upload/renderFile.js +0 -1
- package/lib/es/components/upload/upload.js +1 -1
- package/lib/es/components/utils/empty/index.js +1 -1
- package/lib/es/components/utils/helpericon/helpericon.js +1 -1
- package/lib/es/components/utils/helpericon/index.js +0 -1
- package/lib/es/components/video/index.js +0 -1
- package/lib/es/components/video/video.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/js/hooks.js +0 -1
- package/lib/es/js/usePreview/content.js +3 -4
- package/lib/es/js/usePreview/index.js +1 -1
- package/lib/es/js/usePreview/renderFile.js +0 -1
- package/lib/es/js/usePreview/type.js +0 -1
- package/lib/es/js/useRipple/index.js +2 -1
- package/lib/es/js/useTheme/index.js +0 -1
- package/lib/es/js/utils.js +0 -1
- package/lib/index.js +338 -197
- package/lib/types/components/tabs/type.d.ts +1 -1
- package/lib/types/components/tree/type.d.ts +8 -5
- package/lib/types/js/usePreview/type.d.ts +1 -1
- package/package.json +8 -11
- package/lib/cjs/components/affix/affix.js +0 -80
- package/lib/cjs/components/affix/affix.js.map +0 -1
- package/lib/cjs/components/affix/index.js +0 -10
- package/lib/cjs/components/affix/index.js.map +0 -1
- package/lib/cjs/components/affix/totop.js +0 -21
- package/lib/cjs/components/affix/totop.js.map +0 -1
- package/lib/cjs/components/badge/badge.js +0 -21
- package/lib/cjs/components/badge/badge.js.map +0 -1
- package/lib/cjs/components/badge/index.js +0 -10
- package/lib/cjs/components/badge/index.js.map +0 -1
- package/lib/cjs/components/button/button.js +0 -72
- package/lib/cjs/components/button/button.js.map +0 -1
- package/lib/cjs/components/button/confirm.js +0 -58
- package/lib/cjs/components/button/confirm.js.map +0 -1
- package/lib/cjs/components/button/group.js +0 -29
- package/lib/cjs/components/button/group.js.map +0 -1
- package/lib/cjs/components/button/index.js +0 -10
- package/lib/cjs/components/button/index.js.map +0 -1
- package/lib/cjs/components/button/toggle.js +0 -47
- package/lib/cjs/components/button/toggle.js.map +0 -1
- package/lib/cjs/components/card/card.js +0 -21
- package/lib/cjs/components/card/card.js.map +0 -1
- package/lib/cjs/components/card/index.js +0 -10
- package/lib/cjs/components/card/index.js.map +0 -1
- package/lib/cjs/components/checkbox/checkbox.js +0 -47
- package/lib/cjs/components/checkbox/checkbox.js.map +0 -1
- package/lib/cjs/components/checkbox/index.js +0 -10
- package/lib/cjs/components/checkbox/index.js.map +0 -1
- package/lib/cjs/components/checkbox/item.js +0 -43
- package/lib/cjs/components/checkbox/item.js.map +0 -1
- package/lib/cjs/components/collapse/collapse.js +0 -80
- package/lib/cjs/components/collapse/collapse.js.map +0 -1
- package/lib/cjs/components/collapse/index.js +0 -10
- package/lib/cjs/components/collapse/index.js.map +0 -1
- package/lib/cjs/components/collapse/item.js +0 -12
- package/lib/cjs/components/collapse/item.js.map +0 -1
- package/lib/cjs/components/datagrid/cell.js +0 -34
- package/lib/cjs/components/datagrid/cell.js.map +0 -1
- package/lib/cjs/components/datagrid/datagrid.js +0 -219
- package/lib/cjs/components/datagrid/datagrid.js.map +0 -1
- package/lib/cjs/components/datagrid/helper.js +0 -83
- package/lib/cjs/components/datagrid/helper.js.map +0 -1
- package/lib/cjs/components/datagrid/index.js +0 -10
- package/lib/cjs/components/datagrid/index.js.map +0 -1
- package/lib/cjs/components/datagrid/resize.js +0 -72
- package/lib/cjs/components/datagrid/resize.js.map +0 -1
- package/lib/cjs/components/datagrid/row.js +0 -55
- package/lib/cjs/components/datagrid/row.js.map +0 -1
- package/lib/cjs/components/datagrid/sorter.js +0 -21
- package/lib/cjs/components/datagrid/sorter.js.map +0 -1
- package/lib/cjs/components/datagrid/virtual.js +0 -283
- package/lib/cjs/components/datagrid/virtual.js.map +0 -1
- package/lib/cjs/components/description/description.js +0 -36
- package/lib/cjs/components/description/description.js.map +0 -1
- package/lib/cjs/components/description/index.js +0 -10
- package/lib/cjs/components/description/index.js.map +0 -1
- package/lib/cjs/components/drawer/drawer.js +0 -77
- package/lib/cjs/components/drawer/drawer.js.map +0 -1
- package/lib/cjs/components/drawer/index.js +0 -10
- package/lib/cjs/components/drawer/index.js.map +0 -1
- package/lib/cjs/components/dropdown/dropdown.js +0 -36
- package/lib/cjs/components/dropdown/dropdown.js.map +0 -1
- package/lib/cjs/components/dropdown/index.js +0 -10
- package/lib/cjs/components/dropdown/index.js.map +0 -1
- package/lib/cjs/components/dropdown/item.js +0 -38
- package/lib/cjs/components/dropdown/item.js.map +0 -1
- package/lib/cjs/components/editor/controls.js +0 -64
- package/lib/cjs/components/editor/controls.js.map +0 -1
- package/lib/cjs/components/editor/editor.js +0 -287
- package/lib/cjs/components/editor/editor.js.map +0 -1
- package/lib/cjs/components/editor/index.js +0 -10
- package/lib/cjs/components/editor/index.js.map +0 -1
- package/lib/cjs/components/editor/memtion.js +0 -302
- package/lib/cjs/components/editor/memtion.js.map +0 -1
- package/lib/cjs/components/flex/flex.js +0 -36
- package/lib/cjs/components/flex/flex.js.map +0 -1
- package/lib/cjs/components/flex/index.js +0 -10
- package/lib/cjs/components/flex/index.js.map +0 -1
- package/lib/cjs/components/form/context.js +0 -10
- package/lib/cjs/components/form/context.js.map +0 -1
- package/lib/cjs/components/form/field.js +0 -81
- package/lib/cjs/components/form/field.js.map +0 -1
- package/lib/cjs/components/form/form.js +0 -76
- package/lib/cjs/components/form/form.js.map +0 -1
- package/lib/cjs/components/form/index.js +0 -10
- package/lib/cjs/components/form/index.js.map +0 -1
- package/lib/cjs/components/form/useConfig.js +0 -38
- package/lib/cjs/components/form/useConfig.js.map +0 -1
- package/lib/cjs/components/form/useForm.js +0 -127
- package/lib/cjs/components/form/useForm.js.map +0 -1
- package/lib/cjs/components/form/utils.js +0 -33
- package/lib/cjs/components/form/utils.js.map +0 -1
- package/lib/cjs/components/icon/icon.js +0 -31
- package/lib/cjs/components/icon/icon.js.map +0 -1
- package/lib/cjs/components/icon/index.js +0 -10
- package/lib/cjs/components/icon/index.js.map +0 -1
- package/lib/cjs/components/image/image.js +0 -103
- package/lib/cjs/components/image/image.js.map +0 -1
- package/lib/cjs/components/image/index.js +0 -10
- package/lib/cjs/components/image/index.js.map +0 -1
- package/lib/cjs/components/image/list.js +0 -47
- package/lib/cjs/components/image/list.js.map +0 -1
- package/lib/cjs/components/input/container.js +0 -22
- package/lib/cjs/components/input/container.js.map +0 -1
- package/lib/cjs/components/input/index.js +0 -10
- package/lib/cjs/components/input/index.js.map +0 -1
- package/lib/cjs/components/input/input.js +0 -85
- package/lib/cjs/components/input/input.js.map +0 -1
- package/lib/cjs/components/input/number.js +0 -118
- package/lib/cjs/components/input/number.js.map +0 -1
- package/lib/cjs/components/input/range.js +0 -82
- package/lib/cjs/components/input/range.js.map +0 -1
- package/lib/cjs/components/input/textarea.js +0 -64
- package/lib/cjs/components/input/textarea.js.map +0 -1
- package/lib/cjs/components/list/index.js +0 -10
- package/lib/cjs/components/list/index.js.map +0 -1
- package/lib/cjs/components/list/item.js +0 -23
- package/lib/cjs/components/list/item.js.map +0 -1
- package/lib/cjs/components/list/list.js +0 -33
- package/lib/cjs/components/list/list.js.map +0 -1
- package/lib/cjs/components/loading/index.js +0 -10
- package/lib/cjs/components/loading/index.js.map +0 -1
- package/lib/cjs/components/loading/loading.js +0 -26
- package/lib/cjs/components/loading/loading.js.map +0 -1
- package/lib/cjs/components/message/index.js +0 -11
- package/lib/cjs/components/message/index.js.map +0 -1
- package/lib/cjs/components/message/message.js +0 -239
- package/lib/cjs/components/message/message.js.map +0 -1
- package/lib/cjs/components/modal/content.js +0 -45
- package/lib/cjs/components/modal/content.js.map +0 -1
- package/lib/cjs/components/modal/context.js +0 -10
- package/lib/cjs/components/modal/context.js.map +0 -1
- package/lib/cjs/components/modal/hookModal.js +0 -31
- package/lib/cjs/components/modal/hookModal.js.map +0 -1
- package/lib/cjs/components/modal/index.js +0 -10
- package/lib/cjs/components/modal/index.js.map +0 -1
- package/lib/cjs/components/modal/modal.js +0 -140
- package/lib/cjs/components/modal/modal.js.map +0 -1
- package/lib/cjs/components/modal/modalManager.js +0 -83
- package/lib/cjs/components/modal/modalManager.js.map +0 -1
- package/lib/cjs/components/modal/useModal.js +0 -38
- package/lib/cjs/components/modal/useModal.js.map +0 -1
- package/lib/cjs/components/pagination/index.js +0 -10
- package/lib/cjs/components/pagination/index.js.map +0 -1
- package/lib/cjs/components/pagination/page.js +0 -32
- package/lib/cjs/components/pagination/page.js.map +0 -1
- package/lib/cjs/components/pagination/pagination.js +0 -52
- package/lib/cjs/components/pagination/pagination.js.map +0 -1
- package/lib/cjs/components/picker/colors/footer.js +0 -39
- package/lib/cjs/components/picker/colors/footer.js.map +0 -1
- package/lib/cjs/components/picker/colors/handle.js +0 -18
- package/lib/cjs/components/picker/colors/handle.js.map +0 -1
- package/lib/cjs/components/picker/colors/index.js +0 -72
- package/lib/cjs/components/picker/colors/index.js.map +0 -1
- package/lib/cjs/components/picker/daterange/daterange.js +0 -60
- package/lib/cjs/components/picker/daterange/daterange.js.map +0 -1
- package/lib/cjs/components/picker/daterange/index.js +0 -11
- package/lib/cjs/components/picker/daterange/index.js.map +0 -1
- package/lib/cjs/components/picker/daterange/panel.js +0 -55
- package/lib/cjs/components/picker/daterange/panel.js.map +0 -1
- package/lib/cjs/components/picker/dates/dates.js +0 -63
- package/lib/cjs/components/picker/dates/dates.js.map +0 -1
- package/lib/cjs/components/picker/dates/index.js +0 -73
- package/lib/cjs/components/picker/dates/index.js.map +0 -1
- package/lib/cjs/components/picker/dates/panel.js +0 -93
- package/lib/cjs/components/picker/dates/panel.js.map +0 -1
- package/lib/cjs/components/picker/time/index.js +0 -55
- package/lib/cjs/components/picker/time/index.js.map +0 -1
- package/lib/cjs/components/picker/time/item.js +0 -23
- package/lib/cjs/components/picker/time/item.js.map +0 -1
- package/lib/cjs/components/picker/time/panel.js +0 -104
- package/lib/cjs/components/picker/time/panel.js.map +0 -1
- package/lib/cjs/components/popconfirm/index.js +0 -10
- package/lib/cjs/components/popconfirm/index.js.map +0 -1
- package/lib/cjs/components/popconfirm/popconfirm.js +0 -55
- package/lib/cjs/components/popconfirm/popconfirm.js.map +0 -1
- package/lib/cjs/components/popup/content.js +0 -51
- package/lib/cjs/components/popup/content.js.map +0 -1
- package/lib/cjs/components/popup/index.js +0 -10
- package/lib/cjs/components/popup/index.js.map +0 -1
- package/lib/cjs/components/popup/popup.js +0 -495
- package/lib/cjs/components/popup/popup.js.map +0 -1
- package/lib/cjs/components/progress/circle.js +0 -16
- package/lib/cjs/components/progress/circle.js.map +0 -1
- package/lib/cjs/components/progress/index.js +0 -10
- package/lib/cjs/components/progress/index.js.map +0 -1
- package/lib/cjs/components/progress/line.js +0 -22
- package/lib/cjs/components/progress/line.js.map +0 -1
- package/lib/cjs/components/progress/progress.js +0 -90
- package/lib/cjs/components/progress/progress.js.map +0 -1
- package/lib/cjs/components/radio/index.js +0 -10
- package/lib/cjs/components/radio/index.js.map +0 -1
- package/lib/cjs/components/radio/item.js +0 -25
- package/lib/cjs/components/radio/item.js.map +0 -1
- package/lib/cjs/components/radio/radio.js +0 -40
- package/lib/cjs/components/radio/radio.js.map +0 -1
- package/lib/cjs/components/resizable/index.js +0 -10
- package/lib/cjs/components/resizable/index.js.map +0 -1
- package/lib/cjs/components/resizable/resizable.js +0 -68
- package/lib/cjs/components/resizable/resizable.js.map +0 -1
- package/lib/cjs/components/river/index.js +0 -10
- package/lib/cjs/components/river/index.js.map +0 -1
- package/lib/cjs/components/river/river.js +0 -114
- package/lib/cjs/components/river/river.js.map +0 -1
- package/lib/cjs/components/scroll/index.js +0 -10
- package/lib/cjs/components/scroll/index.js.map +0 -1
- package/lib/cjs/components/scroll/scroll.js +0 -78
- package/lib/cjs/components/scroll/scroll.js.map +0 -1
- package/lib/cjs/components/select/index.js +0 -10
- package/lib/cjs/components/select/index.js.map +0 -1
- package/lib/cjs/components/select/options.js +0 -55
- package/lib/cjs/components/select/options.js.map +0 -1
- package/lib/cjs/components/select/select.js +0 -103
- package/lib/cjs/components/select/select.js.map +0 -1
- package/lib/cjs/components/step/divider.js +0 -12
- package/lib/cjs/components/step/divider.js.map +0 -1
- package/lib/cjs/components/step/index.js +0 -10
- package/lib/cjs/components/step/index.js.map +0 -1
- package/lib/cjs/components/step/item.js +0 -30
- package/lib/cjs/components/step/item.js.map +0 -1
- package/lib/cjs/components/step/step.js +0 -44
- package/lib/cjs/components/step/step.js.map +0 -1
- package/lib/cjs/components/swiper/index.js +0 -10
- package/lib/cjs/components/swiper/index.js.map +0 -1
- package/lib/cjs/components/swiper/item.js +0 -33
- package/lib/cjs/components/swiper/item.js.map +0 -1
- package/lib/cjs/components/swiper/swiper.js +0 -241
- package/lib/cjs/components/swiper/swiper.js.map +0 -1
- package/lib/cjs/components/tabs/contents.js +0 -28
- package/lib/cjs/components/tabs/contents.js.map +0 -1
- package/lib/cjs/components/tabs/helper.js +0 -68
- package/lib/cjs/components/tabs/helper.js.map +0 -1
- package/lib/cjs/components/tabs/index.js +0 -10
- package/lib/cjs/components/tabs/index.js.map +0 -1
- package/lib/cjs/components/tabs/item.js +0 -12
- package/lib/cjs/components/tabs/item.js.map +0 -1
- package/lib/cjs/components/tabs/navs.js +0 -38
- package/lib/cjs/components/tabs/navs.js.map +0 -1
- package/lib/cjs/components/tabs/tabs.js +0 -264
- package/lib/cjs/components/tabs/tabs.js.map +0 -1
- package/lib/cjs/components/tag/index.js +0 -10
- package/lib/cjs/components/tag/index.js.map +0 -1
- package/lib/cjs/components/tag/tag.js +0 -26
- package/lib/cjs/components/tag/tag.js.map +0 -1
- package/lib/cjs/components/text/highlight.js +0 -32
- package/lib/cjs/components/text/highlight.js.map +0 -1
- package/lib/cjs/components/text/index.js +0 -10
- package/lib/cjs/components/text/index.js.map +0 -1
- package/lib/cjs/components/text/number.js +0 -31
- package/lib/cjs/components/text/number.js.map +0 -1
- package/lib/cjs/components/text/text.js +0 -42
- package/lib/cjs/components/text/text.js.map +0 -1
- package/lib/cjs/components/text/time.js +0 -24
- package/lib/cjs/components/text/time.js.map +0 -1
- package/lib/cjs/components/tree/index.js +0 -10
- package/lib/cjs/components/tree/index.js.map +0 -1
- package/lib/cjs/components/tree/item.js +0 -80
- package/lib/cjs/components/tree/item.js.map +0 -1
- package/lib/cjs/components/tree/tree.js +0 -134
- package/lib/cjs/components/tree/tree.js.map +0 -1
- package/lib/cjs/components/upload/dropbox.js +0 -54
- package/lib/cjs/components/upload/dropbox.js.map +0 -1
- package/lib/cjs/components/upload/index.js +0 -10
- package/lib/cjs/components/upload/index.js.map +0 -1
- package/lib/cjs/components/upload/renderFile.js +0 -66
- package/lib/cjs/components/upload/renderFile.js.map +0 -1
- package/lib/cjs/components/upload/upload.js +0 -163
- package/lib/cjs/components/upload/upload.js.map +0 -1
- package/lib/cjs/components/utils/empty/index.js +0 -19
- package/lib/cjs/components/utils/empty/index.js.map +0 -1
- package/lib/cjs/components/utils/helpericon/helpericon.js +0 -32
- package/lib/cjs/components/utils/helpericon/helpericon.js.map +0 -1
- package/lib/cjs/components/utils/helpericon/index.js +0 -10
- package/lib/cjs/components/utils/helpericon/index.js.map +0 -1
- package/lib/cjs/components/video/index.js +0 -10
- package/lib/cjs/components/video/index.js.map +0 -1
- package/lib/cjs/components/video/video.js +0 -181
- package/lib/cjs/components/video/video.js.map +0 -1
- package/lib/cjs/index.js +0 -92
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/js/hooks.js +0 -272
- package/lib/cjs/js/hooks.js.map +0 -1
- package/lib/cjs/js/usePreview/content.js +0 -164
- package/lib/cjs/js/usePreview/content.js.map +0 -1
- package/lib/cjs/js/usePreview/index.js +0 -27
- package/lib/cjs/js/usePreview/index.js.map +0 -1
- package/lib/cjs/js/usePreview/renderFile.js +0 -24
- package/lib/cjs/js/usePreview/renderFile.js.map +0 -1
- package/lib/cjs/js/usePreview/type.js +0 -13
- package/lib/cjs/js/usePreview/type.js.map +0 -1
- package/lib/cjs/js/useRipple/index.js +0 -51
- package/lib/cjs/js/useRipple/index.js.map +0 -1
- package/lib/cjs/js/useTheme/index.js +0 -155
- package/lib/cjs/js/useTheme/index.js.map +0 -1
- package/lib/cjs/js/utils.js +0 -302
- package/lib/cjs/js/utils.js.map +0 -1
- package/lib/css/colors.css +0 -792
- package/lib/css/index.css.map +0 -1
- package/lib/css/input.css +0 -214
- package/lib/css/reset.css +0 -140
- package/lib/css/tokens.css +0 -13
- package/lib/css/utilities.css +0 -1973
- package/lib/es/components/affix/affix.js.map +0 -1
- package/lib/es/components/affix/index.js.map +0 -1
- package/lib/es/components/affix/totop.js.map +0 -1
- package/lib/es/components/badge/badge.js.map +0 -1
- package/lib/es/components/badge/index.js.map +0 -1
- package/lib/es/components/button/button.js.map +0 -1
- package/lib/es/components/button/confirm.js.map +0 -1
- package/lib/es/components/button/group.js.map +0 -1
- package/lib/es/components/button/index.js.map +0 -1
- package/lib/es/components/button/toggle.js.map +0 -1
- package/lib/es/components/card/card.js.map +0 -1
- package/lib/es/components/card/index.js.map +0 -1
- package/lib/es/components/checkbox/checkbox.js.map +0 -1
- package/lib/es/components/checkbox/index.js.map +0 -1
- package/lib/es/components/checkbox/item.js.map +0 -1
- package/lib/es/components/collapse/collapse.js.map +0 -1
- package/lib/es/components/collapse/index.js.map +0 -1
- package/lib/es/components/collapse/item.js.map +0 -1
- package/lib/es/components/datagrid/cell.js.map +0 -1
- package/lib/es/components/datagrid/datagrid.js.map +0 -1
- package/lib/es/components/datagrid/helper.js.map +0 -1
- package/lib/es/components/datagrid/index.js.map +0 -1
- package/lib/es/components/datagrid/resize.js.map +0 -1
- package/lib/es/components/datagrid/row.js.map +0 -1
- package/lib/es/components/datagrid/sorter.js.map +0 -1
- package/lib/es/components/datagrid/virtual.js.map +0 -1
- package/lib/es/components/description/description.js.map +0 -1
- package/lib/es/components/description/index.js.map +0 -1
- package/lib/es/components/drawer/drawer.js.map +0 -1
- package/lib/es/components/drawer/index.js.map +0 -1
- package/lib/es/components/dropdown/dropdown.js.map +0 -1
- package/lib/es/components/dropdown/index.js.map +0 -1
- package/lib/es/components/dropdown/item.js.map +0 -1
- package/lib/es/components/editor/controls.js.map +0 -1
- package/lib/es/components/editor/editor.js.map +0 -1
- package/lib/es/components/editor/index.js.map +0 -1
- package/lib/es/components/editor/memtion.js.map +0 -1
- package/lib/es/components/flex/flex.js.map +0 -1
- package/lib/es/components/flex/index.js.map +0 -1
- package/lib/es/components/form/context.js.map +0 -1
- package/lib/es/components/form/field.js.map +0 -1
- package/lib/es/components/form/form.js.map +0 -1
- package/lib/es/components/form/index.js.map +0 -1
- package/lib/es/components/form/useConfig.js.map +0 -1
- package/lib/es/components/form/useForm.js.map +0 -1
- package/lib/es/components/form/utils.js.map +0 -1
- package/lib/es/components/icon/icon.js.map +0 -1
- package/lib/es/components/icon/index.js.map +0 -1
- package/lib/es/components/image/image.js.map +0 -1
- package/lib/es/components/image/index.js.map +0 -1
- package/lib/es/components/image/list.js.map +0 -1
- package/lib/es/components/input/container.js.map +0 -1
- package/lib/es/components/input/index.js.map +0 -1
- package/lib/es/components/input/input.js.map +0 -1
- package/lib/es/components/input/number.js.map +0 -1
- package/lib/es/components/input/range.js.map +0 -1
- package/lib/es/components/input/textarea.js.map +0 -1
- package/lib/es/components/list/index.js.map +0 -1
- package/lib/es/components/list/item.js.map +0 -1
- package/lib/es/components/list/list.js.map +0 -1
- package/lib/es/components/loading/index.js.map +0 -1
- package/lib/es/components/loading/loading.js.map +0 -1
- package/lib/es/components/message/index.js.map +0 -1
- package/lib/es/components/message/message.js.map +0 -1
- package/lib/es/components/modal/content.js.map +0 -1
- package/lib/es/components/modal/context.js.map +0 -1
- package/lib/es/components/modal/hookModal.js.map +0 -1
- package/lib/es/components/modal/index.js.map +0 -1
- package/lib/es/components/modal/modal.js.map +0 -1
- package/lib/es/components/modal/modalManager.js.map +0 -1
- package/lib/es/components/modal/useModal.js.map +0 -1
- package/lib/es/components/pagination/index.js.map +0 -1
- package/lib/es/components/pagination/page.js.map +0 -1
- package/lib/es/components/pagination/pagination.js.map +0 -1
- package/lib/es/components/picker/colors/footer.js.map +0 -1
- package/lib/es/components/picker/colors/handle.js.map +0 -1
- package/lib/es/components/picker/colors/index.js.map +0 -1
- package/lib/es/components/picker/daterange/daterange.js.map +0 -1
- package/lib/es/components/picker/daterange/index.js.map +0 -1
- package/lib/es/components/picker/daterange/panel.js.map +0 -1
- package/lib/es/components/picker/dates/dates.js.map +0 -1
- package/lib/es/components/picker/dates/index.js.map +0 -1
- package/lib/es/components/picker/dates/panel.js.map +0 -1
- package/lib/es/components/picker/time/index.js.map +0 -1
- package/lib/es/components/picker/time/item.js.map +0 -1
- package/lib/es/components/picker/time/panel.js.map +0 -1
- package/lib/es/components/popconfirm/index.js.map +0 -1
- package/lib/es/components/popconfirm/popconfirm.js.map +0 -1
- package/lib/es/components/popup/content.js.map +0 -1
- package/lib/es/components/popup/index.js.map +0 -1
- package/lib/es/components/popup/popup.js.map +0 -1
- package/lib/es/components/progress/circle.js.map +0 -1
- package/lib/es/components/progress/index.js.map +0 -1
- package/lib/es/components/progress/line.js.map +0 -1
- package/lib/es/components/progress/progress.js.map +0 -1
- package/lib/es/components/radio/index.js.map +0 -1
- package/lib/es/components/radio/item.js.map +0 -1
- package/lib/es/components/radio/radio.js.map +0 -1
- package/lib/es/components/resizable/index.js.map +0 -1
- package/lib/es/components/resizable/resizable.js.map +0 -1
- package/lib/es/components/river/index.js.map +0 -1
- package/lib/es/components/river/river.js.map +0 -1
- package/lib/es/components/scroll/index.js.map +0 -1
- package/lib/es/components/scroll/scroll.js.map +0 -1
- package/lib/es/components/select/index.js.map +0 -1
- package/lib/es/components/select/options.js.map +0 -1
- package/lib/es/components/select/select.js.map +0 -1
- package/lib/es/components/step/divider.js.map +0 -1
- package/lib/es/components/step/index.js.map +0 -1
- package/lib/es/components/step/item.js.map +0 -1
- package/lib/es/components/step/step.js.map +0 -1
- package/lib/es/components/swiper/index.js.map +0 -1
- package/lib/es/components/swiper/item.js.map +0 -1
- package/lib/es/components/swiper/swiper.js.map +0 -1
- package/lib/es/components/tabs/contents.js.map +0 -1
- package/lib/es/components/tabs/helper.js.map +0 -1
- package/lib/es/components/tabs/index.js.map +0 -1
- package/lib/es/components/tabs/item.js.map +0 -1
- package/lib/es/components/tabs/navs.js.map +0 -1
- package/lib/es/components/tabs/tabs.js.map +0 -1
- package/lib/es/components/tag/index.js.map +0 -1
- package/lib/es/components/tag/tag.js.map +0 -1
- package/lib/es/components/text/highlight.js.map +0 -1
- package/lib/es/components/text/index.js.map +0 -1
- package/lib/es/components/text/number.js.map +0 -1
- package/lib/es/components/text/text.js.map +0 -1
- package/lib/es/components/text/time.js.map +0 -1
- package/lib/es/components/tree/index.js.map +0 -1
- package/lib/es/components/tree/item.js.map +0 -1
- package/lib/es/components/tree/tree.js.map +0 -1
- package/lib/es/components/upload/dropbox.js.map +0 -1
- package/lib/es/components/upload/index.js.map +0 -1
- package/lib/es/components/upload/renderFile.js.map +0 -1
- package/lib/es/components/upload/upload.js.map +0 -1
- package/lib/es/components/utils/empty/index.js.map +0 -1
- package/lib/es/components/utils/helpericon/helpericon.js.map +0 -1
- package/lib/es/components/utils/helpericon/index.js.map +0 -1
- package/lib/es/components/video/index.js.map +0 -1
- package/lib/es/components/video/video.js.map +0 -1
- package/lib/es/index.js.map +0 -1
- package/lib/es/js/hooks.js.map +0 -1
- package/lib/es/js/usePreview/content.js.map +0 -1
- package/lib/es/js/usePreview/index.js.map +0 -1
- package/lib/es/js/usePreview/renderFile.js.map +0 -1
- package/lib/es/js/usePreview/type.js.map +0 -1
- package/lib/es/js/useRipple/index.js.map +0 -1
- package/lib/es/js/useTheme/index.js.map +0 -1
- package/lib/es/js/utils.js.map +0 -1
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var material = require('@ricons/material');
|
|
7
|
-
var classNames = require('classnames');
|
|
8
|
-
var react = require('react');
|
|
9
|
-
var helpericon = require('../utils/helpericon/helpericon.js');
|
|
10
|
-
var container = require('./container.js');
|
|
11
|
-
var number = require('./number.js');
|
|
12
|
-
var range = require('./range.js');
|
|
13
|
-
var textarea = require('./textarea.js');
|
|
14
|
-
|
|
15
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
16
|
-
|
|
17
|
-
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
18
|
-
|
|
19
|
-
const Input = ((props) => {
|
|
20
|
-
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;
|
|
21
|
-
const [inputValue, setInputValue] = react.useState(value);
|
|
22
|
-
const [inputType, setInputType] = react.useState(type);
|
|
23
|
-
const [visible, setVisible] = react.useState(false);
|
|
24
|
-
const handleChange = (e) => {
|
|
25
|
-
const v = e.target.value;
|
|
26
|
-
setInputValue(v);
|
|
27
|
-
onChange?.(v, e);
|
|
28
|
-
};
|
|
29
|
-
const handleKeydown = (e) => {
|
|
30
|
-
e.code === "Enter" && onEnter?.(e);
|
|
31
|
-
};
|
|
32
|
-
const handleHelperClick = () => {
|
|
33
|
-
if (type === "password" && !hideVisible) {
|
|
34
|
-
setVisible((v) => {
|
|
35
|
-
const next = !v;
|
|
36
|
-
setInputType(next ? "text" : "password");
|
|
37
|
-
return next;
|
|
38
|
-
});
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const v = "";
|
|
42
|
-
setInputValue(v);
|
|
43
|
-
onChange?.(v);
|
|
44
|
-
onClear?.();
|
|
45
|
-
};
|
|
46
|
-
const HelperIcon = react.useMemo(() => {
|
|
47
|
-
if (type === "password") {
|
|
48
|
-
return visible ? jsxRuntime.jsx(material.VisibilityRound, {}) : jsxRuntime.jsx(material.VisibilityOffRound, {});
|
|
49
|
-
}
|
|
50
|
-
return undefined;
|
|
51
|
-
}, [type, visible]);
|
|
52
|
-
react.useEffect(() => {
|
|
53
|
-
setInputValue(value);
|
|
54
|
-
}, [value]);
|
|
55
|
-
const inputProps = {
|
|
56
|
-
ref,
|
|
57
|
-
type: inputType,
|
|
58
|
-
name,
|
|
59
|
-
value: inputValue,
|
|
60
|
-
maxLength,
|
|
61
|
-
className: classNames__default("i-input", `i-input-${type}`),
|
|
62
|
-
onChange: handleChange,
|
|
63
|
-
onKeyDown: handleKeydown,
|
|
64
|
-
...restProps,
|
|
65
|
-
};
|
|
66
|
-
react.useEffect(() => {
|
|
67
|
-
setInputType(type);
|
|
68
|
-
setVisible(false);
|
|
69
|
-
}, [type]);
|
|
70
|
-
const clearable = clear && inputValue;
|
|
71
|
-
const showHelper = type === "password" && !!inputValue;
|
|
72
|
-
const isClearBtn = clearable && !showHelper;
|
|
73
|
-
return (jsxRuntime.jsx(container.default, { label: label, labelInline: labelInline, className: className, style: { width, ...style }, tip: message ?? tip, status: status, required: required, children: jsxRuntime.jsxs("div", { className: classNames__default("i-input-item", {
|
|
74
|
-
"i-input-clearable": clearable,
|
|
75
|
-
[`i-input-${status}`]: status !== "normal",
|
|
76
|
-
"i-input-borderless": !border,
|
|
77
|
-
"i-input-underline": underline,
|
|
78
|
-
}), children: [prepend && jsxRuntime.jsx("div", { className: 'i-input-prepend', children: prepend }), jsxRuntime.jsx("input", { ...inputProps }), maxLength && inputValue?.length > 0 && (jsxRuntime.jsxs("span", { className: 'color-8 pr-4 font-sm', children: [inputValue.length, " / ", maxLength] })), jsxRuntime.jsx(helpericon.default, { active: !!clearable || showHelper, icon: HelperIcon, className: classNames__default({ "i-helpericon-clear": isClearBtn }), onClick: handleHelperClick }), append && jsxRuntime.jsx("div", { className: 'i-input-append', children: append })] }) }));
|
|
79
|
-
});
|
|
80
|
-
Input.Textarea = textarea.default;
|
|
81
|
-
Input.Number = number.default;
|
|
82
|
-
Input.Range = range.default;
|
|
83
|
-
|
|
84
|
-
exports.default = Input;
|
|
85
|
-
//# sourceMappingURL=input.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","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\tconst isClearBtn = clearable && !showHelper;\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\t\"i-input-clearable\": clearable,\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\tclassName={classNames({ \"i-helpericon-clear\": isClearBtn })}\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"],"names":["useState","useMemo","_jsx","VisibilityRound","VisibilityOffRound","useEffect","classNames","InputContainer","_jsxs","Helpericon","Textarea","Number","Range"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,MAAM,KAAK,IAAI,CAAC,KAAa,KAAI;IAChC,MAAM,EACL,GAAG,EACH,IAAI,GAAG,MAAM,EACb,KAAK,EACL,IAAI,EACJ,KAAK,GAAG,EAAE,EACV,OAAO,EACP,MAAM,EACN,WAAW,EACX,SAAS,EACT,MAAM,GAAG,QAAQ,EACjB,OAAO,EACP,GAAG,EACH,KAAK,EACL,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,OAAO,EACP,OAAO,EACP,KAAK,EACL,GAAG,SAAS,EACZ,GAAG,KAAK;IAET,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAGA,cAAQ,CAAC,KAAK,CAAC;IACnD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAGA,cAAQ,CAAC,IAAI,CAAC;IAChD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAGA,cAAQ,CAAC,KAAK,CAAC;AAE7C,IAAA,MAAM,YAAY,GAAG,CAAC,CAAgC,KAAI;AACzD,QAAA,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK;QAExB,aAAa,CAAC,CAAC,CAAC;AAChB,QAAA,QAAQ,GAAG,CAAC,EAAE,CAAC,CAAC;AACjB,IAAA,CAAC;AAED,IAAA,MAAM,aAAa,GAAG,CAAC,CAAkC,KAAI;QAC5D,CA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AAEH,mBAAU,CAAC,EAAE,oBAAoB,EAAE,UAAU,EAAE,CAAC,EAC3D,OAAO,EAAE,iBAAiB,EAAA,CACzB,EAED,MAAM,IAAIJ,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,gBAAgB,EAAA,QAAA,EAAE,MAAM,GAAO,CAAA,EAAA,CACpD,EAAA,CACU;AAEnB,CAAC;AAED,KAAK,CAAC,QAAQ,GAAGQ,gBAAQ;AACzB,KAAK,CAAC,MAAM,GAAGC,cAAM;AACrB,KAAK,CAAC,KAAK,GAAGC,aAAK;;;;"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var material = require('@ricons/material');
|
|
7
|
-
var classNames = require('classnames');
|
|
8
|
-
var react = require('react');
|
|
9
|
-
var utils = require('../../js/utils.js');
|
|
10
|
-
var helpericon = require('../utils/helpericon/helpericon.js');
|
|
11
|
-
var container = require('./container.js');
|
|
12
|
-
|
|
13
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
14
|
-
|
|
15
|
-
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
16
|
-
|
|
17
|
-
const Number = (props) => {
|
|
18
|
-
const { ref, label, name, value = "", labelInline, step = 1, min = -Infinity, max = Infinity, thousand, precision, type, className, width, status = "normal", append, border, underline, prepend, disabled, message, tip, hideControl, showMax, style, onChange, onEnter, onInput, onBlur, ...restProps } = props;
|
|
19
|
-
const [inputValue, setInputValue] = react.useState(value === undefined || value === null ? "" : String(value));
|
|
20
|
-
const formatOut = (num) => {
|
|
21
|
-
const v = utils.clamp(num, min, max);
|
|
22
|
-
if (precision !== undefined)
|
|
23
|
-
return utils.formatNumber(v, { precision, thousand });
|
|
24
|
-
const s = String(v);
|
|
25
|
-
if (!thousand)
|
|
26
|
-
return s;
|
|
27
|
-
const negative = s.startsWith("-");
|
|
28
|
-
const body = negative ? s.slice(1) : s;
|
|
29
|
-
const [integer, decimal] = body.split(".");
|
|
30
|
-
const withThousand = integer.replace(/\B(?=(\d{3})+(?!\d))/g, thousand);
|
|
31
|
-
return decimal
|
|
32
|
-
? `${negative ? "-" : ""}${withThousand}.${decimal}`
|
|
33
|
-
: `${negative ? "-" : ""}${withThousand}`;
|
|
34
|
-
};
|
|
35
|
-
const sanitizeNumberInput = (raw) => {
|
|
36
|
-
const hasMinus = raw.startsWith("-");
|
|
37
|
-
let v = raw.replace(/[^\d.]/g, "");
|
|
38
|
-
if (hasMinus)
|
|
39
|
-
v = `-${v}`;
|
|
40
|
-
const parts = v.split(".");
|
|
41
|
-
if (parts.length > 1) {
|
|
42
|
-
v = `${parts.shift()}.${parts.join("")}`;
|
|
43
|
-
}
|
|
44
|
-
return v;
|
|
45
|
-
};
|
|
46
|
-
const formatInputValue = (v) => {
|
|
47
|
-
if (!v)
|
|
48
|
-
return "";
|
|
49
|
-
if (typeof v === "number")
|
|
50
|
-
return v.toString();
|
|
51
|
-
if (!thousand)
|
|
52
|
-
return v;
|
|
53
|
-
return v.split(thousand).join("");
|
|
54
|
-
};
|
|
55
|
-
const handleChange = (e) => {
|
|
56
|
-
const { value } = e.target;
|
|
57
|
-
const v = sanitizeNumberInput(formatInputValue(value));
|
|
58
|
-
const isIntermediate = v === "" || v === "-" || v === "." || v === "-." || v.endsWith(".");
|
|
59
|
-
setInputValue(v);
|
|
60
|
-
if (isIntermediate)
|
|
61
|
-
return;
|
|
62
|
-
const num = parseFloat(v);
|
|
63
|
-
if (globalThis.Number.isNaN(num))
|
|
64
|
-
return;
|
|
65
|
-
onChange?.(utils.clamp(num, min, max), e);
|
|
66
|
-
if (precision !== undefined)
|
|
67
|
-
setInputValue(formatOut(num));
|
|
68
|
-
};
|
|
69
|
-
const handleOperate = (param) => {
|
|
70
|
-
const value = parseFloat(formatInputValue(inputValue)) || 0; // 确保值为数字,默认值为 0
|
|
71
|
-
const result = value + param;
|
|
72
|
-
setInputValue(formatOut(result));
|
|
73
|
-
onChange?.(utils.clamp(result, min, max));
|
|
74
|
-
};
|
|
75
|
-
const handleMax = () => {
|
|
76
|
-
setInputValue(formatOut(max));
|
|
77
|
-
onChange?.(utils.clamp(max, min, max));
|
|
78
|
-
};
|
|
79
|
-
const handleBlur = (e) => {
|
|
80
|
-
onBlur?.(e);
|
|
81
|
-
const v = sanitizeNumberInput(formatInputValue(inputValue));
|
|
82
|
-
if (!v || v === "-" || v === "." || v === "-.") {
|
|
83
|
-
setInputValue("");
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
const num = parseFloat(v);
|
|
87
|
-
if (globalThis.Number.isNaN(num))
|
|
88
|
-
return;
|
|
89
|
-
const numValue = utils.clamp(num, min, max);
|
|
90
|
-
setInputValue(formatOut(numValue));
|
|
91
|
-
onChange?.(numValue, e);
|
|
92
|
-
};
|
|
93
|
-
react.useEffect(() => {
|
|
94
|
-
setInputValue(value === undefined || value === null ? "" : String(value));
|
|
95
|
-
}, [value]);
|
|
96
|
-
const inputProps = {
|
|
97
|
-
ref,
|
|
98
|
-
name,
|
|
99
|
-
disabled,
|
|
100
|
-
value: inputValue,
|
|
101
|
-
className: "i-input i-input-number",
|
|
102
|
-
onChange: handleChange,
|
|
103
|
-
onKeyDown: (e) => {
|
|
104
|
-
e.code === "Enter" && onEnter?.(e);
|
|
105
|
-
},
|
|
106
|
-
onInput,
|
|
107
|
-
onBlur: handleBlur,
|
|
108
|
-
...restProps,
|
|
109
|
-
};
|
|
110
|
-
return (jsxRuntime.jsx(container.default, { label: label, labelInline: labelInline, className: className, style: { width, ...style }, tip: message ?? tip, status: status, children: jsxRuntime.jsxs("div", { className: classNames__default("i-input-item", {
|
|
111
|
-
[`i-input-${status}`]: status !== "normal",
|
|
112
|
-
"i-input-borderless": !border,
|
|
113
|
-
"i-input-underline": underline,
|
|
114
|
-
}), children: [prepend && jsxRuntime.jsx("div", { className: 'i-input-prepend', children: prepend }), !hideControl && !disabled && (jsxRuntime.jsx(helpericon.default, { active: true, icon: jsxRuntime.jsx(material.MinusRound, {}), onClick: () => handleOperate(-step) })), jsxRuntime.jsx("input", { ...inputProps }), !hideControl && !disabled && (jsxRuntime.jsx(helpericon.default, { active: true, icon: jsxRuntime.jsx(material.PlusRound, {}), onClick: () => handleOperate(step) })), showMax && max && !disabled && (jsxRuntime.jsx(helpericon.default, { active: true, icon: jsxRuntime.jsx(material.KeyboardDoubleArrowUpRound, {}), onClick: handleMax })), append && jsxRuntime.jsx("div", { className: 'i-input-append', children: append })] }) }));
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
exports.default = Number;
|
|
118
|
-
//# sourceMappingURL=number.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number.js","sources":["../../../../packages/components/input/number.tsx"],"sourcesContent":["import {\n\tKeyboardDoubleArrowUpRound,\n\tMinusRound,\n\tPlusRound,\n} from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport {\n\tChangeEvent,\n\tuseEffect,\n\tuseState,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n} from \"react\";\nimport \"../../css/input.css\";\nimport { clamp, formatNumber } from \"../../js/utils\";\nimport Helpericon from \"../utils/helpericon\";\nimport InputContainer from \"./container\";\nimport type { IInputNumber } from \"./type\";\n\nconst Number = (props: IInputNumber) => {\n\tconst {\n\t\tref,\n\t\tlabel,\n\t\tname,\n\t\tvalue = \"\",\n\t\tlabelInline,\n\t\tstep = 1,\n\t\tmin = -Infinity,\n\t\tmax = Infinity,\n\t\tthousand,\n\t\tprecision,\n\t\ttype,\n\t\tclassName,\n\t\twidth,\n\t\tstatus = \"normal\",\n\t\tappend,\n\t\tborder,\n\t\tunderline,\n\t\tprepend,\n\t\tdisabled,\n\t\tmessage,\n\t\ttip,\n\t\thideControl,\n\t\tshowMax,\n\t\tstyle,\n\t\tonChange,\n\t\tonEnter,\n\t\tonInput,\n\t\tonBlur,\n\t\t...restProps\n\t} = props;\n\n\tconst [inputValue, setInputValue] = useState<string>(\n\t\tvalue === undefined || value === null ? \"\" : String(value),\n\t);\n\n\tconst formatOut = (num: number) => {\n\t\tconst v = clamp(num, min, max);\n\t\tif (precision !== undefined)\n\t\t\treturn formatNumber(v, { precision, thousand });\n\t\tconst s = String(v);\n\t\tif (!thousand) return s;\n\t\tconst negative = s.startsWith(\"-\");\n\t\tconst body = negative ? s.slice(1) : s;\n\t\tconst [integer, decimal] = body.split(\".\");\n\t\tconst withThousand = integer.replace(/\\B(?=(\\d{3})+(?!\\d))/g, thousand);\n\t\treturn decimal\n\t\t\t? `${negative ? \"-\" : \"\"}${withThousand}.${decimal}`\n\t\t\t: `${negative ? \"-\" : \"\"}${withThousand}`;\n\t};\n\n\tconst sanitizeNumberInput = (raw: string) => {\n\t\tconst hasMinus = raw.startsWith(\"-\");\n\t\tlet v = raw.replace(/[^\\d.]/g, \"\");\n\t\tif (hasMinus) v = `-${v}`;\n\n\t\tconst parts = v.split(\".\");\n\t\tif (parts.length > 1) {\n\t\t\tv = `${parts.shift()}.${parts.join(\"\")}`;\n\t\t}\n\n\t\treturn v;\n\t};\n\n\tconst formatInputValue = (v?: string | number) => {\n\t\tif (!v) return \"\";\n\t\tif (typeof v === \"number\") return v.toString();\n\t\tif (!thousand) return v;\n\n\t\treturn v.split(thousand).join(\"\");\n\t};\n\n\tconst handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n\t\tconst { value } = e.target;\n\t\tconst v = sanitizeNumberInput(formatInputValue(value));\n\t\tconst isIntermediate =\n\t\t\tv === \"\" || v === \"-\" || v === \".\" || v === \"-.\" || v.endsWith(\".\");\n\n\t\tsetInputValue(v);\n\t\tif (isIntermediate) return;\n\n\t\tconst num = parseFloat(v);\n\t\tif (globalThis.Number.isNaN(num)) return;\n\n\t\tonChange?.(clamp(num, min, max), e);\n\t\tif (precision !== undefined) setInputValue(formatOut(num));\n\t};\n\n\tconst handleOperate = (param: number) => {\n\t\tconst value = parseFloat(formatInputValue(inputValue)) || 0; // 确保值为数字,默认值为 0\n\t\tconst result = value + param;\n\t\tsetInputValue(formatOut(result));\n\t\tonChange?.(clamp(result, min, max));\n\t};\n\n\tconst handleMax = () => {\n\t\tsetInputValue(formatOut(max));\n\t\tonChange?.(clamp(max, min, max));\n\t};\n\n\tconst handleBlur = (e: FocusEvent<HTMLInputElement>) => {\n\t\tonBlur?.(e);\n\n\t\tconst v = sanitizeNumberInput(formatInputValue(inputValue));\n\t\tif (!v || v === \"-\" || v === \".\" || v === \"-.\") {\n\t\t\tsetInputValue(\"\");\n\t\t\treturn;\n\t\t}\n\n\t\tconst num = parseFloat(v);\n\t\tif (globalThis.Number.isNaN(num)) return;\n\n\t\tconst numValue = clamp(num, min, max);\n\t\tsetInputValue(formatOut(numValue));\n\t\tonChange?.(numValue, e);\n\t};\n\n\tuseEffect(() => {\n\t\tsetInputValue(\n\t\t\tvalue === undefined || value === null ? \"\" : String(value),\n\t\t);\n\t}, [value]);\n\n\tconst inputProps = {\n\t\tref,\n\t\tname,\n\t\tdisabled,\n\t\tvalue: inputValue,\n\t\tclassName: \"i-input i-input-number\",\n\t\tonChange: handleChange,\n\t\tonKeyDown: (e: KeyboardEvent<HTMLInputElement>) => {\n\t\t\te.code === \"Enter\" && onEnter?.(e);\n\t\t},\n\t\tonInput,\n\t\tonBlur: handleBlur,\n\t\t...restProps,\n\t};\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>\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{!hideControl && !disabled && (\n\t\t\t\t\t<Helpericon\n\t\t\t\t\t\tactive\n\t\t\t\t\t\ticon={<MinusRound />}\n\t\t\t\t\t\tonClick={() => handleOperate(-step)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t<input {...inputProps} />\n\n\t\t\t\t{!hideControl && !disabled && (\n\t\t\t\t\t<Helpericon\n\t\t\t\t\t\tactive\n\t\t\t\t\t\ticon={<PlusRound />}\n\t\t\t\t\t\tonClick={() => handleOperate(step)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{showMax && max && !disabled && (\n\t\t\t\t\t<Helpericon\n\t\t\t\t\t\tactive\n\t\t\t\t\t\ticon={<KeyboardDoubleArrowUpRound />}\n\t\t\t\t\t\tonClick={handleMax}\n\t\t\t\t\t/>\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};\n\nexport default Number;\n"],"names":["useState","clamp","formatNumber","useEffect","_jsx","InputContainer","_jsxs","classNames","Helpericon","MinusRound","PlusRound","KeyboardDoubleArrowUpRound"],"mappings":";;;;;;;;;;;;;;;;AAmBA,MAAM,MAAM,GAAG,CAAC,KAAmB,KAAI;AACtC,IAAA,MAAM,EACL,GAAG,EACH,KAAK,EACL,IAAI,EACJ,KAAK,GAAG,EAAE,EACV,WAAW,EACX,IAAI,GAAG,CAAC,EACR,GAAG,GAAG,CAAC,QAAQ,EACf,GAAG,GAAG,QAAQ,EACd,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,SAAS,EACT,KAAK,EACL,MAAM,GAAG,QAAQ,EACjB,MAAM,EACN,MAAM,EACN,SAAS,EACT,OAAO,EACP,QAAQ,EACR,OAAO,EACP,GAAG,EACH,WAAW,EACX,OAAO,EACP,KAAK,EACL,QAAQ,EACR,OAAO,EACP,OAAO,EACP,MAA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AAO,EAE3D,CAAC,WAAW,IAAI,CAAC,QAAQ,KACzBA,cAAA,CAACI,kBAAU,EAAA,EACV,MAAM,EAAA,IAAA,EACN,IAAI,EAAEJ,cAAA,CAACK,mBAAU,KAAG,EACpB,OAAO,EAAE,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,EAAA,CAClC,CACF,EAEDL,cAAA,CAAA,OAAA,EAAA,EAAA,GAAW,UAAU,EAAA,CAAI,EAExB,CAAC,WAAW,IAAI,CAAC,QAAQ,KACzBA,cAAA,CAACI,kBAAU,EAAA,EACV,MAAM,EAAA,IAAA,EACN,IAAI,EAAEJ,cAAA,CAACM,kBAAS,EAAA,EAAA,CAAG,EACnB,OAAO,EAAE,MAAM,aAAa,CAAC,IAAI,CAAC,EAAA,CACjC,CACF,EAEA,OAAO,IAAI,GAAG,IAAI,CAAC,QAAQ,KAC3BN,cAAA,CAACI,kBAAU,EAAA,EACV,MAAM,EAAA,IAAA,EACN,IAAI,EAAEJ,cAAA,CAACO,mCAA0B,EAAA,EAAA,CAAG,EACpC,OAAO,EAAE,SAAS,EAAA,CACjB,CACF,EAEA,MAAM,IAAIP,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,gBAAgB,EAAA,QAAA,EAAE,MAAM,EAAA,CAAO,CAAA,EAAA,CACpD,EAAA,CACU;AAEnB;;;;"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var material = require('@ricons/material');
|
|
7
|
-
var classNames = require('classnames');
|
|
8
|
-
var react = require('react');
|
|
9
|
-
var utils = require('../../js/utils.js');
|
|
10
|
-
var helpericon = require('../utils/helpericon/helpericon.js');
|
|
11
|
-
var container = require('./container.js');
|
|
12
|
-
|
|
13
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
14
|
-
|
|
15
|
-
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
16
|
-
|
|
17
|
-
const Range = (props) => {
|
|
18
|
-
const { label, name, value, labelInline, min = -Infinity, max = Infinity, type, className, status = "normal", message, tip, append, prepend, step = 1, width, thousand, precision, hideControl, placeholder, border, underline, autoSwitch, onChange, onBlur, style, ...restProps } = props;
|
|
19
|
-
const [rangeValue, setRangeValue] = react.useState(value);
|
|
20
|
-
const getRangeNumber = (v) => utils.clamp(v, min, max);
|
|
21
|
-
const getFormatNumber = (v) => utils.formatNumber(v, { precision, thousand });
|
|
22
|
-
const formatInputValue = (v) => {
|
|
23
|
-
if (!v)
|
|
24
|
-
return "";
|
|
25
|
-
if (typeof v === "number" || !thousand)
|
|
26
|
-
return v;
|
|
27
|
-
return v.replaceAll(thousand, "");
|
|
28
|
-
};
|
|
29
|
-
const handleChange = (e, i) => {
|
|
30
|
-
const { value } = e.target;
|
|
31
|
-
const v = formatInputValue(value.replace(/[^\d\.-]/g, ""));
|
|
32
|
-
const range = Array.isArray(rangeValue) ? [...rangeValue] : [];
|
|
33
|
-
range[i] = v;
|
|
34
|
-
setRangeValue(range);
|
|
35
|
-
onChange?.(range, e);
|
|
36
|
-
};
|
|
37
|
-
const handleOperate = (e, param, i) => {
|
|
38
|
-
e.preventDefault();
|
|
39
|
-
e.stopPropagation();
|
|
40
|
-
const range = Array.isArray(rangeValue) ? [...rangeValue] : [];
|
|
41
|
-
const value = formatInputValue(range[i]) ?? 0;
|
|
42
|
-
const result = getRangeNumber(+value + param);
|
|
43
|
-
range[i] = getFormatNumber(result);
|
|
44
|
-
setRangeValue(range);
|
|
45
|
-
onChange?.(range, e);
|
|
46
|
-
};
|
|
47
|
-
const handleSwitch = (e) => {
|
|
48
|
-
e?.preventDefault();
|
|
49
|
-
e?.stopPropagation();
|
|
50
|
-
const range = Array.isArray(rangeValue) ? [...rangeValue] : [];
|
|
51
|
-
[range[0], range[1]] = [range[1], range[0]];
|
|
52
|
-
setRangeValue(range);
|
|
53
|
-
onChange?.(range);
|
|
54
|
-
};
|
|
55
|
-
react.useEffect(() => {
|
|
56
|
-
setRangeValue(value);
|
|
57
|
-
}, [value]);
|
|
58
|
-
const inputProps = {
|
|
59
|
-
name,
|
|
60
|
-
className: "i-input i-input-number",
|
|
61
|
-
...restProps,
|
|
62
|
-
};
|
|
63
|
-
const handleBlur = () => {
|
|
64
|
-
if (!autoSwitch)
|
|
65
|
-
return;
|
|
66
|
-
const range = Array.isArray(rangeValue) ? rangeValue : [];
|
|
67
|
-
if (range.length < 2)
|
|
68
|
-
return;
|
|
69
|
-
const [left, right] = range.map(Number);
|
|
70
|
-
if (left > right) {
|
|
71
|
-
handleSwitch();
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
return (jsxRuntime.jsx(container.default, { label: label, labelInline: labelInline, className: className, style: { width, ...style }, tip: message ?? tip, status: status, children: jsxRuntime.jsxs("div", { className: classNames__default("i-input-item", {
|
|
75
|
-
[`i-input-${status}`]: status !== "normal",
|
|
76
|
-
"i-input-borderless": !border,
|
|
77
|
-
"i-input-underline": underline,
|
|
78
|
-
}), children: [prepend && jsxRuntime.jsx("div", { className: 'i-input-prepend', children: prepend }), !hideControl && (jsxRuntime.jsx(helpericon.default, { active: true, icon: jsxRuntime.jsx(material.MinusRound, {}), onClick: (e) => handleOperate(e, -step, 0) })), jsxRuntime.jsx("input", { value: rangeValue?.[0] || "", placeholder: placeholder?.[0], ...inputProps, onBlur: handleBlur, onChange: (e) => handleChange(e, 0) }), !hideControl && (jsxRuntime.jsx(helpericon.default, { active: true, icon: jsxRuntime.jsx(material.PlusRound, {}), onClick: (e) => handleOperate(e, step, 0) })), jsxRuntime.jsx(helpericon.default, { active: true, icon: jsxRuntime.jsx(material.SyncAltRound, {}), style: { margin: 0 }, onClick: handleSwitch }), !hideControl && (jsxRuntime.jsx(helpericon.default, { active: true, icon: jsxRuntime.jsx(material.MinusRound, {}), onClick: (e) => handleOperate(e, -step, 1) })), jsxRuntime.jsx("input", { value: rangeValue?.[1] || "", placeholder: placeholder?.[1], ...inputProps, onBlur: handleBlur, onChange: (e) => handleChange(e, 1) }), !hideControl && (jsxRuntime.jsx(helpericon.default, { active: true, icon: jsxRuntime.jsx(material.PlusRound, {}), onClick: (e) => handleOperate(e, step, 1) })), append && jsxRuntime.jsx("div", { className: 'i-input-append', children: append })] }) }));
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
exports.default = Range;
|
|
82
|
-
//# sourceMappingURL=range.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"range.js","sources":["../../../../packages/components/input/range.tsx"],"sourcesContent":["import { MinusRound, PlusRound, SyncAltRound } from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport { ChangeEvent, MouseEvent, useEffect, useState } from \"react\";\nimport \"../../css/input.css\";\nimport { clamp, formatNumber } from \"../../js/utils\";\nimport Helpericon from \"../utils/helpericon\";\nimport InputContainer from \"./container\";\nimport type { IInputRange } from \"./type\";\n\nconst Range = (props: IInputRange) => {\n\tconst {\n\t\tlabel,\n\t\tname,\n\t\tvalue,\n\t\tlabelInline,\n\t\tmin = -Infinity,\n\t\tmax = Infinity,\n\t\ttype,\n\t\tclassName,\n\t\tstatus = \"normal\",\n\t\tmessage,\n\t\ttip,\n\t\tappend,\n\t\tprepend,\n\t\tstep = 1,\n\t\twidth,\n\t\tthousand,\n\t\tprecision,\n\t\thideControl,\n\t\tplaceholder,\n\t\tborder,\n\t\tunderline,\n\t\tautoSwitch,\n\t\tonChange,\n\t\tonBlur,\n\t\tstyle,\n\t\t...restProps\n\t} = props;\n\n\tconst [rangeValue, setRangeValue] = useState(value);\n\n\tconst getRangeNumber = (v: number) => clamp(v, min, max);\n\n\tconst getFormatNumber = (v: number) =>\n\t\tformatNumber(v, { precision, thousand });\n\n\tconst formatInputValue = (v?: string | number) => {\n\t\tif (!v) return \"\";\n\t\tif (typeof v === \"number\" || !thousand) return v;\n\n\t\treturn v.replaceAll(thousand, \"\");\n\t};\n\n\tconst handleChange = (e: ChangeEvent<HTMLInputElement>, i: number) => {\n\t\tconst { value } = e.target;\n\t\tconst v = formatInputValue(value.replace(/[^\\d\\.-]/g, \"\"));\n\t\tconst range = Array.isArray(rangeValue) ? [...rangeValue] : [];\n\n\t\trange[i] = v;\n\t\tsetRangeValue(range);\n\t\tonChange?.(range, e);\n\t};\n\n\tconst handleOperate = (\n\t\te: MouseEvent<Element>,\n\t\tparam: number,\n\t\ti: number\n\t) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tconst range = Array.isArray(rangeValue) ? [...rangeValue] : [];\n\t\tconst value = formatInputValue(range[i]) ?? 0;\n\t\tconst result = getRangeNumber(+value + param);\n\n\t\trange[i] = getFormatNumber(result);\n\n\t\tsetRangeValue(range);\n\t\tonChange?.(range, e);\n\t};\n\n\tconst handleSwitch = (e?: MouseEvent) => {\n\t\te?.preventDefault();\n\t\te?.stopPropagation();\n\t\tconst range = Array.isArray(rangeValue) ? [...rangeValue] : [];\n\t\t[range[0], range[1]] = [range[1], range[0]];\n\n\t\tsetRangeValue(range);\n\t\tonChange?.(range);\n\t};\n\n\tuseEffect(() => {\n\t\tsetRangeValue(value);\n\t}, [value]);\n\n\tconst inputProps = {\n\t\tname,\n\t\tclassName: \"i-input i-input-number\",\n\t\t...restProps,\n\t};\n\n\tconst handleBlur = () => {\n\t\tif (!autoSwitch) return;\n\t\tconst range = Array.isArray(rangeValue) ? rangeValue : [];\n\n\t\tif (range.length < 2) return;\n\n\t\tconst [left, right] = range.map(Number);\n\t\tif (left > right) {\n\t\t\thandleSwitch();\n\t\t}\n\t};\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>\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{!hideControl && (\n\t\t\t\t\t<Helpericon\n\t\t\t\t\t\tactive\n\t\t\t\t\t\ticon={<MinusRound />}\n\t\t\t\t\t\tonClick={(e) => handleOperate(e, -step, 0)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t<input\n\t\t\t\t\tvalue={rangeValue?.[0] || \"\"}\n\t\t\t\t\tplaceholder={placeholder?.[0]}\n\t\t\t\t\t{...inputProps}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t\tonChange={(e) => handleChange(e, 0)}\n\t\t\t\t/>\n\n\t\t\t\t{!hideControl && (\n\t\t\t\t\t<Helpericon\n\t\t\t\t\t\tactive\n\t\t\t\t\t\ticon={<PlusRound />}\n\t\t\t\t\t\tonClick={(e) => handleOperate(e, step, 0)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<Helpericon\n\t\t\t\t\tactive\n\t\t\t\t\ticon={<SyncAltRound />}\n\t\t\t\t\tstyle={{ margin: 0 }}\n\t\t\t\t\tonClick={handleSwitch}\n\t\t\t\t/>\n\t\t\t\t{!hideControl && (\n\t\t\t\t\t<Helpericon\n\t\t\t\t\t\tactive\n\t\t\t\t\t\ticon={<MinusRound />}\n\t\t\t\t\t\tonClick={(e) => handleOperate(e, -step, 1)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t<input\n\t\t\t\t\tvalue={rangeValue?.[1] || \"\"}\n\t\t\t\t\tplaceholder={placeholder?.[1]}\n\t\t\t\t\t{...inputProps}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t\tonChange={(e) => handleChange(e, 1)}\n\t\t\t\t/>\n\n\t\t\t\t{!hideControl && (\n\t\t\t\t\t<Helpericon\n\t\t\t\t\t\tactive\n\t\t\t\t\t\ticon={<PlusRound />}\n\t\t\t\t\t\tonClick={(e) => handleOperate(e, step, 1)}\n\t\t\t\t\t/>\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};\n\nexport default Range;\n"],"names":["useState","clamp","formatNumber","useEffect","_jsx","InputContainer","_jsxs","classNames","Helpericon","MinusRound","PlusRound","SyncAltRound"],"mappings":";;;;;;;;;;;;;;;;AASA,MAAM,KAAK,GAAG,CAAC,KAAkB,KAAI;AACpC,IAAA,MAAM,EACL,KAAK,EACL,IAAI,EACJ,KAAK,EACL,WAAW,EACX,GAAG,GAAG,CAAC,QAAQ,EACf,GAAG,GAAG,QAAQ,EACd,IAAI,EACJ,SAAS,EACT,MAAM,GAAG,QAAQ,EACjB,OAAO,EACP,GAAG,EACH,MAAM,EACN,OAAO,EACP,IAAI,GAAG,CAAC,EACR,KAAK,EACL,QAAQ,EACR,SAAS,EACT,WAAW,EACX,WAAW,EACX,MAAM,EACN,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,KAAK,EACL,GAAG,SAAS,EACZ,GAAG,KAAK;IAET,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAGA,cAAQ,CAAC,KAAK,CAAC;AAEnD,IAAA,MAAM,cAAc,GAAG,CAAC,CAAS,KAAKC,WAAK,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC;AAExD,IAAA,MAAM,eAAe,GAAG,CAAC,CAAS,KACjCC,kBAAY,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AAEzC,IAAA,MAAM,gBAAgB,GAAG,CAAC,CAAmB,KAAI;AAChD,QAAA,IAAI,CAAC,CAAC;AAAE,YAAA,OAAO,EAAE;AACjB,QAAA,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,QAAQ;AAA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AAM,EAAA,IAAA,EACN,IAAI,EAAEJ,cAAA,CAACK,mBAAU,EAAA,EAAA,CAAG,EACpB,OAAO,EAAE,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,EAAA,CACzC,CACF,EAEDL,cAAA,CAAA,OAAA,EAAA,EACC,KAAK,EAAE,UAAU,GAAG,CAAC,CAAC,IAAI,EAAE,EAC5B,WAAW,EAAE,WAAW,GAAG,CAAC,CAAC,EAAA,GACzB,UAAU,EACd,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,EAAA,CAClC,EAED,CAAC,WAAW,KACZA,cAAA,CAACI,kBAAU,EAAA,EACV,MAAM,EAAA,IAAA,EACN,IAAI,EAAEJ,cAAA,CAACM,kBAAS,EAAA,EAAA,CAAG,EACnB,OAAO,EAAE,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAA,CACxC,CACF,EAEA,MAAM,IAAIN,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,gBAAgB,EAAA,QAAA,EAAE,MAAM,EAAA,CAAO,CAAA,EAAA,CACpD,EAAA,CACU;AAEnB;;;;"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var classNames = require('classnames');
|
|
7
|
-
var react = require('react');
|
|
8
|
-
var container = require('./container.js');
|
|
9
|
-
|
|
10
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
11
|
-
|
|
12
|
-
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
13
|
-
|
|
14
|
-
const Textarea = (props) => {
|
|
15
|
-
const { ref, label, name, value = "", labelInline, className, status = "normal", message, tip, autoSize, border, width, style, resize, onChange, onEnter, ...restProps } = props;
|
|
16
|
-
const [textareaValue, setTextareaValue] = react.useState(value);
|
|
17
|
-
const refTextarea = react.useRef(null);
|
|
18
|
-
const syncTextareaHeight = () => {
|
|
19
|
-
const ta = refTextarea.current;
|
|
20
|
-
if (!autoSize || !ta)
|
|
21
|
-
return;
|
|
22
|
-
ta.style.height = "auto";
|
|
23
|
-
ta.style.height = `${ta.scrollHeight}px`;
|
|
24
|
-
};
|
|
25
|
-
const handleChange = (e) => {
|
|
26
|
-
const v = e.target.value;
|
|
27
|
-
setTextareaValue(v);
|
|
28
|
-
onChange?.(v, e);
|
|
29
|
-
};
|
|
30
|
-
const handleKeydown = (e) => {
|
|
31
|
-
if (e.code !== "Enter")
|
|
32
|
-
return;
|
|
33
|
-
e.stopPropagation();
|
|
34
|
-
onEnter?.(e);
|
|
35
|
-
};
|
|
36
|
-
react.useEffect(() => {
|
|
37
|
-
setTextareaValue(value);
|
|
38
|
-
}, [value]);
|
|
39
|
-
react.useEffect(() => {
|
|
40
|
-
syncTextareaHeight();
|
|
41
|
-
}, [autoSize, textareaValue]);
|
|
42
|
-
react.useImperativeHandle(ref, () => {
|
|
43
|
-
return {
|
|
44
|
-
input: refTextarea.current,
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
const inputProps = {
|
|
48
|
-
ref: refTextarea,
|
|
49
|
-
name,
|
|
50
|
-
value: textareaValue,
|
|
51
|
-
className: "i-input i-textarea",
|
|
52
|
-
style: resize === false ? { resize: "none" } : undefined,
|
|
53
|
-
onChange: handleChange,
|
|
54
|
-
onKeyDown: handleKeydown,
|
|
55
|
-
...restProps,
|
|
56
|
-
};
|
|
57
|
-
return (jsxRuntime.jsx(container.default, { label: label, labelInline: labelInline, className: classNames__default("i-textarea-label", className), style: { width, ...style }, tip: message ?? tip, status: status, children: jsxRuntime.jsx("div", { className: classNames__default("i-input-item", {
|
|
58
|
-
[`i-input-${status}`]: status !== "normal",
|
|
59
|
-
"i-input-borderless": !border,
|
|
60
|
-
}), children: jsxRuntime.jsx("textarea", { ...inputProps }) }) }));
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
exports.default = Textarea;
|
|
64
|
-
//# sourceMappingURL=textarea.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","sources":["../../../../packages/components/input/textarea.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport {\n ChangeEvent,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n type KeyboardEvent,\n} from \"react\";\nimport \"../../css/input.css\";\nimport InputContainer from \"./container\";\nimport type { ITextarea } from \"./type\";\n\nconst Textarea = (props: ITextarea) => {\n const {\n ref,\n label,\n name,\n value = \"\",\n labelInline,\n className,\n status = \"normal\",\n message,\n tip,\n autoSize,\n border,\n width,\n style,\n resize,\n onChange,\n onEnter,\n ...restProps\n } = props;\n\n const [textareaValue, setTextareaValue] = useState(value);\n const refTextarea = useRef<HTMLTextAreaElement>(null);\n\n const syncTextareaHeight = () => {\n const ta = refTextarea.current;\n if (!autoSize || !ta) return;\n\n ta.style.height = \"auto\";\n ta.style.height = `${ta.scrollHeight}px`;\n };\n\n const handleChange = (\n e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\n ) => {\n const v = e.target.value;\n\n setTextareaValue(v);\n\n onChange?.(v, e);\n };\n\n const handleKeydown = (e: KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.code !== \"Enter\") return;\n\n e.stopPropagation();\n onEnter?.(e);\n };\n\n useEffect(() => {\n setTextareaValue(value);\n }, [value]);\n\n useEffect(() => {\n syncTextareaHeight();\n }, [autoSize, textareaValue]);\n\n useImperativeHandle(ref, () => {\n return {\n input: refTextarea.current,\n };\n });\n\n const inputProps = {\n ref: refTextarea,\n name,\n value: textareaValue,\n className: \"i-input i-textarea\",\n style: resize === false ? { resize: \"none\" as const } : undefined,\n onChange: handleChange,\n onKeyDown: handleKeydown,\n ...restProps,\n };\n\n return (\n <InputContainer\n label={label}\n labelInline={labelInline}\n className={classNames(\"i-textarea-label\", className)}\n style={{ width, ...style }}\n tip={message ?? tip}\n status={status}\n >\n <div\n className={classNames(\"i-input-item\", {\n [`i-input-${status}`]: status !== \"normal\",\n \"i-input-borderless\": !border,\n })}\n >\n <textarea {...inputProps} />\n </div>\n </InputContainer>\n );\n};\n\nexport default Textarea;\n"],"names":["useState","useRef","useEffect","useImperativeHandle","_jsx","InputContainer","classNames"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,QAAQ,GAAG,CAAC,KAAgB,KAAI;AAClC,IAAA,MAAM,EACF,GAAG,EACH,KAAK,EACL,IAAI,EACJ,KAAK,GAAG,EAAE,EACV,WAAW,EACX,SAAS,EACT,MAAM,GAAG,QAAQ,EACjB,OAAO,EACP,GAAG,EACH,QAAQ,EACR,MAAM,EACN,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,EACR,OAAO,EACP,GAAG,SAAS,EACf,GAAG,KAAK;IAET,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAGA,cAAQ,CAAC,KAAK,CAAC;AACzD,IAAA,MAAM,WAAW,GAAGC,YAAM,CAAsB,IAAI,CAAC;IAErD,MAAM,kBAAkB,GAAG,MAAK;AAC5B,QAAA,MAAM,EAAE,GAAG,WAAW,CAAC,OAAO;AAC9B,QAAA,IAAI,CAAC,QAAQ,IAAI,CAAC,EAAE;YAAE;AAEtB,QAAA,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM;QACxB,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAA,EAAA,CAAI;AAC5C,IAAA,CAAC;AAED,IAAA,MAAM,YAAY,GAAG,CACjB,CAAsD,KACtD;AACA,QAAA,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK;QAExB,gBAAgB,CAAC,CAAC,CAAC;AAEnB,QAAA,QAAQ,GAAG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,gBAAA,CAAC,WAAW,MAAM,CAAA,CAAE,GAAG,MAAM,KAAK,QAAQ;gBAC1C,oBAAoB,EAAE,CAAC,MAAM;AAChC,aAAA,CAAC,YAEFF,cAAA,CAAA,UAAA,EAAA,EAAA,GAAc,UAAU,GAAI,EAAA,CAC1B,EAAA,CACO;AAEzB;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var classNames = require('classnames');
|
|
7
|
-
|
|
8
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
9
|
-
|
|
10
|
-
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
11
|
-
|
|
12
|
-
const Item = (props) => {
|
|
13
|
-
const { ref, active, type, align, disabled, label, style, border, className, children, ...restProps } = props;
|
|
14
|
-
return (jsxRuntime.jsxs("li", { ref: ref, className: classNames__default("i-list-item", className, {
|
|
15
|
-
"i-list-item-active": active,
|
|
16
|
-
"i-list-option": type === "option",
|
|
17
|
-
"i-list-item-bordered": border,
|
|
18
|
-
disabled,
|
|
19
|
-
}), style: { alignItems: align, ...style }, ...restProps, children: [label !== undefined && (jsxRuntime.jsx("span", { className: 'i-list-item-label', children: label })), children] }));
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
exports.default = Item;
|
|
23
|
-
//# sourceMappingURL=item.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sources":["../../../../packages/components/list/item.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { IListItem } from \"./type\";\n\nconst Item = (props: IListItem) => {\n\tconst {\n\t\tref,\n\t\tactive,\n\t\ttype,\n\t\talign,\n\t\tdisabled,\n\t\tlabel,\n\t\tstyle,\n\t\tborder,\n\t\tclassName,\n\t\tchildren,\n\t\t...restProps\n\t} = props;\n\n\treturn (\n\t\t<li\n\t\t\tref={ref}\n\t\t\tclassName={classNames(\"i-list-item\", className, {\n\t\t\t\t\"i-list-item-active\": active,\n\t\t\t\t\"i-list-option\": type === \"option\",\n\t\t\t\t\"i-list-item-bordered\": border,\n\t\t\t\tdisabled,\n\t\t\t})}\n\t\t\tstyle={{ alignItems: align, ...style }}\n\t\t\t{...restProps}\n\t\t>\n\t\t\t{label !== undefined && (\n\t\t\t\t<span className='i-list-item-label'>{label}</span>\n\t\t\t)}\n\t\t\t{children}\n\t\t</li>\n\t);\n};\n\nexport default Item;\n"],"names":["_jsxs","classNames","_jsx"],"mappings":";;;;;;;;;;;AAGA,MAAM,IAAI,GAAG,CAAC,KAAgB,KAAI;IACjC,MAAM,EACL,GAAG,EACH,MAAM,EACN,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,KAAK,EACL,KAAK,EACL,MAAM,EACN,SAAS,EACT,QAAQ,EACR,GAAG,SAAS,EACZ,GAAG,KAAK;AAET,IAAA,QACCA,eAAA,CAAA,IAAA,EAAA,EACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAEC,mBAAU,CAAC,aAAa,EAAE,SAAS,EAAE;AAC/C,YAAA,oBAAoB,EAAE,MAAM;YAC5B,eAAe,EAAE,IAAI,KAAK,QAAQ;AAClC,YAAA,sBAAsB,EAAE,MAAM;YAC9B,QAAQ;AACR,SAAA,CAAC,EACF,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAA,GAClC,SAAS,EAAA,QAAA,EAAA,CAEZ,KAAK,KAAK,SAAS,KACnBC,cAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,mBAAmB,EAAA,QAAA,EAAE,KAAK,EAAA,CAAQ,CAClD,EACA,QAAQ,CAAA,EAAA,CACL;AAEP;;;;"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var classNames = require('classnames');
|
|
7
|
-
var react = require('react');
|
|
8
|
-
var item = require('./item.js');
|
|
9
|
-
|
|
10
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
11
|
-
|
|
12
|
-
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
13
|
-
|
|
14
|
-
const List = react.forwardRef((props, ref) => {
|
|
15
|
-
const { label, type, border, className, children, ...restProps } = props;
|
|
16
|
-
return (jsxRuntime.jsx("ul", { ref: ref, className: classNames__default("i-list", className), ...restProps, children: react.Children.map(children, (node, i) => {
|
|
17
|
-
const renderLabel = typeof label === "function" ? label(i) : label;
|
|
18
|
-
const { type, props: nodeProps } = node;
|
|
19
|
-
if (type === item.default) {
|
|
20
|
-
return react.cloneElement(node, {
|
|
21
|
-
label: renderLabel,
|
|
22
|
-
...nodeProps,
|
|
23
|
-
type: props.type,
|
|
24
|
-
border,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return node;
|
|
28
|
-
}) }));
|
|
29
|
-
});
|
|
30
|
-
List.Item = item.default;
|
|
31
|
-
|
|
32
|
-
exports.default = List;
|
|
33
|
-
//# sourceMappingURL=list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sources":["../../../../packages/components/list/list.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { Children, cloneElement, forwardRef } from \"react\";\nimport \"./index.css\";\nimport Item from \"./item\";\nimport { IList } from \"./type\";\n\nconst List = forwardRef<HTMLUListElement, IList>((props, ref) => {\n const { label, type, border, className, children, ...restProps } = props;\n\n return (\n <ul\n ref={ref}\n className={classNames(\"i-list\", className)}\n {...restProps}\n >\n {Children.map(children, (node: any, i) => {\n const renderLabel =\n typeof label === \"function\" ? label(i) : label;\n\n const { type, props: nodeProps } = node;\n\n if (type === Item) {\n return cloneElement(node, {\n label: renderLabel,\n ...nodeProps,\n type: props.type,\n border,\n });\n }\n\n return node;\n })}\n </ul>\n );\n}) as typeof List & { Item: typeof Item };\n\nList.Item = Item;\n\nexport default List;\n"],"names":["forwardRef","_jsx","classNames","Children","Item","cloneElement"],"mappings":";;;;;;;;;;;;;AAMA,MAAM,IAAI,GAAGA,gBAAU,CAA0B,CAAC,KAAK,EAAE,GAAG,KAAI;AAC5D,IAAA,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK;AAExE,IAAA,QACIC,cAAA,CAAA,IAAA,EAAA,EACI,GAAG,EAAE,GAAG,EACR,SAAS,EAAEC,mBAAU,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAA,GACtC,SAAS,EAAA,QAAA,EAEZC,cAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,IAAS,EAAE,CAAC,KAAI;AACrC,YAAA,MAAM,WAAW,GACb,OAAO,KAAK,KAAK,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK;YAElD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI;AAEvC,YAAA,IAAI,IAAI,KAAKC,YAAI,EAAE;gBACf,OAAOC,kBAAY,CAAC,IAAI,EAAE;AACtB,oBAAA,KAAK,EAAE,WAAW;AAClB,oBAAA,GAAG,SAAS;oBACZ,IAAI,EAAE,KAAK,CAAC,IAAI;oBAChB,MAAM;AACT,iBAAA,CAAC;YACN;AAEA,YAAA,OAAO,IAAI;QACf,CAAC,CAAC,EAAA,CACD;AAEb,CAAC;AAED,IAAI,CAAC,IAAI,GAAGD,YAAI;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var classNames = require('classnames');
|
|
7
|
-
|
|
8
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
9
|
-
|
|
10
|
-
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
11
|
-
|
|
12
|
-
const Loading = (props) => {
|
|
13
|
-
const { icon, text, size, absolute, style, className, ...restProps } = props;
|
|
14
|
-
const iconSize = size != null
|
|
15
|
-
? { fontSize: typeof size === "number" ? `${size}px` : size }
|
|
16
|
-
: undefined;
|
|
17
|
-
return (jsxRuntime.jsxs("div", { className: classNames__default("i-loading-container", {
|
|
18
|
-
absolute,
|
|
19
|
-
}, className), style: {
|
|
20
|
-
...style,
|
|
21
|
-
inset: absolute ? 0 : "unset",
|
|
22
|
-
}, ...restProps, children: [icon ?? jsxRuntime.jsx("span", { className: "i-loading-icon", style: iconSize }), text] }));
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
exports.default = Loading;
|
|
26
|
-
//# 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 const { icon, text, size, absolute, style, className, ...restProps } =\n props;\n const iconSize = size != null\n ? { fontSize: typeof size === \"number\" ? `${size}px` : size }\n : undefined;\n\n return (\n <div\n className={classNames(\n \"i-loading-container\",\n {\n absolute,\n },\n className,\n )}\n style={{\n ...style,\n inset: absolute ? 0 : \"unset\",\n }}\n {...restProps}\n >\n {icon ?? <span className=\"i-loading-icon\" style={iconSize}></span>}\n\n {text}\n </div>\n );\n};\n\nexport default Loading;\n"],"names":["_jsxs","classNames","_jsx"],"mappings":";;;;;;;;;;;AAIA,MAAM,OAAO,GAAG,CAAC,KAAe,KAAI;AAChC,IAAA,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAChE,KAAK;AACT,IAAA,MAAM,QAAQ,GAAG,IAAI,IAAI;AACrB,UAAE,EAAE,QAAQ,EAAE,OAAO,IAAI,KAAK,QAAQ,GAAG,GAAG,IAAI,CAAA,EAAA,CAAI,GAAG,IAAI;UACzD,SAAS;AAEf,IAAA,QACIA,eAAA,CAAA,KAAA,EAAA,EACI,SAAS,EAAEC,mBAAU,CACjB,qBAAqB,EACrB;YACI,QAAQ;AACX,SAAA,EACD,SAAS,CACZ,EACD,KAAK,EAAE;AACH,YAAA,GAAG,KAAK;YACR,KAAK,EAAE,QAAQ,GAAG,CAAC,GAAG,OAAO;AAChC,SAAA,EAAA,GACG,SAAS,EAAA,QAAA,EAAA,CAEZ,IAAI,IAAIC,cAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,gBAAgB,EAAC,KAAK,EAAE,QAAQ,EAAA,CAAS,EAEjE,IAAI,CAAA,EAAA,CACH;AAEd;;;;"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var message = require('./message.js');
|
|
6
|
-
|
|
7
|
-
const Message = Object.assign(message.default, { Container: message.MessageContainer });
|
|
8
|
-
|
|
9
|
-
exports.MessageContainer = message.MessageContainer;
|
|
10
|
-
exports.default = Message;
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../packages/components/message/index.tsx"],"sourcesContent":["import message, { MessageContainer } from \"./message\";\n\nconst Message = Object.assign(message, { Container: MessageContainer });\n\nexport { MessageContainer };\nexport default Message;\n"],"names":["message","MessageContainer"],"mappings":";;;;;;AAEA,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAACA,eAAO,EAAE,EAAE,SAAS,EAAEC,wBAAgB,EAAE;;;;;"}
|