@blueking/bk-user-selector 0.0.10 → 0.0.12

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.
@@ -3,7 +3,7 @@
3
3
  })(this, function(exports2, vue, bkuiVue) {
4
4
  "use strict";
5
5
  var __vite_style__ = document.createElement("style");
6
- __vite_style__.textContent = ".me-tag[data-v-887b7c44] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background-color: #e1ecff;\n color: #4d4f56;\n border-radius: 50%;\n padding: 0 8px;\n height: 24px;\n width: 24px;\n cursor: pointer;\n font-size: 12px;\n position: absolute;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n z-index: 1;\n}\n.me-tag[data-v-887b7c44]:hover {\n background-color: #cddffe;\n color: #3a84ff;\n}\n.me-tag.disabled[data-v-887b7c44] {\n background-color: #f0f1f5;\n color: #c4c6cc;\n cursor: not-allowed;\n}.dropdown-content[data-v-01b75e6e] {\n min-height: 40px;\n max-height: 300px;\n overflow-y: auto;\n padding: 5px 0;\n}\n.dropdown-content .no-data[data-v-01b75e6e] {\n padding: 10px;\n text-align: center;\n color: #979ba5;\n}\n.dropdown-content .user-group .group-header[data-v-01b75e6e] {\n padding: 8px 12px;\n color: #979ba5;\n display: flex;\n align-items: center;\n}\n.dropdown-content .user-group .group-header .group-count[data-v-01b75e6e] {\n margin-left: 4px;\n}\n.dropdown-content .user-option[data-v-01b75e6e] {\n padding: 8px 12px;\n cursor: pointer;\n display: flex;\n align-items: center;\n height: 32px;\n}\n.dropdown-content .user-option[data-v-01b75e6e]:hover {\n background-color: #f5f7fa;\n}\n.dropdown-content .user-option .tenant-name[data-v-01b75e6e] {\n color: #f59500;\n margin-left: 4px;\n padding: 0 4px;\n}.bk-user-selector-popover.bk-popover.bk-pop2-content {\n padding: 0;\n}.user-tag[data-v-203c36cb] {\n margin-right: 4px;\n}\n.user-tag.draggable[data-v-203c36cb] {\n cursor: move;\n}\n.user-tag.active[data-v-203c36cb] {\n background-color: #e1ecff;\n border-color: #3a84ff;\n}\n.user-tag .tag-content .user-name[data-v-203c36cb] {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: 12px;\n}\n.user-tag .tag-content .tenant-name[data-v-203c36cb] {\n color: #f59500;\n margin-left: 3px;\n white-space: nowrap;\n padding: 0 3px;\n border-radius: 2px;\n}.multiple-selector[data-v-1a376d26] {\n position: relative;\n width: 100%;\n}\n.multiple-selector .tags-container[data-v-1a376d26] {\n min-height: 32px;\n border: 1px solid #dcdee5;\n border-radius: 2px;\n padding: 1px 10px 1px 8px;\n transition: all 0.2s ease;\n background-color: #fff;\n}\n.multiple-selector .tags-container.focused[data-v-1a376d26] {\n border-color: #3a84ff;\n box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);\n}\n.multiple-selector .tags-container.collapsed[data-v-1a376d26] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n}\n.multiple-selector .tag-list[data-v-1a376d26] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n}\n.multiple-selector .tag-wrapper[data-v-1a376d26] {\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n}\n.multiple-selector .search-input[data-v-1a376d26] {\n outline: none;\n border: none;\n height: 28px;\n min-width: 10px;\n background: transparent;\n}\n.multiple-selector .search-input[data-v-1a376d26]::placeholder {\n color: #c4c6cc;\n}\n.multiple-selector .search-input.inline[data-v-1a376d26] {\n min-width: 10px;\n}\n.multiple-selector .search-input.last[data-v-1a376d26], .multiple-selector .search-input.collapsed[data-v-1a376d26] {\n flex: 1;\n min-width: 60px;\n}.single-selector[data-v-22d9b76f] {\n position: relative;\n width: 100%;\n}\n.input-container[data-v-22d9b76f] {\n position: relative;\n display: flex;\n align-items: center;\n min-height: 32px;\n border: 1px solid #dcdee5;\n border-radius: 2px;\n padding: 0 8px;\n background-color: #fff;\n}\n.input-container[data-v-22d9b76f]:focus-within {\n border-color: #3a84ff;\n box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);\n}\n.search-input[data-v-22d9b76f] {\n flex: 1;\n outline: none;\n border: none;\n height: 30px;\n background: transparent;\n}\n.search-input[data-v-22d9b76f]::placeholder {\n color: #c4c6cc;\n}\n.selected-user[data-v-22d9b76f] {\n display: inline-flex;\n align-items: center;\n background-color: #f0f1f5;\n border-radius: 2px;\n padding: 0 8px;\n margin-right: 8px;\n height: 24px;\n max-width: calc(100% - 32px);\n}\n.selected-user .tenant-name[data-v-22d9b76f] {\n color: #f59500;\n margin-left: 4px;\n}\n.selected-user .close-icon[data-v-22d9b76f] {\n margin-left: 4px;\n cursor: pointer;\n font-style: normal;\n}.bk-user-selector[data-v-84252deb] {\n width: 100%;\n position: relative;\n font-size: 12px;\n}/*$vite$:1*/";
6
+ __vite_style__.textContent = ".me-tag[data-v-887b7c44] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background-color: #e1ecff;\n color: #4d4f56;\n border-radius: 50%;\n padding: 0 8px;\n height: 24px;\n width: 24px;\n cursor: pointer;\n font-size: 12px;\n position: absolute;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n z-index: 1;\n}\n.me-tag[data-v-887b7c44]:hover {\n background-color: #cddffe;\n color: #3a84ff;\n}\n.me-tag.disabled[data-v-887b7c44] {\n background-color: #f0f1f5;\n color: #c4c6cc;\n cursor: not-allowed;\n}.dropdown-content[data-v-05b232a4] {\n min-height: 40px;\n max-height: 300px;\n overflow-y: auto;\n padding: 5px 0;\n}\n.dropdown-content .no-data[data-v-05b232a4] {\n padding: 10px;\n text-align: center;\n color: #979ba5;\n}\n.dropdown-content .user-group .group-header[data-v-05b232a4] {\n padding: 8px 12px;\n color: #979ba5;\n display: flex;\n align-items: center;\n}\n.dropdown-content .user-group .group-header .group-count[data-v-05b232a4] {\n margin-left: 4px;\n}\n.dropdown-content .user-option[data-v-05b232a4] {\n padding: 8px 12px;\n cursor: pointer;\n display: flex;\n align-items: center;\n height: 32px;\n}\n.dropdown-content .user-option[data-v-05b232a4]:hover {\n background-color: #f5f7fa;\n}\n.dropdown-content .user-option .tenant-name[data-v-05b232a4] {\n color: #f59500;\n margin-left: 4px;\n padding: 0 4px;\n}.bk-user-selector-popover.bk-popover.bk-pop2-content {\n padding: 0;\n}.user-tag[data-v-87c12feb] {\n margin-right: 4px;\n margin-left: 0;\n}\n.user-tag.draggable[data-v-87c12feb] {\n cursor: move;\n}\n.user-tag.active[data-v-87c12feb] {\n background-color: #e1ecff;\n border-color: #3a84ff;\n}\n.user-tag .tag-content .user-name[data-v-87c12feb] {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: 12px;\n}\n.user-tag .tag-content .tenant-name[data-v-87c12feb] {\n color: #f59500;\n margin-left: 3px;\n white-space: nowrap;\n padding: 0 3px;\n border-radius: 2px;\n}.multiple-selector[data-v-a884849e] {\n position: relative;\n width: 100%;\n}\n.multiple-selector .tags-container[data-v-a884849e] {\n min-height: 32px;\n border: 1px solid #dcdee5;\n border-radius: 2px;\n padding: 1px 10px 1px 8px;\n transition: all 0.2s ease;\n background-color: #fff;\n}\n.multiple-selector .tags-container.focused[data-v-a884849e] {\n border-color: #3a84ff;\n box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);\n}\n.multiple-selector .tags-container.collapsed[data-v-a884849e] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n}\n.multiple-selector .tag-list[data-v-a884849e] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n}\n.multiple-selector .tag-wrapper[data-v-a884849e] {\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n}\n.multiple-selector .search-input[data-v-a884849e] {\n outline: none;\n border: none;\n height: 28px;\n min-width: 10px;\n background: transparent;\n}\n.multiple-selector .search-input[data-v-a884849e]::placeholder {\n color: #c4c6cc;\n}\n.multiple-selector .search-input.inline[data-v-a884849e] {\n min-width: 10px;\n}\n.multiple-selector .search-input.last[data-v-a884849e], .multiple-selector .search-input.collapsed[data-v-a884849e] {\n flex: 1;\n min-width: 60px;\n}.single-selector[data-v-ad0d9e2e] {\n position: relative;\n width: 100%;\n}\n.input-container[data-v-ad0d9e2e] {\n position: relative;\n display: flex;\n align-items: center;\n min-height: 32px;\n border: 1px solid #dcdee5;\n border-radius: 2px;\n padding: 0 8px;\n background-color: #fff;\n}\n.input-container[data-v-ad0d9e2e]:focus-within {\n border-color: #3a84ff;\n box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);\n}\n.search-input[data-v-ad0d9e2e] {\n flex: 1;\n outline: none;\n border: none;\n height: 30px;\n background: transparent;\n}\n.search-input[data-v-ad0d9e2e]::placeholder {\n color: #c4c6cc;\n}\n.selected-user[data-v-ad0d9e2e] {\n display: inline-flex;\n align-items: center;\n background-color: #f0f1f5;\n border-radius: 2px;\n padding: 0 8px;\n margin-right: 8px;\n height: 24px;\n max-width: calc(100% - 32px);\n}\n.selected-user .tenant-name[data-v-ad0d9e2e] {\n color: #f59500;\n margin-left: 4px;\n}\n.selected-user .close-icon[data-v-ad0d9e2e] {\n margin-left: 4px;\n cursor: pointer;\n font-style: normal;\n}.bk-user-selector[data-v-6fd92757] {\n width: 100%;\n position: relative;\n font-size: 12px;\n}/*$vite$:1*/";
7
7
  document.head.appendChild(__vite_style__);
8
8
  const getTenants = async (apiBaseUrl, tenantId) => {
9
9
  if (!apiBaseUrl || !tenantId) {
@@ -53,7 +53,8 @@
53
53
  return [];
54
54
  }
55
55
  };
56
- const lookupUsers = async (apiBaseUrl = "", tenantId = "", exactSearchKey = "bk_username", users = []) => {
56
+ const lookupUsers = async (apiBaseUrl = "", tenantId = "", exactSearchKey = "bk_username", usersList = []) => {
57
+ const users = usersList.filter((user) => user).map((user) => user.trim());
57
58
  if (users.length === 0 || !apiBaseUrl || !tenantId) {
58
59
  console.warn("批量查找用户需要提供有效的apiBaseUrl、租户ID和至少一个用户名");
59
60
  return [];
@@ -3096,6 +3097,13 @@
3096
3097
  userGroupName: {
3097
3098
  type: String,
3098
3099
  default: "用户群组"
3100
+ },
3101
+ /**
3102
+ * 无匹配人员时的提示文本
3103
+ */
3104
+ emptyText: {
3105
+ type: String,
3106
+ default: "无匹配人员"
3099
3107
  }
3100
3108
  },
3101
3109
  emits: ["select-user"],
@@ -3145,7 +3153,7 @@
3145
3153
  vue.createElementVNode(
3146
3154
  "span",
3147
3155
  null,
3148
- vue.toDisplayString(__props.searchQuery.length > 1 ? "未找到匹配用户" : "请输入关键词搜索"),
3156
+ vue.toDisplayString(__props.searchQuery.length > 1 ? __props.emptyText : "请至少输入2个字符搜索"),
3149
3157
  1
3150
3158
  /* TEXT */
3151
3159
  )
@@ -3228,7 +3236,7 @@
3228
3236
  };
3229
3237
  }
3230
3238
  });
