linkmore-design 1.1.13-alpha.0 → 1.1.13-alpha.10
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 +118 -0
- package/dist/Button/demos/ghost.d.ts +2 -0
- package/dist/ConfigProvider/context.d.ts +1 -0
- package/dist/Descriptions/Cell.d.ts +1 -0
- package/dist/Descriptions/Item.d.ts +1 -0
- package/dist/Descriptions/index.d.ts +1 -1
- package/dist/Form/FormWrapper.d.ts +3 -0
- package/dist/Form/WrapperItem.d.ts +4 -0
- package/dist/Form/demos/disabled.d.ts +2 -0
- package/dist/Form/demos/responsive.d.ts +0 -1
- package/dist/Form/index.d.ts +2 -0
- package/dist/Form/interface.d.ts +12 -0
- package/dist/IconFont/demos/ConfigProvider.d.ts +2 -0
- package/dist/IconFont/index.d.ts +1 -2
- package/dist/LmDrag/LmDrag.d.ts +4 -0
- package/dist/LmDrag/components/DndContainer.d.ts +3 -0
- package/dist/LmDrag/components/sortableBox.d.ts +5 -0
- package/dist/LmDrag/components/sortableItem.d.ts +7 -0
- package/dist/LmDrag/demos/basic.d.ts +2 -0
- package/dist/LmDrag/index.d.ts +10 -0
- package/dist/LmDrag/style/index.d.ts +1 -0
- package/dist/LmDrag/style/variables.d.ts +1 -0
- package/dist/LmDrag/wrapper/Root.d.ts +3 -0
- package/dist/LmEditTable/EditTable.d.ts +16 -3
- package/dist/LmEditTable/components/QuickOpetate.d.ts +12 -0
- package/dist/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
- package/dist/LmEditTable/components/index.d.ts +3 -1
- package/dist/LmFilter/LmFilter.d.ts +2 -6
- package/dist/LmTable/demos/summuy.d.ts +2 -0
- package/dist/LmTable/expression.d.ts +1 -0
- package/dist/LmTable/hooks/useGroupDataSource.d.ts +7 -0
- package/dist/LmUpload/UploadList/ItemPictureCard.d.ts +2 -1
- package/dist/LmUpload/fns/index.d.ts +1 -0
- package/dist/QuickMenu/demos/useInDraw.d.ts +2 -0
- package/dist/QuickMenu/index.d.ts +3 -1
- package/dist/Select/index.d.ts +3 -0
- package/dist/TreeSelect/demos/treedata.d.ts +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.umd.js +2660 -1507
- package/dist/index.umd.min.js +17 -17
- package/dist/variables.css +263 -120
- package/es/Button/index.js +4 -3
- package/es/Button/style/index.css +28 -25
- package/es/Button/style/variables.css +28 -25
- package/es/Cascader/index.js +31 -3
- package/es/Cascader/style/index.css +1 -0
- package/es/Cascader/style/variables.css +1 -0
- package/es/ConfigProvider/context.d.ts +1 -0
- package/es/ConfigProvider/index.js +5 -3
- package/es/Descriptions/Cell.d.ts +1 -0
- package/es/Descriptions/Cell.js +5 -2
- package/es/Descriptions/Item.d.ts +1 -0
- package/es/Descriptions/Row.js +6 -1
- package/es/Descriptions/index.d.ts +1 -1
- package/es/Descriptions/index.js +3 -3
- package/es/Descriptions/style/index.css +3 -0
- package/es/Descriptions/style/variables.css +3 -0
- package/es/Form/Form.js +13 -4
- package/es/Form/FormItem/ItemHolder.js +1 -10
- package/es/Form/FormWrapper.d.ts +3 -0
- package/es/Form/FormWrapper.js +22 -0
- package/es/Form/WrapperItem.d.ts +4 -0
- package/es/Form/WrapperItem.js +217 -0
- package/es/Form/container.js +1 -13
- package/es/Form/images/icon_collapse.svg +1 -0
- package/es/Form/index.d.ts +2 -0
- package/es/Form/index.js +2 -0
- package/es/Form/interface.d.ts +12 -0
- package/es/Form/style/index.css +34 -41
- package/es/Form/style/variables.css +34 -41
- package/es/IconFont/index.d.ts +1 -2
- package/es/IconFont/index.js +18 -4
- package/es/ImageViewer/components/Operate.js +4 -7
- package/es/Input/index.js +47 -10
- package/es/InputNumber/index.js +23 -11
- package/es/InputNumber/style/index.css +7 -0
- package/es/InputNumber/style/variables.css +7 -0
- package/es/LmDrag/LmDrag.d.ts +4 -0
- package/es/LmDrag/LmDrag.js +30 -0
- package/es/LmDrag/components/DndContainer.d.ts +3 -0
- package/es/LmDrag/components/DndContainer.js +121 -0
- package/es/LmDrag/components/sortableBox.d.ts +5 -0
- package/es/LmDrag/components/sortableBox.js +23 -0
- package/es/LmDrag/components/sortableItem.d.ts +7 -0
- package/es/LmDrag/components/sortableItem.js +41 -0
- package/es/LmDrag/index.d.ts +10 -0
- package/es/LmDrag/index.js +3 -0
- package/es/LmDrag/style/index.css +0 -0
- package/es/LmDrag/style/index.d.ts +1 -0
- package/es/LmDrag/style/index.js +1 -0
- package/es/LmDrag/style/variables.css +0 -0
- package/es/LmDrag/style/variables.d.ts +1 -0
- package/es/LmDrag/style/variables.js +1 -0
- package/es/LmDrag/wrapper/Root.d.ts +3 -0
- package/es/LmDrag/wrapper/Root.js +12 -0
- package/es/LmEditTable/EditTable.d.ts +16 -3
- package/es/LmEditTable/EditTable.js +276 -235
- package/es/LmEditTable/components/QuickOpetate.d.ts +12 -0
- package/es/LmEditTable/components/QuickOpetate.js +82 -0
- package/es/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
- package/es/LmEditTable/components/bottomOpetateComponent.js +23 -0
- package/es/LmEditTable/components/index.d.ts +3 -1
- package/es/LmEditTable/components/index.js +3 -1
- package/es/LmEditTable/sortableItemCol.js +40 -10
- package/es/LmEditTable/style/index.css +20 -0
- package/es/LmEditTable/style/variables.css +20 -0
- package/es/LmEditTable/util.js +51 -15
- package/es/LmFilter/LmFilter.js +6 -6
- package/es/LmFilter/components/CheckboxFilter.js +9 -4
- package/es/LmFilter/components/DropdownFIlter.js +186 -111
- package/es/LmFilter/components/SelectFilter.js +4 -3
- package/es/LmFilter/filterFns/index.js +4 -6
- package/es/LmFilter/index.js +0 -3
- package/es/LmFilter/style/index.css +82 -54
- package/es/LmFilter/style/variables.css +82 -54
- package/es/LmFilter/utils.js +6 -6
- package/es/LmSelect/style/index.css +1 -0
- package/es/LmSelect/style/variables.css +1 -0
- package/es/LmTable/Table.js +24 -15
- package/es/LmTable/expression.d.ts +1 -0
- package/es/LmTable/expression.js +31 -0
- package/es/LmTable/hooks/useGroupDataSource.js +50 -0
- package/es/LmTable/style/index.css +39 -0
- package/es/LmTable/style/variables.css +39 -0
- package/es/LmUpload/LmUpload.js +6 -3
- package/es/LmUpload/UploadList/ItemPicture.js +2 -1
- package/es/LmUpload/UploadList/ItemPictureCard.d.ts +2 -1
- package/es/LmUpload/UploadList/ItemPictureCard.js +15 -5
- package/es/LmUpload/UploadList/ItemText.js +7 -2
- package/es/LmUpload/UploadList/index.js +53 -2
- package/es/LmUpload/body/UploadCore.js +4 -1
- package/es/LmUpload/fns/index.d.ts +1 -0
- package/es/LmUpload/fns/index.js +27 -6
- package/es/LmUpload/style/index.css +17 -0
- package/es/LmUpload/style/variables.css +17 -0
- package/es/QuickMenu/index.d.ts +3 -1
- package/es/QuickMenu/index.js +22 -19
- package/es/Select/index.d.ts +3 -0
- package/es/Select/index.js +44 -7
- package/es/Select/style/index.css +28 -0
- package/es/Select/style/variables.css +28 -0
- package/es/TreeSelect/index.js +17 -2
- package/es/TreeSelect/style/index.css +3 -0
- package/es/TreeSelect/style/variables.css +3 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -1
- package/es/styles/variables.css +263 -120
- package/lib/Button/index.js +4 -3
- package/lib/Button/style/index.css +28 -25
- package/lib/Button/style/variables.css +28 -25
- package/lib/Cascader/index.js +35 -3
- package/lib/Cascader/style/index.css +1 -0
- package/lib/Cascader/style/variables.css +1 -0
- package/lib/ConfigProvider/context.d.ts +1 -0
- package/lib/ConfigProvider/index.js +5 -3
- package/lib/Descriptions/Cell.d.ts +1 -0
- package/lib/Descriptions/Cell.js +5 -2
- package/lib/Descriptions/Item.d.ts +1 -0
- package/lib/Descriptions/Row.js +6 -1
- package/lib/Descriptions/index.d.ts +1 -1
- package/lib/Descriptions/index.js +3 -3
- package/lib/Descriptions/style/index.css +3 -0
- package/lib/Descriptions/style/variables.css +3 -0
- package/lib/Form/Form.js +13 -4
- package/lib/Form/FormItem/ItemHolder.js +1 -10
- package/lib/Form/FormWrapper.d.ts +3 -0
- package/lib/Form/FormWrapper.js +34 -0
- package/lib/Form/WrapperItem.d.ts +4 -0
- package/lib/Form/WrapperItem.js +235 -0
- package/lib/Form/container.js +1 -13
- package/lib/Form/images/icon_collapse.svg +1 -0
- package/lib/Form/index.d.ts +2 -0
- package/lib/Form/index.js +3 -0
- package/lib/Form/interface.d.ts +12 -0
- package/lib/Form/style/index.css +34 -41
- package/lib/Form/style/variables.css +34 -41
- package/lib/IconFont/index.d.ts +1 -2
- package/lib/IconFont/index.js +25 -4
- package/lib/ImageViewer/components/Operate.js +4 -8
- package/lib/Input/index.js +52 -10
- package/lib/InputNumber/index.js +29 -11
- package/lib/InputNumber/style/index.css +7 -0
- package/lib/InputNumber/style/variables.css +7 -0
- package/lib/LmDrag/LmDrag.d.ts +4 -0
- package/lib/LmDrag/LmDrag.js +44 -0
- package/lib/LmDrag/components/DndContainer.d.ts +3 -0
- package/lib/LmDrag/components/DndContainer.js +138 -0
- package/lib/LmDrag/components/sortableBox.d.ts +5 -0
- package/lib/LmDrag/components/sortableBox.js +37 -0
- package/lib/LmDrag/components/sortableItem.d.ts +7 -0
- package/lib/LmDrag/components/sortableItem.js +54 -0
- package/lib/LmDrag/index.d.ts +10 -0
- package/lib/LmDrag/index.js +19 -0
- package/lib/LmDrag/style/index.css +0 -0
- package/lib/LmDrag/style/index.d.ts +1 -0
- package/lib/LmDrag/style/index.js +3 -0
- package/lib/LmDrag/style/variables.css +0 -0
- package/lib/LmDrag/style/variables.d.ts +1 -0
- package/lib/LmDrag/style/variables.js +3 -0
- package/lib/LmDrag/wrapper/Root.d.ts +3 -0
- package/lib/LmDrag/wrapper/Root.js +26 -0
- package/lib/LmEditTable/EditTable.d.ts +16 -3
- package/lib/LmEditTable/EditTable.js +272 -231
- package/lib/LmEditTable/components/QuickOpetate.d.ts +12 -0
- package/lib/LmEditTable/components/QuickOpetate.js +96 -0
- package/lib/LmEditTable/components/bottomOpetateComponent.d.ts +13 -0
- package/lib/LmEditTable/components/bottomOpetateComponent.js +34 -0
- package/lib/LmEditTable/components/index.d.ts +3 -1
- package/lib/LmEditTable/components/index.js +16 -0
- package/lib/LmEditTable/sortableItemCol.js +37 -8
- package/lib/LmEditTable/style/index.css +20 -0
- package/lib/LmEditTable/style/variables.css +20 -0
- package/lib/LmEditTable/util.js +50 -14
- package/lib/LmFilter/LmFilter.js +6 -6
- package/lib/LmFilter/components/CheckboxFilter.js +9 -4
- package/lib/LmFilter/components/DropdownFIlter.js +186 -111
- package/lib/LmFilter/components/SelectFilter.js +4 -3
- package/lib/LmFilter/filterFns/index.js +4 -6
- package/lib/LmFilter/index.js +0 -3
- package/lib/LmFilter/style/index.css +82 -54
- package/lib/LmFilter/style/variables.css +82 -54
- package/lib/LmFilter/utils.js +6 -6
- package/lib/LmSelect/style/index.css +1 -0
- package/lib/LmSelect/style/variables.css +1 -0
- package/lib/LmTable/Table.js +24 -15
- package/lib/LmTable/expression.d.ts +1 -0
- package/lib/LmTable/expression.js +41 -0
- package/lib/LmTable/hooks/useGroupDataSource.js +50 -0
- package/lib/LmTable/style/index.css +39 -0
- package/lib/LmTable/style/variables.css +39 -0
- package/lib/LmUpload/LmUpload.js +9 -3
- package/lib/LmUpload/UploadList/ItemPicture.js +2 -1
- package/lib/LmUpload/UploadList/ItemPictureCard.d.ts +2 -1
- package/lib/LmUpload/UploadList/ItemPictureCard.js +15 -5
- package/lib/LmUpload/UploadList/ItemText.js +7 -2
- package/lib/LmUpload/UploadList/index.js +54 -2
- package/lib/LmUpload/body/UploadCore.js +5 -1
- package/lib/LmUpload/fns/index.d.ts +1 -0
- package/lib/LmUpload/fns/index.js +27 -6
- package/lib/LmUpload/style/index.css +17 -0
- package/lib/LmUpload/style/variables.css +17 -0
- package/lib/QuickMenu/index.d.ts +3 -1
- package/lib/QuickMenu/index.js +21 -18
- package/lib/Select/index.d.ts +3 -0
- package/lib/Select/index.js +47 -7
- package/lib/Select/style/index.css +28 -0
- package/lib/Select/style/variables.css +28 -0
- package/lib/TreeSelect/index.js +21 -2
- package/lib/TreeSelect/style/index.css +3 -0
- package/lib/TreeSelect/style/variables.css +3 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +15 -1
- package/lib/styles/variables.css +263 -120
- package/package.json +5 -1
package/es/LmUpload/LmUpload.js
CHANGED
|
@@ -13,6 +13,7 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
13
13
|
|
|
14
14
|
import React, { useRef, useMemo, forwardRef } from 'react';
|
|
15
15
|
import LmFilterRoot from './wrapper/UploadRoot';
|
|
16
|
+
import DisabledContext from '../ConfigProvider/DisabledContext';
|
|
16
17
|
|
|
17
18
|
var LmUpload = function LmUpload(_a, ref) {
|
|
18
19
|
var _fileConfig = _a.fileConfig,
|
|
@@ -21,7 +22,8 @@ var LmUpload = function LmUpload(_a, ref) {
|
|
|
21
22
|
_ossConfig = _a.ossConfig,
|
|
22
23
|
resetProps = __rest(_a, ["fileConfig", "fileNames", "components", "ossConfig"]);
|
|
23
24
|
|
|
24
|
-
var defaultRef = useRef(null);
|
|
25
|
+
var defaultRef = useRef(null);
|
|
26
|
+
var disabled = React.useContext(DisabledContext); // 仅在初始化触发一次
|
|
25
27
|
|
|
26
28
|
var initConfig = useMemo(function () {
|
|
27
29
|
return {
|
|
@@ -73,12 +75,12 @@ var LmUpload = function LmUpload(_a, ref) {
|
|
|
73
75
|
size: 100,
|
|
74
76
|
fileSize: 10,
|
|
75
77
|
fileSizeType: 'M',
|
|
76
|
-
uid: '
|
|
78
|
+
uid: 'fileName',
|
|
77
79
|
accept: '',
|
|
78
80
|
type: ['jpg', 'jpeg', 'png'],
|
|
79
81
|
listType: 'card',
|
|
80
82
|
readOnly: false,
|
|
81
|
-
disabled: false,
|
|
83
|
+
disabled: disabled || false,
|
|
82
84
|
showUploadList: true,
|
|
83
85
|
fileList: null,
|
|
84
86
|
defaultFileList: [],
|
|
@@ -88,6 +90,7 @@ var LmUpload = function LmUpload(_a, ref) {
|
|
|
88
90
|
itemRender: null,
|
|
89
91
|
enabledPreview: true,
|
|
90
92
|
enabledCrop: false,
|
|
93
|
+
enableDrag: false,
|
|
91
94
|
enabledOss: false,
|
|
92
95
|
// oss配置
|
|
93
96
|
ossConfig: function ossConfig() {
|
|
@@ -6,6 +6,7 @@ var PictureItem = function PictureItem(_ref) {
|
|
|
6
6
|
var file = _ref.file,
|
|
7
7
|
instance = _ref.instance;
|
|
8
8
|
var readOnly = instance.readOnly,
|
|
9
|
+
disabled = instance.disabled,
|
|
9
10
|
remove = instance.remove,
|
|
10
11
|
preview = instance.preview,
|
|
11
12
|
download = instance.download,
|
|
@@ -27,7 +28,7 @@ var PictureItem = function PictureItem(_ref) {
|
|
|
27
28
|
onClick: function onClick() {
|
|
28
29
|
return download(file);
|
|
29
30
|
}
|
|
30
|
-
}, file[fileNames.fileName])), !readOnly && /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
}, file[fileNames.fileName])), !readOnly && !disabled && /*#__PURE__*/React.createElement("div", {
|
|
31
32
|
className: "picture_right lm_upload_item_action"
|
|
32
33
|
}, /*#__PURE__*/React.createElement("div", {
|
|
33
34
|
className: "action_delete",
|
|
@@ -64,8 +64,10 @@ var renderThumb = function renderThumb(file) {
|
|
|
64
64
|
var PictureItem = function PictureItem(_ref) {
|
|
65
65
|
var file = _ref.file,
|
|
66
66
|
index = _ref.index,
|
|
67
|
-
instance = _ref.instance
|
|
67
|
+
instance = _ref.instance,
|
|
68
|
+
listeners = _ref.listeners;
|
|
68
69
|
var dispatch = instance.dispatch,
|
|
70
|
+
disabled = instance.disabled,
|
|
69
71
|
readOnly = instance.readOnly,
|
|
70
72
|
size = instance.size,
|
|
71
73
|
remove = instance.remove,
|
|
@@ -121,13 +123,13 @@ var PictureItem = function PictureItem(_ref) {
|
|
|
121
123
|
});
|
|
122
124
|
};
|
|
123
125
|
|
|
124
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
126
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
125
127
|
className: cn('lm_upload_item', 'lm_upload_item_card', isError && 'lm_upload_item_error'),
|
|
126
128
|
style: {
|
|
127
129
|
height: size,
|
|
128
130
|
width: size
|
|
129
131
|
}
|
|
130
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
132
|
+
}, listeners || {}), /*#__PURE__*/React.createElement("div", {
|
|
131
133
|
className: "lm_upload_item_thumb"
|
|
132
134
|
}, isError || !isImg ? renderThumb(resetFile) : /*#__PURE__*/React.createElement(Image, {
|
|
133
135
|
width: resetSize.width,
|
|
@@ -139,7 +141,15 @@ var PictureItem = function PictureItem(_ref) {
|
|
|
139
141
|
})), /*#__PURE__*/React.createElement("div", {
|
|
140
142
|
className: "lm_upload_item_mask"
|
|
141
143
|
}, /*#__PURE__*/React.createElement("div", {
|
|
142
|
-
className: "lm_upload_item_action"
|
|
144
|
+
className: "lm_upload_item_action",
|
|
145
|
+
onKeyDown: function onKeyDown(e) {
|
|
146
|
+
e.stopPropagation();
|
|
147
|
+
e.preventDefault();
|
|
148
|
+
},
|
|
149
|
+
onPointerDown: function onPointerDown(e) {
|
|
150
|
+
e.stopPropagation();
|
|
151
|
+
e.preventDefault();
|
|
152
|
+
}
|
|
143
153
|
}, /*#__PURE__*/React.createElement("div", {
|
|
144
154
|
className: "action_preview",
|
|
145
155
|
onClick: handlePreview
|
|
@@ -148,7 +158,7 @@ var PictureItem = function PictureItem(_ref) {
|
|
|
148
158
|
style: {
|
|
149
159
|
fontSize: resetSize.fontSize
|
|
150
160
|
}
|
|
151
|
-
})), !readOnly && /*#__PURE__*/React.createElement("div", {
|
|
161
|
+
})), !readOnly && !disabled && /*#__PURE__*/React.createElement("div", {
|
|
152
162
|
className: "action_delete",
|
|
153
163
|
onClick: function onClick() {
|
|
154
164
|
return remove(file);
|
|
@@ -6,7 +6,9 @@ var TextItem = function TextItem(_ref) {
|
|
|
6
6
|
var file = _ref.file,
|
|
7
7
|
instance = _ref.instance;
|
|
8
8
|
var readOnly = instance.readOnly,
|
|
9
|
+
disabled = instance.disabled,
|
|
9
10
|
remove = instance.remove,
|
|
11
|
+
download = instance.download,
|
|
10
12
|
fileNames = instance.fileNames;
|
|
11
13
|
return /*#__PURE__*/React.createElement("div", {
|
|
12
14
|
className: cn('lm_upload_item lm_upload_item_text', file[fileNames.status] === 'error' && 'lm_upload_item_error')
|
|
@@ -17,8 +19,11 @@ var TextItem = function TextItem(_ref) {
|
|
|
17
19
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
18
20
|
type: "lmweb-attachment"
|
|
19
21
|
})), /*#__PURE__*/React.createElement("div", {
|
|
20
|
-
className: "lm_upload_item_name"
|
|
21
|
-
|
|
22
|
+
className: "lm_upload_item_name",
|
|
23
|
+
onClick: function onClick() {
|
|
24
|
+
return download(file);
|
|
25
|
+
}
|
|
26
|
+
}, file[fileNames.fileName])), !readOnly && !disabled && /*#__PURE__*/React.createElement("div", {
|
|
22
27
|
className: "text_right lm_upload_item_text_action"
|
|
23
28
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24
29
|
className: "action_delete",
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
|
+
import { LmDrag } from 'linkmore-design';
|
|
2
3
|
import { render } from '../utils';
|
|
3
4
|
import RenderItem from './RenderItem';
|
|
4
5
|
|
|
5
6
|
var LmUploadList = function LmUploadList(_ref) {
|
|
6
7
|
var instance = _ref.instance;
|
|
7
|
-
var
|
|
8
|
+
var uid = instance.uid,
|
|
9
|
+
getFileHasValue = instance.getFileHasValue,
|
|
8
10
|
getFileList = instance.getFileList,
|
|
9
11
|
itemRender = instance.itemRender,
|
|
10
12
|
listType = instance.listType,
|
|
11
|
-
showUploadList = instance.showUploadList
|
|
13
|
+
showUploadList = instance.showUploadList,
|
|
14
|
+
disabled = instance.disabled,
|
|
15
|
+
enableDrag = instance.enableDrag,
|
|
16
|
+
fileNames = instance.fileNames,
|
|
17
|
+
move = instance.move;
|
|
12
18
|
if (!showUploadList) return null;
|
|
13
19
|
var fileList = useMemo(function () {
|
|
14
20
|
var _a;
|
|
@@ -17,6 +23,51 @@ var LmUploadList = function LmUploadList(_ref) {
|
|
|
17
23
|
return a.seq - b.seq;
|
|
18
24
|
});
|
|
19
25
|
}, [getFileList]);
|
|
26
|
+
|
|
27
|
+
var handleMove = function handleMove(active, over, fileList) {
|
|
28
|
+
try {
|
|
29
|
+
var fileMap = fileList.map(function (v) {
|
|
30
|
+
if (getFileHasValue(v) === getFileHasValue(active)) {
|
|
31
|
+
return Object.assign(Object.assign({}, v), {
|
|
32
|
+
seq: over[fileNames.seq]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (getFileHasValue(v) === getFileHasValue(over)) {
|
|
37
|
+
return Object.assign(Object.assign({}, v), {
|
|
38
|
+
seq: active[fileNames.seq]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return v;
|
|
43
|
+
});
|
|
44
|
+
move(active, over, fileMap);
|
|
45
|
+
} catch (error) {
|
|
46
|
+
console.log('移动出现了错误', error);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
if (!disabled && enableDrag) {
|
|
51
|
+
return /*#__PURE__*/React.createElement(LmDrag, {
|
|
52
|
+
options: fileList,
|
|
53
|
+
rowKey: uid,
|
|
54
|
+
move: handleMove
|
|
55
|
+
}, function (_ref2) {
|
|
56
|
+
var item = _ref2.item,
|
|
57
|
+
listeners = _ref2.listeners,
|
|
58
|
+
index = _ref2.index;
|
|
59
|
+
return render(itemRender || RenderItem, {
|
|
60
|
+
type: listType,
|
|
61
|
+
key: getFileHasValue(item) || index,
|
|
62
|
+
index: index,
|
|
63
|
+
file: item,
|
|
64
|
+
fileList: fileList,
|
|
65
|
+
instance: instance,
|
|
66
|
+
listeners: listeners
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
20
71
|
return /*#__PURE__*/React.createElement(React.Fragment, null, fileList === null || fileList === void 0 ? void 0 : fileList.map(function (file, idx) {
|
|
21
72
|
return render(itemRender || RenderItem, {
|
|
22
73
|
type: listType,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
2
3
|
import UploadPicture from './UploadPicture'; // 上传核心
|
|
3
4
|
// 渲染上传区域样式, 仅用于触发上传事件
|
|
4
5
|
// type: 'card' 图片 | 'drag' 拖拽
|
|
@@ -10,6 +11,7 @@ var UploadCore = function UploadCore(_ref) {
|
|
|
10
11
|
|
|
11
12
|
var inputRef = React.useRef(null);
|
|
12
13
|
var accept = instance.accept,
|
|
14
|
+
disabled = instance.disabled,
|
|
13
15
|
children = instance.children,
|
|
14
16
|
beforeUpload = instance.beforeUpload,
|
|
15
17
|
getUploadStatus = instance.getUploadStatus,
|
|
@@ -18,6 +20,7 @@ var UploadCore = function UploadCore(_ref) {
|
|
|
18
20
|
var handleClick = useCallback(function () {
|
|
19
21
|
var _a;
|
|
20
22
|
|
|
23
|
+
if (disabled) return;
|
|
21
24
|
var isUploading = getUploadStatus().uploading;
|
|
22
25
|
if (isUploading) return;
|
|
23
26
|
(_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
@@ -43,7 +46,7 @@ var UploadCore = function UploadCore(_ref) {
|
|
|
43
46
|
};
|
|
44
47
|
return !getIsMaxCount() && /*#__PURE__*/React.createElement("div", {
|
|
45
48
|
onClick: handleClick,
|
|
46
|
-
className:
|
|
49
|
+
className: cn('lm_upload_core', disabled && 'disabled')
|
|
47
50
|
}, children || /*#__PURE__*/React.createElement(UploadPicture, {
|
|
48
51
|
instance: instance
|
|
49
52
|
}), /*#__PURE__*/React.createElement("input", Object.assign({
|
|
@@ -15,6 +15,7 @@ declare const useCoreOptions: ({ state, dispatch, props }: {
|
|
|
15
15
|
remove: (file: any) => Promise<void>;
|
|
16
16
|
preview: (file: any) => void;
|
|
17
17
|
download: (file: any) => void;
|
|
18
|
+
move: (active: any, over: any, fileList: any) => void;
|
|
18
19
|
};
|
|
19
20
|
RefMethods: {
|
|
20
21
|
getState: () => any;
|
package/es/LmUpload/fns/index.js
CHANGED
|
@@ -49,22 +49,28 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
49
49
|
fileAreaSize = props.fileAreaSize,
|
|
50
50
|
enabledOss = props.enabledOss,
|
|
51
51
|
enableCrop = props.enableCrop,
|
|
52
|
-
ossConfig = props.ossConfig;
|
|
52
|
+
ossConfig = props.ossConfig;
|
|
53
|
+
/* 获取两个对象是否存在指定值相等
|
|
54
|
+
* 取用户定义的列字段,如果读取不到则取'fileName'对比
|
|
55
|
+
*/
|
|
53
56
|
|
|
54
57
|
var getHasEqual = useCallback(function (obj1, obj2) {
|
|
55
58
|
var extend = [uid, 'fileName'];
|
|
56
59
|
var flag = false;
|
|
57
60
|
extend.forEach(function (v) {
|
|
58
|
-
if (!flag
|
|
61
|
+
if (!flag && obj1[v] && obj2[v]) {
|
|
62
|
+
flag = obj1[v] === obj2[v];
|
|
63
|
+
}
|
|
59
64
|
});
|
|
60
65
|
return flag;
|
|
61
|
-
}, []); // 从对象中读取存在的指定属性
|
|
66
|
+
}, [uid]); // 从对象中读取存在的指定属性
|
|
62
67
|
|
|
63
68
|
var getFileHasValue = useCallback(function (obj) {
|
|
69
|
+
if (!obj) return '';
|
|
64
70
|
var extend = [uid, 'fileName'];
|
|
65
71
|
var val = '';
|
|
66
72
|
extend.forEach(function (v) {
|
|
67
|
-
if (!val) val = obj[v];
|
|
73
|
+
if (!val && obj[v]) val = obj[v];
|
|
68
74
|
});
|
|
69
75
|
return val;
|
|
70
76
|
}, [uid]); // 获取当前的文件列表
|
|
@@ -465,7 +471,21 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
465
471
|
var _a;
|
|
466
472
|
|
|
467
473
|
(_a = props.onDownload) === null || _a === void 0 ? void 0 : _a.call(props, file);
|
|
468
|
-
}, [props.onDownload]);
|
|
474
|
+
}, [props.onDownload]); // 拖拽移动事件
|
|
475
|
+
|
|
476
|
+
var move = useCallback(function (active, over, fileList) {
|
|
477
|
+
var _a;
|
|
478
|
+
|
|
479
|
+
(_a = props.onMove) === null || _a === void 0 ? void 0 : _a.call(props, active, over, fileList);
|
|
480
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
481
|
+
file: active,
|
|
482
|
+
fileList: fileList
|
|
483
|
+
});
|
|
484
|
+
dispatch({
|
|
485
|
+
type: 'changeFileList',
|
|
486
|
+
fileList: fileList
|
|
487
|
+
});
|
|
488
|
+
}, [props.onMove, onChange, dispatch]);
|
|
469
489
|
var CoreMethods = {
|
|
470
490
|
getIsMaxCount: getIsMaxCount,
|
|
471
491
|
getFileHasValue: getFileHasValue,
|
|
@@ -475,7 +495,8 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
475
495
|
getUploadStatus: getUploadStatus,
|
|
476
496
|
remove: remove,
|
|
477
497
|
preview: preview,
|
|
478
|
-
download: download
|
|
498
|
+
download: download,
|
|
499
|
+
move: move
|
|
479
500
|
};
|
|
480
501
|
var RefMethods = {
|
|
481
502
|
getState: function getState() {
|
|
@@ -122,6 +122,7 @@
|
|
|
122
122
|
gap: 8px;
|
|
123
123
|
}
|
|
124
124
|
.lm_upload_wrapper .lm_upload_core {
|
|
125
|
+
position: relative;
|
|
125
126
|
display: inline-flex;
|
|
126
127
|
vertical-align: middle;
|
|
127
128
|
}
|
|
@@ -136,6 +137,12 @@
|
|
|
136
137
|
cursor: pointer;
|
|
137
138
|
transition: all 0.3s;
|
|
138
139
|
}
|
|
140
|
+
.lm_upload_wrapper .lm_upload_core .lm_upload_core_picture::after {
|
|
141
|
+
position: absolute;
|
|
142
|
+
background-color: var(--disabled-bg-color);
|
|
143
|
+
cursor: not-allowed;
|
|
144
|
+
inset: 0;
|
|
145
|
+
}
|
|
139
146
|
.lm_upload_wrapper .lm_upload_core .lm_upload_core_picture:hover {
|
|
140
147
|
border-color: var(--primary-color);
|
|
141
148
|
}
|
|
@@ -151,6 +158,16 @@
|
|
|
151
158
|
margin-top: var(--gap);
|
|
152
159
|
color: var(--color-45);
|
|
153
160
|
}
|
|
161
|
+
.lm_upload_wrapper .lm_upload_core.disabled .lm_upload_core_picture {
|
|
162
|
+
border-color: var(--disabled-border-color);
|
|
163
|
+
}
|
|
164
|
+
.lm_upload_wrapper .lm_upload_core.disabled .lm_upload_core_picture::after {
|
|
165
|
+
content: '';
|
|
166
|
+
}
|
|
167
|
+
.lm_upload_wrapper .lm_upload_core.disabled .lm_upload_core_picture .lm_upload_core_picture_action .action_plus,
|
|
168
|
+
.lm_upload_wrapper .lm_upload_core.disabled .lm_upload_core_picture .lm_upload_core_picture_action .tip {
|
|
169
|
+
color: var(--disabled-font-color);
|
|
170
|
+
}
|
|
154
171
|
.lm_upload_wrapper .lm_upload_progress {
|
|
155
172
|
width: 100%;
|
|
156
173
|
height: 2px;
|
|
@@ -122,6 +122,7 @@
|
|
|
122
122
|
gap: 8px;
|
|
123
123
|
}
|
|
124
124
|
.lm_upload_wrapper .lm_upload_core {
|
|
125
|
+
position: relative;
|
|
125
126
|
display: inline-flex;
|
|
126
127
|
vertical-align: middle;
|
|
127
128
|
}
|
|
@@ -136,6 +137,12 @@
|
|
|
136
137
|
cursor: pointer;
|
|
137
138
|
transition: all 0.3s;
|
|
138
139
|
}
|
|
140
|
+
.lm_upload_wrapper .lm_upload_core .lm_upload_core_picture::after {
|
|
141
|
+
position: absolute;
|
|
142
|
+
background-color: var(--disabled-bg-color);
|
|
143
|
+
cursor: not-allowed;
|
|
144
|
+
inset: 0;
|
|
145
|
+
}
|
|
139
146
|
.lm_upload_wrapper .lm_upload_core .lm_upload_core_picture:hover {
|
|
140
147
|
border-color: var(--primary-color);
|
|
141
148
|
}
|
|
@@ -151,6 +158,16 @@
|
|
|
151
158
|
margin-top: var(--gap);
|
|
152
159
|
color: var(--color-45);
|
|
153
160
|
}
|
|
161
|
+
.lm_upload_wrapper .lm_upload_core.disabled .lm_upload_core_picture {
|
|
162
|
+
border-color: var(--disabled-border-color);
|
|
163
|
+
}
|
|
164
|
+
.lm_upload_wrapper .lm_upload_core.disabled .lm_upload_core_picture::after {
|
|
165
|
+
content: '';
|
|
166
|
+
}
|
|
167
|
+
.lm_upload_wrapper .lm_upload_core.disabled .lm_upload_core_picture .lm_upload_core_picture_action .action_plus,
|
|
168
|
+
.lm_upload_wrapper .lm_upload_core.disabled .lm_upload_core_picture .lm_upload_core_picture_action .tip {
|
|
169
|
+
color: var(--disabled-font-color);
|
|
170
|
+
}
|
|
154
171
|
.lm_upload_wrapper .lm_upload_progress {
|
|
155
172
|
width: 100%;
|
|
156
173
|
height: 2px;
|
package/es/QuickMenu/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
interface IMenuData {
|
|
2
|
+
export interface IMenuData {
|
|
3
3
|
menuId: string;
|
|
4
4
|
title: string | React.ReactNode;
|
|
5
|
+
hidden?: boolean;
|
|
5
6
|
}
|
|
6
7
|
export interface IQuickMenuProps {
|
|
7
8
|
className?: string;
|
|
@@ -9,6 +10,7 @@ export interface IQuickMenuProps {
|
|
|
9
10
|
top?: number;
|
|
10
11
|
menuData: IMenuData[];
|
|
11
12
|
warpElement: any;
|
|
13
|
+
root?: IntersectionObserver['root'] | undefined;
|
|
12
14
|
}
|
|
13
15
|
declare const LMQuickMenu: React.FC<IQuickMenuProps>;
|
|
14
16
|
export default LMQuickMenu;
|
package/es/QuickMenu/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import React, { useEffect, useState, useRef } from 'react';
|
|
2
|
+
import React, { useEffect, useState, useRef, useMemo } from 'react';
|
|
3
3
|
import { IconFont, Button } from 'linkmore-design';
|
|
4
4
|
import { useScroll, useDebounceEffect } from 'ahooks';
|
|
5
5
|
import classNames from 'classnames';
|
|
@@ -12,7 +12,8 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
12
12
|
top = _props$top === void 0 ? '104px' : _props$top,
|
|
13
13
|
_props$menuData = props.menuData,
|
|
14
14
|
menuData = _props$menuData === void 0 ? [] : _props$menuData,
|
|
15
|
-
warpElement = props.warpElement
|
|
15
|
+
warpElement = props.warpElement,
|
|
16
|
+
root = props.root;
|
|
16
17
|
var idTopInfo = useRef({});
|
|
17
18
|
|
|
18
19
|
var _useState = useState(false),
|
|
@@ -31,6 +32,11 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
31
32
|
var scroll = useScroll(getTargetElement(warpElement || document), function () {
|
|
32
33
|
return scrollOpenStatus;
|
|
33
34
|
});
|
|
35
|
+
var filterMenuData = useMemo(function () {
|
|
36
|
+
return menuData === null || menuData === void 0 ? void 0 : menuData.filter(function (item) {
|
|
37
|
+
return item.hidden !== true;
|
|
38
|
+
});
|
|
39
|
+
}, [menuData]);
|
|
34
40
|
|
|
35
41
|
function clearActiveToc() {
|
|
36
42
|
[].forEach.call(document.querySelectorAll('.lm_menu_list li a'), function (node) {
|
|
@@ -54,7 +60,7 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
54
60
|
(_a = menuTimeEventRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
55
61
|
}
|
|
56
62
|
|
|
57
|
-
if (!
|
|
63
|
+
if (!filterMenuData.length) {
|
|
58
64
|
return;
|
|
59
65
|
} // eslint-disable-next-line global-require
|
|
60
66
|
|
|
@@ -65,12 +71,13 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
65
71
|
var scrollama = require('scrollama');
|
|
66
72
|
|
|
67
73
|
menuTimeEventRef.current = scrollama();
|
|
74
|
+
console.log(getTargetElement(warpElement || document), '--getTargetElement(warpElement || document)');
|
|
68
75
|
(_c = (_b = menuTimeEventRef.current) === null || _b === void 0 ? void 0 : _b.setup({
|
|
69
|
-
step:
|
|
76
|
+
step: filterMenuData.map(function (item) {
|
|
70
77
|
return document.getElementById("".concat(item.menuId));
|
|
71
|
-
}).filter(Boolean)
|
|
72
|
-
|
|
73
|
-
|
|
78
|
+
}).filter(Boolean),
|
|
79
|
+
container: getTargetElement(warpElement || document),
|
|
80
|
+
root: root ? getTargetElement(root) : undefined
|
|
74
81
|
})) === null || _c === void 0 ? void 0 : _c.onStepEnter(function (_ref) {
|
|
75
82
|
var element = _ref.element;
|
|
76
83
|
updateActiveToc(element.id);
|
|
@@ -78,7 +85,7 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
78
85
|
};
|
|
79
86
|
|
|
80
87
|
function setKeysDom() {
|
|
81
|
-
|
|
88
|
+
filterMenuData.forEach(function (item) {
|
|
82
89
|
var _a, _b;
|
|
83
90
|
|
|
84
91
|
var warpTop = ((_a = getTargetElement(warpElement || document)) === null || _a === void 0 ? void 0 : _a.offsetTop) || 0;
|
|
@@ -102,12 +109,6 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
102
109
|
wait: 50
|
|
103
110
|
});
|
|
104
111
|
|
|
105
|
-
var bindDom = function bindDom() {
|
|
106
|
-
if (!Object.keys(idTopInfo.current).length) {
|
|
107
|
-
setKeysDom();
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
|
|
111
112
|
var handleScroll = function handleScroll() {
|
|
112
113
|
setScrollOpenStatus(true);
|
|
113
114
|
};
|
|
@@ -122,10 +123,6 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
122
123
|
var _a; // bindScroller();
|
|
123
124
|
|
|
124
125
|
|
|
125
|
-
setTimeout(function () {
|
|
126
|
-
bindDom();
|
|
127
|
-
bindScroller();
|
|
128
|
-
}, 200);
|
|
129
126
|
(_a = getTargetElement(warpElement || document)) === null || _a === void 0 ? void 0 : _a.addEventListener('scroll', handleScroll, {
|
|
130
127
|
once: true
|
|
131
128
|
});
|
|
@@ -135,6 +132,12 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
135
132
|
(_a = getTargetElement(warpElement || document)) === null || _a === void 0 ? void 0 : _a.removeEventListener('scroll', handleScroll);
|
|
136
133
|
};
|
|
137
134
|
}, []);
|
|
135
|
+
useEffect(function () {
|
|
136
|
+
setTimeout(function () {
|
|
137
|
+
setKeysDom();
|
|
138
|
+
bindScroller();
|
|
139
|
+
}, 200);
|
|
140
|
+
}, [filterMenuData]);
|
|
138
141
|
return /*#__PURE__*/React.createElement("div", {
|
|
139
142
|
className: classNames(prefixCls),
|
|
140
143
|
onMouseEnter: function onMouseEnter() {
|
|
@@ -156,7 +159,7 @@ var LMQuickMenu = function LMQuickMenu(props) {
|
|
|
156
159
|
})
|
|
157
160
|
}), /*#__PURE__*/React.createElement("ul", {
|
|
158
161
|
className: classNames('lm_menu_list', hovering && 'show', className)
|
|
159
|
-
},
|
|
162
|
+
}, filterMenuData.map(function (item) {
|
|
160
163
|
return /*#__PURE__*/React.createElement("li", {
|
|
161
164
|
key: item.menuId,
|
|
162
165
|
onClick: function onClick() {
|
package/es/Select/index.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ export interface ISelectProps extends SelectProps {
|
|
|
6
6
|
Option?: typeof Select.Option;
|
|
7
7
|
OptGroup?: typeof Select.OptGroup;
|
|
8
8
|
defaultLabel?: string;
|
|
9
|
+
suffix?: React.ReactNode;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
iconClick?: () => void;
|
|
9
12
|
}
|
|
10
13
|
declare type SelectType = typeof Select & typeof Select.Option & typeof Select.OptGroup;
|
|
11
14
|
declare const LMSelect: SelectType;
|
package/es/Select/index.js
CHANGED
|
@@ -15,20 +15,31 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
import React, { forwardRef, useMemo } from 'react';
|
|
18
|
+
import Button from '../Button';
|
|
18
19
|
import classNames from 'classnames';
|
|
19
20
|
import SizeContext from '../ConfigProvider/SizeContext';
|
|
21
|
+
import DisabledContext from '../ConfigProvider/DisabledContext';
|
|
20
22
|
var prefixCls = 'lm_select';
|
|
21
23
|
var CLMSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
22
24
|
var children = props.children,
|
|
23
25
|
className = props.className,
|
|
24
26
|
customizeSize = props.size,
|
|
27
|
+
customDisabled = props.disabled,
|
|
25
28
|
dropdownClassName = props.dropdownClassName,
|
|
26
29
|
options = props.options,
|
|
27
30
|
value = props.value,
|
|
28
31
|
defaultLabel = props.defaultLabel,
|
|
29
|
-
|
|
32
|
+
suffix = props.suffix,
|
|
33
|
+
icon = props.icon,
|
|
34
|
+
iconClick = props.iconClick,
|
|
35
|
+
rest = __rest(props // ===================== Size =====================
|
|
36
|
+
, ["children", "className", "size", "disabled", "dropdownClassName", "options", "value", "defaultLabel", "suffix", "icon", "iconClick"]); // ===================== Size =====================
|
|
30
37
|
|
|
31
|
-
|
|
38
|
+
|
|
39
|
+
var size = customizeSize || React.useContext(SizeContext) || 'middle'; // ===================== Disabled =====================
|
|
40
|
+
|
|
41
|
+
var disabled = React.useContext(DisabledContext);
|
|
42
|
+
var mergedDisabled = customDisabled || disabled; // 当前值是否存于选项中
|
|
32
43
|
|
|
33
44
|
var hasOption = useMemo(function () {
|
|
34
45
|
var flag = false;
|
|
@@ -47,24 +58,50 @@ var CLMSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
47
58
|
|
|
48
59
|
if (options) {
|
|
49
60
|
flag = !!options.some(function (v) {
|
|
50
|
-
|
|
61
|
+
var _a, _b;
|
|
62
|
+
|
|
63
|
+
return v[(_b = (_a = props.fieldNames) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 'value'] === value;
|
|
51
64
|
});
|
|
52
65
|
}
|
|
53
66
|
|
|
54
67
|
return flag;
|
|
55
|
-
}, [children, value, options]); // 重组value: 传入value但找不到options项时,展示默认label
|
|
68
|
+
}, [children, value, options, props.fieldNames]); // 重组value: 传入value但找不到options项时,展示默认label
|
|
56
69
|
|
|
57
70
|
var resetValue = useMemo(function () {
|
|
58
71
|
if (value && !hasOption) return defaultLabel !== null && defaultLabel !== void 0 ? defaultLabel : value;
|
|
59
72
|
return value;
|
|
60
|
-
}, [value, hasOption]);
|
|
73
|
+
}, [value, defaultLabel, hasOption]);
|
|
74
|
+
|
|
75
|
+
if (icon) {
|
|
76
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
className: 'lm_select_has_icon',
|
|
78
|
+
style: props.style
|
|
79
|
+
}, /*#__PURE__*/React.createElement(_Select, Object.assign({
|
|
80
|
+
className: classNames(className, prefixCls),
|
|
81
|
+
size: size,
|
|
82
|
+
ref: ref,
|
|
83
|
+
value: resetValue,
|
|
84
|
+
options: options,
|
|
85
|
+
disabled: mergedDisabled || undefined
|
|
86
|
+
}, rest, {
|
|
87
|
+
dropdownClassName: classNames('lm_select_dropdown', dropdownClassName)
|
|
88
|
+
}), children), /*#__PURE__*/React.createElement(Button, {
|
|
89
|
+
size: size,
|
|
90
|
+
onClick: iconClick,
|
|
91
|
+
className: 'lm_select_icon_button',
|
|
92
|
+
disabled: mergedDisabled || undefined,
|
|
93
|
+
icon: icon
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
|
|
61
97
|
return /*#__PURE__*/React.createElement(_Select, Object.assign({
|
|
62
98
|
className: classNames(className, prefixCls),
|
|
63
99
|
size: size,
|
|
64
100
|
ref: ref,
|
|
65
101
|
value: resetValue,
|
|
66
|
-
options: options
|
|
67
|
-
|
|
102
|
+
options: options,
|
|
103
|
+
disabled: mergedDisabled || undefined
|
|
104
|
+
}, rest, {
|
|
68
105
|
dropdownClassName: classNames('lm_select_dropdown', dropdownClassName)
|
|
69
106
|
}), children);
|
|
70
107
|
});
|
|
@@ -512,6 +512,7 @@ p {
|
|
|
512
512
|
}
|
|
513
513
|
.lm_select.ant-select {
|
|
514
514
|
font-size: 12px;
|
|
515
|
+
width: 100%;
|
|
515
516
|
}
|
|
516
517
|
.lm_select.ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector {
|
|
517
518
|
box-shadow: none;
|
|
@@ -525,3 +526,30 @@ p {
|
|
|
525
526
|
.lm_select_dropdown .ant-select-item-option-disabled {
|
|
526
527
|
color: var(--disabled-font-color);
|
|
527
528
|
}
|
|
529
|
+
.lm_select_has_icon {
|
|
530
|
+
width: 100%;
|
|
531
|
+
display: flex;
|
|
532
|
+
flex-direction: row;
|
|
533
|
+
align-items: center;
|
|
534
|
+
justify-content: flex-start;
|
|
535
|
+
position: relative;
|
|
536
|
+
}
|
|
537
|
+
.lm_select_has_icon .ant-select {
|
|
538
|
+
border-top-right-radius: 0;
|
|
539
|
+
border-bottom-right-radius: 0;
|
|
540
|
+
z-index: 3;
|
|
541
|
+
}
|
|
542
|
+
.lm_select_has_icon .ant-select .ant-select-selector {
|
|
543
|
+
border-top-right-radius: 0 !important;
|
|
544
|
+
border-bottom-right-radius: 0 !important;
|
|
545
|
+
}
|
|
546
|
+
.lm_select_has_icon .lm_select_icon_button {
|
|
547
|
+
margin-left: -1px;
|
|
548
|
+
border-top-left-radius: 0;
|
|
549
|
+
border-bottom-left-radius: 0;
|
|
550
|
+
z-index: 2;
|
|
551
|
+
}
|
|
552
|
+
.lm_select_has_icon .lm_select_icon_button:hover,
|
|
553
|
+
.lm_select_has_icon .lm_select_icon_button:focus {
|
|
554
|
+
z-index: 5;
|
|
555
|
+
}
|