bkui-vue 1.0.3-beta.59 → 1.0.3-beta.60.dialog.1

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.
Files changed (187) hide show
  1. package/dist/index.cjs.js +51 -51
  2. package/dist/index.esm.js +10150 -10028
  3. package/dist/index.umd.js +51 -51
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/affix/index.js +1 -1
  7. package/lib/alert/index.js +1 -1
  8. package/lib/animate-number/index.js +7 -8
  9. package/lib/badge/index.js +1 -1
  10. package/lib/breadcrumb/index.js +1 -1
  11. package/lib/button/index.js +1 -1
  12. package/lib/card/index.js +1 -1
  13. package/lib/cascader/index.js +38 -42
  14. package/lib/checkbox/index.js +6 -7
  15. package/lib/collapse/index.js +11 -12
  16. package/lib/collapse-transition/index.js +3 -4
  17. package/lib/color-picker/index.js +10 -13
  18. package/lib/config-provider/index.js +1 -1
  19. package/lib/container/index.js +10 -12
  20. package/lib/date-picker/index.js +1 -1
  21. package/lib/dialog/dialog.css +139 -77
  22. package/lib/dialog/dialog.d.ts +41 -121
  23. package/lib/dialog/dialog.less +10 -65
  24. package/lib/dialog/dialog.variable.css +139 -77
  25. package/lib/dialog/index.d.ts +105 -272
  26. package/lib/dialog/index.js +95 -104
  27. package/lib/dialog/props.d.ts +8 -48
  28. package/lib/directives/index.js +1 -1
  29. package/lib/divider/index.js +2 -3
  30. package/lib/dropdown/index.js +6 -8
  31. package/lib/exception/index.js +1 -1
  32. package/lib/fixed-navbar/index.js +2 -3
  33. package/lib/form/index.js +1 -1
  34. package/lib/icon/angle-double-down-line.js +1 -1
  35. package/lib/icon/angle-double-left-line.js +1 -1
  36. package/lib/icon/angle-double-left.js +1 -1
  37. package/lib/icon/angle-double-right-line.js +1 -1
  38. package/lib/icon/angle-double-right.js +1 -1
  39. package/lib/icon/angle-double-up-line.js +1 -1
  40. package/lib/icon/angle-down-fill.js +1 -1
  41. package/lib/icon/angle-down-line.js +1 -1
  42. package/lib/icon/angle-down.js +1 -1
  43. package/lib/icon/angle-left.js +1 -1
  44. package/lib/icon/angle-right.js +1 -1
  45. package/lib/icon/angle-up-fill.js +1 -1
  46. package/lib/icon/angle-up.js +1 -1
  47. package/lib/icon/archive-fill.js +1 -1
  48. package/lib/icon/arrows-left.js +1 -1
  49. package/lib/icon/arrows-right.js +1 -1
  50. package/lib/icon/assistant.js +1 -1
  51. package/lib/icon/audio-fill.js +1 -1
  52. package/lib/icon/bk.js +1 -1
  53. package/lib/icon/circle.js +1 -1
  54. package/lib/icon/close-line.js +1 -1
  55. package/lib/icon/close.js +1 -1
  56. package/lib/icon/code.js +1 -1
  57. package/lib/icon/cog-shape.js +1 -1
  58. package/lib/icon/collapse-left.js +1 -1
  59. package/lib/icon/copy-shape.js +1 -1
  60. package/lib/icon/copy.js +1 -1
  61. package/lib/icon/data-shape.js +1 -1
  62. package/lib/icon/del.js +1 -1
  63. package/lib/icon/doc-fill.js +1 -1
  64. package/lib/icon/done.js +1 -1
  65. package/lib/icon/down-shape.js +1 -1
  66. package/lib/icon/down-small.js +1 -1
  67. package/lib/icon/edit-line.js +1 -1
  68. package/lib/icon/ellipsis.js +1 -1
  69. package/lib/icon/enlarge-line.js +1 -1
  70. package/lib/icon/error.js +1 -1
  71. package/lib/icon/excel-fill.js +1 -1
  72. package/lib/icon/exclamation-circle-shape.js +1 -1
  73. package/lib/icon/eye.js +1 -1
  74. package/lib/icon/filliscreen-line.js +1 -1
  75. package/lib/icon/fix-line.js +1 -1
  76. package/lib/icon/fix-shape.js +1 -1
  77. package/lib/icon/folder-open.js +1 -1
  78. package/lib/icon/folder-shape-open.js +1 -1
  79. package/lib/icon/folder-shape.js +1 -1
  80. package/lib/icon/folder.js +1 -1
  81. package/lib/icon/funnel.js +1 -1
  82. package/lib/icon/grag-fill.js +1 -1
  83. package/lib/icon/help-document-fill.js +1 -1
  84. package/lib/icon/help-fill.js +1 -1
  85. package/lib/icon/help.js +1 -1
  86. package/lib/icon/image-fill.js +1 -1
  87. package/lib/icon/img-error.js +1 -1
  88. package/lib/icon/img-placehoulder.js +1 -1
  89. package/lib/icon/info-line.js +1 -1
  90. package/lib/icon/info.js +1 -1
  91. package/lib/icon/left-shape.js +1 -1
  92. package/lib/icon/left-turn-line.js +1 -1
  93. package/lib/icon/loading.js +1 -1
  94. package/lib/icon/narrow-line.js +1 -1
  95. package/lib/icon/original.js +1 -1
  96. package/lib/icon/pdf-fill.js +1 -1
  97. package/lib/icon/play-shape.js +1 -1
  98. package/lib/icon/plus.js +1 -1
  99. package/lib/icon/ppt-fill.js +1 -1
  100. package/lib/icon/qq.js +1 -1
  101. package/lib/icon/right-shape.js +1 -1
  102. package/lib/icon/right-turn-line.js +1 -1
  103. package/lib/icon/search.js +1 -1
  104. package/lib/icon/share.js +1 -1
  105. package/lib/icon/spinner.js +1 -1
  106. package/lib/icon/success.js +1 -1
  107. package/lib/icon/switcher-loading.js +1 -1
  108. package/lib/icon/text-all.js +1 -1
  109. package/lib/icon/text-file.js +1 -1
  110. package/lib/icon/text-fill.js +1 -1
  111. package/lib/icon/transfer.js +1 -1
  112. package/lib/icon/tree-application-shape.js +1 -1
  113. package/lib/icon/unfull-screen.js +1 -1
  114. package/lib/icon/unvisible.js +1 -1
  115. package/lib/icon/up-shape.js +1 -1
  116. package/lib/icon/upload.js +1 -1
  117. package/lib/icon/video-fill.js +1 -1
  118. package/lib/icon/warn.js +1 -1
  119. package/lib/icon/weixin-pro.js +1 -1
  120. package/lib/icon/weixin.js +1 -1
  121. package/lib/image/index.js +10 -11
  122. package/lib/info-box/index.d.ts +2 -2
  123. package/lib/info-box/index.js +316 -177
  124. package/lib/info-box/info-box.css +63 -7
  125. package/lib/info-box/info-box.d.ts +17 -16
  126. package/lib/info-box/info-box.less +76 -14
  127. package/lib/info-box/info-box.variable.css +63 -7
  128. package/lib/info-box/render-component.d.ts +4 -0
  129. package/lib/input/index.js +4 -4
  130. package/lib/link/index.js +2 -2
  131. package/lib/loading/index.js +11 -12
  132. package/lib/menu/index.js +2 -3
  133. package/lib/message/index.js +1 -1
  134. package/lib/modal/index.d.ts +45 -325
  135. package/lib/modal/index.js +188 -667
  136. package/lib/modal/mask.d.ts +6 -0
  137. package/lib/modal/modal.css +131 -31
  138. package/lib/modal/modal.d.ts +16 -126
  139. package/lib/modal/modal.less +84 -28
  140. package/lib/modal/modal.variable.css +131 -31
  141. package/lib/modal/props.mixin.d.ts +2 -53
  142. package/lib/navigation/index.js +7 -9
  143. package/lib/notify/index.js +1 -1
  144. package/lib/overflow-title/index.js +9 -10
  145. package/lib/pagination/index.js +1 -1
  146. package/lib/plugin-popover/index.js +26 -30
  147. package/lib/pop-confirm/index.js +4 -5
  148. package/lib/popover/index.js +26 -30
  149. package/lib/popover2/index.js +2 -2
  150. package/lib/process/index.js +4 -4
  151. package/lib/progress/index.js +5 -6
  152. package/lib/radio/index.js +6 -7
  153. package/lib/rate/index.js +1 -1
  154. package/lib/resize-layout/index.js +1 -1
  155. package/lib/search-select/index.d.ts +12 -6
  156. package/lib/search-select/index.js +331 -251
  157. package/lib/search-select/input.d.ts +2 -1
  158. package/lib/search-select/search-select.d.ts +4 -2
  159. package/lib/search-select/selected.d.ts +4 -2
  160. package/lib/search-select/utils.d.ts +6 -0
  161. package/lib/select/index.js +4 -4
  162. package/lib/shared/index.d.ts +0 -1
  163. package/lib/shared/index.js +6 -56
  164. package/lib/sideslider/index.d.ts +31 -222
  165. package/lib/sideslider/index.js +53 -40
  166. package/lib/sideslider/sideslider.css +4 -42
  167. package/lib/sideslider/sideslider.d.ts +14 -105
  168. package/lib/sideslider/sideslider.less +13 -58
  169. package/lib/sideslider/sideslider.variable.css +4 -42
  170. package/lib/slider/index.js +19 -20
  171. package/lib/steps/index.js +4 -4
  172. package/lib/swiper/index.js +1 -1
  173. package/lib/switcher/index.js +1 -1
  174. package/lib/tab/index.js +3 -4
  175. package/lib/table/index.js +6 -8
  176. package/lib/table-column/index.js +1 -1
  177. package/lib/tag/index.js +1 -1
  178. package/lib/tag-input/index.js +3 -4
  179. package/lib/tree/index.js +10 -12
  180. package/lib/upload/index.d.ts +12 -0
  181. package/lib/upload/index.js +25 -34
  182. package/lib/upload/props.d.ts +3 -0
  183. package/lib/upload/upload-trigger.d.ts +6 -0
  184. package/lib/upload/upload.d.ts +6 -0
  185. package/lib/virtual-render/index.js +2 -3
  186. package/package.json +1 -1
  187. package/lib/shared/mask.d.ts +0 -11