3231
- const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-01b75e6e"]]);
3239
+ const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-05b232a4"]]);
3232
3240
  const _hoisted_1$3 = { class: "tag-content" };
3233
3241
  const _hoisted_2$2 = { class: "user-name" };
3234
3242
  const _hoisted_3$2 = {
@@ -3288,7 +3296,7 @@
3288
3296
  };
3289
3297
  }
3290
3298
  });
3291
- const UserTag = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-203c36cb"]]);
3299
+ const UserTag = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-87c12feb"]]);
3292
3300
  const _hoisted_1$2 = ["onClick"];
3293
3301
  const _hoisted_2$1 = ["placeholder"];
3294
3302
  const _hoisted_3$1 = ["placeholder"];
@@ -3308,7 +3316,8 @@
3308
3316
  currentUserId: { default: "" },
3309
3317
  exactSearchKey: { default: "bk_username" },
3310
3318
  userGroup: { default: () => [] },
3311
- userGroupName: { default: "用户群组" }
3319
+ userGroupName: { default: "用户群组" },
3320
+ emptyText: { default: "无匹配人员" }
3312
3321
  },
3313
3322
  emits: ["update:selectedUsers", "add-user", "remove-user"],
3314
3323
  setup(__props, { emit: __emit }) {
@@ -3385,7 +3394,13 @@
3385
3394
  }
