bkui-vue 0.0.1-beta.24 → 0.0.1-beta.27

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 (46) hide show
  1. package/dist/bkui-vue.cjs.js +434 -303
  2. package/dist/bkui-vue.esm.js +435 -304
  3. package/dist/bkui-vue.umd.js +434 -303
  4. package/dist/style.css +377 -70
  5. package/lib/loading/index.js +1 -1
  6. package/lib/loading/loading.css +2 -0
  7. package/lib/loading/loading.d.ts +1 -0
  8. package/lib/loading/loading.less +2 -0
  9. package/lib/loading/loading.variable.css +2 -0
  10. package/lib/pagination/index.d.ts +3 -3
  11. package/lib/pagination/index.js +1 -1
  12. package/lib/pagination/pagination.d.ts +1 -1
  13. package/lib/pagination/type.d.ts +1 -1
  14. package/lib/popover/index.js +1 -1
  15. package/lib/resize-layout/index.d.ts +336 -0
  16. package/lib/resize-layout/index.js +1 -0
  17. package/lib/resize-layout/resize-layout.css +189 -0
  18. package/lib/resize-layout/resize-layout.d.ts +127 -0
  19. package/lib/resize-layout/resize-layout.less +233 -0
  20. package/lib/resize-layout/resize-layout.variable.css +282 -0
  21. package/lib/select/common.d.ts +23 -27
  22. package/lib/select/index.d.ts +530 -145
  23. package/lib/select/index.js +12 -12
  24. package/lib/select/optionGroup.d.ts +0 -76
  25. package/lib/select/select.css +154 -44
  26. package/lib/select/select.d.ts +150 -39
  27. package/lib/select/select.less +131 -75
  28. package/lib/select/select.variable.css +154 -44
  29. package/lib/select/type.d.ts +31 -0
  30. package/lib/styles/index.d.ts +1 -0
  31. package/lib/styles/index.js +1 -1
  32. package/lib/swiper/index.js +1 -1
  33. package/lib/swiper/swiper.css +14 -14
  34. package/lib/swiper/swiper.less +93 -77
  35. package/lib/swiper/swiper.variable.css +14 -14
  36. package/lib/table/table.css +1 -1
  37. package/lib/table/table.less +1 -1
  38. package/lib/table/table.variable.css +1 -1
  39. package/lib/tag/index.js +1 -1
  40. package/lib/tag/tag.css +11 -5
  41. package/lib/tag/tag.less +12 -5
  42. package/lib/tag/tag.variable.css +11 -5
  43. package/lib/tree/tree.css +6 -6
  44. package/lib/tree/tree.less +7 -6
  45. package/lib/tree/tree.variable.css +6 -6
  46. package/package.json +3 -3
@@ -81,6 +81,7 @@ var __publicField = (obj, key, value) => {
81
81
  var transfer = "";
82
82
  var pagination = "";
83
83
  var timeline = "";
84
+ var resizeLayout = "";
84
85
  const BKLAYERD_INDEX_EFAULT_VALUE = {
85
86
  ["bottom"]: 0,
86
87
  ["content"]: 1,
@@ -8446,6 +8447,7 @@ ${$(r2)}`), n2;
8446
8447
  })(BkLoadingMode || (BkLoadingMode = {}));
8447
8448
  let BkLoadingSize;
8448
8449
  (function(BkLoadingSize2) {
8450
+ BkLoadingSize2["Normal"] = "";
8449
8451
  BkLoadingSize2["Mini"] = "mini";
8450
8452
  BkLoadingSize2["Small"] = "small";
8451
8453
  BkLoadingSize2["Large"] = "large";
@@ -8461,7 +8463,7 @@ ${$(r2)}`), n2;
8461
8463
  loading: PropTypes.bool,
8462
8464
  theme: PropTypes.theme(["white", "primary", "warning", "success", "danger"]),
8463
8465
  title: PropTypes.string.def(""),
8464
- size: PropTypes.commonType(Object.values(BkLoadingSize)).def("small"),
8466
+ size: PropTypes.commonType(Object.values(BkLoadingSize)).def(BkLoadingSize.Normal),
8465
8467
  mode: PropTypes.commonType(Object.values(BkLoadingMode)).def("default")
8466
8468
  };
8467
8469
  var Component$r = vue.defineComponent({
@@ -9528,8 +9530,9 @@ ${$(r2)}`), n2;
9528
9530
  };
9529
9531
  });
9530
9532
  const handleManualShow = (val) => {
9533
+ var _a, _b;
9531
9534
  if (trigger.value === "manual" && isPopInstance) {
9532
- val ? popoverInstance.show() : popoverInstance.hide();
9535
+ val ? (_a = popoverInstance.show) == null ? void 0 : _a.call(popoverInstance) : (_b = popoverInstance.hide) == null ? void 0 : _b.call(popoverInstance);
9533
9536
  }
9534
9537
  };
9535
9538
  vue.watch(() => props.isShow, (val) => {
@@ -9606,7 +9609,7 @@ ${$(r2)}`), n2;
9606
9609
  "ref": refContent,
9607
9610
  "class": contentClass,
9608
9611
  "style": compStyle.value
9609
- }, customTheme), [(_c = (_b2 = (_a2 = ctx.slots).content) == null ? void 0 : _b2.call(_a2)) != null ? _c : content.value, arrow2 && vue.createVNode("div", {
9612
+ }, customTheme), [(_c = (_b2 = (_a2 = ctx.slots).content) == null ? void 0 : _b2.call(_a2)) != null ? _c : content.value, arrow2.value && vue.createVNode("div", {
9610
9613
  "class": "arrow",
9611
9614
  "data-popper-arrow": true
9612
9615
  }, null)])];
@@ -10358,22 +10361,79 @@ ${$(r2)}`), n2;
10358
10361
  cancelHover
10359
10362
  };
10360
10363
  }
10364
+ function useRegistry(data2) {
10365
+ const register = (item) => {
10366
+ if (!item)
10367
+ return;
10368
+ return data2.value.add(item);
10369
+ };
10370
+ const unregister = (item) => data2.value.delete(item);
10371
+ return {
10372
+ register,
10373
+ unregister
10374
+ };
10375
+ }
10361
10376
  function useDebouncedRef(value, delay = 200) {
10362
10377
  let timeout;
10378
+ let innerValue = value;
10363
10379
  return vue.customRef((track, trigger) => ({
10364
10380
  get() {
10365
10381
  track();
10366
- return value;
10382
+ return innerValue;
10367
10383
  },
10368
10384
  set(newValue) {
10369
10385
  clearTimeout(timeout);
10370
10386
  timeout = setTimeout(() => {
10371
- value = newValue;
10387
+ innerValue = newValue;
10372
10388
  trigger();
10373
10389
  }, delay);
10374
10390
  }
10375
10391
  }));
10376
10392
  }
10393
+ function usePopover(config) {
10394
+ const { popoverMinWidth } = config;
10395
+ const popperWidth = vue.ref("auto");
10396
+ const isPopoverShow = vue.ref(false);
10397
+ const onPopoverFirstUpdate = (instance) => {
10398
+ const { reference: reference2 } = instance.elements;
10399
+ popperWidth.value = Math.max(reference2.offsetWidth, popoverMinWidth);
10400
+ };
10401
+ const togglePopover = () => {
10402
+ isPopoverShow.value = !isPopoverShow.value;
10403
+ };
10404
+ const hidePopover = () => {
10405
+ isPopoverShow.value = false;
10406
+ };
10407
+ const showPopover = () => {
10408
+ isPopoverShow.value = true;
10409
+ };
10410
+ return {
10411
+ isPopoverShow,
10412
+ popperWidth,
10413
+ togglePopover,
10414
+ onPopoverFirstUpdate,
10415
+ hidePopover,
10416
+ showPopover
10417
+ };
10418
+ }
10419
+ function useRemoteSearch(method) {
10420
+ const searchKey = useDebouncedRef("");
10421
+ const searchLoading = vue.ref(false);
10422
+ vue.watch(searchKey, async () => {
10423
+ searchLoading.value = true;
10424
+ await method(searchKey.value);
10425
+ searchLoading.value = false;
10426
+ });
10427
+ return {
10428
+ searchKey,
10429
+ searchLoading
10430
+ };
10431
+ }
10432
+ function toLowerCase(value = "") {
10433
+ if (!value)
10434
+ return value;
10435
+ return String(value).trim().toLowerCase();
10436
+ }
10377
10437
  var BkOption = vue.defineComponent({
10378
10438
  name: "Option",
10379
10439
  props: {
@@ -10389,28 +10449,12 @@ ${$(r2)}`), n2;
10389
10449
  visible: true
