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