@cloudbase/weda-ui 3.12.1 → 3.12.3

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.
@@ -88,11 +88,11 @@ declare const OPERATION_NODE_STATUS: readonly [{
88
88
  /** 操作节点状态相关映射关系转换 */
89
89
  declare const
90
90
  /** 状态码-状态名称映射 */
91
- CODE_NAME_MAPPING: Record<number, "stop" | "drop" | "end" | "start" | "down" | "pending" | "revoke" | "cc" | "pass" | "turn" | "trans" | "countersign" | "skip_pass" | "skip_down" | "handled" | "handling" | "delete_draft">,
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" | "STOP" | "DROP" | "END" | "START" | "DOWN" | "PENDING" | "PASS" | "TURN" | "TRANS" | "COUNTERSIGN" | "SKIP_PASS" | "SKIP_DOWN" | "HANDLED" | "HANDLING" | "DELETE_DRAFT", number>,
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" | "STOP" | "DROP" | "END" | "START" | "DOWN" | "PENDING" | "PASS" | "TURN" | "TRANS" | "COUNTERSIGN" | "SKIP_PASS" | "SKIP_DOWN" | "HANDLED" | "HANDLING" | "DELETE_DRAFT", "stop" | "drop" | "end" | "start" | "down" | "pending" | "revoke" | "cc" | "pass" | "turn" | "trans" | "countersign" | "skip_pass" | "skip_down" | "handled" | "handling" | "delete_draft">,
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: 88px;
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;
@@ -29,7 +29,7 @@ alt = '[加载失败]', gutter = 8, height = 100, width = 100, events = emptyObj
29
29
  cursor: isZoom ? 'zoom-in' : 'auto',
30
30
  };
31
31
  const values = [].concat(srcList).filter((d) => typeof d === 'string' && d !== '');
32
- return (_jsx("div", { className: cls, id: id, style: style, children: _jsxs("div", { className: `${CLASS_PREFIX}__image-list`, children: [values.map((d, i) => {
32
+ return (_jsx("div", { className: cls, id: id, style: style, "data-testid": "uploader-view", children: _jsxs("div", { className: `${CLASS_PREFIX}__image-list`, children: [values.map((d, i) => {
33
33
  const imgProps = {
34
34
  fileID: d,
35
35
  className: `${CLASS_PREFIX}__image`,
@@ -39,6 +39,7 @@ alt = '[加载失败]', gutter = 8, height = 100, width = 100, events = emptyObj
39
39
  onError: () => setErrorList((list) => [...list, d]),
40
40
  portalContainer,
41
41
  allFile: values === null || values === void 0 ? void 0 : values.map((d) => ({ realUrl: d })),
42
+ index: i,
42
43
  };
43
44
  return (_jsx("div", { className: `${CLASS_PREFIX}__image-box`, style: boxStyle, title: d, children: _jsx(TcbImage, { ...imgProps }) }, `${d}-${i}`));
44
45
  }), values.length === 0 && isEmptyPlace && (_jsx("div", { className: `${CLASS_PREFIX}__image-box`, style: boxStyle, children: _jsx("img", { className: `${CLASS_PREFIX}__image`, alt: "\u6682\u65E0\u56FE\u7247" }) }))] }) }));
@@ -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
  });
@@ -95,20 +95,22 @@ export const ImagePreview = (props) => {
95
95
  setCurrentImg(previewImageList[index]);
96
96
  });
97
97
  }, [children, index, previewImageList, setCurrentImg]);
98
- return (_jsxs(_Fragment, { children: [child, visible && (_jsx(Portal, { type: "div", portalContainer: portalContainer, children: _jsx("div", { "data-testid": "portal-container", style: { zIndex: 1001, position: 'relative' }, className: `${classPrefix}-image-preview-container`, children: _jsxs("div", { className: `${classPrefix}-image-mask`, onClick: onMaskClick, children: [_jsx("div", { onClick: (e) => {
98
+ return (_jsxs(_Fragment, { children: [child, visible && (_jsx(Portal, { type: "div", portalContainer: portalContainer, children: _jsx("div", { "data-testid": "portal-container", style: { zIndex: 1010, position: 'relative' }, className: `${classPrefix}-image-preview-container`, children: _jsxs("div", { className: `${classPrefix}-image-mask`, onClick: onMaskClick, children: [_jsx("div", { onClick: (e) => {
99
99
  if (isStopPropagation) {
100
100
  e.stopPropagation();
101
101
  }
102
102
  setVisible(false);
103
103
  }, className: `${classPrefix}-image-mask__close-btn`, children: _jsx("i", { className: `${classPrefix}-image-mask__icon-close` }) }), _jsx("div", { ...bind(), className: `${classPrefix}-image-preview`, style: previewStyle }), platform === 'pc' && (_jsxs("div", { className: `${classPrefix}-image-preview-toolbar`, children: [(previewImageList === null || previewImageList === void 0 ? void 0 : previewImageList.length) > 1 && (_jsxs(_Fragment, { children: [_jsx("span", { className: "wd-icon-wrap wd-event-tap", children: _jsx(WdIcon, { name: 'td:chevron-left', size: "sm", events: {
104
- tap: () => {
104
+ tap: (arg, { originEvent: e }) => {
105
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
105
106
  const index = previewImageList.findIndex((i) => i === currentImg);
106
107
  const currentIndex = index === 0 ? previewImageList.length - 1 : index - 1;
107
108
  setCurrentImg(previewImageList[currentIndex]);
108
109
  setRotate(0);
109
110
  },
110
111
  } }) }), _jsx("span", { className: "wd-icon-wrap wd-event-tap", children: _jsx(WdIcon, { name: 'td:chevron-right', size: "sm", events: {
111
- tap: () => {
112
+ tap: (arg, { originEvent: e }) => {
113
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
112
114
  const index = previewImageList.findIndex((i) => i === currentImg);
113
115
  const currentIndex = index === previewImageList.length - 1 ? 0 : index + 1;
114
116
  setCurrentImg(previewImageList[currentIndex]);
@@ -116,7 +118,7 @@ export const ImagePreview = (props) => {
116
118
  },
117
119
  } }) })] })), _jsx("span", { className: "wd-icon-wrap wd-event-tap", children: _jsx(WdIcon, { name: 'td:anticlockwise', size: "sm", events: {
118
120
  tap: (arg, { originEvent: e }) => {
119
- e.stopPropagation();
121
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
120
122
  // eslint-disable-next-line @typescript-eslint/no-magic-numbers
121
123
  setRotate(rotate - 90);
122
124
  },
@@ -48,7 +48,6 @@ const OptionText = ({ mode, option, selectFields, authFields, onChange, onRelati
48
48
  const defaultSize = 50;
49
49
  const defaultPage = 1;
50
50
  export function RelationSelect(props) {
51
- var _a;
52
51
  const { placeholder, size, disabled, onChange, value, onSearch, addRelationButton, childRef, dataSourceName, selectFields, selectFieldType, primaryField, setRefreshStatus, mode, onRelationOptionJump, enableRelationOptionJump, } = props;
53
52
  const { authFields } = useAuthFields({
54
53
  dbName: dataSourceName,
@@ -128,8 +127,6 @@ export function RelationSelect(props) {
128
127
  searchOptionListWithWhere(where);
129
128
  onSearch(keyword);
130
129
  };
131
- const primaryFieldTitle = (_a = authFields === null || authFields === void 0 ? void 0 : authFields.find((j) => (j === null || j === void 0 ? void 0 : j.name) === primaryField)) === null || _a === void 0 ? void 0 : _a.title;
132
- const searchPlaceholder = `搜索主列${primaryFieldTitle}[${primaryField}]`;
133
130
  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: () => {
134
131
  if (!isLoading && customOptions.length < total) {
135
132
  setQuery((query) => ({
@@ -139,7 +136,7 @@ export function RelationSelect(props) {
139
136
  }
140
137
  }, onOpen: () => {
141
138
  searchOptionListWithWhere();
142
- }, footer: addRelationButton, mode: mode, searchPlaceholder: searchPlaceholder }) }));
139
+ }, footer: addRelationButton, mode: mode }) }));
143
140
  }
144
141
  export function EnumSelect(props) {
145
142
  const { placeholder, size, disabled, onChange, value, onSearch, addRelationButton, childRef, dataSourceName, enumName, primaryField, format, viewId, where, setRefreshStatus, mode, } = props;
@@ -193,5 +190,5 @@ export function CustomSelect(props) {
193
190
  if (refreshStatus) {
194
191
  return _jsx(LoadingTip, {});
195
192
  }
196
- return isEnumType ? (_jsx(EnumSelect, { ...props, addRelationButton: addRelationButton, setRefreshStatus: setRefreshStatus, listWidth: listWidth })) : (_jsx(RelationSelect, { ...props, addRelationButton: addRelationButton, setRefreshStatus: setRefreshStatus, listWidth: listWidth, searchPlaceholder: '搜索主列' }));
193
+ return isEnumType ? (_jsx(EnumSelect, { ...props, addRelationButton: addRelationButton, setRefreshStatus: setRefreshStatus, listWidth: listWidth })) : (_jsx(RelationSelect, { ...props, addRelationButton: addRelationButton, setRefreshStatus: setRefreshStatus, listWidth: listWidth }));
197
194
  }
@@ -20,7 +20,7 @@ const OptionList = ({ options, inputFocus, currentSelected, optionClick, bottomT
20
20
  'is-selected': currentSelected.find((i) => i.value === item.value),
21
21
  'is-disabled': item.disabled,
22
22
  });
23
- return (_jsx(List.Item, { className: itemCls, onClick: () => optionClick(item), children: _jsx("p", { className: 'weda-ui-custom-picker__cloumn-item-text', children: textToString(item.text) || textToString(item.label) }) }, index));
23
+ return (_jsx(List.Item, { className: itemCls, onClick: () => optionClick(item), children: _jsx("p", { className: 'weda-ui-custom-picker__cloumn-item-text', children: item.text || item.label }) }, index));
24
24
  }), bottomTips && (_jsx(List.Item, { children: _jsx("div", { className: "weda-ui-custom-picker__status weda-ui-custom-picker__status--empty", children: bottomTips }) }))] }));
25
25
  };
26
26
  const getSelectedItem = (options = [], value) => {
@@ -53,9 +53,9 @@ function SelectH5(props) {
53
53
  // 判断是否输入中文,则停止搜索
54
54
  setIsSearch(false);
55
55
  };
56
- const handleZhEnd = (e) => {
56
+ const handleZhEnd = () => {
57
57
  setIsSearch(true);
58
- handleSearch(e);
58
+ onSearch(searchValue);
59
59
  };
60
60
  const handleSearch = (e) => {
61
61
  const tValue = e.target.value.trim();
@@ -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, } from '../../utils/hooks/useFormLegacy';
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, } from '../../utils/hooks/useFormLegacy';
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 +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.1",
3
+ "version": "3.12.3",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index",
6
6
  "miniprogram": "mpdist",
@@ -85,7 +85,7 @@
85
85
  "description": "腾讯云微搭低代码组件库模板",
86
86
  "dependencies": {
87
87
  "@antv/g6": "^4.8.5",
88
- "@cloudbase/weda-client": "^1.1.13",
88
+ "@cloudbase/weda-client": "^1.1.14",
89
89
  "@codemirror/autocomplete": "^6.16.0",
90
90
  "@codemirror/lang-javascript": "^6.2.2",
91
91
  "@codemirror/lang-json": "^6.0.1",
@@ -149,7 +149,7 @@
149
149
  "@babel/preset-typescript": "^7.22.15",
150
150
  "@cloudbase/cals": "^1.2.5",
151
151
  "@cloudbase/lowcode-cli": "^0.21.14",
152
- "@cloudbase/weda-cloud-sdk": "^1.0.89",
152
+ "@cloudbase/weda-cloud-sdk": "^1.0.93",
153
153
  "@commitlint/cli": "^16.0.2",
154
154
  "@commitlint/config-conventional": "^17.7.0",
155
155
  "@craco/craco": "^7.1.0",