linkmore-design 1.0.68 → 1.0.71
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/ImageViewer/LmImageViewer.d.ts +5 -0
- package/dist/ImageViewer/demos/basic.d.ts +2 -0
- package/dist/ImageViewer/index.d.ts +2 -0
- package/dist/ImageViewer/style/index.d.ts +1 -0
- package/dist/ImageViewer/wrapeer/Root.d.ts +3 -0
- package/dist/LmFilter/components/InputFilter.d.ts +2 -2
- 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 +1 -0
- package/dist/LmUpload/LmUpload.d.ts +2 -0
- package/dist/LmUpload/UploadList/ItemPicture.d.ts +2 -1
- package/dist/LmUpload/UploadList/ItemText.d.ts +2 -1
- package/dist/LmUpload/UploadList/RenderItem.d.ts +1 -5
- package/dist/LmUpload/UploadList/index.d.ts +4 -3
- 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 +5 -0
- package/dist/LmUpload/utils.d.ts +1 -0
- package/dist/LmUpload/wrapper/UploadContainer.d.ts +4 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.umd.js +4081 -603
- package/dist/index.umd.min.js +6 -6
- package/es/Affix/style/index.css +6 -0
- package/es/Alert/style/index.css +6 -0
- package/es/Approval/index.js +4 -4
- package/es/Approval/style/index.css +18 -4
- 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/style/index.css +6 -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/style/index.css +6 -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/style/index.css +6 -0
- package/es/Comment/style/index.css +6 -0
- 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/ImageViewer/LmImageViewer.d.ts +5 -0
- package/es/ImageViewer/LmImageViewer.js +26 -0
- package/es/ImageViewer/index.d.ts +2 -0
- package/es/ImageViewer/index.js +2 -0
- package/es/ImageViewer/style/index.css +211 -0
- package/es/ImageViewer/style/index.js +3 -0
- package/es/ImageViewer/wrapeer/Root.d.ts +3 -0
- package/es/ImageViewer/wrapeer/Root.js +12 -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/style/index.css +6 -0
- package/es/LmFilter/complexFilter/drawer.js +2 -7
- package/es/LmFilter/complexFilter/valueDrawer.js +2 -5
- package/es/LmFilter/components/CascaderFilter.js +3 -2
- package/es/LmFilter/components/CheckboxFilter.js +3 -3
- package/es/LmFilter/components/DropdownFIlter.js +71 -65
- package/es/LmFilter/components/InputFilter.js +1 -2
- package/es/LmFilter/components/SelectFilter.js +2 -2
- package/es/LmFilter/components/index.js +7 -5
- package/es/LmFilter/customFilter/drawer.js +7 -25
- package/es/LmFilter/customFilter/saveModal.js +2 -3
- package/es/LmFilter/customFilter/valueDrawer.js +2 -5
- package/es/LmFilter/filterFns/index.js +4 -6
- package/es/LmFilter/localization.d.ts +1 -0
- package/es/LmFilter/localization.js +2 -1
- package/es/LmFilter/utils.js +41 -22
- package/es/LmFilter/wrapper/FilterRoot.js +0 -2
- package/es/LmSelect/style/index.css +6 -0
- package/es/LmSelect/useCheckboxOptions.d.ts +1 -0
- package/es/LmSelect/useCheckboxOptions.js +4 -3
- package/es/LmTable/Table.js +0 -1
- package/es/LmTable/autosize.js +0 -3
- package/es/LmTable/style/index.css +6 -0
- package/es/LmUpload/LmUpload.d.ts +2 -0
- package/es/LmUpload/LmUpload.js +54 -22
- package/es/LmUpload/UploadList/ItemPicture.d.ts +2 -1
- package/es/LmUpload/UploadList/ItemPicture.js +23 -8
- package/es/LmUpload/UploadList/ItemPictureCard.js +18 -9
- package/es/LmUpload/UploadList/ItemText.d.ts +2 -1
- package/es/LmUpload/UploadList/ItemText.js +13 -7
- package/es/LmUpload/UploadList/RenderItem.d.ts +1 -5
- package/es/LmUpload/UploadList/RenderItem.js +3 -3
- package/es/LmUpload/UploadList/index.d.ts +4 -3
- package/es/LmUpload/UploadList/index.js +14 -8
- package/es/LmUpload/body/Progress.js +2 -2
- package/es/LmUpload/body/UploadCore.js +5 -4
- package/es/LmUpload/body/UploadPicture.js +4 -4
- package/es/LmUpload/fns/index.d.ts +5 -0
- package/es/LmUpload/fns/index.js +138 -42
- package/es/LmUpload/style/index.css +6 -0
- package/es/LmUpload/utils.d.ts +1 -0
- package/es/LmUpload/utils.js +14 -1
- package/es/LmUpload/view/index.js +2 -2
- package/es/LmUpload/wrapper/UploadContainer.d.ts +4 -3
- package/es/LmUpload/wrapper/UploadContainer.js +19 -3
- package/es/LmUpload/wrapper/UploadRoot.js +9 -1
- package/es/LmUpload/wrapper/UploadWrapper.js +4 -8
- package/es/LmUpload/wrapper/reducer.js +2 -1
- package/es/Mentions/style/index.css +6 -0
- package/es/Menu/style/index.css +6 -0
- 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/style/index.css +6 -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/style/index.css +6 -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/style/index.css +6 -0
- package/es/Select/style/index.css +6 -0
- package/es/Slider/style/index.css +6 -0
- package/es/Space/style/index.css +6 -0
- package/es/Spin/style/index.css +6 -0
- package/es/Statistic/style/index.css +6 -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/style/index.css +6 -0
- package/es/Timeline/style/index.css +6 -0
- package/es/Tooltip/style/index.css +6 -0
- package/es/Transfer/style/index.css +6 -0
- package/es/Tree/style/index.css +6 -0
- package/es/TreeSelect/style/index.css +6 -0
- package/es/Typography/style/index.css +6 -0
- package/es/Upload/style/index.css +6 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- 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/style/index.css +6 -0
- package/lib/Approval/index.js +4 -4
- package/lib/Approval/style/index.css +18 -4
- 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/style/index.css +6 -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/style/index.css +6 -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/style/index.css +6 -0
- package/lib/Comment/style/index.css +6 -0
- 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/ImageViewer/LmImageViewer.d.ts +5 -0
- package/lib/ImageViewer/LmImageViewer.js +40 -0
- package/lib/ImageViewer/index.d.ts +2 -0
- package/lib/ImageViewer/index.js +13 -0
- package/lib/ImageViewer/style/index.css +211 -0
- package/lib/ImageViewer/style/index.js +3 -0
- package/lib/ImageViewer/wrapeer/Root.d.ts +3 -0
- package/lib/ImageViewer/wrapeer/Root.js +23 -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/style/index.css +6 -0
- package/lib/LmFilter/complexFilter/drawer.js +2 -7
- package/lib/LmFilter/complexFilter/valueDrawer.js +2 -5
- package/lib/LmFilter/components/CascaderFilter.js +3 -2
- package/lib/LmFilter/components/CheckboxFilter.js +3 -3
- package/lib/LmFilter/components/DropdownFIlter.js +71 -65
- package/lib/LmFilter/components/InputFilter.js +1 -2
- package/lib/LmFilter/components/SelectFilter.js +2 -2
- package/lib/LmFilter/components/index.js +7 -5
- package/lib/LmFilter/customFilter/drawer.js +7 -25
- package/lib/LmFilter/customFilter/saveModal.js +2 -3
- package/lib/LmFilter/customFilter/valueDrawer.js +2 -5
- package/lib/LmFilter/filterFns/index.js +4 -6
- package/lib/LmFilter/localization.d.ts +1 -0
- package/lib/LmFilter/localization.js +4 -2
- package/lib/LmFilter/utils.js +41 -22
- package/lib/LmFilter/wrapper/FilterRoot.js +0 -2
- package/lib/LmSelect/style/index.css +6 -0
- package/lib/LmSelect/useCheckboxOptions.d.ts +1 -0
- package/lib/LmSelect/useCheckboxOptions.js +7 -5
- package/lib/LmTable/Table.js +0 -1
- package/lib/LmTable/autosize.js +0 -3
- package/lib/LmTable/style/index.css +6 -0
- package/lib/LmUpload/LmUpload.d.ts +2 -0
- package/lib/LmUpload/LmUpload.js +53 -22
- package/lib/LmUpload/UploadList/ItemPicture.d.ts +2 -1
- package/lib/LmUpload/UploadList/ItemPicture.js +26 -8
- package/lib/LmUpload/UploadList/ItemPictureCard.js +18 -9
- package/lib/LmUpload/UploadList/ItemText.d.ts +2 -1
- package/lib/LmUpload/UploadList/ItemText.js +16 -7
- package/lib/LmUpload/UploadList/RenderItem.d.ts +1 -5
- package/lib/LmUpload/UploadList/RenderItem.js +3 -3
- package/lib/LmUpload/UploadList/index.d.ts +4 -3
- package/lib/LmUpload/UploadList/index.js +15 -10
- package/lib/LmUpload/body/Progress.js +2 -2
- package/lib/LmUpload/body/UploadCore.js +10 -9
- package/lib/LmUpload/body/UploadPicture.js +4 -4
- package/lib/LmUpload/fns/index.d.ts +5 -0
- package/lib/LmUpload/fns/index.js +138 -42
- package/lib/LmUpload/style/index.css +6 -0
- package/lib/LmUpload/utils.d.ts +1 -0
- package/lib/LmUpload/utils.js +16 -1
- package/lib/LmUpload/view/index.js +2 -2
- package/lib/LmUpload/wrapper/UploadContainer.d.ts +4 -3
- package/lib/LmUpload/wrapper/UploadContainer.js +21 -3
- package/lib/LmUpload/wrapper/UploadRoot.js +9 -1
- package/lib/LmUpload/wrapper/UploadWrapper.js +5 -12
- package/lib/LmUpload/wrapper/reducer.js +2 -1
- package/lib/Mentions/style/index.css +6 -0
- package/lib/Menu/style/index.css +6 -0
- 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/style/index.css +6 -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/style/index.css +6 -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/style/index.css +6 -0
- package/lib/Select/style/index.css +6 -0
- package/lib/Slider/style/index.css +6 -0
- package/lib/Space/style/index.css +6 -0
- package/lib/Spin/style/index.css +6 -0
- package/lib/Statistic/style/index.css +6 -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/style/index.css +6 -0
- package/lib/Timeline/style/index.css +6 -0
- package/lib/Tooltip/style/index.css +6 -0
- package/lib/Transfer/style/index.css +6 -0
- package/lib/Tree/style/index.css +6 -0
- package/lib/TreeSelect/style/index.css +6 -0
- package/lib/Typography/style/index.css +6 -0
- package/lib/Upload/style/index.css +6 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +8 -0
- 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 +2 -1
|
@@ -14,11 +14,11 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
14
14
|
return t;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
import { useEvent } from '../hooks';
|
|
18
17
|
import { useControllableValue } from 'ahooks';
|
|
19
18
|
import classNames from 'classnames';
|
|
20
19
|
import { Checkbox, VirtualList } from 'linkmore-design';
|
|
21
20
|
import React, { useMemo } from 'react';
|
|
21
|
+
import { useEvent } from '../hooks';
|
|
22
22
|
import { onStringSearch } from './utils';
|
|
23
23
|
|
|
24
24
|
var imgEmpty = require('./icon_placeholder.png');
|
|
@@ -53,7 +53,7 @@ export var useCheckboxOptions = function useCheckboxOptions(options, _ref) {
|
|
|
53
53
|
|
|
54
54
|
var renderOptions = useMemo(function () {
|
|
55
55
|
return options.filter(function (v) {
|
|
56
|
-
return onStringSearch(filter, v.label);
|
|
56
|
+
return !v.disabled && onStringSearch(filter, v.label);
|
|
57
57
|
});
|
|
58
58
|
}, [options, filter]); // 是否全选: 选中的数据大于等于筛选后的数据 && 筛选后的数据全部存在于选中的数据中
|
|
59
59
|
|
|
@@ -124,4 +124,5 @@ export var useCheckboxOptions = function useCheckboxOptions(options, _ref) {
|
|
|
124
124
|
className: "filter_item-content"
|
|
125
125
|
}, item.label));
|
|
126
126
|
}), !renderOptions.length && /*#__PURE__*/React.createElement(FilterEmpty, null)));
|
|
127
|
-
};
|
|
127
|
+
};
|
|
128
|
+
export default useCheckboxOptions;
|
package/es/LmTable/Table.js
CHANGED
|
@@ -158,7 +158,6 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
158
158
|
var newIndex = columns.findIndex(function (item) {
|
|
159
159
|
return item.dataIndex === over;
|
|
160
160
|
});
|
|
161
|
-
console.log((0, _sortable.arrayMove)(columns, oldIndex, newIndex), 222);
|
|
162
161
|
filterChange === null || filterChange === void 0 ? void 0 : filterChange((0, _sortable.arrayMove)(columns, oldIndex, newIndex).map(function (item, index) {
|
|
163
162
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
|
164
163
|
order: index
|
package/es/LmTable/autosize.js
CHANGED
|
@@ -48,7 +48,6 @@ var AutoSizer = /*#__PURE__*/function (_React$Component) {
|
|
|
48
48
|
_this._detectElementResize = void 0;
|
|
49
49
|
|
|
50
50
|
_this._onResize = function () {
|
|
51
|
-
console.log(11);
|
|
52
51
|
var _this$props = _this.props,
|
|
53
52
|
disableHeight = _this$props.disableHeight,
|
|
54
53
|
disableWidth = _this$props.disableWidth,
|
|
@@ -109,8 +108,6 @@ var AutoSizer = /*#__PURE__*/function (_React$Component) {
|
|
|
109
108
|
|
|
110
109
|
this._detectElementResize.addResizeListener(this._parentNode, this.handleResize);
|
|
111
110
|
|
|
112
|
-
console.log(3);
|
|
113
|
-
|
|
114
111
|
this._onResize();
|
|
115
112
|
}
|
|
116
113
|
}
|
|
@@ -81,6 +81,9 @@
|
|
|
81
81
|
.ant-notification-notice .ant-notification-notice-description {
|
|
82
82
|
font-size: 12px;
|
|
83
83
|
}
|
|
84
|
+
.ant-collapse {
|
|
85
|
+
font-size: 12px;
|
|
86
|
+
}
|
|
84
87
|
@font-face {
|
|
85
88
|
font-family: 'iconfont';
|
|
86
89
|
/* Project id 2966019 */
|
|
@@ -503,6 +506,9 @@ html {
|
|
|
503
506
|
.card_cell_content:hover .card_cell_body .card_cell_checkbox {
|
|
504
507
|
opacity: 1;
|
|
505
508
|
}
|
|
509
|
+
p {
|
|
510
|
+
margin-bottom: 0;
|
|
511
|
+
}
|
|
506
512
|
.z_container {
|
|
507
513
|
position: relative;
|
|
508
514
|
display: flex;
|
package/es/LmUpload/LmUpload.js
CHANGED
|
@@ -11,17 +11,49 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
import React, { useRef, forwardRef } from 'react';
|
|
14
|
+
import React, { useRef, useMemo, forwardRef } from 'react';
|
|
15
15
|
import LmFilterRoot from './wrapper/UploadRoot';
|
|
16
|
-
var stsToken = 'CAISjgJ1q6Ft5B2yfSjIr5eDGdHdi5RigKuYR2fGhUcBaOEfmKHYijz2IH5IenZuA+gYtf8ymm1Q5v8ZloAvFs4YbR3KPJco48QJtA/9aoGE5cW7tfkIhJasXDPCBRPyjJ+OaLn0RYseuA94rQiW+BVoyJ7WKB+APTX8Q7Dr5LdjatMIJHraCRNNGNZRICZ7tcYeLgG/HP2xMxns8AGyZQgSzWgas25k7rmlycCx8wfXiEaAqtUYvIPsOJOpHaIOVdVdK47tgr0pLfeRinQNukYSpPhM4fYaqWudjLa0GEJM5hiKCe3Q/+B0IRVxDqpAQPAY8qeiz6Um4beOydmvm08WJ49SSD/FTYWwXwx6zT9crb8agAE/AmQIq01ud7Oe11GaycEGpfRMjSM7w3GYv7WZPtY7dlVJemeghJDOuoOjPuu+WigsrFqJr4LCXB44EvoV4tTBz9NrFdJ8T1JPD5nCQ15TSifXJMjym4tWeOTVRiZk04N27cXgD3YYj7s9wOFMsUsenZR6WulrHhyUEwyjb9fGcQ==';
|
|
17
16
|
|
|
18
17
|
var LmUpload = function LmUpload(_a, ref) {
|
|
19
|
-
var
|
|
20
|
-
|
|
18
|
+
var fileConfig = _a.fileConfig,
|
|
19
|
+
components = _a.components,
|
|
20
|
+
_ossConfig = _a.ossConfig,
|
|
21
|
+
resetProps = __rest(_a, ["fileConfig", "components", "ossConfig"]);
|
|
21
22
|
|
|
22
|
-
var defaultRef = useRef(null);
|
|
23
|
+
var defaultRef = useRef(null); // 仅在初始化触发一次
|
|
24
|
+
|
|
25
|
+
var initConfig = useMemo(function () {
|
|
26
|
+
return {
|
|
27
|
+
// 文件配置单独存储
|
|
28
|
+
fileConfig: Object.assign({
|
|
29
|
+
size: 10,
|
|
30
|
+
type: ['jpg', 'jpeg', 'png'],
|
|
31
|
+
maxCount: 99
|
|
32
|
+
}, fileConfig || {}),
|
|
33
|
+
// 读取字段配置
|
|
34
|
+
fileNames: {
|
|
35
|
+
uid: 'uid',
|
|
36
|
+
fileTypeCode: 'fileTypeCode',
|
|
37
|
+
fileTypeName: 'fileTypeName',
|
|
38
|
+
fileName: 'fileName',
|
|
39
|
+
realFileName: 'realFileName',
|
|
40
|
+
fileSize: 'fileSize',
|
|
41
|
+
internalUrl: 'internalUrl',
|
|
42
|
+
externalUrl: 'externalUrl',
|
|
43
|
+
filePath: 'filePath',
|
|
44
|
+
seq: 'seq',
|
|
45
|
+
url: 'url'
|
|
46
|
+
},
|
|
47
|
+
// 初始化
|
|
48
|
+
components: Object.assign({
|
|
49
|
+
itemRender: null,
|
|
50
|
+
wrapper: null
|
|
51
|
+
}, components || {})
|
|
52
|
+
};
|
|
53
|
+
}, []);
|
|
23
54
|
var defaultProps = {
|
|
24
|
-
|
|
55
|
+
uid: 'uid',
|
|
56
|
+
fileList: null,
|
|
25
57
|
type: ['jpg', 'jpeg', 'png'],
|
|
26
58
|
accept: '',
|
|
27
59
|
fileSize: 10,
|
|
@@ -29,30 +61,30 @@ var LmUpload = function LmUpload(_a, ref) {
|
|
|
29
61
|
size: 100,
|
|
30
62
|
disabled: false,
|
|
31
63
|
maxCount: null,
|
|
64
|
+
showUploadList: true,
|
|
32
65
|
children: null,
|
|
33
66
|
defaultFileList: [],
|
|
34
67
|
itemRender: null,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
wrapper: function wrapper(upload, fileList) {
|
|
38
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, upload, fileList);
|
|
39
|
-
}
|
|
68
|
+
onRemove: function onRemove() {
|
|
69
|
+
return true;
|
|
40
70
|
},
|
|
71
|
+
enabledOss: false,
|
|
41
72
|
// oss配置
|
|
42
|
-
ossConfig:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
73
|
+
ossConfig: function ossConfig() {
|
|
74
|
+
return Object.assign({
|
|
75
|
+
dir: '/BizFile/4595/Supplier/',
|
|
76
|
+
region: 'oss-cn-hangzhou',
|
|
77
|
+
accessKeyId: '',
|
|
78
|
+
accessKeySecret: '',
|
|
79
|
+
stsToken: '',
|
|
80
|
+
bucket: 'linkmore-scm-test',
|
|
81
|
+
shortlink: 'https://linkmore-scm-test.oss-cn-hangzhou.aliyuncs.com'
|
|
82
|
+
}, typeof _ossConfig === 'function' ? _ossConfig() : _ossConfig);
|
|
83
|
+
}
|
|
52
84
|
};
|
|
53
85
|
return /*#__PURE__*/React.createElement(LmFilterRoot, Object.assign({
|
|
54
86
|
ref: ref || defaultRef
|
|
55
|
-
}, defaultProps, resetProps));
|
|
87
|
+
}, initConfig, defaultProps, resetProps));
|
|
56
88
|
};
|
|
57
89
|
|
|
58
90
|
export default /*#__PURE__*/forwardRef(LmUpload);
|
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
2
3
|
import { IconFont } from 'linkmore-design'; // 图片列表项
|
|
3
4
|
|
|
4
5
|
var PictureItem = function PictureItem(_ref) {
|
|
5
|
-
var file = _ref.file
|
|
6
|
+
var file = _ref.file,
|
|
7
|
+
instance = _ref.instance;
|
|
8
|
+
var remove = instance.remove,
|
|
9
|
+
preview = instance.preview,
|
|
10
|
+
download = instance.download;
|
|
6
11
|
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
-
className: 'lm_upload_item lm_upload_item_picture'
|
|
12
|
+
className: cn('lm_upload_item lm_upload_item_picture', file.status === 'error' && 'error')
|
|
8
13
|
}, /*#__PURE__*/React.createElement("div", {
|
|
9
|
-
className:
|
|
14
|
+
className: "picture_left"
|
|
10
15
|
}, /*#__PURE__*/React.createElement("div", {
|
|
11
|
-
className:
|
|
16
|
+
className: "lm_upload_item_thumb",
|
|
17
|
+
onClick: function onClick() {
|
|
18
|
+
return preview(file);
|
|
19
|
+
}
|
|
12
20
|
}, /*#__PURE__*/React.createElement("img", {
|
|
13
|
-
src: file.url
|
|
21
|
+
src: file.url,
|
|
22
|
+
alt: ""
|
|
14
23
|
})), /*#__PURE__*/React.createElement("div", {
|
|
15
|
-
className:
|
|
24
|
+
className: "lm_upload_item_name",
|
|
25
|
+
onClick: function onClick() {
|
|
26
|
+
return download(file);
|
|
27
|
+
}
|
|
16
28
|
}, file.fileName)), /*#__PURE__*/React.createElement("div", {
|
|
17
|
-
className:
|
|
29
|
+
className: "picture_right lm_upload_item_action"
|
|
18
30
|
}, /*#__PURE__*/React.createElement("div", {
|
|
19
|
-
className:
|
|
31
|
+
className: "action_delete",
|
|
32
|
+
onClick: function onClick() {
|
|
33
|
+
return remove(file);
|
|
34
|
+
}
|
|
20
35
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
21
36
|
type: "lmweb-delete"
|
|
22
37
|
}))));
|
|
@@ -14,11 +14,11 @@ var renderThumb = function renderThumb(file) {
|
|
|
14
14
|
case 'png':
|
|
15
15
|
case 'jpg':
|
|
16
16
|
return /*#__PURE__*/React.createElement("div", {
|
|
17
|
-
className:
|
|
17
|
+
className: "lm_upload_item_error"
|
|
18
18
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
19
19
|
type: "lmweb-image"
|
|
20
20
|
}), /*#__PURE__*/React.createElement("div", {
|
|
21
|
-
className:
|
|
21
|
+
className: "lm_upload_item_name"
|
|
22
22
|
}, file.realFileName));
|
|
23
23
|
|
|
24
24
|
case 'doc':
|
|
@@ -55,7 +55,9 @@ var renderThumb = function renderThumb(file) {
|
|
|
55
55
|
var PictureItem = function PictureItem(_ref) {
|
|
56
56
|
var file = _ref.file,
|
|
57
57
|
instance = _ref.instance;
|
|
58
|
-
var size = instance.size
|
|
58
|
+
var size = instance.size,
|
|
59
|
+
remove = instance.remove,
|
|
60
|
+
preview = instance.preview;
|
|
59
61
|
|
|
60
62
|
var _useState = useState(false),
|
|
61
63
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -72,7 +74,8 @@ var PictureItem = function PictureItem(_ref) {
|
|
|
72
74
|
|
|
73
75
|
var thumbUrl = useMemo(function () {
|
|
74
76
|
return "".concat(file.url, "?x-oss-process=image/resize,w_").concat(size);
|
|
75
|
-
}, [file.url, size]);
|
|
77
|
+
}, [file.url, size]); // 根据文件名后缀判断
|
|
78
|
+
|
|
76
79
|
var isImg = useMemo(function () {
|
|
77
80
|
return ['jpg', 'jpeg', 'png', 'gif', 'bmp'].includes(resetFile.fileExtension);
|
|
78
81
|
}, [resetFile]); // 重置尺寸大小
|
|
@@ -94,7 +97,7 @@ var PictureItem = function PictureItem(_ref) {
|
|
|
94
97
|
width: size
|
|
95
98
|
}
|
|
96
99
|
}, /*#__PURE__*/React.createElement("div", {
|
|
97
|
-
className:
|
|
100
|
+
className: "lm_upload_item_thumb"
|
|
98
101
|
}, isError || !isImg ? renderThumb(resetFile) : /*#__PURE__*/React.createElement(Image, {
|
|
99
102
|
width: resetSize.width,
|
|
100
103
|
height: resetSize.width,
|
|
@@ -103,18 +106,24 @@ var PictureItem = function PictureItem(_ref) {
|
|
|
103
106
|
return setIsError(true);
|
|
104
107
|
}
|
|
105
108
|
})), /*#__PURE__*/React.createElement("div", {
|
|
106
|
-
className:
|
|
109
|
+
className: "lm_upload_item_mask"
|
|
107
110
|
}, /*#__PURE__*/React.createElement("div", {
|
|
108
|
-
className:
|
|
111
|
+
className: "lm_upload_item_action"
|
|
109
112
|
}, /*#__PURE__*/React.createElement("div", {
|
|
110
|
-
className:
|
|
113
|
+
className: "action_preview",
|
|
114
|
+
onClick: function onClick() {
|
|
115
|
+
return preview(file);
|
|
116
|
+
}
|
|
111
117
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
112
118
|
type: "lmweb-eye",
|
|
113
119
|
style: {
|
|
114
120
|
fontSize: size > 48 ? 16 : 12
|
|
115
121
|
}
|
|
116
122
|
})), /*#__PURE__*/React.createElement("div", {
|
|
117
|
-
className:
|
|
123
|
+
className: "action_delete",
|
|
124
|
+
onClick: function onClick() {
|
|
125
|
+
return remove(file);
|
|
126
|
+
}
|
|
118
127
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
119
128
|
type: "lmweb-delete",
|
|
120
129
|
style: {
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
2
3
|
import { IconFont } from 'linkmore-design';
|
|
3
4
|
|
|
4
5
|
var TextItem = function TextItem(_ref) {
|
|
5
|
-
var file = _ref.file
|
|
6
|
+
var file = _ref.file,
|
|
7
|
+
instance = _ref.instance;
|
|
8
|
+
var remove = instance.remove;
|
|
6
9
|
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
-
className: 'lm_upload_item lm_upload_item_text'
|
|
10
|
+
className: cn('lm_upload_item lm_upload_item_text', file.status === 'error' && 'error')
|
|
8
11
|
}, /*#__PURE__*/React.createElement("div", {
|
|
9
|
-
className:
|
|
12
|
+
className: "text_left"
|
|
10
13
|
}, /*#__PURE__*/React.createElement("div", {
|
|
11
|
-
className:
|
|
14
|
+
className: "prefix"
|
|
12
15
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
13
16
|
type: "lmweb-attachment"
|
|
14
17
|
})), /*#__PURE__*/React.createElement("div", {
|
|
15
|
-
className:
|
|
18
|
+
className: "lm_upload_item_name"
|
|
16
19
|
}, file.fileName)), /*#__PURE__*/React.createElement("div", {
|
|
17
|
-
className:
|
|
20
|
+
className: "text_right lm_upload_item_text_action"
|
|
18
21
|
}, /*#__PURE__*/React.createElement("div", {
|
|
19
|
-
className:
|
|
22
|
+
className: "action_delete",
|
|
23
|
+
onClick: function onClick() {
|
|
24
|
+
return remove(file);
|
|
25
|
+
}
|
|
20
26
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
21
27
|
type: "lmweb-delete"
|
|
22
28
|
}))));
|
|
@@ -21,9 +21,9 @@ var RenderCell = function RenderCell(props) {
|
|
|
21
21
|
resetProsp = __rest(props, ["type"]);
|
|
22
22
|
|
|
23
23
|
var types = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
text: TextItem,
|
|
25
|
+
picture: PictureItem,
|
|
26
|
+
card: PictureCardItem
|
|
27
27
|
};
|
|
28
28
|
return render(types[type] || PictureItem, resetProsp);
|
|
29
29
|
};
|
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { render } from '../utils';
|
|
3
3
|
import RenderItem from './RenderItem';
|
|
4
4
|
|
|
5
5
|
var LmUploadList = function LmUploadList(_ref) {
|
|
6
6
|
var instance = _ref.instance;
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
var _a, _b;
|
|
9
|
+
|
|
10
|
+
var uid = instance.uid,
|
|
11
|
+
getFileList = instance.getFileList,
|
|
8
12
|
itemRender = instance.itemRender,
|
|
9
|
-
listType = instance.listType
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
listType = instance.listType,
|
|
14
|
+
showUploadList = instance.showUploadList;
|
|
15
|
+
if (!showUploadList) return null;
|
|
16
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, (_b = (_a = getFileList()) === null || _a === void 0 ? void 0 : _a.sort(function (a, b) {
|
|
17
|
+
return a.seq - b.seq;
|
|
18
|
+
})) === null || _b === void 0 ? void 0 : _b.map(function (file, idx) {
|
|
12
19
|
return render(itemRender || RenderItem, {
|
|
13
20
|
type: listType,
|
|
14
|
-
key: idx,
|
|
21
|
+
key: file[uid] || idx,
|
|
15
22
|
file: file,
|
|
16
|
-
fileList: fileList,
|
|
17
23
|
instance: instance
|
|
18
24
|
});
|
|
19
25
|
}));
|
|
20
26
|
};
|
|
21
27
|
|
|
22
|
-
export default LmUploadList;
|
|
28
|
+
export default /*#__PURE__*/React.memo(LmUploadList);
|
|
@@ -4,9 +4,9 @@ var Progress = function Progress(_ref) {
|
|
|
4
4
|
var instance = _ref.instance;
|
|
5
5
|
var state = instance.state;
|
|
6
6
|
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
-
className:
|
|
7
|
+
className: "lm_upload_progress"
|
|
8
8
|
}, /*#__PURE__*/React.createElement("div", {
|
|
9
|
-
className:
|
|
9
|
+
className: "line",
|
|
10
10
|
style: {
|
|
11
11
|
width: "".concat(state.percent || 0, "%")
|
|
12
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import UploadPicture from './UploadPicture'; // 上传核心
|
|
3
3
|
// 渲染上传区域样式, 仅用于触发上传事件
|
|
4
4
|
// type: 'card' 图片 | 'drag' 拖拽
|
|
@@ -9,7 +9,8 @@ var UploadCore = function UploadCore(_ref) {
|
|
|
9
9
|
var accept = instance.accept,
|
|
10
10
|
children = instance.children,
|
|
11
11
|
beforeUpload = instance.beforeUpload,
|
|
12
|
-
getUploadStatus = instance.getUploadStatus
|
|
12
|
+
getUploadStatus = instance.getUploadStatus,
|
|
13
|
+
getIsMaxCount = instance.getIsMaxCount; // 点击事件触发文件上传
|
|
13
14
|
|
|
14
15
|
var handleClick = function handleClick() {
|
|
15
16
|
var _a;
|
|
@@ -31,7 +32,7 @@ var UploadCore = function UploadCore(_ref) {
|
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
var inputConfig = {
|
|
34
|
-
type:
|
|
35
|
+
type: 'file',
|
|
35
36
|
accept: accept,
|
|
36
37
|
title: '',
|
|
37
38
|
onChange: uploadChange,
|
|
@@ -39,7 +40,7 @@ var UploadCore = function UploadCore(_ref) {
|
|
|
39
40
|
display: 'none'
|
|
40
41
|
}
|
|
41
42
|
};
|
|
42
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
return !getIsMaxCount() && /*#__PURE__*/React.createElement("div", {
|
|
43
44
|
onClick: handleClick,
|
|
44
45
|
className: "lm_upload_core"
|
|
45
46
|
}, children || /*#__PURE__*/React.createElement(UploadPicture, {
|
|
@@ -11,22 +11,22 @@ var uploadPicture = function uploadPicture(_ref) {
|
|
|
11
11
|
return getUploadStatus().uploading;
|
|
12
12
|
}, [getUploadStatus]);
|
|
13
13
|
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
-
className:
|
|
14
|
+
className: "lm_upload_core_picture",
|
|
15
15
|
style: {
|
|
16
16
|
height: size,
|
|
17
17
|
width: size
|
|
18
18
|
}
|
|
19
19
|
}, /*#__PURE__*/React.createElement("div", {
|
|
20
|
-
className:
|
|
20
|
+
className: "lm_upload_core_picture_action"
|
|
21
21
|
}, !isUploading && /*#__PURE__*/React.createElement("div", {
|
|
22
|
-
className:
|
|
22
|
+
className: "action_plus"
|
|
23
23
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
24
24
|
type: "lmweb-plus",
|
|
25
25
|
style: {
|
|
26
26
|
fontSize: size > 48 ? 16 : 12
|
|
27
27
|
}
|
|
28
28
|
})), /*#__PURE__*/React.createElement("div", {
|
|
29
|
-
className:
|
|
29
|
+
className: "tip"
|
|
30
30
|
}, "\u4E0A\u4F20"), isUploading && /*#__PURE__*/React.createElement(Progress, {
|
|
31
31
|
instance: instance
|
|
32
32
|
})));
|
|
@@ -4,13 +4,18 @@ declare const useCoreOptions: ({ state, dispatch, props }: {
|
|
|
4
4
|
props: any;
|
|
5
5
|
}) => {
|
|
6
6
|
CoreMethods: {
|
|
7
|
+
getIsMaxCount: () => boolean;
|
|
7
8
|
beforeUpload: (e: any) => false | import("../../message").MessageType;
|
|
8
9
|
getUploadStatus: () => {
|
|
9
10
|
uploading: boolean;
|
|
10
11
|
};
|
|
12
|
+
remove: (file: any) => Promise<void>;
|
|
13
|
+
preview: (file: any) => void;
|
|
14
|
+
download: (file: any) => void;
|
|
11
15
|
};
|
|
12
16
|
RefMethods: {
|
|
13
17
|
getState: () => any;
|
|
18
|
+
getFileList: () => any;
|
|
14
19
|
};
|
|
15
20
|
};
|
|
16
21
|
export default useCoreOptions;
|