@douyinfe/semi-ui 2.1.6-alpha.0 → 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.
- package/_base/_story/a11y.jsx +1302 -0
- package/_base/_story/a11y.scss +49 -0
- package/_base/_story/index.stories.js +3 -1
- package/_utils/index.ts +2 -1
- package/cascader/__test__/cascader.test.js +221 -0
- package/cascader/_story/cascader.stories.js +138 -0
- package/cascader/index.tsx +37 -21
- package/cascader/item.tsx +4 -2
- package/datePicker/__test__/datePicker.test.js +67 -2
- package/datePicker/_story/datePicker.stories.js +3 -1
- package/datePicker/_story/v2/YearButton.jsx +17 -0
- package/datePicker/_story/v2/index.js +1 -0
- package/datePicker/monthsGrid.tsx +12 -1
- package/datePicker/navigation.tsx +55 -29
- package/descriptions/__test__/descriptions.test.js +27 -1
- package/descriptions/_story/descriptions.stories.js +52 -2
- package/descriptions/item.tsx +1 -1
- package/dist/css/semi.css +38 -20
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +699 -160
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/lib/cjs/_utils/index.d.ts +1 -0
- package/lib/cjs/_utils/index.js +3 -2
- package/lib/cjs/cascader/index.d.ts +7 -0
- package/lib/cjs/cascader/index.js +35 -22
- package/lib/cjs/cascader/item.d.ts +2 -0
- package/lib/cjs/cascader/item.js +4 -2
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -0
- package/lib/cjs/datePicker/monthsGrid.js +6 -0
- package/lib/cjs/datePicker/navigation.js +47 -7
- package/lib/cjs/descriptions/item.js +1 -1
- package/lib/cjs/form/baseForm.d.ts +6 -1
- package/lib/cjs/form/field.d.ts +6 -1
- package/lib/cjs/locale/source/es.d.ts +7 -0
- package/lib/cjs/locale/source/es.js +168 -0
- package/lib/cjs/rating/item.js +1 -1
- package/lib/cjs/select/index.d.ts +9 -0
- package/lib/cjs/select/index.js +10 -8
- package/lib/cjs/timeline/item.d.ts +3 -0
- package/lib/cjs/timeline/item.js +10 -4
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/cjs/upload/fileCard.d.ts +2 -0
- package/lib/cjs/upload/fileCard.js +70 -45
- package/lib/cjs/upload/index.d.ts +23 -2
- package/lib/cjs/upload/index.js +133 -25
- package/lib/cjs/upload/interface.d.ts +3 -0
- package/lib/es/_utils/index.d.ts +1 -0
- package/lib/es/_utils/index.js +3 -2
- package/lib/es/cascader/index.d.ts +7 -0
- package/lib/es/cascader/index.js +34 -25
- package/lib/es/cascader/item.d.ts +2 -0
- package/lib/es/cascader/item.js +4 -2
- package/lib/es/datePicker/monthsGrid.d.ts +1 -0
- package/lib/es/datePicker/monthsGrid.js +6 -0
- package/lib/es/datePicker/navigation.js +48 -8
- package/lib/es/descriptions/item.js +1 -1
- package/lib/es/form/baseForm.d.ts +6 -1
- package/lib/es/form/field.d.ts +6 -1
- package/lib/es/locale/source/es.d.ts +7 -0
- package/lib/es/locale/source/es.js +157 -0
- package/lib/es/rating/item.js +1 -1
- package/lib/es/select/index.d.ts +9 -0
- package/lib/es/select/index.js +14 -8
- package/lib/es/timeline/item.d.ts +3 -0
- package/lib/es/timeline/item.js +9 -4
- package/lib/es/typography/title.d.ts +1 -1
- package/lib/es/upload/fileCard.d.ts +2 -0
- package/lib/es/upload/fileCard.js +69 -44
- package/lib/es/upload/index.d.ts +23 -2
- package/lib/es/upload/index.js +133 -24
- package/lib/es/upload/interface.d.ts +3 -0
- package/locale/source/es.ts +160 -0
- package/package.json +8 -8
- package/popover/Arrow.tsx +1 -1
- package/rating/item.tsx +1 -1
- package/select/_story/select.stories.js +25 -0
- package/select/index.tsx +17 -6
- package/timeline/_story/timeline.stories.js +50 -0
- package/timeline/item.tsx +7 -2
- package/upload/__test__/upload.test.js +50 -1
- package/upload/fileCard.tsx +110 -95
- package/upload/index.tsx +147 -53
- package/upload/interface.ts +3 -0
package/dist/umd/semi-ui.js
CHANGED
|
@@ -13752,7 +13752,7 @@ const getHighLightTextHTML = _ref => {
|
|
|
13752
13752
|
const markEle = option.highlightTag || 'mark';
|
|
13753
13753
|
const highlightClassName = option.highlightClassName || '';
|
|
13754
13754
|
const highlightStyle = option.highlightStyle || {};
|
|
13755
|
-
return _babel_runtime_corejs3_core_js_stable_instance_map__WEBPACK_IMPORTED_MODULE_7___default()(chunks).call(chunks, chunk => {
|
|
13755
|
+
return _babel_runtime_corejs3_core_js_stable_instance_map__WEBPACK_IMPORTED_MODULE_7___default()(chunks).call(chunks, (chunk, index) => {
|
|
13756
13756
|
const {
|
|
13757
13757
|
end,
|
|
13758
13758
|
start,
|
|
@@ -13763,7 +13763,8 @@ const getHighLightTextHTML = _ref => {
|
|
|
13763
13763
|
if (highlight) {
|
|
13764
13764
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement(markEle, {
|
|
13765
13765
|
style: highlightStyle,
|
|
13766
|
-
className: highlightClassName
|
|
13766
|
+
className: highlightClassName,
|
|
13767
|
+
key: text + index
|
|
13767
13768
|
}, text);
|
|
13768
13769
|
} else {
|
|
13769
13770
|
return text;
|
|
@@ -28583,6 +28584,64 @@ function IconCopy_SvgComponent(props) {
|
|
|
28583
28584
|
|
|
28584
28585
|
const IconCopy_IconComponent = convertIcon(IconCopy_SvgComponent, 'copy');
|
|
28585
28586
|
/* harmony default export */ var IconCopy = (IconCopy_IconComponent);
|
|
28587
|
+
// CONCATENATED MODULE: ../semi-icons/lib/es/icons/IconDoubleChevronLeft.js
|
|
28588
|
+
|
|
28589
|
+
|
|
28590
|
+
|
|
28591
|
+
|
|
28592
|
+
function IconDoubleChevronLeft_SvgComponent(props) {
|
|
28593
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("svg", assign_default()({
|
|
28594
|
+
viewBox: "0 0 24 24",
|
|
28595
|
+
fill: "none",
|
|
28596
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28597
|
+
width: "1em",
|
|
28598
|
+
height: "1em",
|
|
28599
|
+
focusable: false,
|
|
28600
|
+
"aria-hidden": true
|
|
28601
|
+
}, props), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("path", {
|
|
28602
|
+
fillRule: "evenodd",
|
|
28603
|
+
clipRule: "evenodd",
|
|
28604
|
+
d: "M12.6185 4.39653C13.1272 4.92524 13.1272 5.78245 12.6185 6.31116L7.14483 12L12.6185 17.6888C13.1272 18.2176 13.1272 19.0748 12.6185 19.6035C12.1098 20.1322 11.285 20.1322 10.7763 19.6035L4.38153 12.9573C3.87282 12.4286 3.87282 11.5714 4.38153 11.0427L10.7763 4.39653C11.285 3.86782 12.1098 3.86782 12.6185 4.39653Z",
|
|
28605
|
+
fill: "currentColor"
|
|
28606
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("path", {
|
|
28607
|
+
fillRule: "evenodd",
|
|
28608
|
+
clipRule: "evenodd",
|
|
28609
|
+
d: "M19.6185 4.39653C20.1272 4.92524 20.1272 5.78245 19.6185 6.31116L14.1448 12L19.6185 17.6888C20.1272 18.2176 20.1272 19.0748 19.6185 19.6035C19.1098 20.1322 18.285 20.1322 17.7763 19.6035L11.3815 12.9573C10.8728 12.4286 10.8728 11.5714 11.3815 11.0427L17.7763 4.39653C18.285 3.86782 19.1098 3.86782 19.6185 4.39653Z",
|
|
28610
|
+
fill: "currentColor"
|
|
28611
|
+
}));
|
|
28612
|
+
}
|
|
28613
|
+
|
|
28614
|
+
const IconDoubleChevronLeft_IconComponent = convertIcon(IconDoubleChevronLeft_SvgComponent, 'double_chevron_left');
|
|
28615
|
+
/* harmony default export */ var IconDoubleChevronLeft = (IconDoubleChevronLeft_IconComponent);
|
|
28616
|
+
// CONCATENATED MODULE: ../semi-icons/lib/es/icons/IconDoubleChevronRight.js
|
|
28617
|
+
|
|
28618
|
+
|
|
28619
|
+
|
|
28620
|
+
|
|
28621
|
+
function IconDoubleChevronRight_SvgComponent(props) {
|
|
28622
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("svg", assign_default()({
|
|
28623
|
+
viewBox: "0 0 24 24",
|
|
28624
|
+
fill: "none",
|
|
28625
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28626
|
+
width: "1em",
|
|
28627
|
+
height: "1em",
|
|
28628
|
+
focusable: false,
|
|
28629
|
+
"aria-hidden": true
|
|
28630
|
+
}, props), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("path", {
|
|
28631
|
+
fillRule: "evenodd",
|
|
28632
|
+
clipRule: "evenodd",
|
|
28633
|
+
d: "M4.38153 4.39653C4.89024 3.86782 5.71502 3.86782 6.22373 4.39653L12.6185 11.0427C13.1272 11.5714 13.1272 12.4286 12.6185 12.9573L6.22373 19.6035C5.71502 20.1322 4.89024 20.1322 4.38153 19.6035C3.87282 19.0748 3.87282 18.2176 4.38153 17.6888L9.85517 12L4.38153 6.31116C3.87282 5.78245 3.87282 4.92524 4.38153 4.39653Z",
|
|
28634
|
+
fill: "currentColor"
|
|
28635
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("path", {
|
|
28636
|
+
fillRule: "evenodd",
|
|
28637
|
+
clipRule: "evenodd",
|
|
28638
|
+
d: "M11.3815 4.39653C11.8902 3.86782 12.715 3.86782 13.2237 4.39653L19.6185 11.0427C20.1272 11.5714 20.1272 12.4286 19.6185 12.9573L13.2237 19.6035C12.715 20.1322 11.8902 20.1322 11.3815 19.6035C10.8728 19.0748 10.8728 18.2176 11.3815 17.6888L16.8552 12L11.3815 6.31116C10.8728 5.78245 10.8728 4.92524 11.3815 4.39653Z",
|
|
28639
|
+
fill: "currentColor"
|
|
28640
|
+
}));
|
|
28641
|
+
}
|
|
28642
|
+
|
|
28643
|
+
const IconDoubleChevronRight_IconComponent = convertIcon(IconDoubleChevronRight_SvgComponent, 'double_chevron_right');
|
|
28644
|
+
/* harmony default export */ var IconDoubleChevronRight = (IconDoubleChevronRight_IconComponent);
|
|
28586
28645
|
// CONCATENATED MODULE: ../semi-icons/lib/es/icons/IconEyeClosedSolid.js
|
|
28587
28646
|
|
|
28588
28647
|
|
|
@@ -29510,6 +29569,8 @@ const IconUpload_IconComponent = convertIcon(IconUpload_SvgComponent, 'upload');
|
|
|
29510
29569
|
|
|
29511
29570
|
|
|
29512
29571
|
|
|
29572
|
+
|
|
29573
|
+
|
|
29513
29574
|
|
|
29514
29575
|
|
|
29515
29576
|
|
|
@@ -42585,6 +42646,10 @@ cardGroup_CardGroup.defaultProps = {
|
|
|
42585
42646
|
spacing: 16
|
|
42586
42647
|
};
|
|
42587
42648
|
/* harmony default export */ var cardGroup = (cardGroup_CardGroup);
|
|
42649
|
+
// EXTERNAL MODULE: /Users/daiqiang/Project/semi-design/node_modules/lodash/flatten.js
|
|
42650
|
+
var lodash_flatten = __webpack_require__("1xil");
|
|
42651
|
+
var flatten_default = /*#__PURE__*/__webpack_require__.n(lodash_flatten);
|
|
42652
|
+
|
|
42588
42653
|
// EXTERNAL MODULE: /Users/daiqiang/Project/semi-design/node_modules/@babel/runtime-corejs3/core-js-stable/promise.js
|
|
42589
42654
|
var promise = __webpack_require__("kNzS");
|
|
42590
42655
|
var promise_default = /*#__PURE__*/__webpack_require__.n(promise);
|
|
@@ -42646,7 +42711,6 @@ var object_entries_default = /*#__PURE__*/__webpack_require__.n(object_entries);
|
|
|
42646
42711
|
|
|
42647
42712
|
|
|
42648
42713
|
|
|
42649
|
-
|
|
42650
42714
|
|
|
42651
42715
|
|
|
42652
42716
|
const DRAG_OFFSET = 0.45;
|
|
@@ -43126,7 +43190,7 @@ function normalizedArr(val) {
|
|
|
43126
43190
|
}
|
|
43127
43191
|
function normalizeKeyList(keyList, keyEntities) {
|
|
43128
43192
|
let leafOnly = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
43129
|
-
|
|
43193
|
+
const res = [];
|
|
43130
43194
|
const keyListSet = new set_default.a(keyList);
|
|
43131
43195
|
|
|
43132
43196
|
if (!leafOnly) {
|
|
@@ -43146,9 +43210,11 @@ function normalizeKeyList(keyList, keyEntities) {
|
|
|
43146
43210
|
res.push(key);
|
|
43147
43211
|
});
|
|
43148
43212
|
} else {
|
|
43149
|
-
|
|
43150
|
-
|
|
43151
|
-
|
|
43213
|
+
for_each_default()(keyList).call(keyList, key => {
|
|
43214
|
+
if (keyEntities[key] && !treeUtil_isValid(keyEntities[key].children)) {
|
|
43215
|
+
res.push(key);
|
|
43216
|
+
}
|
|
43217
|
+
});
|
|
43152
43218
|
}
|
|
43153
43219
|
|
|
43154
43220
|
return res;
|
|
@@ -43157,9 +43223,9 @@ function getMotionKeys(eventKey, expandedKeys, keyEntities) {
|
|
|
43157
43223
|
const res = [];
|
|
43158
43224
|
|
|
43159
43225
|
const getChild = itemKey => {
|
|
43160
|
-
var
|
|
43226
|
+
var _context8;
|
|
43161
43227
|
|
|
43162
|
-
keyEntities[itemKey].children && for_each_default()(
|
|
43228
|
+
keyEntities[itemKey].children && for_each_default()(_context8 = keyEntities[itemKey].children).call(_context8, item => {
|
|
43163
43229
|
const {
|
|
43164
43230
|
key
|
|
43165
43231
|
} = item;
|
|
@@ -43275,7 +43341,7 @@ function calcCheckedKeysForUnchecked(key, keyEntities, checkedKeys, halfCheckedK
|
|
|
43275
43341
|
};
|
|
43276
43342
|
}
|
|
43277
43343
|
function filterTreeData(info) {
|
|
43278
|
-
var
|
|
43344
|
+
var _context9, _context10;
|
|
43279
43345
|
|
|
43280
43346
|
const {
|
|
43281
43347
|
showFilteredOnly,
|
|
@@ -43287,7 +43353,7 @@ function filterTreeData(info) {
|
|
|
43287
43353
|
prevExpandedKeys
|
|
43288
43354
|
} = info;
|
|
43289
43355
|
let filteredOptsKeys = [];
|
|
43290
|
-
filteredOptsKeys = map_default()(
|
|
43356
|
+
filteredOptsKeys = map_default()(_context9 = filter_default()(_context10 = values_default()(keyEntities)).call(_context10, item => treeUtil_filter(inputValue, item.data, filterTreeNode, filterProps))).call(_context9, item => item.key);
|
|
43291
43357
|
let expandedOptsKeys = findAncestorKeys(filteredOptsKeys, keyEntities, false);
|
|
43292
43358
|
|
|
43293
43359
|
if (prevExpandedKeys.length) {
|
|
@@ -43328,9 +43394,9 @@ function updateKeys(keySet, keyEntities) {
|
|
|
43328
43394
|
return filter_default()(keyArr).call(keyArr, key => key in keyEntities);
|
|
43329
43395
|
}
|
|
43330
43396
|
function calcDisabledKeys(keyEntities) {
|
|
43331
|
-
var
|
|
43397
|
+
var _context11;
|
|
43332
43398
|
|
|
43333
|
-
const disabledKeys = filter_default()(
|
|
43399
|
+
const disabledKeys = filter_default()(_context11 = keys_default()(keyEntities)).call(_context11, key => keyEntities[key].data.disabled);
|
|
43334
43400
|
|
|
43335
43401
|
const {
|
|
43336
43402
|
checkedKeys
|
|
@@ -43365,6 +43431,27 @@ function calcDropActualPosition(pos, relativeDropPos) {
|
|
|
43365
43431
|
|
|
43366
43432
|
return relativeDropPos + Number(posArr[posArr.length - 1]);
|
|
43367
43433
|
}
|
|
43434
|
+
// CONCATENATED MODULE: ../semi-foundation/cascader/constants.ts
|
|
43435
|
+
|
|
43436
|
+
const cascader_constants_cssClasses = {
|
|
43437
|
+
PREFIX: "".concat(BASE_CLASS_PREFIX, "-cascader"),
|
|
43438
|
+
PREFIX_OPTION: "".concat(BASE_CLASS_PREFIX, "-cascader-option")
|
|
43439
|
+
};
|
|
43440
|
+
const cascader_constants_strings = {
|
|
43441
|
+
SIZE_SET: ['small', 'large', 'default'],
|
|
43442
|
+
VALIDATE_STATUS: ['default', 'error', 'warning'],
|
|
43443
|
+
IS_KEY: 'isKey',
|
|
43444
|
+
IS_VALUE: 'isValue',
|
|
43445
|
+
SHOW_NEXT_BY_CLICK: 'click',
|
|
43446
|
+
SHOW_NEXT_BY_HOVER: 'hover',
|
|
43447
|
+
|
|
43448
|
+
/* Merge Type */
|
|
43449
|
+
LEAF_ONLY_MERGE_TYPE: 'leafOnly',
|
|
43450
|
+
AUTO_MERGE_VALUE_MERGE_TYPE: 'autoMergeValue',
|
|
43451
|
+
NONE_MERGE_TYPE: 'none'
|
|
43452
|
+
};
|
|
43453
|
+
const cascader_constants_numbers = {};
|
|
43454
|
+
|
|
43368
43455
|
// CONCATENATED MODULE: ../semi-foundation/cascader/util.ts
|
|
43369
43456
|
|
|
43370
43457
|
|
|
@@ -43377,6 +43464,7 @@ function calcDropActualPosition(pos, relativeDropPos) {
|
|
|
43377
43464
|
|
|
43378
43465
|
|
|
43379
43466
|
|
|
43467
|
+
|
|
43380
43468
|
function util_getPosition(level, index) {
|
|
43381
43469
|
var _context;
|
|
43382
43470
|
|
|
@@ -43457,6 +43545,19 @@ function util_findKeysForValues(value, keyEntities) {
|
|
|
43457
43545
|
|
|
43458
43546
|
return res;
|
|
43459
43547
|
}
|
|
43548
|
+
function calcMergeType(autoMergeValue, leafOnly) {
|
|
43549
|
+
let mergeType;
|
|
43550
|
+
|
|
43551
|
+
if (leafOnly) {
|
|
43552
|
+
mergeType = cascader_constants_strings.LEAF_ONLY_MERGE_TYPE;
|
|
43553
|
+
} else if (autoMergeValue) {
|
|
43554
|
+
mergeType = cascader_constants_strings.AUTO_MERGE_VALUE_MERGE_TYPE;
|
|
43555
|
+
} else {
|
|
43556
|
+
mergeType = cascader_constants_strings.NONE_MERGE_TYPE;
|
|
43557
|
+
}
|
|
43558
|
+
|
|
43559
|
+
return mergeType;
|
|
43560
|
+
}
|
|
43460
43561
|
// CONCATENATED MODULE: ../semi-foundation/cascader/foundation.ts
|
|
43461
43562
|
|
|
43462
43563
|
|
|
@@ -43480,6 +43581,7 @@ function util_findKeysForValues(value, keyEntities) {
|
|
|
43480
43581
|
|
|
43481
43582
|
|
|
43482
43583
|
|
|
43584
|
+
|
|
43483
43585
|
|
|
43484
43586
|
|
|
43485
43587
|
// eslint-disable-next-line max-len
|
|
@@ -43995,10 +44097,12 @@ class foundation_CascaderFoundation extends foundation {
|
|
|
43995
44097
|
}
|
|
43996
44098
|
|
|
43997
44099
|
_defaultRenderText(path, displayRender) {
|
|
44100
|
+
const separator = this.getProp('separator');
|
|
44101
|
+
|
|
43998
44102
|
if (displayRender && typeof displayRender === 'function') {
|
|
43999
44103
|
return displayRender(path);
|
|
44000
44104
|
} else {
|
|
44001
|
-
return path.join(
|
|
44105
|
+
return path.join(separator);
|
|
44002
44106
|
}
|
|
44003
44107
|
}
|
|
44004
44108
|
|
|
@@ -44072,7 +44176,8 @@ class foundation_CascaderFoundation extends foundation {
|
|
|
44072
44176
|
const {
|
|
44073
44177
|
changeOnSelect: allowChange,
|
|
44074
44178
|
filterLeafOnly,
|
|
44075
|
-
multiple
|
|
44179
|
+
multiple,
|
|
44180
|
+
enableLeafClick
|
|
44076
44181
|
} = this.getProps();
|
|
44077
44182
|
const {
|
|
44078
44183
|
keyEntities,
|
|
@@ -44106,6 +44211,10 @@ class foundation_CascaderFoundation extends foundation {
|
|
|
44106
44211
|
this._adapter.updateStates({
|
|
44107
44212
|
activeKeys: new set_default.a(activeKeys)
|
|
44108
44213
|
});
|
|
44214
|
+
|
|
44215
|
+
if (isLeaf && enableLeafClick) {
|
|
44216
|
+
this.onItemCheckboxClick(item);
|
|
44217
|
+
}
|
|
44109
44218
|
} else {
|
|
44110
44219
|
this._adapter.notifySelect(data.value);
|
|
44111
44220
|
|
|
@@ -44155,12 +44264,13 @@ class foundation_CascaderFoundation extends foundation {
|
|
|
44155
44264
|
const {
|
|
44156
44265
|
checkedKeys,
|
|
44157
44266
|
keyEntities,
|
|
44158
|
-
|
|
44267
|
+
resolvedCheckedKeys
|
|
44159
44268
|
} = this.getStates();
|
|
44160
44269
|
const {
|
|
44161
44270
|
autoMergeValue,
|
|
44162
44271
|
max,
|
|
44163
|
-
disableStrictly
|
|
44272
|
+
disableStrictly,
|
|
44273
|
+
leafOnly
|
|
44164
44274
|
} = this.getProps(); // prev checked status
|
|
44165
44275
|
|
|
44166
44276
|
const prevCheckedStatus = checkedKeys.has(key); // next checked status
|
|
@@ -44171,16 +44281,19 @@ class foundation_CascaderFoundation extends foundation {
|
|
|
44171
44281
|
checkedKeys: curCheckedKeys,
|
|
44172
44282
|
halfCheckedKeys: curHalfCheckedKeys
|
|
44173
44283
|
} = disableStrictly ? this.calcNonDisabedCheckedKeys(key, curCheckedStatus) : this.calcCheckedKeys(key, curCheckedStatus);
|
|
44174
|
-
const
|
|
44175
|
-
const
|
|
44284
|
+
const mergeType = calcMergeType(autoMergeValue, leafOnly);
|
|
44285
|
+
const isLeafOnlyMerge = mergeType === cascader_constants_strings.LEAF_ONLY_MERGE_TYPE;
|
|
44286
|
+
const isNoneMerge = mergeType === cascader_constants_strings.NONE_MERGE_TYPE;
|
|
44287
|
+
const curResolvedCheckedKeys = new set_default.a(normalizeKeyList(curCheckedKeys, keyEntities, isLeafOnlyMerge));
|
|
44288
|
+
const curRealCheckedKeys = isNoneMerge ? curCheckedKeys : curResolvedCheckedKeys;
|
|
44176
44289
|
|
|
44177
44290
|
if (isNumber_default()(max)) {
|
|
44178
|
-
if (
|
|
44291
|
+
if (!isNoneMerge) {
|
|
44179
44292
|
// When it exceeds max, the quantity is allowed to be reduced, and no further increase is allowed
|
|
44180
|
-
if (
|
|
44293
|
+
if (resolvedCheckedKeys.size < curResolvedCheckedKeys.size && curResolvedCheckedKeys.size > max) {
|
|
44181
44294
|
const checkedEntities = [];
|
|
44182
44295
|
|
|
44183
|
-
for_each_default()(
|
|
44296
|
+
for_each_default()(curResolvedCheckedKeys).call(curResolvedCheckedKeys, itemKey => {
|
|
44184
44297
|
checkedEntities.push(keyEntities[itemKey]);
|
|
44185
44298
|
});
|
|
44186
44299
|
|
|
@@ -44208,7 +44321,7 @@ class foundation_CascaderFoundation extends foundation {
|
|
|
44208
44321
|
this._adapter.updateStates({
|
|
44209
44322
|
checkedKeys: curCheckedKeys,
|
|
44210
44323
|
halfCheckedKeys: curHalfCheckedKeys,
|
|
44211
|
-
|
|
44324
|
+
resolvedCheckedKeys: curResolvedCheckedKeys
|
|
44212
44325
|
});
|
|
44213
44326
|
} // The click event during multiple selection will definitely cause the checked state of node to change,
|
|
44214
44327
|
// so there is no need to judge the value to change.
|
|
@@ -44371,7 +44484,7 @@ class foundation_CascaderFoundation extends foundation {
|
|
|
44371
44484
|
newState.halfCheckedKeys = new set_default.a([]);
|
|
44372
44485
|
newState.selectedKeys = new set_default.a([]);
|
|
44373
44486
|
newState.activeKeys = new set_default.a([]);
|
|
44374
|
-
newState.
|
|
44487
|
+
newState.resolvedCheckedKeys = new set_default.a([]);
|
|
44375
44488
|
|
|
44376
44489
|
this._adapter.notifyChange([]);
|
|
44377
44490
|
} else {
|
|
@@ -44496,22 +44609,6 @@ class foundation_CascaderFoundation extends foundation {
|
|
|
44496
44609
|
}
|
|
44497
44610
|
|
|
44498
44611
|
}
|
|
44499
|
-
// CONCATENATED MODULE: ../semi-foundation/cascader/constants.ts
|
|
44500
|
-
|
|
44501
|
-
const cascader_constants_cssClasses = {
|
|
44502
|
-
PREFIX: "".concat(BASE_CLASS_PREFIX, "-cascader"),
|
|
44503
|
-
PREFIX_OPTION: "".concat(BASE_CLASS_PREFIX, "-cascader-option")
|
|
44504
|
-
};
|
|
44505
|
-
const cascader_constants_strings = {
|
|
44506
|
-
SIZE_SET: ['small', 'large', 'default'],
|
|
44507
|
-
VALIDATE_STATUS: ['default', 'error', 'warning'],
|
|
44508
|
-
IS_KEY: 'isKey',
|
|
44509
|
-
IS_VALUE: 'isValue',
|
|
44510
|
-
SHOW_NEXT_BY_CLICK: 'click',
|
|
44511
|
-
SHOW_NEXT_BY_HOVER: 'hover'
|
|
44512
|
-
};
|
|
44513
|
-
const cascader_constants_numbers = {};
|
|
44514
|
-
|
|
44515
44612
|
// EXTERNAL MODULE: ../semi-foundation/cascader/cascader.scss
|
|
44516
44613
|
var cascader = __webpack_require__("7u0x");
|
|
44517
44614
|
|
|
@@ -45295,7 +45392,8 @@ class item_Item extends external_root_React_commonjs2_react_commonjs_react_amd_r
|
|
|
45295
45392
|
this.highlight = searchText => {
|
|
45296
45393
|
const content = [];
|
|
45297
45394
|
const {
|
|
45298
|
-
keyword
|
|
45395
|
+
keyword,
|
|
45396
|
+
separator
|
|
45299
45397
|
} = this.props;
|
|
45300
45398
|
|
|
45301
45399
|
for_each_default()(searchText).call(searchText, (item, idx) => {
|
|
@@ -45319,7 +45417,7 @@ class item_Item extends external_root_React_commonjs2_react_commonjs_react_amd_r
|
|
|
45319
45417
|
}
|
|
45320
45418
|
|
|
45321
45419
|
if (idx !== searchText.length - 1) {
|
|
45322
|
-
content.push(
|
|
45420
|
+
content.push(separator);
|
|
45323
45421
|
}
|
|
45324
45422
|
});
|
|
45325
45423
|
|
|
@@ -45491,6 +45589,7 @@ item_Item.propTypes = {
|
|
|
45491
45589
|
checkedKeys: prop_types_default.a.object,
|
|
45492
45590
|
halfCheckedKeys: prop_types_default.a.object,
|
|
45493
45591
|
onItemCheckboxClick: prop_types_default.a.func,
|
|
45592
|
+
separator: prop_types_default.a.string,
|
|
45494
45593
|
keyword: prop_types_default.a.string
|
|
45495
45594
|
};
|
|
45496
45595
|
item_Item.defaultProps = {
|
|
@@ -46400,6 +46499,7 @@ tagInput_TagInput.defaultProps = {
|
|
|
46400
46499
|
|
|
46401
46500
|
|
|
46402
46501
|
|
|
46502
|
+
|
|
46403
46503
|
|
|
46404
46504
|
|
|
46405
46505
|
const cascader_prefixcls = cascader_constants_cssClasses.PREFIX;
|
|
@@ -46493,6 +46593,7 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
46493
46593
|
dropdownStyle,
|
|
46494
46594
|
loadData,
|
|
46495
46595
|
emptyContent,
|
|
46596
|
+
separator,
|
|
46496
46597
|
topSlot,
|
|
46497
46598
|
bottomSlot,
|
|
46498
46599
|
showNext,
|
|
@@ -46508,6 +46609,7 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
46508
46609
|
}, topSlot, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(item_Item, {
|
|
46509
46610
|
activeKeys: activeKeys,
|
|
46510
46611
|
selectedKeys: selectedKeys,
|
|
46612
|
+
separator: separator,
|
|
46511
46613
|
loadedKeys: loadedKeys,
|
|
46512
46614
|
loadingKeys: loadingKeys,
|
|
46513
46615
|
onItemClick: this.handleItemClick,
|
|
@@ -46557,9 +46659,9 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
46557
46659
|
} = this.props;
|
|
46558
46660
|
const {
|
|
46559
46661
|
checkedKeys,
|
|
46560
|
-
|
|
46662
|
+
resolvedCheckedKeys
|
|
46561
46663
|
} = this.state;
|
|
46562
|
-
const realKeys =
|
|
46664
|
+
const realKeys = this.mergeType === cascader_constants_strings.NONE_MERGE_TYPE ? checkedKeys : resolvedCheckedKeys;
|
|
46563
46665
|
const displayTag = [];
|
|
46564
46666
|
const hiddenTag = [];
|
|
46565
46667
|
|
|
@@ -46649,20 +46751,23 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
46649
46751
|
const {
|
|
46650
46752
|
disabled,
|
|
46651
46753
|
triggerRender,
|
|
46652
|
-
multiple
|
|
46653
|
-
autoMergeValue
|
|
46754
|
+
multiple
|
|
46654
46755
|
} = this.props;
|
|
46655
46756
|
const {
|
|
46656
46757
|
selectedKeys,
|
|
46657
46758
|
inputValue,
|
|
46658
46759
|
inputPlaceHolder,
|
|
46659
|
-
|
|
46760
|
+
resolvedCheckedKeys,
|
|
46660
46761
|
checkedKeys
|
|
46661
46762
|
} = this.state;
|
|
46662
46763
|
let realValue;
|
|
46663
46764
|
|
|
46664
46765
|
if (multiple) {
|
|
46665
|
-
|
|
46766
|
+
if (this.mergeType === cascader_constants_strings.NONE_MERGE_TYPE) {
|
|
46767
|
+
realValue = checkedKeys;
|
|
46768
|
+
} else {
|
|
46769
|
+
realValue = resolvedCheckedKeys;
|
|
46770
|
+
}
|
|
46666
46771
|
} else {
|
|
46667
46772
|
realValue = [...selectedKeys][0];
|
|
46668
46773
|
}
|
|
@@ -46842,8 +46947,8 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
46842
46947
|
/* Key of half checked node, when multiple */
|
|
46843
46948
|
halfCheckedKeys: new set_default.a([]),
|
|
46844
46949
|
|
|
46845
|
-
/* Auto merged checkedKeys, when multiple */
|
|
46846
|
-
|
|
46950
|
+
/* Auto merged checkedKeys or leaf checkedKeys, when multiple */
|
|
46951
|
+
resolvedCheckedKeys: new set_default.a([]),
|
|
46847
46952
|
|
|
46848
46953
|
/* Keys of loaded item */
|
|
46849
46954
|
loadedKeys: new set_default.a(),
|
|
@@ -46856,6 +46961,7 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
46856
46961
|
};
|
|
46857
46962
|
this.options = {};
|
|
46858
46963
|
this.isEmpty = false;
|
|
46964
|
+
this.mergeType = calcMergeType(props.autoMergeValue, props.leafOnly);
|
|
46859
46965
|
this.inputRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
|
|
46860
46966
|
this.triggerRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
|
|
46861
46967
|
this.optionsRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
|
|
@@ -46998,7 +47104,9 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
46998
47104
|
multiple,
|
|
46999
47105
|
value,
|
|
47000
47106
|
defaultValue,
|
|
47001
|
-
onChangeWithObject
|
|
47107
|
+
onChangeWithObject,
|
|
47108
|
+
leafOnly,
|
|
47109
|
+
autoMergeValue
|
|
47002
47110
|
} = props;
|
|
47003
47111
|
const {
|
|
47004
47112
|
prevProps
|
|
@@ -47063,24 +47171,19 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
47063
47171
|
realKeys = formatKeys;
|
|
47064
47172
|
}
|
|
47065
47173
|
|
|
47066
|
-
|
|
47067
|
-
|
|
47068
|
-
|
|
47069
|
-
for_each_default()(realKeys).call(realKeys, v => {
|
|
47070
|
-
const calRes = calcCheckedKeys(v, keyEntities);
|
|
47071
|
-
checkedKeys = new set_default.a([...checkedKeys, ...calRes.checkedKeys]);
|
|
47072
|
-
halfCheckedKeys = new set_default.a([...halfCheckedKeys, ...calRes.halfCheckedKeys]);
|
|
47073
|
-
}); // disableStrictly
|
|
47074
|
-
|
|
47174
|
+
const calRes = calcCheckedKeys(flatten_default()(realKeys), keyEntities);
|
|
47175
|
+
const checkedKeys = new set_default.a(calRes.checkedKeys);
|
|
47176
|
+
const halfCheckedKeys = new set_default.a(calRes.halfCheckedKeys); // disableStrictly
|
|
47075
47177
|
|
|
47076
47178
|
if (props.disableStrictly) {
|
|
47077
47179
|
newState.disabledKeys = calcDisabledKeys(keyEntities);
|
|
47078
47180
|
}
|
|
47079
47181
|
|
|
47182
|
+
const isLeafOnlyMerge = calcMergeType(autoMergeValue, leafOnly) === cascader_constants_strings.LEAF_ONLY_MERGE_TYPE;
|
|
47080
47183
|
newState.prevProps = props;
|
|
47081
47184
|
newState.checkedKeys = checkedKeys;
|
|
47082
47185
|
newState.halfCheckedKeys = halfCheckedKeys;
|
|
47083
|
-
newState.
|
|
47186
|
+
newState.resolvedCheckedKeys = new set_default.a(normalizeKeyList(checkedKeys, keyEntities, isLeafOnlyMerge));
|
|
47084
47187
|
}
|
|
47085
47188
|
}
|
|
47086
47189
|
|
|
@@ -47114,7 +47217,6 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
47114
47217
|
const {
|
|
47115
47218
|
size,
|
|
47116
47219
|
disabled,
|
|
47117
|
-
autoMergeValue,
|
|
47118
47220
|
placeholder,
|
|
47119
47221
|
maxTagCount,
|
|
47120
47222
|
showRestTagsPopover,
|
|
@@ -47124,11 +47226,11 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
47124
47226
|
inputValue,
|
|
47125
47227
|
checkedKeys,
|
|
47126
47228
|
keyEntities,
|
|
47127
|
-
|
|
47229
|
+
resolvedCheckedKeys
|
|
47128
47230
|
} = this.state;
|
|
47129
47231
|
const tagInputcls = classnames_default()("".concat(cascader_prefixcls, "-tagInput-wrapper"));
|
|
47130
47232
|
const tagValue = [];
|
|
47131
|
-
const realKeys =
|
|
47233
|
+
const realKeys = this.mergeType === cascader_constants_strings.NONE_MERGE_TYPE ? checkedKeys : resolvedCheckedKeys;
|
|
47132
47234
|
|
|
47133
47235
|
for_each_default()(_context3 = [...realKeys]).call(_context3, checkedKey => {
|
|
47134
47236
|
if (!isEmpty_default()(keyEntities[checkedKey])) {
|
|
@@ -47278,14 +47380,18 @@ cascader_Cascader.propTypes = {
|
|
|
47278
47380
|
showRestTagsPopover: prop_types_default.a.bool,
|
|
47279
47381
|
restTagsPopoverProps: prop_types_default.a.object,
|
|
47280
47382
|
max: prop_types_default.a.number,
|
|
47383
|
+
separator: prop_types_default.a.string,
|
|
47281
47384
|
onExceed: prop_types_default.a.func,
|
|
47282
47385
|
onClear: prop_types_default.a.func,
|
|
47283
47386
|
loadData: prop_types_default.a.func,
|
|
47284
47387
|
onLoad: prop_types_default.a.func,
|
|
47285
47388
|
loadedKeys: prop_types_default.a.array,
|
|
47286
|
-
disableStrictly: prop_types_default.a.bool
|
|
47389
|
+
disableStrictly: prop_types_default.a.bool,
|
|
47390
|
+
leafOnly: prop_types_default.a.bool,
|
|
47391
|
+
enableLeafClick: prop_types_default.a.bool
|
|
47287
47392
|
};
|
|
47288
47393
|
cascader_Cascader.defaultProps = {
|
|
47394
|
+
leafOnly: false,
|
|
47289
47395
|
arrowIcon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconChevronDown, null),
|
|
47290
47396
|
stopPropagation: true,
|
|
47291
47397
|
motion: true,
|
|
@@ -47302,6 +47408,7 @@ cascader_Cascader.defaultProps = {
|
|
|
47302
47408
|
filterLeafOnly: true,
|
|
47303
47409
|
showRestTagsPopover: false,
|
|
47304
47410
|
restTagsPopoverProps: {},
|
|
47411
|
+
separator: ' / ',
|
|
47305
47412
|
size: 'default',
|
|
47306
47413
|
treeNodeFilterProp: 'label',
|
|
47307
47414
|
displayProp: 'label',
|
|
@@ -47310,7 +47417,8 @@ cascader_Cascader.defaultProps = {
|
|
|
47310
47417
|
onExceed: noop_default.a,
|
|
47311
47418
|
onClear: noop_default.a,
|
|
47312
47419
|
onDropdownVisibleChange: noop_default.a,
|
|
47313
|
-
onListScroll: noop_default.a
|
|
47420
|
+
onListScroll: noop_default.a,
|
|
47421
|
+
enableLeafClick: false
|
|
47314
47422
|
};
|
|
47315
47423
|
/* harmony default export */ var cascader_0 = (cascader_Cascader);
|
|
47316
47424
|
// CONCATENATED MODULE: ../semi-foundation/collapse/constants.ts
|
|
@@ -54558,11 +54666,99 @@ class monthsGridFoundation_MonthsGridFoundation extends foundation {
|
|
|
54558
54666
|
|
|
54559
54667
|
|
|
54560
54668
|
destroy() {}
|
|
54669
|
+
/**
|
|
54670
|
+
* sync change another panel month when change months from the else yam panel
|
|
54671
|
+
* call it when
|
|
54672
|
+
* - current change panel targe date month is same with another panel date
|
|
54673
|
+
*
|
|
54674
|
+
* @example
|
|
54675
|
+
* - panelType=right, target=new Date('2022-09-01') and left panel is in '2022-09' => call it, left panel minus one month to '2022-08'
|
|
54676
|
+
* - panelType=left, target=new Date('2021-12-01') and right panel is in '2021-12' => call it, right panel add one month to '2021-01'
|
|
54677
|
+
*/
|
|
54678
|
+
|
|
54679
|
+
|
|
54680
|
+
handleSyncChangeMonths(options) {
|
|
54681
|
+
const {
|
|
54682
|
+
panelType,
|
|
54683
|
+
target
|
|
54684
|
+
} = options;
|
|
54685
|
+
|
|
54686
|
+
const {
|
|
54687
|
+
type
|
|
54688
|
+
} = this._adapter.getProps();
|
|
54689
|
+
|
|
54690
|
+
const {
|
|
54691
|
+
monthLeft,
|
|
54692
|
+
monthRight
|
|
54693
|
+
} = this._adapter.getStates();
|
|
54694
|
+
|
|
54695
|
+
if (this.isRangeType(type)) {
|
|
54696
|
+
if (panelType === 'right' && differenceInCalendarMonths(target, monthLeft.pickerDate) === 0) {
|
|
54697
|
+
this.handleYearOrMonthChange('prevMonth', 'left', 1, true);
|
|
54698
|
+
} else if (panelType === 'left' && differenceInCalendarMonths(monthRight.pickerDate, target) === 0) {
|
|
54699
|
+
this.handleYearOrMonthChange('nextMonth', 'right', 1, true);
|
|
54700
|
+
}
|
|
54701
|
+
}
|
|
54702
|
+
}
|
|
54703
|
+
/**
|
|
54704
|
+
* Get the target date based on the panel type and switch type
|
|
54705
|
+
*/
|
|
54706
|
+
|
|
54707
|
+
|
|
54708
|
+
getTargetChangeDate(options) {
|
|
54709
|
+
const {
|
|
54710
|
+
panelType,
|
|
54711
|
+
switchType
|
|
54712
|
+
} = options;
|
|
54713
|
+
|
|
54714
|
+
const {
|
|
54715
|
+
monthRight,
|
|
54716
|
+
monthLeft
|
|
54717
|
+
} = this._adapter.getStates();
|
|
54718
|
+
|
|
54719
|
+
const currentDate = panelType === 'left' ? monthLeft.pickerDate : monthRight.pickerDate;
|
|
54720
|
+
let target;
|
|
54721
|
+
|
|
54722
|
+
switch (switchType) {
|
|
54723
|
+
case 'prevMonth':
|
|
54724
|
+
target = addMonths(currentDate, -1);
|
|
54725
|
+
break;
|
|
54726
|
+
|
|
54727
|
+
case 'nextMonth':
|
|
54728
|
+
target = addMonths(currentDate, 1);
|
|
54729
|
+
break;
|
|
54730
|
+
|
|
54731
|
+
case 'prevYear':
|
|
54732
|
+
target = addYears(currentDate, -1);
|
|
54733
|
+
break;
|
|
54734
|
+
|
|
54735
|
+
case 'nextYear':
|
|
54736
|
+
target = addYears(currentDate, 1);
|
|
54737
|
+
break;
|
|
54738
|
+
}
|
|
54739
|
+
|
|
54740
|
+
return target;
|
|
54741
|
+
}
|
|
54742
|
+
/**
|
|
54743
|
+
* Change month by yam panel
|
|
54744
|
+
*/
|
|
54745
|
+
|
|
54561
54746
|
|
|
54562
54747
|
toMonth(panelType, target) {
|
|
54748
|
+
const {
|
|
54749
|
+
type
|
|
54750
|
+
} = this._adapter.getProps();
|
|
54751
|
+
|
|
54563
54752
|
const diff = this._getDiff('month', target, panelType);
|
|
54564
54753
|
|
|
54565
54754
|
this.handleYearOrMonthChange(diff < 0 ? 'prevMonth' : 'nextMonth', panelType, Math.abs(diff), false);
|
|
54755
|
+
|
|
54756
|
+
if (this.isRangeType(type)) {
|
|
54757
|
+
this.handleSyncChangeMonths({
|
|
54758
|
+
panelType,
|
|
54759
|
+
target
|
|
54760
|
+
});
|
|
54761
|
+
}
|
|
54566
54762
|
}
|
|
54567
54763
|
|
|
54568
54764
|
toYear(panelType, target) {
|
|
@@ -54584,34 +54780,51 @@ class monthsGridFoundation_MonthsGridFoundation extends foundation {
|
|
|
54584
54780
|
return typeof realType === 'string' && /range/i.test(realType);
|
|
54585
54781
|
}
|
|
54586
54782
|
|
|
54587
|
-
|
|
54783
|
+
handleSwitchMonthOrYear(switchType, panelType) {
|
|
54588
54784
|
const {
|
|
54589
54785
|
type,
|
|
54590
54786
|
syncSwitchMonth
|
|
54591
54787
|
} = this.getProps();
|
|
54788
|
+
const rangeType = this.isRangeType(type); // range type and syncSwitchMonth, we should change panels at same time
|
|
54592
54789
|
|
|
54593
|
-
if (
|
|
54790
|
+
if (rangeType && syncSwitchMonth) {
|
|
54594
54791
|
this.handleYearOrMonthChange(switchType, 'left', 1, true);
|
|
54595
54792
|
this.handleYearOrMonthChange(switchType, 'right', 1, true);
|
|
54596
54793
|
} else {
|
|
54597
54794
|
this.handleYearOrMonthChange(switchType, panelType);
|
|
54795
|
+
/**
|
|
54796
|
+
* default behavior (v2.2.0)
|
|
54797
|
+
* In order to prevent the two panels from being the same month, this will confuse the user when selecting the range
|
|
54798
|
+
* https://github.com/DouyinFE/semi-design/issues/260
|
|
54799
|
+
*/
|
|
54800
|
+
|
|
54801
|
+
if (rangeType) {
|
|
54802
|
+
const target = this.getTargetChangeDate({
|
|
54803
|
+
panelType,
|
|
54804
|
+
switchType
|
|
54805
|
+
});
|
|
54806
|
+
this.handleSyncChangeMonths({
|
|
54807
|
+
panelType,
|
|
54808
|
+
target
|
|
54809
|
+
});
|
|
54810
|
+
}
|
|
54598
54811
|
}
|
|
54599
54812
|
}
|
|
54600
54813
|
|
|
54601
54814
|
prevMonth(panelType) {
|
|
54602
|
-
this.
|
|
54815
|
+
this.handleSwitchMonthOrYear('prevMonth', panelType);
|
|
54603
54816
|
}
|
|
54604
54817
|
|
|
54605
54818
|
nextMonth(panelType) {
|
|
54606
|
-
this.
|
|
54819
|
+
this.handleSwitchMonthOrYear('nextMonth', panelType);
|
|
54607
54820
|
}
|
|
54608
54821
|
|
|
54609
54822
|
prevYear(panelType) {
|
|
54610
|
-
this.
|
|
54823
|
+
this.handleSwitchMonthOrYear('prevYear', panelType);
|
|
54611
54824
|
}
|
|
54612
54825
|
|
|
54613
54826
|
nextYear(panelType) {
|
|
54614
|
-
this.
|
|
54827
|
+
this.handleSwitchMonthOrYear('nextYear', panelType);
|
|
54615
54828
|
}
|
|
54616
54829
|
/**
|
|
54617
54830
|
* Calculate the year and month difference
|
|
@@ -55268,6 +55481,34 @@ class monthsGridFoundation_MonthsGridFoundation extends foundation {
|
|
|
55268
55481
|
isYearPickerOpen: false
|
|
55269
55482
|
});
|
|
55270
55483
|
}
|
|
55484
|
+
/**
|
|
55485
|
+
* Get year and month panel open type
|
|
55486
|
+
*
|
|
55487
|
+
* It is useful info to set minHeight of weeks.
|
|
55488
|
+
* - When yam open type is 'left' or 'right', weeks minHeight should be set
|
|
55489
|
+
* If the minHeight is not set, the change of the number of weeks will cause the scrollList to be unstable
|
|
55490
|
+
*/
|
|
55491
|
+
|
|
55492
|
+
|
|
55493
|
+
getYAMOpenType() {
|
|
55494
|
+
const {
|
|
55495
|
+
monthLeft,
|
|
55496
|
+
monthRight
|
|
55497
|
+
} = this._adapter.getStates();
|
|
55498
|
+
|
|
55499
|
+
const leftYearPickerOpen = monthLeft.isYearPickerOpen;
|
|
55500
|
+
const rightYearPickerOpen = monthRight.isYearPickerOpen;
|
|
55501
|
+
|
|
55502
|
+
if (leftYearPickerOpen && rightYearPickerOpen) {
|
|
55503
|
+
return 'both';
|
|
55504
|
+
} else if (leftYearPickerOpen) {
|
|
55505
|
+
return 'left';
|
|
55506
|
+
} else if (rightYearPickerOpen) {
|
|
55507
|
+
return 'right';
|
|
55508
|
+
} else {
|
|
55509
|
+
return 'none';
|
|
55510
|
+
}
|
|
55511
|
+
}
|
|
55271
55512
|
|
|
55272
55513
|
}
|
|
55273
55514
|
// CONCATENATED MODULE: ./datePicker/navigation.tsx
|
|
@@ -55293,6 +55534,8 @@ class navigation_Navigation extends external_root_React_commonjs2_react_commonjs
|
|
|
55293
55534
|
onMonthClick,
|
|
55294
55535
|
onNextMonth,
|
|
55295
55536
|
onPrevMonth,
|
|
55537
|
+
onPrevYear,
|
|
55538
|
+
onNextYear,
|
|
55296
55539
|
density,
|
|
55297
55540
|
shouldBimonthSwitch,
|
|
55298
55541
|
panelType
|
|
@@ -55300,37 +55543,75 @@ class navigation_Navigation extends external_root_React_commonjs2_react_commonjs
|
|
|
55300
55543
|
const btnTheme = 'borderless';
|
|
55301
55544
|
const iconBtnSize = density === 'compact' ? 'default' : 'large';
|
|
55302
55545
|
const btnNoHorizontalPadding = true;
|
|
55303
|
-
const buttonSize = density === 'compact' ? 'small' : 'default';
|
|
55546
|
+
const buttonSize = density === 'compact' ? 'small' : 'default';
|
|
55547
|
+
const isLeftPanel = panelType === datePicker_constants_strings.PANEL_TYPE_LEFT;
|
|
55548
|
+
const isRightPanel = panelType === datePicker_constants_strings.PANEL_TYPE_RIGHT; // syncSwitchMonth and the current panel is the left
|
|
55549
|
+
|
|
55550
|
+
const hiddenLeftPanelRightButtons = shouldBimonthSwitch && isLeftPanel; // syncSwitchMonth and the current panel is the right
|
|
55551
|
+
|
|
55552
|
+
const hiddenRightPanelLeftButtons = shouldBimonthSwitch && isRightPanel; // `visibility: hidden` will keep the icon in position
|
|
55304
55553
|
|
|
55305
|
-
const
|
|
55554
|
+
const leftButtonStyle = {};
|
|
55555
|
+
const rightButtonStyle = {};
|
|
55556
|
+
|
|
55557
|
+
if (hiddenRightPanelLeftButtons) {
|
|
55558
|
+
leftButtonStyle.visibility = 'hidden';
|
|
55559
|
+
}
|
|
55560
|
+
|
|
55561
|
+
if (hiddenLeftPanelRightButtons) {
|
|
55562
|
+
rightButtonStyle.visibility = 'hidden';
|
|
55563
|
+
}
|
|
55306
55564
|
|
|
55307
|
-
const bimonthSwitchWithRightPanel = shouldBimonthSwitch && panelType === datePicker_constants_strings.PANEL_TYPE_RIGHT;
|
|
55308
55565
|
const ref = forwardRef || this.navRef;
|
|
55309
55566
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
55310
55567
|
className: navigation_prefixCls,
|
|
55311
55568
|
ref: ref
|
|
55312
|
-
},
|
|
55569
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(iconButton_0, {
|
|
55570
|
+
key: "double-chevron-left",
|
|
55571
|
+
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconDoubleChevronLeft, {
|
|
55572
|
+
size: iconBtnSize
|
|
55573
|
+
}),
|
|
55574
|
+
size: buttonSize,
|
|
55575
|
+
theme: btnTheme,
|
|
55576
|
+
noHorizontalPadding: btnNoHorizontalPadding,
|
|
55577
|
+
onClick: onPrevYear,
|
|
55578
|
+
style: leftButtonStyle
|
|
55579
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(iconButton_0, {
|
|
55580
|
+
key: "chevron-left",
|
|
55313
55581
|
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconChevronLeft, {
|
|
55314
55582
|
size: iconBtnSize
|
|
55315
55583
|
}),
|
|
55316
55584
|
size: buttonSize,
|
|
55317
55585
|
onClick: onPrevMonth,
|
|
55318
55586
|
theme: btnTheme,
|
|
55319
|
-
noHorizontalPadding: btnNoHorizontalPadding
|
|
55587
|
+
noHorizontalPadding: btnNoHorizontalPadding,
|
|
55588
|
+
style: leftButtonStyle
|
|
55320
55589
|
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
55321
55590
|
className: "".concat(navigation_prefixCls, "-month")
|
|
55322
55591
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, {
|
|
55323
55592
|
onClick: onMonthClick,
|
|
55324
55593
|
theme: btnTheme,
|
|
55325
55594
|
size: buttonSize
|
|
55326
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", null, monthText))),
|
|
55595
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", null, monthText))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(iconButton_0, {
|
|
55596
|
+
key: "chevron-right",
|
|
55327
55597
|
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconChevronRight, {
|
|
55328
55598
|
size: iconBtnSize
|
|
55329
55599
|
}),
|
|
55330
55600
|
size: buttonSize,
|
|
55331
55601
|
onClick: onNextMonth,
|
|
55332
55602
|
theme: btnTheme,
|
|
55333
|
-
noHorizontalPadding: btnNoHorizontalPadding
|
|
55603
|
+
noHorizontalPadding: btnNoHorizontalPadding,
|
|
55604
|
+
style: rightButtonStyle
|
|
55605
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(iconButton_0, {
|
|
55606
|
+
key: "double-chevron-right",
|
|
55607
|
+
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconDoubleChevronRight, {
|
|
55608
|
+
size: iconBtnSize
|
|
55609
|
+
}),
|
|
55610
|
+
size: buttonSize,
|
|
55611
|
+
theme: btnTheme,
|
|
55612
|
+
noHorizontalPadding: btnNoHorizontalPadding,
|
|
55613
|
+
onClick: onNextYear,
|
|
55614
|
+
style: rightButtonStyle
|
|
55334
55615
|
}));
|
|
55335
55616
|
}
|
|
55336
55617
|
|
|
@@ -58017,6 +58298,10 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
|
|
|
58017
58298
|
});
|
|
58018
58299
|
};
|
|
58019
58300
|
|
|
58301
|
+
this.getYAMOpenType = () => {
|
|
58302
|
+
return this.foundation.getYAMOpenType();
|
|
58303
|
+
};
|
|
58304
|
+
|
|
58020
58305
|
let nowDate = is_array_default()(props.defaultPickerValue) ? props.defaultPickerValue[0] : props.defaultPickerValue;
|
|
58021
58306
|
const validFormat = props.format || getDefaultFormatTokenByType(props.type);
|
|
58022
58307
|
|
|
@@ -58508,9 +58793,11 @@ class monthsGrid_MonthsGrid extends baseComponent_BaseComponent {
|
|
|
58508
58793
|
content = 'year month';
|
|
58509
58794
|
}
|
|
58510
58795
|
|
|
58796
|
+
const yearOpenType = this.getYAMOpenType();
|
|
58511
58797
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
58512
58798
|
className: monthGridCls,
|
|
58513
58799
|
"x-type": type,
|
|
58800
|
+
"x-panel-yearandmonth-open-type": yearOpenType,
|
|
58514
58801
|
ref: current => this.cacheRefCurrent('monthGrid', current)
|
|
58515
58802
|
}, content);
|
|
58516
58803
|
}
|
|
@@ -59458,7 +59745,7 @@ class descriptions_item_Item extends external_root_React_commonjs2_react_commonj
|
|
|
59458
59745
|
className: "".concat(item_prefixCls, "-item")
|
|
59459
59746
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
59460
59747
|
className: keyCls
|
|
59461
|
-
},
|
|
59748
|
+
}, itemKey, ":"), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
59462
59749
|
className: valCls
|
|
59463
59750
|
}, typeof children === 'function' ? children() : children))) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("tr", {
|
|
59464
59751
|
className: className,
|
|
@@ -72285,39 +72572,44 @@ class select_Select extends baseComponent_BaseComponent {
|
|
|
72285
72572
|
const {
|
|
72286
72573
|
size,
|
|
72287
72574
|
multiple,
|
|
72288
|
-
disabled
|
|
72575
|
+
disabled,
|
|
72576
|
+
inputProps
|
|
72289
72577
|
} = this.props;
|
|
72578
|
+
|
|
72579
|
+
const inputPropsCls = get_default()(inputProps, 'className');
|
|
72580
|
+
|
|
72290
72581
|
const inputcls = classnames_default()("".concat(select_prefixcls, "-input"), {
|
|
72291
72582
|
["".concat(select_prefixcls, "-input-single")]: !multiple,
|
|
72292
72583
|
["".concat(select_prefixcls, "-input-multiple")]: multiple
|
|
72293
|
-
});
|
|
72584
|
+
}, inputPropsCls);
|
|
72294
72585
|
const {
|
|
72295
72586
|
inputValue
|
|
72296
72587
|
} = this.state;
|
|
72297
|
-
|
|
72588
|
+
|
|
72589
|
+
const selectInputProps = assign_default()({
|
|
72298
72590
|
value: inputValue,
|
|
72299
72591
|
disabled,
|
|
72300
72592
|
className: inputcls,
|
|
72301
72593
|
onChange: this.handleInputChange
|
|
72302
|
-
};
|
|
72594
|
+
}, inputProps);
|
|
72595
|
+
|
|
72303
72596
|
let style = {}; // Multiple choice mode
|
|
72304
72597
|
|
|
72305
72598
|
if (multiple) {
|
|
72306
72599
|
style = {
|
|
72307
72600
|
width: inputValue ? "".concat(inputValue.length * 16, "px") : '2px'
|
|
72308
72601
|
};
|
|
72309
|
-
|
|
72602
|
+
selectInputProps.style = style;
|
|
72310
72603
|
}
|
|
72311
72604
|
|
|
72312
72605
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(input_0, assign_default()({
|
|
72313
72606
|
ref: this.inputRef,
|
|
72314
|
-
size: size
|
|
72315
|
-
}, inputProps, {
|
|
72607
|
+
size: size,
|
|
72316
72608
|
onFocus: e => {
|
|
72317
72609
|
// prevent event bubbling which will fire trigger onFocus event
|
|
72318
72610
|
e.stopPropagation(); // e.nativeEvent.stopImmediatePropagation();
|
|
72319
72611
|
}
|
|
72320
|
-
}));
|
|
72612
|
+
}, selectInputProps));
|
|
72321
72613
|
}
|
|
72322
72614
|
|
|
72323
72615
|
close() {
|
|
@@ -72923,6 +73215,7 @@ select_Select.propTypes = {
|
|
|
72923
73215
|
dropdownStyle: prop_types_default.a.object,
|
|
72924
73216
|
outerTopSlot: prop_types_default.a.node,
|
|
72925
73217
|
innerTopSlot: prop_types_default.a.node,
|
|
73218
|
+
inputProps: prop_types_default.a.object,
|
|
72926
73219
|
outerBottomSlot: prop_types_default.a.node,
|
|
72927
73220
|
innerBottomSlot: prop_types_default.a.node,
|
|
72928
73221
|
optionList: prop_types_default.a.array,
|
|
@@ -74808,7 +75101,7 @@ class rating_item_Item extends external_root_React_commonjs2_react_commonjs_reac
|
|
|
74808
75101
|
height: size,
|
|
74809
75102
|
fontSize: size
|
|
74810
75103
|
} : {};
|
|
74811
|
-
const iconSize = size === 'small' ? 'default' : 'extra-large';
|
|
75104
|
+
const iconSize = isCustomSize ? 'inherit' : size === 'small' ? 'default' : 'extra-large';
|
|
74812
75105
|
const content = character ? character : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconStar, {
|
|
74813
75106
|
size: iconSize
|
|
74814
75107
|
});
|
|
@@ -86762,6 +87055,7 @@ const timeline_constants_strings = {
|
|
|
86762
87055
|
|
|
86763
87056
|
|
|
86764
87057
|
|
|
87058
|
+
|
|
86765
87059
|
const timeline_item_prefixCls = timeline_constants_cssClasses.ITEM;
|
|
86766
87060
|
class timeline_item_Item extends external_root_React_commonjs2_react_commonjs_react_amd_react_["PureComponent"] {
|
|
86767
87061
|
render() {
|
|
@@ -86775,7 +87069,8 @@ class timeline_item_Item extends external_root_React_commonjs2_react_commonjs_re
|
|
|
86775
87069
|
type,
|
|
86776
87070
|
style,
|
|
86777
87071
|
time,
|
|
86778
|
-
extra
|
|
87072
|
+
extra,
|
|
87073
|
+
onClick
|
|
86779
87074
|
} = this.props;
|
|
86780
87075
|
const itemCls = classnames_default()(timeline_item_prefixCls, className);
|
|
86781
87076
|
const dotCls = classnames_default()({
|
|
@@ -86790,7 +87085,8 @@ class timeline_item_Item extends external_root_React_commonjs2_react_commonjs_re
|
|
|
86790
87085
|
} : null;
|
|
86791
87086
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("li", {
|
|
86792
87087
|
className: itemCls,
|
|
86793
|
-
style: style
|
|
87088
|
+
style: style,
|
|
87089
|
+
onClick: onClick
|
|
86794
87090
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
86795
87091
|
className: "".concat(timeline_item_prefixCls, "-tail")
|
|
86796
87092
|
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", assign_default()({
|
|
@@ -86813,11 +87109,13 @@ timeline_item_Item.propTypes = {
|
|
|
86813
87109
|
extra: prop_types_default.a.node,
|
|
86814
87110
|
position: prop_types_default.a.oneOf(timeline_constants_strings.ITEM_POS),
|
|
86815
87111
|
className: prop_types_default.a.string,
|
|
86816
|
-
style: prop_types_default.a.object
|
|
87112
|
+
style: prop_types_default.a.object,
|
|
87113
|
+
onClick: prop_types_default.a.func
|
|
86817
87114
|
};
|
|
86818
87115
|
timeline_item_Item.defaultProps = {
|
|
86819
87116
|
type: 'default',
|
|
86820
|
-
time: ''
|
|
87117
|
+
time: '',
|
|
87118
|
+
onClick: noop_default.a
|
|
86821
87119
|
};
|
|
86822
87120
|
// CONCATENATED MODULE: ./timeline/index.tsx
|
|
86823
87121
|
|
|
@@ -93967,6 +94265,113 @@ class foundation_UploadFoundation extends foundation {
|
|
|
93967
94265
|
this.startUpload(currentFiles);
|
|
93968
94266
|
}
|
|
93969
94267
|
});
|
|
94268
|
+
} // 插入多个文件到指定位置
|
|
94269
|
+
// Insert files to the specified location
|
|
94270
|
+
|
|
94271
|
+
|
|
94272
|
+
insertFileToList(files, index) {
|
|
94273
|
+
const {
|
|
94274
|
+
limit,
|
|
94275
|
+
transformFile,
|
|
94276
|
+
accept,
|
|
94277
|
+
uploadTrigger
|
|
94278
|
+
} = this.getProps();
|
|
94279
|
+
const {
|
|
94280
|
+
fileList
|
|
94281
|
+
} = this.getStates();
|
|
94282
|
+
const unAcceptFileList = []; // 当次选中的文件
|
|
94283
|
+
// current selected file
|
|
94284
|
+
|
|
94285
|
+
let currentFileList = from_default()(files);
|
|
94286
|
+
|
|
94287
|
+
if (typeof accept !== 'undefined') {
|
|
94288
|
+
currentFileList = filter_default()(currentFileList).call(currentFileList, item => {
|
|
94289
|
+
const isValid = this.checkFileFormat(accept, item);
|
|
94290
|
+
|
|
94291
|
+
if (!isValid) {
|
|
94292
|
+
unAcceptFileList.push(item);
|
|
94293
|
+
}
|
|
94294
|
+
|
|
94295
|
+
return isValid;
|
|
94296
|
+
});
|
|
94297
|
+
|
|
94298
|
+
if (unAcceptFileList.length !== 0) {
|
|
94299
|
+
this._adapter.notifyAcceptInvalid(unAcceptFileList);
|
|
94300
|
+
}
|
|
94301
|
+
|
|
94302
|
+
if (currentFileList.length === 0) {
|
|
94303
|
+
return;
|
|
94304
|
+
}
|
|
94305
|
+
}
|
|
94306
|
+
|
|
94307
|
+
currentFileList = map_default()(currentFileList).call(currentFileList, file => {
|
|
94308
|
+
if (!file.uid) {
|
|
94309
|
+
file.uid = getUuidv4();
|
|
94310
|
+
}
|
|
94311
|
+
|
|
94312
|
+
if (this.checkFileSize(file)) {
|
|
94313
|
+
file._sizeInvalid = true;
|
|
94314
|
+
file.status = FILE_STATUS_VALID_FAIL;
|
|
94315
|
+
|
|
94316
|
+
this._adapter.notifySizeError(file, fileList);
|
|
94317
|
+
}
|
|
94318
|
+
|
|
94319
|
+
if (transformFile) {
|
|
94320
|
+
file = transformFile(file);
|
|
94321
|
+
}
|
|
94322
|
+
|
|
94323
|
+
return file;
|
|
94324
|
+
});
|
|
94325
|
+
const total = fileList.length + currentFileList.length;
|
|
94326
|
+
|
|
94327
|
+
if (typeof limit !== 'undefined') {
|
|
94328
|
+
// 判断是否超出限制
|
|
94329
|
+
// Determine whether the limit is exceeded
|
|
94330
|
+
if (total > limit) {
|
|
94331
|
+
if (limit === 1) {
|
|
94332
|
+
// 使用最后面的文件对当前文件进行替换
|
|
94333
|
+
// Use the last file to replace the current file
|
|
94334
|
+
currentFileList = slice_default()(currentFileList).call(currentFileList, -1);
|
|
94335
|
+
|
|
94336
|
+
this._adapter.notifyFileSelect(currentFileList);
|
|
94337
|
+
|
|
94338
|
+
this._adapter.resetInput();
|
|
94339
|
+
|
|
94340
|
+
this.replaceFileList(currentFileList);
|
|
94341
|
+
return;
|
|
94342
|
+
} // 如果超出了限制,则计算还能添加几个文件,将剩余的文件继续上传
|
|
94343
|
+
// If the limit is exceeded, several files can be added to the calculation, and the remaining files will continue to be uploaded
|
|
94344
|
+
|
|
94345
|
+
|
|
94346
|
+
const restNum = limit - fileList.length;
|
|
94347
|
+
currentFileList = slice_default()(currentFileList).call(currentFileList, 0, restNum);
|
|
94348
|
+
|
|
94349
|
+
this._adapter.notifyExceed(currentFileList);
|
|
94350
|
+
}
|
|
94351
|
+
}
|
|
94352
|
+
|
|
94353
|
+
const fileItemList = map_default()(currentFileList).call(currentFileList, file => this.buildFileItem(file, uploadTrigger));
|
|
94354
|
+
|
|
94355
|
+
const newFileList = slice_default()(fileList).call(fileList);
|
|
94356
|
+
|
|
94357
|
+
if (typeof index !== 'undefined') {
|
|
94358
|
+
splice_default()(newFileList).call(newFileList, index, 0, ...fileItemList);
|
|
94359
|
+
} else {
|
|
94360
|
+
newFileList.push(...fileItemList);
|
|
94361
|
+
}
|
|
94362
|
+
|
|
94363
|
+
this._adapter.notifyFileSelect(currentFileList);
|
|
94364
|
+
|
|
94365
|
+
this._adapter.notifyChange({
|
|
94366
|
+
fileList: newFileList,
|
|
94367
|
+
currentFile: null
|
|
94368
|
+
});
|
|
94369
|
+
|
|
94370
|
+
this._adapter.updateFileList(newFileList, () => {
|
|
94371
|
+
if (uploadTrigger === foundation_TRIGGER_AUTO) {
|
|
94372
|
+
this.startUpload(fileItemList);
|
|
94373
|
+
}
|
|
94374
|
+
});
|
|
93970
94375
|
}
|
|
93971
94376
|
|
|
93972
94377
|
manualUpload() {
|
|
@@ -94836,16 +95241,23 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
94836
95241
|
status,
|
|
94837
95242
|
disabled,
|
|
94838
95243
|
style,
|
|
94839
|
-
onPreviewClick
|
|
95244
|
+
onPreviewClick,
|
|
95245
|
+
showPicInfo,
|
|
95246
|
+
renderPicInfo,
|
|
95247
|
+
renderThumbnail,
|
|
95248
|
+
name,
|
|
95249
|
+
index
|
|
94840
95250
|
} = this.props;
|
|
95251
|
+
const showProgress = status === upload_constants_strings.FILE_STATUS_UPLOADING && percent !== 100;
|
|
95252
|
+
const showRetry = status === upload_constants_strings.FILE_STATUS_UPLOAD_FAIL && this.props.showRetry;
|
|
95253
|
+
const showReplace = status === upload_constants_strings.FILE_STATUS_SUCCESS && this.props.showReplace;
|
|
94841
95254
|
const filePicCardCls = classnames_default()({
|
|
94842
95255
|
["".concat(fileCard_prefixCls, "-picture-file-card")]: true,
|
|
94843
95256
|
["".concat(fileCard_prefixCls, "-picture-file-card-disabled")]: disabled,
|
|
94844
|
-
["".concat(fileCard_prefixCls, "-picture-file-card-show-pointer")]: typeof onPreviewClick !== 'undefined'
|
|
95257
|
+
["".concat(fileCard_prefixCls, "-picture-file-card-show-pointer")]: typeof onPreviewClick !== 'undefined',
|
|
95258
|
+
["".concat(fileCard_prefixCls, "-picture-file-card-error")]: status === upload_constants_strings.FILE_STATUS_UPLOAD_FAIL,
|
|
95259
|
+
["".concat(fileCard_prefixCls, "-picture-file-card-uploading")]: showProgress
|
|
94845
95260
|
});
|
|
94846
|
-
const showProgress = status === upload_constants_strings.FILE_STATUS_UPLOADING && percent !== 100;
|
|
94847
|
-
const showRetry = status === upload_constants_strings.FILE_STATUS_UPLOAD_FAIL && this.props.showRetry;
|
|
94848
|
-
const showReplace = status === upload_constants_strings.FILE_STATUS_SUCCESS && this.props.showReplace;
|
|
94849
95261
|
const closeCls = "".concat(fileCard_prefixCls, "-picture-file-card-close");
|
|
94850
95262
|
const retry = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
94851
95263
|
className: "".concat(fileCard_prefixCls, "-picture-file-card-retry"),
|
|
@@ -94865,47 +95277,38 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
94865
95277
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(ReplaceSvg, {
|
|
94866
95278
|
className: "".concat(fileCard_prefixCls, "-picture-file-card-icon-replace")
|
|
94867
95279
|
})));
|
|
95280
|
+
const picInfo = typeof renderPicInfo === 'function' ? renderPicInfo(this.props) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
95281
|
+
className: "".concat(fileCard_prefixCls, "-picture-file-card-pic-info")
|
|
95282
|
+
}, index + 1);
|
|
95283
|
+
const thumbnail = typeof renderThumbnail === 'function' ? renderThumbnail(this.props) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("img", {
|
|
95284
|
+
src: url,
|
|
95285
|
+
alt: "picture of ".concat(name)
|
|
95286
|
+
});
|
|
94868
95287
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
94869
95288
|
className: filePicCardCls,
|
|
94870
95289
|
style: style,
|
|
94871
95290
|
onClick: onPreviewClick
|
|
94872
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
|
94873
|
-
src: url
|
|
94874
|
-
}), showProgress ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(progress_0, {
|
|
95291
|
+
}, thumbnail, showProgress ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(progress_0, {
|
|
94875
95292
|
percent: percent,
|
|
94876
95293
|
type: "circle",
|
|
94877
95294
|
size: "small",
|
|
94878
95295
|
orbitStroke: '#FFF'
|
|
94879
|
-
}) : null, showRetry ? retry : null, showReplace && replace,
|
|
94880
|
-
className: closeCls
|
|
94881
|
-
onClick: e => this.onRemove(e)
|
|
95296
|
+
}) : null, showRetry ? retry : null, showReplace && replace, showPicInfo && picInfo, !disabled && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
95297
|
+
className: closeCls
|
|
94882
95298
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, {
|
|
94883
|
-
size: "extra-small"
|
|
95299
|
+
size: "extra-small",
|
|
95300
|
+
onClick: e => this.onRemove(e)
|
|
94884
95301
|
})), this.renderPicValidateMsg());
|
|
94885
95302
|
}
|
|
94886
95303
|
|
|
94887
|
-
|
|
94888
|
-
e.stopPropagation();
|
|
94889
|
-
this.props.onRemove(this.props, e);
|
|
94890
|
-
}
|
|
94891
|
-
|
|
94892
|
-
onReplace(e) {
|
|
94893
|
-
e.stopPropagation();
|
|
94894
|
-
this.props.onReplace(this.props, e);
|
|
94895
|
-
}
|
|
94896
|
-
|
|
94897
|
-
onRetry(e) {
|
|
94898
|
-
e.stopPropagation();
|
|
94899
|
-
this.props.onRetry(this.props, e);
|
|
94900
|
-
}
|
|
94901
|
-
|
|
94902
|
-
render() {
|
|
95304
|
+
renderFile(locale) {
|
|
94903
95305
|
const {
|
|
94904
95306
|
name,
|
|
94905
95307
|
size,
|
|
94906
95308
|
percent,
|
|
94907
95309
|
url,
|
|
94908
|
-
|
|
95310
|
+
showRetry: propsShowRetry,
|
|
95311
|
+
showReplace: propsShowReplace,
|
|
94909
95312
|
preview,
|
|
94910
95313
|
previewFile,
|
|
94911
95314
|
status,
|
|
@@ -94926,15 +95329,8 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
94926
95329
|
const replaceCls = "".concat(fileCard_prefixCls, "-file-card-replace");
|
|
94927
95330
|
const showProgress = !(percent === 100 || typeof percent === 'undefined') && status === upload_constants_strings.FILE_STATUS_UPLOADING; // only show retry when upload fail & showRetry is true, no need to show during validate fail
|
|
94928
95331
|
|
|
94929
|
-
const showRetry = status === upload_constants_strings.FILE_STATUS_UPLOAD_FAIL &&
|
|
94930
|
-
const showReplace = status === upload_constants_strings.FILE_STATUS_SUCCESS &&
|
|
94931
|
-
|
|
94932
|
-
if (listType === upload_constants_strings.FILE_LIST_PIC) {
|
|
94933
|
-
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(localeConsumer_LocaleConsumer, {
|
|
94934
|
-
componentName: "Upload"
|
|
94935
|
-
}, locale => this.renderPic(locale));
|
|
94936
|
-
}
|
|
94937
|
-
|
|
95332
|
+
const showRetry = status === upload_constants_strings.FILE_STATUS_UPLOAD_FAIL && propsShowRetry;
|
|
95333
|
+
const showReplace = status === upload_constants_strings.FILE_STATUS_SUCCESS && propsShowReplace;
|
|
94938
95334
|
const fileSize = this.transSize(size);
|
|
94939
95335
|
let previewContent = preview ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("img", {
|
|
94940
95336
|
src: url
|
|
@@ -94946,9 +95342,7 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
94946
95342
|
previewContent = previewFile(this.props);
|
|
94947
95343
|
}
|
|
94948
95344
|
|
|
94949
|
-
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
|
94950
|
-
componentName: "Upload"
|
|
94951
|
-
}, locale => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
95345
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
94952
95346
|
className: fileCardCls,
|
|
94953
95347
|
style: style,
|
|
94954
95348
|
onClick: onPreviewClick
|
|
@@ -94993,7 +95387,42 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
94993
95387
|
theme: "borderless",
|
|
94994
95388
|
size: "small",
|
|
94995
95389
|
className: closeCls
|
|
94996
|
-
}))
|
|
95390
|
+
}));
|
|
95391
|
+
}
|
|
95392
|
+
|
|
95393
|
+
onRemove(e) {
|
|
95394
|
+
e.stopPropagation();
|
|
95395
|
+
this.props.onRemove(this.props, e);
|
|
95396
|
+
}
|
|
95397
|
+
|
|
95398
|
+
onReplace(e) {
|
|
95399
|
+
e.stopPropagation();
|
|
95400
|
+
this.props.onReplace(this.props, e);
|
|
95401
|
+
}
|
|
95402
|
+
|
|
95403
|
+
onRetry(e) {
|
|
95404
|
+
e.stopPropagation();
|
|
95405
|
+
this.props.onRetry(this.props, e);
|
|
95406
|
+
}
|
|
95407
|
+
|
|
95408
|
+
render() {
|
|
95409
|
+
const {
|
|
95410
|
+
listType
|
|
95411
|
+
} = this.props;
|
|
95412
|
+
|
|
95413
|
+
if (listType === upload_constants_strings.FILE_LIST_PIC) {
|
|
95414
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(localeConsumer_LocaleConsumer, {
|
|
95415
|
+
componentName: "Upload"
|
|
95416
|
+
}, locale => this.renderPic(locale));
|
|
95417
|
+
}
|
|
95418
|
+
|
|
95419
|
+
if (listType === upload_constants_strings.FILE_LIST_DEFAULT) {
|
|
95420
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(localeConsumer_LocaleConsumer, {
|
|
95421
|
+
componentName: "Upload"
|
|
95422
|
+
}, locale => this.renderFile(locale));
|
|
95423
|
+
}
|
|
95424
|
+
|
|
95425
|
+
return null;
|
|
94997
95426
|
}
|
|
94998
95427
|
|
|
94999
95428
|
}
|
|
@@ -95016,7 +95445,8 @@ fileCard_FileCard.propTypes = {
|
|
|
95016
95445
|
status: prop_types_default.a.string,
|
|
95017
95446
|
style: prop_types_default.a.object,
|
|
95018
95447
|
url: prop_types_default.a.string,
|
|
95019
|
-
validateMessage: prop_types_default.a.node
|
|
95448
|
+
validateMessage: prop_types_default.a.node,
|
|
95449
|
+
index: prop_types_default.a.number
|
|
95020
95450
|
};
|
|
95021
95451
|
fileCard_FileCard.defaultProps = {
|
|
95022
95452
|
listType: upload_constants_strings.FILE_LIST_DEFAULT,
|
|
@@ -95107,6 +95537,23 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
95107
95537
|
this.remove = fileItem => {
|
|
95108
95538
|
this.foundation.handleRemove(fileItem);
|
|
95109
95539
|
};
|
|
95540
|
+
/**
|
|
95541
|
+
* ref method
|
|
95542
|
+
* insert files at index
|
|
95543
|
+
* @param files Array<CustomFile>
|
|
95544
|
+
* @param index number
|
|
95545
|
+
* @returns
|
|
95546
|
+
*/
|
|
95547
|
+
|
|
95548
|
+
|
|
95549
|
+
this.insert = (files, index) => {
|
|
95550
|
+
return this.foundation.insertFileToList(files, index);
|
|
95551
|
+
};
|
|
95552
|
+
/**
|
|
95553
|
+
* ref method
|
|
95554
|
+
* manual upload by user
|
|
95555
|
+
*/
|
|
95556
|
+
|
|
95110
95557
|
|
|
95111
95558
|
this.upload = () => {
|
|
95112
95559
|
const {
|
|
@@ -95122,14 +95569,18 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
95122
95569
|
name,
|
|
95123
95570
|
status,
|
|
95124
95571
|
validateMessage,
|
|
95125
|
-
_sizeInvalid
|
|
95572
|
+
_sizeInvalid,
|
|
95573
|
+
uid
|
|
95126
95574
|
} = file;
|
|
95127
95575
|
const {
|
|
95128
95576
|
previewFile,
|
|
95129
95577
|
listType,
|
|
95130
95578
|
itemStyle,
|
|
95131
95579
|
showRetry,
|
|
95580
|
+
showPicInfo,
|
|
95581
|
+
renderPicInfo,
|
|
95132
95582
|
renderFileItem,
|
|
95583
|
+
renderThumbnail,
|
|
95133
95584
|
disabled,
|
|
95134
95585
|
onPreviewClick,
|
|
95135
95586
|
showReplace
|
|
@@ -95150,10 +95601,14 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
95150
95601
|
listType,
|
|
95151
95602
|
onRemove,
|
|
95152
95603
|
onRetry,
|
|
95153
|
-
|
|
95604
|
+
index,
|
|
95605
|
+
key: uid || concat_default()(_context = "".concat(name)).call(_context, index),
|
|
95154
95606
|
showRetry: typeof file.showRetry !== 'undefined' ? file.showRetry : showRetry,
|
|
95155
95607
|
style: itemStyle,
|
|
95156
95608
|
disabled,
|
|
95609
|
+
showPicInfo,
|
|
95610
|
+
renderPicInfo,
|
|
95611
|
+
renderThumbnail,
|
|
95157
95612
|
showReplace: typeof file.showReplace !== 'undefined' ? file.showReplace : showReplace,
|
|
95158
95613
|
onReplace,
|
|
95159
95614
|
onPreviewClick: typeof onPreviewClick !== 'undefined' ? () => this.foundation.handlePreviewClick(file) : undefined
|
|
@@ -95175,27 +95630,69 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
95175
95630
|
};
|
|
95176
95631
|
|
|
95177
95632
|
this.renderFileList = () => {
|
|
95633
|
+
const {
|
|
95634
|
+
listType
|
|
95635
|
+
} = this.props;
|
|
95636
|
+
|
|
95637
|
+
if (listType === upload_constants_strings.FILE_LIST_PIC) {
|
|
95638
|
+
return this.renderFileListPic();
|
|
95639
|
+
}
|
|
95640
|
+
|
|
95641
|
+
if (listType === upload_constants_strings.FILE_LIST_DEFAULT) {
|
|
95642
|
+
return this.renderFileListDefault();
|
|
95643
|
+
}
|
|
95644
|
+
|
|
95645
|
+
return null;
|
|
95646
|
+
};
|
|
95647
|
+
|
|
95648
|
+
this.renderFileListPic = () => {
|
|
95178
95649
|
const {
|
|
95179
95650
|
showUploadList,
|
|
95180
|
-
listType,
|
|
95181
95651
|
limit,
|
|
95182
95652
|
disabled,
|
|
95183
|
-
children
|
|
95653
|
+
children,
|
|
95654
|
+
draggable
|
|
95184
95655
|
} = this.props;
|
|
95185
95656
|
const {
|
|
95186
|
-
fileList: stateFileList
|
|
95657
|
+
fileList: stateFileList,
|
|
95658
|
+
dragAreaStatus
|
|
95187
95659
|
} = this.state;
|
|
95188
95660
|
const fileList = this.props.fileList || stateFileList;
|
|
95189
|
-
const
|
|
95190
|
-
const
|
|
95661
|
+
const showAddTriggerInList = limit ? limit > fileList.length : true;
|
|
95662
|
+
const dragAreaBaseCls = "".concat(upload_prefixCls, "-drag-area");
|
|
95191
95663
|
const uploadAddCls = classnames_default()("".concat(upload_prefixCls, "-add"), {
|
|
95192
|
-
["".concat(upload_prefixCls, "-picture-add")]:
|
|
95664
|
+
["".concat(upload_prefixCls, "-picture-add")]: true,
|
|
95193
95665
|
["".concat(upload_prefixCls, "-picture-add-disabled")]: disabled
|
|
95194
95666
|
});
|
|
95195
|
-
const
|
|
95667
|
+
const fileListCls = classnames_default()("".concat(upload_prefixCls, "-file-list"), {
|
|
95668
|
+
["".concat(upload_prefixCls, "-picture-file-list")]: true
|
|
95669
|
+
});
|
|
95670
|
+
const dragAreaCls = classnames_default()({
|
|
95671
|
+
["".concat(dragAreaBaseCls, "-legal")]: dragAreaStatus === upload_constants_strings.DRAG_AREA_LEGAL,
|
|
95672
|
+
["".concat(dragAreaBaseCls, "-illegal")]: dragAreaStatus === upload_constants_strings.DRAG_AREA_ILLEGAL
|
|
95673
|
+
});
|
|
95674
|
+
const mainCls = "".concat(upload_prefixCls, "-file-list-main");
|
|
95675
|
+
const addContentProps = {
|
|
95196
95676
|
className: uploadAddCls,
|
|
95197
95677
|
onClick: this.onClick
|
|
95198
|
-
}
|
|
95678
|
+
};
|
|
95679
|
+
const containerProps = {
|
|
95680
|
+
className: fileListCls
|
|
95681
|
+
};
|
|
95682
|
+
const draggableProps = {
|
|
95683
|
+
onDrop: this.onDrop,
|
|
95684
|
+
onDragOver: this.onDragOver,
|
|
95685
|
+
onDragLeave: this.onDragLeave,
|
|
95686
|
+
onDragEnter: this.onDragEnter
|
|
95687
|
+
};
|
|
95688
|
+
|
|
95689
|
+
if (draggable) {
|
|
95690
|
+
assign_default()(addContentProps, draggableProps, {
|
|
95691
|
+
className: classnames_default()(uploadAddCls, dragAreaCls)
|
|
95692
|
+
});
|
|
95693
|
+
}
|
|
95694
|
+
|
|
95695
|
+
const addContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", assign_default()({}, addContentProps), children);
|
|
95199
95696
|
|
|
95200
95697
|
if (!showUploadList || !fileList.length) {
|
|
95201
95698
|
if (showAddTriggerInList) {
|
|
@@ -95205,18 +95702,39 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
95205
95702
|
return null;
|
|
95206
95703
|
}
|
|
95207
95704
|
|
|
95208
|
-
|
|
95209
|
-
|
|
95210
|
-
})
|
|
95705
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(localeConsumer_LocaleConsumer, {
|
|
95706
|
+
componentName: "Upload"
|
|
95707
|
+
}, locale => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", assign_default()({}, containerProps), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
95708
|
+
className: mainCls
|
|
95709
|
+
}, map_default()(fileList).call(fileList, (file, index) => this.renderFile(file, index, locale)), showAddTriggerInList ? addContent : null)));
|
|
95710
|
+
};
|
|
95711
|
+
|
|
95712
|
+
this.renderFileListDefault = () => {
|
|
95713
|
+
const {
|
|
95714
|
+
showUploadList,
|
|
95715
|
+
limit,
|
|
95716
|
+
disabled
|
|
95717
|
+
} = this.props;
|
|
95718
|
+
const {
|
|
95719
|
+
fileList: stateFileList
|
|
95720
|
+
} = this.state;
|
|
95721
|
+
const fileList = this.props.fileList || stateFileList;
|
|
95722
|
+
const fileListCls = classnames_default()("".concat(upload_prefixCls, "-file-list"));
|
|
95211
95723
|
const titleCls = "".concat(upload_prefixCls, "-file-list-title");
|
|
95212
95724
|
const mainCls = "".concat(upload_prefixCls, "-file-list-main");
|
|
95213
|
-
const showTitle = limit !== 1 && fileList.length
|
|
95725
|
+
const showTitle = limit !== 1 && fileList.length;
|
|
95214
95726
|
const showClear = this.props.showClear && !disabled;
|
|
95727
|
+
const containerProps = {
|
|
95728
|
+
className: fileListCls
|
|
95729
|
+
};
|
|
95730
|
+
|
|
95731
|
+
if (!showUploadList || !fileList.length) {
|
|
95732
|
+
return null;
|
|
95733
|
+
}
|
|
95734
|
+
|
|
95215
95735
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(localeConsumer_LocaleConsumer, {
|
|
95216
95736
|
componentName: "Upload"
|
|
95217
|
-
}, locale => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
95218
|
-
className: fileListCls
|
|
95219
|
-
}, showTitle ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
95737
|
+
}, locale => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", assign_default()({}, containerProps), showTitle ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
95220
95738
|
className: titleCls
|
|
95221
95739
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
95222
95740
|
className: "".concat(titleCls, "-choosen")
|
|
@@ -95225,7 +95743,7 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
95225
95743
|
className: "".concat(titleCls, "-clear")
|
|
95226
95744
|
}, locale.clear) : null) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
95227
95745
|
className: mainCls
|
|
95228
|
-
}, map_default()(fileList).call(fileList, (file, index) => this.renderFile(file, index, locale))
|
|
95746
|
+
}, map_default()(fileList).call(fileList, (file, index) => this.renderFile(file, index, locale)))));
|
|
95229
95747
|
};
|
|
95230
95748
|
|
|
95231
95749
|
this.onDrop = e => {
|
|
@@ -95245,6 +95763,28 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
95245
95763
|
this.foundation.handleDragEnter(e);
|
|
95246
95764
|
};
|
|
95247
95765
|
|
|
95766
|
+
this.renderAddContent = () => {
|
|
95767
|
+
const {
|
|
95768
|
+
draggable,
|
|
95769
|
+
children,
|
|
95770
|
+
listType
|
|
95771
|
+
} = this.props;
|
|
95772
|
+
const uploadAddCls = classnames_default()("".concat(upload_prefixCls, "-add"));
|
|
95773
|
+
|
|
95774
|
+
if (listType === upload_constants_strings.FILE_LIST_PIC) {
|
|
95775
|
+
return null;
|
|
95776
|
+
}
|
|
95777
|
+
|
|
95778
|
+
if (draggable) {
|
|
95779
|
+
return this.renderDragArea();
|
|
95780
|
+
}
|
|
95781
|
+
|
|
95782
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
95783
|
+
className: uploadAddCls,
|
|
95784
|
+
onClick: this.onClick
|
|
95785
|
+
}, children);
|
|
95786
|
+
};
|
|
95787
|
+
|
|
95248
95788
|
this.renderDragArea = () => {
|
|
95249
95789
|
const {
|
|
95250
95790
|
dragAreaStatus
|
|
@@ -95431,7 +95971,6 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
95431
95971
|
["".concat(upload_prefixCls, "-warning")]: validateStatus === 'warning',
|
|
95432
95972
|
["".concat(upload_prefixCls, "-success")]: validateStatus === 'success'
|
|
95433
95973
|
}, className);
|
|
95434
|
-
const uploadAddCls = classnames_default()("".concat(upload_prefixCls, "-add"));
|
|
95435
95974
|
const inputCls = classnames_default()("".concat(upload_prefixCls, "-hidden-input"));
|
|
95436
95975
|
const inputReplaceCls = classnames_default()("".concat(upload_prefixCls, "-hidden-input-replace"));
|
|
95437
95976
|
const promptCls = classnames_default()("".concat(upload_prefixCls, "-prompt"));
|
|
@@ -95440,10 +95979,6 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
95440
95979
|
directory: 'directory',
|
|
95441
95980
|
webkitdirectory: 'webkitdirectory'
|
|
95442
95981
|
} : {};
|
|
95443
|
-
const addContent = listType !== upload_constants_strings.FILE_LIST_PIC ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
95444
|
-
className: uploadAddCls,
|
|
95445
|
-
onClick: this.onClick
|
|
95446
|
-
}, children) : null;
|
|
95447
95982
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
95448
95983
|
className: uploadCls,
|
|
95449
95984
|
style: style,
|
|
@@ -95469,7 +96004,7 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
95469
96004
|
tabIndex: -1,
|
|
95470
96005
|
className: inputReplaceCls,
|
|
95471
96006
|
ref: this.replaceInputRef
|
|
95472
|
-
}),
|
|
96007
|
+
}), this.renderAddContent(), prompt ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
95473
96008
|
className: promptCls
|
|
95474
96009
|
}, prompt) : null, validateMessage ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
95475
96010
|
className: validateMsgCls
|
|
@@ -95524,7 +96059,10 @@ upload_Upload.propTypes = {
|
|
|
95524
96059
|
prompt: prop_types_default.a.node,
|
|
95525
96060
|
promptPosition: prop_types_default.a.oneOf(upload_constants_strings.PROMPT_POSITION),
|
|
95526
96061
|
renderFileItem: prop_types_default.a.func,
|
|
96062
|
+
renderPicInfo: prop_types_default.a.func,
|
|
96063
|
+
renderThumbnail: prop_types_default.a.func,
|
|
95527
96064
|
showClear: prop_types_default.a.bool,
|
|
96065
|
+
showPicInfo: prop_types_default.a.bool,
|
|
95528
96066
|
showReplace: prop_types_default.a.bool,
|
|
95529
96067
|
showRetry: prop_types_default.a.bool,
|
|
95530
96068
|
showUploadList: prop_types_default.a.bool,
|
|
@@ -95558,6 +96096,7 @@ upload_Upload.defaultProps = {
|
|
|
95558
96096
|
onSuccess: noop_default.a,
|
|
95559
96097
|
promptPosition: 'right',
|
|
95560
96098
|
showClear: true,
|
|
96099
|
+
showPicInfo: false,
|
|
95561
96100
|
showReplace: false,
|
|
95562
96101
|
showRetry: true,
|
|
95563
96102
|
showUploadList: true,
|