linkmore-design 1.0.66 → 1.0.69
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/README.md +11 -7
- package/dist/Approval/demos/basic.d.ts +1 -0
- package/dist/Approval/handle.d.ts +11 -0
- package/dist/Approval/index.d.ts +1 -21
- package/dist/Approval/type.d.ts +55 -0
- package/dist/Approval/util.d.ts +26 -0
- package/dist/AutoComplete/index.d.ts +2 -1
- package/dist/Calendar/demos/basic.d.ts +2 -0
- package/dist/Calendar/index.d.ts +4 -0
- package/dist/Calendar/style/index.d.ts +1 -0
- package/dist/CardTable/hooks/usePagination.d.ts +1 -1
- package/dist/CardTable/utils.d.ts +2 -2
- package/dist/Carousel/demos/basic.d.ts +2 -0
- package/dist/Carousel/index.d.ts +3 -0
- package/dist/Carousel/style/index.d.ts +1 -0
- package/dist/CkFilter/components/CascaderFilter.d.ts +1 -1
- package/dist/Collapse/demos/basic.d.ts +2 -0
- package/dist/Collapse/index.d.ts +3 -0
- package/dist/Collapse/style/index.d.ts +1 -0
- package/dist/Comment/demos/basic.d.ts +2 -0
- package/dist/Comment/index.d.ts +3 -0
- package/dist/Comment/style/index.d.ts +1 -0
- package/dist/LmFilter/components/CascaderFilter.d.ts +1 -1
- package/dist/LmFilter/components/CheckboxFilter.d.ts +1 -1
- package/dist/LmFilter/components/DateFilter.d.ts +1 -1
- package/dist/LmFilter/components/InputFilter.d.ts +2 -2
- package/dist/LmFilter/components/SelectFilter.d.ts +1 -1
- package/dist/LmFilter/filterFns/index.d.ts +1 -1
- package/dist/LmFilter/localization.d.ts +1 -0
- package/dist/LmFilter/utils.d.ts +1 -1
- package/dist/LmSelect/useCheckboxOptions.d.ts +2 -1
- package/dist/LmTable/components/DndContainer.d.ts +5 -0
- package/dist/LmTable/components/sortableBoxCol.d.ts +5 -0
- package/dist/LmTable/components/sortableItemCol.d.ts +1 -0
- package/dist/LmTable/demos/musort.d.ts +2 -0
- package/dist/LmTable/demos/tableColSort.d.ts +2 -0
- package/dist/LmUpload/LmUpload.d.ts +6 -0
- package/dist/LmUpload/UploadList/ItemPicture.d.ts +5 -0
- package/dist/LmUpload/UploadList/ItemPictureCard.d.ts +5 -0
- package/dist/LmUpload/UploadList/ItemText.d.ts +5 -0
- package/dist/LmUpload/UploadList/RenderItem.d.ts +2 -0
- package/dist/LmUpload/UploadList/index.d.ts +4 -0
- package/dist/LmUpload/body/Progress.d.ts +4 -0
- package/dist/LmUpload/body/UploadCore.d.ts +4 -0
- package/dist/LmUpload/body/UploadPicture.d.ts +4 -0
- package/dist/LmUpload/components/card.d.ts +2 -0
- package/dist/LmUpload/demos/basic.d.ts +2 -0
- package/dist/LmUpload/demos/card.d.ts +2 -0
- package/dist/LmUpload/demos/picture.d.ts +2 -0
- package/dist/LmUpload/fns/index.d.ts +18 -0
- package/dist/LmUpload/index.d.ts +2 -0
- package/dist/LmUpload/style/index.d.ts +1 -0
- package/dist/LmUpload/utils.d.ts +5 -0
- package/dist/LmUpload/view/index.d.ts +4 -0
- package/dist/LmUpload/wrapper/Upload.d.ts +4 -0
- package/dist/LmUpload/wrapper/UploadContainer.d.ts +5 -0
- package/dist/LmUpload/wrapper/UploadRoot.d.ts +3 -0
- package/dist/LmUpload/wrapper/UploadWrapper.d.ts +4 -0
- package/dist/LmUpload/wrapper/reducer.d.ts +8 -0
- package/dist/Modal/index.d.ts +1 -1
- package/dist/Popconfirm/demos/basic.d.ts +2 -0
- package/dist/Popconfirm/index.d.ts +3 -0
- package/dist/Popconfirm/style/index.d.ts +1 -0
- package/dist/Progress/demos/basic.d.ts +2 -0
- package/dist/Progress/demos/circle.d.ts +2 -0
- package/dist/Progress/demos/dynamic.d.ts +2 -0
- package/dist/Progress/demos/small.d.ts +2 -0
- package/dist/Progress/index.d.ts +3 -0
- package/dist/Progress/style/index.d.ts +1 -0
- package/dist/Segmented/demos/basic.d.ts +2 -0
- package/dist/Segmented/index.d.ts +3 -0
- package/dist/Segmented/style/index.d.ts +1 -0
- package/dist/Slider/demos/basic.d.ts +2 -0
- package/dist/Slider/index.d.ts +2 -0
- package/dist/Slider/style/index.d.ts +1 -0
- package/dist/Statistic/demos/basic.d.ts +2 -0
- package/dist/Statistic/index.d.ts +3 -0
- package/dist/Statistic/style/index.d.ts +1 -0
- package/dist/TimePicker/demos/basic.d.ts +3 -0
- package/dist/TimePicker/index.d.ts +3 -0
- package/dist/TimePicker/style/index.d.ts +1 -0
- package/dist/Timeline/demos/basic.d.ts +2 -0
- package/dist/Timeline/index.d.ts +3 -0
- package/dist/Timeline/style/index.d.ts +1 -0
- package/dist/Transfer/demos/basic.d.ts +2 -0
- package/dist/Transfer/index.d.ts +3 -0
- package/dist/Transfer/style/index.d.ts +1 -0
- package/dist/TreeSelect/demos/basic.d.ts +2 -0
- package/dist/TreeSelect/index.d.ts +3 -0
- package/dist/TreeSelect/style/index.d.ts +1 -0
- package/dist/hooks/useFullscreen/demos/useInModal.d.ts +2 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.umd.js +3891 -1392
- package/dist/index.umd.min.js +6 -6
- package/es/Affix/style/index.css +6 -0
- package/es/Alert/index.js +27 -5
- package/es/Alert/style/index.css +7 -1
- package/es/Approval/handle.d.ts +11 -0
- package/es/Approval/handle.js +138 -0
- package/es/Approval/index.d.ts +1 -21
- package/es/Approval/index.js +341 -90
- package/es/Approval/style/index.css +131 -13
- package/es/Approval/type.d.ts +55 -0
- package/es/Approval/type.js +97 -0
- package/es/Approval/util.d.ts +26 -0
- package/es/Approval/util.js +132 -0
- package/es/AutoComplete/index.d.ts +2 -1
- package/es/AutoComplete/style/index.css +6 -0
- package/es/Avatar/style/index.css +6 -0
- package/es/Breadcrumb/style/index.css +6 -0
- package/es/ButtonTags/style/index.css +6 -0
- package/es/Calendar/index.d.ts +4 -0
- package/es/Calendar/index.js +3 -0
- package/es/Calendar/style/index.css +511 -0
- package/es/Calendar/style/index.d.ts +1 -0
- package/es/Calendar/style/index.js +1 -0
- package/es/Card/style/index.css +6 -0
- package/es/CardTable/fns/index.js +5 -8
- package/es/CardTable/table/TableRoot.js +2 -1
- package/es/Carousel/index.d.ts +3 -0
- package/es/Carousel/index.js +3 -0
- package/es/Carousel/style/index.css +511 -0
- package/es/Carousel/style/index.d.ts +1 -0
- package/es/Carousel/style/index.js +1 -0
- package/es/Cascader/style/index.css +6 -0
- package/es/CkFilter/complexFilter/drawer.js +1 -4
- package/es/CkFilter/complexFilter/saveModal.js +5 -7
- package/es/CkFilter/components/CustomModal.js +2 -3
- package/es/CkFilter/components/filterTypes.js +1 -3
- package/es/CkFilter/components/modal.js +2 -5
- package/es/CkFilter/components/modalBack.js +2 -3
- package/es/CkFilter/customFilter/drawer.js +6 -11
- package/es/CkFilter/style/index.css +6 -0
- package/es/Col/style/index.css +6 -0
- package/es/Collapse/index.d.ts +3 -0
- package/es/Collapse/index.js +3 -0
- package/es/Collapse/style/index.css +511 -0
- package/es/Collapse/style/index.d.ts +1 -0
- package/es/Collapse/style/index.js +1 -0
- package/es/Comment/index.d.ts +3 -0
- package/es/Comment/index.js +3 -0
- package/es/Comment/style/index.css +511 -0
- package/es/Comment/style/index.d.ts +1 -0
- package/es/Comment/style/index.js +1 -0
- package/es/CustomTableOption/index.js +6 -6
- package/es/CustomTableOption/style/index.css +6 -0
- package/es/CustomerService/style/index.css +6 -0
- package/es/DatePicker/style/index.css +6 -0
- package/es/Descriptions/style/index.css +6 -0
- package/es/Drawer/style/index.css +6 -0
- package/es/Dropdown/style/index.css +6 -0
- package/es/EditTable/style/index.css +6 -0
- package/es/Empty/style/index.css +6 -0
- package/es/Filter/baseFilter/Popover.js +0 -1
- package/es/Filter/baseFilter/ToggleFilter.js +0 -1
- package/es/Filter/edit/editFilter.js +2 -6
- package/es/Filter/remember.js +0 -1
- package/es/Filter/style/index.css +6 -0
- package/es/Form/style/index.css +6 -0
- package/es/Grid/style/index.css +6 -0
- package/es/Icon/style/index.css +6 -0
- package/es/IconFont/font/iconfont.js +1 -1
- package/es/Image/style/index.css +6 -0
- package/es/Input/style/index.css +6 -0
- package/es/InputNumber/style/index.css +6 -0
- package/es/Layout/style/index.css +6 -0
- package/es/LeftTable/style/index.css +6 -0
- package/es/List/style/index.css +6 -0
- package/es/LmEditTable/DragHandle.js +2 -1
- package/es/LmEditTable/EditTable.js +90 -43
- package/es/LmEditTable/style/index.css +18 -0
- package/es/LmFilter/LmFilter.js +2 -0
- package/es/LmFilter/complexFilter/drawer.js +2 -7
- package/es/LmFilter/complexFilter/valueDrawer.js +2 -5
- package/es/LmFilter/components/CascaderFilter.js +0 -1
- package/es/LmFilter/components/DropdownFIlter.js +17 -19
- package/es/LmFilter/components/InputFilter.js +1 -2
- package/es/LmFilter/components/SelectFilter.js +2 -2
- package/es/LmFilter/components/index.js +1 -1
- package/es/LmFilter/customFilter/drawer.js +7 -25
- package/es/LmFilter/customFilter/index.js +2 -1
- package/es/LmFilter/customFilter/saveModal.js +5 -7
- package/es/LmFilter/customFilter/valueDrawer.js +2 -5
- package/es/LmFilter/filterFns/index.js +5 -7
- package/es/LmFilter/localization.d.ts +1 -0
- package/es/LmFilter/localization.js +2 -1
- package/es/LmFilter/utils.js +39 -22
- package/es/LmFilter/wrapper/Filter.js +3 -2
- package/es/LmFilter/wrapper/FilterRoot.js +0 -2
- package/es/LmSelect/NormalSelect.js +5 -1
- package/es/LmSelect/style/index.css +8 -1
- package/es/LmSelect/useCheckboxOptions.d.ts +2 -1
- package/es/LmSelect/useCheckboxOptions.js +6 -4
- package/es/LmTable/Table.js +88 -46
- package/es/LmTable/autosize.js +0 -3
- package/es/LmTable/components/DndContainer.d.ts +5 -0
- package/es/LmTable/components/DndContainer.js +35 -0
- package/es/LmTable/components/sortableBoxCol.js +24 -0
- package/es/LmTable/components/sortableItemCol.js +54 -0
- package/es/LmTable/style/index.css +6 -0
- package/es/LmUpload/LmUpload.d.ts +6 -0
- package/es/LmUpload/LmUpload.js +81 -0
- package/es/LmUpload/UploadList/ItemPicture.d.ts +5 -0
- package/es/LmUpload/UploadList/ItemPicture.js +31 -0
- package/es/LmUpload/UploadList/ItemPictureCard.d.ts +5 -0
- package/es/LmUpload/UploadList/ItemPictureCard.js +135 -0
- package/es/LmUpload/UploadList/ItemText.d.ts +5 -0
- package/es/LmUpload/UploadList/ItemText.js +30 -0
- package/es/LmUpload/UploadList/RenderItem.d.ts +2 -0
- package/es/LmUpload/UploadList/RenderItem.js +31 -0
- package/es/LmUpload/UploadList/index.d.ts +4 -0
- package/es/LmUpload/UploadList/index.js +27 -0
- package/es/LmUpload/body/Progress.d.ts +4 -0
- package/es/LmUpload/body/Progress.js +16 -0
- package/es/LmUpload/body/UploadCore.d.ts +4 -0
- package/es/LmUpload/body/UploadCore.js +57 -0
- package/es/LmUpload/body/UploadPicture.d.ts +4 -0
- package/es/LmUpload/body/UploadPicture.js +35 -0
- package/es/LmUpload/components/card.d.ts +2 -0
- package/es/LmUpload/components/card.js +9 -0
- package/es/LmUpload/fns/index.d.ts +18 -0
- package/es/LmUpload/fns/index.js +229 -0
- package/es/LmUpload/index.d.ts +2 -0
- package/es/LmUpload/index.js +2 -0
- package/es/LmUpload/style/index.css +205 -0
- package/es/LmUpload/style/index.js +3 -0
- package/es/LmUpload/utils.d.ts +5 -0
- package/es/LmUpload/utils.js +33 -0
- package/es/LmUpload/view/index.d.ts +4 -0
- package/es/LmUpload/view/index.js +10 -0
- package/es/LmUpload/wrapper/Upload.d.ts +4 -0
- package/es/LmUpload/wrapper/Upload.js +12 -0
- package/es/LmUpload/wrapper/UploadContainer.d.ts +5 -0
- package/es/LmUpload/wrapper/UploadContainer.js +28 -0
- package/es/LmUpload/wrapper/UploadRoot.d.ts +3 -0
- package/es/LmUpload/wrapper/UploadRoot.js +68 -0
- package/es/LmUpload/wrapper/UploadWrapper.d.ts +4 -0
- package/es/LmUpload/wrapper/UploadWrapper.js +17 -0
- package/es/LmUpload/wrapper/reducer.d.ts +8 -0
- package/es/LmUpload/wrapper/reducer.js +33 -0
- package/es/Mentions/style/index.css +6 -0
- package/es/Menu/style/index.css +6 -0
- package/es/Modal/index.d.ts +1 -1
- package/es/Modal/style/index.css +6 -0
- package/es/PageHeader/style/index.css +6 -0
- package/es/Pagination/style/index.css +6 -0
- package/es/PopTable/style/index.css +6 -0
- package/es/Popconfirm/index.d.ts +3 -0
- package/es/Popconfirm/index.js +3 -0
- package/es/Popconfirm/style/index.css +511 -0
- package/es/Popconfirm/style/index.d.ts +1 -0
- package/es/Popconfirm/style/index.js +1 -0
- package/es/Popover/style/index.css +6 -0
- package/es/ProTable/Table.js +0 -1
- package/es/ProTable/autosize.js +0 -3
- package/es/ProTable/style/index.css +6 -0
- package/es/Progress/index.d.ts +3 -0
- package/es/Progress/index.js +3 -0
- package/es/Progress/style/index.css +511 -0
- package/es/Progress/style/index.d.ts +1 -0
- package/es/Progress/style/index.js +1 -0
- package/es/QuickMenu/style/index.css +6 -0
- package/es/Rate/style/index.css +6 -0
- package/es/Row/style/index.css +6 -0
- package/es/Segmented/index.d.ts +3 -0
- package/es/Segmented/index.js +3 -0
- package/es/Segmented/style/index.css +511 -0
- package/es/Segmented/style/index.d.ts +1 -0
- package/es/Segmented/style/index.js +1 -0
- package/es/Select/style/index.css +6 -0
- package/es/Slider/index.d.ts +2 -0
- package/es/Slider/index.js +3 -0
- package/es/Slider/style/index.css +511 -0
- package/es/Slider/style/index.d.ts +1 -0
- package/es/Slider/style/index.js +1 -0
- package/es/Space/style/index.css +6 -0
- package/es/Spin/style/index.css +6 -0
- package/es/Statistic/index.d.ts +3 -0
- package/es/Statistic/index.js +3 -0
- package/es/Statistic/style/index.css +511 -0
- package/es/Statistic/style/index.d.ts +1 -0
- package/es/Statistic/style/index.js +1 -0
- package/es/Steps/style/index.css +6 -0
- package/es/Switch/style/index.css +6 -0
- package/es/Table/style/index.css +6 -0
- package/es/Tabs/style/index.css +6 -0
- package/es/Tag/style/index.css +6 -0
- package/es/TimePicker/index.d.ts +3 -0
- package/es/TimePicker/index.js +3 -0
- package/es/TimePicker/style/index.css +511 -0
- package/es/TimePicker/style/index.d.ts +1 -0
- package/es/TimePicker/style/index.js +1 -0
- package/es/Timeline/index.d.ts +3 -0
- package/es/Timeline/index.js +3 -0
- package/es/Timeline/style/index.css +511 -0
- package/es/Timeline/style/index.d.ts +1 -0
- package/es/Timeline/style/index.js +1 -0
- package/es/Tooltip/style/index.css +6 -0
- package/es/Transfer/index.d.ts +3 -0
- package/es/Transfer/index.js +3 -0
- package/es/Transfer/style/index.css +511 -0
- package/es/Transfer/style/index.d.ts +1 -0
- package/es/Transfer/style/index.js +1 -0
- package/es/Tree/style/index.css +6 -0
- package/es/TreeSelect/index.d.ts +3 -0
- package/es/TreeSelect/index.js +3 -0
- package/es/TreeSelect/style/index.css +511 -0
- package/es/TreeSelect/style/index.d.ts +1 -0
- package/es/TreeSelect/style/index.js +1 -0
- package/es/Typography/style/index.css +6 -0
- package/es/Upload/style/index.css +6 -0
- package/es/hooks/useFullscreen/index.js +6 -8
- package/es/index.d.ts +18 -0
- package/es/index.js +10 -1
- package/es/message/style/index.css +6 -0
- package/es/notification/style/index.css +6 -0
- package/es/styles/main.css +6 -0
- package/es/styles/resetAntd.css +3 -0
- package/lib/Affix/style/index.css +6 -0
- package/lib/Alert/index.js +27 -5
- package/lib/Alert/style/index.css +7 -1
- package/lib/Approval/handle.d.ts +11 -0
- package/lib/Approval/handle.js +160 -0
- package/lib/Approval/index.d.ts +1 -21
- package/lib/Approval/index.js +347 -89
- package/lib/Approval/style/index.css +131 -13
- package/lib/Approval/type.d.ts +55 -0
- package/lib/Approval/type.js +105 -0
- package/lib/Approval/util.d.ts +26 -0
- package/lib/Approval/util.js +148 -0
- package/lib/AutoComplete/index.d.ts +2 -1
- package/lib/AutoComplete/style/index.css +6 -0
- package/lib/Avatar/style/index.css +6 -0
- package/lib/Breadcrumb/style/index.css +6 -0
- package/lib/ButtonTags/style/index.css +6 -0
- package/lib/Calendar/index.d.ts +4 -0
- package/lib/Calendar/index.js +15 -0
- package/lib/Calendar/style/index.css +511 -0
- package/lib/Calendar/style/index.d.ts +1 -0
- package/lib/Calendar/style/index.js +3 -0
- package/lib/Card/style/index.css +6 -0
- package/lib/CardTable/fns/index.js +5 -8
- package/lib/CardTable/table/TableRoot.js +2 -1
- package/lib/Carousel/index.d.ts +3 -0
- package/lib/Carousel/index.js +15 -0
- package/lib/Carousel/style/index.css +511 -0
- package/lib/Carousel/style/index.d.ts +1 -0
- package/lib/Carousel/style/index.js +3 -0
- package/lib/Cascader/style/index.css +6 -0
- package/lib/CkFilter/complexFilter/drawer.js +1 -4
- package/lib/CkFilter/complexFilter/saveModal.js +5 -7
- package/lib/CkFilter/components/CustomModal.js +2 -3
- package/lib/CkFilter/components/filterTypes.js +1 -3
- package/lib/CkFilter/components/modal.js +2 -5
- package/lib/CkFilter/components/modalBack.js +2 -3
- package/lib/CkFilter/customFilter/drawer.js +6 -11
- package/lib/CkFilter/style/index.css +6 -0
- package/lib/Col/style/index.css +6 -0
- package/lib/Collapse/index.d.ts +3 -0
- package/lib/Collapse/index.js +15 -0
- package/lib/Collapse/style/index.css +511 -0
- package/lib/Collapse/style/index.d.ts +1 -0
- package/lib/Collapse/style/index.js +3 -0
- package/lib/Comment/index.d.ts +3 -0
- package/lib/Comment/index.js +15 -0
- package/lib/Comment/style/index.css +511 -0
- package/lib/Comment/style/index.d.ts +1 -0
- package/lib/Comment/style/index.js +3 -0
- package/lib/CustomTableOption/index.js +6 -6
- package/lib/CustomTableOption/style/index.css +6 -0
- package/lib/CustomerService/style/index.css +6 -0
- package/lib/DatePicker/style/index.css +6 -0
- package/lib/Descriptions/style/index.css +6 -0
- package/lib/Drawer/style/index.css +6 -0
- package/lib/Dropdown/style/index.css +6 -0
- package/lib/EditTable/style/index.css +6 -0
- package/lib/Empty/style/index.css +6 -0
- package/lib/Filter/baseFilter/Popover.js +0 -1
- package/lib/Filter/baseFilter/ToggleFilter.js +0 -1
- package/lib/Filter/edit/editFilter.js +2 -6
- package/lib/Filter/remember.js +0 -1
- package/lib/Filter/style/index.css +6 -0
- package/lib/Form/style/index.css +6 -0
- package/lib/Grid/style/index.css +6 -0
- package/lib/Icon/style/index.css +6 -0
- package/lib/IconFont/font/iconfont.js +1 -1
- package/lib/Image/style/index.css +6 -0
- package/lib/Input/style/index.css +6 -0
- package/lib/InputNumber/style/index.css +6 -0
- package/lib/Layout/style/index.css +6 -0
- package/lib/LeftTable/style/index.css +6 -0
- package/lib/List/style/index.css +6 -0
- package/lib/LmEditTable/DragHandle.js +2 -1
- package/lib/LmEditTable/EditTable.js +90 -43
- package/lib/LmEditTable/style/index.css +18 -0
- package/lib/LmFilter/LmFilter.js +2 -0
- package/lib/LmFilter/complexFilter/drawer.js +2 -7
- package/lib/LmFilter/complexFilter/valueDrawer.js +2 -5
- package/lib/LmFilter/components/CascaderFilter.js +0 -1
- package/lib/LmFilter/components/DropdownFIlter.js +17 -19
- package/lib/LmFilter/components/InputFilter.js +1 -2
- package/lib/LmFilter/components/SelectFilter.js +2 -2
- package/lib/LmFilter/components/index.js +1 -1
- package/lib/LmFilter/customFilter/drawer.js +7 -25
- package/lib/LmFilter/customFilter/index.js +2 -1
- package/lib/LmFilter/customFilter/saveModal.js +5 -7
- package/lib/LmFilter/customFilter/valueDrawer.js +2 -5
- package/lib/LmFilter/filterFns/index.js +5 -7
- package/lib/LmFilter/localization.d.ts +1 -0
- package/lib/LmFilter/localization.js +4 -2
- package/lib/LmFilter/utils.js +39 -22
- package/lib/LmFilter/wrapper/Filter.js +3 -2
- package/lib/LmFilter/wrapper/FilterRoot.js +0 -2
- package/lib/LmSelect/NormalSelect.js +5 -1
- package/lib/LmSelect/style/index.css +8 -1
- package/lib/LmSelect/useCheckboxOptions.d.ts +2 -1
- package/lib/LmSelect/useCheckboxOptions.js +9 -6
- package/lib/LmTable/Table.js +88 -46
- package/lib/LmTable/autosize.js +0 -3
- package/lib/LmTable/components/DndContainer.d.ts +5 -0
- package/lib/LmTable/components/DndContainer.js +49 -0
- package/lib/LmTable/components/sortableBoxCol.js +24 -0
- package/lib/LmTable/components/sortableItemCol.js +54 -0
- package/lib/LmTable/style/index.css +6 -0
- package/lib/LmUpload/LmUpload.d.ts +6 -0
- package/lib/LmUpload/LmUpload.js +95 -0
- package/lib/LmUpload/UploadList/ItemPicture.d.ts +5 -0
- package/lib/LmUpload/UploadList/ItemPicture.js +43 -0
- package/lib/LmUpload/UploadList/ItemPictureCard.d.ts +5 -0
- package/lib/LmUpload/UploadList/ItemPictureCard.js +150 -0
- package/lib/LmUpload/UploadList/ItemText.d.ts +5 -0
- package/lib/LmUpload/UploadList/ItemText.js +41 -0
- package/lib/LmUpload/UploadList/RenderItem.d.ts +2 -0
- package/lib/LmUpload/UploadList/RenderItem.js +44 -0
- package/lib/LmUpload/UploadList/index.d.ts +4 -0
- package/lib/LmUpload/UploadList/index.js +41 -0
- package/lib/LmUpload/body/Progress.d.ts +4 -0
- package/lib/LmUpload/body/Progress.js +26 -0
- package/lib/LmUpload/body/UploadCore.d.ts +4 -0
- package/lib/LmUpload/body/UploadCore.js +73 -0
- package/lib/LmUpload/body/UploadPicture.d.ts +4 -0
- package/lib/LmUpload/body/UploadPicture.js +50 -0
- package/lib/LmUpload/components/card.d.ts +2 -0
- package/lib/LmUpload/components/card.js +19 -0
- package/lib/LmUpload/fns/index.d.ts +18 -0
- package/lib/LmUpload/fns/index.js +242 -0
- package/lib/LmUpload/index.d.ts +2 -0
- package/lib/LmUpload/index.js +13 -0
- package/lib/LmUpload/style/index.css +205 -0
- package/lib/LmUpload/style/index.js +3 -0
- package/lib/LmUpload/utils.d.ts +5 -0
- package/lib/LmUpload/utils.js +54 -0
- package/lib/LmUpload/view/index.d.ts +4 -0
- package/lib/LmUpload/view/index.js +20 -0
- package/lib/LmUpload/wrapper/Upload.d.ts +4 -0
- package/lib/LmUpload/wrapper/Upload.js +25 -0
- package/lib/LmUpload/wrapper/UploadContainer.d.ts +5 -0
- package/lib/LmUpload/wrapper/UploadContainer.js +43 -0
- package/lib/LmUpload/wrapper/UploadRoot.d.ts +3 -0
- package/lib/LmUpload/wrapper/UploadRoot.js +85 -0
- package/lib/LmUpload/wrapper/UploadWrapper.d.ts +4 -0
- package/lib/LmUpload/wrapper/UploadWrapper.js +29 -0
- package/lib/LmUpload/wrapper/reducer.d.ts +8 -0
- package/lib/LmUpload/wrapper/reducer.js +46 -0
- package/lib/Mentions/style/index.css +6 -0
- package/lib/Menu/style/index.css +6 -0
- package/lib/Modal/index.d.ts +1 -1
- package/lib/Modal/style/index.css +6 -0
- package/lib/PageHeader/style/index.css +6 -0
- package/lib/Pagination/style/index.css +6 -0
- package/lib/PopTable/style/index.css +6 -0
- package/lib/Popconfirm/index.d.ts +3 -0
- package/lib/Popconfirm/index.js +15 -0
- package/lib/Popconfirm/style/index.css +511 -0
- package/lib/Popconfirm/style/index.d.ts +1 -0
- package/lib/Popconfirm/style/index.js +3 -0
- package/lib/Popover/style/index.css +6 -0
- package/lib/ProTable/Table.js +0 -1
- package/lib/ProTable/autosize.js +0 -3
- package/lib/ProTable/style/index.css +6 -0
- package/lib/Progress/index.d.ts +3 -0
- package/lib/Progress/index.js +15 -0
- package/lib/Progress/style/index.css +511 -0
- package/lib/Progress/style/index.d.ts +1 -0
- package/lib/Progress/style/index.js +3 -0
- package/lib/QuickMenu/style/index.css +6 -0
- package/lib/Rate/style/index.css +6 -0
- package/lib/Row/style/index.css +6 -0
- package/lib/Segmented/index.d.ts +3 -0
- package/lib/Segmented/index.js +15 -0
- package/lib/Segmented/style/index.css +511 -0
- package/lib/Segmented/style/index.d.ts +1 -0
- package/lib/Segmented/style/index.js +3 -0
- package/lib/Select/style/index.css +6 -0
- package/lib/Slider/index.d.ts +2 -0
- package/lib/Slider/index.js +15 -0
- package/lib/Slider/style/index.css +511 -0
- package/lib/Slider/style/index.d.ts +1 -0
- package/lib/Slider/style/index.js +3 -0
- package/lib/Space/style/index.css +6 -0
- package/lib/Spin/style/index.css +6 -0
- package/lib/Statistic/index.d.ts +3 -0
- package/lib/Statistic/index.js +15 -0
- package/lib/Statistic/style/index.css +511 -0
- package/lib/Statistic/style/index.d.ts +1 -0
- package/lib/Statistic/style/index.js +3 -0
- package/lib/Steps/style/index.css +6 -0
- package/lib/Switch/style/index.css +6 -0
- package/lib/Table/style/index.css +6 -0
- package/lib/Tabs/style/index.css +6 -0
- package/lib/Tag/style/index.css +6 -0
- package/lib/TimePicker/index.d.ts +3 -0
- package/lib/TimePicker/index.js +15 -0
- package/lib/TimePicker/style/index.css +511 -0
- package/lib/TimePicker/style/index.d.ts +1 -0
- package/lib/TimePicker/style/index.js +3 -0
- package/lib/Timeline/index.d.ts +3 -0
- package/lib/Timeline/index.js +15 -0
- package/lib/Timeline/style/index.css +511 -0
- package/lib/Timeline/style/index.d.ts +1 -0
- package/lib/Timeline/style/index.js +3 -0
- package/lib/Tooltip/style/index.css +6 -0
- package/lib/Transfer/index.d.ts +3 -0
- package/lib/Transfer/index.js +15 -0
- package/lib/Transfer/style/index.css +511 -0
- package/lib/Transfer/style/index.d.ts +1 -0
- package/lib/Transfer/style/index.js +3 -0
- package/lib/Tree/style/index.css +6 -0
- package/lib/TreeSelect/index.d.ts +3 -0
- package/lib/TreeSelect/index.js +15 -0
- package/lib/TreeSelect/style/index.css +511 -0
- package/lib/TreeSelect/style/index.d.ts +1 -0
- package/lib/TreeSelect/style/index.js +3 -0
- package/lib/Typography/style/index.css +6 -0
- package/lib/Upload/style/index.css +6 -0
- package/lib/hooks/useFullscreen/index.js +6 -10
- package/lib/index.d.ts +18 -0
- package/lib/index.js +73 -1
- package/lib/message/style/index.css +6 -0
- package/lib/notification/style/index.css +6 -0
- package/lib/styles/main.css +6 -0
- package/lib/styles/resetAntd.css +3 -0
- package/package.json +3 -1
- package/typings/index.d.ts +1 -1
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useMemo, useState } from 'react';
|
|
3
|
+
import cn from 'classnames';
|
|
4
|
+
import { IconFont, Image } from 'linkmore-design';
|
|
5
|
+
|
|
6
|
+
var renderThumb = function renderThumb(file) {
|
|
7
|
+
switch (file.fileExtension) {
|
|
8
|
+
case '':
|
|
9
|
+
return /*#__PURE__*/React.createElement(IconFont, {
|
|
10
|
+
type: "lmweb-folder-fill"
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
case 'jpeg':
|
|
14
|
+
case 'png':
|
|
15
|
+
case 'jpg':
|
|
16
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
className: "lm_upload_item_error"
|
|
18
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
19
|
+
type: "lmweb-image"
|
|
20
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
className: "lm_upload_item_name"
|
|
22
|
+
}, file.realFileName));
|
|
23
|
+
|
|
24
|
+
case 'doc':
|
|
25
|
+
case 'docx':
|
|
26
|
+
return /*#__PURE__*/React.createElement(IconFont, {
|
|
27
|
+
type: "lmweb-file-word"
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
case 'ppt':
|
|
31
|
+
case 'pptx':
|
|
32
|
+
return /*#__PURE__*/React.createElement(IconFont, {
|
|
33
|
+
type: "lmweb-file-ppt"
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
case 'xls':
|
|
37
|
+
case 'xlsx':
|
|
38
|
+
return /*#__PURE__*/React.createElement(IconFont, {
|
|
39
|
+
type: "lmweb-file-excel"
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
case 'pdf':
|
|
43
|
+
return /*#__PURE__*/React.createElement(IconFont, {
|
|
44
|
+
type: "lmweb-file-pdf"
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
default:
|
|
48
|
+
return /*#__PURE__*/React.createElement(IconFont, {
|
|
49
|
+
type: "lmweb-file-text"
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}; // 图片列表项
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
var PictureItem = function PictureItem(_ref) {
|
|
56
|
+
var file = _ref.file,
|
|
57
|
+
instance = _ref.instance;
|
|
58
|
+
var size = instance.size,
|
|
59
|
+
remove = instance.remove,
|
|
60
|
+
preview = instance.preview;
|
|
61
|
+
|
|
62
|
+
var _useState = useState(false),
|
|
63
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
64
|
+
isError = _useState2[0],
|
|
65
|
+
setIsError = _useState2[1]; // 文件信息重组
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
var resetFile = useMemo(function () {
|
|
69
|
+
var fileExtension = file.realFileName.replace(/.*\./, '').toLowerCase();
|
|
70
|
+
return Object.assign(Object.assign({}, file), {
|
|
71
|
+
fileExtension: fileExtension
|
|
72
|
+
});
|
|
73
|
+
}, [file]); // 预览小图
|
|
74
|
+
|
|
75
|
+
var thumbUrl = useMemo(function () {
|
|
76
|
+
return "".concat(file.url, "?x-oss-process=image/resize,w_").concat(size);
|
|
77
|
+
}, [file.url, size]); // 根据文件名后缀判断
|
|
78
|
+
|
|
79
|
+
var isImg = useMemo(function () {
|
|
80
|
+
return ['jpg', 'jpeg', 'png', 'gif', 'bmp'].includes(resetFile.fileExtension);
|
|
81
|
+
}, [resetFile]); // 重置尺寸大小
|
|
82
|
+
|
|
83
|
+
var resetSize = useMemo(function () {
|
|
84
|
+
var width = size - 16;
|
|
85
|
+
var padding = size > 60 ? 8 : 4;
|
|
86
|
+
var fontSize = size > 60 ? 16 : 14;
|
|
87
|
+
return {
|
|
88
|
+
width: width,
|
|
89
|
+
padding: padding,
|
|
90
|
+
fontSize: fontSize
|
|
91
|
+
};
|
|
92
|
+
}, [size]);
|
|
93
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
className: cn('lm_upload_item', 'lm_upload_item_card', isError && 'error'),
|
|
95
|
+
style: {
|
|
96
|
+
height: size,
|
|
97
|
+
width: size
|
|
98
|
+
}
|
|
99
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
100
|
+
className: "lm_upload_item_thumb"
|
|
101
|
+
}, isError || !isImg ? renderThumb(resetFile) : /*#__PURE__*/React.createElement(Image, {
|
|
102
|
+
width: resetSize.width,
|
|
103
|
+
height: resetSize.width,
|
|
104
|
+
src: thumbUrl,
|
|
105
|
+
onError: function onError() {
|
|
106
|
+
return setIsError(true);
|
|
107
|
+
}
|
|
108
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
109
|
+
className: "lm_upload_item_mask"
|
|
110
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
111
|
+
className: "lm_upload_item_action"
|
|
112
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
113
|
+
className: "action_preview",
|
|
114
|
+
onClick: function onClick() {
|
|
115
|
+
return preview(file);
|
|
116
|
+
}
|
|
117
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
118
|
+
type: "lmweb-eye",
|
|
119
|
+
style: {
|
|
120
|
+
fontSize: size > 48 ? 16 : 12
|
|
121
|
+
}
|
|
122
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
123
|
+
className: "action_delete",
|
|
124
|
+
onClick: function onClick() {
|
|
125
|
+
return remove(file);
|
|
126
|
+
}
|
|
127
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
128
|
+
type: "lmweb-delete",
|
|
129
|
+
style: {
|
|
130
|
+
fontSize: size > 48 ? 16 : 12
|
|
131
|
+
}
|
|
132
|
+
})))));
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export default PictureItem;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IconFont } from 'linkmore-design';
|
|
3
|
+
|
|
4
|
+
var TextItem = function TextItem(_ref) {
|
|
5
|
+
var file = _ref.file,
|
|
6
|
+
instance = _ref.instance;
|
|
7
|
+
var remove = instance.remove;
|
|
8
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
className: "lm_upload_item lm_upload_item_text"
|
|
10
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
className: "text_left"
|
|
12
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
className: "prefix"
|
|
14
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
15
|
+
type: "lmweb-attachment"
|
|
16
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
className: "lm_upload_item_name"
|
|
18
|
+
}, file.fileName)), /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
className: "text_right lm_upload_item_text_action"
|
|
20
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
className: "action_delete",
|
|
22
|
+
onClick: function onClick() {
|
|
23
|
+
return remove(file);
|
|
24
|
+
}
|
|
25
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
26
|
+
type: "lmweb-delete"
|
|
27
|
+
}))));
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default TextItem;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
|
|
4
|
+
for (var p in s) {
|
|
5
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
9
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
import TextItem from './ItemText';
|
|
15
|
+
import PictureItem from './ItemPicture';
|
|
16
|
+
import PictureCardItem from './ItemPictureCard';
|
|
17
|
+
import { render } from '../utils';
|
|
18
|
+
|
|
19
|
+
var RenderCell = function RenderCell(props) {
|
|
20
|
+
var type = props.type,
|
|
21
|
+
resetProsp = __rest(props, ["type"]);
|
|
22
|
+
|
|
23
|
+
var types = {
|
|
24
|
+
text: TextItem,
|
|
25
|
+
picture: PictureItem,
|
|
26
|
+
card: PictureCardItem
|
|
27
|
+
};
|
|
28
|
+
return render(types[type] || PictureItem, resetProsp);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default RenderCell;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { render } from '../utils';
|
|
3
|
+
import RenderItem from './RenderItem';
|
|
4
|
+
|
|
5
|
+
var LmUploadList = function LmUploadList(_ref) {
|
|
6
|
+
var instance = _ref.instance;
|
|
7
|
+
|
|
8
|
+
var _a;
|
|
9
|
+
|
|
10
|
+
var uid = instance.uid,
|
|
11
|
+
fileList = instance.fileList,
|
|
12
|
+
itemRender = instance.itemRender,
|
|
13
|
+
listType = instance.listType;
|
|
14
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, (_a = fileList === null || fileList === void 0 ? void 0 : fileList.sort(function (a, b) {
|
|
15
|
+
return a.seq - b.seq;
|
|
16
|
+
})) === null || _a === void 0 ? void 0 : _a.map(function (file, idx) {
|
|
17
|
+
return render(itemRender || RenderItem, {
|
|
18
|
+
type: listType,
|
|
19
|
+
key: file[uid] || idx,
|
|
20
|
+
file: file,
|
|
21
|
+
fileList: fileList,
|
|
22
|
+
instance: instance
|
|
23
|
+
});
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default LmUploadList;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
var Progress = function Progress(_ref) {
|
|
4
|
+
var instance = _ref.instance;
|
|
5
|
+
var state = instance.state;
|
|
6
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
+
className: "lm_upload_progress"
|
|
8
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
className: "line",
|
|
10
|
+
style: {
|
|
11
|
+
width: "".concat(state.percent || 0, "%")
|
|
12
|
+
}
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default Progress;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import UploadPicture from './UploadPicture'; // 上传核心
|
|
3
|
+
// 渲染上传区域样式, 仅用于触发上传事件
|
|
4
|
+
// type: 'card' 图片 | 'drag' 拖拽
|
|
5
|
+
|
|
6
|
+
var UploadCore = function UploadCore(_ref) {
|
|
7
|
+
var instance = _ref.instance;
|
|
8
|
+
var inputRef = React.useRef(null);
|
|
9
|
+
var fileList = instance.fileList,
|
|
10
|
+
accept = instance.accept,
|
|
11
|
+
maxCount = instance.maxCount,
|
|
12
|
+
children = instance.children,
|
|
13
|
+
beforeUpload = instance.beforeUpload,
|
|
14
|
+
getUploadStatus = instance.getUploadStatus;
|
|
15
|
+
var isMaxCount = useMemo(function () {
|
|
16
|
+
return !(fileList.length < maxCount);
|
|
17
|
+
}, []); // 点击事件触发文件上传
|
|
18
|
+
|
|
19
|
+
var handleClick = function handleClick() {
|
|
20
|
+
var _a;
|
|
21
|
+
|
|
22
|
+
var isUploading = getUploadStatus().uploading;
|
|
23
|
+
if (isUploading) return;
|
|
24
|
+
(_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
25
|
+
}; // 上传触发事件
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
var uploadChange = function uploadChange(e) {
|
|
29
|
+
var _a;
|
|
30
|
+
|
|
31
|
+
beforeUpload === null || beforeUpload === void 0 ? void 0 : beforeUpload(e);
|
|
32
|
+
|
|
33
|
+
if ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value) {
|
|
34
|
+
inputRef.current.value = '';
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var inputConfig = {
|
|
39
|
+
type: 'file',
|
|
40
|
+
accept: accept,
|
|
41
|
+
title: '',
|
|
42
|
+
onChange: uploadChange,
|
|
43
|
+
style: {
|
|
44
|
+
display: 'none'
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return isMaxCount && /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
onClick: handleClick,
|
|
49
|
+
className: "lm_upload_core"
|
|
50
|
+
}, children || /*#__PURE__*/React.createElement(UploadPicture, {
|
|
51
|
+
instance: instance
|
|
52
|
+
}), /*#__PURE__*/React.createElement("input", Object.assign({
|
|
53
|
+
ref: inputRef
|
|
54
|
+
}, inputConfig)));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export default UploadCore;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IconFont } from 'linkmore-design';
|
|
3
|
+
import Progress from './Progress'; // 预设卡片上传样式
|
|
4
|
+
|
|
5
|
+
var uploadPicture = function uploadPicture(_ref) {
|
|
6
|
+
var instance = _ref.instance;
|
|
7
|
+
var size = instance.size,
|
|
8
|
+
getUploadStatus = instance.getUploadStatus; // 是否上传中状态
|
|
9
|
+
|
|
10
|
+
var isUploading = React.useMemo(function () {
|
|
11
|
+
return getUploadStatus().uploading;
|
|
12
|
+
}, [getUploadStatus]);
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: "lm_upload_core_picture",
|
|
15
|
+
style: {
|
|
16
|
+
height: size,
|
|
17
|
+
width: size
|
|
18
|
+
}
|
|
19
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
className: "lm_upload_core_picture_action"
|
|
21
|
+
}, !isUploading && /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
className: "action_plus"
|
|
23
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
24
|
+
type: "lmweb-plus",
|
|
25
|
+
style: {
|
|
26
|
+
fontSize: size > 48 ? 16 : 12
|
|
27
|
+
}
|
|
28
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: "tip"
|
|
30
|
+
}, "\u4E0A\u4F20"), isUploading && /*#__PURE__*/React.createElement(Progress, {
|
|
31
|
+
instance: instance
|
|
32
|
+
})));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default uploadPicture;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const useCoreOptions: ({ state, dispatch, props }: {
|
|
2
|
+
state: any;
|
|
3
|
+
dispatch: any;
|
|
4
|
+
props: any;
|
|
5
|
+
}) => {
|
|
6
|
+
CoreMethods: {
|
|
7
|
+
beforeUpload: (e: any) => false | import("../../message").MessageType;
|
|
8
|
+
getUploadStatus: () => {
|
|
9
|
+
uploading: boolean;
|
|
10
|
+
};
|
|
11
|
+
remove: (file: any) => Promise<void>;
|
|
12
|
+
preview: (file: any) => void;
|
|
13
|
+
};
|
|
14
|
+
RefMethods: {
|
|
15
|
+
getState: () => any;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default useCoreOptions;
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
|
|
4
|
+
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) {
|
|
6
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
7
|
+
resolve(value);
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
12
|
+
function fulfilled(value) {
|
|
13
|
+
try {
|
|
14
|
+
step(generator.next(value));
|
|
15
|
+
} catch (e) {
|
|
16
|
+
reject(e);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function rejected(value) {
|
|
21
|
+
try {
|
|
22
|
+
step(generator["throw"](value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function step(result) {
|
|
29
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
import { useCallback } from 'react';
|
|
37
|
+
import { message } from 'linkmore-design';
|
|
38
|
+
import OSS from 'ali-oss';
|
|
39
|
+
|
|
40
|
+
var useCoreOptions = function useCoreOptions(_ref) {
|
|
41
|
+
var state = _ref.state,
|
|
42
|
+
dispatch = _ref.dispatch,
|
|
43
|
+
props = _ref.props;
|
|
44
|
+
var uid = props.uid,
|
|
45
|
+
value = props.fileList,
|
|
46
|
+
onChange = props.onChange,
|
|
47
|
+
type = props.type,
|
|
48
|
+
fileSize = props.fileSize,
|
|
49
|
+
enabledOss = props.enabledOss,
|
|
50
|
+
ossConfig = props.ossConfig; // 上传完成
|
|
51
|
+
|
|
52
|
+
var uploadOnChange = useCallback(function (file) {
|
|
53
|
+
var fileList = [file].concat(_toConsumableArray(value));
|
|
54
|
+
dispatch({
|
|
55
|
+
type: 'changeFileList',
|
|
56
|
+
fileList: fileList
|
|
57
|
+
});
|
|
58
|
+
dispatch({
|
|
59
|
+
type: 'changePercent',
|
|
60
|
+
percent: null
|
|
61
|
+
}); // 上传事件:抛出 file: 文件 filelist: 文件列表 event: 上传进度信息
|
|
62
|
+
|
|
63
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
64
|
+
file: file,
|
|
65
|
+
fileList: fileList
|
|
66
|
+
});
|
|
67
|
+
}, [value]); // 上传至ali-oss
|
|
68
|
+
|
|
69
|
+
var uploadOss = useCallback(function (file) {
|
|
70
|
+
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
71
|
+
var _a, _ossConfig, _ossConfig$dir, dir, shortlink, _ossConfig$region, region, accessKeyId, accessKeySecret, stsToken, _ossConfig$bucket, bucket, client, fileName, pathName, url, seq, params;
|
|
72
|
+
|
|
73
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
74
|
+
while (1) {
|
|
75
|
+
switch (_context.prev = _context.next) {
|
|
76
|
+
case 0:
|
|
77
|
+
_ossConfig = ossConfig(), _ossConfig$dir = _ossConfig.dir, dir = _ossConfig$dir === void 0 ? '/BizFile/4595/Supplier/' : _ossConfig$dir, shortlink = _ossConfig.shortlink, _ossConfig$region = _ossConfig.region, region = _ossConfig$region === void 0 ? 'oss-cn-hangzhou' : _ossConfig$region, accessKeyId = _ossConfig.accessKeyId, accessKeySecret = _ossConfig.accessKeySecret, stsToken = _ossConfig.stsToken, _ossConfig$bucket = _ossConfig.bucket, bucket = _ossConfig$bucket === void 0 ? 'linkmore-scm-test' : _ossConfig$bucket;
|
|
78
|
+
client = new OSS({
|
|
79
|
+
region: region,
|
|
80
|
+
accessKeyId: accessKeyId,
|
|
81
|
+
accessKeySecret: accessKeySecret,
|
|
82
|
+
stsToken: stsToken,
|
|
83
|
+
bucket: bucket
|
|
84
|
+
});
|
|
85
|
+
_context.prev = 2;
|
|
86
|
+
fileName = "".concat(Date.now(), "-").concat(file.name);
|
|
87
|
+
pathName = dir.slice(-1) === '/' ? "".concat(dir).concat(fileName) : "".concat(dir, "/").concat(fileName);
|
|
88
|
+
url = "".concat(shortlink).concat(pathName) || '';
|
|
89
|
+
_context.next = 8;
|
|
90
|
+
return client.multipartUpload(pathName, file, {
|
|
91
|
+
// 获取分片上传进度、断点和返回值。
|
|
92
|
+
progress: function progress(p, cpt, res) {
|
|
93
|
+
onChange({
|
|
94
|
+
file: file,
|
|
95
|
+
fileList: value,
|
|
96
|
+
event: {
|
|
97
|
+
progress: p,
|
|
98
|
+
checkPoint: cpt,
|
|
99
|
+
result: res
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
dispatch({
|
|
103
|
+
type: 'changePercent',
|
|
104
|
+
percent: Number((p * 100).toFixed(2))
|
|
105
|
+
});
|
|
106
|
+
},
|
|
107
|
+
parallel: 4,
|
|
108
|
+
partSize: 1024 * 1024 // 分片大小
|
|
109
|
+
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
case 8:
|
|
113
|
+
seq = (((_a = state.fileList) === null || _a === void 0 ? void 0 : _a.length) || 0) + 1;
|
|
114
|
+
params = {
|
|
115
|
+
uid: seq,
|
|
116
|
+
fileTypeCode: file.type,
|
|
117
|
+
fileTypeName: file.type,
|
|
118
|
+
fileName: fileName,
|
|
119
|
+
realFileName: file.name,
|
|
120
|
+
fileSize: file.size,
|
|
121
|
+
internalUrl: '',
|
|
122
|
+
externalUrl: 'externalUrl',
|
|
123
|
+
filePath: dir,
|
|
124
|
+
seq: seq,
|
|
125
|
+
url: url
|
|
126
|
+
};
|
|
127
|
+
uploadOnChange(params);
|
|
128
|
+
_context.next = 16;
|
|
129
|
+
break;
|
|
130
|
+
|
|
131
|
+
case 13:
|
|
132
|
+
_context.prev = 13;
|
|
133
|
+
_context.t0 = _context["catch"](2);
|
|
134
|
+
console.log('error:', _context.t0);
|
|
135
|
+
|
|
136
|
+
case 16:
|
|
137
|
+
case "end":
|
|
138
|
+
return _context.stop();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}, _callee, null, [[2, 13]]);
|
|
142
|
+
}));
|
|
143
|
+
}, [ossConfig, uploadOnChange, value]); // 上传前的检测
|
|
144
|
+
|
|
145
|
+
var beforeUpload = useCallback(function (e) {
|
|
146
|
+
var files = e.target.files; // 循环文件检查是否存在不符合要求的文件
|
|
147
|
+
|
|
148
|
+
for (var i = 0, len = files.length; i < len; i += 1) {
|
|
149
|
+
var item = files[i];
|
|
150
|
+
|
|
151
|
+
if (!type.includes(item.name.replace(/.*\./, '').toLowerCase())) {
|
|
152
|
+
var content = type.join('、');
|
|
153
|
+
return message.warning("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF01\u4EC5\u652F\u6301".concat(content, "\u7684\u6587\u4EF6\u7C7B\u578B\uFF01"), 1.5);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (item.size / 1024 / 1024 > fileSize) {
|
|
157
|
+
return message.warning("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF01\u9644\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7".concat(fileSize, "M\uFF01"), 1.5);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
enabledOss && uploadOss(item); // 单个文件上传
|
|
161
|
+
// fileUpload?.({ file: item, size, value, onChange: uploadOnChange, isImg: true });
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return false;
|
|
165
|
+
}, [type, fileSize, uploadOss]); // 删除事件
|
|
166
|
+
|
|
167
|
+
var remove = useCallback(function (file) {
|
|
168
|
+
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
169
|
+
var _b, res, fileList;
|
|
170
|
+
|
|
171
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
172
|
+
while (1) {
|
|
173
|
+
switch (_context2.prev = _context2.next) {
|
|
174
|
+
case 0:
|
|
175
|
+
_context2.next = 2;
|
|
176
|
+
return (_b = props.onRemove) === null || _b === void 0 ? void 0 : _b.call(props, file);
|
|
177
|
+
|
|
178
|
+
case 2:
|
|
179
|
+
res = _context2.sent;
|
|
180
|
+
|
|
181
|
+
if (res) {
|
|
182
|
+
fileList = value.filter(function (v) {
|
|
183
|
+
return v[uid] !== file[uid];
|
|
184
|
+
});
|
|
185
|
+
dispatch({
|
|
186
|
+
type: 'changeFileList',
|
|
187
|
+
fileList: fileList
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
case 4:
|
|
192
|
+
case "end":
|
|
193
|
+
return _context2.stop();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}, _callee2);
|
|
197
|
+
}));
|
|
198
|
+
}, [props.onRemove, state.fileList, uid]); // 点击文件链接或预览图标时的回调
|
|
199
|
+
|
|
200
|
+
var preview = useCallback(function (file) {
|
|
201
|
+
var _a;
|
|
202
|
+
|
|
203
|
+
(_a = props.onPreview) === null || _a === void 0 ? void 0 : _a.call(props, file);
|
|
204
|
+
}, []); // 获取上传状态
|
|
205
|
+
|
|
206
|
+
var getUploadStatus = useCallback(function () {
|
|
207
|
+
var uploading = typeof state.percent === 'number';
|
|
208
|
+
return {
|
|
209
|
+
uploading: uploading
|
|
210
|
+
};
|
|
211
|
+
}, [state.percent]);
|
|
212
|
+
var CoreMethods = {
|
|
213
|
+
beforeUpload: beforeUpload,
|
|
214
|
+
getUploadStatus: getUploadStatus,
|
|
215
|
+
remove: remove,
|
|
216
|
+
preview: preview
|
|
217
|
+
};
|
|
218
|
+
var RefMethods = {
|
|
219
|
+
getState: function getState() {
|
|
220
|
+
return state;
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
return {
|
|
224
|
+
CoreMethods: CoreMethods,
|
|
225
|
+
RefMethods: RefMethods
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export default useCoreOptions;
|