@douyinfe/semi-foundation 2.1.3 → 2.2.0-beta.0

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.
Files changed (106) hide show
  1. package/cascader/cascader.scss +1 -1
  2. package/cascader/constants.ts +4 -0
  3. package/cascader/foundation.ts +29 -15
  4. package/cascader/util.ts +13 -0
  5. package/checkbox/checkbox.scss +25 -1
  6. package/checkbox/checkboxFoundation.ts +15 -4
  7. package/checkbox/variables.scss +6 -1
  8. package/datePicker/datePicker.scss +18 -0
  9. package/datePicker/monthsGridFoundation.ts +101 -8
  10. package/lib/cjs/cascader/cascader.css +2 -2
  11. package/lib/cjs/cascader/cascader.scss +1 -1
  12. package/lib/cjs/cascader/constants.d.ts +3 -0
  13. package/lib/cjs/cascader/constants.js +6 -1
  14. package/lib/cjs/cascader/foundation.d.ts +4 -1
  15. package/lib/cjs/cascader/foundation.js +24 -11
  16. package/lib/cjs/cascader/util.d.ts +1 -0
  17. package/lib/cjs/cascader/util.js +17 -0
  18. package/lib/cjs/checkbox/checkbox.css +21 -2
  19. package/lib/cjs/checkbox/checkbox.scss +25 -1
  20. package/lib/cjs/checkbox/checkboxFoundation.d.ts +11 -4
  21. package/lib/cjs/checkbox/checkboxFoundation.js +7 -0
  22. package/lib/cjs/checkbox/variables.scss +6 -1
  23. package/lib/cjs/datePicker/datePicker.css +6 -0
  24. package/lib/cjs/datePicker/datePicker.scss +18 -0
  25. package/lib/cjs/datePicker/monthsGridFoundation.d.ts +35 -3
  26. package/lib/cjs/datePicker/monthsGridFoundation.js +139 -6
  27. package/lib/cjs/modal/modal.css +1 -1
  28. package/lib/cjs/modal/modalFoundation.d.ts +2 -2
  29. package/lib/cjs/modal/variables.scss +1 -1
  30. package/lib/cjs/radio/radio.css +33 -2
  31. package/lib/cjs/radio/radio.scss +44 -1
  32. package/lib/cjs/radio/variables.scss +12 -2
  33. package/lib/cjs/rating/rating.css +3 -0
  34. package/lib/cjs/rating/rating.scss +4 -0
  35. package/lib/cjs/select/select.scss +1 -1
  36. package/lib/cjs/sideSheet/sideSheet.css +1 -1
  37. package/lib/cjs/sideSheet/variables.scss +1 -1
  38. package/lib/cjs/table/table.css +2 -2
  39. package/lib/cjs/table/table.scss +2 -2
  40. package/lib/cjs/table/variables.scss +3 -0
  41. package/lib/cjs/timeline/timeline.css +3 -0
  42. package/lib/cjs/timeline/timeline.scss +5 -1
  43. package/lib/cjs/tree/treeUtil.js +14 -14
  44. package/lib/cjs/upload/foundation.d.ts +1 -0
  45. package/lib/cjs/upload/foundation.js +106 -0
  46. package/lib/cjs/upload/rtl.scss +0 -4
  47. package/lib/cjs/upload/upload.css +31 -19
  48. package/lib/cjs/upload/upload.scss +31 -8
  49. package/lib/cjs/upload/variables.scss +6 -2
  50. package/lib/es/cascader/cascader.css +2 -2
  51. package/lib/es/cascader/cascader.scss +1 -1
  52. package/lib/es/cascader/constants.d.ts +3 -0
  53. package/lib/es/cascader/constants.js +6 -1
  54. package/lib/es/cascader/foundation.d.ts +4 -1
  55. package/lib/es/cascader/foundation.js +24 -12
  56. package/lib/es/cascader/util.d.ts +1 -0
  57. package/lib/es/cascader/util.js +14 -0
  58. package/lib/es/checkbox/checkbox.css +21 -2
  59. package/lib/es/checkbox/checkbox.scss +25 -1
  60. package/lib/es/checkbox/checkboxFoundation.d.ts +11 -4
  61. package/lib/es/checkbox/checkboxFoundation.js +7 -0
  62. package/lib/es/checkbox/variables.scss +6 -1
  63. package/lib/es/datePicker/datePicker.css +6 -0
  64. package/lib/es/datePicker/datePicker.scss +18 -0
  65. package/lib/es/datePicker/monthsGridFoundation.d.ts +35 -3
  66. package/lib/es/datePicker/monthsGridFoundation.js +139 -6
  67. package/lib/es/modal/modal.css +1 -1
  68. package/lib/es/modal/modalFoundation.d.ts +2 -2
  69. package/lib/es/modal/variables.scss +1 -1
  70. package/lib/es/radio/radio.css +33 -2
  71. package/lib/es/radio/radio.scss +44 -1
  72. package/lib/es/radio/variables.scss +12 -2
  73. package/lib/es/rating/rating.css +3 -0
  74. package/lib/es/rating/rating.scss +4 -0
  75. package/lib/es/select/select.scss +1 -1
  76. package/lib/es/sideSheet/sideSheet.css +1 -1
  77. package/lib/es/sideSheet/variables.scss +1 -1
  78. package/lib/es/table/table.css +2 -2
  79. package/lib/es/table/table.scss +2 -2
  80. package/lib/es/table/variables.scss +3 -0
  81. package/lib/es/timeline/timeline.css +3 -0
  82. package/lib/es/timeline/timeline.scss +5 -1
  83. package/lib/es/tree/treeUtil.js +13 -12
  84. package/lib/es/upload/foundation.d.ts +1 -0
  85. package/lib/es/upload/foundation.js +107 -0
  86. package/lib/es/upload/rtl.scss +0 -4
  87. package/lib/es/upload/upload.css +31 -19
  88. package/lib/es/upload/upload.scss +31 -8
  89. package/lib/es/upload/variables.scss +6 -2
  90. package/modal/modalFoundation.ts +2 -2
  91. package/modal/variables.scss +1 -1
  92. package/package.json +3 -3
  93. package/radio/radio.scss +44 -1
  94. package/radio/variables.scss +12 -2
  95. package/rating/rating.scss +4 -0
  96. package/select/select.scss +1 -1
  97. package/sideSheet/variables.scss +1 -1
  98. package/table/table.scss +2 -2
  99. package/table/variables.scss +3 -0
  100. package/timeline/timeline.scss +5 -1
  101. package/tree/treeUtil.ts +6 -2
  102. package/tsconfig.json +2 -1
  103. package/upload/foundation.ts +81 -0
  104. package/upload/rtl.scss +0 -4
  105. package/upload/upload.scss +31 -8
  106. package/upload/variables.scss +6 -2