3386
3395
  });
3387
3396
  };
3388
- const handleClickOutside = () => {
3397
+ const handleClickOutside = ({ event }) => {
3398
+ event.stopPropagation();
3399
+ const target = event.target;
3400
+ const container = containerRef.value;
3401
+ if ((container == null ? void 0 : container.contains(target)) || container === target) {
3402
+ return;
3403
+ }
3389
3404
  isFocused.value = false;
3390
3405
  showDropdown.value = false;
3391
3406
  activeTagIndex.value = -1;
@@ -3494,7 +3509,14 @@
3494
3509
  emit("add-user", user);
3495
3510
  }
3496
3511
  searchQuery.value = "";
3497
- showDropdown.value = false;
3512
+ setTimeout(() => {
3513
+ showDropdown.value = false;
3514
+ }, 220);
3515
+ vue.nextTick(() => {
3516
+ if (lastInputRef.value) {
3517
+ lastInputRef.value.focus();
3518
+ }
3519
+ });
3498
3520
  };
3499
3521
  const removeUser = (user) => {
3500
3522
  if (!(user == null ? void 0 : user.id)) return;
@@ -3543,200 +3565,206 @@
3543
3565
  });
3544
3566
  });
3545
3567
  return (_ctx, _cache) => {
3546
- return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
3547
- ref_key: "containerRef",
3548
- ref: containerRef,
3549
- class: "multiple-selector"
3550
- }, [
3551
- vue.createCommentVNode(" 聚焦状态 - 可编辑模式 "),
3552
- isFocused.value ? (vue.openBlock(), vue.createElementBlock(
3553
- "div",
3554
- {
3555
- key: 0,
3556
- ref_key: "tagsContainerRef",
3557
- ref: tagsContainerRef,
3558
- class: "tags-container focused",
3559
- onClick: vue.withModifiers(handleContainerClick, ["stop"])
3560
- },
3561
- [
3562
- vue.createCommentVNode(" 用户标签列表 "),
3563
- vue.createElementVNode(
3564
- "div",
3565
- {
3566
- ref_key: "sortableContainerRef",
3567
- ref: sortableContainerRef,
3568
- class: "tag-list"
3569
- },
3570
- [
3571
- (vue.openBlock(true), vue.createElementBlock(
3572
- vue.Fragment,
3573
- null,
3574
- vue.renderList(_ctx.selectedUsers, (user, index) => {
3575
- return vue.openBlock(), vue.createElementBlock("div", {
3576
- class: "tag-wrapper",
3577
- key: user.id,
3578
- onClick: vue.withModifiers(($event) => handleTagClick(index), ["stop"])
3579
- }, [
3580
- vue.createVNode(UserTag, {
3581
- active: index === activeTagIndex.value,
3568
+ return vue.openBlock(), vue.createElementBlock(
3569
+ "div",
3570
+ {
3571
+ ref_key: "containerRef",
3572
+ ref: containerRef,
3573
+ class: "multiple-selector"
3574
+ },
3575
+ [
3576
+ vue.createCommentVNode(" 聚焦状态 - 可编辑模式 "),
3577
+ isFocused.value ? (vue.openBlock(), vue.createElementBlock(
3578
+ "div",
3579
+ {
3580
+ key: 0,
3581
+ ref_key: "tagsContainerRef",
3582
+ ref: tagsContainerRef,
3583
+ class: "tags-container focused",
3584
+ onClick: vue.withModifiers(handleContainerClick, ["stop"])
3585
+ },
3586
+ [
3587
+ vue.createCommentVNode(" 用户标签列表 "),
3588
+ vue.createElementVNode(
3589
+ "div",
3590
+ {
3591
+ ref_key: "sortableContainerRef",
3592
+ ref: sortableContainerRef,
3593
+ class: "tag-list"
3594
+ },
3595
+ [
3596
+ (vue.openBlock(true), vue.createElementBlock(
3597
+ vue.Fragment,
3598
+ null,
3599
+ vue.renderList(_ctx.selectedUsers, (user, index) => {
3600
+ return vue.openBlock(), vue.createElementBlock("div", {
3601
+ class: "tag-wrapper",
3602
+ key: user.id,
3603
+ onClick: vue.withModifiers(($event) => handleTagClick(index), ["stop"])
3604
+ }, [
3605
+ vue.createVNode(UserTag, {
3606
+ active: index === activeTagIndex.value,
3607
+ "current-tenant-id": _ctx.tenantId,
3608
+ draggable: _ctx.draggable,
3609
+ tenants: _ctx.tenants,
3610
+ user,
3611
+ onClick: ($event) => handleTagClick(index),
3612
+ onClose: ($event) => removeUser(user)
3613
+ }, null, 8, ["active", "current-tenant-id", "draggable", "tenants", "user", "onClick", "onClose"]),
3614
+ vue.createCommentVNode(" 在当前激活标签后插入输入框 "),
3615
+ index === activeTagIndex.value && activeTagIndex.value !== _ctx.selectedUsers.length - 1 ? vue.withDirectives((vue.openBlock(), vue.createElementBlock(
3616
+ "input",
3617
+ {
3618
+ key: 0,
3619
+ ref_for: true,
3620
+ ref_key: "inlineInputRef",
3621
+ ref: inlineInputRef,
3622
+ class: "search-input inline",
3623
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(searchQuery) ? searchQuery.value = $event : null),
3624
+ onFocus: handleInputFocus,
3625
+ onInput: handleInput,
3626
+ onKeydown: handleKeyDown,
3627
+ onPaste: handlePaste
3628
+ },
3629
+ null,
3630
+ 544
3631
+ /* NEED_HYDRATION, NEED_PATCH */
3632
+ )), [
3633
+ [vue.vModelText, vue.unref(searchQuery)]
3634
+ ]) : vue.createCommentVNode("v-if", true)
3635
+ ], 8, _hoisted_1$2);
3636
+ }),
3637
+ 128
3638
+ /* KEYED_FRAGMENT */
3639
+ )),
3640
+ vue.createCommentVNode(" 最后一个输入框 "),
3641
+ activeTagIndex.value === -1 || activeTagIndex.value === _ctx.selectedUsers.length - 1 ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
3642
+ key: 0,
3643
+ ref_key: "lastInputRef",
3644
+ ref: lastInputRef,
3645
+ class: "search-input last",
3646
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(searchQuery) ? searchQuery.value = $event : null),
3647
+ placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
3648
+ onFocus: handleInputFocus,
3649
+ onInput: handleInput,
3650
+ onKeydown: handleKeyDown,
3651
+ onPaste: handlePaste
3652
+ }, null, 40, _hoisted_2$1)), [
3653
+ [vue.vModelText, vue.unref(searchQuery)]
3654
+ ]) : vue.createCommentVNode("v-if", true),
3655
+ vue.createCommentVNode(' "我"标签 '),
3656
+ vue.createVNode(MeTag, {
3657
+ "current-user-id": _ctx.currentUserId,
3658
+ "is-disabled": !!_ctx.currentUserId && _ctx.selectedUsers.some((user) => user.id === _ctx.currentUserId),
3659
+ onClick: addCurrentUser
3660
+ }, null, 8, ["current-user-id", "is-disabled"])
3661
+ ],
3662
+ 512
3663
+ /* NEED_PATCH */
3664
+ )
3665
+ ],
3666
+ 512
3667
+ /* NEED_PATCH */
3668
+ )) : (vue.openBlock(), vue.createElementBlock(
3669
+ vue.Fragment,
3670
+ { key: 1 },
3671
+ [
3672
+ vue.createCommentVNode(" 未聚焦状态 - 只读展示模式 "),
3673
+ vue.createElementVNode(
3674
+ "div",
3675
+ {
3676
+ ref_key: "collapsedContainerRef",
3677
+ ref: collapsedContainerRef,
3678
+ class: "tags-container collapsed",
3679
+ onClick: vue.withModifiers(handleFocus, ["stop"])
3680
+ },
3681
+ [
3682
+ (vue.openBlock(true), vue.createElementBlock(
3683
+ vue.Fragment,
3684
+ null,
3685
+ vue.renderList(visibleUsers.value, (user) => {
3686
+ return vue.openBlock(), vue.createBlock(UserTag, {
3582
3687
  "current-tenant-id": _ctx.tenantId,
3583
- draggable: _ctx.draggable,
3688
+ key: user.id,
3689
+ "show-tenant": true,
3584
3690
  tenants: _ctx.tenants,
3585
3691
  user,
3586
- onClick: ($event) => handleTagClick(index),
3692
+ onClick: handleFocus,
3587
3693
  onClose: ($event) => removeUser(user)
3588
- }, null, 8, ["active", "current-tenant-id", "draggable", "tenants", "user", "onClick", "onClose"]),
3589
- vue.createCommentVNode(" 在当前激活标签后插入输入框 "),
3590
- index === activeTagIndex.value && activeTagIndex.value !== _ctx.selectedUsers.length - 1 ? vue.withDirectives((vue.openBlock(), vue.createElementBlock(
3591
- "input",
3592
- {
3593
- key: 0,
3594
- ref_for: true,
3595
- ref_key: "inlineInputRef",
3596
- ref: inlineInputRef,
3597
- class: "search-input inline",
3598
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(searchQuery) ? searchQuery.value = $event : null),
3599
- onFocus: handleInputFocus,
3600
- onInput: handleInput,
3601
- onKeydown: handleKeyDown,
3602
- onPaste: handlePaste
3603
- },
3604
- null,
3605
- 544
3606
- /* NEED_HYDRATION, NEED_PATCH */
3607
- )), [
3608
- [vue.vModelText, vue.unref(searchQuery)]
3609
- ]) : vue.createCommentVNode("v-if", true)
3610
- ], 8, _hoisted_1$2);
3611
- }),
3612
- 128
3613
- /* KEYED_FRAGMENT */
3614
- )),
3615
- vue.createCommentVNode(" 最后一个输入框 "),
3616
- activeTagIndex.value === -1 || activeTagIndex.value === _ctx.selectedUsers.length - 1 ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
3617
- key: 0,
3618
- ref_key: "lastInputRef",
3619
- ref: lastInputRef,
3620
- class: "search-input last",
3621
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(searchQuery) ? searchQuery.value = $event : null),
3622
- placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
3623
- onFocus: handleInputFocus,
3624
- onInput: handleInput,
3625
- onKeydown: handleKeyDown,
3626
- onPaste: handlePaste
3627
- }, null, 40, _hoisted_2$1)), [
3628
- [vue.vModelText, vue.unref(searchQuery)]
3629
- ]) : vue.createCommentVNode("v-if", true),
3630
- vue.createCommentVNode(' "我"标签 '),
3631
- vue.createVNode(MeTag, {
3632
- "current-user-id": _ctx.currentUserId,
3633
- "is-disabled": !!_ctx.currentUserId && _ctx.selectedUsers.some((user) => user.id === _ctx.currentUserId),
3634
- onClick: addCurrentUser
3635
- }, null, 8, ["current-user-id", "is-disabled"])
3636
- ],
3637
- 512
3638
- /* NEED_PATCH */
3639
- )
3640
- ],
3641
- 512
3642
- /* NEED_PATCH */
3643
- )) : (vue.openBlock(), vue.createElementBlock(
3644
- vue.Fragment,
3645
- { key: 1 },
3646
- [
3647
- vue.createCommentVNode(" 未聚焦状态 - 只读展示模式 "),
3648
- vue.createElementVNode(
3649
- "div",
3650
- {
3651
- ref_key: "collapsedContainerRef",
3652
- ref: collapsedContainerRef,
3653
- class: "tags-container collapsed",
3654
- onClick: vue.withModifiers(handleFocus, ["stop"])
3655
- },
3656
- [
3657
- (vue.openBlock(true), vue.createElementBlock(
3658
- vue.Fragment,
3659
- null,
3660
- vue.renderList(visibleUsers.value, (user) => {
3661
- return vue.openBlock(), vue.createBlock(UserTag, {
3662
- "current-tenant-id": _ctx.tenantId,
3663
- key: user.id,
3664
- "show-tenant": true,
3665
- tenants: _ctx.tenants,
3666
- user,
3667
- onClick: handleFocus,
3668
- onClose: ($event) => removeUser(user)
3669
- }, null, 8, ["current-tenant-id", "tenants", "user", "onClose"]);
3670
- }),
3671
- 128
3672
- /* KEYED_FRAGMENT */
3673
- )),
3674
- vue.createCommentVNode(" 显示折叠标签数量 "),
3675
- hiddenCount.value > 0 ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(bkuiVue.Tag), {
3676
- key: 0,
3677
- onClick: vue.withModifiers(handleFocus, ["stop"])
3678
- }, {
3679
- default: vue.withCtx(() => [
3680
- vue.createTextVNode(
3681
- " +" + vue.toDisplayString(hiddenCount.value),
3682
- 1
3683
- /* TEXT */
3684
- )
3694
+ }, null, 8, ["current-tenant-id", "tenants", "user", "onClose"]);
3695
+ }),
3696
+ 128
3697
+ /* KEYED_FRAGMENT */
3698
+ )),
3699
+ vue.createCommentVNode(" 显示折叠标签数量 "),
3700
+ hiddenCount.value > 0 ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(bkuiVue.Tag), {
3701
+ key: 0,
3702
+ onClick: vue.withModifiers(handleFocus, ["stop"])
3703
+ }, {
3704
+ default: vue.withCtx(() => [
3705
+ vue.createTextVNode(
3706
+ " +" + vue.toDisplayString(hiddenCount.value),
3707
+ 1
3708
+ /* TEXT */
3709
+ )
3710
+ ]),
3711
+ _: 1
3712
+ /* STABLE */
3713
+ })), [
3714
+ [vue.unref(bkuiVue.bkTooltips), {
3715
+ content: _ctx.selectedUsers.slice(visibleUsers.value.length).map((user) => user.display_name).join(","),
3716
+ placement: "top"
3717
+ }]
3718
+ ]) : vue.createCommentVNode("v-if", true),
3719
+ vue.createCommentVNode(" 搜索输入框 "),
3720
+ vue.withDirectives(vue.createElementVNode("input", {
3721
+ ref_key: "collapsedInputRef",
3722
+ ref: collapsedInputRef,
3723
+ class: "search-input collapsed",
3724
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.isRef(searchQuery) ? searchQuery.value = $event : null),
3725
+ placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
3726
+ onFocus: handleFocus
3727
+ }, null, 40, _hoisted_3$1), [
3728
+ [vue.vModelText, vue.unref(searchQuery)]
3685
3729
  ]),