@@ -126,7 +126,7 @@ function _regeneratorRuntime() {
126
126
  function makeInvokeMethod(e, r, n) {
127
127
  var o = h;
128
128
  return function (i, a) {
129
- if (o === f) throw new Error("Generator is already running");
129
+ if (o === f) throw Error("Generator is already running");
130
130
  if (o === s) {
131
131
  if ("throw" === i) throw a;
132
132
  return {
@@ -268,7 +268,7 @@ function _regeneratorRuntime() {
268
268
  } else if (c) {
269
269
  if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
270
270
  } else {
271
- if (!u) throw new Error("try statement without catch or finally");
271
+ if (!u) throw Error("try statement without catch or finally");
272
272
  if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
273
273
  }
274
274
  }
@@ -308,7 +308,7 @@ function _regeneratorRuntime() {
308
308
  return o;
309
309
  }
310
310
  }
311
- throw new Error("illegal catch attempt");
311
+ throw Error("illegal catch attempt");
312
312
  },
313
313
  delegateYield: function delegateYield(e, r, n) {
314
314
  return this.delegate = {
@@ -459,7 +459,7 @@ function toPrimitive(t, r) {
459
459
 
460
460
  function toPropertyKey(t) {
461
461
  var i = toPrimitive(t, "string");
462
- return "symbol" == _typeof(i) ? i : String(i);
462
+ return "symbol" == _typeof(i) ? i : i + "";
463
463
  }
464
464
  ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
465
465
 
@@ -927,6 +927,27 @@ const radio_namespaceObject = radio_x({ ["default"]: () => __WEBPACK_EXTERNAL_MO
927
927
  var radio_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
928
928
  var radio_less_y = x => () => x
929
929
  const radio_less_namespaceObject = radio_less_x({ });
930
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
931
+
932
+ function _arrayWithoutHoles(arr) {
933
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
934
+ }
935
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
936
+ function _iterableToArray(iter) {
937
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
938
+ }
939
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
940
+ function _nonIterableSpread() {
941
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
942
+ }
943
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
944
+
945
+
946
+
947
+
948
+ function _toConsumableArray(arr) {
949
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
950
+ }
930
951
  ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
931
952
  function _classCallCheck(instance, Constructor) {
932
953
  if (!(instance instanceof Constructor)) {
@@ -956,6 +977,7 @@ function _createClass(Constructor, protoProps, staticProps) {
956
977
 
957
978
 
958
979
 
980
+
959
981
  /*
960
982
  * Tencent is pleased to support the open source community by making
961
983
  * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
@@ -994,6 +1016,11 @@ var ValueBehavior;
994
1016
  ValueBehavior["ALL"] = "all";
995
1017
  ValueBehavior["NEEDKEY"] = "need-key";
996
1018
  })(ValueBehavior || (ValueBehavior = {}));
1019
+ var DeleteBehavior;
1020
+ (function (DeleteBehavior) {
1021
+ DeleteBehavior["CHAR"] = "delete-char";
1022
+ DeleteBehavior["VALUE"] = "delete-value";
1023
+ })(DeleteBehavior || (DeleteBehavior = {}));
997
1024
  var SEARCH_SLECT_PROVIDER_KEY = Symbol('SEARCH_SLECT_PROVIDER_KEY');
998
1025
  var useSearchSelectProvider = function useSearchSelectProvider(data) {
999
1026
  (0,external_vue_namespaceObject.provide)(SEARCH_SLECT_PROVIDER_KEY, data);
@@ -1006,6 +1033,8 @@ var SearchInputMode;
1006
1033
  SearchInputMode["DEFAULT"] = "default";
1007
1034
  SearchInputMode["EDIT"] = "edit";
1008
1035
  })(SearchInputMode || (SearchInputMode = {}));
1036
+ var ValueSplitRegex = /(\||,|、|\/|\r\n|\n)/gm;
1037
+ var ValueSplitTestRegex = /^(\||,|、|\/|\r\n|\n)$/;
1009
1038
  var SearchLogical;
1010
1039
  (function (SearchLogical) {
1011
1040
  SearchLogical["AND"] = "&";
@@ -1024,7 +1053,7 @@ var SelectedItem = /*#__PURE__*/function () {
1024
1053
  this.logical = searchItem.logical || SearchLogical.OR;
1025
1054
  this.type = type;
1026
1055
  }
1027
- _createClass(SelectedItem, [{
1056
+ return _createClass(SelectedItem, [{
1028
1057
  key: "multiple",
1029
1058
  get: function get() {
1030
1059
  return !!this.searchItem.multiple;
@@ -1117,7 +1146,7 @@ var SelectedItem = /*#__PURE__*/function () {
1117
1146
  });
1118
1147
  };
1119
1148
  if (!this.multiple) {
1120
- var val = list.join(this.logical).trim();
1149
+ var val = list.join(" ".concat(this.logical, " ")).trim();
1121
1150
  var item = findChildByName(val);
1122
1151
  return [{
1123
1152
  id: item ? item.id : val,
@@ -1143,14 +1172,17 @@ var SelectedItem = /*#__PURE__*/function () {
1143
1172
  key: "addValues",
1144
1173
  value: function addValues(str) {
1145
1174
  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;
1175
+ var valuesFromStr = str.split(ValueSplitRegex).filter(function (v) {
1176
+ return v.trim() && !ValueSplitTestRegex.test(v);
1177
+ });
1178
+ var currentValues = mergeValues ? this.values.map(function (item) {
1179
+ return item.name;
1180
+ }) : [];
1181
+ var combinedValues = [].concat(_toConsumableArray(valuesFromStr), _toConsumableArray(currentValues));
1182
+ var logicalString = combinedValues.filter(function (v) {
1183
+ return v.trim();
1184
+ }).join(this.logical);
1185
+ this.values = this.str2Values(logicalString);
1154
1186
  }
1155
1187
  }, {
1156
1188
  key: "getValue",
@@ -1198,7 +1230,6 @@ var SelectedItem = /*#__PURE__*/function () {
1198
1230
  });
1199
1231
  }
1200
1232
  }]);
1201
- return SelectedItem;
1202
1233
  }();
1203
1234
  ;// CONCATENATED MODULE: ../../packages/search-select/src/menu.tsx
1204
1235
 
@@ -1231,10 +1262,9 @@ var SelectedItem = /*#__PURE__*/function () {
1231
1262
 
1232
1263
 
1233
1264
 
1234
-
1235
1265
  // import { Done } from '@bkui-vue/icon';
1236
1266
 
1237
- /* harmony default export */ const menu = ((0,external_vue_namespaceObject.defineComponent)({
1267
+ /* harmony default export */ const menu = (defineComponent({
1238
1268
  name: 'SearchSelectMenu',
1239
1269
  props: {
1240
1270
  list: {
@@ -1279,7 +1309,7 @@ var SelectedItem = /*#__PURE__*/function () {
1279
1309
  var t = (0,config_provider_namespaceObject.useLocale)('searchSelect');
1280
1310
  var _usePrefix = (0,config_provider_namespaceObject.usePrefix)(),
1281
1311
  resolveClassName = _usePrefix.resolveClassName;
1282
- var localFooterBtns = (0,external_vue_namespaceObject.computed)(function () {
1312
+ var localFooterBtns = computed(function () {
1283
1313
  if (props.footerBtns === undefined || props.footerBtns.length === 0) {
1284
1314
  return [{
1285
1315
  id: 'confirm',
@@ -1302,7 +1332,7 @@ var SelectedItem = /*#__PURE__*/function () {
1302
1332
  function handleClickFooterBtn(item) {
1303
1333
  emit('footerClick', item);
1304
1334
  }
1305
- var filterList = (0,external_vue_namespaceObject.computed)(function () {
1335
+ var filterList = computed(function () {
1306
1336
  var _props$list, _props$keyword;
1307
1337
  if (!((_props$list = props.list) !== null && _props$list !== void 0 && _props$list.length)) return [];
1308
1338
  if (!((_props$keyword = props.keyword) !== null && _props$keyword !== void 0 && _props$keyword.length)) return props.list;
@@ -1550,17 +1580,15 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1550
1580
  // );
1551
1581
  (0,external_vue_namespaceObject.watch)([menuList, showPopover], function () {
1552
1582
  var _menuList$value;
1553
- if ((_menuList$value = menuList.value) !== null && _menuList$value !== void 0 && _menuList$value.some(function (item) {
1583
+ var shouldBindEvent = showPopover.value && ((_menuList$value = menuList.value) === null || _menuList$value === void 0 ? void 0 : _menuList$value.some(function (item) {
1554
1584
  return !item.disabled;
1555
- }) && showPopover.value) {
1585
+ }));
1586
+ if (shouldBindEvent) {
1556
1587
  if (!isBindEvent) {
1557
- if (props.valueBehavior === ValueBehavior.NEEDKEY) {
1558
- menuHoverId.value = menuList.value.find(function (item) {
1559
- return !item.disabled;
1560
- }).id;
1561
- } else {
1562
- menuHoverId.value = '';
1563
- }
1588
+ var _menuList$value$find;
1589
+ menuHoverId.value = props.valueBehavior === ValueBehavior.NEEDKEY ? ((_menuList$value$find = menuList.value.find(function (item) {
1590
+ return !item.disabled;
1591
+ })) === null || _menuList$value$find === void 0 ? void 0 : _menuList$value$find.id) || '' : '';
1564
1592
  isBindEvent = true;
1565
1593
  document.addEventListener('keydown', handleDocumentKeydown);
1566
1594
  }
@@ -1590,33 +1618,27 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1590
1618
  e.preventDefault();
1591
1619
  (_inputRef$value = inputRef.value) === null || _inputRef$value === void 0 || _inputRef$value.blur();
1592
1620
  var len = menuList.value.length;
1593
- var i = len;
1594
1621
  var index = menuList.value.findIndex(function (set) {
1595
1622
  return set.id === menuHoverId.value;
1596
1623
  });
1597
- while (i >= 0) {
1598
- index = e.code === 'ArrowDown' ? index + 1 : index - 1;
1599
- // eslint-disable-next-line no-nested-ternary
1600
- index = index > len - 1 ? 0 : index < 0 ? len - 1 : index;
1624
+ for (var tries = 0; tries < len; tries++) {
1625
+ index = (index + (e.code === 'ArrowDown' ? 1 : -1) + len) % len;
1601
1626
  var item = menuList.value[index];
1602
1627
  if (item && !item.disabled) {
1603
- i = -1;
1604
1628
  var dom = document.getElementById(item.id);
1605
1629
  dom === null || dom === void 0 || dom.focus();
1606
1630
  menuHoverId.value = item.id;
1607
- return;
1631
+ break;
1608
1632
  }
1609
- i -= 1;
1610
1633
  }
1611
1634
  }
1612
1635
  function documentEnterEvent(e) {
1613
- if (isBindEvent) {
1614
- e.preventDefault();
1615
- var item = menuList.value.find(function (item) {
1616
- return item.id === menuHoverId.value;
1617
- });
1618
- item && handleSelectItem(item);
1619
- }
1636
+ if (!isBindEvent) return;
1637
+ e.preventDefault();
1638
+ var item = menuList.value.find(function (item) {
1639
+ return item.id === menuHoverId.value;
1640
+ });
1641
+ item && handleSelectItem(item);
1620
1642
  }
1621
1643
  function handleClickOutside(e) {
1622
1644
  var _popoverRef$value, _props$clickOutside;
@@ -1638,15 +1660,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1638
1660
  function handleInputFocus() {
1639
1661
  showNoSelectValueError.value = false;
1640
1662
  if (props.mode === SearchInputMode.EDIT && usingItem.value && !isFocus.value) {
1663
+ var nodeList = Array.from(inputRef.value.querySelectorAll("[data-type=\"".concat(usingItem.value.values.length ? 'value' : usingItem.value.type, "\"]")));
1664
+ if (!nodeList.length) return;
1641
1665
  var range = document.createRange();
1642
1666
  var selection = window.getSelection();
1643
- var nodeList = [];
1644
- if (usingItem.value.values.length) {
1645
- nodeList = Array.from(inputRef.value.querySelectorAll('[data-type="value"]'));
1646
- } else {
1647
- nodeList = Array.from(inputRef.value.querySelectorAll("[data-type=\"".concat(usingItem.value.type, "\"]")));
1648
- }
1649
- if (!nodeList.length) return;
1650
1667
  range.selectNodeContents(nodeList.at(-1));
1651
1668
  selection === null || selection === void 0 || selection.removeAllRanges();
1652
1669
  selection.addRange(range); // 注意这里会触发focu事件
@@ -1658,11 +1675,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1658
1675
  }
1659
1676
  function handleInputPaste(event) {
1660
1677
  event.preventDefault();
1661
- var clipboardData = event.clipboardData;
1662
- var pastedData = clipboardData.getData('text');
1663
- var tempDiv = document.createElement('div');
1664
- tempDiv.innerHTML = pastedData;
1665
- var formattedText = (tempDiv.textContent || tempDiv.innerText || '').trim();
1678
+ var formattedText = event.clipboardData.getData('text').trim();
1666
1679
  if (!usingItem.value) {
1667
1680
  var formateItem = str2SeletedItem(formattedText);
1668
1681
  if (formateItem) {
@@ -1670,9 +1683,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1670
1683
  setInputFocus(true, true);
1671
1684
  return;
1672
1685
  }
1673
- keyword.value = formattedText.split(/(\s|\||,|、|\/|\n\r|\n)/gm).filter(function (v) {
1674
- return !!v.trim();
1675
- }).join(valueLoagic.value);
1686
+ keyword.value = formattedText.split(ValueSplitRegex).filter(function (v) {
1687
+ return v.trim() && !ValueSplitTestRegex.test(v);
1688
+ }).join(" ".concat(valueLoagic.value, " "));
1676
1689
  inputRef.value.innerText = keyword.value;
1677
1690
  setInputFocus();
1678
1691
  debounceSetMenuList();
@@ -1682,13 +1695,13 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1682
1695
  debounceSetMenuList();
1683
1696
  }
1684
1697
  function handleInputChange(event) {
1685
- var text = event.target.innerText;
1698
+ var text = event.target.innerText.trim();
1686
1699
  if (!usingItem.value) {
1687
1700
  keyword.value = text;
1688
1701
  debounceSetMenuList();
1689
1702
  return;
1690
1703
  }
1691
- keyword.value = usingItem.value.isSpecialType() ? text.trim() : text.replace(usingItem.value.name, '').replace(':', '').trim();
1704
+ keyword.value = usingItem.value.isSpecialType() ? text : text.replace(usingItem.value.name, '').replace(':', '').trim();
1692
1705
  debounceSetMenuList();
1693
1706
  }
1694
1707
  function handleInputKeyup(event) {
@@ -1714,20 +1727,20 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1714
1727
  }
1715
1728
  function _handleKeyEnter() {
1716
1729
  _handleKeyEnter = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee(event) {
1717
- var _keyword$value, _usingItem$value4, _usingItem$value5;
1718
- var formatItem, valueList, _res, _valueList, _formatItem, _res2, res;
1730
+ var _usingItem$value4, _usingItem$value5;
1731
+ var isValid;
1719
1732
  return regenerator_default().wrap(function _callee$(_context) {
1720
1733
  while (1) switch (_context.prev = _context.next) {
1721
1734
  case 0:
1722
1735
  event === null || event === void 0 || event.preventDefault();
1723
- // resolve 中文输入时直接按下enter的错误表现
1736
+ // 异步延迟解决确保响应时机问题
1724
1737
  _context.next = 3;
1725
- return new Promise(function (r) {
1726
- return setTimeout(r, 0);
1738
+ return new Promise(function (resolve) {
1739
+ return setTimeout(resolve, 0);
1727
1740
  });
1728
1741
  case 3:
1729
1742
  if (usingItem.value) {
1730
- _context.next = 17;
1743
+ _context.next = 9;
1731
1744
  break;
1732
1745
  }
1733
1746
  if (!(!keyword.value || props.valueBehavior === ValueBehavior.NEEDKEY)) {
@@ -1736,95 +1749,40 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1736
1749
  }
1737
1750
  return _context.abrupt("return");
1738
1751
  case 6:
1739
- formatItem = str2SeletedItem(keyword.value);
1740
- valueList = (formatItem === null || formatItem === void 0 ? void 0 : formatItem.values) || [{
1741
- id: keyword.value,
1742
- name: keyword.value
1743
- }];
1744
- _context.next = 10;
1745
- return Promise.all(valueList.map(function (item) {
1746
- return validateUsingItemValues(item);
1747
- })).then(function () {
1748
- return true;
1749
- })["catch"](function () {
1750
- return false;
1751
- });
1752
- case 10:
1753
- _res = _context.sent;
1754
- if (_res) {
1752
+ _context.next = 8;
1753
+ return enterNewItemSelected();
1754
+ case 8:
1755
+ return _context.abrupt("return", _context.sent);
1756
+ case 9:
1757
+ if (!keyword.value) {
1755
1758
  _context.next = 13;
1756
1759
  break;
1757
1760
  }
1758
- return _context.abrupt("return");
1761
+ _context.next = 12;
1762
+ return enterExistingItemSelected();
1763
+ case 12:
1764
+ return _context.abrupt("return", _context.sent);
1759
1765
  case 13:
1760
- emit('add', formatItem || new SelectedItem(_objectSpread({}, valueList[0]), 'text'));
1761
- keyword.value = '';
1762
- setMenuList();
1763
- return _context.abrupt("return", true);
1764
- case 17:
1765
- if (!((_keyword$value = keyword.value) !== null && _keyword$value !== void 0 && _keyword$value.length)) {
1766
- _context.next = 32;
1767
- break;
1768
- }
1769
- _valueList = [];
1770
- if (usingItem.value.isSpecialType()) {
1771
- _formatItem = str2SeletedItem(keyword.value);
1772
- if (_formatItem) {
1773
- usingItem.value = _formatItem;
1774
- _valueList = _formatItem.values;
1775
- }
1776
- }
1777
- if (!_valueList.length) {
1778
- _valueList = usingItem.value.str2Values(keyword.value);
1779
- }
1780
- _context.next = 23;
1781
- return Promise.all(_valueList.map(function (item) {
1782
- return validateUsingItemValues(item);
1783
- })).then(function () {
1784
- return true;
1785
- })["catch"](function () {
1786
- return false;
1787
- });
1788
- case 23:
1789
- _res2 = _context.sent;
1790
- if (_res2) {
1791
- _context.next = 26;
1792
- break;
1793
- }
1794
- return _context.abrupt("return");
1795
- case 26:
1796
- if (usingItem.value.type === 'text') {
1797
- usingItem.value.name = keyword.value;
1798
- usingItem.value.id = keyword.value;
1799
- } else {
1800
- usingItem.value.values = _valueList;
1801
- }
1802
- emit('add', usingItem.value);
1803
- keyword.value = '';
1804
- usingItem.value = null;
1805
- setInputFocus(true);
1806
- return _context.abrupt("return", true);
1807
- case 32:
1808
- 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)) {
1809
- _context.next = 35;
1766
+ if (!(!((_usingItem$value4 = usingItem.value) !== null && _usingItem$value4 !== void 0 && _usingItem$value4.isSpecialType()) && ((_usingItem$value5 = usingItem.value) === null || _usingItem$value5 === void 0 ? void 0 : _usingItem$value5.values.length) < 1)) {
1767
+ _context.next = 16;
1810
1768
  break;
1811
1769
  }
1812
1770
  showNoSelectValueError.value = !showNoSelectValueError.value;
1813
1771
  return _context.abrupt("return", false);
1814
- case 35:
1815
- _context.next = 37;
1772
+ case 16:
1773
+ _context.next = 18;
1816
1774
  return validateUsingItemValues();
1817
- case 37:
1818
- res = _context.sent;
1819
- if (res) {
1820
- _context.next = 40;
1775
+ case 18:
1776
+ isValid = _context.sent;
1777
+ if (isValid) {
1778
+ _context.next = 21;
1821
1779
  break;
1822
1780
  }
1823
1781
  return _context.abrupt("return", false);
1824
- case 40:
1782
+ case 21:
1825
1783
  setSelectedItem();
1826
1784
  return _context.abrupt("return", false);
1827
- case 42:
1785
+ case 23:
1828
1786
  case "end":
1829
1787
  return _context.stop();
1830
1788
  }
@@ -1841,8 +1799,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1841
1799
  return;
1842
1800
  }
1843
1801
  if ((_usingItem$value2 = usingItem.value) !== null && _usingItem$value2 !== void 0 && _usingItem$value2.values.length) {
1844
- // if (hasSelectAllContent) {
1845
- // }
1802
+ var _usingItem$value$chil;
1803
+ if (usingItem.value.type === 'text' || !((_usingItem$value$chil = usingItem.value.children) !== null && _usingItem$value$chil !== void 0 && _usingItem$value$chil.length)) return;
1846
1804
  event.preventDefault();
1847
1805
  var selection = window.getSelection();
1848
1806
  if ((selection === null || selection === void 0 ? void 0 : selection.rangeCount) > 0) {
@@ -1871,89 +1829,78 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1871
1829
  }
1872
1830
  function _handleSelectItem() {
1873
1831
  _handleSelectItem = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee2(item, type) {
1874
- var _item$value, _usingItem$value6, _usingItem$value7, _usingItem$value8;
1875
- var _item$realId2, _item$realId, seleted, _res3, isCondition, res;
1832
+ var _item$value, _usingItem$value6, _usingItem$value9;
1833
+ var _item$realId, selectedItem, _usingItem$value7, _usingItem$value8, isCondition;
1876
1834
  return regenerator_default().wrap(function _callee2$(_context2) {
1877
1835
  while (1) switch (_context2.prev = _context2.next) {
1878
1836
  case 0:
1879
1837
  if (!((_item$value = item.value) !== null && _item$value !== void 0 && _item$value.id)) {
1880
- _context2.next = 20;
1881
- break;
1882
- }
1883
- if (!(props.valueBehavior === ValueBehavior.NEEDKEY && item.value || !props.validateValues)) {
1884
- _context2.next = 8;
1838
+ _context2.next = 18;
1885
1839
  break;
1886
1840
  }
1887
- seleted = new SelectedItem(_objectSpread(_objectSpread({}, item), {}, {
1841
+ selectedItem = new SelectedItem(_objectSpread(_objectSpread({}, item), {}, {
1888
1842
  id: (_item$realId = item.realId) !== null && _item$realId !== void 0 ? _item$realId : item.id
1889
1843
  }), type);
1890
- seleted.addValues(item.value.name, false);
1891
- setSelectedItem(seleted);
1892
- if (props.valueBehavior === ValueBehavior.NEEDKEY && menuHoverId.value) {
1893
- setInputFocus(true);
1844
+ selectedItem.addValues(item.value.name, false);
1845
+ if (!(props.valueBehavior === ValueBehavior.NEEDKEY && menuHoverId.value)) {
1846
+ _context2.next = 8;
1847
+ break;
1894
1848
  }
1849
+ setSelectedItem(selectedItem);
1850
+ setInputFocus(true);
1895
1851
  menuHoverId.value = '';
1896
1852
  return _context2.abrupt("return");
1897
1853
  case 8:
1898
- usingItem.value = new SelectedItem(_objectSpread(_objectSpread({}, item), {}, {
1899
- id: (_item$realId2 = item.realId) !== null && _item$realId2 !== void 0 ? _item$realId2 : item.id
1900
- }), type);
1901
- usingItem.value.addValues(item.value.name, false);
1902
- _context2.next = 12;
1903
- return Promise.all(usingItem.value.values.map(function (v) {
1904
- return validateUsingItemValues(v);
1905
- }));
1906
- case 12:
1907
- _res3 = _context2.sent;
1908
- if (_res3) {
1909
- _context2.next = 16;
1854
+ usingItem.value = selectedItem;
1855
+ _context2.next = 11;
1856
+ return validateUsingItemValues(usingItem.value.values);
1857
+ case 11:
1858
+ if (_context2.sent) {
1859
+ _context2.next = 14;
1910
1860
  break;
1911
1861
  }
1912
1862
  usingItem.value = null;
1913
1863
  return _context2.abrupt("return");
1914
- case 16:
1864
+ case 14:
1915
1865
  setSelectedItem(usingItem.value);
1916
- menuHoverId.value = '';
1917
1866
  setInputFocus(true);
1867
+ menuHoverId.value = '';
1918
1868
  return _context2.abrupt("return");
1919
- case 20:
1920
- if (usingItem.value) {
1921
- _context2.next = 28;
1869
+ case 18:
1870
+ if (!(!usingItem.value || ((_usingItem$value6 = usingItem.value) === null || _usingItem$value6 === void 0 ? void 0 : _usingItem$value6.type) === 'condition')) {
1871
+ _context2.next = 26;
1922
1872
  break;
1923
1873
  }
1924
- usingItem.value = new SelectedItem(item, type);
1874
+ usingItem.value = new SelectedItem(item, type !== null && type !== void 0 ? type : (_usingItem$value7 = usingItem.value) === null || _usingItem$value7 === void 0 ? void 0 : _usingItem$value7.type);
1925
1875
  keyword.value = '';
1926
- isCondition = type === 'condition';
1927
- isCondition && setSelectedItem();
1876
+ isCondition = ((_usingItem$value8 = usingItem.value) === null || _usingItem$value8 === void 0 ? void 0 : _usingItem$value8.type) === 'condition';
1877
+ if (isCondition) {
1878
+ setSelectedItem();
1879
+ }
1928
1880
  showPopover.value = isCondition || !!usingItem.value.children.length;
1929
1881
  setInputFocus(props.valueBehavior === ValueBehavior.NEEDKEY && !!menuHoverId.value);
1930
1882
  return _context2.abrupt("return");
1931
- case 28:
1932
- if (!(((_usingItem$value6 = usingItem.value) === null || _usingItem$value6 === void 0 ? void 0 : _usingItem$value6.type) === 'condition')) {
1933
- _context2.next = 32;
1934
- break;
1883
+ case 26:
1884
+ if (usingItem.value) {
1885
+ usingItem.value.addValue(item);
1886
+ (0,external_vue_namespaceObject.nextTick)(deleteInputTextNode);
1935
1887
  }
1936
- usingItem.value = new SelectedItem(item, type);
1937
- setSelectedItem();
1938
- return _context2.abrupt("return");
1939
- case 32:
1940
- (_usingItem$value7 = usingItem.value) === null || _usingItem$value7 === void 0 || _usingItem$value7.addValue(item);
1941
- keyword.value = '';
1942
- _context2.next = 36;
1943
- return validateUsingItemValues(item);
1944
- case 36:
1945
- res = _context2.sent;
1946
- if (res) {
1947
- _context2.next = 39;
1888
+ _context2.next = 29;
1889
+ return validateUsingItemValues(usingItem.value.values);
1890
+ case 29:
1891
+ if (_context2.sent) {
1892
+ _context2.next = 31;
1948
1893
  break;
1949
1894
  }
1950
1895
  return _context2.abrupt("return");
1951
- case 39:
1952
- if (!usingItem.value.multiple) setSelectedItem();
1953
- if (props.valueBehavior === ValueBehavior.NEEDKEY && (_usingItem$value8 = usingItem.value) !== null && _usingItem$value8 !== void 0 && _usingItem$value8.multiple) {
1896
+ case 31:
1897
+ if (!usingItem.value.multiple) {
1898
+ setSelectedItem();
1899
+ }
1900
+ if (props.valueBehavior === ValueBehavior.NEEDKEY && (_usingItem$value9 = usingItem.value) !== null && _usingItem$value9 !== void 0 && _usingItem$value9.multiple) {
1954
1901
  setInputFocus();
1955
1902
  }
1956
- case 41:
1903
+ case 33:
1957
1904
  case "end":
1958
1905
  return _context2.stop();
1959
1906
  }
@@ -1978,90 +1925,104 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1978
1925
  break;
1979
1926
  }
1980
1927
  }
1928
+ function handleLogicalChange(logical) {
1929
+ if (!usingItem.value) return;
1930
+ usingItem.value.logical = logical;
1931
+ }
1981
1932
  // functions
1982
- function validateUsingItemValues(_x4) {
1983
- return _validateUsingItemValues.apply(this, arguments);
1933
+ function validateValues(_x4, _x5) {
1934
+ return _validateValues.apply(this, arguments);
1984
1935
  }
1985
- function _validateUsingItemValues() {
1986
- _validateUsingItemValues = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee3(value) {
1987
- var _usingItem$value9, searchItem, validate, values;
1936
+ function _validateValues() {
1937
+ _validateValues = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee3(searchItem, value) {
1938
+ var validateStr;
1988
1939
  return regenerator_default().wrap(function _callee3$(_context3) {
1989
1940
  while (1) switch (_context3.prev = _context3.next) {
1990
1941
  case 0:
1991
- if (usingItem.value) {
1992
- _context3.next = 4;
1942
+ if (!(typeof props.validateValues === 'function')) {
1943
+ _context3.next = 14;
1993
1944
  break;
1994
1945
  }
1995
- _context3.next = 3;
1996
- return validateValues(null, [value]);
1997
- case 3:
1998
- return _context3.abrupt("return", _context3.sent);
1999
- case 4:
2000
- _usingItem$value9 = usingItem.value, searchItem = _usingItem$value9.searchItem, validate = _usingItem$value9.validate, values = _usingItem$value9.values;
2001
- if (!(validate && typeof props.validateValues === 'function')) {
2002
- _context3.next = 9;
1946
+ validateStr = '';
1947
+ _context3.prev = 2;
1948
+ _context3.next = 5;
1949
+ return props.validateValues(searchItem !== null && searchItem !== void 0 ? searchItem : null, value);
1950
+ case 5:
1951
+ validateStr = _context3.sent;
1952
+ _context3.next = 11;
1953
+ break;
1954
+ case 8:
1955
+ _context3.prev = 8;
1956
+ _context3.t0 = _context3["catch"](2);
1957
+ validateStr = false;
1958
+ case 11:
1959
+ if (!(typeof validateStr === 'string' || validateStr === false)) {
1960
+ _context3.next = 14;
2003
1961
  break;
2004
1962
  }
2005
- _context3.next = 8;
2006
- return validateValues(searchItem, value ? [value] : values);
2007
- case 8:
2008
- return _context3.abrupt("return", _context3.sent);
2009
- case 9:
1963
+ onValidate(validateStr || '校验错误');
1964
+ return _context3.abrupt("return", false);
1965
+ case 14:
2010
1966
  onValidate('');
2011
1967
  return _context3.abrupt("return", true);
2012
- case 11:
1968
+ case 16:
2013
1969
  case "end":
2014
1970
  return _context3.stop();
2015
1971
  }
2016
- }, _callee3);
1972
+ }, _callee3, null, [[2, 8]]);
2017
1973
  }));
2018
- return _validateUsingItemValues.apply(this, arguments);
2019
- }
2020
- function validateValues(_x5, _x6) {
2021
1974
  return _validateValues.apply(this, arguments);
2022
1975
  }
2023
- function _validateValues() {
2024
- _validateValues = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee4(searchItem, value) {
2025
- var _props$validateValues;
2026
- var validateStr;
1976
+ function validateUsingItemValues(_x6) {
1977
+ return _validateUsingItemValues.apply(this, arguments);
1978
+ }
1979
+ function _validateUsingItemValues() {
1980
+ _validateUsingItemValues = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee4(preValues) {
1981
+ var _usingItem$value10, searchItem, validate, values;
2027
1982
  return regenerator_default().wrap(function _callee4$(_context4) {
2028
1983
  while (1) switch (_context4.prev = _context4.next) {
2029
1984
  case 0:
2030
- _context4.next = 2;
2031
- return (_props$validateValues = props.validateValues) === null || _props$validateValues === void 0 ? void 0 : _props$validateValues.call(props, searchItem !== null && searchItem !== void 0 ? searchItem : null, value)["catch"](function () {
2032
- return false;
2033
- });
2034
- case 2:
2035
- validateStr = _context4.sent;
2036
- if (!(typeof validateStr === 'string' || validateStr === false)) {
2037
- _context4.next = 6;
1985
+ if (usingItem.value) {
1986
+ _context4.next = 4;
2038
1987
  break;
2039
1988
  }
2040
- onValidate(validateStr || '校验错误');
2041
- return _context4.abrupt("return", false);
2042
- case 6:
1989
+ _context4.next = 3;
1990
+ return validateValues(null, preValues);
1991
+ case 3:
1992
+ return _context4.abrupt("return", _context4.sent);
1993
+ case 4:
1994
+ _usingItem$value10 = usingItem.value, searchItem = _usingItem$value10.searchItem, validate = _usingItem$value10.validate, values = _usingItem$value10.values;
1995
+ if (!(validate && typeof props.validateValues === 'function')) {
1996
+ _context4.next = 9;
1997
+ break;
1998
+ }
1999
+ _context4.next = 8;
2000
+ return validateValues(searchItem, preValues !== null && preValues !== void 0 ? preValues : values);
2001
+ case 8:
2002
+ return _context4.abrupt("return", _context4.sent);
2003
+ case 9:
2043
2004
  onValidate('');
2044
2005
  return _context4.abrupt("return", true);
2045
- case 8:
2006
+ case 11:
2046
2007
  case "end":
2047
2008
  return _context4.stop();
2048
2009
  }
2049
2010
  }, _callee4);
2050
2011
  }));
2051
- return _validateValues.apply(this, arguments);
2012
+ return _validateUsingItemValues.apply(this, arguments);
2052
2013
  }
2053
2014
  function setMenuList() {
2054
2015
  return _setMenuList.apply(this, arguments);
2055
2016
  }
2056
2017
  function _setMenuList() {
2057
2018
  _setMenuList = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee5() {
2058
- var _usingItem$value10, _usingItem$value$valu;
2019
+ var _props$data, _usingItem$value$sear, _usingItem$value$valu;
2059
2020
  var list, _usingItem$value11, _keyword$value2, hoverItem;
2060
2021
  return regenerator_default().wrap(function _callee5$(_context5) {
2061
2022
  while (1) switch (_context5.prev = _context5.next) {
2062
2023
  case 0:
2063
2024
  list = [];
2064
- 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))) {
2025
+ if (!(typeof props.getMenuList === 'function' && (!((_props$data = props.data) !== null && _props$data !== void 0 && _props$data.length) && !usingItem.value || usingItem.value && usingItem.value.type !== 'condition' && (((_usingItem$value$sear = usingItem.value.searchItem) === null || _usingItem$value$sear === void 0 ? void 0 : _usingItem$value$sear.async) === undefined || usingItem.value.searchItem.async === true)))) {
2065
2026
  _context5.next = 9;
2066
2027
  break;
2067
2028
  }
@@ -2153,6 +2114,89 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2153
2114
  }));
2154
2115
  return _setMenuList.apply(this, arguments);
2155
2116
  }
2117
+ function enterNewItemSelected() {
2118
+ return _enterNewItemSelected.apply(this, arguments);
2119
+ }
2120
+ function _enterNewItemSelected() {
2121
+ _enterNewItemSelected = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee6() {
2122
+ var formatItem, valueList, res;
2123
+ return regenerator_default().wrap(function _callee6$(_context6) {
2124
+ while (1) switch (_context6.prev = _context6.next) {
2125
+ case 0:
2126
+ formatItem = str2SeletedItem(keyword.value);
2127
+ valueList = (formatItem === null || formatItem === void 0 ? void 0 : formatItem.values) || [{
2128
+ id: keyword.value,
2129
+ name: keyword.value
2130
+ }];
2131
+ _context6.next = 4;
2132
+ return validateUsingItemValues(valueList);
2133
+ case 4:
2134
+ res = _context6.sent;
2135
+ if (res) {
2136
+ _context6.next = 7;
2137
+ break;
2138
+ }
2139
+ return _context6.abrupt("return");
2140
+ case 7:
2141
+ emit('add', formatItem || new SelectedItem(_objectSpread({}, valueList[0]), 'text'));
2142
+ keyword.value = '';
2143
+ setMenuList();
2144
+ return _context6.abrupt("return", true);
2145
+ case 11:
2146
+ case "end":
2147
+ return _context6.stop();
2148
+ }
2149
+ }, _callee6);
2150
+ }));
2151
+ return _enterNewItemSelected.apply(this, arguments);
2152
+ }
2153
+ function enterExistingItemSelected() {
2154
+ return _enterExistingItemSelected.apply(this, arguments);
2155
+ }
2156
+ function _enterExistingItemSelected() {
2157
+ _enterExistingItemSelected = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee7() {
2158
+ var valueList, formatItem, isValid;
2159
+ return regenerator_default().wrap(function _callee7$(_context7) {
2160
+ while (1) switch (_context7.prev = _context7.next) {
2161
+ case 0:
2162
+ valueList = [];
2163
+ if (usingItem.value.isSpecialType()) {
2164
+ formatItem = str2SeletedItem(keyword.value);
2165
+ if (formatItem) {
2166
+ usingItem.value = formatItem;
2167
+ valueList = formatItem.values;
2168
+ }
2169
+ }
2170
+ valueList = valueList.length ? valueList : usingItem.value.str2Values(keyword.value);
2171
+ _context7.next = 5;
2172
+ return validateUsingItemValues(valueList);
2173
+ case 5:
2174
+ isValid = _context7.sent;
2175
+ if (isValid) {
2176
+ _context7.next = 8;
2177
+ break;
2178
+ }
2179
+ return _context7.abrupt("return");
2180
+ case 8:
2181
+ if (usingItem.value.type === 'text') {
2182
+ usingItem.value.name = keyword.value;
2183
+ usingItem.value.id = keyword.value;
2184
+ } else {
2185
+ usingItem.value.values = valueList;
2186
+ }
2187
+ emit('add', usingItem.value);
2188
+ keyword.value = '';
2189
+ usingItem.value = null;
2190
+ setInputFocus(true);
2191
+ return _context7.abrupt("return", true);
2192
+ case 14:
2193
+ case "end":
2194
+ return _context7.stop();
2195
+ }
2196
+ }, _callee7);
2197
+ }));
2198
+ return _enterExistingItemSelected.apply(this, arguments);
2199
+ }
2156
2200
  function setCursorToEnd() {
2157
2201
  if (!inputRef.value) return;
2158
2202
  var range = document.createRange();
@@ -2184,11 +2228,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2184
2228
  function clearInput() {
2185
2229
  if (!inputRef.value) return;
2186
2230
  keyword.value = '';
2187
- inputRef.value.innerText = '';
2188
- }
2189
- function handleLogicalChange(logical) {
2190
- if (!usingItem.value) return;
2191
- usingItem.value.logical = logical;
2231
+ (0,external_vue_namespaceObject.nextTick)(function () {
2232
+ return inputRef.value.innerText = '';
2233
+ });
2192
2234
  }
2193
2235
  function str2SeletedItem(str) {
2194
2236
  var _str$split = str.split(':'),
@@ -2207,14 +2249,45 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2207
2249
  }
2208
2250
  return undefined;
2209
2251
  }
2252
+ function deleteInputTextNode() {
2253
+ var _keyword$value;
2254
+ if ((_keyword$value = keyword.value) !== null && _keyword$value !== void 0 && _keyword$value.length) {
2255
+ keyword.value = '';
2256
+ var nodes = Array.from(inputRef.value.childNodes);
2257
+ nodes.forEach(function (node) {
2258
+ var _node$textContent;
2259
+ if (node.nodeType === Node.TEXT_NODE && (_node$textContent = node.textContent) !== null && _node$textContent !== void 0 && _node$textContent.trim()) {
2260
+ inputRef.value.removeChild(node);
2261
+ }
2262
+ });
2263
+ }
2264
+ }
2210
2265
  function inputFocusForWrapper() {
2211
2266
  var _inputRef$value2;
2212
2267
  (_inputRef$value2 = inputRef.value) === null || _inputRef$value2 === void 0 || _inputRef$value2.focus();
2213
2268
  }
2214
2269
  function inputEnterForWrapper() {
2215
- handleKeyEnter().then(function (v) {
2216
- return v && clearInput();
2217
- });
2270
+ return _inputEnterForWrapper.apply(this, arguments);
2271
+ }
2272
+ function _inputEnterForWrapper() {
2273
+ _inputEnterForWrapper = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee8() {
2274
+ return regenerator_default().wrap(function _callee8$(_context8) {
2275
+ while (1) switch (_context8.prev = _context8.next) {
2276
+ case 0:
2277
+ _context8.next = 2;
2278
+ return handleKeyEnter().then(function (v) {
2279
+ return v && clearInput();
2280
+ });
2281
+ case 2:
2282
+ showPopover.value = false;
2283
+ inputRef.value.blur();
2284
+ case 4:
2285
+ case "end":
2286
+ return _context8.stop();
2287
+ }
2288
+ }, _callee8);
2289
+ }));
2290
+ return _inputEnterForWrapper.apply(this, arguments);
2218
2291
  }
2219
2292
  function inputClearForWrapper() {
2220
2293
  keyword.value = '';
@@ -2258,6 +2331,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2258
2331
  inputFocusForWrapper: inputFocusForWrapper,
2259
2332
  inputEnterForWrapper: inputEnterForWrapper,
2260
2333
  inputClearForWrapper: inputClearForWrapper,
2334
+ deleteInputTextNode: deleteInputTextNode,
2261
2335
  t: t
2262
2336
  };
2263
2337
  },
@@ -2392,8 +2466,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2392
2466
 
2393
2467
 
2394
2468
 
2395
-
2396
- /* harmony default export */ const selected = ((0,external_vue_namespaceObject.defineComponent)({
2469
+ /* harmony default export */ const selected = (defineComponent({
2397
2470
  name: 'SearchSelected',
2398
2471
  props: {
2399
2472
  data: {
@@ -2421,8 +2494,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2421
2494
  emits: ['delete'],
2422
2495
  setup: function setup(_props, _ref) {
2423
2496
  var emit = _ref.emit;
2424
- var inputRef = (0,external_vue_namespaceObject.ref)(null);
2425
- var selectedInputRef = (0,external_vue_namespaceObject.ref)(null);
2497
+ var inputRef = ref(null);
2498
+ var selectedInputRef = ref(null);
2426
2499
  var _useSearchSelectInjec = useSearchSelectInject(),
2427
2500
  onEditClick = _useSearchSelectInjec.onEditClick,
2428
2501
  onEditEnter = _useSearchSelectInjec.onEditEnter,
@@ -2604,6 +2677,13 @@ var SearchSelectProps = {
2604
2677
  return [ValueBehavior.ALL, ValueBehavior.NEEDKEY].includes(v);
2605
2678
  }
2606
2679
  }
2680
+ // deleteBehavior: {
2681
+ // type: String as PropType<`${DeleteBehavior}`>,
2682
+ // default: DeleteBehavior.CHAR,
2683
+ // validator(v: DeleteBehavior) {
2684
+ // return [DeleteBehavior.CHAR, DeleteBehavior.VALUE].includes(v);
2685
+ // },
2686
+ // },
2607
2687
  };
2608
2688
  /* harmony default export */ const search_select = ((0,external_vue_namespaceObject.defineComponent)({
2609
2689
  name: 'SearchSelect',