linkmore-design 1.1.27-beta.5 → 1.1.28
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/CHANGELOG.md +1237 -0
- package/dist/Affix/demos/basic.d.ts +0 -1
- package/dist/Alert/demos/basic.d.ts +0 -1
- package/dist/Alert/demos/visible.d.ts +0 -1
- package/dist/Approval/demos/basic.d.ts +0 -1
- package/dist/Avatar/demos/basic.d.ts +0 -1
- package/dist/Badge/SingleNumber.d.ts +0 -1
- package/dist/Badge/demos/basic.d.ts +0 -1
- package/dist/Breadcrumb/demos/basic.d.ts +0 -1
- package/dist/Breadcrumb/demos/basic1.d.ts +0 -1
- package/dist/Button/demos/basic.d.ts +0 -1
- package/dist/Button/demos/disabled.d.ts +0 -1
- package/dist/Button/demos/ghost.d.ts +0 -1
- package/dist/Button/demos/icon.d.ts +0 -1
- package/dist/Button/demos/type.d.ts +0 -1
- package/dist/Calendar/demos/basic.d.ts +0 -1
- package/dist/Card/demos/basic.d.ts +0 -1
- package/dist/Carousel/demos/basic.d.ts +0 -1
- package/dist/Cascader/demos/basic.d.ts +0 -1
- package/dist/Cascader/demos/formItem.d.ts +0 -1
- package/dist/Col/demos/basic.d.ts +0 -1
- package/dist/Collapse/demos/basic.d.ts +0 -1
- package/dist/Comment/demos/basic.d.ts +0 -1
- package/dist/ConfigProvider/demos/componentSize.d.ts +0 -1
- package/dist/CustomTableOption/demos/basic.d.ts +0 -1
- package/dist/DatePicker/PickerButton.d.ts +0 -1
- package/dist/DatePicker/PickerTag.d.ts +0 -1
- package/dist/DatePicker/demos/basic.d.ts +0 -1
- package/dist/Descriptions/demos/basic.d.ts +0 -1
- package/dist/Drawer/demos/basic.d.ts +0 -1
- package/dist/Drawer/demos/button.d.ts +0 -1
- package/dist/Drawer/demos/nested.d.ts +0 -1
- package/dist/Dropdown/demos/basic.d.ts +0 -1
- package/dist/Dropdown/demos/button.d.ts +0 -1
- package/dist/Dropdown/demos/icon.d.ts +0 -1
- package/dist/Dropdown/demos/local.d.ts +0 -1
- package/dist/Dropdown/demos/target.d.ts +0 -1
- package/dist/Empty/demos/basic.d.ts +0 -1
- package/dist/Empty/demos/custom.d.ts +0 -1
- package/dist/Empty/empty.d.ts +0 -1
- package/dist/Empty/simple.d.ts +0 -1
- package/dist/Form/demos/disabled.d.ts +0 -1
- package/dist/Form/demos/drawer1152-triple.d.ts +0 -1
- package/dist/Form/demos/drawer440-double.d.ts +0 -1
- package/dist/Form/demos/drawer440.d.ts +0 -1
- package/dist/Form/demos/drawer720-double.d.ts +0 -1
- package/dist/Form/demos/error-tip.d.ts +0 -1
- package/dist/Form/demos/formlist.d.ts +0 -1
- package/dist/Form/demos/horizontal.d.ts +0 -1
- package/dist/Form/demos/inline.d.ts +0 -1
- package/dist/Form/demos/modal416.d.ts +0 -1
- package/dist/Form/demos/modal552-double.d.ts +0 -1
- package/dist/Form/demos/responsive.d.ts +0 -1
- package/dist/Form/demos/ruleTime.d.ts +0 -1
- package/dist/Form/demos/vertical.d.ts +0 -1
- package/dist/FullScreen/demos/basic.d.ts +0 -1
- package/dist/FullScreen/demos/useInModal.d.ts +0 -1
- package/dist/Grid/demos/basic.d.ts +0 -1
- package/dist/IconFont/index.d.ts +0 -1
- package/dist/Image/demos/basic.d.ts +0 -1
- package/dist/ImageViewer/components/Arrows.d.ts +0 -1
- package/dist/ImageViewer/components/Carousel.d.ts +0 -1
- package/dist/ImageViewer/components/Operate.d.ts +0 -1
- package/dist/ImageViewer/components/Thumb.d.ts +0 -1
- package/dist/Input/demos/after.d.ts +0 -1
- package/dist/Input/demos/base.d.ts +0 -1
- package/dist/Input/demos/basic.d.ts +0 -1
- package/dist/Input/demos/color.d.ts +0 -1
- package/dist/Input/demos/combination.d.ts +0 -1
- package/dist/Input/demos/import.d.ts +0 -1
- package/dist/Input/demos/line.d.ts +0 -1
- package/dist/Input/demos/password.d.ts +0 -1
- package/dist/Input/demos/size.d.ts +0 -1
- package/dist/InputNumber/demos/basic.d.ts +0 -1
- package/dist/InputNumber/demos/format.d.ts +0 -1
- package/dist/InputNumber/demos/price.d.ts +0 -1
- package/dist/InputNumber/demos/status.d.ts +0 -1
- package/dist/InputNumber/demos/suffix.d.ts +0 -1
- package/dist/Layout/demos/basic.d.ts +0 -1
- package/dist/List/demos/basic.d.ts +0 -1
- package/dist/LmDrag/components/DndContainer.d.ts +0 -1
- package/dist/LmDrag/demos/basic.d.ts +0 -1
- package/dist/LmEditTable/DndContainer.d.ts +0 -1
- package/dist/LmEditTable/DragHandle.d.ts +0 -1
- package/dist/LmEditTable/demos/basic.d.ts +0 -1
- package/dist/LmEditTable/demos/colsort.d.ts +0 -1
- package/dist/LmEditTable/demos/group.d.ts +0 -1
- package/dist/LmEditTable/demos/priceTable.d.ts +0 -1
- package/dist/LmEditTable/demos/sinleEdit.d.ts +0 -1
- package/dist/LmEditTable/demos/size.d.ts +0 -1
- package/dist/LmEditTable/sortableBox.d.ts +0 -1
- package/dist/LmEditTable/sortableBoxCol.d.ts +0 -1
- package/dist/LmEditTable/sortableItem.d.ts +0 -1
- package/dist/LmEditTable/sortableItemCol.d.ts +0 -1
- package/dist/LmSelect/GhostSelect.d.ts +0 -1
- package/dist/LmSelect/demos/basic.d.ts +0 -1
- package/dist/LmSelect/demos/checkbox.d.ts +0 -1
- package/dist/LmSelect/demos/ghost.d.ts +0 -1
- package/dist/LmSelect/useCheckboxOptions.d.ts +0 -1
- package/dist/LmTable/components/DndContainer.d.ts +5 -37
- package/dist/LmTable/components/customRenderEmpty.d.ts +0 -1
- package/dist/LmTable/components/inputDataEdit.d.ts +0 -1
- package/dist/LmTable/components/{SortableBox.d.ts → sortableBoxCol.d.ts} +0 -0
- package/dist/LmTable/components/sortableItemCol.d.ts +1 -0
- package/dist/LmTable/components/tableChartsModal.d.ts +0 -1
- package/dist/LmTable/demos/{draggable.d.ts → excelGroup.d.ts} +0 -0
- package/dist/LmTable/expression.d.ts +1 -2
- package/dist/LmTable/hooks/useGroupDataSource.d.ts +2 -1
- package/dist/LmTable/util.d.ts +1 -1
- package/dist/LmUpload/UploadList/ItemPicture.d.ts +0 -1
- package/dist/LmUpload/UploadList/ItemPictureCard.d.ts +0 -1
- package/dist/LmUpload/UploadList/ItemText.d.ts +0 -1
- package/dist/LmUpload/view/index.d.ts +0 -1
- package/dist/LmUpload/wrapper/Upload.d.ts +0 -1
- package/dist/Mentions/demos/basic.d.ts +0 -1
- package/dist/Menu/demos/basic.d.ts +0 -1
- package/dist/Modal/demos/basic.d.ts +0 -1
- package/dist/Modal/demos/info.d.ts +0 -1
- package/dist/Modal/demos/locale.d.ts +0 -1
- package/dist/PageHeader/demos/basic.d.ts +0 -1
- package/dist/Pagination/demos/basic.d.ts +0 -1
- package/dist/Popconfirm/demos/basic.d.ts +0 -1
- package/dist/Popover/demos/basic.d.ts +0 -1
- package/dist/Popover/demos/basic1.d.ts +0 -1
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Progress/demos/basic.d.ts +0 -1
- package/dist/Progress/demos/circle.d.ts +0 -1
- package/dist/Progress/demos/dynamic.d.ts +0 -1
- package/dist/Progress/demos/small.d.ts +0 -1
- package/dist/QuickMenu/demos/basic.d.ts +0 -1
- package/dist/QuickMenu/demos/useInDraw.d.ts +0 -1
- package/dist/Rate/demos/basic.d.ts +0 -1
- package/dist/Result/demos/403.d.ts +0 -1
- package/dist/Result/demos/404.d.ts +0 -1
- package/dist/Result/demos/500.d.ts +0 -1
- package/dist/Result/demos/basic.d.ts +0 -1
- package/dist/Result/demos/customicon.d.ts +0 -1
- package/dist/Result/demos/error.d.ts +0 -1
- package/dist/Result/demos/info.d.ts +0 -1
- package/dist/Result/demos/success.d.ts +0 -1
- package/dist/Result/demos/warning.d.ts +0 -1
- package/dist/Result/noFound.d.ts +0 -1
- package/dist/Result/serverError.d.ts +0 -1
- package/dist/Result/unauthorized.d.ts +0 -1
- package/dist/Row/demos/basic.d.ts +0 -1
- package/dist/Segmented/demos/basic.d.ts +0 -1
- package/dist/Select/demos/basic.d.ts +0 -1
- package/dist/Select/demos/bordered.d.ts +0 -1
- package/dist/Select/demos/formItem.d.ts +0 -1
- package/dist/Skeleton/demos/basic.d.ts +0 -1
- package/dist/Slider/demos/basic.d.ts +0 -1
- package/dist/Space/demos/auto.d.ts +0 -1
- package/dist/Space/demos/basic.d.ts +0 -1
- package/dist/Space/demos/vertical.d.ts +0 -1
- package/dist/Spin/demos/basic.d.ts +0 -1
- package/dist/Spin/demos/size.d.ts +0 -1
- package/dist/Statistic/demos/basic.d.ts +0 -1
- package/dist/Steps/demos/basic.d.ts +0 -1
- package/dist/Switch/demos/basic.d.ts +0 -1
- package/dist/Switch/demos/table.d.ts +0 -1
- package/dist/Table/demos/basic.d.ts +0 -1
- package/dist/Tabs/demos/basic.d.ts +0 -1
- package/dist/Tabs/demos/nobroder.d.ts +0 -1
- package/dist/Tag/demos/CheckableTag.d.ts +0 -1
- package/dist/Tag/demos/ExigencyTag.d.ts +0 -1
- package/dist/Tag/demos/add.d.ts +0 -1
- package/dist/Tag/demos/basic.d.ts +0 -1
- package/dist/Tag/demos/border.d.ts +0 -1
- package/dist/Tag/demos/colors.d.ts +0 -1
- package/dist/Timeline/demos/basic.d.ts +0 -1
- package/dist/Tooltip/demos/basic.d.ts +0 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Transfer/demos/basic.d.ts +0 -1
- package/dist/Tree/demos/basic.d.ts +0 -1
- package/dist/Tree/demos/controlled.d.ts +0 -1
- package/dist/Tree/demos/search.d.ts +0 -1
- package/dist/Tree/demos/sort.d.ts +0 -1
- package/dist/Tree/utils/dropIndicator.d.ts +0 -1
- package/dist/TreeSelect/demos/basic.d.ts +0 -1
- package/dist/TreeSelect/demos/formItem.d.ts +0 -1
- package/dist/Typography/demos/basic.d.ts +0 -1
- package/dist/hooks/useFullscreen/demos/basic.d.ts +0 -1
- package/dist/hooks/useFullscreen/demos/useInModal.d.ts +0 -1
- package/dist/index.umd.css +1224 -650
- package/dist/index.umd.js +205586 -135230
- package/dist/index.umd.min.css +2 -2
- package/dist/index.umd.min.js +52 -24
- package/dist/locale-provider/index.d.ts +2 -2
- package/dist/message/demos/basic.d.ts +0 -1
- package/dist/message/demos/other.d.ts +0 -1
- package/dist/notification/demos/basic.d.ts +0 -1
- package/dist/notification/demos/button.d.ts +0 -1
- package/dist/notification/demos/icon.d.ts +0 -1
- package/dist/variables.css +2 -17
- package/es/Affix/index.js +90 -37
- package/es/Affix/utils.js +13 -6
- package/es/Alert/ErrorBoundary.js +15 -5
- package/es/Alert/index.js +64 -42
- package/es/Approval/handle.js +27 -10
- package/es/Approval/index.js +120 -63
- package/es/Approval/type.js +24 -0
- package/es/Approval/util.js +24 -4
- package/es/AutoComplete/index.js +20 -9
- package/es/Badge/Ribbon.js +16 -9
- package/es/Badge/ScrollNumber.js +28 -17
- package/es/Badge/SingleNumber.d.ts +0 -1
- package/es/Badge/SingleNumber.js +38 -23
- package/es/Badge/index.js +68 -44
- package/es/Badge/utils.js +2 -2
- package/es/Box/body/Item.js +3 -1
- package/es/Box/body/OverflowList.js +2 -2
- package/es/Box/wrapper/BoxContainer.js +12 -8
- package/es/Box/wrapper/BoxRoot.js +7 -5
- package/es/Box/wrapper/reducer.js +4 -2
- package/es/Button/index.js +17 -10
- package/es/ButtonTags/ButtonTags.js +15 -6
- package/es/ButtonTags/index.js +3 -0
- package/es/CardTable/LmCardTable.js +28 -19
- package/es/CardTable/body/TableBody.js +26 -17
- package/es/CardTable/body/TableBodyCell.js +17 -9
- package/es/CardTable/body/TableBodyRow.js +19 -13
- package/es/CardTable/card/PictureTextColumn.js +28 -18
- package/es/CardTable/card/PictureTextRow.js +31 -18
- package/es/CardTable/card/PictureTextRowOperate.js +30 -17
- package/es/CardTable/context.js +5 -0
- package/es/CardTable/empty.js +6 -1
- package/es/CardTable/fns/index.js +36 -22
- package/es/CardTable/footer.js +15 -4
- package/es/CardTable/hooks/usePagination.js +50 -35
- package/es/CardTable/index.js +5 -0
- package/es/CardTable/pager/TablePagination.js +15 -8
- package/es/CardTable/pager/index.js +13 -6
- package/es/CardTable/table/Table.js +6 -2
- package/es/CardTable/table/TableContainer.js +23 -14
- package/es/CardTable/table/TableRoot.js +65 -45
- package/es/CardTable/table/TableWrapper.js +9 -2
- package/es/CardTable/toolbar/ToolBarBottom.js +8 -3
- package/es/CardTable/utils.js +9 -3
- package/es/Cascader/index.js +21 -11
- package/es/Checkbox/index.js +18 -7
- package/es/ConfigProvider/DisabledContext.js +1 -1
- package/es/ConfigProvider/SizeContext.js +1 -1
- package/es/ConfigProvider/context.js +10 -4
- package/es/ConfigProvider/cssVariables.js +25 -16
- package/es/ConfigProvider/defaultRenderEmpty.js +6 -0
- package/es/ConfigProvider/index.js +55 -30
- package/es/CropImg/body/Operate.js +19 -10
- package/es/CropImg/body/index.js +8 -6
- package/es/CropImg/fns/index.js +11 -10
- package/es/CropImg/utils.js +45 -27
- package/es/CropImg/wrapper/Container.js +20 -9
- package/es/CropImg/wrapper/Root.js +16 -13
- package/es/CropImg/wrapper/Wrapper.js +2 -0
- package/es/CropImg/wrapper/reducer.js +9 -5
- package/es/CustomTableOption/cardSort.js +49 -24
- package/es/CustomTableOption/columnsSort.js +56 -22
- package/es/CustomTableOption/filterSort.js +48 -23
- package/es/CustomTableOption/index.js +31 -18
- package/es/CustomerService/components/question.js +20 -3
- package/es/CustomerService/index.js +46 -18
- package/es/DatePicker/PickerButton.d.ts +0 -1
- package/es/DatePicker/PickerTag.d.ts +0 -1
- package/es/DatePicker/generatePicker/generateRangePicker.js +33 -23
- package/es/DatePicker/generatePicker/generateSinglePicker.js +37 -22
- package/es/DatePicker/generatePicker/index.js +25 -12
- package/es/DatePicker/util.js +17 -0
- package/es/Descriptions/Cell.js +17 -11
- package/es/Descriptions/Item.js +1 -0
- package/es/Descriptions/Row.js +31 -24
- package/es/Descriptions/index.js +46 -27
- package/es/Divider/index.js +21 -12
- package/es/Drawer/index.js +11 -4
- package/es/Dropdown/index.js +40 -19
- package/es/EditTable/EditTable.js +171 -75
- package/es/EditTable/index.js +3 -0
- package/es/Empty/empty.js +4 -1
- package/es/Empty/index.js +22 -10
- package/es/Empty/simple.js +4 -1
- package/es/EnlargeImg/index.js +43 -17
- package/es/Filter/Popover.js +65 -29
- package/es/Filter/baseFilter/Popover.js +70 -28
- package/es/Filter/baseFilter/ToggleFilter.js +25 -9
- package/es/Filter/baseFilter/index.js +28 -8
- package/es/Filter/complex/ComplexFilter.js +47 -16
- package/es/Filter/complex/ComplexItem.js +47 -24
- package/es/Filter/components/Checkbox.js +34 -14
- package/es/Filter/components/Date.js +30 -10
- package/es/Filter/components/Input.js +23 -7
- package/es/Filter/components/Select.js +33 -13
- package/es/Filter/components/Tree.js +24 -8
- package/es/Filter/components/header.js +17 -3
- package/es/Filter/components/index.js +6 -0
- package/es/Filter/context.js +4 -0
- package/es/Filter/edit/editFilter.js +78 -41
- package/es/Filter/index.js +43 -21
- package/es/Filter/popContext.js +4 -0
- package/es/Filter/remember.js +41 -18
- package/es/Form/ErrorList.js +22 -16
- package/es/Form/Form.js +49 -27
- package/es/Form/FormItem/ItemHolder.js +42 -26
- package/es/Form/FormItem/index.js +103 -58
- package/es/Form/FormItemInput.js +16 -14
- package/es/Form/FormItemLabel.js +43 -24
- package/es/Form/FormList.js +11 -3
- package/es/Form/FormWrapper.js +4 -0
- package/es/Form/WrapperItem.js +70 -34
- package/es/Form/container.js +25 -12
- package/es/Form/context.js +5 -2
- package/es/Form/hooks/useDebounce.js +4 -3
- package/es/Form/hooks/useForm.js +7 -2
- package/es/Form/hooks/useFormInstance.js +2 -1
- package/es/Form/hooks/useFormItemStatus.js +4 -1
- package/es/Form/hooks/useFrameState.js +8 -3
- package/es/Form/hooks/useItemRef.js +6 -1
- package/es/Form/index.js +2 -0
- package/es/Form/style/index.css +0 -4
- package/es/Form/style/variables.css +0 -4
- package/es/Form/util.js +6 -2
- package/es/FullScreen/index.js +6 -3
- package/es/Grid/col.js +41 -21
- package/es/Grid/hooks/useBreakpoint.js +3 -0
- package/es/Grid/index.js +3 -2
- package/es/Grid/row.js +49 -31
- package/es/Icon/index.js +4 -0
- package/es/IconFont/font/iconfont.js +16 -10
- package/es/IconFont/index.js +4 -1
- package/es/IconSelect/index.js +29 -12
- package/es/ImageViewer/LmImageViewer.js +6 -0
- package/es/ImageViewer/components/Arrows.js +7 -1
- package/es/ImageViewer/components/Carousel.js +15 -13
- package/es/ImageViewer/components/Operate.js +4 -0
- package/es/ImageViewer/components/Thumb.js +10 -3
- package/es/ImageViewer/fns/index.js +26 -17
- package/es/ImageViewer/wrapeer/Container.js +5 -1
- package/es/ImageViewer/wrapeer/Root.js +19 -14
- package/es/ImageViewer/wrapeer/Wrapper.js +5 -1
- package/es/ImageViewer/wrapeer/reducer.js +13 -6
- package/es/Input/index.js +37 -30
- package/es/InputNumber/index.js +17 -9
- package/es/LeftTable/index.js +49 -25
- package/es/LmDrag/LmDrag.js +6 -0
- package/es/LmDrag/components/DndContainer.js +38 -22
- package/es/LmDrag/components/sortableBox.js +5 -4
- package/es/LmDrag/components/sortableItem.js +17 -13
- package/es/LmDrag/wrapper/Root.js +2 -0
- package/es/LmEditTable/DndContainer.js +12 -9
- package/es/LmEditTable/DragHandle.js +6 -4
- package/es/LmEditTable/EditTable.js +323 -158
- package/es/LmEditTable/sortableBox.js +3 -1
- package/es/LmEditTable/sortableBoxCol.js +3 -1
- package/es/LmEditTable/sortableItem.js +16 -9
- package/es/LmEditTable/sortableItemCol.d.ts +0 -1
- package/es/LmEditTable/sortableItemCol.js +14 -8
- package/es/LmEditTable/util.js +10 -2
- package/es/LmFilter/Controls/CheckboxTags.js +12 -2
- package/es/LmFilter/Controls/index.js +24 -10
- package/es/LmFilter/LmFilter.js +14 -4
- package/es/LmFilter/baseFilter/fuzzySearch.js +18 -8
- package/es/LmFilter/baseFilter/index.js +9 -3
- package/es/LmFilter/clearFilter/index.js +9 -2
- package/es/LmFilter/complexFilter/drawer.js +76 -47
- package/es/LmFilter/complexFilter/index.js +14 -2
- package/es/LmFilter/complexFilter/valueDrawer.js +46 -14
- package/es/LmFilter/components/CascaderFilter.js +52 -27
- package/es/LmFilter/components/CheckboxFilter.js +52 -39
- package/es/LmFilter/components/CustomSelectFilter.js +38 -20
- package/es/LmFilter/components/DateFilter.js +39 -23
- package/es/LmFilter/components/DropdownFIlter.js +82 -49
- package/es/LmFilter/components/EmptyFilter.js +5 -0
- package/es/LmFilter/components/InputFilter.js +13 -5
- package/es/LmFilter/components/InputSearchClose.js +22 -10
- package/es/LmFilter/components/SelectFilter.js +37 -21
- package/es/LmFilter/components/index.js +34 -23
- package/es/LmFilter/customFilter/drawer.js +72 -37
- package/es/LmFilter/customFilter/index.js +24 -11
- package/es/LmFilter/customFilter/saveModal.js +36 -12
- package/es/LmFilter/customFilter/valueDrawer.js +45 -14
- package/es/LmFilter/filterFns/index.js +196 -133
- package/es/LmFilter/hooks/index.js +2 -0
- package/es/LmFilter/hooks/useDelayedFn.js +5 -2
- package/es/LmFilter/index.js +3 -0
- package/es/LmFilter/localization.js +1 -2
- package/es/LmFilter/utils.js +47 -21
- package/es/LmFilter/wrapper/Filter.js +13 -4
- package/es/LmFilter/wrapper/FilterContainer.js +5 -1
- package/es/LmFilter/wrapper/FilterRoot.js +62 -40
- package/es/LmFilter/wrapper/FilterWrapper.js +5 -1
- package/es/LmImgList/body/Banner.js +17 -13
- package/es/LmImgList/body/Thumb.js +9 -4
- package/es/LmImgList/fns/index.js +23 -15
- package/es/LmImgList/wrapper/Container.js +13 -9
- package/es/LmImgList/wrapper/Root.js +16 -13
- package/es/LmImgList/wrapper/reducer.js +11 -6
- package/es/LmSelect/GhostSelect.js +150 -99
- package/es/LmSelect/NormalSelect.js +30 -20
- package/es/LmSelect/index.js +7 -1
- package/es/LmSelect/useCheckboxOptions.js +27 -17
- package/es/LmSelect/utils.js +22 -20
- package/es/LmTable/Table.js +525 -416
- package/es/LmTable/VList.js +170 -109
- package/es/LmTable/autosize.js +43 -16
- package/es/LmTable/chartUtil.js +14 -4
- package/es/LmTable/components/DndContainer.d.ts +5 -37
- package/es/LmTable/components/DndContainer.js +30 -630
- package/es/LmTable/components/customRenderEmpty.js +4 -1
- package/es/LmTable/components/inputDataEdit.js +8 -3
- package/es/LmTable/components/sheelTableCell.js +57 -32
- package/{lib/LmTable/components/SortableBox.js → es/LmTable/components/sortableBoxCol.js} +6 -1
- package/es/LmTable/components/sortableItemCol.js +56 -0
- package/es/LmTable/components/tableChartsModal.js +30 -23
- package/es/LmTable/context.js +3 -0
- package/es/LmTable/detectElementResize.js +48 -15
- package/es/LmTable/expression.d.ts +1 -2
- package/es/LmTable/expression.js +19 -75
- package/es/LmTable/hooks/useGroupDataSource.js +29 -2
- package/es/LmTable/hooks/useRowSelectControllableValue.js +20 -6
- package/es/LmTable/index.js +3 -0
- package/es/LmTable/resetConfig.js +8 -8
- package/es/LmTable/style/index.css +2 -13
- package/es/LmTable/style/variables.css +2 -13
- package/es/LmTable/util.js +93 -46
- package/es/LmTable/virTual/VirtualRow.js +26 -14
- package/es/LmTable/virTual/VirtualTable.js +12 -27
- package/es/LmTable/virTual/VirtualWrapper.js +14 -7
- package/es/LmTable/virTual/context.js +13 -4
- package/es/LmUpload/LmUpload.js +17 -11
- package/es/LmUpload/UploadList/ItemPicture.js +9 -8
- package/es/LmUpload/UploadList/ItemPictureCard.js +38 -23
- package/es/LmUpload/UploadList/ItemText.js +7 -5
- package/es/LmUpload/UploadList/RenderItem.js +7 -1
- package/es/LmUpload/UploadList/index.js +19 -11
- package/es/LmUpload/body/Progress.js +2 -0
- package/es/LmUpload/body/UploadCore.js +16 -10
- package/es/LmUpload/body/UploadPicture.js +5 -4
- package/es/LmUpload/components/Crop.js +5 -3
- package/es/LmUpload/components/Preview.js +10 -7
- package/es/LmUpload/fns/index.js +108 -57
- package/es/LmUpload/utils.js +15 -12
- package/es/LmUpload/view/index.js +2 -0
- package/es/LmUpload/wrapper/Upload.js +2 -0
- package/es/LmUpload/wrapper/UploadContainer.js +5 -1
- package/es/LmUpload/wrapper/UploadRoot.js +18 -13
- package/es/LmUpload/wrapper/UploadWrapper.js +2 -0
- package/es/LmUpload/wrapper/reducer.js +11 -6
- package/es/LoadingPage/index.js +7 -1
- package/es/Locale/ku_IQ.js +2 -2
- package/es/Modal/index.js +22 -8
- package/es/PageHeader/index.js +44 -22
- package/es/Pagination/index.js +13 -4
- package/es/Popover/index.d.ts +1 -1
- package/es/Popover/index.js +14 -5
- package/es/QuickMenu/index.js +45 -18
- package/es/Radio/index.js +20 -9
- package/es/Result/index.js +26 -16
- package/es/Result/noFound.js +2 -0
- package/es/Result/serverError.js +2 -0
- package/es/Result/unauthorized.js +2 -0
- package/es/Select/index.js +31 -20
- package/es/Switch/index.js +10 -3
- package/es/Tabs/TabPane.js +2 -0
- package/es/Tabs/hooks/useAnimateConfig.js +3 -0
- package/es/Tabs/hooks/useLegacyItems.js +12 -3
- package/es/Tabs/index.js +27 -15
- package/es/Tabs/index.old.js +11 -4
- package/es/Tag/index.js +13 -5
- package/es/Tooltip/index.d.ts +1 -1
- package/es/Tooltip/index.js +66 -34
- package/es/Tree/DirectoryTree.js +61 -31
- package/es/Tree/Tree.js +21 -14
- package/es/Tree/index.js +5 -1
- package/es/Tree/utils/dictUtil.js +21 -4
- package/es/Tree/utils/dropIndicator.d.ts +0 -1
- package/es/Tree/utils/dropIndicator.js +10 -5
- package/es/Tree/utils/iconUtil.js +13 -2
- package/es/TreeSelect/index.js +24 -15
- package/es/Typography/Base/Ellipsis.js +52 -25
- package/es/Typography/Base/EllipsisTooltip.js +8 -3
- package/es/Typography/Base/index.js +173 -104
- package/es/Typography/Editable.js +34 -21
- package/es/Typography/Link.js +11 -4
- package/es/Typography/Paragraph.js +2 -0
- package/es/Typography/Text.js +9 -1
- package/es/Typography/Title.js +10 -2
- package/es/Typography/Typography.js +23 -11
- package/es/Typography/hooks/useUpdatedEffect.js +1 -0
- package/es/Upload/index.js +6 -2
- package/es/UploadOss/index.js +4 -0
- package/es/UploadOss/uploadBtn.js +54 -32
- package/es/UploadOss/uploadImg.js +86 -58
- package/es/VirtualList/index.js +27 -18
- package/es/_util/colors.js +2 -2
- package/es/_util/domTarget.js +3 -0
- package/es/_util/getDataOrAriaProps.js +1 -0
- package/es/_util/getRenderPropValue.js +3 -0
- package/es/_util/hooks/useFlexGapSupport.js +4 -3
- package/es/_util/hooks/useForceUpdate.js +5 -4
- package/es/_util/motion.js +11 -2
- package/es/_util/placements.js +8 -7
- package/es/_util/responsiveObserve.js +5 -0
- package/es/_util/statusUtils.js +1 -0
- package/es/_util/styleChecker.js +9 -6
- package/es/_util/throttleByAnimationFrame.js +6 -0
- package/es/_util/transButton.js +15 -3
- package/es/_util/type.js +2 -0
- package/es/_util/warning.js +6 -4
- package/es/hooks/useEvent/index.js +7 -6
- package/es/hooks/useFullscreen/index.js +29 -7
- package/es/locale-provider/LocaleReceiver.js +12 -4
- package/es/locale-provider/index.d.ts +2 -2
- package/es/locale-provider/index.js +11 -2
- package/es/message/hooks/useMessage.js +17 -8
- package/es/message/index.js +36 -8
- package/es/notification/hooks/useNotification.js +12 -8
- package/es/notification/index.js +67 -31
- package/es/services/newRequest.js +47 -18
- package/es/services/utils.js +15 -0
- package/es/styles/variables.css +2 -17
- package/lib/Affix/index.js +104 -37
- package/lib/Affix/utils.js +22 -6
- package/lib/Alert/ErrorBoundary.js +21 -5
- package/lib/Alert/index.js +78 -42
- package/lib/Approval/handle.js +37 -10
- package/lib/Approval/index.js +131 -63
- package/lib/Approval/type.js +24 -0
- package/lib/Approval/util.js +30 -4
- package/lib/AutoComplete/index.js +34 -10
- package/lib/Avatar/index.js +4 -0
- package/lib/Badge/Ribbon.js +23 -9
- package/lib/Badge/ScrollNumber.js +35 -17
- package/lib/Badge/SingleNumber.d.ts +0 -1
- package/lib/Badge/SingleNumber.js +43 -23
- package/lib/Badge/index.js +79 -44
- package/lib/Badge/utils.js +2 -0
- package/lib/Box/LmBox.js +5 -0
- package/lib/Box/body/Item.js +7 -1
- package/lib/Box/body/List.js +6 -0
- package/lib/Box/body/OverflowList.js +4 -0
- package/lib/Box/index.js +3 -0
- package/lib/Box/wrapper/BoxContainer.js +19 -8
- package/lib/Box/wrapper/BoxRoot.js +14 -5
- package/lib/Box/wrapper/BoxWrapper.js +5 -0
- package/lib/Box/wrapper/reducer.js +8 -2
- package/lib/Breadcrumb/index.js +4 -0
- package/lib/Button/index.js +25 -10
- package/lib/ButtonTags/ButtonTags.js +15 -6
- package/lib/ButtonTags/index.js +3 -0
- package/lib/Calendar/index.js +4 -0
- package/lib/Card/index.js +4 -0
- package/lib/CardTable/LmCardTable.js +28 -19
- package/lib/CardTable/body/TableBody.js +26 -17
- package/lib/CardTable/body/TableBodyCell.js +17 -9
- package/lib/CardTable/body/TableBodyRow.js +19 -13
- package/lib/CardTable/card/PictureTextColumn.js +28 -18
- package/lib/CardTable/card/PictureTextRow.js +31 -18
- package/lib/CardTable/card/PictureTextRowOperate.js +30 -17
- package/lib/CardTable/context.js +5 -0
- package/lib/CardTable/empty.js +6 -1
- package/lib/CardTable/fns/index.js +36 -22
- package/lib/CardTable/footer.js +15 -4
- package/lib/CardTable/hooks/usePagination.js +50 -35
- package/lib/CardTable/index.js +5 -0
- package/lib/CardTable/pager/TablePagination.js +15 -8
- package/lib/CardTable/pager/index.js +13 -6
- package/lib/CardTable/table/Table.js +6 -2
- package/lib/CardTable/table/TableContainer.js +23 -14
- package/lib/CardTable/table/TableRoot.js +65 -45
- package/lib/CardTable/table/TableWrapper.js +9 -2
- package/lib/CardTable/toolbar/ToolBarBottom.js +8 -3
- package/lib/CardTable/utils.js +9 -3
- package/lib/Carousel/index.js +4 -0
- package/lib/Cascader/index.js +30 -11
- package/lib/Checkbox/index.js +18 -7
- package/lib/Col/index.js +2 -0
- package/lib/Collapse/index.js +4 -0
- package/lib/Comment/index.js +4 -0
- package/lib/ConfigProvider/DisabledContext.js +6 -1
- package/lib/ConfigProvider/SizeContext.js +6 -1
- package/lib/ConfigProvider/context.js +13 -4
- package/lib/ConfigProvider/cssVariables.js +34 -17
- package/lib/ConfigProvider/defaultRenderEmpty.js +12 -0
- package/lib/ConfigProvider/index.js +75 -30
- package/lib/CropImg/LmCropImg.js +5 -0
- package/lib/CropImg/body/Operate.js +23 -10
- package/lib/CropImg/body/index.js +13 -6
- package/lib/CropImg/fns/index.js +12 -8
- package/lib/CropImg/index.js +3 -0
- package/lib/CropImg/utils.js +45 -27
- package/lib/CropImg/wrapper/Container.js +26 -7
- package/lib/CropImg/wrapper/Root.js +24 -13
- package/lib/CropImg/wrapper/Wrapper.js +6 -0
- package/lib/CropImg/wrapper/reducer.js +12 -5
- package/lib/CustomTableOption/cardSort.js +60 -24
- package/lib/CustomTableOption/columnsSort.js +67 -22
- package/lib/CustomTableOption/filterSort.js +59 -23
- package/lib/CustomTableOption/index.js +44 -18
- package/lib/CustomerService/components/question.js +20 -3
- package/lib/CustomerService/index.js +46 -18
- package/lib/DatePicker/PickerButton.d.ts +0 -1
- package/lib/DatePicker/PickerButton.js +4 -0
- package/lib/DatePicker/PickerTag.d.ts +0 -1
- package/lib/DatePicker/PickerTag.js +4 -0
- package/lib/DatePicker/generatePicker/generateRangePicker.js +52 -23
- package/lib/DatePicker/generatePicker/generateSinglePicker.js +56 -22
- package/lib/DatePicker/generatePicker/index.js +33 -12
- package/lib/DatePicker/index.js +6 -0
- package/lib/DatePicker/util.js +20 -0
- package/lib/Descriptions/Cell.js +22 -11
- package/lib/Descriptions/Item.js +2 -0
- package/lib/Descriptions/Row.js +36 -24
- package/lib/Descriptions/index.js +61 -28
- package/lib/Divider/index.js +28 -12
- package/lib/Drawer/index.js +16 -4
- package/lib/Dropdown/index.js +48 -19
- package/lib/EditTable/EditTable.js +171 -75
- package/lib/EditTable/index.js +3 -0
- package/lib/Empty/empty.js +7 -1
- package/lib/Empty/index.js +33 -10
- package/lib/Empty/simple.js +7 -1
- package/lib/EnlargeImg/index.js +43 -17
- package/lib/Filter/Popover.js +65 -29
- package/lib/Filter/baseFilter/Popover.js +70 -28
- package/lib/Filter/baseFilter/ToggleFilter.js +25 -9
- package/lib/Filter/baseFilter/index.js +28 -8
- package/lib/Filter/complex/ComplexFilter.js +47 -16
- package/lib/Filter/complex/ComplexItem.js +47 -24
- package/lib/Filter/components/Checkbox.js +34 -14
- package/lib/Filter/components/Date.js +30 -10
- package/lib/Filter/components/Input.js +23 -7
- package/lib/Filter/components/Select.js +33 -13
- package/lib/Filter/components/Tree.js +24 -8
- package/lib/Filter/components/header.js +17 -3
- package/lib/Filter/components/index.js +6 -0
- package/lib/Filter/context.js +4 -0
- package/lib/Filter/edit/editFilter.js +78 -41
- package/lib/Filter/index.js +43 -21
- package/lib/Filter/popContext.js +4 -0
- package/lib/Filter/remember.js +41 -18
- package/lib/Form/ErrorList.js +34 -16
- package/lib/Form/Form.js +62 -27
- package/lib/Form/FormItem/ItemHolder.js +60 -26
- package/lib/Form/FormItem/index.js +122 -58
- package/lib/Form/FormItemInput.js +23 -14
- package/lib/Form/FormItemLabel.js +55 -24
- package/lib/Form/FormList.js +18 -3
- package/lib/Form/FormWrapper.js +8 -0
- package/lib/Form/WrapperItem.js +79 -34
- package/lib/Form/container.js +32 -12
- package/lib/Form/context.js +15 -2
- package/lib/Form/hooks/useDebounce.js +9 -3
- package/lib/Form/hooks/useForm.js +14 -2
- package/lib/Form/hooks/useFormInstance.js +5 -1
- package/lib/Form/hooks/useFormItemStatus.js +8 -1
- package/lib/Form/hooks/useFrameState.js +16 -3
- package/lib/Form/hooks/useItemRef.js +13 -1
- package/lib/Form/index.js +13 -0
- package/lib/Form/style/index.css +0 -4
- package/lib/Form/style/variables.css +0 -4
- package/lib/Form/util.js +9 -2
- package/lib/FullScreen/index.js +10 -3
- package/lib/Grid/RowContext.js +2 -0
- package/lib/Grid/col.js +48 -21
- package/lib/Grid/hooks/useBreakpoint.js +8 -0
- package/lib/Grid/index.js +7 -0
- package/lib/Grid/row.js +62 -31
- package/lib/Icon/index.js +4 -0
- package/lib/IconFont/font/iconfont.js +16 -10
- package/lib/IconFont/index.js +11 -1
- package/lib/IconSelect/index.js +29 -12
- package/lib/Image/index.js +4 -0
- package/lib/ImageViewer/LmImageViewer.js +11 -0
- package/lib/ImageViewer/components/Arrows.js +10 -1
- package/lib/ImageViewer/components/Carousel.js +18 -13
- package/lib/ImageViewer/components/Operate.js +7 -0
- package/lib/ImageViewer/components/Thumb.js +15 -3
- package/lib/ImageViewer/fns/index.js +27 -17
- package/lib/ImageViewer/index.js +3 -0
- package/lib/ImageViewer/wrapeer/Container.js +12 -2
- package/lib/ImageViewer/wrapeer/Root.js +27 -15
- package/lib/ImageViewer/wrapeer/Wrapper.js +9 -2
- package/lib/ImageViewer/wrapeer/reducer.js +16 -6
- package/lib/Input/index.js +49 -30
- package/lib/InputNumber/index.js +26 -9
- package/lib/Layout/index.js +4 -0
- package/lib/LeftTable/index.js +49 -25
- package/lib/List/index.js +4 -0
- package/lib/LmDrag/LmDrag.js +11 -0
- package/lib/LmDrag/components/DndContainer.js +47 -22
- package/lib/LmDrag/components/sortableBox.js +9 -2
- package/lib/LmDrag/components/sortableItem.js +22 -13
- package/lib/LmDrag/index.js +3 -0
- package/lib/LmDrag/wrapper/Root.js +7 -0
- package/lib/LmEditTable/DndContainer.js +16 -7
- package/lib/LmEditTable/DragHandle.js +12 -4
- package/lib/LmEditTable/EditTable.js +348 -158
- package/lib/LmEditTable/index.js +3 -0
- package/lib/LmEditTable/sortableBox.js +6 -1
- package/lib/LmEditTable/sortableBoxCol.js +6 -1
- package/lib/LmEditTable/sortableItem.js +20 -9
- package/lib/LmEditTable/sortableItemCol.d.ts +0 -1
- package/lib/LmEditTable/sortableItemCol.js +20 -8
- package/lib/LmEditTable/util.js +19 -2
- package/lib/LmFilter/Controls/CheckboxTags.js +12 -2
- package/lib/LmFilter/Controls/index.js +24 -10
- package/lib/LmFilter/LmFilter.js +14 -4
- package/lib/LmFilter/baseFilter/fuzzySearch.js +18 -8
- package/lib/LmFilter/baseFilter/index.js +9 -3
- package/lib/LmFilter/clearFilter/index.js +9 -2
- package/lib/LmFilter/complexFilter/drawer.js +76 -47
- package/lib/LmFilter/complexFilter/index.js +14 -2
- package/lib/LmFilter/complexFilter/valueDrawer.js +46 -14
- package/lib/LmFilter/components/CascaderFilter.js +52 -27
- package/lib/LmFilter/components/CheckboxFilter.js +52 -39
- package/lib/LmFilter/components/CustomSelectFilter.js +38 -20
- package/lib/LmFilter/components/DateFilter.js +39 -23
- package/lib/LmFilter/components/DropdownFIlter.js +82 -49
- package/lib/LmFilter/components/EmptyFilter.js +5 -0
- package/lib/LmFilter/components/InputFilter.js +13 -5
- package/lib/LmFilter/components/InputSearchClose.js +22 -10
- package/lib/LmFilter/components/SelectFilter.js +37 -21
- package/lib/LmFilter/components/index.js +34 -23
- package/lib/LmFilter/customFilter/drawer.js +72 -37
- package/lib/LmFilter/customFilter/index.js +24 -11
- package/lib/LmFilter/customFilter/saveModal.js +36 -12
- package/lib/LmFilter/customFilter/valueDrawer.js +45 -14
- package/lib/LmFilter/filterFns/index.js +202 -131
- package/lib/LmFilter/hooks/index.js +2 -0
- package/lib/LmFilter/hooks/useDelayedFn.js +5 -2
- package/lib/LmFilter/index.js +3 -0
- package/lib/LmFilter/localization.js +1 -2
- package/lib/LmFilter/utils.js +47 -21
- package/lib/LmFilter/wrapper/Filter.js +13 -4
- package/lib/LmFilter/wrapper/FilterContainer.js +5 -1
- package/lib/LmFilter/wrapper/FilterRoot.js +62 -40
- package/lib/LmFilter/wrapper/FilterWrapper.js +5 -1
- package/lib/LmImgList/LmImgList.js +5 -0
- package/lib/LmImgList/body/Banner.js +22 -13
- package/lib/LmImgList/body/Thumb.js +16 -4
- package/lib/LmImgList/fns/index.js +24 -15
- package/lib/LmImgList/index.js +4 -0
- package/lib/LmImgList/wrapper/Container.js +21 -9
- package/lib/LmImgList/wrapper/Root.js +24 -13
- package/lib/LmImgList/wrapper/Wrapper.js +5 -0
- package/lib/LmImgList/wrapper/reducer.js +14 -6
- package/lib/LmSelect/GhostSelect.js +163 -99
- package/lib/LmSelect/NormalSelect.js +40 -20
- package/lib/LmSelect/index.js +14 -1
- package/lib/LmSelect/useCheckboxOptions.js +37 -17
- package/lib/LmSelect/utils.js +38 -18
- package/lib/LmTable/Table.js +525 -416
- package/lib/LmTable/VList.js +170 -109
- package/lib/LmTable/autosize.js +43 -16
- package/lib/LmTable/chartUtil.js +14 -4
- package/lib/LmTable/components/DndContainer.d.ts +5 -37
- package/lib/LmTable/components/DndContainer.js +36 -628
- package/lib/LmTable/components/customRenderEmpty.js +8 -1
- package/lib/LmTable/components/inputDataEdit.js +11 -3
- package/lib/LmTable/components/sheelTableCell.js +65 -32
- package/{es/LmTable/components/SortableBox.js → lib/LmTable/components/sortableBoxCol.js} +6 -1
- package/lib/LmTable/components/sortableItemCol.js +56 -0
- package/lib/LmTable/components/tableChartsModal.js +26 -12
- package/lib/LmTable/context.js +3 -0
- package/lib/LmTable/detectElementResize.js +48 -15
- package/lib/LmTable/expression.d.ts +1 -2
- package/lib/LmTable/expression.js +23 -78
- package/lib/LmTable/hooks/useGroupDataSource.js +29 -2
- package/lib/LmTable/hooks/useRowSelectControllableValue.js +20 -6
- package/lib/LmTable/index.js +3 -0
- package/lib/LmTable/resetConfig.js +8 -8
- package/lib/LmTable/style/index.css +2 -13
- package/lib/LmTable/style/variables.css +2 -13
- package/lib/LmTable/util.js +93 -46
- package/lib/LmTable/virTual/VirtualRow.js +31 -14
- package/lib/LmTable/virTual/VirtualTable.js +20 -27
- package/lib/LmTable/virTual/VirtualWrapper.js +19 -7
- package/lib/LmTable/virTual/context.js +13 -2
- package/lib/LmTable/virTual/index.js +4 -0
- package/lib/LmUpload/LmUpload.js +25 -11
- package/lib/LmUpload/UploadList/ItemPicture.js +13 -6
- package/lib/LmUpload/UploadList/ItemPictureCard.js +44 -23
- package/lib/LmUpload/UploadList/ItemText.js +12 -5
- package/lib/LmUpload/UploadList/RenderItem.js +14 -1
- package/lib/LmUpload/UploadList/index.js +26 -11
- package/lib/LmUpload/body/Progress.js +5 -0
- package/lib/LmUpload/body/UploadCore.js +22 -8
- package/lib/LmUpload/body/UploadPicture.js +10 -2
- package/lib/LmUpload/components/Crop.js +9 -3
- package/lib/LmUpload/components/Preview.js +14 -7
- package/lib/LmUpload/fns/index.js +114 -57
- package/lib/LmUpload/index.js +3 -0
- package/lib/LmUpload/utils.js +24 -10
- package/lib/LmUpload/view/index.js +4 -0
- package/lib/LmUpload/wrapper/Upload.js +6 -1
- package/lib/LmUpload/wrapper/UploadContainer.js +11 -2
- package/lib/LmUpload/wrapper/UploadRoot.js +26 -14
- package/lib/LmUpload/wrapper/UploadWrapper.js +9 -1
- package/lib/LmUpload/wrapper/reducer.js +15 -6
- package/lib/LoadingPage/index.js +7 -1
- package/lib/Locale/ar_EG.js +6 -1
- package/lib/Locale/az_AZ.js +6 -1
- package/lib/Locale/bg_BG.js +6 -0
- package/lib/Locale/bn_BD.js +6 -1
- package/lib/Locale/by_BY.js +6 -1
- package/lib/Locale/ca_ES.js +6 -1
- package/lib/Locale/cs_CZ.js +6 -1
- package/lib/Locale/da_DK.js +6 -0
- package/lib/Locale/de_DE.js +6 -1
- package/lib/Locale/default.js +7 -1
- package/lib/Locale/el_GR.js +6 -0
- package/lib/Locale/en_GB.js +6 -1
- package/lib/Locale/en_US.js +3 -0
- package/lib/Locale/es_ES.js +6 -1
- package/lib/Locale/et_EE.js +6 -1
- package/lib/Locale/fa_IR.js +6 -1
- package/lib/Locale/fi_FI.js +6 -0
- package/lib/Locale/fr_BE.js +6 -0
- package/lib/Locale/fr_CA.js +6 -0
- package/lib/Locale/fr_FR.js +6 -1
- package/lib/Locale/ga_IE.js +6 -1
- package/lib/Locale/gl_ES.js +6 -1
- package/lib/Locale/he_IL.js +6 -1
- package/lib/Locale/hi_IN.js +6 -1
- package/lib/Locale/hr_HR.js +6 -1
- package/lib/Locale/hu_HU.js +6 -0
- package/lib/Locale/id_ID.js +6 -0
- package/lib/Locale/is_IS.js +6 -0
- package/lib/Locale/it_IT.js +6 -0
- package/lib/Locale/ja_JP.js +6 -1
- package/lib/Locale/ka_GE.js +6 -1
- package/lib/Locale/kk_KZ.js +6 -1
- package/lib/Locale/km_KH.js +6 -1
- package/lib/Locale/kmr_IQ.js +6 -0
- package/lib/Locale/kn_IN.js +6 -0
- package/lib/Locale/ko_KR.js +6 -1
- package/lib/Locale/ku_IQ.js +6 -0
- package/lib/Locale/lt_LT.js +6 -1
- package/lib/Locale/lv_LV.js +6 -0
- package/lib/Locale/mk_MK.js +6 -0
- package/lib/Locale/ml_IN.js +6 -1
- package/lib/Locale/mn_MN.js +6 -0
- package/lib/Locale/ms_MY.js +6 -0
- package/lib/Locale/nb_NO.js +6 -1
- package/lib/Locale/ne_NP.js +6 -0
- package/lib/Locale/nl_BE.js +6 -1
- package/lib/Locale/nl_NL.js +6 -1
- package/lib/Locale/pl_PL.js +6 -1
- package/lib/Locale/pt_BR.js +6 -1
- package/lib/Locale/pt_PT.js +6 -0
- package/lib/Locale/ro_RO.js +6 -1
- package/lib/Locale/ru_RU.js +6 -1
- package/lib/Locale/si_LK.js +6 -1
- package/lib/Locale/sk_SK.js +6 -1
- package/lib/Locale/sl_SI.js +6 -0
- package/lib/Locale/sr_RS.js +6 -1
- package/lib/Locale/sv_SE.js +6 -1
- package/lib/Locale/ta_IN.js +6 -0
- package/lib/Locale/th_TH.js +6 -1
- package/lib/Locale/tk_TK.js +6 -1
- package/lib/Locale/tr_TR.js +6 -1
- package/lib/Locale/uk_UA.js +6 -1
- package/lib/Locale/ur_PK.js +6 -1
- package/lib/Locale/vi_VN.js +6 -0
- package/lib/Locale/zh_CN.js +7 -1
- package/lib/Locale/zh_HK.js +6 -1
- package/lib/Locale/zh_TW.js +6 -1
- package/lib/Mentions/index.js +4 -0
- package/lib/Menu/index.js +4 -0
- package/lib/Modal/index.js +33 -8
- package/lib/Modal/locale.js +5 -0
- package/lib/PageHeader/index.js +60 -22
- package/lib/Pagination/index.js +20 -4
- package/lib/Popconfirm/index.js +4 -0
- package/lib/Popover/index.d.ts +1 -1
- package/lib/Popover/index.js +23 -5
- package/lib/Progress/index.js +4 -0
- package/lib/QuickMenu/index.js +54 -18
- package/lib/Radio/index.js +20 -9
- package/lib/Rate/index.js +4 -0
- package/lib/Result/index.js +41 -16
- package/lib/Result/noFound.js +4 -0
- package/lib/Result/serverError.js +4 -0
- package/lib/Result/unauthorized.js +4 -0
- package/lib/Row/index.js +2 -0
- package/lib/Segmented/index.js +4 -0
- package/lib/Select/index.js +41 -20
- package/lib/Skeleton/index.js +4 -0
- package/lib/Slider/index.js +4 -0
- package/lib/Space/index.js +4 -0
- package/lib/Spin/index.js +4 -0
- package/lib/Statistic/index.js +4 -0
- package/lib/Steps/index.js +4 -0
- package/lib/Switch/index.js +15 -3
- package/lib/Table/index.js +4 -0
- package/lib/Tabs/TabPane.js +3 -0
- package/lib/Tabs/hooks/useAnimateConfig.js +8 -0
- package/lib/Tabs/hooks/useLegacyItems.js +17 -3
- package/lib/Tabs/index.js +43 -15
- package/lib/Tabs/index.old.js +17 -4
- package/lib/Tag/index.js +20 -5
- package/lib/TestTable/LmBox.js +3 -0
- package/lib/TestTable/index.js +3 -0
- package/lib/TimePicker/index.js +4 -0
- package/lib/Timeline/index.js +4 -0
- package/lib/Tooltip/index.d.ts +1 -1
- package/lib/Tooltip/index.js +80 -34
- package/lib/Transfer/index.js +4 -0
- package/lib/Tree/DirectoryTree.js +74 -29
- package/lib/Tree/Tree.js +35 -14
- package/lib/Tree/TreeIndex.js +3 -0
- package/lib/Tree/index.js +11 -1
- package/lib/Tree/utils/dictUtil.js +24 -4
- package/lib/Tree/utils/dropIndicator.d.ts +0 -1
- package/lib/Tree/utils/dropIndicator.js +15 -5
- package/lib/Tree/utils/iconUtil.js +25 -2
- package/lib/TreeSelect/index.js +35 -15
- package/lib/Typography/Base/Ellipsis.js +58 -25
- package/lib/Typography/Base/EllipsisTooltip.js +12 -3
- package/lib/Typography/Base/index.js +200 -104
- package/lib/Typography/Editable.js +45 -21
- package/lib/Typography/Link.js +17 -4
- package/lib/Typography/Paragraph.js +7 -0
- package/lib/Typography/Text.js +16 -1
- package/lib/Typography/Title.js +18 -2
- package/lib/Typography/Typography.js +30 -11
- package/lib/Typography/hooks/useMergedConfig.js +5 -0
- package/lib/Typography/hooks/useUpdatedEffect.js +6 -1
- package/lib/Typography/index.js +9 -0
- package/lib/Upload/index.js +13 -2
- package/lib/UploadOss/index.js +4 -0
- package/lib/UploadOss/uploadBtn.js +54 -32
- package/lib/UploadOss/uploadImg.js +86 -58
- package/lib/VirtualList/index.js +27 -18
- package/lib/_util/colors.js +4 -2
- package/lib/_util/domTarget.js +6 -0
- package/lib/_util/getDataOrAriaProps.js +2 -0
- package/lib/_util/getRenderPropValue.js +5 -0
- package/lib/_util/hooks/useFlexGapSupport.js +11 -3
- package/lib/_util/hooks/useForceUpdate.js +10 -4
- package/lib/_util/motion.js +12 -0
- package/lib/_util/placements.js +12 -7
- package/lib/_util/reactNode.js +5 -0
- package/lib/_util/responsiveObserve.js +8 -0
- package/lib/_util/statusUtils.js +9 -0
- package/lib/_util/styleChecker.js +16 -6
- package/lib/_util/throttleByAnimationFrame.js +12 -0
- package/lib/_util/transButton.js +19 -3
- package/lib/_util/type.js +6 -0
- package/lib/_util/warning.js +10 -4
- package/lib/hooks/index.js +3 -0
- package/lib/hooks/useEvent/index.js +7 -4
- package/lib/hooks/useFullscreen/index.js +33 -7
- package/lib/index.js +89 -0
- package/lib/locale-provider/LocaleReceiver.js +20 -4
- package/lib/locale-provider/ar_EG.js +3 -0
- package/lib/locale-provider/az_AZ.js +3 -0
- package/lib/locale-provider/bg_BG.js +3 -0
- package/lib/locale-provider/bn_BD.js +3 -0
- package/lib/locale-provider/by_BY.js +3 -0
- package/lib/locale-provider/ca_ES.js +3 -0
- package/lib/locale-provider/context.js +2 -0
- package/lib/locale-provider/cs_CZ.js +3 -0
- package/lib/locale-provider/da_DK.js +3 -0
- package/lib/locale-provider/de_DE.js +3 -0
- package/lib/locale-provider/default.js +3 -0
- package/lib/locale-provider/el_GR.js +3 -0
- package/lib/locale-provider/en_GB.js +3 -0
- package/lib/locale-provider/en_US.js +3 -0
- package/lib/locale-provider/es_ES.js +3 -0
- package/lib/locale-provider/et_EE.js +3 -0
- package/lib/locale-provider/fa_IR.js +3 -0
- package/lib/locale-provider/fi_FI.js +3 -0
- package/lib/locale-provider/fr_BE.js +3 -0
- package/lib/locale-provider/fr_CA.js +3 -0
- package/lib/locale-provider/fr_FR.js +3 -0
- package/lib/locale-provider/ga_IE.js +3 -0
- package/lib/locale-provider/gl_ES.js +3 -0
- package/lib/locale-provider/he_IL.js +3 -0
- package/lib/locale-provider/hi_IN.js +3 -0
- package/lib/locale-provider/hr_HR.js +3 -0
- package/lib/locale-provider/hu_HU.js +3 -0
- package/lib/locale-provider/hy_AM.js +3 -0
- package/lib/locale-provider/id_ID.js +3 -0
- package/lib/locale-provider/index.d.ts +2 -2
- package/lib/locale-provider/index.js +21 -2
- package/lib/locale-provider/is_IS.js +3 -0
- package/lib/locale-provider/it_IT.js +3 -0
- package/lib/locale-provider/ja_JP.js +3 -0
- package/lib/locale-provider/ka_GE.js +3 -0
- package/lib/locale-provider/kk_KZ.js +3 -0
- package/lib/locale-provider/km_KH.js +3 -0
- package/lib/locale-provider/kmr_IQ.js +3 -0
- package/lib/locale-provider/kn_IN.js +3 -0
- package/lib/locale-provider/ko_KR.js +3 -0
- package/lib/locale-provider/ku_IQ.js +3 -0
- package/lib/locale-provider/lt_LT.js +3 -0
- package/lib/locale-provider/lv_LV.js +3 -0
- package/lib/locale-provider/mk_MK.js +3 -0
- package/lib/locale-provider/ml_IN.js +3 -0
- package/lib/locale-provider/mn_MN.js +3 -0
- package/lib/locale-provider/ms_MY.js +3 -0
- package/lib/locale-provider/nb_NO.js +3 -0
- package/lib/locale-provider/ne_NP.js +3 -0
- package/lib/locale-provider/nl_BE.js +3 -0
- package/lib/locale-provider/nl_NL.js +3 -0
- package/lib/locale-provider/pl_PL.js +3 -0
- package/lib/locale-provider/pt_BR.js +3 -0
- package/lib/locale-provider/pt_PT.js +3 -0
- package/lib/locale-provider/ro_RO.js +3 -0
- package/lib/locale-provider/ru_RU.js +3 -0
- package/lib/locale-provider/si_LK.js +3 -0
- package/lib/locale-provider/sk_SK.js +3 -0
- package/lib/locale-provider/sl_SI.js +3 -0
- package/lib/locale-provider/sr_RS.js +3 -0
- package/lib/locale-provider/sv_SE.js +3 -0
- package/lib/locale-provider/ta_IN.js +3 -0
- package/lib/locale-provider/th_TH.js +3 -0
- package/lib/locale-provider/tk_TK.js +3 -0
- package/lib/locale-provider/tr_TR.js +3 -0
- package/lib/locale-provider/uk_UA.js +3 -0
- package/lib/locale-provider/ur_PK.js +3 -0
- package/lib/locale-provider/vi_VN.js +3 -0
- package/lib/locale-provider/zh_CN.js +3 -0
- package/lib/locale-provider/zh_HK.js +3 -0
- package/lib/locale-provider/zh_TW.js +3 -0
- package/lib/message/hooks/useMessage.js +27 -8
- package/lib/message/index.js +53 -8
- package/lib/notification/hooks/useNotification.js +19 -8
- package/lib/notification/index.js +80 -31
- package/lib/services/newRequest.js +47 -18
- package/lib/services/utils.js +15 -0
- package/lib/styles/variables.css +2 -17
- package/package.json +1 -1
- package/dist/LmTable/common/index.d.ts +0 -10
- package/dist/LmTable/components/CalcExpression.d.ts +0 -9
- package/dist/LmTable/components/Container/Container.d.ts +0 -20
- package/dist/LmTable/components/Container/index.d.ts +0 -2
- package/dist/LmTable/components/HeaderCol.d.ts +0 -1
- package/dist/LmTable/components/Item/Item.d.ts +0 -37
- package/dist/LmTable/components/Item/components/Action/Action.d.ts +0 -10
- package/dist/LmTable/components/Item/components/Action/index.d.ts +0 -2
- package/dist/LmTable/components/Item/components/Handle/index.d.ts +0 -4
- package/dist/LmTable/components/Item/components/Remove/index.d.ts +0 -3
- package/dist/LmTable/components/Item/components/index.d.ts +0 -3
- package/dist/LmTable/components/Item/index.d.ts +0 -2
- package/dist/LmTable/demos/resize.d.ts +0 -2
- package/dist/LmTable/hooks/useDndItems.d.ts +0 -13
- package/dist/LmTable/hooks/useResizeObserver.d.ts +0 -13
- package/dist/LmTable/multipleContainersKeyboardCoordinates.d.ts +0 -3
- package/dist/LmTable/testDemos/group.d.ts +0 -2
- package/es/LmTable/common/index.d.ts +0 -10
- package/es/LmTable/common/index.js +0 -32
- package/es/LmTable/components/CalcExpression.d.ts +0 -9
- package/es/LmTable/components/CalcExpression.js +0 -120
- package/es/LmTable/components/Container/Container.css +0 -94
- package/es/LmTable/components/Container/Container.d.ts +0 -20
- package/es/LmTable/components/Container/Container.js +0 -48
- package/es/LmTable/components/Container/index.d.ts +0 -2
- package/es/LmTable/components/Container/index.js +0 -1
- package/es/LmTable/components/HeaderCol.js +0 -52
- package/es/LmTable/components/Item/Item.css +0 -113
- package/es/LmTable/components/Item/Item.d.ts +0 -37
- package/es/LmTable/components/Item/Item.js +0 -84
- package/es/LmTable/components/Item/components/Action/Action.css +0 -41
- package/es/LmTable/components/Item/components/Action/Action.d.ts +0 -10
- package/es/LmTable/components/Item/components/Action/Action.js +0 -31
- package/es/LmTable/components/Item/components/Action/index.d.ts +0 -2
- package/es/LmTable/components/Item/components/Action/index.js +0 -1
- package/es/LmTable/components/Item/components/Handle/index.d.ts +0 -4
- package/es/LmTable/components/Item/components/Handle/index.js +0 -15
- package/es/LmTable/components/Item/components/Remove/index.d.ts +0 -3
- package/es/LmTable/components/Item/components/Remove/index.js +0 -16
- package/es/LmTable/components/Item/components/index.d.ts +0 -3
- package/es/LmTable/components/Item/components/index.js +0 -3
- package/es/LmTable/components/Item/index.d.ts +0 -2
- package/es/LmTable/components/Item/index.js +0 -2
- package/es/LmTable/hooks/useDndItems.d.ts +0 -13
- package/es/LmTable/hooks/useDndItems.js +0 -193
- package/es/LmTable/hooks/useResizeObserver.d.ts +0 -13
- package/es/LmTable/hooks/useResizeObserver.js +0 -44
- package/es/LmTable/multipleContainersKeyboardCoordinates.d.ts +0 -3
- package/es/LmTable/multipleContainersKeyboardCoordinates.js +0 -92
- package/es/LmTable/testDemos/group.js +0 -115
- package/lib/LmTable/common/index.d.ts +0 -10
- package/lib/LmTable/common/index.js +0 -40
- package/lib/LmTable/components/CalcExpression.d.ts +0 -9
- package/lib/LmTable/components/CalcExpression.js +0 -129
- package/lib/LmTable/components/Container/Container.css +0 -94
- package/lib/LmTable/components/Container/Container.d.ts +0 -20
- package/lib/LmTable/components/Container/Container.js +0 -56
- package/lib/LmTable/components/Container/index.d.ts +0 -2
- package/lib/LmTable/components/Container/index.js +0 -12
- package/lib/LmTable/components/HeaderCol.js +0 -52
- package/lib/LmTable/components/Item/Item.css +0 -113
- package/lib/LmTable/components/Item/Item.d.ts +0 -37
- package/lib/LmTable/components/Item/Item.js +0 -92
- package/lib/LmTable/components/Item/components/Action/Action.css +0 -41
- package/lib/LmTable/components/Item/components/Action/Action.d.ts +0 -10
- package/lib/LmTable/components/Item/components/Action/Action.js +0 -40
- package/lib/LmTable/components/Item/components/Action/index.d.ts +0 -2
- package/lib/LmTable/components/Item/components/Action/index.js +0 -12
- package/lib/LmTable/components/Item/components/Handle/index.d.ts +0 -4
- package/lib/LmTable/components/Item/components/Handle/index.js +0 -23
- package/lib/LmTable/components/Item/components/Remove/index.d.ts +0 -3
- package/lib/LmTable/components/Item/components/Remove/index.js +0 -23
- package/lib/LmTable/components/Item/components/index.d.ts +0 -3
- package/lib/LmTable/components/Item/components/index.js +0 -27
- package/lib/LmTable/components/Item/index.d.ts +0 -2
- package/lib/LmTable/components/Item/index.js +0 -31
- package/lib/LmTable/hooks/useDndItems.d.ts +0 -13
- package/lib/LmTable/hooks/useDndItems.js +0 -201
- package/lib/LmTable/hooks/useResizeObserver.d.ts +0 -13
- package/lib/LmTable/hooks/useResizeObserver.js +0 -51
- package/lib/LmTable/multipleContainersKeyboardCoordinates.d.ts +0 -3
- package/lib/LmTable/multipleContainersKeyboardCoordinates.js +0 -99
- package/lib/LmTable/testDemos/group.js +0 -115
package/es/LmUpload/fns/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
|
+
|
|
3
4
|
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
4
5
|
function adopt(value) {
|
|
5
6
|
return value instanceof P ? value : new P(function (resolve) {
|
|
6
7
|
resolve(value);
|
|
7
8
|
});
|
|
8
9
|
}
|
|
10
|
+
|
|
9
11
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
12
|
function fulfilled(value) {
|
|
11
13
|
try {
|
|
@@ -14,6 +16,7 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
|
|
|
14
16
|
reject(e);
|
|
15
17
|
}
|
|
16
18
|
}
|
|
19
|
+
|
|
17
20
|
function rejected(value) {
|
|
18
21
|
try {
|
|
19
22
|
step(generator["throw"](value));
|
|
@@ -21,31 +24,36 @@ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, gene
|
|
|
21
24
|
reject(e);
|
|
22
25
|
}
|
|
23
26
|
}
|
|
27
|
+
|
|
24
28
|
function step(result) {
|
|
25
29
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
26
30
|
}
|
|
31
|
+
|
|
27
32
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28
33
|
});
|
|
29
34
|
};
|
|
35
|
+
|
|
30
36
|
import { useCallback } from 'react';
|
|
31
37
|
import { message } from 'linkmore-design';
|
|
32
38
|
import OSS from 'ali-oss';
|
|
39
|
+
|
|
33
40
|
var useCoreOptions = function useCoreOptions(_ref) {
|
|
34
41
|
var state = _ref.state,
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
dispatch = _ref.dispatch,
|
|
43
|
+
props = _ref.props;
|
|
37
44
|
var uid = props.uid,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
onChange = props.onChange,
|
|
46
|
+
type = props.type,
|
|
47
|
+
fileSize = props.fileSize,
|
|
48
|
+
fileSizeType = props.fileSizeType,
|
|
49
|
+
fileAreaSize = props.fileAreaSize,
|
|
50
|
+
enabledOss = props.enabledOss,
|
|
51
|
+
enableCrop = props.enableCrop,
|
|
52
|
+
ossConfig = props.ossConfig;
|
|
46
53
|
/* 获取两个对象是否存在指定值相等
|
|
47
54
|
* 取用户定义的列字段,如果读取不到则取'fileName'对比
|
|
48
55
|
*/
|
|
56
|
+
|
|
49
57
|
var getHasEqual = useCallback(function (obj1, obj2) {
|
|
50
58
|
var extend = [uid, 'fileName'];
|
|
51
59
|
var flag = false;
|
|
@@ -55,8 +63,8 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
55
63
|
}
|
|
56
64
|
});
|
|
57
65
|
return flag;
|
|
58
|
-
}, [uid]);
|
|
59
|
-
|
|
66
|
+
}, [uid]); // 从对象中读取存在的指定属性
|
|
67
|
+
|
|
60
68
|
var getFileHasValue = useCallback(function (obj) {
|
|
61
69
|
if (!obj) return '';
|
|
62
70
|
var extend = [uid, 'fileName'];
|
|
@@ -65,45 +73,49 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
65
73
|
if (!val && obj[v]) val = obj[v];
|
|
66
74
|
});
|
|
67
75
|
return val;
|
|
68
|
-
}, [uid]);
|
|
69
|
-
|
|
76
|
+
}, [uid]); // 获取当前的文件列表
|
|
77
|
+
|
|
70
78
|
var getFileList = useCallback(function () {
|
|
71
79
|
return props.fileList || state.fileList;
|
|
72
|
-
}, [props.fileList, state.fileList]);
|
|
73
|
-
|
|
80
|
+
}, [props.fileList, state.fileList]); // 获取上传状态
|
|
81
|
+
|
|
74
82
|
var getUploadStatus = useCallback(function () {
|
|
75
83
|
var uploading = typeof state.percent === 'number';
|
|
76
84
|
return {
|
|
77
85
|
uploading: uploading
|
|
78
86
|
};
|
|
79
|
-
}, [state.percent]);
|
|
80
|
-
|
|
87
|
+
}, [state.percent]); // 获取文件字段值
|
|
88
|
+
|
|
81
89
|
var getFileFields = useCallback(function (fileParams) {
|
|
82
90
|
var fileNames = props.fileNames;
|
|
83
91
|
var obj = {};
|
|
84
92
|
Object.entries(fileNames).forEach(function (v) {
|
|
85
93
|
var itemKey = v[0];
|
|
86
94
|
var itemValue = v[1];
|
|
95
|
+
|
|
87
96
|
if (fileParams[itemKey]) {
|
|
88
97
|
obj[itemKey] = fileParams[itemValue];
|
|
89
98
|
}
|
|
90
99
|
});
|
|
91
100
|
return obj;
|
|
92
|
-
}, [props]);
|
|
93
|
-
|
|
101
|
+
}, [props]); // 获取是否达到最大上传数量
|
|
102
|
+
|
|
94
103
|
var getIsMaxCount = useCallback(function () {
|
|
95
104
|
var maxCount = props.maxCount,
|
|
96
|
-
|
|
105
|
+
limit = props.limit;
|
|
97
106
|
var flag = false;
|
|
98
107
|
var num = maxCount || limit;
|
|
108
|
+
|
|
99
109
|
if (num && typeof num === 'number') {
|
|
100
110
|
flag = !(getFileList().length < num);
|
|
101
111
|
}
|
|
112
|
+
|
|
102
113
|
return flag;
|
|
103
|
-
}, [getFileList, props]);
|
|
104
|
-
|
|
114
|
+
}, [getFileList, props]); // 上传成功事件: File, fileParams
|
|
115
|
+
|
|
105
116
|
var uploadSuccess = useCallback(function (file, params, ossCallBack) {
|
|
106
117
|
var _a;
|
|
118
|
+
|
|
107
119
|
var fileList = [params].concat(_toConsumableArray(getFileList()));
|
|
108
120
|
dispatch({
|
|
109
121
|
type: 'changeFileList',
|
|
@@ -112,8 +124,8 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
112
124
|
dispatch({
|
|
113
125
|
type: 'changePercent',
|
|
114
126
|
percent: null
|
|
115
|
-
});
|
|
116
|
-
|
|
127
|
+
}); // 上传事件:抛出 file: 文件 filelist: 文件列表 event: 上传进度信息
|
|
128
|
+
|
|
117
129
|
(_a = props.onSuccess) === null || _a === void 0 ? void 0 : _a.call(props, {
|
|
118
130
|
file: file,
|
|
119
131
|
fileList: fileList
|
|
@@ -123,13 +135,15 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
123
135
|
fileList: fileList
|
|
124
136
|
});
|
|
125
137
|
ossCallBack === null || ossCallBack === void 0 ? void 0 : ossCallBack(params);
|
|
126
|
-
}, [getFileList, props.onSuccess, onChange, dispatch]);
|
|
127
|
-
|
|
138
|
+
}, [getFileList, props.onSuccess, onChange, dispatch]); // 上传进度事件
|
|
139
|
+
|
|
128
140
|
var uploadProgress = useCallback(function (file, _ref2) {
|
|
129
141
|
var progress = _ref2.progress,
|
|
130
|
-
|
|
131
|
-
|
|
142
|
+
checkPoint = _ref2.checkPoint,
|
|
143
|
+
result = _ref2.result;
|
|
144
|
+
|
|
132
145
|
var _a;
|
|
146
|
+
|
|
133
147
|
var params = {
|
|
134
148
|
file: file,
|
|
135
149
|
fileList: getFileList(),
|
|
@@ -146,11 +160,11 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
146
160
|
type: 'changePercent',
|
|
147
161
|
percent: Number((progress * 100).toFixed(2))
|
|
148
162
|
});
|
|
149
|
-
}, [getFileList, props.onProgress, onChange, dispatch]);
|
|
150
|
-
|
|
163
|
+
}, [getFileList, props.onProgress, onChange, dispatch]); // 上传失败事件
|
|
164
|
+
|
|
151
165
|
var uploadError = useCallback(function (_ref3) {
|
|
152
166
|
var error = _ref3.error,
|
|
153
|
-
|
|
167
|
+
file = _ref3.file;
|
|
154
168
|
console.log('上传报错:', error);
|
|
155
169
|
props.onError ? props.onError({
|
|
156
170
|
error: error,
|
|
@@ -164,11 +178,12 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
164
178
|
status: 'error'
|
|
165
179
|
}
|
|
166
180
|
});
|
|
167
|
-
}, [props.onError, getFileList, onChange]);
|
|
168
|
-
|
|
181
|
+
}, [props.onError, getFileList, onChange]); // 上传至ali-oss
|
|
182
|
+
|
|
169
183
|
var uploadOss = useCallback(function (file) {
|
|
170
184
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
171
185
|
var _ossConfig, _ossConfig$dir, filePath, shortlink, _ossConfig$region, region, accessKeyId, accessKeySecret, stsToken, _ossConfig$bucket, bucket, ossCallBack, client, timestamp, fileName, pathName, url, params;
|
|
186
|
+
|
|
172
187
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
173
188
|
while (1) {
|
|
174
189
|
switch (_context.prev = _context.next) {
|
|
@@ -198,7 +213,9 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
198
213
|
},
|
|
199
214
|
parallel: 4,
|
|
200
215
|
partSize: 1024 * 1024 // 分片大小
|
|
216
|
+
|
|
201
217
|
});
|
|
218
|
+
|
|
202
219
|
case 9:
|
|
203
220
|
params = props.fileConfig({
|
|
204
221
|
file: file,
|
|
@@ -211,6 +228,7 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
211
228
|
uploadSuccess(file, params, ossCallBack);
|
|
212
229
|
_context.next = 16;
|
|
213
230
|
break;
|
|
231
|
+
|
|
214
232
|
case 13:
|
|
215
233
|
_context.prev = 13;
|
|
216
234
|
_context.t0 = _context["catch"](0);
|
|
@@ -218,6 +236,7 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
218
236
|
error: _context.t0,
|
|
219
237
|
file: file
|
|
220
238
|
});
|
|
239
|
+
|
|
221
240
|
case 16:
|
|
222
241
|
case "end":
|
|
223
242
|
return _context.stop();
|
|
@@ -225,22 +244,23 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
225
244
|
}
|
|
226
245
|
}, _callee, null, [[0, 13]]);
|
|
227
246
|
}));
|
|
228
|
-
}, [ossConfig, uploadProgress, props.fileConfig, uploadSuccess, uploadError]);
|
|
229
|
-
|
|
247
|
+
}, [ossConfig, uploadProgress, props.fileConfig, uploadSuccess, uploadError]); // 自定义使用外部上传
|
|
248
|
+
|
|
230
249
|
var customUpload = useCallback(function (file) {
|
|
231
250
|
var _a;
|
|
251
|
+
|
|
232
252
|
(_a = props.fileUpload) === null || _a === void 0 ? void 0 : _a.call(props, {
|
|
233
253
|
file: file,
|
|
234
254
|
value: getFileList(),
|
|
235
255
|
onChange: uploadSuccess
|
|
236
256
|
});
|
|
237
|
-
}, [props.fileUpload, getFileList, uploadSuccess]);
|
|
238
|
-
|
|
257
|
+
}, [props.fileUpload, getFileList, uploadSuccess]); // 调用上传方法: 执行 uploadOss && customUpload事件
|
|
258
|
+
|
|
239
259
|
var uploadFile = useCallback(function (file) {
|
|
240
260
|
enabledOss && uploadOss(file);
|
|
241
261
|
customUpload(file);
|
|
242
|
-
}, [enabledOss, uploadOss, customUpload]);
|
|
243
|
-
|
|
262
|
+
}, [enabledOss, uploadOss, customUpload]); // 检测完成, 执行外部 `beforeUpload` 事件
|
|
263
|
+
|
|
244
264
|
var checkOver = useCallback(function (file) {
|
|
245
265
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
246
266
|
var res, newFile;
|
|
@@ -252,37 +272,48 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
252
272
|
_context2.next = 3;
|
|
253
273
|
break;
|
|
254
274
|
}
|
|
275
|
+
|
|
255
276
|
uploadFile(file);
|
|
256
277
|
return _context2.abrupt("return");
|
|
278
|
+
|
|
257
279
|
case 3:
|
|
258
280
|
res = props.beforeUpload(file, getFileList()); // Promise
|
|
281
|
+
|
|
259
282
|
if (!(res === null || res === void 0 ? void 0 : res.then)) {
|
|
260
283
|
_context2.next = 16;
|
|
261
284
|
break;
|
|
262
285
|
}
|
|
286
|
+
|
|
263
287
|
_context2.prev = 5;
|
|
264
288
|
_context2.next = 8;
|
|
265
289
|
return res;
|
|
290
|
+
|
|
266
291
|
case 8:
|
|
267
292
|
newFile = _context2.sent;
|
|
268
293
|
uploadFile(newFile);
|
|
269
294
|
_context2.next = 15;
|
|
270
295
|
break;
|
|
296
|
+
|
|
271
297
|
case 12:
|
|
272
298
|
_context2.prev = 12;
|
|
273
299
|
_context2.t0 = _context2["catch"](5);
|
|
274
300
|
console.log('上传失败!');
|
|
301
|
+
|
|
275
302
|
case 15:
|
|
276
303
|
return _context2.abrupt("return");
|
|
304
|
+
|
|
277
305
|
case 16:
|
|
278
306
|
if (res) {
|
|
279
307
|
_context2.next = 18;
|
|
280
308
|
break;
|
|
281
309
|
}
|
|
310
|
+
|
|
282
311
|
return _context2.abrupt("return");
|
|
312
|
+
|
|
283
313
|
case 18:
|
|
284
314
|
// () => true
|
|
285
315
|
uploadFile(file);
|
|
316
|
+
|
|
286
317
|
case 19:
|
|
287
318
|
case "end":
|
|
288
319
|
return _context2.stop();
|
|
@@ -290,34 +321,40 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
290
321
|
}
|
|
291
322
|
}, _callee2, null, [[5, 12]]);
|
|
292
323
|
}));
|
|
293
|
-
}, [props.beforeUpload, getFileList, uploadFile]);
|
|
294
|
-
|
|
324
|
+
}, [props.beforeUpload, getFileList, uploadFile]); // 单个文件异步校验
|
|
325
|
+
|
|
295
326
|
var fileCheckAsync = useCallback(function (file) {
|
|
296
327
|
return new Promise(function (resolve, reject) {
|
|
297
328
|
// 文件类型校验是否通过 | 存在通配符或符合规定类型
|
|
298
|
-
var isCheckType = type.includes('*') || type.includes(file.name.replace(/.*\./, '').toLowerCase());
|
|
299
|
-
|
|
329
|
+
var isCheckType = type.includes('*') || type.includes(file.name.replace(/.*\./, '').toLowerCase()); // 大小校验是否通过
|
|
330
|
+
|
|
300
331
|
var isCheckSize = file.size / 1024 / (fileSizeType.toLowerCase().includes('m') ? 1024 : 1) <= fileSize;
|
|
332
|
+
|
|
301
333
|
if (!isCheckType) {
|
|
302
334
|
var content = type.join('、');
|
|
303
335
|
reject(new Error("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF01\u4EC5\u652F\u6301".concat(content, "\u7684\u6587\u4EF6\u7C7B\u578B\uFF01")));
|
|
304
336
|
}
|
|
337
|
+
|
|
305
338
|
if (!isCheckSize) {
|
|
306
339
|
reject(new Error("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF01\u9644\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7".concat(fileSize).concat(fileSizeType, "\uFF01")));
|
|
307
|
-
}
|
|
308
|
-
|
|
340
|
+
} // 是否需要校验图片宽高
|
|
341
|
+
|
|
342
|
+
|
|
309
343
|
if (fileAreaSize) {
|
|
310
344
|
var reader = new FileReader();
|
|
311
345
|
reader.readAsDataURL(file);
|
|
346
|
+
|
|
312
347
|
reader.onload = function (evt) {
|
|
313
348
|
var res = evt.target.result;
|
|
314
349
|
var imageObj = new Image();
|
|
315
350
|
imageObj.src = res;
|
|
351
|
+
|
|
316
352
|
imageObj.onload = function () {
|
|
317
353
|
var maxWidth = fileAreaSize.maxWidth,
|
|
318
|
-
|
|
354
|
+
maxHeight = fileAreaSize.maxHeight;
|
|
319
355
|
var isCheckAreaSizeMaxWidth = !maxWidth || imageObj.width <= maxWidth;
|
|
320
356
|
var isCheckAreaSizeMaxHeight = !maxHeight || imageObj.height <= maxHeight;
|
|
357
|
+
|
|
321
358
|
if (!isCheckAreaSizeMaxWidth || !isCheckAreaSizeMaxHeight) {
|
|
322
359
|
reject(new Error("\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF01\u56FE\u7247\u5C3A\u5BF8\u4E0D\u7B26\u5408"));
|
|
323
360
|
} else {
|
|
@@ -329,8 +366,8 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
329
366
|
resolve(file);
|
|
330
367
|
}
|
|
331
368
|
});
|
|
332
|
-
}, [type, fileSize, fileSizeType, fileAreaSize]);
|
|
333
|
-
|
|
369
|
+
}, [type, fileSize, fileSizeType, fileAreaSize]); // 文件循环校验,返回校验后的文件数组
|
|
370
|
+
|
|
334
371
|
var filesLoopCheck = useCallback(function (files) {
|
|
335
372
|
return Promise.all(files.map(fileCheckAsync));
|
|
336
373
|
}, []);
|
|
@@ -342,6 +379,7 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
342
379
|
* => uploadProgress => uploadSuccess || uploadError
|
|
343
380
|
* => Props.onChange && (Props.onSuccess || Props.onError)
|
|
344
381
|
*/
|
|
382
|
+
|
|
345
383
|
var beforeUpload = useCallback(function (e) {
|
|
346
384
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
347
385
|
var files, res;
|
|
@@ -353,8 +391,10 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
353
391
|
_context3.prev = 1;
|
|
354
392
|
_context3.next = 4;
|
|
355
393
|
return filesLoopCheck(files);
|
|
394
|
+
|
|
356
395
|
case 4:
|
|
357
396
|
res = _context3.sent;
|
|
397
|
+
|
|
358
398
|
// 仅单文件上传时可剪裁
|
|
359
399
|
if (enableCrop) {
|
|
360
400
|
dispatch({
|
|
@@ -365,13 +405,16 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
365
405
|
// 校验完成开始执行上传
|
|
366
406
|
res.forEach(checkOver);
|
|
367
407
|
}
|
|
408
|
+
|
|
368
409
|
_context3.next = 12;
|
|
369
410
|
break;
|
|
411
|
+
|
|
370
412
|
case 8:
|
|
371
413
|
_context3.prev = 8;
|
|
372
414
|
_context3.t0 = _context3["catch"](1);
|
|
373
415
|
console.log('文件校验未通过!', _context3.t0.message);
|
|
374
416
|
message.warning(_context3.t0.message, 1.5);
|
|
417
|
+
|
|
375
418
|
case 12:
|
|
376
419
|
case "end":
|
|
377
420
|
return _context3.stop();
|
|
@@ -379,19 +422,22 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
379
422
|
}
|
|
380
423
|
}, _callee3, null, [[1, 8]]);
|
|
381
424
|
}));
|
|
382
|
-
}, [filesLoopCheck, enableCrop, checkOver]);
|
|
383
|
-
|
|
425
|
+
}, [filesLoopCheck, enableCrop, checkOver]); // 删除事件
|
|
426
|
+
|
|
384
427
|
var remove = useCallback(function (file) {
|
|
385
428
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
386
429
|
var _a, _b, res, fileList;
|
|
430
|
+
|
|
387
431
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
388
432
|
while (1) {
|
|
389
433
|
switch (_context4.prev = _context4.next) {
|
|
390
434
|
case 0:
|
|
391
435
|
_context4.next = 2;
|
|
392
436
|
return (_a = props.onRemove) === null || _a === void 0 ? void 0 : _a.call(props, file);
|
|
437
|
+
|
|
393
438
|
case 2:
|
|
394
439
|
res = _context4.sent;
|
|
440
|
+
|
|
395
441
|
if (res) {
|
|
396
442
|
fileList = (_b = getFileList()) === null || _b === void 0 ? void 0 : _b.filter(function (v) {
|
|
397
443
|
return !getHasEqual(v, file);
|
|
@@ -405,6 +451,7 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
405
451
|
fileList: fileList
|
|
406
452
|
});
|
|
407
453
|
}
|
|
454
|
+
|
|
408
455
|
case 4:
|
|
409
456
|
case "end":
|
|
410
457
|
return _context4.stop();
|
|
@@ -412,20 +459,23 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
412
459
|
}
|
|
413
460
|
}, _callee4);
|
|
414
461
|
}));
|
|
415
|
-
}, [props.onRemove, getFileList, onChange, dispatch, getHasEqual]);
|
|
416
|
-
|
|
462
|
+
}, [props.onRemove, getFileList, onChange, dispatch, getHasEqual]); // 点击文件链接或预览图标时的回调
|
|
463
|
+
|
|
417
464
|
var preview = useCallback(function (file) {
|
|
418
465
|
var _a;
|
|
466
|
+
|
|
419
467
|
(_a = props.onPreview) === null || _a === void 0 ? void 0 : _a.call(props, file);
|
|
420
|
-
}, [props.onPreview]);
|
|
421
|
-
|
|
468
|
+
}, [props.onPreview]); // 点击下载文件时的回调
|
|
469
|
+
|
|
422
470
|
var download = useCallback(function (file) {
|
|
423
471
|
var _a;
|
|
472
|
+
|
|
424
473
|
(_a = props.onDownload) === null || _a === void 0 ? void 0 : _a.call(props, file);
|
|
425
|
-
}, [props.onDownload]);
|
|
426
|
-
|
|
474
|
+
}, [props.onDownload]); // 拖拽移动事件
|
|
475
|
+
|
|
427
476
|
var move = useCallback(function (active, over, fileList) {
|
|
428
477
|
var _a;
|
|
478
|
+
|
|
429
479
|
(_a = props.onMove) === null || _a === void 0 ? void 0 : _a.call(props, active, over, fileList);
|
|
430
480
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
431
481
|
file: active,
|
|
@@ -460,4 +510,5 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
460
510
|
RefMethods: RefMethods
|
|
461
511
|
};
|
|
462
512
|
};
|
|
513
|
+
|
|
463
514
|
export default useCoreOptions;
|
package/es/LmUpload/utils.js
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
2
|
+
import React from 'react'; // 检查是否存在内容
|
|
3
|
+
|
|
4
4
|
export function getIsHas(val) {
|
|
5
|
-
var _a;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// 检查空对象和空数组
|
|
5
|
+
var _a; // 检查是否数字类型, 是否布尔类型
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var flag = !!val || typeof val === 'number' || typeof val === 'boolean'; // 检查空对象和空数组
|
|
9
|
+
|
|
9
10
|
if (!!val && _typeof(val) === 'object') {
|
|
10
11
|
flag = Array.isArray(val) ? !!val.length : !!((_a = Object.keys(val)) === null || _a === void 0 ? void 0 : _a.length);
|
|
11
12
|
}
|
|
13
|
+
|
|
12
14
|
return flag;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
+
} // 检查是否类组件
|
|
16
|
+
|
|
15
17
|
export function isClassComponent(component) {
|
|
16
18
|
return typeof component === 'function' && function () {
|
|
17
19
|
var proto = Object.getPrototypeOf(component);
|
|
18
20
|
return proto.prototype && proto.prototype.isReactComponent;
|
|
19
21
|
}();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
+
} // 检查是否自定义组件
|
|
23
|
+
|
|
22
24
|
export function isExoticComponent(component) {
|
|
23
25
|
return _typeof(component) === 'object' && _typeof(component.$$typeof) === 'symbol' && ['react.memo', 'react.forward_ref'].includes(component.$$typeof.description);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
+
} // 检查是否React组件
|
|
27
|
+
|
|
26
28
|
export function isReactComponent(component) {
|
|
27
29
|
return isClassComponent(component) || typeof component === 'function' || isExoticComponent(component);
|
|
28
30
|
}
|
|
@@ -33,6 +35,7 @@ export var render = function render(Comp, props) {
|
|
|
33
35
|
* 将上传的图片转换为可展示的形式
|
|
34
36
|
* getBase64(file, (img) => {})
|
|
35
37
|
*/
|
|
38
|
+
|
|
36
39
|
export var getBase64 = function getBase64(img, callback) {
|
|
37
40
|
var reader = new FileReader();
|
|
38
41
|
reader.addEventListener('load', function () {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// 上传组件组合
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import UploadCore from '../body/UploadCore';
|
|
4
|
+
|
|
4
5
|
var LmUpload = function LmUpload(_ref) {
|
|
5
6
|
var instance = _ref.instance;
|
|
6
7
|
return /*#__PURE__*/React.createElement(UploadCore, {
|
|
7
8
|
instance: instance
|
|
8
9
|
});
|
|
9
10
|
};
|
|
11
|
+
|
|
10
12
|
export default LmUpload;
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import LmUpload from './Upload';
|
|
4
4
|
import LmUploadList from '../UploadList';
|
|
5
|
+
|
|
5
6
|
var LmUploadContainer = function LmUploadContainer(_ref) {
|
|
6
7
|
var instance = _ref.instance;
|
|
7
8
|
var readOnly = instance.readOnly,
|
|
8
|
-
|
|
9
|
+
wrapper = instance.components.wrapper;
|
|
10
|
+
|
|
9
11
|
if (!wrapper) {
|
|
10
12
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !readOnly && /*#__PURE__*/React.createElement(LmUpload, {
|
|
11
13
|
instance: instance
|
|
@@ -13,6 +15,7 @@ var LmUploadContainer = function LmUploadContainer(_ref) {
|
|
|
13
15
|
instance: instance
|
|
14
16
|
}));
|
|
15
17
|
}
|
|
18
|
+
|
|
16
19
|
return wrapper === null || wrapper === void 0 ? void 0 : wrapper({
|
|
17
20
|
uploadDom: !readOnly && /*#__PURE__*/React.createElement(LmUpload, {
|
|
18
21
|
instance: instance
|
|
@@ -22,4 +25,5 @@ var LmUploadContainer = function LmUploadContainer(_ref) {
|
|
|
22
25
|
})
|
|
23
26
|
});
|
|
24
27
|
};
|
|
28
|
+
|
|
25
29
|
export default /*#__PURE__*/React.memo(LmUploadContainer);
|
|
@@ -4,30 +4,34 @@ import React, { useMemo, useReducer, forwardRef, useImperativeHandle } from 'rea
|
|
|
4
4
|
import reducer, { initialState as initReducerState } from './reducer';
|
|
5
5
|
import useCoreOptions from '../fns';
|
|
6
6
|
import LmUploadWrapper from './UploadWrapper';
|
|
7
|
+
|
|
7
8
|
var LmUploadRoot = function LmUploadRoot(props, ref) {
|
|
8
9
|
var initialState = useMemo(function () {
|
|
9
10
|
return initReducerState(props);
|
|
10
11
|
}, []);
|
|
12
|
+
|
|
11
13
|
var _useReducer = useReducer(reducer, initialState),
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
15
|
+
state = _useReducer2[0],
|
|
16
|
+
dispatch = _useReducer2[1]; // 获取核心Methods
|
|
17
|
+
|
|
18
|
+
|
|
16
19
|
var _useCoreOptions = useCoreOptions({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
state: state,
|
|
21
|
+
dispatch: dispatch,
|
|
22
|
+
props: props
|
|
23
|
+
}),
|
|
24
|
+
CoreMethods = _useCoreOptions.CoreMethods,
|
|
25
|
+
RefMethods = _useCoreOptions.RefMethods; // 组件实例
|
|
26
|
+
|
|
27
|
+
|
|
24
28
|
var instance = useMemo(function () {
|
|
25
29
|
return Object.assign(Object.assign(Object.assign(Object.assign({}, props), CoreMethods), RefMethods), {
|
|
26
30
|
state: state,
|
|
27
31
|
dispatch: dispatch
|
|
28
32
|
});
|
|
29
|
-
}, [props, CoreMethods, RefMethods, state, dispatch]);
|
|
30
|
-
|
|
33
|
+
}, [props, CoreMethods, RefMethods, state, dispatch]); // 向外暴露出的方法
|
|
34
|
+
|
|
31
35
|
useImperativeHandle(ref, function () {
|
|
32
36
|
return Object.assign({}, RefMethods);
|
|
33
37
|
});
|
|
@@ -35,4 +39,5 @@ var LmUploadRoot = function LmUploadRoot(props, ref) {
|
|
|
35
39
|
instance: instance
|
|
36
40
|
});
|
|
37
41
|
};
|
|
42
|
+
|
|
38
43
|
export default /*#__PURE__*/forwardRef(LmUploadRoot);
|
|
@@ -4,6 +4,7 @@ import LmUploadContainer from './UploadContainer';
|
|
|
4
4
|
import LmUploadView from '../view';
|
|
5
5
|
import Crop from '../components/Crop';
|
|
6
6
|
import Preview from '../components/Preview';
|
|
7
|
+
|
|
7
8
|
var LmUploadWrapper = function LmUploadWrapper(_ref) {
|
|
8
9
|
var instance = _ref.instance;
|
|
9
10
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -18,4 +19,5 @@ var LmUploadWrapper = function LmUploadWrapper(_ref) {
|
|
|
18
19
|
instance: instance
|
|
19
20
|
}));
|
|
20
21
|
};
|
|
22
|
+
|
|
21
23
|
export default /*#__PURE__*/React.memo(LmUploadWrapper);
|
|
@@ -1,34 +1,39 @@
|
|
|
1
1
|
// 状态管理操作
|
|
2
2
|
export var reducer = function reducer(state, action) {
|
|
3
3
|
var fileList = action.fileList,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
percent = action.percent,
|
|
5
|
+
cropFile = action.cropFile,
|
|
6
|
+
preview = action.preview;
|
|
7
|
+
|
|
7
8
|
switch (action.type) {
|
|
8
9
|
case 'changeFileList':
|
|
9
10
|
return Object.assign(Object.assign({}, state), {
|
|
10
11
|
fileList: fileList
|
|
11
12
|
});
|
|
13
|
+
|
|
12
14
|
case 'changePercent':
|
|
13
15
|
return Object.assign(Object.assign({}, state), {
|
|
14
16
|
percent: percent
|
|
15
17
|
});
|
|
18
|
+
|
|
16
19
|
case 'changeCropFile':
|
|
17
20
|
return Object.assign(Object.assign({}, state), {
|
|
18
21
|
cropFile: cropFile
|
|
19
22
|
});
|
|
23
|
+
|
|
20
24
|
case 'changePreview':
|
|
21
25
|
return Object.assign(Object.assign({}, state), {
|
|
22
26
|
preview: Object.assign(Object.assign({}, state.preview), preview)
|
|
23
27
|
});
|
|
28
|
+
|
|
24
29
|
default:
|
|
25
30
|
throw new Error();
|
|
26
31
|
}
|
|
27
|
-
};
|
|
28
|
-
|
|
32
|
+
}; // 仅在初始化时触发一次
|
|
33
|
+
|
|
29
34
|
export var initialState = function initialState(props) {
|
|
30
35
|
var defaultFileList = props.defaultFileList,
|
|
31
|
-
|
|
36
|
+
upload = props.upload;
|
|
32
37
|
return {
|
|
33
38
|
upload: upload,
|
|
34
39
|
process: 0,
|