3686
- _: 1
3687
- /* STABLE */
3688
- })), [
3689
- [vue.unref(bkuiVue.bkTooltips), {
3690
- content: _ctx.selectedUsers.slice(visibleUsers.value.length).map((user) => user.display_name).join(","),
3691
- placement: "top"
3692
- }]
3693
- ]) : vue.createCommentVNode("v-if", true),
3694
- vue.createCommentVNode(" 搜索输入框 "),
3695
- vue.withDirectives(vue.createElementVNode("input", {
3696
- ref_key: "collapsedInputRef",
3697
- ref: collapsedInputRef,
3698
- class: "search-input collapsed",
3699
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.isRef(searchQuery) ? searchQuery.value = $event : null),
3700
- placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
3701
- onFocus: handleFocus
3702
- }, null, 40, _hoisted_3$1), [
3703
- [vue.vModelText, vue.unref(searchQuery)]
3704
- ]),
3705
- vue.createCommentVNode(' 未聚焦状态下的"我"标签 '),
3706
- vue.createVNode(MeTag, {
3707
- "current-user-id": _ctx.currentUserId,
3708
- "is-disabled": !!_ctx.currentUserId && _ctx.selectedUsers.some((user) => user[props.exactSearchKey] === _ctx.currentUserId),
3709
- onClick: addCurrentUser
3710
- }, null, 8, ["current-user-id", "is-disabled"])
3711
- ],
3712
- 512
3713
- /* NEED_PATCH */
3714
- )
3715
- ],
3716
- 2112
3717
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
3718
- )),
3719
- vue.createCommentVNode(" 下拉选项列表 "),
3720
- vue.createVNode(SelectionPopover, {
3721
- "container-width": containerRef.value ? containerRef.value.offsetWidth : "auto",
3722
- "is-show": showDropdown.value,
3723
- loading: vue.unref(searchLoading),
3724
- options: options.value,
3725
- "search-query": vue.unref(searchQuery),
3726
- "tenant-id": _ctx.tenantId,
3727
- tenants: _ctx.tenants,
3728
- "user-group": _ctx.userGroup,
3729
- "user-group-name": _ctx.userGroupName,
3730
- onSelectUser: addUser
3731
- }, null, 8, ["container-width", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
3732
- ])), [
3733
- [vue.unref(bkuiVue.clickoutside), handleClickOutside]
3734
- ]);
3730
+ vue.createCommentVNode(' 未聚焦状态下的"我"标签 '),
3731
+ vue.createVNode(MeTag, {
3732
+ "current-user-id": _ctx.currentUserId,
3733
+ "is-disabled": !!_ctx.currentUserId && _ctx.selectedUsers.some((user) => user[props.exactSearchKey] === _ctx.currentUserId),
3734
+ onClick: addCurrentUser
3735
+ }, null, 8, ["current-user-id", "is-disabled"])
3736
+ ],
3737
+ 512
3738
+ /* NEED_PATCH */
3739
+ )
3740
+ ],
3741
+ 2112
3742
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
3743
+ )),
3744
+ vue.createCommentVNode(" 下拉选项列表 "),
3745
+ vue.createVNode(SelectionPopover, {
3746
+ "container-width": containerRef.value ? containerRef.value.offsetWidth : "auto",
3747
+ "empty-text": _ctx.emptyText,
3748
+ "is-show": showDropdown.value,
3749
+ loading: vue.unref(searchLoading),
3750
+ options: options.value,
3751
+ "search-query": vue.unref(searchQuery),
3752
+ "tenant-id": _ctx.tenantId,
3753
+ tenants: _ctx.tenants,
3754
+ "user-group": _ctx.userGroup,
3755
+ "user-group-name": _ctx.userGroupName,
3756
+ onClickoutside: handleClickOutside,
3757
+ onSelectUser: addUser
3758
+ }, null, 8, ["container-width", "empty-text", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
3759
+ ],
3760
+ 512
3761
+ /* NEED_PATCH */
3762
+ );
3735
3763
  };
