bkui-vue 0.0.1-beta.156 → 0.0.1-beta.159

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 (99) hide show
  1. package/dist/index.cjs.js +35 -35
  2. package/dist/index.esm.js +214 -108
  3. package/dist/index.umd.js +35 -35
  4. package/dist/style.css +1 -1
  5. package/dist/style.variable.css +1 -1
  6. package/lib/affix/affix.variable.css +2 -2
  7. package/lib/alert/alert.variable.css +2 -2
  8. package/lib/backtop/backtop.css +8 -0
  9. package/lib/backtop/backtop.less +8 -0
  10. package/lib/backtop/backtop.variable.css +10 -2
  11. package/lib/backtop/index.js +1 -1
  12. package/lib/badge/badge.variable.css +2 -2
  13. package/lib/breadcrumb/breadcrumb.variable.css +2 -2
  14. package/lib/button/button.variable.css +2 -2
  15. package/lib/card/card.variable.css +2 -2
  16. package/lib/cascader/cascader-panel.d.ts +4 -4
  17. package/lib/cascader/cascader.css +13 -3
  18. package/lib/cascader/cascader.d.ts +2 -2
  19. package/lib/cascader/cascader.less +14 -1
  20. package/lib/cascader/cascader.variable.css +13 -3
  21. package/lib/cascader/index.d.ts +10 -10
  22. package/lib/cascader/index.js +1 -1
  23. package/lib/checkbox/checkbox.variable.css +2 -2
  24. package/lib/code-diff/code-diff.variable.css +2 -2
  25. package/lib/collapse/collapse.variable.css +2 -2
  26. package/lib/color-picker/color-picker.variable.css +2 -2
  27. package/lib/container/container.variable.css +2 -2
  28. package/lib/date-picker/date-picker.variable.css +2 -2
  29. package/lib/divider/divider.variable.css +2 -2
  30. package/lib/dropdown/dropdown.variable.css +2 -2
  31. package/lib/exception/exception.css +40 -14
  32. package/lib/exception/exception.d.ts +10 -3
  33. package/lib/exception/exception.less +59 -22
  34. package/lib/exception/exception.variable.css +42 -16
  35. package/lib/exception/index.d.ts +23 -8
  36. package/lib/exception/index.js +1 -1
  37. package/lib/fixed-navbar/fixed-navbar.variable.css +2 -2
  38. package/lib/form/form.variable.css +2 -2
  39. package/lib/input/input.css +1 -1
  40. package/lib/input/input.less +5 -5
  41. package/lib/input/input.variable.css +3 -3
  42. package/lib/link/link.css +12 -12
  43. package/lib/link/link.less +16 -14
  44. package/lib/link/link.variable.css +14 -14
  45. package/lib/loading/loading.variable.css +2 -2
  46. package/lib/menu/menu.variable.css +2 -2
  47. package/lib/menu/submenu.variable.css +2 -2
  48. package/lib/message/message.variable.css +2 -2
  49. package/lib/navigation/navigation.variable.css +2 -2
  50. package/lib/notify/notify.variable.css +2 -2
  51. package/lib/pagination/pagination.variable.css +2 -2
  52. package/lib/popover/popover.variable.css +2 -2
  53. package/lib/popover2/popover2.variable.css +2 -2
  54. package/lib/process/process.variable.css +2 -2
  55. package/lib/progress/progress.variable.css +2 -2
  56. package/lib/radio/radio.variable.css +2 -2
  57. package/lib/resize-layout/resize-layout.variable.css +2 -2
  58. package/lib/select/index.d.ts +65 -25
  59. package/lib/select/index.js +1 -1
  60. package/lib/select/select.css +54 -24
  61. package/lib/select/select.d.ts +28 -8
  62. package/lib/select/select.less +62 -24
  63. package/lib/select/select.variable.css +56 -26
  64. package/lib/select/selectTagInput.d.ts +1 -3
  65. package/lib/shared/dom.d.ts +2 -0
  66. package/lib/shared/index.d.ts +1 -0
  67. package/lib/shared/index.js +1 -1
  68. package/lib/sideslider/sideslider.variable.css +2 -2
  69. package/lib/slider/slider.variable.css +2 -2
  70. package/lib/steps/steps.variable.css +2 -2
  71. package/lib/styles/mixins/scroll.variable.css +2 -2
  72. package/lib/styles/themes/themes.less +2 -2
  73. package/lib/switcher/switcher.variable.css +2 -2
  74. package/lib/tab/tab.variable.css +2 -2
  75. package/lib/table/const.d.ts +2 -2
  76. package/lib/table/index.d.ts +6 -6
  77. package/lib/table/index.js +1 -1
  78. package/lib/table/plugins/head-filter.variable.css +2 -2
  79. package/lib/table/plugins/head-sort.variable.css +2 -2
  80. package/lib/table/plugins/settings.variable.css +2 -2
  81. package/lib/table/table.css +41 -14
  82. package/lib/table/table.d.ts +2 -2
  83. package/lib/table/table.less +1 -1
  84. package/lib/table/table.variable.css +43 -16
  85. package/lib/tag/tag.css +23 -8
  86. package/lib/tag/tag.less +25 -8
  87. package/lib/tag/tag.variable.css +25 -10
  88. package/lib/tag-input/index.js +1 -1
  89. package/lib/tag-input/tag-input.variable.css +2 -2
  90. package/lib/timeline/timeline.variable.css +2 -2
  91. package/lib/transfer/index.d.ts +4 -4
  92. package/lib/transfer/transfer.d.ts +1 -1
  93. package/lib/transfer/transfer.variable.css +2 -2
  94. package/lib/tree/tree.css +3 -0
  95. package/lib/tree/tree.less +6 -0
  96. package/lib/tree/tree.variable.css +5 -2
  97. package/lib/upload/upload.variable.css +2 -2
  98. package/lib/virtual-render/virtual-render.variable.css +2 -2
  99. package/package.json +1 -1