10390
10450
  });
10391
10451
  const {
10392
- disabled,
10393
- label
10452
+ disabled
10394
10453
  } = vue.toRefs(props);
10395
10454
  const select2 = vue.inject(selectKey, null);
10396
10455
  const group = vue.inject(optionGroupKey, null);
10397
10456
  const selected = vue.computed(() => select2.selectedOptions.has(proxy));
10398
10457
  const multiple = vue.computed(() => select2 == null ? void 0 : select2.props.multiple);
10399
- vue.watchEffect(() => {
10400
- var _a;
10401
- if (group == null ? void 0 : group.groupCollapse) {
10402
- states.visible = false;
10403
- } else if (!(select2 == null ? void 0 : select2.isRemoteSearch) && (select2 == null ? void 0 : select2.searchKey)) {
10404
- states.visible = (_a = toLowerCase(String(label.value))) == null ? void 0 : _a.includes(toLowerCase(select2 == null ? void 0 : select2.searchKey));
10405
- } else {
10406
- states.visible = true;
10407
- }
10408
- });
10409
- const toLowerCase = (value = "") => {
10410
- if (!value)
10411
- return value;
10412
- return String(value).trim().toLowerCase();
10413
- };
10414
10458
  const handleOptionClick = () => {
10415
10459
  if (disabled.value)
10416
10460
  return;
@@ -10418,9 +10462,11 @@ ${$(r2)}`), n2;
10418
10462
  };
10419
10463
  vue.onBeforeMount(() => {
10420
10464
  select2 == null ? void 0 : select2.register(proxy);
10465
+ group == null ? void 0 : group.register(proxy);
10421
10466
  });
10422
10467
  vue.onBeforeUnmount(() => {
10423
10468
  select2 == null ? void 0 : select2.unregister(proxy);
10469
+ group == null ? void 0 : group.unregister(proxy);
10424
10470
  });
10425
10471
  return __spreadProps(__spreadValues({}, vue.toRefs(states)), {
10426
10472
  selected,
@@ -10454,41 +10500,38 @@ ${$(r2)}`), n2;
10454
10500
  setup(props, {
10455
10501
  emit
10456
10502
  }) {
10457
- const children = vue.ref([]);
10458
- const instance = vue.getCurrentInstance();
10503
+ const {
10504
+ proxy
10505
+ } = vue.getCurrentInstance();
10506
+ const select2 = vue.inject(selectKey, null);
10459
10507
  const states = vue.reactive({
10460
10508
  groupCollapse: props.collapse,
10461
10509
  visible: true
10462
10510
  });
10463
- const groupLabel = vue.computed(() => `${props.label} (${children.value.filter((option) => option.visible).length})`);
10464
- vue.provide(optionGroupKey, vue.reactive(__spreadProps(__spreadValues({}, vue.toRefs(props)), {
10465
- groupCollapse: vue.toRef(states, "groupCollapse")
10466
- })));
10467
- const flattedChildren = (node) => {
10468
- const children2 = [];
10469
- if (Array.isArray(node.children)) {
10470
- node.children.forEach((child) => {
10471
- var _a;
10472
- if (child.type && child.type.name === "Option" && child.component && child.component.proxy) {
10473
- children2.push(child.component.proxy);
10474
- } else if ((_a = child.children) == null ? void 0 : _a.length) {
10475
- children2.push(...flattedChildren(child));
10476
- }
10477
- });
10478
- }
10479
- return children2;
10480
- };
10511
+ const options = vue.ref(/* @__PURE__ */ new Set());
10512
+ const {
10513
+ register,
10514
+ unregister
10515
+ } = useRegistry(options);
10516
+ const groupLabel = vue.computed(() => `${props.label} (${[...options.value.values()].filter((option) => option.visible).length})`);
10481
10517
  const handleToggleCollapse = () => {
10482
- if (!props.collapsible)
10518
+ if (!props.collapsible || props.disabled)
10483
10519
  return;
10484
10520
  states.groupCollapse = !states.groupCollapse;
10485
10521
  emit("update:collapse", states.groupCollapse);
10486
10522
  };
10487
- vue.onMounted(() => {
10488
- children.value = flattedChildren(instance.subTree);
10523
+ vue.provide(optionGroupKey, vue.reactive(__spreadProps(__spreadValues({}, vue.toRefs(props)), {
10524
+ register,
10525
+ unregister,
10526
+ groupCollapse: vue.toRef(states, "groupCollapse")
10527
+ })));
10528
+ vue.onBeforeMount(() => {
10529
+ select2 == null ? void 0 : select2.registerGroup(proxy);
10530
+ });
10531
+ vue.onBeforeUnmount(() => {
10532
+ select2 == null ? void 0 : select2.unregisterGroup(proxy);
10489
10533
  });
10490
10534
  return __spreadProps(__spreadValues({}, vue.toRefs(states)), {
10491
- children,
10492
10535
  groupLabel,
10493
10536
  handleToggleCollapse
10494
10537
  });
@@ -10497,7 +10540,8 @@ ${$(r2)}`), n2;
10497
10540
  var _a, _b;
10498
10541
  const groupClass = classes({
10499
10542
  "bk-option-group": true,
10500
- collapsible: this.collapsible
10543
+ collapsible: this.collapsible,
10544
+ disabled: this.disabled
10501
10545
  });
10502
10546
  const groupLabelClass = classes({
10503
10547
  "bk-option-group-label": true,
@@ -10514,13 +10558,13 @@ ${$(r2)}`), n2;
10514
10558
  "onClick": this.handleToggleCollapse
10515
10559
  }, [this.$slots.label ? this.$slots.label() : vue.createVNode("span", {
10516
10560
  "class": "default-group-label"
10517
- }, [this.collapsible ? vue.createVNode(angleUpFill, {
10561
+ }, [this.collapsible && vue.createVNode(angleUpFill, {
10518
10562
  "class": groupLabelIconClass
10519
- }, null) : null, vue.createVNode("span", {
10563
+ }, null), vue.createVNode("span", {
10520
10564
  "class": "default-group-label-title"
10521
- }, [this.groupLabel])])]), vue.createVNode("ul", {
10565
+ }, [this.groupLabel])])]), vue.withDirectives(vue.createVNode("ul", {
10522
10566
  "class": "bk-option-group-content"
10523
- }, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)])]), [[vue.vShow, this.visible]]);
10567
+ }, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]), [[vue.vShow, !this.groupCollapse]])]), [[vue.vShow, this.visible]]);
10524
10568
  }