@@ -82,3 +82,6 @@ $shadow-table_right: 3px 0 0 0 $color-table_shadow-bg-default; // 表格滚动
82
82
  $border-table: #{$width-table_base_border} #{$border-table_base-borderStyle} $color-table-border-default; // 表格默认描边
83
83
  $border-table_head-bottom: #{$width-table_header_border} #{$border-table_base-borderStyle} $color-table_th-border-default; // 表头单元格描边 - 底部
84
84
  $border-table_resizer: $width-table_resizer_border solid $color-table_resizer-bg-default; // 表格拉伸标识描边
85
+
86
+ $z-table-fixed: 101!default; // fixed列的zIndex值
87
+ $z-table_fixed_column: $z-table-fixed; // fixed列的zIndex值
@@ -96,6 +96,9 @@
96
96
  .semi-timeline-alternate .semi-timeline-item-tail, .semi-timeline-alternate .semi-timeline-item-head, .semi-timeline-alternate .semi-timeline-item-head-custom, .semi-timeline-right .semi-timeline-item-tail, .semi-timeline-right .semi-timeline-item-head, .semi-timeline-right .semi-timeline-item-head-custom, .semi-timeline-center .semi-timeline-item-tail, .semi-timeline-center .semi-timeline-item-head, .semi-timeline-center .semi-timeline-item-head-custom {
97
97
  left: 50%;
98
98
  }
99
+ .semi-timeline-alternate .semi-timeline-item-head.semi-timeline-item-head-custom, .semi-timeline-right .semi-timeline-item-head.semi-timeline-item-head-custom, .semi-timeline-center .semi-timeline-item-head.semi-timeline-item-head-custom {
100
+ margin-left: 0;
101
+ }
99
102
  .semi-timeline-alternate .semi-timeline-item-head, .semi-timeline-right .semi-timeline-item-head, .semi-timeline-center .semi-timeline-item-head {
100
103
  margin-left: -4px;
101
104
  }
@@ -120,7 +120,11 @@ $module: #{$prefix}-timeline;
120
120
  &-head-custom {
121
121
  left: $spacing-timeline_item_head_custom-left;
122
122
  }
123
-
123
+ &-head{
124
+ &.#{$module}-item-head-custom{
125
+ margin-left: 0;
126
+ }
127
+ }
124
128
  &-head {
125
129
  margin-left: $spacing-timeline_item_head-marginLeft;
126
130
  }
