bkui-vue 0.0.1-beta.26 → 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.
@@ -11018,7 +11018,9 @@ var Component$b = vue.defineComponent({
11018
11018
  "onClick": this.handleClick
11019
11019
  }, [this.$slots.icon ? vue.createVNode("span", {
11020
11020
  "class": "bk-tag-icon"
11021
- }, [this.$slots.icon()]) : "", vue.createVNode("span", null, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]), this.closable ? vue.createVNode(error, {
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, {
11022
11024
  "class": "bk-tag-close",
11023
11025
  "onClick": this.handleClose
11024
11026
  }, null) : ""]);
@@ -12045,27 +12047,27 @@ var useList = () => {
12045
12047
  const {
12046
12048
  proxy
12047
12049
  } = vue.getCurrentInstance();
12048
- const localCurrent = vue.ref(proxy.modelValue);
12050
+ const localCurrent = vue.ref(1);
12049
12051
  const isPagePreDisabled = vue.computed(() => localCurrent.value === 1);
12050
- const isPageNextDisabled = vue.computed(() => localCurrent.value === proxy.pageNum);
12052
+ const isPageNextDisabled = vue.computed(() => localCurrent.value === proxy.totalPageNum);
12051
12053
  const showPreBatch = vue.ref(false);
12052
12054
  const showNextBatch = vue.ref(false);
12053
12055
  const list = vue.computed(() => {
12054
12056
  showPreBatch.value = false;
12055
12057
  showNextBatch.value = false;
12056
12058
  const stack = [];
12057
- if (proxy.pageNum <= PAGE_ITEMS_NUM) {
12058
- 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++) {
12059
12061
  stack.push(i2);
12060
12062
  }
12061
12063
  return stack;
12062
12064
  }
12063
12065
  const pageItemsNumHalf = Math.floor(PAGE_ITEMS_NUM / 2);
12064
- if (proxy.pageNum > PAGE_ITEMS_NUM) {
12066
+ if (proxy.totalPageNum > PAGE_ITEMS_NUM) {
12065
12067
  showPreBatch.value = localCurrent.value - pageItemsNumHalf > 2;
12066
- showNextBatch.value = localCurrent.value + pageItemsNumHalf < proxy.pageNum - 1;
12068
+ showNextBatch.value = localCurrent.value + pageItemsNumHalf < proxy.totalPageNum - 1;
12067
12069
  }
12068
- 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));
12069
12071
  for (let i2 = start2; i2 < start2 + PAGE_ITEMS_NUM; i2++) {
12070
12072
  stack.push(i2);
12071
12073
  }
@@ -12073,19 +12075,19 @@ var useList = () => {
12073
12075
  });
