@kdcloudjs/kdesign 1.7.63 → 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.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @kdcloudjs/kdesign v1.7.62
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
- if (!inputRef.current) return;
4566
- if (inputRef.current.scrollWidth - inputRef.current.offsetWidth > 0) {
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
- if (isMultiple && inputRef.current && textValue && textValue.length > inputValue.length) {
4590
- var selectionStart = inputRef.current.selectionStart || 0; // selectionStart: 光标前面有几个字符
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
- inputRef.current.value = val = textValue.substring(0, selectionStart) + delimiter + textValue.substring(selectionStart, textValue.length);
4596
- setCursorPosition(inputRef.current, selectionStart);
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
- if (inputRef.current) {
4656
- var scrollToWidth = inputRef.current.scrollWidth - inputRef.current.offsetWidth;
4657
- inputRef.current.scrollLeft = scrollToWidth;
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(inputRef.current, inputValue.length + 1);
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$current2, _inputRef$current3;
4691
- var _findDbClickSelectedP = findDbClickSelectedPos(((_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.selectionStart) || 0, ((_inputRef$current3 = inputRef.current) === null || _inputRef$current3 === void 0 ? void 0 : _inputRef$current3.selectionEnd) || 0),
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(inputRef.current, start, end);
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++) {