@ioca/react 1.3.2 → 1.3.3
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/components/affix/affix.js +2 -0
- package/lib/components/affix/affix.js.map +1 -0
- package/lib/components/affix/index.js +2 -0
- package/lib/components/affix/index.js.map +1 -0
- package/lib/components/affix/totop.js +2 -0
- package/lib/components/affix/totop.js.map +1 -0
- package/lib/components/badge/badge.js +2 -0
- package/lib/components/badge/badge.js.map +1 -0
- package/lib/components/badge/index.js +2 -0
- package/lib/components/badge/index.js.map +1 -0
- package/lib/components/button/button.js +2 -0
- package/lib/components/button/button.js.map +1 -0
- package/lib/components/button/group.js +2 -0
- package/lib/components/button/group.js.map +1 -0
- package/lib/components/button/index.js +2 -0
- package/lib/components/button/index.js.map +1 -0
- package/lib/components/button/toggle.js +2 -0
- package/lib/components/button/toggle.js.map +1 -0
- package/lib/components/card/card.js +2 -0
- package/lib/components/card/card.js.map +1 -0
- package/lib/components/card/index.js +2 -0
- package/lib/components/card/index.js.map +1 -0
- package/lib/components/checkbox/checkbox.js +2 -0
- package/lib/components/checkbox/checkbox.js.map +1 -0
- package/lib/components/checkbox/index.js +2 -0
- package/lib/components/checkbox/index.js.map +1 -0
- package/lib/components/checkbox/item.js +2 -0
- package/lib/components/checkbox/item.js.map +1 -0
- package/lib/components/collapse/collapse.js +2 -0
- package/lib/components/collapse/collapse.js.map +1 -0
- package/lib/components/collapse/index.js +2 -0
- package/lib/components/collapse/index.js.map +1 -0
- package/lib/components/collapse/item.js +2 -0
- package/lib/components/collapse/item.js.map +1 -0
- package/lib/components/datagrid/cell.js +2 -0
- package/lib/components/datagrid/cell.js.map +1 -0
- package/lib/components/datagrid/datagrid.js +2 -0
- package/lib/components/datagrid/datagrid.js.map +1 -0
- package/lib/components/datagrid/index.js +2 -0
- package/lib/components/datagrid/index.js.map +1 -0
- package/lib/components/datagrid/resize.js +2 -0
- package/lib/components/datagrid/resize.js.map +1 -0
- package/lib/components/datagrid/row.js +2 -0
- package/lib/components/datagrid/row.js.map +1 -0
- package/lib/components/datagrid/sorter.js +2 -0
- package/lib/components/datagrid/sorter.js.map +1 -0
- package/lib/components/description/description.js +2 -0
- package/lib/components/description/description.js.map +1 -0
- package/lib/components/description/index.js +2 -0
- package/lib/components/description/index.js.map +1 -0
- package/lib/components/drawer/drawer.js +2 -0
- package/lib/components/drawer/drawer.js.map +1 -0
- package/lib/components/drawer/index.js +2 -0
- package/lib/components/drawer/index.js.map +1 -0
- package/lib/components/dropdown/dropdown.js +2 -0
- package/lib/components/dropdown/dropdown.js.map +1 -0
- package/lib/components/dropdown/index.js +2 -0
- package/lib/components/dropdown/index.js.map +1 -0
- package/lib/components/dropdown/item.js +2 -0
- package/lib/components/dropdown/item.js.map +1 -0
- package/lib/components/editor/controls.js +2 -0
- package/lib/components/editor/controls.js.map +1 -0
- package/lib/components/editor/editor.js +2 -0
- package/lib/components/editor/editor.js.map +1 -0
- package/lib/components/editor/index.js +2 -0
- package/lib/components/editor/index.js.map +1 -0
- package/lib/components/flex/flex.js +2 -0
- package/lib/components/flex/flex.js.map +1 -0
- package/lib/components/flex/index.js +2 -0
- package/lib/components/flex/index.js.map +1 -0
- package/lib/components/form/context.js +2 -0
- package/lib/components/form/context.js.map +1 -0
- package/lib/components/form/field.js +2 -0
- package/lib/components/form/field.js.map +1 -0
- package/lib/components/form/form.js +2 -0
- package/lib/components/form/form.js.map +1 -0
- package/lib/components/form/index.js +2 -0
- package/lib/components/form/index.js.map +1 -0
- package/lib/components/form/useForm.js +2 -0
- package/lib/components/form/useForm.js.map +1 -0
- package/lib/components/icon/icon.js +2 -0
- package/lib/components/icon/icon.js.map +1 -0
- package/lib/components/icon/index.js +2 -0
- package/lib/components/icon/index.js.map +1 -0
- package/lib/components/image/image.js +2 -0
- package/lib/components/image/image.js.map +1 -0
- package/lib/components/image/index.js +2 -0
- package/lib/components/image/index.js.map +1 -0
- package/lib/components/image/list.js +2 -0
- package/lib/components/image/list.js.map +1 -0
- package/lib/components/input/container.js +2 -0
- package/lib/components/input/container.js.map +1 -0
- package/lib/components/input/index.js +2 -0
- package/lib/components/input/index.js.map +1 -0
- package/lib/components/input/input.js +2 -0
- package/lib/components/input/input.js.map +1 -0
- package/lib/components/input/number.js +2 -0
- package/lib/components/input/number.js.map +1 -0
- package/lib/components/input/range.js +2 -0
- package/lib/components/input/range.js.map +1 -0
- package/lib/components/input/textarea.js +2 -0
- package/lib/components/input/textarea.js.map +1 -0
- package/lib/components/list/index.js +2 -0
- package/lib/components/list/index.js.map +1 -0
- package/lib/components/list/item.js +2 -0
- package/lib/components/list/item.js.map +1 -0
- package/lib/components/list/list.js +2 -0
- package/lib/components/list/list.js.map +1 -0
- package/lib/components/loading/index.js +2 -0
- package/lib/components/loading/index.js.map +1 -0
- package/lib/components/loading/loading.js +2 -0
- package/lib/components/loading/loading.js.map +1 -0
- package/lib/components/message/index.js +2 -0
- package/lib/components/message/index.js.map +1 -0
- package/lib/components/message/message.js +2 -0
- package/lib/components/message/message.js.map +1 -0
- package/lib/components/modal/hookModal.js +2 -0
- package/lib/components/modal/hookModal.js.map +1 -0
- package/lib/components/modal/index.js +2 -0
- package/lib/components/modal/index.js.map +1 -0
- package/lib/components/modal/modal.js +2 -0
- package/lib/components/modal/modal.js.map +1 -0
- package/lib/components/modal/useModal.js +2 -0
- package/lib/components/modal/useModal.js.map +1 -0
- package/lib/components/pagination/index.js +2 -0
- package/lib/components/pagination/index.js.map +1 -0
- package/lib/components/pagination/page.js +2 -0
- package/lib/components/pagination/page.js.map +1 -0
- package/lib/components/pagination/pagination.js +2 -0
- package/lib/components/pagination/pagination.js.map +1 -0
- package/lib/components/picker/colors/footer.js +2 -0
- package/lib/components/picker/colors/footer.js.map +1 -0
- package/lib/components/picker/colors/handle.js +2 -0
- package/lib/components/picker/colors/handle.js.map +1 -0
- package/lib/components/picker/colors/index.js +2 -0
- package/lib/components/picker/colors/index.js.map +1 -0
- package/lib/components/picker/dates/dates.js +2 -0
- package/lib/components/picker/dates/dates.js.map +1 -0
- package/lib/components/picker/dates/index.js +2 -0
- package/lib/components/picker/dates/index.js.map +1 -0
- package/lib/components/picker/dates/panel.js +2 -0
- package/lib/components/picker/dates/panel.js.map +1 -0
- package/lib/components/picker/time/index.js +2 -0
- package/lib/components/picker/time/index.js.map +1 -0
- package/lib/components/picker/time/item.js +2 -0
- package/lib/components/picker/time/item.js.map +1 -0
- package/lib/components/picker/time/panel.js +2 -0
- package/lib/components/picker/time/panel.js.map +1 -0
- package/lib/components/popconfirm/index.js +2 -0
- package/lib/components/popconfirm/index.js.map +1 -0
- package/lib/components/popconfirm/popconfirm.js +2 -0
- package/lib/components/popconfirm/popconfirm.js.map +1 -0
- package/lib/components/popup/content.js +2 -0
- package/lib/components/popup/content.js.map +1 -0
- package/lib/components/popup/index.js +2 -0
- package/lib/components/popup/index.js.map +1 -0
- package/lib/components/popup/popup.js +2 -0
- package/lib/components/popup/popup.js.map +1 -0
- package/lib/components/progress/circle.js +2 -0
- package/lib/components/progress/circle.js.map +1 -0
- package/lib/components/progress/index.js +2 -0
- package/lib/components/progress/index.js.map +1 -0
- package/lib/components/progress/line.js +2 -0
- package/lib/components/progress/line.js.map +1 -0
- package/lib/components/progress/progress.js +2 -0
- package/lib/components/progress/progress.js.map +1 -0
- package/lib/components/radio/index.js +2 -0
- package/lib/components/radio/index.js.map +1 -0
- package/lib/components/radio/item.js +2 -0
- package/lib/components/radio/item.js.map +1 -0
- package/lib/components/radio/radio.js +2 -0
- package/lib/components/radio/radio.js.map +1 -0
- package/lib/components/resizable/index.js +2 -0
- package/lib/components/resizable/index.js.map +1 -0
- package/lib/components/resizable/resizable.js +2 -0
- package/lib/components/resizable/resizable.js.map +1 -0
- package/lib/components/select/index.js +2 -0
- package/lib/components/select/index.js.map +1 -0
- package/lib/components/select/options.js +2 -0
- package/lib/components/select/options.js.map +1 -0
- package/lib/components/select/select.js +2 -0
- package/lib/components/select/select.js.map +1 -0
- package/lib/components/step/divider.js +2 -0
- package/lib/components/step/divider.js.map +1 -0
- package/lib/components/step/index.js +2 -0
- package/lib/components/step/index.js.map +1 -0
- package/lib/components/step/item.js +2 -0
- package/lib/components/step/item.js.map +1 -0
- package/lib/components/step/step.js +2 -0
- package/lib/components/step/step.js.map +1 -0
- package/lib/components/swiper/index.js +2 -0
- package/lib/components/swiper/index.js.map +1 -0
- package/lib/components/swiper/item.js +2 -0
- package/lib/components/swiper/item.js.map +1 -0
- package/lib/components/swiper/swiper.js +2 -0
- package/lib/components/swiper/swiper.js.map +1 -0
- package/lib/components/tabs/index.js +2 -0
- package/lib/components/tabs/index.js.map +1 -0
- package/lib/components/tabs/item.js +2 -0
- package/lib/components/tabs/item.js.map +1 -0
- package/lib/components/tabs/tabs.js +2 -0
- package/lib/components/tabs/tabs.js.map +1 -0
- package/lib/components/tag/index.js +2 -0
- package/lib/components/tag/index.js.map +1 -0
- package/lib/components/tag/tag.js +2 -0
- package/lib/components/tag/tag.js.map +1 -0
- package/lib/components/text/highlight.js +2 -0
- package/lib/components/text/highlight.js.map +1 -0
- package/lib/components/text/index.js +2 -0
- package/lib/components/text/index.js.map +1 -0
- package/lib/components/text/number.js +2 -0
- package/lib/components/text/number.js.map +1 -0
- package/lib/components/text/text.js +2 -0
- package/lib/components/text/text.js.map +1 -0
- package/lib/components/text/time.js +2 -0
- package/lib/components/text/time.js.map +1 -0
- package/lib/components/tree/index.js +2 -0
- package/lib/components/tree/index.js.map +1 -0
- package/lib/components/tree/item.js +2 -0
- package/lib/components/tree/item.js.map +1 -0
- package/lib/components/tree/tree.js +2 -0
- package/lib/components/tree/tree.js.map +1 -0
- package/lib/components/upload/index.js +2 -0
- package/lib/components/upload/index.js.map +1 -0
- package/lib/components/upload/renderFile.js +2 -0
- package/lib/components/upload/renderFile.js.map +1 -0
- package/lib/components/upload/upload.js +2 -0
- package/lib/components/upload/upload.js.map +1 -0
- package/lib/components/utils/empty/index.js +2 -0
- package/lib/components/utils/empty/index.js.map +1 -0
- package/lib/components/utils/helpericon/helpericon.js +2 -0
- package/lib/components/utils/helpericon/helpericon.js.map +1 -0
- package/lib/components/utils/helpericon/index.js +2 -0
- package/lib/components/utils/helpericon/index.js.map +1 -0
- package/lib/components/video/index.js +2 -0
- package/lib/components/video/index.js.map +1 -0
- package/lib/components/video/video.js +2 -0
- package/lib/components/video/video.js.map +1 -0
- package/lib/css/index.css +1 -1
- package/lib/css/index.css.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/js/hooks.js +2 -0
- package/lib/js/hooks.js.map +1 -0
- package/lib/js/usePreview/content.js +2 -0
- package/lib/js/usePreview/content.js.map +1 -0
- package/lib/js/usePreview/index.js +2 -0
- package/lib/js/usePreview/index.js.map +1 -0
- package/lib/js/usePreview/renderFile.js +2 -0
- package/lib/js/usePreview/renderFile.js.map +1 -0
- package/lib/js/usePreview/type.js +2 -0
- package/lib/js/usePreview/type.js.map +1 -0
- package/lib/js/useRipple/index.js +2 -0
- package/lib/js/useRipple/index.js.map +1 -0
- package/lib/js/utils.js +2 -0
- package/lib/js/utils.js.map +1 -0
- package/lib/types/components/affix/affix.d.ts +10 -0
- package/lib/types/components/affix/index.d.ts +5 -0
- package/lib/types/components/affix/totop.d.ts +6 -0
- package/lib/types/components/affix/type.d.ts +13 -0
- package/lib/types/components/badge/badge.d.ts +6 -0
- package/lib/types/components/badge/index.d.ts +5 -0
- package/lib/types/components/badge/type.d.ts +15 -0
- package/lib/types/components/button/button.d.ts +5 -0
- package/lib/types/components/button/group.d.ts +6 -0
- package/lib/types/components/button/index.d.ts +5 -0
- package/lib/types/components/button/toggle.d.ts +6 -0
- package/lib/types/components/button/type.d.ts +44 -0
- package/lib/types/components/card/card.d.ts +6 -0
- package/lib/types/components/card/index.d.ts +5 -0
- package/lib/types/components/card/type.d.ts +13 -0
- package/lib/types/components/checkbox/checkbox.d.ts +10 -0
- package/lib/types/components/checkbox/index.d.ts +5 -0
- package/lib/types/components/checkbox/item.d.ts +6 -0
- package/lib/types/components/checkbox/type.d.ts +24 -0
- package/lib/types/components/collapse/collapse.d.ts +10 -0
- package/lib/types/components/collapse/index.d.ts +5 -0
- package/lib/types/components/collapse/item.d.ts +6 -0
- package/lib/types/components/collapse/type.d.ts +23 -0
- package/lib/types/components/datagrid/datagrid.d.ts +6 -0
- package/lib/types/components/datagrid/index.d.ts +5 -0
- package/lib/types/components/datagrid/type.d.ts +40 -0
- package/lib/types/components/description/description.d.ts +6 -0
- package/lib/types/components/description/index.d.ts +5 -0
- package/lib/types/components/description/type.d.ts +25 -0
- package/lib/types/components/drawer/drawer.d.ts +5 -0
- package/lib/types/components/drawer/index.d.ts +5 -0
- package/lib/types/components/drawer/type.d.ts +16 -0
- package/lib/types/components/dropdown/dropdown.d.ts +9 -0
- package/lib/types/components/dropdown/index.d.ts +5 -0
- package/lib/types/components/dropdown/type.d.ts +13 -0
- package/lib/types/components/editor/editor.d.ts +6 -0
- package/lib/types/components/editor/index.d.ts +5 -0
- package/lib/types/components/editor/type.d.ts +19 -0
- package/lib/types/components/flex/flex.d.ts +5 -0
- package/lib/types/components/flex/index.d.ts +5 -0
- package/lib/types/components/flex/type.d.ts +13 -0
- package/lib/types/components/form/field.d.ts +6 -0
- package/lib/types/components/form/form.d.ts +12 -0
- package/lib/types/components/form/index.d.ts +5 -0
- package/lib/types/components/form/type.d.ts +30 -0
- package/lib/types/components/form/useForm.d.ts +17 -0
- package/lib/types/components/icon/icon.d.ts +6 -0
- package/lib/types/components/icon/index.d.ts +5 -0
- package/lib/types/components/icon/type.d.ts +12 -0
- package/lib/types/components/image/image.d.ts +5 -0
- package/lib/types/components/image/index.d.ts +5 -0
- package/lib/types/components/image/list.d.ts +6 -0
- package/lib/types/components/image/type.d.ts +28 -0
- package/lib/types/components/input/index.d.ts +5 -0
- package/lib/types/components/input/input.d.ts +5 -0
- package/lib/types/components/input/number.d.ts +6 -0
- package/lib/types/components/input/range.d.ts +6 -0
- package/lib/types/components/input/textarea.d.ts +6 -0
- package/lib/types/components/input/type.d.ts +46 -0
- package/lib/types/components/list/index.d.ts +5 -0
- package/lib/types/components/list/list.d.ts +9 -0
- package/lib/types/components/list/type.d.ts +15 -0
- package/lib/types/components/loading/index.d.ts +5 -0
- package/lib/types/components/loading/loading.d.ts +6 -0
- package/lib/types/components/loading/type.d.ts +10 -0
- package/lib/types/components/message/index.d.ts +5 -0
- package/lib/types/components/message/message.d.ts +24 -0
- package/lib/types/components/message/type.d.ts +21 -0
- package/lib/types/components/modal/index.d.ts +5 -0
- package/lib/types/components/modal/modal.d.ts +5 -0
- package/lib/types/components/modal/type.d.ts +31 -0
- package/lib/types/components/modal/useModal.d.ts +9 -0
- package/lib/types/components/pagination/index.d.ts +5 -0
- package/lib/types/components/pagination/pagination.d.ts +6 -0
- package/lib/types/components/pagination/type.d.ts +18 -0
- package/lib/types/components/picker/colors/index.d.ts +6 -0
- package/lib/types/components/picker/dates/index.d.ts +6 -0
- package/lib/types/components/picker/time/index.d.ts +6 -0
- package/lib/types/components/picker/type.d.ts +41 -0
- package/lib/types/components/popconfirm/index.d.ts +5 -0
- package/lib/types/components/popconfirm/popconfirm.d.ts +6 -0
- package/lib/types/components/popconfirm/type.d.ts +14 -0
- package/lib/types/components/popup/index.d.ts +5 -0
- package/lib/types/components/popup/popup.d.ts +6 -0
- package/lib/types/components/popup/type.d.ts +29 -0
- package/lib/types/components/progress/index.d.ts +5 -0
- package/lib/types/components/progress/progress.d.ts +6 -0
- package/lib/types/components/progress/type.d.ts +23 -0
- package/lib/types/components/radio/index.d.ts +5 -0
- package/lib/types/components/radio/item.d.ts +6 -0
- package/lib/types/components/radio/radio.d.ts +10 -0
- package/lib/types/components/radio/type.d.ts +20 -0
- package/lib/types/components/resizable/index.d.ts +5 -0
- package/lib/types/components/resizable/resizable.d.ts +6 -0
- package/lib/types/components/resizable/type.d.ts +19 -0
- package/lib/types/components/select/index.d.ts +5 -0
- package/lib/types/components/select/select.d.ts +6 -0
- package/lib/types/components/select/type.d.ts +22 -0
- package/lib/types/components/step/index.d.ts +5 -0
- package/lib/types/components/step/item.d.ts +6 -0
- package/lib/types/components/step/step.d.ts +10 -0
- package/lib/types/components/step/type.d.ts +19 -0
- package/lib/types/components/swiper/index.d.ts +5 -0
- package/lib/types/components/swiper/item.d.ts +6 -0
- package/lib/types/components/swiper/swiper.d.ts +5 -0
- package/lib/types/components/swiper/type.d.ts +52 -0
- package/lib/types/components/tabs/index.d.ts +5 -0
- package/lib/types/components/tabs/item.d.ts +6 -0
- package/lib/types/components/tabs/tabs.d.ts +5 -0
- package/lib/types/components/tabs/type.d.ts +44 -0
- package/lib/types/components/tag/index.d.ts +5 -0
- package/lib/types/components/tag/tag.d.ts +6 -0
- package/lib/types/components/tag/type.d.ts +14 -0
- package/lib/types/components/text/highlight.d.ts +6 -0
- package/lib/types/components/text/index.d.ts +5 -0
- package/lib/types/components/text/number.d.ts +6 -0
- package/lib/types/components/text/text.d.ts +5 -0
- package/lib/types/components/text/time.d.ts +6 -0
- package/lib/types/components/text/type.d.ts +43 -0
- package/lib/types/components/tree/index.d.ts +5 -0
- package/lib/types/components/tree/tree.d.ts +6 -0
- package/lib/types/components/tree/type.d.ts +48 -0
- package/lib/types/components/upload/index.d.ts +5 -0
- package/lib/types/components/upload/type.d.ts +36 -0
- package/lib/types/components/upload/upload.d.ts +6 -0
- package/lib/types/components/video/index.d.ts +5 -0
- package/lib/types/components/video/type.d.ts +27 -0
- package/lib/types/components/video/video.d.ts +6 -0
- package/lib/types/index.d.ts +39 -1021
- package/lib/types/js/usePreview/index.d.ts +5 -0
- package/lib/types/js/usePreview/type.d.ts +39 -0
- package/lib/types/type/index.d.ts +28 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as o,jsx as a}from"react/jsx-runtime";import e from"classnames";import s from"../utils/helpericon/helpericon.js";const l=l=>{const{dot:i,dotClass:t,outline:n,round:r,size:c="normal",hoverShowClose:m,className:d,children:p,onClose:u,onClick:g,...h}=l;return o("span",{className:e("i-tag",{"i-tag-outline":n,"i-tag-clickable":g,[`i-tag-${c}`]:"normal"!==c,round:r},d),onClick:g,...h,children:[i&&a("span",{className:e("i-tag-dot",t)}),p,u&&a(s,{active:!0,className:e("i-tag-close",{"i-tag-hover-close":m}),onClick:u})]})};export{l as default};
|
|
2
|
+
//# sourceMappingURL=tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.js","sources":["../../../packages/components/tag/tag.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport Helpericon from \"../utils/helpericon\";\nimport \"./index.css\";\nimport { ITag } from \"./type\";\n\nconst Tag = (props: ITag) => {\n\tconst {\n\t\tdot,\n\t\tdotClass,\n\t\toutline,\n\t\tround,\n\t\tsize = \"normal\",\n\t\thoverShowClose,\n\t\tclassName,\n\t\tchildren,\n\t\tonClose,\n\t\tonClick,\n\t\t...restProps\n\t} = props;\n\n\treturn (\n\t\t<span\n\t\t\tclassName={classNames(\n\t\t\t\t\"i-tag\",\n\t\t\t\t{\n\t\t\t\t\t\"i-tag-outline\": outline,\n\t\t\t\t\t\"i-tag-clickable\": onClick,\n\t\t\t\t\t[`i-tag-${size}`]: size !== \"normal\",\n\t\t\t\t\tround,\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tonClick={onClick}\n\t\t\t{...restProps}\n\t\t>\n\t\t\t{dot && <span className={classNames(\"i-tag-dot\", dotClass)}></span>}\n\n\t\t\t{children}\n\n\t\t\t{onClose && (\n\t\t\t\t<Helpericon\n\t\t\t\t\tactive\n\t\t\t\t\tclassName={classNames(\"i-tag-close\", {\n\t\t\t\t\t\t\"i-tag-hover-close\": hoverShowClose,\n\t\t\t\t\t})}\n\t\t\t\t\tonClick={onClose}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</span>\n\t);\n};\n\nexport default Tag;\n"],"names":["Tag","props","dot","dotClass","outline","round","size","hoverShowClose","className","children","onClose","onClick","restProps","_jsxs","classNames","_jsx","Helpericon","active"],"mappings":"6HAKA,MAAMA,EAAOC,IACZ,MAAMC,IACLA,EAAGC,SACHA,EAAQC,QACRA,EAAOC,MACPA,EAAKC,KACLA,EAAO,SAAQC,eACfA,EAAcC,UACdA,EAASC,SACTA,EAAQC,QACRA,EAAOC,QACPA,KACGC,GACAX,EAEJ,OACCY,EACC,OAAA,CAAAL,UAAWM,EACV,QACA,CACC,gBAAiBV,EACjB,kBAAmBO,EACnB,CAAC,SAASL,KAAkB,WAATA,EACnBD,SAEDG,GAEDG,QAASA,KACLC,EAEHH,SAAA,CAAAP,GAAOa,EAAM,OAAA,CAAAP,UAAWM,EAAW,YAAaX,KAEhDM,EAEAC,GACAK,EAACC,EAAU,CACVC,QACA,EAAAT,UAAWM,EAAW,cAAe,CACpC,oBAAqBP,IAEtBI,QAASD,MAGL"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{findAll as t}from"highlight-words-core";import{useMemo as e,Fragment as i}from"react";import o from"./text.js";function s(s){const{keyword:n,text:c,escape:a,caseSensitive:h,renderWord:m=t=>r("mark",{children:t}),...d}=s,p=e((()=>{const e=c;return t({searchWords:"string"==typeof n?[n]:n,textToHighlight:c,caseSensitive:h,autoEscape:a}).map(((t,o)=>{const{end:s,highlight:n,start:c}=t,a=e.slice(c,s);return n?r(i,{children:m(a)},o):a}))}),[n,c,a,h]);return r(o,{...d,children:p})}export{s as default};
|
|
2
|
+
//# sourceMappingURL=highlight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlight.js","sources":["../../../packages/components/text/highlight.tsx"],"sourcesContent":["import { findAll } from \"highlight-words-core\";\nimport { Fragment, useMemo } from \"react\";\nimport Text from \"./text\";\nimport { ITextHighLight } from \"./type\";\n\nexport default function HighLight(props: ITextHighLight) {\n\tconst {\n\t\tkeyword,\n\t\ttext,\n\t\tescape,\n\t\tcaseSensitive,\n\t\trenderWord = (word) => <mark>{word}</mark>,\n\t\t...restProps\n\t} = props;\n\n\tconst content = useMemo(() => {\n\t\tconst source = text;\n\t\tconst searchWords = typeof keyword === \"string\" ? [keyword] : keyword;\n\n\t\tconst chunks = findAll({\n\t\t\tsearchWords,\n\t\t\ttextToHighlight: text,\n\t\t\tcaseSensitive,\n\t\t\tautoEscape: escape,\n\t\t});\n\n\t\tconst result = chunks.map((chunk, i) => {\n\t\t\tconst { end, highlight, start } = chunk;\n\t\t\tconst word = source.slice(start, end);\n\n\t\t\treturn highlight ? (\n\t\t\t\t<Fragment key={i}>{renderWord(word)}</Fragment>\n\t\t\t) : (\n\t\t\t\tword\n\t\t\t);\n\t\t});\n\n\t\treturn result;\n\t}, [keyword, text, escape, caseSensitive]);\n\n\treturn <Text {...restProps}>{content}</Text>;\n}\n"],"names":["HighLight","props","keyword","text","escape","caseSensitive","renderWord","word","_jsx","children","restProps","content","useMemo","source","findAll","searchWords","textToHighlight","autoEscape","map","chunk","i","end","highlight","start","slice","Fragment","Text"],"mappings":"8JAKwB,SAAAA,EAAUC,GACjC,MAAMC,QACLA,EAAOC,KACPA,EAAIC,OACJA,EAAMC,cACNA,EAAaC,WACbA,EAAcC,GAASC,EAAA,OAAA,CAAAC,SAAOF,OAC3BG,GACAT,EAEEU,EAAUC,GAAQ,KACvB,MAAMC,EAASV,EAqBf,OAlBeW,EAAQ,CACtBC,YAHsC,iBAAZb,EAAuB,CAACA,GAAWA,EAI7Dc,gBAAiBb,EACjBE,gBACAY,WAAYb,IAGSc,KAAI,CAACC,EAAOC,KACjC,MAAMC,IAAEA,EAAGC,UAAEA,EAASC,MAAEA,GAAUJ,EAC5BZ,EAAOM,EAAOW,MAAMD,EAAOF,GAEjC,OAAOC,EACNd,EAACiB,EAAkB,CAAAhB,SAAAH,EAAWC,IAAfa,GAAgC,CAG/C,GAGW,GACX,CAAClB,EAASC,EAAMC,EAAQC,IAE3B,OAAOG,EAACkB,EAAI,IAAKhB,EAAYD,SAAAE,GAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../packages/components/text/index.tsx"],"sourcesContent":["import HighLight from \"./highlight\";\nimport Number from \"./number\";\nimport Text from \"./text\";\nimport Time from \"./time\";\n\nText.Number = Number;\nText.Time = Time;\nText.HighLight = HighLight;\n\nexport default Text;\n"],"names":["Text","Number","Time","HighLight"],"mappings":"2GAKAA,EAAKC,OAASA,EACdD,EAAKE,KAAOA,EACZF,EAAKG,UAAYA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{formatNumber as o,animate as r}from"../../js/utils.js";import{useState as i,useMemo as n,useEffect as e}from"react";import s from"./text.js";function u(u){const{count:d,to:m,decimal:a,thousand:c=",",duration:f=2400,easing:p,...j}=u,[l,x]=i(d),h=n((()=>{if(void 0===l)return;const t=l.toFixed(a);return c?o(l,{precision:a,thousand:c}):t}),[l,c]);return e((()=>{void 0!==d&&void 0!==m&&r(d,m,f,(t=>x(d+t)),p)}),[m]),e((()=>x(d)),[d]),t(s,{...j,children:h})}export{u as default};
|
|
2
|
+
//# sourceMappingURL=number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.js","sources":["../../../packages/components/text/number.tsx"],"sourcesContent":["import { animate, formatNumber } from \"@p/js/utils\";\nimport { useEffect, useMemo, useState } from \"react\";\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":["Number","props","count","to","decimal","thousand","duration","easing","restProps","n","setN","useState","number","useMemo","undefined","z","toFixed","formatNumber","precision","useEffect","animate","v","_jsx","Text","children"],"mappings":"4LAKwB,SAAAA,EAAOC,GAC9B,MAAMC,MACLA,EAAKC,GACLA,EAAEC,QACFA,EAAOC,SACPA,EAAW,IAAGC,SACdA,EAAW,KAAIC,OACfA,KACGC,GACAP,GACGQ,EAAGC,GAAQC,EAAST,GAErBU,EAASC,GAAQ,KACtB,QAAUC,IAANL,EAAiB,OAErB,MAAMM,EAAIN,EAAEO,QAAQZ,GAEpB,OAAKC,EAEEY,EAAaR,EAAG,CAAES,UAAWd,EAASC,aAFvBU,CAEkC,GACtD,CAACN,EAAGJ,IAUP,OARAc,GAAU,UACKL,IAAVZ,QAA8BY,IAAPX,GAE3BiB,EAAQlB,EAAOC,EAAIG,GAAWe,GAAMX,EAAKR,EAAQmB,IAAId,EAAO,GAC1D,CAACJ,IAEJgB,GAAU,IAAMT,EAAKR,IAAQ,CAACA,IAEvBoB,EAACC,EAAI,IAAKf,EAAYgB,SAAAZ,GAC9B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import t from"classnames";import{useMemo as r}from"react";const a=a=>{const{as:i="span",size:n,weight:o,decoration:s,gradient:c,wave:m,style:d,className:l,children:g}=a,f=r((()=>c&&Array.isArray(c)?{backgroundImage:`-webkit-linear-gradient(${c.join(",")})`,backgroundClip:"text"}:{}),[c]);return e(i,{style:{fontSize:n,fontWeight:o,textDecoration:s,...f,...d},className:t(l,{"i-text-gradient":c,"i-text-gradient-wave":m}),children:g})};export{a as default};
|
|
2
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sources":["../../../packages/components/text/text.tsx"],"sourcesContent":["import classNames from \"classnames\";\nimport { useMemo } from \"react\";\nimport \"./index.css\";\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\nexport default Text as CompositionText;\n"],"names":["Text","props","as","Tag","size","weight","decoration","gradient","wave","style","className","children","gradients","useMemo","Array","isArray","backgroundImage","join","backgroundClip","_jsx","fontSize","fontWeight","textDecoration","classNames"],"mappings":"kGAKA,MAAMA,EAAQC,IACb,MACCC,GAAIC,EAAM,OAAMC,KAChBA,EAAIC,OACJA,EAAMC,WACNA,EAAUC,SACVA,EAAQC,KACRA,EAAIC,MACJA,EAAKC,UACLA,EAASC,SACTA,GACGV,EAEEW,EAAYC,GAAQ,IACpBN,GAAaO,MAAMC,QAAQR,GAEzB,CACNS,gBAAiB,2BAA2BT,EAASU,KAAK,QAC1DC,eAAgB,QAJiC,CAAE,GAMlD,CAACX,IAEJ,OACCY,EAAChB,EAAG,CACHM,MAAO,CACNW,SAAUhB,EACViB,WAAYhB,EACZiB,eAAgBhB,KACbM,KACAH,GAEJC,UAAWa,EAAWb,EAAW,CAChC,kBAAmBH,EACnB,uBAAwBC,IAGxBG,SAAAA,GACI"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{formatTime as t}from"../../js/utils.js";import{useMemo as o}from"react";import e from"./text.js";function i(i){const{seconds:s,zero:m,units:n,...u}=i,c=o((()=>void 0===s?"":t(s,{zero:m,units:n})),[s]);return r(e,{...u,children:c})}export{i as default};
|
|
2
|
+
//# sourceMappingURL=time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.js","sources":["../../../packages/components/text/time.tsx"],"sourcesContent":["import { formatTime } from \"@p/js/utils\";\nimport { useMemo } from \"react\";\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":["Number","props","seconds","zero","units","restProps","text","useMemo","undefined","formatTime","_jsx","Text","children"],"mappings":"gJAKwB,SAAAA,EAAOC,GAC9B,MAAMC,QAAEA,EAAOC,KAAEA,EAAIC,MAAEA,KAAUC,GAAcJ,EAEzCK,EAAOC,GAAQ,SACJC,IAAZN,EAA8B,GAE3BO,EAAWP,EAAS,CAC1BC,OACAC,WAEC,CAACF,IAEJ,OAAOQ,EAACC,EAAI,IAAKN,EAAYO,SAAAN,GAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import{KeyboardArrowDownRound as i}from"@ricons/material";import n from"classnames";import{useState as c}from"react";import o from"../checkbox/checkbox.js";import a from"../icon/icon.js";function s(r){const{data:i=[],depth:c=0,round:o,style:a,className:s,parent:l,nodeProps:m,...p}=r,h=i.map(((t,r)=>{const{type:i}=t,n=t[m.title],o=t[m.key]||(void 0!==l?.key?`${l.key}-${r}`:`${r}`);return t.key=o,t.parent=l,"title"===i?e("div",{className:"i-tree-group-title",children:n},r):i&&"item"!==i?e("div",{className:`i-tree-type-${i}`,children:n},r):e(d,{index:r,item:t,depth:c,nodeProps:m,...p},o)}));return c>0?e(t,{children:h}):e("div",{className:n("i-tree",s,{"i-tree-round":o}),style:a,children:h})}const l=t=>{const{as:r="a",href:i,selected:c,children:o,...a}=t,s=n("i-tree-item-header",{"i-tree-item-selected":c});return e(r,"string"==typeof r?{href:i,className:s,...a,children:o}:{to:i||"",className:s,...a,children:o})},d=t=>{const{item:d,depth:m=0,index:p,selected:h,checked:f=[],partofs:k={},checkable:u,nodeProps:N,renderExtra:g,onItemClick:x,onItemSelect:y,onItemCheck:v,...C}=t,{as:I,key:P="",href:b,icon:$,title:j,expanded:D,disabled:E}=d,S=d[N.children],[L,q]=c(D),w=(e,t)=>{t&&(e.preventDefault(),e.stopPropagation()),!E&&S?.length&&q((e=>!e))},z=f.includes(P);return r("div",{className:n("i-tree-item",{"i-tree-expand":L}),children:[r(l,{as:I,href:b,style:{paddingLeft:1.5*m+.5+"em"},selected:h===P,onClick:e=>{if(E)return e.preventDefault(),void e.stopPropagation();w(e),x?.(d,e),y?.(P,d)},children:[u&&e(o.Item,{value:z,partof:!z&&k[P],className:"i-tree-checkbox",onChange:e=>v?.(d,e,[]),onClick:e=>e.stopPropagation()}),$&&e("span",{className:"i-tree-item-icon",children:$}),e("span",{className:"i-tree-item-title",children:j}),g?.(d),S&&e(a,{icon:e(i,{}),className:"i-tree-toggle",onClick:e=>w(e,!0)})]}),S?.length&&e("div",{className:"i-tree-item-content",children:e(s,{data:S,depth:m+1,selected:h,checkable:u,parent:d,partofs:k,checked:f,nodeProps:N,renderExtra:g,onItemClick:x,onItemSelect:y,onItemCheck:v,...C})})]})};export{d as TreeItem,s as TreeList};
|
|
2
|
+
//# sourceMappingURL=item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.js","sources":["../../../packages/components/tree/item.tsx"],"sourcesContent":["import { KeyboardArrowDownRound } from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport { MouseEvent, useState } from \"react\";\nimport Checkbox from \"../checkbox\";\nimport Icon from \"../icon\";\nimport { ITree, ITreeHeader, PropsTreeItem } from \"./type\";\n\ninterface ITreeList extends Omit<ITree, \"nodeProps\"> {\n\tnodeProps: {\n\t\tkey: string;\n\t\ttitle: string;\n\t\tchildren: string;\n\t};\n}\n\nexport function TreeList(props: ITreeList) {\n\tconst {\n\t\tdata = [],\n\t\tdepth = 0,\n\t\tround,\n\t\tstyle,\n\t\tclassName,\n\t\tparent,\n\t\tnodeProps,\n\t\t...restProps\n\t} = props;\n\n\tconst contents = data.map((item, i) => {\n\t\tconst { type } = item;\n\t\tconst title = item[nodeProps.title];\n\t\tconst itemKey =\n\t\t\titem[nodeProps.key] ||\n\t\t\t(parent?.key !== undefined ? `${parent.key}-${i}` : `${i}`);\n\n\t\titem.key = itemKey;\n\t\titem.parent = parent;\n\n\t\tif (type === \"title\") {\n\t\t\treturn (\n\t\t\t\t<div key={i} className='i-tree-group-title'>\n\t\t\t\t\t{title}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\tif (type && type !== \"item\") {\n\t\t\treturn (\n\t\t\t\t<div key={i} className={`i-tree-type-${type}`}>\n\t\t\t\t\t{title}\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<TreeItem\n\t\t\t\tkey={itemKey}\n\t\t\t\tindex={i}\n\t\t\t\titem={item}\n\t\t\t\tdepth={depth}\n\t\t\t\tnodeProps={nodeProps}\n\t\t\t\t{...restProps}\n\t\t\t/>\n\t\t);\n\t});\n\n\tif (depth > 0) return <>{contents}</>;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\"i-tree\", className, {\n\t\t\t\t\"i-tree-round\": round,\n\t\t\t})}\n\t\t\tstyle={style}\n\t\t>\n\t\t\t{contents}\n\t\t</div>\n\t);\n}\n\nconst Header = (props: ITreeHeader) => {\n\tconst { as: Tag = \"a\", href, selected, children, ...restProps } = props;\n\n\tconst className = classNames(\"i-tree-item-header\", {\n\t\t\"i-tree-item-selected\": selected,\n\t});\n\n\tif (typeof Tag === \"string\") {\n\t\treturn (\n\t\t\t<Tag href={href} className={className} {...restProps}>\n\t\t\t\t{children}\n\t\t\t</Tag>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Tag to={href || \"\"} className={className} {...restProps}>\n\t\t\t{children}\n\t\t</Tag>\n\t);\n};\n\nexport const TreeItem = (props: PropsTreeItem) => {\n\tconst {\n\t\titem,\n\t\tdepth = 0,\n\t\tindex,\n\t\tselected,\n\t\tchecked = [],\n\t\tpartofs = {},\n\t\tcheckable,\n\t\tnodeProps,\n\t\trenderExtra,\n\t\tonItemClick,\n\t\tonItemSelect,\n\t\tonItemCheck,\n\t\t...restProps\n\t} = props;\n\n\tconst { as, key = \"\", href, icon, title, expanded, disabled } = item;\n\tconst children = item[nodeProps.children];\n\n\tconst [expand, setExpand] = useState(expanded);\n\n\tconst handleExpand = (e: MouseEvent<HTMLElement>, fromToggle?: boolean) => {\n\t\tif (fromToggle) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t}\n\n\t\tif (disabled || !children?.length) return;\n\n\t\tsetExpand((v) => !v);\n\t};\n\n\tconst handleItemClick = (e: MouseEvent<HTMLElement>) => {\n\t\tif (disabled) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\treturn;\n\t\t}\n\n\t\thandleExpand(e);\n\t\tonItemClick?.(item, e);\n\t\tonItemSelect?.(key, item);\n\t};\n\n\tconst handleItemCheck = (checked) => onItemCheck?.(item, checked, []);\n\tconst itemChecked = checked.includes(key);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\"i-tree-item\", {\n\t\t\t\t\"i-tree-expand\": expand,\n\t\t\t})}\n\t\t>\n\t\t\t<Header\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={handleItemClick}\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={itemChecked}\n\t\t\t\t\t\tpartof={!itemChecked && partofs[key]}\n\t\t\t\t\t\tclassName='i-tree-checkbox'\n\t\t\t\t\t\tonChange={handleItemCheck}\n\t\t\t\t\t\tonClick={(e) => 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?.(item)}\n\n\t\t\t\t{children && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={<KeyboardArrowDownRound />}\n\t\t\t\t\t\tclassName='i-tree-toggle'\n\t\t\t\t\t\tonClick={(e) => handleExpand(e, true)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Header>\n\n\t\t\t{children?.length && (\n\t\t\t\t<div className='i-tree-item-content'>\n\t\t\t\t\t<TreeList\n\t\t\t\t\t\tdata={children}\n\t\t\t\t\t\tdepth={depth + 1}\n\t\t\t\t\t\tselected={selected}\n\t\t\t\t\t\tcheckable={checkable}\n\t\t\t\t\t\tparent={item}\n\t\t\t\t\t\tpartofs={partofs}\n\t\t\t\t\t\tchecked={checked}\n\t\t\t\t\t\tnodeProps={nodeProps}\n\t\t\t\t\t\trenderExtra={renderExtra}\n\t\t\t\t\t\tonItemClick={onItemClick}\n\t\t\t\t\t\tonItemSelect={onItemSelect}\n\t\t\t\t\t\tonItemCheck={onItemCheck}\n\t\t\t\t\t\t{...restProps}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"],"names":["TreeList","props","data","depth","round","style","className","parent","nodeProps","restProps","contents","map","item","i","type","title","itemKey","key","undefined","_jsx","children","TreeItem","index","_Fragment","classNames","Header","as","Tag","href","selected","to","checked","partofs","checkable","renderExtra","onItemClick","onItemSelect","onItemCheck","icon","expanded","disabled","expand","setExpand","useState","handleExpand","e","fromToggle","preventDefault","stopPropagation","length","v","itemChecked","includes","_jsxs","paddingLeft","onClick","Checkbox","Item","value","partof","onChange","Icon","KeyboardArrowDownRound"],"mappings":"2PAeM,SAAUA,EAASC,GACxB,MAAMC,KACLA,EAAO,GAAEC,MACTA,EAAQ,EAACC,MACTA,EAAKC,MACLA,EAAKC,UACLA,EAASC,OACTA,EAAMC,UACNA,KACGC,GACAR,EAEES,EAAWR,EAAKS,KAAI,CAACC,EAAMC,KAChC,MAAMC,KAAEA,GAASF,EACXG,EAAQH,EAAKJ,EAAUO,OACvBC,EACLJ,EAAKJ,EAAUS,YACEC,IAAhBX,GAAQU,IAAoB,GAAGV,EAAOU,OAAOJ,IAAM,GAAGA,KAKxD,OAHAD,EAAKK,IAAMD,EACXJ,EAAKL,OAASA,EAED,UAATO,EAEFK,EAAa,MAAA,CAAAb,UAAU,qBACrBc,SAAAL,GADQF,GAMRC,GAAiB,SAATA,EAEVK,EAAA,MAAA,CAAab,UAAW,eAAeQ,IAAMM,SAC3CL,GADQF,GAOXM,EAACE,EAEA,CAAAC,MAAOT,EACPD,KAAMA,EACNT,MAAOA,EACPK,UAAWA,KACPC,GALCO,EAMJ,IAIJ,OAAIb,EAAQ,EAAUgB,EAAAI,EAAA,CAAAH,SAAGV,IAGxBS,SACCb,UAAWkB,E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T,IAAenB,EAAKL,EAAK,EAmBtBQ,SAAA,CAAAa,GACAd,EAACqC,EAASC,MACTC,MAAOP,EACPQ,QAASR,GAAenB,EAAQf,GAChCX,UAAU,kBACVsD,SArBoB7B,GAAYM,IAAczB,EAAMmB,EAAS,IAsB7DwB,QAAUV,GAAMA,EAAEG,oBAInBV,GAAQnB,UAAMb,UAAU,mBAAkBc,SAAEkB,IAE7CnB,EAAM,OAAA,CAAAb,UAAU,oBAAqBc,SAAAL,IAEpCmB,IAActB,GAEdQ,GACAD,EAAC0C,GACAvB,KAAMnB,EAAC2C,EAAyB,CAAA,GAChCxD,UAAU,gBACViD,QAAUV,GAAMD,EAAaC,GAAG,QAKlCzB,GAAU6B,QACV9B,SAAKb,UAAU,sBACdc,SAAAD,EAACnB,EACA,CAAAE,KAAMkB,EACNjB,MAAOA,EAAQ,EACf0B,SAAUA,EACVI,UAAWA,EACX1B,OAAQK,EACRoB,QAASA,EACTD,QAASA,EACTvB,UAAWA,EACX0B,YAAaA,EACbC,YAAaA,EACbC,aAAcA,EACdC,YAAaA,KACT5B,QAIF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useReactive as t}from"ahooks";import{useEffect as c,useImperativeHandle as s}from"react";import{TreeList as n}from"./item.js";const o={key:"key",title:"title",children:"children"},r=r=>{const{data:a=[],ref:d,selected:l,checked:i=[],disabledRelated:k,nodeProps:p,onItemSelect:f,onItemCheck:h,...m}=r,g=t({selected:l,checked:i,partofs:{},nodeMaps:new Map}),y=Object.assign({},o,p),u=e=>g.checked.includes(e||""),b=(e,t,c)=>{const{key:s="",parent:n,children:o}=e,r={[s]:t},a={[s]:!1};if(k)return[r];if(t){if(n&&"leaf"!==c){const e=n.children?.some((e=>e.key!==s&&!u(e.key))),[t,c]=b(n,!0,"root");e||Object.assign(r,t),Object.assign(a,e?c:{},{[n.key]:!0})}return o?.length&&"root"!==c&&o.map((e=>{if(u(e.key))return;const[t]=b(e,!0,"leaf");Object.assign(r,t),a[e.key]=!1})),[r,a]}if(n&&"leaf"!==c){const[e,t]=b(n,!1,"root");Object.assign(r,e);const c=n.children?.some((e=>u(e.key)&&e.key!==s));Object.assign(a,c?{}:t,{[n.key]:c,[s]:!1})}return o?.length&&"root"!==c&&o.map((e=>{const[t]=b(e,!1,"leaf");u(e.key)&&(Object.assign(r,t),a[e.key]=!1)})),[r,a]};return c((()=>{void 0!==l&&(g.selected=l)}),[l]),c((()=>{g.nodeMaps.clear();const{key:e,children:t}=y,c=s=>{s.map((s=>{g.nodeMaps.set(s[e],s),s[t]?.length>0&&c(s[t])}))};c(a)}),[a]),s(d,(()=>({getChecked:()=>{const e=[];return g.checked.map((t=>{const c=g.nodeMaps.get(t);e.push(c)})),[g.checked,e]},getSelected:()=>{const e=g.nodeMaps.get(g.selected);return[g.selected,e]},getPartofs:()=>{const e=[];return[Object.keys(g.partofs).filter((t=>{const c=g.partofs[t];if(c){const c=g.nodeMaps.get(t);e.push(c)}return c})),e]}}))),e(n,{data:a,selected:g.selected,checked:g.checked,partofs:g.partofs,nodeProps:y,onItemCheck:(e,t)=>{const[c,s]=b(e,t),n=Object.keys(c);g.checked=t?Array.from(new Set([...g.checked,...n])):g.checked.filter((e=>!n.includes(e))),Object.assign(g.partofs,s),h?.(e,t,g.checked)},onItemSelect:(e,t)=>{r.selectable&&(g.selected=e,f?.(e,t))},...m})};export{r as default};
|
|
2
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.js","sources":["../../../packages/components/tree/tree.tsx"],"sourcesContent":["import { useReactive } from \"ahooks\";\nimport { useEffect, useImperativeHandle } from \"react\";\nimport \"./index.css\";\nimport { TreeList } from \"./item\";\nimport { ITree, ITreeItem } from \"./type\";\n\nconst defaultNodeProps = {\n\tkey: \"key\",\n\ttitle: \"title\",\n\tchildren: \"children\",\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\tonItemSelect,\n\t\tonItemCheck,\n\t\t...restProps\n\t} = props;\n\tconst state = useReactive({\n\t\tselected,\n\t\tchecked,\n\t\tpartofs: {} as Record<string, boolean>,\n\t\tnodeMaps: new Map(),\n\t});\n\tconst oNodeProps = Object.assign({}, defaultNodeProps, nodeProps);\n\n\tconst isChecked = (key?: string) => state.checked.includes(key || \"\");\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 = parent.children?.some(\n\t\t\t\t\t(o) => o.key !== key && !isChecked(o.key)\n\t\t\t\t);\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 (children?.length && direction !== \"root\") {\n\t\t\t\tchildren.map((o) => {\n\t\t\t\t\tif (isChecked(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 = parent.children?.some(\n\t\t\t\t(o) => isChecked(o.key) && o.key !== key\n\t\t\t);\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 (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 (!isChecked(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\tstate.checked = checked\n\t\t\t? Array.from(new Set([...state.checked, ...changedKeys]))\n\t\t\t: state.checked.filter((k) => !changedKeys.includes(k));\n\n\t\tObject.assign(state.partofs, partofs);\n\n\t\tonItemCheck?.(item, checked, state.checked);\n\t};\n\n\tconst handleSelect = (key: string, item: ITreeItem) => {\n\t\tif (!props.selectable) return;\n\n\t\tstate.selected = key;\n\t\tonItemSelect?.(key, item);\n\t};\n\n\tuseEffect(() => {\n\t\tif (selected === undefined) return;\n\n\t\tstate.selected = selected;\n\t}, [selected]);\n\n\tuseEffect(() => {\n\t\tstate.nodeMaps.clear();\n\n\t\tconst { key, children } = oNodeProps;\n\t\tconst recursive = (nodes) => {\n\t\t\tnodes.map((o) => {\n\t\t\t\tstate.nodeMaps.set(o[key], o);\n\n\t\t\t\to[children]?.length > 0 && recursive(o[children]);\n\t\t\t});\n\t\t};\n\n\t\trecursive(data);\n\t}, [data]);\n\n\tuseImperativeHandle(ref, () => {\n\t\treturn {\n\t\t\tgetChecked: () => {\n\t\t\t\tconst items: ITreeItem[] = [];\n\t\t\t\tstate.checked.map((k) => {\n\t\t\t\t\tconst item = state.nodeMaps.get(k);\n\t\t\t\t\titems.push(item);\n\t\t\t\t});\n\t\t\t\treturn [state.checked, items];\n\t\t\t},\n\t\t\tgetSelected: () => {\n\t\t\t\tconst item = state.nodeMaps.get(state.selected);\n\t\t\t\treturn [state.selected, item];\n\t\t\t},\n\t\t\tgetPartofs: () => {\n\t\t\t\tconst items: ITreeItem[] = [];\n\t\t\t\tconst keys = Object.keys(state.partofs).filter((k) => {\n\t\t\t\t\tconst indeterminate = state.partofs[k];\n\n\t\t\t\t\tif (indeterminate) {\n\t\t\t\t\t\tconst item = state.nodeMaps.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\treturn (\n\t\t<TreeList\n\t\t\tdata={data}\n\t\t\tselected={state.selected}\n\t\t\tchecked={state.checked}\n\t\t\tpartofs={state.partofs}\n\t\t\tnodeProps={oNodeProps}\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":["defaultNodeProps","key","title","children","Tree","props","data","ref","selected","checked","disabledRelated","nodeProps","onItemSelect","onItemCheck","restProps","state","useReactive","partofs","nodeMaps","Map","oNodeProps","Object","assign","isChecked","includes","checkItem","item","direction","parent","shouldChanged","hasUnchecked","some","o","changes","parts","length","map","hasChecked","useEffect","undefined","clear","recursive","nodes","set","useImperativeHandle","getChecked","items","k","get","push","getSelected","getPartofs","keys","filter","indeterminate","_jsx","TreeList","changedKeys","Array","from","Set","selectable"],"mappings":"6KAMA,MAAMA,EAAmB,CACxBC,IAAK,MACLC,MAAO,QACPC,SAAU,YAGLC,EAAQC,IACb,MAAMC,KACLA,EAAO,GAAEC,IACTA,EAAGC,SACHA,EAAQC,QACRA,EAAU,GAAEC,gBACZA,EAAeC,UACfA,EAASC,aACTA,EAAYC,YACZA,KACGC,GACAT,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N,UAAWS,EACXP,YAhFkB,CAACa,EAAiBjB,KACrC,MAAOoB,EAAeZ,GAAWQ,EAAUC,EAAMjB,GAC3CgD,EAAcpC,OAAO+B,KAAKvB,GAEhCd,EAAMN,QAAUA,EACbiD,MAAMC,KAAK,IAAIC,IAAI,IAAI7C,EAAMN,WAAYgD,KACzC1C,EAAMN,QAAQ4C,QAAQN,IAAOU,EAAYjC,SAASuB,KAErD1B,OAAOC,OAAOP,EAAME,QAASA,GAE7BJ,IAAca,EAAMjB,EAASM,EAAMN,QAAQ,EAuE1CG,aApEmB,CAACX,EAAayB,KAC7BrB,EAAMwD,aAEX9C,EAAMP,SAAWP,EACjBW,IAAeX,EAAKyB,GAAK,KAiEpBZ,GACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as r,Fragment as i}from"react/jsx-runtime";import{TFileType as o}from"../../js/usePreview/type.js";import{getFileType as t,formatBytes as a}from"../../js/utils.js";import{ListAltRound as s}from"@ricons/material";import{title as n}from"radash";import l from"react-easy-sort";import m from"../icon/icon.js";import"../image/index.js";import c from"../utils/helpericon/helpericon.js";import d from"../image/image.js";const p=r=>{const{sortable:i,onSortEnd:o,itemProps:t,...a}=r,s={className:"i-upload-list",onClick:e=>{e.stopPropagation(),e.preventDefault()}};return i?e(l,{draggedItemClassName:"i-upload-item-dragged",onSortEnd:o,...s,...a}):e("div",{...s,...a})},f=l=>{const{ref:p,mode:f,index:u,file:v,renderItem:h,onRemove:g,onPreview:j}=l;if(!v)return"";const{id:N,name:k,size:C,url:D,src:P}=v,w=t(k,v.type);if(h)return h(v,u);const x=e(c,{active:!0,className:"i-upload-delete",onClick:e=>{e.stopPropagation(),e.preventDefault(),g(u)}});if("card"===f){let t=e(i,{});switch(w){case o.IMAGE:t=e(d,{lazyload:!0,src:D||P,fit:"cover",onMouseDown:e=>e.preventDefault()});break;case o.VIDEO:t=e("video",{src:D||P,preload:"none"});break;default:t=r(i,{children:[e(m,{icon:e(s,{})}),e("span",{className:"i-upload-file-name",children:n(k)})]})}return r("div",{ref:p,title:k,className:"i-upload-item-card",onClick:()=>j?.(u),children:[t,x]})}return r("div",{ref:p,className:"i-upload-item",onClick:()=>j?.(u),children:[e("span",{children:k}),e("i",{className:"i-upload-size",children:a(C??0)}),x]},N)};export{p as ListContainer,f as default};
|
|
2
|
+
//# sourceMappingURL=renderFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderFile.js","sources":["../../../packages/components/upload/renderFile.tsx"],"sourcesContent":["import { TFileType } from \"@p/js/usePreview/type\";\nimport { formatBytes, getFileType } from \"@p/js/utils\";\nimport { ListAltRound } from \"@ricons/material\";\nimport { title } from \"radash\";\nimport { RefObject } from \"react\";\nimport SortableContainer from \"react-easy-sort\";\nimport Icon from \"../icon\";\nimport Image from \"../image\";\nimport Helpericon from \"../utils/helpericon\";\nimport { IUploadItem } from \"./type\";\n\nexport const ListContainer = (props) => {\n\tconst { sortable, onSortEnd, itemProps, ...restProps } = props;\n\tconst customProps = {\n\t\tclassName: \"i-upload-list\",\n\t\tonClick: (e) => {\n\t\t\te.stopPropagation();\n\t\t\te.preventDefault();\n\t\t},\n\t};\n\n\tif (!sortable) {\n\t\treturn <div {...customProps} {...restProps} />;\n\t}\n\treturn (\n\t\t<SortableContainer\n\t\t\tdraggedItemClassName='i-upload-item-dragged'\n\t\t\tonSortEnd={onSortEnd}\n\t\t\t{...customProps}\n\t\t\t{...restProps}\n\t\t/>\n\t);\n};\n\nconst FileListItem = (\n\tprops: IUploadItem & { ref?: RefObject<HTMLDivElement | null> }\n) => {\n\tconst { ref, mode, index, file, renderItem, onRemove, onPreview } = props;\n\n\tif (!file) return \"\";\n\n\tconst { id, name, size, url, src } = file;\n\tconst type = getFileType(name, file.type);\n\n\tif (renderItem) {\n\t\treturn renderItem(file, index);\n\t}\n\n\tconst CloseBtn = (\n\t\t<Helpericon\n\t\t\tactive\n\t\t\tclassName='i-upload-delete'\n\t\t\tonClick={(e) => {\n\t\t\t\te.stopPropagation();\n\t\t\t\te.preventDefault();\n\t\t\t\tonRemove(index);\n\t\t\t}}\n\t\t/>\n\t);\n\n\tswitch (mode) {\n\t\tcase \"card\":\n\t\t\tlet node = <></>;\n\n\t\t\tswitch (type) {\n\t\t\t\tcase TFileType.IMAGE:\n\t\t\t\t\tnode = (\n\t\t\t\t\t\t<Image\n\t\t\t\t\t\t\tlazyload\n\t\t\t\t\t\t\tsrc={url || src}\n\t\t\t\t\t\t\tfit='cover'\n\t\t\t\t\t\t\tonMouseDown={(e) => e.preventDefault()}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase TFileType.VIDEO:\n\t\t\t\t\tnode = <video src={url || src} preload='none' />;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tnode = (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<Icon icon={<ListAltRound />} />\n\t\t\t\t\t\t\t<span className='i-upload-file-name'>\n\t\t\t\t\t\t\t\t{title(name)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</>\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tref={ref}\n\t\t\t\t\ttitle={name}\n\t\t\t\t\tclassName='i-upload-item-card'\n\t\t\t\t\tonClick={() => onPreview?.(index)}\n\t\t\t\t>\n\t\t\t\t\t{node}\n\t\t\t\t\t{CloseBtn}\n\t\t\t\t</div>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tref={ref}\n\t\t\t\t\tkey={id}\n\t\t\t\t\tclassName='i-upload-item'\n\t\t\t\t\tonClick={() => onPreview?.(index)}\n\t\t\t\t>\n\t\t\t\t\t<span>{name}</span>\n\n\t\t\t\t\t<i className='i-upload-size'>{formatBytes(size ?? 0)}</i>\n\n\t\t\t\t\t{CloseBtn}\n\t\t\t\t</div>\n\t\t\t);\n\t}\n};\n\nexport default FileListItem;\n"],"names":["ListContainer","props","sortable","onSortEnd","itemProps","restProps","customProps","className","onClick","e","stopPropagation","preventDefault","_jsx","SortableContainer","draggedItemClassName","FileListItem","ref","mode","index","file","renderItem","onRemove","onPreview","id","name","size","url","src","type","getFileType","CloseBtn","Helpericon","active","node","_Fragment","TFileType","IMAGE","Image","lazyload","fit","onMouseDown","VIDEO","preload","_jsxs","children","Icon","icon","ListAltRound","title","formatBytes"],"mappings":"kbAWa,MAAAA,EAAiBC,IAC7B,MAAMC,SAAEA,EAAQC,UAAEA,EAASC,UAAEA,KAAcC,GAAcJ,EACnDK,EAAc,CACnBC,UAAW,gBACXC,QAAUC,IACTA,EAAEC,kBACFD,EAAEE,gBAAgB,GAIpB,OAAKT,EAIJU,EAACC,EACA,CAAAC,qBAAqB,wBACrBX,UAAWA,KACPG,KACAD,IAPEO,EAAS,MAAA,IAAAN,KAAiBD,GAQ/B,EAIEU,EACLd,IAEA,MAAMe,IAAEA,EAAGC,KAAEA,EAAIC,MAAEA,EAAKC,KAAEA,EAAIC,WAAEA,EAAUC,SAAEA,EAAQC,UAAEA,GAAcrB,EAEpE,IAAKkB,EAAM,MAAO,GAElB,MAAMI,GAAEA,EAAEC,KAAEA,EAAIC,KAAEA,EAAIC,IAAEA,EAAGC,IAAEA,GAAQR,EAC/BS,EAAOC,EAAYL,EAAML,EAAKS,MAEpC,GAAIR,EACH,OAAOA,EAAWD,EAAMD,GAGzB,MAAMY,EACLlB,EAACmB,GACAC,QAAM,EACNzB,UAAU,kBACVC,QAAUC,IACTA,EAAEC,kBACFD,EAAEE,iBACFU,EAASH,EAAM,IAKlB,GACM,SADED,EACP,CACC,IAAIgB,EAAOrB,EAAAsB,EAAA,IAEX,OAAQN,GACP,KAAKO,EAAUC,MACdH,EACCrB,EAACyB,EACA,CAAAC,UACA,EAAAX,IAAKD,GAAOC,EACZY,IAAI,QACJC,YAAc/B,GAAMA,EAAEE,mBAGxB,MACD,KAAKwB,EAAUM,MACdR,EAAOrB,EAAA,QAAA,CAAOe,IAAKD,GAAOC,EAAKe,QAAQ,SACvC,MACD,QACCT,EACCU,EAAAT,EAAA,CAAAU,SAAA,CACChC,EAACiC,GAAKC,KAAMlC,EAACmC,EAAe,CAAA,KAC5BnC,EAAM,OAAA,CAAAL,UAAU,qBACdqC,SAAAI,EAAMxB,QAOZ,OACCmB,EAAA,MAAA,CACC3B,IAAKA,EACLgC,MAAOxB,EACPjB,UAAU,qBACVC,QAAS,IAAMc,IAAYJ,GAAM0B,SAAA,CAEhCX,EACAH,IACI,CAGP,OACCa,EACC,MAAA,CAAA3B,IAAKA,EAELT,UAAU,gBACVC,QAAS,IAAMc,IAAYJ,GAAM0B,SAAA,CAEjChC,mBAAOY,IAEPZ,EAAG,IAAA,CAAAL,UAAU,gBAAeqC,SAAEK,EAAYxB,GAAQ,KAEjDK,IARIP"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as s}from"react/jsx-runtime";import{arrayMove as i}from"../../js/utils.js";import l from"../../js/usePreview/index.js";import{PlusSharp as t}from"@ricons/material";import{useReactive as a}from"ahooks";import r from"classnames";import{uid as n}from"radash";import{useRef as o,useMemo as m,useEffect as d,useImperativeHandle as c}from"react";import{SortableItem as f}from"react-easy-sort";import"../button/index.js";import u from"../icon/icon.js";import p from"../input/container.js";import b,{ListContainer as h}from"./renderFile.js";import g from"../button/button.js";const j=j=>{const{ref:v,label:y,labelInline:N,value:U,files:x=[],initialFiles:L,placeholder:F,status:O="normal",message:R,className:z,style:I,children:C,defaultText:P="Upload",mode:k="default",cardSize:w="4em",disabled:S,sortable:q,limit:A=(j.multiple?1/0:1),multiple:E,renderItem:T,shouldUpload:$=()=>!0,uploader:B,onChange:D,onFilesChange:G,onUpload:H,...J}=j,K=a({files:x,value:U,status:O,message:R}),M=o(null),Q=l(),V=m((()=>C||e(g,"card"===k?{className:"i-upload-card-btn color-5",square:!0,flat:!0,outline:!0,disabled:S,children:e(u,{icon:e(t,{})})}:{className:"i-upload-btn",disabled:S,children:P})),[k,C]),W=e=>{const[...s]=K.files,i=s.splice(e,1);URL.revokeObjectURL(i[0]?.src||""),K.files=s,G?.(s,i),D?.(s),M.current&&(M.current.value="")},X=async e=>{if(!B)return;const s=e.filter($),i=Promise.all(s.map(B));return H?.(i)},Y=e=>{Q({items:K.files,initial:e})},Z=e=>{e&&(K.files=e.map((e=>({...e,id:e.id??n(7)}))))};return d((()=>{Object.assign(K,{status:O,message:R})}),[O,R]),d((()=>{K.files=U?.filter?.((e=>!!e.id))??[]}),[U]),d((()=>{Z(L)}),[]),c(v,(()=>({getFileList:()=>K.files,setFileList:Z})),[]),e(p,{as:"div",label:y,labelInline:N,className:r("i-input-label-file",z),style:I,children:s("div",{className:r("i-upload-inner",{[`i-upload-${k}`]:"default"!==k}),style:{"--upload-card-size":w},children:[e(h,{sortable:q,onSortEnd:(e,s)=>{const[...l]=K.files;K.files=i(l,e,s),D?.(K.files)},children:K.files.map(((s,i)=>{const l=e(b,{index:i,file:s,mode:k,renderItem:T,onRemove:W,onPreview:Y},i);return q?e(f,{children:l},i):l}))}),K.message&&e("span",{className:"i-upload-message",children:K.message}),K.files.length<A&&s("label",{children:[e("input",{...J,disabled:S,ref:M,type:"file",className:"i-input-file-hidden",multiple:E,onChange:e=>{const s=Array.from(e.target.files||[]),{files:i}=K,l=[];s.map((e=>{const{id:s,name:t,size:a,type:r}=e,o=i.find((e=>{const{name:s,size:i,type:l}=e;return s===t&&i===a&&l===r})),m=URL.createObjectURL(e);Object.assign(e,{id:s??n(7),src:m??e.name,url:m??e.name}),!o&&l.push(e)}));const t=[...i,...l];Object.assign(K,{files:E?t.slice(0,A):[t.at(-1)],status:O,message:R}),G?.(K.files,l,e),D?.(K.files,e),X(l),M.current&&(M.current.value="")}}),V]})]})})};export{j as default};
|
|
2
|
+
//# sourceMappingURL=upload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.js","sources":["../../../packages/components/upload/upload.tsx"],"sourcesContent":["import { arrayMove } from \"@/packages/js/utils\";\nimport usePreview from \"@p/js/usePreview\";\nimport { TPreviewItem } from \"@p/js/usePreview/type\";\nimport { PlusSharp } from \"@ricons/material\";\nimport { useReactive } from \"ahooks\";\nimport classNames from \"classnames\";\nimport { uid } from \"radash\";\nimport {\n\tChangeEvent,\n\tCSSProperties,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseMemo,\n\tuseRef,\n} from \"react\";\nimport { SortableItem } from \"react-easy-sort\";\nimport Button from \"../button\";\nimport Icon from \"../icon\";\nimport InputContainer from \"../input/container\";\nimport \"./index.css\";\nimport FileListItem, { ListContainer } from \"./renderFile\";\nimport { IFile, IUpload } from \"./type\";\n\nconst Upload = (props: IUpload) => {\n\tconst {\n\t\tref,\n\t\tlabel,\n\t\tlabelInline,\n\t\tvalue,\n\t\tfiles = [],\n\t\tinitialFiles,\n\t\tplaceholder,\n\t\tstatus = \"normal\",\n\t\tmessage,\n\t\tclassName,\n\t\tstyle,\n\t\tchildren,\n\t\tdefaultText = \"Upload\",\n\t\tmode = \"default\",\n\t\tcardSize = \"4em\",\n\t\tdisabled,\n\t\tsortable,\n\t\tlimit = props.multiple ? Infinity : 1,\n\t\tmultiple,\n\t\trenderItem,\n\t\tshouldUpload = () => true,\n\t\tuploader,\n\t\tonChange,\n\t\tonFilesChange,\n\t\tonUpload,\n\t\t...restProps\n\t} = props;\n\n\tconst state = useReactive({\n\t\tfiles,\n\t\tvalue,\n\t\tstatus,\n\t\tmessage,\n\t});\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst preview = usePreview();\n\n\tconst trigger = useMemo(() => {\n\t\tif (children) return children;\n\n\t\tswitch (mode) {\n\t\t\tcase \"card\":\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName='i-upload-card-btn color-5'\n\t\t\t\t\t\tsquare\n\t\t\t\t\t\tflat\n\t\t\t\t\t\toutline\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={<PlusSharp />} />\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\tdefault:\n\t\t\t\treturn (\n\t\t\t\t\t<Button className='i-upload-btn' disabled={disabled}>\n\t\t\t\t\t\t{defaultText}\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t}\n\t}, [mode, children]);\n\n\tconst handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n\t\tconst files = Array.from(e.target.files || []) as IFile[];\n\t\tconst { files: before } = state;\n\t\tconst changed: IFile[] = [];\n\n\t\tfiles.map((f) => {\n\t\t\tconst { id, name, size, type } = f;\n\t\t\tconst same = before.find((pf) => {\n\t\t\t\tconst { name: n, size: s, type: t } = pf;\n\t\t\t\treturn n === name && s === size && t === type;\n\t\t\t});\n\t\t\tconst src = URL.createObjectURL(f);\n\n\t\t\tObject.assign(f, {\n\t\t\t\tid: id ?? uid(7),\n\t\t\t\tsrc: src ?? f.name,\n\t\t\t\turl: src ?? f.name,\n\t\t\t});\n\t\t\t!same && changed.push(f);\n\t\t});\n\n\t\tconst after = [...before, ...changed];\n\n\t\tObject.assign(state, {\n\t\t\tfiles: multiple ? after.slice(0, limit) : [after.at(-1)],\n\t\t\tstatus,\n\t\t\tmessage,\n\t\t});\n\n\t\tonFilesChange?.(state.files, changed, e);\n\t\tonChange?.(state.files, e);\n\n\t\thandleUpload(changed);\n\t\tinputRef.current && (inputRef.current.value = \"\");\n\t};\n\n\tconst handleRemove = (i: number) => {\n\t\tconst [...files] = state.files;\n\n\t\tconst changed = files.splice(i, 1);\n\t\tURL.revokeObjectURL(changed[0]?.src || \"\");\n\n\t\tstate.files = files;\n\t\tonFilesChange?.(files, changed);\n\t\tonChange?.(files);\n\n\t\tinputRef.current && (inputRef.current.value = \"\");\n\t};\n\n\tconst handleUpload = async (files: IFile[]) => {\n\t\tif (!uploader) return;\n\n\t\tconst shouldUploadFiles = files.filter(shouldUpload);\n\n\t\tconst result = Promise.all(shouldUploadFiles.map(uploader));\n\n\t\treturn onUpload?.(result);\n\t};\n\n\tconst handlePreview = (i: number) => {\n\t\tpreview({ items: state.files as TPreviewItem[], initial: i });\n\t};\n\n\tconst setFileList = (files?: IFile[] | File[]) => {\n\t\tif (!files) return;\n\n\t\tstate.files = files.map((f) => {\n\t\t\treturn { ...f, id: f.id ?? uid(7) };\n\t\t});\n\t};\n\n\tconst handleSortEnd = (before, after) => {\n\t\tconst [...files] = state.files;\n\n\t\tstate.files = arrayMove(files, before, after);\n\t\tonChange?.(state.files);\n\t};\n\n\tuseEffect(() => {\n\t\tObject.assign(state, {\n\t\t\tstatus,\n\t\t\tmessage,\n\t\t});\n\t}, [status, message]);\n\n\tuseEffect(() => {\n\t\tstate.files = value?.filter?.((file) => !!file.id) ?? [];\n\t}, [value]);\n\n\tuseEffect(() => {\n\t\tsetFileList(initialFiles);\n\t}, []);\n\n\tuseImperativeHandle(\n\t\tref,\n\t\t() => ({\n\t\t\tgetFileList: () => state.files,\n\n\t\t\tsetFileList,\n\t\t}),\n\t\t[]\n\t);\n\n\treturn (\n\t\t<InputContainer\n\t\t\tas='div'\n\t\t\tlabel={label}\n\t\t\tlabelInline={labelInline}\n\t\t\tclassName={classNames(\"i-input-label-file\", className)}\n\t\t\tstyle={style}\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={classNames(\"i-upload-inner\", {\n\t\t\t\t\t[`i-upload-${mode}`]: mode !== \"default\",\n\t\t\t\t})}\n\t\t\t\tstyle={{ [\"--upload-card-size\"]: cardSize } as CSSProperties}\n\t\t\t>\n\t\t\t\t<ListContainer sortable={sortable} onSortEnd={handleSortEnd}>\n\t\t\t\t\t{state.files.map((file: IFile, i: number) => {\n\t\t\t\t\t\tconst node = (\n\t\t\t\t\t\t\t<FileListItem\n\t\t\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\t\t\tindex={i}\n\t\t\t\t\t\t\t\tfile={file}\n\t\t\t\t\t\t\t\tmode={mode}\n\t\t\t\t\t\t\t\trenderItem={renderItem}\n\t\t\t\t\t\t\t\tonRemove={handleRemove}\n\t\t\t\t\t\t\t\tonPreview={handlePreview}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif (!sortable) return node;\n\n\t\t\t\t\t\treturn <SortableItem key={i}>{node}</SortableItem>;\n\t\t\t\t\t})}\n\t\t\t\t</ListContainer>\n\n\t\t\t\t{state.message && (\n\t\t\t\t\t<span className='i-upload-message'>{state.message}</span>\n\t\t\t\t)}\n\n\t\t\t\t{state.files.length < limit && (\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t{...restProps}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\tref={inputRef}\n\t\t\t\t\t\t\ttype='file'\n\t\t\t\t\t\t\tclassName='i-input-file-hidden'\n\t\t\t\t\t\t\tmultiple={multiple}\n\t\t\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{trigger}\n\t\t\t\t\t</label>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</InputContainer>\n\t);\n};\n\nexport default Upload;\n"],"names":["Upload","props","ref","label","labelInline","value","files","initialFiles","placeholder","status","message","className","style","children","defaultText","mode","cardSize","disabled","sortable","limit","multiple","Infinity","renderItem","shouldUpload","uploader","onChange","onFilesChange","onUpload","restProps","state","useReactive","inputRef","useRef","preview","usePreview","trigger","useMemo","_jsx","Button","square","flat","outline","Icon","icon","PlusSharp","handleRemove","i","changed","splice","URL","revokeObjectURL","src","current","handleUpload","async","shouldUploadFiles","filter","result","Promise","all","map","handlePreview","items","initial","setFileList","f","id","uid","useEffect","Object","assign","file","useImperativeHandle","getFileList","InputContainer","as","classNames","_jsxs","ListContainer","onSortEnd","before","after","arrayMove","node","FileListItem","index","onRemove","onPreview","SortableItem","length","type","e","Array","from","target","name","size","same","find","pf","n","s","t","createObjectURL","url","push","slice","at"],"mappings":"6kBAuBA,MAAMA,EAAUC,IACf,MAAMC,IACLA,EAAGC,MACHA,EAAKC,YACLA,EAAWC,MACXA,EAAKC,MACLA,EAAQ,GAAEC,aACVA,EAAYC,YACZA,EAAWC,OACXA,EAAS,SAAQC,QACjBA,EAAOC,UACPA,EAASC,MACTA,EAAKC,SACLA,EAAQC,YACRA,EAAc,SAAQC,KACtBA,EAAO,UAASC,SAChBA,EAAW,MAAKC,SAChBA,EAAQC,SACRA,EAAQC,MACRA,GAAQlB,EAAMmB,SAAWC,IAAW,GAACD,SACrCA,EAAQE,WACRA,EAAUC,aACVA,EAAe,KAAM,EAAIC,SACzBA,EAAQC,SACRA,EAAQC,cACRA,EAAaC,SACbA,KACGC,GACA3B,EAEE4B,EAAQC,EAAY,CACzBxB,QACAD,QACAI,SACAC,YAEKqB,EAAWC,EAAyB,MACpCC,EAAUC,IAEVC,EAAUC,GAAQ,IACnBvB,GAKDwB,EAACC,EAFE,SADEvB,EAGE,CACNJ,UAAU,4BACV4B,QAAM,EACNC,MAAI,EACJC,SAAO,EACPxB,SAAUA,EAAQJ,SAElBwB,EAACK,EAAK,CAAAC,KAAMN,EAACO,EAAS,CAAA,MAKhB,CAACjC,UAAU,eAAeM,SAAUA,EAAQJ,SACjDC,KAIH,CAACC,EAAMF,IAsCJgC,EAAgBC,IACrB,SAAUxC,GAASuB,EAAMvB,MAEnByC,EAAUzC,EAAM0C,OAAOF,EAAG,GAChCG,IAAIC,gBAAgBH,EAAQ,IAAII,KAAO,IAEvCtB,EAAMvB,MAAQA,EACdoB,IAAgBpB,EAAOyC,GACvBtB,IAAWnB,GAEXyB,EAASqB,UAAYrB,EAASqB,QAAQ/C,MAAQ,GAAG,EAG5CgD,EAAeC,MAAOhD,IAC3B,IAAKkB,EAAU,OAEf,MAAM+B,EAAoBjD,EAAMkD,OAAOjC,GA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E4B,MAInDtD,EAAMnB,SACN2B,EAAM,OAAA,CAAA1B,UAAU,mBAAoBE,SAAAgB,EAAMnB,UAG1CmB,EAAMvB,MAAMmF,OAAStE,GACrB0D,qBACCxC,EACK,QAAA,IAAAT,EACJX,SAAUA,EACVf,IAAK6B,EACL2D,KAAK,OACL/E,UAAU,sBACVS,SAAUA,EACVK,SAtJgBkE,IACrB,MAAMrF,EAAQsF,MAAMC,KAAKF,EAAEG,OAAOxF,OAAS,KACnCA,MAAO0E,GAAWnD,EACpBkB,EAAmB,GAEzBzC,EAAMsD,KAAKK,IACV,MAAMC,GAAEA,EAAE6B,KAAEA,EAAIC,KAAEA,EAAIN,KAAEA,GAASzB,EAC3BgC,EAAOjB,EAAOkB,MAAMC,IACzB,MAAQJ,KAAMK,EAAGJ,KAAMK,EAAGX,KAAMY,GAAMH,EACtC,OAAOC,IAAML,GAAQM,IAAML,GAAQM,IAAMZ,CAAI,IAExCvC,EAAMF,IAAIsD,gBAAgBtC,GAEhCI,OAAOC,OAAOL,EAAG,CAChBC,GAAIA,GAAMC,EAAI,GACdhB,IAAKA,GAAOc,EAAE8B,KACdS,IAAKrD,GAAOc,EAAE8B,QAEdE,GAAQlD,EAAQ0D,KAAKxC,EAAE,IAGzB,MAAMgB,EAAQ,IAAID,KAAWjC,GAE7BsB,OAAOC,OAAOzC,EAAO,CACpBvB,MAAOc,EAAW6D,EAAMyB,MAAM,EAAGvF,GAAS,CAAC8D,EAAM0B,IAAG,IACpDlG,SACAC,YAGDgB,IAAgBG,EAAMvB,MAAOyC,EAAS4C,GACtClE,IAAWI,EAAMvB,MAAOqF,GAExBtC,EAAaN,GACbhB,EAASqB,UAAYrB,EAASqB,QAAQ/C,MAAQ,GAAG,IAuH5C8B,SAIY"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../packages/components/utils/empty/index.tsx"],"sourcesContent":["import { InboxTwotone } from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport \"./index.css\";\n\nexport default function Empty(props) {\n\tconst { className, ...restProps } = props;\n\n\treturn (\n\t\t<InboxTwotone\n\t\t\tclassName={classNames(\"i-empty\", className)}\n\t\t\t{...restProps}\n\t\t/>\n\t);\n}\n"],"names":["Empty","props","className","restProps","_jsx","InboxTwotone","classNames"],"mappings":"kHAIwB,SAAAA,EAAMC,GAC7B,MAAMC,UAAEA,KAAcC,GAAcF,EAEpC,OACCG,EAACC,EACA,CAAAH,UAAWI,EAAW,UAAWJ,MAC7BC,GAGP"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as r,Fragment as o}from"react/jsx-runtime";import{CloseRound as a}from"@ricons/material";import m from"classnames";import{uid as i}from"radash";import{createElement as t}from"react";import s from"../../icon/icon.js";const c=c=>{const{as:e="a",active:n,className:p,icon:f=r(a,{}),...l}=c;return n?t(e,{className:m("i-helpericon",p),...l},[t(s,{key:i(3),icon:f})]):r(o,{})};export{c as default};
|
|
2
|
+
//# sourceMappingURL=helpericon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpericon.js","sources":["../../../../packages/components/utils/helpericon/helpericon.tsx"],"sourcesContent":["import { CloseRound } from \"@ricons/material\";\nimport classNames from \"classnames\";\nimport { uid } from \"radash\";\nimport { createElement } from \"react\";\nimport Icon from \"../../icon\";\nimport \"./index.css\";\nimport { IHelperIcon } from \"./type\";\n\nconst Helpericon = (props: IHelperIcon) => {\n\tconst {\n\t\tas = \"a\",\n\t\tactive,\n\t\tclassName,\n\t\ticon = <CloseRound />,\n\t\t...restProps\n\t} = props;\n\n\tif (!active) return <></>;\n\n\treturn createElement(\n\t\tas,\n\t\t{\n\t\t\tclassName: classNames(\"i-helpericon\", className),\n\t\t\t...restProps,\n\t\t},\n\t\t[\n\t\t\tcreateElement(Icon, {\n\t\t\t\tkey: uid(3),\n\t\t\t\ticon,\n\t\t\t}),\n\t\t]\n\t);\n};\n\nexport default Helpericon;\n"],"names":["Helpericon","props","as","active","className","icon","_jsx","CloseRound","restProps","createElement","classNames","Icon","key","uid"],"mappings":"mOAQA,MAAMA,EAAcC,IACnB,MAAMC,GACLA,EAAK,IAAGC,OACRA,EAAMC,UACNA,EAASC,KACTA,EAAOC,EAACC,SACLC,GACAP,EAEJ,OAAKE,EAEEM,EACNP,EACA,CACCE,UAAWM,EAAW,eAAgBN,MACnCI,GAEJ,CACCC,EAAcE,EAAM,CACnBC,IAAKC,EAAI,GACTR,WAXiBC,OAcnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as e,jsx as r}from"react/jsx-runtime";import{exitFullScreen as n,fullScreen as t}from"../../js/utils.js";import{PauseRound as o,PlayArrowRound as i,StopRound as s,VolumeOffRound as l,VolumeDownRound as c,FullscreenExitRound as a,FullscreenRound as u}from"@ricons/material";import{useReactive as m}from"ahooks";import d from"classnames";import{throttle as v}from"radash";import{useRef as g,useImperativeHandle as p,useEffect as h}from"react";import"../button/index.js";import f from"../icon/icon.js";import C from"../progress/progress.js";import"../text/index.js";import b from"../button/button.js";import y from"../text/text.js";const E=E=>{const{ref:j,style:T,hideControls:L,autoplay:N,muted:P,volume:k=50,height:x,width:F,useOriginControls:H,timeProgressProps:q={barClass:"bg-blue"},volumeProgressProps:O={barClass:"bg-blue"},className:w,onFullScreenChange:D,...M}=E,S=m({playing:N,volume:P?0:k,volumeCache:0,muted:P,current:0,duration:0,isFullscreen:!1,controlHidden:!0,draggingProgress:!1}),V=g(null),z=g(null),A=e=>{const r=e.target;r.paused||S.draggingProgress||Object.assign(S,{current:r.currentTime})},B=e=>{S.playing=!e.target.paused},G=()=>{const e=V.current?.parentElement;e&&(S.isFullscreen=document.fullscreenElement===e)},I=e=>{const r=e.target;Object.assign(S,{volume:100*r.volume,muted:0===r.volume})},J=()=>{const e=V.current;e&&(e.paused?e.play():e.pause())},K=()=>{const e=V.current;e&&(e.currentTime=0,e.pause())},Q=()=>{const e=V.current?.parentElement;e&&(S.isFullscreen?n():t(e),D?.(!S.isFullscreen))},R=!L&&!H,U=()=>{z.current&&(clearTimeout(z.current),z.current=null)},W=v({interval:900},(()=>{R&&S.controlHidden&&(S.controlHidden=!1,U(),z.current=setTimeout((()=>{S.controlHidden=!0}),1e3))}));p(j,(()=>({play:()=>{const e=V.current;e&&e.play()},pause:()=>{const e=V.current;e&&e.pause()},stop:K,fullscreen:Q,getVideo:()=>V.current}))),h((()=>{const e=V.current;if(e)return e.addEventListener("timeupdate",A),e.addEventListener("play",B),e.addEventListener("pause",B),e.addEventListener("volumechange",I),document.addEventListener("fullscreenchange",G),()=>{U(),e.removeEventListener("timeupdate",A),e.removeEventListener("play",B),e.removeEventListener("pause",B),e.removeEventListener("volumechange",I),document.removeEventListener("fullscreenchange",G)}}),[]);const X=S.current/S.duration*100;return e("div",{className:d("i-video",w),style:{height:x,width:F,...T},onClick:J,onDoubleClick:()=>Q(),onMouseMove:W,children:[r("video",{ref:V,onCanPlay:e=>{const r=e.target;Object.assign(S,{duration:r.duration,current:r.currentTime}),r.volume=S.volume/100},...M,controls:H}),R&&e("div",{className:d("i-video-controls",{"i-video-controls-hidden":S.controlHidden}),onClick:e=>e.stopPropagation(),children:[r(b.Toggle,{className:"i-video-btn",flat:!0,square:!0,after:r(f,{icon:r(o,{})}),active:S.playing,onClick:J,children:r(f,{icon:r(i,{})})}),r(b,{className:"i-video-btn",flat:!0,square:!0,onClick:K,children:r(f,{icon:r(s,{})})}),e("span",{className:"i-video-times font-sm",children:[r(y.Time,{seconds:S.current})," /",r(y.Time,{seconds:S.duration})]}),r(C,{...q,value:X,onChange:e=>{const r=V.current;r&&(r.currentTime=S.duration*e/100)},onDraggingChange:e=>{S.draggingProgress=e}}),e("div",{className:"i-video-control-volume",children:[r(b.Toggle,{className:"i-video-btn",flat:!0,square:!0,active:S.volume<=0,after:r(f,{icon:r(l,{}),style:{padding:".125em"}}),onClick:()=>{const e=V.current;if(e)return e.volume>0?(S.volumeCache=e.volume,void(e.volume=0)):void(e.volume=0===S.volumeCache?.5:S.volumeCache)},children:r(f,{icon:r(c,{})})}),r("div",{className:"i-video-volume",children:r(C,{style:{height:100},vertical:!0,...O,value:S.volume,onChange:e=>{const r=V.current;r&&(r.volume=e/100)}})})]}),r(b.Toggle,{className:"i-video-btn",flat:!0,square:!0,after:r(f,{icon:r(a,{})}),active:S.isFullscreen,onClick:()=>Q(),children:r(f,{icon:r(u,{})})})]})]})};export{E as default};
|
|
2
|
+
//# sourceMappingURL=video.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video.js","sources":["../../../packages/components/video/video.tsx"],"sourcesContent":["import { exitFullScreen, fullScreen } from \"@p/js/utils\";\nimport {\n\tFullscreenExitRound,\n\tFullscreenRound,\n\tPauseRound,\n\tPlayArrowRound,\n\tStopRound,\n\tVolumeDownRound,\n\tVolumeOffRound,\n} from \"@ricons/material\";\nimport { useReactive } from \"ahooks\";\nimport classNames from \"classnames\";\nimport { throttle } from \"radash\";\nimport { useEffect, useImperativeHandle, useRef } from \"react\";\nimport Button from \"../button\";\nimport Icon from \"../icon\";\nimport Progress from \"../progress\";\nimport Text from \"../text\";\nimport \"./index.css\";\nimport { IVideo } from \"./type\";\n\nconst Video = (props: IVideo) => {\n\tconst {\n\t\tref,\n\t\tstyle,\n\t\thideControls,\n\t\tautoplay,\n\t\tmuted,\n\t\tvolume = 50,\n\t\theight,\n\t\twidth,\n\t\tuseOriginControls,\n\t\ttimeProgressProps = {\n\t\t\tbarClass: \"bg-blue\",\n\t\t},\n\t\tvolumeProgressProps = {\n\t\t\tbarClass: \"bg-blue\",\n\t\t},\n\t\tclassName,\n\t\tonFullScreenChange,\n\t\t...restProps\n\t} = props;\n\tconst state = useReactive({\n\t\tplaying: autoplay,\n\t\tvolume: muted ? 0 : volume,\n\t\tvolumeCache: 0,\n\t\tmuted,\n\t\tcurrent: 0,\n\t\tduration: 0,\n\t\tisFullscreen: false,\n\t\tcontrolHidden: true,\n\t\tdraggingProgress: false,\n\t});\n\tconst videoRef = useRef<HTMLVideoElement>(null);\n\tconst hiddenTO = useRef<any>(null);\n\n\tconst timeUpdateListener = (e) => {\n\t\tconst tar = e.target;\n\t\tif (tar.paused || state.draggingProgress) return;\n\n\t\tObject.assign(state, {\n\t\t\tcurrent: tar.currentTime,\n\t\t});\n\t};\n\n\tconst playChangeListener = (e) => {\n\t\tstate.playing = !e.target.paused;\n\t};\n\n\tconst fsChangeListener = () => {\n\t\tconst tar = videoRef.current?.parentElement;\n\t\tif (!tar) return;\n\n\t\tstate.isFullscreen = document.fullscreenElement === tar;\n\t};\n\n\tconst volumeChangeListener = (e) => {\n\t\tconst tar = e.target;\n\t\tObject.assign(state, {\n\t\t\tvolume: tar.volume * 100,\n\t\t\tmuted: tar.volume === 0,\n\t\t});\n\t};\n\n\tconst handlePlay = () => {\n\t\tconst v = videoRef.current;\n\t\tif (!v) return;\n\n\t\tv.paused ? v.play() : v.pause();\n\t};\n\n\tconst handleReady = (e) => {\n\t\tconst tar = e.target;\n\t\tObject.assign(state, {\n\t\t\tduration: tar.duration,\n\t\t\tcurrent: tar.currentTime,\n\t\t});\n\t\ttar.volume = state.volume / 100;\n\t};\n\n\tconst handleMuted = () => {\n\t\tconst v = videoRef.current;\n\t\tif (!v) return;\n\n\t\tif (v.volume > 0) {\n\t\t\tstate.volumeCache = v.volume;\n\t\t\tv.volume = 0;\n\t\t\treturn;\n\t\t}\n\t\tv.volume = state.volumeCache === 0 ? 0.5 : state.volumeCache;\n\t};\n\n\tconst handleStop = () => {\n\t\tconst v = videoRef.current;\n\t\tif (!v) return;\n\n\t\tv.currentTime = 0;\n\t\tv.pause();\n\t};\n\n\tconst handleFullscreen = () => {\n\t\tconst tar = videoRef.current?.parentElement;\n\t\tif (!tar) return;\n\n\t\tstate.isFullscreen ? exitFullScreen() : fullScreen(tar);\n\t\tonFullScreenChange?.(!state.isFullscreen);\n\t};\n\n\tconst handleUpdateTime = (t) => {\n\t\tconst v = videoRef.current;\n\t\tif (!v) return;\n\n\t\tv.currentTime = (state.duration * t) / 100;\n\t};\n\n\tconst handleUpdateVolume = (t) => {\n\t\tconst v = videoRef.current;\n\t\tif (!v) return;\n\n\t\tv.volume = t / 100;\n\t};\n\n\tconst showControls = !hideControls && !useOriginControls;\n\n\tconst clearHiddenTO = () => {\n\t\tif (!hiddenTO.current) return;\n\t\tclearTimeout(hiddenTO.current);\n\t\thiddenTO.current = null;\n\t};\n\n\tconst setHiddenFalse = () => {\n\t\tif (!showControls || !state.controlHidden) return;\n\t\tstate.controlHidden = false;\n\n\t\tclearHiddenTO();\n\t\thiddenTO.current = setTimeout(() => {\n\t\t\tstate.controlHidden = true;\n\t\t}, 1000);\n\t};\n\n\tconst handleDraggingProgress = (dragging) => {\n\t\tstate.draggingProgress = dragging;\n\t};\n\n\tconst handleMouseMove = throttle({ interval: 900 }, setHiddenFalse);\n\n\tuseImperativeHandle(ref, () => ({\n\t\tplay: () => {\n\t\t\tconst v = videoRef.current;\n\t\t\tif (!v) return;\n\n\t\t\tv.play();\n\t\t},\n\t\tpause: () => {\n\t\t\tconst v = videoRef.current;\n\t\t\tif (!v) return;\n\n\t\t\tv.pause();\n\t\t},\n\t\tstop: handleStop,\n\t\tfullscreen: handleFullscreen,\n\t\tgetVideo: () => videoRef.current,\n\t}));\n\n\tuseEffect(() => {\n\t\tconst v = videoRef.current;\n\t\tif (!v) return;\n\n\t\tv.addEventListener(\"timeupdate\", timeUpdateListener);\n\t\tv.addEventListener(\"play\", playChangeListener);\n\t\tv.addEventListener(\"pause\", playChangeListener);\n\t\tv.addEventListener(\"volumechange\", volumeChangeListener);\n\t\tdocument.addEventListener(\"fullscreenchange\", fsChangeListener);\n\n\t\treturn () => {\n\t\t\tclearHiddenTO();\n\t\t\tv.removeEventListener(\"timeupdate\", timeUpdateListener);\n\t\t\tv.removeEventListener(\"play\", playChangeListener);\n\t\t\tv.removeEventListener(\"pause\", playChangeListener);\n\t\t\tv.removeEventListener(\"volumechange\", volumeChangeListener);\n\t\t\tdocument.removeEventListener(\"fullscreenchange\", fsChangeListener);\n\t\t};\n\t}, []);\n\n\tconst currentValue = (state.current / state.duration) * 100;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\"i-video\", className)}\n\t\t\tstyle={{ height, width, ...style }}\n\t\t\tonClick={handlePlay}\n\t\t\tonDoubleClick={() => handleFullscreen()}\n\t\t\tonMouseMove={handleMouseMove}\n\t\t>\n\t\t\t<video\n\t\t\t\tref={videoRef}\n\t\t\t\tonCanPlay={handleReady}\n\t\t\t\t{...restProps}\n\t\t\t\tcontrols={useOriginControls}\n\t\t\t/>\n\n\t\t\t{showControls && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames(\"i-video-controls\", {\n\t\t\t\t\t\t\"i-video-controls-hidden\": state.controlHidden,\n\t\t\t\t\t})}\n\t\t\t\t\tonClick={(e) => e.stopPropagation()}\n\t\t\t\t>\n\t\t\t\t\t<Button.Toggle\n\t\t\t\t\t\tclassName='i-video-btn'\n\t\t\t\t\t\tflat\n\t\t\t\t\t\tsquare\n\t\t\t\t\t\tafter={<Icon icon={<PauseRound />} />}\n\t\t\t\t\t\tactive={state.playing}\n\t\t\t\t\t\tonClick={handlePlay}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={<PlayArrowRound />} />\n\t\t\t\t\t</Button.Toggle>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName='i-video-btn'\n\t\t\t\t\t\tflat\n\t\t\t\t\t\tsquare\n\t\t\t\t\t\tonClick={handleStop}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={<StopRound />} />\n\t\t\t\t\t</Button>\n\t\t\t\t\t<span className='i-video-times font-sm'>\n\t\t\t\t\t\t<Text.Time seconds={state.current} /> /\n\t\t\t\t\t\t<Text.Time seconds={state.duration} />\n\t\t\t\t\t</span>\n\t\t\t\t\t<Progress\n\t\t\t\t\t\t{...timeProgressProps}\n\t\t\t\t\t\tvalue={currentValue}\n\t\t\t\t\t\tonChange={handleUpdateTime}\n\t\t\t\t\t\tonDraggingChange={handleDraggingProgress}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<div className='i-video-control-volume'>\n\t\t\t\t\t\t<Button.Toggle\n\t\t\t\t\t\t\tclassName='i-video-btn'\n\t\t\t\t\t\t\tflat\n\t\t\t\t\t\t\tsquare\n\t\t\t\t\t\t\tactive={state.volume <= 0}\n\t\t\t\t\t\t\tafter={\n\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\ticon={<VolumeOffRound />}\n\t\t\t\t\t\t\t\t\tstyle={{ padding: \".125em\" }}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonClick={handleMuted}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Icon icon={<VolumeDownRound />} />\n\t\t\t\t\t\t</Button.Toggle>\n\n\t\t\t\t\t\t<div className='i-video-volume'>\n\t\t\t\t\t\t\t<Progress\n\t\t\t\t\t\t\t\tstyle={{ height: 100 }}\n\t\t\t\t\t\t\t\tvertical\n\t\t\t\t\t\t\t\t{...volumeProgressProps}\n\t\t\t\t\t\t\t\tvalue={state.volume}\n\t\t\t\t\t\t\t\tonChange={handleUpdateVolume}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<Button.Toggle\n\t\t\t\t\t\tclassName='i-video-btn'\n\t\t\t\t\t\tflat\n\t\t\t\t\t\tsquare\n\t\t\t\t\t\tafter={<Icon icon={<FullscreenExitRound />} />}\n\t\t\t\t\t\tactive={state.isFullscreen}\n\t\t\t\t\t\tonClick={() => handleFullscreen()}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={<FullscreenRound />} />\n\t\t\t\t\t</Button.Toggle>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nexport default Video;\n"],"names":["Video","props","ref","style","hideControls","autoplay","muted","volume","height","width","useOriginControls","timeProgressProps","barClass","volumeProgressProps","className","onFullScreenChange","restProps","state","useReactive","playing","volumeCache","current","duration","isFullscreen","controlHidden","draggingProgress","videoRef","useRef","hiddenTO","timeUpdateListener","e","tar","target","paused","Object","assign","currentTime","playChangeListener","fsChangeListener","parentElement","document","fullscreenElement","volumeChangeListener","handlePlay","v","play","pause","handleStop","handleFullscreen","exitFullScreen","fullScreen","showControls","clearHiddenTO","clearTimeout","handleMouseMove","throttle","interval","setTimeout","useImperativeHandle","stop","fullscreen","getVideo","useEffect","addEventListener","removeEventListener","currentValue","_jsxs","classNames","onClick","onDoubleClick","onMouseMove","children","_jsx","onCanPlay","controls","stopPropagation","Button","Toggle","flat","square","after","Icon","icon","PauseRound","active","PlayArrowRound","StopRound","Text","Time","seconds","Progress","value","onChange","t","onDraggingChange","dragging","VolumeOffRound","padding","VolumeDownRound","vertical","FullscreenExitRound","FullscreenRound"],"mappings":"ioBAqBA,MAAMA,EAASC,IACd,MAAMC,IACLA,EAAGC,MACHA,EAAKC,aACLA,EAAYC,SACZA,EAAQC,MACRA,EAAKC,OACLA,EAAS,GAAEC,OACXA,EAAMC,MACNA,EAAKC,kBACLA,EAAiBC,kBACjBA,EAAoB,CACnBC,SAAU,WACVC,oBACDA,EAAsB,CACrBD,SAAU,WACVE,UACDA,EAASC,mBACTA,KACGC,GACAf,EACEgB,EAAQC,EAAY,CACzBC,QAASd,EACTE,OAAQD,EAAQ,EAAIC,EACpBa,YAAa,EACbd,QACAe,QAAS,EACTC,SAAU,EACVC,cAAc,EACdC,eAAe,EACfC,kBAAkB,IAEbC,EAAWC,EAAyB,MACpCC,EAAWD,EAAY,MAEvBE,EAAsBC,IAC3B,MAAMC,EAAMD,EAAEE,OACVD,EAAIE,Q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