10525
10569
  });
10526
10570
  var _populated = false;
@@ -10922,6 +10966,69 @@ ${$(r2)}`), n2;
10922
10966
  }
10923
10967
  }
10924
10968
  var Component$b = vue.defineComponent({
10969
+ name: "Tag",
10970
+ props: {
10971
+ theme: PropTypes.theme(["success", "info", "warning", "danger"]).def(""),
10972
+ closable: PropTypes.bool.def(false),
10973
+ type: PropTypes.commonType(["", "filled", "stroke"]).def(""),
10974
+ checkable: PropTypes.bool.def(false),
10975
+ checked: PropTypes.bool.def(false),
10976
+ radius: PropTypes.string.def("2px"),
10977
+ extCls: PropTypes.string.def("")
10978
+ },
10979
+ emits: ["change", "close"],
10980
+ slots: ["icon"],
10981
+ setup(props, {
10982
+ emit
10983
+ }) {
10984
+ const wrapperCls = vue.computed(() => classes({
10985
+ "bk-tag-closable": props.closable,
10986
+ "bk-tag-checkable": props.checkable,
10987
+ "bk-tag-check": props.checked,
10988
+ [`bk-tag-${props.type}`]: props.type,
10989
+ [`bk-tag-${props.theme}`]: props.theme,
10990
+ [props.extCls]: !!props.extCls
10991
+ }, "bk-tag"));
10992
+ const wrapperStyle = vue.computed(() => ({
10993
+ borderRadius: props.radius
10994
+ }));
10995
+ const handleClose = (e) => {
10996
+ e.preventDefault();
10997
+ e.stopPropagation();
10998
+ emit("close", e);
10999
+ };
11000
+ const handleClick = (e) => {
11001
+ e.preventDefault();
11002
+ e.stopPropagation();
11003
+ if (props.checkable) {
11004
+ emit("change", !props.checked);
11005
+ }
11006
+ };
11007
+ return {
11008
+ wrapperCls,
11009
+ wrapperStyle,
11010
+ handleClose,
11011
+ handleClick
11012
+ };
11013
+ },
11014
+ render() {
11015
+ var _a, _b;
11016
+ return vue.createVNode("div", {
11017
+ "class": this.wrapperCls,
11018
+ "style": this.wrapperStyle,
11019
+ "onClick": this.handleClick
11020
+ }, [this.$slots.icon ? vue.createVNode("span", {
11021
+ "class": "bk-tag-icon"
11022
+ }, [this.$slots.icon()]) : "", vue.createVNode("span", {
11023
+ "class": "bk-tag-text"
11024
+ }, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]), this.closable ? vue.createVNode(error, {
11025
+ "class": "bk-tag-close",
11026
+ "onClick": this.handleClose
11027
+ }, null) : ""]);
11028
+ }
11029
+ });
11030
+ const BkTag = withInstall(Component$b);
11031
+ var Component$a = vue.defineComponent({
10925
11032
  name: "Select",
10926
11033
  directives: {
10927
11034
  clickoutside: ClickOutside
@@ -10929,43 +11036,84 @@ ${$(r2)}`), n2;
10929
11036
  props: {
10930
11037
  modelValue: PropTypes.any,
10931
11038
  multiple: PropTypes.bool.def(false),
10932
- placeholder: PropTypes.string.def("\u8BF7\u9009\u62E9"),
10933
11039
  disabled: PropTypes.bool.def(false),
10934
- size: PropTypes.size().def("small"),
11040
+ size: PropTypes.size().def("default"),
10935
11041
  clearable: PropTypes.bool.def(true),
10936
11042
  loading: PropTypes.bool.def(false),
10937
11043
  filterable: PropTypes.bool.def(false),
10938
11044
  remoteMethod: PropTypes.func,
10939
- scrollHeight: PropTypes.number.def(216)
11045
+ scrollHeight: PropTypes.number.def(216),
11046
+ showSelectAll: PropTypes.bool.def(false),
11047
+ popoverMinWidth: PropTypes.number.def(0),
11048
+ showOnInit: PropTypes.bool.def(false),
11049
+ multipleMode: PropTypes.oneOf(["default", "tag"]).def("default"),
11050
+ tagTheme: PropTypes.theme(["success", "info", "warning", "danger"]).def(""),
11051
+ behavior: PropTypes.oneOf(["normal", "simplicity"]).def("normal"),
11052
+ collapseTags: PropTypes.bool.def(false),
11053
+ noDataText: PropTypes.string.def("\u65E0\u6570\u636E"),
11054
+ noMatchText: PropTypes.string.def("\u65E0\u5339\u914D\u6570\u636E"),
11055
+ loadingText: PropTypes.string.def("\u52A0\u8F7D\u4E2D..."),
11056
+ placeholder: PropTypes.string.def("\u8BF7\u9009\u62E9"),
11057
+ selectAllText: PropTypes.string.def("\u5168\u90E8")
10940
11058
  },