3736
3764
  }
3737
3765
  });
3738
- const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-1a376d26"]]);
3739
- const _withScopeId = (n) => (vue.pushScopeId("data-v-22d9b76f"), n = n(), vue.popScopeId(), n);
3766
+ const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-a884849e"]]);
3767
+ const _withScopeId = (n) => (vue.pushScopeId("data-v-ad0d9e2e"), n = n(), vue.popScopeId(), n);
3740
3768
  const _hoisted_1$1 = { class: "input-container" };
3741
3769
  const _hoisted_2 = {
3742
3770
  key: 0,
@@ -3764,7 +3792,8 @@
3764
3792
  currentUserId: { default: "" },
3765
3793
  exactSearchKey: { default: "bk_username" },
3766
3794
  userGroup: { default: () => [] },
3767
- userGroupName: { default: "用户群组" }
3795
+ userGroupName: { default: "用户群组" },
3796
+ emptyText: { default: "无匹配人员" }
3768
3797
  },
3769
3798
  emits: ["update:modelValue", "change"],
3770
3799
  setup(__props, { emit: __emit }) {
@@ -3907,6 +3936,7 @@
3907
3936
  vue.createCommentVNode(" 使用新的公共下拉选项组件 "),
3908
3937
  vue.createVNode(SelectionPopover, {
3909
3938
  "container-width": containerRef.value ? containerRef.value.offsetWidth : "auto",
3939
+ "empty-text": _ctx.emptyText,
3910
3940
  "is-show": showDropdown.value,
3911
3941
  loading: isLoading.value,
3912
3942
  options: options.value,
@@ -3916,14 +3946,14 @@
3916
3946
  "user-group": _ctx.userGroup,
3917
3947
  "user-group-name": _ctx.userGroupName,
3918
3948
  onSelectUser: addUser
3919
- }, null, 8, ["container-width", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
3949
+ }, null, 8, ["container-width", "empty-text", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
3920
3950
  ])), [
3921
3951
  [vue.unref(bkuiVue.clickoutside), handleClickOutside]
3922
3952
  ]);