package/dist/index.esm.js CHANGED
@@ -7320,6 +7320,7 @@ var lodash = { exports: {} };
7320
7320
  }
7321
7321
  }).call(commonjsGlobal);
7322
7322
  })(lodash, lodash.exports);
7323
+ var _$1 = lodash.exports;
7323
7324
  const lowerStr = "abcdefghijklmnopqrstuvwxyz0123456789";
7324
7325
  const random = (n2, str = lowerStr) => {
7325
7326
  let result = "";
@@ -7905,6 +7906,34 @@ const formKey = Symbol("form");
7905
7906
  const formItemKey = Symbol("formItem");
7906
7907
  const useForm = () => inject(formKey);
7907
7908
  const useFormItem = () => inject(formItemKey, EMPTY_OBJ);
7909
+ const on$2 = (() => {
7910
+ if (document.addEventListener) {
7911
+ return (element, event, handler) => {
7912
+ if (element && event && handler) {
7913
+ element.addEventListener(event, handler, true);
7914
+ }
7915
+ };
7916
+ }
7917
+ return (element, event, handler) => {
7918
+ if (element && event && handler) {
7919
+ element.attachEvent(`on${event}`, handler);
7920
+ }
7921
+ };
7922
+ })();
7923
+ const off$2 = (() => {
7924
+ if (document.removeEventListener) {
7925
+ return (element, event, handler) => {
7926
+ if (element && event) {
7927
+ element.removeEventListener(event, handler, true);
7928
+ }
7929
+ };
7930
+ }
7931
+ return (element, event, handler) => {
7932
+ if (element && event) {
7933
+ element.detachEvent(`on${event}`, handler);
7934
+ }
7935
+ };
7936
+ })();
7908
7937
  function classes(dynamicCls, constCls = "") {
7909
7938
  return Object.entries(dynamicCls).filter((entry) => entry[1]).map((entry) => entry[0]).join(" ").concat(constCls ? ` ${constCls}` : "");
7910
7939
  }
@@ -8801,9 +8830,7 @@ var Component$C = defineComponent({
8801
8830
  },
8802
8831
  "onClick": scrollTop
8803
8832
  }, [(_b = (_a = slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : createVNode(angleUp, {
8804
- "style": {
8805
- fontSize: "14px"
8806
- }
8833
+ "class": "bk-backtop-icon"
8807
8834
  }, null)]) : ""];
8808
8835
  }
8809
8836
  });
