@ioca/react 1.5.20 → 1.5.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/css/index.css +1 -2
- package/lib/es/components/affix/affix.js +1 -1
- package/lib/es/components/affix/index.js +0 -1
- package/lib/es/components/affix/totop.js +0 -1
- package/lib/es/components/badge/badge.js +1 -1
- package/lib/es/components/badge/index.js +0 -1
- package/lib/es/components/button/button.js +1 -1
- package/lib/es/components/button/confirm.js +0 -1
- package/lib/es/components/button/group.js +0 -1
- package/lib/es/components/button/index.js +0 -1
- package/lib/es/components/button/toggle.js +0 -1
- package/lib/es/components/card/card.js +1 -1
- package/lib/es/components/card/index.js +0 -1
- package/lib/es/components/checkbox/checkbox.js +2 -1
- package/lib/es/components/checkbox/index.js +0 -1
- package/lib/es/components/checkbox/item.js +0 -1
- package/lib/es/components/collapse/collapse.js +1 -1
- package/lib/es/components/collapse/index.js +0 -1
- package/lib/es/components/collapse/item.js +0 -1
- package/lib/es/components/datagrid/cell.js +0 -1
- package/lib/es/components/datagrid/datagrid.js +1 -1
- package/lib/es/components/datagrid/helper.js +0 -1
- package/lib/es/components/datagrid/index.js +0 -1
- package/lib/es/components/datagrid/resize.js +0 -1
- package/lib/es/components/datagrid/row.js +0 -1
- package/lib/es/components/datagrid/sorter.js +0 -1
- package/lib/es/components/datagrid/virtual.js +0 -1
- package/lib/es/components/description/description.js +1 -1
- package/lib/es/components/description/index.js +0 -1
- package/lib/es/components/drawer/drawer.js +1 -1
- package/lib/es/components/drawer/index.js +0 -1
- package/lib/es/components/dropdown/dropdown.js +1 -1
- package/lib/es/components/dropdown/index.js +0 -1
- package/lib/es/components/dropdown/item.js +0 -1
- package/lib/es/components/editor/controls.js +0 -1
- package/lib/es/components/editor/editor.js +1 -1
- package/lib/es/components/editor/index.js +0 -1
- package/lib/es/components/editor/memtion.js +0 -1
- package/lib/es/components/flex/flex.js +1 -1
- package/lib/es/components/flex/index.js +0 -1
- package/lib/es/components/form/context.js +0 -1
- package/lib/es/components/form/field.js +0 -1
- package/lib/es/components/form/form.js +1 -1
- package/lib/es/components/form/index.js +0 -1
- package/lib/es/components/form/useConfig.js +0 -1
- package/lib/es/components/form/useForm.js +0 -1
- package/lib/es/components/form/utils.js +0 -1
- package/lib/es/components/icon/icon.js +1 -1
- package/lib/es/components/icon/index.js +0 -1
- package/lib/es/components/image/image.js +1 -1
- package/lib/es/components/image/index.js +0 -1
- package/lib/es/components/image/list.js +0 -1
- package/lib/es/components/input/container.js +0 -1
- package/lib/es/components/input/index.js +0 -1
- package/lib/es/components/input/input.js +1 -1
- package/lib/es/components/input/number.js +1 -1
- package/lib/es/components/input/range.js +1 -1
- package/lib/es/components/input/textarea.js +1 -1
- package/lib/es/components/list/index.js +0 -1
- package/lib/es/components/list/item.js +0 -1
- package/lib/es/components/list/list.js +1 -1
- package/lib/es/components/loading/index.js +0 -1
- package/lib/es/components/loading/loading.js +1 -1
- package/lib/es/components/message/index.js +0 -1
- package/lib/es/components/message/message.js +1 -1
- package/lib/es/components/modal/content.js +1 -1
- package/lib/es/components/modal/context.js +0 -1
- package/lib/es/components/modal/hookModal.js +0 -1
- package/lib/es/components/modal/index.js +0 -1
- package/lib/es/components/modal/modal.js +1 -1
- package/lib/es/components/modal/modalManager.js +0 -1
- package/lib/es/components/modal/useModal.js +0 -1
- package/lib/es/components/pagination/index.js +0 -1
- package/lib/es/components/pagination/page.js +0 -1
- package/lib/es/components/pagination/pagination.js +1 -1
- package/lib/es/components/picker/colors/footer.js +0 -1
- package/lib/es/components/picker/colors/handle.js +0 -1
- package/lib/es/components/picker/colors/index.js +1 -1
- package/lib/es/components/picker/daterange/daterange.js +2 -1
- package/lib/es/components/picker/daterange/index.js +0 -1
- package/lib/es/components/picker/daterange/panel.js +0 -1
- package/lib/es/components/picker/dates/dates.js +0 -1
- package/lib/es/components/picker/dates/index.js +1 -1
- package/lib/es/components/picker/dates/panel.js +0 -1
- package/lib/es/components/picker/time/index.js +0 -1
- package/lib/es/components/picker/time/item.js +0 -1
- package/lib/es/components/picker/time/panel.js +1 -1
- package/lib/es/components/popconfirm/index.js +0 -1
- package/lib/es/components/popconfirm/popconfirm.js +1 -1
- package/lib/es/components/popup/content.js +0 -1
- package/lib/es/components/popup/index.js +0 -1
- package/lib/es/components/popup/popup.js +1 -1
- package/lib/es/components/progress/circle.js +0 -1
- package/lib/es/components/progress/index.js +0 -1
- package/lib/es/components/progress/line.js +0 -1
- package/lib/es/components/progress/progress.js +2 -1
- package/lib/es/components/radio/index.js +0 -1
- package/lib/es/components/radio/item.js +0 -1
- package/lib/es/components/radio/radio.js +2 -1
- package/lib/es/components/resizable/index.js +0 -1
- package/lib/es/components/resizable/resizable.js +1 -1
- package/lib/es/components/river/index.js +0 -1
- package/lib/es/components/river/river.js +1 -1
- package/lib/es/components/scroll/index.js +0 -1
- package/lib/es/components/scroll/scroll.js +1 -1
- package/lib/es/components/select/index.js +0 -1
- package/lib/es/components/select/options.js +0 -1
- package/lib/es/components/select/select.js +2 -1
- package/lib/es/components/step/divider.js +1 -1
- package/lib/es/components/step/index.js +0 -1
- package/lib/es/components/step/item.js +0 -1
- package/lib/es/components/step/step.js +1 -1
- package/lib/es/components/swiper/index.js +0 -1
- package/lib/es/components/swiper/item.js +0 -1
- package/lib/es/components/swiper/swiper.js +1 -1
- package/lib/es/components/tabs/contents.js +0 -1
- package/lib/es/components/tabs/helper.js +0 -1
- package/lib/es/components/tabs/index.js +0 -1
- package/lib/es/components/tabs/item.js +0 -1
- package/lib/es/components/tabs/navs.js +0 -1
- package/lib/es/components/tabs/tabs.js +1 -1
- package/lib/es/components/tag/index.js +0 -1
- package/lib/es/components/tag/tag.js +1 -1
- package/lib/es/components/text/highlight.js +0 -1
- package/lib/es/components/text/index.js +0 -1
- package/lib/es/components/text/number.js +0 -1
- package/lib/es/components/text/text.js +1 -1
- package/lib/es/components/text/time.js +0 -1
- package/lib/es/components/tree/index.js +0 -1
- package/lib/es/components/tree/item.js +0 -1
- package/lib/es/components/tree/tree.js +1 -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 +1 -1
- package/lib/es/components/utils/empty/index.js +1 -1
- package/lib/es/components/utils/helpericon/helpericon.js +1 -1
- package/lib/es/components/utils/helpericon/index.js +0 -1
- package/lib/es/components/video/index.js +0 -1
- package/lib/es/components/video/video.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/js/hooks.js +0 -1
- package/lib/es/js/usePreview/content.js +0 -1
- package/lib/es/js/usePreview/index.js +1 -1
- package/lib/es/js/usePreview/renderFile.js +0 -1
- package/lib/es/js/usePreview/type.js +0 -1
- package/lib/es/js/useRipple/index.js +2 -1
- package/lib/es/js/useTheme/index.js +0 -1
- package/lib/es/js/utils.js +0 -1
- package/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,31 +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 utils = require('../../js/utils.js');
|
|
8
|
-
var text = require('./text.js');
|
|
9
|
-
|
|
10
|
-
function Number(props) {
|
|
11
|
-
const { count, to, decimal, thousand = ",", duration = 2400, easing, ...restProps } = props;
|
|
12
|
-
const [n, setN] = react.useState(count);
|
|
13
|
-
const number = react.useMemo(() => {
|
|
14
|
-
if (n === undefined)
|
|
15
|
-
return;
|
|
16
|
-
const z = n.toFixed(decimal);
|
|
17
|
-
if (!thousand)
|
|
18
|
-
return z;
|
|
19
|
-
return utils.formatNumber(n, { precision: decimal, thousand });
|
|
20
|
-
}, [n, thousand]);
|
|
21
|
-
react.useEffect(() => {
|
|
22
|
-
if (count === undefined || to === undefined)
|
|
23
|
-
return;
|
|
24
|
-
utils.animate(count, to, duration, (v) => setN(count + v), easing);
|
|
25
|
-
}, [to]);
|
|
26
|
-
react.useEffect(() => setN(count), [count]);
|
|
27
|
-
return jsxRuntime.jsx(text.default, { ...restProps, children: number });
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
exports.default = Number;
|
|
31
|
-
//# sourceMappingURL=number.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"number.js","sources":["../../../../packages/components/text/number.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\";\nimport { animate, formatNumber } from \"../../js/utils\";\nimport Text from \"./text\";\nimport { ITextNumber } from \"./type\";\n\nexport default function Number(props: ITextNumber) {\n\tconst {\n\t\tcount,\n\t\tto,\n\t\tdecimal,\n\t\tthousand = \",\",\n\t\tduration = 2400,\n\t\teasing,\n\t\t...restProps\n\t} = props;\n\tconst [n, setN] = useState(count);\n\n\tconst number = useMemo(() => {\n\t\tif (n === undefined) return;\n\n\t\tconst z = n.toFixed(decimal);\n\n\t\tif (!thousand) return z;\n\n\t\treturn formatNumber(n, { precision: decimal, thousand });\n\t}, [n, thousand]);\n\n\tuseEffect(() => {\n\t\tif (count === undefined || to === undefined) return;\n\n\t\tanimate(count, to, duration, (v) => setN(count + v), easing);\n\t}, [to]);\n\n\tuseEffect(() => setN(count), [count]);\n\n\treturn <Text {...restProps}>{number}</Text>;\n}\n"],"names":["useState","useMemo","formatNumber","useEffect","animate","_jsx","Text"],"mappings":";;;;;;;;;AAKc,SAAU,MAAM,CAAC,KAAkB,EAAA;IAChD,MAAM,EACL,KAAK,EACL,EAAE,EACF,OAAO,EACP,QAAQ,GAAG,GAAG,EACd,QAAQ,GAAG,IAAI,EACf,MAAM,EACN,GAAG,SAAS,EACZ,GAAG,KAAK;IACT,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,GAAGA,cAAQ,CAAC,KAAK,CAAC;AAEjC,IAAA,MAAM,MAAM,GAAGC,aAAO,CAAC,MAAK;QAC3B,IAAI,CAAC,KAAK,SAAS;YAAE;QAErB,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;AAE5B,QAAA,IAAI,CAAC,QAAQ;AAAE,YAAA,OAAO,CAAC;AAEvB,QAAA,OAAOC,kBAAY,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AACzD,IAAA,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IAEjBC,eAAS,CAAC,MAAK;AACd,QAAA,IAAI,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,SAAS;YAAE;QAE7CC,aAAO,CAAC,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC;AAC7D,IAAA,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAER,IAAAD,eAAS,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAErC,IAAA,OAAOE,eAACC,YAAI,EAAA,EAAA,GAAK,SAAS,EAAA,QAAA,EAAG,MAAM,GAAQ;AAC5C;;;;"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var classNames = require('classnames');
|
|
7
|
-
var react = require('react');
|
|
8
|
-
var highlight = require('./highlight.js');
|
|
9
|
-
var number = require('./number.js');
|
|
10
|
-
var time = require('./time.js');
|
|
11
|
-
|
|
12
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
13
|
-
|
|
14
|
-
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
15
|
-
|
|
16
|
-
const Text = (props) => {
|
|
17
|
-
const { as: Tag = "span", size, weight, decoration, gradient, wave, style, className, children, } = props;
|
|
18
|
-
const gradients = react.useMemo(() => {
|
|
19
|
-
if (!gradient || !Array.isArray(gradient))
|
|
20
|
-
return {};
|
|
21
|
-
return {
|
|
22
|
-
backgroundImage: `-webkit-linear-gradient(${gradient.join(",")})`,
|
|
23
|
-
backgroundClip: "text",
|
|
24
|
-
};
|
|
25
|
-
}, [gradient]);
|
|
26
|
-
return (jsxRuntime.jsx(Tag, { style: {
|
|
27
|
-
fontSize: size,
|
|
28
|
-
fontWeight: weight,
|
|
29
|
-
textDecoration: decoration,
|
|
30
|
-
...gradients,
|
|
31
|
-
...style,
|
|
32
|
-
}, className: classNames__default(className, {
|
|
33
|
-
"i-text-gradient": gradient,
|
|
34
|
-
"i-text-gradient-wave": wave,
|
|
35
|
-
}), children: children }));
|
|
36
|
-
};
|
|
37
|
-
Text.Number = number.default;
|
|
38
|
-
Text.Time = time.default;
|
|
39
|
-
Text.HighLight = highlight.default;
|
|
40
|
-
|
|
41
|
-
exports.default = Text;
|
|
42
|
-
//# sourceMappingURL=text.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sources":["../../../../packages/components/text/text.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { useMemo } from \"react\";\nimport HighLight from \"./highlight\";\nimport \"./index.css\";\nimport Number from \"./number\";\nimport Time from \"./time\";\nimport { CompositionText, IText } from \"./type\";\n\nconst Text = (props: IText) => {\n\tconst {\n\t\tas: Tag = \"span\",\n\t\tsize,\n\t\tweight,\n\t\tdecoration,\n\t\tgradient,\n\t\twave,\n\t\tstyle,\n\t\tclassName,\n\t\tchildren,\n\t} = props;\n\n\tconst gradients = useMemo(() => {\n\t\tif (!gradient || !Array.isArray(gradient)) return {};\n\n\t\treturn {\n\t\t\tbackgroundImage: `-webkit-linear-gradient(${gradient.join(\",\")})`,\n\t\t\tbackgroundClip: \"text\",\n\t\t};\n\t}, [gradient]);\n\n\treturn (\n\t\t<Tag\n\t\t\tstyle={{\n\t\t\t\tfontSize: size,\n\t\t\t\tfontWeight: weight,\n\t\t\t\ttextDecoration: decoration,\n\t\t\t\t...gradients,\n\t\t\t\t...style,\n\t\t\t}}\n\t\t\tclassName={classNames(className, {\n\t\t\t\t\"i-text-gradient\": gradient,\n\t\t\t\t\"i-text-gradient-wave\": wave,\n\t\t\t})}\n\t\t>\n\t\t\t{children}\n\t\t</Tag>\n\t);\n};\n\nText.Number = Number;\nText.Time = Time;\nText.HighLight = HighLight;\n\nexport default Text as CompositionText;\n"],"names":["useMemo","_jsx","classNames","Number","Time","HighLight"],"mappings":";;;;;;;;;;;;;;;AAQA,MAAM,IAAI,GAAG,CAAC,KAAY,KAAI;IAC7B,MAAM,EACL,EAAE,EAAE,GAAG,GAAG,MAAM,EAChB,IAAI,EACJ,MAAM,EACN,UAAU,EACV,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,SAAS,EACT,QAAQ,GACR,GAAG,KAAK;AAET,IAAA,MAAM,SAAS,GAAGA,aAAO,CAAC,MAAK;QAC9B,IAAI,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;AAAE,YAAA,OAAO,EAAE;QAEpD,OAAO;YACN,eAAe,EAAE,2BAA2B,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,CAAA,CAAG;AACjE,YAAA,cAAc,EAAE,MAAM;SACtB;AACF,IAAA,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;AAEd,IAAA,QACCC,cAAA,CAAC,GAAG,EAAA,EACH,KAAK,EAAE;AACN,YAAA,QAAQ,EAAE,IAAI;AACd,YAAA,UAAU,EAAE,MAAM;AAClB,YAAA,cAAc,EAAE,UAAU;AAC1B,YAAA,GAAG,SAAS;AACZ,YAAA,GAAG,KAAK;AACR,SAAA,EACD,SAAS,EAAEC,mBAAU,CAAC,SAAS,EAAE;AAChC,YAAA,iBAAiB,EAAE,QAAQ;AAC3B,YAAA,sBAAsB,EAAE,IAAI;AAC5B,SAAA,CAAC,EAAA,QAAA,EAED,QAAQ,EAAA,CACJ;AAER;AAEA,IAAI,CAAC,MAAM,GAAGC,cAAM;AACpB,IAAI,CAAC,IAAI,GAAGC,YAAI;AAChB,IAAI,CAAC,SAAS,GAAGC,iBAAS;;;;"}
|
|
@@ -1,24 +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 utils = require('../../js/utils.js');
|
|
8
|
-
var text = require('./text.js');
|
|
9
|
-
|
|
10
|
-
function Number(props) {
|
|
11
|
-
const { seconds, zero, units, ...restProps } = props;
|
|
12
|
-
const text$1 = react.useMemo(() => {
|
|
13
|
-
if (seconds === undefined)
|
|
14
|
-
return "";
|
|
15
|
-
return utils.formatTime(seconds, {
|
|
16
|
-
zero,
|
|
17
|
-
units,
|
|
18
|
-
});
|
|
19
|
-
}, [seconds]);
|
|
20
|
-
return jsxRuntime.jsx(text.default, { ...restProps, children: text$1 });
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
exports.default = Number;
|
|
24
|
-
//# sourceMappingURL=time.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"time.js","sources":["../../../../packages/components/text/time.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { formatTime } from \"../../js/utils\";\nimport Text from \"./text\";\nimport { ITextTime } from \"./type\";\n\nexport default function Number(props: ITextTime) {\n\tconst { seconds, zero, units, ...restProps } = props;\n\n\tconst text = useMemo(() => {\n\t\tif (seconds === undefined) return \"\";\n\n\t\treturn formatTime(seconds, {\n\t\t\tzero,\n\t\t\tunits,\n\t\t});\n\t}, [seconds]);\n\n\treturn <Text {...restProps}>{text}</Text>;\n}\n"],"names":["text","useMemo","formatTime","_jsx","Text"],"mappings":";;;;;;;;;AAKc,SAAU,MAAM,CAAC,KAAgB,EAAA;AAC9C,IAAA,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK;AAEpD,IAAA,MAAMA,MAAI,GAAGC,aAAO,CAAC,MAAK;QACzB,IAAI,OAAO,KAAK,SAAS;AAAE,YAAA,OAAO,EAAE;QAEpC,OAAOC,gBAAU,CAAC,OAAO,EAAE;YAC1B,IAAI;YACJ,KAAK;AACL,SAAA,CAAC;AACH,IAAA,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;AAEb,IAAA,OAAOC,eAACC,YAAI,EAAA,EAAA,GAAK,SAAS,EAAA,QAAA,EAAGJ,MAAI,GAAQ;AAC1C;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var material = require('@ricons/material');
|
|
5
|
-
var classNames = require('classnames');
|
|
6
|
-
var checkbox = require('../checkbox/checkbox.js');
|
|
7
|
-
var icon = require('../icon/icon.js');
|
|
8
|
-
var loading = require('../loading/loading.js');
|
|
9
|
-
|
|
10
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
11
|
-
|
|
12
|
-
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
13
|
-
|
|
14
|
-
const TreeItemHeader = (props) => {
|
|
15
|
-
const { as: Tag = "a", href, selected, children, ...restProps } = props;
|
|
16
|
-
const className = classNames__default("i-tree-item-header", {
|
|
17
|
-
"i-tree-item-selected": selected,
|
|
18
|
-
});
|
|
19
|
-
if (typeof Tag === "string") {
|
|
20
|
-
return (jsxRuntime.jsx(Tag, { href: href, className: className, ...restProps, children: children }));
|
|
21
|
-
}
|
|
22
|
-
return (jsxRuntime.jsx(Tag, { to: href || "", className: className, ...restProps, children: children }));
|
|
23
|
-
};
|
|
24
|
-
function TreeRow(props) {
|
|
25
|
-
const { flatNode, wrapperStyle, virtualMode, selected, checkedSet, partofs = {}, checkable, nodeProps, renderExtra, loadingKeys, onExpand, onItemClick, onItemSelect, onItemCheck, } = props;
|
|
26
|
-
const { node, depth, isExpanded } = flatNode;
|
|
27
|
-
const { key = "", as, href, icon: icon$1, title, disabled, type } = node;
|
|
28
|
-
const children = node[nodeProps.children];
|
|
29
|
-
const hasChildren = children instanceof Promise || (Array.isArray(children) && children.length > 0);
|
|
30
|
-
const loading$1 = loadingKeys?.includes(key);
|
|
31
|
-
if (type === "title") {
|
|
32
|
-
return jsxRuntime.jsx("div", { style: wrapperStyle, className: "i-tree-group-title", children: title });
|
|
33
|
-
}
|
|
34
|
-
if (type && type !== "item") {
|
|
35
|
-
return jsxRuntime.jsx("div", { style: wrapperStyle, className: `i-tree-type-${type}`, children: title });
|
|
36
|
-
}
|
|
37
|
-
return (jsxRuntime.jsx("div", { className: !virtualMode ? classNames__default("i-tree-item", { "i-tree-expand": isExpanded }) : undefined, style: wrapperStyle, children: jsxRuntime.jsxs(TreeItemHeader, { as: as, href: href, style: { paddingLeft: `${depth * 1.5 + 0.5}em` }, selected: selected === key, onClick: (e) => {
|
|
38
|
-
if (disabled) {
|
|
39
|
-
e.preventDefault();
|
|
40
|
-
e.stopPropagation();
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
if (hasChildren)
|
|
44
|
-
onExpand(key);
|
|
45
|
-
onItemClick?.(node, e);
|
|
46
|
-
onItemSelect?.(key, node);
|
|
47
|
-
}, children: [checkable && (jsxRuntime.jsx(checkbox.default.Item, { value: checkedSet.has(key), partof: !checkedSet.has(key) && partofs[key], className: "i-tree-checkbox", onChange: () => onItemCheck?.(node, !checkedSet.has(key), []), onClick: (e) => e.stopPropagation() })), icon$1 && jsxRuntime.jsx("span", { className: "i-tree-item-icon", children: icon$1 }), jsxRuntime.jsx("span", { className: "i-tree-item-title", children: title }), renderExtra?.(node), hasChildren && (jsxRuntime.jsx(icon.default, { icon: loading$1 ? jsxRuntime.jsx(loading.default, { size: ".86em" }) : jsxRuntime.jsx(material.KeyboardArrowDownRound, {}), className: classNames__default("i-tree-toggle", {
|
|
48
|
-
"i-tree-expand": virtualMode ? isExpanded : false,
|
|
49
|
-
}), onClick: (e) => {
|
|
50
|
-
e.preventDefault();
|
|
51
|
-
e.stopPropagation();
|
|
52
|
-
onExpand(key);
|
|
53
|
-
} }))] }) }));
|
|
54
|
-
}
|
|
55
|
-
function TreeList(props) {
|
|
56
|
-
const { flatNodes, onExpand, selected, checkedSet, partofs = {}, checkable, nodeProps, renderExtra, loadingKeys, round, className, style, onItemClick, onItemSelect, onItemCheck } = props;
|
|
57
|
-
return (jsxRuntime.jsx("div", { className: classNames__default("i-tree", className, {
|
|
58
|
-
"i-tree-round": round,
|
|
59
|
-
}), style: style, children: flatNodes.map((flatNode) => {
|
|
60
|
-
const { key = "" } = flatNode.node;
|
|
61
|
-
return (jsxRuntime.jsx(TreeRow, { flatNode: flatNode, selected: selected, checkedSet: checkedSet, partofs: partofs, checkable: checkable, nodeProps: nodeProps, renderExtra: renderExtra, loadingKeys: loadingKeys, onExpand: onExpand, onItemClick: onItemClick, onItemSelect: onItemSelect, onItemCheck: onItemCheck }, key));
|
|
62
|
-
}) }));
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
exports.TreeItemHeader = TreeItemHeader;
|
|
66
|
-
exports.TreeList = TreeList;
|
|
67
|
-
exports.TreeRow = TreeRow;
|
|
68
|
-
//# sourceMappingURL=item.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sources":["../../../../packages/components/tree/item.tsx"],"sourcesContent":["import { KeyboardArrowDownRound } from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport { MouseEvent } from \"react\";\nimport Checkbox from \"../checkbox\";\nimport Icon from \"../icon\";\nimport Loading from \"../loading\";\nimport { FlatNode, ITreeItem } from \"./type\";\n\nexport const TreeItemHeader = (props: {\n as?: ITreeItem[\"as\"];\n href?: string;\n selected?: boolean;\n style?: React.CSSProperties;\n children: React.ReactNode;\n onClick?: (e: MouseEvent<HTMLElement>) => void;\n}) => {\n const { as: Tag = \"a\", href, selected, children, ...restProps } = props;\n\n const className = classNames(\"i-tree-item-header\", {\n \"i-tree-item-selected\": selected,\n });\n\n if (typeof Tag === \"string\") {\n return (\n <Tag href={href} className={className} {...restProps}>\n {children}\n </Tag>\n );\n }\n\n return (\n <Tag to={href || \"\"} className={className} {...restProps}>\n {children}\n </Tag>\n );\n};\n\nexport interface TreeRowProps {\n\tflatNode: FlatNode;\n\twrapperStyle?: React.CSSProperties;\n\tvirtualMode?: boolean;\n\tselected?: string;\n\tcheckedSet: Set<string>;\n\tpartofs?: Record<string, boolean>;\n\tcheckable?: boolean;\n\tnodeProps: { key: string; title: string; children: string };\n\trenderExtra?: (item: ITreeItem) => React.ReactNode;\n\tloadingKeys?: string[];\n\tonExpand: (key: string) => void;\n\tonItemClick?: (item: ITreeItem, e: MouseEvent<HTMLElement>) => void;\n\tonItemSelect?: (key: string, item: ITreeItem) => void;\n\tonItemCheck?: (item: ITreeItem, checked: boolean, checkedKeys: string[]) => void;\n}\n\nexport function TreeRow(props: TreeRowProps) {\n\tconst {\n\t\tflatNode,\n\t\twrapperStyle,\n\t\tvirtualMode,\n\t\tselected,\n\t\tcheckedSet,\n\t\tpartofs = {},\n\t\tcheckable,\n\t\tnodeProps,\n\t\trenderExtra,\n\t\tloadingKeys,\n\t\tonExpand,\n\t\tonItemClick,\n\t\tonItemSelect,\n\t\tonItemCheck,\n\t} = props;\n\n\tconst { node, depth, isExpanded } = flatNode;\n\tconst { key = \"\", as, href, icon, title, disabled, type } = node;\n\tconst children = node[nodeProps.children];\n\tconst hasChildren = children instanceof Promise || (Array.isArray(children) && children.length > 0);\n\tconst loading = loadingKeys?.includes(key);\n\n\tif (type === \"title\") {\n\t\treturn <div style={wrapperStyle} className=\"i-tree-group-title\">{title}</div>;\n\t}\n\n\tif (type && type !== \"item\") {\n\t\treturn <div style={wrapperStyle} className={`i-tree-type-${type}`}>{title}</div>;\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={!virtualMode ? classNames(\"i-tree-item\", { \"i-tree-expand\": isExpanded }) : undefined}\n\t\t\tstyle={wrapperStyle}\n\t\t>\n\t\t\t<TreeItemHeader\n\t\t\t\tas={as}\n\t\t\t\thref={href}\n\t\t\t\tstyle={{ paddingLeft: `${depth * 1.5 + 0.5}em` }}\n\t\t\t\tselected={selected === key}\n\t\t\t\tonClick={(e) => {\n\t\t\t\t\tif (disabled) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (hasChildren) onExpand(key);\n\t\t\t\t\tonItemClick?.(node, e);\n\t\t\t\t\tonItemSelect?.(key, node);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{checkable && (\n\t\t\t\t\t<Checkbox.Item\n\t\t\t\t\t\tvalue={checkedSet.has(key)}\n\t\t\t\t\t\tpartof={!checkedSet.has(key) && partofs[key]}\n\t\t\t\t\t\tclassName=\"i-tree-checkbox\"\n\t\t\t\t\t\tonChange={() => onItemCheck?.(node, !checkedSet.has(key), [])}\n\t\t\t\t\t\tonClick={(e: MouseEvent) => e.stopPropagation()}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{icon && <span className=\"i-tree-item-icon\">{icon}</span>}\n\n\t\t\t\t<span className=\"i-tree-item-title\">{title}</span>\n\n\t\t\t\t{renderExtra?.(node)}\n\n\t\t\t\t{hasChildren && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={loading ? <Loading size=\".86em\" /> : <KeyboardArrowDownRound />}\n\t\t\t\t\t\tclassName={classNames(\"i-tree-toggle\", {\n\t\t\t\t\t\t\t\"i-tree-expand\": virtualMode ? isExpanded : false,\n\t\t\t\t\t\t})}\n\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\t\tonExpand(key);\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</TreeItemHeader>\n\t\t</div>\n\t);\n}\n\ninterface TreeListProps {\n flatNodes: FlatNode[];\n onExpand: (key: string) => void;\n selected?: string;\n checkedSet: Set<string>;\n partofs?: Record<string, boolean>;\n checkable?: boolean;\n nodeProps: { key: string; title: string; children: string };\n renderExtra?: (item: ITreeItem) => React.ReactNode;\n loadingKeys?: string[];\n round?: boolean;\n className?: string;\n style?: React.CSSProperties;\n onItemClick?: (item: ITreeItem, e: MouseEvent<HTMLElement>) => void;\n onItemSelect?: (key: string, item: ITreeItem) => void;\n onItemCheck?: (item: ITreeItem, checked: boolean, checkedKeys: string[]) => void;\n}\n\nexport function TreeList(props: TreeListProps) {\n const { flatNodes, onExpand, selected, checkedSet, partofs = {}, checkable, nodeProps, renderExtra, loadingKeys, round, className, style, onItemClick, onItemSelect, onItemCheck } = props;\n\n return (\n <div\n className={classNames(\"i-tree\", className, {\n \"i-tree-round\": round,\n })}\n style={style}\n >\n {flatNodes.map((flatNode) => {\n const { key = \"\" } = flatNode.node;\n return (\n <TreeRow\n key={key}\n flatNode={flatNode}\n selected={selected}\n checkedSet={checkedSet}\n partofs={partofs}\n checkable={checkable}\n nodeProps={nodeProps}\n renderExtra={renderExtra}\n loadingKeys={loadingKeys}\n onExpand={onExpand}\n onItemClick={onItemClick}\n onItemSelect={onItemSelect}\n onItemCheck={onItemCheck}\n />\n );\n })}\n </div>\n );\n}\n"],"names":["classNames","_jsx","icon","loading","_jsxs","Checkbox","Icon","Loading","KeyboardArrowDownRound"],"mappings":";;;;;;;;;;;;;AAQO,MAAM,cAAc,GAAG,CAAC,KAO9B,KAAI;AACD,IAAA,MAAM,EAAE,EAAE,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK;AAEvE,IAAA,MAAM,SAAS,GAAGA,mBAAU,CAAC,oBAAoB,EAAE;AAC/C,QAAA,sBAAsB,EAAE,QAAQ;AACnC,KAAA,CAAC;AAEF,IAAA,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AACzB,QAAA,QACIC,cAAA,CAAC,GAAG,EAAA,EAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAA,GAAM,SAAS,YAC/C,QAAQ,EAAA,CACP;IAEd;AAEA,IAAA,QACIA,cAAA,CAAC,GAAG,IAAC,EAAE,EAAE,IAAI,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAA,GAAM,SAAS,YACnD,QAAQ,EAAA,CACP;AAEd;AAmBM,SAAU,OAAO,CAAC,KAAmB,EAAA;AAC1C,IAAA,MAAM,EACL,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,UAAU,EACV,OAAO,GAAG,EAAE,EACZ,SAAS,EACT,SAAS,EACT,WAAW,EACX,WAAW,EACX,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,WAAW,GACX,GAAG,KAAK;IAET,MAAM,EAA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strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var reactDom = require('react-dom');
|
|
7
|
-
var react = require('react');
|
|
8
|
-
var item = require('./item.js');
|
|
9
|
-
var virtual = require('./virtual.js');
|
|
10
|
-
|
|
11
|
-
const defaultNodeProps = {
|
|
12
|
-
key: "key",
|
|
13
|
-
title: "title",
|
|
14
|
-
children: "children",
|
|
15
|
-
};
|
|
16
|
-
function flattenTree(nodes, expandedMap, nodeProps, depth = 0, parentItem, asyncChildrenMap = {}) {
|
|
17
|
-
const result = [];
|
|
18
|
-
nodes.forEach((item, i) => {
|
|
19
|
-
const mapKey = item[nodeProps.key];
|
|
20
|
-
item.key = mapKey || `${parentItem?.key ?? ""}-${i}`;
|
|
21
|
-
item.parent = parentItem;
|
|
22
|
-
const isExpanded = !!expandedMap[item.key];
|
|
23
|
-
result.push({ node: item, depth, isExpanded });
|
|
24
|
-
const children = asyncChildrenMap[item.key] || item[nodeProps.children];
|
|
25
|
-
if (Array.isArray(children) && children.length) {
|
|
26
|
-
const childNodes = flattenTree(children, expandedMap, nodeProps, depth + 1, item, asyncChildrenMap);
|
|
27
|
-
if (isExpanded)
|
|
28
|
-
result.push(...childNodes);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
return result;
|
|
32
|
-
}
|
|
33
|
-
const Tree = (props) => {
|
|
34
|
-
const { data = [], ref, selected, checked = [], disabledRelated, nodeProps, height, useVirtual, onItemSelect, onItemCheck, ...restProps } = props;
|
|
35
|
-
const [selectedKey, setSelectedKey] = react.useState(selected);
|
|
36
|
-
const [checkedKeys, setCheckedKeys] = react.useState(checked);
|
|
37
|
-
const [partofs, setPartofs] = react.useState({});
|
|
38
|
-
const [loadingMap, setLoadingMap] = react.useState({});
|
|
39
|
-
const [asyncChildrenMap, setAsyncChildrenMap] = react.useState({});
|
|
40
|
-
const nodeMapsRef = react.useRef(new Map());
|
|
41
|
-
const oNodeProps = react.useMemo(() => ({ ...defaultNodeProps, ...nodeProps }), [nodeProps]);
|
|
42
|
-
const checkedSet = react.useMemo(() => new Set(checkedKeys), [checkedKeys]);
|
|
43
|
-
const [expandedMap, setExpandedMap] = react.useState(() => {
|
|
44
|
-
const map = {};
|
|
45
|
-
const walk = (nodes, parentKey = "") => {
|
|
46
|
-
nodes.forEach((item, i) => {
|
|
47
|
-
const mapKey = item[oNodeProps.key];
|
|
48
|
-
const key = mapKey || `${parentKey}-${i}`;
|
|
49
|
-
if (item.expanded)
|
|
50
|
-
map[key] = true;
|
|
51
|
-
const children = item[oNodeProps.children];
|
|
52
|
-
if (Array.isArray(children) && children.length)
|
|
53
|
-
walk(children, key);
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
walk(data);
|
|
57
|
-
return map;
|
|
58
|
-
});
|
|
59
|
-
const handleExpand = (key) => {
|
|
60
|
-
if (loadingMap[key])
|
|
61
|
-
return;
|
|
62
|
-
const item = nodeMapsRef.current.get(key);
|
|
63
|
-
if (!item)
|
|
64
|
-
return;
|
|
65
|
-
const rawChildren = item[oNodeProps.children];
|
|
66
|
-
const isAsync = rawChildren instanceof Promise;
|
|
67
|
-
const isExpanded = !!expandedMap[key];
|
|
68
|
-
if (isAsync && !isExpanded) {
|
|
69
|
-
reactDom.flushSync(() => {
|
|
70
|
-
setLoadingMap((prev) => ({ ...prev, [key]: true }));
|
|
71
|
-
setExpandedMap((prev) => ({ ...prev, [key]: true }));
|
|
72
|
-
});
|
|
73
|
-
rawChildren
|
|
74
|
-
.then((resolved) => {
|
|
75
|
-
item[oNodeProps.children] = resolved;
|
|
76
|
-
setAsyncChildrenMap((prev) => ({ ...prev, [key]: resolved }));
|
|
77
|
-
})
|
|
78
|
-
.finally(() => {
|
|
79
|
-
setLoadingMap((prev) => {
|
|
80
|
-
const next = { ...prev };
|
|
81
|
-
delete next[key];
|
|
82
|
-
return next;
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
setExpandedMap((prev) => ({
|
|
88
|
-
...prev,
|
|
89
|
-
[key]: !prev[key],
|
|
90
|
-
}));
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
const flatNodes = react.useMemo(() => flattenTree(data, expandedMap, oNodeProps, 0, undefined, asyncChildrenMap), [data, expandedMap, oNodeProps, asyncChildrenMap]);
|
|
94
|
-
const loadingKeys = react.useMemo(() => Object.keys(loadingMap).filter((k) => loadingMap[k]), [loadingMap]);
|
|
95
|
-
const checkItem = (item, checked, direction) => {
|
|
96
|
-
const { key = "", parent, children } = item;
|
|
97
|
-
const shouldChanged = { [key]: checked };
|
|
98
|
-
const partofs = { [key]: false };
|
|
99
|
-
if (disabledRelated)
|
|
100
|
-
return [shouldChanged];
|
|
101
|
-
if (checked) {
|
|
102
|
-
if (parent && direction !== "leaf") {
|
|
103
|
-
const hasUnchecked = Array.isArray(parent.children)
|
|
104
|
-
? parent.children.some((o) => o.key !== key && !checkedSet.has(o.key))
|
|
105
|
-
: false;
|
|
106
|
-
const [changes, parts] = checkItem(parent, true, "root");
|
|
107
|
-
if (!hasUnchecked) {
|
|
108
|
-
Object.assign(shouldChanged, changes);
|
|
109
|
-
}
|
|
110
|
-
Object.assign(partofs, hasUnchecked ? parts : {}, {
|
|
111
|
-
[parent.key]: true,
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
if (Array.isArray(children) && children.length && direction !== "root") {
|
|
115
|
-
children.map((o) => {
|
|
116
|
-
if (checkedSet.has(o.key))
|
|
117
|
-
return;
|
|
118
|
-
const [changes] = checkItem(o, true, "leaf");
|
|
119
|
-
Object.assign(shouldChanged, changes);
|
|
120
|
-
partofs[o.key] = false;
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
return [shouldChanged, partofs];
|
|
124
|
-
}
|
|
125
|
-
if (parent && direction !== "leaf") {
|
|
126
|
-
const [changes, parts] = checkItem(parent, false, "root");
|
|
127
|
-
Object.assign(shouldChanged, changes);
|
|
128
|
-
const hasChecked = Array.isArray(parent.children)
|
|
129
|
-
? parent.children.some((o) => checkedSet.has(o.key) && o.key !== key)
|
|
130
|
-
: false;
|
|
131
|
-
Object.assign(partofs, hasChecked ? {} : parts, {
|
|
132
|
-
[parent.key]: hasChecked,
|
|
133
|
-
[key]: false,
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
if (Array.isArray(children) && children.length && direction !== "root") {
|
|
137
|
-
children.map((o) => {
|
|
138
|
-
const [changes] = checkItem(o, false, "leaf");
|
|
139
|
-
if (!checkedSet.has(o.key))
|
|
140
|
-
return;
|
|
141
|
-
Object.assign(shouldChanged, changes);
|
|
142
|
-
partofs[o.key] = false;
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
return [shouldChanged, partofs];
|
|
146
|
-
};
|
|
147
|
-
const handleCheck = (item, checked) => {
|
|
148
|
-
const [shouldChanged, partofs] = checkItem(item, checked);
|
|
149
|
-
const changedKeys = Object.keys(shouldChanged);
|
|
150
|
-
const changedKeysSet = new Set(changedKeys);
|
|
151
|
-
const nextChecked = checked
|
|
152
|
-
? Array.from(new Set([...checkedKeys, ...changedKeys]))
|
|
153
|
-
: checkedKeys.filter((k) => !changedKeysSet.has(k));
|
|
154
|
-
setCheckedKeys(nextChecked);
|
|
155
|
-
setPartofs((p) => ({ ...p, ...partofs }));
|
|
156
|
-
onItemCheck?.(item, checked, nextChecked);
|
|
157
|
-
};
|
|
158
|
-
const handleSelect = (key, item) => {
|
|
159
|
-
if (!props.selectable)
|
|
160
|
-
return;
|
|
161
|
-
setSelectedKey(key);
|
|
162
|
-
onItemSelect?.(key, item);
|
|
163
|
-
};
|
|
164
|
-
react.useEffect(() => {
|
|
165
|
-
if (selected === undefined)
|
|
166
|
-
return;
|
|
167
|
-
setSelectedKey(selected);
|
|
168
|
-
}, [selected]);
|
|
169
|
-
react.useEffect(() => {
|
|
170
|
-
nodeMapsRef.current.clear();
|
|
171
|
-
const { key: keyProp, children: childrenProp } = oNodeProps;
|
|
172
|
-
const walk = (nodes, parentKey = "") => {
|
|
173
|
-
nodes.forEach((item, i) => {
|
|
174
|
-
const mapKey = item[keyProp];
|
|
175
|
-
const key = (mapKey || `${parentKey}-${i}`);
|
|
176
|
-
nodeMapsRef.current.set(key, item);
|
|
177
|
-
const itemChildren = item[childrenProp];
|
|
178
|
-
if (Array.isArray(itemChildren) && itemChildren.length) {
|
|
179
|
-
walk(itemChildren, key);
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
};
|
|
183
|
-
walk(data);
|
|
184
|
-
}, [data, oNodeProps, asyncChildrenMap]);
|
|
185
|
-
react.useEffect(() => {
|
|
186
|
-
if (!props.selected)
|
|
187
|
-
return;
|
|
188
|
-
const node = nodeMapsRef.current.get(props.selected);
|
|
189
|
-
if (!node)
|
|
190
|
-
return;
|
|
191
|
-
const toExpand = {};
|
|
192
|
-
let p = node.parent;
|
|
193
|
-
while (p) {
|
|
194
|
-
if (p.key)
|
|
195
|
-
toExpand[p.key] = true;
|
|
196
|
-
p = p.parent;
|
|
197
|
-
}
|
|
198
|
-
if (Object.keys(toExpand).length > 0) {
|
|
199
|
-
setExpandedMap((prev) => ({ ...prev, ...toExpand }));
|
|
200
|
-
}
|
|
201
|
-
}, [props.selected]);
|
|
202
|
-
react.useImperativeHandle(ref, () => {
|
|
203
|
-
return {
|
|
204
|
-
getChecked: () => {
|
|
205
|
-
const items = [];
|
|
206
|
-
checkedKeys.map((k) => {
|
|
207
|
-
const item = nodeMapsRef.current.get(k);
|
|
208
|
-
items.push(item);
|
|
209
|
-
});
|
|
210
|
-
return [checkedKeys, items];
|
|
211
|
-
},
|
|
212
|
-
getSelected: () => {
|
|
213
|
-
const item = nodeMapsRef.current.get(selectedKey);
|
|
214
|
-
return [selectedKey, item];
|
|
215
|
-
},
|
|
216
|
-
getPartofs: () => {
|
|
217
|
-
const items = [];
|
|
218
|
-
const keys = Object.keys(partofs).filter((k) => {
|
|
219
|
-
const indeterminate = partofs[k];
|
|
220
|
-
if (indeterminate) {
|
|
221
|
-
const item = nodeMapsRef.current.get(k);
|
|
222
|
-
items.push(item);
|
|
223
|
-
}
|
|
224
|
-
return indeterminate;
|
|
225
|
-
});
|
|
226
|
-
return [keys, items];
|
|
227
|
-
},
|
|
228
|
-
};
|
|
229
|
-
});
|
|
230
|
-
if (useVirtual) {
|
|
231
|
-
return (jsxRuntime.jsx(virtual.default, { flatNodes: flatNodes, onExpand: handleExpand, height: height, useVirtual: useVirtual, selected: selectedKey, checkedSet: checkedSet, partofs: partofs, nodeProps: oNodeProps, loadingKeys: loadingKeys, onItemCheck: handleCheck, onItemSelect: handleSelect, ...restProps }));
|
|
232
|
-
}
|
|
233
|
-
return (jsxRuntime.jsx(item.TreeList, { flatNodes: flatNodes, onExpand: handleExpand, selected: selectedKey, checkedSet: checkedSet, partofs: partofs, nodeProps: oNodeProps, loadingKeys: loadingKeys, onItemCheck: handleCheck, onItemSelect: handleSelect, ...restProps }));
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
exports.default = Tree;
|
|
237
|
-
//# sourceMappingURL=tree.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","sources":["../../../../packages/components/tree/tree.tsx"],"sourcesContent":["import { flushSync } from \"react-dom\";\nimport { useEffect, useImperativeHandle, useMemo, useRef, useState } from \"react\";\nimport \"./index.css\";\nimport { TreeList } from \"./item\";\nimport { ITree, ITreeItem, FlatNode } from \"./type\";\nimport VirtualTree from \"./virtual\";\n\nconst defaultNodeProps = {\n\tkey: \"key\",\n\ttitle: \"title\",\n\tchildren: \"children\",\n};\n\nfunction flattenTree(\n\tnodes: ITreeItem[],\n\texpandedMap: Record<string, boolean>,\n\tnodeProps: { key: string; title: string; children: string },\n\tdepth = 0,\n\tparentItem?: ITreeItem,\n\tasyncChildrenMap: Record<string, ITreeItem[]> = {},\n): FlatNode[] {\n\tconst result: FlatNode[] = [];\n\tnodes.forEach((item, i) => {\n\t\tconst mapKey = item[nodeProps.key];\n\t\titem.key = mapKey || `${parentItem?.key ?? \"\"}-${i}`;\n\t\titem.parent = parentItem;\n\t\tconst isExpanded = !!expandedMap[item.key];\n\t\tresult.push({ node: item, depth, isExpanded });\n\t\tconst children = asyncChildrenMap[item.key as string] || item[nodeProps.children];\n\t\tif (Array.isArray(children) && children.length) {\n\t\t\tconst childNodes = flattenTree(children, expandedMap, nodeProps, depth + 1, item, asyncChildrenMap);\n\t\t\tif (isExpanded) result.push(...childNodes);\n\t\t}\n\t});\n\treturn result;\n}\n\nconst Tree = (props: ITree) => {\n\tconst {\n\t\tdata = [],\n\t\tref,\n\t\tselected,\n\t\tchecked = [],\n\t\tdisabledRelated,\n\t\tnodeProps,\n\t\theight,\n\t\tuseVirtual,\n\t\tonItemSelect,\n\t\tonItemCheck,\n\t\t...restProps\n\t} = props;\n\tconst [selectedKey, setSelectedKey] = useState(selected);\n\tconst [checkedKeys, setCheckedKeys] = useState(checked);\n\tconst [partofs, setPartofs] = useState<Record<string, boolean>>({});\n\tconst [loadingMap, setLoadingMap] = useState<Record<string, boolean>>({});\n\tconst [asyncChildrenMap, setAsyncChildrenMap] = useState<Record<string, ITreeItem[]>>({});\n\tconst nodeMapsRef = useRef<Map<string, ITreeItem>>(new Map());\n\tconst oNodeProps = useMemo(\n\t\t() => ({ ...defaultNodeProps, ...nodeProps }),\n\t\t[nodeProps],\n\t);\n\tconst checkedSet = useMemo(() => new Set(checkedKeys), [checkedKeys]);\n\n\tconst [expandedMap, setExpandedMap] = useState<Record<string, boolean>>(\n\t\t() => {\n\t\t\tconst map: Record<string, boolean> = {};\n\t\t\tconst walk = (nodes: ITreeItem[], parentKey = \"\") => {\n\t\t\t\tnodes.forEach((item, i) => {\n\t\t\t\t\tconst mapKey = item[oNodeProps.key] as string | undefined;\n\t\t\t\t\tconst key = mapKey || `${parentKey}-${i}`;\n\t\t\t\t\tif (item.expanded) map[key] = true;\n\t\t\t\t\tconst children = item[oNodeProps.children];\n\t\t\t\t\tif (Array.isArray(children) && children.length) walk(children, key);\n\t\t\t\t});\n\t\t\t};\n\t\t\twalk(data);\n\t\t\treturn map;\n\t\t},\n\t);\n\n\tconst handleExpand = (key: string) => {\n\t\tif (loadingMap[key]) return;\n\n\t\tconst item = nodeMapsRef.current.get(key);\n\t\tif (!item) return;\n\n\t\tconst rawChildren = item[oNodeProps.children];\n\t\tconst isAsync = rawChildren instanceof Promise;\n\t\tconst isExpanded = !!expandedMap[key];\n\n\t\tif (isAsync && !isExpanded) {\n\t\t\tflushSync(() => {\n\t\t\t\tsetLoadingMap((prev) => ({ ...prev, [key]: true }));\n\t\t\t\tsetExpandedMap((prev) => ({ ...prev, [key]: true }));\n\t\t\t});\n\n\t\t\trawChildren\n\t\t\t\t.then((resolved: ITreeItem[]) => {\n\t\t\t\t\titem[oNodeProps.children] = resolved;\n\t\t\t\t\tsetAsyncChildrenMap((prev) => ({ ...prev, [key]: resolved }));\n\t\t\t\t})\n\t\t\t\t.finally(() => {\n\t\t\t\t\tsetLoadingMap((prev) => {\n\t\t\t\t\t\tconst next = { ...prev };\n\t\t\t\t\t\tdelete next[key];\n\t\t\t\t\t\treturn next;\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t} else {\n\t\t\tsetExpandedMap((prev) => ({\n\t\t\t\t...prev,\n\t\t\t\t[key]: !prev[key],\n\t\t\t}));\n\t\t}\n\t};\n\n\tconst flatNodes = useMemo(\n\t\t() => flattenTree(data, expandedMap, oNodeProps, 0, undefined, asyncChildrenMap),\n\t\t[data, expandedMap, oNodeProps, asyncChildrenMap],\n\t);\n\n\tconst loadingKeys = useMemo(\n\t\t() => Object.keys(loadingMap).filter((k) => loadingMap[k]),\n\t\t[loadingMap],\n\t);\n\n\n\tconst checkItem = (\n\t\titem: ITreeItem,\n\t\tchecked: boolean,\n\t\tdirection?: \"root\" | \"leaf\",\n\t) => {\n\t\tconst { key = \"\", parent, children } = item;\n\t\tconst shouldChanged = { [key]: checked };\n\t\tconst partofs = { [key]: false };\n\n\t\tif (disabledRelated) return [shouldChanged];\n\n\t\tif (checked) {\n\t\t\tif (parent && direction !== \"leaf\") {\n\t\t\t\tconst hasUnchecked = Array.isArray(parent.children)\n\t\t\t\t\t? parent.children.some(\n\t\t\t\t\t\t(o) => o.key !== key && !checkedSet.has(o.key),\n\t\t\t\t\t)\n\t\t\t\t\t: false;\n\n\t\t\t\tconst [changes, parts] = checkItem(parent, true, \"root\");\n\n\t\t\t\tif (!hasUnchecked) {\n\t\t\t\t\tObject.assign(shouldChanged, changes);\n\t\t\t\t}\n\n\t\t\t\tObject.assign(partofs, hasUnchecked ? parts : {}, {\n\t\t\t\t\t[parent.key as string]: true,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (Array.isArray(children) && children.length && direction !== \"root\") {\n\t\t\t\tchildren.map((o) => {\n\t\t\t\t\tif (checkedSet.has(o.key)) return;\n\n\t\t\t\t\tconst [changes] = checkItem(o, true, \"leaf\");\n\n\t\t\t\t\tObject.assign(shouldChanged, changes);\n\t\t\t\t\tpartofs[o.key as string] = false;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn [shouldChanged, partofs];\n\t\t}\n\n\t\tif (parent && direction !== \"leaf\") {\n\t\t\tconst [changes, parts] = checkItem(parent, false, \"root\");\n\n\t\t\tObject.assign(shouldChanged, changes);\n\n\t\t\tconst hasChecked = Array.isArray(parent.children)\n\t\t\t\t? parent.children.some(\n\t\t\t\t\t(o) => checkedSet.has(o.key) && o.key !== key,\n\t\t\t\t)\n\t\t\t\t: false;\n\n\t\t\tObject.assign(partofs, hasChecked ? {} : parts, {\n\t\t\t\t[parent.key as string]: hasChecked,\n\t\t\t\t[key]: false,\n\t\t\t});\n\t\t}\n\t\tif (Array.isArray(children) && children.length && direction !== \"root\") {\n\t\t\tchildren.map((o) => {\n\t\t\t\tconst [changes] = checkItem(o, false, \"leaf\");\n\n\t\t\t\tif (!checkedSet.has(o.key)) return;\n\n\t\t\t\tObject.assign(shouldChanged, changes);\n\t\t\t\tpartofs[o.key as string] = false;\n\t\t\t});\n\t\t}\n\n\t\treturn [shouldChanged, partofs];\n\t};\n\n\tconst handleCheck = (item: ITreeItem, checked: boolean) => {\n\t\tconst [shouldChanged, partofs] = checkItem(item, checked);\n\t\tconst changedKeys = Object.keys(shouldChanged);\n\n\t\tconst changedKeysSet = new Set(changedKeys);\n\t\tconst nextChecked = checked\n\t\t\t? Array.from(new Set([...checkedKeys, ...changedKeys]))\n\t\t\t: checkedKeys.filter((k) => !changedKeysSet.has(k));\n\n\t\tsetCheckedKeys(nextChecked);\n\t\tsetPartofs((p) => ({ ...p, ...partofs }));\n\t\tonItemCheck?.(item, checked, nextChecked);\n\t};\n\n\tconst handleSelect = (key: string, item: ITreeItem) => {\n\t\tif (!props.selectable) return;\n\n\t\tsetSelectedKey(key);\n\t\tonItemSelect?.(key, item);\n\t};\n\n\tuseEffect(() => {\n\t\tif (selected === undefined) return;\n\n\t\tsetSelectedKey(selected);\n\t}, [selected]);\n\n\tuseEffect(() => {\n\t\tnodeMapsRef.current.clear();\n\t\tconst { key: keyProp, children: childrenProp } = oNodeProps;\n\t\tconst walk = (nodes: ITreeItem[], parentKey = \"\") => {\n\t\t\tnodes.forEach((item, i) => {\n\t\t\t\tconst mapKey = item[keyProp];\n\t\t\t\tconst key = (mapKey || `${parentKey}-${i}`) as string;\n\t\t\t\tnodeMapsRef.current.set(key, item);\n\t\t\t\tconst itemChildren = item[childrenProp];\n\t\t\t\tif (Array.isArray(itemChildren) && itemChildren.length) {\n\t\t\t\t\twalk(itemChildren, key);\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t\twalk(data);\n\t}, [data, oNodeProps, asyncChildrenMap]);\n\n\tuseEffect(() => {\n\t\tif (!props.selected) return;\n\n\t\tconst node = nodeMapsRef.current.get(props.selected);\n\t\tif (!node) return;\n\n\t\tconst toExpand: Record<string, boolean> = {};\n\t\tlet p = node.parent;\n\t\twhile (p) {\n\t\t\tif (p.key) toExpand[p.key] = true;\n\t\t\tp = p.parent;\n\t\t}\n\n\t\tif (Object.keys(toExpand).length > 0) {\n\t\t\tsetExpandedMap((prev) => ({ ...prev, ...toExpand }));\n\t\t}\n\t}, [props.selected]);\n\n\tuseImperativeHandle(ref, () => {\n\t\treturn {\n\t\t\tgetChecked: () => {\n\t\t\t\tconst items: ITreeItem[] = [];\n\t\t\t\tcheckedKeys.map((k) => {\n\t\t\t\t\tconst item = nodeMapsRef.current.get(k);\n\t\t\t\t\titems.push(item);\n\t\t\t\t});\n\t\t\t\treturn [checkedKeys, items];\n\t\t\t},\n\t\t\tgetSelected: () => {\n\t\t\t\tconst item = nodeMapsRef.current.get(selectedKey);\n\t\t\t\treturn [selectedKey, item];\n\t\t\t},\n\t\t\tgetPartofs: () => {\n\t\t\t\tconst items: ITreeItem[] = [];\n\t\t\t\tconst keys = Object.keys(partofs).filter((k) => {\n\t\t\t\t\tconst indeterminate = partofs[k];\n\n\t\t\t\t\tif (indeterminate) {\n\t\t\t\t\t\tconst item = nodeMapsRef.current.get(k);\n\t\t\t\t\t\titems.push(item);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn indeterminate;\n\t\t\t\t});\n\n\t\t\t\treturn [keys, items];\n\t\t\t},\n\t\t};\n\t});\n\n\tif (useVirtual) {\n\t\treturn (\n\t\t\t<VirtualTree\n\t\t\t\tflatNodes={flatNodes}\n\t\t\t\tonExpand={handleExpand}\n\t\t\t\theight={height}\n\t\t\t\tuseVirtual={useVirtual}\n\t\t\t\tselected={selectedKey}\n\t\t\t\tcheckedSet={checkedSet}\n\t\t\t\tpartofs={partofs}\n\t\t\t\tnodeProps={oNodeProps}\n\t\t\t\tloadingKeys={loadingKeys}\n\t\t\t\tonItemCheck={handleCheck}\n\t\t\t\tonItemSelect={handleSelect}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<TreeList\n\t\t\tflatNodes={flatNodes}\n\t\t\tonExpand={handleExpand}\n\t\t\tselected={selectedKey}\n\t\t\tcheckedSet={checkedSet}\n\t\t\tpartofs={partofs}\n\t\t\tnodeProps={oNodeProps}\n\t\t\tloadingKeys={loadingKeys}\n\t\t\tonItemCheck={handleCheck}\n\t\t\tonItemSelect={handleSelect}\n\t\t\t{...restProps}\n\t\t/>\n\t);\n};\n\nexport default Tree;\n"],"names":["useState","useRef","useMemo","flushSync","useEffect","useImperativeHandle","_jsx","VirtualTree","TreeList"],"mappings":";;;;;;;;;;AAOA,MAAM,gBAAgB,GAAG;AACxB,IAAA,GAAG,EAAE,KAAK;AACV,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,QAAQ,EAAE,UAAU;CACpB;AAED,SAAS,WAAW,CACnB,KAAkB,EAClB,WAAoC,EACpC,SAA2D,EAC3D,KAAK,GAAG,CAAC,EACT,UAAsB,EACtB,mBAAgD,EAAE,EAAA;IAElD,MAAM,MAAM,GAAe,EAAE;IAC7B,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,KAAI;QACzB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;AAClC,QAAA,IAAI,CAAC,GAAG,GAAG,MAAM,IAAI,CAAA,EAAG,UAAU,EAAE,GAAG,IAAI,EAAE,CAAA,CAAA,EAAI,CAAC,EAAE;AACpD,QAAA,IAAI,CAAC,MAAM,GAAG,UAAU;QACxB,MAAM,UAAU,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;AAC1C,QAAA,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAC9C,QAAA,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,CAAC,GAAa,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;QACjF,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,EAAE;A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AAI,CAAC,IAAI,CAAC;oBACjB;AAEA,oBAAA,OAAO,aAAa;AACrB,gBAAA,CAAC,CAAC;AAEF,gBAAA,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;YACrB,CAAC;SACD;AACF,IAAA,CAAC,CAAC;IAEF,IAAI,UAAU,EAAE;QACf,QACCC,eAACC,eAAW,EAAA,EACX,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,WAAW,EACrB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAAA,GACtB,SAAS,EAAA,CACZ;IAEJ;AAEA,IAAA,QACCD,cAAA,CAACE,aAAQ,IACR,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,WAAW,EACrB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,UAAU,EACrB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,KACtB,SAAS,EAAA,CACZ;AAEJ;;;;"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var classNames = require('classnames');
|
|
7
|
-
var react = require('react');
|
|
8
|
-
var reactWindow = require('react-window');
|
|
9
|
-
var hooks = require('../../js/hooks.js');
|
|
10
|
-
var item = require('./item.js');
|
|
11
|
-
|
|
12
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
13
|
-
|
|
14
|
-
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
15
|
-
|
|
16
|
-
function VirtualTree(props) {
|
|
17
|
-
const { flatNodes, onExpand, selected, checkedSet, partofs = {}, checkable, nodeProps, renderExtra, loadingKeys, height, useVirtual, className, style, onItemClick, onItemSelect, onItemCheck, } = props;
|
|
18
|
-
const listRef = react.useRef(null);
|
|
19
|
-
const wrapRef = react.useRef(null);
|
|
20
|
-
const ro = hooks.useResizeObserver();
|
|
21
|
-
const [viewportHeight, setViewportHeight] = react.useState(0);
|
|
22
|
-
react.useEffect(() => {
|
|
23
|
-
const el = wrapRef.current;
|
|
24
|
-
if (!el)
|
|
25
|
-
return;
|
|
26
|
-
const update = () => {
|
|
27
|
-
const r = el.getBoundingClientRect();
|
|
28
|
-
setViewportHeight((prev) => (prev === r.height ? prev : r.height));
|
|
29
|
-
};
|
|
30
|
-
update();
|
|
31
|
-
ro.observe?.(el, update);
|
|
32
|
-
return () => ro.unobserve?.(el);
|
|
33
|
-
}, [ro]);
|
|
34
|
-
const listHeight = Math.max(0, (typeof height === "number" ? height : viewportHeight || 360));
|
|
35
|
-
const propsRef = react.useRef(props);
|
|
36
|
-
propsRef.current = props;
|
|
37
|
-
const rowComponent = react.useCallback(({ index, style, }) => {
|
|
38
|
-
const p = propsRef.current;
|
|
39
|
-
const flatNode = p.flatNodes[index];
|
|
40
|
-
if (!flatNode)
|
|
41
|
-
return null;
|
|
42
|
-
return (jsxRuntime.jsx(item.TreeRow, { flatNode: flatNode, wrapperStyle: style, virtualMode: true, selected: p.selected, checkedSet: p.checkedSet, partofs: p.partofs, checkable: p.checkable, nodeProps: p.nodeProps, renderExtra: p.renderExtra, loadingKeys: p.loadingKeys, onExpand: p.onExpand, onItemClick: p.onItemClick, onItemSelect: p.onItemSelect, onItemCheck: p.onItemCheck }));
|
|
43
|
-
}, []);
|
|
44
|
-
return (jsxRuntime.jsx("div", { ref: wrapRef, className: classNames__default("i-tree", className), style: { display: "block", width: "100%", height: "100%", ...style }, children: jsxRuntime.jsx(reactWindow.List, { listRef: listRef, rowCount: flatNodes.length, rowHeight: useVirtual.rowHeight, overscanCount: Math.max(3, useVirtual.threshold ?? 8), rowProps: {}, style: {
|
|
45
|
-
width: "100%",
|
|
46
|
-
height: listHeight,
|
|
47
|
-
overflow: "auto",
|
|
48
|
-
}, rowComponent: rowComponent }) }));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
exports.default = VirtualTree;
|
|
52
|
-
//# sourceMappingURL=virtual.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"virtual.js","sources":["../../../../packages/components/tree/virtual.tsx"],"sourcesContent":["import { KeyboardArrowDownRound } from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-ignore\nimport { List as VirtualList } from \"react-window\";\nimport Checkbox from \"../checkbox\";\nimport Icon from \"../icon\";\nimport Loading from \"../loading\";\nimport { useResizeObserver } from \"../../js/hooks\";\nimport { FlatNode, ITreeItem, TVirtual } from \"./type\";\nimport { TreeRow } from \"./item\";\n\ninterface VirtualTreeProps {\n\tflatNodes: FlatNode[];\n\tonExpand: (key: string) => void;\n\tselected?: string;\n\tcheckedSet: Set<string>;\n\tpartofs?: Record<string, boolean>;\n\tcheckable?: boolean;\n\tnodeProps: { key: string; title: string; children: string };\n\trenderExtra?: (item: ITreeItem) => React.ReactNode;\n\tloadingKeys?: string[];\n\theight?: number | string;\n\tuseVirtual: TVirtual;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\tonItemClick?: (item: ITreeItem, e: React.MouseEvent<HTMLElement>) => void;\n\tonItemSelect?: (key: string, item: ITreeItem) => void;\n\tonItemCheck?: (\n\t\titem: ITreeItem,\n\t\tchecked: boolean,\n\t\tcheckedKeys: string[],\n\t) => void;\n}\n\nexport default function VirtualTree(props: VirtualTreeProps) {\n\tconst {\n\t\tflatNodes,\n\t\tonExpand,\n\t\tselected,\n\t\tcheckedSet,\n\t\tpartofs = {},\n\t\tcheckable,\n\t\tnodeProps,\n\t\trenderExtra,\n\t\tloadingKeys,\n\t\theight,\n\t\tuseVirtual,\n\t\tclassName,\n\t\tstyle,\n\t\tonItemClick,\n\t\tonItemSelect,\n\t\tonItemCheck,\n\t} = props;\n\n\tconst listRef = useRef<any>(null);\n\tconst wrapRef = useRef<HTMLDivElement>(null);\n\tconst ro = useResizeObserver();\n\tconst [viewportHeight, setViewportHeight] = useState(0);\n\n\tuseEffect(() => {\n\t\tconst el = wrapRef.current;\n\t\tif (!el) return;\n\t\tconst update = () => {\n\t\t\tconst r = el.getBoundingClientRect();\n\t\t\tsetViewportHeight((prev) => (prev === r.height ? prev : r.height));\n\t\t};\n\t\tupdate();\n\t\tro.observe?.(el, update);\n\t\treturn () => ro.unobserve?.(el);\n\t}, [ro]);\n\n\tconst listHeight = Math.max(\n\t\t0,\n\t\t(typeof height === \"number\" ? height : viewportHeight || 360),\n\t);\n\n\tconst propsRef = useRef(props);\n\tpropsRef.current = props;\n\n\tconst rowComponent = useCallback(\n\t\t({\n\t\t\tindex,\n\t\t\tstyle,\n\t\t}: {\n\t\t\tindex: number;\n\t\t\tstyle: React.CSSProperties;\n\t\t}) => {\n\t\t\tconst p = propsRef.current;\n\t\t\tconst flatNode = p.flatNodes[index];\n\t\t\tif (!flatNode) return null;\n\t\t\treturn (\n\t\t\t\t<TreeRow\n\t\t\t\t\tflatNode={flatNode}\n\t\t\t\t\twrapperStyle={style}\n\t\t\t\t\tvirtualMode\n\t\t\t\t\tselected={p.selected}\n\t\t\t\t\tcheckedSet={p.checkedSet}\n\t\t\t\t\tpartofs={p.partofs}\n\t\t\t\t\tcheckable={p.checkable}\n\t\t\t\t\tnodeProps={p.nodeProps}\n\t\t\t\t\trenderExtra={p.renderExtra}\n\t\t\t\t\tloadingKeys={p.loadingKeys}\n\t\t\t\t\tonExpand={p.onExpand}\n\t\t\t\t\tonItemClick={p.onItemClick}\n\t\t\t\t\tonItemSelect={p.onItemSelect}\n\t\t\t\t\tonItemCheck={p.onItemCheck}\n\t\t\t\t/>\n\t\t\t);\n\t\t},\n\t\t[],\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={wrapRef}\n\t\t\tclassName={classNames(\"i-tree\", className)}\n\t\t\tstyle={{ display: \"block\", width: \"100%\", height: \"100%\", ...style }}\n\t\t>\n\t\t\t<VirtualList\n\t\t\t\tlistRef={listRef}\n\t\t\t\trowCount={flatNodes.length}\n\t\t\t\trowHeight={useVirtual.rowHeight}\n\t\t\t\toverscanCount={Math.max(3, useVirtual.threshold ?? 8)}\n\t\t\t\trowProps={{} as any}\n\t\t\t\tstyle={{\n\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\theight: listHeight,\n\t\t\t\t\toverflow: \"auto\",\n\t\t\t\t}}\n\t\t\t\trowComponent={rowComponent}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"names":["useRef","useResizeObserver","useState","useEffect","useCallback","_jsx","TreeRow","classNames","VirtualList"],"mappings":";;;;;;;;;;;;;;;AAmCc,SAAU,WAAW,CAAC,KAAuB,EAAA;AAC1D,IAAA,MAAM,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,OAAO,GAAG,EAAE,EACZ,SAAS,EACT,SAAS,EACT,WAAW,EACX,WAAW,EACX,MAAM,EACN,UAAU,EACV,SAAS,EACT,KAAK,EACL,WAAW,EACX,YAAY,EACZ,WAAW,GACX,GAAG,KAAK;AAET,IAAA,MAAM,OAAO,GAAGA,YAAM,CAAM,IAAI,CAAC;AACjC,IAAA,MAAM,OAAO,GAAGA,YAAM,CAAiB,IAAI,CAAC;AAC5C,IAAA,MAAM,EAAE,GAAGC,uBAAiB,EAAE;IAC9B,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAGC,cAAQ,CAAC,CAAC,CAAC;IAEvDC,eAAS,CAAC,MAAK;AACd,QAAA,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO;AAC1B,QAAA,IAAI,CAAC,EAAE;YAAE;QACT,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B,QAAQ,EAAE,CAAC,CAAC,QAAQ,EACpB,WAAW,EAAE,CAAC,CAAC,WAAW,EAC1B,YAAY,EAAE,CAAC,CAAC,YAAY,EAC5B,WAAW,EAAE,CAAC,CAAC,WAAW,EAAA,CACzB;IAEJ,CAAC,EACD,EAAE,CACF;AAED,IAAA,QACCD,cAAA,CAAA,KAAA,EAAA,EACC,GAAG,EAAE,OAAO,EACZ,SAAS,EAAEE,mBAAU,CAAC,QAAQ,EAAE,SAAS,CAAC,EAC1C,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,YAEpEF,cAAA,CAACG,gBAAW,EAAA,EACX,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,SAAS,CAAC,MAAM,EAC1B,SAAS,EAAE,UAAU,CAAC,SAAS,EAC/B,aAAa,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,SAAS,IAAI,CAAC,CAAC,EACrD,QAAQ,EAAE,EAAS,EACnB,KAAK,EAAE;AACN,gBAAA,KAAK,EAAE,MAAM;AACb,gBAAA,MAAM,EAAE,UAAU;AAClB,gBAAA,QAAQ,EAAE,MAAM;AAChB,aAAA,EACD,YAAY,EAAE,YAAY,EAAA,CACzB,EAAA,CACG;AAER;;;;"}
|
|
@@ -1,54 +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
|
-
|
|
11
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
12
|
-
|
|
13
|
-
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
14
|
-
|
|
15
|
-
const Dropbox = (props) => {
|
|
16
|
-
const { multiple, accept, disabled, children, onChange, onDropFiles } = props;
|
|
17
|
-
const [dragging, setDragging] = react.useState(false);
|
|
18
|
-
const inputRef = react.useRef(null);
|
|
19
|
-
const handleDragOver = (e) => {
|
|
20
|
-
e.preventDefault();
|
|
21
|
-
e.stopPropagation();
|
|
22
|
-
};
|
|
23
|
-
const handleDragEnter = (e) => {
|
|
24
|
-
e.preventDefault();
|
|
25
|
-
e.stopPropagation();
|
|
26
|
-
if (!disabled)
|
|
27
|
-
setDragging(true);
|
|
28
|
-
};
|
|
29
|
-
const handleDragLeave = (e) => {
|
|
30
|
-
e.preventDefault();
|
|
31
|
-
e.stopPropagation();
|
|
32
|
-
setDragging(false);
|
|
33
|
-
};
|
|
34
|
-
const handleDrop = (e) => {
|
|
35
|
-
e.preventDefault();
|
|
36
|
-
e.stopPropagation();
|
|
37
|
-
setDragging(false);
|
|
38
|
-
if (disabled)
|
|
39
|
-
return;
|
|
40
|
-
const files = Array.from(e.dataTransfer.files);
|
|
41
|
-
if (files.length)
|
|
42
|
-
onDropFiles(files);
|
|
43
|
-
};
|
|
44
|
-
const handleClick = () => {
|
|
45
|
-
if (!disabled)
|
|
46
|
-
inputRef.current?.click();
|
|
47
|
-
};
|
|
48
|
-
return (jsxRuntime.jsxs("div", { className: classNames__default("i-upload-dropbox", dragging && "i-upload-dropbox-active"), onDragOver: handleDragOver, onDragEnter: handleDragEnter, onDragLeave: handleDragLeave, onDrop: handleDrop, onClick: handleClick, children: [jsxRuntime.jsx("input", { ref: inputRef, type: "file", className: "i-input-file-hidden", multiple: multiple, accept: accept, disabled: disabled, onChange: onChange }), typeof children === "function"
|
|
49
|
-
? children(dragging)
|
|
50
|
-
: children || (jsxRuntime.jsx(icon.default, { icon: dragging ? (jsxRuntime.jsx(material.MoveToInboxTwotone, {})) : (jsxRuntime.jsx(material.OutboxTwotone, {})), size: "2em" }))] }));
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
exports.default = Dropbox;
|
|
54
|
-
//# sourceMappingURL=dropbox.js.map
|