10941
- emits: ["update:modelValue", "change", "toggle"],
11059
+ emits: ["update:modelValue", "change", "toggle", "clear"],
10942
11060
  setup(props, {
10943
11061
  emit
10944
11062
  }) {
10945
11063
  const {
10946
11064
  modelValue,
10947
11065
  disabled,
10948
- size,
10949
11066
  filterable,
10950
11067
  placeholder,
10951
11068
  multiple,
10952
11069
  remoteMethod,
10953
- loading: loading2
11070
+ loading: loading2,
11071
+ loadingText,
11072
+ noDataText,
11073
+ noMatchText,
11074
+ popoverMinWidth,
11075
+ showOnInit
10954
11076
  } = vue.toRefs(props);
10955
11077
  const states = vue.reactive({
10956
11078
  currentPlaceholder: placeholder.value,
10957
- options: /* @__PURE__ */ new Set(),
10958
11079
  selectedOptions: /* @__PURE__ */ new Set(),
10959
11080
  currentSelectedLabel: ""
10960
11081
  });
10961
- const selectTriggerRef = vue.ref();
10962
11082
  const inputRef = vue.ref();
10963
- const register = (option) => {
10964
- if (!option)
10965
- return;
10966
- return states.options.add(option);
10967
- };
10968
- const unregister = (option) => states.options.delete(option);
11083
+ const popoverRef = vue.ref();
11084
+ const options = vue.ref(/* @__PURE__ */ new Set());
11085
+ const groups = vue.ref(/* @__PURE__ */ new Set());
11086
+ const isDisabled = vue.computed(() => disabled.value || loading2.value);
11087
+ const selectedLabel = vue.computed(() => [...states.selectedOptions.values()].map((option) => option.label));
11088
+ const isAllSelected = vue.computed(() => [...options.value.values()].filter((option) => !option.disabled).every((option) => states.selectedOptions.has(option)));
11089
+ const isGroup = vue.computed(() => !!groups.value.size);
11090
+ const isOptionsEmpty = vue.computed(() => !options.value.size);
11091
+ const isSearchEmpty = vue.computed(() => {
11092
+ const data2 = [...options.value.values()];
11093
+ return data2.length && data2.every((option) => !option.visible);
11094
+ });
11095
+ const isRemoteSearch = vue.computed(() => typeof remoteMethod.value === "function");
11096
+ const isShowSelectContent = vue.computed(() => !(searchLoading.value || isOptionsEmpty.value || isSearchEmpty.value));
11097
+ const curContentText = vue.computed(() => {
11098
+ if (searchLoading.value) {
11099
+ return loadingText.value;
11100
+ }
11101
+ if (isOptionsEmpty.value) {
11102
+ return noDataText.value;
11103
+ }
11104
+ if (isSearchEmpty.value) {
11105
+ return noMatchText.value;
11106
+ }
11107
+ return "";
11108
+ });
11109
+ const {
11110
+ register,
11111
+ unregister
11112
+ } = useRegistry(options);
11113
+ const {
11114
+ register: registerGroup,
11115
+ unregister: unregisterGroup
11116
+ } = useRegistry(groups);
10969
11117
  const {
10970
11118
  isHover,
10971
11119
  setHover,
@@ -10976,63 +11124,63 @@ ${$(r2)}`), n2;
10976
11124
  handleFocus,
10977
11125
  handleBlur
10978
11126
  } = useFocus();
10979
- const handleInput = (e) => {
10980
- searchKey.value = e.target.value;
10981
- };
10982
- const isDisabled = vue.computed(() => disabled.value || loading2.value);
10983
- const selectClass = vue.computed(() => ({
10984
- "bk-select": true,
10985
- "popover-show": isPopoverShow.value,
10986
- "is-disabled": isDisabled.value,
10987
- "is-focus": isFocus.value,
10988
- [size.value]: true
10989
- }));
10990
- const selectedLabel = vue.computed(() => [...states.selectedOptions.values()].map((option) => option.label).join(","));
10991
- const popperWidth = vue.ref("auto");
10992
- const onPopoverFirstUpdate = (instance) => {
10993
- const {
10994
- reference: reference2
10995
- } = instance.elements;
10996
- popperWidth.value = reference2.offsetWidth;
10997
- };
10998
- const isPopoverShow = vue.ref(false);
10999
- const toggleMenu = () => {
11000
- if (isDisabled.value)
11001
- return;
11002
- isPopoverShow.value = !isPopoverShow.value;
11003
- emit("toggle", isPopoverShow.value);
11004
- };
11005
- const hidePopover = () => {
11006
- isPopoverShow.value = false;
11007
- handleBlur();
11008
- };
11009
- const showPopover = () => {
11010
- isPopoverShow.value = true;
11011
- };
11012
- vue.watch(isPopoverShow, () => {
11013
- handleResetState();
11127
+ const {
11128
+ popperWidth,
11129
+ isPopoverShow,
11130
+ onPopoverFirstUpdate,
11131
+ hidePopover,
11132
+ showPopover,
11133
+ togglePopover
11134
+ } = usePopover({
11135
+ popoverMinWidth: popoverMinWidth.value
11014
11136
  });
11015
- const handleResetState = () => {
11016
- if (!isRemoteSearch.value || isRemoteSearch.value && !isPopoverShow.value) {
11017
- searchKey.value = "";
11018
- }
11137
+ const defaultSearchMethod = (value) => {
11138
+ options.value.forEach((option) => {
11139
+ var _a;
11140
+ option.visible = (_a = toLowerCase(String(option.label))) == null ? void 0 : _a.includes(toLowerCase(value));
11141
+ });
11142
+ };
11143
+ const {
11144
+ searchKey,
11145
+ searchLoading
11146
+ } = useRemoteSearch(isRemoteSearch.value ? remoteMethod.value : defaultSearchMethod);
11147
+ const handleResetInputValue = () => {
11148
+ const label = selectedLabel.value.join(",");
11019
11149
  if (filterable.value && isPopoverShow.value) {
11020
- states.currentPlaceholder = selectedLabel.value || placeholder.value;
11150
+ states.currentPlaceholder = label || placeholder.value;
11021
11151
  states.currentSelectedLabel = "";
11022
11152
  } else {
11023
11153
  states.currentPlaceholder = placeholder.value;
11024
- states.currentSelectedLabel = selectedLabel.value;
11154
+ states.currentSelectedLabel = label;
11155
+ searchKey.value = "";
11025
11156
  }
11026
11157
  };
11158
+ vue.watch(isPopoverShow, () => {
11159
+ handleResetInputValue();
11160
+ });
11027
11161
  const emitChange = (val) => {
11028
11162
  if (val === modelValue.value)
11029
11163
  return;
11030
11164
  emit("change", val);
11031
11165
  emit("update:modelValue", val);
11032
11166
  };
11033
- const handleOptionSelected = (option) => {
11167
+ const handleTogglePopover = () => {
11034
11168
  if (isDisabled.value)
11035
11169
  return;
11170
+ togglePopover();
11171
+ emit("toggle", isPopoverShow.value);
11172
+ };
11173
+ const handleInput = (e) => {
11174
+ searchKey.value = e.target.value;
11175
+ };
11176
+ const selectedCallback = () => {
11177
+ inputRef.value.focus();
11178
+ popoverRef.value.update();
11179
+ !searchKey.value && handleResetInputValue();
11180
+ };
11181
+ const handleOptionSelected = (option) => {
11182
+ if (isDisabled.value || !option)
11183
+ return;
11036
11184
  if (multiple.value) {
11037
11185
  if (states.selectedOptions.has(option)) {
11038
11186
  states.selectedOptions.delete(option);
@@ -11046,129 +11194,195 @@ ${$(r2)}`), n2;
11046
11194
  emitChange(option.value);
11047
11195
  hidePopover();
11048
11196
  }
11049
- inputRef.value.focus();
11050
- handleResetState();
11197
+ selectedCallback();
11051
11198
  };
11052
11199
  const handleClear = (e) => {
11053
11200
  e.stopPropagation();
11054
11201
  states.selectedOptions.clear();
11055
- emitChange(multiple.value ? [] : "");
11056
11202
  hidePopover();
11057
- handleResetState();
11203
+ handleResetInputValue();
11204
+ emitChange(multiple.value ? [] : "");
11205
+ emit("clear", multiple.value ? [] : "");
11058
11206
  };
