@douyinfe/semi-ui 2.4.0 → 2.5.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/datePicker/_story/v2/FixInputRangeFocus.jsx +25 -0
- package/datePicker/_story/v2/index.js +2 -1
- package/datePicker/datePicker.tsx +4 -0
- package/dist/css/semi.css +51 -27
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +481 -182
- 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/form/_story/demo.jsx +1 -0
- package/input/index.tsx +1 -0
- package/input/textarea.tsx +1 -1
- package/lib/cjs/autoComplete/index.d.ts +1 -1
- package/lib/cjs/cascader/index.js +6 -0
- package/lib/cjs/datePicker/datePicker.js +16 -8
- 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/input/index.js +2 -1
- package/lib/cjs/input/textarea.js +1 -1
- package/lib/cjs/select/index.d.ts +3 -3
- package/lib/cjs/select/index.js +32 -28
- package/lib/cjs/select/option.js +2 -2
- package/lib/cjs/select/virtualRow.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/timePicker/TimePicker.js +2 -1
- package/lib/cjs/tooltip/index.d.ts +1 -1
- package/lib/cjs/tooltip/index.js +6 -2
- 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/datePicker/datePicker.js +16 -8
- 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/input/index.js +2 -1
- package/lib/es/input/textarea.js +1 -1
- package/lib/es/select/index.d.ts +3 -3
- package/lib/es/select/index.js +30 -26
- package/lib/es/select/option.js +2 -2
- package/lib/es/select/virtualRow.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/timePicker/TimePicker.js +2 -1
- package/lib/es/tooltip/index.d.ts +1 -1
- package/lib/es/tooltip/index.js +6 -2
- 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 -8
- package/select/index.tsx +18 -19
- package/select/option.tsx +2 -2
- package/select/virtualRow.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/FixedResizable/index.jsx +114 -0
- package/table/_story/v2/defaultFilteredValue.tsx +123 -0
- package/table/_story/v2/index.js +5 -0
- package/table/interface.ts +1 -0
- package/tabs/interface.ts +1 -1
- package/timePicker/TimePicker.tsx +1 -0
- package/tooltip/__test__/tooltip.test.js +48 -4
- package/tooltip/_story/tooltip.stories.js +83 -1
- package/tooltip/index.tsx +4 -4
- 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'
|
|
@@ -27093,11 +27154,15 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
|
|
|
27093
27154
|
}
|
|
27094
27155
|
};
|
|
27095
27156
|
|
|
27096
|
-
document.addEventListener('
|
|
27157
|
+
document.addEventListener('mousedown', this.clickOutsideHandler, {
|
|
27158
|
+
capture: true
|
|
27159
|
+
});
|
|
27097
27160
|
},
|
|
27098
27161
|
unregisterClickOutsideHandler: () => {
|
|
27099
27162
|
if (this.clickOutsideHandler) {
|
|
27100
|
-
document.removeEventListener('
|
|
27163
|
+
document.removeEventListener('mousedown', this.clickOutsideHandler, {
|
|
27164
|
+
capture: true
|
|
27165
|
+
});
|
|
27101
27166
|
this.clickOutsideHandler = null;
|
|
27102
27167
|
}
|
|
27103
27168
|
},
|
|
@@ -33628,6 +33693,7 @@ class input_Input extends baseComponent_BaseComponent {
|
|
|
33628
33693
|
prefix,
|
|
33629
33694
|
mode,
|
|
33630
33695
|
insetLabel,
|
|
33696
|
+
insetLabelId,
|
|
33631
33697
|
validateStatus,
|
|
33632
33698
|
type,
|
|
33633
33699
|
readonly,
|
|
@@ -33643,7 +33709,7 @@ class input_Input extends baseComponent_BaseComponent {
|
|
|
33643
33709
|
maxLength,
|
|
33644
33710
|
getValueLength
|
|
33645
33711
|
} = _a,
|
|
33646
|
-
rest = input_rest(_a, ["addonAfter", "addonBefore", "autofocus", "className", "disabled", "placeholder", "prefix", "mode", "insetLabel", "validateStatus", "type", "readonly", "size", "suffix", "style", "showClear", "onEnterPress", "onClear", "hideSuffix", "inputStyle", "forwardRef", "maxLength", "getValueLength"]);
|
|
33712
|
+
rest = input_rest(_a, ["addonAfter", "addonBefore", "autofocus", "className", "disabled", "placeholder", "prefix", "mode", "insetLabel", "insetLabelId", "validateStatus", "type", "readonly", "size", "suffix", "style", "showClear", "onEnterPress", "onClear", "hideSuffix", "inputStyle", "forwardRef", "maxLength", "getValueLength"]);
|
|
33647
33713
|
|
|
33648
33714
|
const {
|
|
33649
33715
|
value,
|
|
@@ -33914,9 +33980,9 @@ class option_Option extends external_root_React_commonjs2_react_commonjs_react_a
|
|
|
33914
33980
|
const {
|
|
33915
33981
|
props
|
|
33916
33982
|
} = this;
|
|
33917
|
-
const
|
|
33983
|
+
const isDisabled = props.disabled;
|
|
33918
33984
|
|
|
33919
|
-
if (!
|
|
33985
|
+
if (!isDisabled) {
|
|
33920
33986
|
props.onSelect(assign_default()(assign_default()({}, rest), {
|
|
33921
33987
|
value,
|
|
33922
33988
|
label: label || children
|
|
@@ -42910,6 +42976,10 @@ cardGroup_CardGroup.defaultProps = {
|
|
|
42910
42976
|
var lodash_flatten = __webpack_require__("1xil");
|
|
42911
42977
|
var flatten_default = /*#__PURE__*/__webpack_require__.n(lodash_flatten);
|
|
42912
42978
|
|
|
42979
|
+
// EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/lodash/isSet.js
|
|
42980
|
+
var isSet = __webpack_require__("/iLo");
|
|
42981
|
+
var isSet_default = /*#__PURE__*/__webpack_require__.n(isSet);
|
|
42982
|
+
|
|
42913
42983
|
// EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/@babel/runtime-corejs3/core-js-stable/promise.js
|
|
42914
42984
|
var promise = __webpack_require__("kNzS");
|
|
42915
42985
|
var promise_default = /*#__PURE__*/__webpack_require__.n(promise);
|
|
@@ -46867,6 +46937,7 @@ tagInput_TagInput.defaultProps = {
|
|
|
46867
46937
|
|
|
46868
46938
|
|
|
46869
46939
|
|
|
46940
|
+
|
|
46870
46941
|
|
|
46871
46942
|
|
|
46872
46943
|
const cascader_prefixcls = cascader_constants_cssClasses.PREFIX;
|
|
@@ -47559,6 +47630,10 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
47559
47630
|
realKeys = formatKeys;
|
|
47560
47631
|
}
|
|
47561
47632
|
|
|
47633
|
+
if (isSet_default()(realKeys)) {
|
|
47634
|
+
realKeys = [...realKeys];
|
|
47635
|
+
}
|
|
47636
|
+
|
|
47562
47637
|
const calRes = calcCheckedKeys(flatten_default()(realKeys), keyEntities);
|
|
47563
47638
|
const checkedKeys = new set_default.a(calRes.checkedKeys);
|
|
47564
47639
|
const halfCheckedKeys = new set_default.a(calRes.halfCheckedKeys); // disableStrictly
|
|
@@ -52709,6 +52784,24 @@ function getDefaultFormatTokenByType(type) {
|
|
|
52709
52784
|
class foundation_DatePickerFoundation extends foundation {
|
|
52710
52785
|
constructor(adapter) {
|
|
52711
52786
|
super(assign_default()({}, adapter));
|
|
52787
|
+
/**
|
|
52788
|
+
* clear range input focus when open is controlled
|
|
52789
|
+
* fixed github 1375
|
|
52790
|
+
*/
|
|
52791
|
+
|
|
52792
|
+
this.clearRangeInputFocus = () => {
|
|
52793
|
+
const {
|
|
52794
|
+
type
|
|
52795
|
+
} = this._adapter.getProps();
|
|
52796
|
+
|
|
52797
|
+
const {
|
|
52798
|
+
rangeInputFocus
|
|
52799
|
+
} = this._adapter.getStates();
|
|
52800
|
+
|
|
52801
|
+
if (type === 'dateTimeRange' && rangeInputFocus) {
|
|
52802
|
+
this._adapter.setRangeInputFocus(false);
|
|
52803
|
+
}
|
|
52804
|
+
};
|
|
52712
52805
|
|
|
52713
52806
|
this.getMergedMotion = motion => {
|
|
52714
52807
|
const mergedMotion = typeof motion === 'undefined' || motion ? assign_default()(assign_default()({}, motion), {
|
|
@@ -54449,10 +54542,6 @@ function addMonths(dirtyDate, dirtyAmount) {
|
|
|
54449
54542
|
return date;
|
|
54450
54543
|
}
|
|
54451
54544
|
}
|
|
54452
|
-
// EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/lodash/isSet.js
|
|
54453
|
-
var isSet = __webpack_require__("/iLo");
|
|
54454
|
-
var isSet_default = /*#__PURE__*/__webpack_require__.n(isSet);
|
|
54455
|
-
|
|
54456
54545
|
// CONCATENATED MODULE: /home/runner/work/semi-design/semi-design/node_modules/date-fns/esm/differenceInCalendarMonths/index.js
|
|
54457
54546
|
|
|
54458
54547
|
|
|
@@ -59809,6 +59898,10 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
|
|
|
59809
59898
|
|
|
59810
59899
|
if (prevProps.open !== this.props.open) {
|
|
59811
59900
|
this.foundation.initPanelOpenStatus();
|
|
59901
|
+
|
|
59902
|
+
if (!this.props.open) {
|
|
59903
|
+
this.foundation.clearRangeInputFocus();
|
|
59904
|
+
}
|
|
59812
59905
|
}
|
|
59813
59906
|
}
|
|
59814
59907
|
|
|
@@ -59980,14 +60073,18 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
|
|
|
59980
60073
|
onRangeEndTabPress: this.handleRangeEndTabPress
|
|
59981
60074
|
});
|
|
59982
60075
|
|
|
59983
|
-
return
|
|
59984
|
-
|
|
59985
|
-
|
|
59986
|
-
|
|
59987
|
-
|
|
59988
|
-
|
|
59989
|
-
|
|
59990
|
-
|
|
60076
|
+
return (
|
|
60077
|
+
/*#__PURE__*/
|
|
60078
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events
|
|
60079
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
60080
|
+
onClick: this.handleTriggerWrapperClick,
|
|
60081
|
+
className: inputCls
|
|
60082
|
+
}, typeof triggerRender === 'function' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(trigger_0, assign_default()({}, props, {
|
|
60083
|
+
triggerRender: triggerRender,
|
|
60084
|
+
componentName: "DatePicker",
|
|
60085
|
+
componentProps: assign_default()({}, this.props)
|
|
60086
|
+
})) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(dateInput_DateInput, assign_default()({}, props)))
|
|
60087
|
+
);
|
|
59991
60088
|
}
|
|
59992
60089
|
|
|
59993
60090
|
render() {
|
|
@@ -64054,7 +64151,7 @@ class textarea_TextArea extends baseComponent_BaseComponent {
|
|
|
64054
64151
|
["".concat(textarea_prefixCls, "-textarea-showClear")]: showClear
|
|
64055
64152
|
});
|
|
64056
64153
|
|
|
64057
|
-
const itemProps = assign_default()(assign_default()({}, omit_default()(rest, 'insetLabel', 'getValueLength', 'onClear', 'showClear')), {
|
|
64154
|
+
const itemProps = assign_default()(assign_default()({}, omit_default()(rest, 'insetLabel', 'insetLabelId', 'getValueLength', 'onClear', 'showClear')), {
|
|
64058
64155
|
className: itemCls,
|
|
64059
64156
|
disabled,
|
|
64060
64157
|
readOnly: readonly,
|
|
@@ -72353,8 +72450,9 @@ class foundation_SelectFoundation extends foundation {
|
|
|
72353
72450
|
} // console.log('new:' + index);
|
|
72354
72451
|
|
|
72355
72452
|
|
|
72356
|
-
this._adapter.updateFocusIndex(index);
|
|
72453
|
+
this._adapter.updateFocusIndex(index);
|
|
72357
72454
|
|
|
72455
|
+
this._adapter.updateScrollTop(index);
|
|
72358
72456
|
}
|
|
72359
72457
|
|
|
72360
72458
|
_handleArrowKeyDown(offset) {
|
|
@@ -72916,9 +73014,9 @@ const VirtualRow = _ref => {
|
|
|
72916
73014
|
style
|
|
72917
73015
|
} = _ref;
|
|
72918
73016
|
const {
|
|
72919
|
-
|
|
73017
|
+
visibleOptions
|
|
72920
73018
|
} = data;
|
|
72921
|
-
const option =
|
|
73019
|
+
const option = visibleOptions[index];
|
|
72922
73020
|
return data.renderOption(option, index, style);
|
|
72923
73021
|
};
|
|
72924
73022
|
|
|
@@ -73256,11 +73354,19 @@ class select_Select extends baseComponent_BaseComponent {
|
|
|
73256
73354
|
el.focus();
|
|
73257
73355
|
} catch (error) {}
|
|
73258
73356
|
},
|
|
73259
|
-
updateScrollTop:
|
|
73260
|
-
var
|
|
73357
|
+
updateScrollTop: index => {
|
|
73358
|
+
var _context10, _context11;
|
|
73261
73359
|
|
|
73262
73360
|
// eslint-disable-next-line max-len
|
|
73263
|
-
let
|
|
73361
|
+
let optionClassName = ".".concat(select_prefixcls, "-option-selected");
|
|
73362
|
+
|
|
73363
|
+
if (index !== undefined) {
|
|
73364
|
+
var _context9;
|
|
73365
|
+
|
|
73366
|
+
optionClassName = concat_default()(_context9 = ".".concat(select_prefixcls, "-option:nth-child(")).call(_context9, index, ")");
|
|
73367
|
+
}
|
|
73368
|
+
|
|
73369
|
+
let destNode = document.querySelector(concat_default()(_context10 = concat_default()(_context11 = "#".concat(select_prefixcls, "-")).call(_context11, this.selectOptionListID, " ")).call(_context10, optionClassName));
|
|
73264
73370
|
|
|
73265
73371
|
if (is_array_default()(destNode)) {
|
|
73266
73372
|
// eslint-disable-next-line prefer-destructuring
|
|
@@ -73288,11 +73394,11 @@ class select_Select extends baseComponent_BaseComponent {
|
|
|
73288
73394
|
}
|
|
73289
73395
|
|
|
73290
73396
|
componentDidUpdate(prevProps, prevState) {
|
|
73291
|
-
var
|
|
73397
|
+
var _context12, _context13;
|
|
73292
73398
|
|
|
73293
|
-
const prevChildrenKeys = map_default()(
|
|
73399
|
+
const prevChildrenKeys = map_default()(_context12 = external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Children.toArray(prevProps.children)).call(_context12, child => child.key);
|
|
73294
73400
|
|
|
73295
|
-
const nowChildrenKeys = map_default()(
|
|
73401
|
+
const nowChildrenKeys = map_default()(_context13 = external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Children.toArray(this.props.children)).call(_context13, child => child.key);
|
|
73296
73402
|
|
|
73297
73403
|
let isOptionsChanged = false;
|
|
73298
73404
|
|
|
@@ -73486,34 +73592,30 @@ class select_Select extends baseComponent_BaseComponent {
|
|
|
73486
73592
|
this.foundation.handleOptionMouseEnter(optionIndex);
|
|
73487
73593
|
}
|
|
73488
73594
|
|
|
73489
|
-
renderWithGroup(
|
|
73595
|
+
renderWithGroup(visibleOptions) {
|
|
73490
73596
|
const content = [];
|
|
73491
73597
|
const groupStatus = new core_js_stable_map_default.a();
|
|
73492
73598
|
|
|
73493
|
-
for_each_default()(
|
|
73599
|
+
for_each_default()(visibleOptions).call(visibleOptions, (option, optionIndex) => {
|
|
73494
73600
|
const parentGroup = option._parentGroup;
|
|
73495
73601
|
const optionContent = this.renderOption(option, optionIndex);
|
|
73496
73602
|
|
|
73497
|
-
if (parentGroup && groupStatus.has(parentGroup.label)) {
|
|
73498
|
-
// group content already insert
|
|
73499
|
-
content.push(optionContent);
|
|
73500
|
-
} else if (parentGroup) {
|
|
73603
|
+
if (parentGroup && !groupStatus.has(parentGroup.label)) {
|
|
73604
|
+
// when use with OptionGroup and group content not already insert
|
|
73501
73605
|
const groupContent = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(optionGroup, assign_default()({}, parentGroup, {
|
|
73502
73606
|
key: parentGroup.label
|
|
73503
73607
|
}));
|
|
73504
73608
|
groupStatus.set(parentGroup.label, true);
|
|
73505
73609
|
content.push(groupContent);
|
|
73506
|
-
content.push(optionContent);
|
|
73507
|
-
} else {
|
|
73508
|
-
// when not use with OptionGroup
|
|
73509
|
-
content.push(optionContent);
|
|
73510
73610
|
}
|
|
73611
|
+
|
|
73612
|
+
content.push(optionContent);
|
|
73511
73613
|
});
|
|
73512
73614
|
|
|
73513
73615
|
return content;
|
|
73514
73616
|
}
|
|
73515
73617
|
|
|
73516
|
-
renderVirtualizeList(
|
|
73618
|
+
renderVirtualizeList(visibleOptions) {
|
|
73517
73619
|
const {
|
|
73518
73620
|
virtualize
|
|
73519
73621
|
} = this.props;
|
|
@@ -73528,10 +73630,10 @@ class select_Select extends baseComponent_BaseComponent {
|
|
|
73528
73630
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(FixedSizeList, {
|
|
73529
73631
|
ref: this.virtualizeListRef,
|
|
73530
73632
|
height: height || select_constants_numbers.LIST_HEIGHT,
|
|
73531
|
-
itemCount:
|
|
73633
|
+
itemCount: visibleOptions.length,
|
|
73532
73634
|
itemSize: itemSize,
|
|
73533
73635
|
itemData: {
|
|
73534
|
-
|
|
73636
|
+
visibleOptions,
|
|
73535
73637
|
renderOption: this.renderOption
|
|
73536
73638
|
},
|
|
73537
73639
|
width: width || '100%',
|
|
@@ -73542,7 +73644,7 @@ class select_Select extends baseComponent_BaseComponent {
|
|
|
73542
73644
|
}
|
|
73543
73645
|
|
|
73544
73646
|
renderOptions(children) {
|
|
73545
|
-
var
|
|
73647
|
+
var _context14;
|
|
73546
73648
|
|
|
73547
73649
|
const {
|
|
73548
73650
|
dropdownMinWidth,
|
|
@@ -73562,12 +73664,12 @@ class select_Select extends baseComponent_BaseComponent {
|
|
|
73562
73664
|
multiple
|
|
73563
73665
|
} = this.props; // Do a filter first, instead of directly judging in forEach, so that the focusIndex can correspond to
|
|
73564
73666
|
|
|
73565
|
-
const
|
|
73667
|
+
const visibleOptions = filter_default()(options).call(options, item => item._show);
|
|
73566
73668
|
|
|
73567
|
-
let listContent = this.renderWithGroup(
|
|
73669
|
+
let listContent = this.renderWithGroup(visibleOptions);
|
|
73568
73670
|
|
|
73569
73671
|
if (virtualize) {
|
|
73570
|
-
listContent = this.renderVirtualizeList(
|
|
73672
|
+
listContent = this.renderVirtualizeList(visibleOptions);
|
|
73571
73673
|
}
|
|
73572
73674
|
|
|
73573
73675
|
const style = assign_default()({
|
|
@@ -73580,7 +73682,7 @@ class select_Select extends baseComponent_BaseComponent {
|
|
|
73580
73682
|
});
|
|
73581
73683
|
const isEmpty = !options.length || !some_default()(options).call(options, item => item._show);
|
|
73582
73684
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
73583
|
-
id: concat_default()(
|
|
73685
|
+
id: concat_default()(_context14 = "".concat(select_prefixcls, "-")).call(_context14, this.selectOptionListID),
|
|
73584
73686
|
className: dropdownClassName,
|
|
73585
73687
|
style: style
|
|
73586
73688
|
}, outerTopSlot, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
@@ -73811,7 +73913,7 @@ class select_Select extends baseComponent_BaseComponent {
|
|
|
73811
73913
|
}
|
|
73812
73914
|
|
|
73813
73915
|
renderSelection() {
|
|
73814
|
-
var
|
|
73916
|
+
var _context15;
|
|
73815
73917
|
|
|
73816
73918
|
const {
|
|
73817
73919
|
disabled,
|
|
@@ -73895,7 +73997,7 @@ class select_Select extends baseComponent_BaseComponent {
|
|
|
73895
73997
|
role: "combobox",
|
|
73896
73998
|
"aria-disabled": disabled,
|
|
73897
73999
|
"aria-expanded": isOpen,
|
|
73898
|
-
"aria-controls": concat_default()(
|
|
74000
|
+
"aria-controls": concat_default()(_context15 = "".concat(select_prefixcls, "-")).call(_context15, this.selectOptionListID),
|
|
73899
74001
|
"aria-haspopup": "listbox",
|
|
73900
74002
|
"aria-label": "select value",
|
|
73901
74003
|
"aria-invalid": this.props['aria-invalid'],
|
|
@@ -77383,7 +77485,7 @@ class foundation_SliderFoundation extends foundation {
|
|
|
77383
77485
|
|
|
77384
77486
|
const scroll = node => regex.test(style(node, 'overflow') + style(node, 'overflow-y') + style(node, 'overflow-x'));
|
|
77385
77487
|
|
|
77386
|
-
const scrollParent = node => !node || node === document.body ? document.body : scroll(node) ? node : scrollParent(node.parentNode);
|
|
77488
|
+
const scrollParent = node => !node || node === document.body || !(node instanceof Element) ? document.body : scroll(node) ? node : scrollParent(node.parentNode);
|
|
77387
77489
|
|
|
77388
77490
|
return scrollParent(el);
|
|
77389
77491
|
};
|
|
@@ -77507,7 +77609,7 @@ class foundation_SliderFoundation extends foundation {
|
|
|
77507
77609
|
}
|
|
77508
77610
|
|
|
77509
77611
|
if (step !== 1) {
|
|
77510
|
-
// Find nearest step point
|
|
77612
|
+
// Find nearest step point
|
|
77511
77613
|
stepValue = Math.round(stepValue / step) * step;
|
|
77512
77614
|
}
|
|
77513
77615
|
|
|
@@ -80144,7 +80246,10 @@ function assignColumnKeys(columns) {
|
|
|
80144
80246
|
if (column.key == null) {
|
|
80145
80247
|
var _context4;
|
|
80146
80248
|
|
|
80147
|
-
|
|
80249
|
+
// if user give column a dataIndex, use it for backup
|
|
80250
|
+
const _index = column.dataIndex || index;
|
|
80251
|
+
|
|
80252
|
+
column.key = concat_default()(_context4 = "".concat(level, "-")).call(_context4, _index);
|
|
80148
80253
|
}
|
|
80149
80254
|
|
|
80150
80255
|
if (is_array_default()(column[childrenColumnName]) && column[childrenColumnName].length) {
|
|
@@ -80705,7 +80810,17 @@ class foundation_TableFoundation extends foundation {
|
|
|
80705
80810
|
|
|
80706
80811
|
|
|
80707
80812
|
getFilteredSortedDataSource(dataSource, queries) {
|
|
80708
|
-
const filteredDataSource = this.filterDataSource(dataSource, filter_default()(queries).call(queries, query =>
|
|
80813
|
+
const filteredDataSource = this.filterDataSource(dataSource, filter_default()(queries).call(queries, query => {
|
|
80814
|
+
/**
|
|
80815
|
+
* 这里无需判断 filteredValue 是否为数组,初始化时它是 `undefined`,点击选择空时为 `[]`
|
|
80816
|
+
* 初始化时我们应该用 `defaultFilteredValue`,点击后我们应该用 `filteredValue`
|
|
80817
|
+
*
|
|
80818
|
+
* 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
|
|
80819
|
+
* When initializing we should use `defaultFilteredValue`, after clicking we should use `filteredValue`
|
|
80820
|
+
*/
|
|
80821
|
+
const currentFilteredValue = query.filteredValue ? query.filteredValue : query.defaultFilteredValue;
|
|
80822
|
+
return isFunction_default()(query.onFilter) && is_array_default()(query.filters) && query.filters.length && is_array_default()(currentFilteredValue) && currentFilteredValue.length;
|
|
80823
|
+
}));
|
|
80709
80824
|
const sortedDataSource = this.sortDataSource(filteredDataSource, filter_default()(queries).call(queries, query => query && isFunction_default()(query.sorter)));
|
|
80710
80825
|
return sortedDataSource;
|
|
80711
80826
|
}
|
|
@@ -80864,10 +80979,12 @@ class foundation_TableFoundation extends foundation {
|
|
|
80864
80979
|
const {
|
|
80865
80980
|
onFilter,
|
|
80866
80981
|
filteredValue,
|
|
80867
|
-
filterChildrenRecord
|
|
80982
|
+
filterChildrenRecord,
|
|
80983
|
+
defaultFilteredValue
|
|
80868
80984
|
} = filterObj;
|
|
80985
|
+
const currentFilteredValue = is_array_default()(filteredValue) ? filteredValue : defaultFilteredValue;
|
|
80869
80986
|
|
|
80870
|
-
if (typeof onFilter === 'function' && is_array_default()(
|
|
80987
|
+
if (typeof onFilter === 'function' && is_array_default()(currentFilteredValue) && currentFilteredValue.length) {
|
|
80871
80988
|
hasValidFilters = true;
|
|
80872
80989
|
|
|
80873
80990
|
if (filteredData === null) {
|
|
@@ -80877,7 +80994,7 @@ class foundation_TableFoundation extends foundation {
|
|
|
80877
80994
|
filteredData = new core_js_stable_map_default.a();
|
|
80878
80995
|
}
|
|
80879
80996
|
|
|
80880
|
-
each_default()(
|
|
80997
|
+
each_default()(currentFilteredValue, value => {
|
|
80881
80998
|
each_default()(dataSource, record => {
|
|
80882
80999
|
const childrenRecords = get_default()(record, childrenRecordName);
|
|
80883
81000
|
|
|
@@ -85687,10 +85804,17 @@ class Table_Table extends baseComponent_BaseComponent {
|
|
|
85687
85804
|
titleArr.push(sorter);
|
|
85688
85805
|
}
|
|
85689
85806
|
|
|
85807
|
+
const stateFilteredValue = get_default()(curQuery, 'filteredValue');
|
|
85808
|
+
|
|
85809
|
+
const defaultFilteredValue = get_default()(curQuery, 'defaultFilteredValue');
|
|
85810
|
+
|
|
85811
|
+
const filteredValue = stateFilteredValue ? stateFilteredValue : defaultFilteredValue;
|
|
85812
|
+
|
|
85690
85813
|
if (is_array_default()(column.filters) && column.filters.length || /*#__PURE__*/Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["isValidElement"])(column.filterDropdown)) {
|
|
85691
85814
|
const filter = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(ColumnFilter, assign_default()({
|
|
85692
85815
|
key: table_constants_strings.DEFAULT_KEY_COLUMN_FILTER
|
|
85693
85816
|
}, curQuery, {
|
|
85817
|
+
filteredValue: filteredValue,
|
|
85694
85818
|
onFilterDropdownVisibleChange: visible => _this.foundation.toggleShowFilter(dataIndex, visible),
|
|
85695
85819
|
onSelect: data => _this.foundation.handleFilterSelect(dataIndex, data)
|
|
85696
85820
|
}));
|
|
@@ -86279,11 +86403,12 @@ class Table_Table extends baseComponent_BaseComponent {
|
|
|
86279
86403
|
willUpdateStates.cachedColumns = props.columns;
|
|
86280
86404
|
willUpdateStates.cachedChildren = null;
|
|
86281
86405
|
} else if (props.children && props.children !== state.cachedChildren) {
|
|
86282
|
-
const
|
|
86406
|
+
const newNestedColumns = getColumns(props.children);
|
|
86407
|
+
const newFlattenColumns = flattenColumns(newNestedColumns);
|
|
86283
86408
|
const columns = mergeColumns(state.queries, newFlattenColumns, null, false);
|
|
86284
86409
|
willUpdateStates.flattenColumns = newFlattenColumns;
|
|
86285
86410
|
willUpdateStates.queries = [...columns];
|
|
86286
|
-
willUpdateStates.cachedColumns = [...
|
|
86411
|
+
willUpdateStates.cachedColumns = [...newNestedColumns];
|
|
86287
86412
|
willUpdateStates.cachedChildren = props.children;
|
|
86288
86413
|
} // Update controlled selection column
|
|
86289
86414
|
|
|
@@ -89514,6 +89639,7 @@ class TimePicker_TimePicker extends baseComponent_BaseComponent {
|
|
|
89514
89639
|
panelFooter,
|
|
89515
89640
|
rangeSeparator,
|
|
89516
89641
|
onOpenChange,
|
|
89642
|
+
onChangeWithDateFirst,
|
|
89517
89643
|
popupClassName: propPopupClassName,
|
|
89518
89644
|
hideDisabledOptions,
|
|
89519
89645
|
use12Hours,
|
|
@@ -89525,7 +89651,7 @@ class TimePicker_TimePicker extends baseComponent_BaseComponent {
|
|
|
89525
89651
|
motion,
|
|
89526
89652
|
autoAdjustOverflow
|
|
89527
89653
|
} = _a,
|
|
89528
|
-
rest = TimePicker_rest(_a, ["prefixCls", "placeholder", "disabled", "defaultValue", "className", "popupStyle", "size", "style", "locale", "localeCode", "zIndex", "getPopupContainer", "insetLabel", "insetLabelId", "inputStyle", "showClear", "panelHeader", "panelFooter", "rangeSeparator", "onOpenChange", "popupClassName", "hideDisabledOptions", "use12Hours", "minuteStep", "hourStep", "secondStep", "scrollItemProps", "triggerRender", "motion", "autoAdjustOverflow"]);
|
|
89654
|
+
rest = TimePicker_rest(_a, ["prefixCls", "placeholder", "disabled", "defaultValue", "className", "popupStyle", "size", "style", "locale", "localeCode", "zIndex", "getPopupContainer", "insetLabel", "insetLabelId", "inputStyle", "showClear", "panelHeader", "panelFooter", "rangeSeparator", "onOpenChange", "onChangeWithDateFirst", "popupClassName", "hideDisabledOptions", "use12Hours", "minuteStep", "hourStep", "secondStep", "scrollItemProps", "triggerRender", "motion", "autoAdjustOverflow"]);
|
|
89529
89655
|
|
|
89530
89656
|
const format = this.foundation.getDefaultFormatIfNeed();
|
|
89531
89657
|
const position = this.foundation.getPosition();
|
|
@@ -90546,6 +90672,7 @@ class foundation_TreeFoundation extends foundation {
|
|
|
90546
90672
|
selectedKeys = [],
|
|
90547
90673
|
checkedKeys = new set_default.a([]),
|
|
90548
90674
|
halfCheckedKeys = new set_default.a([]),
|
|
90675
|
+
realCheckedKeys = new set_default.a([]),
|
|
90549
90676
|
keyEntities = {},
|
|
90550
90677
|
filteredKeys = new set_default.a([]),
|
|
90551
90678
|
inputValue = '',
|
|
@@ -90555,13 +90682,26 @@ class foundation_TreeFoundation extends foundation {
|
|
|
90555
90682
|
disabledKeys = new set_default.a([])
|
|
90556
90683
|
} = this.getStates();
|
|
90557
90684
|
const {
|
|
90558
|
-
treeNodeFilterProp
|
|
90685
|
+
treeNodeFilterProp,
|
|
90686
|
+
checkRelation
|
|
90559
90687
|
} = this.getProps();
|
|
90560
90688
|
const entity = keyEntities[key];
|
|
90561
90689
|
const notExist = !entity;
|
|
90562
90690
|
|
|
90563
90691
|
if (notExist) {
|
|
90564
90692
|
return null;
|
|
90693
|
+
} // if checkRelation is invalid, the checked status of node will be false
|
|
90694
|
+
|
|
90695
|
+
|
|
90696
|
+
let realChecked = false;
|
|
90697
|
+
let realHalfChecked = false;
|
|
90698
|
+
|
|
90699
|
+
if (checkRelation === 'related') {
|
|
90700
|
+
realChecked = checkedKeys.has(key);
|
|
90701
|
+
realHalfChecked = halfCheckedKeys.has(key);
|
|
90702
|
+
} else if (checkRelation === 'unRelated') {
|
|
90703
|
+
realChecked = realCheckedKeys.has(key);
|
|
90704
|
+
realHalfChecked = false;
|
|
90565
90705
|
}
|
|
90566
90706
|
|
|
90567
90707
|
const isSearching = Boolean(inputValue);
|
|
@@ -90569,8 +90709,8 @@ class foundation_TreeFoundation extends foundation {
|
|
|
90569
90709
|
eventKey: key,
|
|
90570
90710
|
expanded: isSearching ? filteredExpandedKeys.has(key) : expandedKeys.has(key),
|
|
90571
90711
|
selected: includes_default()(selectedKeys).call(selectedKeys, key),
|
|
90572
|
-
checked:
|
|
90573
|
-
halfChecked:
|
|
90712
|
+
checked: realChecked,
|
|
90713
|
+
halfChecked: realHalfChecked,
|
|
90574
90714
|
pos: String(entity ? entity.pos : ''),
|
|
90575
90715
|
level: entity.level,
|
|
90576
90716
|
filtered: filteredKeys.has(key),
|
|
@@ -90604,10 +90744,17 @@ class foundation_TreeFoundation extends foundation {
|
|
|
90604
90744
|
keyEntities
|
|
90605
90745
|
} = this.getStates();
|
|
90606
90746
|
const {
|
|
90607
|
-
leafOnly
|
|
90747
|
+
leafOnly,
|
|
90748
|
+
checkRelation
|
|
90608
90749
|
} = this.getProps();
|
|
90609
90750
|
let value;
|
|
90610
|
-
|
|
90751
|
+
let keyList = [];
|
|
90752
|
+
|
|
90753
|
+
if (checkRelation === 'related') {
|
|
90754
|
+
keyList = normalizeKeyList(key, keyEntities, leafOnly);
|
|
90755
|
+
} else if (checkRelation === 'unRelated') {
|
|
90756
|
+
keyList = key;
|
|
90757
|
+
}
|
|
90611
90758
|
|
|
90612
90759
|
if (this.getProp('onChangeWithObject')) {
|
|
90613
90760
|
value = map_default()(keyList).call(keyList, itemKey => keyEntities[itemKey].data);
|
|
@@ -90822,30 +90969,58 @@ class foundation_TreeFoundation extends foundation {
|
|
|
90822
90969
|
|
|
90823
90970
|
handleMultipleSelect(e, treeNode) {
|
|
90824
90971
|
const {
|
|
90825
|
-
disableStrictly
|
|
90826
|
-
|
|
90972
|
+
disableStrictly,
|
|
90973
|
+
checkRelation
|
|
90974
|
+
} = this.getProps();
|
|
90975
|
+
const {
|
|
90976
|
+
realCheckedKeys
|
|
90977
|
+
} = this.getStates(); // eventKey: The key value of the currently clicked node
|
|
90827
90978
|
|
|
90828
90979
|
const {
|
|
90829
90980
|
checked,
|
|
90830
90981
|
eventKey,
|
|
90831
90982
|
data
|
|
90832
|
-
} = treeNode;
|
|
90983
|
+
} = treeNode;
|
|
90833
90984
|
|
|
90834
|
-
|
|
90835
|
-
|
|
90836
|
-
|
|
90837
|
-
|
|
90838
|
-
|
|
90985
|
+
if (checkRelation === 'related') {
|
|
90986
|
+
// Find the checked state of the current node
|
|
90987
|
+
const targetStatus = disableStrictly ? this.calcChekcedStatus(!checked, eventKey) : !checked;
|
|
90988
|
+
const {
|
|
90989
|
+
checkedKeys,
|
|
90990
|
+
halfCheckedKeys
|
|
90991
|
+
} = disableStrictly ? this.calcNonDisabedCheckedKeys(eventKey, targetStatus) : this.calcCheckedKeys(eventKey, targetStatus);
|
|
90839
90992
|
|
|
90840
|
-
|
|
90993
|
+
this._adapter.notifySelect(eventKey, targetStatus, data);
|
|
90841
90994
|
|
|
90842
|
-
|
|
90995
|
+
this.notifyChange([...checkedKeys], e);
|
|
90843
90996
|
|
|
90844
|
-
|
|
90845
|
-
|
|
90846
|
-
|
|
90847
|
-
|
|
90848
|
-
|
|
90997
|
+
if (!this._isControlledComponent()) {
|
|
90998
|
+
this._adapter.updateState({
|
|
90999
|
+
checkedKeys,
|
|
91000
|
+
halfCheckedKeys
|
|
91001
|
+
});
|
|
91002
|
+
}
|
|
91003
|
+
} else if (checkRelation === 'unRelated') {
|
|
91004
|
+
const newRealCheckedKeys = new set_default.a(realCheckedKeys);
|
|
91005
|
+
let targetStatus;
|
|
91006
|
+
|
|
91007
|
+
if (realCheckedKeys.has(eventKey)) {
|
|
91008
|
+
newRealCheckedKeys.delete(eventKey);
|
|
91009
|
+
targetStatus = false;
|
|
91010
|
+
} else {
|
|
91011
|
+
newRealCheckedKeys.add(eventKey);
|
|
91012
|
+
targetStatus = true;
|
|
91013
|
+
}
|
|
91014
|
+
|
|
91015
|
+
this._adapter.notifySelect(eventKey, targetStatus, data);
|
|
91016
|
+
|
|
91017
|
+
this.notifyChange([...newRealCheckedKeys], e);
|
|
91018
|
+
|
|
91019
|
+
if (!this._isControlledComponent()) {
|
|
91020
|
+
this._adapter.updateState({
|
|
91021
|
+
realCheckedKeys: newRealCheckedKeys
|
|
91022
|
+
});
|
|
91023
|
+
}
|
|
90849
91024
|
}
|
|
90850
91025
|
}
|
|
90851
91026
|
|
|
@@ -92256,6 +92431,7 @@ class tree_Tree extends baseComponent_BaseComponent {
|
|
|
92256
92431
|
selectedKeys: [],
|
|
92257
92432
|
checkedKeys: new set_default.a(),
|
|
92258
92433
|
halfCheckedKeys: new set_default.a(),
|
|
92434
|
+
realCheckedKeys: new set_default.a([]),
|
|
92259
92435
|
motionKeys: new set_default.a([]),
|
|
92260
92436
|
motionType: 'hide',
|
|
92261
92437
|
expandedKeys: new set_default.a(props.expandedKeys),
|
|
@@ -92466,12 +92642,16 @@ class tree_Tree extends baseComponent_BaseComponent {
|
|
|
92466
92642
|
}
|
|
92467
92643
|
|
|
92468
92644
|
if (checkedKeyValues) {
|
|
92469
|
-
|
|
92470
|
-
|
|
92471
|
-
|
|
92472
|
-
|
|
92473
|
-
|
|
92474
|
-
|
|
92645
|
+
if (props.checkRelation === 'unRelated') {
|
|
92646
|
+
newState.realCheckedKeys = new set_default.a(checkedKeyValues);
|
|
92647
|
+
} else if (props.checkRelation === 'related') {
|
|
92648
|
+
const {
|
|
92649
|
+
checkedKeys,
|
|
92650
|
+
halfCheckedKeys
|
|
92651
|
+
} = calcCheckedKeys(checkedKeyValues, keyEntities);
|
|
92652
|
+
newState.checkedKeys = checkedKeys;
|
|
92653
|
+
newState.halfCheckedKeys = halfCheckedKeys;
|
|
92654
|
+
}
|
|
92475
92655
|
}
|
|
92476
92656
|
} // update loadedKeys
|
|
92477
92657
|
|
|
@@ -92481,7 +92661,7 @@ class tree_Tree extends baseComponent_BaseComponent {
|
|
|
92481
92661
|
} // update disableStrictly
|
|
92482
92662
|
|
|
92483
92663
|
|
|
92484
|
-
if (treeData && props.disableStrictly) {
|
|
92664
|
+
if (treeData && props.disableStrictly && props.checkRelation === 'related') {
|
|
92485
92665
|
newState.disabledKeys = calcDisabledKeys(keyEntities);
|
|
92486
92666
|
}
|
|
92487
92667
|
|
|
@@ -92802,6 +92982,7 @@ tree_Tree.propTypes = {
|
|
|
92802
92982
|
onDragStart: prop_types_default.a.func,
|
|
92803
92983
|
onDrop: prop_types_default.a.func,
|
|
92804
92984
|
labelEllipsis: prop_types_default.a.bool,
|
|
92985
|
+
checkRelation: prop_types_default.a.string,
|
|
92805
92986
|
'aria-label': prop_types_default.a.string
|
|
92806
92987
|
};
|
|
92807
92988
|
tree_Tree.defaultProps = {
|
|
@@ -92821,7 +93002,8 @@ tree_Tree.defaultProps = {
|
|
|
92821
93002
|
expandAction: false,
|
|
92822
93003
|
disableStrictly: false,
|
|
92823
93004
|
draggable: false,
|
|
92824
|
-
autoExpandWhenDragEnter: true
|
|
93005
|
+
autoExpandWhenDragEnter: true,
|
|
93006
|
+
checkRelation: 'related'
|
|
92825
93007
|
};
|
|
92826
93008
|
tree_Tree.TreeNode = treeNode_TreeNode;
|
|
92827
93009
|
/* harmony default export */ var tree_0 = (tree_Tree);
|
|
@@ -92967,6 +93149,7 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
92967
93149
|
selectedKeys = [],
|
|
92968
93150
|
checkedKeys = new set_default.a([]),
|
|
92969
93151
|
halfCheckedKeys = new set_default.a([]),
|
|
93152
|
+
realCheckedKeys = new set_default.a([]),
|
|
92970
93153
|
keyEntities = {},
|
|
92971
93154
|
filteredKeys = new set_default.a([]),
|
|
92972
93155
|
inputValue = '',
|
|
@@ -92976,13 +93159,26 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
92976
93159
|
disabledKeys = new set_default.a([])
|
|
92977
93160
|
} = this.getStates();
|
|
92978
93161
|
const {
|
|
92979
|
-
treeNodeFilterProp
|
|
93162
|
+
treeNodeFilterProp,
|
|
93163
|
+
checkRelation
|
|
92980
93164
|
} = this.getProps();
|
|
92981
93165
|
const entity = keyEntities[key];
|
|
92982
93166
|
const notExist = !entity;
|
|
92983
93167
|
|
|
92984
93168
|
if (notExist) {
|
|
92985
93169
|
return null;
|
|
93170
|
+
} // if checkRelation is invalid, the checked status of node will be false
|
|
93171
|
+
|
|
93172
|
+
|
|
93173
|
+
let realChecked = false;
|
|
93174
|
+
let realHalfChecked = false;
|
|
93175
|
+
|
|
93176
|
+
if (checkRelation === 'related') {
|
|
93177
|
+
realChecked = checkedKeys.has(key);
|
|
93178
|
+
realHalfChecked = halfCheckedKeys.has(key);
|
|
93179
|
+
} else if (checkRelation === 'unRelated') {
|
|
93180
|
+
realChecked = realCheckedKeys.has(key);
|
|
93181
|
+
realHalfChecked = false;
|
|
92986
93182
|
}
|
|
92987
93183
|
|
|
92988
93184
|
const isSearching = Boolean(inputValue);
|
|
@@ -92990,8 +93186,8 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
92990
93186
|
eventKey: key,
|
|
92991
93187
|
expanded: isSearching ? filteredExpandedKeys.has(key) : expandedKeys.has(key),
|
|
92992
93188
|
selected: includes_default()(selectedKeys).call(selectedKeys, key),
|
|
92993
|
-
checked:
|
|
92994
|
-
halfChecked:
|
|
93189
|
+
checked: realChecked,
|
|
93190
|
+
halfChecked: realHalfChecked,
|
|
92995
93191
|
pos: String(entity ? entity.pos : ''),
|
|
92996
93192
|
level: entity.level,
|
|
92997
93193
|
filtered: filteredKeys.has(key),
|
|
@@ -93057,9 +93253,16 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93057
93253
|
keyEntities
|
|
93058
93254
|
} = this.getStates();
|
|
93059
93255
|
const {
|
|
93060
|
-
leafOnly
|
|
93256
|
+
leafOnly,
|
|
93257
|
+
checkRelation
|
|
93061
93258
|
} = this.getProps();
|
|
93062
|
-
|
|
93259
|
+
let keyList = [];
|
|
93260
|
+
|
|
93261
|
+
if (checkRelation === 'related') {
|
|
93262
|
+
keyList = normalizeKeyList(key, keyEntities, leafOnly);
|
|
93263
|
+
} else if (checkRelation === 'unRelated') {
|
|
93264
|
+
keyList = key;
|
|
93265
|
+
}
|
|
93063
93266
|
|
|
93064
93267
|
const nodes = map_default()(keyList).call(keyList, i => keyEntities[i].data);
|
|
93065
93268
|
|
|
@@ -93186,7 +93389,8 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93186
93389
|
this._adapter.updateState({
|
|
93187
93390
|
selectedKeys: [],
|
|
93188
93391
|
checkedKeys: new set_default.a(),
|
|
93189
|
-
halfCheckedKeys: new set_default.a()
|
|
93392
|
+
halfCheckedKeys: new set_default.a(),
|
|
93393
|
+
realCheckedKeys: new set_default.a([])
|
|
93190
93394
|
});
|
|
93191
93395
|
} // When triggerSearch, clicking the clear button will trigger to clear Input
|
|
93192
93396
|
|
|
@@ -93214,11 +93418,13 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93214
93418
|
|
|
93215
93419
|
removeTag(eventKey) {
|
|
93216
93420
|
const {
|
|
93217
|
-
disableStrictly
|
|
93421
|
+
disableStrictly,
|
|
93422
|
+
checkRelation
|
|
93218
93423
|
} = this.getProps();
|
|
93219
93424
|
const {
|
|
93220
93425
|
keyEntities,
|
|
93221
|
-
disabledKeys
|
|
93426
|
+
disabledKeys,
|
|
93427
|
+
realCheckedKeys
|
|
93222
93428
|
} = this.getStates();
|
|
93223
93429
|
const item = keyEntities[eventKey].data;
|
|
93224
93430
|
|
|
@@ -93226,20 +93432,35 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93226
93432
|
return;
|
|
93227
93433
|
}
|
|
93228
93434
|
|
|
93229
|
-
|
|
93230
|
-
|
|
93231
|
-
|
|
93232
|
-
} = this.calcCheckedKeys(eventKey, false);
|
|
93435
|
+
if (checkRelation === 'unRelated') {
|
|
93436
|
+
const newRealCheckedKeys = new set_default.a(realCheckedKeys);
|
|
93437
|
+
newRealCheckedKeys.delete(eventKey);
|
|
93233
93438
|
|
|
93234
|
-
|
|
93439
|
+
this._notifyChange([...newRealCheckedKeys], null);
|
|
93235
93440
|
|
|
93236
|
-
|
|
93237
|
-
|
|
93441
|
+
if (!this._isControlledComponent()) {
|
|
93442
|
+
this._adapter.updateState({
|
|
93443
|
+
realCheckedKeys: newRealCheckedKeys
|
|
93444
|
+
});
|
|
93445
|
+
|
|
93446
|
+
this._adapter.rePositionDropdown();
|
|
93447
|
+
}
|
|
93448
|
+
} else if (checkRelation === 'related') {
|
|
93449
|
+
const {
|
|
93238
93450
|
checkedKeys,
|
|
93239
93451
|
halfCheckedKeys
|
|
93240
|
-
});
|
|
93452
|
+
} = this.calcCheckedKeys(eventKey, false);
|
|
93241
93453
|
|
|
93242
|
-
this.
|
|
93454
|
+
this._notifyChange([...checkedKeys], null);
|
|
93455
|
+
|
|
93456
|
+
if (!this._isControlledComponent()) {
|
|
93457
|
+
this._adapter.updateState({
|
|
93458
|
+
checkedKeys,
|
|
93459
|
+
halfCheckedKeys
|
|
93460
|
+
});
|
|
93461
|
+
|
|
93462
|
+
this._adapter.rePositionDropdown();
|
|
93463
|
+
}
|
|
93243
93464
|
}
|
|
93244
93465
|
|
|
93245
93466
|
this._adapter.notifySelect(eventKey, false, item); // reposition dropdown when selected values change
|
|
@@ -93390,40 +93611,68 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93390
93611
|
handleMultipleSelect(e, treeNode) {
|
|
93391
93612
|
const {
|
|
93392
93613
|
searchPosition,
|
|
93393
|
-
disableStrictly
|
|
93614
|
+
disableStrictly,
|
|
93615
|
+
checkRelation
|
|
93394
93616
|
} = this.getProps();
|
|
93395
93617
|
const {
|
|
93396
|
-
inputValue
|
|
93618
|
+
inputValue,
|
|
93619
|
+
realCheckedKeys
|
|
93397
93620
|
} = this.getStates();
|
|
93398
93621
|
const {
|
|
93399
93622
|
checked,
|
|
93400
93623
|
eventKey,
|
|
93401
93624
|
data
|
|
93402
93625
|
} = treeNode;
|
|
93403
|
-
const targetStatus = disableStrictly ? this.calcChekcedStatus(!checked, eventKey) : !checked;
|
|
93404
|
-
const {
|
|
93405
|
-
checkedKeys,
|
|
93406
|
-
halfCheckedKeys
|
|
93407
|
-
} = disableStrictly ? this.calcNonDisabedCheckedKeys(eventKey, targetStatus) : this.calcCheckedKeys(eventKey, targetStatus);
|
|
93408
93626
|
|
|
93409
|
-
|
|
93627
|
+
if (checkRelation === 'related') {
|
|
93628
|
+
const targetStatus = disableStrictly ? this.calcChekcedStatus(!checked, eventKey) : !checked;
|
|
93629
|
+
const {
|
|
93630
|
+
checkedKeys,
|
|
93631
|
+
halfCheckedKeys
|
|
93632
|
+
} = disableStrictly ? this.calcNonDisabedCheckedKeys(eventKey, targetStatus) : this.calcCheckedKeys(eventKey, targetStatus);
|
|
93633
|
+
|
|
93634
|
+
this._adapter.notifySelect(eventKey, targetStatus, data);
|
|
93635
|
+
|
|
93636
|
+
this._notifyChange([...checkedKeys], e);
|
|
93637
|
+
|
|
93638
|
+
if (!this._isControlledComponent()) {
|
|
93639
|
+
this._adapter.updateState({
|
|
93640
|
+
checkedKeys,
|
|
93641
|
+
halfCheckedKeys
|
|
93642
|
+
});
|
|
93643
|
+
|
|
93644
|
+
this._adapter.rePositionDropdown();
|
|
93645
|
+
}
|
|
93646
|
+
} else if (checkRelation === 'unRelated') {
|
|
93647
|
+
const newRealCheckedKeys = new set_default.a(realCheckedKeys);
|
|
93648
|
+
let targetStatus;
|
|
93649
|
+
|
|
93650
|
+
if (realCheckedKeys.has(eventKey)) {
|
|
93651
|
+
newRealCheckedKeys.delete(eventKey);
|
|
93652
|
+
targetStatus = false;
|
|
93653
|
+
} else {
|
|
93654
|
+
newRealCheckedKeys.add(eventKey);
|
|
93655
|
+
targetStatus = true;
|
|
93656
|
+
}
|
|
93657
|
+
|
|
93658
|
+
this._adapter.notifySelect(eventKey, targetStatus, data);
|
|
93410
93659
|
|
|
93411
|
-
|
|
93660
|
+
this._notifyChange([...newRealCheckedKeys], e);
|
|
93661
|
+
|
|
93662
|
+
if (!this._isControlledComponent()) {
|
|
93663
|
+
this._adapter.updateState({
|
|
93664
|
+
realCheckedKeys: newRealCheckedKeys
|
|
93665
|
+
});
|
|
93666
|
+
|
|
93667
|
+
this._adapter.rePositionDropdown();
|
|
93668
|
+
}
|
|
93669
|
+
}
|
|
93412
93670
|
|
|
93413
93671
|
if (searchPosition === treeSelect_constants_strings.SEARCH_POSITION_TRIGGER && inputValue !== '') {
|
|
93414
93672
|
this._adapter.updateState({
|
|
93415
93673
|
inputValue: ''
|
|
93416
93674
|
});
|
|
93417
93675
|
}
|
|
93418
|
-
|
|
93419
|
-
if (!this._isControlledComponent()) {
|
|
93420
|
-
this._adapter.updateState({
|
|
93421
|
-
checkedKeys,
|
|
93422
|
-
halfCheckedKeys
|
|
93423
|
-
});
|
|
93424
|
-
|
|
93425
|
-
this._adapter.rePositionDropdown();
|
|
93426
|
-
}
|
|
93427
93676
|
}
|
|
93428
93677
|
|
|
93429
93678
|
calcNonDisabedCheckedKeys(eventKey, targetStatus) {
|
|
@@ -93750,34 +93999,52 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
93750
93999
|
this.foundation.handleSelectionEnterPress(e);
|
|
93751
94000
|
};
|
|
93752
94001
|
|
|
93753
|
-
this.
|
|
94002
|
+
this.hasValue = () => {
|
|
93754
94003
|
const {
|
|
93755
|
-
|
|
94004
|
+
multiple,
|
|
94005
|
+
checkRelation
|
|
93756
94006
|
} = this.props;
|
|
93757
94007
|
const {
|
|
93758
|
-
|
|
94008
|
+
realCheckedKeys,
|
|
94009
|
+
checkedKeys,
|
|
94010
|
+
selectedKeys
|
|
93759
94011
|
} = this.state;
|
|
93760
|
-
|
|
94012
|
+
let hasValue = false;
|
|
94013
|
+
|
|
94014
|
+
if (multiple) {
|
|
94015
|
+
if (checkRelation === 'related') {
|
|
94016
|
+
hasValue = Boolean(checkedKeys.size);
|
|
94017
|
+
} else if (checkRelation === 'unRelated') {
|
|
94018
|
+
hasValue = Boolean(realCheckedKeys.size);
|
|
94019
|
+
}
|
|
94020
|
+
} else {
|
|
94021
|
+
hasValue = Boolean(selectedKeys.length);
|
|
94022
|
+
}
|
|
94023
|
+
|
|
94024
|
+
return hasValue;
|
|
94025
|
+
};
|
|
94026
|
+
|
|
94027
|
+
this.showClearBtn = () => {
|
|
93761
94028
|
const {
|
|
93762
94029
|
showClear,
|
|
93763
94030
|
disabled,
|
|
93764
|
-
|
|
94031
|
+
searchPosition
|
|
93765
94032
|
} = this.props;
|
|
93766
94033
|
const {
|
|
93767
|
-
|
|
93768
|
-
checkedKeys,
|
|
94034
|
+
inputValue,
|
|
93769
94035
|
isOpen,
|
|
93770
94036
|
isHovering
|
|
93771
94037
|
} = this.state;
|
|
93772
|
-
const
|
|
93773
|
-
return showClear && (hasValue || triggerSearchHasInputValue) && !disabled && (isOpen || isHovering);
|
|
94038
|
+
const triggerSearchHasInputValue = searchPosition === treeSelect_constants_strings.SEARCH_POSITION_TRIGGER && inputValue;
|
|
94039
|
+
return showClear && (this.hasValue() || triggerSearchHasInputValue) && !disabled && (isOpen || isHovering);
|
|
93774
94040
|
};
|
|
93775
94041
|
|
|
93776
94042
|
this.renderTagList = () => {
|
|
93777
94043
|
const {
|
|
93778
94044
|
checkedKeys,
|
|
93779
94045
|
keyEntities,
|
|
93780
|
-
disabledKeys
|
|
94046
|
+
disabledKeys,
|
|
94047
|
+
realCheckedKeys
|
|
93781
94048
|
} = this.state;
|
|
93782
94049
|
const {
|
|
93783
94050
|
treeNodeLabelProp,
|
|
@@ -93785,13 +94052,21 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
93785
94052
|
disabled,
|
|
93786
94053
|
disableStrictly,
|
|
93787
94054
|
size,
|
|
94055
|
+
checkRelation,
|
|
93788
94056
|
renderSelectedItem: propRenderSelectedItem
|
|
93789
94057
|
} = this.props;
|
|
93790
94058
|
const renderSelectedItem = isFunction_default()(propRenderSelectedItem) ? propRenderSelectedItem : item => ({
|
|
93791
94059
|
isRenderInTag: true,
|
|
93792
94060
|
content: get_default()(item, treeNodeLabelProp, null)
|
|
93793
94061
|
});
|
|
93794
|
-
|
|
94062
|
+
let renderKeys = [];
|
|
94063
|
+
|
|
94064
|
+
if (checkRelation === 'related') {
|
|
94065
|
+
renderKeys = normalizeKeyList([...checkedKeys], keyEntities, leafOnly);
|
|
94066
|
+
} else if (checkRelation === 'unRelated') {
|
|
94067
|
+
renderKeys = [...realCheckedKeys];
|
|
94068
|
+
}
|
|
94069
|
+
|
|
93795
94070
|
const tagList = []; // eslint-disable-next-line @typescript-eslint/no-shadow
|
|
93796
94071
|
|
|
93797
94072
|
for_each_default()(renderKeys).call(renderKeys, key => {
|
|
@@ -93880,11 +94155,6 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
93880
94155
|
searchPosition,
|
|
93881
94156
|
filterTreeNode
|
|
93882
94157
|
} = this.props;
|
|
93883
|
-
const {
|
|
93884
|
-
selectedKeys,
|
|
93885
|
-
checkedKeys
|
|
93886
|
-
} = this.state;
|
|
93887
|
-
const hasValue = multiple ? Boolean(checkedKeys.size) : Boolean(selectedKeys.length);
|
|
93888
94158
|
const isTriggerPositionSearch = filterTreeNode && searchPosition === treeSelect_constants_strings.SEARCH_POSITION_TRIGGER; // searchPosition = trigger
|
|
93889
94159
|
|
|
93890
94160
|
if (isTriggerPositionSearch) {
|
|
@@ -93892,7 +94162,7 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
93892
94162
|
} // searchPosition = dropdown and single seleciton
|
|
93893
94163
|
|
|
93894
94164
|
|
|
93895
|
-
if (!multiple || !hasValue) {
|
|
94165
|
+
if (!multiple || !this.hasValue()) {
|
|
93896
94166
|
const renderText = this.foundation.getRenderTextInSingle();
|
|
93897
94167
|
const spanCls = classnames_default()({
|
|
93898
94168
|
["".concat(treeSelect_prefixcls, "-selection-placeholder")]: !renderText
|
|
@@ -94149,14 +94419,23 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94149
94419
|
size,
|
|
94150
94420
|
searchAutoFocus,
|
|
94151
94421
|
placeholder,
|
|
94152
|
-
maxTagCount
|
|
94422
|
+
maxTagCount,
|
|
94423
|
+
checkRelation
|
|
94153
94424
|
} = this.props;
|
|
94154
94425
|
const {
|
|
94155
94426
|
keyEntities,
|
|
94156
94427
|
checkedKeys,
|
|
94157
|
-
inputValue
|
|
94428
|
+
inputValue,
|
|
94429
|
+
realCheckedKeys
|
|
94158
94430
|
} = this.state;
|
|
94159
|
-
|
|
94431
|
+
let keyList = [];
|
|
94432
|
+
|
|
94433
|
+
if (checkRelation === 'related') {
|
|
94434
|
+
keyList = normalizeKeyList(checkedKeys, keyEntities, leafOnly);
|
|
94435
|
+
} else if (checkRelation === 'unRelated') {
|
|
94436
|
+
keyList = [...realCheckedKeys];
|
|
94437
|
+
}
|
|
94438
|
+
|
|
94160
94439
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(tagInput_0, {
|
|
94161
94440
|
maxTagCount: maxTagCount,
|
|
94162
94441
|
disabled: disabled,
|
|
@@ -94481,6 +94760,7 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94481
94760
|
selectedKeys: [],
|
|
94482
94761
|
checkedKeys: new set_default.a(),
|
|
94483
94762
|
halfCheckedKeys: new set_default.a(),
|
|
94763
|
+
realCheckedKeys: new set_default.a([]),
|
|
94484
94764
|
disabledKeys: new set_default.a(),
|
|
94485
94765
|
motionKeys: new set_default.a([]),
|
|
94486
94766
|
motionType: 'hide',
|
|
@@ -94601,12 +94881,16 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94601
94881
|
}
|
|
94602
94882
|
|
|
94603
94883
|
if (checkedKeyValues) {
|
|
94604
|
-
|
|
94605
|
-
|
|
94606
|
-
|
|
94607
|
-
|
|
94608
|
-
|
|
94609
|
-
|
|
94884
|
+
if (props.checkRelation === 'unRelated') {
|
|
94885
|
+
newState.realCheckedKeys = new set_default.a(checkedKeyValues);
|
|
94886
|
+
} else if (props.checkRelation === 'related') {
|
|
94887
|
+
const {
|
|
94888
|
+
checkedKeys,
|
|
94889
|
+
halfCheckedKeys
|
|
94890
|
+
} = calcCheckedKeys(checkedKeyValues, keyEntities);
|
|
94891
|
+
newState.checkedKeys = checkedKeys;
|
|
94892
|
+
newState.halfCheckedKeys = halfCheckedKeys;
|
|
94893
|
+
}
|
|
94610
94894
|
}
|
|
94611
94895
|
} // loadedKeys
|
|
94612
94896
|
|
|
@@ -94621,7 +94905,7 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94621
94905
|
} // ================ disableStrictly =================
|
|
94622
94906
|
|
|
94623
94907
|
|
|
94624
|
-
if (treeData && props.disableStrictly) {
|
|
94908
|
+
if (treeData && props.disableStrictly && props.checkRelation === 'related') {
|
|
94625
94909
|
newState.disabledKeys = calcDisabledKeys(keyEntities);
|
|
94626
94910
|
}
|
|
94627
94911
|
|
|
@@ -94887,6 +95171,7 @@ treeSelect_TreeSelect.propTypes = {
|
|
|
94887
95171
|
optionListStyle: prop_types_default.a.object,
|
|
94888
95172
|
searchRender: prop_types_default.a.oneOfType([prop_types_default.a.func, prop_types_default.a.bool]),
|
|
94889
95173
|
renderSelectedItem: prop_types_default.a.func,
|
|
95174
|
+
checkRelation: prop_types_default.a.string,
|
|
94890
95175
|
'aria-label': prop_types_default.a.string
|
|
94891
95176
|
};
|
|
94892
95177
|
treeSelect_TreeSelect.defaultProps = {
|
|
@@ -94915,6 +95200,7 @@ treeSelect_TreeSelect.defaultProps = {
|
|
|
94915
95200
|
expandAction: false,
|
|
94916
95201
|
clickToHide: true,
|
|
94917
95202
|
searchAutoFocus: false,
|
|
95203
|
+
checkRelation: 'related',
|
|
94918
95204
|
'aria-label': 'TreeSelect'
|
|
94919
95205
|
};
|
|
94920
95206
|
/* harmony default export */ var treeSelect_0 = (treeSelect_TreeSelect);
|
|
@@ -96486,6 +96772,7 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96486
96772
|
onPreviewClick,
|
|
96487
96773
|
showPicInfo,
|
|
96488
96774
|
renderPicInfo,
|
|
96775
|
+
renderPicPreviewIcon,
|
|
96489
96776
|
renderThumbnail,
|
|
96490
96777
|
name,
|
|
96491
96778
|
index
|
|
@@ -96493,6 +96780,7 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96493
96780
|
const showProgress = status === upload_constants_strings.FILE_STATUS_UPLOADING && percent !== 100;
|
|
96494
96781
|
const showRetry = status === upload_constants_strings.FILE_STATUS_UPLOAD_FAIL && this.props.showRetry;
|
|
96495
96782
|
const showReplace = status === upload_constants_strings.FILE_STATUS_SUCCESS && this.props.showReplace;
|
|
96783
|
+
const showPreview = status === upload_constants_strings.FILE_STATUS_SUCCESS && !this.props.showReplace;
|
|
96496
96784
|
const filePicCardCls = classnames_default()({
|
|
96497
96785
|
["".concat(fileCard_prefixCls, "-picture-file-card")]: true,
|
|
96498
96786
|
["".concat(fileCard_prefixCls, "-picture-file-card-disabled")]: disabled,
|
|
@@ -96500,7 +96788,6 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96500
96788
|
["".concat(fileCard_prefixCls, "-picture-file-card-error")]: status === upload_constants_strings.FILE_STATUS_UPLOAD_FAIL,
|
|
96501
96789
|
["".concat(fileCard_prefixCls, "-picture-file-card-uploading")]: showProgress
|
|
96502
96790
|
});
|
|
96503
|
-
const closeCls = "".concat(fileCard_prefixCls, "-picture-file-card-close");
|
|
96504
96791
|
const retry = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
96505
96792
|
role: "button",
|
|
96506
96793
|
tabIndex: 0,
|
|
@@ -96523,6 +96810,17 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96523
96810
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(ReplaceSvg, {
|
|
96524
96811
|
className: "".concat(fileCard_prefixCls, "-picture-file-card-icon-replace")
|
|
96525
96812
|
})));
|
|
96813
|
+
const preview = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
96814
|
+
className: "".concat(fileCard_prefixCls, "-picture-file-card-preview")
|
|
96815
|
+
}, typeof renderPicPreviewIcon === 'function' ? renderPicPreviewIcon(this.props) : null);
|
|
96816
|
+
const close = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
96817
|
+
role: "button",
|
|
96818
|
+
tabIndex: 0,
|
|
96819
|
+
className: "".concat(fileCard_prefixCls, "-picture-file-card-close"),
|
|
96820
|
+
onClick: e => this.onRemove(e)
|
|
96821
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClear, {
|
|
96822
|
+
className: "".concat(fileCard_prefixCls, "-picture-file-card-icon-close")
|
|
96823
|
+
}));
|
|
96526
96824
|
const picInfo = typeof renderPicInfo === 'function' ? renderPicInfo(this.props) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
96527
96825
|
className: "".concat(fileCard_prefixCls, "-picture-file-card-pic-info")
|
|
96528
96826
|
}, index + 1);
|
|
@@ -96541,14 +96839,7 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96541
96839
|
size: "small",
|
|
96542
96840
|
orbitStroke: '#FFF',
|
|
96543
96841
|
"aria-label": "uploading file progress"
|
|
96544
|
-
}) : null, showRetry ? retry : null, showReplace && replace, showPicInfo && picInfo, !disabled &&
|
|
96545
|
-
className: closeCls,
|
|
96546
|
-
onClick: e => this.onRemove(e)
|
|
96547
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, {
|
|
96548
|
-
tabIndex: 0,
|
|
96549
|
-
role: "button",
|
|
96550
|
-
size: "extra-small"
|
|
96551
|
-
})), this.renderPicValidateMsg());
|
|
96842
|
+
}) : null, showRetry ? retry : null, showReplace && replace, showPreview && preview, showPicInfo && picInfo, !disabled && close, this.renderPicValidateMsg());
|
|
96552
96843
|
}
|
|
96553
96844
|
|
|
96554
96845
|
renderFile(locale) {
|
|
@@ -96563,7 +96854,8 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96563
96854
|
previewFile,
|
|
96564
96855
|
status,
|
|
96565
96856
|
style,
|
|
96566
|
-
onPreviewClick
|
|
96857
|
+
onPreviewClick,
|
|
96858
|
+
renderFileOperation
|
|
96567
96859
|
} = this.props;
|
|
96568
96860
|
const fileCardCls = classnames_default()({
|
|
96569
96861
|
["".concat(fileCard_prefixCls, "-file-card")]: true,
|
|
@@ -96593,6 +96885,14 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96593
96885
|
previewContent = previewFile(this.props);
|
|
96594
96886
|
}
|
|
96595
96887
|
|
|
96888
|
+
const operation = typeof renderFileOperation === 'function' ? renderFileOperation(this.props) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, {
|
|
96889
|
+
onClick: e => this.onRemove(e),
|
|
96890
|
+
type: "tertiary",
|
|
96891
|
+
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, null),
|
|
96892
|
+
theme: "borderless",
|
|
96893
|
+
size: "small",
|
|
96894
|
+
className: closeCls
|
|
96895
|
+
});
|
|
96596
96896
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
96597
96897
|
role: "listitem",
|
|
96598
96898
|
className: fileCardCls,
|
|
@@ -96613,7 +96913,7 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96613
96913
|
position: "top",
|
|
96614
96914
|
showArrow: false,
|
|
96615
96915
|
content: locale.replace
|
|
96616
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(
|
|
96916
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(button_0, {
|
|
96617
96917
|
onClick: e => this.onReplace(e),
|
|
96618
96918
|
type: "tertiary",
|
|
96619
96919
|
theme: "borderless",
|
|
@@ -96635,29 +96935,22 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96635
96935
|
tabIndex: 0,
|
|
96636
96936
|
className: "".concat(infoCls, "-retry"),
|
|
96637
96937
|
onClick: e => this.onRetry(e)
|
|
96638
|
-
}, locale.retry) : null)),
|
|
96639
|
-
onClick: e => this.onRemove(e),
|
|
96640
|
-
type: "tertiary",
|
|
96641
|
-
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, null),
|
|
96642
|
-
theme: "borderless",
|
|
96643
|
-
size: "small",
|
|
96644
|
-
className: closeCls
|
|
96645
|
-
}));
|
|
96938
|
+
}, locale.retry) : null)), operation);
|
|
96646
96939
|
}
|
|
96647
96940
|
|
|
96648
96941
|
onRemove(e) {
|
|
96649
96942
|
e.stopPropagation();
|
|
96650
|
-
this.props.onRemove(
|
|
96943
|
+
this.props.onRemove();
|
|
96651
96944
|
}
|
|
96652
96945
|
|
|
96653
96946
|
onReplace(e) {
|
|
96654
96947
|
e.stopPropagation();
|
|
96655
|
-
this.props.onReplace(
|
|
96948
|
+
this.props.onReplace();
|
|
96656
96949
|
}
|
|
96657
96950
|
|
|
96658
96951
|
onRetry(e) {
|
|
96659
96952
|
e.stopPropagation();
|
|
96660
|
-
this.props.onRetry(
|
|
96953
|
+
this.props.onRetry();
|
|
96661
96954
|
}
|
|
96662
96955
|
|
|
96663
96956
|
render() {
|
|
@@ -96721,6 +97014,7 @@ var upload = __webpack_require__("/t7F");
|
|
|
96721
97014
|
|
|
96722
97015
|
|
|
96723
97016
|
|
|
97017
|
+
|
|
96724
97018
|
/* eslint-disable max-len */
|
|
96725
97019
|
|
|
96726
97020
|
|
|
@@ -96831,14 +97125,14 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
96831
97125
|
previewFile,
|
|
96832
97126
|
listType,
|
|
96833
97127
|
itemStyle,
|
|
96834
|
-
showRetry,
|
|
96835
97128
|
showPicInfo,
|
|
96836
97129
|
renderPicInfo,
|
|
97130
|
+
renderPicPreviewIcon,
|
|
97131
|
+
renderFileOperation,
|
|
96837
97132
|
renderFileItem,
|
|
96838
97133
|
renderThumbnail,
|
|
96839
97134
|
disabled,
|
|
96840
|
-
onPreviewClick
|
|
96841
|
-
showReplace
|
|
97135
|
+
onPreviewClick
|
|
96842
97136
|
} = this.props;
|
|
96843
97137
|
|
|
96844
97138
|
const onRemove = () => this.remove(file);
|
|
@@ -96851,20 +97145,20 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
96851
97145
|
this.replace(index);
|
|
96852
97146
|
};
|
|
96853
97147
|
|
|
96854
|
-
const fileCardProps = assign_default()(assign_default()({}, file), {
|
|
97148
|
+
const fileCardProps = assign_default()(assign_default()(assign_default()({}, pick_default()(this.props, ['showRetry', 'showReplace', ''])), file), {
|
|
96855
97149
|
previewFile,
|
|
96856
97150
|
listType,
|
|
96857
97151
|
onRemove,
|
|
96858
97152
|
onRetry,
|
|
96859
97153
|
index,
|
|
96860
97154
|
key: uid || concat_default()(_context = "".concat(name)).call(_context, index),
|
|
96861
|
-
showRetry: typeof file.showRetry !== 'undefined' ? file.showRetry : showRetry,
|
|
96862
97155
|
style: itemStyle,
|
|
96863
97156
|
disabled,
|
|
96864
97157
|
showPicInfo,
|
|
96865
97158
|
renderPicInfo,
|
|
97159
|
+
renderPicPreviewIcon,
|
|
97160
|
+
renderFileOperation,
|
|
96866
97161
|
renderThumbnail,
|
|
96867
|
-
showReplace: typeof file.showReplace !== 'undefined' ? file.showReplace : showReplace,
|
|
96868
97162
|
onReplace,
|
|
96869
97163
|
onPreviewClick: typeof onPreviewClick !== 'undefined' ? () => this.foundation.handlePreviewClick(file) : undefined
|
|
96870
97164
|
});
|
|
@@ -96906,7 +97200,8 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
96906
97200
|
limit,
|
|
96907
97201
|
disabled,
|
|
96908
97202
|
children,
|
|
96909
|
-
draggable
|
|
97203
|
+
draggable,
|
|
97204
|
+
hotSpotLocation
|
|
96910
97205
|
} = this.props;
|
|
96911
97206
|
const {
|
|
96912
97207
|
fileList: stateFileList,
|
|
@@ -96964,7 +97259,7 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
96964
97259
|
className: mainCls,
|
|
96965
97260
|
role: "list",
|
|
96966
97261
|
"aria-label": "picture list"
|
|
96967
|
-
}, map_default()(fileList).call(fileList, (file, index) => this.renderFile(file, index, locale)), showAddTriggerInList ? addContent : null)));
|
|
97262
|
+
}, showAddTriggerInList && hotSpotLocation === 'start' ? addContent : null, map_default()(fileList).call(fileList, (file, index) => this.renderFile(file, index, locale)), showAddTriggerInList && hotSpotLocation === 'end' ? addContent : null)));
|
|
96968
97263
|
};
|
|
96969
97264
|
|
|
96970
97265
|
this.renderFileListDefault = () => {
|
|
@@ -97304,6 +97599,7 @@ upload_Upload.propTypes = {
|
|
|
97304
97599
|
fileList: prop_types_default.a.array,
|
|
97305
97600
|
fileName: prop_types_default.a.string,
|
|
97306
97601
|
headers: prop_types_default.a.oneOfType([prop_types_default.a.object, prop_types_default.a.func]),
|
|
97602
|
+
hotSpotLocation: prop_types_default.a.oneOf(['start', 'end']),
|
|
97307
97603
|
itemStyle: prop_types_default.a.object,
|
|
97308
97604
|
limit: prop_types_default.a.number,
|
|
97309
97605
|
listType: prop_types_default.a.oneOf(upload_constants_strings.LIST_TYPE),
|
|
@@ -97329,6 +97625,8 @@ upload_Upload.propTypes = {
|
|
|
97329
97625
|
prompt: prop_types_default.a.node,
|
|
97330
97626
|
promptPosition: prop_types_default.a.oneOf(upload_constants_strings.PROMPT_POSITION),
|
|
97331
97627
|
renderFileItem: prop_types_default.a.func,
|
|
97628
|
+
renderPicPreviewIcon: prop_types_default.a.func,
|
|
97629
|
+
renderFileOperation: prop_types_default.a.func,
|
|
97332
97630
|
renderPicInfo: prop_types_default.a.func,
|
|
97333
97631
|
renderThumbnail: prop_types_default.a.func,
|
|
97334
97632
|
showClear: prop_types_default.a.bool,
|
|
@@ -97348,6 +97646,7 @@ upload_Upload.defaultProps = {
|
|
|
97348
97646
|
defaultFileList: [],
|
|
97349
97647
|
disabled: false,
|
|
97350
97648
|
listType: 'list',
|
|
97649
|
+
hotSpotLocation: 'end',
|
|
97351
97650
|
multiple: false,
|
|
97352
97651
|
onAcceptInvalid: noop_default.a,
|
|
97353
97652
|
onChange: noop_default.a,
|