3923
3953
  };
3924
3954
  }
3925
3955
  });
3926
- const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-22d9b76f"]]);
3956
+ const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ad0d9e2e"]]);
3927
3957
  const _hoisted_1 = {
3928
3958
  ref: "containerRef",
3929
3959
  class: "bk-user-selector"
@@ -3943,7 +3973,8 @@
3943
3973
  currentUserId: { default: "" },
3944
3974
  exactSearchKey: { default: "bk_username" },
3945
3975
  userGroup: { default: () => [] },
3946
- userGroupName: { default: "用户群组" }
3976
+ userGroupName: { default: "用户群组" },
3977
+ emptyText: { default: "无匹配人员" }
3947
3978
  },
3948
3979
  emits: ["update:modelValue", "change"],
3949
3980
  setup(__props, { emit: __emit }) {
@@ -4001,6 +4032,7 @@
4001
4032
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedUser.value = $event),
4002
4033
  "api-base-url": _ctx.apiBaseUrl,
4003
4034
  "current-user-id": _ctx.currentUserId,
4035
+ "empty-text": _ctx.emptyText,
4004
4036
  "exact-search-key": _ctx.exactSearchKey,
4005
4037
  placeholder: _ctx.placeholder,
4006
4038
  "tenant-id": _ctx.tenantId,