@@ -10438,20 +10465,12 @@ var Component$t = defineComponent({
10438
10465
  props: {
10439
10466
  type: PropTypes.commonType(["404", "403", "500", "building", "empty", "search-empty", "login"], "type").def("404"),
10440
10467
  scene: PropTypes.commonType(["page", "part"], "scene").def("page"),
10441
- extCls: PropTypes.string
10468
+ title: PropTypes.string,
10469
+ description: PropTypes.string
10442
10470
  },
10443
10471
  setup(props2, {
10444
10472
  slots
10445
10473
  }) {
10446
- const tipText = {
10447
- 403: "\u65E0\u4E1A\u52A1\u6743\u9650",
10448
- 404: "\u9875\u9762\u4E0D\u5B58\u5728",
10449
- 500: "\u670D\u52A1\u7EF4\u62A4\u4E2D",
10450
- building: "\u529F\u80FD\u5EFA\u8BBE\u4E2D",
10451
- empty: "\u6CA1\u6709\u6570\u636E",
10452
- "search-empty": "\u641C\u7D22\u4E3A\u7A7A",
10453
- login: "\u8BF7\u767B\u5165\u84DD\u9CB8"
10454
- };
10455
10474
  const images = {
10456
10475
  403: permissions,
10457
10476
  404: notFound,
@@ -10461,19 +10480,58 @@ var Component$t = defineComponent({
10461
10480
  "search-empty": searchEmpty,
10462
10481
  login
10463
10482
  };
10464
- return () => {
10465
- var _a, _b;
10483
+ const renderImg = () => {
10484
+ const imgSrc = images[props2.type] ? images[props2.type] : empty;
10466
10485
  return createVNode("div", {
10467
- "class": ["bk-exception-wrapper", props2.extCls]
10468
- }, [createVNode("div", {
10469
- "class": ["bk-exception-img", `${props2.scene}-img`]
10486
+ "class": "bk-exception-img"
10470
10487
  }, [createVNode("img", {
10471
10488
  "class": "exception-image",
10472
- "src": images[props2.type],
10489
+ "src": imgSrc,
10473
10490
  "alt": "type"
10474
- }, null)]), createVNode("div", {
10475
- "class": ["bk-exception-text", `${props2.scene}-text`]
10476
- }, [(_b = (_a = slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : tipText[props2.type]])]);
10491
+ }, null)]);
10492
+ };
10493
+ const renderTitle = () => {
10494
+ if (_$1.isFunction(slots.title)) {
10495
+ return createVNode("div", {
10496
+ "class": "bk-exception-title"
10497
+ }, [slots.title()]);
10498
+ }
10499
+ if (props2.title) {
10500
+ return createVNode("div", {
10501
+ "class": "bk-exception-title"
10502
+ }, [props2.title]);
10503
+ }
10504
+ return null;
10505
+ };
10506
+ const renderDescription = () => {
10507
+ if (_$1.isFunction(slots.description)) {
10508
+ return createVNode("div", {
10509
+ "class": "bk-exception-description"
10510
+ }, [slots.description()]);
10511
+ }
10512
+ if (props2.description) {
10513
+ return createVNode("div", {
10514
+ "class": "bk-exception-description"
10515
+ }, [props2.description]);
10516
+ }
10517
+ return null;
10518
+ };
10519
+ const renderFooter = () => {
10520
+ if (_$1.isFunction(slots.default)) {
10521
+ return createVNode("div", {
10522
+ "class": "bk-exception-footer"
10523
+ }, [slots.default()]);
10524
+ }
10525
+ return null;
10526
+ };
10527
+ return () => {
10528
+ const rootClass = classes({
10529
+ "bk-exception": true,
10530
+ [`bk-exception-${props2.scene}`]: true
10531
+ });
10532
+ return createVNode("div", {
10533
+ "class": rootClass
10534
+ }, [renderImg(), renderTitle(), renderDescription(), renderFooter()]);
10477
10535
  };
10478
10536
  }
10479
10537
  });
@@ -14200,7 +14258,7 @@ var SelectTagInput = defineComponent({
14200
14258
  allowCreate: PropTypes.bool.def(false),
14201
14259
  modelValue: PropTypes.any
14202
14260
  },
14203
- emits: ["update:modelValue", "remove", "focus", "enter"],
14261
+ emits: ["update:modelValue", "remove", "enter"],
14204
14262
  setup(props2, {
14205
14263
  emit
14206
14264
  }) {
@@ -14216,9 +14274,6 @@ var SelectTagInput = defineComponent({
14216
14274
  const handleRemoveTag = (val) => {
14217
14275
  emit("remove", val);
14218
14276
  };
14219
- const handleFocus = () => {
14220
- emit("focus");
14221
- };
14222
14277
  const focus = () => {
14223
14278
  var _a;
14224
14279
  (_a = inputRef.value) == null ? void 0 : _a.focus();
@@ -14239,7 +14294,6 @@ var SelectTagInput = defineComponent({
14239
14294
  value,
14240
14295
  inputRef,
14241
14296
  handleRemoveTag,
14242
- handleFocus,
14243
14297
  focus,
14244
14298
  handleInput,
14245
14299
  handleKeydown,
@@ -14259,17 +14313,16 @@ var SelectTagInput = defineComponent({
14259
14313
  }, _isSlot$5(_slot = this.handleGetLabelByValue(item)) ? _slot : {
14260
14314
  default: () => [_slot]
14261
14315
  });
14262
- }), withDirectives(createVNode("input", {
14316
+ }), createVNode("input", {
14263
14317
  "class": "bk-select-tag-input",
14264
14318
  "ref": "inputRef",
14265
14319
  "type": "text",
14266
14320
  "placeholder": !this.selected.length ? this.placeholder : "",
14267
14321
  "readonly": !this.filterable,
14268
- "onUpdate:modelValue": ($event) => this.value = $event,
14269
- "onFocus": this.handleFocus,
14322
+ "value": !this.filterable ? "" : this.value,
14270
14323
  "onInput": this.handleInput,
14271
14324
  "onKeydown": this.handleKeydown
14272
- }, null), [[vModelText, this.value]]), (_d = (_c = this.$slots) == null ? void 0 : _c.suffix) == null ? void 0 : _d.call(_c)]);
14325
+ }, null), (_d = (_c = this.$slots) == null ? void 0 : _c.suffix) == null ? void 0 : _d.call(_c)]);
14273
14326
  }
14274
14327
  });
