@ioca/react 1.5.20 → 1.5.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/css/index.css +1 -2
- package/lib/es/components/affix/affix.js +0 -1
- package/lib/es/components/affix/index.js +0 -1
- package/lib/es/components/affix/totop.js +0 -1
- package/lib/es/components/badge/badge.js +0 -1
- package/lib/es/components/badge/index.js +0 -1
- package/lib/es/components/button/button.js +0 -1
- package/lib/es/components/button/confirm.js +0 -1
- package/lib/es/components/button/group.js +0 -1
- package/lib/es/components/button/index.js +0 -1
- package/lib/es/components/button/toggle.js +0 -1
- package/lib/es/components/card/card.js +0 -1
- package/lib/es/components/card/index.js +0 -1
- package/lib/es/components/checkbox/checkbox.js +0 -1
- package/lib/es/components/checkbox/index.js +0 -1
- package/lib/es/components/checkbox/item.js +0 -1
- package/lib/es/components/collapse/collapse.js +0 -1
- package/lib/es/components/collapse/index.js +0 -1
- package/lib/es/components/collapse/item.js +0 -1
- package/lib/es/components/datagrid/cell.js +0 -1
- package/lib/es/components/datagrid/datagrid.js +0 -1
- package/lib/es/components/datagrid/helper.js +0 -1
- package/lib/es/components/datagrid/index.js +0 -1
- package/lib/es/components/datagrid/resize.js +0 -1
- package/lib/es/components/datagrid/row.js +0 -1
- package/lib/es/components/datagrid/sorter.js +0 -1
- package/lib/es/components/datagrid/virtual.js +0 -1
- package/lib/es/components/description/description.js +0 -1
- package/lib/es/components/description/index.js +0 -1
- package/lib/es/components/drawer/drawer.js +0 -1
- package/lib/es/components/drawer/index.js +0 -1
- package/lib/es/components/dropdown/dropdown.js +0 -1
- package/lib/es/components/dropdown/index.js +0 -1
- package/lib/es/components/dropdown/item.js +0 -1
- package/lib/es/components/editor/controls.js +0 -1
- package/lib/es/components/editor/editor.js +0 -1
- package/lib/es/components/editor/index.js +0 -1
- package/lib/es/components/editor/memtion.js +0 -1
- package/lib/es/components/flex/flex.js +0 -1
- package/lib/es/components/flex/index.js +0 -1
- package/lib/es/components/form/context.js +0 -1
- package/lib/es/components/form/field.js +0 -1
- package/lib/es/components/form/form.js +0 -1
- package/lib/es/components/form/index.js +0 -1
- package/lib/es/components/form/useConfig.js +0 -1
- package/lib/es/components/form/useForm.js +0 -1
- package/lib/es/components/form/utils.js +0 -1
- package/lib/es/components/icon/icon.js +0 -1
- package/lib/es/components/icon/index.js +0 -1
- package/lib/es/components/image/image.js +0 -1
- package/lib/es/components/image/index.js +0 -1
- package/lib/es/components/image/list.js +0 -1
- package/lib/es/components/input/container.js +0 -1
- package/lib/es/components/input/index.js +0 -1
- package/lib/es/components/input/input.js +0 -1
- package/lib/es/components/input/number.js +0 -1
- package/lib/es/components/input/range.js +0 -1
- package/lib/es/components/input/textarea.js +0 -1
- package/lib/es/components/list/index.js +0 -1
- package/lib/es/components/list/item.js +0 -1
- package/lib/es/components/list/list.js +0 -1
- package/lib/es/components/loading/index.js +0 -1
- package/lib/es/components/loading/loading.js +0 -1
- package/lib/es/components/message/index.js +0 -1
- package/lib/es/components/message/message.js +0 -1
- package/lib/es/components/modal/content.js +0 -1
- package/lib/es/components/modal/context.js +0 -1
- package/lib/es/components/modal/hookModal.js +0 -1
- package/lib/es/components/modal/index.js +0 -1
- package/lib/es/components/modal/modal.js +0 -1
- package/lib/es/components/modal/modalManager.js +0 -1
- package/lib/es/components/modal/useModal.js +0 -1
- package/lib/es/components/pagination/index.js +0 -1
- package/lib/es/components/pagination/page.js +0 -1
- package/lib/es/components/pagination/pagination.js +0 -1
- package/lib/es/components/picker/colors/footer.js +0 -1
- package/lib/es/components/picker/colors/handle.js +0 -1
- package/lib/es/components/picker/colors/index.js +0 -1
- package/lib/es/components/picker/daterange/daterange.js +0 -1
- package/lib/es/components/picker/daterange/index.js +0 -1
- package/lib/es/components/picker/daterange/panel.js +0 -1
- package/lib/es/components/picker/dates/dates.js +0 -1
- package/lib/es/components/picker/dates/index.js +0 -1
- package/lib/es/components/picker/dates/panel.js +0 -1
- package/lib/es/components/picker/time/index.js +0 -1
- package/lib/es/components/picker/time/item.js +0 -1
- package/lib/es/components/picker/time/panel.js +0 -1
- package/lib/es/components/popconfirm/index.js +0 -1
- package/lib/es/components/popconfirm/popconfirm.js +0 -1
- package/lib/es/components/popup/content.js +0 -1
- package/lib/es/components/popup/index.js +0 -1
- package/lib/es/components/popup/popup.js +0 -1
- package/lib/es/components/progress/circle.js +0 -1
- package/lib/es/components/progress/index.js +0 -1
- package/lib/es/components/progress/line.js +0 -1
- package/lib/es/components/progress/progress.js +0 -1
- package/lib/es/components/radio/index.js +0 -1
- package/lib/es/components/radio/item.js +0 -1
- package/lib/es/components/radio/radio.js +0 -1
- package/lib/es/components/resizable/index.js +0 -1
- package/lib/es/components/resizable/resizable.js +0 -1
- package/lib/es/components/river/index.js +0 -1
- package/lib/es/components/river/river.js +0 -1
- package/lib/es/components/scroll/index.js +0 -1
- package/lib/es/components/scroll/scroll.js +0 -1
- package/lib/es/components/select/index.js +0 -1
- package/lib/es/components/select/options.js +0 -1
- package/lib/es/components/select/select.js +0 -1
- package/lib/es/components/step/divider.js +0 -1
- package/lib/es/components/step/index.js +0 -1
- package/lib/es/components/step/item.js +0 -1
- package/lib/es/components/step/step.js +0 -1
- package/lib/es/components/swiper/index.js +0 -1
- package/lib/es/components/swiper/item.js +0 -1
- package/lib/es/components/swiper/swiper.js +0 -1
- package/lib/es/components/tabs/contents.js +0 -1
- package/lib/es/components/tabs/helper.js +0 -1
- package/lib/es/components/tabs/index.js +0 -1
- package/lib/es/components/tabs/item.js +0 -1
- package/lib/es/components/tabs/navs.js +0 -1
- package/lib/es/components/tabs/tabs.js +0 -1
- package/lib/es/components/tag/index.js +0 -1
- package/lib/es/components/tag/tag.js +0 -1
- package/lib/es/components/text/highlight.js +0 -1
- package/lib/es/components/text/index.js +0 -1
- package/lib/es/components/text/number.js +0 -1
- package/lib/es/components/text/text.js +0 -1
- package/lib/es/components/text/time.js +0 -1
- package/lib/es/components/tree/index.js +0 -1
- package/lib/es/components/tree/item.js +0 -1
- package/lib/es/components/tree/tree.js +0 -1
- package/lib/es/components/tree/virtual.js +0 -1
- package/lib/es/components/upload/dropbox.js +0 -1
- package/lib/es/components/upload/index.js +0 -1
- package/lib/es/components/upload/renderFile.js +0 -1
- package/lib/es/components/upload/upload.js +0 -1
- package/lib/es/components/utils/empty/index.js +0 -1
- package/lib/es/components/utils/helpericon/helpericon.js +0 -1
- package/lib/es/components/utils/helpericon/index.js +0 -1
- package/lib/es/components/video/index.js +0 -1
- package/lib/es/components/video/video.js +0 -1
- package/lib/es/index.js +0 -1
- package/lib/es/js/hooks.js +0 -1
- package/lib/es/js/usePreview/content.js +0 -1
- package/lib/es/js/usePreview/index.js +0 -1
- package/lib/es/js/usePreview/renderFile.js +0 -1
- package/lib/es/js/usePreview/type.js +0 -1
- package/lib/es/js/useRipple/index.js +0 -1
- package/lib/es/js/useTheme/index.js +0 -1
- package/lib/es/js/utils.js +0 -1
- package/package.json +3 -7
- package/lib/cjs/components/affix/affix.js +0 -80
- package/lib/cjs/components/affix/affix.js.map +0 -1
- package/lib/cjs/components/affix/index.js +0 -10
- package/lib/cjs/components/affix/index.js.map +0 -1
- package/lib/cjs/components/affix/totop.js +0 -21
- package/lib/cjs/components/affix/totop.js.map +0 -1
- package/lib/cjs/components/badge/badge.js +0 -21
- package/lib/cjs/components/badge/badge.js.map +0 -1
- package/lib/cjs/components/badge/index.js +0 -10
- package/lib/cjs/components/badge/index.js.map +0 -1
- package/lib/cjs/components/button/button.js +0 -72
- package/lib/cjs/components/button/button.js.map +0 -1
- package/lib/cjs/components/button/confirm.js +0 -58
- package/lib/cjs/components/button/confirm.js.map +0 -1
- package/lib/cjs/components/button/group.js +0 -29
- package/lib/cjs/components/button/group.js.map +0 -1
- package/lib/cjs/components/button/index.js +0 -10
- package/lib/cjs/components/button/index.js.map +0 -1
- package/lib/cjs/components/button/toggle.js +0 -47
- package/lib/cjs/components/button/toggle.js.map +0 -1
- package/lib/cjs/components/card/card.js +0 -21
- package/lib/cjs/components/card/card.js.map +0 -1
- package/lib/cjs/components/card/index.js +0 -10
- package/lib/cjs/components/card/index.js.map +0 -1
- package/lib/cjs/components/checkbox/checkbox.js +0 -47
- package/lib/cjs/components/checkbox/checkbox.js.map +0 -1
- package/lib/cjs/components/checkbox/index.js +0 -10
- package/lib/cjs/components/checkbox/index.js.map +0 -1
- package/lib/cjs/components/checkbox/item.js +0 -43
- package/lib/cjs/components/checkbox/item.js.map +0 -1
- package/lib/cjs/components/collapse/collapse.js +0 -80
- package/lib/cjs/components/collapse/collapse.js.map +0 -1
- package/lib/cjs/components/collapse/index.js +0 -10
- package/lib/cjs/components/collapse/index.js.map +0 -1
- package/lib/cjs/components/collapse/item.js +0 -12
- package/lib/cjs/components/collapse/item.js.map +0 -1
- package/lib/cjs/components/datagrid/cell.js +0 -34
- package/lib/cjs/components/datagrid/cell.js.map +0 -1
- package/lib/cjs/components/datagrid/datagrid.js +0 -219
- package/lib/cjs/components/datagrid/datagrid.js.map +0 -1
- package/lib/cjs/components/datagrid/helper.js +0 -83
- package/lib/cjs/components/datagrid/helper.js.map +0 -1
- package/lib/cjs/components/datagrid/index.js +0 -10
- package/lib/cjs/components/datagrid/index.js.map +0 -1
- package/lib/cjs/components/datagrid/resize.js +0 -72
- package/lib/cjs/components/datagrid/resize.js.map +0 -1
- package/lib/cjs/components/datagrid/row.js +0 -55
- package/lib/cjs/components/datagrid/row.js.map +0 -1
- package/lib/cjs/components/datagrid/sorter.js +0 -21
- package/lib/cjs/components/datagrid/sorter.js.map +0 -1
- package/lib/cjs/components/datagrid/virtual.js +0 -310
- package/lib/cjs/components/datagrid/virtual.js.map +0 -1
- package/lib/cjs/components/description/description.js +0 -36
- package/lib/cjs/components/description/description.js.map +0 -1
- package/lib/cjs/components/description/index.js +0 -10
- package/lib/cjs/components/description/index.js.map +0 -1
- package/lib/cjs/components/drawer/drawer.js +0 -77
- package/lib/cjs/components/drawer/drawer.js.map +0 -1
- package/lib/cjs/components/drawer/index.js +0 -10
- package/lib/cjs/components/drawer/index.js.map +0 -1
- package/lib/cjs/components/dropdown/dropdown.js +0 -36
- package/lib/cjs/components/dropdown/dropdown.js.map +0 -1
- package/lib/cjs/components/dropdown/index.js +0 -10
- package/lib/cjs/components/dropdown/index.js.map +0 -1
- package/lib/cjs/components/dropdown/item.js +0 -38
- package/lib/cjs/components/dropdown/item.js.map +0 -1
- package/lib/cjs/components/editor/controls.js +0 -64
- package/lib/cjs/components/editor/controls.js.map +0 -1
- package/lib/cjs/components/editor/editor.js +0 -287
- package/lib/cjs/components/editor/editor.js.map +0 -1
- package/lib/cjs/components/editor/index.js +0 -10
- package/lib/cjs/components/editor/index.js.map +0 -1
- package/lib/cjs/components/editor/memtion.js +0 -302
- package/lib/cjs/components/editor/memtion.js.map +0 -1
- package/lib/cjs/components/flex/flex.js +0 -36
- package/lib/cjs/components/flex/flex.js.map +0 -1
- package/lib/cjs/components/flex/index.js +0 -10
- package/lib/cjs/components/flex/index.js.map +0 -1
- package/lib/cjs/components/form/context.js +0 -10
- package/lib/cjs/components/form/context.js.map +0 -1
- package/lib/cjs/components/form/field.js +0 -81
- package/lib/cjs/components/form/field.js.map +0 -1
- package/lib/cjs/components/form/form.js +0 -76
- package/lib/cjs/components/form/form.js.map +0 -1
- package/lib/cjs/components/form/index.js +0 -10
- package/lib/cjs/components/form/index.js.map +0 -1
- package/lib/cjs/components/form/useConfig.js +0 -38
- package/lib/cjs/components/form/useConfig.js.map +0 -1
- package/lib/cjs/components/form/useForm.js +0 -127
- package/lib/cjs/components/form/useForm.js.map +0 -1
- package/lib/cjs/components/form/utils.js +0 -33
- package/lib/cjs/components/form/utils.js.map +0 -1
- package/lib/cjs/components/icon/icon.js +0 -31
- package/lib/cjs/components/icon/icon.js.map +0 -1
- package/lib/cjs/components/icon/index.js +0 -10
- package/lib/cjs/components/icon/index.js.map +0 -1
- package/lib/cjs/components/image/image.js +0 -103
- package/lib/cjs/components/image/image.js.map +0 -1
- package/lib/cjs/components/image/index.js +0 -10
- package/lib/cjs/components/image/index.js.map +0 -1
- package/lib/cjs/components/image/list.js +0 -47
- package/lib/cjs/components/image/list.js.map +0 -1
- package/lib/cjs/components/input/container.js +0 -22
- package/lib/cjs/components/input/container.js.map +0 -1
- package/lib/cjs/components/input/index.js +0 -10
- package/lib/cjs/components/input/index.js.map +0 -1
- package/lib/cjs/components/input/input.js +0 -85
- package/lib/cjs/components/input/input.js.map +0 -1
- package/lib/cjs/components/input/number.js +0 -118
- package/lib/cjs/components/input/number.js.map +0 -1
- package/lib/cjs/components/input/range.js +0 -82
- package/lib/cjs/components/input/range.js.map +0 -1
- package/lib/cjs/components/input/textarea.js +0 -64
- package/lib/cjs/components/input/textarea.js.map +0 -1
- package/lib/cjs/components/list/index.js +0 -10
- package/lib/cjs/components/list/index.js.map +0 -1
- package/lib/cjs/components/list/item.js +0 -23
- package/lib/cjs/components/list/item.js.map +0 -1
- package/lib/cjs/components/list/list.js +0 -33
- package/lib/cjs/components/list/list.js.map +0 -1
- package/lib/cjs/components/loading/index.js +0 -10
- package/lib/cjs/components/loading/index.js.map +0 -1
- package/lib/cjs/components/loading/loading.js +0 -26
- package/lib/cjs/components/loading/loading.js.map +0 -1
- package/lib/cjs/components/message/index.js +0 -11
- package/lib/cjs/components/message/index.js.map +0 -1
- package/lib/cjs/components/message/message.js +0 -239
- package/lib/cjs/components/message/message.js.map +0 -1
- package/lib/cjs/components/modal/content.js +0 -45
- package/lib/cjs/components/modal/content.js.map +0 -1
- package/lib/cjs/components/modal/context.js +0 -10
- package/lib/cjs/components/modal/context.js.map +0 -1
- package/lib/cjs/components/modal/hookModal.js +0 -31
- package/lib/cjs/components/modal/hookModal.js.map +0 -1
- package/lib/cjs/components/modal/index.js +0 -10
- package/lib/cjs/components/modal/index.js.map +0 -1
- package/lib/cjs/components/modal/modal.js +0 -140
- package/lib/cjs/components/modal/modal.js.map +0 -1
- package/lib/cjs/components/modal/modalManager.js +0 -83
- package/lib/cjs/components/modal/modalManager.js.map +0 -1
- package/lib/cjs/components/modal/useModal.js +0 -38
- package/lib/cjs/components/modal/useModal.js.map +0 -1
- package/lib/cjs/components/pagination/index.js +0 -10
- package/lib/cjs/components/pagination/index.js.map +0 -1
- package/lib/cjs/components/pagination/page.js +0 -32
- package/lib/cjs/components/pagination/page.js.map +0 -1
- package/lib/cjs/components/pagination/pagination.js +0 -52
- package/lib/cjs/components/pagination/pagination.js.map +0 -1
- package/lib/cjs/components/picker/colors/footer.js +0 -39
- package/lib/cjs/components/picker/colors/footer.js.map +0 -1
- package/lib/cjs/components/picker/colors/handle.js +0 -18
- package/lib/cjs/components/picker/colors/handle.js.map +0 -1
- package/lib/cjs/components/picker/colors/index.js +0 -72
- package/lib/cjs/components/picker/colors/index.js.map +0 -1
- package/lib/cjs/components/picker/daterange/daterange.js +0 -60
- package/lib/cjs/components/picker/daterange/daterange.js.map +0 -1
- package/lib/cjs/components/picker/daterange/index.js +0 -11
- package/lib/cjs/components/picker/daterange/index.js.map +0 -1
- package/lib/cjs/components/picker/daterange/panel.js +0 -55
- package/lib/cjs/components/picker/daterange/panel.js.map +0 -1
- package/lib/cjs/components/picker/dates/dates.js +0 -63
- package/lib/cjs/components/picker/dates/dates.js.map +0 -1
- package/lib/cjs/components/picker/dates/index.js +0 -73
- package/lib/cjs/components/picker/dates/index.js.map +0 -1
- package/lib/cjs/components/picker/dates/panel.js +0 -93
- package/lib/cjs/components/picker/dates/panel.js.map +0 -1
- package/lib/cjs/components/picker/time/index.js +0 -55
- package/lib/cjs/components/picker/time/index.js.map +0 -1
- package/lib/cjs/components/picker/time/item.js +0 -23
- package/lib/cjs/components/picker/time/item.js.map +0 -1
- package/lib/cjs/components/picker/time/panel.js +0 -104
- package/lib/cjs/components/picker/time/panel.js.map +0 -1
- package/lib/cjs/components/popconfirm/index.js +0 -10
- package/lib/cjs/components/popconfirm/index.js.map +0 -1
- package/lib/cjs/components/popconfirm/popconfirm.js +0 -55
- package/lib/cjs/components/popconfirm/popconfirm.js.map +0 -1
- package/lib/cjs/components/popup/content.js +0 -51
- package/lib/cjs/components/popup/content.js.map +0 -1
- package/lib/cjs/components/popup/index.js +0 -10
- package/lib/cjs/components/popup/index.js.map +0 -1
- package/lib/cjs/components/popup/popup.js +0 -495
- package/lib/cjs/components/popup/popup.js.map +0 -1
- package/lib/cjs/components/progress/circle.js +0 -16
- package/lib/cjs/components/progress/circle.js.map +0 -1
- package/lib/cjs/components/progress/index.js +0 -10
- package/lib/cjs/components/progress/index.js.map +0 -1
- package/lib/cjs/components/progress/line.js +0 -22
- package/lib/cjs/components/progress/line.js.map +0 -1
- package/lib/cjs/components/progress/progress.js +0 -90
- package/lib/cjs/components/progress/progress.js.map +0 -1
- package/lib/cjs/components/radio/index.js +0 -10
- package/lib/cjs/components/radio/index.js.map +0 -1
- package/lib/cjs/components/radio/item.js +0 -25
- package/lib/cjs/components/radio/item.js.map +0 -1
- package/lib/cjs/components/radio/radio.js +0 -40
- package/lib/cjs/components/radio/radio.js.map +0 -1
- package/lib/cjs/components/resizable/index.js +0 -10
- package/lib/cjs/components/resizable/index.js.map +0 -1
- package/lib/cjs/components/resizable/resizable.js +0 -68
- package/lib/cjs/components/resizable/resizable.js.map +0 -1
- package/lib/cjs/components/river/index.js +0 -10
- package/lib/cjs/components/river/index.js.map +0 -1
- package/lib/cjs/components/river/river.js +0 -114
- package/lib/cjs/components/river/river.js.map +0 -1
- package/lib/cjs/components/scroll/index.js +0 -10
- package/lib/cjs/components/scroll/index.js.map +0 -1
- package/lib/cjs/components/scroll/scroll.js +0 -78
- package/lib/cjs/components/scroll/scroll.js.map +0 -1
- package/lib/cjs/components/select/index.js +0 -10
- package/lib/cjs/components/select/index.js.map +0 -1
- package/lib/cjs/components/select/options.js +0 -55
- package/lib/cjs/components/select/options.js.map +0 -1
- package/lib/cjs/components/select/select.js +0 -103
- package/lib/cjs/components/select/select.js.map +0 -1
- package/lib/cjs/components/step/divider.js +0 -12
- package/lib/cjs/components/step/divider.js.map +0 -1
- package/lib/cjs/components/step/index.js +0 -10
- package/lib/cjs/components/step/index.js.map +0 -1
- package/lib/cjs/components/step/item.js +0 -30
- package/lib/cjs/components/step/item.js.map +0 -1
- package/lib/cjs/components/step/step.js +0 -44
- package/lib/cjs/components/step/step.js.map +0 -1
- package/lib/cjs/components/swiper/index.js +0 -10
- package/lib/cjs/components/swiper/index.js.map +0 -1
- package/lib/cjs/components/swiper/item.js +0 -33
- package/lib/cjs/components/swiper/item.js.map +0 -1
- package/lib/cjs/components/swiper/swiper.js +0 -241
- package/lib/cjs/components/swiper/swiper.js.map +0 -1
- package/lib/cjs/components/tabs/contents.js +0 -28
- package/lib/cjs/components/tabs/contents.js.map +0 -1
- package/lib/cjs/components/tabs/helper.js +0 -68
- package/lib/cjs/components/tabs/helper.js.map +0 -1
- package/lib/cjs/components/tabs/index.js +0 -10
- package/lib/cjs/components/tabs/index.js.map +0 -1
- package/lib/cjs/components/tabs/item.js +0 -12
- package/lib/cjs/components/tabs/item.js.map +0 -1
- package/lib/cjs/components/tabs/navs.js +0 -38
- package/lib/cjs/components/tabs/navs.js.map +0 -1
- package/lib/cjs/components/tabs/tabs.js +0 -255
- 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 -68
- package/lib/cjs/components/tree/item.js.map +0 -1
- package/lib/cjs/components/tree/tree.js +0 -237
- package/lib/cjs/components/tree/tree.js.map +0 -1
- package/lib/cjs/components/tree/virtual.js +0 -52
- package/lib/cjs/components/tree/virtual.js.map +0 -1
- package/lib/cjs/components/upload/dropbox.js +0 -54
- package/lib/cjs/components/upload/dropbox.js.map +0 -1
- package/lib/cjs/components/upload/index.js +0 -10
- package/lib/cjs/components/upload/index.js.map +0 -1
- package/lib/cjs/components/upload/renderFile.js +0 -66
- package/lib/cjs/components/upload/renderFile.js.map +0 -1
- package/lib/cjs/components/upload/upload.js +0 -163
- package/lib/cjs/components/upload/upload.js.map +0 -1
- package/lib/cjs/components/utils/empty/index.js +0 -19
- package/lib/cjs/components/utils/empty/index.js.map +0 -1
- package/lib/cjs/components/utils/helpericon/helpericon.js +0 -32
- package/lib/cjs/components/utils/helpericon/helpericon.js.map +0 -1
- package/lib/cjs/components/utils/helpericon/index.js +0 -10
- package/lib/cjs/components/utils/helpericon/index.js.map +0 -1
- package/lib/cjs/components/video/index.js +0 -10
- package/lib/cjs/components/video/index.js.map +0 -1
- package/lib/cjs/components/video/video.js +0 -181
- package/lib/cjs/components/video/video.js.map +0 -1
- package/lib/cjs/index.js +0 -92
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/js/hooks.js +0 -272
- package/lib/cjs/js/hooks.js.map +0 -1
- package/lib/cjs/js/usePreview/content.js +0 -164
- package/lib/cjs/js/usePreview/content.js.map +0 -1
- package/lib/cjs/js/usePreview/index.js +0 -27
- package/lib/cjs/js/usePreview/index.js.map +0 -1
- package/lib/cjs/js/usePreview/renderFile.js +0 -24
- package/lib/cjs/js/usePreview/renderFile.js.map +0 -1
- package/lib/cjs/js/usePreview/type.js +0 -13
- package/lib/cjs/js/usePreview/type.js.map +0 -1
- package/lib/cjs/js/useRipple/index.js +0 -51
- package/lib/cjs/js/useRipple/index.js.map +0 -1
- package/lib/cjs/js/useTheme/index.js +0 -155
- package/lib/cjs/js/useTheme/index.js.map +0 -1
- package/lib/cjs/js/utils.js +0 -302
- package/lib/cjs/js/utils.js.map +0 -1
- package/lib/css/colors.css +0 -792
- package/lib/css/index.css.map +0 -1
- package/lib/css/input.css +0 -210
- package/lib/css/reset.css +0 -140
- package/lib/css/tokens.css +0 -13
- package/lib/css/utilities.css +0 -1973
- package/lib/es/components/affix/affix.js.map +0 -1
- package/lib/es/components/affix/index.js.map +0 -1
- package/lib/es/components/affix/totop.js.map +0 -1
- package/lib/es/components/badge/badge.js.map +0 -1
- package/lib/es/components/badge/index.js.map +0 -1
- package/lib/es/components/button/button.js.map +0 -1
- package/lib/es/components/button/confirm.js.map +0 -1
- package/lib/es/components/button/group.js.map +0 -1
- package/lib/es/components/button/index.js.map +0 -1
- package/lib/es/components/button/toggle.js.map +0 -1
- package/lib/es/components/card/card.js.map +0 -1
- package/lib/es/components/card/index.js.map +0 -1
- package/lib/es/components/checkbox/checkbox.js.map +0 -1
- package/lib/es/components/checkbox/index.js.map +0 -1
- package/lib/es/components/checkbox/item.js.map +0 -1
- package/lib/es/components/collapse/collapse.js.map +0 -1
- package/lib/es/components/collapse/index.js.map +0 -1
- package/lib/es/components/collapse/item.js.map +0 -1
- package/lib/es/components/datagrid/cell.js.map +0 -1
- package/lib/es/components/datagrid/datagrid.js.map +0 -1
- package/lib/es/components/datagrid/helper.js.map +0 -1
- package/lib/es/components/datagrid/index.js.map +0 -1
- package/lib/es/components/datagrid/resize.js.map +0 -1
- package/lib/es/components/datagrid/row.js.map +0 -1
- package/lib/es/components/datagrid/sorter.js.map +0 -1
- package/lib/es/components/datagrid/virtual.js.map +0 -1
- package/lib/es/components/description/description.js.map +0 -1
- package/lib/es/components/description/index.js.map +0 -1
- package/lib/es/components/drawer/drawer.js.map +0 -1
- package/lib/es/components/drawer/index.js.map +0 -1
- package/lib/es/components/dropdown/dropdown.js.map +0 -1
- package/lib/es/components/dropdown/index.js.map +0 -1
- package/lib/es/components/dropdown/item.js.map +0 -1
- package/lib/es/components/editor/controls.js.map +0 -1
- package/lib/es/components/editor/editor.js.map +0 -1
- package/lib/es/components/editor/index.js.map +0 -1
- package/lib/es/components/editor/memtion.js.map +0 -1
- package/lib/es/components/flex/flex.js.map +0 -1
- package/lib/es/components/flex/index.js.map +0 -1
- package/lib/es/components/form/context.js.map +0 -1
- package/lib/es/components/form/field.js.map +0 -1
- package/lib/es/components/form/form.js.map +0 -1
- package/lib/es/components/form/index.js.map +0 -1
- package/lib/es/components/form/useConfig.js.map +0 -1
- package/lib/es/components/form/useForm.js.map +0 -1
- package/lib/es/components/form/utils.js.map +0 -1
- package/lib/es/components/icon/icon.js.map +0 -1
- package/lib/es/components/icon/index.js.map +0 -1
- package/lib/es/components/image/image.js.map +0 -1
- package/lib/es/components/image/index.js.map +0 -1
- package/lib/es/components/image/list.js.map +0 -1
- package/lib/es/components/input/container.js.map +0 -1
- package/lib/es/components/input/index.js.map +0 -1
- package/lib/es/components/input/input.js.map +0 -1
- package/lib/es/components/input/number.js.map +0 -1
- package/lib/es/components/input/range.js.map +0 -1
- package/lib/es/components/input/textarea.js.map +0 -1
- package/lib/es/components/list/index.js.map +0 -1
- package/lib/es/components/list/item.js.map +0 -1
- package/lib/es/components/list/list.js.map +0 -1
- package/lib/es/components/loading/index.js.map +0 -1
- package/lib/es/components/loading/loading.js.map +0 -1
- package/lib/es/components/message/index.js.map +0 -1
- package/lib/es/components/message/message.js.map +0 -1
- package/lib/es/components/modal/content.js.map +0 -1
- package/lib/es/components/modal/context.js.map +0 -1
- package/lib/es/components/modal/hookModal.js.map +0 -1
- package/lib/es/components/modal/index.js.map +0 -1
- package/lib/es/components/modal/modal.js.map +0 -1
- package/lib/es/components/modal/modalManager.js.map +0 -1
- package/lib/es/components/modal/useModal.js.map +0 -1
- package/lib/es/components/pagination/index.js.map +0 -1
- package/lib/es/components/pagination/page.js.map +0 -1
- package/lib/es/components/pagination/pagination.js.map +0 -1
- package/lib/es/components/picker/colors/footer.js.map +0 -1
- package/lib/es/components/picker/colors/handle.js.map +0 -1
- package/lib/es/components/picker/colors/index.js.map +0 -1
- package/lib/es/components/picker/daterange/daterange.js.map +0 -1
- package/lib/es/components/picker/daterange/index.js.map +0 -1
- package/lib/es/components/picker/daterange/panel.js.map +0 -1
- package/lib/es/components/picker/dates/dates.js.map +0 -1
- package/lib/es/components/picker/dates/index.js.map +0 -1
- package/lib/es/components/picker/dates/panel.js.map +0 -1
- package/lib/es/components/picker/time/index.js.map +0 -1
- package/lib/es/components/picker/time/item.js.map +0 -1
- package/lib/es/components/picker/time/panel.js.map +0 -1
- package/lib/es/components/popconfirm/index.js.map +0 -1
- package/lib/es/components/popconfirm/popconfirm.js.map +0 -1
- package/lib/es/components/popup/content.js.map +0 -1
- package/lib/es/components/popup/index.js.map +0 -1
- package/lib/es/components/popup/popup.js.map +0 -1
- package/lib/es/components/progress/circle.js.map +0 -1
- package/lib/es/components/progress/index.js.map +0 -1
- package/lib/es/components/progress/line.js.map +0 -1
- package/lib/es/components/progress/progress.js.map +0 -1
- package/lib/es/components/radio/index.js.map +0 -1
- package/lib/es/components/radio/item.js.map +0 -1
- package/lib/es/components/radio/radio.js.map +0 -1
- package/lib/es/components/resizable/index.js.map +0 -1
- package/lib/es/components/resizable/resizable.js.map +0 -1
- package/lib/es/components/river/index.js.map +0 -1
- package/lib/es/components/river/river.js.map +0 -1
- package/lib/es/components/scroll/index.js.map +0 -1
- package/lib/es/components/scroll/scroll.js.map +0 -1
- package/lib/es/components/select/index.js.map +0 -1
- package/lib/es/components/select/options.js.map +0 -1
- package/lib/es/components/select/select.js.map +0 -1
- package/lib/es/components/step/divider.js.map +0 -1
- package/lib/es/components/step/index.js.map +0 -1
- package/lib/es/components/step/item.js.map +0 -1
- package/lib/es/components/step/step.js.map +0 -1
- package/lib/es/components/swiper/index.js.map +0 -1
- package/lib/es/components/swiper/item.js.map +0 -1
- package/lib/es/components/swiper/swiper.js.map +0 -1
- package/lib/es/components/tabs/contents.js.map +0 -1
- package/lib/es/components/tabs/helper.js.map +0 -1
- package/lib/es/components/tabs/index.js.map +0 -1
- package/lib/es/components/tabs/item.js.map +0 -1
- package/lib/es/components/tabs/navs.js.map +0 -1
- package/lib/es/components/tabs/tabs.js.map +0 -1
- package/lib/es/components/tag/index.js.map +0 -1
- package/lib/es/components/tag/tag.js.map +0 -1
- package/lib/es/components/text/highlight.js.map +0 -1
- package/lib/es/components/text/index.js.map +0 -1
- package/lib/es/components/text/number.js.map +0 -1
- package/lib/es/components/text/text.js.map +0 -1
- package/lib/es/components/text/time.js.map +0 -1
- package/lib/es/components/tree/index.js.map +0 -1
- package/lib/es/components/tree/item.js.map +0 -1
- package/lib/es/components/tree/tree.js.map +0 -1
- package/lib/es/components/tree/virtual.js.map +0 -1
- package/lib/es/components/upload/dropbox.js.map +0 -1
- package/lib/es/components/upload/index.js.map +0 -1
- package/lib/es/components/upload/renderFile.js.map +0 -1
- package/lib/es/components/upload/upload.js.map +0 -1
- package/lib/es/components/utils/empty/index.js.map +0 -1
- package/lib/es/components/utils/helpericon/helpericon.js.map +0 -1
- package/lib/es/components/utils/helpericon/index.js.map +0 -1
- package/lib/es/components/video/index.js.map +0 -1
- package/lib/es/components/video/video.js.map +0 -1
- package/lib/es/index.js.map +0 -1
- package/lib/es/js/hooks.js.map +0 -1
- package/lib/es/js/usePreview/content.js.map +0 -1
- package/lib/es/js/usePreview/index.js.map +0 -1
- package/lib/es/js/usePreview/renderFile.js.map +0 -1
- package/lib/es/js/usePreview/type.js.map +0 -1
- package/lib/es/js/useRipple/index.js.map +0 -1
- package/lib/es/js/useTheme/index.js.map +0 -1
- package/lib/es/js/utils.js.map +0 -1
|
@@ -1,495 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var radash = require('radash');
|
|
7
|
-
var react = require('react');
|
|
8
|
-
var hooks = require('../../js/hooks.js');
|
|
9
|
-
var utils = require('../../js/utils.js');
|
|
10
|
-
var content = require('./content.js');
|
|
11
|
-
|
|
12
|
-
const REACT_FORWARD_REF = Symbol.for("react.forward_ref");
|
|
13
|
-
const REACT_FRAGMENT = Symbol.for("react.fragment");
|
|
14
|
-
const canAttachRef = (el) => {
|
|
15
|
-
if (!react.isValidElement(el))
|
|
16
|
-
return false;
|
|
17
|
-
const t = el.type;
|
|
18
|
-
if (typeof t === "string")
|
|
19
|
-
return true;
|
|
20
|
-
if (t?.prototype?.isReactComponent)
|
|
21
|
-
return true;
|
|
22
|
-
if (t?.$$typeof === REACT_FORWARD_REF)
|
|
23
|
-
return true;
|
|
24
|
-
return false;
|
|
25
|
-
};
|
|
26
|
-
function Popup(props) {
|
|
27
|
-
const { visible = false, content: content$1, trigger = "hover", gap = 12, offset = 8, position = "top", showDelay = 16, hideDelay = 12, touchable, arrow = true, align = "center", fitSize, disabled, style, className, children, onVisibleChange, } = props;
|
|
28
|
-
const triggerRef = react.useRef(null);
|
|
29
|
-
const contentRef = react.useRef(null);
|
|
30
|
-
const timerRef = react.useRef(null);
|
|
31
|
-
const afterHideTimerRef = react.useRef(null);
|
|
32
|
-
const rafRef = react.useRef(null);
|
|
33
|
-
const [show, setShow] = react.useState(false);
|
|
34
|
-
const showRef = react.useRef(false);
|
|
35
|
-
showRef.current = show;
|
|
36
|
-
const latestRef = react.useRef({});
|
|
37
|
-
latestRef.current = {
|
|
38
|
-
disabled,
|
|
39
|
-
trigger,
|
|
40
|
-
touchable,
|
|
41
|
-
showDelay,
|
|
42
|
-
hideDelay,
|
|
43
|
-
position,
|
|
44
|
-
gap,
|
|
45
|
-
offset,
|
|
46
|
-
align,
|
|
47
|
-
fitSize,
|
|
48
|
-
onVisibleChange,
|
|
49
|
-
};
|
|
50
|
-
const phaseRef = react.useRef("");
|
|
51
|
-
const lastPosRef = react.useRef(null);
|
|
52
|
-
const lastArrowRef = react.useRef(null);
|
|
53
|
-
const arrowElRef = react.useRef(null);
|
|
54
|
-
const pointRef = react.useRef(null);
|
|
55
|
-
const clearTimer = () => {
|
|
56
|
-
if (!timerRef.current)
|
|
57
|
-
return;
|
|
58
|
-
clearTimeout(timerRef.current);
|
|
59
|
-
timerRef.current = null;
|
|
60
|
-
phaseRef.current = "";
|
|
61
|
-
};
|
|
62
|
-
const clearAllTimers = () => {
|
|
63
|
-
clearTimer();
|
|
64
|
-
if (afterHideTimerRef.current) {
|
|
65
|
-
clearTimeout(afterHideTimerRef.current);
|
|
66
|
-
afterHideTimerRef.current = null;
|
|
67
|
-
}
|
|
68
|
-
if (rafRef.current !== null) {
|
|
69
|
-
cancelAnimationFrame(rafRef.current);
|
|
70
|
-
rafRef.current = null;
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
const setContentVisible = (visible) => {
|
|
74
|
-
const el = contentRef.current;
|
|
75
|
-
if (!el)
|
|
76
|
-
return;
|
|
77
|
-
el.style.opacity = visible ? "1" : "0";
|
|
78
|
-
el.style.transform = visible ? "none" : "translate(0, 2px)";
|
|
79
|
-
};
|
|
80
|
-
const ensureBaseStyle = () => {
|
|
81
|
-
const el = contentRef.current;
|
|
82
|
-
if (!el)
|
|
83
|
-
return;
|
|
84
|
-
const pos = "fixed";
|
|
85
|
-
if (el.style.position !== pos)
|
|
86
|
-
el.style.position = pos;
|
|
87
|
-
};
|
|
88
|
-
const applyFitSize = () => {
|
|
89
|
-
const o = latestRef.current;
|
|
90
|
-
const contentEl = contentRef.current;
|
|
91
|
-
if (!contentEl)
|
|
92
|
-
return;
|
|
93
|
-
const vertical = ["top", "bottom"].includes(o.position);
|
|
94
|
-
const key = vertical ? "width" : "height";
|
|
95
|
-
if (!o.fitSize) {
|
|
96
|
-
contentEl.style[key] = "";
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
const triggerEl = triggerRef.current;
|
|
100
|
-
if (!triggerEl)
|
|
101
|
-
return;
|
|
102
|
-
const size = triggerEl[vertical ? "offsetWidth" : "offsetHeight"];
|
|
103
|
-
contentEl.style[key] =
|
|
104
|
-
typeof size === "number" ? `${size}px` : "";
|
|
105
|
-
};
|
|
106
|
-
const applyArrow = (arrowX, arrowY, arrowPos) => {
|
|
107
|
-
const contentEl = contentRef.current;
|
|
108
|
-
if (!contentEl)
|
|
109
|
-
return;
|
|
110
|
-
const arrowEl = arrowElRef.current ??
|
|
111
|
-
contentEl.querySelector(".i-popup-arrow");
|
|
112
|
-
arrowElRef.current = arrowEl;
|
|
113
|
-
if (!arrowEl)
|
|
114
|
-
return;
|
|
115
|
-
let left = arrowX ?? 0;
|
|
116
|
-
let top = arrowY ?? 0;
|
|
117
|
-
let transform = "";
|
|
118
|
-
switch (arrowPos) {
|
|
119
|
-
case "left":
|
|
120
|
-
left += 2;
|
|
121
|
-
transform = `translate(-100%, -50%) rotate(180deg)`;
|
|
122
|
-
break;
|
|
123
|
-
case "right":
|
|
124
|
-
left -= 2;
|
|
125
|
-
transform = `translate(0, -50%)`;
|
|
126
|
-
break;
|
|
127
|
-
case "top":
|
|
128
|
-
top -= 2;
|
|
129
|
-
transform = `translate(-50%, -50%) rotate(-90deg)`;
|
|
130
|
-
break;
|
|
131
|
-
case "bottom":
|
|
132
|
-
top += 2;
|
|
133
|
-
transform = `translate(-50%, -50%) rotate(90deg)`;
|
|
134
|
-
break;
|
|
135
|
-
}
|
|
136
|
-
const prev = lastArrowRef.current;
|
|
137
|
-
if (prev &&
|
|
138
|
-
prev.left === left &&
|
|
139
|
-
prev.top === top &&
|
|
140
|
-
prev.transform === transform) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
lastArrowRef.current = { left, top, transform };
|
|
144
|
-
arrowEl.style.left = `${left}px`;
|
|
145
|
-
arrowEl.style.top = `${top}px`;
|
|
146
|
-
arrowEl.style.transform = transform;
|
|
147
|
-
};
|
|
148
|
-
const applyLeftTop = (left, top) => {
|
|
149
|
-
const contentEl = contentRef.current;
|
|
150
|
-
if (!contentEl)
|
|
151
|
-
return;
|
|
152
|
-
const prev = lastPosRef.current;
|
|
153
|
-
if (prev && prev.left === left && prev.top === top)
|
|
154
|
-
return;
|
|
155
|
-
lastPosRef.current = { left, top };
|
|
156
|
-
contentEl.style.left = `${left}px`;
|
|
157
|
-
contentEl.style.top = `${top}px`;
|
|
158
|
-
};
|
|
159
|
-
const computeRelativePosition = () => {
|
|
160
|
-
const triggerEl = triggerRef.current;
|
|
161
|
-
const contentEl = contentRef.current;
|
|
162
|
-
if (!triggerEl || !contentEl)
|
|
163
|
-
return;
|
|
164
|
-
const o = latestRef.current;
|
|
165
|
-
applyFitSize();
|
|
166
|
-
const [left, top, { arrowX, arrowY, arrowPos }] = utils.getPosition(triggerEl, contentEl, {
|
|
167
|
-
position: o.position,
|
|
168
|
-
gap: o.gap,
|
|
169
|
-
offset: o.offset,
|
|
170
|
-
align: o.align,
|
|
171
|
-
refWindow: true,
|
|
172
|
-
});
|
|
173
|
-
applyLeftTop(left, top);
|
|
174
|
-
applyArrow(arrowX, arrowY, arrowPos);
|
|
175
|
-
};
|
|
176
|
-
const computePointPosition = () => {
|
|
177
|
-
const contentEl = contentRef.current;
|
|
178
|
-
if (!contentEl)
|
|
179
|
-
return;
|
|
180
|
-
const point = pointRef.current;
|
|
181
|
-
if (!point)
|
|
182
|
-
return;
|
|
183
|
-
const [left, top] = utils.getPointPosition(point, contentEl);
|
|
184
|
-
applyLeftTop(left, top);
|
|
185
|
-
};
|
|
186
|
-
const scheduleComputePosition = () => {
|
|
187
|
-
if (!showRef.current)
|
|
188
|
-
return;
|
|
189
|
-
if (rafRef.current !== null)
|
|
190
|
-
return;
|
|
191
|
-
rafRef.current = requestAnimationFrame(() => {
|
|
192
|
-
rafRef.current = null;
|
|
193
|
-
if (!showRef.current)
|
|
194
|
-
return;
|
|
195
|
-
ensureBaseStyle();
|
|
196
|
-
if (latestRef.current.trigger === "contextmenu") {
|
|
197
|
-
computePointPosition();
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
computeRelativePosition();
|
|
201
|
-
});
|
|
202
|
-
};
|
|
203
|
-
const handleShow = () => {
|
|
204
|
-
const opts = latestRef.current;
|
|
205
|
-
if (opts.disabled)
|
|
206
|
-
return;
|
|
207
|
-
clearAllTimers();
|
|
208
|
-
if (showRef.current &&
|
|
209
|
-
(opts.trigger !== "hover" ||
|
|
210
|
-
(opts.trigger === "hover" && !opts.touchable))) {
|
|
211
|
-
ensureBaseStyle();
|
|
212
|
-
computeRelativePosition();
|
|
213
|
-
setContentVisible(true);
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
phaseRef.current = "showing";
|
|
217
|
-
if (!showRef.current) {
|
|
218
|
-
lastPosRef.current = null;
|
|
219
|
-
lastArrowRef.current = null;
|
|
220
|
-
arrowElRef.current = null;
|
|
221
|
-
setShow(true);
|
|
222
|
-
}
|
|
223
|
-
timerRef.current = setTimeout(() => {
|
|
224
|
-
if (phaseRef.current !== "showing")
|
|
225
|
-
return;
|
|
226
|
-
rafRef.current = requestAnimationFrame(() => {
|
|
227
|
-
rafRef.current = null;
|
|
228
|
-
if (phaseRef.current !== "showing")
|
|
229
|
-
return;
|
|
230
|
-
if (!contentRef.current)
|
|
231
|
-
return;
|
|
232
|
-
ensureBaseStyle();
|
|
233
|
-
if (opts.trigger === "contextmenu") {
|
|
234
|
-
computePointPosition();
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
computeRelativePosition();
|
|
238
|
-
}
|
|
239
|
-
setContentVisible(true);
|
|
240
|
-
opts.onVisibleChange?.(true);
|
|
241
|
-
clearTimer();
|
|
242
|
-
phaseRef.current = "";
|
|
243
|
-
});
|
|
244
|
-
}, opts.showDelay);
|
|
245
|
-
};
|
|
246
|
-
const handleHide = () => {
|
|
247
|
-
if (!showRef.current)
|
|
248
|
-
return;
|
|
249
|
-
clearAllTimers();
|
|
250
|
-
phaseRef.current = "hiding";
|
|
251
|
-
timerRef.current = setTimeout(() => {
|
|
252
|
-
if (phaseRef.current !== "hiding") {
|
|
253
|
-
clearTimer();
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
setContentVisible(false);
|
|
257
|
-
afterHideTimerRef.current = setTimeout(() => {
|
|
258
|
-
afterHideTimerRef.current = null;
|
|
259
|
-
setShow(false);
|
|
260
|
-
clearAllTimers();
|
|
261
|
-
latestRef.current.onVisibleChange?.(false);
|
|
262
|
-
phaseRef.current = "";
|
|
263
|
-
}, 160);
|
|
264
|
-
}, latestRef.current.hideDelay);
|
|
265
|
-
};
|
|
266
|
-
const handleToggle = (action) => {
|
|
267
|
-
if (action !== undefined) {
|
|
268
|
-
action ? handleShow() : handleHide();
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
showRef.current ? handleHide() : handleShow();
|
|
272
|
-
};
|
|
273
|
-
const hideRef = react.useRef(handleHide);
|
|
274
|
-
const toggleRef = react.useRef(handleToggle);
|
|
275
|
-
hideRef.current = handleHide;
|
|
276
|
-
toggleRef.current = handleToggle;
|
|
277
|
-
const doHide = react.useMemo(() => () => hideRef.current(), []);
|
|
278
|
-
const doToggle = react.useMemo(() => (action) => toggleRef.current(action), []);
|
|
279
|
-
const mergeRefs = react.useMemo(() => {
|
|
280
|
-
return (...refs) => {
|
|
281
|
-
return (node) => {
|
|
282
|
-
for (const ref of refs) {
|
|
283
|
-
if (!ref)
|
|
284
|
-
continue;
|
|
285
|
-
if (typeof ref === "function") {
|
|
286
|
-
ref(node);
|
|
287
|
-
}
|
|
288
|
-
else {
|
|
289
|
-
ref.current = node;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
};
|
|
293
|
-
};
|
|
294
|
-
}, []);
|
|
295
|
-
const triggerEvents = react.useMemo(() => {
|
|
296
|
-
const setTriggerEl = (e) => {
|
|
297
|
-
const el = e?.currentTarget;
|
|
298
|
-
if (el)
|
|
299
|
-
triggerRef.current = el;
|
|
300
|
-
};
|
|
301
|
-
switch (trigger) {
|
|
302
|
-
case "click":
|
|
303
|
-
return {
|
|
304
|
-
onClick: (e) => {
|
|
305
|
-
setTriggerEl(e);
|
|
306
|
-
doToggle(true);
|
|
307
|
-
},
|
|
308
|
-
};
|
|
309
|
-
case "hover":
|
|
310
|
-
return {
|
|
311
|
-
onMouseEnter: (e) => {
|
|
312
|
-
setTriggerEl(e);
|
|
313
|
-
doToggle(true);
|
|
314
|
-
},
|
|
315
|
-
onMouseLeave: (e) => {
|
|
316
|
-
setTriggerEl(e);
|
|
317
|
-
doToggle(false);
|
|
318
|
-
},
|
|
319
|
-
};
|
|
320
|
-
case "focus":
|
|
321
|
-
return {
|
|
322
|
-
onFocus: (e) => {
|
|
323
|
-
setTriggerEl(e);
|
|
324
|
-
doToggle(true);
|
|
325
|
-
},
|
|
326
|
-
onBlur: (e) => {
|
|
327
|
-
setTriggerEl(e);
|
|
328
|
-
doToggle(false);
|
|
329
|
-
},
|
|
330
|
-
};
|
|
331
|
-
case "contextmenu":
|
|
332
|
-
return {
|
|
333
|
-
onContextMenu: (e) => {
|
|
334
|
-
e.preventDefault();
|
|
335
|
-
e.stopPropagation();
|
|
336
|
-
setTriggerEl(e);
|
|
337
|
-
pointRef.current = {
|
|
338
|
-
pageX: e.clientX,
|
|
339
|
-
pageY: e.clientY,
|
|
340
|
-
};
|
|
341
|
-
if (showRef.current) {
|
|
342
|
-
ensureBaseStyle();
|
|
343
|
-
computePointPosition();
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
clearAllTimers();
|
|
347
|
-
phaseRef.current = "showing";
|
|
348
|
-
lastPosRef.current = null;
|
|
349
|
-
lastArrowRef.current = null;
|
|
350
|
-
arrowElRef.current = null;
|
|
351
|
-
setShow(true);
|
|
352
|
-
timerRef.current = setTimeout(() => {
|
|
353
|
-
if (phaseRef.current !== "showing")
|
|
354
|
-
return;
|
|
355
|
-
if (!contentRef.current)
|
|
356
|
-
return;
|
|
357
|
-
ensureBaseStyle();
|
|
358
|
-
computePointPosition();
|
|
359
|
-
setContentVisible(true);
|
|
360
|
-
clearTimer();
|
|
361
|
-
latestRef.current.onVisibleChange?.(true);
|
|
362
|
-
phaseRef.current = "";
|
|
363
|
-
}, latestRef.current.showDelay);
|
|
364
|
-
},
|
|
365
|
-
};
|
|
366
|
-
default:
|
|
367
|
-
return {};
|
|
368
|
-
}
|
|
369
|
-
}, [doToggle]);
|
|
370
|
-
const triggerNode = react.useMemo(() => {
|
|
371
|
-
const events = triggerEvents;
|
|
372
|
-
const eventKeys = Object.keys(events);
|
|
373
|
-
const items = react.Children.toArray(children);
|
|
374
|
-
let attachedRef = false;
|
|
375
|
-
let cloned = false;
|
|
376
|
-
const nextItems = items.map((item) => {
|
|
377
|
-
if (!react.isValidElement(item))
|
|
378
|
-
return item;
|
|
379
|
-
if (item.type === REACT_FRAGMENT)
|
|
380
|
-
return item;
|
|
381
|
-
const attachRef = !attachedRef && canAttachRef(item);
|
|
382
|
-
if (attachRef)
|
|
383
|
-
attachedRef = true;
|
|
384
|
-
if (!attachRef && eventKeys.length === 0)
|
|
385
|
-
return item;
|
|
386
|
-
const patchedProps = {};
|
|
387
|
-
for (const evt of eventKeys) {
|
|
388
|
-
const ours = events[evt];
|
|
389
|
-
const theirs = item.props?.[evt];
|
|
390
|
-
patchedProps[evt] =
|
|
391
|
-
typeof theirs === "function"
|
|
392
|
-
? (e) => {
|
|
393
|
-
ours(e);
|
|
394
|
-
theirs(e);
|
|
395
|
-
}
|
|
396
|
-
: ours;
|
|
397
|
-
}
|
|
398
|
-
if (attachRef) {
|
|
399
|
-
patchedProps.ref = mergeRefs(item.ref, triggerRef);
|
|
400
|
-
}
|
|
401
|
-
cloned = true;
|
|
402
|
-
return react.cloneElement(item, patchedProps);
|
|
403
|
-
});
|
|
404
|
-
if (!cloned)
|
|
405
|
-
return children;
|
|
406
|
-
return nextItems.length === 1 ? nextItems[0] : jsxRuntime.jsx(jsxRuntime.Fragment, { children: nextItems });
|
|
407
|
-
}, [children, triggerEvents, mergeRefs]);
|
|
408
|
-
const contentTouch = react.useMemo(() => {
|
|
409
|
-
if (!touchable)
|
|
410
|
-
return {};
|
|
411
|
-
const events = {};
|
|
412
|
-
if (trigger === "hover") {
|
|
413
|
-
events["onMouseEnter"] = () => {
|
|
414
|
-
clearTimer();
|
|
415
|
-
};
|
|
416
|
-
events["onMouseLeave"] = () => handleToggle(false);
|
|
417
|
-
}
|
|
418
|
-
return events;
|
|
419
|
-
}, [touchable, trigger]);
|
|
420
|
-
const { observe, unobserve, disconnect } = hooks.useResizeObserver();
|
|
421
|
-
react.useEffect(() => {
|
|
422
|
-
if (!observe)
|
|
423
|
-
return;
|
|
424
|
-
const triggerEl = triggerRef.current;
|
|
425
|
-
const contentEl = contentRef.current;
|
|
426
|
-
if (triggerEl)
|
|
427
|
-
observe(triggerEl, scheduleComputePosition);
|
|
428
|
-
if (contentEl)
|
|
429
|
-
observe(contentEl, scheduleComputePosition);
|
|
430
|
-
return () => {
|
|
431
|
-
if (contentEl)
|
|
432
|
-
unobserve(contentEl);
|
|
433
|
-
if (triggerEl)
|
|
434
|
-
unobserve(triggerEl);
|
|
435
|
-
disconnect();
|
|
436
|
-
};
|
|
437
|
-
}, [trigger, observe, unobserve, disconnect, show]);
|
|
438
|
-
react.useLayoutEffect(() => {
|
|
439
|
-
if (!show)
|
|
440
|
-
return;
|
|
441
|
-
ensureBaseStyle();
|
|
442
|
-
if (latestRef.current.trigger === "contextmenu") {
|
|
443
|
-
computePointPosition();
|
|
444
|
-
}
|
|
445
|
-
else {
|
|
446
|
-
computeRelativePosition();
|
|
447
|
-
}
|
|
448
|
-
}, [show]);
|
|
449
|
-
react.useLayoutEffect(() => {
|
|
450
|
-
doToggle(visible);
|
|
451
|
-
}, [visible]);
|
|
452
|
-
react.useEffect(() => {
|
|
453
|
-
return () => {
|
|
454
|
-
clearAllTimers();
|
|
455
|
-
};
|
|
456
|
-
}, []);
|
|
457
|
-
const mouseUpHandlerRef = react.useRef(() => { });
|
|
458
|
-
mouseUpHandlerRef.current = (e) => {
|
|
459
|
-
if (!showRef.current)
|
|
460
|
-
return;
|
|
461
|
-
const triggerEl = triggerRef.current;
|
|
462
|
-
const contentEl = contentRef.current;
|
|
463
|
-
if (!triggerEl || !contentEl)
|
|
464
|
-
return;
|
|
465
|
-
const tar = e.target;
|
|
466
|
-
if (triggerEl.contains(tar) || contentEl.contains(tar))
|
|
467
|
-
return;
|
|
468
|
-
doHide();
|
|
469
|
-
};
|
|
470
|
-
const onGlobalMouseUp = react.useMemo(() => (e) => mouseUpHandlerRef.current(e), []);
|
|
471
|
-
hooks.useMouseUp(onGlobalMouseUp);
|
|
472
|
-
react.useEffect(() => {
|
|
473
|
-
if (!show)
|
|
474
|
-
return;
|
|
475
|
-
if (typeof window === "undefined")
|
|
476
|
-
return;
|
|
477
|
-
const onScrollOrResize = radash.debounce({ delay: 160 }, () => {
|
|
478
|
-
scheduleComputePosition();
|
|
479
|
-
});
|
|
480
|
-
window.addEventListener("scroll", onScrollOrResize, {
|
|
481
|
-
passive: true,
|
|
482
|
-
capture: true,
|
|
483
|
-
});
|
|
484
|
-
return () => {
|
|
485
|
-
window.removeEventListener("scroll", onScrollOrResize, true);
|
|
486
|
-
};
|
|
487
|
-
}, [show]);
|
|
488
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [triggerNode, show && (jsxRuntime.jsx(content.default, { ref: contentRef, arrow: arrow && trigger !== "contextmenu", style: {
|
|
489
|
-
...style,
|
|
490
|
-
position: "fixed",
|
|
491
|
-
}, className: className, ...contentTouch, trigger: triggerRef.current, children: content$1 }))] }));
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
exports.default = Popup;
|
|
495
|
-
//# sourceMappingURL=popup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"popup.js","sources":["../../../../packages/components/popup/popup.tsx"],"sourcesContent":["import { debounce } from \"radash\";\nimport {\n Children,\n MouseEvent,\n Ref,\n cloneElement,\n isValidElement,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useMouseUp, useResizeObserver } from \"../../js/hooks\";\nimport { getPointPosition, getPosition } from \"../../js/utils\";\nimport Content from \"./content\";\nimport \"./index.css\";\nimport { IPopup } from \"./type\";\n\nconst REACT_FORWARD_REF = Symbol.for(\"react.forward_ref\");\nconst REACT_FRAGMENT = Symbol.for(\"react.fragment\");\n\nconst canAttachRef = (el: any) => {\n if (!isValidElement(el)) return false;\n const t: any = el.type;\n if (typeof t === \"string\") return true;\n if (t?.prototype?.isReactComponent) return true;\n if (t?.$$typeof === REACT_FORWARD_REF) return true;\n return false;\n};\n\nexport default function Popup(props: IPopup) {\n const {\n visible = false,\n content,\n trigger = \"hover\",\n gap = 12,\n offset = 8,\n position = \"top\",\n showDelay = 16,\n hideDelay = 12,\n touchable,\n arrow = true,\n align = \"center\",\n fitSize,\n disabled,\n style,\n className,\n children,\n onVisibleChange,\n } = props;\n\n const triggerRef = useRef<HTMLElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const timerRef = useRef<any>(null);\n const afterHideTimerRef = useRef<any>(null);\n const rafRef = useRef<number | null>(null);\n\n const [show, setShow] = useState(false);\n const showRef = useRef(false);\n showRef.current = show;\n\n const latestRef = useRef<Record<string, any>>({});\n latestRef.current = {\n disabled,\n trigger,\n touchable,\n showDelay,\n hideDelay,\n position,\n gap,\n offset,\n align,\n fitSize,\n onVisibleChange,\n };\n\n const phaseRef = useRef<\"\" | \"showing\" | \"hiding\">(\"\");\n const lastPosRef = useRef<{ left: number; top: number } | null>(null);\n const lastArrowRef = useRef<{\n left: number;\n top: number;\n transform: string;\n } | null>(null);\n const arrowElRef = useRef<HTMLElement | null>(null);\n const pointRef = useRef<{ pageX: number; pageY: number } | null>(null);\n\n const clearTimer = () => {\n if (!timerRef.current) return;\n clearTimeout(timerRef.current);\n timerRef.current = null;\n phaseRef.current = \"\";\n };\n\n const clearAllTimers = () => {\n clearTimer();\n if (afterHideTimerRef.current) {\n clearTimeout(afterHideTimerRef.current);\n afterHideTimerRef.current = null;\n }\n if (rafRef.current !== null) {\n cancelAnimationFrame(rafRef.current);\n rafRef.current = null;\n }\n };\n\n const setContentVisible = (visible: boolean) => {\n const el = contentRef.current;\n if (!el) return;\n el.style.opacity = visible ? \"1\" : \"0\";\n el.style.transform = visible ? \"none\" : \"translate(0, 2px)\";\n };\n\n const ensureBaseStyle = () => {\n const el = contentRef.current;\n if (!el) return;\n const pos = \"fixed\";\n if (el.style.position !== pos) el.style.position = pos;\n };\n\n const applyFitSize = () => {\n const o = latestRef.current;\n const contentEl = contentRef.current;\n if (!contentEl) return;\n\n const vertical = [\"top\", \"bottom\"].includes(o.position);\n const key = vertical ? \"width\" : \"height\";\n if (!o.fitSize) {\n (contentEl.style as any)[key] = \"\";\n return;\n }\n\n const triggerEl = triggerRef.current;\n if (!triggerEl) return;\n\n const size = triggerEl[vertical ? \"offsetWidth\" : \"offsetHeight\"];\n (contentEl.style as any)[key] =\n typeof size === \"number\" ? `${size}px` : \"\";\n };\n\n const applyArrow = (arrowX: number, arrowY: number, arrowPos: string) => {\n const contentEl = contentRef.current;\n if (!contentEl) return;\n\n const arrowEl =\n arrowElRef.current ??\n (contentEl.querySelector(\".i-popup-arrow\") as HTMLElement | null);\n arrowElRef.current = arrowEl;\n if (!arrowEl) return;\n\n let left = arrowX ?? 0;\n let top = arrowY ?? 0;\n let transform = \"\";\n\n switch (arrowPos) {\n case \"left\":\n left += 2;\n transform = `translate(-100%, -50%) rotate(180deg)`;\n break;\n case \"right\":\n left -= 2;\n transform = `translate(0, -50%)`;\n break;\n case \"top\":\n top -= 2;\n transform = `translate(-50%, -50%) rotate(-90deg)`;\n break;\n case \"bottom\":\n top += 2;\n transform = `translate(-50%, -50%) rotate(90deg)`;\n break;\n default:\n break;\n }\n\n const prev = lastArrowRef.current;\n if (\n prev &&\n prev.left === left &&\n prev.top === top &&\n prev.transform === transform\n ) {\n return;\n }\n\n lastArrowRef.current = { left, top, transform };\n arrowEl.style.left = `${left}px`;\n arrowEl.style.top = `${top}px`;\n arrowEl.style.transform = transform;\n };\n\n const applyLeftTop = (left: number, top: number) => {\n const contentEl = contentRef.current;\n if (!contentEl) return;\n\n const prev = lastPosRef.current;\n if (prev && prev.left === left && prev.top === top) return;\n\n lastPosRef.current = { left, top };\n contentEl.style.left = `${left}px`;\n contentEl.style.top = `${top}px`;\n };\n\n const computeRelativePosition = () => {\n const triggerEl = triggerRef.current;\n const contentEl = contentRef.current;\n if (!triggerEl || !contentEl) return;\n\n const o = latestRef.current;\n applyFitSize();\n\n const [left, top, { arrowX, arrowY, arrowPos }] = getPosition(\n triggerEl,\n contentEl,\n {\n position: o.position,\n gap: o.gap,\n offset: o.offset,\n align: o.align,\n refWindow: true,\n },\n );\n\n applyLeftTop(left, top);\n applyArrow(arrowX, arrowY, arrowPos);\n };\n\n const computePointPosition = () => {\n const contentEl = contentRef.current as HTMLElement | null;\n if (!contentEl) return;\n const point = pointRef.current;\n if (!point) return;\n\n const [left, top] = getPointPosition(point as any, contentEl);\n applyLeftTop(left, top);\n };\n\n const scheduleComputePosition = () => {\n if (!showRef.current) return;\n if (rafRef.current !== null) return;\n rafRef.current = requestAnimationFrame(() => {\n rafRef.current = null;\n if (!showRef.current) return;\n ensureBaseStyle();\n\n if (latestRef.current.trigger === \"contextmenu\") {\n computePointPosition();\n return;\n }\n\n computeRelativePosition();\n });\n };\n\n const handleShow = () => {\n const opts = latestRef.current;\n if (opts.disabled) return;\n clearAllTimers();\n if (\n showRef.current &&\n (opts.trigger !== \"hover\" ||\n (opts.trigger === \"hover\" && !opts.touchable))\n ) {\n ensureBaseStyle();\n computeRelativePosition();\n setContentVisible(true);\n return;\n }\n\n phaseRef.current = \"showing\";\n if (!showRef.current) {\n lastPosRef.current = null;\n lastArrowRef.current = null;\n arrowElRef.current = null;\n setShow(true);\n }\n\n timerRef.current = setTimeout(() => {\n if (phaseRef.current !== \"showing\") return;\n\n rafRef.current = requestAnimationFrame(() => {\n rafRef.current = null;\n if (phaseRef.current !== \"showing\") return;\n if (!contentRef.current) return;\n\n ensureBaseStyle();\n if (opts.trigger === \"contextmenu\") {\n computePointPosition();\n } else {\n computeRelativePosition();\n }\n setContentVisible(true);\n opts.onVisibleChange?.(true);\n clearTimer();\n phaseRef.current = \"\";\n });\n }, opts.showDelay);\n };\n\n const handleHide = () => {\n if (!showRef.current) return;\n\n clearAllTimers();\n phaseRef.current = \"hiding\";\n timerRef.current = setTimeout(() => {\n if (phaseRef.current !== \"hiding\") {\n clearTimer();\n return;\n }\n\n setContentVisible(false);\n\n afterHideTimerRef.current = setTimeout(() => {\n afterHideTimerRef.current = null;\n setShow(false);\n clearAllTimers();\n latestRef.current.onVisibleChange?.(false);\n phaseRef.current = \"\";\n }, 160);\n }, latestRef.current.hideDelay);\n };\n\n const handleToggle = (action?: boolean) => {\n if (action !== undefined) {\n action ? handleShow() : handleHide();\n return;\n }\n showRef.current ? handleHide() : handleShow();\n };\n\n const hideRef = useRef(handleHide);\n const toggleRef = useRef(handleToggle);\n hideRef.current = handleHide;\n toggleRef.current = handleToggle;\n\n const doHide = useMemo(() => () => hideRef.current(), []);\n const doToggle = useMemo(\n () => (action?: boolean) => toggleRef.current(action),\n [],\n );\n\n const mergeRefs = useMemo(() => {\n return (...refs: Array<Ref<HTMLElement> | undefined>) => {\n return (node: HTMLElement | null) => {\n for (const ref of refs) {\n if (!ref) continue;\n if (typeof ref === \"function\") {\n ref(node);\n } else {\n (ref as any).current = node;\n }\n }\n };\n };\n }, []);\n\n const triggerEvents = useMemo(() => {\n const setTriggerEl = (e: any) => {\n const el = e?.currentTarget as HTMLElement | null | undefined;\n if (el) triggerRef.current = el;\n };\n\n switch (trigger) {\n case \"click\":\n return {\n onClick: (e: any) => {\n setTriggerEl(e);\n doToggle(true);\n },\n };\n case \"hover\":\n return {\n onMouseEnter: (e: any) => {\n setTriggerEl(e);\n doToggle(true);\n },\n onMouseLeave: (e: any) => {\n setTriggerEl(e);\n doToggle(false);\n },\n };\n case \"focus\":\n return {\n onFocus: (e: any) => {\n setTriggerEl(e);\n doToggle(true);\n },\n onBlur: (e: any) => {\n setTriggerEl(e);\n doToggle(false);\n },\n };\n case \"contextmenu\":\n return {\n onContextMenu: (e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setTriggerEl(e);\n\n pointRef.current = {\n pageX: (e as any).clientX,\n pageY: (e as any).clientY,\n };\n\n if (showRef.current) {\n ensureBaseStyle();\n computePointPosition();\n return;\n }\n\n clearAllTimers();\n phaseRef.current = \"showing\";\n lastPosRef.current = null;\n lastArrowRef.current = null;\n arrowElRef.current = null;\n setShow(true);\n\n timerRef.current = setTimeout(() => {\n if (phaseRef.current !== \"showing\") return;\n if (!contentRef.current) return;\n\n ensureBaseStyle();\n computePointPosition();\n setContentVisible(true);\n clearTimer();\n latestRef.current.onVisibleChange?.(true);\n phaseRef.current = \"\";\n }, latestRef.current.showDelay);\n },\n };\n default:\n return {};\n }\n }, [doToggle]);\n\n const triggerNode = useMemo(() => {\n const events = triggerEvents as any;\n const eventKeys = Object.keys(events);\n const items = Children.toArray(children);\n\n let attachedRef = false;\n let cloned = false;\n\n const nextItems = items.map((item) => {\n if (!isValidElement(item)) return item;\n if ((item as any).type === REACT_FRAGMENT) return item;\n\n const attachRef = !attachedRef && canAttachRef(item);\n if (attachRef) attachedRef = true;\n\n if (!attachRef && eventKeys.length === 0) return item;\n\n const patchedProps: Record<string, any> = {};\n\n for (const evt of eventKeys) {\n const ours = events[evt];\n const theirs = (item.props as any)?.[evt];\n patchedProps[evt] =\n typeof theirs === \"function\"\n ? (e: any) => {\n ours(e);\n theirs(e);\n }\n : ours;\n }\n\n if (attachRef) {\n patchedProps.ref = mergeRefs(\n (item as any).ref,\n triggerRef as any,\n );\n }\n\n cloned = true;\n return cloneElement(item as any, patchedProps);\n });\n\n if (!cloned) return children;\n return nextItems.length === 1 ? nextItems[0] : <>{nextItems}</>;\n }, [children, triggerEvents, mergeRefs]);\n\n const contentTouch = useMemo(() => {\n if (!touchable) return {};\n const events: { [key: string]: () => void } = {};\n\n if (trigger === \"hover\") {\n events[\"onMouseEnter\"] = () => {\n clearTimer();\n };\n events[\"onMouseLeave\"] = () => handleToggle(false);\n }\n\n return events;\n }, [touchable, trigger]);\n\n const { observe, unobserve, disconnect } = useResizeObserver();\n useEffect(() => {\n if (!observe) return;\n const triggerEl = triggerRef.current;\n const contentEl = contentRef.current;\n if (triggerEl) observe(triggerEl, scheduleComputePosition);\n if (contentEl) observe(contentEl, scheduleComputePosition);\n return () => {\n if (contentEl) unobserve(contentEl);\n if (triggerEl) unobserve(triggerEl);\n disconnect();\n };\n }, [trigger, observe, unobserve, disconnect, show]);\n\n useLayoutEffect(() => {\n if (!show) return;\n ensureBaseStyle();\n if (latestRef.current.trigger === \"contextmenu\") {\n computePointPosition();\n } else {\n computeRelativePosition();\n }\n }, [show]);\n\n useLayoutEffect(() => {\n doToggle(visible);\n }, [visible]);\n\n useEffect(() => {\n return () => {\n clearAllTimers();\n };\n }, []);\n\n const mouseUpHandlerRef = useRef<((e: any) => void)>(() => {});\n mouseUpHandlerRef.current = (e) => {\n if (!showRef.current) return;\n const triggerEl = triggerRef.current;\n const contentEl = contentRef.current;\n if (!triggerEl || !contentEl) return;\n const tar = e.target as HTMLElement;\n if (triggerEl.contains(tar) || contentEl.contains(tar)) return;\n doHide();\n };\n const onGlobalMouseUp = useMemo(\n () => (e: any) => mouseUpHandlerRef.current(e),\n [],\n );\n useMouseUp(onGlobalMouseUp);\n\n useEffect(() => {\n if (!show) return;\n if (typeof window === \"undefined\") return;\n\n const onScrollOrResize = debounce({ delay: 160 }, () => {\n scheduleComputePosition();\n });\n\n window.addEventListener(\"scroll\", onScrollOrResize, {\n passive: true,\n capture: true,\n });\n\n return () => {\n window.removeEventListener(\"scroll\", onScrollOrResize, true);\n };\n }, [show]);\n\n return (\n <>\n {triggerNode}\n\n {show && (\n <Content\n ref={contentRef}\n arrow={arrow && trigger !== \"contextmenu\"}\n style={{\n ...style,\n position: \"fixed\",\n }}\n className={className}\n {...contentTouch}\n trigger={triggerRef.current as HTMLElement}\n >\n {content}\n </Content>\n )}\n </>\n );\n}\n"],"names":["isValidElement","content","useRef","useState","getPosition","getPointPosition","useMemo","Children","cloneElement","_jsx","_Fragment","useResizeObserver","useEffect","useLayoutEffect","useMouseUp","debounce","_jsxs","Content"],"mappings":";;;;;;;;;;;AAmBA,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC;AACzD,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;AAEnD,MAAM,YAAY,GAAG,CAAC,EAAO,KAAI;AAC7B,IAAA,IAAI,CAACA,oBAAc,CAAC,EAAE,CAAC;AAAE,QAAA,OAAO,KAAK;AACrC,IAAA,MAAM,CAAC,GAAQ,EAAE,CAAC,IAAI;IACtB,IAAI,OAAO,CAAC,KAAK,QAAQ;AAAE,QAAA,OAAO,IAAI;AACtC,IAAA,IAAI,CAAC,EAAE,SAAS,EAAE,gBAAgB;AAAE,QAAA,OAAO,IAAI;AAC/C,IAAA,IAAI,CAAC,EAAE,QAAQ,KAAK,iBAAiB;AAAE,QAAA,OAAO,IAAI;AAClD,IAAA,OAAO,KAAK;AAChB,CAAC;AAEa,SAAU,KAAK,CAAC,KAAa,EAAA;IACvC,MAAM,EACF,OAAO,GAAG,KAAK,WACfC,SAAO,EACP,OAAO,GAAG,OAAO,EACjB,GAAG,GAAG,EAAE,EACR,MAAM,GAAG,CAAC,EACV,QAAQ,GAAG,KAAK,EAChB,SAAS,GAAG,EAAE,EACd,SAAS,GAAG,EAAE,EACd,SAAS,EACT,KAAK,GAAG,IAAI,EACZ,KAAK,GAAG,QAAQ,EAChB,OAAO,EACP,QAAQ,EACR,KAAK,EACL,SAAS,EACT,QAAQ,EACR,eAAe,GAClB,GAAG,KAAK;AAET,IAAA,MAAM,UAAU,GAAGC,YAAM,CAAc,IAAI,CAAC;AAC5C,IAAA,MAAM,UAAU,GAAGA,YAAM,CAAiB,IAAI,CAAC;A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O,EAAE,UAAU,CAAC,OAAsB,EAAA,QAAA,EAEzChB,SAAO,GACF,CACb,CAAA,EAAA,CACF;AAEX;;;;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var text = require('../text/text.js');
|
|
7
|
-
|
|
8
|
-
function Circle(props) {
|
|
9
|
-
const { value, circleSize = 40, lineWidth = 8 } = props;
|
|
10
|
-
return (jsxRuntime.jsxs("div", { className: "i-progress-circle", children: [jsxRuntime.jsxs("svg", { width: circleSize, height: circleSize, children: [jsxRuntime.jsx("circle", { cx: circleSize / 2, cy: circleSize / 2, r: circleSize / 2 - lineWidth / 2, fill: "none", stroke: "var(--color-main-0)", strokeWidth: lineWidth }), jsxRuntime.jsx("circle", { cx: circleSize / 2, cy: circleSize / 2, r: circleSize / 2 - lineWidth / 2, fill: "none", stroke: "var(--color-main)", strokeWidth: lineWidth, strokeDasharray: 100, pathLength: 100, className: "i-progress-circle-path", strokeLinecap: "round", style: {
|
|
11
|
-
strokeDashoffset: 100 - (value ?? 0),
|
|
12
|
-
} })] }), jsxRuntime.jsxs("span", { className: "i-progress-circle-value", children: [jsxRuntime.jsx("span", { children: value }), jsxRuntime.jsx(text.default, { size: ".81em", className: "color-5", children: "%" })] })] }));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
exports.default = Circle;
|
|
16
|
-
//# sourceMappingURL=circle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"circle.js","sources":["../../../../packages/components/progress/circle.tsx"],"sourcesContent":["import Text from \"../text\";\nimport { IProgress } from \"./type\";\n\nexport default function Circle(\n props: Pick<IProgress, \"value\" | \"circleSize\" | \"lineWidth\">,\n) {\n const { value, circleSize = 40, lineWidth = 8 } = props;\n\n return (\n <div className=\"i-progress-circle\">\n <svg width={circleSize} height={circleSize}>\n <circle\n cx={circleSize / 2}\n cy={circleSize / 2}\n r={circleSize / 2 - lineWidth / 2}\n fill=\"none\"\n stroke=\"var(--color-main-0)\"\n strokeWidth={lineWidth}\n />\n <circle\n cx={circleSize / 2}\n cy={circleSize / 2}\n r={circleSize / 2 - lineWidth / 2}\n fill=\"none\"\n stroke=\"var(--color-main)\"\n strokeWidth={lineWidth}\n strokeDasharray={100}\n pathLength={100}\n className=\"i-progress-circle-path\"\n strokeLinecap=\"round\"\n style={{\n strokeDashoffset: 100 - (value ?? 0),\n }}\n />\n </svg>\n\n <span className=\"i-progress-circle-value\">\n <span>{value}</span>\n <Text size=\".81em\" className=\"color-5\">\n %\n </Text>\n </span>\n </div>\n );\n}\n"],"names":["_jsxs","_jsx","Text"],"mappings":";;;;;;;AAGc,SAAU,MAAM,CAC1B,KAA4D,EAAA;AAE5D,IAAA,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,EAAE,EAAE,SAAS,GAAG,CAAC,EAAE,GAAG,KAAK;IAEvD,QACIA,yBAAK,SAAS,EAAC,mBAAmB,EAAA,QAAA,EAAA,CAC9BA,eAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,aACtCC,cAAA,CAAA,QAAA,EAAA,EACI,EAAE,EAAE,UAAU,GAAG,CAAC,EAClB,EAAE,EAAE,UAAU,GAAG,CAAC,EAClB,CAAC,EAAE,UAAU,GAAG,CAAC,GAAG,SAAS,GAAG,CAAC,EACjC,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,qBAAqB,EAC5B,WAAW,EAAE,SAAS,EAAA,CACxB,EACFA,2BACI,EAAE,EAAE,UAAU,GAAG,CAAC,EAClB,EAAE,EAAE,UAAU,GAAG,CAAC,EAClB,CAAC,EAAE,UAAU,GAAG,CAAC,GAAG,SAAS,GAAG,CAAC,EACjC,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,mBAAmB,EAC1B,WAAW,EAAE,SAAS,EACtB,eAAe,EAAE,GAAG,EACpB,UAAU,EAAE,GAAG,EACf,SAAS,EAAC,wBAAwB,EAClC,aAAa,EAAC,OAAO,EACrB,KAAK,EAAE;AACH,4BAAA,gBAAgB,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC;yBACvC,EAAA,CACH,CAAA,EAAA,CACA,EAEND,eAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,yBAAyB,EAAA,QAAA,EAAA,CACrCC,cAAA,CAAA,MAAA,EAAA,EAAA,QAAA,EAAO,KAAK,EAAA,CAAQ,EACpBA,cAAA,CAACC,YAAI,EAAA,EAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,SAAS,EAAA,QAAA,EAAA,GAAA,EAAA,CAE/B,CAAA,EAAA,CACJ,CAAA,EAAA,CACL;AAEd;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,22 +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 Line = (props) => {
|
|
13
|
-
const { ref, value, lineWidth, vertical, barClass, dragging, renderCursor, onMouseDown, onTouchStart, } = props;
|
|
14
|
-
return (jsxRuntime.jsx("div", { ref: ref, className: classNames__default("i-progress", {
|
|
15
|
-
"i-progress-vertical": vertical,
|
|
16
|
-
}), style: { [vertical ? "width" : "height"]: lineWidth }, onMouseDown: onMouseDown, onTouchStart: onTouchStart, children: jsxRuntime.jsx("div", { className: classNames__default("i-progress-bar", barClass, {
|
|
17
|
-
"no-transition": dragging,
|
|
18
|
-
}), style: { [vertical ? "height" : "width"]: `${value}%` }, children: renderCursor && (jsxRuntime.jsx("a", { className: 'i-progress-cursor', children: renderCursor(value ?? 0) })) }) }));
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
exports.default = Line;
|
|
22
|
-
//# sourceMappingURL=line.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"line.js","sources":["../../../../packages/components/progress/line.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { MouseEvent, RefObject } from \"react\";\nimport { IProgress } from \"./type\";\n\nconst Line = (\n\tprops: Pick<\n\t\tIProgress,\n\t\t\"value\" | \"vertical\" | \"lineWidth\" | \"barClass\" | \"renderCursor\"\n\t> & {\n\t\tref: RefObject<HTMLDivElement | null>;\n\t\tdragging: boolean;\n\t\tonMouseDown: (e: MouseEvent) => void;\n\t\tonTouchStart: (e) => void;\n\t}\n) => {\n\tconst {\n\t\tref,\n\t\tvalue,\n\t\tlineWidth,\n\t\tvertical,\n\t\tbarClass,\n\t\tdragging,\n\t\trenderCursor,\n\t\tonMouseDown,\n\t\tonTouchStart,\n\t} = props;\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={classNames(\"i-progress\", {\n\t\t\t\t\"i-progress-vertical\": vertical,\n\t\t\t})}\n\t\t\tstyle={{ [vertical ? \"width\" : \"height\"]: lineWidth }}\n\t\t\tonMouseDown={onMouseDown}\n\t\t\tonTouchStart={onTouchStart}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames(\"i-progress-bar\", barClass, {\n\t\t\t\t\t\"no-transition\": dragging,\n\t\t\t\t})}\n\t\t\t\tstyle={{ [vertical ? \"height\" : \"width\"]: `${value}%` }}\n\t\t\t>\n\t\t\t\t{renderCursor && (\n\t\t\t\t\t<a className='i-progress-cursor'>\n\t\t\t\t\t\t{renderCursor(value ?? 0)}\n\t\t\t\t\t</a>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default Line;\n"],"names":["_jsx","classNames"],"mappings":";;;;;;;;;;;AAIA,MAAM,IAAI,GAAG,CACZ,KAQC,KACE;IACH,MAAM,EACL,GAAG,EACH,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,YAAY,GACZ,GAAG,KAAK;IAET,QACCA,cAAA,CAAA,KAAA,EAAA,EACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAEC,mBAAU,CAAC,YAAY,EAAE;AACnC,YAAA,qBAAqB,EAAE,QAAQ;AAC/B,SAAA,CAAC,EACF,KAAK,EAAE,EAAE,CAAC,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,EAAE,EACrD,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAAA,QAAA,EAE1BD,cAAA,CAAA,KAAA,EAAA,EACC,SAAS,EAAEC,mBAAU,CAAC,gBAAgB,EAAE,QAAQ,EAAE;AACjD,gBAAA,eAAe,EAAE,QAAQ;AACzB,aAAA,CAAC,EACF,KAAK,EAAE,EAAE,CAAC,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,CAAA,EAAG,KAAK,CAAA,CAAA,CAAG,EAAE,EAAA,QAAA,EAEtD,YAAY,KACZD,cAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAC,mBAAmB,YAC9B,YAAY,CAAC,KAAK,IAAI,CAAC,CAAC,EAAA,CACtB,CACJ,EAAA,CACI,EAAA,CACD;AAER;;;;"}
|