@douyinfe/semi-ui 2.56.3 → 2.56.4-alpha.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/dist/umd/semi-ui.js +44 -28
- 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/treeSelect/index.js +44 -28
- package/lib/es/treeSelect/index.js +44 -28
- package/package.json +8 -8
package/dist/umd/semi-ui.js
CHANGED
|
@@ -91127,15 +91127,17 @@ class TreeSelect extends BaseComponent {
|
|
|
91127
91127
|
leafOnly,
|
|
91128
91128
|
searchPosition,
|
|
91129
91129
|
triggerRender,
|
|
91130
|
-
borderless
|
|
91130
|
+
borderless,
|
|
91131
|
+
checkRelation
|
|
91131
91132
|
} = _a,
|
|
91132
|
-
rest = treeSelect_rest(_a, ["disabled", "multiple", "filterTreeNode", "validateStatus", "prefix", "suffix", "style", "size", "insetLabel", "className", "placeholder", "showClear", "leafOnly", "searchPosition", "triggerRender", "borderless"]);
|
|
91133
|
+
rest = treeSelect_rest(_a, ["disabled", "multiple", "filterTreeNode", "validateStatus", "prefix", "suffix", "style", "size", "insetLabel", "className", "placeholder", "showClear", "leafOnly", "searchPosition", "triggerRender", "borderless", "checkRelation"]);
|
|
91133
91134
|
const {
|
|
91134
91135
|
inputValue,
|
|
91135
91136
|
selectedKeys,
|
|
91136
91137
|
checkedKeys,
|
|
91137
91138
|
keyEntities,
|
|
91138
|
-
isFocus
|
|
91139
|
+
isFocus,
|
|
91140
|
+
realCheckedKeys
|
|
91139
91141
|
} = this.state;
|
|
91140
91142
|
const filterable = Boolean(filterTreeNode);
|
|
91141
91143
|
const useCustomTrigger = typeof triggerRender === 'function';
|
|
@@ -91163,31 +91165,45 @@ class TreeSelect extends BaseComponent {
|
|
|
91163
91165
|
[`${treeSelect_prefixcls}-with-suffix`]: suffix,
|
|
91164
91166
|
[`${treeSelect_prefixcls}-with-suffix`]: suffix
|
|
91165
91167
|
}, className);
|
|
91166
|
-
|
|
91167
|
-
|
|
91168
|
-
|
|
91169
|
-
|
|
91170
|
-
|
|
91171
|
-
|
|
91172
|
-
|
|
91173
|
-
|
|
91174
|
-
|
|
91175
|
-
|
|
91176
|
-
|
|
91177
|
-
|
|
91178
|
-
|
|
91179
|
-
|
|
91180
|
-
|
|
91181
|
-
|
|
91182
|
-
|
|
91183
|
-
|
|
91184
|
-
|
|
91185
|
-
|
|
91186
|
-
|
|
91187
|
-
|
|
91188
|
-
|
|
91189
|
-
|
|
91190
|
-
}
|
|
91168
|
+
let inner;
|
|
91169
|
+
if (useCustomTrigger) {
|
|
91170
|
+
let triggerRenderKeys = [];
|
|
91171
|
+
if (multiple) {
|
|
91172
|
+
if (checkRelation === 'related') {
|
|
91173
|
+
triggerRenderKeys = normalizeKeyList(checkedKeys, keyEntities, leafOnly, true);
|
|
91174
|
+
} else if (checkRelation === 'unRelated') {
|
|
91175
|
+
triggerRenderKeys = [...realCheckedKeys];
|
|
91176
|
+
}
|
|
91177
|
+
} else {
|
|
91178
|
+
triggerRenderKeys = selectedKeys;
|
|
91179
|
+
}
|
|
91180
|
+
inner = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(trigger, {
|
|
91181
|
+
inputValue: inputValue,
|
|
91182
|
+
value: triggerRenderKeys.map(key => get_default()(keyEntities, [key, 'data'])),
|
|
91183
|
+
disabled: disabled,
|
|
91184
|
+
placeholder: placeholder,
|
|
91185
|
+
onClear: this.handleClear,
|
|
91186
|
+
componentName: 'TreeSelect',
|
|
91187
|
+
triggerRender: triggerRender,
|
|
91188
|
+
componentProps: Object.assign({}, this.props),
|
|
91189
|
+
onSearch: this.search,
|
|
91190
|
+
onRemove: this.removeTag
|
|
91191
|
+
});
|
|
91192
|
+
} else {
|
|
91193
|
+
inner = [/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, {
|
|
91194
|
+
key: 'prefix'
|
|
91195
|
+
}, prefix || insetLabel ? this.renderPrefix() : null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, {
|
|
91196
|
+
key: 'selection'
|
|
91197
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("div", {
|
|
91198
|
+
className: `${treeSelect_prefixcls}-selection`
|
|
91199
|
+
}, this.renderSelectContent())), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, {
|
|
91200
|
+
key: 'suffix'
|
|
91201
|
+
}, suffix ? this.renderSuffix() : null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, {
|
|
91202
|
+
key: 'clearBtn'
|
|
91203
|
+
}, showClear || isTriggerPositionSearch && inputValue ? this.renderClearBtn() : null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_.Fragment, {
|
|
91204
|
+
key: 'arrow'
|
|
91205
|
+
}, this.renderArrow())];
|
|
91206
|
+
}
|
|
91191
91207
|
const tabIndex = disabled ? null : 0;
|
|
91192
91208
|
/**
|
|
91193
91209
|
* Reasons for disabling the a11y eslint rule:
|