@@ -17,9 +17,8 @@ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/ins
17
17
  import _Set from "@babel/runtime-corejs3/core-js-stable/set";
18
18
  import _everyInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/every";
19
19
  import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
20
- import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
21
- import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
22
20
  import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
21
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
23
22
  import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
24
23
  const DRAG_OFFSET = 0.45;
25
24
 
@@ -498,7 +497,7 @@ export function normalizedArr(val) {
498
497
  }
499
498
  export function normalizeKeyList(keyList, keyEntities) {
500
499
  let leafOnly = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
501
- let res = [];
500
+ const res = [];
502
501
  const keyListSet = new _Set(keyList);
503
502
 
504
503
  if (!leafOnly) {
@@ -518,9 +517,11 @@ export function normalizeKeyList(keyList, keyEntities) {
518
517
  res.push(key);
519
518
  });
520
519
  } else {
521
- var _context8;
522
-
523
- res = _filterInstanceProperty(_context8 = _Array$from(keyList)).call(_context8, key => keyEntities[key] && !isValid(keyEntities[key].children));
520
+ _forEachInstanceProperty(keyList).call(keyList, key => {
521
+ if (keyEntities[key] && !isValid(keyEntities[key].children)) {
522
+ res.push(key);
523
+ }
524
+ });
524
525
  }
525
526
 
526
527
  return res;