11059
- const searchKey = useDebouncedRef("");
11060
- const isRemoteSearch = vue.computed(() => typeof remoteMethod.value === "function");
11061
- const searchLoading = vue.ref(false);
11062
- vue.watchEffect(async () => {
11063
- if (!isRemoteSearch.value || !isPopoverShow.value || !searchKey.value)
11064
- return;
11065
- try {
11066
- searchLoading.value = true;
11067
- await remoteMethod.value(searchKey.value);
11068
- } catch (e) {
11069
- console.error(e);
11070
- } finally {
11071
- searchLoading.value = false;
11207
+ const handleToggleAll = () => {
11208
+ if (isAllSelected.value) {
11209
+ states.selectedOptions.clear();
11210
+ } else {
11211
+ options.value.forEach((option) => {
11212
+ if (option.disabled || states.selectedOptions.has(option))
11213
+ return;
11214
+ states.selectedOptions.add(option);
11215
+ });
11072
11216
  }
11073
- });
11074
- const isEmpty2 = vue.computed(() => [...states.options.values()].every((option) => !option.visible));
11217
+ selectedCallback();
11218
+ emitChange([...states.selectedOptions.values()].map((option) => option.value));
11219
+ };
11220
+ const handleClickOutside = () => {
11221
+ hidePopover();
11222
+ handleBlur();
11223
+ };
11075
11224
  vue.provide(selectKey, vue.reactive({
11076
11225
  props,
11077
- searchKey,
11078
11226
  selectedOptions: vue.unref(states.selectedOptions),
11079
- isRemoteSearch,
11080
11227
  register,
11081
11228
  unregister,
11229
+ registerGroup,
11230
+ unregisterGroup,
11082
11231
  handleOptionSelected
11083
11232
  }));
11084
11233
  vue.onMounted(() => {
11085
11234
  const initializeValue = Array.isArray(modelValue.value) ? modelValue.value : [modelValue.value];
11086
- states.options.forEach((option) => {
11235
+ options.value.forEach((option) => {
11087
11236
  if (initializeValue.includes(option.value)) {
11088
11237
  states.selectedOptions.add(option);
11089
11238
  }
11090
11239
  });
11091
- handleResetState();
11240
+ handleResetInputValue();
11241
+ setTimeout(() => {
11242
+ showOnInit.value && showPopover();
11243
+ });
11092
11244
  });
11093
11245
  return __spreadProps(__spreadValues({}, vue.toRefs(states)), {
11246
+ options,
11247
+ isDisabled,
11094
11248
  selectedLabel,
11095
- selectClass,
11096
11249
  isPopoverShow,
11097
11250
  isHover,
11098
11251
  popperWidth,
11099
- selectTriggerRef,
11252
+ popoverRef,
11100
11253
  inputRef,
11101
- searchKey,
11102
11254
  searchLoading,
11103
- isEmpty: isEmpty2,
11255
+ isOptionsEmpty,
11256
+ isSearchEmpty,
11104
11257
  isFocus,
11258
+ isShowSelectContent,
11259
+ curContentText,
11260
+ isGroup,
11261
+ searchKey,
11105
11262
  setHover,
11106
11263
  cancelHover,
11107
11264
  handleFocus,
11108
11265
  handleInput,
11109
- toggleMenu,
11266
+ handleTogglePopover,
11110
11267
  handleClear,
11111
11268
  onPopoverFirstUpdate,
11112
11269
  hidePopover,
11113
- showPopover
11270
+ showPopover,
11271
+ handleToggleAll,
11272
+ handleOptionSelected,
11273
+ handleClickOutside
11114
11274
  });
11115
11275
  },
11116
11276
  render() {
11277
+ const selectClass = classes({
11278
+ "bk-select": true,
11279
+ "popover-show": this.isPopoverShow,
11280
+ "is-disabled": this.isDisabled,
11281
+ "is-focus": this.isFocus,
11282
+ "is-filterable": this.filterable,
11283
+ [this.size]: true,
11284
+ [this.behavior]: true
11285
+ });
11117
11286
  const modifiers = [{
11118
11287
  name: "offset",
11119
11288
  options: {
11120
11289
  offset: [0, 4]
11121
11290
  }
11122
11291
  }];
11123
- const renderSelectRightIcon = () => {
11124
- if (this.loading) {
11125
- return vue.createVNode(spinner, {
11126
- "class": "spinner"
11127
- }, null);
11128
- }
11129
- if (this.clearable && this.isHover) {
11130
- return vue.createVNode(close$1, {
11131
- "class": "clear-icon",
11132
- "onClick": this.handleClear
11292
+ const renderSelectTrigger = () => {
11293
+ var _a, _b;
11294
+ const suffixIcon = () => {
11295
+ if (this.loading) {
11296
+ return vue.createVNode(BkLoading, {
11297
+ "class": "spinner",
11298
+ "mode": "spin",
11299
+ "size": "mini"
11300
+ }, null);
11301
+ }
11302
+ if (this.clearable && this.isHover) {
11303
+ return vue.createVNode(close$1, {
11304
+ "class": "clear-icon",
11305
+ "onClick": this.handleClear
11306
+ }, null);
11307
+ }
11308
+ return vue.createVNode(angleUp, {
11309
+ "class": "angle-up"
11133
11310
  }, null);
11134
- }
11135
- return vue.createVNode(angleUp, {
11136
- "class": "angle-up"
11137
- }, null);
11138
- };
11139
- const renderEmptySelect = () => {
11140
- if (this.searchLoading) {
11141
- return vue.withDirectives(vue.createVNode("div", {
11142
- "class": "bk-select-empty"
11143
- }, [vue.createVNode(spinner, {
11144
- "class": "spinner"
11145
- }, null), vue.createTextVNode("\u52A0\u8F7D\u4E2D...")]), [[vue.vShow, this.searchLoading]]);
11146
- }
11147
- if (this.isEmpty) {
11148
- return vue.withDirectives(vue.createVNode("div", {
11149
- "class": "bk-select-empty"
11150
- }, [vue.createTextVNode("\u65E0\u5339\u914D\u6570\u636E")]), [[vue.vShow, this.isEmpty]]);
11151
- }
11152
- return null;
11311
+ };
11312
+ const renderTriggerInput = () => {
11313
+ if (this.multipleMode === "tag") {
11314
+ return vue.createVNode("div", {
11315
+ "class": "bk-select-tag"
11316
+ }, [[...this.selectedOptions.values()].map((option) => vue.createVNode(BkTag, {
11317
+ "closable": true,
11318
+ "style": {
11319
+ marginTop: "3px"
11320
+ },
11321
+ "theme": this.tagTheme,
11322
+ "onClose": () => this.handleOptionSelected(option)
11323
+ }, {
11324
+ default: () => [option.label]
11325
+ })), vue.withDirectives(vue.createVNode("input", {
11326
+ "class": "bk-select-tag-input",
11327
+ "ref": "inputRef",
11328
+ "type": "text",
11329
+ "placeholder": !this.selectedOptions.size ? this.placeholder : "",
11330
+ "readonly": !this.filterable || !this.isPopoverShow,
11331
+ "onUpdate:modelValue": ($event) => this.searchKey = $event,
11332
+ "onFocus": this.handleFocus
11333
+ }, null), [[vue.vModelText, this.searchKey]])]);
11334
+ }
11335
+ return vue.withDirectives(vue.createVNode("input", {
11336
+ "ref": "inputRef",
11337
+ "type": "text",
11338
+ "class": "bk-select-input",
11339
+ "style": {
11340
+ paddingLeft: this.$slots.prefixIcon ? "20px" : "10px"
11341
+ },
11342
+ "onUpdate:modelValue": ($event) => this.currentSelectedLabel = $event,
11343
+ "placeholder": this.currentPlaceholder,
11344
+ "readonly": !this.filterable || !this.isPopoverShow,
11345
+ "onFocus": this.handleFocus,
11346
+ "onInput": this.handleInput
11347
+ }, null), [[vue.vModelText, this.currentSelectedLabel]]);
11348
+ };
11349
+ return vue.createVNode("div", {
11350
+ "class": "bk-select-trigger",
11351
+ "onClick": this.handleTogglePopover,
11352
+ "onMouseenter": this.setHover,
11353
+ "onMouseleave": this.cancelHover
11354
+ }, [this.$slots.prefixIcon ? vue.createVNode("span", {
11355
+ "class": "bk-select-prefix"
11356
+ }, [(_b = (_a = this.$slots).prefixIcon) == null ? void 0 : _b.call(_a)]) : null, renderTriggerInput(), suffixIcon()]);
11153
11357
  };
11154
11358
  const renderSelectContent = () => {
11155
11359
  var _a, _b;
11156
- return vue.createVNode("div", null, [renderEmptySelect(), vue.withDirectives(vue.createVNode("div", {
11360
+ return vue.createVNode("div", null, [!this.isShowSelectContent && vue.createVNode("div", {
11361
+ "class": "bk-select-empty"
11362
+ }, [this.searchLoading && vue.createVNode(BkLoading, {
11363
+ "class": "mr5",
11364
+ "mode": "spin",
11365
+ "size": "mini"
11366
+ }, null), this.curContentText]), vue.createVNode("div", {
11157
11367
  "class": "bk-select-content"
11158
11368
  }, [vue.createVNode("div", {
11159
11369
  "class": "bk-select-dropdown",
11160
11370
  "style": {
11161
11371
  maxHeight: `${this.scrollHeight}px`
11162
11372
  }
11163
- }, [vue.createVNode("ul", {
11373
+ }, [vue.withDirectives(vue.createVNode("ul", {
11164
11374
  "class": "bk-select-options"
11165
- }, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)])]), this.$slots.extension ? vue.createVNode("div", {
11375
+ }, [this.multiple && this.showSelectAll && !this.searchKey && vue.createVNode("li", {
11376
+ "class": "bk-select-option",
11377
+ "onClick": this.handleToggleAll
11378
+ }, [this.selectAllText]), (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]), [[vue.vShow, this.isShowSelectContent]])]), this.$slots.extension && vue.createVNode("div", {
11166
11379
  "class": "bk-select-extension"
11167
- }, [this.$slots.extension()]) : null]), [[vue.vShow, !this.searchLoading && !this.isEmpty]])]);
11380
+ }, [this.$slots.extension()])])]);
11168
11381
  };
11169
11382
  return vue.withDirectives(vue.createVNode("div", {
11170
- "class": this.selectClass
11383
+ "class": selectClass
11171
11384
  }, [vue.createVNode(BkPopover, {
11385
+ "ref": "popoverRef",
11172
11386
  "theme": "light",
11173
11387
  "trigger": "manual",
11174
11388
  "width": this.popperWidth,
@@ -11178,35 +11392,12 @@ ${$(r2)}`), n2;
11178
11392
  "modifiers": modifiers,
11179
11393
  "handleFirstUpdate": this.onPopoverFirstUpdate
11180
11394
  }, {
11181
- default: () => {
11182
- var _a, _b;
11183
- return vue.createVNode("div", {
11184
- "class": "bk-select-trigger",
11185
- "ref": "selectTriggerRef",
11186
- "onClick": this.toggleMenu,
11187
- "onMouseenter": this.setHover,
11188
- "onMouseleave": this.cancelHover
11189
- }, [this.$slots.prefixIcon ? vue.createVNode("span", {
11190
- "class": "bk-select-prefix"
11191
- }, [(_b = (_a = this.$slots).prefixIcon) == null ? void 0 : _b.call(_a)]) : null, vue.withDirectives(vue.createVNode("input", {
11192
- "ref": "inputRef",
11193
- "type": "text",
11194
- "class": "bk-select-input",
11195
- "style": {
11196
- paddingLeft: this.$slots.prefixIcon ? "20px" : "10px"
11197
- },
11198
- "onUpdate:modelValue": ($event) => this.currentSelectedLabel = $event,
11199
- "placeholder": this.currentPlaceholder,
11200
- "readonly": !this.filterable || !this.isPopoverShow,
11201
- "onFocus": this.handleFocus,
11202
- "onInput": this.handleInput
11203
- }, null), [[vue.vModelText, this.currentSelectedLabel]]), renderSelectRightIcon()]);
11204
- },
11395
+ default: () => renderSelectTrigger(),
11205
11396
  content: () => renderSelectContent()
11206
- })]), [[vue.resolveDirective("clickoutside"), this.hidePopover]]);
11397
+ })]), [[vue.resolveDirective("clickoutside"), this.handleClickOutside]]);
11207
11398
  }
11208
11399
  });
11209
- const BkSelect = withInstallProps(Component$b, { Option: BkOption, Group: OptionGroup });
11400
+ const BkSelect = withInstallProps(Component$a, { Option: BkOption, Group: OptionGroup });
11210
11401
  function _isSlot$1(s2) {
11211
11402
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !vue.isVNode(s2);
11212
11403
  }
@@ -11216,7 +11407,7 @@ ${$(r2)}`), n2;
11216
11407
  const sliderPops = Object.assign({}, propsMixin);
11217
11408
  sliderPops.width.default = "400";
11218
11409
  sliderPops.height.default = "100%";
11219
- var Component$a = vue.defineComponent({
11410
+ var Component$9 = vue.defineComponent({
11220
11411
  name: "Sideslider",
11221
11412
  components: {
11222
11413
  BkModal,
@@ -11273,7 +11464,7 @@ ${$(r2)}`), n2;
11273
11464
  });
11274
11465
  }
11275
11466
  });
11276
- const BkSideslider = withInstall(Component$a);
11467
+ const BkSideslider = withInstall(Component$9);
11277
11468
  const stepsProps = {
11278
11469
  theme: PropTypes.theme().def("primary"),
11279
11470
  size: PropTypes.size(),
@@ -11287,7 +11478,7 @@ ${$(r2)}`), n2;
11287
11478
  steps: PropTypes.array.def([]),
11288
11479
  beforeChange: PropTypes.func
11289
11480
  };
11290
- var Component$9 = vue.defineComponent({
11481
+ var Component$8 = vue.defineComponent({
11291
11482
  name: "Steps",
11292
11483
  props: stepsProps,
11293
11484
  emits: ["update:curStep", "click"],
@@ -11423,8 +11614,8 @@ ${$(r2)}`), n2;
11423
11614
  })]);
11424
11615
  }
11425
11616
  });
11426
- const BkSteps = withInstall(Component$9);
11427
- var Component$8 = vue.defineComponent({
11617
+ const BkSteps = withInstall(Component$8);
11618
+ var Component$7 = vue.defineComponent({
11428
11619
  name: "Switcher",
11429
11620
  props: {
11430
11621
  theme: PropTypes.theme().def(""),
@@ -11518,7 +11709,7 @@ ${$(r2)}`), n2;
11518
11709
  }, [isChecked.value ? props.onText : props.offText]) : ""]);
11519
11710
  }
11520
11711
  });
11521
- const BkSwitcher = withInstall(Component$8);
11712
+ const BkSwitcher = withInstall(Component$7);
11522
11713
  const EventProps$1 = {
11523
11714
  onContentScroll: Function
11524
11715
  };
@@ -11622,7 +11813,7 @@ ${$(r2)}`), n2;
11622
11813
  }
11623
11814
  }
11624
11815
  };
11625
- var Component$7 = vue.defineComponent({
11816
+ var Component$6 = vue.defineComponent({
11626
11817
  name: "VirtualRender",
11627
11818
  directives: {
11628
11819
  bkVirtualRender: virtualRender
@@ -11769,7 +11960,7 @@ ${$(r2)}`), n2;
11769
11960
  };
11770
11961
  }
11771
11962
  });
11772
- const BkVirtualRender = withInstall(Component$7);
11963
+ const BkVirtualRender = withInstall(Component$6);
11773
11964
  const BORDER_OPRIONS = ["none", "row", "col", "outer"];
11774
11965
  const EventProps = {
11775
11966
  onRowClick: Function
@@ -11857,27 +12048,27 @@ ${$(r2)}`), n2;
11857
12048
  const {
11858
12049
  proxy
11859
12050
  } = vue.getCurrentInstance();
11860
- const localCurrent = vue.ref(proxy.modelValue);
12051
+ const localCurrent = vue.ref(1);
11861
12052
  const isPagePreDisabled = vue.computed(() => localCurrent.value === 1);
11862
- const isPageNextDisabled = vue.computed(() => localCurrent.value === proxy.pageNum);
12053
+ const isPageNextDisabled = vue.computed(() => localCurrent.value === proxy.totalPageNum);
11863
12054
  const showPreBatch = vue.ref(false);
11864
12055
  const showNextBatch = vue.ref(false);
11865
12056
  const list = vue.computed(() => {
11866
12057
  showPreBatch.value = false;
11867
12058
  showNextBatch.value = false;
11868
12059
  const stack = [];
11869
- if (proxy.pageNum <= PAGE_ITEMS_NUM) {
11870
- for (let i2 = 2; i2 <= proxy.pageNum - 1; i2++) {
12060
+ if (proxy.totalPageNum <= PAGE_ITEMS_NUM) {
12061
+ for (let i2 = 2; i2 <= proxy.totalPageNum - 1; i2++) {
11871
12062
  stack.push(i2);
11872
12063
  }
11873
12064
  return stack;
11874
12065
  }
11875
12066
  const pageItemsNumHalf = Math.floor(PAGE_ITEMS_NUM / 2);
11876
- if (proxy.pageNum > PAGE_ITEMS_NUM) {
12067
+ if (proxy.totalPageNum > PAGE_ITEMS_NUM) {
11877
12068
  showPreBatch.value = localCurrent.value - pageItemsNumHalf > 2;
11878
- showNextBatch.value = localCurrent.value + pageItemsNumHalf < proxy.pageNum - 1;
12069
+ showNextBatch.value = localCurrent.value + pageItemsNumHalf < proxy.totalPageNum - 1;
11879
12070
  }
11880
- const start2 = Math.min(proxy.pageNum - PAGE_ITEMS_NUM, Math.max(2, localCurrent.value - pageItemsNumHalf));
12071
+ const start2 = Math.min(proxy.totalPageNum - PAGE_ITEMS_NUM, Math.max(2, localCurrent.value - pageItemsNumHalf));
11881
12072
  for (let i2 = start2; i2 < start2 + PAGE_ITEMS_NUM; i2++) {
11882
12073
  stack.push(i2);
11883
12074
  }
@@ -11885,19 +12076,19 @@ ${$(r2)}`), n2;
11885
12076
  });
