@douyinfe/semi-ui 2.4.1 → 2.5.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/cascader/__test__/cascader.test.js +24 -0
- package/cascader/_story/cascader.stories.js +73 -0
- package/cascader/index.tsx +5 -2
- package/dist/css/semi.css +50 -27
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +398 -139
- 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/autoComplete/index.d.ts +1 -1
- package/lib/cjs/cascader/index.js +6 -0
- package/lib/cjs/dropdown/index.d.ts +1 -1
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/select/index.d.ts +1 -1
- package/lib/cjs/select/option.js +2 -2
- package/lib/cjs/table/Table.d.ts +1 -1
- package/lib/cjs/table/Table.js +8 -2
- package/lib/cjs/table/interface.d.ts +1 -0
- package/lib/cjs/tabs/interface.d.ts +1 -1
- package/lib/cjs/tooltip/index.d.ts +1 -1
- package/lib/cjs/tree/index.d.ts +2 -0
- package/lib/cjs/tree/index.js +15 -8
- package/lib/cjs/treeSelect/index.d.ts +2 -0
- package/lib/cjs/treeSelect/index.js +64 -27
- package/lib/cjs/upload/fileCard.js +31 -22
- package/lib/cjs/upload/index.d.ts +6 -0
- package/lib/cjs/upload/index.js +15 -8
- package/lib/cjs/upload/interface.d.ts +8 -6
- package/lib/es/autoComplete/index.d.ts +1 -1
- package/lib/es/cascader/index.js +5 -0
- package/lib/es/dropdown/index.d.ts +1 -1
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/select/index.d.ts +1 -1
- package/lib/es/select/option.js +2 -2
- package/lib/es/table/Table.d.ts +1 -1
- package/lib/es/table/Table.js +10 -2
- package/lib/es/table/interface.d.ts +1 -0
- package/lib/es/tabs/interface.d.ts +1 -1
- package/lib/es/tooltip/index.d.ts +1 -1
- package/lib/es/tree/index.d.ts +2 -0
- package/lib/es/tree/index.js +15 -8
- package/lib/es/treeSelect/index.d.ts +2 -0
- package/lib/es/treeSelect/index.js +64 -27
- package/lib/es/upload/fileCard.js +31 -24
- package/lib/es/upload/index.d.ts +6 -0
- package/lib/es/upload/index.js +14 -8
- package/lib/es/upload/interface.d.ts +8 -6
- package/package.json +9 -9
- package/select/option.tsx +2 -2
- package/table/Table.tsx +7 -2
- package/table/_story/table.stories.js +1 -2
- package/table/_story/v2/FixedHeaderMerge/index.jsx +98 -0
- package/table/_story/v2/defaultFilteredValue.tsx +123 -0
- package/table/_story/v2/index.js +4 -0
- package/table/interface.ts +1 -0
- package/tabs/interface.ts +1 -1
- package/tooltip/_story/tooltip.stories.js +83 -1
- package/tree/__test__/treeMultiple.test.js +94 -0
- package/tree/_story/tree.stories.js +169 -0
- package/tree/index.tsx +12 -5
- package/treeSelect/__test__/treeMultiple.test.js +94 -0
- package/treeSelect/_story/treeSelect.stories.js +242 -0
- package/treeSelect/index.tsx +72 -40
- package/upload/_story/upload.stories.js +22 -6
- package/upload/fileCard.tsx +23 -23
- package/upload/index.tsx +15 -6
- package/upload/interface.ts +7 -5
package/dist/umd/semi-ui.js
CHANGED
|
@@ -24257,6 +24257,19 @@ class foundation_Tooltip extends foundation {
|
|
|
24257
24257
|
translateX = -1;
|
|
24258
24258
|
break;
|
|
24259
24259
|
|
|
24260
|
+
case 'leftBottomOver':
|
|
24261
|
+
left = triggerRect.left;
|
|
24262
|
+
top = triggerRect.bottom;
|
|
24263
|
+
translateY = -1;
|
|
24264
|
+
break;
|
|
24265
|
+
|
|
24266
|
+
case 'rightBottomOver':
|
|
24267
|
+
left = triggerRect.right;
|
|
24268
|
+
top = triggerRect.bottom;
|
|
24269
|
+
translateX = -1;
|
|
24270
|
+
translateY = -1;
|
|
24271
|
+
break;
|
|
24272
|
+
|
|
24260
24273
|
default:
|
|
24261
24274
|
break;
|
|
24262
24275
|
}
|
|
@@ -24380,12 +24393,16 @@ class foundation_Tooltip extends foundation {
|
|
|
24380
24393
|
|
|
24381
24394
|
const shouldReverseTop = clientTop < wrapperRect.height + spacing && restClientBottom > wrapperRect.height + spacing;
|
|
24382
24395
|
const shouldReverseLeft = clientLeft < wrapperRect.width + spacing && restClientRight > wrapperRect.width + spacing;
|
|
24383
|
-
const
|
|
24396
|
+
const shouldReverseBottom = restClientBottom < wrapperRect.height + spacing && clientTop > wrapperRect.height + spacing;
|
|
24384
24397
|
const shouldReverseRight = restClientRight < wrapperRect.width + spacing && clientLeft > wrapperRect.width + spacing;
|
|
24398
|
+
const shouldReverseTopOver = restClientTop < wrapperRect.height + spacing && clientBottom > wrapperRect.height + spacing;
|
|
24399
|
+
const shouldReverseBottomOver = clientBottom < wrapperRect.height + spacing && restClientTop > wrapperRect.height + spacing;
|
|
24385
24400
|
const shouldReverseTopSide = restClientTop < wrapperRect.height && clientBottom > wrapperRect.height;
|
|
24386
24401
|
const shouldReverseBottomSide = clientBottom < wrapperRect.height && restClientTop > wrapperRect.height;
|
|
24387
24402
|
const shouldReverseLeftSide = restClientLeft < wrapperRect.width && clientRight > wrapperRect.width;
|
|
24388
24403
|
const shouldReverseRightSide = clientRight < wrapperRect.width && restClientLeft > wrapperRect.width;
|
|
24404
|
+
const shouldReverseLeftOver = restClientLeft < wrapperRect.width && clientRight > wrapperRect.width;
|
|
24405
|
+
const shouldReverseRightOver = clientRight < wrapperRect.width && restClientLeft > wrapperRect.width;
|
|
24389
24406
|
|
|
24390
24407
|
switch (position) {
|
|
24391
24408
|
case 'top':
|
|
@@ -24447,14 +24464,14 @@ class foundation_Tooltip extends foundation {
|
|
|
24447
24464
|
break;
|
|
24448
24465
|
|
|
24449
24466
|
case 'bottom':
|
|
24450
|
-
if (
|
|
24467
|
+
if (shouldReverseBottom) {
|
|
24451
24468
|
position = this._reversePos(position, true);
|
|
24452
24469
|
}
|
|
24453
24470
|
|
|
24454
24471
|
break;
|
|
24455
24472
|
|
|
24456
24473
|
case 'bottomLeft':
|
|
24457
|
-
if (
|
|
24474
|
+
if (shouldReverseBottom) {
|
|
24458
24475
|
position = this._reversePos(position, true);
|
|
24459
24476
|
}
|
|
24460
24477
|
|
|
@@ -24465,7 +24482,7 @@ class foundation_Tooltip extends foundation {
|
|
|
24465
24482
|
break;
|
|
24466
24483
|
|
|
24467
24484
|
case 'bottomRight':
|
|
24468
|
-
if (
|
|
24485
|
+
if (shouldReverseBottom) {
|
|
24469
24486
|
position = this._reversePos(position, true);
|
|
24470
24487
|
}
|
|
24471
24488
|
|
|
@@ -24504,6 +24521,50 @@ class foundation_Tooltip extends foundation {
|
|
|
24504
24521
|
|
|
24505
24522
|
break;
|
|
24506
24523
|
|
|
24524
|
+
case 'leftTopOver':
|
|
24525
|
+
if (shouldReverseTopOver) {
|
|
24526
|
+
position = this._reversePos(position, true);
|
|
24527
|
+
}
|
|
24528
|
+
|
|
24529
|
+
if (shouldReverseLeftOver) {
|
|
24530
|
+
position = this._reversePos(position);
|
|
24531
|
+
}
|
|
24532
|
+
|
|
24533
|
+
break;
|
|
24534
|
+
|
|
24535
|
+
case 'leftBottomOver':
|
|
24536
|
+
if (shouldReverseBottomOver) {
|
|
24537
|
+
position = this._reversePos(position, true);
|
|
24538
|
+
}
|
|
24539
|
+
|
|
24540
|
+
if (shouldReverseLeftOver) {
|
|
24541
|
+
position = this._reversePos(position);
|
|
24542
|
+
}
|
|
24543
|
+
|
|
24544
|
+
break;
|
|
24545
|
+
|
|
24546
|
+
case 'rightTopOver':
|
|
24547
|
+
if (shouldReverseTopOver) {
|
|
24548
|
+
position = this._reversePos(position, true);
|
|
24549
|
+
}
|
|
24550
|
+
|
|
24551
|
+
if (shouldReverseRightOver) {
|
|
24552
|
+
position = this._reversePos(position);
|
|
24553
|
+
}
|
|
24554
|
+
|
|
24555
|
+
break;
|
|
24556
|
+
|
|
24557
|
+
case 'rightBottomOver':
|
|
24558
|
+
if (shouldReverseBottomOver) {
|
|
24559
|
+
position = this._reversePos(position, true);
|
|
24560
|
+
}
|
|
24561
|
+
|
|
24562
|
+
if (shouldReverseRightOver) {
|
|
24563
|
+
position = this._reversePos(position);
|
|
24564
|
+
}
|
|
24565
|
+
|
|
24566
|
+
break;
|
|
24567
|
+
|
|
24507
24568
|
default:
|
|
24508
24569
|
break;
|
|
24509
24570
|
}
|
|
@@ -24533,7 +24594,7 @@ const tooltip_constants_cssClasses = {
|
|
|
24533
24594
|
PREFIX: "".concat(BASE_CLASS_PREFIX, "-tooltip")
|
|
24534
24595
|
};
|
|
24535
24596
|
const tooltip_constants_strings = {
|
|
24536
|
-
POSITION_SET: ['top', 'topLeft', 'topRight', 'left', 'leftTop', 'leftBottom', 'right', 'rightTop', 'rightBottom', 'bottom', 'bottomLeft', 'bottomRight', 'leftTopOver', 'rightTopOver'],
|
|
24597
|
+
POSITION_SET: ['top', 'topLeft', 'topRight', 'left', 'leftTop', 'leftBottom', 'right', 'rightTop', 'rightBottom', 'bottom', 'bottomLeft', 'bottomRight', 'leftTopOver', 'rightTopOver', 'leftBottomOver', 'rightBottomOver'],
|
|
24537
24598
|
TRIGGER_SET: ['hover', 'focus', 'click', 'custom'],
|
|
24538
24599
|
STATUS_DISABLED: 'disabled',
|
|
24539
24600
|
STATUS_LOADING: 'loading'
|
|
@@ -33915,9 +33976,9 @@ class option_Option extends external_root_React_commonjs2_react_commonjs_react_a
|
|
|
33915
33976
|
const {
|
|
33916
33977
|
props
|
|
33917
33978
|
} = this;
|
|
33918
|
-
const
|
|
33979
|
+
const isDisabled = props.disabled;
|
|
33919
33980
|
|
|
33920
|
-
if (!
|
|
33981
|
+
if (!isDisabled) {
|
|
33921
33982
|
props.onSelect(assign_default()(assign_default()({}, rest), {
|
|
33922
33983
|
value,
|
|
33923
33984
|
label: label || children
|
|
@@ -42911,6 +42972,10 @@ cardGroup_CardGroup.defaultProps = {
|
|
|
42911
42972
|
var lodash_flatten = __webpack_require__("1xil");
|
|
42912
42973
|
var flatten_default = /*#__PURE__*/__webpack_require__.n(lodash_flatten);
|
|
42913
42974
|
|
|
42975
|
+
// EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/lodash/isSet.js
|
|
42976
|
+
var isSet = __webpack_require__("/iLo");
|
|
42977
|
+
var isSet_default = /*#__PURE__*/__webpack_require__.n(isSet);
|
|
42978
|
+
|
|
42914
42979
|
// EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/@babel/runtime-corejs3/core-js-stable/promise.js
|
|
42915
42980
|
var promise = __webpack_require__("kNzS");
|
|
42916
42981
|
var promise_default = /*#__PURE__*/__webpack_require__.n(promise);
|
|
@@ -46868,6 +46933,7 @@ tagInput_TagInput.defaultProps = {
|
|
|
46868
46933
|
|
|
46869
46934
|
|
|
46870
46935
|
|
|
46936
|
+
|
|
46871
46937
|
|
|
46872
46938
|
|
|
46873
46939
|
const cascader_prefixcls = cascader_constants_cssClasses.PREFIX;
|
|
@@ -47560,6 +47626,10 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
47560
47626
|
realKeys = formatKeys;
|
|
47561
47627
|
}
|
|
47562
47628
|
|
|
47629
|
+
if (isSet_default()(realKeys)) {
|
|
47630
|
+
realKeys = [...realKeys];
|
|
47631
|
+
}
|
|
47632
|
+
|
|
47563
47633
|
const calRes = calcCheckedKeys(flatten_default()(realKeys), keyEntities);
|
|
47564
47634
|
const checkedKeys = new set_default.a(calRes.checkedKeys);
|
|
47565
47635
|
const halfCheckedKeys = new set_default.a(calRes.halfCheckedKeys); // disableStrictly
|
|
@@ -54450,10 +54520,6 @@ function addMonths(dirtyDate, dirtyAmount) {
|
|
|
54450
54520
|
return date;
|
|
54451
54521
|
}
|
|
54452
54522
|
}
|
|
54453
|
-
// EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/lodash/isSet.js
|
|
54454
|
-
var isSet = __webpack_require__("/iLo");
|
|
54455
|
-
var isSet_default = /*#__PURE__*/__webpack_require__.n(isSet);
|
|
54456
|
-
|
|
54457
54523
|
// CONCATENATED MODULE: /home/runner/work/semi-design/semi-design/node_modules/date-fns/esm/differenceInCalendarMonths/index.js
|
|
54458
54524
|
|
|
54459
54525
|
|
|
@@ -77388,7 +77454,7 @@ class foundation_SliderFoundation extends foundation {
|
|
|
77388
77454
|
|
|
77389
77455
|
const scroll = node => regex.test(style(node, 'overflow') + style(node, 'overflow-y') + style(node, 'overflow-x'));
|
|
77390
77456
|
|
|
77391
|
-
const scrollParent = node => !node || node === document.body ? document.body : scroll(node) ? node : scrollParent(node.parentNode);
|
|
77457
|
+
const scrollParent = node => !node || node === document.body || !(node instanceof Element) ? document.body : scroll(node) ? node : scrollParent(node.parentNode);
|
|
77392
77458
|
|
|
77393
77459
|
return scrollParent(el);
|
|
77394
77460
|
};
|
|
@@ -77512,7 +77578,7 @@ class foundation_SliderFoundation extends foundation {
|
|
|
77512
77578
|
}
|
|
77513
77579
|
|
|
77514
77580
|
if (step !== 1) {
|
|
77515
|
-
// Find nearest step point
|
|
77581
|
+
// Find nearest step point
|
|
77516
77582
|
stepValue = Math.round(stepValue / step) * step;
|
|
77517
77583
|
}
|
|
77518
77584
|
|
|
@@ -80710,7 +80776,17 @@ class foundation_TableFoundation extends foundation {
|
|
|
80710
80776
|
|
|
80711
80777
|
|
|
80712
80778
|
getFilteredSortedDataSource(dataSource, queries) {
|
|
80713
|
-
const filteredDataSource = this.filterDataSource(dataSource, filter_default()(queries).call(queries, query =>
|
|
80779
|
+
const filteredDataSource = this.filterDataSource(dataSource, filter_default()(queries).call(queries, query => {
|
|
80780
|
+
/**
|
|
80781
|
+
* 这里无需判断 filteredValue 是否为数组,初始化时它是 `undefined`,点击选择空时为 `[]`
|
|
80782
|
+
* 初始化时我们应该用 `defaultFilteredValue`,点击后我们应该用 `filteredValue`
|
|
80783
|
+
*
|
|
80784
|
+
* There is no need to judge whether `filteredValue` is an array here, because it is `undefined` when initialized, and `[]` when you click to select empty
|
|
80785
|
+
* When initializing we should use `defaultFilteredValue`, after clicking we should use `filteredValue`
|
|
80786
|
+
*/
|
|
80787
|
+
const currentFilteredValue = query.filteredValue ? query.filteredValue : query.defaultFilteredValue;
|
|
80788
|
+
return isFunction_default()(query.onFilter) && is_array_default()(query.filters) && query.filters.length && is_array_default()(currentFilteredValue) && currentFilteredValue.length;
|
|
80789
|
+
}));
|
|
80714
80790
|
const sortedDataSource = this.sortDataSource(filteredDataSource, filter_default()(queries).call(queries, query => query && isFunction_default()(query.sorter)));
|
|
80715
80791
|
return sortedDataSource;
|
|
80716
80792
|
}
|
|
@@ -80869,10 +80945,12 @@ class foundation_TableFoundation extends foundation {
|
|
|
80869
80945
|
const {
|
|
80870
80946
|
onFilter,
|
|
80871
80947
|
filteredValue,
|
|
80872
|
-
filterChildrenRecord
|
|
80948
|
+
filterChildrenRecord,
|
|
80949
|
+
defaultFilteredValue
|
|
80873
80950
|
} = filterObj;
|
|
80951
|
+
const currentFilteredValue = is_array_default()(filteredValue) ? filteredValue : defaultFilteredValue;
|
|
80874
80952
|
|
|
80875
|
-
if (typeof onFilter === 'function' && is_array_default()(
|
|
80953
|
+
if (typeof onFilter === 'function' && is_array_default()(currentFilteredValue) && currentFilteredValue.length) {
|
|
80876
80954
|
hasValidFilters = true;
|
|
80877
80955
|
|
|
80878
80956
|
if (filteredData === null) {
|
|
@@ -80882,7 +80960,7 @@ class foundation_TableFoundation extends foundation {
|
|
|
80882
80960
|
filteredData = new core_js_stable_map_default.a();
|
|
80883
80961
|
}
|
|
80884
80962
|
|
|
80885
|
-
each_default()(
|
|
80963
|
+
each_default()(currentFilteredValue, value => {
|
|
80886
80964
|
each_default()(dataSource, record => {
|
|
80887
80965
|
const childrenRecords = get_default()(record, childrenRecordName);
|
|
80888
80966
|
|
|
@@ -85692,10 +85770,17 @@ class Table_Table extends baseComponent_BaseComponent {
|
|
|
85692
85770
|
titleArr.push(sorter);
|
|
85693
85771
|
}
|
|
85694
85772
|
|
|
85773
|
+
const stateFilteredValue = get_default()(curQuery, 'filteredValue');
|
|
85774
|
+
|
|
85775
|
+
const defaultFilteredValue = get_default()(curQuery, 'defaultFilteredValue');
|
|
85776
|
+
|
|
85777
|
+
const filteredValue = stateFilteredValue ? stateFilteredValue : defaultFilteredValue;
|
|
85778
|
+
|
|
85695
85779
|
if (is_array_default()(column.filters) && column.filters.length || /*#__PURE__*/Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["isValidElement"])(column.filterDropdown)) {
|
|
85696
85780
|
const filter = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(ColumnFilter, assign_default()({
|
|
85697
85781
|
key: table_constants_strings.DEFAULT_KEY_COLUMN_FILTER
|
|
85698
85782
|
}, curQuery, {
|
|
85783
|
+
filteredValue: filteredValue,
|
|
85699
85784
|
onFilterDropdownVisibleChange: visible => _this.foundation.toggleShowFilter(dataIndex, visible),
|
|
85700
85785
|
onSelect: data => _this.foundation.handleFilterSelect(dataIndex, data)
|
|
85701
85786
|
}));
|
|
@@ -86284,11 +86369,12 @@ class Table_Table extends baseComponent_BaseComponent {
|
|
|
86284
86369
|
willUpdateStates.cachedColumns = props.columns;
|
|
86285
86370
|
willUpdateStates.cachedChildren = null;
|
|
86286
86371
|
} else if (props.children && props.children !== state.cachedChildren) {
|
|
86287
|
-
const
|
|
86372
|
+
const newNestedColumns = getColumns(props.children);
|
|
86373
|
+
const newFlattenColumns = flattenColumns(newNestedColumns);
|
|
86288
86374
|
const columns = mergeColumns(state.queries, newFlattenColumns, null, false);
|
|
86289
86375
|
willUpdateStates.flattenColumns = newFlattenColumns;
|
|
86290
86376
|
willUpdateStates.queries = [...columns];
|
|
86291
|
-
willUpdateStates.cachedColumns = [...
|
|
86377
|
+
willUpdateStates.cachedColumns = [...newNestedColumns];
|
|
86292
86378
|
willUpdateStates.cachedChildren = props.children;
|
|
86293
86379
|
} // Update controlled selection column
|
|
86294
86380
|
|
|
@@ -90552,6 +90638,7 @@ class foundation_TreeFoundation extends foundation {
|
|
|
90552
90638
|
selectedKeys = [],
|
|
90553
90639
|
checkedKeys = new set_default.a([]),
|
|
90554
90640
|
halfCheckedKeys = new set_default.a([]),
|
|
90641
|
+
realCheckedKeys = new set_default.a([]),
|
|
90555
90642
|
keyEntities = {},
|
|
90556
90643
|
filteredKeys = new set_default.a([]),
|
|
90557
90644
|
inputValue = '',
|
|
@@ -90561,13 +90648,26 @@ class foundation_TreeFoundation extends foundation {
|
|
|
90561
90648
|
disabledKeys = new set_default.a([])
|
|
90562
90649
|
} = this.getStates();
|
|
90563
90650
|
const {
|
|
90564
|
-
treeNodeFilterProp
|
|
90651
|
+
treeNodeFilterProp,
|
|
90652
|
+
checkRelation
|
|
90565
90653
|
} = this.getProps();
|
|
90566
90654
|
const entity = keyEntities[key];
|
|
90567
90655
|
const notExist = !entity;
|
|
90568
90656
|
|
|
90569
90657
|
if (notExist) {
|
|
90570
90658
|
return null;
|
|
90659
|
+
} // if checkRelation is invalid, the checked status of node will be false
|
|
90660
|
+
|
|
90661
|
+
|
|
90662
|
+
let realChecked = false;
|
|
90663
|
+
let realHalfChecked = false;
|
|
90664
|
+
|
|
90665
|
+
if (checkRelation === 'related') {
|
|
90666
|
+
realChecked = checkedKeys.has(key);
|
|
90667
|
+
realHalfChecked = halfCheckedKeys.has(key);
|
|
90668
|
+
} else if (checkRelation === 'unRelated') {
|
|
90669
|
+
realChecked = realCheckedKeys.has(key);
|
|
90670
|
+
realHalfChecked = false;
|
|
90571
90671
|
}
|
|
90572
90672
|
|
|
90573
90673
|
const isSearching = Boolean(inputValue);
|
|
@@ -90575,8 +90675,8 @@ class foundation_TreeFoundation extends foundation {
|
|
|
90575
90675
|
eventKey: key,
|
|
90576
90676
|
expanded: isSearching ? filteredExpandedKeys.has(key) : expandedKeys.has(key),
|
|
90577
90677
|
selected: includes_default()(selectedKeys).call(selectedKeys, key),
|
|
90578
|
-
checked:
|
|
90579
|
-
halfChecked:
|
|
90678
|
+
checked: realChecked,
|
|
90679
|
+
halfChecked: realHalfChecked,
|
|
90580
90680
|
pos: String(entity ? entity.pos : ''),
|
|
90581
90681
|
level: entity.level,
|
|
90582
90682
|
filtered: filteredKeys.has(key),
|
|
@@ -90610,10 +90710,17 @@ class foundation_TreeFoundation extends foundation {
|
|
|
90610
90710
|
keyEntities
|
|
90611
90711
|
} = this.getStates();
|
|
90612
90712
|
const {
|
|
90613
|
-
leafOnly
|
|
90713
|
+
leafOnly,
|
|
90714
|
+
checkRelation
|
|
90614
90715
|
} = this.getProps();
|
|
90615
90716
|
let value;
|
|
90616
|
-
|
|
90717
|
+
let keyList = [];
|
|
90718
|
+
|
|
90719
|
+
if (checkRelation === 'related') {
|
|
90720
|
+
keyList = normalizeKeyList(key, keyEntities, leafOnly);
|
|
90721
|
+
} else if (checkRelation === 'unRelated') {
|
|
90722
|
+
keyList = key;
|
|
90723
|
+
}
|
|
90617
90724
|
|
|
90618
90725
|
if (this.getProp('onChangeWithObject')) {
|
|
90619
90726
|
value = map_default()(keyList).call(keyList, itemKey => keyEntities[itemKey].data);
|
|
@@ -90828,30 +90935,58 @@ class foundation_TreeFoundation extends foundation {
|
|
|
90828
90935
|
|
|
90829
90936
|
handleMultipleSelect(e, treeNode) {
|
|
90830
90937
|
const {
|
|
90831
|
-
disableStrictly
|
|
90832
|
-
|
|
90938
|
+
disableStrictly,
|
|
90939
|
+
checkRelation
|
|
90940
|
+
} = this.getProps();
|
|
90941
|
+
const {
|
|
90942
|
+
realCheckedKeys
|
|
90943
|
+
} = this.getStates(); // eventKey: The key value of the currently clicked node
|
|
90833
90944
|
|
|
90834
90945
|
const {
|
|
90835
90946
|
checked,
|
|
90836
90947
|
eventKey,
|
|
90837
90948
|
data
|
|
90838
|
-
} = treeNode;
|
|
90949
|
+
} = treeNode;
|
|
90839
90950
|
|
|
90840
|
-
|
|
90841
|
-
|
|
90842
|
-
|
|
90843
|
-
|
|
90844
|
-
|
|
90951
|
+
if (checkRelation === 'related') {
|
|
90952
|
+
// Find the checked state of the current node
|
|
90953
|
+
const targetStatus = disableStrictly ? this.calcChekcedStatus(!checked, eventKey) : !checked;
|
|
90954
|
+
const {
|
|
90955
|
+
checkedKeys,
|
|
90956
|
+
halfCheckedKeys
|
|
90957
|
+
} = disableStrictly ? this.calcNonDisabedCheckedKeys(eventKey, targetStatus) : this.calcCheckedKeys(eventKey, targetStatus);
|
|
90845
90958
|
|
|
90846
|
-
|
|
90959
|
+
this._adapter.notifySelect(eventKey, targetStatus, data);
|
|
90847
90960
|
|
|
90848
|
-
|
|
90961
|
+
this.notifyChange([...checkedKeys], e);
|
|
90849
90962
|
|
|
90850
|
-
|
|
90851
|
-
|
|
90852
|
-
|
|
90853
|
-
|
|
90854
|
-
|
|
90963
|
+
if (!this._isControlledComponent()) {
|
|
90964
|
+
this._adapter.updateState({
|
|
90965
|
+
checkedKeys,
|
|
90966
|
+
halfCheckedKeys
|
|
90967
|
+
});
|
|
90968
|
+
}
|
|
90969
|
+
} else if (checkRelation === 'unRelated') {
|
|
90970
|
+
const newRealCheckedKeys = new set_default.a(realCheckedKeys);
|
|
90971
|
+
let targetStatus;
|
|
90972
|
+
|
|
90973
|
+
if (realCheckedKeys.has(eventKey)) {
|
|
90974
|
+
newRealCheckedKeys.delete(eventKey);
|
|
90975
|
+
targetStatus = false;
|
|
90976
|
+
} else {
|
|
90977
|
+
newRealCheckedKeys.add(eventKey);
|
|
90978
|
+
targetStatus = true;
|
|
90979
|
+
}
|
|
90980
|
+
|
|
90981
|
+
this._adapter.notifySelect(eventKey, targetStatus, data);
|
|
90982
|
+
|
|
90983
|
+
this.notifyChange([...newRealCheckedKeys], e);
|
|
90984
|
+
|
|
90985
|
+
if (!this._isControlledComponent()) {
|
|
90986
|
+
this._adapter.updateState({
|
|
90987
|
+
realCheckedKeys: newRealCheckedKeys
|
|
90988
|
+
});
|
|
90989
|
+
}
|
|
90855
90990
|
}
|
|
90856
90991
|
}
|
|
90857
90992
|
|
|
@@ -92262,6 +92397,7 @@ class tree_Tree extends baseComponent_BaseComponent {
|
|
|
92262
92397
|
selectedKeys: [],
|
|
92263
92398
|
checkedKeys: new set_default.a(),
|
|
92264
92399
|
halfCheckedKeys: new set_default.a(),
|
|
92400
|
+
realCheckedKeys: new set_default.a([]),
|
|
92265
92401
|
motionKeys: new set_default.a([]),
|
|
92266
92402
|
motionType: 'hide',
|
|
92267
92403
|
expandedKeys: new set_default.a(props.expandedKeys),
|
|
@@ -92472,12 +92608,16 @@ class tree_Tree extends baseComponent_BaseComponent {
|
|
|
92472
92608
|
}
|
|
92473
92609
|
|
|
92474
92610
|
if (checkedKeyValues) {
|
|
92475
|
-
|
|
92476
|
-
|
|
92477
|
-
|
|
92478
|
-
|
|
92479
|
-
|
|
92480
|
-
|
|
92611
|
+
if (props.checkRelation === 'unRelated') {
|
|
92612
|
+
newState.realCheckedKeys = new set_default.a(checkedKeyValues);
|
|
92613
|
+
} else if (props.checkRelation === 'related') {
|
|
92614
|
+
const {
|
|
92615
|
+
checkedKeys,
|
|
92616
|
+
halfCheckedKeys
|
|
92617
|
+
} = calcCheckedKeys(checkedKeyValues, keyEntities);
|
|
92618
|
+
newState.checkedKeys = checkedKeys;
|
|
92619
|
+
newState.halfCheckedKeys = halfCheckedKeys;
|
|
92620
|
+
}
|
|
92481
92621
|
}
|
|
92482
92622
|
} // update loadedKeys
|
|
92483
92623
|
|
|
@@ -92487,7 +92627,7 @@ class tree_Tree extends baseComponent_BaseComponent {
|
|
|
92487
92627
|
} // update disableStrictly
|
|
92488
92628
|
|
|
92489
92629
|
|
|
92490
|
-
if (treeData && props.disableStrictly) {
|
|
92630
|
+
if (treeData && props.disableStrictly && props.checkRelation === 'related') {
|
|
92491
92631
|
newState.disabledKeys = calcDisabledKeys(keyEntities);
|
|
92492
92632
|
}
|
|
92493
92633
|
|
|
@@ -92808,6 +92948,7 @@ tree_Tree.propTypes = {
|
|
|
92808
92948
|
onDragStart: prop_types_default.a.func,
|
|
92809
92949
|
onDrop: prop_types_default.a.func,
|
|
92810
92950
|
labelEllipsis: prop_types_default.a.bool,
|
|
92951
|
+
checkRelation: prop_types_default.a.string,
|
|
92811
92952
|
'aria-label': prop_types_default.a.string
|
|
92812
92953
|
};
|
|
92813
92954
|
tree_Tree.defaultProps = {
|
|
@@ -92827,7 +92968,8 @@ tree_Tree.defaultProps = {
|
|
|
92827
92968
|
expandAction: false,
|
|
92828
92969
|
disableStrictly: false,
|
|
92829
92970
|
draggable: false,
|
|
92830
|
-
autoExpandWhenDragEnter: true
|
|
92971
|
+
autoExpandWhenDragEnter: true,
|
|
92972
|
+
checkRelation: 'related'
|
|
92831
92973
|
};
|
|
92832
92974
|
tree_Tree.TreeNode = treeNode_TreeNode;
|
|
92833
92975
|
/* harmony default export */ var tree_0 = (tree_Tree);
|
|
@@ -92973,6 +93115,7 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
92973
93115
|
selectedKeys = [],
|
|
92974
93116
|
checkedKeys = new set_default.a([]),
|
|
92975
93117
|
halfCheckedKeys = new set_default.a([]),
|
|
93118
|
+
realCheckedKeys = new set_default.a([]),
|
|
92976
93119
|
keyEntities = {},
|
|
92977
93120
|
filteredKeys = new set_default.a([]),
|
|
92978
93121
|
inputValue = '',
|
|
@@ -92982,13 +93125,26 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
92982
93125
|
disabledKeys = new set_default.a([])
|
|
92983
93126
|
} = this.getStates();
|
|
92984
93127
|
const {
|
|
92985
|
-
treeNodeFilterProp
|
|
93128
|
+
treeNodeFilterProp,
|
|
93129
|
+
checkRelation
|
|
92986
93130
|
} = this.getProps();
|
|
92987
93131
|
const entity = keyEntities[key];
|
|
92988
93132
|
const notExist = !entity;
|
|
92989
93133
|
|
|
92990
93134
|
if (notExist) {
|
|
92991
93135
|
return null;
|
|
93136
|
+
} // if checkRelation is invalid, the checked status of node will be false
|
|
93137
|
+
|
|
93138
|
+
|
|
93139
|
+
let realChecked = false;
|
|
93140
|
+
let realHalfChecked = false;
|
|
93141
|
+
|
|
93142
|
+
if (checkRelation === 'related') {
|
|
93143
|
+
realChecked = checkedKeys.has(key);
|
|
93144
|
+
realHalfChecked = halfCheckedKeys.has(key);
|
|
93145
|
+
} else if (checkRelation === 'unRelated') {
|
|
93146
|
+
realChecked = realCheckedKeys.has(key);
|
|
93147
|
+
realHalfChecked = false;
|
|
92992
93148
|
}
|
|
92993
93149
|
|
|
92994
93150
|
const isSearching = Boolean(inputValue);
|
|
@@ -92996,8 +93152,8 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
92996
93152
|
eventKey: key,
|
|
92997
93153
|
expanded: isSearching ? filteredExpandedKeys.has(key) : expandedKeys.has(key),
|
|
92998
93154
|
selected: includes_default()(selectedKeys).call(selectedKeys, key),
|
|
92999
|
-
checked:
|
|
93000
|
-
halfChecked:
|
|
93155
|
+
checked: realChecked,
|
|
93156
|
+
halfChecked: realHalfChecked,
|
|
93001
93157
|
pos: String(entity ? entity.pos : ''),
|
|
93002
93158
|
level: entity.level,
|
|
93003
93159
|
filtered: filteredKeys.has(key),
|
|
@@ -93063,9 +93219,16 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93063
93219
|
keyEntities
|
|
93064
93220
|
} = this.getStates();
|
|
93065
93221
|
const {
|
|
93066
|
-
leafOnly
|
|
93222
|
+
leafOnly,
|
|
93223
|
+
checkRelation
|
|
93067
93224
|
} = this.getProps();
|
|
93068
|
-
|
|
93225
|
+
let keyList = [];
|
|
93226
|
+
|
|
93227
|
+
if (checkRelation === 'related') {
|
|
93228
|
+
keyList = normalizeKeyList(key, keyEntities, leafOnly);
|
|
93229
|
+
} else if (checkRelation === 'unRelated') {
|
|
93230
|
+
keyList = key;
|
|
93231
|
+
}
|
|
93069
93232
|
|
|
93070
93233
|
const nodes = map_default()(keyList).call(keyList, i => keyEntities[i].data);
|
|
93071
93234
|
|
|
@@ -93192,7 +93355,8 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93192
93355
|
this._adapter.updateState({
|
|
93193
93356
|
selectedKeys: [],
|
|
93194
93357
|
checkedKeys: new set_default.a(),
|
|
93195
|
-
halfCheckedKeys: new set_default.a()
|
|
93358
|
+
halfCheckedKeys: new set_default.a(),
|
|
93359
|
+
realCheckedKeys: new set_default.a([])
|
|
93196
93360
|
});
|
|
93197
93361
|
} // When triggerSearch, clicking the clear button will trigger to clear Input
|
|
93198
93362
|
|
|
@@ -93220,11 +93384,13 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93220
93384
|
|
|
93221
93385
|
removeTag(eventKey) {
|
|
93222
93386
|
const {
|
|
93223
|
-
disableStrictly
|
|
93387
|
+
disableStrictly,
|
|
93388
|
+
checkRelation
|
|
93224
93389
|
} = this.getProps();
|
|
93225
93390
|
const {
|
|
93226
93391
|
keyEntities,
|
|
93227
|
-
disabledKeys
|
|
93392
|
+
disabledKeys,
|
|
93393
|
+
realCheckedKeys
|
|
93228
93394
|
} = this.getStates();
|
|
93229
93395
|
const item = keyEntities[eventKey].data;
|
|
93230
93396
|
|
|
@@ -93232,20 +93398,35 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93232
93398
|
return;
|
|
93233
93399
|
}
|
|
93234
93400
|
|
|
93235
|
-
|
|
93236
|
-
|
|
93237
|
-
|
|
93238
|
-
} = this.calcCheckedKeys(eventKey, false);
|
|
93401
|
+
if (checkRelation === 'unRelated') {
|
|
93402
|
+
const newRealCheckedKeys = new set_default.a(realCheckedKeys);
|
|
93403
|
+
newRealCheckedKeys.delete(eventKey);
|
|
93239
93404
|
|
|
93240
|
-
|
|
93405
|
+
this._notifyChange([...newRealCheckedKeys], null);
|
|
93241
93406
|
|
|
93242
|
-
|
|
93243
|
-
|
|
93407
|
+
if (!this._isControlledComponent()) {
|
|
93408
|
+
this._adapter.updateState({
|
|
93409
|
+
realCheckedKeys: newRealCheckedKeys
|
|
93410
|
+
});
|
|
93411
|
+
|
|
93412
|
+
this._adapter.rePositionDropdown();
|
|
93413
|
+
}
|
|
93414
|
+
} else if (checkRelation === 'related') {
|
|
93415
|
+
const {
|
|
93244
93416
|
checkedKeys,
|
|
93245
93417
|
halfCheckedKeys
|
|
93246
|
-
});
|
|
93418
|
+
} = this.calcCheckedKeys(eventKey, false);
|
|
93247
93419
|
|
|
93248
|
-
this.
|
|
93420
|
+
this._notifyChange([...checkedKeys], null);
|
|
93421
|
+
|
|
93422
|
+
if (!this._isControlledComponent()) {
|
|
93423
|
+
this._adapter.updateState({
|
|
93424
|
+
checkedKeys,
|
|
93425
|
+
halfCheckedKeys
|
|
93426
|
+
});
|
|
93427
|
+
|
|
93428
|
+
this._adapter.rePositionDropdown();
|
|
93429
|
+
}
|
|
93249
93430
|
}
|
|
93250
93431
|
|
|
93251
93432
|
this._adapter.notifySelect(eventKey, false, item); // reposition dropdown when selected values change
|
|
@@ -93396,39 +93577,67 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93396
93577
|
handleMultipleSelect(e, treeNode) {
|
|
93397
93578
|
const {
|
|
93398
93579
|
searchPosition,
|
|
93399
|
-
disableStrictly
|
|
93580
|
+
disableStrictly,
|
|
93581
|
+
checkRelation
|
|
93400
93582
|
} = this.getProps();
|
|
93401
93583
|
const {
|
|
93402
|
-
inputValue
|
|
93584
|
+
inputValue,
|
|
93585
|
+
realCheckedKeys
|
|
93403
93586
|
} = this.getStates();
|
|
93404
93587
|
const {
|
|
93405
93588
|
checked,
|
|
93406
93589
|
eventKey,
|
|
93407
93590
|
data
|
|
93408
93591
|
} = treeNode;
|
|
93409
|
-
const targetStatus = disableStrictly ? this.calcChekcedStatus(!checked, eventKey) : !checked;
|
|
93410
|
-
const {
|
|
93411
|
-
checkedKeys,
|
|
93412
|
-
halfCheckedKeys
|
|
93413
|
-
} = disableStrictly ? this.calcNonDisabedCheckedKeys(eventKey, targetStatus) : this.calcCheckedKeys(eventKey, targetStatus);
|
|
93414
93592
|
|
|
93415
|
-
|
|
93593
|
+
if (checkRelation === 'related') {
|
|
93594
|
+
const targetStatus = disableStrictly ? this.calcChekcedStatus(!checked, eventKey) : !checked;
|
|
93595
|
+
const {
|
|
93596
|
+
checkedKeys,
|
|
93597
|
+
halfCheckedKeys
|
|
93598
|
+
} = disableStrictly ? this.calcNonDisabedCheckedKeys(eventKey, targetStatus) : this.calcCheckedKeys(eventKey, targetStatus);
|
|
93416
93599
|
|
|
93417
|
-
|
|
93600
|
+
this._adapter.notifySelect(eventKey, targetStatus, data);
|
|
93418
93601
|
|
|
93419
|
-
|
|
93420
|
-
|
|
93421
|
-
|
|
93422
|
-
|
|
93602
|
+
this._notifyChange([...checkedKeys], e);
|
|
93603
|
+
|
|
93604
|
+
if (!this._isControlledComponent()) {
|
|
93605
|
+
this._adapter.updateState({
|
|
93606
|
+
checkedKeys,
|
|
93607
|
+
halfCheckedKeys
|
|
93608
|
+
});
|
|
93609
|
+
|
|
93610
|
+
this._adapter.rePositionDropdown();
|
|
93611
|
+
}
|
|
93612
|
+
} else if (checkRelation === 'unRelated') {
|
|
93613
|
+
const newRealCheckedKeys = new set_default.a(realCheckedKeys);
|
|
93614
|
+
let targetStatus;
|
|
93615
|
+
|
|
93616
|
+
if (realCheckedKeys.has(eventKey)) {
|
|
93617
|
+
newRealCheckedKeys.delete(eventKey);
|
|
93618
|
+
targetStatus = false;
|
|
93619
|
+
} else {
|
|
93620
|
+
newRealCheckedKeys.add(eventKey);
|
|
93621
|
+
targetStatus = true;
|
|
93622
|
+
}
|
|
93623
|
+
|
|
93624
|
+
this._adapter.notifySelect(eventKey, targetStatus, data);
|
|
93625
|
+
|
|
93626
|
+
this._notifyChange([...newRealCheckedKeys], e);
|
|
93627
|
+
|
|
93628
|
+
if (!this._isControlledComponent()) {
|
|
93629
|
+
this._adapter.updateState({
|
|
93630
|
+
realCheckedKeys: newRealCheckedKeys
|
|
93631
|
+
});
|
|
93632
|
+
|
|
93633
|
+
this._adapter.rePositionDropdown();
|
|
93634
|
+
}
|
|
93423
93635
|
}
|
|
93424
93636
|
|
|
93425
|
-
if (
|
|
93637
|
+
if (searchPosition === treeSelect_constants_strings.SEARCH_POSITION_TRIGGER && inputValue !== '') {
|
|
93426
93638
|
this._adapter.updateState({
|
|
93427
|
-
|
|
93428
|
-
halfCheckedKeys
|
|
93639
|
+
inputValue: ''
|
|
93429
93640
|
});
|
|
93430
|
-
|
|
93431
|
-
this._adapter.rePositionDropdown();
|
|
93432
93641
|
}
|
|
93433
93642
|
}
|
|
93434
93643
|
|
|
@@ -93756,34 +93965,52 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
93756
93965
|
this.foundation.handleSelectionEnterPress(e);
|
|
93757
93966
|
};
|
|
93758
93967
|
|
|
93759
|
-
this.
|
|
93968
|
+
this.hasValue = () => {
|
|
93760
93969
|
const {
|
|
93761
|
-
|
|
93970
|
+
multiple,
|
|
93971
|
+
checkRelation
|
|
93762
93972
|
} = this.props;
|
|
93763
93973
|
const {
|
|
93764
|
-
|
|
93974
|
+
realCheckedKeys,
|
|
93975
|
+
checkedKeys,
|
|
93976
|
+
selectedKeys
|
|
93765
93977
|
} = this.state;
|
|
93766
|
-
|
|
93978
|
+
let hasValue = false;
|
|
93979
|
+
|
|
93980
|
+
if (multiple) {
|
|
93981
|
+
if (checkRelation === 'related') {
|
|
93982
|
+
hasValue = Boolean(checkedKeys.size);
|
|
93983
|
+
} else if (checkRelation === 'unRelated') {
|
|
93984
|
+
hasValue = Boolean(realCheckedKeys.size);
|
|
93985
|
+
}
|
|
93986
|
+
} else {
|
|
93987
|
+
hasValue = Boolean(selectedKeys.length);
|
|
93988
|
+
}
|
|
93989
|
+
|
|
93990
|
+
return hasValue;
|
|
93991
|
+
};
|
|
93992
|
+
|
|
93993
|
+
this.showClearBtn = () => {
|
|
93767
93994
|
const {
|
|
93768
93995
|
showClear,
|
|
93769
93996
|
disabled,
|
|
93770
|
-
|
|
93997
|
+
searchPosition
|
|
93771
93998
|
} = this.props;
|
|
93772
93999
|
const {
|
|
93773
|
-
|
|
93774
|
-
checkedKeys,
|
|
94000
|
+
inputValue,
|
|
93775
94001
|
isOpen,
|
|
93776
94002
|
isHovering
|
|
93777
94003
|
} = this.state;
|
|
93778
|
-
const
|
|
93779
|
-
return showClear && (hasValue || triggerSearchHasInputValue) && !disabled && (isOpen || isHovering);
|
|
94004
|
+
const triggerSearchHasInputValue = searchPosition === treeSelect_constants_strings.SEARCH_POSITION_TRIGGER && inputValue;
|
|
94005
|
+
return showClear && (this.hasValue() || triggerSearchHasInputValue) && !disabled && (isOpen || isHovering);
|
|
93780
94006
|
};
|
|
93781
94007
|
|
|
93782
94008
|
this.renderTagList = () => {
|
|
93783
94009
|
const {
|
|
93784
94010
|
checkedKeys,
|
|
93785
94011
|
keyEntities,
|
|
93786
|
-
disabledKeys
|
|
94012
|
+
disabledKeys,
|
|
94013
|
+
realCheckedKeys
|
|
93787
94014
|
} = this.state;
|
|
93788
94015
|
const {
|
|
93789
94016
|
treeNodeLabelProp,
|
|
@@ -93791,13 +94018,21 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
93791
94018
|
disabled,
|
|
93792
94019
|
disableStrictly,
|
|
93793
94020
|
size,
|
|
94021
|
+
checkRelation,
|
|
93794
94022
|
renderSelectedItem: propRenderSelectedItem
|
|
93795
94023
|
} = this.props;
|
|
93796
94024
|
const renderSelectedItem = isFunction_default()(propRenderSelectedItem) ? propRenderSelectedItem : item => ({
|
|
93797
94025
|
isRenderInTag: true,
|
|
93798
94026
|
content: get_default()(item, treeNodeLabelProp, null)
|
|
93799
94027
|
});
|
|
93800
|
-
|
|
94028
|
+
let renderKeys = [];
|
|
94029
|
+
|
|
94030
|
+
if (checkRelation === 'related') {
|
|
94031
|
+
renderKeys = normalizeKeyList([...checkedKeys], keyEntities, leafOnly);
|
|
94032
|
+
} else if (checkRelation === 'unRelated') {
|
|
94033
|
+
renderKeys = [...realCheckedKeys];
|
|
94034
|
+
}
|
|
94035
|
+
|
|
93801
94036
|
const tagList = []; // eslint-disable-next-line @typescript-eslint/no-shadow
|
|
93802
94037
|
|
|
93803
94038
|
for_each_default()(renderKeys).call(renderKeys, key => {
|
|
@@ -93886,11 +94121,6 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
93886
94121
|
searchPosition,
|
|
93887
94122
|
filterTreeNode
|
|
93888
94123
|
} = this.props;
|
|
93889
|
-
const {
|
|
93890
|
-
selectedKeys,
|
|
93891
|
-
checkedKeys
|
|
93892
|
-
} = this.state;
|
|
93893
|
-
const hasValue = multiple ? Boolean(checkedKeys.size) : Boolean(selectedKeys.length);
|
|
93894
94124
|
const isTriggerPositionSearch = filterTreeNode && searchPosition === treeSelect_constants_strings.SEARCH_POSITION_TRIGGER; // searchPosition = trigger
|
|
93895
94125
|
|
|
93896
94126
|
if (isTriggerPositionSearch) {
|
|
@@ -93898,7 +94128,7 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
93898
94128
|
} // searchPosition = dropdown and single seleciton
|
|
93899
94129
|
|
|
93900
94130
|
|
|
93901
|
-
if (!multiple || !hasValue) {
|
|
94131
|
+
if (!multiple || !this.hasValue()) {
|
|
93902
94132
|
const renderText = this.foundation.getRenderTextInSingle();
|
|
93903
94133
|
const spanCls = classnames_default()({
|
|
93904
94134
|
["".concat(treeSelect_prefixcls, "-selection-placeholder")]: !renderText
|
|
@@ -94155,14 +94385,23 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94155
94385
|
size,
|
|
94156
94386
|
searchAutoFocus,
|
|
94157
94387
|
placeholder,
|
|
94158
|
-
maxTagCount
|
|
94388
|
+
maxTagCount,
|
|
94389
|
+
checkRelation
|
|
94159
94390
|
} = this.props;
|
|
94160
94391
|
const {
|
|
94161
94392
|
keyEntities,
|
|
94162
94393
|
checkedKeys,
|
|
94163
|
-
inputValue
|
|
94394
|
+
inputValue,
|
|
94395
|
+
realCheckedKeys
|
|
94164
94396
|
} = this.state;
|
|
94165
|
-
|
|
94397
|
+
let keyList = [];
|
|
94398
|
+
|
|
94399
|
+
if (checkRelation === 'related') {
|
|
94400
|
+
keyList = normalizeKeyList(checkedKeys, keyEntities, leafOnly);
|
|
94401
|
+
} else if (checkRelation === 'unRelated') {
|
|
94402
|
+
keyList = [...realCheckedKeys];
|
|
94403
|
+
}
|
|
94404
|
+
|
|
94166
94405
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(tagInput_0, {
|
|
94167
94406
|
maxTagCount: maxTagCount,
|
|
94168
94407
|
disabled: disabled,
|
|
@@ -94487,6 +94726,7 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94487
94726
|
selectedKeys: [],
|
|
94488
94727
|
checkedKeys: new set_default.a(),
|
|
94489
94728
|
halfCheckedKeys: new set_default.a(),
|
|
94729
|
+
realCheckedKeys: new set_default.a([]),
|
|
94490
94730
|
disabledKeys: new set_default.a(),
|
|
94491
94731
|
motionKeys: new set_default.a([]),
|
|
94492
94732
|
motionType: 'hide',
|
|
@@ -94607,12 +94847,16 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94607
94847
|
}
|
|
94608
94848
|
|
|
94609
94849
|
if (checkedKeyValues) {
|
|
94610
|
-
|
|
94611
|
-
|
|
94612
|
-
|
|
94613
|
-
|
|
94614
|
-
|
|
94615
|
-
|
|
94850
|
+
if (props.checkRelation === 'unRelated') {
|
|
94851
|
+
newState.realCheckedKeys = new set_default.a(checkedKeyValues);
|
|
94852
|
+
} else if (props.checkRelation === 'related') {
|
|
94853
|
+
const {
|
|
94854
|
+
checkedKeys,
|
|
94855
|
+
halfCheckedKeys
|
|
94856
|
+
} = calcCheckedKeys(checkedKeyValues, keyEntities);
|
|
94857
|
+
newState.checkedKeys = checkedKeys;
|
|
94858
|
+
newState.halfCheckedKeys = halfCheckedKeys;
|
|
94859
|
+
}
|
|
94616
94860
|
}
|
|
94617
94861
|
} // loadedKeys
|
|
94618
94862
|
|
|
@@ -94627,7 +94871,7 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94627
94871
|
} // ================ disableStrictly =================
|
|
94628
94872
|
|
|
94629
94873
|
|
|
94630
|
-
if (treeData && props.disableStrictly) {
|
|
94874
|
+
if (treeData && props.disableStrictly && props.checkRelation === 'related') {
|
|
94631
94875
|
newState.disabledKeys = calcDisabledKeys(keyEntities);
|
|
94632
94876
|
}
|
|
94633
94877
|
|
|
@@ -94893,6 +95137,7 @@ treeSelect_TreeSelect.propTypes = {
|
|
|
94893
95137
|
optionListStyle: prop_types_default.a.object,
|
|
94894
95138
|
searchRender: prop_types_default.a.oneOfType([prop_types_default.a.func, prop_types_default.a.bool]),
|
|
94895
95139
|
renderSelectedItem: prop_types_default.a.func,
|
|
95140
|
+
checkRelation: prop_types_default.a.string,
|
|
94896
95141
|
'aria-label': prop_types_default.a.string
|
|
94897
95142
|
};
|
|
94898
95143
|
treeSelect_TreeSelect.defaultProps = {
|
|
@@ -94921,6 +95166,7 @@ treeSelect_TreeSelect.defaultProps = {
|
|
|
94921
95166
|
expandAction: false,
|
|
94922
95167
|
clickToHide: true,
|
|
94923
95168
|
searchAutoFocus: false,
|
|
95169
|
+
checkRelation: 'related',
|
|
94924
95170
|
'aria-label': 'TreeSelect'
|
|
94925
95171
|
};
|
|
94926
95172
|
/* harmony default export */ var treeSelect_0 = (treeSelect_TreeSelect);
|
|
@@ -96492,6 +96738,7 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96492
96738
|
onPreviewClick,
|
|
96493
96739
|
showPicInfo,
|
|
96494
96740
|
renderPicInfo,
|
|
96741
|
+
renderPicPreviewIcon,
|
|
96495
96742
|
renderThumbnail,
|
|
96496
96743
|
name,
|
|
96497
96744
|
index
|
|
@@ -96499,6 +96746,7 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96499
96746
|
const showProgress = status === upload_constants_strings.FILE_STATUS_UPLOADING && percent !== 100;
|
|
96500
96747
|
const showRetry = status === upload_constants_strings.FILE_STATUS_UPLOAD_FAIL && this.props.showRetry;
|
|
96501
96748
|
const showReplace = status === upload_constants_strings.FILE_STATUS_SUCCESS && this.props.showReplace;
|
|
96749
|
+
const showPreview = status === upload_constants_strings.FILE_STATUS_SUCCESS && !this.props.showReplace;
|
|
96502
96750
|
const filePicCardCls = classnames_default()({
|
|
96503
96751
|
["".concat(fileCard_prefixCls, "-picture-file-card")]: true,
|
|
96504
96752
|
["".concat(fileCard_prefixCls, "-picture-file-card-disabled")]: disabled,
|
|
@@ -96506,7 +96754,6 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96506
96754
|
["".concat(fileCard_prefixCls, "-picture-file-card-error")]: status === upload_constants_strings.FILE_STATUS_UPLOAD_FAIL,
|
|
96507
96755
|
["".concat(fileCard_prefixCls, "-picture-file-card-uploading")]: showProgress
|
|
96508
96756
|
});
|
|
96509
|
-
const closeCls = "".concat(fileCard_prefixCls, "-picture-file-card-close");
|
|
96510
96757
|
const retry = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
96511
96758
|
role: "button",
|
|
96512
96759
|
tabIndex: 0,
|
|
@@ -96529,6 +96776,17 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96529
96776
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(ReplaceSvg, {
|
|
96530
96777
|
className: "".concat(fileCard_prefixCls, "-picture-file-card-icon-replace")
|
|
96531
96778
|
})));
|
|
96779
|
+
const preview = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
96780
|
+
className: "".concat(fileCard_prefixCls, "-picture-file-card-preview")
|
|
96781
|
+
}, typeof renderPicPreviewIcon === 'function' ? renderPicPreviewIcon(this.props) : null);
|
|
96782
|
+
const close = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
96783
|
+
role: "button",
|
|
96784
|
+
tabIndex: 0,
|
|
96785
|
+
className: "".concat(fileCard_prefixCls, "-picture-file-card-close"),
|
|
96786
|
+
onClick: e => this.onRemove(e)
|
|
96787
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClear, {
|
|
96788
|
+
className: "".concat(fileCard_prefixCls, "-picture-file-card-icon-close")
|
|
96789
|
+
}));
|
|
96532
96790
|
const picInfo = typeof renderPicInfo === 'function' ? renderPicInfo(this.props) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
96533
96791
|
className: "".concat(fileCard_prefixCls, "-picture-file-card-pic-info")
|
|
96534
96792
|
}, index + 1);
|
|
@@ -96547,14 +96805,7 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96547
96805
|
size: "small",
|
|
96548
96806
|
orbitStroke: '#FFF',
|
|
96549
96807
|
"aria-label": "uploading file progress"
|
|
96550
|
-
}) : null, showRetry ? retry : null, showReplace && replace, showPicInfo && picInfo, !disabled &&
|
|
96551
|
-
className: closeCls,
|
|
96552
|
-
onClick: e => this.onRemove(e)
|
|
96553
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, {
|
|
96554
|
-
tabIndex: 0,
|
|
96555
|
-
role: "button",
|
|
96556
|
-
size: "extra-small"
|
|
96557
|
-
})), this.renderPicValidateMsg());
|
|
96808
|
+
}) : null, showRetry ? retry : null, showReplace && replace, showPreview && preview, showPicInfo && picInfo, !disabled && close, this.renderPicValidateMsg());
|
|
96558
96809
|
}
|
|
96559
96810
|
|
|
96560
96811
|
renderFile(locale) {
|
|
@@ -96569,7 +96820,8 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96569
96820
|
previewFile,
|
|
96570
96821
|
status,
|
|
96571
96822
|
style,
|
|
96572
|
-
onPreviewClick
|
|
96823
|
+
onPreviewClick,
|
|
96824
|
+
renderFileOperation
|
|
96573
96825
|
} = this.props;
|
|
96574
96826
|
const fileCardCls = classnames_default()({
|
|
96575
96827
|
["".concat(fileCard_prefixCls, "-file-card")]: true,
|
|
@@ -96599,6 +96851,14 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96599
96851
|
previewContent = previewFile(this.props);
|
|
96600
96852
|
}
|
|
96601
96853
|
|
|
96854
|
+
const operation = typeof renderFileOperation === 'function' ? renderFileOperation(this.props) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, {
|
|
96855
|
+
onClick: e => this.onRemove(e),
|
|
96856
|
+
type: "tertiary",
|
|
96857
|
+
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, null),
|
|
96858
|
+
theme: "borderless",
|
|
96859
|
+
size: "small",
|
|
96860
|
+
className: closeCls
|
|
96861
|
+
});
|
|
96602
96862
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
96603
96863
|
role: "listitem",
|
|
96604
96864
|
className: fileCardCls,
|
|
@@ -96619,7 +96879,7 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96619
96879
|
position: "top",
|
|
96620
96880
|
showArrow: false,
|
|
96621
96881
|
content: locale.replace
|
|
96622
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
|
96882
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, {
|
|
96623
96883
|
onClick: e => this.onReplace(e),
|
|
96624
96884
|
type: "tertiary",
|
|
96625
96885
|
theme: "borderless",
|
|
@@ -96641,29 +96901,22 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96641
96901
|
tabIndex: 0,
|
|
96642
96902
|
className: "".concat(infoCls, "-retry"),
|
|
96643
96903
|
onClick: e => this.onRetry(e)
|
|
96644
|
-
}, locale.retry) : null)),
|
|
96645
|
-
onClick: e => this.onRemove(e),
|
|
96646
|
-
type: "tertiary",
|
|
96647
|
-
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, null),
|
|
96648
|
-
theme: "borderless",
|
|
96649
|
-
size: "small",
|
|
96650
|
-
className: closeCls
|
|
96651
|
-
}));
|
|
96904
|
+
}, locale.retry) : null)), operation);
|
|
96652
96905
|
}
|
|
96653
96906
|
|
|
96654
96907
|
onRemove(e) {
|
|
96655
96908
|
e.stopPropagation();
|
|
96656
|
-
this.props.onRemove(
|
|
96909
|
+
this.props.onRemove();
|
|
96657
96910
|
}
|
|
96658
96911
|
|
|
96659
96912
|
onReplace(e) {
|
|
96660
96913
|
e.stopPropagation();
|
|
96661
|
-
this.props.onReplace(
|
|
96914
|
+
this.props.onReplace();
|
|
96662
96915
|
}
|
|
96663
96916
|
|
|
96664
96917
|
onRetry(e) {
|
|
96665
96918
|
e.stopPropagation();
|
|
96666
|
-
this.props.onRetry(
|
|
96919
|
+
this.props.onRetry();
|
|
96667
96920
|
}
|
|
96668
96921
|
|
|
96669
96922
|
render() {
|
|
@@ -96727,6 +96980,7 @@ var upload = __webpack_require__("/t7F");
|
|
|
96727
96980
|
|
|
96728
96981
|
|
|
96729
96982
|
|
|
96983
|
+
|
|
96730
96984
|
/* eslint-disable max-len */
|
|
96731
96985
|
|
|
96732
96986
|
|
|
@@ -96837,14 +97091,14 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
96837
97091
|
previewFile,
|
|
96838
97092
|
listType,
|
|
96839
97093
|
itemStyle,
|
|
96840
|
-
showRetry,
|
|
96841
97094
|
showPicInfo,
|
|
96842
97095
|
renderPicInfo,
|
|
97096
|
+
renderPicPreviewIcon,
|
|
97097
|
+
renderFileOperation,
|
|
96843
97098
|
renderFileItem,
|
|
96844
97099
|
renderThumbnail,
|
|
96845
97100
|
disabled,
|
|
96846
|
-
onPreviewClick
|
|
96847
|
-
showReplace
|
|
97101
|
+
onPreviewClick
|
|
96848
97102
|
} = this.props;
|
|
96849
97103
|
|
|
96850
97104
|
const onRemove = () => this.remove(file);
|
|
@@ -96857,20 +97111,20 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
96857
97111
|
this.replace(index);
|
|
96858
97112
|
};
|
|
96859
97113
|
|
|
96860
|
-
const fileCardProps = assign_default()(assign_default()({}, file), {
|
|
97114
|
+
const fileCardProps = assign_default()(assign_default()(assign_default()({}, pick_default()(this.props, ['showRetry', 'showReplace', ''])), file), {
|
|
96861
97115
|
previewFile,
|
|
96862
97116
|
listType,
|
|
96863
97117
|
onRemove,
|
|
96864
97118
|
onRetry,
|
|
96865
97119
|
index,
|
|
96866
97120
|
key: uid || concat_default()(_context = "".concat(name)).call(_context, index),
|
|
96867
|
-
showRetry: typeof file.showRetry !== 'undefined' ? file.showRetry : showRetry,
|
|
96868
97121
|
style: itemStyle,
|
|
96869
97122
|
disabled,
|
|
96870
97123
|
showPicInfo,
|
|
96871
97124
|
renderPicInfo,
|
|
97125
|
+
renderPicPreviewIcon,
|
|
97126
|
+
renderFileOperation,
|
|
96872
97127
|
renderThumbnail,
|
|
96873
|
-
showReplace: typeof file.showReplace !== 'undefined' ? file.showReplace : showReplace,
|
|
96874
97128
|
onReplace,
|
|
96875
97129
|
onPreviewClick: typeof onPreviewClick !== 'undefined' ? () => this.foundation.handlePreviewClick(file) : undefined
|
|
96876
97130
|
});
|
|
@@ -96912,7 +97166,8 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
96912
97166
|
limit,
|
|
96913
97167
|
disabled,
|
|
96914
97168
|
children,
|
|
96915
|
-
draggable
|
|
97169
|
+
draggable,
|
|
97170
|
+
hotSpotLocation
|
|
96916
97171
|
} = this.props;
|
|
96917
97172
|
const {
|
|
96918
97173
|
fileList: stateFileList,
|
|
@@ -96970,7 +97225,7 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
96970
97225
|
className: mainCls,
|
|
96971
97226
|
role: "list",
|
|
96972
97227
|
"aria-label": "picture list"
|
|
96973
|
-
}, map_default()(fileList).call(fileList, (file, index) => this.renderFile(file, index, locale)), showAddTriggerInList ? addContent : null)));
|
|
97228
|
+
}, showAddTriggerInList && hotSpotLocation === 'start' ? addContent : null, map_default()(fileList).call(fileList, (file, index) => this.renderFile(file, index, locale)), showAddTriggerInList && hotSpotLocation === 'end' ? addContent : null)));
|
|
96974
97229
|
};
|
|
96975
97230
|
|
|
96976
97231
|
this.renderFileListDefault = () => {
|
|
@@ -97310,6 +97565,7 @@ upload_Upload.propTypes = {
|
|
|
97310
97565
|
fileList: prop_types_default.a.array,
|
|
97311
97566
|
fileName: prop_types_default.a.string,
|
|
97312
97567
|
headers: prop_types_default.a.oneOfType([prop_types_default.a.object, prop_types_default.a.func]),
|
|
97568
|
+
hotSpotLocation: prop_types_default.a.oneOf(['start', 'end']),
|
|
97313
97569
|
itemStyle: prop_types_default.a.object,
|
|
97314
97570
|
limit: prop_types_default.a.number,
|
|
97315
97571
|
listType: prop_types_default.a.oneOf(upload_constants_strings.LIST_TYPE),
|
|
@@ -97335,6 +97591,8 @@ upload_Upload.propTypes = {
|
|
|
97335
97591
|
prompt: prop_types_default.a.node,
|
|
97336
97592
|
promptPosition: prop_types_default.a.oneOf(upload_constants_strings.PROMPT_POSITION),
|
|
97337
97593
|
renderFileItem: prop_types_default.a.func,
|
|
97594
|
+
renderPicPreviewIcon: prop_types_default.a.func,
|
|
97595
|
+
renderFileOperation: prop_types_default.a.func,
|
|
97338
97596
|
renderPicInfo: prop_types_default.a.func,
|
|
97339
97597
|
renderThumbnail: prop_types_default.a.func,
|
|
97340
97598
|
showClear: prop_types_default.a.bool,
|
|
@@ -97354,6 +97612,7 @@ upload_Upload.defaultProps = {
|
|
|
97354
97612
|
defaultFileList: [],
|
|
97355
97613
|
disabled: false,
|
|
97356
97614
|
listType: 'list',
|
|
97615
|
+
hotSpotLocation: 'end',
|
|
97357
97616
|
multiple: false,
|
|
97358
97617
|
onAcceptInvalid: noop_default.a,
|
|
97359
97618
|
onChange: noop_default.a,
|