@kdcloudjs/kdesign 1.7.62 → 1.7.64
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/kdesign.css +1 -1
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +35 -23
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +1 -1
- package/dist/kdesign.min.js +5 -5
- package/dist/kdesign.min.js.map +1 -1
- package/es/base-data/base-data.js +24 -16
- package/es/tree-select/tree-select.js +10 -6
- package/lib/base-data/base-data.js +24 -16
- package/lib/tree-select/tree-select.js +10 -6
- package/package.json +1 -1
package/dist/kdesign.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* @kdcloudjs/kdesign v1.7.
|
|
3
|
+
* @kdcloudjs/kdesign v1.7.63
|
|
4
4
|
*
|
|
5
5
|
* Copyright 2020-present, Kingdee, Inc.
|
|
6
6
|
* All rights reserved.
|
|
@@ -4520,12 +4520,12 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
4520
4520
|
searchInfo.current.editOptions = _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(seletedItems);
|
|
4521
4521
|
}, [value, isMultiple]);
|
|
4522
4522
|
Object(react__WEBPACK_IMPORTED_MODULE_17__["useEffect"])(function () {
|
|
4523
|
-
var _inputRef$current;
|
|
4523
|
+
var _inputRef$current, _inputRef$current$inp;
|
|
4524
4524
|
if (!searchInfo.current.previousEditValue) return;
|
|
4525
4525
|
var posList = setValIndxPosition();
|
|
4526
4526
|
var preValueArr = getStrToArr(searchInfo.current.previousEditValue, delimiter);
|
|
4527
4527
|
var valueArr = getStrToArr(inputValue, delimiter);
|
|
4528
|
-
var selectionStart = ((_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.selectionStart) || 0;
|
|
4528
|
+
var selectionStart = ((_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : (_inputRef$current$inp = _inputRef$current.input) === null || _inputRef$current$inp === void 0 ? void 0 : _inputRef$current$inp.selectionStart) || 0;
|
|
4529
4529
|
var index = findSelectionIndex(selectionStart, posList);
|
|
4530
4530
|
searchInfo.current.searchIndex = index;
|
|
4531
4531
|
// 新增一个
|
|
@@ -4562,8 +4562,10 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
4562
4562
|
|
|
4563
4563
|
// 当选中项文字超出输入框时,显示共多少项
|
|
4564
4564
|
Object(react__WEBPACK_IMPORTED_MODULE_17__["useLayoutEffect"])(function () {
|
|
4565
|
-
|
|
4566
|
-
|
|
4565
|
+
var _inputRef$current2;
|
|
4566
|
+
var inputDom = (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.input;
|
|
4567
|
+
if (!inputDom) return;
|
|
4568
|
+
if (inputDom.scrollWidth - inputDom.offsetWidth > 0) {
|
|
4567
4569
|
setShowTotal(true);
|
|
4568
4570
|
} else {
|
|
4569
4571
|
setShowTotal(false);
|
|
@@ -4583,17 +4585,19 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
4583
4585
|
setValueBySeleted();
|
|
4584
4586
|
}, [setValueBySeleted]);
|
|
4585
4587
|
var changeInputText = function changeInputText(e) {
|
|
4588
|
+
var _inputRef$current3;
|
|
4586
4589
|
setOptionShow(true);
|
|
4587
4590
|
var textValue = e.target.value;
|
|
4588
4591
|
var val = textValue;
|
|
4589
|
-
|
|
4590
|
-
|
|
4592
|
+
var inputDom = (_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.input;
|
|
4593
|
+
if (isMultiple && inputDom && textValue && textValue.length > inputValue.length) {
|
|
4594
|
+
var selectionStart = inputDom.selectionStart || 0; // selectionStart: 光标前面有几个字符
|
|
4591
4595
|
searchInfo.current.selectionStart = selectionStart;
|
|
4592
4596
|
var isInHead = selectionStart === 1 && textValue[1] !== delimiter && textValue.length !== 1; // 在首部添加
|
|
4593
4597
|
var isInMid = selectionStart !== textValue.length && textValue[selectionStart - 2] === delimiter && textValue[selectionStart] !== delimiter;
|
|
4594
4598
|
if (isInHead || isInMid) {
|
|
4595
|
-
|
|
4596
|
-
setCursorPosition(
|
|
4599
|
+
inputDom.value = val = textValue.substring(0, selectionStart) + delimiter + textValue.substring(selectionStart, textValue.length);
|
|
4600
|
+
setCursorPosition(inputDom, selectionStart);
|
|
4597
4601
|
}
|
|
4598
4602
|
}
|
|
4599
4603
|
setInputValue(val);
|
|
@@ -4609,11 +4613,12 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
4609
4613
|
return queryStr;
|
|
4610
4614
|
}
|
|
4611
4615
|
if (inputRef.current && queryStr) {
|
|
4616
|
+
var _inputRef$current4, _inputRef$current4$in;
|
|
4612
4617
|
if (queryStr.indexOf(delimiter) < 0) {
|
|
4613
4618
|
// 只有一条记录
|
|
4614
4619
|
return queryStr;
|
|
4615
4620
|
}
|
|
4616
|
-
var selectionStart = inputRef.current.selectionStart || 0;
|
|
4621
|
+
var selectionStart = ((_inputRef$current4 = inputRef.current) === null || _inputRef$current4 === void 0 ? void 0 : (_inputRef$current4$in = _inputRef$current4.input) === null || _inputRef$current4$in === void 0 ? void 0 : _inputRef$current4$in.selectionStart) || 0;
|
|
4617
4622
|
var startIndex = queryStr.slice(0, selectionStart).lastIndexOf(delimiter) + 1; // 光标前面最近分隔符index
|
|
4618
4623
|
var endIndex = queryStr.slice(selectionStart).indexOf(delimiter);
|
|
4619
4624
|
endIndex = endIndex === -1 ? queryStr.length : selectionStart + endIndex; // 光标后面最近分隔符index
|
|
@@ -4651,12 +4656,14 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
4651
4656
|
setSeletedOptions(list);
|
|
4652
4657
|
};
|
|
4653
4658
|
var showInputTotal = function showInputTotal() {
|
|
4659
|
+
var _inputRef$current5;
|
|
4654
4660
|
if (disabled) return;
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4661
|
+
var inputDom = (_inputRef$current5 = inputRef.current) === null || _inputRef$current5 === void 0 ? void 0 : _inputRef$current5.input;
|
|
4662
|
+
if (inputDom) {
|
|
4663
|
+
var scrollToWidth = inputDom.scrollWidth - inputDom.offsetWidth;
|
|
4664
|
+
inputDom.scrollLeft = scrollToWidth;
|
|
4658
4665
|
setTimeout(function () {
|
|
4659
|
-
setCursorPosition(
|
|
4666
|
+
setCursorPosition(inputDom, inputValue.length + 1);
|
|
4660
4667
|
}, 0);
|
|
4661
4668
|
}
|
|
4662
4669
|
};
|
|
@@ -4687,11 +4694,12 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
4687
4694
|
|
|
4688
4695
|
// 双击选中当前项
|
|
4689
4696
|
var handleDoubleClick = function handleDoubleClick() {
|
|
4690
|
-
var _inputRef$
|
|
4691
|
-
var
|
|
4697
|
+
var _inputRef$current6;
|
|
4698
|
+
var inputDom = (_inputRef$current6 = inputRef.current) === null || _inputRef$current6 === void 0 ? void 0 : _inputRef$current6.input;
|
|
4699
|
+
var _findDbClickSelectedP = findDbClickSelectedPos((inputDom === null || inputDom === void 0 ? void 0 : inputDom.selectionStart) || 0, (inputDom === null || inputDom === void 0 ? void 0 : inputDom.selectionEnd) || 0),
|
|
4692
4700
|
start = _findDbClickSelectedP.start,
|
|
4693
4701
|
end = _findDbClickSelectedP.end;
|
|
4694
|
-
handleSeletedText(
|
|
4702
|
+
handleSeletedText(inputDom, start, end);
|
|
4695
4703
|
};
|
|
4696
4704
|
var findDbClickSelectedPos = function findDbClickSelectedPos(selectionStart, selectionEnd) {
|
|
4697
4705
|
for (var index = 0; index < indxPosList.length; index++) {
|
|
@@ -38633,7 +38641,7 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
38633
38641
|
// 输入框变化搜索内容
|
|
38634
38642
|
var handleSearchChange = Object(react__WEBPACK_IMPORTED_MODULE_19__["useCallback"])(function (event) {
|
|
38635
38643
|
var val = event.currentTarget.value;
|
|
38636
|
-
|
|
38644
|
+
handleVisibleChange(true);
|
|
38637
38645
|
setSearchValue(val);
|
|
38638
38646
|
onSearch === null || onSearch === void 0 ? void 0 : onSearch(val);
|
|
38639
38647
|
}, [onSearch]);
|
|
@@ -38683,7 +38691,7 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
38683
38691
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(keys, state);
|
|
38684
38692
|
!isMultiple && (onChange === null || onChange === void 0 ? void 0 : onChange(keys[0], [TreeMap.get(keys[0])]));
|
|
38685
38693
|
if (!isMultiple) {
|
|
38686
|
-
|
|
38694
|
+
handleVisibleChange(false);
|
|
38687
38695
|
}
|
|
38688
38696
|
};
|
|
38689
38697
|
var handleCheck = function handleCheck(keys, state) {
|
|
@@ -38779,6 +38787,9 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
38779
38787
|
Object(react__WEBPACK_IMPORTED_MODULE_19__["useEffect"])(function () {
|
|
38780
38788
|
setSelectedKeys(initValue);
|
|
38781
38789
|
}, [initValue]);
|
|
38790
|
+
Object(react__WEBPACK_IMPORTED_MODULE_19__["useEffect"])(function () {
|
|
38791
|
+
setOptionShow(props.visible);
|
|
38792
|
+
}, [props.visible]);
|
|
38782
38793
|
|
|
38783
38794
|
// 渲染下拉列表框
|
|
38784
38795
|
var renderContent = function renderContent() {
|
|
@@ -38818,7 +38829,7 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
38818
38829
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_19___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_19___default.a.Fragment, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_19___default.a.createElement("div", {
|
|
38819
38830
|
className: singleCls,
|
|
38820
38831
|
ref: selectionRef,
|
|
38821
|
-
title: label
|
|
38832
|
+
title: typeof label === 'string' ? label : ''
|
|
38822
38833
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_19___default.a.createElement("span", {
|
|
38823
38834
|
className: "".concat(selectPrefixCls, "-selection-search")
|
|
38824
38835
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_19___default.a.createElement("input", {
|
|
@@ -38873,7 +38884,7 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
38873
38884
|
return handleRemove(e, key);
|
|
38874
38885
|
},
|
|
38875
38886
|
"data-tag": key,
|
|
38876
|
-
title: label
|
|
38887
|
+
title: typeof label === 'string' ? label : ''
|
|
38877
38888
|
}, label));
|
|
38878
38889
|
}), maxTagCount && selectTreeNodes.length > maxTagCount ? maxTagPlaceholder ? handleMaxTagHolder() : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_19___default.a.createElement("span", {
|
|
38879
38890
|
className: itemCls
|
|
@@ -38937,9 +38948,10 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
|
|
|
38937
38948
|
onVisibleChange === null || onVisibleChange === void 0 ? void 0 : onVisibleChange(visible);
|
|
38938
38949
|
}
|
|
38939
38950
|
};
|
|
38940
|
-
var popperProps = _objectSpread(_objectSpread({
|
|
38951
|
+
var popperProps = _objectSpread(_objectSpread({
|
|
38952
|
+
placement: 'bottomLeft'
|
|
38953
|
+
}, treeSelectProps), {}, {
|
|
38941
38954
|
prefixCls: "".concat(selectPrefixCls, "-panel"),
|
|
38942
|
-
placement: 'bottomLeft',
|
|
38943
38955
|
popperStyle: catchStyle(),
|
|
38944
38956
|
defaultVisible: optionShow,
|
|
38945
38957
|
visible: optionShow,
|