11886
12077
  vue.watch(() => proxy.modelValue, (modelValue) => {
11887
12078
  vue.nextTick(() => {
11888
- if (modelValue >= 1 && modelValue <= proxy.pageNum) {
12079
+ if (modelValue >= 1 && modelValue <= proxy.totalPageNum) {
11889
12080
  localCurrent.value = modelValue;
11890
12081
  } else if (modelValue < 1) {
11891
12082
  localCurrent.value = 1;
11892
12083
  } else {
11893
- localCurrent.value = proxy.pageNum;
12084
+ localCurrent.value = proxy.totalPageNum;
11894
12085
  }
11895
12086
  });
11896
12087
  });
11897
12088
  vue.nextTick(() => {
11898
- vue.watch(() => proxy.pageNum, (pageNum) => {
11899
- if (localCurrent.value > pageNum) {
11900
- localCurrent.value = pageNum;
12089
+ vue.watch(() => proxy.totalPageNum, (totalPageNum) => {
12090
+ if (localCurrent.value > totalPageNum) {
12091
+ localCurrent.value = totalPageNum;
11901
12092
  }
11902
12093
  });
11903
12094
  });
@@ -11913,17 +12104,17 @@ ${$(r2)}`), n2;
11913
12104
  }
11914
12105
  localCurrent.value = localCurrent.value + 1;
11915
12106
  };
11916
- const handleItemClick = (pageNum) => {
11917
- if (pageNum === localCurrent.value) {
12107
+ const handleItemClick = (totalPageNum) => {
12108
+ if (totalPageNum === localCurrent.value) {
11918
12109
  return;
11919
12110
  }
11920
- localCurrent.value = pageNum;
12111
+ localCurrent.value = totalPageNum;
11921
12112
  };
11922
12113
  const handlePreBatch = () => {
11923
12114
  localCurrent.value = Math.max(1, localCurrent.value - PAGE_ITEMS_NUM);
11924
12115
  };
11925
12116
  const handleNextBatch = () => {
11926
- localCurrent.value = Math.min(proxy.pageNum, localCurrent.value + PAGE_ITEMS_NUM);
12117
+ localCurrent.value = Math.min(proxy.totalPageNum, localCurrent.value + PAGE_ITEMS_NUM);
11927
12118
  };
11928
12119
  const render = ({
11929
12120
  isFirst,
@@ -11962,14 +12153,14 @@ ${$(r2)}`), n2;
11962
12153
  "key": "next-batch",
11963
12154
  "class": "bk-pagination-list-next-batch",
11964
12155
  "onClick": handleNextBatch
11965
- }, [vue.createVNode(ellipsis, null, null)]), proxy.pageNum > 1 && vue.createVNode("div", {
12156
+ }, [vue.createVNode(ellipsis, null, null)]), proxy.totalPageNum > 1 && vue.createVNode("div", {
11966
12157
  "class": {
11967
12158
  "bk-pagination-list-item": true,
11968
- "is-active": localCurrent.value === proxy.pageNum
12159
+ "is-active": localCurrent.value === proxy.totalPageNum
11969
12160
  },
11970
12161
  "key": "last",
11971
- "onClick": () => handleItemClick(proxy.pageNum)
11972
- }, [proxy.pageNum]), vue.createVNode("div", {
12162
+ "onClick": () => handleItemClick(proxy.totalPageNum)
12163
+ }, [proxy.totalPageNum]), vue.createVNode("div", {
11973
12164
  "class": {
11974
12165
  "bk-pagination-list-pre": true,
11975
12166
  "is-disabled": isPageNextDisabled.value
@@ -11989,23 +12180,23 @@ ${$(r2)}`), n2;
11989
12180
  const isFocused = vue.ref(false);
11990
12181
  const localCurrent = vue.ref(1);
11991
12182
  const isPagePreDisabled = vue.computed(() => localCurrent.value === 1);
11992
- const isPageNextDisabled = vue.computed(() => localCurrent.value === proxy.pageNum);
12183
+ const isPageNextDisabled = vue.computed(() => localCurrent.value === proxy.totalPageNum);
11993
12184
  let inputMemo = 0;
11994
12185
  const list = vue.computed(() => {
11995
12186
  const stack = [];
11996
- for (let i2 = 1; i2 <= proxy.pageNum; i2++) {
12187
+ for (let i2 = 1; i2 <= proxy.totalPageNum; i2++) {
11997
12188
  stack.push(i2);
11998
12189
  }
11999
12190
  return stack;
12000
12191
  });
12001
12192
  vue.watch(() => proxy.modelValue, (modelValue) => {
12002
12193
  vue.nextTick(() => {
12003
- if (modelValue >= 1 && modelValue <= proxy.pageNum) {
12194
+ if (modelValue >= 1 && modelValue <= proxy.totalPageNum) {
12004
12195
  localCurrent.value = modelValue;
12005
12196
  } else if (modelValue < 1) {
12006
12197
  localCurrent.value = 1;
12007
12198
  } else {
12008
- localCurrent.value = proxy.pageNum;
12199
+ localCurrent.value = proxy.totalPageNum;
12009
12200
  }
12010
12201
  inputMemo = localCurrent.value;
12011
12202
  });
@@ -12013,9 +12204,9 @@ ${$(r2)}`), n2;
12013
12204
  immediate: true
12014
12205
  });
12015
12206
  vue.nextTick(() => {
12016
- vue.watch(() => proxy.pageNum, (pageNum) => {
12017
- if (localCurrent.value > pageNum) {
12018
- localCurrent.value = pageNum;
12207
+ vue.watch(() => proxy.totalPageNum, (totalPageNum) => {
12208
+ if (localCurrent.value > totalPageNum) {
12209
+ localCurrent.value = totalPageNum;
12019
12210
  }
12020
12211
  });
12021
12212
  });
@@ -12052,7 +12243,7 @@ ${$(r2)}`), n2;
12052
12243
  const handlePageEditorInput = (event) => {
12053
12244
  const $target = event.target;
12054
12245
  const value = Number($target.textContent);
12055
- if (!value || value < 1 || value > proxy.pageNum || value === localCurrent.value) {
12246
+ if (!value || value < 1 || value > proxy.totalPageNum || value === localCurrent.value) {
12056
12247
  return;
12057
12248
  }
12058
12249
  inputMemo = value;
@@ -12100,7 +12291,7 @@ ${$(r2)}`), n2;
12100
12291
  "onKeydown": handlePageEditorKeydown
12101
12292
  }, [localCurrent.value]), vue.createVNode("span", null, [vue.createTextVNode("/")]), vue.createVNode("span", {
12102
12293
  "class": "bk-pagination-small-list-total"
12103
- }, [proxy.pageNum])]),
12294
+ }, [proxy.totalPageNum])]),
12104
12295
  content: () => vue.createVNode("div", {
12105
12296
  "class": "bk-pagination-picker-list"
12106
12297
  }, [list.value.map((item) => vue.createVNode("div", {
@@ -12169,12 +12360,12 @@ ${$(r2)}`), n2;
12169
12360
  return value.some((item) => layoutNameMap[item]);
12170
12361
  }, "layout \u7684\u503C\u53EA\u652F\u6301 * total\u3001list\u3001limit *").def(["total", "list", "limit"])
12171
12362
  };
12172
- var Component$6 = vue.defineComponent({
12363
+ var Component$5 = vue.defineComponent({
12173
12364
  name: "Pagination",
12174
12365
  props: paginationProps,
12175
12366
  emits: ["update:modelValue", "change", "update:limit", "limit-change"],
12176
12367
  setup(props, context) {
12177
- const pageNum = vue.ref(0);
12368
+ const totalPageNum = vue.ref(0);
12178
12369
  const {
12179
12370
  count,
12180
12371
  limit
@@ -12193,7 +12384,8 @@ ${$(r2)}`), n2;
12193
12384
  render: renderLimit
12194
12385
  } = useLimit();
12195
12386
  vue.watch([count, localLimit, limit], ([count2, localLimit2]) => {
12196
- pageNum.value = Math.ceil(count2 / localLimit2);
12387
+ const total = Math.ceil(count2 / localLimit2);
12388
+ totalPageNum.value = total < 1 ? 1 : total;
12197
12389
  }, {
12198
12390
  immediate: true
12199
12391
  });
@@ -12209,7 +12401,7 @@ ${$(r2)}`), n2;
12209
12401
  context.emit("limit-change", localLimit2);
12210
12402
  });
12211
12403
  return {
12212
- pageNum,
12404
+ totalPageNum,
12213
12405
  renderTotal,
12214
12406
  renderList,
12215
12407
  renderLimit,
@@ -12224,7 +12416,7 @@ ${$(r2)}`), n2;
12224
12416
  });