12074
12076
  vue.watch(() => proxy.modelValue, (modelValue) => {
12075
12077
  vue.nextTick(() => {
12076
- if (modelValue >= 1 && modelValue <= proxy.pageNum) {
12078
+ if (modelValue >= 1 && modelValue <= proxy.totalPageNum) {
12077
12079
  localCurrent.value = modelValue;
12078
12080
  } else if (modelValue < 1) {
12079
12081
  localCurrent.value = 1;
12080
12082
  } else {
12081
- localCurrent.value = proxy.pageNum;
12083
+ localCurrent.value = proxy.totalPageNum;
12082
12084
  }
12083
12085
  });
12084
12086
  });
12085
12087
  vue.nextTick(() => {
12086
- vue.watch(() => proxy.pageNum, (pageNum) => {
12087
- if (localCurrent.value > pageNum) {
12088
- localCurrent.value = pageNum;
12088
+ vue.watch(() => proxy.totalPageNum, (totalPageNum) => {
12089
+ if (localCurrent.value > totalPageNum) {
12090
+ localCurrent.value = totalPageNum;
12089
12091
  }
12090
12092
  });
12091
12093
  });
@@ -12101,17 +12103,17 @@ var useList = () => {
12101
12103
  }
12102
12104
  localCurrent.value = localCurrent.value + 1;
12103
12105
  };
12104
- const handleItemClick = (pageNum) => {
12105
- if (pageNum === localCurrent.value) {
12106
+ const handleItemClick = (totalPageNum) => {
12107
+ if (totalPageNum === localCurrent.value) {
12106
12108
  return;
12107
12109
  }
12108
- localCurrent.value = pageNum;
12110
+ localCurrent.value = totalPageNum;
12109
12111
  };
12110
12112
  const handlePreBatch = () => {
12111
12113
  localCurrent.value = Math.max(1, localCurrent.value - PAGE_ITEMS_NUM);
12112
12114
  };
12113
12115
  const handleNextBatch = () => {
12114
- localCurrent.value = Math.min(proxy.pageNum, localCurrent.value + PAGE_ITEMS_NUM);
12116
+ localCurrent.value = Math.min(proxy.totalPageNum, localCurrent.value + PAGE_ITEMS_NUM);
12115
12117
  };
12116
12118
  const render = ({
12117
12119
  isFirst,
@@ -12150,14 +12152,14 @@ var useList = () => {
12150
12152
  "key": "next-batch",
12151
12153
  "class": "bk-pagination-list-next-batch",
12152
12154
  "onClick": handleNextBatch
12153
- }, [vue.createVNode(ellipsis, null, null)]), proxy.pageNum > 1 && vue.createVNode("div", {
12155
+ }, [vue.createVNode(ellipsis, null, null)]), proxy.totalPageNum > 1 && vue.createVNode("div", {
12154
12156
  "class": {
12155
12157
  "bk-pagination-list-item": true,
12156
- "is-active": localCurrent.value === proxy.pageNum
12158
+ "is-active": localCurrent.value === proxy.totalPageNum
12157
12159
  },
12158
12160
  "key": "last",
12159
- "onClick": () => handleItemClick(proxy.pageNum)
12160
- }, [proxy.pageNum]), vue.createVNode("div", {
12161
+ "onClick": () => handleItemClick(proxy.totalPageNum)
12162
+ }, [proxy.totalPageNum]), vue.createVNode("div", {
12161
12163
  "class": {
12162
12164
  "bk-pagination-list-pre": true,
12163
12165
  "is-disabled": isPageNextDisabled.value
@@ -12177,23 +12179,23 @@ var useSmallList = () => {
12177
12179
  const isFocused = vue.ref(false);
12178
12180
  const localCurrent = vue.ref(1);
12179
12181
  const isPagePreDisabled = vue.computed(() => localCurrent.value === 1);
12180
- const isPageNextDisabled = vue.computed(() => localCurrent.value === proxy.pageNum);
12182
+ const isPageNextDisabled = vue.computed(() => localCurrent.value === proxy.totalPageNum);
12181
12183
  let inputMemo = 0;
12182
12184
  const list = vue.computed(() => {
12183
12185
  const stack = [];
12184
- for (let i2 = 1; i2 <= proxy.pageNum; i2++) {
12186
+ for (let i2 = 1; i2 <= proxy.totalPageNum; i2++) {
12185
12187
  stack.push(i2);
12186
12188
  }
12187
12189
  return stack;
12188
12190
  });
12189
12191
  vue.watch(() => proxy.modelValue, (modelValue) => {
12190
12192
  vue.nextTick(() => {
12191
- if (modelValue >= 1 && modelValue <= proxy.pageNum) {
12193
+ if (modelValue >= 1 && modelValue <= proxy.totalPageNum) {
12192
12194
  localCurrent.value = modelValue;
12193
12195
  } else if (modelValue < 1) {
12194
12196
  localCurrent.value = 1;
12195
12197
  } else {
12196
- localCurrent.value = proxy.pageNum;
12198
+ localCurrent.value = proxy.totalPageNum;
12197
12199
  }
12198
12200
  inputMemo = localCurrent.value;
12199
12201
  });
@@ -12201,9 +12203,9 @@ var useSmallList = () => {
12201
12203
  immediate: true
12202
12204
  });
12203
12205
  vue.nextTick(() => {
12204
- vue.watch(() => proxy.pageNum, (pageNum) => {
12205
- if (localCurrent.value > pageNum) {
12206
- localCurrent.value = pageNum;
12206
+ vue.watch(() => proxy.totalPageNum, (totalPageNum) => {
12207
+ if (localCurrent.value > totalPageNum) {
12208
+ localCurrent.value = totalPageNum;
12207
12209
  }
12208
12210
  });
12209
12211
  });
@@ -12240,7 +12242,7 @@ var useSmallList = () => {
12240
12242
  const handlePageEditorInput = (event) => {
12241
12243
  const $target = event.target;
12242
12244
  const value = Number($target.textContent);
12243
- if (!value || value < 1 || value > proxy.pageNum || value === localCurrent.value) {
12245
+ if (!value || value < 1 || value > proxy.totalPageNum || value === localCurrent.value) {
12244
12246
  return;
12245
12247
  }
12246
12248
  inputMemo = value;
@@ -12288,7 +12290,7 @@ var useSmallList = () => {
12288
12290
  "onKeydown": handlePageEditorKeydown
12289
12291
  }, [localCurrent.value]), vue.createVNode("span", null, [vue.createTextVNode("/")]), vue.createVNode("span", {
12290
12292
  "class": "bk-pagination-small-list-total"
12291
- }, [proxy.pageNum])]),
12293
+ }, [proxy.totalPageNum])]),
12292
12294
  content: () => vue.createVNode("div", {
12293
12295
  "class": "bk-pagination-picker-list"
12294
12296
  }, [list.value.map((item) => vue.createVNode("div", {
@@ -12362,7 +12364,7 @@ var Component$5 = vue.defineComponent({
12362
12364
  props: paginationProps,
12363
12365
  emits: ["update:modelValue", "change", "update:limit", "limit-change"],
12364
12366
  setup(props, context) {
12365
- const pageNum = vue.ref(0);
12367
+ const totalPageNum = vue.ref(0);
12366
12368
  const {
12367
12369
  count,
12368
12370
  limit
@@ -12381,7 +12383,8 @@ var Component$5 = vue.defineComponent({
12381
12383
  render: renderLimit
12382
12384
  } = useLimit();
12383
12385
  vue.watch([count, localLimit, limit], ([count2, localLimit2]) => {
12384
- pageNum.value = Math.ceil(count2 / localLimit2);
12386
+ const total = Math.ceil(count2 / localLimit2);
12387
+ totalPageNum.value = total < 1 ? 1 : total;
12385
12388
  }, {
12386
12389
  immediate: true
12387
12390
  });
@@ -12397,7 +12400,7 @@ var Component$5 = vue.defineComponent({
12397
12400
  context.emit("limit-change", localLimit2);
12398
12401
  });
12399
12402
  return {
12400
- pageNum,
12403
+ totalPageNum,
12401
12404
  renderTotal,
12402
12405
  renderList,
12403
12406
  renderLimit,
@@ -12412,7 +12415,7 @@ var Component$5 = vue.defineComponent({
12412
12415
  });
12413
12416
  const layoutMap = {
12414
12417
  total: this.renderTotal,
12415
- list: this.renderList,
12418
+ list: this.small ? this.renderSmallList : this.renderList,
12416
12419
  limit: this.renderLimit
12417
12420
  };
12418
12421
  return vue.createVNode("div", {
@@ -12420,7 +12423,7 @@ var Component$5 = vue.defineComponent({
12420
12423
  }, [this.layout.map((layout, index) => layoutMap[layout]({
12421
12424
  isFirst: index === 0,
12422
12425
  isLast: index === this.layout.length - 1
12423
- })), this.renderSmallList()]);
12426
+ }))]);
12424
12427
  }
12425
12428
  });
12426
12429
  const BkPagination = withInstall(Component$5);
@@ -11016,7 +11016,9 @@ var Component$b = defineComponent({
11016
11016
  "onClick": this.handleClick
11017
11017
  }, [this.$slots.icon ? createVNode("span", {
11018
11018
  "class": "bk-tag-icon"
11019
- }, [this.$slots.icon()]) : "", createVNode("span", null, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]), this.closable ? createVNode(error, {
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, {
11020
11022
  "class": "bk-tag-close",
11021
11023
  "onClick": this.handleClose
11022
11024
  }, null) : ""]);
@@ -12043,27 +12045,27 @@ var useList = () => {
12043
12045
  const {
12044
12046
  proxy
12045
12047
  } = getCurrentInstance();
12046
- const localCurrent = ref(proxy.modelValue);
12048
+ const localCurrent = ref(1);
12047
12049
  const isPagePreDisabled = computed(() => localCurrent.value === 1);
12048
- const isPageNextDisabled = computed(() => localCurrent.value === proxy.pageNum);
12050
+ const isPageNextDisabled = computed(() => localCurrent.value === proxy.totalPageNum);
12049
12051
  const showPreBatch = ref(false);
12050
12052
  const showNextBatch = ref(false);
12051
12053
  const list = computed(() => {
12052
12054
  showPreBatch.value = false;
12053
12055
  showNextBatch.value = false;
12054
12056
  const stack = [];
12055
- if (proxy.pageNum <= PAGE_ITEMS_NUM) {
12056
- 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++) {
12057
12059
  stack.push(i);
12058
12060
  }
12059
12061
  return stack;
12060
12062
  }
12061
12063
  const pageItemsNumHalf = Math.floor(PAGE_ITEMS_NUM / 2);
12062
- if (proxy.pageNum > PAGE_ITEMS_NUM) {
12064
+ if (proxy.totalPageNum > PAGE_ITEMS_NUM) {
12063
12065
  showPreBatch.value = localCurrent.value - pageItemsNumHalf > 2;
12064
- showNextBatch.value = localCurrent.value + pageItemsNumHalf < proxy.pageNum - 1;
12066
+ showNextBatch.value = localCurrent.value + pageItemsNumHalf < proxy.totalPageNum - 1;
12065
12067
  }
12066
- 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));
12067
12069
  for (let i = start2; i < start2 + PAGE_ITEMS_NUM; i++) {
12068
12070
  stack.push(i);
12069
12071
  }
@@ -12071,19 +12073,19 @@ var useList = () => {
12071
12073
  });
12072
12074
  watch(() => proxy.modelValue, (modelValue) => {
12073
12075
  nextTick(() => {
12074
- if (modelValue >= 1 && modelValue <= proxy.pageNum) {
12076
+ if (modelValue >= 1 && modelValue <= proxy.totalPageNum) {
12075
12077
  localCurrent.value = modelValue;
12076
12078
  } else if (modelValue < 1) {
12077
12079
  localCurrent.value = 1;
12078
12080
  } else {
12079
- localCurrent.value = proxy.pageNum;
12081
+ localCurrent.value = proxy.totalPageNum;
12080
12082
  }
12081
12083
  });
12082
12084
  });
12083
12085
  nextTick(() => {
12084
- watch(() => proxy.pageNum, (pageNum) => {
12085
- if (localCurrent.value > pageNum) {
12086
- localCurrent.value = pageNum;
12086
+ watch(() => proxy.totalPageNum, (totalPageNum) => {
12087
+ if (localCurrent.value > totalPageNum) {
12088
+ localCurrent.value = totalPageNum;
12087
12089
  }
12088
12090
  });
12089
12091
  });
@@ -12099,17 +12101,17 @@ var useList = () => {
12099
12101
  }
12100
12102
  localCurrent.value = localCurrent.value + 1;
12101
12103
  };
12102
- const handleItemClick = (pageNum) => {
12103
- if (pageNum === localCurrent.value) {
12104
+ const handleItemClick = (totalPageNum) => {
12105
+ if (totalPageNum === localCurrent.value) {
12104
12106
  return;
12105
12107
  }
12106
- localCurrent.value = pageNum;
12108
+ localCurrent.value = totalPageNum;
12107
12109
  };
12108
12110
  const handlePreBatch = () => {
12109
12111
  localCurrent.value = Math.max(1, localCurrent.value - PAGE_ITEMS_NUM);
12110
12112
  };
12111
12113
  const handleNextBatch = () => {
12112
- localCurrent.value = Math.min(proxy.pageNum, localCurrent.value + PAGE_ITEMS_NUM);
12114
+ localCurrent.value = Math.min(proxy.totalPageNum, localCurrent.value + PAGE_ITEMS_NUM);
12113
12115
  };
12114
12116
  const render2 = ({
12115
12117
  isFirst,
@@ -12148,14 +12150,14 @@ var useList = () => {
12148
12150
  "key": "next-batch",
12149
12151
  "class": "bk-pagination-list-next-batch",
12150
12152
  "onClick": handleNextBatch
12151
- }, [createVNode(ellipsis, null, null)]), proxy.pageNum > 1 && createVNode("div", {
12153
+ }, [createVNode(ellipsis, null, null)]), proxy.totalPageNum > 1 && createVNode("div", {
12152
12154
  "class": {
12153
12155
  "bk-pagination-list-item": true,
12154
- "is-active": localCurrent.value === proxy.pageNum
12156
+ "is-active": localCurrent.value === proxy.totalPageNum
12155
12157
  },
12156
12158
  "key": "last",
12157
- "onClick": () => handleItemClick(proxy.pageNum)
12158
- }, [proxy.pageNum]), createVNode("div", {
12159
+ "onClick": () => handleItemClick(proxy.totalPageNum)
12160
+ }, [proxy.totalPageNum]), createVNode("div", {
12159
12161
  "class": {
12160
12162
  "bk-pagination-list-pre": true,
12161
12163
  "is-disabled": isPageNextDisabled.value
@@ -12175,23 +12177,23 @@ var useSmallList = () => {
12175
12177
  const isFocused = ref(false);
12176
12178
  const localCurrent = ref(1);
12177
12179
  const isPagePreDisabled = computed(() => localCurrent.value === 1);
12178
- const isPageNextDisabled = computed(() => localCurrent.value === proxy.pageNum);
12180
+ const isPageNextDisabled = computed(() => localCurrent.value === proxy.totalPageNum);
12179
12181
  let inputMemo = 0;
12180
12182
  const list = computed(() => {
12181
12183
  const stack = [];
12182
- for (let i = 1; i <= proxy.pageNum; i++) {
12184
+ for (let i = 1; i <= proxy.totalPageNum; i++) {
12183
12185
  stack.push(i);
12184
12186
  }
12185
12187
  return stack;
12186
12188
  });
12187
12189
  watch(() => proxy.modelValue, (modelValue) => {
12188
12190
  nextTick(() => {
12189
- if (modelValue >= 1 && modelValue <= proxy.pageNum) {
12191
+ if (modelValue >= 1 && modelValue <= proxy.totalPageNum) {
12190
12192
  localCurrent.value = modelValue;
12191
12193
  } else if (modelValue < 1) {
12192
12194
  localCurrent.value = 1;
12193
12195
  } else {
12194
- localCurrent.value = proxy.pageNum;
12196
+ localCurrent.value = proxy.totalPageNum;
12195
12197
  }
12196
12198
  inputMemo = localCurrent.value;
12197
12199
  });
@@ -12199,9 +12201,9 @@ var useSmallList = () => {
12199
12201
  immediate: true
12200
12202
  });
12201
12203
  nextTick(() => {
12202
- watch(() => proxy.pageNum, (pageNum) => {
12203
- if (localCurrent.value > pageNum) {
12204
- localCurrent.value = pageNum;
12204
+ watch(() => proxy.totalPageNum, (totalPageNum) => {
12205
+ if (localCurrent.value > totalPageNum) {
12206
+ localCurrent.value = totalPageNum;
12205
12207
  }
12206
12208
  });
12207
12209
  });
@@ -12238,7 +12240,7 @@ var useSmallList = () => {
12238
12240
  const handlePageEditorInput = (event) => {
12239
12241
  const $target = event.target;
12240
12242
  const value = Number($target.textContent);
12241
- if (!value || value < 1 || value > proxy.pageNum || value === localCurrent.value) {
12243
+ if (!value || value < 1 || value > proxy.totalPageNum || value === localCurrent.value) {
12242
12244
  return;
12243
12245
  }
12244
12246
  inputMemo = value;
@@ -12286,7 +12288,7 @@ var useSmallList = () => {
12286
12288
  "onKeydown": handlePageEditorKeydown
12287
12289
  }, [localCurrent.value]), createVNode("span", null, [createTextVNode("/")]), createVNode("span", {
12288
12290
  "class": "bk-pagination-small-list-total"
12289
- }, [proxy.pageNum])]),
12291
+ }, [proxy.totalPageNum])]),
12290
12292
  content: () => createVNode("div", {
12291
12293
  "class": "bk-pagination-picker-list"
12292
12294
  }, [list.value.map((item) => createVNode("div", {
@@ -12360,7 +12362,7 @@ var Component$5 = defineComponent({
12360
12362
  props: paginationProps,
12361
12363
  emits: ["update:modelValue", "change", "update:limit", "limit-change"],
12362
12364
  setup(props, context) {
12363
- const pageNum = ref(0);
12365
+ const totalPageNum = ref(0);
12364
12366
  const {
12365
12367
  count,
12366
12368
  limit
@@ -12379,7 +12381,8 @@ var Component$5 = defineComponent({
12379
12381
  render: renderLimit
12380
12382
  } = useLimit();
12381
12383
  watch([count, localLimit, limit], ([count2, localLimit2]) => {
12382
- pageNum.value = Math.ceil(count2 / localLimit2);
12384
+ const total = Math.ceil(count2 / localLimit2);
12385
+ totalPageNum.value = total < 1 ? 1 : total;
12383
12386
  }, {
12384
12387
  immediate: true
12385
12388
  });
@@ -12395,7 +12398,7 @@ var Component$5 = defineComponent({
12395
12398
  context.emit("limit-change", localLimit2);
12396
12399
  });
12397
12400
  return {
12398
- pageNum,
12401
+ totalPageNum,
12399
12402
  renderTotal,
12400
12403
  renderList,
12401
12404
  renderLimit,
@@ -12410,7 +12413,7 @@ var Component$5 = defineComponent({
12410
12413
  });
12411
12414
  const layoutMap = {
12412
12415
  total: this.renderTotal,
12413
- list: this.renderList,
12416
+ list: this.small ? this.renderSmallList : this.renderList,
12414
12417
  limit: this.renderLimit
12415
12418
  };
12416
12419
  return createVNode("div", {
@@ -12418,7 +12421,7 @@ var Component$5 = defineComponent({
12418
12421
  }, [this.layout.map((layout, index) => layoutMap[layout]({
12419
12422
  isFirst: index === 0,
12420
12423
  isLast: index === this.layout.length - 1
12421
- })), this.renderSmallList()]);
12424
+ }))]);
12422
12425
  }
12423
12426
  });
12424
12427
  const BkPagination = withInstall(Component$5);
@@ -11019,7 +11019,9 @@ ${$(r2)}`), n2;
11019
11019
  "onClick": this.handleClick
11020
11020
  }, [this.$slots.icon ? vue.createVNode("span", {
11021
11021
  "class": "bk-tag-icon"
11022
- }, [this.$slots.icon()]) : "", vue.createVNode("span", null, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]), this.closable ? vue.createVNode(error, {
11022
+ }, [this.$slots.icon()]) : "", vue.createVNode("span", {
11023
+ "class": "bk-tag-text"
11024
+ }, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]), this.closable ? vue.createVNode(error, {
11023
11025
  "class": "bk-tag-close",
11024
11026
  "onClick": this.handleClose
11025
11027
  }, null) : ""]);
@@ -12046,27 +12048,27 @@ ${$(r2)}`), n2;
12046
12048
  const {
12047
12049
  proxy
12048
12050
  } = vue.getCurrentInstance();
12049
- const localCurrent = vue.ref(proxy.modelValue);
12051
+ const localCurrent = vue.ref(1);
12050
12052
  const isPagePreDisabled = vue.computed(() => localCurrent.value === 1);
12051
- const isPageNextDisabled = vue.computed(() => localCurrent.value === proxy.pageNum);
12053
+ const isPageNextDisabled = vue.computed(() => localCurrent.value === proxy.totalPageNum);
12052
12054
  const showPreBatch = vue.ref(false);
12053
12055
  const showNextBatch = vue.ref(false);
12054
12056
  const list = vue.computed(() => {
12055
12057
  showPreBatch.value = false;
12056
12058
  showNextBatch.value = false;
12057
12059
  const stack = [];
12058
- if (proxy.pageNum <= PAGE_ITEMS_NUM) {
12059
- for (let i2 = 2; i2 <= proxy.pageNum - 1; i2++) {
12060
+ if (proxy.totalPageNum <= PAGE_ITEMS_NUM) {
12061
+ for (let i2 = 2; i2 <= proxy.totalPageNum - 1; i2++) {
12060
12062
  stack.push(i2);
12061
12063
  }
12062
12064
  return stack;
12063
12065
  }
12064
12066
  const pageItemsNumHalf = Math.floor(PAGE_ITEMS_NUM / 2);
12065
- if (proxy.pageNum > PAGE_ITEMS_NUM) {
12067
+ if (proxy.totalPageNum > PAGE_ITEMS_NUM) {
12066
12068
  showPreBatch.value = localCurrent.value - pageItemsNumHalf > 2;
12067
- showNextBatch.value = localCurrent.value + pageItemsNumHalf < proxy.pageNum - 1;
12069
+ showNextBatch.value = localCurrent.value + pageItemsNumHalf < proxy.totalPageNum - 1;
12068
12070
  }
12069
- const start2 = Math.min(proxy.pageNum - PAGE_ITEMS_NUM, Math.max(2, localCurrent.value - pageItemsNumHalf));
12071
+ const start2 = Math.min(proxy.totalPageNum - PAGE_ITEMS_NUM, Math.max(2, localCurrent.value - pageItemsNumHalf));
12070
12072
  for (let i2 = start2; i2 < start2 + PAGE_ITEMS_NUM; i2++) {
12071
12073
  stack.push(i2);
12072
12074
  }
@@ -12074,19 +12076,19 @@ ${$(r2)}`), n2;
12074
12076
  });
12075
12077
  vue.watch(() => proxy.modelValue, (modelValue) => {
12076
12078
  vue.nextTick(() => {
12077
- if (modelValue >= 1 && modelValue <= proxy.pageNum) {
12079
+ if (modelValue >= 1 && modelValue <= proxy.totalPageNum) {
12078
12080
  localCurrent.value = modelValue;
12079
12081
  } else if (modelValue < 1) {
12080
12082
  localCurrent.value = 1;
12081
12083
  } else {
12082
- localCurrent.value = proxy.pageNum;
12084
+ localCurrent.value = proxy.totalPageNum;
12083
12085
  }
12084
12086
  });
12085
12087
  });
12086
12088
  vue.nextTick(() => {
12087
- vue.watch(() => proxy.pageNum, (pageNum) => {
12088
- if (localCurrent.value > pageNum) {
12089
- localCurrent.value = pageNum;
12089
+ vue.watch(() => proxy.totalPageNum, (totalPageNum) => {
12090
+ if (localCurrent.value > totalPageNum) {
12091
+ localCurrent.value = totalPageNum;
12090
12092
  }
12091
12093
  });
12092
12094
  });
@@ -12102,17 +12104,17 @@ ${$(r2)}`), n2;
12102
12104
  }
12103
12105
  localCurrent.value = localCurrent.value + 1;
12104
12106
  };
12105
- const handleItemClick = (pageNum) => {
12106
- if (pageNum === localCurrent.value) {
12107
+ const handleItemClick = (totalPageNum) => {
12108
+ if (totalPageNum === localCurrent.value) {
12107
12109
  return;
12108
12110
  }
12109
- localCurrent.value = pageNum;
12111
+ localCurrent.value = totalPageNum;
12110
12112
  };
12111
12113
  const handlePreBatch = () => {
12112
12114
  localCurrent.value = Math.max(1, localCurrent.value - PAGE_ITEMS_NUM);
12113
12115
  };
12114
12116
  const handleNextBatch = () => {
12115
- localCurrent.value = Math.min(proxy.pageNum, localCurrent.value + PAGE_ITEMS_NUM);
12117
+ localCurrent.value = Math.min(proxy.totalPageNum, localCurrent.value + PAGE_ITEMS_NUM);
12116
12118
  };
12117
12119
  const render = ({
12118
12120
  isFirst,
@@ -12151,14 +12153,14 @@ ${$(r2)}`), n2;
12151
12153
  "key": "next-batch",
12152
12154
  "class": "bk-pagination-list-next-batch",
12153
12155
  "onClick": handleNextBatch
12154
- }, [vue.createVNode(ellipsis, null, null)]), proxy.pageNum > 1 && vue.createVNode("div", {
12156
+ }, [vue.createVNode(ellipsis, null, null)]), proxy.totalPageNum > 1 && vue.createVNode("div", {
12155
12157
  "class": {
12156
12158
  "bk-pagination-list-item": true,
12157
- "is-active": localCurrent.value === proxy.pageNum
12159
+ "is-active": localCurrent.value === proxy.totalPageNum
12158
12160
  },
12159
12161
  "key": "last",
12160
- "onClick": () => handleItemClick(proxy.pageNum)
12161
- }, [proxy.pageNum]), vue.createVNode("div", {
12162
+ "onClick": () => handleItemClick(proxy.totalPageNum)
12163
+ }, [proxy.totalPageNum]), vue.createVNode("div", {
12162
12164
  "class": {
12163
12165
  "bk-pagination-list-pre": true,
12164
12166
  "is-disabled": isPageNextDisabled.value
@@ -12178,23 +12180,23 @@ ${$(r2)}`), n2;
12178
12180
  const isFocused = vue.ref(false);
12179
12181
  const localCurrent = vue.ref(1);
12180
12182
  const isPagePreDisabled = vue.computed(() => localCurrent.value === 1);
12181
- const isPageNextDisabled = vue.computed(() => localCurrent.value === proxy.pageNum);
12183
+ const isPageNextDisabled = vue.computed(() => localCurrent.value === proxy.totalPageNum);
12182
12184
  let inputMemo = 0;
12183
12185
  const list = vue.computed(() => {
12184
12186
  const stack = [];
12185
- for (let i2 = 1; i2 <= proxy.pageNum; i2++) {
12187
+ for (let i2 = 1; i2 <= proxy.totalPageNum; i2++) {
12186
12188
  stack.push(i2);
12187
12189
  }
12188
12190
  return stack;
12189
12191
  });
12190
12192
  vue.watch(() => proxy.modelValue, (modelValue) => {
12191
12193
  vue.nextTick(() => {
12192
- if (modelValue >= 1 && modelValue <= proxy.pageNum) {
12194
+ if (modelValue >= 1 && modelValue <= proxy.totalPageNum) {
12193
12195
  localCurrent.value = modelValue;
12194
12196
  } else if (modelValue < 1) {
12195
12197
  localCurrent.value = 1;
12196
12198
  } else {
12197
- localCurrent.value = proxy.pageNum;
12199
+ localCurrent.value = proxy.totalPageNum;
12198
12200
  }
12199
12201
  inputMemo = localCurrent.value;
12200
12202
  });
@@ -12202,9 +12204,9 @@ ${$(r2)}`), n2;
12202
12204
  immediate: true
12203
12205
  });
12204
12206
  vue.nextTick(() => {
12205
- vue.watch(() => proxy.pageNum, (pageNum) => {
12206
- if (localCurrent.value > pageNum) {
12207
- localCurrent.value = pageNum;
12207
+ vue.watch(() => proxy.totalPageNum, (totalPageNum) => {
12208
+ if (localCurrent.value > totalPageNum) {
12209
+ localCurrent.value = totalPageNum;
12208
12210
  }
12209
12211
  });
12210
12212
  });
@@ -12241,7 +12243,7 @@ ${$(r2)}`), n2;
12241
12243
  const handlePageEditorInput = (event) => {
12242
12244
  const $target = event.target;
12243
12245
  const value = Number($target.textContent);
12244
- if (!value || value < 1 || value > proxy.pageNum || value === localCurrent.value) {
12246
+ if (!value || value < 1 || value > proxy.totalPageNum || value === localCurrent.value) {
12245
12247
  return;
12246
12248
  }
12247
12249
  inputMemo = value;
@@ -12289,7 +12291,7 @@ ${$(r2)}`), n2;
12289
12291
  "onKeydown": handlePageEditorKeydown
12290
12292
  }, [localCurrent.value]), vue.createVNode("span", null, [vue.createTextVNode("/")]), vue.createVNode("span", {
12291
12293
  "class": "bk-pagination-small-list-total"
12292
- }, [proxy.pageNum])]),
12294
+ }, [proxy.totalPageNum])]),
12293
12295
  content: () => vue.createVNode("div", {
12294
12296
  "class": "bk-pagination-picker-list"
12295
12297
  }, [list.value.map((item) => vue.createVNode("div", {
@@ -12363,7 +12365,7 @@ ${$(r2)}`), n2;
12363
12365
  props: paginationProps,
12364
12366
  emits: ["update:modelValue", "change", "update:limit", "limit-change"],
12365
12367
  setup(props, context) {
12366
- const pageNum = vue.ref(0);
12368
+ const totalPageNum = vue.ref(0);
12367
12369
  const {
12368
12370
  count,
12369
12371
  limit
@@ -12382,7 +12384,8 @@ ${$(r2)}`), n2;
12382
12384
  render: renderLimit
12383
12385
  } = useLimit();
12384
12386
  vue.watch([count, localLimit, limit], ([count2, localLimit2]) => {
12385
- pageNum.value = Math.ceil(count2 / localLimit2);
12387
+ const total = Math.ceil(count2 / localLimit2);
12388
+ totalPageNum.value = total < 1 ? 1 : total;
12386
12389
  }, {
12387
12390
  immediate: true
12388
12391
  });
@@ -12398,7 +12401,7 @@ ${$(r2)}`), n2;
12398
12401
  context.emit("limit-change", localLimit2);
12399
12402
  });
12400
12403
  return {
12401
- pageNum,
12404
+ totalPageNum,
12402
12405
  renderTotal,
12403
12406
  renderList,
12404
12407
  renderLimit,
@@ -12413,7 +12416,7 @@ ${$(r2)}`), n2;
12413
12416
  });
12414
12417
  const layoutMap = {
12415
12418
  total: this.renderTotal,
12416
- list: this.renderList,
12419
+ list: this.small ? this.renderSmallList : this.renderList,
12417
12420
  limit: this.renderLimit
12418
12421
  };
12419
12422
  return vue.createVNode("div", {
@@ -12421,7 +12424,7 @@ ${$(r2)}`), n2;
12421
12424
  }, [this.layout.map((layout, index) => layoutMap[layout]({
12422
12425
  isFirst: index === 0,
12423
12426
  isLast: index === this.layout.length - 1
12424
- })), this.renderSmallList()]);
12427
+ }))]);
12425
12428
  }
12426
12429
  });
12427
12430
  const BkPagination = withInstall(Component$5);
package/dist/style.css CHANGED
@@ -2830,7 +2830,8 @@ optgroup {
2830
2830
  background: #f0f1f5;
2831
2831
  }
2832
2832
  .bk-tag {
2833
- display: inline-block;
2833
+ display: inline-flex;
2834
+ align-items: center;
2834
2835
  height: 22px;
2835
2836
  padding: 0 10px;
2836
2837
  margin: 2px 6px 2px 0px;
@@ -2906,18 +2907,23 @@ optgroup {
2906
2907
  background: #3a84ff;
2907
2908
  opacity: 1;
2908
2909
  }
2910
+ .bk-tag .bk-tag-text {
2911
+ flex: 1;
2912
+ overflow: hidden;
2913
+ text-overflow: ellipsis;
2914
+ white-space: nowrap;
2915
+ }
2909
2916
  .bk-tag .bk-tag-icon {
2910
- display: inline-block;
2917
+ flex-shrink: 0;
2911
2918
  margin-right: 4px;
2912
2919
  font-size: 14px;
2913
2920
  line-height: 0;
2914
2921
  }
2915
2922
  .bk-tag .bk-tag-close {
2916
- display: inline-block;
2923
+ flex-shrink: 0;
2917
2924
  margin-left: 4px;
2918
2925
  font-size: 12px;
2919
2926
  line-height: 0;
2920
- vertical-align: 1px;
2921
2927
  cursor: pointer;
2922
2928
  }
2923
2929
  .bk-form {
@@ -162,7 +162,7 @@ declare const BkPagination: {
162
162
  "onUpdate:limit"?: (...args: any[]) => any;
163
163
  "onLimit-change"?: (...args: any[]) => any;
164
164
  }, {
165
- pageNum: import("vue").Ref<number>;
165
+ totalPageNum: import("vue").Ref<number>;
166
166
  renderTotal: ({ isFirst, isLast }: {
167
167
  isFirst: any;
168
168
  isLast: any;
@@ -277,7 +277,7 @@ declare const BkPagination: {
277
277
  "onUpdate:limit"?: (...args: any[]) => any;
278
278
  "onLimit-change"?: (...args: any[]) => any;
279
279
  } & import("vue").ShallowUnwrapRef<{
280
- pageNum: import("vue").Ref<number>;
280
+ totalPageNum: import("vue").Ref<number>;
281
281
  renderTotal: ({ isFirst, isLast }: {
282
282
  isFirst: any;
283
283
  isLast: any;
@@ -361,7 +361,7 @@ declare const BkPagination: {
361
361
  "onUpdate:limit"?: (...args: any[]) => any;
362
362
  "onLimit-change"?: (...args: any[]) => any;
363
363
  }, {
364
- pageNum: import("vue").Ref<number>;
364
+ totalPageNum: import("vue").Ref<number>;
365
365
  renderTotal: ({ isFirst, isLast }: {
366
366
  isFirst: any;
367
367
  isLast: any;
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("../shared"),require("vue"),require("../select"),require("../icon"),require("../popover")):"function"==typeof define&&define.amd?define(["exports","../shared","vue","../select","../icon","../popover"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue,e.Select,e["@bkui-vue/icon/icons"],e.Popover)}(this,(function(e,t,n,a,r,i){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=o(a),l=o(i);function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s={exports:{}};!function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports}(s);var p=c(s.exports),d={exports:{}},f={exports:{}};!function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports}(f);var v={exports:{}};!function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,i=[],o=!0,u=!1;try{for(n=n.call(e);!(o=(a=n.next()).done)&&(i.push(a.value),!t||i.length!==t);o=!0);}catch(e){u=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(u)throw r}}return i}},e.exports.__esModule=!0,e.exports.default=e.exports}(v);var m={exports:{}},g={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a},e.exports.__esModule=!0,e.exports.default=e.exports}(g),function(e){var t=g.exports;e.exports=function(e,n){if(e){if("string"==typeof e)return t(e,n);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?t(e,n):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(m);var b={exports:{}};!function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(b),function(e){var t=f.exports,n=v.exports,a=m.exports,r=b.exports;e.exports=function(e,i){return t(e)||n(e,i)||a(e,i)||r()},e.exports.__esModule=!0,e.exports.default=e.exports}(d);var x=c(d.exports);var h=function(){var e=n.getCurrentInstance().proxy,t=n.ref(null),a=n.ref(!1),i=n.ref(1),o=n.computed((function(){return 1===i.value})),u=n.computed((function(){return i.value===e.pageNum})),c=0,s=n.computed((function(){for(var t=[],n=1;n<=e.pageNum;n++)t.push(n);return t}));n.watch((function(){return e.modelValue}),(function(t){n.nextTick((function(){t>=1&&t<=e.pageNum?i.value=t:i.value=t<1?1:e.pageNum,c=i.value}))}),{immediate:!0}),n.nextTick((function(){n.watch((function(){return e.pageNum}),(function(e){i.value>e&&(i.value=e)}))}));var p=function(){o.value||(i.value=i.value-1)},d=function(){u.value||(i.value=i.value+1)},f=function(){n.nextTick((function(){t.value.focus();var e=window.getSelection();e.selectAllChildren(t.value),e.collapseToEnd()}))},v=function(){a.value=!0},m=function(){a.value=!1,t.value.textContent="".concat(c),c!==i.value&&(i.value=c)},g=function(t){var n=t.target,a=Number(n.textContent);!a||a<1||a>e.pageNum||a===i.value||(c=a,f())},b=function(e){["Enter","NumpadEnter"].includes(e.code)&&(e.preventDefault(),m(),f())};return{current:i,render:function(){return n.createVNode("div",{class:"bk-pagination-small-list"},[n.createVNode("div",{class:{"bk-pagination-btn-pre":!0,"is-disabled":o.value},onClick:p},[n.createVNode(r.LeftShape,null,null)]),n.createVNode(l.default,{theme:"light",trigger:"click",arrow:!1,boundary:"body",placement:"bottom"},{default:function(){return n.createVNode("div",{class:{"bk-pagination-picker":!0,"is-focused":a.value}},[n.createVNode("span",{ref:t,class:"bk-pagination-editor",contenteditable:!0,spellcheck:"false",onFocus:v,onBlur:m,onInput:g,onKeydown:b},[i.value]),n.createVNode("span",null,[n.createTextVNode("/")]),n.createVNode("span",{class:"bk-pagination-small-list-total"},[e.pageNum])])},content:function(){return n.createVNode("div",{class:"bk-pagination-picker-list"},[s.value.map((function(e){return n.createVNode("div",{class:{item:!0,"is-actived":e===i.value},key:e,onClick:function(){return function(e){c=e,m()}(e)}},[e])}))])}}),n.createVNode("div",{class:{"bk-pagination-btn-next":!0,"is-disabled":u.value},onClick:d},[n.createVNode(r.RightShape,null,null)])])}}},N={modelValue:t.PropTypes.number.def(1),count:t.PropTypes.number.def(0).isRequired,limit:t.PropTypes.number.def(10),limitList:t.PropTypes.arrayOf(Number).def([10,20,50,100]),showLimit:t.PropTypes.bool.def(!0),type:t.PropTypes.oneOf(["default","compact"]).def("default"),location:t.PropTypes.oneOf(["left","right"]).def("right"),align:t.PropTypes.oneOf(["left","center","right"]).def("left"),size:t.PropTypes.size(),small:t.PropTypes.bool.def(!1),showTotalCount:t.PropTypes.bool.def(!0),prevText:t.PropTypes.string,nextText:t.PropTypes.string,disabled:t.PropTypes.bool.def(!1),layout:t.PropTypes.custom((function(e){var t={total:!0,list:!0,limit:!0};return e.some((function(e){return t[e]}))}),"layout 的值只支持 * total、list、limit *").def(["total","list","limit"])},y=n.defineComponent({name:"Pagination",props:N,emits:["update:modelValue","change","update:limit","limit-change"],setup:function(e,t){var i=n.ref(0),o=n.toRefs(e),l=o.count,c=o.limit,s=function(e){var t=e.isFirst,a=e.isLast,r=n.getCurrentInstance().props;return r.showTotalCount?n.createVNode("div",n.mergeProps({class:{"bk-pagination-total":!0,"is-first":t,"is-last":a}},{disabled:r.disabled}),[n.createTextVNode("共计"),n.createVNode("div",{class:"bk-pagination-total-num"},[r.count]),n.createTextVNode("条")]):null},p=function(){var e=n.getCurrentInstance().proxy,t=n.ref(e.modelValue),a=n.computed((function(){return 1===t.value})),i=n.computed((function(){return t.value===e.pageNum})),o=n.ref(!1),u=n.ref(!1),l=n.computed((function(){o.value=!1,u.value=!1;var n=[];if(e.pageNum<=5){for(var a=2;a<=e.pageNum-1;a++)n.push(a);return n}var r=Math.floor(2.5);e.pageNum>5&&(o.value=t.value-r>2,u.value=t.value+r<e.pageNum-1);for(var i=Math.min(e.pageNum-5,Math.max(2,t.value-r)),l=i;l<i+5;l++)n.push(l);return n}));n.watch((function(){return e.modelValue}),(function(a){n.nextTick((function(){a>=1&&a<=e.pageNum?t.value=a:t.value=a<1?1:e.pageNum}))})),n.nextTick((function(){n.watch((function(){return e.pageNum}),(function(e){t.value>e&&(t.value=e)}))}));var c=function(){a.value||(t.value=t.value-1)},s=function(){i.value||(t.value=t.value+1)},p=function(e){e!==t.value&&(t.value=e)},d=function(){t.value=Math.max(1,t.value-5)},f=function(){t.value=Math.min(e.pageNum,t.value+5)};return{current:t,render:function(v){var m=v.isFirst,g=v.isLast;return n.createVNode("div",{class:{"bk-pagination-list":!0,"is-first":m,"is-last":g}},[n.createVNode("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":a.value},onClick:c},[e.prevText||n.createVNode(r.AngleLeft,null,null)]),n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":1===t.value},key:"1",onClick:function(){return p(1)}},[n.createTextVNode("1")]),o.value&&n.createVNode("div",{key:"pre-batch",class:"bk-pagination-list-pre-batch",onClick:d},[n.createVNode(r.Ellipsis,null,null)]),l.value.map((function(e){return n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e},key:e,onClick:function(){return p(e)}},[e])})),u.value&&n.createVNode("div",{key:"next-batch",class:"bk-pagination-list-next-batch",onClick:f},[n.createVNode(r.Ellipsis,null,null)]),e.pageNum>1&&n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e.pageNum},key:"last",onClick:function(){return p(e.pageNum)}},[e.pageNum]),n.createVNode("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":i.value},onClick:s},[e.nextText||n.createVNode(r.AngleRight,null,null)])])}}}(),d=p.current,f=p.render,v=h(),m=v.current,g=v.render,b=function(){var e=n.getCurrentInstance().proxy,t=n.ref(e.limit);n.watch((function(){return e.limit}),(function(e){t.value=e})),n.watch((function(){return e.limitList}),(function(e){n.nextTick((function(){if(!e.includes(t.value)){var n=x(e,1);t.value=n[0]}}))}),{immediate:!0});var r=function(e){t.value=e};return{limit:t,render:function(i){var o,l,c=i.isFirst,s=i.isLast;return e.showLimit?n.createVNode("div",n.mergeProps({class:{"bk-pagination-limit":!0,"is-first":c,"is-last":s}},{disabled:e.disabled}),[n.createVNode("div",null,[n.createTextVNode("每页")]),n.createVNode(u.default,{class:"bk-pagination-limit-select",clearable:!1,modelValue:t.value,onChange:r,disabled:e.disabled},(l=o=e.limitList.map((function(e,t){return n.createVNode(a.BkOption,{value:e,label:e,key:"".concat(t,"_").concat(e)},null)})),"function"==typeof l||"[object Object]"===Object.prototype.toString.call(l)&&!n.isVNode(l)?o:{default:function(){return[o]}})),n.createVNode("div",null,[n.createTextVNode("条")])]):null}}}(),N=b.limit,y=b.render;return n.watch([l,N,c],(function(e){var t=x(e,2),n=t[0],a=t[1];i.value=Math.ceil(n/a)}),{immediate:!0}),n.watch(d,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),n.watch(m,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),n.watch(N,(function(e){t.emit("limit-change",e)})),{pageNum:i,renderTotal:s,renderList:f,renderLimit:y,renderSmallList:g}},render:function(){var e,a=this,r=t.classes((p(e={"bk-pagination":!0},"bk-pagination--".concat(this.size),!0),p(e,"is-align-".concat(this.align),!0),e)),i={total:this.renderTotal,list:this.renderList,limit:this.renderLimit};return n.createVNode("div",{class:r},[this.layout.map((function(e,t){return i[e]({isFirst:0===t,isLast:t===a.layout.length-1})})),this.renderSmallList()])}}),k=t.withInstall(y);e.BkPagination=k,e.default=k,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("../shared"),require("vue"),require("../select"),require("../icon"),require("../popover")):"function"==typeof define&&define.amd?define(["exports","../shared","vue","../select","../icon","../popover"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue,e.Select,e["@bkui-vue/icon/icons"],e.Popover)}(this,(function(e,t,n,a,r,o){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=i(a),u=i(o);function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s={exports:{}};!function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports}(s);var d=c(s.exports),p={exports:{}},f={exports:{}};!function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports}(f);var v={exports:{}};!function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(o.push(a.value),!t||o.length!==t);i=!0);}catch(e){l=!0,r=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw r}}return o}},e.exports.__esModule=!0,e.exports.default=e.exports}(v);var m={exports:{}},g={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a},e.exports.__esModule=!0,e.exports.default=e.exports}(g),function(e){var t=g.exports;e.exports=function(e,n){if(e){if("string"==typeof e)return t(e,n);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?t(e,n):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(m);var b={exports:{}};!function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(b),function(e){var t=f.exports,n=v.exports,a=m.exports,r=b.exports;e.exports=function(e,o){return t(e)||n(e,o)||a(e,o)||r()},e.exports.__esModule=!0,e.exports.default=e.exports}(p);var x=c(p.exports);var h=function(){var e=n.getCurrentInstance().proxy,t=n.ref(null),a=n.ref(!1),o=n.ref(1),i=n.computed((function(){return 1===o.value})),l=n.computed((function(){return o.value===e.totalPageNum})),c=0,s=n.computed((function(){for(var t=[],n=1;n<=e.totalPageNum;n++)t.push(n);return t}));n.watch((function(){return e.modelValue}),(function(t){n.nextTick((function(){t>=1&&t<=e.totalPageNum?o.value=t:o.value=t<1?1:e.totalPageNum,c=o.value}))}),{immediate:!0}),n.nextTick((function(){n.watch((function(){return e.totalPageNum}),(function(e){o.value>e&&(o.value=e)}))}));var d=function(){i.value||(o.value=o.value-1)},p=function(){l.value||(o.value=o.value+1)},f=function(){n.nextTick((function(){t.value.focus();var e=window.getSelection();e.selectAllChildren(t.value),e.collapseToEnd()}))},v=function(){a.value=!0},m=function(){a.value=!1,t.value.textContent="".concat(c),c!==o.value&&(o.value=c)},g=function(t){var n=t.target,a=Number(n.textContent);!a||a<1||a>e.totalPageNum||a===o.value||(c=a,f())},b=function(e){["Enter","NumpadEnter"].includes(e.code)&&(e.preventDefault(),m(),f())};return{current:o,render:function(){return n.createVNode("div",{class:"bk-pagination-small-list"},[n.createVNode("div",{class:{"bk-pagination-btn-pre":!0,"is-disabled":i.value},onClick:d},[n.createVNode(r.LeftShape,null,null)]),n.createVNode(u.default,{theme:"light",trigger:"click",arrow:!1,boundary:"body",placement:"bottom"},{default:function(){return n.createVNode("div",{class:{"bk-pagination-picker":!0,"is-focused":a.value}},[n.createVNode("span",{ref:t,class:"bk-pagination-editor",contenteditable:!0,spellcheck:"false",onFocus:v,onBlur:m,onInput:g,onKeydown:b},[o.value]),n.createVNode("span",null,[n.createTextVNode("/")]),n.createVNode("span",{class:"bk-pagination-small-list-total"},[e.totalPageNum])])},content:function(){return n.createVNode("div",{class:"bk-pagination-picker-list"},[s.value.map((function(e){return n.createVNode("div",{class:{item:!0,"is-actived":e===o.value},key:e,onClick:function(){return function(e){c=e,m()}(e)}},[e])}))])}}),n.createVNode("div",{class:{"bk-pagination-btn-next":!0,"is-disabled":l.value},onClick:p},[n.createVNode(r.RightShape,null,null)])])}}},N={modelValue:t.PropTypes.number.def(1),count:t.PropTypes.number.def(0).isRequired,limit:t.PropTypes.number.def(10),limitList:t.PropTypes.arrayOf(Number).def([10,20,50,100]),showLimit:t.PropTypes.bool.def(!0),type:t.PropTypes.oneOf(["default","compact"]).def("default"),location:t.PropTypes.oneOf(["left","right"]).def("right"),align:t.PropTypes.oneOf(["left","center","right"]).def("left"),size:t.PropTypes.size(),small:t.PropTypes.bool.def(!1),showTotalCount:t.PropTypes.bool.def(!0),prevText:t.PropTypes.string,nextText:t.PropTypes.string,disabled:t.PropTypes.bool.def(!1),layout:t.PropTypes.custom((function(e){var t={total:!0,list:!0,limit:!0};return e.some((function(e){return t[e]}))}),"layout 的值只支持 * total、list、limit *").def(["total","list","limit"])},y=n.defineComponent({name:"Pagination",props:N,emits:["update:modelValue","change","update:limit","limit-change"],setup:function(e,t){var o=n.ref(0),i=n.toRefs(e),u=i.count,c=i.limit,s=function(e){var t=e.isFirst,a=e.isLast,r=n.getCurrentInstance().props;return r.showTotalCount?n.createVNode("div",n.mergeProps({class:{"bk-pagination-total":!0,"is-first":t,"is-last":a}},{disabled:r.disabled}),[n.createTextVNode("共计"),n.createVNode("div",{class:"bk-pagination-total-num"},[r.count]),n.createTextVNode("条")]):null},d=function(){var e=n.getCurrentInstance().proxy,t=n.ref(1),a=n.computed((function(){return 1===t.value})),o=n.computed((function(){return t.value===e.totalPageNum})),i=n.ref(!1),l=n.ref(!1),u=n.computed((function(){i.value=!1,l.value=!1;var n=[];if(e.totalPageNum<=5){for(var a=2;a<=e.totalPageNum-1;a++)n.push(a);return n}var r=Math.floor(2.5);e.totalPageNum>5&&(i.value=t.value-r>2,l.value=t.value+r<e.totalPageNum-1);for(var o=Math.min(e.totalPageNum-5,Math.max(2,t.value-r)),u=o;u<o+5;u++)n.push(u);return n}));n.watch((function(){return e.modelValue}),(function(a){n.nextTick((function(){a>=1&&a<=e.totalPageNum?t.value=a:t.value=a<1?1:e.totalPageNum}))})),n.nextTick((function(){n.watch((function(){return e.totalPageNum}),(function(e){t.value>e&&(t.value=e)}))}));var c=function(){a.value||(t.value=t.value-1)},s=function(){o.value||(t.value=t.value+1)},d=function(e){e!==t.value&&(t.value=e)},p=function(){t.value=Math.max(1,t.value-5)},f=function(){t.value=Math.min(e.totalPageNum,t.value+5)};return{current:t,render:function(v){var m=v.isFirst,g=v.isLast;return n.createVNode("div",{class:{"bk-pagination-list":!0,"is-first":m,"is-last":g}},[n.createVNode("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":a.value},onClick:c},[e.prevText||n.createVNode(r.AngleLeft,null,null)]),n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":1===t.value},key:"1",onClick:function(){return d(1)}},[n.createTextVNode("1")]),i.value&&n.createVNode("div",{key:"pre-batch",class:"bk-pagination-list-pre-batch",onClick:p},[n.createVNode(r.Ellipsis,null,null)]),u.value.map((function(e){return n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e},key:e,onClick:function(){return d(e)}},[e])})),l.value&&n.createVNode("div",{key:"next-batch",class:"bk-pagination-list-next-batch",onClick:f},[n.createVNode(r.Ellipsis,null,null)]),e.totalPageNum>1&&n.createVNode("div",{class:{"bk-pagination-list-item":!0,"is-active":t.value===e.totalPageNum},key:"last",onClick:function(){return d(e.totalPageNum)}},[e.totalPageNum]),n.createVNode("div",{class:{"bk-pagination-list-pre":!0,"is-disabled":o.value},onClick:s},[e.nextText||n.createVNode(r.AngleRight,null,null)])])}}}(),p=d.current,f=d.render,v=h(),m=v.current,g=v.render,b=function(){var e=n.getCurrentInstance().proxy,t=n.ref(e.limit);n.watch((function(){return e.limit}),(function(e){t.value=e})),n.watch((function(){return e.limitList}),(function(e){n.nextTick((function(){if(!e.includes(t.value)){var n=x(e,1);t.value=n[0]}}))}),{immediate:!0});var r=function(e){t.value=e};return{limit:t,render:function(o){var i,u,c=o.isFirst,s=o.isLast;return e.showLimit?n.createVNode("div",n.mergeProps({class:{"bk-pagination-limit":!0,"is-first":c,"is-last":s}},{disabled:e.disabled}),[n.createVNode("div",null,[n.createTextVNode("每页")]),n.createVNode(l.default,{class:"bk-pagination-limit-select",clearable:!1,modelValue:t.value,onChange:r,disabled:e.disabled},(u=i=e.limitList.map((function(e,t){return n.createVNode(a.BkOption,{value:e,label:e,key:"".concat(t,"_").concat(e)},null)})),"function"==typeof u||"[object Object]"===Object.prototype.toString.call(u)&&!n.isVNode(u)?i:{default:function(){return[i]}})),n.createVNode("div",null,[n.createTextVNode("条")])]):null}}}(),N=b.limit,y=b.render;return n.watch([u,N,c],(function(e){var t=x(e,2),n=t[0],a=t[1],r=Math.ceil(n/a);o.value=r<1?1:r}),{immediate:!0}),n.watch(p,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),n.watch(m,(function(e){t.emit("update:modelValue",e),t.emit("change",e)})),n.watch(N,(function(e){t.emit("limit-change",e)})),{totalPageNum:o,renderTotal:s,renderList:f,renderLimit:y,renderSmallList:g}},render:function(){var e,a=this,r=t.classes((d(e={"bk-pagination":!0},"bk-pagination--".concat(this.size),!0),d(e,"is-align-".concat(this.align),!0),e)),o={total:this.renderTotal,list:this.small?this.renderSmallList:this.renderList,limit:this.renderLimit};return n.createVNode("div",{class:r},[this.layout.map((function(e,t){return o[e]({isFirst:0===t,isLast:t===a.layout.length-1})}))])}}),k=t.withInstall(y);e.BkPagination=k,e.default=k,Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -122,7 +122,7 @@ declare const _default: import("vue").DefineComponent<{
122
122
  default: () => string[];
123
123
  };
124
124
  }, {
125
- pageNum: import("vue").Ref<number>;
125
+ totalPageNum: import("vue").Ref<number>;
126
126
  renderTotal: ({ isFirst, isLast }: {
127
127
  isFirst: any;
128
128
  isLast: any;
@@ -2,5 +2,5 @@ import type { ComponentPublicInstance } from 'vue';
2
2
  import type { PaginationProps } from './pagination';
3
3
  export declare type IPaginationInstance = ComponentPublicInstance<PaginationProps, {
4
4
  limit: PaginationProps['limit'];
5
- pageNum: number;
5
+ totalPageNum: number;
6
6
  }>;
package/lib/tag/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("../shared"),require("vue"),require("../icon")):"function"==typeof define&&define.amd?define(["exports","../shared","vue","../icon"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue,e["@bkui-vue/icon/icons"])}(this,(function(e,t,o,s){"use strict";function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n={exports:{}};!function(e){e.exports=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},e.exports.__esModule=!0,e.exports.default=e.exports}(n);var l=r(n.exports),a=o.defineComponent({name:"Tag",props:{theme:t.PropTypes.theme(["success","info","warning","danger"]).def(""),closable:t.PropTypes.bool.def(!1),type:t.PropTypes.commonType(["","filled","stroke"]).def(""),checkable:t.PropTypes.bool.def(!1),checked:t.PropTypes.bool.def(!1),radius:t.PropTypes.string.def("2px"),extCls:t.PropTypes.string.def("")},emits:["change","close"],slots:["icon"],setup:function(e,s){var r=s.emit;return{wrapperCls:o.computed((function(){var o;return t.classes((o={"bk-tag-closable":e.closable,"bk-tag-checkable":e.checkable,"bk-tag-check":e.checked},l(o,"bk-tag-".concat(e.type),e.type),l(o,"bk-tag-".concat(e.theme),e.theme),l(o,e.extCls,!!e.extCls),o),"bk-tag")})),wrapperStyle:o.computed((function(){return{borderRadius:e.radius}})),handleClose:function(e){e.preventDefault(),e.stopPropagation(),r("close",e)},handleClick:function(t){t.preventDefault(),t.stopPropagation(),e.checkable&&r("change",!e.checked)}}},render:function(){var e,t;return o.createVNode("div",{class:this.wrapperCls,style:this.wrapperStyle,onClick:this.handleClick},[this.$slots.icon?o.createVNode("span",{class:"bk-tag-icon"},[this.$slots.icon()]):"",o.createVNode("span",null,[null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e)]),this.closable?o.createVNode(s.Error,{class:"bk-tag-close",onClick:this.handleClose},null):""])}}),c=t.withInstall(a);e.default=c,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("../shared"),require("vue"),require("../icon")):"function"==typeof define&&define.amd?define(["exports","../shared","vue","../icon"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue,e["@bkui-vue/icon/icons"])}(this,(function(e,t,o,s){"use strict";function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n={exports:{}};!function(e){e.exports=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},e.exports.__esModule=!0,e.exports.default=e.exports}(n);var a=r(n.exports),l=o.defineComponent({name:"Tag",props:{theme:t.PropTypes.theme(["success","info","warning","danger"]).def(""),closable:t.PropTypes.bool.def(!1),type:t.PropTypes.commonType(["","filled","stroke"]).def(""),checkable:t.PropTypes.bool.def(!1),checked:t.PropTypes.bool.def(!1),radius:t.PropTypes.string.def("2px"),extCls:t.PropTypes.string.def("")},emits:["change","close"],slots:["icon"],setup:function(e,s){var r=s.emit;return{wrapperCls:o.computed((function(){var o;return t.classes((o={"bk-tag-closable":e.closable,"bk-tag-checkable":e.checkable,"bk-tag-check":e.checked},a(o,"bk-tag-".concat(e.type),e.type),a(o,"bk-tag-".concat(e.theme),e.theme),a(o,e.extCls,!!e.extCls),o),"bk-tag")})),wrapperStyle:o.computed((function(){return{borderRadius:e.radius}})),handleClose:function(e){e.preventDefault(),e.stopPropagation(),r("close",e)},handleClick:function(t){t.preventDefault(),t.stopPropagation(),e.checkable&&r("change",!e.checked)}}},render:function(){var e,t;return o.createVNode("div",{class:this.wrapperCls,style:this.wrapperStyle,onClick:this.handleClick},[this.$slots.icon?o.createVNode("span",{class:"bk-tag-icon"},[this.$slots.icon()]):"",o.createVNode("span",{class:"bk-tag-text"},[null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e)]),this.closable?o.createVNode(s.Error,{class:"bk-tag-close",onClick:this.handleClose},null):""])}}),c=t.withInstall(l);e.default=c,Object.defineProperty(e,"__esModule",{value:!0})}));
package/lib/tag/tag.css CHANGED
@@ -1,5 +1,6 @@
1
1
  .bk-tag {
2
- display: inline-block;
2
+ display: inline-flex;
3
+ align-items: center;
3
4
  height: 22px;
4
5
  padding: 0 10px;
5
6
  margin: 2px 6px 2px 0px;
@@ -75,17 +76,22 @@
75
76
  background: #3a84ff;
76
77
  opacity: 1;
77
78
  }
79
+ .bk-tag .bk-tag-text {
80
+ flex: 1;
81
+ overflow: hidden;
82
+ text-overflow: ellipsis;
83
+ white-space: nowrap;
84
+ }
78
85
  .bk-tag .bk-tag-icon {
79
- display: inline-block;
86
+ flex-shrink: 0;
80
87
  margin-right: 4px;
81
88
  font-size: 14px;
82
89
  line-height: 0;
83
90
  }
84
91
  .bk-tag .bk-tag-close {
85
- display: inline-block;
92
+ flex-shrink: 0;
86
93
  margin-left: 4px;
87
94
  font-size: 12px;
88
95
  line-height: 0;
89
- vertical-align: 1px;
90
96
  cursor: pointer;
91
97
  }
package/lib/tag/tag.less CHANGED
@@ -22,7 +22,8 @@
22
22
  @themeSelectors: success, info, warning, danger;
23
23
 
24
24
  .bk-tag {
25
- display: inline-block;
25
+ display: inline-flex;
26
+ align-items: center;
26
27
  height: 22px;
27
28
  padding: 0 10px;
28
29
  margin: 2px 6px 2px 0px;
@@ -88,19 +89,25 @@
88
89
  }
89
90
  }
90
91
 
92
+ .bk-tag-text {
93
+ flex: 1;
94
+ overflow: hidden;
95
+ text-overflow: ellipsis;
96
+ white-space: nowrap;
97
+ }
98
+
91
99
  .bk-tag-icon {
92
- display: inline-block;
100
+ flex-shrink: 0;
93
101
  margin-right: 4px;
94
102
  font-size: 14px;
95
103
  line-height: 0;
96
104
  }
97
105
 
98
106
  .bk-tag-close {
99
- display: inline-block;
107
+ flex-shrink: 0;
100
108
  margin-left: 4px;
101
109
  font-size: 12px;
102
110
  line-height: 0;
103
- vertical-align: 1px;
104
111
  cursor: pointer;
105
112
  }
106
113
  }
@@ -92,7 +92,8 @@
92
92
  --table-row-hover-bg-color: #f5f7fa;
93
93
  }
94
94
  .bk-tag {
95
- display: inline-block;
95
+ display: inline-flex;
96
+ align-items: center;
96
97
  height: 22px;
97
98
  padding: 0 10px;
98
99
  margin: 2px 6px 2px 0px;
@@ -168,17 +169,22 @@
168
169
  background: var(--primary-color);
169
170
  opacity: 1;
170
171
  }
172
+ .bk-tag .bk-tag-text {
173
+ flex: 1;
174
+ overflow: hidden;
175
+ text-overflow: ellipsis;
176
+ white-space: nowrap;
177
+ }
171
178
  .bk-tag .bk-tag-icon {
172
- display: inline-block;
179
+ flex-shrink: 0;
173
180
  margin-right: 4px;
174
181
  font-size: 14px;
175
182
  line-height: 0;
176
183
  }
177
184
  .bk-tag .bk-tag-close {
178
- display: inline-block;
185
+ flex-shrink: 0;
179
186
  margin-left: 4px;
180
187
  font-size: 12px;
181
188
  line-height: 0;
182
- vertical-align: 1px;
183
189
  cursor: pointer;
184
190
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkui-vue",
3
- "version": "0.0.1-beta.26",
3
+ "version": "0.0.1-beta.27",
4
4
  "workspaces": {
5
5
  "packages": [
6
6
  "packages/!(**.bak)*"