@douyinfe/semi-foundation 2.1.6-alpha.0 → 2.2.1
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/cascader/cascader.scss +1 -1
- package/cascader/constants.ts +4 -0
- package/cascader/foundation.ts +29 -15
- package/cascader/util.ts +13 -0
- package/datePicker/_utils/parser.ts +4 -3
- package/datePicker/datePicker.scss +29 -0
- package/datePicker/foundation.ts +31 -11
- package/datePicker/inputFoundation.ts +2 -0
- package/datePicker/monthsGridFoundation.ts +101 -8
- package/datePicker/rtl.scss +15 -1
- package/datePicker/variables.scss +2 -0
- package/gulpfile.js +3 -1
- package/lib/cjs/cascader/cascader.css +2 -2
- package/lib/cjs/cascader/cascader.scss +1 -1
- package/lib/cjs/cascader/constants.d.ts +3 -0
- package/lib/cjs/cascader/constants.js +6 -1
- package/lib/cjs/cascader/foundation.d.ts +4 -1
- package/lib/cjs/cascader/foundation.js +24 -11
- package/lib/cjs/cascader/util.d.ts +1 -0
- package/lib/cjs/cascader/util.js +17 -0
- package/lib/cjs/datePicker/_utils/parser.d.ts +6 -1
- package/lib/cjs/datePicker/_utils/parser.js +3 -1
- package/lib/cjs/datePicker/datePicker.css +32 -3
- package/lib/cjs/datePicker/datePicker.scss +29 -0
- package/lib/cjs/datePicker/foundation.d.ts +6 -3
- package/lib/cjs/datePicker/foundation.js +40 -14
- package/lib/cjs/datePicker/inputFoundation.js +3 -0
- package/lib/cjs/datePicker/monthsGridFoundation.d.ts +35 -3
- package/lib/cjs/datePicker/monthsGridFoundation.js +139 -6
- package/lib/cjs/datePicker/rtl.scss +15 -1
- package/lib/cjs/datePicker/variables.scss +2 -0
- package/lib/cjs/navigation/navigation.css +0 -1
- package/lib/cjs/notification/notification.css +8 -4
- package/lib/cjs/notification/notification.scss +9 -5
- package/lib/cjs/notification/variables.scss +1 -0
- package/lib/cjs/select/foundation.d.ts +10 -1
- package/lib/cjs/select/foundation.js +11 -9
- package/lib/cjs/table/table.css +0 -2
- package/lib/cjs/table/table.scss +0 -2
- package/lib/cjs/tree/treeUtil.js +14 -14
- package/lib/cjs/upload/foundation.d.ts +1 -0
- package/lib/cjs/upload/foundation.js +106 -0
- package/lib/cjs/upload/rtl.scss +0 -4
- package/lib/cjs/upload/upload.css +30 -18
- package/lib/cjs/upload/upload.scss +31 -8
- package/lib/cjs/upload/variables.scss +5 -1
- package/lib/es/cascader/cascader.css +2 -2
- package/lib/es/cascader/cascader.scss +1 -1
- package/lib/es/cascader/constants.d.ts +3 -0
- package/lib/es/cascader/constants.js +6 -1
- package/lib/es/cascader/foundation.d.ts +4 -1
- package/lib/es/cascader/foundation.js +24 -12
- package/lib/es/cascader/util.d.ts +1 -0
- package/lib/es/cascader/util.js +14 -0
- package/lib/es/datePicker/_utils/parser.d.ts +6 -1
- package/lib/es/datePicker/_utils/parser.js +3 -1
- package/lib/es/datePicker/datePicker.css +32 -3
- package/lib/es/datePicker/datePicker.scss +29 -0
- package/lib/es/datePicker/foundation.d.ts +6 -3
- package/lib/es/datePicker/foundation.js +40 -14
- package/lib/es/datePicker/inputFoundation.js +3 -0
- package/lib/es/datePicker/monthsGridFoundation.d.ts +35 -3
- package/lib/es/datePicker/monthsGridFoundation.js +139 -6
- package/lib/es/datePicker/rtl.scss +15 -1
- package/lib/es/datePicker/variables.scss +2 -0
- package/lib/es/navigation/navigation.css +0 -1
- package/lib/es/notification/notification.css +8 -4
- package/lib/es/notification/notification.scss +9 -5
- package/lib/es/notification/variables.scss +1 -0
- package/lib/es/select/foundation.d.ts +10 -1
- package/lib/es/select/foundation.js +12 -9
- package/lib/es/table/table.css +0 -2
- package/lib/es/table/table.scss +0 -2
- package/lib/es/tree/treeUtil.js +13 -12
- package/lib/es/upload/foundation.d.ts +1 -0
- package/lib/es/upload/foundation.js +107 -0
- package/lib/es/upload/rtl.scss +0 -4
- package/lib/es/upload/upload.css +30 -18
- package/lib/es/upload/upload.scss +31 -8
- package/lib/es/upload/variables.scss +5 -1
- package/notification/notification.scss +9 -5
- package/notification/variables.scss +1 -0
- package/package.json +4 -4
- package/select/foundation.ts +11 -9
- package/table/table.scss +0 -2
- package/tree/treeUtil.ts +6 -2
- package/upload/foundation.ts +81 -0
- package/upload/rtl.scss +0 -4
- package/upload/upload.scss +31 -8
- package/upload/variables.scss +5 -1
|
@@ -9,6 +9,18 @@ $module: #{$prefix}-datepicker;
|
|
|
9
9
|
padding-right: 0;
|
|
10
10
|
padding-left: $spacing-datepicker_footer-paddingRight;
|
|
11
11
|
text-align: left;
|
|
12
|
+
|
|
13
|
+
.#{$prefix}-button {
|
|
14
|
+
&:first-of-type {
|
|
15
|
+
margin-left: 0;
|
|
16
|
+
margin-right: 0;
|
|
17
|
+
}
|
|
18
|
+
// confirm button
|
|
19
|
+
&:nth-of-type(2) {
|
|
20
|
+
margin-right: $spacing-datepicker_footer_cancel_button-marginRight;
|
|
21
|
+
margin-left: 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
12
24
|
}
|
|
13
25
|
|
|
14
26
|
&-day {
|
|
@@ -66,7 +78,9 @@ $module: #{$prefix}-datepicker;
|
|
|
66
78
|
&-yam {
|
|
67
79
|
// rtl 对箭头进行翻转
|
|
68
80
|
.#{$prefix}-icon-chevron_left,
|
|
69
|
-
.#{$prefix}-icon-chevron_right
|
|
81
|
+
.#{$prefix}-icon-chevron_right,
|
|
82
|
+
.#{$prefix}-icon-double_chevron_left,
|
|
83
|
+
.#{$prefix}-icon-double_chevron_right {
|
|
70
84
|
transform: scaleX(-1);
|
|
71
85
|
}
|
|
72
86
|
}
|
|
@@ -33,6 +33,8 @@ $spacing-datepicker_scrolllist_body-padding: 0; // 时间选择滚动菜单内
|
|
|
33
33
|
$spacing-datepicker_footer-paddingTop: 10px; // 确认选择 footer 顶部内边距
|
|
34
34
|
$spacing-datepicker_footer-paddingBottom: 10px; // 确认选择 footer 底部内边距
|
|
35
35
|
$spacing-datepicker_footer-paddingRight: 8px; // 确认选择 footer 右侧内边距
|
|
36
|
+
$spacing-datepicker_footer_cancel_button-marginRight: 12px; // 确认选择 footer 取消按钮右外边距
|
|
37
|
+
$spacing-datepicker_footer_confirm_button-marginRight: 8px; // 确认选择 footer 确认按钮右外边距
|
|
36
38
|
$spacing-datepicker_navigation-paddingY: $spacing-base-tight; // 年月切换 header 垂直内边距
|
|
37
39
|
$spacing-datepicker_navigation-paddingX: $spacing-base; // 年月切换 header 水平内边距
|
|
38
40
|
$spacing-datepicker_month-padding: $spacing-base;
|
|
@@ -79,19 +79,23 @@
|
|
|
79
79
|
color: var(--semi-color-success);
|
|
80
80
|
}
|
|
81
81
|
.semi-notification-notice-light.semi-notification-notice-warning {
|
|
82
|
-
background-
|
|
82
|
+
background-image: linear-gradient(0deg, var(--semi-color-warning-light-default), var(--semi-color-warning-light-default));
|
|
83
|
+
background-color: var(--semi-color-bg-0);
|
|
83
84
|
border: 1px solid var(--semi-color-warning);
|
|
84
85
|
}
|
|
85
86
|
.semi-notification-notice-light.semi-notification-notice-success {
|
|
86
|
-
background-
|
|
87
|
+
background-image: linear-gradient(0deg, var(--semi-color-success-light-default), var(--semi-color-success-light-default));
|
|
88
|
+
background-color: var(--semi-color-bg-0);
|
|
87
89
|
border: 1px solid var(--semi-color-success);
|
|
88
90
|
}
|
|
89
91
|
.semi-notification-notice-light.semi-notification-notice-info, .semi-notification-notice-light.semi-notification-notice-default {
|
|
90
|
-
background-
|
|
92
|
+
background-image: linear-gradient(0deg, var(--semi-color-info-light-default), var(--semi-color-info-light-default));
|
|
93
|
+
background-color: var(--semi-color-bg-0);
|
|
91
94
|
border: 1px solid var(--semi-color-info);
|
|
92
95
|
}
|
|
93
96
|
.semi-notification-notice-light.semi-notification-notice-error {
|
|
94
|
-
background-
|
|
97
|
+
background-image: linear-gradient(0deg, var(--semi-color-danger-light-default), var(--semi-color-danger-light-default));
|
|
98
|
+
background-color: var(--semi-color-bg-0);
|
|
95
99
|
border: 1px solid var(--semi-color-danger);
|
|
96
100
|
}
|
|
97
101
|
.semi-notification-notice-title {
|
|
@@ -93,23 +93,27 @@ $module: #{$prefix}-notification;
|
|
|
93
93
|
|
|
94
94
|
&-light {
|
|
95
95
|
&.#{$module}-notice-warning {
|
|
96
|
-
background-
|
|
96
|
+
background-image: linear-gradient(0deg, $color-notification_warning_light-bg, $color-notification_warning_light-bg);
|
|
97
|
+
background-color: $color-notification_ambient-bg;
|
|
97
98
|
border: $width-notification_notice-border solid $color-notification_warning_light-border;
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
&.#{$module}-notice-success {
|
|
101
|
-
background-
|
|
102
|
+
background-image: linear-gradient(0deg, $color-notification_success_light-bg, $color-notification_success_light-bg);
|
|
103
|
+
background-color: $color-notification_ambient-bg;
|
|
102
104
|
border: $width-notification_notice-border solid $color-notification_success_light-border;
|
|
103
105
|
}
|
|
104
106
|
|
|
105
107
|
&.#{$module}-notice-info,
|
|
106
108
|
&.#{$module}-notice-default {
|
|
107
|
-
background-
|
|
109
|
+
background-image: linear-gradient(0deg, $color-notification_info_light-bg, $color-notification_info_light-bg);
|
|
110
|
+
background-color: $color-notification_ambient-bg;
|
|
108
111
|
border: $width-notification_notice-border solid $color-notification_info_light-border;
|
|
109
112
|
}
|
|
110
113
|
|
|
111
114
|
&.#{$module}-notice-error {
|
|
112
|
-
background-
|
|
115
|
+
background-image: linear-gradient(0deg, $color-notification_danger_light-bg, $color-notification_danger_light-bg);
|
|
116
|
+
background-color: $color-notification_ambient-bg;
|
|
113
117
|
border: $width-notification_notice-border solid $color-notification_danger_light-border;
|
|
114
118
|
}
|
|
115
119
|
}
|
|
@@ -165,4 +169,4 @@ $module: #{$prefix}-notification;
|
|
|
165
169
|
}
|
|
166
170
|
}
|
|
167
171
|
|
|
168
|
-
@import "./rtl.scss";
|
|
172
|
+
@import "./rtl.scss";
|
|
@@ -15,6 +15,7 @@ $color-notification_info_light-bg: var(--semi-color-info-light-default); // 彩
|
|
|
15
15
|
$color-notification_info_light-border: var(--semi-color-info); // 彩色通知信息描边色
|
|
16
16
|
$color-notification_danger_light-bg: var(--semi-color-danger-light-default); // 彩色通知危险背景色
|
|
17
17
|
$color-notification_danger_light-border: var(--semi-color-danger); // 彩色通知危险描边色
|
|
18
|
+
$color-notification_ambient-bg: var(--semi-color-bg-0); // 透明背景色叠加层(与bg0保持一致不建议修改)
|
|
18
19
|
|
|
19
20
|
// Width/Height
|
|
20
21
|
$width-notification_notice: auto; // 通知宽度
|
|
@@ -82,7 +82,16 @@ export default class SelectFoundation extends BaseFoundation<SelectAdapter> {
|
|
|
82
82
|
_handleEnterKeyDown(event: KeyboardEvent): void;
|
|
83
83
|
_handleBackspaceKeyDown(): void;
|
|
84
84
|
_notifyChange(selections: Map<any, any>): void;
|
|
85
|
-
_removeInternalKey(option: BasicOptionProps):
|
|
85
|
+
_removeInternalKey(option: BasicOptionProps): {
|
|
86
|
+
[x: string]: any;
|
|
87
|
+
value?: string | number;
|
|
88
|
+
label?: unknown;
|
|
89
|
+
children?: unknown;
|
|
90
|
+
disabled?: boolean;
|
|
91
|
+
showTick?: boolean;
|
|
92
|
+
className?: string;
|
|
93
|
+
style?: Record<string, any>;
|
|
94
|
+
};
|
|
86
95
|
_notifySelect(value: BasicOptionProps['value'], option: BasicOptionProps): void;
|
|
87
96
|
_notifyDeselect(value: BasicOptionProps['value'], option: BasicOptionProps): void;
|
|
88
97
|
_diffSelections(selections: Map<any, any>, oldSelections: Map<any, any>, isMultiple: boolean): boolean;
|
|
@@ -1038,17 +1038,19 @@ class SelectFoundation extends _foundation.default {
|
|
|
1038
1038
|
}
|
|
1039
1039
|
|
|
1040
1040
|
_removeInternalKey(option) {
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
delete
|
|
1044
|
-
delete
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1041
|
+
// eslint-disable-next-line
|
|
1042
|
+
let newOption = (0, _assign.default)({}, option);
|
|
1043
|
+
delete newOption._parentGroup;
|
|
1044
|
+
delete newOption._show;
|
|
1045
|
+
delete newOption._selected;
|
|
1046
|
+
delete newOption._scrollIndex;
|
|
1047
|
+
|
|
1048
|
+
if ('_keyInOptionList' in newOption) {
|
|
1049
|
+
newOption.key = newOption._keyInOptionList;
|
|
1050
|
+
delete newOption._keyInOptionList;
|
|
1049
1051
|
}
|
|
1050
1052
|
|
|
1051
|
-
return
|
|
1053
|
+
return newOption;
|
|
1052
1054
|
}
|
|
1053
1055
|
|
|
1054
1056
|
_notifySelect(value, option) {
|
package/lib/cjs/table/table.css
CHANGED
|
@@ -52,12 +52,10 @@
|
|
|
52
52
|
color: var(--semi-color-text-0);
|
|
53
53
|
width: 100%;
|
|
54
54
|
}
|
|
55
|
-
.semi-table-middle .semi-table-thead > .semi-table-row > .semi-table-row-head,
|
|
56
55
|
.semi-table-middle .semi-table-tbody > .semi-table-row > .semi-table-row-cell {
|
|
57
56
|
padding-top: 12px;
|
|
58
57
|
padding-bottom: 12px;
|
|
59
58
|
}
|
|
60
|
-
.semi-table-small .semi-table-thead > .semi-table-row > .semi-table-row-head,
|
|
61
59
|
.semi-table-small .semi-table-tbody > .semi-table-row > .semi-table-row-cell {
|
|
62
60
|
padding-top: 8px;
|
|
63
61
|
padding-bottom: 8px;
|
package/lib/cjs/table/table.scss
CHANGED
|
@@ -25,7 +25,6 @@ $module: #{$prefix}-table;
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
&-middle {
|
|
28
|
-
.#{$module}-thead > .#{$module}-row > .#{$module}-row-head,
|
|
29
28
|
.#{$module}-tbody > .#{$module}-row > .#{$module}-row-cell {
|
|
30
29
|
padding-top: $spacing-table_middle-paddingY;
|
|
31
30
|
padding-bottom: $spacing-table_middle-paddingY;
|
|
@@ -33,7 +32,6 @@ $module: #{$prefix}-table;
|
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
&-small {
|
|
36
|
-
.#{$module}-thead > .#{$module}-row > .#{$module}-row-head,
|
|
37
35
|
.#{$module}-tbody > .#{$module}-row > .#{$module}-row-cell {
|
|
38
36
|
padding-top: $spacing-table_small-paddingY;
|
|
39
37
|
padding-bottom: $spacing-table_small-paddingY;
|
package/lib/cjs/tree/treeUtil.js
CHANGED
|
@@ -57,12 +57,10 @@ var _every = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stab
|
|
|
57
57
|
|
|
58
58
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
|
|
59
59
|
|
|
60
|
-
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
61
|
-
|
|
62
|
-
var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
|
|
63
|
-
|
|
64
60
|
var _some = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/some"));
|
|
65
61
|
|
|
62
|
+
var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
|
|
63
|
+
|
|
66
64
|
var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/values"));
|
|
67
65
|
|
|
68
66
|
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
@@ -557,7 +555,7 @@ function normalizedArr(val) {
|
|
|
557
555
|
|
|
558
556
|
function normalizeKeyList(keyList, keyEntities) {
|
|
559
557
|
let leafOnly = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
560
|
-
|
|
558
|
+
const res = [];
|
|
561
559
|
const keyListSet = new _set.default(keyList);
|
|
562
560
|
|
|
563
561
|
if (!leafOnly) {
|
|
@@ -577,9 +575,11 @@ function normalizeKeyList(keyList, keyEntities) {
|
|
|
577
575
|
res.push(key);
|
|
578
576
|
});
|
|
579
577
|
} else {
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
578
|
+
(0, _forEach.default)(keyList).call(keyList, key => {
|
|
579
|
+
if (keyEntities[key] && !isValid(keyEntities[key].children)) {
|
|
580
|
+
res.push(key);
|
|
581
|
+
}
|
|
582
|
+
});
|
|
583
583
|
}
|
|
584
584
|
|
|
585
585
|
return res;
|
|
@@ -589,9 +589,9 @@ function getMotionKeys(eventKey, expandedKeys, keyEntities) {
|
|
|
589
589
|
const res = [];
|
|
590
590
|
|
|
591
591
|
const getChild = itemKey => {
|
|
592
|
-
var
|
|
592
|
+
var _context8;
|
|
593
593
|
|
|
594
|
-
keyEntities[itemKey].children && (0, _forEach.default)(
|
|
594
|
+
keyEntities[itemKey].children && (0, _forEach.default)(_context8 = keyEntities[itemKey].children).call(_context8, item => {
|
|
595
595
|
const {
|
|
596
596
|
key
|
|
597
597
|
} = item;
|
|
@@ -707,7 +707,7 @@ function calcCheckedKeysForUnchecked(key, keyEntities, checkedKeys, halfCheckedK
|
|
|
707
707
|
}
|
|
708
708
|
|
|
709
709
|
function filterTreeData(info) {
|
|
710
|
-
var
|
|
710
|
+
var _context9, _context10;
|
|
711
711
|
|
|
712
712
|
const {
|
|
713
713
|
showFilteredOnly,
|
|
@@ -719,7 +719,7 @@ function filterTreeData(info) {
|
|
|
719
719
|
prevExpandedKeys
|
|
720
720
|
} = info;
|
|
721
721
|
let filteredOptsKeys = [];
|
|
722
|
-
filteredOptsKeys = (0, _map.default)(
|
|
722
|
+
filteredOptsKeys = (0, _map.default)(_context9 = (0, _filter.default)(_context10 = (0, _values.default)(keyEntities)).call(_context10, item => filter(inputValue, item.data, filterTreeNode, filterProps))).call(_context9, item => item.key);
|
|
723
723
|
let expandedOptsKeys = findAncestorKeys(filteredOptsKeys, keyEntities, false);
|
|
724
724
|
|
|
725
725
|
if (prevExpandedKeys.length) {
|
|
@@ -763,9 +763,9 @@ function updateKeys(keySet, keyEntities) {
|
|
|
763
763
|
}
|
|
764
764
|
|
|
765
765
|
function calcDisabledKeys(keyEntities) {
|
|
766
|
-
var
|
|
766
|
+
var _context11;
|
|
767
767
|
|
|
768
|
-
const disabledKeys = (0, _filter.default)(
|
|
768
|
+
const disabledKeys = (0, _filter.default)(_context11 = (0, _keys.default)(keyEntities)).call(_context11, key => keyEntities[key].data.disabled);
|
|
769
769
|
const {
|
|
770
770
|
checkedKeys
|
|
771
771
|
} = calcCheckedKeys(disabledKeys, keyEntities);
|
|
@@ -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;
|
|
@@ -405,6 +405,112 @@ class UploadFoundation extends _foundation.default {
|
|
|
405
405
|
this.startUpload(currentFiles);
|
|
406
406
|
}
|
|
407
407
|
});
|
|
408
|
+
} // 插入多个文件到指定位置
|
|
409
|
+
// Insert files to the specified location
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
insertFileToList(files, index) {
|
|
413
|
+
const {
|
|
414
|
+
limit,
|
|
415
|
+
transformFile,
|
|
416
|
+
accept,
|
|
417
|
+
uploadTrigger
|
|
418
|
+
} = this.getProps();
|
|
419
|
+
const {
|
|
420
|
+
fileList
|
|
421
|
+
} = this.getStates();
|
|
422
|
+
const unAcceptFileList = []; // 当次选中的文件
|
|
423
|
+
// current selected file
|
|
424
|
+
|
|
425
|
+
let currentFileList = (0, _from.default)(files);
|
|
426
|
+
|
|
427
|
+
if (typeof accept !== 'undefined') {
|
|
428
|
+
currentFileList = (0, _filter.default)(currentFileList).call(currentFileList, item => {
|
|
429
|
+
const isValid = this.checkFileFormat(accept, item);
|
|
430
|
+
|
|
431
|
+
if (!isValid) {
|
|
432
|
+
unAcceptFileList.push(item);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
return isValid;
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
if (unAcceptFileList.length !== 0) {
|
|
439
|
+
this._adapter.notifyAcceptInvalid(unAcceptFileList);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
if (currentFileList.length === 0) {
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
currentFileList = (0, _map.default)(currentFileList).call(currentFileList, file => {
|
|
448
|
+
if (!file.uid) {
|
|
449
|
+
file.uid = (0, _uuid.getUuidv4)();
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
if (this.checkFileSize(file)) {
|
|
453
|
+
file._sizeInvalid = true;
|
|
454
|
+
file.status = FILE_STATUS_VALID_FAIL;
|
|
455
|
+
|
|
456
|
+
this._adapter.notifySizeError(file, fileList);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
if (transformFile) {
|
|
460
|
+
file = transformFile(file);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
return file;
|
|
464
|
+
});
|
|
465
|
+
const total = fileList.length + currentFileList.length;
|
|
466
|
+
|
|
467
|
+
if (typeof limit !== 'undefined') {
|
|
468
|
+
// 判断是否超出限制
|
|
469
|
+
// Determine whether the limit is exceeded
|
|
470
|
+
if (total > limit) {
|
|
471
|
+
if (limit === 1) {
|
|
472
|
+
// 使用最后面的文件对当前文件进行替换
|
|
473
|
+
// Use the last file to replace the current file
|
|
474
|
+
currentFileList = (0, _slice.default)(currentFileList).call(currentFileList, -1);
|
|
475
|
+
|
|
476
|
+
this._adapter.notifyFileSelect(currentFileList);
|
|
477
|
+
|
|
478
|
+
this._adapter.resetInput();
|
|
479
|
+
|
|
480
|
+
this.replaceFileList(currentFileList);
|
|
481
|
+
return;
|
|
482
|
+
} // 如果超出了限制,则计算还能添加几个文件,将剩余的文件继续上传
|
|
483
|
+
// If the limit is exceeded, several files can be added to the calculation, and the remaining files will continue to be uploaded
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
const restNum = limit - fileList.length;
|
|
487
|
+
currentFileList = (0, _slice.default)(currentFileList).call(currentFileList, 0, restNum);
|
|
488
|
+
|
|
489
|
+
this._adapter.notifyExceed(currentFileList);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
const fileItemList = (0, _map.default)(currentFileList).call(currentFileList, file => this.buildFileItem(file, uploadTrigger));
|
|
494
|
+
const newFileList = (0, _slice.default)(fileList).call(fileList);
|
|
495
|
+
|
|
496
|
+
if (typeof index !== 'undefined') {
|
|
497
|
+
(0, _splice.default)(newFileList).call(newFileList, index, 0, ...fileItemList);
|
|
498
|
+
} else {
|
|
499
|
+
newFileList.push(...fileItemList);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
this._adapter.notifyFileSelect(currentFileList);
|
|
503
|
+
|
|
504
|
+
this._adapter.notifyChange({
|
|
505
|
+
fileList: newFileList,
|
|
506
|
+
currentFile: null
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
this._adapter.updateFileList(newFileList, () => {
|
|
510
|
+
if (uploadTrigger === TRIGGER_AUTO) {
|
|
511
|
+
this.startUpload(fileItemList);
|
|
512
|
+
}
|
|
513
|
+
});
|
|
408
514
|
}
|
|
409
515
|
|
|
410
516
|
manualUpload() {
|
package/lib/cjs/upload/rtl.scss
CHANGED
|
@@ -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:
|
|
238
|
+
order: 1;
|
|
239
239
|
}
|
|
240
240
|
.semi-upload-picture[x-prompt-pos=bottom] .semi-upload-add {
|
|
241
|
-
order:
|
|
241
|
+
order: 0;
|
|
242
242
|
}
|
|
243
243
|
.semi-upload-picture[x-prompt-pos=right] .semi-upload-prompt {
|
|
244
|
-
order:
|
|
244
|
+
order: 1;
|
|
245
245
|
}
|
|
246
246
|
.semi-upload-picture[x-prompt-pos=right] .semi-upload-add {
|
|
247
|
-
order:
|
|
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
|
-
|
|
288
|
-
margin-bottom: 8px;
|
|
291
|
+
overflow: hidden;
|
|
289
292
|
}
|
|
290
293
|
.semi-upload-picture-file-card img {
|
|
291
294
|
height: 96px;
|
|
@@ -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:
|
|
295
|
+
order: 1;
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
.#{$module}-add {
|
|
299
|
-
order:
|
|
299
|
+
order: 0;
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
&[x-prompt-pos="right"] {
|
|
304
304
|
.#{$module}-prompt {
|
|
305
|
-
order:
|
|
305
|
+
order: 1;
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
.#{$module}-add {
|
|
309
|
-
order:
|
|
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
|
-
|
|
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
|
|
|
@@ -24,6 +24,8 @@ $color-upload_pic_add-bg-hover: var(--semi-color-fill-1); // 图片墙上传背
|
|
|
24
24
|
$color-upload_pic_add-bg: var(--semi-color-fill-0); // 图片墙上传背景色 - 默认
|
|
25
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-
|
|
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; // 图片墙图片信息文本字重
|
|
@@ -99,11 +99,11 @@
|
|
|
99
99
|
.semi-cascader-selection-tag:first-child {
|
|
100
100
|
margin-left: 0;
|
|
101
101
|
}
|
|
102
|
-
.semi-cascader-selection-tag-disabled {
|
|
102
|
+
.semi-cascader-selection-tag-disabled.semi-tag {
|
|
103
103
|
color: var(--semi-color-disabled-text);
|
|
104
104
|
cursor: not-allowed;
|
|
105
105
|
}
|
|
106
|
-
.semi-cascader-selection-tag-disabled .semi-tag-close {
|
|
106
|
+
.semi-cascader-selection-tag-disabled.semi-tag .semi-tag-close {
|
|
107
107
|
color: var(--semi-color-disabled-text);
|
|
108
108
|
cursor: not-allowed;
|
|
109
109
|
pointer-events: none;
|