@@ -529,9 +530,9 @@ export function getMotionKeys(eventKey, expandedKeys, keyEntities) {
529
530
  const res = [];
530
531
 
531
532
  const getChild = itemKey => {
532
- var _context9;
533
+ var _context8;
533
534
 
534
- keyEntities[itemKey].children && _forEachInstanceProperty(_context9 = keyEntities[itemKey].children).call(_context9, item => {
535
+ keyEntities[itemKey].children && _forEachInstanceProperty(_context8 = keyEntities[itemKey].children).call(_context8, item => {
535
536
  const {
536
537
  key
537
538
  } = item;
@@ -647,7 +648,7 @@ export function calcCheckedKeysForUnchecked(key, keyEntities, checkedKeys, halfC
647
648
  };
648
649
  }
649
650
  export function filterTreeData(info) {
650
- var _context10, _context11;
651
+ var _context9, _context10;
651
652
 
652
653
  const {
653
654
  showFilteredOnly,
@@ -659,7 +660,7 @@ export function filterTreeData(info) {
659
660
  prevExpandedKeys
660
661
  } = info;
661
662
  let filteredOptsKeys = [];
662
- filteredOptsKeys = _mapInstanceProperty(_context10 = _filterInstanceProperty(_context11 = _Object$values(keyEntities)).call(_context11, item => filter(inputValue, item.data, filterTreeNode, filterProps))).call(_context10, item => item.key);
663
+ filteredOptsKeys = _mapInstanceProperty(_context9 = _filterInstanceProperty(_context10 = _Object$values(keyEntities)).call(_context10, item => filter(inputValue, item.data, filterTreeNode, filterProps))).call(_context9, item => item.key);
663
664
  let expandedOptsKeys = findAncestorKeys(filteredOptsKeys, keyEntities, false);
664
665
 
665
666
  if (prevExpandedKeys.length) {
@@ -700,9 +701,9 @@ export function updateKeys(keySet, keyEntities) {
700
701
  return _filterInstanceProperty(keyArr).call(keyArr, key => key in keyEntities);
701
702
  }
702
703
  export function calcDisabledKeys(keyEntities) {
703
- var _context12;
704
+ var _context11;
704
705
 
705
- const disabledKeys = _filterInstanceProperty(_context12 = _Object$keys(keyEntities)).call(_context12, key => keyEntities[key].data.disabled);
706
+ const disabledKeys = _filterInstanceProperty(_context11 = _Object$keys(keyEntities)).call(_context11, key => keyEntities[key].data.disabled);
706
707
 
707
708
  const {
708
709
  checkedKeys
@@ -119,6 +119,7 @@ declare class UploadFoundation<P = Record<string, any>, S = Record<string, any>>
119
119
  buildFileItem(fileInstance: CustomFile, uploadTrigger: string): BaseFileItem;
120
120
  replaceFileList(files: Array<CustomFile>): void;
121
121
  addFilesToList(files: Array<CustomFile>): void;
122
+ insertFileToList(files: Array<CustomFile>, index: number): void;
122
123
  manualUpload(): void;
123
124
  startUpload(fileList: Array<BaseFileItem>): void;
124
125
  upload(file: BaseFileItem): void;
@@ -383,6 +383,113 @@ class UploadFoundation extends BaseFoundation {
383
383
  this.startUpload(currentFiles);
384
384
  }
385
385
  });
386
+ } // 插入多个文件到指定位置
387
+ // Insert files to the specified location
388
+
389
+
390
+ insertFileToList(files, index) {
391
+ const {
392
+ limit,
393
+ transformFile,
394
+ accept,
395
+ uploadTrigger
396
+ } = this.getProps();
397
+ const {
398
+ fileList
399
+ } = this.getStates();
400
+ const unAcceptFileList = []; // 当次选中的文件
401
+ // current selected file
402
+
403
+ let currentFileList = _Array$from(files);
404
+
405
+ if (typeof accept !== 'undefined') {
406
+ currentFileList = _filterInstanceProperty(currentFileList).call(currentFileList, item => {
407
+ const isValid = this.checkFileFormat(accept, item);
408
+
409
+ if (!isValid) {
410
+ unAcceptFileList.push(item);
411
+ }
412
+
413
+ return isValid;
414
+ });
415
+
416
+ if (unAcceptFileList.length !== 0) {
417
+ this._adapter.notifyAcceptInvalid(unAcceptFileList);
418
+ }
419
+
420
+ if (currentFileList.length === 0) {
421
+ return;
422
+ }
423
+ }
424
+
425
+ currentFileList = _mapInstanceProperty(currentFileList).call(currentFileList, file => {
426
+ if (!file.uid) {
427
+ file.uid = getUuidv4();
428
+ }
429
+
430
+ if (this.checkFileSize(file)) {
431
+ file._sizeInvalid = true;
432
+ file.status = FILE_STATUS_VALID_FAIL;
433
+
434
+ this._adapter.notifySizeError(file, fileList);
435
+ }
436
+
437
+ if (transformFile) {
438
+ file = transformFile(file);
439
+ }
440
+
441
+ return file;
442
+ });
443
+ const total = fileList.length + currentFileList.length;
444
+
445
+ if (typeof limit !== 'undefined') {
446
+ // 判断是否超出限制
447
+ // Determine whether the limit is exceeded
448
+ if (total > limit) {
449
+ if (limit === 1) {
450
+ // 使用最后面的文件对当前文件进行替换
451
+ // Use the last file to replace the current file
452
+ currentFileList = _sliceInstanceProperty(currentFileList).call(currentFileList, -1);
453
+
454
+ this._adapter.notifyFileSelect(currentFileList);
455
+
456
+ this._adapter.resetInput();
457
+
458
+ this.replaceFileList(currentFileList);
459
+ return;
460
+ } // 如果超出了限制,则计算还能添加几个文件,将剩余的文件继续上传
461
+ // If the limit is exceeded, several files can be added to the calculation, and the remaining files will continue to be uploaded
462
+
463
+
464
+ const restNum = limit - fileList.length;
465
+ currentFileList = _sliceInstanceProperty(currentFileList).call(currentFileList, 0, restNum);
466
+
467
+ this._adapter.notifyExceed(currentFileList);
468
+ }
469
+ }
470
+
471
+ const fileItemList = _mapInstanceProperty(currentFileList).call(currentFileList, file => this.buildFileItem(file, uploadTrigger));
472
+
473
+ const newFileList = _sliceInstanceProperty(fileList).call(fileList);
474
+
475
+ if (typeof index !== 'undefined') {
476
+ _spliceInstanceProperty(newFileList).call(newFileList, index, 0, ...fileItemList);
477
+ } else {
478
+ newFileList.push(...fileItemList);
479
+ }
480
+
481
+ this._adapter.notifyFileSelect(currentFileList);
482
+
483
+ this._adapter.notifyChange({
484
+ fileList: newFileList,
485
+ currentFile: null
486
+ });
487
+
488
+ this._adapter.updateFileList(newFileList, () => {
489
+ if (uploadTrigger === TRIGGER_AUTO) {
490
+ this.startUpload(fileItemList);
491
+ }
492
+ });
386
493
  }
387
494
 
388
495
  manualUpload() {
@@ -22,8 +22,6 @@ $module: #{$prefix}-upload;
22
22
  }
23
23
 
24
24
  &-file-card {
25
- margin-right: 0;
26
- margin-left: $spacing-upload_picture_file_card-marginRight;
27
25
 
28
26
  &-info {
29
27
 
@@ -53,8 +51,6 @@ $module: #{$prefix}-upload;
53
51
  &-picture {
54
52
 
55
53
  &-file-card {
56
- margin-right: 0;
57
- margin-left: $spacing-upload_picture_file_card-marginRight;
58
54
 
59
55
  &-close {
60
56
  right: auto;
@@ -73,6 +73,8 @@
73
73
  display: flex;
74
74
  flex-wrap: wrap;
75
75
  flex-shrink: 0;
76
+ gap: 8px;
77
+ margin-bottom: 8px;
76
78
  }
77
79
  .semi-upload-file-list-main p {
78
80
  display: flex;
@@ -99,8 +101,6 @@
99
101
  justify-content: space-between;
100
102
  height: 52px;
101
103
  width: 250px;
102
- margin-right: 8px;
103
- margin-bottom: 8px;
104
104
  background-color: var(--semi-color-fill-0);
105
105
  cursor: pointer;
106
106
  }
@@ -235,16 +235,16 @@
235
235
  flex-direction: column;
236
236
  }
237
237
  .semi-upload-picture[x-prompt-pos=bottom] .semi-upload-prompt {
238
- order: 2;
238
+ order: 1;
239
239
  }
240
240
  .semi-upload-picture[x-prompt-pos=bottom] .semi-upload-add {
241
- order: 1;
241
+ order: 0;
242
242
  }
243
243
  .semi-upload-picture[x-prompt-pos=right] .semi-upload-prompt {
244
- order: 2;
244
+ order: 1;
245
245
  }
246
246
  .semi-upload-picture[x-prompt-pos=right] .semi-upload-add {
247
- order: 1;
247
+ order: 0;
248
248
  }
249
249
  .semi-upload-picture-add {
250
250
  background-color: var(--semi-color-fill-0);
@@ -281,11 +281,14 @@
281
281
  margin-bottom: 0;
282
282
  }
283
283
  .semi-upload-picture-file-card {
284
+ display: flex;
285
+ align-items: center;
286
+ justify-content: center;
284
287
  height: 96px;
285
288
  width: 96px;
289
+ border-radius: var(--semi-border-radius-small);
286
290
  position: relative;
287
- margin-right: 8px;
288
- margin-bottom: 8px;
291
+ overflow: hidden;
289
292
  }
290
293
  .semi-upload-picture-file-card img {
291
294
  height: 96px;
@@ -296,7 +299,7 @@
296
299
  .semi-upload-picture-file-card-close {
297
300
  width: 16px;
298
301
  height: 16px;
299
- background-color: var(--semi-overlay-bg);
302
+ background-color: var(--semi-color-overlay-bg);
300
303
  position: absolute;
301
304
  top: 8px;
302
305
  right: 8px;
@@ -350,6 +353,22 @@
350
353
  color: var(--semi-color-white);
351
354
  transform: translate3D(-50%, -50%, 0);
352
355
  }
356
+ .semi-upload-picture-file-card-pic-info {
357
+ display: inline-flex;
358
+ box-sizing: border-box;
359
+ justify-content: space-between;
360
+ align-items: center;
361
+ position: absolute;
362
+ width: 100%;
363
+ height: 24px;
364
+ padding: 0 10px;
365
+ bottom: 0;
366
+ left: 0;
367
+ color: var(--semi-color-white);
368
+ font-size: 12px;
369
+ font-weight: 600;
370
+ background: linear-gradient(0deg, rgba(22, 22, 26, 0.3) 0%, rgba(22, 22, 26, 0) 77.08%);
371
+ }
353
372
  .semi-upload-picture-file-card-icon-loading, .semi-upload-picture-file-card-icon-error {
354
373
  position: absolute;
355
374
  bottom: 6px;
@@ -362,6 +381,9 @@
362
381
  .semi-upload-picture-file-card-show-pointer {
363
382
  cursor: pointer;
364
383
  }
384
+ .semi-upload-picture-file-card-error {
385
+ outline: 1px solid var(--semi-color-danger);
386
+ }
365
387
  .semi-upload-drag-area {
366
388
  border-radius: var(--semi-border-radius-small);
367
389
  border: 2px dashed var(--semi-color-border);
@@ -442,11 +464,6 @@
442
464
  .semi-portal-rtl .semi-upload-file-list-title-clear {
443
465
  display: inline-block;
444
466
  }
445
- .semi-rtl .semi-upload-file-card,
446
- .semi-portal-rtl .semi-upload-file-card {
447
- margin-right: 0;
448
- margin-left: 8px;
449
- }
450
467
  .semi-rtl .semi-upload-file-card-info-size,
451
468
  .semi-portal-rtl .semi-upload-file-card-info-size {
452
469
  margin-left: 0;
@@ -463,11 +480,6 @@
463
480
  margin-right: 0;
464
481
  margin-left: 2px;
465
482
  }
466
- .semi-rtl .semi-upload-picture-file-card,
467
- .semi-portal-rtl .semi-upload-picture-file-card {
468
- margin-right: 0;
469
- margin-left: 8px;
470
- }
471
483
  .semi-rtl .semi-upload-picture-file-card-close,
472
484
  .semi-portal-rtl .semi-upload-picture-file-card-close {
473
485
  right: auto;
@@ -99,6 +99,8 @@ $module: #{$prefix}-upload;
99
99
  display: flex;
100
100
  flex-wrap: wrap;
101
101
  flex-shrink: 0;
102
+ gap: $spacing-upload_picture_file_card-gap;
103
+ margin-bottom: $spacing-upload_picture_file_card-marginBottom;
102
104
 
103
105
  p {
104
106
  @include ver-center;
@@ -130,8 +132,6 @@ $module: #{$prefix}-upload;
130
132
  justify-content: space-between;
131
133
  height: $height-upload_file_card;
132
134
  width: $width-upload_file_card;
133
- margin-right: $spacing-tight;
134
- margin-bottom: $spacing-tight;
135
135
  background-color: $color-upload_card-bg;
136
136
  cursor: pointer;
137
137
 
@@ -292,21 +292,21 @@ $module: #{$prefix}-upload;
292
292
  flex-direction: column;
293
293
 
294
294
  .#{$module}-prompt {
295
- order: 2;
295
+ order: 1;
296
296
  }
297
297
 
298
298
  .#{$module}-add {
299
- order: 1;
299
+ order: 0;
300
300
  }
301
301
  }
302
302
 
303
303
  &[x-prompt-pos="right"] {
304
304
  .#{$module}-prompt {
305
- order: 2;
305
+ order: 1;
306
306
  }
307
307
 
308
308
  .#{$module}-add {
309
- order: 1;
309
+ order: 0;
310
310
  }
311
311
  }
312
312
 
@@ -353,11 +353,14 @@ $module: #{$prefix}-upload;
353
353
  }
354
354
 
355
355
  &-file-card {
356
+ display: flex;
357
+ align-items: center;
358
+ justify-content: center;
356
359
  height: $height-upload_file_pic_card;
357
360
  width: $width-upload_file_pic_card;
361
+ border-radius: $radius-upload_picture_file_card_img;
358
362
  position: relative;
359
- margin-right: $spacing-upload_picture_file_card-marginRight;
360
- margin-bottom: $spacing-upload_picture_file_card-marginBottom;
363
+ overflow: hidden;
361
364
 
362
365
  img {
363
366
  height: $width-upload_picture_file_card_img;
@@ -429,6 +432,22 @@ $module: #{$prefix}-upload;
429
432
  color: $color-upload_replace-text;
430
433
  transform: translate3D(-50%, -50%, 0);
431
434
  }
435
+ &-pic-info {
436
+ display: inline-flex;
437
+ box-sizing: border-box;
438
+ justify-content: space-between;
439
+ align-items: center;
440
+ position: absolute;
441
+ width: 100%;
442
+ height: 24px;
443
+ padding: 0 10px;
444
+ bottom: 0;
445
+ left: 0;
446
+ color: $color-upload_picture_file_card_pic_info-text;
447
+ font-size: $font-upload_picture_file_card_pic_info-fontSize;
448
+ font-weight: $font-upload_picture_file_card_pic_info-fontWeight;
449
+ background: linear-gradient(0deg, rgba(22, 22, 26, 0.3) 0%, rgba(22, 22, 26, 0) 77.08%);
450
+ }
432
451
 
433
452
  &-icon-loading,
434
453
  &-icon-error {
@@ -445,6 +464,10 @@ $module: #{$prefix}-upload;
445
464
  &-show-pointer {
446
465
  cursor: pointer;
447
466
  }
467
+
468
+ &-error {
469
+ outline: 1px solid $color-upload_picture_file_card_error-border;
470
+ }
448
471
  }
449
472
  }
450
473
 
@@ -22,8 +22,10 @@ $color-upload-icon: var(--semi-color-tertiary); // 图片墙上传图标加号
22
22
  $color-upload_pic_add-bg-active: var(--semi-color-fill-2); // 图片墙上传背景色 - 按下
23
23
  $color-upload_pic_add-bg-hover: var(--semi-color-fill-1); // 图片墙上传背景色 - 悬浮
24
24
  $color-upload_pic_add-bg: var(--semi-color-fill-0); // 图片墙上传背景色 - 默认
25
- $color-upload_pic_remove-bg: var(--semi-overlay-bg); // 图片墙上传移除图标颜色
25
+ $color-upload_pic_remove-bg: var(--semi-color-overlay-bg); // 图片墙上传移除图标颜色
26
26
  $color-upload_picture_file_card_loading_error-icon: var(--semi-color-danger); // 图片墙上传移除图标颜色
27
+ $color-upload_picture_file_card_error-border: var(--semi-color-danger); // 图片墙上传移除图标颜色
28
+ $color-upload_picture_file_card_pic_info-text: var(--semi-color-white); // 图片墙图片信息(序号)文字颜色
27
29
  $color-upload_preview-icon: var(--semi-color-text-2); // 上传文件卡片文本颜色
28
30
  $color-upload_retry-text: var(--semi-color-primary); // 上传文件卡片重新上传按钮文本颜色
29
31
  $color-upload_replace-text: var(--semi-color-white); // 上传文件卡片重新替换按钮文本颜色
@@ -56,7 +58,7 @@ $spacing-upload_file_card_info_progress-marginTop: 4px; // 上传文件卡片进
56
58
  $spacing-upload_file_card_close-marginLeft: $spacing-tight; // 上传文件卡片删除按钮左侧外边距
57
59
  $spacing-upload_file_card_close-marginRight: $spacing-tight; // 上传文件卡片删除按钮右侧外边距
58
60
  $spacing-upload_file_card_icon-marginRight: $spacing-super-tight; // 上传文件卡片图标右侧外边距
59
- $spacing-upload_picture_file_card-marginRight: $spacing-tight; // 图片墙上传卡片右侧外边距
61
+ $spacing-upload_picture_file_card-gap: $spacing-tight; // 图片墙卡片之间边距
60
62
  $spacing-upload_picture_file_card-marginBottom: $spacing-tight; // 图片墙上传卡片底部外边距
61
63
  $spacing-upload_picture_file_card_close-top: 8px; // 图片墙上传卡片删除按钮顶部位置
62
64
  $spacing-upload_picture_file_card_close-right: 8px; // 图片墙上传卡片删除右侧位置
@@ -79,3 +81,5 @@ $radius-upload_drag_area: var(--semi-border-radius-small); // 可拖拽上传拖
79
81
  $font-upload_file_card_info_name-fontWeight: $font-weight-bold; // 上传文件卡片文件名字重
80
82
  $font-upload_file_card_info_size-fontWeight: $font-weight-regular; // 上传文件卡片文件尺寸字重
81
83
  $font-upload_drag_area_tips-fontWeight: 600; // 可拖拽上传提示文本字重
84
+ $font-upload_picture_file_card_pic_info-fontSize: 12px; // 图片墙图片信息字体大小
85
+ $font-upload_picture_file_card_pic_info-fontWeight: 600; // 图片墙图片信息文本字重
@@ -29,7 +29,7 @@ export interface ModalProps {
29
29
  footer?: any;
30
30
  hasCancel?: boolean;
31
31
  header?: any;
32
- height?: number;
32
+ height?: string | number;
33
33
  mask?: boolean;
34
34
  maskClosable?: boolean;
35
35
  maskStyle?: Record<string, any>;
@@ -43,7 +43,7 @@ export interface ModalProps {
43
43
  style?: Record<string, any>;
44
44
  title?: any;
45
45
  visible?: boolean;
46
- width?: number;
46
+ width?: string | number;
47
47
  zIndex?: number;
48
48
  icon?: any;
49
49
  getPopupContainer?: () => HTMLElement;
@@ -1,6 +1,6 @@
1
1
  // Color
2
2
  $color-modal-bg: var(--semi-color-bg-2); // 模态框背景颜色
3
- $color-modal_mask-bg: var(--semi-overlay-bg); // 模态框蒙层颜色
3
+ $color-modal_mask-bg: var(--semi-color-overlay-bg); // 模态框蒙层颜色
4
4
  $color-modal_main-text: var(--semi-color-text-0); // 模态框文字颜色
5
5
  $color-modal_info-icon: var(--semi-color-info); // 模态框信息图标颜色
6
6
  $color-modal_primary-icon: var(--semi-color-primary); // 模态框主要图标颜色
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.1.3",
3
+ "version": "2.2.0-beta.0",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build:lib": "node ./scripts/compileLib.js",
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@babel/runtime-corejs3": "^7.15.4",
11
- "@douyinfe/semi-animation": "2.1.3",
11
+ "@douyinfe/semi-animation": "2.2.0-beta.0",
12
12
  "async-validator": "^3.5.0",
13
13
  "classnames": "^2.2.6",
14
14
  "date-fns": "^2.9.0",
@@ -24,7 +24,7 @@
24
24
  "*.scss",
25
25
  "*.css"
26
26
  ],
27
- "gitHead": "a11f15ed646efd74e254932f9ee63ad557bb1e80",
27
+ "gitHead": "e8ea6a96a5ddd73a178a797548497cd6a64eb14b",
28
28
  "devDependencies": {
29
29
  "@babel/plugin-proposal-decorators": "^7.15.8",
30
30
  "@babel/plugin-transform-runtime": "^7.15.8",
package/radio/radio.scss CHANGED
@@ -29,6 +29,7 @@ $inner-width: $width-icon-medium;
29
29
  width: 100%;
30
30
  height: 100%;
31
31
  margin: 0;
32
+ cursor: pointer;
32
33
  }
33
34
 
34
35
  &:hover {
@@ -46,6 +47,7 @@ $inner-width: $width-icon-medium;
46
47
  .#{$module}-inner-checked {
47
48
  .#{$module}-inner-display {
48
49
  background: $color-radio_primary-bg-hover;
50
+ border-color: $color-radio_checked-border-hover;
49
51
  }
50
52
  }
51
53
  }
@@ -64,6 +66,7 @@ $inner-width: $width-icon-medium;
64
66
  .#{$module}-inner-checked {
65
67
  .#{$module}-inner-display {
66
68
  background: $color-radio_primary-bg-active;
69
+ border-color: $color-radio_checked-border-active;
67
70
  }
68
71
  }
69
72
  }
@@ -135,6 +138,29 @@ $inner-width: $width-icon-medium;
135
138
  &_checked {
136
139
  background: $color-radio_cardRadioGroup-bg-checked;
137
140
  border: $width-radio_cardRadioGroup_checked-border solid $color-radio_cardRadioGroup_border-active;
141
+
142
+ &:hover {
143
+ border: $width-radio_cardRadioGroup_checked-border solid $color-radio_cardRadioGroup_checked_border-hover;
144
+
145
+ .#{$module}-inner-checked .#{$module}-inner-display {
146
+ border-color: $color-radio_cardRadioGroup_checked_border-hover;
147
+ }
148
+ }
149
+
150
+ &:active {
151
+ background: $color-radio_cardRadioGroup-bg-checked;
152
+ border: $width-radio_cardRadioGroup_checked-border solid $color-radio_cardRadioGroup_checked_border-active;
153
+
154
+ .#{$module}-inner-checked {
155
+ .#{$module}-inner-display {
156
+ border-color: $color-radio_cardRadioGroup_checked_border-active;
157
+ }
158
+
159
+ &:hover .#{$module}-inner-display {
160
+ background: $color-radio_primary-bg-active;
161
+ }
162
+ }
163
+ }
138
164
  }
139
165
 
140
166
  &_hover {
@@ -146,6 +172,21 @@ $inner-width: $width-icon-medium;
146
172
  background: transparent;
147
173
  }
148
174
  }
175
+
176
+ &_checked_disabled.#{$module}-cardRadioGroup {
177
+ background: $color-radio_cardRadioGroup_disabled-bg-checked;
178
+ border: $width-radio_cardRadioGroup_checked_disabled-border solid $color-radio_cardRadioGroup_border_disabled-active;
179
+
180
+ .#{$module}-inner-checked .#{$module}-inner-display {
181
+ border-color: $color-radio_cardRadioGroup_checked_disabled-border-default;
182
+ }
183
+
184
+ &:hover {
185
+ .#{$module}-inner-checked .#{$module}-inner-display {
186
+ border-color: $color-radio_cardRadioGroup_checked_disabled-border-hover;
187
+ }
188
+ }
189
+ }
149
190
  }
150
191
 
151
192
  &.#{$module}-disabled:hover,
@@ -158,6 +199,7 @@ $inner-width: $width-icon-medium;
158
199
  .#{$module}-inner-checked {
159
200
  .#{$module}-inner-display {
160
201
  background: $color-radio_checked-bg-disabled;
202
+ border-color: $color-radio_checked-border-disabled;
161
203
  }
162
204
  }
163
205
  }
@@ -293,7 +335,7 @@ $inner-width: $width-icon-medium;
293
335
  &-display {
294
336
  opacity: 0.75;
295
337
  background: $color-radio_disabled-bg-default;
296
- border-color: $color-radio_checked-border-disabled;
338
+ border-color: $color-radio_default-border-disabled;
297
339
 
298
340
  &:hover {
299
341
  background: $color-radio_disabled-bg-hover;
@@ -308,6 +350,7 @@ $inner-width: $width-icon-medium;
308
350
 
309
351
  &:hover {
310
352
  background: $color-radio_checked-bg-disabled;
353
+ border-color: $color-radio_checked-border-disabled;
311
354
  }
312
355
  }
313
356
  }