14275
14328
  var Component$j = defineComponent({
@@ -14298,6 +14351,7 @@ var Component$j = defineComponent({
14298
14351
  noMatchText: PropTypes.string.def("\u65E0\u5339\u914D\u6570\u636E"),
14299
14352
  loadingText: PropTypes.string.def("\u52A0\u8F7D\u4E2D..."),
14300
14353
  placeholder: PropTypes.string.def("\u8BF7\u9009\u62E9"),
14354
+ searchPlaceholder: PropTypes.string.def("\u8BF7\u8F93\u5165\u5173\u952E\u5B57"),
14301
14355
  selectAllText: PropTypes.string.def("\u5168\u90E8"),
14302
14356
  scrollLoading: PropTypes.bool.def(false),
14303
14357
  allowCreate: PropTypes.bool.def(false),
@@ -14307,7 +14361,8 @@ var Component$j = defineComponent({
14307
14361
  idKey: PropTypes.string.def("value"),
14308
14362
  displayKey: PropTypes.string.def("label"),
14309
14363
  withValidate: PropTypes.bool.def(true),
14310
- showSelectedIcon: PropTypes.bool.def(true)
14364
+ showSelectedIcon: PropTypes.bool.def(true),
14365
+ inputSearch: PropTypes.bool.def(true)
14311
14366
  },
14312
14367
  emits: ["update:modelValue", "change", "toggle", "clear", "scroll-end", "focus", "blur"],
14313
14368
  setup(props2, {
@@ -14328,11 +14383,14 @@ var Component$j = defineComponent({
14328
14383
  multipleMode,
14329
14384
  allowCreate,
14330
14385
  customContent,
14331
- showSelectedIcon
14386
+ showSelectedIcon,
14387
+ inputSearch
14332
14388
  } = toRefs(props2);
14333
14389
  const formItem = useFormItem();
14334
14390
  const inputRef = ref();
14335
14391
  const triggerRef = ref();
14392
+ const contentRef = ref();
14393
+ const searchRef = ref();
14336
14394
  const selectTagInputRef = ref();
14337
14395
  const optionsMap = ref(/* @__PURE__ */ new Map());
14338
14396
  const options = computed(() => [...optionsMap.value.values()]);
@@ -14390,13 +14448,17 @@ var Component$j = defineComponent({
14390
14448
  cancelHover
14391
14449
  } = useHover();
14392
14450
  const isFocus = ref(false);
14393
- const handleFocus = (e) => {
14451
+ const handleFocus = () => {
14452
+ if (isFocus.value)
14453
+ return;
14394
14454
  isFocus.value = true;
14395
- emit("focus", e);
14455
+ emit("focus");
14396
14456
  };
14397
14457
  const handleBlur = () => {
14398
- isFocus.value && emit("blur");
14458
+ if (!isFocus.value)
14459
+ return;
14399
14460
  isFocus.value = false;
14461
+ emit("blur");
14400
14462
  };
14401
14463
  const {
14402
14464
  popperWidth,
@@ -14407,12 +14469,12 @@ var Component$j = defineComponent({
14407
14469
  } = usePopover({
14408
14470
  popoverMinWidth: popoverMinWidth.value
14409
14471
  }, triggerRef);
14410
- const isInput = computed(() => (filterable.value || allowCreate.value) && isPopoverShow.value);
14472
+ const isInput = computed(() => (filterable.value && inputSearch.value || allowCreate.value) && isPopoverShow.value);
14411
14473
  watch(isPopoverShow, (isShow) => {
14412
14474
  if (!isShow) {
14413
14475
  searchKey.value = "";
14414
14476
  } else {
14415
- focus();
14477
+ focusInput();
14416
14478
  initActiveOptionValue();
14417
14479
  }
14418
14480
  });
@@ -14447,6 +14509,7 @@ var Component$j = defineComponent({
14447
14509
  const handleTogglePopover = () => {
14448
14510
  if (isDisabled.value)
14449
14511
  return;
14512
+ handleFocus();
14450
14513
  togglePopover();
14451
14514
  emit("toggle", isPopoverShow.value);
14452
14515
  };
@@ -14501,15 +14564,21 @@ var Component$j = defineComponent({
14501
14564
  emitChange(option.value);
14502
14565
  hidePopover();
14503
14566
  }
14504
- focus();
14567
+ focusInput();
14505
14568
  };
14506
- const focus = () => {
14507
- var _a, _b;
14508
- if (multipleMode.value === "tag") {
14509
- (_a = selectTagInputRef.value) == null ? void 0 : _a.focus();
14510
- } else {
14511
- (_b = inputRef.value) == null ? void 0 : _b.focus();
14512
- }
14569
+ const focusInput = () => {
14570
+ setTimeout(() => {
14571
+ var _a, _b, _c;
14572
+ if (!inputSearch.value && !allowCreate.value) {
14573
+ (_a = searchRef.value) == null ? void 0 : _a.focus();
14574
+ } else {
14575
+ if (multipleMode.value === "tag") {
14576
+ (_b = selectTagInputRef.value) == null ? void 0 : _b.focus();
14577
+ } else {
14578
+ (_c = inputRef.value) == null ? void 0 : _c.focus();
14579
+ }
14580
+ }
14581
+ }, 0);
14513
14582
  };
14514
14583
  const handleClear = (e) => {
14515
14584
  e.stopPropagation();
@@ -14535,7 +14604,7 @@ var Component$j = defineComponent({
14535
14604
  });
14536
14605
  }
14537
14606
  emitChange(selected.value.map((item) => item.value));
14538
- focus();
14607
+ focusInput();
14539
14608
  };
14540
14609
  const handleScroll = (e) => {
14541
14610
  const {
@@ -14573,6 +14642,8 @@ var Component$j = defineComponent({
14573
14642
  };
14574
14643
  const handleKeydown = (e) => {
14575
14644
  var _a, _b;
14645
+ if (!triggerRef.value.contains(e.target) && !contentRef.value.contains(e.target))
14646
+ return;
14576
14647
  const availableOptions = options.value.filter((option) => !option.disabled && option.visible);
14577
14648
  const index = availableOptions.findIndex((option) => option.value === activeOptionValue.value);
14578
14649
  if (!availableOptions.length || index === -1)
@@ -14591,7 +14662,7 @@ var Component$j = defineComponent({
14591
14662
  break;
14592
14663
  }
14593
14664
  case "Backspace": {
14594
- if (!multiple.value || !selected.value.length || searchKey.value.length)
14665
+ if (!multiple.value || !selected.value.length || searchKey.value.length || e.target === searchRef.value)
14595
14666
  return;
14596
14667
  selected.value.pop();
14597
14668
  emitChange(selected.value.map((item) => item.value));
@@ -14637,6 +14708,10 @@ var Component$j = defineComponent({
14637
14708
  setTimeout(() => {
14638
14709
  showOnInit.value && showPopover();
14639
14710
  });
14711
+ on$2(document, "keydown", handleKeydown);
14712
+ });
14713
+ onBeforeMount(() => {
14714
+ off$2(document, "keydown", handleKeydown);
14640
14715
  });
14641
14716
  return {
14642
14717
  selected,
@@ -14649,6 +14724,8 @@ var Component$j = defineComponent({
14649
14724
  popperWidth,
14650
14725
  inputRef,
14651
14726
  triggerRef,
14727
+ contentRef,
14728
+ searchRef,
14652
14729
  selectTagInputRef,
14653
14730
  searchLoading,
14654
14731
  isOptionsEmpty,
@@ -14661,6 +14738,7 @@ var Component$j = defineComponent({
14661
14738
  setHover,
14662
14739
  cancelHover,
14663
14740
  handleFocus,
14741
+ handleBlur,
14664
14742
  handleTogglePopover,
14665
14743
  handleClear,
14666
14744
  hidePopover,
@@ -14725,7 +14803,6 @@ var Component$j = defineComponent({
14725
14803
  "tagTheme": this.tagTheme,
14726
14804
  "placeholder": this.placeholder,
14727
14805
  "filterable": this.isInput,
14728
- "onFocus": this.handleFocus,
14729
14806
  "onRemove": this.handleDeleteTag,
14730
14807
  "onEnter": this.handleInputEnter
14731
14808
  }, {
@@ -14746,10 +14823,8 @@ var Component$j = defineComponent({
14746
14823
  "disabled": this.isDisabled,
14747
14824
  "behavior": this.behavior,
14748
14825
  "size": this.size,
14749
- "onFocus": this.handleFocus,
14750
14826
  "onInput": this.handleInputChange,
14751
- "onEnter": this.handleInputEnter,
14752
- "onKeydown": (_2, e) => this.handleKeydown(e)
14827
+ "onEnter": this.handleInputEnter
14753
14828
  }, {
14754
14829
  prefix: () => {
14755
14830
  var _a, _b;
@@ -14763,14 +14838,25 @@ var Component$j = defineComponent({
14763
14838
  "ref": "triggerRef",
14764
14839
  "onClick": this.handleTogglePopover,
14765
14840
  "onMouseenter": this.setHover,
14766
- "onMouseleave": this.cancelHover,
14767
- "onKeydown": this.handleKeydown
14841
+ "onMouseleave": this.cancelHover
14768
14842
  }, [renderTriggerInput()]);
14769
14843
  const renderSelectContent = () => {
14770
14844
  var _a, _b;
14771
14845
  return createVNode("div", {
14772
- "class": "bk-select-content"
14773
- }, [!this.isShowSelectContent && createVNode("div", {
14846
+ "class": "bk-select-content",
14847
+ "ref": "contentRef"
14848
+ }, [this.filterable && !this.inputSearch && createVNode("div", {
14849
+ "class": "bk-select-search-wrapper"
14850
+ }, [createVNode(search, {
14851
+ "class": "icon-search",
14852
+ "width": 16,
14853
+ "height": 16
14854
+ }, null), withDirectives(createVNode("input", {
14855
+ "ref": "searchRef",
14856
+ "class": "bk-select-search-input",
14857
+ "placeholder": this.searchPlaceholder,
14858
+ "onUpdate:modelValue": ($event) => this.searchKey = $event
14859
+ }, null), [[vModelText, this.searchKey]])]), !this.isShowSelectContent && createVNode("div", {
14774
14860
  "class": "bk-select-empty"
14775
14861
  }, [this.searchLoading && createVNode(BkLoading, {
14776
14862
  "class": "mr5",
@@ -15494,7 +15580,7 @@ var EMITEVENTS = /* @__PURE__ */ ((EMITEVENTS2) => {
15494
15580
  EMITEVENTS2["COLUMN_SORT"] = "columnSort";
15495
15581
  EMITEVENTS2["COLUMN_FILTER"] = "columnFilter";
15496
15582
  EMITEVENTS2["ROW_CLICK"] = "rowClick";
15497
- EMITEVENTS2["ROW_DBL_CLICK"] = "rowDblClick";
15583
+ EMITEVENTS2["ROW_DBL_CLICK"] = "rowDblclick";
15498
15584
  EMITEVENTS2["ROW_EXPAND_CLICK"] = "rowExpand";
15499
15585
  EMITEVENTS2["PAGE_LIMIT_CHANGE"] = "pageLimitChange";
15500
15586
  EMITEVENTS2["PAGE_VALUE_CHANGE"] = "pageValueChange";
@@ -15508,7 +15594,7 @@ const EMIT_EVENT_TYPES = {
15508
15594
  ["columnFilter"]: EMPTY$1,
15509
15595
  ["columnSort"]: EMPTY$1,
15510
15596
  ["rowClick"]: EMPTY$1,
15511
- ["rowDblClick"]: EMPTY$1,
15597
+ ["rowDblclick"]: EMPTY$1,
15512
15598
  ["rowExpand"]: EMPTY$1,
15513
15599
  ["pageLimitChange"]: EMPTY$1,
15514
15600
  ["pageValueChange"]: EMPTY$1,
@@ -16177,19 +16263,13 @@ var BodyEmpty = defineComponent({
16177
16263
  emptyText: PropTypes.string.def("\u6682\u65E0\u6570\u636E")
16178
16264
  },
16179
16265
  emits: ["change"],
16180
- setup(props2, {
16181
- slots
16182
- }) {
16266
+ setup(props2) {
16183
16267
  const type = computed(() => props2.list.length === 0 ? "empty" : "search-empty");
16184
16268
  return () => createVNode(BkException, {
16185
16269
  "scene": "part",
16186
- "type": type.value
16187
- }, {
16188
- default: () => {
16189
- var _a, _b;
16190
- return [(_b = (_a = slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : props2.emptyText];
16191
- }
16192
- });
16270
+ "type": type.value,
16271
+ "description": props2.emptyText
16272
+ }, null);
16193
16273
  }
16194
16274
  });
16195
16275
  const resolvePropVal = (prop, key2, args) => {
@@ -16940,14 +17020,14 @@ class TableRender {
16940
17020
  Object.assign(this.props.pagination, {
16941
17021
  limit
16942
17022
  });
16943
- this.context.emit("pageLimitChange", limit);
17023
+ this.context.emit(EMITEVENTS.PAGE_LIMIT_CHANGE, limit);
16944
17024
  }
16945
17025
  hanlePageChange(current) {
16946
17026
  Object.assign(this.props.pagination, {
16947
17027
  current,
16948
17028
  value: current
16949
17029
  });
16950
- this.context.emit("pageValueChange", current);
17030
+ this.context.emit(EMITEVENTS.PAGE_VALUE_CHANGE, current);
16951
17031
  }
16952
17032
  setColumnActive(index, single = false) {
16953
17033
  const col = this.propActiveCols.find((item) => item.index === index);
@@ -16965,7 +17045,7 @@ class TableRender {
16965
17045
  handleColumnHeadClick(index) {
16966
17046
  if (this.props.columnPick !== "disabled") {
16967
17047
  this.setColumnActive(index, this.props.columnPick === "single");
16968
- this.context.emit("column-pick", this.propActiveCols);
17048
+ this.context.emit(EMITEVENTS.COLUMN_PICK, this.propActiveCols);
16969
17049
  }
16970
17050
  }
16971
17051
  getSortCell(column, index) {
@@ -17120,10 +17200,10 @@ class TableRender {
17120
17200
  }
17121
17201
  }
17122
17202
  handleRowClick(e, row, index, rows) {
17123
- this.context.emit("rowClick", e, row, index, rows, this);
17203
+ this.context.emit(EMITEVENTS.ROW_CLICK, e, row, index, rows, this);
17124
17204
  }
17125
17205
  handleRowDblClick(e, row, index, rows) {
17126
- this.context.emit("rowDblClick", e, row, index, rows, this);
17206
+ this.context.emit(EMITEVENTS.ROW_DBL_CLICK, e, row, index, rows, this);
17127
17207
  }
17128
17208
  getExpandCell(row) {
17129
17209
  const isExpand = !!row[TABLE_ROW_ATTRIBUTE.ROW_EXPAND];
@@ -17830,11 +17910,9 @@ function useFlatList(props2) {
17830
17910
  displayKey,
17831
17911
  list
17832
17912
  } = toRefs(props2);
17833
- const state = reactive({
17834
- flatList: []
17835
- });
17913
+ const flatList = reactive([]);
17836
17914
  watch([useGroup, saveKey, displayKey, list], () => {
17837
- state.flatList = [];
17915
+ flatList.splice(0, flatList.length);
17838
17916
  let formatList = list.value;
17839
17917
  if (useGroup.value) {
17840
17918
  formatList = list.value.reduce((formatList2, item) => {
@@ -17850,9 +17928,17 @@ function useFlatList(props2) {
17850
17928
  return formatList2.concat(children);
17851
17929
  }, []);
17852
17930
  }
17853
- state.flatList = [...formatList];
17931
+ appendToTargetList(formatList);
17854
17932
  }, { immediate: true, deep: true });
17855
- return state.flatList;
17933
+ function appendToTargetList(targetList) {
17934
+ const QUANTUM = 3e4;
17935
+ const len = targetList.length;
17936
+ for (let i2 = 0; i2 < len; i2 += QUANTUM) {
17937
+ const appendList = targetList.slice(i2, Math.min(i2 + QUANTUM, len));
17938
+ flatList.push(...appendList);
17939
+ }
17940
+ }
17941
+ return flatList;
17856
17942
  }
17857
17943
  const getCharLength = (str) => {
17858
17944
  const len = str.length;
@@ -18019,7 +18105,9 @@ var Component$c = defineComponent({
18019
18105
  }));
18020
18106
  watch([() => [...props2.modelValue], () => [...props2.list]], () => {
18021
18107
  var _a;
18022
- initData();
18108
+ nextTick(() => {
18109
+ initData();
18110
+ });
18023
18111
  if (props2.withValidate) {
18024
18112
  (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change");
18025
18113
  }
@@ -26108,9 +26196,10 @@ const BkDropdown = withInstallProps(Dropdown, { DropdownMenu, DropdownItem });
26108
26196
  var CascaderPanel = defineComponent({
26109
26197
  name: "CascaderPanel",
26110
26198
  props: {
26111
- store: PropTypes.object.def({})
26199
+ store: PropTypes.object.def({}),
26200
+ modelValue: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number).def([]), PropTypes.arrayOf(PropTypes.string).def([])])
26112
26201
  },
26113
- emits: ["input"],
26202
+ emits: ["update:modelValue"],
26114
26203
  setup(props2, {
26115
26204
  emit
26116
26205
  }) {
@@ -26122,24 +26211,25 @@ var CascaderPanel = defineComponent({
26122
26211
  });
26123
26212
  const activePath = ref([]);
26124
26213
  const checkValue = ref([]);
26125
- const nodeCheckHandler = (node) => {
26126
- if (node.config.multiple) {
26127
- checkValue.value = store.getCheckedNodes().map((node2) => node2.path);
26128
- } else {
26129
- checkValue.value = node.path;
26214
+ const updateCheckValue = (value) => {
26215
+ if (value.length === 0) {
26216
+ menus.list = menus.list.slice(0, 1);
26217
+ activePath.value = [];
26130
26218
  }
26131
- emit("input", checkValue.value);
26132
- };
26133
- const nodeClear = () => {
26134
- emit("input", []);
26135
- };
26136
- const syncCheckedValue = (value) => {
26137
26219
  value.forEach((id) => {
26138
26220
  const node = store.getNodeById(id);
26139
26221
  nodeExpandHandler(node);
26140
26222
  });
26141
26223
  checkValue.value = value;
26142
26224
  };
26225
+ const nodeCheckHandler = (node) => {
26226
+ if (node.config.multiple) {
26227
+ checkValue.value = store.getCheckedNodes().map((node2) => node2.path);
26228
+ } else {
26229
+ checkValue.value = node.path;
26230
+ }
26231
+ emit("update:modelValue", checkValue.value);
26232
+ };
26143
26233
  const nodeExpandHandler = (node) => {
26144
26234
  var _a;
26145
26235
  if (node.isDisabled)
@@ -26204,6 +26294,11 @@ var CascaderPanel = defineComponent({
26204
26294
  }, null) : createVNode(angleRight, {
26205
26295
  "class": "icon-angle-right"
26206
26296
  }, null);
26297
+ watch(() => props2.modelValue, (value) => {
26298
+ updateCheckValue(value);
26299
+ }, {
26300
+ immediate: true
26301
+ });
26207
26302
  return {
26208
26303
  menus,
26209
26304
  activePath,
@@ -26212,10 +26307,8 @@ var CascaderPanel = defineComponent({
26212
26307
  nodeEvent,
26213
26308
  isCheckedNode,
26214
26309
  checkValue,
26215
- nodeClear,
26216
26310
  checkNode,
26217
- iconRender,
26218
- syncCheckedValue
26311
+ iconRender
26219
26312
  };
26220
26313
  },
26221
26314
  render() {
@@ -26375,13 +26468,18 @@ var Component$6 = defineComponent({
26375
26468
  const panelShow = ref(false);
26376
26469
  const selectedText = ref("");
26377
26470
  const selectedTags = ref([]);
26378
- const checkedValue = ref(props2.modelValue);
26471
+ const {
26472
+ modelValue
26473
+ } = toRefs(props2);
26379
26474
  const cascaderPanel = ref();
26380
- watch(() => props2.modelValue, (value) => {
26381
- updateValue(value);
26475
+ const checkedValue = computed({
26476
+ get: () => modelValue.value,
26477
+ set: (value) => {
26478
+ emit("update:modelValue", value);
26479
+ }
26382
26480
  });
26481
+ const popover3 = ref(null);
26383
26482
  const updateValue = (val) => {
26384
- cascaderPanel.value.syncCheckedValue(val);
26385
26483
  if (multiple) {
26386
26484
  selectedTags.value = store.getCheckedNodes().map((node) => ({
26387
26485
  text: node.pathNames.join(separator2),
@@ -26396,17 +26494,13 @@ var Component$6 = defineComponent({
26396
26494
  selectedText.value = node.pathNames.join(separator2);
26397
26495
  }
26398
26496
  };
26399
- const inputChangeHandler = (val) => {
26400
- updateValue(val);
26401
- emit("update:modelValue", val);
26402
- emit("change", val);
26403
- };
26404
26497
  const hidePopover = () => {
26405
26498
  panelShow.value = false;
26406
26499
  };
26407
26500
  const handleClear = (e) => {
26408
26501
  e.stopPropagation();
26409
26502
  updateValue([]);
26503
+ emit("update:modelValue", []);
26410
26504
  emit("clear", JSON.parse(JSON.stringify(props2.modelValue)));
26411
26505
  };
26412
26506
  const inputClickHandler = (e) => {
@@ -26420,6 +26514,15 @@ var Component$6 = defineComponent({
26420
26514
  current.splice(index, 1);
26421
26515
  updateValue(current);
26422
26516
  };
26517
+ watch(() => props2.modelValue, (value) => {
26518
+ var _a;
26519
+ updateValue(value);
26520
+ (_a = popover3 == null ? void 0 : popover3.value) == null ? void 0 : _a.handlePopShow(false);
26521
+ emit("update:modelValue", value);
26522
+ emit("change", value);
26523
+ }, {
26524
+ immediate: true
26525
+ });
26423
26526
  return {
26424
26527
  store,
26425
26528
  updateValue,
@@ -26431,10 +26534,10 @@ var Component$6 = defineComponent({
26431
26534
  handleClear,
26432
26535
  isHover,
26433
26536
  setHover,
26537
+ popover: popover3,
26434
26538
  cancelHover,
26435
26539
  selectedTags,
26436
26540
  removeTag,
26437
- inputChangeHandler,
26438
26541
  cascaderPanel
26439
26542
  };
26440
26543
  },
@@ -26468,7 +26571,8 @@ var Component$6 = defineComponent({
26468
26571
  return createVNode("div", {
26469
26572
  "class": ["bk-cascader", "bk-cascader-wrapper", this.extCls, {
26470
26573
  "bk-is-show-panel": this.panelShow,
26471
- "is-unselected": this.modelValue.length === 0
26574
+ "is-unselected": this.modelValue.length === 0,
26575
+ "is-hover": this.isHover
26472
26576
  }],
26473
26577
  "tabindex": "0",
26474
26578
  "data-placeholder": this.placeholder,
@@ -26482,6 +26586,7 @@ var Component$6 = defineComponent({
26482
26586
  "class": "bk-cascader-popover-wrapper",
26483
26587
  "isShow": this.panelShow,
26484
26588
  "onUpdate:isShow": ($event) => this.panelShow = $event,
26589
+ "ref": "popover",
26485
26590
  "boundary": "body"
26486
26591
  }, {
26487
26592
  default: () => createVNode("div", {
@@ -26497,7 +26602,8 @@ var Component$6 = defineComponent({
26497
26602
  }, [createVNode(CascaderPanel, {
26498
26603
  "store": this.store,
26499
26604
  "ref": "cascaderPanel",
26500
- "onInput": (val) => this.inputChangeHandler(val)
26605
+ "modelValue": this.checkedValue,
26606
+ "onUpdate:modelValue": ($event) => this.checkedValue = $event
26501
26607
  }, null)])
26502
26608
  })]);
26503
26609
  }