12225
12417
  const layoutMap = {
12226
12418
  total: this.renderTotal,
12227
- list: this.renderList,
12419
+ list: this.small ? this.renderSmallList : this.renderList,
12228
12420
  limit: this.renderLimit
12229
12421
  };
12230
12422
  return vue.createVNode("div", {
@@ -12232,10 +12424,10 @@ ${$(r2)}`), n2;
12232
12424
  }, [this.layout.map((layout, index) => layoutMap[layout]({
12233
12425
  isFirst: index === 0,
12234
12426
  isLast: index === this.layout.length - 1
12235
- })), this.renderSmallList()]);
12427
+ }))]);
12236
12428
  }
12237
12429
  });
12238
- const BkPagination = withInstall(Component$6);
12430
+ const BkPagination = withInstall(Component$5);
12239
12431
  class TablePlugins {
12240
12432
  constructor(props, ctx) {
12241
12433
  __publicField(this, "props", null);
@@ -12500,7 +12692,7 @@ ${$(r2)}`), n2;
12500
12692
  })]);
12501
12693
  }
12502
12694
  }
12503
- var Component$5 = vue.defineComponent({
12695
+ var Component$4 = vue.defineComponent({
12504
12696
  name: "Table",
12505
12697
  props: tableProps,
12506
12698
  emits: ["column-pick", "row-click", "page-limit-change", "page-value-change"],
@@ -12635,68 +12827,7 @@ ${$(r2)}`), n2;
12635
12827
  }, [props.pagination && tableRender.renderTableFooter(localPagination.value)])]);
12636
12828
  }
12637
12829
  });
12638
- const BkTable = withInstall(Component$5);
12639
- var Component$4 = vue.defineComponent({
12640
- name: "Tag",
12641
- props: {
12642
- theme: PropTypes.theme(["success", "info", "warning", "danger"]).def(""),
12643
- closable: PropTypes.bool.def(false),
12644
- type: PropTypes.commonType(["", "filled", "stroke"]).def(""),
12645
- checkable: PropTypes.bool.def(false),
12646
- checked: PropTypes.bool.def(false),
12647
- radius: PropTypes.string.def("2px"),
12648
- extCls: PropTypes.string.def("")
12649
- },
12650
- emits: ["change", "close"],
12651
- slots: ["icon"],
12652
- setup(props, {
12653
- emit
12654
- }) {
12655
- const wrapperCls = vue.computed(() => classes({
12656
- "bk-tag-closable": props.closable,
12657
- "bk-tag-checkable": props.checkable,
12658
- "bk-tag-check": props.checked,
12659
- [`bk-tag-${props.type}`]: props.type,
12660
- [`bk-tag-${props.theme}`]: props.theme,
12661
- [props.extCls]: !!props.extCls
12662
- }, "bk-tag"));
12663
- const wrapperStyle = vue.computed(() => ({
12664
- borderRadius: props.radius
12665
- }));
12666
- const handleClose = (e) => {
12667
- e.preventDefault();
12668
- e.stopPropagation();
12669
- emit("close", e);
12670
- };
12671
- const handleClick = (e) => {
12672
- e.preventDefault();
12673
- e.stopPropagation();
12674
- if (props.checkable) {
12675
- emit("change", !props.checked);
12676
- }
12677
- };
12678
- return {
12679
- wrapperCls,
12680
- wrapperStyle,
12681
- handleClose,
12682
- handleClick
12683
- };
12684
- },
12685
- render() {
12686
- var _a, _b;
12687
- return vue.createVNode("div", {
12688
- "class": this.wrapperCls,
12689
- "style": this.wrapperStyle,
12690
- "onClick": this.handleClick
12691
- }, [this.$slots.icon ? vue.createVNode("span", {
12692
- "class": "bk-tag-icon"
12693
- }, [this.$slots.icon()]) : "", vue.createVNode("span", null, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]), this.closable ? vue.createVNode(error, {
12694
- "class": "bk-tag-close",
12695
- "onClick": this.handleClose
12696
- }, null) : ""]);
12697
- }
12698
- });
12699
- const BkTag = withInstall(Component$4);
12830
+ const BkTable = withInstall(Component$4);
12700
12831
  var bkDivider = vue.defineComponent({
12701
12832
  name: "Divider",
12702
12833
  props: {