linkmore-design 1.0.69 → 1.0.70
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/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/LmUpload/LmUpload.d.ts +2 -0
- package/dist/LmUpload/UploadList/index.d.ts +4 -3
- package/dist/LmUpload/fns/index.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.umd.js +4080 -602
- package/dist/index.umd.min.js +6 -6
- 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/LmFilter/components/CascaderFilter.js +3 -1
- package/es/LmFilter/components/CheckboxFilter.js +3 -3
- package/es/LmFilter/components/DropdownFIlter.js +61 -53
- package/es/LmFilter/components/index.js +6 -4
- package/es/LmFilter/filterFns/index.js +1 -1
- package/es/LmFilter/utils.js +2 -0
- package/es/LmUpload/LmUpload.d.ts +2 -0
- package/es/LmUpload/LmUpload.js +24 -15
- package/es/LmUpload/UploadList/ItemPicture.js +13 -4
- package/es/LmUpload/UploadList/ItemText.js +2 -1
- package/es/LmUpload/UploadList/index.d.ts +4 -3
- package/es/LmUpload/UploadList/index.js +9 -8
- package/es/LmUpload/body/UploadCore.js +5 -9
- package/es/LmUpload/fns/index.d.ts +3 -0
- package/es/LmUpload/fns/index.js +98 -47
- package/es/LmUpload/style/index.css +6 -0
- package/es/LmUpload/view/index.js +2 -2
- package/es/LmUpload/wrapper/UploadContainer.js +2 -2
- package/es/LmUpload/wrapper/UploadRoot.js +10 -29
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -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/LmFilter/components/CascaderFilter.js +3 -1
- package/lib/LmFilter/components/CheckboxFilter.js +3 -3
- package/lib/LmFilter/components/DropdownFIlter.js +61 -53
- package/lib/LmFilter/components/index.js +6 -4
- package/lib/LmFilter/filterFns/index.js +1 -1
- package/lib/LmFilter/utils.js +2 -0
- package/lib/LmUpload/LmUpload.d.ts +2 -0
- package/lib/LmUpload/LmUpload.js +24 -15
- package/lib/LmUpload/UploadList/ItemPicture.js +16 -4
- package/lib/LmUpload/UploadList/ItemText.js +5 -1
- package/lib/LmUpload/UploadList/index.d.ts +4 -3
- package/lib/LmUpload/UploadList/index.js +10 -10
- package/lib/LmUpload/body/UploadCore.js +5 -11
- package/lib/LmUpload/fns/index.d.ts +3 -0
- package/lib/LmUpload/fns/index.js +98 -47
- package/lib/LmUpload/style/index.css +6 -0
- package/lib/LmUpload/view/index.js +2 -2
- package/lib/LmUpload/wrapper/UploadContainer.js +2 -2
- package/lib/LmUpload/wrapper/UploadRoot.js +10 -29
- package/lib/index.d.ts +1 -0
- package/lib/index.js +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
.lm_upload_wrapper {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
gap: 8px;
|
|
5
|
+
}
|
|
6
|
+
.lm_upload_wrapper .lm_upload_core {
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
vertical-align: middle;
|
|
9
|
+
}
|
|
10
|
+
.lm_upload_wrapper .lm_upload_core .lm_upload_core_picture {
|
|
11
|
+
font-size: 12px;
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
text-align: center;
|
|
16
|
+
border: 1px solid var(--color-15);
|
|
17
|
+
background-color: var(--color-2);
|
|
18
|
+
transition: all 0.3s;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
21
|
+
.lm_upload_wrapper .lm_upload_core .lm_upload_core_picture:hover {
|
|
22
|
+
border-color: var(--primary-color);
|
|
23
|
+
}
|
|
24
|
+
.lm_upload_wrapper .lm_upload_core .lm_upload_core_picture .lm_upload_core_picture_action {
|
|
25
|
+
width: 100%;
|
|
26
|
+
text-align: center;
|
|
27
|
+
padding: var(--gap);
|
|
28
|
+
}
|
|
29
|
+
.lm_upload_wrapper .lm_upload_core .lm_upload_core_picture .lm_upload_core_picture_action .action_plus {
|
|
30
|
+
color: var(--color-85);
|
|
31
|
+
}
|
|
32
|
+
.lm_upload_wrapper .lm_upload_core .lm_upload_core_picture .lm_upload_core_picture_action .tip {
|
|
33
|
+
color: var(--color-45);
|
|
34
|
+
margin-top: var(--gap);
|
|
35
|
+
}
|
|
36
|
+
.lm_upload_wrapper .lm_upload_progress {
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 2px;
|
|
39
|
+
background-color: var(--color-4);
|
|
40
|
+
border-radius: 20px;
|
|
41
|
+
margin: 10px 0;
|
|
42
|
+
}
|
|
43
|
+
.lm_upload_wrapper .lm_upload_progress .line {
|
|
44
|
+
width: 0%;
|
|
45
|
+
height: 2px;
|
|
46
|
+
transition: 0.3;
|
|
47
|
+
background-color: var(--primary-color);
|
|
48
|
+
border-radius: 20px;
|
|
49
|
+
}
|
|
50
|
+
.lm_upload_wrapper .lm_upload_item {
|
|
51
|
+
vertical-align: middle;
|
|
52
|
+
}
|
|
53
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_text {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
gap: var(--gap);
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 22px;
|
|
60
|
+
padding: 0 6px;
|
|
61
|
+
transition: 0.3s;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
}
|
|
64
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_text:hover {
|
|
65
|
+
background-color: var(--color-2);
|
|
66
|
+
}
|
|
67
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_text .text_left {
|
|
68
|
+
flex: 1;
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: var(--gap);
|
|
72
|
+
}
|
|
73
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_text .text_left .prefix {
|
|
74
|
+
font-size: 14px;
|
|
75
|
+
color: var(--color-45);
|
|
76
|
+
transition: 0.3s;
|
|
77
|
+
}
|
|
78
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_text .text_left .lm_upload_item_name {
|
|
79
|
+
flex: 1;
|
|
80
|
+
font-size: 14px;
|
|
81
|
+
color: var(--primary-color);
|
|
82
|
+
transition: 0.3s;
|
|
83
|
+
}
|
|
84
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_text .text_right {
|
|
85
|
+
display: inline-flex;
|
|
86
|
+
}
|
|
87
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_text .text_right .action_delete {
|
|
88
|
+
width: 24px;
|
|
89
|
+
text-align: center;
|
|
90
|
+
color: var(--color-45);
|
|
91
|
+
transition: 0.3s;
|
|
92
|
+
}
|
|
93
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_text .text_right .action_delete .anticon {
|
|
94
|
+
font-size: 14px;
|
|
95
|
+
}
|
|
96
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_text .text_right .action_delete:hover {
|
|
97
|
+
color: var(--primary-color);
|
|
98
|
+
}
|
|
99
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_text.error {
|
|
100
|
+
color: var(--error-color);
|
|
101
|
+
}
|
|
102
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_card {
|
|
103
|
+
position: relative;
|
|
104
|
+
display: inline-flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
text-align: center;
|
|
108
|
+
border: 1px solid var(--color-15);
|
|
109
|
+
border-radius: 2px;
|
|
110
|
+
padding: var(--gap);
|
|
111
|
+
transition: all 0.3s;
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
}
|
|
114
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_card .lm_upload_item_thumb {
|
|
115
|
+
width: 100%;
|
|
116
|
+
}
|
|
117
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_card .lm_upload_item_thumb .anticon {
|
|
118
|
+
font-size: 34px;
|
|
119
|
+
color: var(--color-45);
|
|
120
|
+
}
|
|
121
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_card .lm_upload_item_thumb img {
|
|
122
|
+
object-fit: contain;
|
|
123
|
+
}
|
|
124
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_card .lm_upload_item_error .lm_upload_item_name {
|
|
125
|
+
font-size: 12px;
|
|
126
|
+
text-overflow: ellipsis;
|
|
127
|
+
overflow: hidden;
|
|
128
|
+
margin-top: 8px;
|
|
129
|
+
}
|
|
130
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_card .lm_upload_item_mask {
|
|
131
|
+
position: absolute;
|
|
132
|
+
inset: 8px;
|
|
133
|
+
display: flex;
|
|
134
|
+
align-items: center;
|
|
135
|
+
justify-content: center;
|
|
136
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
137
|
+
opacity: 0;
|
|
138
|
+
transition: 0.3s;
|
|
139
|
+
z-index: 1;
|
|
140
|
+
}
|
|
141
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_card .lm_upload_item_mask .lm_upload_item_action {
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
gap: var(--gap);
|
|
145
|
+
color: #fff;
|
|
146
|
+
}
|
|
147
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_card:hover .lm_upload_item_mask {
|
|
148
|
+
opacity: 1;
|
|
149
|
+
}
|
|
150
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_card.error {
|
|
151
|
+
border-color: var(--error-color);
|
|
152
|
+
}
|
|
153
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_card.error .lm_upload_item_mask {
|
|
154
|
+
display: none;
|
|
155
|
+
}
|
|
156
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_card.error .lm_upload_item_error {
|
|
157
|
+
color: var(--error-color);
|
|
158
|
+
}
|
|
159
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_picture {
|
|
160
|
+
display: flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
justify-content: space-between;
|
|
163
|
+
gap: var(--gap);
|
|
164
|
+
width: 100%;
|
|
165
|
+
border: 1px solid var(--color-15);
|
|
166
|
+
border-radius: 2px;
|
|
167
|
+
padding: var(--gap);
|
|
168
|
+
transition: 0.3s;
|
|
169
|
+
cursor: pointer;
|
|
170
|
+
}
|
|
171
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_picture:hover {
|
|
172
|
+
border-color: var(--primary-color);
|
|
173
|
+
}
|
|
174
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_picture .picture_left {
|
|
175
|
+
flex: 1;
|
|
176
|
+
display: inline-flex;
|
|
177
|
+
align-items: center;
|
|
178
|
+
gap: var(--gap);
|
|
179
|
+
}
|
|
180
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_picture .picture_left .lm_upload_item_thumb {
|
|
181
|
+
width: 48px;
|
|
182
|
+
}
|
|
183
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_picture .picture_left .lm_upload_item_thumb img {
|
|
184
|
+
width: 100%;
|
|
185
|
+
max-height: 80px;
|
|
186
|
+
}
|
|
187
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_picture .picture_left .lm_upload_item_name {
|
|
188
|
+
flex: 1;
|
|
189
|
+
font-size: 14px;
|
|
190
|
+
color: var(--primary-color);
|
|
191
|
+
transition: 0.3s;
|
|
192
|
+
}
|
|
193
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_picture .picture_right {
|
|
194
|
+
display: flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
}
|
|
197
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_picture .picture_right .action_delete {
|
|
198
|
+
width: 24px;
|
|
199
|
+
text-align: center;
|
|
200
|
+
color: var(--color-45);
|
|
201
|
+
transition: 0.3s;
|
|
202
|
+
}
|
|
203
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_picture .picture_right .action_delete .anticon {
|
|
204
|
+
font-size: 14px;
|
|
205
|
+
}
|
|
206
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_picture .picture_right .action_delete:hover {
|
|
207
|
+
color: var(--primary-color);
|
|
208
|
+
}
|
|
209
|
+
.lm_upload_wrapper .lm_upload_item.lm_upload_item_picture.error {
|
|
210
|
+
color: var(--error-color);
|
|
211
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
// 根文件 => 参数聚合
|
|
13
|
+
var LmImageViewerRoot = function LmImageViewerRoot(props, ref) {
|
|
14
|
+
// 向外暴露出的方法
|
|
15
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
16
|
+
return {};
|
|
17
|
+
});
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement("div", null, "ImageViewer");
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var _default = /*#__PURE__*/(0, _react.forwardRef)(LmImageViewerRoot);
|
|
22
|
+
|
|
23
|
+
exports.default = _default;
|
|
@@ -49,7 +49,9 @@ var DropdownRender = function DropdownRender(_ref) {
|
|
|
49
49
|
|
|
50
50
|
var handleFilter = function handleFilter(val) {
|
|
51
51
|
var serachValues = filters.filter(function (v) {
|
|
52
|
-
|
|
52
|
+
var _v, _item$props2, _item$props2$fieldNam;
|
|
53
|
+
|
|
54
|
+
return ((_v = v[(item === null || item === void 0 ? void 0 : (_item$props2 = item.props) === null || _item$props2 === void 0 ? void 0 : (_item$props2$fieldNam = _item$props2.fieldNames) === null || _item$props2$fieldNam === void 0 ? void 0 : _item$props2$fieldNam.label) || 'label']) === null || _v === void 0 ? void 0 : _v.indexOf(val)) > -1;
|
|
53
55
|
});
|
|
54
56
|
setOptions(serachValues);
|
|
55
57
|
}; // 确定
|
|
@@ -21,12 +21,12 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
21
21
|
|
|
22
22
|
var _linkmoreDesign = require("linkmore-design");
|
|
23
23
|
|
|
24
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
25
|
+
|
|
24
26
|
var _InputSearchClose = _interopRequireDefault(require("./InputSearchClose"));
|
|
25
27
|
|
|
26
28
|
var _EmptyFilter = _interopRequireDefault(require("./EmptyFilter"));
|
|
27
29
|
|
|
28
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
29
|
-
|
|
30
30
|
var _utils = require("../utils");
|
|
31
31
|
|
|
32
32
|
var _hooks = require("../hooks");
|
|
@@ -112,7 +112,7 @@ var CheckboxFilter = function CheckboxFilter(_ref) {
|
|
|
112
112
|
var handleCancel = function handleCancel() {
|
|
113
113
|
// 手动触发内容改变(不会触发onChange事件)
|
|
114
114
|
setVisible === null || setVisible === void 0 ? void 0 : setVisible(false);
|
|
115
|
-
}; // 确定 执行查询操作
|
|
115
|
+
}; // 确定 执行查询操作
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
var handleSure = function handleSure() {
|
|
@@ -99,85 +99,93 @@ var getPlacehodler = function getPlacehodler(props) {
|
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
var getLabel = function getLabel(filterValue, item) {
|
|
102
|
-
var _data$find;
|
|
103
|
-
|
|
104
102
|
var type = item.type,
|
|
105
103
|
data = item.data; // 不存在筛选时
|
|
106
104
|
|
|
107
105
|
if (!(0, _utils.getIsHas)(filterValue)) {
|
|
108
106
|
return getPlacehodler(item);
|
|
109
107
|
} // 存在筛选数据时 ⬇️
|
|
110
|
-
// 级联数据转换平级结构
|
|
111
108
|
|
|
112
109
|
|
|
113
|
-
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
try {
|
|
111
|
+
var _data$find;
|
|
112
|
+
|
|
113
|
+
// 级联数据转换平级结构
|
|
114
|
+
if (['cascader'].includes(type)) {
|
|
115
|
+
var nArr = (0, _utils.getFlatItem)(item, filterValue);
|
|
116
|
+
var labels = nArr === null || nArr === void 0 ? void 0 : nArr.map(function (v) {
|
|
117
|
+
var _item$props, _item$props$fieldName;
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
return v[(item === null || item === void 0 ? void 0 : (_item$props = item.props) === null || _item$props === void 0 ? void 0 : (_item$props$fieldName = _item$props.fieldNames) === null || _item$props$fieldName === void 0 ? void 0 : _item$props$fieldName.label) || 'label'];
|
|
120
|
+
});
|
|
120
121
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
switch (labels.length) {
|
|
123
|
+
case 0:
|
|
124
|
+
// 数据未查找到时
|
|
125
|
+
return filterValue;
|
|
124
126
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
+
case 1:
|
|
128
|
+
return labels[0];
|
|
127
129
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
+
case 2:
|
|
131
|
+
return "".concat(labels[0], "\u3001").concat(labels[1]);
|
|
132
|
+
|
|
133
|
+
default:
|
|
134
|
+
return "".concat(labels[0], "\u3001+").concat(labels.length - 1, "...");
|
|
135
|
+
}
|
|
130
136
|
}
|
|
131
|
-
}
|
|
132
137
|
|
|
133
|
-
|
|
134
|
-
|
|
138
|
+
if (Array.isArray(filterValue)) {
|
|
139
|
+
var _data$filter;
|
|
135
140
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
// 日期
|
|
142
|
+
if (['date'].includes(type)) {
|
|
143
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, filterValue[0], /*#__PURE__*/_react.default.createElement(_linkmoreDesign.IconFont, {
|
|
144
|
+
type: "lmweb-swap-right",
|
|
145
|
+
style: {
|
|
146
|
+
fontSize: 14,
|
|
147
|
+
color: 'var(--text-color)'
|
|
148
|
+
}
|
|
149
|
+
}), filterValue[1]);
|
|
150
|
+
} // 多选
|
|
146
151
|
|
|
147
152
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
var _labels = data === null || data === void 0 ? void 0 : (_data$filter = data.filter(function (v) {
|
|
154
|
+
return filterValue.includes(v.value);
|
|
155
|
+
})) === null || _data$filter === void 0 ? void 0 : _data$filter.map(function (v) {
|
|
156
|
+
return v.label;
|
|
157
|
+
});
|
|
153
158
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
159
|
+
if (!_labels.length) {
|
|
160
|
+
_labels = filterValue;
|
|
161
|
+
} // 受控模式未查找到显示的内容时展示
|
|
157
162
|
|
|
158
163
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
164
|
+
switch (_labels.length) {
|
|
165
|
+
case 1:
|
|
166
|
+
return _labels[0];
|
|
162
167
|
|
|
163
|
-
|
|
164
|
-
|
|
168
|
+
case 2:
|
|
169
|
+
return "".concat(_labels[0], "\u3001").concat(_labels[1]);
|
|
165
170
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
171
|
+
default:
|
|
172
|
+
return "".concat(_labels[0], "\u3001+").concat(_labels.length - 1, "...");
|
|
173
|
+
}
|
|
174
|
+
} // 输入框
|
|
170
175
|
|
|
171
176
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
177
|
+
if (['input', 'date'].includes(type)) {
|
|
178
|
+
return filterValue;
|
|
179
|
+
} // 单选框 受控模式未查找到显示的内容时展示filterValue
|
|
175
180
|
|
|
176
181
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
182
|
+
var label = (data === null || data === void 0 ? void 0 : (_data$find = data.find(function (v) {
|
|
183
|
+
return (v === null || v === void 0 ? void 0 : v.value) === filterValue;
|
|
184
|
+
})) === null || _data$find === void 0 ? void 0 : _data$find.label) || filterValue;
|
|
185
|
+
return label;
|
|
186
|
+
} catch (error) {
|
|
187
|
+
return filterValue;
|
|
188
|
+
}
|
|
181
189
|
};
|
|
182
190
|
/*
|
|
183
191
|
* css样式控制
|
|
@@ -62,12 +62,14 @@ var FilterControl = /*#__PURE__*/_react.default.memo(function (props) {
|
|
|
62
62
|
return value || aliveValue;
|
|
63
63
|
}, [value, aliveValue]);
|
|
64
64
|
var filterValue = (0, _react.useMemo)(function () {
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
var val = getFilterValue === null || getFilterValue === void 0 ? void 0 : getFilterValue(resetItem);
|
|
66
|
+
|
|
67
|
+
if ((0, _utils.getIsHas)(val)) {
|
|
68
|
+
return val;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
|
-
return
|
|
70
|
-
}, [resetItem, transformFilterValue]); // 单独使用时抛出选中的值
|
|
71
|
+
return val || transformFilterValue;
|
|
72
|
+
}, [getFilterValue, resetItem, transformFilterValue]); // 单独使用时抛出选中的值
|
|
71
73
|
|
|
72
74
|
var handleChange = function handleChange(val) {
|
|
73
75
|
setAliveValue === null || setAliveValue === void 0 ? void 0 : setAliveValue(val);
|
|
@@ -322,12 +322,12 @@ var useCoreOptions = function useCoreOptions(_ref) {
|
|
|
322
322
|
var getFilterValue = (0, _react.useCallback)(function (_ref3) {
|
|
323
323
|
var field = _ref3.field,
|
|
324
324
|
type = _ref3.type;
|
|
325
|
-
var defaultValue = (0, _utils.getValueForType)(type);
|
|
326
325
|
|
|
327
326
|
if ((0, _utils.getIsHas)(state.basicFilter[field])) {
|
|
328
327
|
return state.basicFilter[field];
|
|
329
328
|
}
|
|
330
329
|
|
|
330
|
+
var defaultValue = (0, _utils.getValueForType)(type);
|
|
331
331
|
return state.basicFilter[field] || defaultValue;
|
|
332
332
|
}, [state.basicFilter]); // 获取查询结构
|
|
333
333
|
|
package/lib/LmFilter/utils.js
CHANGED
package/lib/LmUpload/LmUpload.js
CHANGED
|
@@ -27,37 +27,45 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
var LmUpload = function LmUpload(_a, ref) {
|
|
30
|
-
var
|
|
31
|
-
|
|
30
|
+
var fileConfig = _a.fileConfig,
|
|
31
|
+
components = _a.components,
|
|
32
|
+
_ossConfig = _a.ossConfig,
|
|
33
|
+
resetProps = __rest(_a, ["fileConfig", "components", "ossConfig"]);
|
|
32
34
|
|
|
33
35
|
var defaultRef = (0, _react.useRef)(null); // 仅在初始化触发一次
|
|
34
36
|
|
|
35
37
|
var initConfig = (0, _react.useMemo)(function () {
|
|
36
38
|
return {
|
|
37
39
|
// 文件配置单独存储
|
|
38
|
-
fileConfig: {
|
|
40
|
+
fileConfig: Object.assign({
|
|
39
41
|
size: 10,
|
|
40
42
|
type: ['jpg', 'jpeg', 'png'],
|
|
41
43
|
maxCount: 99
|
|
44
|
+
}, fileConfig || {}),
|
|
45
|
+
// 读取字段配置
|
|
46
|
+
fileNames: {
|
|
47
|
+
uid: 'uid',
|
|
48
|
+
fileTypeCode: 'fileTypeCode',
|
|
49
|
+
fileTypeName: 'fileTypeName',
|
|
50
|
+
fileName: 'fileName',
|
|
51
|
+
realFileName: 'realFileName',
|
|
52
|
+
fileSize: 'fileSize',
|
|
53
|
+
internalUrl: 'internalUrl',
|
|
54
|
+
externalUrl: 'externalUrl',
|
|
55
|
+
filePath: 'filePath',
|
|
56
|
+
seq: 'seq',
|
|
57
|
+
url: 'url'
|
|
42
58
|
},
|
|
43
59
|
// 初始化
|
|
44
|
-
components: {
|
|
60
|
+
components: Object.assign({
|
|
45
61
|
itemRender: null,
|
|
46
|
-
wrapper: null
|
|
47
|
-
|
|
48
|
-
// wrapper: (upload, fileList) => (
|
|
49
|
-
// <>
|
|
50
|
-
// {upload}
|
|
51
|
-
// {fileList}
|
|
52
|
-
// </>
|
|
53
|
-
// ),
|
|
54
|
-
|
|
55
|
-
}
|
|
62
|
+
wrapper: null
|
|
63
|
+
}, components || {})
|
|
56
64
|
};
|
|
57
65
|
}, []);
|
|
58
66
|
var defaultProps = {
|
|
59
67
|
uid: 'uid',
|
|
60
|
-
fileList:
|
|
68
|
+
fileList: null,
|
|
61
69
|
type: ['jpg', 'jpeg', 'png'],
|
|
62
70
|
accept: '',
|
|
63
71
|
fileSize: 10,
|
|
@@ -65,6 +73,7 @@ var LmUpload = function LmUpload(_a, ref) {
|
|
|
65
73
|
size: 100,
|
|
66
74
|
disabled: false,
|
|
67
75
|
maxCount: null,
|
|
76
|
+
showUploadList: true,
|
|
68
77
|
children: null,
|
|
69
78
|
defaultFileList: [],
|
|
70
79
|
itemRender: null,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
3
5
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -9,24 +11,34 @@ exports.default = void 0;
|
|
|
9
11
|
|
|
10
12
|
var React = _interopRequireWildcard(require("react"));
|
|
11
13
|
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
12
16
|
var _linkmoreDesign = require("linkmore-design");
|
|
13
17
|
|
|
14
18
|
// 图片列表项
|
|
15
19
|
var PictureItem = function PictureItem(_ref) {
|
|
16
20
|
var file = _ref.file,
|
|
17
21
|
instance = _ref.instance;
|
|
18
|
-
var remove = instance.remove
|
|
22
|
+
var remove = instance.remove,
|
|
23
|
+
preview = instance.preview,
|
|
24
|
+
download = instance.download;
|
|
19
25
|
return /*#__PURE__*/React.createElement("div", {
|
|
20
|
-
className:
|
|
26
|
+
className: (0, _classnames.default)('lm_upload_item lm_upload_item_picture', file.status === 'error' && 'error')
|
|
21
27
|
}, /*#__PURE__*/React.createElement("div", {
|
|
22
28
|
className: "picture_left"
|
|
23
29
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24
|
-
className: "lm_upload_item_thumb"
|
|
30
|
+
className: "lm_upload_item_thumb",
|
|
31
|
+
onClick: function onClick() {
|
|
32
|
+
return preview(file);
|
|
33
|
+
}
|
|
25
34
|
}, /*#__PURE__*/React.createElement("img", {
|
|
26
35
|
src: file.url,
|
|
27
36
|
alt: ""
|
|
28
37
|
})), /*#__PURE__*/React.createElement("div", {
|
|
29
|
-
className: "lm_upload_item_name"
|
|
38
|
+
className: "lm_upload_item_name",
|
|
39
|
+
onClick: function onClick() {
|
|
40
|
+
return download(file);
|
|
41
|
+
}
|
|
30
42
|
}, file.fileName)), /*#__PURE__*/React.createElement("div", {
|
|
31
43
|
className: "picture_right lm_upload_item_action"
|
|
32
44
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
3
5
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -9,6 +11,8 @@ exports.default = void 0;
|
|
|
9
11
|
|
|
10
12
|
var React = _interopRequireWildcard(require("react"));
|
|
11
13
|
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
12
16
|
var _linkmoreDesign = require("linkmore-design");
|
|
13
17
|
|
|
14
18
|
var TextItem = function TextItem(_ref) {
|
|
@@ -16,7 +20,7 @@ var TextItem = function TextItem(_ref) {
|
|
|
16
20
|
instance = _ref.instance;
|
|
17
21
|
var remove = instance.remove;
|
|
18
22
|
return /*#__PURE__*/React.createElement("div", {
|
|
19
|
-
className:
|
|
23
|
+
className: (0, _classnames.default)('lm_upload_item lm_upload_item_text', file.status === 'error' && 'error')
|
|
20
24
|
}, /*#__PURE__*/React.createElement("div", {
|
|
21
25
|
className: "text_left"
|
|
22
26
|
}, /*#__PURE__*/React.createElement("div", {
|