@douyinfe/semi-ui 2.55.3 → 2.55.5-hotfix-aria
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/dist/umd/semi-ui.js +56 -10
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/lib/cjs/cascader/index.js +7 -3
- package/lib/cjs/scrollList/scrollItem.js +1 -1
- package/lib/cjs/tree/treeNode.js +2 -1
- package/lib/es/cascader/index.js +7 -3
- package/lib/es/scrollList/scrollItem.js +1 -1
- package/lib/es/tree/treeNode.js +2 -1
- package/package.json +8 -8
package/dist/umd/semi-ui.js
CHANGED
|
@@ -47072,10 +47072,10 @@ class Cascader extends BaseComponent {
|
|
|
47072
47072
|
displayRender,
|
|
47073
47073
|
disableStrictly
|
|
47074
47074
|
} = this.props;
|
|
47075
|
-
const isDsiabled = disabled || keyEntities[nodeKey].data.disabled || disableStrictly && disabledKeys.has(nodeKey);
|
|
47076
47075
|
if (keyEntities[nodeKey]) {
|
|
47076
|
+
const isDisabled = disabled || keyEntities[nodeKey].data.disabled || disableStrictly && disabledKeys.has(nodeKey);
|
|
47077
47077
|
const tagCls = classnames_default()(`${cascader_prefixcls}-selection-tag`, {
|
|
47078
|
-
[`${cascader_prefixcls}-selection-tag-disabled`]:
|
|
47078
|
+
[`${cascader_prefixcls}-selection-tag-disabled`]: isDisabled
|
|
47079
47079
|
});
|
|
47080
47080
|
// custom render tags
|
|
47081
47081
|
if (isFunction_default()(displayRender)) {
|
|
@@ -47738,7 +47738,11 @@ class Cascader extends BaseComponent {
|
|
|
47738
47738
|
formatItem.length > 0 && formatValuePath.push(formatItem);
|
|
47739
47739
|
});
|
|
47740
47740
|
// formatKeys is used to save key of value
|
|
47741
|
-
const formatKeys = formatValuePath.
|
|
47741
|
+
const formatKeys = formatValuePath.reduce((acc, cur) => {
|
|
47742
|
+
const key = getKeyByValuePath(cur);
|
|
47743
|
+
keyEntities[key] && acc.push(key);
|
|
47744
|
+
return acc;
|
|
47745
|
+
}, []);
|
|
47742
47746
|
return formatKeys;
|
|
47743
47747
|
};
|
|
47744
47748
|
const needUpdateTreeData = needUpdate('treeData') || needUpdateData();
|
|
@@ -57936,8 +57940,8 @@ class ScrollItem extends BaseComponent {
|
|
|
57936
57940
|
key: prefixKey + index
|
|
57937
57941
|
}, events, {
|
|
57938
57942
|
className: cls,
|
|
57943
|
+
// eslint-disable-next-line jsx-a11y/role-has-required-aria-props
|
|
57939
57944
|
role: "option",
|
|
57940
|
-
"aria-selected": selected,
|
|
57941
57945
|
"aria-disabled": item.disabled
|
|
57942
57946
|
}), text)
|
|
57943
57947
|
);
|
|
@@ -76010,7 +76014,8 @@ class SliderFoundation extends foundation {
|
|
|
76010
76014
|
this.onHandleLeave = () => {
|
|
76011
76015
|
// this._adapter.setEventDefault(e);
|
|
76012
76016
|
const disabled = this._adapter.getState('disabled');
|
|
76013
|
-
|
|
76017
|
+
const isDrag = this._adapter.getState('isDrag');
|
|
76018
|
+
if (!disabled && !isDrag) {
|
|
76014
76019
|
this._adapter.onHandleLeave();
|
|
76015
76020
|
}
|
|
76016
76021
|
};
|
|
@@ -87771,6 +87776,45 @@ class TreeFoundation extends foundation {
|
|
|
87771
87776
|
const value = pick_default()(data, selectedPath);
|
|
87772
87777
|
this._adapter.notifyChange(value);
|
|
87773
87778
|
}
|
|
87779
|
+
constructDataForValue(value) {
|
|
87780
|
+
const {
|
|
87781
|
+
keyMaps
|
|
87782
|
+
} = this.getProps();
|
|
87783
|
+
const keyName = get_default()(keyMaps, 'key', 'key');
|
|
87784
|
+
const labelName = get_default()(keyMaps, 'label', 'label');
|
|
87785
|
+
return {
|
|
87786
|
+
[keyName]: value,
|
|
87787
|
+
[labelName]: value
|
|
87788
|
+
};
|
|
87789
|
+
}
|
|
87790
|
+
findDataForValue(findValue) {
|
|
87791
|
+
const {
|
|
87792
|
+
value,
|
|
87793
|
+
defaultValue,
|
|
87794
|
+
keyMaps
|
|
87795
|
+
} = this.getProps();
|
|
87796
|
+
const realValueName = get_default()(keyMaps, 'value', 'value');
|
|
87797
|
+
const realKeyName = get_default()(keyMaps, 'key', 'key');
|
|
87798
|
+
let valueArr = [];
|
|
87799
|
+
if (value) {
|
|
87800
|
+
valueArr = Array.isArray(value) ? value : [value];
|
|
87801
|
+
} else if (defaultValue) {
|
|
87802
|
+
valueArr = Array.isArray(defaultValue) ? defaultValue : [defaultValue];
|
|
87803
|
+
}
|
|
87804
|
+
return valueArr.find(item => {
|
|
87805
|
+
return item[realValueName] === findValue || item[realKeyName] === findValue;
|
|
87806
|
+
});
|
|
87807
|
+
}
|
|
87808
|
+
getDataForKeyNotInKeyEntities(value) {
|
|
87809
|
+
const {
|
|
87810
|
+
onChangeWithObject
|
|
87811
|
+
} = this.getProps();
|
|
87812
|
+
if (onChangeWithObject) {
|
|
87813
|
+
return this.findDataForValue(value);
|
|
87814
|
+
} else {
|
|
87815
|
+
return this.constructDataForValue(value);
|
|
87816
|
+
}
|
|
87817
|
+
}
|
|
87774
87818
|
notifyMultipleChange(key, e) {
|
|
87775
87819
|
const {
|
|
87776
87820
|
keyEntities
|
|
@@ -87783,14 +87827,15 @@ class TreeFoundation extends foundation {
|
|
|
87783
87827
|
let value;
|
|
87784
87828
|
let keyList = [];
|
|
87785
87829
|
if (checkRelation === 'related') {
|
|
87786
|
-
keyList = normalizeKeyList(key, keyEntities, leafOnly);
|
|
87830
|
+
keyList = normalizeKeyList(key, keyEntities, leafOnly, true);
|
|
87787
87831
|
} else if (checkRelation === 'unRelated') {
|
|
87788
87832
|
keyList = key;
|
|
87789
87833
|
}
|
|
87834
|
+
const nodes = keyList.map(key => keyEntities[key] ? keyEntities[key].data : this.getDataForKeyNotInKeyEntities(key));
|
|
87790
87835
|
if (this.getProp('onChangeWithObject')) {
|
|
87791
|
-
value =
|
|
87836
|
+
value = nodes;
|
|
87792
87837
|
} else {
|
|
87793
|
-
value = getValueOrKey(
|
|
87838
|
+
value = getValueOrKey(nodes, keyMaps);
|
|
87794
87839
|
}
|
|
87795
87840
|
this._adapter.notifyChange(value);
|
|
87796
87841
|
}
|
|
@@ -87949,7 +87994,7 @@ class TreeFoundation extends foundation {
|
|
|
87949
87994
|
return this.calcCheckedKeys(eventKey, targetStatus);
|
|
87950
87995
|
}
|
|
87951
87996
|
const nonDisabled = descendantKeys.filter(key => !disabledKeys.has(key));
|
|
87952
|
-
const newCheckedKeys = targetStatus ? [...nonDisabled, ...checkedKeys] : difference_default()(normalizeKeyList([...checkedKeys], keyEntities, true), nonDisabled);
|
|
87997
|
+
const newCheckedKeys = targetStatus ? [...nonDisabled, ...checkedKeys] : difference_default()(normalizeKeyList([...checkedKeys], keyEntities, true, true), nonDisabled);
|
|
87953
87998
|
return calcCheckedKeys(newCheckedKeys, keyEntities);
|
|
87954
87999
|
}
|
|
87955
88000
|
/*
|
|
@@ -88498,6 +88543,7 @@ class TreeNode extends external_root_React_commonjs2_react_commonjs_react_amd_re
|
|
|
88498
88543
|
onNodeExpand(e, this.props);
|
|
88499
88544
|
};
|
|
88500
88545
|
this.onCheck = e => {
|
|
88546
|
+
var _a, _b;
|
|
88501
88547
|
if (this.isDisabled()) {
|
|
88502
88548
|
return;
|
|
88503
88549
|
}
|
|
@@ -88505,7 +88551,7 @@ class TreeNode extends external_root_React_commonjs2_react_commonjs_react_amd_re
|
|
|
88505
88551
|
onNodeCheck
|
|
88506
88552
|
} = this.context;
|
|
88507
88553
|
e.stopPropagation();
|
|
88508
|
-
e.nativeEvent.stopImmediatePropagation();
|
|
88554
|
+
(_b = (_a = e.nativeEvent) === null || _a === void 0 ? void 0 : _a.stopImmediatePropagation) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
88509
88555
|
onNodeCheck(e, this.props);
|
|
88510
88556
|
};
|
|
88511
88557
|
/**
|