bkui-vue 1.0.3-beta.54 → 1.0.3-beta.56

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.
@@ -480,7 +480,7 @@ function _defineProperty(obj, key, value) {
480
480
  ;// CONCATENATED MODULE: external "vue"
481
481
  var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
482
482
  var external_vue_y = x => () => x
483
- const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["shallowRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["watchEffect"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
483
+ const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["shallowRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
484
484
  ;// CONCATENATED MODULE: ../../node_modules/resize-detector/esm/index.js
485
485
  var raf = null;
486
486
  function requestAnimationFrame (callback) {
@@ -809,6 +809,66 @@ const directives_namespaceObject = directives_x({ ["clickoutside"]: () => __WEBP
809
809
  var icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
810
810
  var icon_y = x => () => x
811
811
  const icon_namespaceObject = icon_x({ ["Close"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Close, ["Error"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Error, ["ExclamationCircleShape"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.ExclamationCircleShape, ["Search"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Search });
812
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
813
+ function _arrayWithHoles(arr) {
814
+ if (Array.isArray(arr)) return arr;
815
+ }
816
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
817
+ function _iterableToArrayLimit(r, l) {
818
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
819
+ if (null != t) {
820
+ var e,
821
+ n,
822
+ i,
823
+ u,
824
+ a = [],
825
+ f = !0,
826
+ o = !1;
827
+ try {
828
+ if (i = (t = t.call(r)).next, 0 === l) {
829
+ if (Object(t) !== t) return;
830
+ f = !1;
831
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
832
+ } catch (r) {
833
+ o = !0, n = r;
834
+ } finally {
835
+ try {
836
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
837
+ } finally {
838
+ if (o) throw n;
839
+ }
840
+ }
841
+ return a;
842
+ }
843
+ }
844
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
845
+ function _arrayLikeToArray(arr, len) {
846
+ if (len == null || len > arr.length) len = arr.length;
847
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
848
+ return arr2;
849
+ }
850
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
851
+
852
+ function _unsupportedIterableToArray(o, minLen) {
853
+ if (!o) return;
854
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
855
+ var n = Object.prototype.toString.call(o).slice(8, -1);
856
+ if (n === "Object" && o.constructor) n = o.constructor.name;
857
+ if (n === "Map" || n === "Set") return Array.from(o);
858
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
859
+ }
860
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
861
+ function _nonIterableRest() {
862
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
863
+ }
864
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js
865
+
866
+
867
+
868
+
869
+ function _slicedToArray(arr, i) {
870
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
871
+ }
812
872
  ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
813
873
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
814
874
  try {
@@ -922,6 +982,7 @@ function _createClass(Constructor, protoProps, staticProps) {
922
982
  * IN THE SOFTWARE.
923
983
  */
924
984
 
985
+
925
986
  /**
926
987
  * @description: 获取menu list方法
927
988
  * @param {ISearchItem} item 已选择的key字段 为空则代表当前并未选择key字段
@@ -955,11 +1016,13 @@ var SelectedItem = /*#__PURE__*/function () {
955
1016
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
956
1017
  _classCallCheck(this, SelectedItem);
957
1018
  _defineProperty(this, "values", []);
1019
+ _defineProperty(this, "nameRenderkey", (0,shared_namespaceObject.random)(4));
958
1020
  this.searchItem = searchItem;
959
1021
  this.type = type;
960
1022
  this.id = searchItem.id;
961
1023
  this.name = searchItem.name;
962
1024
  this.logical = searchItem.logical || SearchLogical.OR;
1025
+ this.type = type;
963
1026
  }
964
1027
  _createClass(SelectedItem, [{
965
1028
  key: "multiple",
@@ -1024,6 +1087,7 @@ var SelectedItem = /*#__PURE__*/function () {
1024
1087
  }, {
1025
1088
  key: "addValue",
1026
1089
  value: function addValue(item) {
1090
+ this.nameRenderkey = (0,shared_namespaceObject.random)(4);
1027
1091
  if (this.multiple) {
1028
1092
  var index = this.values.findIndex(function (val) {
1029
1093
  return val.id === item.id;
@@ -1037,6 +1101,66 @@ var SelectedItem = /*#__PURE__*/function () {
1037
1101
  }
1038
1102
  this.values = [item];
1039
1103
  }
1104
+ }, {
1105
+ key: "str2Values",
1106
+ value: function str2Values(str) {
1107
+ var _this = this;
1108
+ var list = str === null || str === void 0 ? void 0 : str.split(this.logical).map(function (v) {
1109
+ return v.trim();
1110
+ }).filter(function (v) {
1111
+ return v;
1112
+ });
1113
+ if (!(list !== null && list !== void 0 && list.length)) return [];
1114
+ var findChildByName = function findChildByName(name) {
1115
+ return _this.children.find(function (item) {
1116
+ return item.name === name;
1117
+ });
1118
+ };
1119
+ if (!this.multiple) {
1120
+ var val = list.join(this.logical).trim();
1121
+ var item = findChildByName(val);
1122
+ return [{
1123
+ id: item ? item.id : val,
1124
+ name: item ? item.name : val,
1125
+ disabled: !!(item !== null && item !== void 0 && item.disabled)
1126
+ }];
1127
+ }
1128
+ // 对于多选情况,处理整个列表
1129
+ return list.map(function (val) {
1130
+ var existing = _this.values.find(function (item) {
1131
+ return item.name === val;
1132
+ });
1133
+ if (existing) return existing;
1134
+ var item = findChildByName(val);
1135
+ return {
1136
+ id: item ? item.id : val,
1137
+ name: item ? item.name : val,
1138
+ disabled: !!(item !== null && item !== void 0 && item.disabled)
1139
+ };
1140
+ });
1141
+ }
1142
+ }, {
1143
+ key: "addValues",
1144
+ value: function addValues(str) {
1145
+ var mergeValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1146
+ var list = this.str2Values(str.split(/(\s|\||,|、|\/|\n\r|\n)/gm).filter(function (v) {
1147
+ return !!v.trim();
1148
+ }).concat(this.values.map(function (item) {
1149
+ return mergeValues ? item.name : '';
1150
+ })).filter(function (v) {
1151
+ return !!v.trim();
1152
+ }).join(this.logical));
1153
+ this.values = list;
1154
+ }
1155
+ }, {
1156
+ key: "getValue",
1157
+ value: function getValue(str) {
1158
+ return this.values.find(function (item) {
1159
+ return item.id === str;
1160
+ }) || this.values.find(function (item) {
1161
+ return item.name === str;
1162
+ });
1163
+ }
1040
1164
  }, {
1041
1165
  key: "toValue",
1042
1166
  value: function toValue() {
@@ -1315,9 +1439,10 @@ var SelectedItem = /*#__PURE__*/function () {
1315
1439
 
1316
1440
 
1317
1441
 
1442
+
1443
+
1318
1444
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1319
1445
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1320
-
1321
1446
  /*
1322
1447
  * Tencent is pleased to support the open source community by making
1323
1448
  * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
@@ -1403,7 +1528,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1403
1528
  var menuList = (0,external_vue_namespaceObject.ref)([]);
1404
1529
  var _useSearchSelectInjec = useSearchSelectInject(),
1405
1530
  editKey = _useSearchSelectInjec.editKey,
1406
- onValidate = _useSearchSelectInjec.onValidate;
1531
+ onValidate = _useSearchSelectInjec.onValidate,
1532
+ searchData = _useSearchSelectInjec.searchData;
1407
1533
  var valueLoagic = (0,external_vue_namespaceObject.computed)(function () {
1408
1534
  var _usingItem$value;
1409
1535
  return ((_usingItem$value = usingItem.value) === null || _usingItem$value === void 0 ? void 0 : _usingItem$value.logical) || SearchLogical.OR;
@@ -1414,13 +1540,14 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1414
1540
  }
1415
1541
  });
1416
1542
  // effects
1417
- (0,external_vue_namespaceObject.watchEffect)(function () {
1418
- if (!keyword.value) {
1419
- setInputText();
1420
- }
1421
- }, {
1422
- flush: 'pre'
1423
- });
1543
+ // watchEffect(
1544
+ // () => {
1545
+ // if (!keyword.value) {
1546
+ // setInputText();
1547
+ // }
1548
+ // },
1549
+ // { flush: 'pre' },
1550
+ // );
1424
1551
  (0,external_vue_namespaceObject.watch)([menuList, showPopover], function () {
1425
1552
  var _menuList$value;
1426
1553
  if ((_menuList$value = menuList.value) !== null && _menuList$value !== void 0 && _menuList$value.some(function (item) {
@@ -1494,53 +1621,73 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1494
1621
  function handleClickOutside(e) {
1495
1622
  var _popoverRef$value, _props$clickOutside;
1496
1623
  if (!((_popoverRef$value = popoverRef.value) !== null && _popoverRef$value !== void 0 && _popoverRef$value.contains(e.target)) && (_props$clickOutside = props.clickOutside) !== null && _props$clickOutside !== void 0 && _props$clickOutside.call(props, e.target, popoverRef.value)) {
1497
- var _usingItem$value2, _usingItem$value3;
1498
- if ((_usingItem$value2 = usingItem.value) !== null && _usingItem$value2 !== void 0 && (_usingItem$value2 = _usingItem$value2.values) !== null && _usingItem$value2 !== void 0 && _usingItem$value2.length && (_usingItem$value3 = usingItem.value) !== null && _usingItem$value3 !== void 0 && _usingItem$value3.multiple) {
1499
- keyword.value = '';
1500
- handleKeyEnter();
1624
+ if (props.mode === SearchInputMode.EDIT || usingItem.value) {
1625
+ usingItem.value && handleKeyEnter();
1626
+ if (!usingItem.value) {
1627
+ emit('focus', false);
1628
+ }
1501
1629
  return;
1502
1630
  }
1503
- showPopover.value = false;
1504
1631
  isFocus.value = false;
1632
+ showPopover.value = false;
1505
1633
  emit('focus', isFocus.value);
1506
1634
  }
1507
1635
  }
1508
- function handleInputFocus(e) {
1509
- setInputFocus();
1510
- e && setMenuList();
1511
- }
1512
- function handleInputChange(event) {
1513
- var _usingItem$value5, _usingItem$value8;
1514
- clearInput();
1515
- var text = event.target.innerText;
1516
- if (/(\r|\n)/gm.test(text) || /\s{2}/gm.test(text)) {
1517
- var _usingItem$value4;
1518
- event.preventDefault();
1519
- text = text.replace(/(\r|\n)/gm, " ".concat(valueLoagic.value, " ")).replace(/\s{2}/gm, '');
1520
- inputRef.value.innerText = text;
1521
- setInputFocus();
1522
- keyword.value = text.replace(((_usingItem$value4 = usingItem.value) === null || _usingItem$value4 === void 0 ? void 0 : _usingItem$value4.keyInnerText) || '', '').trim();
1523
- debounceSetMenuList();
1524
- } else if (!keyword.value && text.length < (((_usingItem$value5 = usingItem.value) === null || _usingItem$value5 === void 0 || (_usingItem$value5 = _usingItem$value5.inputInnerText) === null || _usingItem$value5 === void 0 ? void 0 : _usingItem$value5.length) || 1)) {
1525
- var _usingItem$value6, _usingItem$value7, _usingItem$value$valu, _text;
1526
- var outerText = text.replace("\xA0", " ").replace(((_usingItem$value6 = usingItem.value) === null || _usingItem$value6 === void 0 ? void 0 : _usingItem$value6.keyInnerText.replace("\xA0", " ").trim()) || '', '').trim();
1527
- var hasKeyword = text && ((_usingItem$value7 = usingItem.value) === null || _usingItem$value7 === void 0 ? void 0 : _usingItem$value7.keyInnerText) && text.replace("\xA0", " ").includes(usingItem.value.keyInnerText.replace("\xA0", " ").trim());
1528
- if (hasKeyword && outerText && (_usingItem$value$valu = usingItem.value.values) !== null && _usingItem$value$valu !== void 0 && _usingItem$value$valu.length) {
1529
- keyword.value = outerText;
1530
- debounceSetMenuList();
1531
- return;
1636
+ function handleInputFocus() {
1637
+ showNoSelectValueError.value = false;
1638
+ if (props.mode === SearchInputMode.EDIT && usingItem.value && !isFocus.value) {
1639
+ var range = document.createRange();
1640
+ var selection = window.getSelection();
1641
+ var nodeList = [];
1642
+ if (usingItem.value.values.length) {
1643
+ nodeList = Array.from(inputRef.value.querySelectorAll('[data-type="value"]'));
1644
+ } else {
1645
+ nodeList = Array.from(inputRef.value.querySelectorAll("[data-type=\"".concat(usingItem.value.type, "\"]")));
1532
1646
  }
1533
- if (outerText || !((_text = text) !== null && _text !== void 0 && _text.length)) {
1534
- usingItem.value = null;
1647
+ if (!nodeList.length) return;
1648
+ range.selectNodeContents(nodeList.at(-1));
1649
+ selection === null || selection === void 0 || selection.removeAllRanges();
1650
+ selection.addRange(range); // 注意这里会触发focu事件
1651
+ setInputFocus(true, false);
1652
+ return;
1653
+ }
1654
+ setMenuList();
1655
+ setInputFocus(false, !isFocus.value);
1656
+ }
1657
+ function handleInputPaste(event) {
1658
+ event.preventDefault();
1659
+ var clipboardData = event.clipboardData;
1660
+ var pastedData = clipboardData.getData('text');
1661
+ var tempDiv = document.createElement('div');
1662
+ tempDiv.innerHTML = pastedData;
1663
+ var formattedText = (tempDiv.textContent || tempDiv.innerText || '').trim();
1664
+ if (!usingItem.value) {
1665
+ var formateItem = str2SeletedItem(formattedText);
1666
+ if (formateItem) {
1667
+ usingItem.value = formateItem;
1668
+ setInputFocus(true, true);
1669
+ return;
1535
1670
  }
1536
- keyword.value = outerText ? text : '';
1537
- debounceSetMenuList();
1538
- } else if (!((_usingItem$value8 = usingItem.value) !== null && _usingItem$value8 !== void 0 && (_usingItem$value8 = _usingItem$value8.values) !== null && _usingItem$value8 !== void 0 && _usingItem$value8.length)) {
1539
- var _usingItem$value9;
1540
- keyword.value = text.replace("\xA0", " ").replace(((_usingItem$value9 = usingItem.value) === null || _usingItem$value9 === void 0 ? void 0 : _usingItem$value9.keyInnerText.replace("\xA0", " ")) || '', '').trim();
1671
+ keyword.value = formattedText.split(/(\s|\||,|、|\/|\n\r|\n)/gm).filter(function (v) {
1672
+ return !!v.trim();
1673
+ }).join(valueLoagic.value);
1674
+ inputRef.value.innerText = keyword.value;
1541
1675
  setInputFocus();
1542
1676
  debounceSetMenuList();
1677
+ return;
1543
1678
  }
1679
+ usingItem.value.addValues(formattedText);
1680
+ debounceSetMenuList();
1681
+ }
1682
+ function handleInputChange(event) {
1683
+ var text = event.target.innerText;
1684
+ if (!usingItem.value) {
1685
+ keyword.value = text;
1686
+ debounceSetMenuList();
1687
+ return;
1688
+ }
1689
+ keyword.value = usingItem.value.isSpecialType() ? text.trim() : text.replace(usingItem.value.name, '').replace(':', '').trim();
1690
+ debounceSetMenuList();
1544
1691
  }
1545
1692
  function handleInputKeyup(event) {
1546
1693
  switch (event.code) {
@@ -1549,10 +1696,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1549
1696
  if (props.valueBehavior === ValueBehavior.NEEDKEY && menuList.value.some(function (item) {
1550
1697
  return item.id === menuHoverId.value;
1551
1698
  })) return;
1552
- handleKeyEnter(event);
1699
+ handleKeyEnter(event).then(function (v) {
1700
+ return v && clearInput();
1701
+ });
1553
1702
  break;
1554
1703
  case 'Backspace':
1555
- handleKeyBackspace();
1704
+ handleKeyBackspace(event);
1556
1705
  default:
1557
1706
  showNoSelectValueError.value = false;
1558
1707
  break;
@@ -1563,7 +1712,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1563
1712
  }
1564
1713
  function _handleKeyEnter() {
1565
1714
  _handleKeyEnter = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee(event) {
1566
- var value, _res, values, _keyword$value, valueList, _res2, _value, _res3, _value2, _res4, res;
1715
+ var _keyword$value, _usingItem$value4, _usingItem$value5;
1716
+ var formatItem, valueList, _res, _valueList, _formatItem, _res2, res;
1567
1717
  return regenerator_default().wrap(function _callee$(_context) {
1568
1718
  while (1) switch (_context.prev = _context.next) {
1569
1719
  case 0:
@@ -1575,7 +1725,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1575
1725
  });
1576
1726
  case 3:
1577
1727
  if (usingItem.value) {
1578
- _context.next = 16;
1728
+ _context.next = 17;
1579
1729
  break;
1580
1730
  }
1581
1731
  if (!(!keyword.value || props.valueBehavior === ValueBehavior.NEEDKEY)) {
@@ -1584,43 +1734,54 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1584
1734
  }
1585
1735
  return _context.abrupt("return");
1586
1736
  case 6:
1587
- value = {
1737
+ formatItem = str2SeletedItem(keyword.value);
1738
+ valueList = (formatItem === null || formatItem === void 0 ? void 0 : formatItem.values) || [{
1588
1739
  id: keyword.value,
1589
1740
  name: keyword.value
1590
- };
1591
- _context.next = 9;
1592
- return validateUsingItemValues(value);
1593
- case 9:
1741
+ }];
1742
+ _context.next = 10;
1743
+ return Promise.all(valueList.map(function (item) {
1744
+ return validateUsingItemValues(item);
1745
+ })).then(function () {
1746
+ return true;
1747
+ })["catch"](function () {
1748
+ return false;
1749
+ });
1750
+ case 10:
1594
1751
  _res = _context.sent;
1595
1752
  if (_res) {
1596
- _context.next = 12;
1753
+ _context.next = 13;
1597
1754
  break;
1598
1755
  }
1599
1756
  return _context.abrupt("return");
1600
- case 12:
1601
- emit('add', new SelectedItem(value, 'text'));
1757
+ case 13:
1758
+ emit('add', formatItem || new SelectedItem(_objectSpread({}, valueList[0]), 'text'));
1602
1759
  keyword.value = '';
1603
1760
  setMenuList();
1604
- return _context.abrupt("return");
1605
- case 16:
1606
- values = usingItem.value.values;
1607
- if (values !== null && values !== void 0 && values.length) {
1608
- _context.next = 43;
1609
- break;
1610
- }
1761
+ return _context.abrupt("return", true);
1762
+ case 17:
1611
1763
  if (!((_keyword$value = keyword.value) !== null && _keyword$value !== void 0 && _keyword$value.length)) {
1612
- _context.next = 41;
1764
+ _context.next = 32;
1613
1765
  break;
1614
1766
  }
1615
- if (!keyword.value.includes(valueLoagic.value)) {
1616
- _context.next = 29;
1617
- break;
1767
+ _valueList = [];
1768
+ if (usingItem.value.isSpecialType()) {
1769
+ _formatItem = str2SeletedItem(keyword.value);
1770
+ if (_formatItem) {
1771
+ usingItem.value = _formatItem;
1772
+ _valueList = _formatItem.values;
1773
+ }
1774
+ }
1775
+ if (!_valueList.length) {
1776
+ _valueList = usingItem.value.str2Values(keyword.value);
1618
1777
  }
1619
- valueList = keyword.value.split(valueLoagic.value);
1620
1778
  _context.next = 23;
1621
- return validateUsingItemValues({
1622
- id: keyword.value,
1623
- name: keyword.value
1779
+ return Promise.all(_valueList.map(function (item) {
1780
+ return validateUsingItemValues(item);
1781
+ })).then(function () {
1782
+ return true;
1783
+ })["catch"](function () {
1784
+ return false;
1624
1785
  });
1625
1786
  case 23:
1626
1787
  _res2 = _context.sent;
@@ -1630,77 +1791,38 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1630
1791
  }
1631
1792
  return _context.abrupt("return");
1632
1793
  case 26:
1633
- valueList.forEach(function (v) {
1634
- return usingItem.value.addValue({
1635
- id: v,
1636
- name: v
1637
- });
1638
- });
1639
- _context.next = 36;
1640
- break;
1641
- case 29:
1642
- _value = {
1643
- id: keyword.value,
1644
- name: keyword.value
1645
- };
1646
- _context.next = 32;
1647
- return validateUsingItemValues(_value);
1648
- case 32:
1649
- _res3 = _context.sent;
1650
- if (_res3) {
1651
- _context.next = 35;
1652
- break;
1794
+ if (usingItem.value.type === 'text') {
1795
+ usingItem.value.name = keyword.value;
1796
+ usingItem.value.id = keyword.value;
1797
+ } else {
1798
+ usingItem.value.values = _valueList;
1653
1799
  }
1654
- return _context.abrupt("return");
1655
- case 35:
1656
- usingItem.value.addValue(_value);
1657
- case 36:
1658
1800
  emit('add', usingItem.value);
1659
1801
  keyword.value = '';
1660
1802
  usingItem.value = null;
1661
1803
  setInputFocus(true);
1662
- return _context.abrupt("return");
1663
- case 41:
1664
- showNoSelectValueError.value = true;
1665
- return _context.abrupt("return");
1666
- case 43:
1667
- if (!keyword.value) {
1668
- _context.next = 56;
1669
- break;
1670
- }
1671
- _value2 = {
1672
- id: keyword.value,
1673
- name: keyword.value
1674
- };
1675
- _context.next = 47;
1676
- return validateUsingItemValues(_value2);
1677
- case 47:
1678
- _res4 = _context.sent;
1679
- if (_res4) {
1680
- _context.next = 50;
1804
+ return _context.abrupt("return", true);
1805
+ case 32:
1806
+ if (!(!((_usingItem$value4 = usingItem.value) !== null && _usingItem$value4 !== void 0 && _usingItem$value4.isSpecialType()) && ((_usingItem$value5 = usingItem.value) === null || _usingItem$value5 === void 0 || (_usingItem$value5 = _usingItem$value5.values) === null || _usingItem$value5 === void 0 ? void 0 : _usingItem$value5.length) < 1)) {
1807
+ _context.next = 35;
1681
1808
  break;
1682
1809
  }
1683
- return _context.abrupt("return");
1684
- case 50:
1685
- usingItem.value.addValue(_value2);
1686
- emit('add', usingItem.value);
1687
- keyword.value = '';
1688
- usingItem.value = null;
1689
- setInputFocus(true);
1690
- return _context.abrupt("return");
1691
- case 56:
1692
- _context.next = 58;
1810
+ showNoSelectValueError.value = !showNoSelectValueError.value;
1811
+ return _context.abrupt("return", false);
1812
+ case 35:
1813
+ _context.next = 37;
1693
1814
  return validateUsingItemValues();
1694
- case 58:
1815
+ case 37:
1695
1816
  res = _context.sent;
1696
1817
  if (res) {
1697
- _context.next = 61;
1818
+ _context.next = 40;
1698
1819
  break;
1699
1820
  }
1700
- return _context.abrupt("return");
1701
- case 61:
1821
+ return _context.abrupt("return", false);
1822
+ case 40:
1702
1823
  setSelectedItem();
1703
- case 62:
1824
+ return _context.abrupt("return", false);
1825
+ case 42:
1704
1826
  case "end":
1705
1827
  return _context.stop();
1706
1828
  }
@@ -1708,22 +1830,31 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1708
1830
  }));
1709
1831
  return _handleKeyEnter.apply(this, arguments);
1710
1832
  }
1711
- function handleKeyBackspace() {
1712
- var _usingItem$value10;
1833
+ function handleKeyBackspace(event) {
1834
+ var _usingItem$value2;
1713
1835
  // 删除已选择项
1714
1836
  if (!usingItem.value && !keyword.value) {
1715
1837
  emit('delete');
1716
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
1717
1838
  setTimeout(setMenuList, 16);
1718
1839
  return;
1719
1840
  }
1720
- if ((_usingItem$value10 = usingItem.value) !== null && _usingItem$value10 !== void 0 && _usingItem$value10.values.length) {
1721
- var _usingItem$value11;
1722
- // 删除选项
1723
- if ((_usingItem$value11 = usingItem.value) !== null && _usingItem$value11 !== void 0 && _usingItem$value11.multiple || usingItem.value.isInValueList(usingItem.value.values[0]) || props.mode === SearchInputMode.EDIT && !keyword.value) {
1724
- usingItem.value.values.splice(-1, 1);
1841
+ if ((_usingItem$value2 = usingItem.value) !== null && _usingItem$value2 !== void 0 && _usingItem$value2.values.length) {
1842
+ // if (hasSelectAllContent) {
1843
+ // }
1844
+ event.preventDefault();
1845
+ var selection = window.getSelection();
1846
+ if ((selection === null || selection === void 0 ? void 0 : selection.rangeCount) > 0) {
1847
+ var _node;
1848
+ var range = selection.getRangeAt(0);
1849
+ var startPos = range.startContainer;
1850
+ var node = startPos;
1851
+ while (node && node.parentNode !== inputRef.value) {
1852
+ node = node.parentNode;
1853
+ }
1854
+ var editIndex = ((_node = node) === null || _node === void 0 || (_node = _node.dataset) === null || _node === void 0 ? void 0 : _node.index) || -1;
1855
+ usingItem.value.values.splice(+editIndex, 1);
1725
1856
  keyword.value = '';
1726
- setInputFocus();
1857
+ setInputFocus(false, false);
1727
1858
  return;
1728
1859
  }
1729
1860
  } else if (!keyword.value) {
@@ -1738,8 +1869,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1738
1869
  }
1739
1870
  function _handleSelectItem() {
1740
1871
  _handleSelectItem = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee2(item, type) {
1741
- var _item$value, _inputRef$value2, _usingItem$value14, _usingItem$value15;
1742
- var _item$realId2, _item$realId, seleted, _res5, isCondition, res;
1872
+ var _item$value, _usingItem$value6, _usingItem$value7, _usingItem$value8;
1873
+ var _item$realId2, _item$realId, seleted, _res3, isCondition, res;
1743
1874
  return regenerator_default().wrap(function _callee2$(_context2) {
1744
1875
  while (1) switch (_context2.prev = _context2.next) {
1745
1876
  case 0:
@@ -1754,7 +1885,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1754
1885
  seleted = new SelectedItem(_objectSpread(_objectSpread({}, item), {}, {
1755
1886
  id: (_item$realId = item.realId) !== null && _item$realId !== void 0 ? _item$realId : item.id
1756
1887
  }), type);
1757
- seleted.addValue(item.value);
1888
+ seleted.addValues(item.value.name, false);
1758
1889
  setSelectedItem(seleted);
1759
1890
  if (props.valueBehavior === ValueBehavior.NEEDKEY && menuHoverId.value) {
1760
1891
  setInputFocus(true);
@@ -1765,12 +1896,14 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1765
1896
  usingItem.value = new SelectedItem(_objectSpread(_objectSpread({}, item), {}, {
1766
1897
  id: (_item$realId2 = item.realId) !== null && _item$realId2 !== void 0 ? _item$realId2 : item.id
1767
1898
  }), type);
1768
- usingItem.value.addValue(item.value);
1899
+ usingItem.value.addValues(item.value.name, false);
1769
1900
  _context2.next = 12;
1770
- return validateUsingItemValues(item.value);
1901
+ return Promise.all(usingItem.value.values.map(function (v) {
1902
+ return validateUsingItemValues(v);
1903
+ }));
1771
1904
  case 12:
1772
- _res5 = _context2.sent;
1773
- if (_res5) {
1905
+ _res3 = _context2.sent;
1906
+ if (_res3) {
1774
1907
  _context2.next = 16;
1775
1908
  break;
1776
1909
  }
@@ -1782,7 +1915,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1782
1915
  setInputFocus(true);
1783
1916
  return _context2.abrupt("return");
1784
1917
  case 20:
1785
- if (!(!usingItem.value || !(inputRef !== null && inputRef !== void 0 && (_inputRef$value2 = inputRef.value) !== null && _inputRef$value2 !== void 0 && _inputRef$value2.innerText))) {
1918
+ if (usingItem.value) {
1786
1919
  _context2.next = 28;
1787
1920
  break;
1788
1921
  }
@@ -1794,7 +1927,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1794
1927
  setInputFocus(props.valueBehavior === ValueBehavior.NEEDKEY && !!menuHoverId.value);
1795
1928
  return _context2.abrupt("return");
1796
1929
  case 28:
1797
- if (!(((_usingItem$value14 = usingItem.value) === null || _usingItem$value14 === void 0 ? void 0 : _usingItem$value14.type) === 'condition')) {
1930
+ if (!(((_usingItem$value6 = usingItem.value) === null || _usingItem$value6 === void 0 ? void 0 : _usingItem$value6.type) === 'condition')) {
1798
1931
  _context2.next = 32;
1799
1932
  break;
1800
1933
  }
@@ -1802,22 +1935,23 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1802
1935
  setSelectedItem();
1803
1936
  return _context2.abrupt("return");
1804
1937
  case 32:
1805
- usingItem.value.addValue(item);
1806
- _context2.next = 35;
1938
+ (_usingItem$value7 = usingItem.value) === null || _usingItem$value7 === void 0 || _usingItem$value7.addValue(item);
1939
+ keyword.value = '';
1940
+ _context2.next = 36;
1807
1941
  return validateUsingItemValues(item);
1808
- case 35:
1942
+ case 36:
1809
1943
  res = _context2.sent;
1810
1944
  if (res) {
1811
- _context2.next = 38;
1945
+ _context2.next = 39;
1812
1946
  break;
1813
1947
  }
1814
1948
  return _context2.abrupt("return");
1815
- case 38:
1949
+ case 39:
1816
1950
  if (!usingItem.value.multiple) setSelectedItem();
1817
- if (props.valueBehavior === ValueBehavior.NEEDKEY && (_usingItem$value15 = usingItem.value) !== null && _usingItem$value15 !== void 0 && _usingItem$value15.multiple) {
1951
+ if (props.valueBehavior === ValueBehavior.NEEDKEY && (_usingItem$value8 = usingItem.value) !== null && _usingItem$value8 !== void 0 && _usingItem$value8.multiple) {
1818
1952
  setInputFocus();
1819
1953
  }
1820
- case 40:
1954
+ case 41:
1821
1955
  case "end":
1822
1956
  return _context2.stop();
1823
1957
  }
@@ -1829,10 +1963,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1829
1963
  handleSelectItem(item, 'condition');
1830
1964
  }
1831
1965
  function handleMenuFooterClick(item) {
1832
- var _usingItem$value12;
1966
+ var _usingItem$value3;
1833
1967
  switch (item.id) {
1834
1968
  case 'confirm':
1835
- if (!((_usingItem$value12 = usingItem.value) !== null && _usingItem$value12 !== void 0 && _usingItem$value12.values.length)) return;
1969
+ if (!((_usingItem$value3 = usingItem.value) !== null && _usingItem$value3 !== void 0 && _usingItem$value3.values.length)) return;
1836
1970
  keyword.value = '';
1837
1971
  handleKeyEnter();
1838
1972
  break;
@@ -1848,7 +1982,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1848
1982
  }
1849
1983
  function _validateUsingItemValues() {
1850
1984
  _validateUsingItemValues = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee3(value) {
1851
- var _usingItem$value16, searchItem, validate, values;
1985
+ var _usingItem$value9, searchItem, validate, values;
1852
1986
  return regenerator_default().wrap(function _callee3$(_context3) {
1853
1987
  while (1) switch (_context3.prev = _context3.next) {
1854
1988
  case 0:
@@ -1861,7 +1995,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1861
1995
  case 3:
1862
1996
  return _context3.abrupt("return", _context3.sent);
1863
1997
  case 4:
1864
- _usingItem$value16 = usingItem.value, searchItem = _usingItem$value16.searchItem, validate = _usingItem$value16.validate, values = _usingItem$value16.values;
1998
+ _usingItem$value9 = usingItem.value, searchItem = _usingItem$value9.searchItem, validate = _usingItem$value9.validate, values = _usingItem$value9.values;
1865
1999
  if (!(validate && typeof props.validateValues === 'function')) {
1866
2000
  _context3.next = 9;
1867
2001
  break;
@@ -1914,47 +2048,24 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1914
2048
  }));
1915
2049
  return _validateValues.apply(this, arguments);
1916
2050
  }
1917
- function setInputFocus() {
1918
- var refleshMenuList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1919
- if (refleshMenuList) {
1920
- setTimeout(function () {
1921
- setMenuList();
1922
- }, 16);
1923
- }
1924
- isFocus.value = true;
1925
- showPopover.value = true;
1926
- showNoSelectValueError.value = false;
1927
- var timer = setTimeout(function () {
1928
- if (inputRef.value) {
1929
- inputRef.value.focus(); // 光标移至最后
1930
- var selection = window.getSelection();
1931
- if (selection.focusOffset === 0) {
1932
- selection.selectAllChildren(inputRef.value);
1933
- selection.collapseToEnd();
1934
- }
1935
- }
1936
- window.clearTimeout(timer);
1937
- }, 0);
1938
- emit('focus', isFocus.value);
1939
- }
1940
2051
  function setMenuList() {
1941
2052
  return _setMenuList.apply(this, arguments);
1942
2053
  }
1943
2054
  function _setMenuList() {
1944
2055
  _setMenuList = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee5() {
1945
- var _usingItem$value17, _usingItem$value$valu2;
1946
- var list, _usingItem$value18, _keyword$value2, hoverItem;
2056
+ var _usingItem$value10, _usingItem$value$valu;
2057
+ var list, _usingItem$value11, _keyword$value2, hoverItem;
1947
2058
  return regenerator_default().wrap(function _callee5$(_context5) {
1948
2059
  while (1) switch (_context5.prev = _context5.next) {
1949
2060
  case 0:
1950
2061
  list = [];
1951
- if (!(typeof props.getMenuList === 'function' && (typeof ((_usingItem$value17 = usingItem.value) === null || _usingItem$value17 === void 0 || (_usingItem$value17 = _usingItem$value17.searchItem) === null || _usingItem$value17 === void 0 ? void 0 : _usingItem$value17.async) === 'undefined' || usingItem.value.searchItem.async === true))) {
2062
+ if (!(typeof props.getMenuList === 'function' && (typeof ((_usingItem$value10 = usingItem.value) === null || _usingItem$value10 === void 0 || (_usingItem$value10 = _usingItem$value10.searchItem) === null || _usingItem$value10 === void 0 ? void 0 : _usingItem$value10.async) === 'undefined' || usingItem.value.searchItem.async === true))) {
1952
2063
  _context5.next = 9;
1953
2064
  break;
1954
2065
  }
1955
2066
  loading.value = true;
1956
2067
  _context5.next = 5;
1957
- return props.getMenuList((_usingItem$value18 = usingItem.value) === null || _usingItem$value18 === void 0 ? void 0 : _usingItem$value18.searchItem, keyword.value)["catch"](function () {
2068
+ return props.getMenuList((_usingItem$value11 = usingItem.value) === null || _usingItem$value11 === void 0 ? void 0 : _usingItem$value11.searchItem, keyword.value)["catch"](function () {
1958
2069
  return [];
1959
2070
  });
1960
2071
  case 5:
@@ -2015,7 +2126,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2015
2126
  });
2016
2127
  } else if (usingItem.value.type === 'condition') {
2017
2128
  list = props.conditions;
2018
- } else if (!((_usingItem$value$valu2 = usingItem.value.values) !== null && _usingItem$value$valu2 !== void 0 && _usingItem$value$valu2.length) || usingItem.value.multiple || props.mode === SearchInputMode.EDIT) {
2129
+ } else if (!((_usingItem$value$valu = usingItem.value.values) !== null && _usingItem$value$valu !== void 0 && _usingItem$value$valu.length) || usingItem.value.multiple || props.mode === SearchInputMode.EDIT) {
2019
2130
  list = usingItem.value.children.filter(function (item) {
2020
2131
  return item.name.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase());
2021
2132
  });
@@ -2040,35 +2151,72 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2040
2151
  }));
2041
2152
  return _setMenuList.apply(this, arguments);
2042
2153
  }
2154
+ function setCursorToEnd() {
2155
+ if (!inputRef.value) return;
2156
+ var range = document.createRange();
2157
+ var selection = window.getSelection();
2158
+ range.selectNodeContents(inputRef.value);
2159
+ range.collapse(false);
2160
+ selection.removeAllRanges();
2161
+ selection.addRange(range);
2162
+ }
2163
+ function setInputFocus() {
2164
+ var refleshMenuList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
2165
+ var needCursorToEnd = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2166
+ if (refleshMenuList) {
2167
+ setTimeout(setMenuList, 16);
2168
+ }
2169
+ isFocus.value = true;
2170
+ showPopover.value = true;
2171
+ showNoSelectValueError.value = false;
2172
+ needCursorToEnd && (0,external_vue_namespaceObject.nextTick)(setCursorToEnd);
2173
+ emit('focus', isFocus.value);
2174
+ }
2043
2175
  function setSelectedItem(item) {
2044
2176
  emit('add', item !== null && item !== void 0 ? item : usingItem.value);
2045
2177
  usingItem.value = null;
2046
2178
  keyword.value = '';
2047
- setInputFocus(props.valueBehavior === ValueBehavior.NEEDKEY);
2179
+ setInputFocus(true, true);
2180
+ (0,external_vue_namespaceObject.nextTick)(clearInput);
2048
2181
  }
2049
2182
  function clearInput() {
2050
- var text = inputRef.value.innerText;
2051
- if (text[text.length - 1] === '\n' || text[0] === '\r') {
2052
- setInputText(text.slice(0, -1));
2053
- clearInput();
2054
- } else if (text[0] === '\n' || text[0] === '\r') {
2055
- setInputText(text.slice(1));
2056
- clearInput();
2057
- }
2058
- }
2059
- function setInputText() {
2060
- var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
2061
- if (inputRef.value) {
2062
- var _usingItem$value13;
2063
- inputRef.value.innerHTML = text || ((_usingItem$value13 = usingItem.value) === null || _usingItem$value13 === void 0 ? void 0 : _usingItem$value13.inputInnerHtml) || '';
2064
- }
2183
+ if (!inputRef.value) return;
2184
+ inputRef.value.innerText = '';
2065
2185
  }
2066
2186
  function handleLogicalChange(logical) {
2067
2187
  if (!usingItem.value) return;
2068
2188
  usingItem.value.logical = logical;
2069
2189
  }
2190
+ function str2SeletedItem(str) {
2191
+ var _str$split = str.split(':'),
2192
+ _str$split2 = _slicedToArray(_str$split, 2),
2193
+ key = _str$split2[0],
2194
+ value = _str$split2[1];
2195
+ if (key !== null && key !== void 0 && key.trim()) {
2196
+ var selectedItem = searchData.value.find(function (item) {
2197
+ return item.name === key.trim();
2198
+ });
2199
+ if (selectedItem) {
2200
+ var item = new SelectedItem(_objectSpread({}, selectedItem), 'default');
2201
+ item.addValues(value);
2202
+ return item;
2203
+ }
2204
+ }
2205
+ return undefined;
2206
+ }
2207
+ function inputFocusForWrapper() {
2208
+ var _inputRef$value2;
2209
+ (_inputRef$value2 = inputRef.value) === null || _inputRef$value2 === void 0 || _inputRef$value2.focus();
2210
+ }
2211
+ function inputEnterForWrapper() {
2212
+ handleKeyEnter().then(function (v) {
2213
+ return v && clearInput();
2214
+ });
2215
+ }
2070
2216
  // expose
2071
2217
  expose({
2218
+ inputFocusForWrapper: inputFocusForWrapper,
2219
+ inputEnterForWrapper: inputEnterForWrapper,
2072
2220
  handleInputFocus: handleInputFocus,
2073
2221
  isFocus: isFocus
2074
2222
  });
@@ -2089,12 +2237,15 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2089
2237
  handleClickOutside: handleClickOutside,
2090
2238
  handleInputFocus: handleInputFocus,
2091
2239
  handleInputChange: handleInputChange,
2240
+ handleInputPaste: handleInputPaste,
2092
2241
  handleLogicalChange: handleLogicalChange,
2093
2242
  handleInputKeyup: handleInputKeyup,
2094
2243
  handleSelectItem: handleSelectItem,
2095
2244
  handleSelectCondtionItem: handleSelectCondtionItem,
2096
2245
  handleMenuFooterClick: handleMenuFooterClick,
2097
2246
  resolveClassName: resolveClassName,
2247
+ inputFocusForWrapper: inputFocusForWrapper,
2248
+ inputEnterForWrapper: inputEnterForWrapper,
2098
2249
  t: t
2099
2250
  };
2100
2251
  },
@@ -2117,7 +2268,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2117
2268
  }
2118
2269
  } : {});
2119
2270
  var inputContent = function inputContent() {
2120
- var _this$keyword2;
2271
+ var _this$keyword2, _this$usingItem, _this$usingItem2;
2121
2272
  return (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("div", {
2122
2273
  "ref": "inputRef",
2123
2274
  "class": {
@@ -2129,13 +2280,37 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2129
2280
  "data-placeholder": !inputInnerHtml && !_this.keyword ? _this.placeholder : '',
2130
2281
  "data-tips": placeholder || '',
2131
2282
  "spellcheck": "false",
2283
+ "onPaste": _this.handleInputPaste,
2132
2284
  "onFocus": _this.handleInputFocus,
2133
2285
  "onInput": _this.handleInputChange,
2134
2286
  "onKeydown": _this.handleInputKeyup
2135
- }, null), [[(0,external_vue_namespaceObject.resolveDirective)("clickoutside"), _this.handleClickOutside]]);
2287
+ }, [((_this$usingItem = _this.usingItem) === null || _this$usingItem === void 0 ? void 0 : _this$usingItem.name) && (!_this.usingItem.isSpecialType() ? (0,external_vue_namespaceObject.createVNode)("span", {
2288
+ "data-key": _this.usingItem.name,
2289
+ "data-type": _this.usingItem.type,
2290
+ "key": _this.usingItem.nameRenderkey,
2291
+ "onMousedown": function onMousedown(e) {
2292
+ return e.preventDefault();
2293
+ },
2294
+ "contenteditable": false,
2295
+ "style": {
2296
+ color: '#979BA5'
2297
+ }
2298
+ }, [_this.usingItem.name, (0,external_vue_namespaceObject.createTextVNode)(":\xA0")]) : (0,external_vue_namespaceObject.createVNode)("span", {
2299
+ "data-key": _this.usingItem.name,
2300
+ "data-type": _this.usingItem.type,
2301
+ "key": _this.usingItem.nameRenderkey
2302
+ }, [_this.usingItem.name])), (_this$usingItem2 = _this.usingItem) === null || _this$usingItem2 === void 0 || (_this$usingItem2 = _this$usingItem2.values) === null || _this$usingItem2 === void 0 ? void 0 : _this$usingItem2.map(function (item, index) {
2303
+ return (0,external_vue_namespaceObject.createVNode)("span", {
2304
+ "key": index,
2305
+ "data-key": item.name,
2306
+ "data-type": "value",
2307
+ "data-id": item.id,
2308
+ "data-index": index
2309
+ }, [index > 0 ? " ".concat(_this.usingItem.logical, " ") : '', item.name]);
2310
+ })]), [[(0,external_vue_namespaceObject.resolveDirective)("clickoutside"), _this.handleClickOutside]]);
2136
2311
  };
2137
2312
  var popoverContent = function popoverContent() {
2138
- var _this$menuList2, _this$usingItem, _this$usingItem2;
2313
+ var _this$menuList2, _this$usingItem3, _this$usingItem4;
2139
2314
  if (_this.loading) {
2140
2315
  return (0,external_vue_namespaceObject.createVNode)("div", null, [_this.t.loading]);
2141
2316
  }
@@ -2154,8 +2329,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2154
2329
  return item.id;
2155
2330
  })) || [],
2156
2331
  "conditions": showCondition ? _this.conditions : [],
2157
- "logical": (_this$usingItem = _this.usingItem) === null || _this$usingItem === void 0 ? void 0 : _this$usingItem.logical,
2158
- "showLogical": (_this$usingItem2 = _this.usingItem) === null || _this$usingItem2 === void 0 ? void 0 : _this$usingItem2.showLogical,
2332
+ "logical": (_this$usingItem3 = _this.usingItem) === null || _this$usingItem3 === void 0 ? void 0 : _this$usingItem3.logical,
2333
+ "showLogical": (_this$usingItem4 = _this.usingItem) === null || _this$usingItem4 === void 0 ? void 0 : _this$usingItem4.showLogical,
2159
2334
  "onUpdate:logical": _this.handleLogicalChange,
2160
2335
  "onSelectItem": _this.handleSelectItem,
2161
2336
  "onSelectCondition": _this.handleSelectCondtionItem,
@@ -2239,7 +2414,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2239
2414
  onEditClick = _useSearchSelectInjec.onEditClick,
2240
2415
  onEditEnter = _useSearchSelectInjec.onEditEnter,
2241
2416
  onEditBlur = _useSearchSelectInjec.onEditBlur,
2242
- editKey = _useSearchSelectInjec.editKey;
2417
+ editKey = _useSearchSelectInjec.editKey,
2418
+ isClickOutside = _useSearchSelectInjec.isClickOutside;
2243
2419
  function handleDeleteSelected(index) {
2244
2420
  emit('delete', index);
2245
2421
  }
@@ -2259,8 +2435,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2259
2435
  if (isFocus) return;
2260
2436
  onEditBlur();
2261
2437
  }
2262
- function handleInputOutside() {
2263
- return true;
2438
+ function handleInputOutside(target) {
2439
+ return isClickOutside(target);
2264
2440
  }
2265
2441
  function copySeletedItem(item) {
2266
2442
  var newItem = new SelectedItem(item.searchItem, item.type);
@@ -2528,7 +2704,11 @@ var SearchSelectProps = {
2528
2704
  onEditEnter: onEditEnter,
2529
2705
  onEditBlur: onEditBlur,
2530
2706
  onValidate: onValidate,
2531
- editKey: editKey
2707
+ editKey: editKey,
2708
+ searchData: (0,external_vue_namespaceObject.computed)(function () {
2709
+ return props.data;
2710
+ }),
2711
+ isClickOutside: handleInputOutside
2532
2712
  });
2533
2713
  function onEditClick(item, index) {
2534
2714
  editKey.value = "".concat(item.id, "_").concat(index);
@@ -2580,7 +2760,7 @@ var SearchSelectProps = {
2580
2760
  }
2581
2761
  function handleWrapClick() {
2582
2762
  if (!editKey.value) {
2583
- inputRef.value.handleInputFocus();
2763
+ inputRef.value.inputFocusForWrapper();
2584
2764
  }
2585
2765
  }
2586
2766
  function handleClearAll() {
@@ -2617,6 +2797,7 @@ var SearchSelectProps = {
2617
2797
  isFocus.value = v;
2618
2798
  }
2619
2799
  function handleClickSearch(e) {
2800
+ inputRef.value.inputEnterForWrapper();
2620
2801
  emit('search', e);
2621
2802
  }
2622
2803
  return {