@ioca/react 1.4.75 → 1.4.77
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 -3
- package/lib/es/components/affix/affix.js +60 -59
- package/lib/es/components/affix/affix.js.map +1 -1
- package/lib/es/components/affix/index.js +6 -5
- package/lib/es/components/affix/index.js.map +1 -1
- package/lib/es/components/affix/totop.js +20 -10
- package/lib/es/components/affix/totop.js.map +1 -1
- package/lib/es/components/badge/badge.js +19 -10
- package/lib/es/components/badge/badge.js.map +1 -1
- package/lib/es/components/badge/index.js +6 -5
- package/lib/es/components/badge/index.js.map +1 -1
- package/lib/es/components/button/button.js +55 -57
- package/lib/es/components/button/button.js.map +1 -1
- package/lib/es/components/button/confirm.js +52 -47
- package/lib/es/components/button/confirm.js.map +1 -1
- package/lib/es/components/button/group.js +21 -18
- package/lib/es/components/button/group.js.map +1 -1
- package/lib/es/components/button/index.js +6 -5
- package/lib/es/components/button/index.js.map +1 -1
- package/lib/es/components/button/toggle.js +41 -36
- package/lib/es/components/button/toggle.js.map +1 -1
- package/lib/es/components/card/card.js +28 -10
- package/lib/es/components/card/card.js.map +1 -1
- package/lib/es/components/card/index.js +6 -5
- package/lib/es/components/card/index.js.map +1 -1
- package/lib/es/components/checkbox/checkbox.js +60 -35
- package/lib/es/components/checkbox/checkbox.js.map +1 -1
- package/lib/es/components/checkbox/index.js +6 -5
- package/lib/es/components/checkbox/index.js.map +1 -1
- package/lib/es/components/checkbox/item.js +54 -32
- package/lib/es/components/checkbox/item.js.map +1 -1
- package/lib/es/components/collapse/collapse.js +78 -68
- package/lib/es/components/collapse/collapse.js.map +1 -1
- package/lib/es/components/collapse/index.js +6 -5
- package/lib/es/components/collapse/index.js.map +1 -1
- package/lib/es/components/collapse/item.js +6 -5
- package/lib/es/components/collapse/item.js.map +1 -1
- package/lib/es/components/datagrid/cell.js +32 -20
- package/lib/es/components/datagrid/cell.js.map +1 -1
- package/lib/es/components/datagrid/datagrid.js +135 -110
- package/lib/es/components/datagrid/datagrid.js.map +1 -1
- package/lib/es/components/datagrid/index.js +6 -5
- package/lib/es/components/datagrid/index.js.map +1 -1
- package/lib/es/components/datagrid/resize.js +38 -37
- package/lib/es/components/datagrid/resize.js.map +1 -1
- package/lib/es/components/datagrid/row.js +60 -27
- package/lib/es/components/datagrid/row.js.map +1 -1
- package/lib/es/components/datagrid/sorter.js +23 -10
- package/lib/es/components/datagrid/sorter.js.map +1 -1
- package/lib/es/components/description/description.js +38 -25
- package/lib/es/components/description/description.js.map +1 -1
- package/lib/es/components/description/index.js +6 -5
- package/lib/es/components/description/index.js.map +1 -1
- package/lib/es/components/drawer/drawer.js +79 -63
- package/lib/es/components/drawer/drawer.js.map +1 -1
- package/lib/es/components/drawer/index.js +6 -5
- package/lib/es/components/drawer/index.js.map +1 -1
- package/lib/es/components/dropdown/dropdown.js +33 -25
- package/lib/es/components/dropdown/dropdown.js.map +1 -1
- package/lib/es/components/dropdown/index.js +6 -5
- package/lib/es/components/dropdown/index.js.map +1 -1
- package/lib/es/components/dropdown/item.js +32 -15
- package/lib/es/components/dropdown/item.js.map +1 -1
- package/lib/es/components/editor/controls.js +75 -75
- package/lib/es/components/editor/controls.js.map +1 -1
- package/lib/es/components/editor/editor.js +85 -77
- package/lib/es/components/editor/editor.js.map +1 -1
- package/lib/es/components/editor/index.js +6 -5
- package/lib/es/components/editor/index.js.map +1 -1
- package/lib/es/components/flex/flex.js +26 -25
- package/lib/es/components/flex/flex.js.map +1 -1
- package/lib/es/components/flex/index.js +6 -5
- package/lib/es/components/flex/index.js.map +1 -1
- package/lib/es/components/form/context.js +5 -4
- package/lib/es/components/form/context.js.map +1 -1
- package/lib/es/components/form/field.js +66 -66
- package/lib/es/components/form/field.js.map +1 -1
- package/lib/es/components/form/form.js +55 -53
- package/lib/es/components/form/form.js.map +1 -1
- package/lib/es/components/form/index.js +6 -5
- package/lib/es/components/form/index.js.map +1 -1
- package/lib/es/components/form/useConfig.js +41 -31
- package/lib/es/components/form/useConfig.js.map +1 -1
- package/lib/es/components/form/useForm.js +118 -130
- package/lib/es/components/form/useForm.js.map +1 -1
- package/lib/es/components/icon/icon.js +19 -20
- package/lib/es/components/icon/icon.js.map +1 -1
- package/lib/es/components/icon/index.js +6 -5
- package/lib/es/components/icon/index.js.map +1 -1
- package/lib/es/components/image/image.js +80 -75
- package/lib/es/components/image/image.js.map +1 -1
- package/lib/es/components/image/index.js +6 -5
- package/lib/es/components/image/index.js.map +1 -1
- package/lib/es/components/image/list.js +45 -40
- package/lib/es/components/image/list.js.map +1 -1
- package/lib/es/components/input/container.js +25 -11
- package/lib/es/components/input/container.js.map +1 -1
- package/lib/es/components/input/index.js +6 -5
- package/lib/es/components/input/index.js.map +1 -1
- package/lib/es/components/input/input.js +105 -69
- package/lib/es/components/input/input.js.map +1 -1
- package/lib/es/components/input/number.js +133 -106
- package/lib/es/components/input/number.js.map +1 -1
- package/lib/es/components/input/range.js +129 -70
- package/lib/es/components/input/range.js.map +1 -1
- package/lib/es/components/input/textarea.js +56 -46
- package/lib/es/components/input/textarea.js.map +1 -1
- package/lib/es/components/list/index.js +6 -5
- package/lib/es/components/list/index.js.map +1 -1
- package/lib/es/components/list/item.js +25 -12
- package/lib/es/components/list/item.js.map +1 -1
- package/lib/es/components/list/list.js +24 -21
- package/lib/es/components/list/list.js.map +1 -1
- package/lib/es/components/loading/index.js +6 -5
- package/lib/es/components/loading/index.js.map +1 -1
- package/lib/es/components/loading/loading.js +34 -14
- package/lib/es/components/loading/loading.js.map +1 -1
- package/lib/es/components/message/index.js +6 -5
- package/lib/es/components/message/index.js.map +1 -1
- package/lib/es/components/message/message.js +161 -154
- package/lib/es/components/message/message.js.map +1 -1
- package/lib/es/components/modal/content.js +53 -30
- package/lib/es/components/modal/content.js.map +1 -1
- package/lib/es/components/modal/context.js +5 -4
- package/lib/es/components/modal/context.js.map +1 -1
- package/lib/es/components/modal/hookModal.js +24 -24
- package/lib/es/components/modal/hookModal.js.map +1 -1
- package/lib/es/components/modal/index.js +6 -5
- package/lib/es/components/modal/index.js.map +1 -1
- package/lib/es/components/modal/modal.js +111 -87
- package/lib/es/components/modal/modal.js.map +1 -1
- package/lib/es/components/modal/useModal.js +35 -31
- package/lib/es/components/modal/useModal.js.map +1 -1
- package/lib/es/components/pagination/index.js +6 -5
- package/lib/es/components/pagination/index.js.map +1 -1
- package/lib/es/components/pagination/page.js +26 -21
- package/lib/es/components/pagination/page.js.map +1 -1
- package/lib/es/components/pagination/pagination.js +81 -41
- package/lib/es/components/pagination/pagination.js.map +1 -1
- package/lib/es/components/picker/colors/footer.js +57 -29
- package/lib/es/components/picker/colors/footer.js.map +1 -1
- package/lib/es/components/picker/colors/handle.js +20 -7
- package/lib/es/components/picker/colors/handle.js.map +1 -1
- package/lib/es/components/picker/colors/index.js +76 -56
- package/lib/es/components/picker/colors/index.js.map +1 -1
- package/lib/es/components/picker/dates/dates.js +62 -43
- package/lib/es/components/picker/dates/dates.js.map +1 -1
- package/lib/es/components/picker/dates/index.js +88 -54
- package/lib/es/components/picker/dates/index.js.map +1 -1
- package/lib/es/components/picker/dates/panel.js +143 -66
- package/lib/es/components/picker/dates/panel.js.map +1 -1
- package/lib/es/components/picker/time/index.js +67 -38
- package/lib/es/components/picker/time/index.js.map +1 -1
- package/lib/es/components/picker/time/item.js +15 -12
- package/lib/es/components/picker/time/item.js.map +1 -1
- package/lib/es/components/picker/time/panel.js +138 -95
- package/lib/es/components/picker/time/panel.js.map +1 -1
- package/lib/es/components/popconfirm/index.js +6 -5
- package/lib/es/components/popconfirm/index.js.map +1 -1
- package/lib/es/components/popconfirm/popconfirm.js +80 -48
- package/lib/es/components/popconfirm/popconfirm.js.map +1 -1
- package/lib/es/components/popup/content.js +53 -46
- package/lib/es/components/popup/content.js.map +1 -1
- package/lib/es/components/popup/index.js +6 -5
- package/lib/es/components/popup/index.js.map +1 -1
- package/lib/es/components/popup/popup.js +421 -227
- package/lib/es/components/popup/popup.js.map +1 -1
- package/lib/es/components/progress/circle.js +41 -9
- package/lib/es/components/progress/circle.js.map +1 -1
- package/lib/es/components/progress/index.js +6 -5
- package/lib/es/components/progress/index.js.map +1 -1
- package/lib/es/components/progress/line.js +22 -11
- package/lib/es/components/progress/line.js.map +1 -1
- package/lib/es/components/progress/progress.js +95 -79
- package/lib/es/components/progress/progress.js.map +1 -1
- package/lib/es/components/radio/index.js +6 -5
- package/lib/es/components/radio/index.js.map +1 -1
- package/lib/es/components/radio/item.js +29 -14
- package/lib/es/components/radio/item.js.map +1 -1
- package/lib/es/components/radio/radio.js +56 -28
- package/lib/es/components/radio/radio.js.map +1 -1
- package/lib/es/components/resizable/index.js +6 -5
- package/lib/es/components/resizable/index.js.map +1 -1
- package/lib/es/components/resizable/resizable.js +76 -57
- package/lib/es/components/resizable/resizable.js.map +1 -1
- package/lib/es/components/river/index.js +6 -5
- package/lib/es/components/river/index.js.map +1 -1
- package/lib/es/components/river/river.js +111 -103
- package/lib/es/components/river/river.js.map +1 -1
- package/lib/es/components/select/index.js +6 -5
- package/lib/es/components/select/index.js.map +1 -1
- package/lib/es/components/select/options.js +66 -40
- package/lib/es/components/select/options.js.map +1 -1
- package/lib/es/components/select/select.js +150 -92
- package/lib/es/components/select/select.js.map +1 -1
- package/lib/es/components/step/divider.js +6 -5
- package/lib/es/components/step/divider.js.map +1 -1
- package/lib/es/components/step/index.js +6 -5
- package/lib/es/components/step/index.js.map +1 -1
- package/lib/es/components/step/item.js +53 -17
- package/lib/es/components/step/item.js.map +1 -1
- package/lib/es/components/step/step.js +36 -32
- package/lib/es/components/step/step.js.map +1 -1
- package/lib/es/components/swiper/index.js +6 -5
- package/lib/es/components/swiper/index.js.map +1 -1
- package/lib/es/components/swiper/item.js +34 -22
- package/lib/es/components/swiper/item.js.map +1 -1
- package/lib/es/components/swiper/swiper.js +256 -229
- package/lib/es/components/swiper/swiper.js.map +1 -1
- package/lib/es/components/tabs/index.js +6 -5
- package/lib/es/components/tabs/index.js.map +1 -1
- package/lib/es/components/tabs/item.js +6 -5
- package/lib/es/components/tabs/item.js.map +1 -1
- package/lib/es/components/tabs/tabs.js +266 -216
- package/lib/es/components/tabs/tabs.js.map +1 -1
- package/lib/es/components/tag/index.js +6 -5
- package/lib/es/components/tag/index.js.map +1 -1
- package/lib/es/components/tag/tag.js +27 -15
- package/lib/es/components/tag/tag.js.map +1 -1
- package/lib/es/components/text/highlight.js +31 -25
- package/lib/es/components/text/highlight.js.map +1 -1
- package/lib/es/components/text/index.js +6 -5
- package/lib/es/components/text/index.js.map +1 -1
- package/lib/es/components/text/number.js +28 -24
- package/lib/es/components/text/number.js.map +1 -1
- package/lib/es/components/text/text.js +31 -28
- package/lib/es/components/text/text.js.map +1 -1
- package/lib/es/components/text/time.js +20 -17
- package/lib/es/components/text/time.js.map +1 -1
- package/lib/es/components/tree/index.js +6 -5
- package/lib/es/components/tree/index.js.map +1 -1
- package/lib/es/components/tree/item.js +127 -66
- package/lib/es/components/tree/item.js.map +1 -1
- package/lib/es/components/tree/tree.js +121 -125
- package/lib/es/components/tree/tree.js.map +1 -1
- package/lib/es/components/upload/index.js +6 -5
- package/lib/es/components/upload/index.js.map +1 -1
- package/lib/es/components/upload/renderFile.js +91 -55
- package/lib/es/components/upload/renderFile.js.map +1 -1
- package/lib/es/components/upload/upload.js +160 -115
- package/lib/es/components/upload/upload.js.map +1 -1
- package/lib/es/components/utils/empty/index.js +12 -8
- package/lib/es/components/utils/empty/index.js.map +1 -1
- package/lib/es/components/utils/helpericon/helpericon.js +19 -21
- package/lib/es/components/utils/helpericon/helpericon.js.map +1 -1
- package/lib/es/components/utils/helpericon/index.js +6 -5
- package/lib/es/components/utils/helpericon/index.js.map +1 -1
- package/lib/es/components/video/index.js +6 -5
- package/lib/es/components/video/index.js.map +1 -1
- package/lib/es/components/video/video.js +232 -170
- package/lib/es/components/video/video.js.map +1 -1
- package/lib/es/index.js +42 -42
- package/lib/es/js/hooks.js +227 -274
- package/lib/es/js/hooks.js.map +1 -1
- package/lib/es/js/usePreview/content.js +192 -153
- package/lib/es/js/usePreview/content.js.map +1 -1
- package/lib/es/js/usePreview/index.js +35 -20
- package/lib/es/js/usePreview/index.js.map +1 -1
- package/lib/es/js/usePreview/renderFile.js +24 -17
- package/lib/es/js/usePreview/renderFile.js.map +1 -1
- package/lib/es/js/usePreview/type.js +14 -12
- package/lib/es/js/usePreview/type.js.map +1 -1
- package/lib/es/js/useRipple/index.js +30 -32
- package/lib/es/js/useRipple/index.js.map +1 -1
- package/lib/es/js/useTheme/index.js +26 -30
- package/lib/es/js/useTheme/index.js.map +1 -1
- package/lib/es/js/utils.js +238 -255
- package/lib/es/js/utils.js.map +1 -1
- package/lib/types/components/affix/affix.d.ts +4 -7
- package/lib/types/components/affix/affix.js +63 -0
- package/lib/types/components/affix/index.d.ts +2 -5
- package/lib/types/components/affix/index.js +5 -0
- package/lib/types/components/affix/totop.d.ts +3 -6
- package/lib/types/components/affix/totop.js +21 -0
- package/lib/types/components/affix/type.d.ts +1 -4
- package/lib/types/components/area/area.d.ts +3 -0
- package/lib/types/components/area/index.d.ts +2 -0
- package/lib/types/components/area/item.d.ts +3 -0
- package/lib/types/components/area/type.d.ts +12 -0
- package/lib/types/components/badge/badge.d.ts +3 -6
- package/lib/types/components/badge/badge.js +21 -0
- package/lib/types/components/badge/index.d.ts +2 -5
- package/lib/types/components/badge/index.js +5 -0
- package/lib/types/components/badge/type.d.ts +2 -5
- package/lib/types/components/button/button.d.ts +2 -4
- package/lib/types/components/button/button.js +61 -0
- package/lib/types/components/button/confirm.d.ts +2 -6
- package/lib/types/components/button/confirm.js +57 -0
- package/lib/types/components/button/group.d.ts +2 -6
- package/lib/types/components/button/group.js +22 -0
- package/lib/types/components/button/index.d.ts +2 -5
- package/lib/types/components/button/index.js +5 -0
- package/lib/types/components/button/toggle.d.ts +2 -6
- package/lib/types/components/button/toggle.js +42 -0
- package/lib/types/components/button/type.d.ts +10 -12
- package/lib/types/components/card/card.d.ts +3 -6
- package/lib/types/components/card/card.js +30 -0
- package/lib/types/components/card/index.d.ts +2 -5
- package/lib/types/components/card/index.js +5 -0
- package/lib/types/components/card/type.d.ts +2 -5
- package/lib/types/components/checkbox/checkbox.d.ts +4 -7
- package/lib/types/components/checkbox/checkbox.js +64 -0
- package/lib/types/components/checkbox/index.d.ts +2 -5
- package/lib/types/components/checkbox/index.js +5 -0
- package/lib/types/components/checkbox/item.d.ts +2 -6
- package/lib/types/components/checkbox/item.js +55 -0
- package/lib/types/components/checkbox/type.d.ts +5 -7
- package/lib/types/components/collapse/collapse.d.ts +4 -7
- package/lib/types/components/collapse/collapse.js +81 -0
- package/lib/types/components/collapse/index.d.ts +2 -5
- package/lib/types/components/collapse/index.js +5 -0
- package/lib/types/components/collapse/item.d.ts +2 -6
- package/lib/types/components/collapse/item.js +7 -0
- package/lib/types/components/collapse/type.d.ts +4 -7
- package/lib/types/components/datagrid/cell.d.ts +13 -0
- package/lib/types/components/datagrid/cell.js +34 -0
- package/lib/types/components/datagrid/datagrid.d.ts +3 -6
- package/lib/types/components/datagrid/datagrid.js +137 -0
- package/lib/types/components/datagrid/index.d.ts +2 -5
- package/lib/types/components/datagrid/index.js +5 -0
- package/lib/types/components/datagrid/resize.d.ts +1 -0
- package/lib/types/components/datagrid/resize.js +39 -0
- package/lib/types/components/datagrid/row.d.ts +3 -0
- package/lib/types/components/datagrid/row.js +63 -0
- package/lib/types/components/datagrid/sorter.d.ts +1 -0
- package/lib/types/components/datagrid/sorter.js +24 -0
- package/lib/types/components/datagrid/type.d.ts +28 -7
- package/lib/types/components/description/description.d.ts +3 -6
- package/lib/types/components/description/description.js +40 -0
- package/lib/types/components/description/index.d.ts +2 -5
- package/lib/types/components/description/index.js +5 -0
- package/lib/types/components/description/type.d.ts +3 -5
- package/lib/types/components/drawer/drawer.d.ts +2 -4
- package/lib/types/components/drawer/drawer.js +81 -0
- package/lib/types/components/drawer/index.d.ts +2 -5
- package/lib/types/components/drawer/index.js +5 -0
- package/lib/types/components/drawer/type.d.ts +1 -4
- package/lib/types/components/drawer/useDrawer.d.ts +0 -0
- package/lib/types/components/dropdown/dropdown.d.ts +4 -8
- package/lib/types/components/dropdown/dropdown.js +36 -0
- package/lib/types/components/dropdown/index.d.ts +2 -5
- package/lib/types/components/dropdown/index.js +5 -0
- package/lib/types/components/dropdown/item.d.ts +3 -0
- package/lib/types/components/dropdown/item.js +33 -0
- package/lib/types/components/dropdown/type.d.ts +4 -7
- package/lib/types/components/editor/controls.d.ts +5 -0
- package/lib/types/components/editor/controls.js +83 -0
- package/lib/types/components/editor/editor.d.ts +3 -6
- package/lib/types/components/editor/editor.js +87 -0
- package/lib/types/components/editor/index.d.ts +2 -5
- package/lib/types/components/editor/index.js +5 -0
- package/lib/types/components/editor/type.d.ts +3 -6
- package/lib/types/components/flex/flex.d.ts +2 -4
- package/lib/types/components/flex/flex.js +28 -0
- package/lib/types/components/flex/index.d.ts +2 -5
- package/lib/types/components/flex/index.js +5 -0
- package/lib/types/components/flex/type.d.ts +1 -4
- package/lib/types/components/form/context.d.ts +3 -0
- package/lib/types/components/form/context.js +5 -0
- package/lib/types/components/form/field.d.ts +3 -6
- package/lib/types/components/form/field.js +67 -0
- package/lib/types/components/form/form.d.ts +6 -9
- package/lib/types/components/form/form.js +60 -0
- package/lib/types/components/form/index.d.ts +2 -5
- package/lib/types/components/form/index.js +5 -0
- package/lib/types/components/form/type.d.ts +6 -9
- package/lib/types/components/form/useConfig.d.ts +4 -9
- package/lib/types/components/form/useConfig.js +42 -0
- package/lib/types/components/form/useForm.d.ts +3 -6
- package/lib/types/components/form/useForm.js +119 -0
- package/lib/types/components/icon/icon.d.ts +3 -6
- package/lib/types/components/icon/icon.js +21 -0
- package/lib/types/components/icon/index.d.ts +2 -5
- package/lib/types/components/icon/index.js +5 -0
- package/lib/types/components/icon/type.d.ts +2 -5
- package/lib/types/components/image/image.d.ts +2 -4
- package/lib/types/components/image/image.js +83 -0
- package/lib/types/components/image/index.d.ts +2 -5
- package/lib/types/components/image/index.js +5 -0
- package/lib/types/components/image/list.d.ts +2 -6
- package/lib/types/components/image/list.js +46 -0
- package/lib/types/components/image/type.d.ts +5 -8
- package/lib/types/components/input/container.d.ts +2 -0
- package/lib/types/components/input/container.js +26 -0
- package/lib/types/components/input/index.d.ts +2 -5
- package/lib/types/components/input/index.js +5 -0
- package/lib/types/components/input/input.d.ts +2 -4
- package/lib/types/components/input/input.js +110 -0
- package/lib/types/components/input/number.d.ts +3 -6
- package/lib/types/components/input/number.js +135 -0
- package/lib/types/components/input/range.d.ts +3 -6
- package/lib/types/components/input/range.js +131 -0
- package/lib/types/components/input/textarea.d.ts +3 -6
- package/lib/types/components/input/textarea.js +58 -0
- package/lib/types/components/input/type.d.ts +22 -14
- package/lib/types/components/list/index.d.ts +2 -5
- package/lib/types/components/list/index.js +5 -0
- package/lib/types/components/list/item.d.ts +3 -0
- package/lib/types/components/list/item.js +26 -0
- package/lib/types/components/list/list.d.ts +4 -7
- package/lib/types/components/list/list.js +27 -0
- package/lib/types/components/list/type.d.ts +2 -5
- package/lib/types/components/loading/index.d.ts +2 -5
- package/lib/types/components/loading/index.js +5 -0
- package/lib/types/components/loading/loading.d.ts +3 -6
- package/lib/types/components/loading/loading.js +36 -0
- package/lib/types/components/loading/type.d.ts +1 -4
- package/lib/types/components/message/index.d.ts +2 -5
- package/lib/types/components/message/index.js +5 -0
- package/lib/types/components/message/message.d.ts +3 -4
- package/lib/types/components/message/message.js +194 -0
- package/lib/types/components/message/type.d.ts +13 -5
- package/lib/types/components/modal/content.d.ts +2 -0
- package/lib/types/components/modal/content.js +55 -0
- package/lib/types/components/modal/context.d.ts +2 -0
- package/lib/types/components/modal/context.js +5 -0
- package/lib/types/components/modal/hookModal.d.ts +6 -0
- package/lib/types/components/modal/hookModal.js +25 -0
- package/lib/types/components/modal/index.d.ts +2 -5
- package/lib/types/components/modal/index.js +5 -0
- package/lib/types/components/modal/modal.d.ts +2 -4
- package/lib/types/components/modal/modal.js +114 -0
- package/lib/types/components/modal/type.d.ts +11 -8
- package/lib/types/components/modal/useModal.d.ts +2 -5
- package/lib/types/components/modal/useModal.js +36 -0
- package/lib/types/components/pagination/index.d.ts +2 -5
- package/lib/types/components/pagination/index.js +5 -0
- package/lib/types/components/pagination/page.d.ts +3 -0
- package/lib/types/components/pagination/page.js +27 -0
- package/lib/types/components/pagination/pagination.d.ts +3 -6
- package/lib/types/components/pagination/pagination.js +83 -0
- package/lib/types/components/pagination/type.d.ts +6 -4
- package/lib/types/components/picker/colors/footer.d.ts +6 -0
- package/lib/types/components/picker/colors/footer.js +60 -0
- package/lib/types/components/picker/colors/handle.d.ts +2 -0
- package/lib/types/components/picker/colors/handle.js +21 -0
- package/lib/types/components/picker/colors/index.d.ts +2 -6
- package/lib/types/components/picker/colors/index.js +78 -0
- package/lib/types/components/picker/dates/dates.d.ts +5 -0
- package/lib/types/components/picker/dates/dates.js +63 -0
- package/lib/types/components/picker/dates/index.d.ts +3 -6
- package/lib/types/components/picker/dates/index.js +92 -0
- package/lib/types/components/picker/dates/panel.d.ts +3 -0
- package/lib/types/components/picker/dates/panel.js +146 -0
- package/lib/types/components/picker/index.d.ts +10 -0
- package/lib/types/components/picker/time/index.d.ts +2 -6
- package/lib/types/components/picker/time/index.js +69 -0
- package/lib/types/components/picker/time/item.d.ts +1 -0
- package/lib/types/components/picker/time/item.js +16 -0
- package/lib/types/components/picker/time/panel.d.ts +1 -0
- package/lib/types/components/picker/time/panel.js +142 -0
- package/lib/types/components/picker/type.d.ts +7 -10
- package/lib/types/components/popconfirm/index.d.ts +2 -5
- package/lib/types/components/popconfirm/index.js +5 -0
- package/lib/types/components/popconfirm/popconfirm.d.ts +3 -6
- package/lib/types/components/popconfirm/popconfirm.js +84 -0
- package/lib/types/components/popconfirm/type.d.ts +3 -6
- package/lib/types/components/popup/content.d.ts +3 -0
- package/lib/types/components/popup/content.js +52 -0
- package/lib/types/components/popup/index.d.ts +2 -5
- package/lib/types/components/popup/index.js +5 -0
- package/lib/types/components/popup/popup.d.ts +2 -6
- package/lib/types/components/popup/popup.js +423 -0
- package/lib/types/components/popup/type.d.ts +7 -10
- package/lib/types/components/progress/circle.d.ts +2 -0
- package/lib/types/components/progress/circle.js +42 -0
- package/lib/types/components/progress/index.d.ts +2 -5
- package/lib/types/components/progress/index.js +5 -0
- package/lib/types/components/progress/line.d.ts +9 -0
- package/lib/types/components/progress/line.js +23 -0
- package/lib/types/components/progress/progress.d.ts +3 -6
- package/lib/types/components/progress/progress.js +98 -0
- package/lib/types/components/progress/type.d.ts +2 -5
- package/lib/types/components/radio/index.d.ts +2 -5
- package/lib/types/components/radio/index.js +5 -0
- package/lib/types/components/radio/item.d.ts +2 -6
- package/lib/types/components/radio/item.js +30 -0
- package/lib/types/components/radio/radio.d.ts +4 -7
- package/lib/types/components/radio/radio.js +60 -0
- package/lib/types/components/radio/type.d.ts +5 -7
- package/lib/types/components/resizable/index.d.ts +2 -5
- package/lib/types/components/resizable/index.js +5 -0
- package/lib/types/components/resizable/resizable.d.ts +3 -6
- package/lib/types/components/resizable/resizable.js +78 -0
- package/lib/types/components/resizable/type.d.ts +2 -5
- package/lib/types/components/river/index.d.ts +2 -5
- package/lib/types/components/river/index.js +5 -0
- package/lib/types/components/river/river.d.ts +3 -6
- package/lib/types/components/river/river.js +113 -0
- package/lib/types/components/river/type.d.ts +1 -4
- package/lib/types/components/select/index.d.ts +2 -5
- package/lib/types/components/select/index.js +5 -0
- package/lib/types/components/select/options.d.ts +5 -0
- package/lib/types/components/select/options.js +71 -0
- package/lib/types/components/select/select.d.ts +3 -6
- package/lib/types/components/select/select.js +153 -0
- package/lib/types/components/select/type.d.ts +9 -7
- package/lib/types/components/step/divider.d.ts +1 -0
- package/lib/types/components/step/divider.js +8 -0
- package/lib/types/components/step/index.d.ts +2 -5
- package/lib/types/components/step/index.js +5 -0
- package/lib/types/components/step/item.d.ts +3 -6
- package/lib/types/components/step/item.js +56 -0
- package/lib/types/components/step/step.d.ts +4 -7
- package/lib/types/components/step/step.js +39 -0
- package/lib/types/components/step/type.d.ts +2 -5
- package/lib/types/components/swiper/index.d.ts +2 -5
- package/lib/types/components/swiper/index.js +5 -0
- package/lib/types/components/swiper/item.d.ts +3 -6
- package/lib/types/components/swiper/item.js +35 -0
- package/lib/types/components/swiper/swiper.d.ts +2 -4
- package/lib/types/components/swiper/swiper.js +259 -0
- package/lib/types/components/swiper/type.d.ts +6 -9
- package/lib/types/components/tabs/index.d.ts +2 -5
- package/lib/types/components/tabs/index.js +5 -0
- package/lib/types/components/tabs/item.d.ts +3 -6
- package/lib/types/components/tabs/item.js +7 -0
- package/lib/types/components/tabs/tabs.d.ts +2 -4
- package/lib/types/components/tabs/tabs.js +269 -0
- package/lib/types/components/tabs/type.d.ts +8 -10
- package/lib/types/components/tag/index.d.ts +2 -5
- package/lib/types/components/tag/index.js +5 -0
- package/lib/types/components/tag/tag.d.ts +3 -6
- package/lib/types/components/tag/tag.js +29 -0
- package/lib/types/components/tag/type.d.ts +1 -4
- package/lib/types/components/text/highlight.d.ts +2 -6
- package/lib/types/components/text/highlight.js +32 -0
- package/lib/types/components/text/index.d.ts +2 -5
- package/lib/types/components/text/index.js +5 -0
- package/lib/types/components/text/number.d.ts +2 -6
- package/lib/types/components/text/number.js +29 -0
- package/lib/types/components/text/text.d.ts +2 -4
- package/lib/types/components/text/text.js +36 -0
- package/lib/types/components/text/time.d.ts +2 -6
- package/lib/types/components/text/time.js +21 -0
- package/lib/types/components/text/type.d.ts +10 -13
- package/lib/types/components/tree/index.d.ts +2 -5
- package/lib/types/components/tree/index.js +5 -0
- package/lib/types/components/tree/item.d.ts +11 -0
- package/lib/types/components/tree/item.js +132 -0
- package/lib/types/components/tree/tree.d.ts +3 -6
- package/lib/types/components/tree/tree.js +125 -0
- package/lib/types/components/tree/type.d.ts +19 -7
- package/lib/types/components/upload/index.d.ts +2 -5
- package/lib/types/components/upload/index.js +5 -0
- package/lib/types/components/upload/renderFile.d.ts +7 -0
- package/lib/types/components/upload/renderFile.js +94 -0
- package/lib/types/components/upload/type.d.ts +13 -9
- package/lib/types/components/upload/upload.d.ts +3 -6
- package/lib/types/components/upload/upload.js +162 -0
- package/lib/types/components/utils/empty/index.d.ts +1 -0
- package/lib/types/components/utils/empty/index.js +14 -0
- package/lib/types/components/utils/helpericon/helpericon.d.ts +3 -0
- package/lib/types/components/utils/helpericon/helpericon.js +21 -0
- package/lib/types/components/utils/helpericon/index.d.ts +2 -0
- package/lib/types/components/utils/helpericon/index.js +5 -0
- package/lib/types/components/utils/helpericon/type.d.ts +11 -0
- package/lib/types/components/video/index.d.ts +2 -5
- package/lib/types/components/video/index.js +5 -0
- package/lib/types/components/video/type.d.ts +3 -6
- package/lib/types/components/video/video.d.ts +3 -6
- package/lib/types/components/video/video.js +234 -0
- package/lib/types/index.d.ts +40 -41
- package/lib/types/index.js +43 -0
- package/lib/types/js/hooks.d.ts +36 -0
- package/lib/types/js/hooks.js +249 -0
- package/lib/types/js/usePreview/content.d.ts +2 -0
- package/lib/types/js/usePreview/content.js +193 -0
- package/lib/types/js/usePreview/index.d.ts +2 -5
- package/lib/types/js/usePreview/index.js +37 -0
- package/lib/types/js/usePreview/renderFile.d.ts +2 -0
- package/lib/types/js/usePreview/renderFile.js +25 -0
- package/lib/types/js/usePreview/type.d.ts +13 -7
- package/lib/types/js/usePreview/type.js +13 -0
- package/lib/types/js/useRipple/index.d.ts +2 -0
- package/lib/types/js/useRipple/index.js +44 -0
- package/lib/types/js/useTheme/index.d.ts +2 -4
- package/lib/types/js/useTheme/index.js +27 -0
- package/lib/types/js/useTheme/type.d.ts +5 -3
- package/lib/types/js/utils.d.ts +36 -0
- package/lib/types/js/utils.js +267 -0
- package/lib/types/type/index.d.ts +16 -10
- package/package.json +8 -16
- package/lib/cjs/components/affix/affix.js +0 -71
- 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 -31
- package/lib/cjs/components/datagrid/cell.js.map +0 -1
- package/lib/cjs/components/datagrid/datagrid.js +0 -121
- package/lib/cjs/components/datagrid/datagrid.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 -44
- package/lib/cjs/components/datagrid/resize.js.map +0 -1
- package/lib/cjs/components/datagrid/row.js +0 -41
- 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/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 -74
- 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 -33
- 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 -22
- package/lib/cjs/components/dropdown/item.js.map +0 -1
- package/lib/cjs/components/editor/controls.js +0 -95
- package/lib/cjs/components/editor/controls.js.map +0 -1
- package/lib/cjs/components/editor/editor.js +0 -89
- 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/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 -77
- package/lib/cjs/components/form/field.js.map +0 -1
- package/lib/cjs/components/form/form.js +0 -68
- 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 -142
- package/lib/cjs/components/form/useForm.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 -87
- 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 -83
- package/lib/cjs/components/input/input.js.map +0 -1
- package/lib/cjs/components/input/number.js +0 -117
- package/lib/cjs/components/input/number.js.map +0 -1
- package/lib/cjs/components/input/range.js +0 -81
- package/lib/cjs/components/input/range.js.map +0 -1
- package/lib/cjs/components/input/textarea.js +0 -57
- 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 -25
- package/lib/cjs/components/loading/loading.js.map +0 -1
- package/lib/cjs/components/message/index.js +0 -10
- package/lib/cjs/components/message/index.js.map +0 -1
- package/lib/cjs/components/message/message.js +0 -196
- package/lib/cjs/components/message/message.js.map +0 -1
- package/lib/cjs/components/modal/content.js +0 -37
- 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 -99
- package/lib/cjs/components/modal/modal.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 -67
- package/lib/cjs/components/picker/colors/index.js.map +0 -1
- package/lib/cjs/components/picker/dates/dates.js +0 -55
- package/lib/cjs/components/picker/dates/dates.js.map +0 -1
- package/lib/cjs/components/picker/dates/index.js +0 -69
- package/lib/cjs/components/picker/dates/index.js.map +0 -1
- package/lib/cjs/components/picker/dates/panel.js +0 -80
- package/lib/cjs/components/picker/dates/panel.js.map +0 -1
- package/lib/cjs/components/picker/time/index.js +0 -50
- 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 -57
- package/lib/cjs/components/popconfirm/popconfirm.js.map +0 -1
- package/lib/cjs/components/popup/content.js +0 -55
- 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 -234
- 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/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/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/tabs.js +0 -228
- 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/index.js +0 -10
- package/lib/cjs/components/upload/index.js.map +0 -1
- package/lib/cjs/components/upload/renderFile.js +0 -69
- package/lib/cjs/components/upload/renderFile.js.map +0 -1
- package/lib/cjs/components/upload/upload.js +0 -126
- 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 -88
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/js/hooks.js +0 -308
- 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 -37
- 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/index.css.map +0 -1
- package/lib/es/index.js.map +0 -1
- package/lib/index.js +0 -4922
|
@@ -1,39 +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 react = require('react');
|
|
8
|
-
var button = require('../../button/button.js');
|
|
9
|
-
var icon = require('../../icon/icon.js');
|
|
10
|
-
var input = require('../../input/input.js');
|
|
11
|
-
var select = require('../../select/select.js');
|
|
12
|
-
|
|
13
|
-
const ColorMethods = {
|
|
14
|
-
HEX: "toHexString",
|
|
15
|
-
RGB: "toRgbString",
|
|
16
|
-
HSB: "toHsbString",
|
|
17
|
-
};
|
|
18
|
-
function Footer(props) {
|
|
19
|
-
const { value, type, onTypeChange, onChange, onOk } = props;
|
|
20
|
-
const [inputValue, setInputValue] = react.useState(value);
|
|
21
|
-
const [colorType, setColorType] = react.useState(type);
|
|
22
|
-
const handleChange = (v) => {
|
|
23
|
-
setInputValue(v);
|
|
24
|
-
onChange(v);
|
|
25
|
-
};
|
|
26
|
-
const handleTypeChange = (t) => {
|
|
27
|
-
setColorType(t);
|
|
28
|
-
onTypeChange(t);
|
|
29
|
-
};
|
|
30
|
-
react.useEffect(() => {
|
|
31
|
-
setInputValue(value);
|
|
32
|
-
setColorType(type);
|
|
33
|
-
}, [value, type]);
|
|
34
|
-
return (jsxRuntime.jsxs("div", { className: 'i-colorpicker-footer', children: [jsxRuntime.jsx(select.default, { readOnly: true, hideClear: true, hideArrow: true, style: { width: "5.6em" }, options: ["RGB", "HEX", "HSB"], value: colorType, onChange: handleTypeChange }), jsxRuntime.jsx(input.default, { placeholder: 'color', value: inputValue, onChange: handleChange }), jsxRuntime.jsx(button.default, { square: true, onClick: onOk, children: jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.CheckRound, {}) }) })] }));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
exports.ColorMethods = ColorMethods;
|
|
38
|
-
exports.default = Footer;
|
|
39
|
-
//# sourceMappingURL=footer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"footer.js","sources":["../../../../../packages/components/picker/colors/footer.tsx"],"sourcesContent":["import { CheckRound } from \"@ricons/material\";\nimport { useEffect, useState } from \"react\";\nimport Button from \"../../button\";\nimport Icon from \"../../icon\";\nimport Input from \"../../input\";\nimport Select from \"../../select\";\n\nexport const ColorMethods = {\n\tHEX: \"toHexString\",\n\tRGB: \"toRgbString\",\n\tHSB: \"toHsbString\",\n};\n\nexport default function Footer(props) {\n\tconst { value, type, onTypeChange, onChange, onOk } = props;\n\tconst [inputValue, setInputValue] = useState(value);\n\tconst [colorType, setColorType] = useState(type);\n\n\tconst handleChange = (v) => {\n\t\tsetInputValue(v);\n\t\tonChange(v);\n\t};\n\n\tconst handleTypeChange = (t) => {\n\t\tsetColorType(t);\n\t\tonTypeChange(t);\n\t};\n\n\tuseEffect(() => {\n\t\tsetInputValue(value);\n\t\tsetColorType(type);\n\t}, [value, type]);\n\n\treturn (\n\t\t<div className='i-colorpicker-footer'>\n\t\t\t<Select\n\t\t\t\treadOnly\n\t\t\t\thideClear\n\t\t\t\thideArrow\n\t\t\t\tstyle={{ width: \"5.6em\" }}\n\t\t\t\toptions={[\"RGB\", \"HEX\", \"HSB\"]}\n\t\t\t\tvalue={colorType}\n\t\t\t\tonChange={handleTypeChange}\n\t\t\t/>\n\t\t\t<Input\n\t\t\t\tplaceholder='color'\n\t\t\t\tvalue={inputValue}\n\t\t\t\tonChange={handleChange}\n\t\t\t/>\n\t\t\t<Button square onClick={onOk}>\n\t\t\t\t<Icon icon={<CheckRound />} />\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n"],"names":["useState","useEffect","_jsxs","_jsx","Select","Input","Button","Icon","CheckRound"],"mappings":";;;;;;;;;;;;AAOO,MAAM,YAAY,GAAG;AAC3B,IAAA,GAAG,EAAE,aAAa;AAClB,IAAA,GAAG,EAAE,aAAa;AAClB,IAAA,GAAG,EAAE,aAAa;;AAGL,SAAU,MAAM,CAAC,KAAK,EAAA;AACnC,IAAA,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,KAAK;IAC3D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAGA,cAAQ,CAAC,KAAK,CAAC;IACnD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAGA,cAAQ,CAAC,IAAI,CAAC;AAEhD,IAAA,MAAM,YAAY,GAAG,CAAC,CAAC,KAAI;QAC1B,aAAa,CAAC,CAAC,CAAC;QAChB,QAAQ,CAAC,CAAC,CAAC;AACZ,IAAA,CAAC;AAED,IAAA,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAI;QAC9B,YAAY,CAAC,CAAC,CAAC;QACf,YAAY,CAAC,CAAC,CAAC;AAChB,IAAA,CAAC;IAEDC,eAAS,CAAC,MAAK;QACd,aAAa,CAAC,KAAK,CAAC;QACpB,YAAY,CAAC,IAAI,CAAC;AACnB,IAAA,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAEjB,IAAA,QACCC,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,sBAAsB,aACpCC,cAAA,CAACC,cAAM,EAAA,EACN,QAAQ,QACR,SAAS,EAAA,IAAA,EACT,SAAS,EAAA,IAAA,EACT,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EACzB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAC9B,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,gBAAgB,EAAA,CACzB,EACFD,cAAA,CAACE,aAAK,EAAA,EACL,WAAW,EAAC,OAAO,EACnB,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,YAAY,EAAA,CACrB,EACFF,cAAA,CAACG,cAAM,EAAA,EAAC,MAAM,QAAC,OAAO,EAAE,IAAI,EAAA,QAAA,EAC3BH,eAACI,YAAI,EAAA,EAAC,IAAI,EAAEJ,eAACK,mBAAU,EAAA,EAAA,CAAG,GAAI,EAAA,CACtB,CAAA,EAAA,CACJ;AAER;;;;;"}
|
|
@@ -1,18 +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 Handle = (props) => {
|
|
13
|
-
const { ref, color, handle, placeholder, className, ...restProps } = props;
|
|
14
|
-
return (jsxRuntime.jsxs("div", { ref: ref, className: classNames__default("i-colorpicker-handle", className), ...restProps, children: [handle !== "text" && (jsxRuntime.jsx("i", { className: 'i-colorpicker-square', style: { background: color } })), handle !== "square" && (jsxRuntime.jsx("span", { className: 'i-colorpicker-text', style: { color }, children: color ?? placeholder }))] }));
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
exports.default = Handle;
|
|
18
|
-
//# sourceMappingURL=handle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handle.js","sources":["../../../../../packages/components/picker/colors/handle.tsx"],"sourcesContent":["import classNames from \"classnames\";\n\nconst Handle = (props) => {\n\tconst { ref, color, handle, placeholder, className, ...restProps } = props;\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={classNames(\"i-colorpicker-handle\", className)}\n\t\t\t{...restProps}\n\t\t>\n\t\t\t{handle !== \"text\" && (\n\t\t\t\t<i\n\t\t\t\t\tclassName='i-colorpicker-square'\n\t\t\t\t\tstyle={{ background: color }}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{handle !== \"square\" && (\n\t\t\t\t<span className='i-colorpicker-text' style={{ color }}>\n\t\t\t\t\t{color ?? placeholder}\n\t\t\t\t</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport default Handle;\n"],"names":["_jsxs","classNames","_jsx"],"mappings":";;;;;;;;;;;AAEA,MAAM,MAAM,GAAG,CAAC,KAAK,KAAI;AACxB,IAAA,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK;AAE1E,IAAA,QACCA,eAAA,CAAA,KAAA,EAAA,EACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAEC,mBAAU,CAAC,sBAAsB,EAAE,SAAS,CAAC,EAAA,GACpD,SAAS,EAAA,QAAA,EAAA,CAEZ,MAAM,KAAK,MAAM,KACjBC,cAAA,CAAA,GAAA,EAAA,EACC,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,EAAA,CAC3B,CACF,EAEA,MAAM,KAAK,QAAQ,KACnBA,cAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,oBAAoB,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAA,QAAA,EACnD,KAAK,IAAI,WAAW,EAAA,CACf,CACP,CAAA,EAAA,CACI;AAER;;;;"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var ColorsPanel = require('@rc-component/color-picker');
|
|
7
|
-
var react = require('react');
|
|
8
|
-
var popup = require('../../popup/popup.js');
|
|
9
|
-
var footer = require('./footer.js');
|
|
10
|
-
var handle = require('./handle.js');
|
|
11
|
-
|
|
12
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
13
|
-
|
|
14
|
-
var ColorsPanel__default = /*#__PURE__*/_interopDefaultCompat(ColorsPanel);
|
|
15
|
-
|
|
16
|
-
function ColorPicker(props) {
|
|
17
|
-
const { value, type = "HEX", disabledAlpha, children, usePanel, handle: handle$1 = "both", placeholder = "Colors", popupProps, onChange, } = props;
|
|
18
|
-
const [colorType, setColorType] = react.useState(type);
|
|
19
|
-
const [colorValue, setColorValue] = react.useState(value);
|
|
20
|
-
const [syncValue, setSyncValue] = react.useState(value);
|
|
21
|
-
const [visible, setVisible] = react.useState(popupProps?.visible);
|
|
22
|
-
const handleChange = (target) => {
|
|
23
|
-
setSyncValue(target);
|
|
24
|
-
};
|
|
25
|
-
const handleComplete = (target) => {
|
|
26
|
-
const method = footer.ColorMethods[colorType];
|
|
27
|
-
if (target.a !== 1) {
|
|
28
|
-
target.a = parseFloat(target.a.toFixed(3));
|
|
29
|
-
}
|
|
30
|
-
setColorValue(target[method]?.());
|
|
31
|
-
};
|
|
32
|
-
const handleVisibleChange = (v) => {
|
|
33
|
-
setVisible(v);
|
|
34
|
-
popupProps?.onVisibleChange?.(v);
|
|
35
|
-
};
|
|
36
|
-
const handleTypeChange = (t) => {
|
|
37
|
-
const method = footer.ColorMethods[t];
|
|
38
|
-
setColorType(t);
|
|
39
|
-
setColorValue(syncValue?.[method]?.());
|
|
40
|
-
};
|
|
41
|
-
const handleValueChange = (v) => {
|
|
42
|
-
setColorValue(v);
|
|
43
|
-
setSyncValue(v);
|
|
44
|
-
};
|
|
45
|
-
const handleOk = () => {
|
|
46
|
-
onChange?.(colorValue);
|
|
47
|
-
setVisible(false);
|
|
48
|
-
};
|
|
49
|
-
react.useEffect(() => {
|
|
50
|
-
setSyncValue(value);
|
|
51
|
-
setColorValue(value);
|
|
52
|
-
}, [value]);
|
|
53
|
-
react.useEffect(() => {
|
|
54
|
-
if (popupProps?.visible !== undefined) {
|
|
55
|
-
setVisible(popupProps.visible);
|
|
56
|
-
}
|
|
57
|
-
}, [popupProps?.visible]);
|
|
58
|
-
if (usePanel) {
|
|
59
|
-
return jsxRuntime.jsx(ColorsPanel__default, { ...props });
|
|
60
|
-
}
|
|
61
|
-
return (jsxRuntime.jsx(popup.default, { trigger: 'click', touchable: true, position: 'bottom', ...popupProps, visible: visible, content: jsxRuntime.jsx(ColorsPanel__default, { value: syncValue, disabledAlpha: disabledAlpha, panelRender: (panel) => {
|
|
62
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [panel, jsxRuntime.jsx(footer.default, { value: colorValue, type: colorType, onTypeChange: handleTypeChange, onChange: handleValueChange, onOk: handleOk })] }));
|
|
63
|
-
}, onChange: handleChange, onChangeComplete: handleComplete }), onVisibleChange: handleVisibleChange, children: children ?? (jsxRuntime.jsx(handle.default, { color: value, handle: handle$1, placeholder: placeholder })) }));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
exports.default = ColorPicker;
|
|
67
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../packages/components/picker/colors/index.tsx"],"sourcesContent":["import ColorsPanel from \"@rc-component/color-picker\";\nimport { useEffect, useState } from \"react\";\nimport Popup from \"../../popup\";\nimport { IColorPicker } from \"../type\";\nimport Footer, { ColorMethods } from \"./footer\";\nimport Handle from \"./handle\";\nimport \"./index.css\";\n\nexport default function ColorPicker(props: IColorPicker) {\n\tconst {\n\t\tvalue,\n\t\ttype = \"HEX\",\n\t\tdisabledAlpha,\n\t\tchildren,\n\t\tusePanel,\n\t\thandle = \"both\",\n\t\tplaceholder = \"Colors\",\n\t\tpopupProps,\n\t\tonChange,\n\t} = props;\n\n\tconst [colorType, setColorType] = useState(type);\n\tconst [colorValue, setColorValue] = useState(value);\n\tconst [syncValue, setSyncValue] = useState(value);\n\tconst [visible, setVisible] = useState<boolean | undefined>(popupProps?.visible);\n\n\tconst handleChange = (target) => {\n\t\tsetSyncValue(target);\n\t};\n\n\tconst handleComplete = (target) => {\n\t\tconst method = ColorMethods[colorType];\n\n\t\tif (target.a !== 1) {\n\t\t\ttarget.a = parseFloat(target.a.toFixed(3));\n\t\t}\n\n\t\tsetColorValue(target[method]?.());\n\t};\n\n\tconst handleVisibleChange = (v: boolean) => {\n\t\tsetVisible(v);\n\t\tpopupProps?.onVisibleChange?.(v);\n\t};\n\n\tconst handleTypeChange = (t) => {\n\t\tconst method = ColorMethods[t];\n\n\t\tsetColorType(t);\n\t\tsetColorValue(syncValue?.[method]?.());\n\t};\n\n\tconst handleValueChange = (v) => {\n\t\tsetColorValue(v);\n\t\tsetSyncValue(v);\n\t};\n\n\tconst handleOk = () => {\n\t\tonChange?.(colorValue);\n\t\tsetVisible(false);\n\t};\n\n\tuseEffect(() => {\n\t\tsetSyncValue(value);\n\t\tsetColorValue(value);\n\t}, [value]);\n\n\tuseEffect(() => {\n\t\tif (popupProps?.visible !== undefined) {\n\t\t\tsetVisible(popupProps.visible);\n\t\t}\n\t}, [popupProps?.visible]);\n\n\tif (usePanel) {\n\t\treturn <ColorsPanel {...props} />;\n\t}\n\n\treturn (\n\t\t<Popup\n\t\t\ttrigger='click'\n\t\t\ttouchable\n\t\t\tposition='bottom'\n\t\t\t{...popupProps}\n\t\t\tvisible={visible}\n\t\t\tcontent={\n\t\t\t\t<ColorsPanel\n\t\t\t\t\tvalue={syncValue}\n\t\t\t\t\tdisabledAlpha={disabledAlpha}\n\t\t\t\t\tpanelRender={(panel) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{panel}\n\t\t\t\t\t\t\t\t<Footer\n\t\t\t\t\t\t\t\t\tvalue={colorValue}\n\t\t\t\t\t\t\t\t\ttype={colorType}\n\t\t\t\t\t\t\t\t\tonTypeChange={handleTypeChange}\n\t\t\t\t\t\t\t\t\tonChange={handleValueChange}\n\t\t\t\t\t\t\t\t\tonOk={handleOk}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t);\n\t\t\t\t\t}}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tonChangeComplete={handleComplete}\n\t\t\t\t/>\n\t\t\t}\n\t\t\tonVisibleChange={handleVisibleChange}\n\t\t>\n\t\t\t{children ?? (\n\t\t\t\t<Handle\n\t\t\t\t\tcolor={value}\n\t\t\t\t\thandle={handle}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</Popup>\n\t);\n}\n"],"names":["handle","useState","ColorMethods","useEffect","_jsx","ColorsPanel","Popup","_jsxs","_Fragment","Footer","Handle"],"mapp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9B,QAAQ,EAAE,iBAAiB,EAC3B,IAAI,EAAE,QAAQ,EAAA,CACb,CAAA,EAAA,CACA;AAEL,YAAA,CAAC,EACD,QAAQ,EAAE,YAAY,EACtB,gBAAgB,EAAE,cAAc,EAAA,CAC/B,EAEH,eAAe,EAAE,mBAAmB,EAAA,QAAA,EAEnC,QAAQ,KACRL,cAAA,CAACM,cAAM,IACN,KAAK,EAAE,KAAK,EACZ,MAAM,EAAEV,QAAM,EACd,WAAW,EAAE,WAAW,EAAA,CACvB,CACF,EAAA,CACM;AAEV;;;;"}
|
|
@@ -1,55 +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 dayjs = require('dayjs');
|
|
8
|
-
var react = require('react');
|
|
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
|
-
var dayjs__default = /*#__PURE__*/_interopDefaultCompat(dayjs);
|
|
14
|
-
|
|
15
|
-
const Dates = (props) => {
|
|
16
|
-
const { value, month, weeks = ["一", "二", "三", "四", "五", "六", "日"], renderDate = (date) => date.date(), disabledDate, onDateClick, } = props;
|
|
17
|
-
const today = dayjs__default();
|
|
18
|
-
const dates = react.useMemo(() => {
|
|
19
|
-
const dates = [];
|
|
20
|
-
const lastDateOfLastMonth = month.add(-1, "month").endOf("month");
|
|
21
|
-
let { $W, $D } = lastDateOfLastMonth;
|
|
22
|
-
if ($W !== 0) {
|
|
23
|
-
const lastMonthDates = Array.from({ length: $W }).map((whatever, i) => lastDateOfLastMonth.add(i + 1 - $W, "day"));
|
|
24
|
-
dates.push(...lastMonthDates);
|
|
25
|
-
}
|
|
26
|
-
const lastDate = month.endOf("month");
|
|
27
|
-
$D = lastDate.$D;
|
|
28
|
-
$W = lastDate.$W;
|
|
29
|
-
dates.push(...Array.from({ length: $D }).map((whatever, i) => lastDate.add(i + 1 - $D, "day")));
|
|
30
|
-
if ($W !== 0) {
|
|
31
|
-
dates.push(...Array.from({ length: 7 - $W }).map((whatever, i) => lastDate.add(i + 1, "day")));
|
|
32
|
-
}
|
|
33
|
-
return dates;
|
|
34
|
-
}, [month]);
|
|
35
|
-
const handleDateClick = (date) => {
|
|
36
|
-
if (disabledDate?.(date))
|
|
37
|
-
return;
|
|
38
|
-
onDateClick?.(date);
|
|
39
|
-
};
|
|
40
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: 'i-datepicker-weeks', children: weeks.map((week, i) => (jsxRuntime.jsx("span", { className: 'i-datepicker-week', children: week }, i))) }), jsxRuntime.jsx("div", { className: 'i-datepicker-dates', children: dates.map((date, i) => {
|
|
41
|
-
const active = date.isSame(value, "day");
|
|
42
|
-
const isSameMonth = date.isSame(month, "month");
|
|
43
|
-
const isToday = date.isSame(today, "day");
|
|
44
|
-
const disabled = disabledDate?.(date);
|
|
45
|
-
return (jsxRuntime.jsx("div", { className: classNames__default("i-datepicker-item", {
|
|
46
|
-
"i-datepicker-active": active,
|
|
47
|
-
"i-datepicker-same-month": isSameMonth,
|
|
48
|
-
"i-datepicker-today": isToday,
|
|
49
|
-
"i-datepicker-disabled": disabled,
|
|
50
|
-
}), onClick: () => handleDateClick(date), children: renderDate(date) }, i));
|
|
51
|
-
}) })] }));
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
exports.default = Dates;
|
|
55
|
-
//# sourceMappingURL=dates.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dates.js","sources":["../../../../../packages/components/picker/dates/dates.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport dayjs, { Dayjs } from \"dayjs\";\nimport { ReactNode, useMemo } from \"react\";\nimport { IBaseDates } from \"../type\";\n\nconst Dates = (\n\tprops: IBaseDates & {\n\t\tmonth: any;\n\t}\n) => {\n\tconst {\n\t\tvalue,\n\t\tmonth,\n\t\tweeks = [\"一\", \"二\", \"三\", \"四\", \"五\", \"六\", \"日\"],\n\t\trenderDate = (date: Dayjs) => date.date(),\n\t\tdisabledDate,\n\t\tonDateClick,\n\t} = props;\n\tconst today = dayjs();\n\n\tconst dates = useMemo(() => {\n\t\tconst dates: Dayjs[] = [];\n\n\t\tconst lastDateOfLastMonth = month.add(-1, \"month\").endOf(\"month\");\n\t\tlet { $W, $D } = lastDateOfLastMonth;\n\n\t\tif ($W !== 0) {\n\t\t\tconst lastMonthDates = Array.from({ length: $W }).map(\n\t\t\t\t(whatever, i) => lastDateOfLastMonth.add(i + 1 - $W, \"day\")\n\t\t\t);\n\t\t\tdates.push(...lastMonthDates);\n\t\t}\n\n\t\tconst lastDate = month.endOf(\"month\");\n\t\t$D = lastDate.$D;\n\t\t$W = lastDate.$W;\n\t\tdates.push(\n\t\t\t...Array.from({ length: $D }).map((whatever, i) =>\n\t\t\t\tlastDate.add(i + 1 - $D, \"day\")\n\t\t\t)\n\t\t);\n\n\t\tif ($W !== 0) {\n\t\t\tdates.push(\n\t\t\t\t...Array.from({ length: 7 - $W }).map((whatever, i) =>\n\t\t\t\t\tlastDate.add(i + 1, \"day\")\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\treturn dates;\n\t}, [month]);\n\n\tconst handleDateClick = (date: Dayjs) => {\n\t\tif (disabledDate?.(date)) return;\n\n\t\tonDateClick?.(date);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<div className='i-datepicker-weeks'>\n\t\t\t\t{weeks.map((week: ReactNode, i: number) => (\n\t\t\t\t\t<span key={i} className='i-datepicker-week'>\n\t\t\t\t\t\t{week}\n\t\t\t\t\t</span>\n\t\t\t\t))}\n\t\t\t</div>\n\t\t\t<div className='i-datepicker-dates'>\n\t\t\t\t{dates.map((date, i: number) => {\n\t\t\t\t\tconst active = date.isSame(value, \"day\");\n\t\t\t\t\tconst isSameMonth = date.isSame(month, \"month\");\n\t\t\t\t\tconst isToday = date.isSame(today, \"day\");\n\t\t\t\t\tconst disabled = disabledDate?.(date);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\t\tclassName={classNames(\"i-datepicker-item\", {\n\t\t\t\t\t\t\t\t\"i-datepicker-active\": active,\n\t\t\t\t\t\t\t\t\"i-datepicker-same-month\": isSameMonth,\n\t\t\t\t\t\t\t\t\"i-datepicker-today\": isToday,\n\t\t\t\t\t\t\t\t\"i-datepicker-disabled\": disabled,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tonClick={() => handleDateClick(date)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{renderDate(date)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default Dates;\n"],"names":["dayjs","useMemo","_jsxs","_jsx","classNames"],"mappings":";;;;;;;;;;;;;;AAKA,MAAM,KAAK,GAAG,CACb,KAEC,KACE;AACH,IAAA,MAAM,EACL,KAAK,EACL,KAAK,EACL,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAC3C,UAAU,GAAG,CAAC,IAAW,KAAK,IAAI,CAAC,IAAI,EAAE,EACzC,YAAY,EACZ,WAAW,GACX,GAAG,KAAK;AACT,IAAA,MAAM,KAAK,GAAGA,cAAK,EAAE;AAErB,IAAA,MAAM,KAAK,GAAGC,aAAO,CAAC,MAAK;QAC1B,MAAM,KAAK,GAAY,EAAE;AAEzB,QAAA,MAAM,mBAAmB,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;AACjE,QAAA,IA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');
|
|
6
|
-
var material = require('@ricons/material');
|
|
7
|
-
var classNames = require('classnames');
|
|
8
|
-
var dayjs = require('dayjs');
|
|
9
|
-
var customParseFormat = require('dayjs/plugin/customParseFormat.js');
|
|
10
|
-
var react = require('react');
|
|
11
|
-
var icon = require('../../icon/icon.js');
|
|
12
|
-
var input = require('../../input/input.js');
|
|
13
|
-
var popup = require('../../popup/popup.js');
|
|
14
|
-
var panel = require('./panel.js');
|
|
15
|
-
|
|
16
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
17
|
-
|
|
18
|
-
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
19
|
-
var dayjs__default = /*#__PURE__*/_interopDefaultCompat(dayjs);
|
|
20
|
-
var customParseFormat__default = /*#__PURE__*/_interopDefaultCompat(customParseFormat);
|
|
21
|
-
|
|
22
|
-
dayjs__default.extend(customParseFormat__default);
|
|
23
|
-
const FORMATTYPES = ["YYYY-MM-DD", "YYYY-M-D", "YYYY/MM/DD", "YYYY/M/D"];
|
|
24
|
-
const FORMAT = "YYYY-MM-DD";
|
|
25
|
-
const Datepicker = (props) => {
|
|
26
|
-
const { name, value, weeks, format = FORMAT, placeholder = props.format ?? FORMAT, className, renderDate, renderMonth, renderYear, popupProps, disabledDate, onDateClick, onChange, onBlur, ...restProps } = props;
|
|
27
|
-
const [inputValue, setInputValue] = react.useState(value);
|
|
28
|
-
const [active, setActive] = react.useState(false);
|
|
29
|
-
const dayJsValue = react.useMemo(() => {
|
|
30
|
-
if (!inputValue)
|
|
31
|
-
return null;
|
|
32
|
-
const date = dayjs__default(inputValue, format, true);
|
|
33
|
-
if (date.isValid())
|
|
34
|
-
return date;
|
|
35
|
-
return null;
|
|
36
|
-
}, [inputValue, format]);
|
|
37
|
-
const handleDateClick = (date) => {
|
|
38
|
-
handleChange(date.format(format));
|
|
39
|
-
};
|
|
40
|
-
const handleChange = (v) => {
|
|
41
|
-
setInputValue(v);
|
|
42
|
-
onChange?.(v);
|
|
43
|
-
};
|
|
44
|
-
const handleSetDate = () => {
|
|
45
|
-
if (!inputValue)
|
|
46
|
-
return;
|
|
47
|
-
const date = dayjs__default(inputValue, FORMATTYPES, true);
|
|
48
|
-
if (date.isValid()) {
|
|
49
|
-
handleChange(date.format(format));
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
handleChange("");
|
|
53
|
-
};
|
|
54
|
-
const handleBlur = (e) => {
|
|
55
|
-
onBlur?.(e);
|
|
56
|
-
handleSetDate();
|
|
57
|
-
};
|
|
58
|
-
const handleVisibleChange = (v) => {
|
|
59
|
-
popupProps?.onVisibleChange?.(v);
|
|
60
|
-
setActive(v);
|
|
61
|
-
};
|
|
62
|
-
react.useEffect(() => {
|
|
63
|
-
setInputValue(value);
|
|
64
|
-
}, [value]);
|
|
65
|
-
return (jsxRuntime.jsx(popup.default, { visible: active, trigger: 'click', position: 'bottom', arrow: false, align: 'start', onVisibleChange: handleVisibleChange, watchResize: true, content: jsxRuntime.jsx(panel.default, { value: dayJsValue, weeks: weeks, renderDate: renderDate, renderMonth: renderMonth, renderYear: renderYear, disabledDate: disabledDate, onDateClick: handleDateClick }), ...popupProps, children: jsxRuntime.jsx(input.default, { value: inputValue, append: jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.CalendarMonthTwotone, {}), className: 'i-datepicker-icon', size: '1em' }), placeholder: placeholder, onChange: handleChange, onBlur: handleBlur, onEnter: handleSetDate, className: classNames__default("i-datepicker-label", className), ...restProps }) }));
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
exports.default = Datepicker;
|
|
69
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../packages/components/picker/dates/index.tsx"],"sourcesContent":["import { CalendarMonthTwotone } from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport dayjs, { Dayjs } from \"dayjs\";\nimport customParseFormat from \"dayjs/plugin/customParseFormat.js\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport Icon from \"../../icon\";\nimport Input from \"../../input\";\nimport Popup from \"../../popup\";\nimport { IDatePicker } from \"../type\";\nimport \"./index.css\";\nimport Panel from \"./panel\";\n\ndayjs.extend(customParseFormat);\n\nconst FORMATTYPES = [\"YYYY-MM-DD\", \"YYYY-M-D\", \"YYYY/MM/DD\", \"YYYY/M/D\"];\nconst FORMAT = \"YYYY-MM-DD\";\n\nconst Datepicker = (props: IDatePicker) => {\n\tconst {\n\t\tname,\n\t\tvalue,\n\t\tweeks,\n\t\tformat = FORMAT,\n\t\tplaceholder = props.format ?? FORMAT,\n\t\tclassName,\n\t\trenderDate,\n\t\trenderMonth,\n\t\trenderYear,\n\t\tpopupProps,\n\t\tdisabledDate,\n\t\tonDateClick,\n\t\tonChange,\n\t\tonBlur,\n\t\t...restProps\n\t} = props;\n\n\tconst [inputValue, setInputValue] = useState(value);\n\n\tconst [active, setActive] = useState<boolean>(false);\n\n\tconst dayJsValue = useMemo(() => {\n\t\tif (!inputValue) return null;\n\n\t\tconst date = dayjs(inputValue as string, format, true);\n\n\t\tif (date.isValid()) return date;\n\n\t\treturn null;\n\t}, [inputValue, format]);\n\n\tconst handleDateClick = (date: Dayjs) => {\n\t\thandleChange(date.format(format));\n\t};\n\n\tconst handleChange = (v) => {\n\t\tsetInputValue(v);\n\t\tonChange?.(v);\n\t};\n\n\tconst handleSetDate = () => {\n\t\tif (!inputValue) return;\n\n\t\tconst date = dayjs(inputValue as string, FORMATTYPES, true);\n\n\t\tif (date.isValid()) {\n\t\t\thandleChange(date.format(format));\n\t\t\treturn;\n\t\t}\n\n\t\thandleChange(\"\");\n\t};\n\n\tconst handleBlur = (e) => {\n\t\tonBlur?.(e);\n\t\thandleSetDate();\n\t};\n\n\tconst handleVisibleChange = (v) => {\n\t\tpopupProps?.onVisibleChange?.(v);\n\t\tsetActive(v);\n\t};\n\n\tuseEffect(() => {\n\t\tsetInputValue(value);\n\t}, [value]);\n\n\treturn (\n\t\t<Popup\n\t\t\tvisible={active}\n\t\t\ttrigger='click'\n\t\t\tposition='bottom'\n\t\t\tarrow={false}\n\t\t\talign='start'\n\t\t\tonVisibleChange={handleVisibleChange}\n\t\t\twatchResize\n\t\t\tcontent={\n\t\t\t\t<Panel\n\t\t\t\t\tvalue={dayJsValue}\n\t\t\t\t\tweeks={weeks}\n\t\t\t\t\trenderDate={renderDate}\n\t\t\t\t\trenderMonth={renderMonth}\n\t\t\t\t\trenderYear={renderYear}\n\t\t\t\t\tdisabledDate={disabledDate}\n\t\t\t\t\tonDateClick={handleDateClick}\n\t\t\t\t/>\n\t\t\t}\n\t\t\t{...popupProps}\n\t\t>\n\t\t\t<Input\n\t\t\t\tvalue={inputValue}\n\t\t\t\tappend={\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={<CalendarMonthTwotone />}\n\t\t\t\t\t\tclassName='i-datepicker-icon'\n\t\t\t\t\t\tsize='1em'\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tonBlur={handleBlur}\n\t\t\t\tonEnter={handleSetDate}\n\t\t\t\tclassName={classNames(\"i-datepicker-label\", className)}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t</Popup>\n\t);\n};\n\nexport default Datepicker;\n"],"names":["dayjs","customParseFormat","useState","useMemo","useEffect","_jsx","Popup","Panel","Input","Icon","CalendarMonthTwotone","classNames"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYAA,cAAK,CAAC,MAAM,CAACC,0BAAiB,CAAC;AAE/B,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC;AACxE,MAAM,MAAM,GAAG,YAAY;AAE3B,MAAM,UAAU,GAAG,CAAC,KAAkB,KAAI;AACzC,IAAA,MAAM,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,MAAM,GAAG,MAAM,EACf,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ACK;AAEV;;;;"}
|
|
@@ -1,80 +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 dayjs = require('dayjs');
|
|
9
|
-
var radash = require('radash');
|
|
10
|
-
var react = require('react');
|
|
11
|
-
var icon = require('../../icon/icon.js');
|
|
12
|
-
var helpericon = require('../../utils/helpericon/helpericon.js');
|
|
13
|
-
var dates = require('./dates.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
|
-
var dayjs__default = /*#__PURE__*/_interopDefaultCompat(dayjs);
|
|
19
|
-
|
|
20
|
-
const MONTHS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
21
|
-
const YearMonth = (props) => {
|
|
22
|
-
const { value, unitMonth = "月", unitYear = "年", renderYear, renderMonth, onClick, } = props;
|
|
23
|
-
return (jsxRuntime.jsxs("a", { className: 'i-datepicker-action', "data-ripple": true, onClick: onClick, children: [jsxRuntime.jsx("span", { children: renderYear?.(value.year()) }), unitYear, jsxRuntime.jsx("span", { children: renderMonth?.(value.month() + 1) }), unitMonth] }));
|
|
24
|
-
};
|
|
25
|
-
const Panel = (props) => {
|
|
26
|
-
const { value, unitYear, unitMonth, renderDate, renderMonth = (m) => m, renderYear = (y) => y, disabledDate, onDateClick, } = props;
|
|
27
|
-
const [today, setToday] = react.useState(value);
|
|
28
|
-
const [month, setMonth] = react.useState(value || dayjs__default());
|
|
29
|
-
const [selectedYear, setSelectedYear] = react.useState(dayjs__default());
|
|
30
|
-
const [years, setYears] = react.useState([]);
|
|
31
|
-
const [selectable, setSelectable] = react.useState(false);
|
|
32
|
-
const $years = react.useRef(null);
|
|
33
|
-
const handleOperateMonth = (next) => {
|
|
34
|
-
setMonth((m) => m[next ? "add" : "subtract"](1, "month"));
|
|
35
|
-
};
|
|
36
|
-
const handleChangeDate = (date) => {
|
|
37
|
-
if (date.isSame(today, "day"))
|
|
38
|
-
return;
|
|
39
|
-
if (!date.isSame(month, "month")) {
|
|
40
|
-
setMonth(date);
|
|
41
|
-
}
|
|
42
|
-
setToday(date);
|
|
43
|
-
onDateClick?.(date);
|
|
44
|
-
};
|
|
45
|
-
const handleChangeMonth = (month) => {
|
|
46
|
-
setMonth((m) => m.year(selectedYear.year()).month(month - 1));
|
|
47
|
-
setSelectable(false);
|
|
48
|
-
};
|
|
49
|
-
const getMoreYears = radash.throttle({ interval: 100 }, (e) => {
|
|
50
|
-
const isUp = e.deltaY < 0;
|
|
51
|
-
setYears((ys) => ys.map((y) => y + (isUp ? -1 : 1)));
|
|
52
|
-
});
|
|
53
|
-
react.useEffect(() => {
|
|
54
|
-
if (!selectable)
|
|
55
|
-
return;
|
|
56
|
-
setSelectedYear(month);
|
|
57
|
-
const y = month.year();
|
|
58
|
-
const nextYears = Array.from({ length: 7 }).map((_, i) => y - 3 + i);
|
|
59
|
-
setYears([...nextYears]);
|
|
60
|
-
}, [selectable, month]);
|
|
61
|
-
react.useEffect(() => {
|
|
62
|
-
setToday(value);
|
|
63
|
-
setMonth(value || dayjs__default());
|
|
64
|
-
}, [value]);
|
|
65
|
-
return (jsxRuntime.jsxs("div", { className: 'i-datepicker', children: [jsxRuntime.jsxs("div", { className: 'i-datepicker-units', children: [jsxRuntime.jsx(YearMonth, { value: month, unitYear: unitYear, unitMonth: unitMonth, renderMonth: renderMonth, renderYear: renderYear, onClick: () => setSelectable(true) }), jsxRuntime.jsx("a", { className: 'ml-auto i-datepicker-action', "data-ripple": true, onClick: () => handleOperateMonth(false), children: jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.KeyboardArrowLeftRound, {}) }) }), jsxRuntime.jsx("a", { className: 'i-datepicker-action', "data-ripple": true, onClick: () => handleOperateMonth(true), children: jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.KeyboardArrowRightRound, {}) }) })] }), jsxRuntime.jsxs("div", { className: classNames__default("i-datepicker-ym", {
|
|
66
|
-
"i-datepicker-active": selectable,
|
|
67
|
-
}), children: [jsxRuntime.jsx(helpericon.default, { active: true, className: 'i-datepicker-close', onClick: (e) => {
|
|
68
|
-
e.stopPropagation();
|
|
69
|
-
setSelectable(false);
|
|
70
|
-
} }), jsxRuntime.jsx("div", { ref: $years, className: 'i-datepicker-years', onWheel: getMoreYears, children: years.map((y) => (jsxRuntime.jsx("a", { className: classNames__default("i-datepicker-year", {
|
|
71
|
-
"i-datepicker-active": y === selectedYear.year(),
|
|
72
|
-
}), onClick: () => setSelectedYear((sy) => sy.year(y)), children: renderYear(y) }, y))) }), jsxRuntime.jsx("div", { className: 'i-datepicker-months', children: MONTHS.map((m) => {
|
|
73
|
-
return (jsxRuntime.jsx("a", { className: classNames__default("i-datepicker-month", {
|
|
74
|
-
"i-datepicker-active": m === month.month() + 1,
|
|
75
|
-
}), onClick: () => handleChangeMonth(m), children: renderMonth(m) }, m));
|
|
76
|
-
}) })] }), jsxRuntime.jsx(dates.default, { value: today, month: month, disabledDate: disabledDate, onDateClick: handleChangeDate, renderDate: renderDate })] }));
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
exports.default = Panel;
|
|
80
|
-
//# sourceMappingURL=panel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"panel.js","sources":["../../../../../packages/components/picker/dates/panel.tsx"],"sourcesContent":["import {\n\tKeyboardArrowLeftRound,\n\tKeyboardArrowRightRound,\n} from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport dayjs, { Dayjs } from \"dayjs\";\nimport { throttle } from \"radash\";\nimport { ReactNode, useEffect, useRef, useState } from \"react\";\nimport Icon from \"../../icon\";\nimport Helpericon from \"../../utils/helpericon\";\nimport { IBaseDates } from \"../type\";\nimport Dates from \"./dates\";\n\nconst MONTHS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];\n\nconst YearMonth = (\n\tprops: IBaseDates & {\n\t\tonClick?: () => void;\n\t}\n) => {\n\tconst {\n\t\tvalue,\n\t\tunitMonth = \"月\",\n\t\tunitYear = \"年\",\n\t\trenderYear,\n\t\trenderMonth,\n\t\tonClick,\n\t} = props;\n\n\treturn (\n\t\t<a className='i-datepicker-action' data-ripple onClick={onClick}>\n\t\t\t<span>{renderYear?.(value.year())}</span>\n\t\t\t{unitYear}\n\t\t\t<span>{renderMonth?.(value.month() + 1)}</span>\n\t\t\t{unitMonth}\n\t\t</a>\n\t);\n};\n\nconst Panel = (props: IBaseDates) => {\n\tconst {\n\t\tvalue,\n\t\tunitYear,\n\t\tunitMonth,\n\t\trenderDate,\n\t\trenderMonth = (m: ReactNode) => m,\n\t\trenderYear = (y: ReactNode) => y,\n\t\tdisabledDate,\n\t\tonDateClick,\n\t} = props;\n\n\tconst [today, setToday] = useState(value);\n\tconst [month, setMonth] = useState(value || dayjs());\n\tconst [selectedYear, setSelectedYear] = useState(dayjs());\n\tconst [years, setYears] = useState<number[]>([]);\n\tconst [selectable, setSelectable] = useState(false);\n\n\tconst $years = useRef<HTMLDivElement>(null);\n\n\tconst handleOperateMonth = (next: boolean) => {\n\t\tsetMonth((m) => m[next ? \"add\" : \"subtract\"](1, \"month\"));\n\t};\n\n\tconst handleChangeDate = (date: Dayjs) => {\n\t\tif (date.isSame(today, \"day\")) return;\n\n\t\tif (!date.isSame(month, \"month\")) {\n\t\t\tsetMonth(date);\n\t\t}\n\n\t\tsetToday(date);\n\t\tonDateClick?.(date);\n\t};\n\n\tconst handleChangeMonth = (month: number) => {\n\t\tsetMonth((m) => m.year(selectedYear.year()).month(month - 1));\n\t\tsetSelectable(false);\n\t};\n\n\tconst getMoreYears = throttle({ interval: 100 }, (e) => {\n\t\tconst isUp = e.deltaY < 0;\n\n\t\tsetYears((ys) => ys.map((y) => y + (isUp ? -1 : 1)));\n\t});\n\n\tuseEffect(() => {\n\t\tif (!selectable) return;\n\n\t\tsetSelectedYear(month);\n\t\tconst y = month.year();\n\t\tconst nextYears = Array.from({ length: 7 }).map((_, i) => y - 3 + i);\n\n\t\tsetYears([...nextYears]);\n\t}, [selectable, month]);\n\n\tuseEffect(() => {\n\t\tsetToday(value);\n\t\tsetMonth(value || dayjs());\n\t}, [value]);\n\n\treturn (\n\t\t<div className='i-datepicker'>\n\t\t\t<div className='i-datepicker-units'>\n\t\t\t\t<YearMonth\n\t\t\t\t\tvalue={month}\n\t\t\t\t\tunitYear={unitYear}\n\t\t\t\t\tunitMonth={unitMonth}\n\t\t\t\t\trenderMonth={renderMonth}\n\t\t\t\t\trenderYear={renderYear}\n\t\t\t\t\tonClick={() => setSelectable(true)}\n\t\t\t\t/>\n\t\t\t\t<a\n\t\t\t\t\tclassName='ml-auto i-datepicker-action'\n\t\t\t\t\tdata-ripple\n\t\t\t\t\tonClick={() => handleOperateMonth(false)}\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={<KeyboardArrowLeftRound />} />\n\t\t\t\t</a>\n\t\t\t\t<a\n\t\t\t\t\tclassName='i-datepicker-action'\n\t\t\t\t\tdata-ripple\n\t\t\t\t\tonClick={() => handleOperateMonth(true)}\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={<KeyboardArrowRightRound />} />\n\t\t\t\t</a>\n\t\t\t</div>\n\n\t\t\t<div\n\t\t\t\tclassName={classNames(\"i-datepicker-ym\", {\n\t\t\t\t\t\"i-datepicker-active\": selectable,\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t<Helpericon\n\t\t\t\t\tactive\n\t\t\t\t\tclassName='i-datepicker-close'\n\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\tsetSelectable(false);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\n\t\t\t\t<div\n\t\t\t\t\tref={$years}\n\t\t\t\t\tclassName='i-datepicker-years'\n\t\t\t\t\tonWheel={getMoreYears}\n\t\t\t\t>\n\t\t\t\t\t{years.map((y) => (\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tkey={y}\n\t\t\t\t\t\t\tclassName={classNames(\"i-datepicker-year\", {\n\t\t\t\t\t\t\t\t\"i-datepicker-active\":\n\t\t\t\t\t\t\t\t\ty === selectedYear.year(),\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\tonClick={() => setSelectedYear((sy) => sy.year(y))}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{renderYear(y)}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\n\t\t\t\t<div className='i-datepicker-months'>\n\t\t\t\t\t{MONTHS.map((m) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\tkey={m}\n\t\t\t\t\t\t\t\tclassName={classNames(\"i-datepicker-month\", {\n\t\t\t\t\t\t\t\t\t\"i-datepicker-active\":\n\t\t\t\t\t\t\t\t\t\tm === month.month() + 1,\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\tonClick={() => handleChangeMonth(m)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{renderMonth(m)}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<Dates\n\t\t\t\tvalue={today}\n\t\t\t\tmonth={month}\n\t\t\t\tdisabledDate={disabledDate}\n\t\t\t\tonDateClick={handleChangeDate}\n\t\t\t\trenderDate={renderDate}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nexport default Panel;\n"],"names":["_jsxs","_jsx","useState","dayjs","useRef","throttle","useEffect","Icon","KeyboardArrowLeftRound","KeyboardArrowRightRound","classNames","Helpericon","Dates"],"mappings":";;;;;;;;;;;;;;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BAAU,CAAC,oBAAoB,EAAE;oCAC3C,qBAAqB,EACpB,CAAC,KAAK,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC;AACxB,iCAAA,CAAC,EACF,OAAO,EAAE,MAAM,iBAAiB,CAAC,CAAC,CAAC,EAAA,QAAA,EAElC,WAAW,CAAC,CAAC,CAAC,IAPV,CAAC,CAQH;AAEN,wBAAA,CAAC,CAAC,EAAA,CACG,CAAA,EAAA,CACD,EAENT,cAAA,CAACW,aAAK,EAAA,EACL,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,gBAAgB,EAC7B,UAAU,EAAE,UAAU,EAAA,CACrB,CAAA,EAAA,CACG;AAER;;;;"}
|
|
@@ -1,50 +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 icon = require('../../icon/icon.js');
|
|
10
|
-
var input = require('../../input/input.js');
|
|
11
|
-
var popup = require('../../popup/popup.js');
|
|
12
|
-
var panel = require('./panel.js');
|
|
13
|
-
|
|
14
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
15
|
-
|
|
16
|
-
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
17
|
-
|
|
18
|
-
const FORMAT = "hh:mm:ss";
|
|
19
|
-
function TimePicker(props) {
|
|
20
|
-
const { name, value, format = FORMAT, periods, placeholder = props.format ?? FORMAT, className, renderItem, onChange, onBlur, popupProps, ...restProps } = props;
|
|
21
|
-
const [timeValue, setTimeValue] = react.useState(value);
|
|
22
|
-
const [safeValue, setSafeValue] = react.useState(undefined);
|
|
23
|
-
const [active, setActive] = react.useState(false);
|
|
24
|
-
const handleChange = (v) => {
|
|
25
|
-
setTimeValue(v);
|
|
26
|
-
};
|
|
27
|
-
const handleFallback = (v) => {
|
|
28
|
-
setSafeValue(v);
|
|
29
|
-
};
|
|
30
|
-
const handleValidTime = () => {
|
|
31
|
-
if (!timeValue)
|
|
32
|
-
return;
|
|
33
|
-
setTimeValue(safeValue);
|
|
34
|
-
};
|
|
35
|
-
const handleBlur = (e) => {
|
|
36
|
-
onBlur?.(e);
|
|
37
|
-
handleValidTime();
|
|
38
|
-
};
|
|
39
|
-
const handleVisibleChange = (v) => {
|
|
40
|
-
popupProps?.onVisibleChange?.(v);
|
|
41
|
-
setActive(v);
|
|
42
|
-
};
|
|
43
|
-
react.useEffect(() => {
|
|
44
|
-
setTimeValue(value);
|
|
45
|
-
}, [value]);
|
|
46
|
-
return (jsxRuntime.jsx(popup.default, { visible: active, trigger: 'click', position: 'bottom', arrow: false, align: 'start', watchResize: true, ...popupProps, onVisibleChange: handleVisibleChange, content: jsxRuntime.jsx(panel.default, { value: timeValue, format: format, periods: periods, renderItem: renderItem, onChange: handleChange, onFallback: handleFallback }), children: jsxRuntime.jsx(input.default, { value: timeValue, placeholder: placeholder, append: jsxRuntime.jsx(icon.default, { icon: jsxRuntime.jsx(material.AccessTimeRound, {}), className: 'i-timepicker-icon', size: '1em' }), onChange: handleChange, onBlur: handleBlur, className: classNames__default("i-timepicker-label", className), ...restProps }) }));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
exports.default = TimePicker;
|
|
50
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../packages/components/picker/time/index.tsx"],"sourcesContent":["import { AccessTimeRound } from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport { useEffect, useState } from \"react\";\nimport Icon from \"../../icon\";\nimport Input from \"../../input\";\nimport Popup from \"../../popup\";\nimport { ITimePicker } from \"../type\";\nimport Panel from \"./panel\";\n\nconst FORMAT = \"hh:mm:ss\";\n\nexport default function TimePicker(props: ITimePicker) {\n\tconst {\n\t\tname,\n\t\tvalue,\n\t\tformat = FORMAT,\n\t\tperiods,\n\t\tplaceholder = props.format ?? FORMAT,\n\t\tclassName,\n\t\trenderItem,\n\t\tonChange,\n\t\tonBlur,\n\t\tpopupProps,\n\t\t...restProps\n\t} = props;\n\tconst [timeValue, setTimeValue] = useState(value);\n\tconst [safeValue, setSafeValue] = useState(undefined);\n\tconst [active, setActive] = useState<boolean>(false);\n\n\tconst handleChange = (v) => {\n\t\tsetTimeValue(v);\n\t};\n\n\tconst handleFallback = (v) => {\n\t\tsetSafeValue(v);\n\t};\n\n\tconst handleValidTime = () => {\n\t\tif (!timeValue) return;\n\n\t\tsetTimeValue(safeValue);\n\t};\n\n\tconst handleBlur = (e) => {\n\t\tonBlur?.(e);\n\t\thandleValidTime();\n\t};\n\n\tconst handleVisibleChange = (v) => {\n\t\tpopupProps?.onVisibleChange?.(v);\n\t\tsetActive(v);\n\t};\n\n\tuseEffect(() => {\n\t\tsetTimeValue(value);\n\t}, [value]);\n\n\treturn (\n\t\t<Popup\n\t\t\tvisible={active}\n\t\t\ttrigger='click'\n\t\t\tposition='bottom'\n\t\t\tarrow={false}\n\t\t\talign='start'\n\t\t\twatchResize\n\t\t\t{...popupProps}\n\t\t\tonVisibleChange={handleVisibleChange}\n\t\t\tcontent={\n\t\t\t\t<Panel\n\t\t\t\t\tvalue={timeValue}\n\t\t\t\t\tformat={format}\n\t\t\t\t\tperiods={periods}\n\t\t\t\t\trenderItem={renderItem}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tonFallback={handleFallback}\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t<Input\n\t\t\t\tvalue={timeValue}\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tappend={\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={<AccessTimeRound />}\n\t\t\t\t\t\tclassName='i-timepicker-icon'\n\t\t\t\t\t\tsize='1em'\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tonBlur={handleBlur}\n\t\t\t\tclassName={classNames(\"i-timepicker-label\", className)}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t</Popup>\n\t);\n}\n"],"names":["useState","useEffect","_jsx","Popup","Panel","Input","Icon","AccessTimeRound","classNames"],"mappings":";;;;;;;;;;;;;;;;;AASA,MAAM,MAAM,GAAG,UAAU;AAEX,SAAU,UAAU,CAAC,KAAkB,EAAA;AACpD,IAAA,MAAM,EACL,IAAI,EACJ,KAAK,EACL,MAAM,GAAG,MAAM,EACf,OAAO,EACP,WAAW,GAAG,KAAK,CAAC,MAAM,IAAI,MAAM,EACpC,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,UAAU,EACV,GAAG,SAAS,EACZ,GAAG,KAAK;IACT,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAGA,cAAQ,CAAC,KAAK,CAAC;IACjD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAGA,cAAQ,CAAC,SAAS,CAAC;IACrD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAGA,cAAQ,CAAU,KAAK,CAAC;AAEpD,IAAA,MAAM,YAAY,GAAG,CAAC,CAAC,KAAI;QAC1B,YAAY,CAAC,CAAC,CAAC;AAChB,IAAA,CAAC;AAED,IAAA,MAAM,cAAc,GAAG,CAAC,CAAC,KAAI;QAC5B,YAAY,CAAC,CAAC,CAAC;AAChB,IAAA,CAAC;IAED,MAAM,eAAe,GAAG,MAAK;AAC5B,QAAA,IAAI,CAAC,SAAS;YAAE;QAEhB,YAAY,CAAC,SAAS,CAAC;AACxB,IAAA,CAAC;AAED,IAAA,MAAM,UAAU,GAAG,CAAC,CAAC,KAAI;AACxB,QAAA,MAAM,GAAG,CAAC,CAAC;AACX,QAAA,eAAe,EAAE;AAClB,IAAA,CAAC;AAED,IAAA,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAI;AACjC,QAAA,UAAU,EAAE,eAAe,GAAG,CAAC,CAAC;QAChC,SAAS,CAAC,CAAC,CAAC;AACb,IAAA,CAAC;IAEDC,eAAS,CAAC,MAAK;QACd,YAAY,CAAC,KAAK,CAAC;AACpB,IAAA,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAEX,QACCC,cAAA,CAACC,aAAK,EAAA,EACL,OAAO,EAAE,MAAM,EACf,OAAO,EAAC,OAAO,EACf,QAAQ,EAAC,QAAQ,EACjB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAC,OAAO,EACb,WAAW,EAAA,IAAA,EAAA,GACP,UAAU,EACd,eAAe,EAAE,mBAAmB,EACpC,OAAO,EACND,cAAA,CAACE,aAAK,EAAA,EACL,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,YAAY,EACtB,UAAU,EAAE,cAAc,EAAA,CACzB,EAAA,QAAA,EAGHF,cAAA,CAACG,aAAK,IACL,KAAK,EAAE,SAAS,EAChB,WAAW,EAAE,WAAW,EACxB,MAAM,EACLH,cAAA,CAACI,YAAI,EAAA,EACJ,IAAI,EAAEJ,cAAA,CAACK,wBAAe,EAAA,EAAA,CAAG,EACzB,SAAS,EAAC,mBAAmB,EAC7B,IAAI,EAAC,KAAK,EAAA,CACT,EAEH,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,UAAU,EAClB,SAAS,EAAEC,mBAAU,CAAC,oBAAoB,EAAE,SAAS,CAAC,EAAA,GAClD,SAAS,EAAA,CACZ,EAAA,CACK;AAEV;;;;"}
|
|
@@ -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
|
-
function Items(props) {
|
|
13
|
-
const { items = [], active, renderItem, unit, onClick } = props;
|
|
14
|
-
return items.map((n) => {
|
|
15
|
-
const isActive = n === active;
|
|
16
|
-
return (jsxRuntime.jsx("a", { className: classNames__default("i-timepicker-item", {
|
|
17
|
-
"i-timepicker-item-active": isActive,
|
|
18
|
-
}), onClick: () => onClick(n), children: renderItem?.(n, isActive, unit) ?? (n < 10 ? `0${n}` : n) }, n));
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
exports.default = Items;
|
|
23
|
-
//# sourceMappingURL=item.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sources":["../../../../../packages/components/picker/time/item.tsx"],"sourcesContent":["import classNames from \"classnames\";\n\nexport default function Items(props) {\n\tconst { items = [], active, renderItem, unit, onClick } = props;\n\n\treturn items.map((n) => {\n\t\tconst isActive = n === active;\n\n\t\treturn (\n\t\t\t<a\n\t\t\t\tkey={n}\n\t\t\t\tclassName={classNames(\"i-timepicker-item\", {\n\t\t\t\t\t\"i-timepicker-item-active\": isActive,\n\t\t\t\t})}\n\t\t\t\tonClick={() => onClick(n)}\n\t\t\t>\n\t\t\t\t{renderItem?.(n, isActive, unit) ?? (n < 10 ? `0${n}` : n)}\n\t\t\t</a>\n\t\t);\n\t});\n}\n"],"names":["_jsx","classNames"],"mappings":";;;;;;;;;;;AAEc,SAAU,KAAK,CAAC,KAAK,EAAA;AAClC,IAAA,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK;AAE/D,IAAA,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAI;AACtB,QAAA,MAAM,QAAQ,GAAG,CAAC,KAAK,MAAM;AAE7B,QAAA,QACCA,cAAA,CAAA,GAAA,EAAA,EAEC,SAAS,EAAEC,mBAAU,CAAC,mBAAmB,EAAE;AAC1C,gBAAA,0BAA0B,EAAE,QAAQ;AACpC,aAAA,CAAC,EACF,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAA,QAAA,EAExB,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA,CAAE,GAAG,CAAC,CAAC,IANrD,CAAC,CAOH;AAEN,IAAA,CAAC,CAAC;AACH;;;;"}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var react = require('react');
|
|
7
|
-
var item = require('./item.js');
|
|
8
|
-
|
|
9
|
-
const UnitMaps = {
|
|
10
|
-
h: "hour",
|
|
11
|
-
hh: "hour",
|
|
12
|
-
m: "minute",
|
|
13
|
-
mm: "minute",
|
|
14
|
-
s: "second",
|
|
15
|
-
ss: "second",
|
|
16
|
-
};
|
|
17
|
-
function Panel(props) {
|
|
18
|
-
const { value, stepH = 1, stepM = 1, stepS = 1, format, periods, renderItem, onChange, onFallback, } = props;
|
|
19
|
-
const [period, setPeriod] = react.useState(undefined);
|
|
20
|
-
const [hour, setHour] = react.useState(undefined);
|
|
21
|
-
const [minute, setMinute] = react.useState(undefined);
|
|
22
|
-
const [second, setSecond] = react.useState(undefined);
|
|
23
|
-
const [hours, minutes, seconds] = react.useMemo(() => {
|
|
24
|
-
const hasH = format.includes("h");
|
|
25
|
-
const hasM = format.includes("m");
|
|
26
|
-
const hasS = format.includes("s");
|
|
27
|
-
const hours = hasH
|
|
28
|
-
? Array.from({ length: (periods ? 12 : 24) / stepH }, (_, i) => i * stepH)
|
|
29
|
-
: [];
|
|
30
|
-
const minutes = hasM
|
|
31
|
-
? Array.from({ length: 60 / stepM }, (_, i) => i * stepM)
|
|
32
|
-
: [];
|
|
33
|
-
const seconds = hasS
|
|
34
|
-
? Array.from({ length: 60 / stepS }, (_, i) => i * stepS)
|
|
35
|
-
: [];
|
|
36
|
-
return [hours, minutes, seconds];
|
|
37
|
-
}, [stepH, stepM, stepS, format, periods]);
|
|
38
|
-
const updateValue = (next) => {
|
|
39
|
-
const nextPeriod = next?.period ?? period;
|
|
40
|
-
const nextHour = next?.hour ?? hour;
|
|
41
|
-
const nextMinute = next?.minute ?? minute;
|
|
42
|
-
const nextSecond = next?.second ?? second;
|
|
43
|
-
const reg = /(hh|h){1}|(mm|m){1}|(ss|s){1}/gi;
|
|
44
|
-
let result = format.replace(reg, (pattern) => {
|
|
45
|
-
const p = pattern.toLowerCase();
|
|
46
|
-
const u = UnitMaps[p];
|
|
47
|
-
const n = u === "hour"
|
|
48
|
-
? (nextHour ?? 0)
|
|
49
|
-
: u === "minute"
|
|
50
|
-
? (nextMinute ?? 0)
|
|
51
|
-
: (nextSecond ?? 0);
|
|
52
|
-
return p.length > 1 && n < 10 ? `0${n ?? 0}` : n ?? 0;
|
|
53
|
-
});
|
|
54
|
-
if (periods && hours.length > 0) {
|
|
55
|
-
result = `${nextPeriod ?? periods[0]} ${result}`;
|
|
56
|
-
}
|
|
57
|
-
onChange(result);
|
|
58
|
-
};
|
|
59
|
-
const handleSetTime = (v, unit) => {
|
|
60
|
-
const next = { period, hour, minute, second, [unit]: v };
|
|
61
|
-
if (unit === "period")
|
|
62
|
-
setPeriod(v);
|
|
63
|
-
if (unit === "hour")
|
|
64
|
-
setHour(v);
|
|
65
|
-
if (unit === "minute")
|
|
66
|
-
setMinute(v);
|
|
67
|
-
if (unit === "second")
|
|
68
|
-
setSecond(v);
|
|
69
|
-
updateValue(next);
|
|
70
|
-
};
|
|
71
|
-
react.useEffect(() => {
|
|
72
|
-
let time = value ?? "";
|
|
73
|
-
if (periods && hours.length > 0 && value) {
|
|
74
|
-
const [p, t] = value.split(" ");
|
|
75
|
-
time = t ?? "";
|
|
76
|
-
setPeriod(periods.includes(p) ? p : undefined);
|
|
77
|
-
}
|
|
78
|
-
const nums = time.match(/\d+/g) ?? [];
|
|
79
|
-
if (!nums.length) {
|
|
80
|
-
onFallback("");
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
let i = 0;
|
|
84
|
-
const parsed = {
|
|
85
|
-
hour: undefined,
|
|
86
|
-
minute: undefined,
|
|
87
|
-
second: undefined,
|
|
88
|
-
};
|
|
89
|
-
const r = format.replace(/(hh|h)+|(mm|m)+|(ss|s)+/gi, (p) => {
|
|
90
|
-
const n = nums[i++] ?? 0;
|
|
91
|
-
const o = Math.min(59, n);
|
|
92
|
-
parsed[UnitMaps[p]] = o;
|
|
93
|
-
return p.length > 1 && o < 10 ? `0${o}` : o;
|
|
94
|
-
});
|
|
95
|
-
setHour(parsed.hour);
|
|
96
|
-
setMinute(parsed.minute);
|
|
97
|
-
setSecond(parsed.second);
|
|
98
|
-
onFallback(r);
|
|
99
|
-
}, [value, format, hours.length, periods]);
|
|
100
|
-
return (jsxRuntime.jsxs("div", { className: 'i-timepicker', children: [hours.length > 0 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [periods && (jsxRuntime.jsx("div", { className: 'i-timepicker-list', children: jsxRuntime.jsx(item.default, { items: periods, active: period, onClick: (p) => handleSetTime(p, "period") }) })), jsxRuntime.jsx("div", { className: 'i-timepicker-list', children: jsxRuntime.jsx(item.default, { items: hours, active: hour, unit: 'hour', renderItem: renderItem, onClick: (h) => handleSetTime(h, "hour") }) })] })), minutes.length > 0 && (jsxRuntime.jsx("div", { className: 'i-timepicker-list', children: jsxRuntime.jsx(item.default, { items: minutes, active: minute, unit: 'minute', renderItem: renderItem, onClick: (m) => handleSetTime(m, "minute") }) })), seconds.length > 0 && (jsxRuntime.jsx("div", { className: 'i-timepicker-list', children: jsxRuntime.jsx(item.default, { items: seconds, active: second, unit: 'second', renderItem: renderItem, onClick: (s) => handleSetTime(s, "second") }) }))] }));
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
exports.default = Panel;
|
|
104
|
-
//# sourceMappingURL=panel.js.map
|