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