@@ -4008,7 +4040,7 @@
4008
4040
  "user-group": _ctx.userGroup,
4009
4041
  "user-group-name": _ctx.userGroupName,
4010
4042
  onChange: handleUpdateUser
4011
- }, null, 8, ["modelValue", "api-base-url", "current-user-id", "exact-search-key", "placeholder", "tenant-id", "tenants", "user-group", "user-group-name"])) : (vue.openBlock(), vue.createElementBlock(
4043
+ }, null, 8, ["modelValue", "api-base-url", "current-user-id", "empty-text", "exact-search-key", "placeholder", "tenant-id", "tenants", "user-group", "user-group-name"])) : (vue.openBlock(), vue.createElementBlock(
4012
4044
  vue.Fragment,
4013
4045
  { key: 1 },
4014
4046
  [
@@ -4019,6 +4051,7 @@
4019
4051
  "api-base-url": _ctx.apiBaseUrl,
4020
4052
  "current-user-id": _ctx.currentUserId,
4021
4053
  draggable: _ctx.draggable,
4054
+ "empty-text": _ctx.emptyText,
4022
4055
  "exact-search-key": _ctx.exactSearchKey,
4023
4056
  placeholder: _ctx.placeholder,
4024
4057
  "selected-users": selectedUsers.value,
@@ -4027,7 +4060,7 @@
4027
4060
  "user-group": _ctx.userGroup,
4028
4061
  "user-group-name": _ctx.userGroupName,
4029
4062
  "onUpdate:selectedUsers": handleUpdateSelectedUsers
4030
- }, null, 8, ["modelValue", "api-base-url", "current-user-id", "draggable", "exact-search-key", "placeholder", "selected-users", "tenant-id", "tenants", "user-group", "user-group-name"])
4063
+ }, null, 8, ["modelValue", "api-base-url", "current-user-id", "draggable", "empty-text", "exact-search-key", "placeholder", "selected-users", "tenant-id", "tenants", "user-group", "user-group-name"])
4031
4064
  ],
4032
4065
  2112
4033
4066
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
@@ -4039,7 +4072,7 @@
4039
4072
  };
4040
4073
  }
4041
4074
  });
4042
- const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-84252deb"]]);
4075
+ const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6fd92757"]]);
4043
4076
  exports2.BkUserSelector = BkUserSelector;
4044
4077
  exports2.default = BkUserSelector;
4045
4078
  Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });