@douyinfe/semi-ui 2.3.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/datePicker/_story/RenderDate/index.js +13 -3
- package/datePicker/_story/RenderFullDate/index.js +36 -14
- package/datePicker/_story/RenderFullDate/index.scss +1 -1
- package/datePicker/_story/datePicker.stories.js +19 -11
- package/datePicker/_story/v2/PanelOpen.jsx +39 -0
- package/datePicker/_story/v2/index.js +2 -1
- package/datePicker/datePicker.tsx +1 -0
- package/dist/css/semi.css +84 -36
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +487 -170
- 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 +6 -4
- package/inputNumber/__test__/inputNumber.test.js +36 -8
- package/lib/cjs/autoComplete/index.d.ts +1 -1
- package/lib/cjs/cascader/index.js +6 -0
- package/lib/cjs/datePicker/datePicker.js +12 -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 +5 -3
- package/lib/cjs/navigation/Item.js +1 -1
- package/lib/cjs/navigation/SubNav.js +1 -1
- package/lib/cjs/scrollList/scrollItem.d.ts +5 -1
- package/lib/cjs/scrollList/scrollItem.js +7 -0
- package/lib/cjs/select/index.d.ts +1 -1
- package/lib/cjs/select/index.js +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 +17 -7
- package/lib/cjs/table/interface.d.ts +1 -0
- package/lib/cjs/tabs/interface.d.ts +1 -1
- package/lib/cjs/timePicker/TimePicker.d.ts +2 -0
- package/lib/cjs/timePicker/TimePicker.js +4 -4
- package/lib/cjs/timePicker/index.d.ts +1 -0
- 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/tree/treeNode.js +10 -1
- package/lib/cjs/treeSelect/index.d.ts +2 -0
- package/lib/cjs/treeSelect/index.js +75 -30
- package/lib/cjs/typography/util.js +0 -1
- 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 +12 -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 +5 -3
- package/lib/es/navigation/Item.js +1 -1
- package/lib/es/navigation/SubNav.js +1 -1
- package/lib/es/scrollList/scrollItem.d.ts +5 -1
- package/lib/es/scrollList/scrollItem.js +7 -0
- package/lib/es/select/index.d.ts +1 -1
- package/lib/es/select/index.js +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 +19 -7
- package/lib/es/table/interface.d.ts +1 -0
- package/lib/es/tabs/interface.d.ts +1 -1
- package/lib/es/timePicker/TimePicker.d.ts +2 -0
- package/lib/es/timePicker/TimePicker.js +4 -4
- package/lib/es/timePicker/index.d.ts +1 -0
- 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/tree/treeNode.js +9 -1
- package/lib/es/treeSelect/index.d.ts +2 -0
- package/lib/es/treeSelect/index.js +76 -31
- package/lib/es/typography/util.js +0 -1
- 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/navigation/Item.tsx +1 -1
- package/navigation/SubNav.tsx +1 -1
- package/package.json +9 -8
- package/scrollList/scrollItem.tsx +10 -3
- package/select/index.tsx +6 -1
- package/select/option.tsx +2 -2
- package/table/Table.tsx +16 -8
- package/table/_story/table.stories.js +1 -0
- package/table/_story/v2/FixedColumnsChange/index.jsx +104 -0
- package/table/_story/v2/FixedHeaderMerge/index.jsx +98 -0
- package/table/_story/v2/FixedZIndex/index.jsx +87 -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/timePicker/TimePicker.tsx +4 -1
- package/timePicker/__test__/timePicker.test.js +42 -3
- package/timePicker/_story/timepicker.stories.js +18 -0
- 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/tree/treeNode.tsx +9 -2
- package/treeSelect/__test__/treeMultiple.test.js +94 -0
- package/treeSelect/__test__/treeSelect.test.js +157 -0
- package/treeSelect/_story/treeSelect.stories.js +242 -0
- package/treeSelect/index.tsx +93 -52
- package/typography/_story/typography.stories.js +8 -0
- package/typography/util.tsx +0 -1
- 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'
|
|
@@ -30657,7 +30718,6 @@ const getRenderText = function (originEle, rows) {
|
|
|
30657
30718
|
ellipsisContainer.style.zIndex = '-1000'; // clean up css overflow
|
|
30658
30719
|
|
|
30659
30720
|
ellipsisContainer.style.textOverflow = 'clip';
|
|
30660
|
-
ellipsisContainer.style.whiteSpace = 'normal';
|
|
30661
30721
|
ellipsisContainer.style.webkitLineClamp = 'none'; // Render fake container
|
|
30662
30722
|
|
|
30663
30723
|
external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default.a.render( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Fragment, null), ellipsisContainer); // Check if ellipsis in measure div is height enough for content
|
|
@@ -33629,6 +33689,7 @@ class input_Input extends baseComponent_BaseComponent {
|
|
|
33629
33689
|
prefix,
|
|
33630
33690
|
mode,
|
|
33631
33691
|
insetLabel,
|
|
33692
|
+
insetLabelId,
|
|
33632
33693
|
validateStatus,
|
|
33633
33694
|
type,
|
|
33634
33695
|
readonly,
|
|
@@ -33644,7 +33705,7 @@ class input_Input extends baseComponent_BaseComponent {
|
|
|
33644
33705
|
maxLength,
|
|
33645
33706
|
getValueLength
|
|
33646
33707
|
} = _a,
|
|
33647
|
-
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"]);
|
|
33708
|
+
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"]);
|
|
33648
33709
|
|
|
33649
33710
|
const {
|
|
33650
33711
|
value,
|
|
@@ -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
|
|
|
@@ -57640,6 +57706,13 @@ class scrollItem_ScrollItem extends baseComponent_BaseComponent {
|
|
|
57640
57706
|
});
|
|
57641
57707
|
}
|
|
57642
57708
|
|
|
57709
|
+
componentWillUnmount() {
|
|
57710
|
+
if (this.props.cycled) {
|
|
57711
|
+
this.throttledAdjustList.cancel();
|
|
57712
|
+
this.debouncedSelect.cancel();
|
|
57713
|
+
}
|
|
57714
|
+
}
|
|
57715
|
+
|
|
57643
57716
|
componentDidMount() {
|
|
57644
57717
|
this.foundation.init();
|
|
57645
57718
|
const {
|
|
@@ -59974,14 +60047,18 @@ class datePicker_DatePicker extends baseComponent_BaseComponent {
|
|
|
59974
60047
|
onRangeEndTabPress: this.handleRangeEndTabPress
|
|
59975
60048
|
});
|
|
59976
60049
|
|
|
59977
|
-
return
|
|
59978
|
-
|
|
59979
|
-
|
|
59980
|
-
|
|
59981
|
-
|
|
59982
|
-
|
|
59983
|
-
|
|
59984
|
-
|
|
60050
|
+
return (
|
|
60051
|
+
/*#__PURE__*/
|
|
60052
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events
|
|
60053
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
60054
|
+
onClick: this.handleTriggerWrapperClick,
|
|
60055
|
+
className: inputCls
|
|
60056
|
+
}, typeof triggerRender === 'function' ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(trigger_0, assign_default()({}, props, {
|
|
60057
|
+
triggerRender: triggerRender,
|
|
60058
|
+
componentName: "DatePicker",
|
|
60059
|
+
componentProps: assign_default()({}, this.props)
|
|
60060
|
+
})) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(dateInput_DateInput, assign_default()({}, props)))
|
|
60061
|
+
);
|
|
59985
60062
|
}
|
|
59986
60063
|
|
|
59987
60064
|
render() {
|
|
@@ -64034,19 +64111,21 @@ class textarea_TextArea extends baseComponent_BaseComponent {
|
|
|
64034
64111
|
minLength: stateMinLength
|
|
64035
64112
|
} = this.state;
|
|
64036
64113
|
const wrapperCls = classnames_default()(className, "".concat(textarea_prefixCls, "-textarea-wrapper"), {
|
|
64037
|
-
["".concat(textarea_prefixCls, "-textarea-wrapper-disabled")]: disabled
|
|
64114
|
+
["".concat(textarea_prefixCls, "-textarea-wrapper-disabled")]: disabled,
|
|
64115
|
+
["".concat(textarea_prefixCls, "-textarea-wrapper-readonly")]: readonly,
|
|
64038
64116
|
[concat_default()(_context = "".concat(textarea_prefixCls, "-textarea-wrapper-")).call(_context, validateStatus)]: Boolean(validateStatus),
|
|
64039
64117
|
["".concat(textarea_prefixCls, "-textarea-wrapper-focus")]: isFocus // [`${prefixCls}-textarea-wrapper-resize`]: !autosize && resize,
|
|
64040
64118
|
|
|
64041
64119
|
}); // const ref = this.props.forwardRef || this.textAreaRef;
|
|
64042
64120
|
|
|
64043
64121
|
const itemCls = classnames_default()("".concat(textarea_prefixCls, "-textarea"), {
|
|
64044
|
-
["".concat(textarea_prefixCls, "-textarea-disabled")]: disabled
|
|
64122
|
+
["".concat(textarea_prefixCls, "-textarea-disabled")]: disabled,
|
|
64123
|
+
["".concat(textarea_prefixCls, "-textarea-readonly")]: readonly,
|
|
64045
64124
|
["".concat(textarea_prefixCls, "-textarea-autosize")]: autosize,
|
|
64046
64125
|
["".concat(textarea_prefixCls, "-textarea-showClear")]: showClear
|
|
64047
64126
|
});
|
|
64048
64127
|
|
|
64049
|
-
const itemProps = assign_default()(assign_default()({}, omit_default()(rest, 'insetLabel', 'getValueLength', 'onClear', 'showClear')), {
|
|
64128
|
+
const itemProps = assign_default()(assign_default()({}, omit_default()(rest, 'insetLabel', 'insetLabelId', 'getValueLength', 'onClear', 'showClear')), {
|
|
64050
64129
|
className: itemCls,
|
|
64051
64130
|
disabled,
|
|
64052
64131
|
readOnly: readonly,
|
|
@@ -64160,7 +64239,8 @@ const inputNumber_constants_numbers = assign_default()(assign_default()({}, inpu
|
|
|
64160
64239
|
DEFAULT_STEP: 1,
|
|
64161
64240
|
DEFAULT_SHIFT_STEP: 1,
|
|
64162
64241
|
DEFAULT_PRESS_TIMEOUT: 250,
|
|
64163
|
-
DEFAULT_PRESS_INTERVAL: 0
|
|
64242
|
+
DEFAULT_PRESS_INTERVAL: 0,
|
|
64243
|
+
MOUSE_BUTTON_LEFT: 0
|
|
64164
64244
|
});
|
|
64165
64245
|
|
|
64166
64246
|
const inputNumber_constants_strings = assign_default()({}, input_constants_strings);
|
|
@@ -64194,6 +64274,7 @@ function minus(num1, num2) {
|
|
|
64194
64274
|
|
|
64195
64275
|
|
|
64196
64276
|
|
|
64277
|
+
|
|
64197
64278
|
/* eslint-disable max-len */
|
|
64198
64279
|
|
|
64199
64280
|
/* eslint-disable no-param-reassign */
|
|
@@ -64480,6 +64561,10 @@ class foundation_InputNumberFoundation extends foundation {
|
|
|
64480
64561
|
}
|
|
64481
64562
|
|
|
64482
64563
|
handleUpClick(event) {
|
|
64564
|
+
if (!this._isMouseButtonLeft(event)) {
|
|
64565
|
+
return;
|
|
64566
|
+
}
|
|
64567
|
+
|
|
64483
64568
|
this._adapter.setClickUpOrDown(true);
|
|
64484
64569
|
|
|
64485
64570
|
if (event) {
|
|
@@ -64499,6 +64584,10 @@ class foundation_InputNumberFoundation extends foundation {
|
|
|
64499
64584
|
}
|
|
64500
64585
|
|
|
64501
64586
|
handleDownClick(event) {
|
|
64587
|
+
if (!this._isMouseButtonLeft(event)) {
|
|
64588
|
+
return;
|
|
64589
|
+
}
|
|
64590
|
+
|
|
64502
64591
|
this._adapter.setClickUpOrDown(true);
|
|
64503
64592
|
|
|
64504
64593
|
if (event) {
|
|
@@ -64516,6 +64605,15 @@ class foundation_InputNumberFoundation extends foundation {
|
|
|
64516
64605
|
});
|
|
64517
64606
|
});
|
|
64518
64607
|
}
|
|
64608
|
+
/**
|
|
64609
|
+
* Whether it is a left mouse button click
|
|
64610
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
|
|
64611
|
+
*/
|
|
64612
|
+
|
|
64613
|
+
|
|
64614
|
+
_isMouseButtonLeft(event) {
|
|
64615
|
+
return get_default()(event, 'button') === inputNumber_constants_numbers.MOUSE_BUTTON_LEFT;
|
|
64616
|
+
}
|
|
64519
64617
|
|
|
64520
64618
|
_preventDefault(event) {
|
|
64521
64619
|
const keepFocus = this._adapter.getProp('keepFocus');
|
|
@@ -66178,7 +66276,7 @@ class Item_NavItem extends baseComponent_BaseComponent {
|
|
|
66178
66276
|
} else {
|
|
66179
66277
|
let placeholderIcons = null;
|
|
66180
66278
|
|
|
66181
|
-
if (mode === navigation_constants_strings.MODE_VERTICAL && !limitIndent) {
|
|
66279
|
+
if (mode === navigation_constants_strings.MODE_VERTICAL && !limitIndent && !isCollapsed) {
|
|
66182
66280
|
const iconAmount = icon && !indent ? level : level - 1;
|
|
66183
66281
|
placeholderIcons = times_default()(iconAmount, () => this.renderIcon(null, navigation_constants_strings.ICON_POS_RIGHT, false));
|
|
66184
66282
|
}
|
|
@@ -66623,7 +66721,7 @@ class SubNav_SubNav extends baseComponent_BaseComponent {
|
|
|
66623
66721
|
|
|
66624
66722
|
let placeholderIcons = null;
|
|
66625
66723
|
|
|
66626
|
-
if (mode === navigation_constants_strings.MODE_VERTICAL && !limitIndent) {
|
|
66724
|
+
if (mode === navigation_constants_strings.MODE_VERTICAL && !limitIndent && !isCollapsed) {
|
|
66627
66725
|
/* Different icons' amount means different indents.*/
|
|
66628
66726
|
const iconAmount = icon && !indent ? level : level - 1;
|
|
66629
66727
|
placeholderIcons = times_default()(iconAmount, index => this.renderIcon(null, navigation_constants_strings.ICON_POS_RIGHT, false, undefined, index));
|
|
@@ -73450,7 +73548,7 @@ class select_Select extends baseComponent_BaseComponent {
|
|
|
73450
73548
|
role: "button",
|
|
73451
73549
|
"aria-label": "Use the input box to create an optional item",
|
|
73452
73550
|
onClick: e => this.onSelect(option, optionIndex, e),
|
|
73453
|
-
key:
|
|
73551
|
+
key: option.key || option.label
|
|
73454
73552
|
}, customCreateItem)
|
|
73455
73553
|
);
|
|
73456
73554
|
}
|
|
@@ -77356,7 +77454,7 @@ class foundation_SliderFoundation extends foundation {
|
|
|
77356
77454
|
|
|
77357
77455
|
const scroll = node => regex.test(style(node, 'overflow') + style(node, 'overflow-y') + style(node, 'overflow-x'));
|
|
77358
77456
|
|
|
77359
|
-
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);
|
|
77360
77458
|
|
|
77361
77459
|
return scrollParent(el);
|
|
77362
77460
|
};
|
|
@@ -77480,7 +77578,7 @@ class foundation_SliderFoundation extends foundation {
|
|
|
77480
77578
|
}
|
|
77481
77579
|
|
|
77482
77580
|
if (step !== 1) {
|
|
77483
|
-
// Find nearest step point
|
|
77581
|
+
// Find nearest step point
|
|
77484
77582
|
stepValue = Math.round(stepValue / step) * step;
|
|
77485
77583
|
}
|
|
77486
77584
|
|
|
@@ -80678,7 +80776,17 @@ class foundation_TableFoundation extends foundation {
|
|
|
80678
80776
|
|
|
80679
80777
|
|
|
80680
80778
|
getFilteredSortedDataSource(dataSource, queries) {
|
|
80681
|
-
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
|
+
}));
|
|
80682
80790
|
const sortedDataSource = this.sortDataSource(filteredDataSource, filter_default()(queries).call(queries, query => query && isFunction_default()(query.sorter)));
|
|
80683
80791
|
return sortedDataSource;
|
|
80684
80792
|
}
|
|
@@ -80837,10 +80945,12 @@ class foundation_TableFoundation extends foundation {
|
|
|
80837
80945
|
const {
|
|
80838
80946
|
onFilter,
|
|
80839
80947
|
filteredValue,
|
|
80840
|
-
filterChildrenRecord
|
|
80948
|
+
filterChildrenRecord,
|
|
80949
|
+
defaultFilteredValue
|
|
80841
80950
|
} = filterObj;
|
|
80951
|
+
const currentFilteredValue = is_array_default()(filteredValue) ? filteredValue : defaultFilteredValue;
|
|
80842
80952
|
|
|
80843
|
-
if (typeof onFilter === 'function' && is_array_default()(
|
|
80953
|
+
if (typeof onFilter === 'function' && is_array_default()(currentFilteredValue) && currentFilteredValue.length) {
|
|
80844
80954
|
hasValidFilters = true;
|
|
80845
80955
|
|
|
80846
80956
|
if (filteredData === null) {
|
|
@@ -80850,7 +80960,7 @@ class foundation_TableFoundation extends foundation {
|
|
|
80850
80960
|
filteredData = new core_js_stable_map_default.a();
|
|
80851
80961
|
}
|
|
80852
80962
|
|
|
80853
|
-
each_default()(
|
|
80963
|
+
each_default()(currentFilteredValue, value => {
|
|
80854
80964
|
each_default()(dataSource, record => {
|
|
80855
80965
|
const childrenRecords = get_default()(record, childrenRecordName);
|
|
80856
80966
|
|
|
@@ -85660,10 +85770,17 @@ class Table_Table extends baseComponent_BaseComponent {
|
|
|
85660
85770
|
titleArr.push(sorter);
|
|
85661
85771
|
}
|
|
85662
85772
|
|
|
85773
|
+
const stateFilteredValue = get_default()(curQuery, 'filteredValue');
|
|
85774
|
+
|
|
85775
|
+
const defaultFilteredValue = get_default()(curQuery, 'defaultFilteredValue');
|
|
85776
|
+
|
|
85777
|
+
const filteredValue = stateFilteredValue ? stateFilteredValue : defaultFilteredValue;
|
|
85778
|
+
|
|
85663
85779
|
if (is_array_default()(column.filters) && column.filters.length || /*#__PURE__*/Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["isValidElement"])(column.filterDropdown)) {
|
|
85664
85780
|
const filter = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(ColumnFilter, assign_default()({
|
|
85665
85781
|
key: table_constants_strings.DEFAULT_KEY_COLUMN_FILTER
|
|
85666
85782
|
}, curQuery, {
|
|
85783
|
+
filteredValue: filteredValue,
|
|
85667
85784
|
onFilterDropdownVisibleChange: visible => _this.foundation.toggleShowFilter(dataIndex, visible),
|
|
85668
85785
|
onSelect: data => _this.foundation.handleFilterSelect(dataIndex, data)
|
|
85669
85786
|
}));
|
|
@@ -86252,11 +86369,12 @@ class Table_Table extends baseComponent_BaseComponent {
|
|
|
86252
86369
|
willUpdateStates.cachedColumns = props.columns;
|
|
86253
86370
|
willUpdateStates.cachedChildren = null;
|
|
86254
86371
|
} else if (props.children && props.children !== state.cachedChildren) {
|
|
86255
|
-
const
|
|
86372
|
+
const newNestedColumns = getColumns(props.children);
|
|
86373
|
+
const newFlattenColumns = flattenColumns(newNestedColumns);
|
|
86256
86374
|
const columns = mergeColumns(state.queries, newFlattenColumns, null, false);
|
|
86257
86375
|
willUpdateStates.flattenColumns = newFlattenColumns;
|
|
86258
86376
|
willUpdateStates.queries = [...columns];
|
|
86259
|
-
willUpdateStates.cachedColumns = [...
|
|
86377
|
+
willUpdateStates.cachedColumns = [...newNestedColumns];
|
|
86260
86378
|
willUpdateStates.cachedChildren = props.children;
|
|
86261
86379
|
} // Update controlled selection column
|
|
86262
86380
|
|
|
@@ -86393,15 +86511,18 @@ class Table_Table extends baseComponent_BaseComponent {
|
|
|
86393
86511
|
const _dataSource = [...dataSource];
|
|
86394
86512
|
const filteredSortedDataSource = this.foundation.getFilteredSortedDataSource(_dataSource, stateQueries);
|
|
86395
86513
|
this.foundation.setCachedFilteredSortedDataSource(filteredSortedDataSource);
|
|
86396
|
-
states.dataSource = filteredSortedDataSource;
|
|
86397
|
-
|
|
86398
|
-
states.pagination = isObject_default()(statePagination) ? assign_default()(assign_default()({}, statePagination), {
|
|
86399
|
-
currentPage: isObject_default()(propsPagination) && propsPagination.currentPage ? propsPagination.currentPage : 1
|
|
86400
|
-
}) : statePagination;
|
|
86514
|
+
states.dataSource = filteredSortedDataSource;
|
|
86401
86515
|
|
|
86402
86516
|
if (this.props.groupBy) {
|
|
86403
86517
|
states.groups = null;
|
|
86404
86518
|
}
|
|
86519
|
+
} // when dataSource has change, should reset currentPage
|
|
86520
|
+
|
|
86521
|
+
|
|
86522
|
+
if (dataSource !== prevProps.dataSource) {
|
|
86523
|
+
states.pagination = isObject_default()(statePagination) ? assign_default()(assign_default()({}, statePagination), {
|
|
86524
|
+
currentPage: isObject_default()(propsPagination) && propsPagination.currentPage ? propsPagination.currentPage : 1
|
|
86525
|
+
}) : statePagination;
|
|
86405
86526
|
}
|
|
86406
86527
|
|
|
86407
86528
|
if (keys_default()(states).length) {
|
|
@@ -86588,6 +86709,7 @@ class Table_Table extends baseComponent_BaseComponent {
|
|
|
86588
86709
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
86589
86710
|
ref: this.rootWrapRef,
|
|
86590
86711
|
className: classnames_default()(className, "".concat(prefixCls, "-wrapper")),
|
|
86712
|
+
"data-column-fixed": anyColumnFixed,
|
|
86591
86713
|
style: wrapStyle,
|
|
86592
86714
|
id: id
|
|
86593
86715
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(table_TableContextProvider, assign_default()({}, tableContextValue), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(spin_0, {
|
|
@@ -88863,7 +88985,13 @@ class foundation_TimePickerFoundation extends foundation {
|
|
|
88863
88985
|
}
|
|
88864
88986
|
}
|
|
88865
88987
|
|
|
88866
|
-
this.
|
|
88988
|
+
const onChangeWithDateFirst = this.getProp('onChangeWithDateFirst');
|
|
88989
|
+
|
|
88990
|
+
if (onChangeWithDateFirst) {
|
|
88991
|
+
this._adapter.notifyChange(_value, str);
|
|
88992
|
+
} else {
|
|
88993
|
+
this._adapter.notifyChange(str, _value);
|
|
88994
|
+
}
|
|
88867
88995
|
}
|
|
88868
88996
|
|
|
88869
88997
|
_hasChanged() {
|
|
@@ -89330,9 +89458,7 @@ class TimePicker_TimePicker extends baseComponent_BaseComponent {
|
|
|
89330
89458
|
notifyOpenChange: function () {
|
|
89331
89459
|
return _this2.props.onOpenChange(...arguments);
|
|
89332
89460
|
},
|
|
89333
|
-
notifyChange:
|
|
89334
|
-
return _this2.props.onChange && _this2.props.onChange(...arguments);
|
|
89335
|
-
},
|
|
89461
|
+
notifyChange: (agr1, arg2) => this.props.onChange && this.props.onChange(agr1, arg2),
|
|
89336
89462
|
notifyFocus: function () {
|
|
89337
89463
|
return _this2.props.onFocus && _this2.props.onFocus(...arguments);
|
|
89338
89464
|
},
|
|
@@ -89479,6 +89605,7 @@ class TimePicker_TimePicker extends baseComponent_BaseComponent {
|
|
|
89479
89605
|
panelFooter,
|
|
89480
89606
|
rangeSeparator,
|
|
89481
89607
|
onOpenChange,
|
|
89608
|
+
onChangeWithDateFirst,
|
|
89482
89609
|
popupClassName: propPopupClassName,
|
|
89483
89610
|
hideDisabledOptions,
|
|
89484
89611
|
use12Hours,
|
|
@@ -89490,7 +89617,7 @@ class TimePicker_TimePicker extends baseComponent_BaseComponent {
|
|
|
89490
89617
|
motion,
|
|
89491
89618
|
autoAdjustOverflow
|
|
89492
89619
|
} = _a,
|
|
89493
|
-
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"]);
|
|
89620
|
+
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"]);
|
|
89494
89621
|
|
|
89495
89622
|
const format = this.foundation.getDefaultFormatIfNeed();
|
|
89496
89623
|
const position = this.foundation.getPosition();
|
|
@@ -89650,6 +89777,7 @@ TimePicker_TimePicker.defaultProps = assign_default()({
|
|
|
89650
89777
|
onFocus: noop_default.a,
|
|
89651
89778
|
onBlur: noop_default.a,
|
|
89652
89779
|
onChange: noop_default.a,
|
|
89780
|
+
onChangeWithDateFirst: true,
|
|
89653
89781
|
use12Hours: false,
|
|
89654
89782
|
focusOnOpen: false,
|
|
89655
89783
|
onKeyDown: noop_default.a,
|
|
@@ -90510,6 +90638,7 @@ class foundation_TreeFoundation extends foundation {
|
|
|
90510
90638
|
selectedKeys = [],
|
|
90511
90639
|
checkedKeys = new set_default.a([]),
|
|
90512
90640
|
halfCheckedKeys = new set_default.a([]),
|
|
90641
|
+
realCheckedKeys = new set_default.a([]),
|
|
90513
90642
|
keyEntities = {},
|
|
90514
90643
|
filteredKeys = new set_default.a([]),
|
|
90515
90644
|
inputValue = '',
|
|
@@ -90519,13 +90648,26 @@ class foundation_TreeFoundation extends foundation {
|
|
|
90519
90648
|
disabledKeys = new set_default.a([])
|
|
90520
90649
|
} = this.getStates();
|
|
90521
90650
|
const {
|
|
90522
|
-
treeNodeFilterProp
|
|
90651
|
+
treeNodeFilterProp,
|
|
90652
|
+
checkRelation
|
|
90523
90653
|
} = this.getProps();
|
|
90524
90654
|
const entity = keyEntities[key];
|
|
90525
90655
|
const notExist = !entity;
|
|
90526
90656
|
|
|
90527
90657
|
if (notExist) {
|
|
90528
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;
|
|
90529
90671
|
}
|
|
90530
90672
|
|
|
90531
90673
|
const isSearching = Boolean(inputValue);
|
|
@@ -90533,8 +90675,8 @@ class foundation_TreeFoundation extends foundation {
|
|
|
90533
90675
|
eventKey: key,
|
|
90534
90676
|
expanded: isSearching ? filteredExpandedKeys.has(key) : expandedKeys.has(key),
|
|
90535
90677
|
selected: includes_default()(selectedKeys).call(selectedKeys, key),
|
|
90536
|
-
checked:
|
|
90537
|
-
halfChecked:
|
|
90678
|
+
checked: realChecked,
|
|
90679
|
+
halfChecked: realHalfChecked,
|
|
90538
90680
|
pos: String(entity ? entity.pos : ''),
|
|
90539
90681
|
level: entity.level,
|
|
90540
90682
|
filtered: filteredKeys.has(key),
|
|
@@ -90568,10 +90710,17 @@ class foundation_TreeFoundation extends foundation {
|
|
|
90568
90710
|
keyEntities
|
|
90569
90711
|
} = this.getStates();
|
|
90570
90712
|
const {
|
|
90571
|
-
leafOnly
|
|
90713
|
+
leafOnly,
|
|
90714
|
+
checkRelation
|
|
90572
90715
|
} = this.getProps();
|
|
90573
90716
|
let value;
|
|
90574
|
-
|
|
90717
|
+
let keyList = [];
|
|
90718
|
+
|
|
90719
|
+
if (checkRelation === 'related') {
|
|
90720
|
+
keyList = normalizeKeyList(key, keyEntities, leafOnly);
|
|
90721
|
+
} else if (checkRelation === 'unRelated') {
|
|
90722
|
+
keyList = key;
|
|
90723
|
+
}
|
|
90575
90724
|
|
|
90576
90725
|
if (this.getProp('onChangeWithObject')) {
|
|
90577
90726
|
value = map_default()(keyList).call(keyList, itemKey => keyEntities[itemKey].data);
|
|
@@ -90786,30 +90935,58 @@ class foundation_TreeFoundation extends foundation {
|
|
|
90786
90935
|
|
|
90787
90936
|
handleMultipleSelect(e, treeNode) {
|
|
90788
90937
|
const {
|
|
90789
|
-
disableStrictly
|
|
90790
|
-
|
|
90938
|
+
disableStrictly,
|
|
90939
|
+
checkRelation
|
|
90940
|
+
} = this.getProps();
|
|
90941
|
+
const {
|
|
90942
|
+
realCheckedKeys
|
|
90943
|
+
} = this.getStates(); // eventKey: The key value of the currently clicked node
|
|
90791
90944
|
|
|
90792
90945
|
const {
|
|
90793
90946
|
checked,
|
|
90794
90947
|
eventKey,
|
|
90795
90948
|
data
|
|
90796
|
-
} = treeNode;
|
|
90949
|
+
} = treeNode;
|
|
90797
90950
|
|
|
90798
|
-
|
|
90799
|
-
|
|
90800
|
-
|
|
90801
|
-
|
|
90802
|
-
|
|
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);
|
|
90803
90958
|
|
|
90804
|
-
|
|
90959
|
+
this._adapter.notifySelect(eventKey, targetStatus, data);
|
|
90805
90960
|
|
|
90806
|
-
|
|
90961
|
+
this.notifyChange([...checkedKeys], e);
|
|
90807
90962
|
|
|
90808
|
-
|
|
90809
|
-
|
|
90810
|
-
|
|
90811
|
-
|
|
90812
|
-
|
|
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
|
+
}
|
|
90813
90990
|
}
|
|
90814
90991
|
}
|
|
90815
90992
|
|
|
@@ -91247,6 +91424,7 @@ const TreeContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_re
|
|
|
91247
91424
|
|
|
91248
91425
|
|
|
91249
91426
|
|
|
91427
|
+
|
|
91250
91428
|
var treeNode_rest = undefined && undefined.__rest || function (s, e) {
|
|
91251
91429
|
var t = {};
|
|
91252
91430
|
|
|
@@ -91709,7 +91887,14 @@ class treeNode_TreeNode extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
91709
91887
|
ref: this.setRef
|
|
91710
91888
|
}, dragProps));
|
|
91711
91889
|
} else {
|
|
91712
|
-
|
|
91890
|
+
if (isEmpty_default()(style)) {
|
|
91891
|
+
return customLabel;
|
|
91892
|
+
} else {
|
|
91893
|
+
// In virtualization, props.style will contain location information
|
|
91894
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(customLabel, {
|
|
91895
|
+
style: assign_default()(assign_default()({}, get_default()(customLabel, ['props', 'style'])), style)
|
|
91896
|
+
});
|
|
91897
|
+
}
|
|
91713
91898
|
}
|
|
91714
91899
|
}
|
|
91715
91900
|
|
|
@@ -92212,6 +92397,7 @@ class tree_Tree extends baseComponent_BaseComponent {
|
|
|
92212
92397
|
selectedKeys: [],
|
|
92213
92398
|
checkedKeys: new set_default.a(),
|
|
92214
92399
|
halfCheckedKeys: new set_default.a(),
|
|
92400
|
+
realCheckedKeys: new set_default.a([]),
|
|
92215
92401
|
motionKeys: new set_default.a([]),
|
|
92216
92402
|
motionType: 'hide',
|
|
92217
92403
|
expandedKeys: new set_default.a(props.expandedKeys),
|
|
@@ -92422,12 +92608,16 @@ class tree_Tree extends baseComponent_BaseComponent {
|
|
|
92422
92608
|
}
|
|
92423
92609
|
|
|
92424
92610
|
if (checkedKeyValues) {
|
|
92425
|
-
|
|
92426
|
-
|
|
92427
|
-
|
|
92428
|
-
|
|
92429
|
-
|
|
92430
|
-
|
|
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
|
+
}
|
|
92431
92621
|
}
|
|
92432
92622
|
} // update loadedKeys
|
|
92433
92623
|
|
|
@@ -92437,7 +92627,7 @@ class tree_Tree extends baseComponent_BaseComponent {
|
|
|
92437
92627
|
} // update disableStrictly
|
|
92438
92628
|
|
|
92439
92629
|
|
|
92440
|
-
if (treeData && props.disableStrictly) {
|
|
92630
|
+
if (treeData && props.disableStrictly && props.checkRelation === 'related') {
|
|
92441
92631
|
newState.disabledKeys = calcDisabledKeys(keyEntities);
|
|
92442
92632
|
}
|
|
92443
92633
|
|
|
@@ -92758,6 +92948,7 @@ tree_Tree.propTypes = {
|
|
|
92758
92948
|
onDragStart: prop_types_default.a.func,
|
|
92759
92949
|
onDrop: prop_types_default.a.func,
|
|
92760
92950
|
labelEllipsis: prop_types_default.a.bool,
|
|
92951
|
+
checkRelation: prop_types_default.a.string,
|
|
92761
92952
|
'aria-label': prop_types_default.a.string
|
|
92762
92953
|
};
|
|
92763
92954
|
tree_Tree.defaultProps = {
|
|
@@ -92777,7 +92968,8 @@ tree_Tree.defaultProps = {
|
|
|
92777
92968
|
expandAction: false,
|
|
92778
92969
|
disableStrictly: false,
|
|
92779
92970
|
draggable: false,
|
|
92780
|
-
autoExpandWhenDragEnter: true
|
|
92971
|
+
autoExpandWhenDragEnter: true,
|
|
92972
|
+
checkRelation: 'related'
|
|
92781
92973
|
};
|
|
92782
92974
|
tree_Tree.TreeNode = treeNode_TreeNode;
|
|
92783
92975
|
/* harmony default export */ var tree_0 = (tree_Tree);
|
|
@@ -92923,6 +93115,7 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
92923
93115
|
selectedKeys = [],
|
|
92924
93116
|
checkedKeys = new set_default.a([]),
|
|
92925
93117
|
halfCheckedKeys = new set_default.a([]),
|
|
93118
|
+
realCheckedKeys = new set_default.a([]),
|
|
92926
93119
|
keyEntities = {},
|
|
92927
93120
|
filteredKeys = new set_default.a([]),
|
|
92928
93121
|
inputValue = '',
|
|
@@ -92932,13 +93125,26 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
92932
93125
|
disabledKeys = new set_default.a([])
|
|
92933
93126
|
} = this.getStates();
|
|
92934
93127
|
const {
|
|
92935
|
-
treeNodeFilterProp
|
|
93128
|
+
treeNodeFilterProp,
|
|
93129
|
+
checkRelation
|
|
92936
93130
|
} = this.getProps();
|
|
92937
93131
|
const entity = keyEntities[key];
|
|
92938
93132
|
const notExist = !entity;
|
|
92939
93133
|
|
|
92940
93134
|
if (notExist) {
|
|
92941
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;
|
|
92942
93148
|
}
|
|
92943
93149
|
|
|
92944
93150
|
const isSearching = Boolean(inputValue);
|
|
@@ -92946,8 +93152,8 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
92946
93152
|
eventKey: key,
|
|
92947
93153
|
expanded: isSearching ? filteredExpandedKeys.has(key) : expandedKeys.has(key),
|
|
92948
93154
|
selected: includes_default()(selectedKeys).call(selectedKeys, key),
|
|
92949
|
-
checked:
|
|
92950
|
-
halfChecked:
|
|
93155
|
+
checked: realChecked,
|
|
93156
|
+
halfChecked: realHalfChecked,
|
|
92951
93157
|
pos: String(entity ? entity.pos : ''),
|
|
92952
93158
|
level: entity.level,
|
|
92953
93159
|
filtered: filteredKeys.has(key),
|
|
@@ -93013,9 +93219,16 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93013
93219
|
keyEntities
|
|
93014
93220
|
} = this.getStates();
|
|
93015
93221
|
const {
|
|
93016
|
-
leafOnly
|
|
93222
|
+
leafOnly,
|
|
93223
|
+
checkRelation
|
|
93017
93224
|
} = this.getProps();
|
|
93018
|
-
|
|
93225
|
+
let keyList = [];
|
|
93226
|
+
|
|
93227
|
+
if (checkRelation === 'related') {
|
|
93228
|
+
keyList = normalizeKeyList(key, keyEntities, leafOnly);
|
|
93229
|
+
} else if (checkRelation === 'unRelated') {
|
|
93230
|
+
keyList = key;
|
|
93231
|
+
}
|
|
93019
93232
|
|
|
93020
93233
|
const nodes = map_default()(keyList).call(keyList, i => keyEntities[i].data);
|
|
93021
93234
|
|
|
@@ -93142,7 +93355,8 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93142
93355
|
this._adapter.updateState({
|
|
93143
93356
|
selectedKeys: [],
|
|
93144
93357
|
checkedKeys: new set_default.a(),
|
|
93145
|
-
halfCheckedKeys: new set_default.a()
|
|
93358
|
+
halfCheckedKeys: new set_default.a(),
|
|
93359
|
+
realCheckedKeys: new set_default.a([])
|
|
93146
93360
|
});
|
|
93147
93361
|
} // When triggerSearch, clicking the clear button will trigger to clear Input
|
|
93148
93362
|
|
|
@@ -93170,11 +93384,13 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93170
93384
|
|
|
93171
93385
|
removeTag(eventKey) {
|
|
93172
93386
|
const {
|
|
93173
|
-
disableStrictly
|
|
93387
|
+
disableStrictly,
|
|
93388
|
+
checkRelation
|
|
93174
93389
|
} = this.getProps();
|
|
93175
93390
|
const {
|
|
93176
93391
|
keyEntities,
|
|
93177
|
-
disabledKeys
|
|
93392
|
+
disabledKeys,
|
|
93393
|
+
realCheckedKeys
|
|
93178
93394
|
} = this.getStates();
|
|
93179
93395
|
const item = keyEntities[eventKey].data;
|
|
93180
93396
|
|
|
@@ -93182,20 +93398,35 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93182
93398
|
return;
|
|
93183
93399
|
}
|
|
93184
93400
|
|
|
93185
|
-
|
|
93186
|
-
|
|
93187
|
-
|
|
93188
|
-
} = this.calcCheckedKeys(eventKey, false);
|
|
93401
|
+
if (checkRelation === 'unRelated') {
|
|
93402
|
+
const newRealCheckedKeys = new set_default.a(realCheckedKeys);
|
|
93403
|
+
newRealCheckedKeys.delete(eventKey);
|
|
93189
93404
|
|
|
93190
|
-
|
|
93405
|
+
this._notifyChange([...newRealCheckedKeys], null);
|
|
93191
93406
|
|
|
93192
|
-
|
|
93193
|
-
|
|
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 {
|
|
93194
93416
|
checkedKeys,
|
|
93195
93417
|
halfCheckedKeys
|
|
93196
|
-
});
|
|
93418
|
+
} = this.calcCheckedKeys(eventKey, false);
|
|
93197
93419
|
|
|
93198
|
-
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
|
+
}
|
|
93199
93430
|
}
|
|
93200
93431
|
|
|
93201
93432
|
this._adapter.notifySelect(eventKey, false, item); // reposition dropdown when selected values change
|
|
@@ -93346,39 +93577,67 @@ class foundation_TreeSelectFoundation extends foundation {
|
|
|
93346
93577
|
handleMultipleSelect(e, treeNode) {
|
|
93347
93578
|
const {
|
|
93348
93579
|
searchPosition,
|
|
93349
|
-
disableStrictly
|
|
93580
|
+
disableStrictly,
|
|
93581
|
+
checkRelation
|
|
93350
93582
|
} = this.getProps();
|
|
93351
93583
|
const {
|
|
93352
|
-
inputValue
|
|
93584
|
+
inputValue,
|
|
93585
|
+
realCheckedKeys
|
|
93353
93586
|
} = this.getStates();
|
|
93354
93587
|
const {
|
|
93355
93588
|
checked,
|
|
93356
93589
|
eventKey,
|
|
93357
93590
|
data
|
|
93358
93591
|
} = treeNode;
|
|
93359
|
-
const targetStatus = disableStrictly ? this.calcChekcedStatus(!checked, eventKey) : !checked;
|
|
93360
|
-
const {
|
|
93361
|
-
checkedKeys,
|
|
93362
|
-
halfCheckedKeys
|
|
93363
|
-
} = disableStrictly ? this.calcNonDisabedCheckedKeys(eventKey, targetStatus) : this.calcCheckedKeys(eventKey, targetStatus);
|
|
93364
93592
|
|
|
93365
|
-
|
|
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);
|
|
93366
93599
|
|
|
93367
|
-
|
|
93600
|
+
this._adapter.notifySelect(eventKey, targetStatus, data);
|
|
93368
93601
|
|
|
93369
|
-
|
|
93370
|
-
|
|
93371
|
-
|
|
93372
|
-
|
|
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
|
+
}
|
|
93373
93635
|
}
|
|
93374
93636
|
|
|
93375
|
-
if (
|
|
93637
|
+
if (searchPosition === treeSelect_constants_strings.SEARCH_POSITION_TRIGGER && inputValue !== '') {
|
|
93376
93638
|
this._adapter.updateState({
|
|
93377
|
-
|
|
93378
|
-
halfCheckedKeys
|
|
93639
|
+
inputValue: ''
|
|
93379
93640
|
});
|
|
93380
|
-
|
|
93381
|
-
this._adapter.rePositionDropdown();
|
|
93382
93641
|
}
|
|
93383
93642
|
}
|
|
93384
93643
|
|
|
@@ -93706,34 +93965,52 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
93706
93965
|
this.foundation.handleSelectionEnterPress(e);
|
|
93707
93966
|
};
|
|
93708
93967
|
|
|
93709
|
-
this.
|
|
93968
|
+
this.hasValue = () => {
|
|
93710
93969
|
const {
|
|
93711
|
-
|
|
93970
|
+
multiple,
|
|
93971
|
+
checkRelation
|
|
93712
93972
|
} = this.props;
|
|
93713
93973
|
const {
|
|
93714
|
-
|
|
93974
|
+
realCheckedKeys,
|
|
93975
|
+
checkedKeys,
|
|
93976
|
+
selectedKeys
|
|
93715
93977
|
} = this.state;
|
|
93716
|
-
|
|
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 = () => {
|
|
93717
93994
|
const {
|
|
93718
93995
|
showClear,
|
|
93719
93996
|
disabled,
|
|
93720
|
-
|
|
93997
|
+
searchPosition
|
|
93721
93998
|
} = this.props;
|
|
93722
93999
|
const {
|
|
93723
|
-
|
|
93724
|
-
checkedKeys,
|
|
94000
|
+
inputValue,
|
|
93725
94001
|
isOpen,
|
|
93726
94002
|
isHovering
|
|
93727
94003
|
} = this.state;
|
|
93728
|
-
const
|
|
93729
|
-
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);
|
|
93730
94006
|
};
|
|
93731
94007
|
|
|
93732
94008
|
this.renderTagList = () => {
|
|
93733
94009
|
const {
|
|
93734
94010
|
checkedKeys,
|
|
93735
94011
|
keyEntities,
|
|
93736
|
-
disabledKeys
|
|
94012
|
+
disabledKeys,
|
|
94013
|
+
realCheckedKeys
|
|
93737
94014
|
} = this.state;
|
|
93738
94015
|
const {
|
|
93739
94016
|
treeNodeLabelProp,
|
|
@@ -93741,13 +94018,21 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
93741
94018
|
disabled,
|
|
93742
94019
|
disableStrictly,
|
|
93743
94020
|
size,
|
|
94021
|
+
checkRelation,
|
|
93744
94022
|
renderSelectedItem: propRenderSelectedItem
|
|
93745
94023
|
} = this.props;
|
|
93746
94024
|
const renderSelectedItem = isFunction_default()(propRenderSelectedItem) ? propRenderSelectedItem : item => ({
|
|
93747
94025
|
isRenderInTag: true,
|
|
93748
94026
|
content: get_default()(item, treeNodeLabelProp, null)
|
|
93749
94027
|
});
|
|
93750
|
-
|
|
94028
|
+
let renderKeys = [];
|
|
94029
|
+
|
|
94030
|
+
if (checkRelation === 'related') {
|
|
94031
|
+
renderKeys = normalizeKeyList([...checkedKeys], keyEntities, leafOnly);
|
|
94032
|
+
} else if (checkRelation === 'unRelated') {
|
|
94033
|
+
renderKeys = [...realCheckedKeys];
|
|
94034
|
+
}
|
|
94035
|
+
|
|
93751
94036
|
const tagList = []; // eslint-disable-next-line @typescript-eslint/no-shadow
|
|
93752
94037
|
|
|
93753
94038
|
for_each_default()(renderKeys).call(renderKeys, key => {
|
|
@@ -93836,11 +94121,6 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
93836
94121
|
searchPosition,
|
|
93837
94122
|
filterTreeNode
|
|
93838
94123
|
} = this.props;
|
|
93839
|
-
const {
|
|
93840
|
-
selectedKeys,
|
|
93841
|
-
checkedKeys
|
|
93842
|
-
} = this.state;
|
|
93843
|
-
const hasValue = multiple ? Boolean(checkedKeys.size) : Boolean(selectedKeys.length);
|
|
93844
94124
|
const isTriggerPositionSearch = filterTreeNode && searchPosition === treeSelect_constants_strings.SEARCH_POSITION_TRIGGER; // searchPosition = trigger
|
|
93845
94125
|
|
|
93846
94126
|
if (isTriggerPositionSearch) {
|
|
@@ -93848,7 +94128,7 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
93848
94128
|
} // searchPosition = dropdown and single seleciton
|
|
93849
94129
|
|
|
93850
94130
|
|
|
93851
|
-
if (!multiple || !hasValue) {
|
|
94131
|
+
if (!multiple || !this.hasValue()) {
|
|
93852
94132
|
const renderText = this.foundation.getRenderTextInSingle();
|
|
93853
94133
|
const spanCls = classnames_default()({
|
|
93854
94134
|
["".concat(treeSelect_prefixcls, "-selection-placeholder")]: !renderText
|
|
@@ -94105,14 +94385,23 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94105
94385
|
size,
|
|
94106
94386
|
searchAutoFocus,
|
|
94107
94387
|
placeholder,
|
|
94108
|
-
maxTagCount
|
|
94388
|
+
maxTagCount,
|
|
94389
|
+
checkRelation
|
|
94109
94390
|
} = this.props;
|
|
94110
94391
|
const {
|
|
94111
94392
|
keyEntities,
|
|
94112
94393
|
checkedKeys,
|
|
94113
|
-
inputValue
|
|
94394
|
+
inputValue,
|
|
94395
|
+
realCheckedKeys
|
|
94114
94396
|
} = this.state;
|
|
94115
|
-
|
|
94397
|
+
let keyList = [];
|
|
94398
|
+
|
|
94399
|
+
if (checkRelation === 'related') {
|
|
94400
|
+
keyList = normalizeKeyList(checkedKeys, keyEntities, leafOnly);
|
|
94401
|
+
} else if (checkRelation === 'unRelated') {
|
|
94402
|
+
keyList = [...realCheckedKeys];
|
|
94403
|
+
}
|
|
94404
|
+
|
|
94116
94405
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(tagInput_0, {
|
|
94117
94406
|
maxTagCount: maxTagCount,
|
|
94118
94407
|
disabled: disabled,
|
|
@@ -94437,6 +94726,7 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94437
94726
|
selectedKeys: [],
|
|
94438
94727
|
checkedKeys: new set_default.a(),
|
|
94439
94728
|
halfCheckedKeys: new set_default.a(),
|
|
94729
|
+
realCheckedKeys: new set_default.a([]),
|
|
94440
94730
|
disabledKeys: new set_default.a(),
|
|
94441
94731
|
motionKeys: new set_default.a([]),
|
|
94442
94732
|
motionType: 'hide',
|
|
@@ -94487,7 +94777,7 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94487
94777
|
} // if treeData keys changes, we won't show animation
|
|
94488
94778
|
|
|
94489
94779
|
|
|
94490
|
-
if (treeData && props.motion && !isEqual_default()(
|
|
94780
|
+
if (treeData && props.motion && !isEqual_default()(keys_default()(newState.keyEntities), keys_default()(prevState.keyEntities))) {
|
|
94491
94781
|
if (prevProps && props.motion) {
|
|
94492
94782
|
newState.motionKeys = new set_default.a([]);
|
|
94493
94783
|
newState.motionType = null;
|
|
@@ -94533,7 +94823,11 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94533
94823
|
newState.selectedKeys = findKeysForValues(normalizeValue(props.defaultValue, withObject), valueEntities, isMultiple);
|
|
94534
94824
|
} else if (treeData) {
|
|
94535
94825
|
// If `treeData` changed, we also need check it
|
|
94536
|
-
|
|
94826
|
+
if (props.value) {
|
|
94827
|
+
newState.selectedKeys = findKeysForValues(normalizeValue(props.value, withObject) || '', valueEntities, isMultiple);
|
|
94828
|
+
} else {
|
|
94829
|
+
newState.selectedKeys = updateKeys(prevState.selectedKeys, keyEntities);
|
|
94830
|
+
}
|
|
94537
94831
|
}
|
|
94538
94832
|
} else {
|
|
94539
94833
|
// checkedKeys: multiple mode controlled || data changed
|
|
@@ -94545,16 +94839,24 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94545
94839
|
checkedKeyValues = findKeysForValues(normalizeValue(props.defaultValue, withObject), valueEntities, isMultiple);
|
|
94546
94840
|
} else if (treeData) {
|
|
94547
94841
|
// If `treeData` changed, we also need check it
|
|
94548
|
-
|
|
94842
|
+
if (props.value) {
|
|
94843
|
+
checkedKeyValues = findKeysForValues(normalizeValue(props.value, withObject) || [], valueEntities, isMultiple);
|
|
94844
|
+
} else {
|
|
94845
|
+
checkedKeyValues = updateKeys(prevState.checkedKeys, keyEntities);
|
|
94846
|
+
}
|
|
94549
94847
|
}
|
|
94550
94848
|
|
|
94551
94849
|
if (checkedKeyValues) {
|
|
94552
|
-
|
|
94553
|
-
|
|
94554
|
-
|
|
94555
|
-
|
|
94556
|
-
|
|
94557
|
-
|
|
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
|
+
}
|
|
94558
94860
|
}
|
|
94559
94861
|
} // loadedKeys
|
|
94560
94862
|
|
|
@@ -94569,7 +94871,7 @@ class treeSelect_TreeSelect extends baseComponent_BaseComponent {
|
|
|
94569
94871
|
} // ================ disableStrictly =================
|
|
94570
94872
|
|
|
94571
94873
|
|
|
94572
|
-
if (treeData && props.disableStrictly) {
|
|
94874
|
+
if (treeData && props.disableStrictly && props.checkRelation === 'related') {
|
|
94573
94875
|
newState.disabledKeys = calcDisabledKeys(keyEntities);
|
|
94574
94876
|
}
|
|
94575
94877
|
|
|
@@ -94835,6 +95137,7 @@ treeSelect_TreeSelect.propTypes = {
|
|
|
94835
95137
|
optionListStyle: prop_types_default.a.object,
|
|
94836
95138
|
searchRender: prop_types_default.a.oneOfType([prop_types_default.a.func, prop_types_default.a.bool]),
|
|
94837
95139
|
renderSelectedItem: prop_types_default.a.func,
|
|
95140
|
+
checkRelation: prop_types_default.a.string,
|
|
94838
95141
|
'aria-label': prop_types_default.a.string
|
|
94839
95142
|
};
|
|
94840
95143
|
treeSelect_TreeSelect.defaultProps = {
|
|
@@ -94863,6 +95166,7 @@ treeSelect_TreeSelect.defaultProps = {
|
|
|
94863
95166
|
expandAction: false,
|
|
94864
95167
|
clickToHide: true,
|
|
94865
95168
|
searchAutoFocus: false,
|
|
95169
|
+
checkRelation: 'related',
|
|
94866
95170
|
'aria-label': 'TreeSelect'
|
|
94867
95171
|
};
|
|
94868
95172
|
/* harmony default export */ var treeSelect_0 = (treeSelect_TreeSelect);
|
|
@@ -96434,6 +96738,7 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96434
96738
|
onPreviewClick,
|
|
96435
96739
|
showPicInfo,
|
|
96436
96740
|
renderPicInfo,
|
|
96741
|
+
renderPicPreviewIcon,
|
|
96437
96742
|
renderThumbnail,
|
|
96438
96743
|
name,
|
|
96439
96744
|
index
|
|
@@ -96441,6 +96746,7 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96441
96746
|
const showProgress = status === upload_constants_strings.FILE_STATUS_UPLOADING && percent !== 100;
|
|
96442
96747
|
const showRetry = status === upload_constants_strings.FILE_STATUS_UPLOAD_FAIL && this.props.showRetry;
|
|
96443
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;
|
|
96444
96750
|
const filePicCardCls = classnames_default()({
|
|
96445
96751
|
["".concat(fileCard_prefixCls, "-picture-file-card")]: true,
|
|
96446
96752
|
["".concat(fileCard_prefixCls, "-picture-file-card-disabled")]: disabled,
|
|
@@ -96448,7 +96754,6 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96448
96754
|
["".concat(fileCard_prefixCls, "-picture-file-card-error")]: status === upload_constants_strings.FILE_STATUS_UPLOAD_FAIL,
|
|
96449
96755
|
["".concat(fileCard_prefixCls, "-picture-file-card-uploading")]: showProgress
|
|
96450
96756
|
});
|
|
96451
|
-
const closeCls = "".concat(fileCard_prefixCls, "-picture-file-card-close");
|
|
96452
96757
|
const retry = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
96453
96758
|
role: "button",
|
|
96454
96759
|
tabIndex: 0,
|
|
@@ -96471,6 +96776,17 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96471
96776
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(ReplaceSvg, {
|
|
96472
96777
|
className: "".concat(fileCard_prefixCls, "-picture-file-card-icon-replace")
|
|
96473
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
|
+
}));
|
|
96474
96790
|
const picInfo = typeof renderPicInfo === 'function' ? renderPicInfo(this.props) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
96475
96791
|
className: "".concat(fileCard_prefixCls, "-picture-file-card-pic-info")
|
|
96476
96792
|
}, index + 1);
|
|
@@ -96489,14 +96805,7 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96489
96805
|
size: "small",
|
|
96490
96806
|
orbitStroke: '#FFF',
|
|
96491
96807
|
"aria-label": "uploading file progress"
|
|
96492
|
-
}) : null, showRetry ? retry : null, showReplace && replace, showPicInfo && picInfo, !disabled &&
|
|
96493
|
-
className: closeCls,
|
|
96494
|
-
onClick: e => this.onRemove(e)
|
|
96495
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, {
|
|
96496
|
-
tabIndex: 0,
|
|
96497
|
-
role: "button",
|
|
96498
|
-
size: "extra-small"
|
|
96499
|
-
})), this.renderPicValidateMsg());
|
|
96808
|
+
}) : null, showRetry ? retry : null, showReplace && replace, showPreview && preview, showPicInfo && picInfo, !disabled && close, this.renderPicValidateMsg());
|
|
96500
96809
|
}
|
|
96501
96810
|
|
|
96502
96811
|
renderFile(locale) {
|
|
@@ -96511,7 +96820,8 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96511
96820
|
previewFile,
|
|
96512
96821
|
status,
|
|
96513
96822
|
style,
|
|
96514
|
-
onPreviewClick
|
|
96823
|
+
onPreviewClick,
|
|
96824
|
+
renderFileOperation
|
|
96515
96825
|
} = this.props;
|
|
96516
96826
|
const fileCardCls = classnames_default()({
|
|
96517
96827
|
["".concat(fileCard_prefixCls, "-file-card")]: true,
|
|
@@ -96541,6 +96851,14 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96541
96851
|
previewContent = previewFile(this.props);
|
|
96542
96852
|
}
|
|
96543
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
|
+
});
|
|
96544
96862
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
96545
96863
|
role: "listitem",
|
|
96546
96864
|
className: fileCardCls,
|
|
@@ -96561,7 +96879,7 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96561
96879
|
position: "top",
|
|
96562
96880
|
showArrow: false,
|
|
96563
96881
|
content: locale.replace
|
|
96564
|
-
}, /*#__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, {
|
|
96565
96883
|
onClick: e => this.onReplace(e),
|
|
96566
96884
|
type: "tertiary",
|
|
96567
96885
|
theme: "borderless",
|
|
@@ -96583,29 +96901,22 @@ class fileCard_FileCard extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
96583
96901
|
tabIndex: 0,
|
|
96584
96902
|
className: "".concat(infoCls, "-retry"),
|
|
96585
96903
|
onClick: e => this.onRetry(e)
|
|
96586
|
-
}, locale.retry) : null)),
|
|
96587
|
-
onClick: e => this.onRemove(e),
|
|
96588
|
-
type: "tertiary",
|
|
96589
|
-
icon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, null),
|
|
96590
|
-
theme: "borderless",
|
|
96591
|
-
size: "small",
|
|
96592
|
-
className: closeCls
|
|
96593
|
-
}));
|
|
96904
|
+
}, locale.retry) : null)), operation);
|
|
96594
96905
|
}
|
|
96595
96906
|
|
|
96596
96907
|
onRemove(e) {
|
|
96597
96908
|
e.stopPropagation();
|
|
96598
|
-
this.props.onRemove(
|
|
96909
|
+
this.props.onRemove();
|
|
96599
96910
|
}
|
|
96600
96911
|
|
|
96601
96912
|
onReplace(e) {
|
|
96602
96913
|
e.stopPropagation();
|
|
96603
|
-
this.props.onReplace(
|
|
96914
|
+
this.props.onReplace();
|
|
96604
96915
|
}
|
|
96605
96916
|
|
|
96606
96917
|
onRetry(e) {
|
|
96607
96918
|
e.stopPropagation();
|
|
96608
|
-
this.props.onRetry(
|
|
96919
|
+
this.props.onRetry();
|
|
96609
96920
|
}
|
|
96610
96921
|
|
|
96611
96922
|
render() {
|
|
@@ -96669,6 +96980,7 @@ var upload = __webpack_require__("/t7F");
|
|
|
96669
96980
|
|
|
96670
96981
|
|
|
96671
96982
|
|
|
96983
|
+
|
|
96672
96984
|
/* eslint-disable max-len */
|
|
96673
96985
|
|
|
96674
96986
|
|
|
@@ -96779,14 +97091,14 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
96779
97091
|
previewFile,
|
|
96780
97092
|
listType,
|
|
96781
97093
|
itemStyle,
|
|
96782
|
-
showRetry,
|
|
96783
97094
|
showPicInfo,
|
|
96784
97095
|
renderPicInfo,
|
|
97096
|
+
renderPicPreviewIcon,
|
|
97097
|
+
renderFileOperation,
|
|
96785
97098
|
renderFileItem,
|
|
96786
97099
|
renderThumbnail,
|
|
96787
97100
|
disabled,
|
|
96788
|
-
onPreviewClick
|
|
96789
|
-
showReplace
|
|
97101
|
+
onPreviewClick
|
|
96790
97102
|
} = this.props;
|
|
96791
97103
|
|
|
96792
97104
|
const onRemove = () => this.remove(file);
|
|
@@ -96799,20 +97111,20 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
96799
97111
|
this.replace(index);
|
|
96800
97112
|
};
|
|
96801
97113
|
|
|
96802
|
-
const fileCardProps = assign_default()(assign_default()({}, file), {
|
|
97114
|
+
const fileCardProps = assign_default()(assign_default()(assign_default()({}, pick_default()(this.props, ['showRetry', 'showReplace', ''])), file), {
|
|
96803
97115
|
previewFile,
|
|
96804
97116
|
listType,
|
|
96805
97117
|
onRemove,
|
|
96806
97118
|
onRetry,
|
|
96807
97119
|
index,
|
|
96808
97120
|
key: uid || concat_default()(_context = "".concat(name)).call(_context, index),
|
|
96809
|
-
showRetry: typeof file.showRetry !== 'undefined' ? file.showRetry : showRetry,
|
|
96810
97121
|
style: itemStyle,
|
|
96811
97122
|
disabled,
|
|
96812
97123
|
showPicInfo,
|
|
96813
97124
|
renderPicInfo,
|
|
97125
|
+
renderPicPreviewIcon,
|
|
97126
|
+
renderFileOperation,
|
|
96814
97127
|
renderThumbnail,
|
|
96815
|
-
showReplace: typeof file.showReplace !== 'undefined' ? file.showReplace : showReplace,
|
|
96816
97128
|
onReplace,
|
|
96817
97129
|
onPreviewClick: typeof onPreviewClick !== 'undefined' ? () => this.foundation.handlePreviewClick(file) : undefined
|
|
96818
97130
|
});
|
|
@@ -96854,7 +97166,8 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
96854
97166
|
limit,
|
|
96855
97167
|
disabled,
|
|
96856
97168
|
children,
|
|
96857
|
-
draggable
|
|
97169
|
+
draggable,
|
|
97170
|
+
hotSpotLocation
|
|
96858
97171
|
} = this.props;
|
|
96859
97172
|
const {
|
|
96860
97173
|
fileList: stateFileList,
|
|
@@ -96912,7 +97225,7 @@ class upload_Upload extends baseComponent_BaseComponent {
|
|
|
96912
97225
|
className: mainCls,
|
|
96913
97226
|
role: "list",
|
|
96914
97227
|
"aria-label": "picture list"
|
|
96915
|
-
}, 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)));
|
|
96916
97229
|
};
|
|
96917
97230
|
|
|
96918
97231
|
this.renderFileListDefault = () => {
|
|
@@ -97252,6 +97565,7 @@ upload_Upload.propTypes = {
|
|
|
97252
97565
|
fileList: prop_types_default.a.array,
|
|
97253
97566
|
fileName: prop_types_default.a.string,
|
|
97254
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']),
|
|
97255
97569
|
itemStyle: prop_types_default.a.object,
|
|
97256
97570
|
limit: prop_types_default.a.number,
|
|
97257
97571
|
listType: prop_types_default.a.oneOf(upload_constants_strings.LIST_TYPE),
|
|
@@ -97277,6 +97591,8 @@ upload_Upload.propTypes = {
|
|
|
97277
97591
|
prompt: prop_types_default.a.node,
|
|
97278
97592
|
promptPosition: prop_types_default.a.oneOf(upload_constants_strings.PROMPT_POSITION),
|
|
97279
97593
|
renderFileItem: prop_types_default.a.func,
|
|
97594
|
+
renderPicPreviewIcon: prop_types_default.a.func,
|
|
97595
|
+
renderFileOperation: prop_types_default.a.func,
|
|
97280
97596
|
renderPicInfo: prop_types_default.a.func,
|
|
97281
97597
|
renderThumbnail: prop_types_default.a.func,
|
|
97282
97598
|
showClear: prop_types_default.a.bool,
|
|
@@ -97296,6 +97612,7 @@ upload_Upload.defaultProps = {
|
|
|
97296
97612
|
defaultFileList: [],
|
|
97297
97613
|
disabled: false,
|
|
97298
97614
|
listType: 'list',
|
|
97615
|
+
hotSpotLocation: 'end',
|
|
97299
97616
|
multiple: false,
|
|
97300
97617
|
onAcceptInvalid: noop_default.a,
|
|
97301
97618
|
onChange: noop_default.a,
|