@cloudbase/weda-ui 3.12.2 → 3.12.4
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/configs/components/listView.js +13 -26
- package/dist/configs/components/wd-select-multiple.d.ts +2 -0
- package/dist/configs/components/wd-select-multiple.js +9 -7
- package/dist/configs/components/wd-select.d.ts +2 -0
- package/dist/configs/components/wd-select.js +9 -7
- package/dist/configs/components/wd-side-tab.js +16 -1
- package/dist/configs/components/wd-table.js +1 -1
- package/dist/configs/index.d.ts +4 -0
- package/dist/style/weda-ui.min.css +52 -2
- package/dist/web/components/flow/process/constants.d.ts +3 -3
- package/dist/web/components/form/uploaderFile/index.css +23 -71
- package/dist/web/components/wd-icon/wd-icon.d.ts +1 -0
- package/dist/web/components/wd-icon/wd-icon.js +4 -9
- package/dist/web/components/wd-select/relationSelect/relationSelect.js +14 -10
- package/dist/web/components/wd-select/select/selectUI.js +11 -12
- package/dist/web/components/wd-select/wd-select.js +3 -3
- package/dist/web/components/wd-select-multiple/wd-select-multiple.js +3 -3
- package/dist/web/components/wd-table/hooks/useChooseList.d.ts +1 -1
- package/dist/web/components/wd-table/hooks/useChooseList.js +5 -4
- package/dist/web/components/wd-tabs/util.js +2 -4
- package/dist/web/utils/loadIconCss.d.ts +2 -1
- package/dist/web/utils/loadIconCss.js +33 -0
- package/package.json +3 -3
|
@@ -88,11 +88,11 @@ declare const OPERATION_NODE_STATUS: readonly [{
|
|
|
88
88
|
/** 操作节点状态相关映射关系转换 */
|
|
89
89
|
declare const
|
|
90
90
|
/** 状态码-状态名称映射 */
|
|
91
|
-
CODE_NAME_MAPPING: Record<number, "
|
|
91
|
+
CODE_NAME_MAPPING: Record<number, "drop" | "stop" | "end" | "start" | "down" | "pending" | "revoke" | "cc" | "pass" | "turn" | "trans" | "countersign" | "skip_pass" | "skip_down" | "handled" | "handling" | "delete_draft">,
|
|
92
92
|
/** 状态名称-状态码映射 */
|
|
93
|
-
NAME_CODE_MAPPING: Record<"CC" | "REVOKE" | "
|
|
93
|
+
NAME_CODE_MAPPING: Record<"CC" | "REVOKE" | "DROP" | "STOP" | "END" | "START" | "DOWN" | "PENDING" | "PASS" | "TURN" | "TRANS" | "COUNTERSIGN" | "SKIP_PASS" | "SKIP_DOWN" | "HANDLED" | "HANDLING" | "DELETE_DRAFT", number>,
|
|
94
94
|
/** 状态名称映射 */
|
|
95
|
-
NAME_MAPPING: Record<"CC" | "REVOKE" | "
|
|
95
|
+
NAME_MAPPING: Record<"CC" | "REVOKE" | "DROP" | "STOP" | "END" | "START" | "DOWN" | "PENDING" | "PASS" | "TURN" | "TRANS" | "COUNTERSIGN" | "SKIP_PASS" | "SKIP_DOWN" | "HANDLED" | "HANDLING" | "DELETE_DRAFT", "drop" | "stop" | "end" | "start" | "down" | "pending" | "revoke" | "cc" | "pass" | "turn" | "trans" | "countersign" | "skip_pass" | "skip_down" | "handled" | "handling" | "delete_draft">,
|
|
96
96
|
/** 状态名称-状态文本信息映射 */
|
|
97
97
|
NAME_TEXT_MAPPING: Record<string, {
|
|
98
98
|
theme: string;
|
|
@@ -122,15 +122,11 @@
|
|
|
122
122
|
align-items: center;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
.weda-upload-file-pc
|
|
126
|
-
.weda-upload-file-pc--item-header
|
|
127
|
-
.weda-upload-file-pc--item-label {
|
|
125
|
+
.weda-upload-file-pc .weda-upload-file-pc--item-header .weda-upload-file-pc--item-label {
|
|
128
126
|
border-right: 1px solid #e7e7e7;
|
|
129
127
|
}
|
|
130
128
|
|
|
131
|
-
.weda-upload-file-pc
|
|
132
|
-
.weda-upload-file-pc--item
|
|
133
|
-
.weda-upload-file-pc--item-title {
|
|
129
|
+
.weda-upload-file-pc .weda-upload-file-pc--item .weda-upload-file-pc--item-title {
|
|
134
130
|
width: 220px;
|
|
135
131
|
padding: 10px 12px;
|
|
136
132
|
overflow: hidden;
|
|
@@ -138,16 +134,12 @@
|
|
|
138
134
|
white-space: nowrap;
|
|
139
135
|
}
|
|
140
136
|
|
|
141
|
-
.weda-upload-file-pc
|
|
142
|
-
.weda-upload-file-pc--item
|
|
143
|
-
.weda-upload-file-pc--item-size {
|
|
137
|
+
.weda-upload-file-pc .weda-upload-file-pc--item .weda-upload-file-pc--item-size {
|
|
144
138
|
width: 100px;
|
|
145
139
|
padding: 10px 12px;
|
|
146
140
|
}
|
|
147
141
|
|
|
148
|
-
.weda-upload-file-pc
|
|
149
|
-
.weda-upload-file-pc--item
|
|
150
|
-
.weda-upload-file-pc--item-status {
|
|
142
|
+
.weda-upload-file-pc .weda-upload-file-pc--item .weda-upload-file-pc--item-status {
|
|
151
143
|
width: 150px;
|
|
152
144
|
padding: 10px 12px;
|
|
153
145
|
overflow: hidden;
|
|
@@ -155,25 +147,20 @@
|
|
|
155
147
|
white-space: nowrap;
|
|
156
148
|
}
|
|
157
149
|
|
|
158
|
-
.weda-upload-file-pc
|
|
159
|
-
.weda-upload-file-pc--item
|
|
160
|
-
.weda-upload-file-pc--item-action {
|
|
150
|
+
.weda-upload-file-pc .weda-upload-file-pc--item .weda-upload-file-pc--item-action {
|
|
161
151
|
width: 160px;
|
|
162
152
|
padding: 10px 12px;
|
|
163
153
|
}
|
|
164
154
|
|
|
165
155
|
.weda-upload-file-pc .weda-upload-file-pc__btn--weak {
|
|
166
156
|
border-color: #dcdcdc;
|
|
167
|
-
width:
|
|
157
|
+
width: auto;
|
|
168
158
|
font-weight: normal;
|
|
169
159
|
color: var(--wd-color-text-default, rgba(0, 0, 0, 0.9));
|
|
170
160
|
font: var(--wd-typography-body-md, 14px);
|
|
171
161
|
}
|
|
172
162
|
|
|
173
|
-
.weda-upload-file-pc
|
|
174
|
-
.weda-upload-file-pc--item
|
|
175
|
-
.weda-upload-file-pc--item-status
|
|
176
|
-
.wedatea2td-icon {
|
|
163
|
+
.weda-upload-file-pc .weda-upload-file-pc--item .weda-upload-file-pc--item-status .wedatea2td-icon {
|
|
177
164
|
margin-right: 8px;
|
|
178
165
|
}
|
|
179
166
|
|
|
@@ -184,20 +171,14 @@
|
|
|
184
171
|
background-image: url(data:image/svg+xml;charset=utf-8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTRweCIgaGVpZ2h0PSIxNHB4IiB2aWV3Qm94PSIwIDAgMTQgMTQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+SWNvbjwvdGl0bGU+CiAgICA8ZyBpZD0i6aG16Z2iLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJwYyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTY1MS4wMDAwMDAsIC0zOTQuMDAwMDAwKSI+CiAgICAgICAgICAgIDxnIGlkPSLkuIrkvKAv5om56YeP5LiK5Lyg5Lit5aSH5Lu9IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgzNzIuMDAwMDAwLCAxNDcuMDAwMDAwKSI+CiAgICAgICAgICAgICAgICA8ZyBpZD0i5YaF5a655YiXIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLjAwMDAwMCwgMTA3LjAwMDAwMCkiPgogICAgICAgICAgICAgICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI1NC4wMDAwMDAsIDEyNi4wMDAwMDApIiBpZD0i57yW57uEIj4KICAgICAgICAgICAgICAgICAgICAgICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjQuMDAwMDAwLCAxMy4wMDAwMDApIiBpZD0iMS5CYWNl5Z+656GALzMuSWNvbuWbvuaghy/mk43kvZwvbW92ZSI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMCwwIEwxNiwwIEwxNiwxNiBMMCwxNiBMMCwwIFoiIGlkPSJ0aW1lLWZpbGxlZC0oQmFja2dyb3VuZCkiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNSw4IEMxNSw0LjEzNDAwNjc0IDExLjg2NTk5MzUsMSA4LDEgQzQuMTM0MDA2NzQsMSAxLDQuMTM0MDA2NzQgMSw4IEMxLDExLjg2NTk5MzUgNC4xMzQwMDY3NCwxNSA4LDE1IEMxMS44NjU5OTM1LDE1IDE1LDExLjg2NTk5MzUgMTUsOCBaIE03LjUsOC4zODg5MjQ2IEwxMC42NDY2OTA0LDExLjUzNTYxNTkgTDExLjM1Mzc5NzksMTAuODI4NTA4NCBMOC41LDcuOTc0NzExNDIgTDguNSw1IEw3LjUsNSBMNy41LDguMzg4OTI0NiBaIiBpZD0idGltZS1maWxsZWQiIGZpbGwtb3BhY2l0eT0iMC40IiBmaWxsPSIjMDAwMDAwIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==);
|
|
185
172
|
}
|
|
186
173
|
|
|
187
|
-
.weda-upload-file-pc
|
|
188
|
-
.weda-upload-file-pc--item
|
|
189
|
-
.weda-upload-file-pc--item-action
|
|
190
|
-
.wedatea2td-btn {
|
|
174
|
+
.weda-upload-file-pc .weda-upload-file-pc--item .weda-upload-file-pc--item-action .wedatea2td-btn {
|
|
191
175
|
font-size: 0.875em;
|
|
192
176
|
line-height: 1.375em;
|
|
193
177
|
margin-right: 12px;
|
|
194
178
|
color: var(--wd-color-brand, #0052d9);
|
|
195
179
|
}
|
|
196
180
|
|
|
197
|
-
.weda-upload-file-pc
|
|
198
|
-
.weda-upload-file-pc--item
|
|
199
|
-
.weda-upload-file-pc--item-action
|
|
200
|
-
.wedatea2td-btn:last-child {
|
|
181
|
+
.weda-upload-file-pc .weda-upload-file-pc--item .weda-upload-file-pc--item-action .wedatea2td-btn:last-child {
|
|
201
182
|
margin-right: 0;
|
|
202
183
|
}
|
|
203
184
|
|
|
@@ -212,9 +193,7 @@
|
|
|
212
193
|
border-radius: 0 0 2px 2px;
|
|
213
194
|
}
|
|
214
195
|
|
|
215
|
-
.weda-upload-file-pc
|
|
216
|
-
.weda-upload-file-pc--item-empty
|
|
217
|
-
.weda-upload-file-pc--item {
|
|
196
|
+
.weda-upload-file-pc .weda-upload-file-pc--item-empty .weda-upload-file-pc--item {
|
|
218
197
|
line-height: 1.375em;
|
|
219
198
|
color: var(--wd-color-text-placeholder, rgba(0, 0, 0, 0.4));
|
|
220
199
|
font-size: var(--wd-font-size-3, 0.875em);
|
|
@@ -261,9 +240,7 @@
|
|
|
261
240
|
font-size: var(--wd-font-size-2, 0.75em);
|
|
262
241
|
}
|
|
263
242
|
|
|
264
|
-
.weda-upload-file-mobile
|
|
265
|
-
.weda-upload-file-mobile__bd
|
|
266
|
-
.weda-uploader-files_split {
|
|
243
|
+
.weda-upload-file-mobile .weda-upload-file-mobile__bd .weda-uploader-files_split {
|
|
267
244
|
height: 8px;
|
|
268
245
|
width: 100%;
|
|
269
246
|
background-color: #f6f6f6;
|
|
@@ -293,48 +270,34 @@
|
|
|
293
270
|
margin-right: 16px;
|
|
294
271
|
}
|
|
295
272
|
|
|
296
|
-
.weda-upload-file-mobile
|
|
297
|
-
.weda-upload-file-mobile__btn-group
|
|
298
|
-
.wedatea2td-icon:last-child {
|
|
273
|
+
.weda-upload-file-mobile .weda-upload-file-mobile__btn-group .wedatea2td-icon:last-child {
|
|
299
274
|
margin-right: 0;
|
|
300
275
|
}
|
|
301
276
|
|
|
302
|
-
.weda-upload-file-mobile
|
|
303
|
-
.weda-upload-file-mobile__item
|
|
304
|
-
.wedatea2td-icon.wedatea2td-icon-delete {
|
|
277
|
+
.weda-upload-file-mobile .weda-upload-file-mobile__item .wedatea2td-icon.wedatea2td-icon-delete {
|
|
305
278
|
background-image: url('https://imgcache.qq.com/qcloud/tcloud_dtc/static/static_source_business/2372f6a8-2f6a-4f30-92bf-73c62a5c0ae7.svg');
|
|
306
279
|
}
|
|
307
280
|
|
|
308
|
-
.weda-upload-file-mobile
|
|
309
|
-
.weda-upload-file-mobile__item
|
|
310
|
-
.wedatea2td-icon.wedatea2td-icon-download {
|
|
281
|
+
.weda-upload-file-mobile .weda-upload-file-mobile__item .wedatea2td-icon.wedatea2td-icon-download {
|
|
311
282
|
background-image: url('https://imgcache.qq.com/qcloud/tcloud_dtc/static/static_source_business/4cba5da1-cde4-40c6-a075-86eff22858a4.svg');
|
|
312
283
|
}
|
|
313
284
|
|
|
314
|
-
.weda-upload-file-mobile
|
|
315
|
-
.weda-upload-file-mobile__item
|
|
316
|
-
.wedatea2td-icon.wedatea2td-icon-refresh {
|
|
285
|
+
.weda-upload-file-mobile .weda-upload-file-mobile__item .wedatea2td-icon.wedatea2td-icon-refresh {
|
|
317
286
|
background-image: url('https://imgcache.qq.com/qcloud/tcloud_dtc/static/static_source_business/af5486eb-65e0-4536-8e51-6c68a17b71ac.svg');
|
|
318
287
|
}
|
|
319
288
|
|
|
320
|
-
.weda-upload-file-mobile
|
|
321
|
-
.weda-upload-file-mobile__item
|
|
322
|
-
.weda-upload-file-mobile__item-left {
|
|
289
|
+
.weda-upload-file-mobile .weda-upload-file-mobile__item .weda-upload-file-mobile__item-left {
|
|
323
290
|
flex: 1;
|
|
324
291
|
margin-right: 4px;
|
|
325
292
|
max-width: calc(100% - 75px);
|
|
326
293
|
}
|
|
327
294
|
|
|
328
|
-
.weda-upload-file-mobile
|
|
329
|
-
.weda-upload-file-mobile__item
|
|
330
|
-
.weda-upload-file-mobile__file-detail {
|
|
295
|
+
.weda-upload-file-mobile .weda-upload-file-mobile__item .weda-upload-file-mobile__file-detail {
|
|
331
296
|
display: flex;
|
|
332
297
|
align-items: center;
|
|
333
298
|
}
|
|
334
299
|
|
|
335
|
-
.weda-upload-file-mobile
|
|
336
|
-
.weda-upload-file-mobile__item
|
|
337
|
-
.weda-upload-file-mobile__file-name {
|
|
300
|
+
.weda-upload-file-mobile .weda-upload-file-mobile__item .weda-upload-file-mobile__file-name {
|
|
338
301
|
font-size: 0.875em;
|
|
339
302
|
line-height: 1.375em;
|
|
340
303
|
color: rgba(0, 0, 0, 0.9);
|
|
@@ -344,9 +307,7 @@
|
|
|
344
307
|
white-space: nowrap;
|
|
345
308
|
}
|
|
346
309
|
|
|
347
|
-
.weda-upload-file-mobile
|
|
348
|
-
.weda-upload-file-mobile__item
|
|
349
|
-
.weda-upload-file-mobile__file-status {
|
|
310
|
+
.weda-upload-file-mobile .weda-upload-file-mobile__item .weda-upload-file-mobile__file-status {
|
|
350
311
|
margin-right: 0.28571rem;
|
|
351
312
|
display: inline-block;
|
|
352
313
|
white-space: nowrap;
|
|
@@ -354,10 +315,7 @@
|
|
|
354
315
|
text-overflow: ellipsis;
|
|
355
316
|
}
|
|
356
317
|
|
|
357
|
-
.weda-upload-file-mobile
|
|
358
|
-
.weda-upload-file-mobile__item
|
|
359
|
-
.weda-upload-file-mobile__file-status
|
|
360
|
-
.wedatea2td-icon {
|
|
318
|
+
.weda-upload-file-mobile .weda-upload-file-mobile__item .weda-upload-file-mobile__file-status .wedatea2td-icon {
|
|
361
319
|
width: 16px;
|
|
362
320
|
height: 16px;
|
|
363
321
|
background-size: 100% 100%;
|
|
@@ -375,16 +333,12 @@
|
|
|
375
333
|
.wedatea2td-icon.wedatea2td-icon-success {
|
|
376
334
|
background-image: url(data:image/svg+xml;charset=utf-8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgMTQgMTQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+MS5CYWNl5Z+656GALzMuSWNvbuWbvuaghy/mk43kvZwvbW92ZTwvdGl0bGU+CiAgICA8ZyBpZD0i6aG16Z2iLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSLnlLvmnb8iIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMDQuMDAwMDAwLCAtMTIwLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0iMS5CYWNl5Z+656GALzMuSWNvbuWbvuaghy/mk43kvZwvbW92ZSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAzLjAwMDAwMCwgMTE5LjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHBhdGggZD0iTTAsMCBMMTYsMCBMMTYsMTYgTDAsMTYgTDAsMCBaIiBpZD0iY2hlY2stY2lyY2xlLWZpbGxlZC0oQmFja2dyb3VuZCkiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNSw4IEMxNSw0LjEzNDAwNjc0IDExLjg2NTk5MzUsMSA4LDEgQzQuMTM0MDA2NzQsMSAxLDQuMTM0MDA2NzQgMSw4IEMxLDExLjg2NTk5MzUgNC4xMzQwMDY3NCwxNSA4LDE1IEMxMS44NjU5OTM1LDE1IDE1LDExLjg2NTk5MzUgMTUsOCBaIE03LDEwLjcwNjk5OTggTDExLjUsNi4yMDc0OTk5OCBMMTAuNzkyNDk5NSw1LjUgTDcsOS4yOTMwMDAyMiBMNS4yMDY1MDAwNSw3LjUgTDQuNSw4LjIwNjUwMDA1IEw3LDEwLjcwNjk5OTggWiIgaWQ9ImNoZWNrLWNpcmNsZS1maWxsZWQiIGZpbGw9IiMwMEE4NzAiPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+);
|
|
377
335
|
}
|
|
378
|
-
.weda-upload-file-mobile
|
|
379
|
-
.weda-upload-file-mobile__item
|
|
380
|
-
.weda-upload-file-mobile__file-status--msg {
|
|
336
|
+
.weda-upload-file-mobile .weda-upload-file-mobile__item .weda-upload-file-mobile__file-status--msg {
|
|
381
337
|
width: 4.2rem;
|
|
382
338
|
line-height: 1.25em;
|
|
383
339
|
}
|
|
384
340
|
|
|
385
|
-
.weda-upload-file-mobile
|
|
386
|
-
.weda-upload-file-mobile__item
|
|
387
|
-
.weda-upload-file-mobile__file-foot {
|
|
341
|
+
.weda-upload-file-mobile .weda-upload-file-mobile__item .weda-upload-file-mobile__file-foot {
|
|
388
342
|
line-height: 1.25em;
|
|
389
343
|
margin-top: 8px;
|
|
390
344
|
display: flex;
|
|
@@ -392,9 +346,7 @@
|
|
|
392
346
|
font-size: var(--wd-font-size-2, 0.75em);
|
|
393
347
|
}
|
|
394
348
|
|
|
395
|
-
.weda-upload-file-mobile
|
|
396
|
-
.weda-upload-file-mobile__item
|
|
397
|
-
.weda-upload-file-mobile__file-progress {
|
|
349
|
+
.weda-upload-file-mobile .weda-upload-file-mobile__item .weda-upload-file-mobile__file-progress {
|
|
398
350
|
margin-top: 4px;
|
|
399
351
|
border-radius: 0;
|
|
400
352
|
background-color: #e7e7e7;
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { CommonPropsType, unknownFunction } from '../../types';
|
|
3
3
|
import type { DataType } from '../../../configs/components/wd-icon';
|
|
4
4
|
import '../style';
|
|
5
|
+
import '../../utils/loadIconCss';
|
|
5
6
|
export declare const WdIcon: React.ForwardRefExoticComponent<WdIconProps & React.RefAttributes<unknown>>;
|
|
6
7
|
export interface WdIconProps extends CommonPropsType, DataType {
|
|
7
8
|
[handlers: `on${string}`]: unknownFunction;
|
|
@@ -8,13 +8,12 @@ import { convertLegacyEnum } from '../../utils/tool';
|
|
|
8
8
|
import { WD_ICON_TYPE, WD_ICON_SIZE } from '../../../enum';
|
|
9
9
|
import WdImage from '../wd-image';
|
|
10
10
|
import '../style';
|
|
11
|
+
import '../../utils/loadIconCss';
|
|
11
12
|
export const WdIcon = forwardRef(function WdIcon({ type: _type = 'inner', name = 'success', src, size: _size = 'md', sizeSelfAdaptive: _sizeSelfAdaptive = false, events = emptyObject, className, style: _style, id, color: _color, ...props }, ref) {
|
|
12
13
|
const platform = usePlatform();
|
|
13
14
|
// 兼容旧版组件的属性值 size/color
|
|
14
15
|
const remdiff = 2;
|
|
15
|
-
const iconNumSize = !isNaN(Number(_size))
|
|
16
|
-
? `${Number(_size) / remdiff}px`
|
|
17
|
-
: '';
|
|
16
|
+
const iconNumSize = !isNaN(Number(_size)) ? `${Number(_size) / remdiff}px` : '';
|
|
18
17
|
const fontSize = iconNumSize && _type === 'inner' ? { fontSize: iconNumSize } : {};
|
|
19
18
|
const width = iconNumSize && _type === 'custom' ? { width: iconNumSize } : {};
|
|
20
19
|
const height = iconNumSize && _type === 'custom' ? { height: iconNumSize } : {};
|
|
@@ -22,9 +21,7 @@ export const WdIcon = forwardRef(function WdIcon({ type: _type = 'inner', name =
|
|
|
22
21
|
const style = { ...fontSize, ...width, ...height, ...color, ..._style };
|
|
23
22
|
// 枚举转换
|
|
24
23
|
const type = convertLegacyEnum(_type, WD_ICON_TYPE);
|
|
25
|
-
const size = ['xxs'].includes(_size)
|
|
26
|
-
? _size
|
|
27
|
-
: convertLegacyEnum(_size, WD_ICON_SIZE); // 不对外暴露的size属性值
|
|
24
|
+
const size = ['xxs'].includes(_size) ? _size : convertLegacyEnum(_size, WD_ICON_SIZE); // 不对外暴露的size属性值
|
|
28
25
|
// 样式
|
|
29
26
|
const { classPrefix } = useConfig();
|
|
30
27
|
const compClassName = `${classPrefix}-icon`;
|
|
@@ -73,8 +70,6 @@ export const WdIcon = forwardRef(function WdIcon({ type: _type = 'inner', name =
|
|
|
73
70
|
return (_jsx("i", { className: classNames(classes, className), style: style, id: id, onClick: onClick, ...propsStartWithOn }));
|
|
74
71
|
}
|
|
75
72
|
else {
|
|
76
|
-
return (_jsx("div", { "data-testid": propsStartWithOn['data-testid'], style: { display: 'inherit' }, children: _jsx(WdImage, { className: classNames(classes, className), style: style, id: id, src: src
|
|
77
|
-
? src
|
|
78
|
-
: 'https://qcloudimg.tencent-cloud.cn/raw/4a29d51b504f12b4933ce4490110b4dc.svg', events: { tap: onClick }, maskClosable: false, alt: '', lazyLoad: false, ...propsStartWithOn }) }));
|
|
73
|
+
return (_jsx("div", { "data-testid": propsStartWithOn['data-testid'], style: { display: 'inherit' }, children: _jsx(WdImage, { className: classNames(classes, className), style: style, id: id, src: src ? src : 'https://qcloudimg.tencent-cloud.cn/raw/4a29d51b504f12b4933ce4490110b4dc.svg', events: { tap: onClick }, maskClosable: false, alt: '', lazyLoad: false, ...propsStartWithOn }) }));
|
|
79
74
|
}
|
|
80
75
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
3
3
|
import { useState, useImperativeHandle, useMemo, useEffect, useCallback } from 'react';
|
|
4
|
+
import { useDebouncedCallback } from '@react-hookz/web';
|
|
4
5
|
import { LoadingTip } from 'tea-component';
|
|
5
6
|
import { SelectUI as Select } from '../select/selectUI';
|
|
6
7
|
import { WdIcon } from '../../wd-icon';
|
|
@@ -48,8 +49,14 @@ const OptionText = ({ mode, option, selectFields, authFields, onChange, onRelati
|
|
|
48
49
|
const defaultSize = 50;
|
|
49
50
|
const defaultPage = 1;
|
|
50
51
|
export function RelationSelect(props) {
|
|
51
|
-
var _a;
|
|
52
|
-
const { placeholder, size, disabled, onChange, value, onSearch, addRelationButton, childRef, dataSourceName, selectFields, selectFieldType, primaryField, setRefreshStatus, mode, onRelationOptionJump, enableRelationOptionJump, } = props;
|
|
52
|
+
var _a, _b;
|
|
53
|
+
const { placeholder, size, disabled, onChange, value, onSearch, addRelationButton, childRef, dataSourceName, selectFields, selectFieldType, primaryField, setRefreshStatus, mode, onRelationOptionJump, enableRelationOptionJump, listWidth = 700, } = props;
|
|
54
|
+
const selectFieldsLength = selectFieldType === 'custom' ? selectFields === null || selectFields === void 0 ? void 0 : selectFields.length : 0;
|
|
55
|
+
// 设置下拉列表与下拉按钮同宽
|
|
56
|
+
// 以传入为准,未传入,在自定义展示字段少于2个时设置为 true,否则设置为false,宽度设置为700,
|
|
57
|
+
const _matchButtonWidth = (_a = props === null || props === void 0 ? void 0 : props.matchButtonWidth) !== null && _a !== void 0 ? _a : selectFieldsLength < 2;
|
|
58
|
+
// 以传入为准,未传入,在不与按钮同宽度的情况下,listHeight 会被设置为 400
|
|
59
|
+
const _listHeight = (_b = props === null || props === void 0 ? void 0 : props.listHeight) !== null && _b !== void 0 ? _b : (_matchButtonWidth ? undefined : 400);
|
|
53
60
|
const { authFields } = useAuthFields({
|
|
54
61
|
dbName: dataSourceName,
|
|
55
62
|
dbFieldNames: [],
|
|
@@ -95,10 +102,10 @@ export function RelationSelect(props) {
|
|
|
95
102
|
options,
|
|
96
103
|
selectFields,
|
|
97
104
|
]);
|
|
98
|
-
const searchOptionListWithWhere =
|
|
105
|
+
const searchOptionListWithWhere = useDebouncedCallback((where = whereList) => {
|
|
99
106
|
empty();
|
|
100
107
|
setQuery({ ...query, pageNo: defaultPage, where });
|
|
101
|
-
}, [empty, query, setQuery, whereList]);
|
|
108
|
+
}, [empty, query, setQuery, whereList], 300);
|
|
102
109
|
useImperativeHandle(childRef, () => {
|
|
103
110
|
return {
|
|
104
111
|
refresh: async () => {
|
|
@@ -128,9 +135,7 @@ export function RelationSelect(props) {
|
|
|
128
135
|
searchOptionListWithWhere(where);
|
|
129
136
|
onSearch(keyword);
|
|
130
137
|
};
|
|
131
|
-
|
|
132
|
-
const searchPlaceholder = `搜索主列${primaryFieldTitle}[${primaryField}]`;
|
|
133
|
-
return (_jsx(EnumHoc, { fields: authFields, children: _jsx(Select, { ...props, overlayClassName: isRelationSelectOption ? 'wd-relation-select-overlay' : '', searchable: true, matchButtonWidth: true, placeholder: placeholder, appearance: 'button', size: size, disabled: disabled, autoClearSearchValue: true, options: customOptions, value: value, onChange: onChange, onSearch: searchHandle, tips: isLoading ? '' : undefined, bottomTips: isLoading ? _jsx(LoadingTip, {}) : undefined, onScrollBottom: () => {
|
|
138
|
+
return (_jsx(EnumHoc, { fields: authFields, children: _jsx(Select, { ...props, overlayClassName: isRelationSelectOption ? 'wd-relation-select-overlay' : '', searchable: true, listWidth: listWidth, listHeight: _listHeight, matchButtonWidth: _matchButtonWidth, placeholder: placeholder, appearance: 'button', filter: () => true, size: size, disabled: disabled, autoClearSearchValue: true, options: customOptions, value: value, onChange: onChange, onSearch: searchHandle, tips: isLoading ? '' : undefined, bottomTips: isLoading ? _jsx(LoadingTip, {}) : undefined, onScrollBottom: () => {
|
|
134
139
|
if (!isLoading && customOptions.length < total) {
|
|
135
140
|
setQuery((query) => ({
|
|
136
141
|
...query,
|
|
@@ -139,7 +144,7 @@ export function RelationSelect(props) {
|
|
|
139
144
|
}
|
|
140
145
|
}, onOpen: () => {
|
|
141
146
|
searchOptionListWithWhere();
|
|
142
|
-
}, footer: addRelationButton, mode: mode
|
|
147
|
+
}, footer: addRelationButton, mode: mode }) }));
|
|
143
148
|
}
|
|
144
149
|
export function EnumSelect(props) {
|
|
145
150
|
const { placeholder, size, disabled, onChange, value, onSearch, addRelationButton, childRef, dataSourceName, enumName, primaryField, format, viewId, where, setRefreshStatus, mode, } = props;
|
|
@@ -185,7 +190,6 @@ export function CustomSelect(props) {
|
|
|
185
190
|
const { format, addRelationButtonText, enableAddRelationButton, events } = props;
|
|
186
191
|
const isEnumType = format === 'x-enum';
|
|
187
192
|
const [refreshStatus, setRefreshStatus] = useState(false);
|
|
188
|
-
const listWidth = 700;
|
|
189
193
|
const addRelationButton = enableAddRelationButton && (_jsxs("span", { className: "wd-add-relation-button-wrap", onClick: () => {
|
|
190
194
|
var _a;
|
|
191
195
|
(_a = events === null || events === void 0 ? void 0 : events.onAddRelationButtonClick) === null || _a === void 0 ? void 0 : _a.call(events);
|
|
@@ -193,5 +197,5 @@ export function CustomSelect(props) {
|
|
|
193
197
|
if (refreshStatus) {
|
|
194
198
|
return _jsx(LoadingTip, {});
|
|
195
199
|
}
|
|
196
|
-
return isEnumType ? (_jsx(EnumSelect, { ...props, addRelationButton: addRelationButton, setRefreshStatus: setRefreshStatus
|
|
200
|
+
return isEnumType ? (_jsx(EnumSelect, { ...props, addRelationButton: addRelationButton, setRefreshStatus: setRefreshStatus })) : (_jsx(RelationSelect, { ...props, addRelationButton: addRelationButton, setRefreshStatus: setRefreshStatus }));
|
|
197
201
|
}
|
|
@@ -42,20 +42,20 @@ function SelectH5(props) {
|
|
|
42
42
|
// 聚焦在搜索框
|
|
43
43
|
const [inputFocus, setInputFocus] = useState(false);
|
|
44
44
|
const [searchValue, setSearchValue] = useState('');
|
|
45
|
-
const [isSearch, setIsSearch] = useState(
|
|
45
|
+
const [isSearch, setIsSearch] = useState(true);
|
|
46
46
|
const [currentSelected, setCurrentSelected] = useSyncValue(getSelectedItem(options, value), isObjectEqual);
|
|
47
47
|
const getOptionList = () => {
|
|
48
48
|
return options.filter((i) => String(i === null || i === void 0 ? void 0 : i.label).toLowerCase().includes(searchValue.toLowerCase()));
|
|
49
49
|
};
|
|
50
50
|
// 前端查询
|
|
51
|
-
const customOptions = isSearch ? getOptionList() : options;
|
|
51
|
+
const customOptions = isSearch && searchValue ? getOptionList() : options;
|
|
52
52
|
const handleZhStart = () => {
|
|
53
53
|
// 判断是否输入中文,则停止搜索
|
|
54
54
|
setIsSearch(false);
|
|
55
55
|
};
|
|
56
|
-
const handleZhEnd = (
|
|
56
|
+
const handleZhEnd = () => {
|
|
57
57
|
setIsSearch(true);
|
|
58
|
-
|
|
58
|
+
onSearch(searchValue);
|
|
59
59
|
};
|
|
60
60
|
const handleSearch = (e) => {
|
|
61
61
|
const tValue = e.target.value.trim();
|
|
@@ -80,8 +80,7 @@ function SelectH5(props) {
|
|
|
80
80
|
};
|
|
81
81
|
const getInitOptions = () => {
|
|
82
82
|
setSearchValue('');
|
|
83
|
-
|
|
84
|
-
setCurrentSelected([]);
|
|
83
|
+
setCurrentSelected(getSelectedItem(options, value));
|
|
85
84
|
if (onOpen) {
|
|
86
85
|
onOpen();
|
|
87
86
|
}
|
|
@@ -117,8 +116,8 @@ function SelectH5(props) {
|
|
|
117
116
|
if (!isMultiple) {
|
|
118
117
|
// 单选直接关弹窗
|
|
119
118
|
onChange(item.value);
|
|
120
|
-
setVisible(false);
|
|
121
119
|
setCurrentSelected([item]);
|
|
120
|
+
setVisible(false);
|
|
122
121
|
}
|
|
123
122
|
else {
|
|
124
123
|
setCurrentSelected(dealSelectedItem(item));
|
|
@@ -138,7 +137,7 @@ function SelectH5(props) {
|
|
|
138
137
|
}, children: _jsx(OptionList, { onScrollBottom: onScrollBottom, options: customOptions, inputFocus: inputFocus, currentSelected: currentSelected, optionClick: optionClick, bottomTips: bottomTips }) }), footer] })) })] })] }));
|
|
139
138
|
}
|
|
140
139
|
export function SelectUI(props) {
|
|
141
|
-
const { placeholder, size, disabled, onChange, onSearch, searchable, options = [], value, footer, overlayClassName, onOpen, onScrollBottom, tips, bottomTips, mode, format, readOnly, setAllOption, listHeight, listWidth, popupContainer, searchPlaceholder = '搜索选项', } = props;
|
|
140
|
+
const { placeholder, size, disabled, onChange, onSearch, searchable, options = [], value, footer, overlayClassName, onOpen, onScrollBottom, tips, bottomTips, mode, format, readOnly, setAllOption, listHeight, listWidth, popupContainer, searchPlaceholder = '搜索选项', matchButtonWidth = true, ...restProps } = props;
|
|
142
141
|
const platform = usePlatform();
|
|
143
142
|
const [currentOption] = useSyncValue((options === null || options === void 0 ? void 0 : options.map(({ label, value }) => ({ label, value }))) || [], isObjectEqual);
|
|
144
143
|
// 更新option,从而更新最新的选项值
|
|
@@ -165,20 +164,20 @@ export function SelectUI(props) {
|
|
|
165
164
|
return _jsx(SelectH5, { ...props, readValue: readValue, searchPlaceholder: searchPlaceholder });
|
|
166
165
|
}
|
|
167
166
|
else if (mode === 'multiple') {
|
|
168
|
-
return (_jsx(SelectMultiple, { popupContainer: popupContainer, button: (selectedItem) => {
|
|
167
|
+
return (_jsx(SelectMultiple, { ...restProps, popupContainer: popupContainer, button: (selectedItem) => {
|
|
169
168
|
if (!(selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.length)) {
|
|
170
169
|
return _jsx("div", { className: "wedatea2td-text-weak", children: placeholder });
|
|
171
170
|
}
|
|
172
171
|
return selectedItem.map((i) => (i === null || i === void 0 ? void 0 : i.label) || i.value).join(',');
|
|
173
|
-
}, staging: false, overlayClassName: `${overlayClassName} multiple`, searchable: searchable, matchButtonWidth:
|
|
172
|
+
}, staging: false, overlayClassName: `${overlayClassName} multiple`, searchable: searchable, matchButtonWidth: matchButtonWidth, placeholder: placeholder, searchPlaceholder: searchPlaceholder, appearance: 'button', size: size, disabled: disabled, autoClearSearchValue: true, options: options === null || options === void 0 ? void 0 : options.map((i) => ({ ...i, text: i.text || i.label })), value: Array.isArray(value) ? value : [], onChange: onChange, onSearch: onSearch, footer: footer, onOpen: onOpen, onScrollBottom: onScrollBottom, bottomTips: bottomTips, tips: tips, listHeight: listHeight, listWidth: listWidth }));
|
|
174
173
|
}
|
|
175
174
|
else {
|
|
176
|
-
return (_jsx(Select, { popupContainer: popupContainer, button: (selectedItem) => {
|
|
175
|
+
return (_jsx(Select, { ...restProps, popupContainer: popupContainer, button: (selectedItem) => {
|
|
177
176
|
if (!selectedItem) {
|
|
178
177
|
return _jsx("div", { className: "wedatea2td-text-weak", children: placeholder });
|
|
179
178
|
}
|
|
180
179
|
return (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.label) || (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value);
|
|
181
|
-
}, overlayClassName: overlayClassName, searchable: searchable, matchButtonWidth:
|
|
180
|
+
}, overlayClassName: overlayClassName, searchable: searchable, matchButtonWidth: matchButtonWidth, placeholder: placeholder, searchPlaceholder: searchPlaceholder, appearance: 'button', size: size, disabled: disabled, autoClearSearchValue: true, options: options === null || options === void 0 ? void 0 : options.map((i) => ({ ...i, text: i.text || i.label })), value: value, onChange: onChange, onSearch: onSearch, footer: footer, onOpen: onOpen, onScrollBottom: onScrollBottom, bottomTips: bottomTips, tips: tips, listHeight: listHeight, listWidth: listWidth }));
|
|
182
181
|
}
|
|
183
182
|
};
|
|
184
183
|
return (_jsx(WdFormItemReadOnly, { after: props.after, before: props.before, onRelationTagClick: props.onRelationTagClick, readBeforeAfter: true, readOnly: readOnly, readValue: readValue, format: format, value: value, version: 'wd', children: _jsx("div", { "data-testid": isMultiple ? 'form-item-select-multiple-pc' : 'form-select', className: isMultiple ? 'form-select-multiple-pc' : 'form-select-pc', children: render() }) }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { forwardRef, useState, useCallback, useRef } from 'react';
|
|
3
|
-
import { useHandleClear, useFixedIcon, SELECT_ICON_H5, SELECT_ICON_PC
|
|
3
|
+
import { useHandleClear, useFixedIcon, SELECT_ICON_H5, SELECT_ICON_PC } from '../../utils/hooks/useFormLegacy';
|
|
4
4
|
import { useFormInputTrait } from '../../components/form-input-hooks';
|
|
5
5
|
import { WdFormItem, WdInputGroup, WdInputWrap } from '../wd-form-item';
|
|
6
6
|
import { isFormatWithRelation } from '../form/select/formats-util';
|
|
@@ -17,7 +17,7 @@ import { SelectCom as Select } from './select';
|
|
|
17
17
|
*/
|
|
18
18
|
export const WdSelect = forwardRef(function WsSelect(props, ref) {
|
|
19
19
|
const { classRoot = 'select', clearable = X_RUNTIME_DEFAULT.clearable, placeholder, range, format, tipBlock = X_RUNTIME_DEFAULT.tipBlock, where = X_RUNTIME_DEFAULT.where, enumName, primaryField, viewId, dataSourceName, events = emptyObject, ignoreCase = X_RUNTIME_DEFAULT.ignoreCase, staticSearchable = X_RUNTIME_DEFAULT.staticSearchable, enableRelationalSetting = X_RUNTIME_DEFAULT.enableRelationalSetting, enableRelationalRefresh = X_RUNTIME_DEFAULT.enableRelationalRefresh, addRelationButtonText = X_RUNTIME_DEFAULT.addRelationButtonText, enableAddRelationButton = X_RUNTIME_DEFAULT.enableAddRelationButton, enableRelationOptionJump = X_RUNTIME_DEFAULT.enableRelationOptionJump, popupContainer, selectFields: customFields = [], // 自定义展示字段
|
|
20
|
-
selectFieldType = 'primary', } = props;
|
|
20
|
+
selectFieldType = 'primary', searchPlaceholder, } = props;
|
|
21
21
|
const childRef = useRef(null);
|
|
22
22
|
const [options, setOptions] = useState([]);
|
|
23
23
|
const [innerHandle, setInnerHandle] = useState({});
|
|
@@ -108,5 +108,5 @@ export const WdSelect = forwardRef(function WsSelect(props, ref) {
|
|
|
108
108
|
}, enableRelationOptionJump: enableRelationOptionJump, onRelationOptionJump: (item) => {
|
|
109
109
|
var _a;
|
|
110
110
|
(_a = delayEvents === null || delayEvents === void 0 ? void 0 : delayEvents.onRelationOptionJump) === null || _a === void 0 ? void 0 : _a.call(delayEvents, item);
|
|
111
|
-
}, selectFieldType: selectFieldType, selectFields: customFields, isRelation: isRelation, addRelationButtonText: addRelationButtonText, enableAddRelationButton: enableAddRelationButton, childRef: childRef, events: delayEvents, labelVisible: false, value: value, enumName: enumName, format: format, placeholder: placeholder, primaryField: primaryField, options: range, size: "full", tipBlock: tipBlock, viewId: viewId, where: where, dataSourceName: dataSourceName, readOnly: readOnly, disabled: disabled, mode: "selector", decorator: null, ignoreCase: ignoreCase, staticSearchable: staticSearchable, onChange: handleChange, onSearch: onSearchValueInput, popupContainer: popupContainer, searchable: true }) }) }), layout === 'horizontal' && LabelAdornment] }) }));
|
|
111
|
+
}, selectFieldType: selectFieldType, selectFields: customFields, isRelation: isRelation, addRelationButtonText: addRelationButtonText, enableAddRelationButton: enableAddRelationButton, childRef: childRef, events: delayEvents, labelVisible: false, value: value, enumName: enumName, format: format, placeholder: placeholder, primaryField: primaryField, options: range, size: "full", tipBlock: tipBlock, viewId: viewId, where: where, dataSourceName: dataSourceName, readOnly: readOnly, disabled: disabled, mode: "selector", decorator: null, ignoreCase: ignoreCase, staticSearchable: staticSearchable, onChange: handleChange, onSearch: onSearchValueInput, popupContainer: popupContainer, searchable: true, searchPlaceholder: searchPlaceholder }) }) }), layout === 'horizontal' && LabelAdornment] }) }));
|
|
112
112
|
});
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import React, { forwardRef, useState, useCallback, useRef } from 'react';
|
|
3
3
|
import { WdFormItem, WdInputGroup, WdInputWrap } from '../wd-form-item';
|
|
4
4
|
import { SelectCom as SelectMultiple } from '../wd-select/select';
|
|
5
|
-
import { useHandleClear, useFixedIcon, SELECT_ICON_H5, SELECT_ICON_PC
|
|
5
|
+
import { useHandleClear, useFixedIcon, SELECT_ICON_H5, SELECT_ICON_PC } from '../../utils/hooks/useFormLegacy';
|
|
6
6
|
import { useFormInputTrait } from '../../components/form-input-hooks';
|
|
7
7
|
import { useSelected } from '../../utils/hooks/use-selected';
|
|
8
8
|
import { emptyObject } from '../../utils/constant';
|
|
@@ -18,7 +18,7 @@ import { RelationalSetting } from '../wd-select/relationSelect/relationalSetting
|
|
|
18
18
|
*/
|
|
19
19
|
export const WdSelectMultiple = forwardRef(function WdSelectMultiple(props, ref) {
|
|
20
20
|
const { classRoot = 'select-multiple', clearable = X_RUNTIME_DEFAULT.clearable, placeholder, range, enumName, format, primaryField, tipBlock = X_RUNTIME_DEFAULT.tipBlock, viewId, dataSourceName, events = emptyObject, ignoreCase = X_RUNTIME_DEFAULT.ignoreCase, staticSearchable = X_RUNTIME_DEFAULT.staticSearchable, where = X_RUNTIME_DEFAULT.where, enableRelationalSetting = X_RUNTIME_DEFAULT.enableRelationalSetting, enableRelationalRefresh = X_RUNTIME_DEFAULT.enableRelationalRefresh, addRelationButtonText = X_RUNTIME_DEFAULT.addRelationButtonText, enableAddRelationButton = X_RUNTIME_DEFAULT.enableAddRelationButton, enableRelationOptionJump = X_RUNTIME_DEFAULT.enableRelationOptionJump, popupContainer, selectFields: customFields = [], // 自定义展示字段
|
|
21
|
-
selectFieldType = 'primary', } = props;
|
|
21
|
+
selectFieldType = 'primary', searchPlaceholder, } = props;
|
|
22
22
|
const childRef = useRef(null);
|
|
23
23
|
const [options, setOptions] = useState([]);
|
|
24
24
|
const [innerHandle, setInnerHandle] = useState({});
|
|
@@ -104,5 +104,5 @@ export const WdSelectMultiple = forwardRef(function WdSelectMultiple(props, ref)
|
|
|
104
104
|
}, enableRelationOptionJump: enableRelationOptionJump, onRelationOptionJump: (item) => {
|
|
105
105
|
var _a;
|
|
106
106
|
(_a = delayEvents === null || delayEvents === void 0 ? void 0 : delayEvents.onRelationOptionJump) === null || _a === void 0 ? void 0 : _a.call(delayEvents, item);
|
|
107
|
-
}, selectFieldType: selectFieldType, selectFields: customFields, isRelation: isRelation, addRelationButtonText: addRelationButtonText, enableAddRelationButton: enableAddRelationButton, childRef: childRef, events: delayEvents, labelVisible: false, value: value, enumName: enumName, format: format, placeholder: placeholder, primaryField: primaryField, options: range, size: "full", tipBlock: tipBlock, viewId: viewId, dataSourceName: dataSourceName, readOnly: readOnly, disabled: disabled, mode: "multiple", decorator: null, ignoreCase: ignoreCase, staticSearchable: staticSearchable, where: where, onChange: handleChange, onSearch: onSearchValueInput, popupContainer: popupContainer, searchable: true }) }) }), layout === 'horizontal' && LabelAdornment] }) }));
|
|
107
|
+
}, selectFieldType: selectFieldType, selectFields: customFields, isRelation: isRelation, addRelationButtonText: addRelationButtonText, enableAddRelationButton: enableAddRelationButton, childRef: childRef, events: delayEvents, labelVisible: false, value: value, enumName: enumName, format: format, placeholder: placeholder, primaryField: primaryField, options: range, size: "full", tipBlock: tipBlock, viewId: viewId, dataSourceName: dataSourceName, readOnly: readOnly, disabled: disabled, mode: "multiple", decorator: null, ignoreCase: ignoreCase, staticSearchable: staticSearchable, where: where, onChange: handleChange, onSearch: onSearchValueInput, popupContainer: popupContainer, searchable: true, searchPlaceholder: searchPlaceholder }) }) }), layout === 'horizontal' && LabelAdornment] }) }));
|
|
108
108
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const getDataBaseInfo: (fields: any, format: any, childDbName: any) => any;
|
|
2
2
|
export declare const mapResult: (records: any, primaryColumn: any) => any;
|
|
3
|
-
export declare const useChooseList: ({ dataSourceAPI, queryParams, childDbName, primaryColumn, value
|
|
3
|
+
export declare const useChooseList: ({ dataSourceAPI, queryParams, childDbName, primaryColumn, value }: {
|
|
4
4
|
dataSourceAPI: any;
|
|
5
5
|
queryParams: any;
|
|
6
6
|
childDbName: any;
|
|
@@ -35,20 +35,21 @@ export const getDataBaseInfo = (fields, format, childDbName) => {
|
|
|
35
35
|
};
|
|
36
36
|
export const mapResult = (records, primaryColumn) => {
|
|
37
37
|
return records === null || records === void 0 ? void 0 : records.map((childItem) => ({
|
|
38
|
+
_id: childItem._id,
|
|
38
39
|
value: childItem._id,
|
|
39
40
|
text: childItem[primaryColumn] ? childItem[primaryColumn] : childItem._id,
|
|
40
41
|
label: childItem[primaryColumn] ? childItem[primaryColumn] : childItem._id,
|
|
41
42
|
extra: childItem,
|
|
42
43
|
}));
|
|
43
44
|
};
|
|
44
|
-
export const useChooseList = ({ dataSourceAPI, queryParams, childDbName, primaryColumn, value
|
|
45
|
+
export const useChooseList = ({ dataSourceAPI, queryParams, childDbName, primaryColumn, value }) => {
|
|
45
46
|
const [option, setOption] = useState([]);
|
|
46
47
|
const [total, setTotal] = useState(0);
|
|
47
48
|
const [loading, setLoading] = useState(true);
|
|
48
|
-
const unshiftVal = (transformedRecords, itemResult) => {
|
|
49
|
+
const unshiftVal = (transformedRecords, itemResult, originOption) => {
|
|
49
50
|
if (itemResult &&
|
|
50
51
|
transformedRecords.findIndex((item) => item._id === itemResult._id) < 0 &&
|
|
51
|
-
|
|
52
|
+
originOption.findIndex((item) => item._id === itemResult._id) < 0) {
|
|
52
53
|
return [itemResult, ...transformedRecords];
|
|
53
54
|
}
|
|
54
55
|
return transformedRecords;
|
|
@@ -83,7 +84,7 @@ export const useChooseList = ({ dataSourceAPI, queryParams, childDbName, primary
|
|
|
83
84
|
// 若下拉列表中无选中值,则将选中值插到数组头部
|
|
84
85
|
if ((isMultiple && (value === null || value === void 0 ? void 0 : value.length)) || value) {
|
|
85
86
|
itemResult.forEach((i) => {
|
|
86
|
-
transformedRecords = unshiftVal(transformedRecords, i);
|
|
87
|
+
transformedRecords = unshiftVal(transformedRecords, i, option);
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
90
|
let optionRes = mapResult(transformedRecords, primaryColumn);
|
|
@@ -10,12 +10,10 @@ export const renderSlot = (props) => {
|
|
|
10
10
|
const { tabsDatas, selectedTab, isMultipleSlot } = props;
|
|
11
11
|
if (props.isSlotAuto) {
|
|
12
12
|
const slot = getSlots(props);
|
|
13
|
-
const slotKey = (
|
|
13
|
+
const slotKey = isMultipleSlot ? (_a = tabsDatas[selectedTab]) === null || _a === void 0 ? void 0 : _a.slotKey : '1';
|
|
14
14
|
return slot[`${TAB_SLOT_PREFIX}_${slotKey}`];
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
17
|
-
return isMultipleSlot
|
|
18
|
-
? props[`panel${selectedTab + Number('1')}`]
|
|
19
|
-
: props[`panel1`];
|
|
17
|
+
return isMultipleSlot ? props[`panel${selectedTab + Number('1')}`] : props[`panel1`];
|
|
20
18
|
}
|
|
21
19
|
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export function getShadowRoot(): any;
|
|
2
|
+
export function loadIconShadowRoot(url: any, className: any): Promise<any>;
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import cfg from '../../iconConfig.json';
|
|
2
2
|
import { getUrlPath } from './tool';
|
|
3
3
|
import { errorHandler } from './error';
|
|
4
|
+
let shadowRootCache = null;
|
|
5
|
+
const WEDA_PORTAL_ID = 'weda-module-portal';
|
|
6
|
+
export function getShadowRoot() {
|
|
7
|
+
var _a;
|
|
8
|
+
if (!shadowRootCache) {
|
|
9
|
+
shadowRootCache = (_a = document.getElementById(WEDA_PORTAL_ID)) === null || _a === void 0 ? void 0 : _a.shadowRoot;
|
|
10
|
+
}
|
|
11
|
+
return shadowRootCache;
|
|
12
|
+
}
|
|
13
|
+
// 影子dom加载图标库
|
|
14
|
+
export function loadIconShadowRoot(url, className) {
|
|
15
|
+
const shadowRoot = getShadowRoot();
|
|
16
|
+
if (!shadowRoot) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
if (!url || typeof url !== 'string') {
|
|
21
|
+
reject();
|
|
22
|
+
}
|
|
23
|
+
else if (shadowRoot.querySelectorAll('.'.concat(className, '[href="').concat(url, '"]')).length > 0) {
|
|
24
|
+
resolve(true);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const l = document.createElement('link');
|
|
28
|
+
l.setAttribute('class', className);
|
|
29
|
+
l.setAttribute('href', url);
|
|
30
|
+
l.setAttribute('rel', 'stylesheet');
|
|
31
|
+
shadowRoot.head.appendChild(l);
|
|
32
|
+
l.addEventListener('load', () => resolve(true));
|
|
33
|
+
l.addEventListener('error', () => reject());
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
4
37
|
// 加载样式,失败抛出错误
|
|
5
38
|
function loadLink(url, className) {
|
|
6
39
|
return new Promise((resolve, reject) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/weda-ui",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.4",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index",
|
|
6
6
|
"miniprogram": "mpdist",
|
|
@@ -148,8 +148,8 @@
|
|
|
148
148
|
"@babel/preset-react": "^7.22.15",
|
|
149
149
|
"@babel/preset-typescript": "^7.22.15",
|
|
150
150
|
"@cloudbase/cals": "^1.2.5",
|
|
151
|
-
"@cloudbase/lowcode-cli": "^0.
|
|
152
|
-
"@cloudbase/weda-cloud-sdk": "^1.0.
|
|
151
|
+
"@cloudbase/lowcode-cli": "^0.22.0",
|
|
152
|
+
"@cloudbase/weda-cloud-sdk": "^1.0.94",
|
|
153
153
|
"@commitlint/cli": "^16.0.2",
|
|
154
154
|
"@commitlint/config-conventional": "^17.7.0",
|
|
155
155
|
"@craco/craco": "^7.1.0",
|