bkui-vue 0.0.1-beta.224 → 0.0.1-beta.226

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.
package/dist/index.esm.js CHANGED
@@ -16185,6 +16185,7 @@ var BORDER_OPTION = /* @__PURE__ */ ((BORDER_OPTION2) => {
16185
16185
  BORDER_OPTION2["ROW"] = "row";
16186
16186
  BORDER_OPTION2["COL"] = "col";
16187
16187
  BORDER_OPTION2["OUTER"] = "outer";
16188
+ BORDER_OPTION2["HORIZONTAL"] = "horizontal";
16188
16189
  return BORDER_OPTION2;
16189
16190
  })(BORDER_OPTION || {});
16190
16191
  var ROW_HOVER = /* @__PURE__ */ ((ROW_HOVER2) => {
@@ -19348,6 +19349,31 @@ const getCharLength = (str) => {
19348
19349
  }
19349
19350
  return bitLen;
19350
19351
  };
19352
+ const useTagsOverflow = (tagInputRef, collapseTags, selectedTagList) => {
19353
+ watch([selectedTagList, collapseTags], () => {
19354
+ calcOverflow();
19355
+ }, { flush: "post" });
19356
+ const overflowTagIndex = ref(null);
19357
+ const calcOverflow = () => {
19358
+ if (!collapseTags.value)
19359
+ return;
19360
+ overflowTagIndex.value = null;
19361
+ setTimeout(() => {
19362
+ const tags = Array.from(tagInputRef.value.querySelectorAll(".tag-item"));
19363
+ const tagIndexInSecondRow = tags.findIndex((currentTag, index) => {
19364
+ if (!index) {
19365
+ return false;
19366
+ }
19367
+ const previousTag = tags[index - 1];
19368
+ return previousTag.offsetTop !== currentTag.offsetTop;
19369
+ });
19370
+ overflowTagIndex.value = tagIndexInSecondRow > 0 ? tagIndexInSecondRow - 1 : null;
19371
+ });
19372
+ };
19373
+ return {
19374
+ overflowTagIndex
19375
+ };
19376
+ };
19351
19377
  var ListTagRender = defineComponent({
19352
19378
  name: "ListTagRender",
19353
19379
  props: {
@@ -19424,6 +19450,10 @@ const tagProps = () => ({
19424
19450
  popoverProps: {
19425
19451
  type: Object,
19426
19452
  default: () => ({})
19453
+ },
19454
+ collapseTags: {
19455
+ type: Boolean,
19456
+ default: false
19427
19457
  }
19428
19458
  });
19429
19459
  var TagRender = defineComponent({
@@ -20090,6 +20120,10 @@ var Component$d = defineComponent({
20090
20120
  listState.localList.push(data2);
20091
20121
  }
20092
20122
  };
20123
+ const localCollapseTags = computed(() => props2.collapseTags ? props2.collapseTags && !state.isEdit : props2.collapseTags);
20124
+ const {
20125
+ overflowTagIndex
20126
+ } = useTagsOverflow(bkTagSelectorRef, localCollapseTags, tagList);
20093
20127
  return __spreadProps(__spreadValues(__spreadValues(__spreadValues({
20094
20128
  popoverProps
20095
20129
  }, toRefs(state)), toRefs(listState)), toRefs(pageState)), {
@@ -20105,6 +20139,8 @@ var Component$d = defineComponent({
20105
20139
  selectorListRef,
20106
20140
  popoverRef,
20107
20141
  triggerClass,
20142
+ overflowTagIndex,
20143
+ localCollapseTags,
20108
20144
  focusInputTrigger,
20109
20145
  activeClass,
20110
20146
  handleInput,
@@ -20151,8 +20187,12 @@ var Component$d = defineComponent({
20151
20187
  content: item[this.tooltipKey],
20152
20188
  disabled: !this.tooltipKey
20153
20189
  };
20190
+ const isOverflow = this.localCollapseTags && this.overflowTagIndex && index >= this.overflowTagIndex;
20154
20191
  return withDirectives(createVNode("li", {
20155
20192
  "class": "tag-item",
20193
+ "style": {
20194
+ display: isOverflow ? "none" : ""
20195
+ },
20156
20196
  "onClick": this.tagFocus
20157
20197
  }, [createVNode(TagRender, {
20158
20198
  "node": item,
@@ -20177,7 +20217,13 @@ var Component$d = defineComponent({
20177
20217
  "onBlur": this.handleBlur,
20178
20218
  "onKeydown": this.handleKeydown,
20179
20219
  "onPaste": this.handlePaste
20180
- }, null), [[vModelText, this.curInputValue]])]), [[vShow, this.isEdit]])]), withDirectives(createVNode("p", {
20220
+ }, null), [[vModelText, this.curInputValue]])]), [[vShow, this.isEdit]]), !!this.overflowTagIndex && this.localCollapseTags && createVNode("li", {
20221
+ "class": "tag-item"
20222
+ }, [createVNode("div", {
20223
+ "class": "tag"
20224
+ }, [createVNode("span", {
20225
+ "class": "text"
20226
+ }, [createTextVNode("+"), this.selectedTagList.length - this.overflowTagIndex])])])]), withDirectives(createVNode("p", {
20181
20227
  "class": "placeholder"
20182
20228
  }, [this.placeholder]), [[vShow, this.isShowPlaceholder]]), (_c = (_b = (_a = this.$slots) == null ? void 0 : _a.suffix) == null ? void 0 : _b.call(_a)) != null ? _c : this.isShowClear && createVNode(close$1, {
20183
20229
  "class": "clear-icon",
@@ -28272,15 +28318,17 @@ var useTreeInit = (props2) => {
28272
28318
  deep: true
28273
28319
  });
28274
28320
  if (props2.selectable) {
28275
- watch(() => props2.selected, (newData) => {
28276
- afterSelectWatch.length = 0;
28277
- afterSelectEvents.forEach((event) => {
28278
- Reflect.apply(event, globalThis, [newData]);
28279
- afterSelectWatch.push(() => Reflect.apply(event, globalThis, [newData]));
28321
+ onMounted(() => {
28322
+ watch(() => props2.selected, (newData) => {
28323
+ afterSelectWatch.length = 0;
28324
+ afterSelectEvents.forEach((event) => {
28325
+ Reflect.apply(event, globalThis, [newData]);
28326
+ afterSelectWatch.push(() => Reflect.apply(event, globalThis, [newData]));
28327
+ });
28328
+ registerNextLoop("afterSelectWatch", afterSelectWatch);
28329
+ }, {
28330
+ immediate: true
28280
28331
  });
28281
- registerNextLoop("afterSelectWatch", afterSelectWatch);
28282
- }, {
28283
- immediate: true
28284
28332
  });
28285
28333
  }
28286
28334
  const afterDataUpdate = (callFn) => {