bkui-vue 1.0.3-beta.65 → 1.0.3-beta.66

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.
@@ -1108,6 +1108,11 @@ var SelectedItem = /*#__PURE__*/function () {
1108
1108
  get: function get() {
1109
1109
  return !!this.searchItem.showLogicalPanel;
1110
1110
  }
1111
+ }, {
1112
+ key: "isCustomMenu",
1113
+ get: function get() {
1114
+ return this.searchItem.isCustomMenu;
1115
+ }
1111
1116
  }, {
1112
1117
  key: "isSpecialType",
1113
1118
  value: function isSpecialType() {
@@ -1411,13 +1416,7 @@ var SelectedItem = /*#__PURE__*/function () {
1411
1416
  "onClick": function onClick() {
1412
1417
  return !item.disabled && _this.handleClick(item);
1413
1418
  }
1414
- }, [_this.$slots["default"] ? _this.$slots["default"]({
1415
- item: item,
1416
- list: _this.list,
1417
- multiple: !!_this.multiple,
1418
- hoverId: _this.hoverId,
1419
- getSearchNode: _this.getSearchNode
1420
- }) : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [_this.multiple && (0,external_vue_namespaceObject.createVNode)("span", {
1419
+ }, [(0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [_this.multiple && (0,external_vue_namespaceObject.createVNode)("span", {
1421
1420
  "onClick": function onClick(e) {
1422
1421
  return _this.handleSelectedChange(e, item);
1423
1422
  }
@@ -1537,7 +1536,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1537
1536
  validateValues: Function,
1538
1537
  valueBehavior: String
1539
1538
  },
1540
- emits: ['focus', 'add', 'delete'],
1539
+ emits: ['focus', 'add', 'delete', 'selectKey'],
1540
+ slots: Object,
1541
1541
  setup: function setup(props, _ref) {
1542
1542
  var emit = _ref.emit,
1543
1543
  expose = _ref.expose;
@@ -1643,21 +1643,31 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1643
1643
  item && handleSelectItem(item);
1644
1644
  }
1645
1645
  function handleClickOutside(e) {
1646
- var _popoverRef$value, _props$clickOutside;
1647
- 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)) {
1648
- if (props.mode === SearchInputMode.EDIT || usingItem.value) {
1649
- usingItem.value && handleKeyEnter().then(function (v) {
1646
+ var _popoverRef$value, _props$clickOutside, _usingItem$value2;
1647
+ 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))) {
1648
+ return;
1649
+ }
1650
+ if ((_usingItem$value2 = usingItem.value) !== null && _usingItem$value2 !== void 0 && _usingItem$value2.isCustomMenu) {
1651
+ if (props.mode === SearchInputMode.EDIT) {
1652
+ handleKeyEnter().then(function (v) {
1650
1653
  return v && clearInput();
1651
1654
  });
1652
- if (!usingItem.value) {
1653
- emit('focus', false);
1654
- }
1655
- return;
1655
+ showPopover.value = false;
1656
1656
  }
1657
- isFocus.value = false;
1658
- showPopover.value = false;
1659
- emit('focus', isFocus.value);
1657
+ return;
1658
+ }
1659
+ if (props.mode === SearchInputMode.EDIT || usingItem.value) {
1660
+ usingItem.value && handleKeyEnter().then(function (v) {
1661
+ return v && clearInput();
1662
+ });
1663
+ if (!usingItem.value) {
1664
+ emit('focus', false);
1665
+ }
1666
+ return;
1660
1667
  }
1668
+ isFocus.value = false;
1669
+ showPopover.value = false;
1670
+ emit('focus', isFocus.value);
1661
1671
  }
1662
1672
  function handleInputFocus() {
1663
1673
  showNoSelectValueError.value = false;
@@ -1729,7 +1739,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1729
1739
  }
1730
1740
  function _handleKeyEnter() {
1731
1741
  _handleKeyEnter = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee(event) {
1732
- var _usingItem$value4, _usingItem$value5;
1742
+ var _usingItem$value6, _usingItem$value7, _usingItem$value8;
1733
1743
  var isValid;
1734
1744
  return regenerator_default().wrap(function _callee$(_context) {
1735
1745
  while (1) switch (_context.prev = _context.next) {
@@ -1765,7 +1775,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1765
1775
  case 12:
1766
1776
  return _context.abrupt("return", _context.sent);
1767
1777
  case 13:
1768
- 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)) {
1778
+ if (!(!((_usingItem$value6 = usingItem.value) !== null && _usingItem$value6 !== void 0 && _usingItem$value6.isSpecialType()) && ((_usingItem$value7 = usingItem.value) === null || _usingItem$value7 === void 0 ? void 0 : _usingItem$value7.values.length) < 1)) {
1769
1779
  _context.next = 16;
1770
1780
  break;
1771
1781
  }
@@ -1782,9 +1792,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1782
1792
  }
1783
1793
  return _context.abrupt("return", false);
1784
1794
  case 21:
1795
+ if ((_usingItem$value8 = usingItem.value) !== null && _usingItem$value8 !== void 0 && _usingItem$value8.isCustomMenu) {
1796
+ showPopover.value = false;
1797
+ }
1785
1798
  setSelectedItem();
1786
1799
  return _context.abrupt("return", false);
1787
- case 23:
1800
+ case 24:
1788
1801
  case "end":
1789
1802
  return _context.stop();
1790
1803
  }
@@ -1793,14 +1806,14 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1793
1806
  return _handleKeyEnter.apply(this, arguments);
1794
1807
  }
1795
1808
  function handleKeyBackspace(event) {
1796
- var _usingItem$value2;
1809
+ var _usingItem$value3;
1797
1810
  // 删除已选择项
1798
1811
  if (!usingItem.value && !keyword.value) {
1799
1812
  emit('delete');
1800
1813
  setTimeout(setMenuList, 16);
1801
1814
  return;
1802
1815
  }
1803
- if ((_usingItem$value2 = usingItem.value) !== null && _usingItem$value2 !== void 0 && _usingItem$value2.values.length) {
1816
+ if ((_usingItem$value3 = usingItem.value) !== null && _usingItem$value3 !== void 0 && _usingItem$value3.values.length) {
1804
1817
  var _usingItem$value$chil;
1805
1818
  if (usingItem.value.type === 'text' || !((_usingItem$value$chil = usingItem.value.children) !== null && _usingItem$value$chil !== void 0 && _usingItem$value$chil.length)) return;
1806
1819
  event.preventDefault();
@@ -1831,8 +1844,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1831
1844
  }
1832
1845
  function _handleSelectItem() {
1833
1846
  _handleSelectItem = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee2(item, type) {
1834
- var _item$value, _usingItem$value6, _usingItem$value9;
1835
- var _item$realId, selectedItem, _usingItem$value7, _usingItem$value8, isCondition;
1847
+ var _item$value, _usingItem$value9, _usingItem$value12;
1848
+ var _item$realId, selectedItem, _usingItem$value10, _usingItem$value11, isCondition;
1836
1849
  return regenerator_default().wrap(function _callee2$(_context2) {
1837
1850
  while (1) switch (_context2.prev = _context2.next) {
1838
1851
  case 0:
@@ -1869,40 +1882,47 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1869
1882
  menuHoverId.value = '';
1870
1883
  return _context2.abrupt("return");
1871
1884
  case 18:
1872
- if (!(!usingItem.value || ((_usingItem$value6 = usingItem.value) === null || _usingItem$value6 === void 0 ? void 0 : _usingItem$value6.type) === 'condition')) {
1873
- _context2.next = 26;
1885
+ if (!(!usingItem.value || ((_usingItem$value9 = usingItem.value) === null || _usingItem$value9 === void 0 ? void 0 : _usingItem$value9.type) === 'condition')) {
1886
+ _context2.next = 27;
1874
1887
  break;
1875
1888
  }
1876
- 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);
1889
+ usingItem.value = new SelectedItem(item, type !== null && type !== void 0 ? type : (_usingItem$value10 = usingItem.value) === null || _usingItem$value10 === void 0 ? void 0 : _usingItem$value10.type);
1877
1890
  keyword.value = '';
1878
- isCondition = ((_usingItem$value8 = usingItem.value) === null || _usingItem$value8 === void 0 ? void 0 : _usingItem$value8.type) === 'condition';
1891
+ isCondition = ((_usingItem$value11 = usingItem.value) === null || _usingItem$value11 === void 0 ? void 0 : _usingItem$value11.type) === 'condition';
1892
+ if (!isCondition) {
1893
+ emit('selectKey', {
1894
+ id: item.id,
1895
+ name: item.name,
1896
+ values: []
1897
+ });
1898
+ }
1879
1899
  if (isCondition) {
1880
1900
  setSelectedItem();
1881
1901
  }
1882
1902
  showPopover.value = isCondition || !!usingItem.value.children.length;
1883
1903
  setInputFocus(props.valueBehavior === ValueBehavior.NEEDKEY && !!menuHoverId.value);
1884
1904
  return _context2.abrupt("return");
1885
- case 26:
1905
+ case 27:
1886
1906
  if (usingItem.value) {
1887
1907
  usingItem.value.addValue(item);
1888
1908
  (0,external_vue_namespaceObject.nextTick)(deleteInputTextNode);
1889
1909
  }
1890
- _context2.next = 29;
1910
+ _context2.next = 30;
1891
1911
  return validateUsingItemValues(usingItem.value.values);
1892
- case 29:
1912
+ case 30:
1893
1913
  if (_context2.sent) {
1894
- _context2.next = 31;
1914
+ _context2.next = 32;
1895
1915
  break;
1896
1916
  }
1897
1917
  return _context2.abrupt("return");
1898
- case 31:
1918
+ case 32:
1899
1919
  if (!usingItem.value.multiple) {
1900
1920
  setSelectedItem();
1901
1921
  }
1902
- if (props.valueBehavior === ValueBehavior.NEEDKEY && (_usingItem$value9 = usingItem.value) !== null && _usingItem$value9 !== void 0 && _usingItem$value9.multiple) {
1922
+ if (props.valueBehavior === ValueBehavior.NEEDKEY && (_usingItem$value12 = usingItem.value) !== null && _usingItem$value12 !== void 0 && _usingItem$value12.multiple) {
1903
1923
  setInputFocus();
1904
1924
  }
1905
- case 33:
1925
+ case 34:
1906
1926
  case "end":
1907
1927
  return _context2.stop();
1908
1928
  }
@@ -1914,10 +1934,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1914
1934
  handleSelectItem(item, 'condition');
1915
1935
  }
1916
1936
  function handleMenuFooterClick(item) {
1917
- var _usingItem$value3;
1937
+ var _usingItem$value4;
1918
1938
  switch (item.id) {
1919
1939
  case 'confirm':
1920
- if (!((_usingItem$value3 = usingItem.value) !== null && _usingItem$value3 !== void 0 && _usingItem$value3.values.length)) return;
1940
+ if (!((_usingItem$value4 = usingItem.value) !== null && _usingItem$value4 !== void 0 && _usingItem$value4.values.length)) return;
1921
1941
  keyword.value = '';
1922
1942
  handleKeyEnter();
1923
1943
  break;
@@ -1980,7 +2000,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1980
2000
  }
1981
2001
  function _validateUsingItemValues() {
1982
2002
  _validateUsingItemValues = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee4(preValues) {
1983
- var _usingItem$value10, searchItem, validate, values;
2003
+ var _usingItem$value13, searchItem, validate, values;
1984
2004
  return regenerator_default().wrap(function _callee4$(_context4) {
1985
2005
  while (1) switch (_context4.prev = _context4.next) {
1986
2006
  case 0:
@@ -1993,7 +2013,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
1993
2013
  case 3:
1994
2014
  return _context4.abrupt("return", _context4.sent);
1995
2015
  case 4:
1996
- _usingItem$value10 = usingItem.value, searchItem = _usingItem$value10.searchItem, validate = _usingItem$value10.validate, values = _usingItem$value10.values;
2016
+ _usingItem$value13 = usingItem.value, searchItem = _usingItem$value13.searchItem, validate = _usingItem$value13.validate, values = _usingItem$value13.values;
1997
2017
  if (!(validate && typeof props.validateValues === 'function')) {
1998
2018
  _context4.next = 9;
1999
2019
  break;
@@ -2019,7 +2039,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2019
2039
  function _setMenuList() {
2020
2040
  _setMenuList = _asyncToGenerator( /*#__PURE__*/regenerator_default().mark(function _callee5() {
2021
2041
  var _props$data, _usingItem$value$sear, _usingItem$value$valu;
2022
- var list, _usingItem$value11, _keyword$value2, hoverItem;
2042
+ var list, _usingItem$value14, _keyword$value2, hoverItem;
2023
2043
  return regenerator_default().wrap(function _callee5$(_context5) {
2024
2044
  while (1) switch (_context5.prev = _context5.next) {
2025
2045
  case 0:
@@ -2030,7 +2050,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2030
2050
  }
2031
2051
  loading.value = true;
2032
2052
  _context5.next = 5;
2033
- return props.getMenuList((_usingItem$value11 = usingItem.value) === null || _usingItem$value11 === void 0 ? void 0 : _usingItem$value11.searchItem, keyword.value)["catch"](function () {
2053
+ return props.getMenuList((_usingItem$value14 = usingItem.value) === null || _usingItem$value14 === void 0 ? void 0 : _usingItem$value14.searchItem, keyword.value)["catch"](function () {
2034
2054
  return [];
2035
2055
  });
2036
2056
  case 5:
@@ -2221,11 +2241,15 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2221
2241
  emit('focus', isFocus.value);
2222
2242
  }
2223
2243
  function setSelectedItem(item) {
2244
+ var _usingItem$value5;
2224
2245
  emit('add', item !== null && item !== void 0 ? item : usingItem.value);
2246
+ var needCursorToEnd = !((_usingItem$value5 = usingItem.value) !== null && _usingItem$value5 !== void 0 && _usingItem$value5.isCustomMenu);
2225
2247
  usingItem.value = null;
2226
2248
  keyword.value = '';
2227
- setInputFocus(true, true);
2228
- (0,external_vue_namespaceObject.nextTick)(clearInput);
2249
+ if (needCursorToEnd) {
2250
+ setInputFocus(true, needCursorToEnd);
2251
+ (0,external_vue_namespaceObject.nextTick)(clearInput);
2252
+ }
2229
2253
  }
2230
2254
  function clearInput() {
2231
2255
  if (!inputRef.value) return;
@@ -2298,6 +2322,15 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2298
2322
  usingItem.value = null;
2299
2323
  (0,external_vue_namespaceObject.nextTick)(clearInput);
2300
2324
  }
2325
+ function customPanelSubmit(value) {
2326
+ usingItem.value.values = [{
2327
+ id: value,
2328
+ name: value
2329
+ }];
2330
+ handleKeyEnter().then(function (v) {
2331
+ return v && clearInput();
2332
+ });
2333
+ }
2301
2334
  // expose
2302
2335
  expose({
2303
2336
  inputFocusForWrapper: inputFocusForWrapper,
@@ -2334,6 +2367,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2334
2367
  inputEnterForWrapper: inputEnterForWrapper,
2335
2368
  inputClearForWrapper: inputClearForWrapper,
2336
2369
  deleteInputTextNode: deleteInputTextNode,
2370
+ customPanelSubmit: customPanelSubmit,
2337
2371
  t: t
2338
2372
  };
2339
2373
  },
@@ -2345,16 +2379,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2345
2379
  multiple = _ref2.multiple,
2346
2380
  values = _ref2.values,
2347
2381
  placeholder = _ref2.placeholder,
2348
- inputInnerHtml = _ref2.inputInnerHtml;
2382
+ inputInnerHtml = _ref2.inputInnerHtml,
2383
+ isCustomMenu = _ref2.isCustomMenu;
2349
2384
  var showInputAfter = !((_this$keyword = this.keyword) !== null && _this$keyword !== void 0 && _this$keyword.length) && !(values !== null && values !== void 0 && values.length) && placeholder;
2350
- var showPopover = this.loading || this.showNoSelectValueError || this.showPopover && !!((_this$menuList = this.menuList) !== null && _this$menuList !== void 0 && _this$menuList.length);
2385
+ var showPopover = this.loading || this.showNoSelectValueError || this.showPopover && (!!isCustomMenu || !!((_this$menuList = this.menuList) !== null && _this$menuList !== void 0 && _this$menuList.length));
2351
2386
  var showCondition = !this.usingItem && this.showCondition;
2352
- var menuSlots = Object.assign({}, this.$slots.menu ? {
2353
- "default": function _default(data) {
2354
- var _this$$slots$menu, _this$$slots;
2355
- return (_this$$slots$menu = (_this$$slots = _this.$slots).menu) === null || _this$$slots$menu === void 0 ? void 0 : _this$$slots$menu.call(_this$$slots, data);
2356
- }
2357
- } : {});
2358
2387
  var inputContent = function inputContent() {
2359
2388
  var _this$keyword2, _this$usingItem, _this$usingItem2;
2360
2389
  return (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("div", {
@@ -2394,17 +2423,29 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2394
2423
  "data-type": "value",
2395
2424
  "data-id": item.id,
2396
2425
  "data-index": index
2397
- }, [index > 0 ? " ".concat(_this.usingItem.logical, " ") : '', item.name]);
2426
+ }, [item.name, index < _this.usingItem.values.length - 1 ? " ".concat(_this.usingItem.logical, " ") : '']);
2398
2427
  })]), [[(0,external_vue_namespaceObject.resolveDirective)("clickoutside"), _this.handleClickOutside]]);
2399
2428
  };
2400
2429
  var popoverContent = function popoverContent() {
2401
- var _this$menuList2, _this$usingItem3, _this$usingItem4;
2430
+ var _this$usingItem3, _this$menuList2, _this$usingItem4, _this$usingItem5;
2402
2431
  if (_this.loading) {
2403
2432
  return (0,external_vue_namespaceObject.createVNode)("div", null, [_this.t.loading]);
2404
2433
  }
2405
2434
  if (_this.showNoSelectValueError) {
2406
2435
  return (0,external_vue_namespaceObject.createVNode)("div", null, [_this.t.filterQueryMustHasValue]);
2407
2436
  }
2437
+ if ((_this$usingItem3 = _this.usingItem) !== null && _this$usingItem3 !== void 0 && _this$usingItem3.isCustomMenu && _this.$slots.menu) {
2438
+ var _this$usingItem$value;
2439
+ return (0,external_vue_namespaceObject.createVNode)("div", {
2440
+ "ref": "popoverRef",
2441
+ "class": _this.resolveClassName('search-select-popover')
2442
+ }, [_this.$slots.menu({
2443
+ value: (_this$usingItem$value = _this.usingItem.values) === null || _this$usingItem$value === void 0 ? void 0 : _this$usingItem$value[0],
2444
+ id: _this.usingItem.id,
2445
+ name: _this.usingItem.name,
2446
+ onSubmit: _this.customPanelSubmit
2447
+ })]);
2448
+ }
2408
2449
  return (_this$menuList2 = _this.menuList) !== null && _this$menuList2 !== void 0 && _this$menuList2.length ? (0,external_vue_namespaceObject.createVNode)("div", {
2409
2450
  "ref": "popoverRef",
2410
2451
  "class": _this.resolveClassName('search-select-popover')
@@ -2417,13 +2458,13 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2417
2458
  return item.id;
2418
2459
  })) || [],
2419
2460
  "conditions": showCondition ? _this.conditions : [],
2420
- "logical": (_this$usingItem3 = _this.usingItem) === null || _this$usingItem3 === void 0 ? void 0 : _this$usingItem3.logical,
2421
- "showLogical": (_this$usingItem4 = _this.usingItem) === null || _this$usingItem4 === void 0 ? void 0 : _this$usingItem4.showLogical,
2461
+ "logical": (_this$usingItem4 = _this.usingItem) === null || _this$usingItem4 === void 0 ? void 0 : _this$usingItem4.logical,
2462
+ "showLogical": (_this$usingItem5 = _this.usingItem) === null || _this$usingItem5 === void 0 ? void 0 : _this$usingItem5.showLogical,
2422
2463
  "onUpdate:logical": _this.handleLogicalChange,
2423
2464
  "onSelectItem": _this.handleSelectItem,
2424
2465
  "onSelectCondition": _this.handleSelectCondtionItem,
2425
2466
  "onFooterClick": _this.handleMenuFooterClick
2426
- }, _objectSpread({}, menuSlots))]) : undefined;
2467
+ }, null)]) : undefined;
2427
2468
  };
2428
2469
  return (0,external_vue_namespaceObject.createVNode)(popover_namespaceObject["default"], {
2429
2470
  "trigger": "manual",
@@ -2440,6 +2481,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2440
2481
  }));
2441
2482
  ;// CONCATENATED MODULE: ../../packages/search-select/src/selected.tsx
2442
2483
 
2484
+
2485
+ function selected_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; }
2486
+ function selected_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? selected_ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : selected_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2443
2487
  /*
2444
2488
  * Tencent is pleased to support the open source community by making
2445
2489
  * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
@@ -2494,7 +2538,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2494
2538
  validateValues: Function,
2495
2539
  valueBehavior: String
2496
2540
  },
2497
- emits: ['delete'],
2541
+ emits: ['delete', 'selectKey'],
2498
2542
  setup: function setup(_props, _ref) {
2499
2543
  var emit = _ref.emit;
2500
2544
  var inputRef = (0,external_vue_namespaceObject.ref)(null);
@@ -2511,6 +2555,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2511
2555
  e.preventDefault();
2512
2556
  e.stopPropagation();
2513
2557
  onEditClick(item, index);
2558
+ emit('selectKey', {
2559
+ id: item.id,
2560
+ name: item.name,
2561
+ values: item.values.slice()
2562
+ });
2514
2563
  // magic code
2515
2564
  setTimeout(function () {
2516
2565
  return inputRef.value.handleInputFocus();
@@ -2568,7 +2617,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2568
2617
  return _this.handleAddSelected(v, index);
2569
2618
  },
2570
2619
  "onFocus": _this.handleInputFocus
2571
- }, null)]) : (0,external_vue_namespaceObject.createVNode)("li", {
2620
+ }, selected_objectSpread({}, _this.$slots))]) : (0,external_vue_namespaceObject.createVNode)("li", {
2572
2621
  "class": "search-container-selected ".concat(!(_this.overflowIndex >= 0 ? index < _this.overflowIndex : index >= 0) ? 'hidden-selected' : ''),
2573
2622
  "key": "".concat(item.id, "_").concat(index)
2574
2623
  }, [(0,external_vue_namespaceObject.createVNode)("span", {
@@ -2694,7 +2743,8 @@ var SearchSelectProps = {
2694
2743
  clickoutside: directives_namespaceObject.clickoutside
2695
2744
  },
2696
2745
  props: SearchSelectProps,
2697
- emits: ['update:modelValue', 'search'],
2746
+ emits: ['update:modelValue', 'search', 'selectKey'],
2747
+ slots: Object,
2698
2748
  setup: function setup(props, _ref) {
2699
2749
  var emit = _ref.emit;
2700
2750
  var t = (0,config_provider_namespaceObject.useLocale)('searchSelect');
@@ -2899,6 +2949,9 @@ var SearchSelectProps = {
2899
2949
  inputRef.value.inputEnterForWrapper();
2900
2950
  emit('search', e);
2901
2951
  }
2952
+ function handleSelectedKey(a) {
2953
+ emit('selectKey', a);
2954
+ }
2902
2955
  return {
2903
2956
  inputRef: inputRef,
2904
2957
  wrapRef: wrapRef,
@@ -2919,6 +2972,7 @@ var SearchSelectProps = {
2919
2972
  handleClickSearch: handleClickSearch,
2920
2973
  localConditions: localConditions,
2921
2974
  resolveClassName: resolveClassName,
2975
+ handleSelectedKey: handleSelectedKey,
2922
2976
  t: t
2923
2977
  };
2924
2978
  },
@@ -2956,7 +3010,8 @@ var SearchSelectProps = {
2956
3010
  "getMenuList": this.getMenuList,
2957
3011
  "validateValues": this.validateValues,
2958
3012
  "valueBehavior": this.valueBehavior,
2959
- "onDelete": this.handleDeleteSelected
3013
+ "onDelete": this.handleDeleteSelected,
3014
+ "onSelectKey": this.handleSelectedKey
2960
3015
  }, search_select_objectSpread({}, menuSlots)), (0,external_vue_namespaceObject.createVNode)("div", {
2961
3016
  "class": "search-container-input"
2962
3017
  }, [(0,external_vue_namespaceObject.createVNode)(input, {
@@ -2972,7 +3027,8 @@ var SearchSelectProps = {
2972
3027
  "valueBehavior": this.valueBehavior,
2973
3028
  "onAdd": this.handleAddSelected,
2974
3029
  "onDelete": this.handleDeleteSelected,
2975
- "onFocus": this.handleInputFocus
3030
+ "onFocus": this.handleInputFocus,
3031
+ "onSelectKey": this.handleSelectedKey
2976
3032
  }, search_select_objectSpread({}, menuSlots))])]), (0,external_vue_namespaceObject.createVNode)("div", {
2977
3033
  "class": "search-nextfix"
2978
3034
  }, [this.clearable && !!this.selectedList.length && (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Close, {
@@ -1,5 +1,5 @@
1
- import { PropType, Ref } from 'vue';
2
- import { GetMenuListFunc, ICommonItem, IMenuFooterItem, ISearchItem, SearchInputMode, SearchItemType, SearchLogical, SelectedItem, ValidateValuesFunc, ValueBehavior } from './utils';
1
+ import { PropType, Ref, SlotsType } from 'vue';
2
+ import { GetMenuListFunc, ICommonItem, IMenuFooterItem, ISearchItem, MenuSlotParams, SearchInputMode, SearchItemType, SearchLogical, SelectedItem, ValidateValuesFunc, ValueBehavior } from './utils';
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  data: {
5
5
  type: PropType<ISearchItem[]>;
@@ -66,6 +66,7 @@ declare const _default: import("vue").DefineComponent<{
66
66
  inputEnterForWrapper: () => Promise<void>;
67
67
  inputClearForWrapper: () => void;
68
68
  deleteInputTextNode: () => void;
69
+ customPanelSubmit: (value: string) => void;
69
70
  t: import("vue").ComputedRef<{
70
71
  pleaseSelect: string;
71
72
  loading: string;
@@ -76,7 +77,7 @@ declare const _default: import("vue").DefineComponent<{
76
77
  and: string;
77
78
  logical: string;
78
79
  }>;
79
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "delete" | "add")[], "focus" | "delete" | "add", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
80
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "delete" | "add" | "selectKey")[], "focus" | "delete" | "add" | "selectKey", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
80
81
  data: {
81
82
  type: PropType<ISearchItem[]>;
82
83
  required: true;
@@ -101,10 +102,13 @@ declare const _default: import("vue").DefineComponent<{
101
102
  onFocus?: (...args: any[]) => any;
102
103
  onDelete?: (...args: any[]) => any;
103
104
  onAdd?: (...args: any[]) => any;
105
+ onSelectKey?: (...args: any[]) => any;
104
106
  }, {
105
107
  mode: SearchInputMode;
106
108
  conditions: ICommonItem[];
107
109
  showInputBefore: boolean;
108
110
  showCondition: boolean;
109
- }, {}>;
111
+ }, SlotsType<{
112
+ menu: MenuSlotParams;
113
+ }>>;
110
114
  export default _default;
@@ -1,5 +1,6 @@
1
1
  import { PropType, ShallowRef } from 'vue';
2
- import { GetMenuListFunc, ICommonItem, ISearchItem, ISearchValue, SearchItemType, SearchLogical, SelectedItem, ValidateValuesFunc, ValueBehavior } from './utils';
2
+ import { type SlotsType } from 'vue';
3
+ import { GetMenuListFunc, ICommonItem, ISearchItem, ISearchValue, MenuSlotParams, SearchItemType, SearchLogical, SelectedItem, ValidateValuesFunc, ValueBehavior } from './utils';
3
4
  export declare const SearchSelectProps: {
4
5
  data: {
5
6
  type: PropType<ISearchItem[]>;
@@ -109,6 +110,7 @@ declare const _default: import("vue").DefineComponent<{
109
110
  onFocus?: (...args: any[]) => any;
110
111
  onDelete?: (...args: any[]) => any;
111
112
  onAdd?: (...args: any[]) => any;
113
+ onSelectKey?: (...args: any[]) => any;
112
114
  }, {
113
115
  popoverRef: import("vue").Ref<HTMLDivElement>;
114
116
  inputRef: import("vue").Ref<HTMLDivElement>;
@@ -154,6 +156,7 @@ declare const _default: import("vue").DefineComponent<{
154
156
  inputEnterForWrapper: () => Promise<void>;
155
157
  inputClearForWrapper: () => void;
156
158
  deleteInputTextNode: () => void;
159
+ customPanelSubmit: (value: string) => void;
157
160
  t: import("vue").ComputedRef<{
158
161
  pleaseSelect: string;
159
162
  loading: string;
@@ -164,7 +167,7 @@ declare const _default: import("vue").DefineComponent<{
164
167
  and: string;
165
168
  logical: string;
166
169
  }>;
167
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "delete" | "add")[], import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
170
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("focus" | "delete" | "add" | "selectKey")[], import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
168
171
  data: {
169
172
  type: PropType<ISearchItem[]>;
170
173
  required: true;
@@ -189,12 +192,15 @@ declare const _default: import("vue").DefineComponent<{
189
192
  onFocus?: (...args: any[]) => any;
190
193
  onDelete?: (...args: any[]) => any;
191
194
  onAdd?: (...args: any[]) => any;
195
+ onSelectKey?: (...args: any[]) => any;
192
196
  }, {
193
197
  mode: import("./utils").SearchInputMode;
194
198
  conditions: ICommonItem[];
195
199
  showInputBefore: boolean;
196
200
  showCondition: boolean;
197
- }, true, {}, {}, {
201
+ }, true, {}, SlotsType<{
202
+ menu: MenuSlotParams;
203
+ }>, {
198
204
  P: {};
199
205
  B: {};
200
206
  D: {};
@@ -226,6 +232,7 @@ declare const _default: import("vue").DefineComponent<{
226
232
  onFocus?: (...args: any[]) => any;
227
233
  onDelete?: (...args: any[]) => any;
228
234
  onAdd?: (...args: any[]) => any;
235
+ onSelectKey?: (...args: any[]) => any;
229
236
  }, {
230
237
  popoverRef: import("vue").Ref<HTMLDivElement>;
231
238
  inputRef: import("vue").Ref<HTMLDivElement>;
@@ -271,6 +278,7 @@ declare const _default: import("vue").DefineComponent<{
271
278
  inputEnterForWrapper: () => Promise<void>;
272
279
  inputClearForWrapper: () => void;
273
280
  deleteInputTextNode: () => void;
281
+ customPanelSubmit: (value: string) => void;
274
282
  t: import("vue").ComputedRef<{
275
283
  pleaseSelect: string;
276
284
  loading: string;
@@ -353,6 +361,7 @@ declare const _default: import("vue").DefineComponent<{
353
361
  onlyRecommendChildren?: boolean;
354
362
  logical?: SearchLogical;
355
363
  showLogicalPanel?: boolean;
364
+ isCustomMenu?: boolean;
356
365
  };
357
366
  type: SearchItemType;
358
367
  readonly multiple: boolean;
@@ -378,6 +387,7 @@ declare const _default: import("vue").DefineComponent<{
378
387
  readonly keyInnerHtml: string;
379
388
  readonly keyInnerText: string;
380
389
  readonly showLogical: boolean;
390
+ readonly isCustomMenu: boolean;
381
391
  isSpecialType: () => boolean;
382
392
  addValue: (item: ICommonItem) => void;
383
393
  str2Values: (str: string) => ICommonItem[];
@@ -401,6 +411,7 @@ declare const _default: import("vue").DefineComponent<{
401
411
  handleClickSearch: (e: MouseEvent) => void;
402
412
  localConditions: import("vue").ComputedRef<ICommonItem[]>;
403
413
  resolveClassName: (cls: string) => string;
414
+ handleSelectedKey: (a: any) => void;
404
415
  t: import("vue").ComputedRef<{
405
416
  pleaseSelect: string;
406
417
  loading: string;
@@ -411,7 +422,7 @@ declare const _default: import("vue").DefineComponent<{
411
422
  and: string;
412
423
  logical: string;
413
424
  }>;
414
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("search" | "update:modelValue")[], "search" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
425
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("search" | "update:modelValue" | "selectKey")[], "search" | "update:modelValue" | "selectKey", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
415
426
  data: {
416
427
  type: PropType<ISearchItem[]>;
417
428
  default: () => any[];
@@ -454,6 +465,7 @@ declare const _default: import("vue").DefineComponent<{
454
465
  };
455
466
  }>> & {
456
467
  "onUpdate:modelValue"?: (...args: any[]) => any;
468
+ onSelectKey?: (...args: any[]) => any;
457
469
  onSearch?: (...args: any[]) => any;
458
470
  }, {
459
471
  data: ISearchItem[];
@@ -465,5 +477,10 @@ declare const _default: import("vue").DefineComponent<{
465
477
  valueBehavior: "all" | "need-key";
466
478
  shrink: boolean;
467
479
  uniqueSelect: boolean;
468
- }, {}>;
480
+ }, SlotsType<{
481
+ menu: MenuSlotParams;
482
+ prepend: void;
483
+ append: void;
484
+ validate: void;
485
+ }>>;
469
486
  export default _default;