@blueking/bk-user-selector 0.0.11 → 0.0.13

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-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-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-8cd452d0] {\n min-height: 40px;\n max-height: 300px;\n overflow-y: auto;\n padding: 5px 0;\n}\n.dropdown-content .no-data[data-v-8cd452d0] {\n padding: 10px;\n text-align: center;\n color: #979ba5;\n}\n.dropdown-content .user-group .group-header[data-v-8cd452d0] {\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-8cd452d0] {\n margin-left: 4px;\n}\n.dropdown-content .user-option[data-v-8cd452d0] {\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-8cd452d0]:hover {\n background-color: #f5f7fa;\n}\n.dropdown-content .user-option .tenant-name[data-v-8cd452d0] {\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-6ac8344d] {\n position: relative;\n width: 100%;\n}\n.multiple-selector .tags-container[data-v-6ac8344d] {\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-6ac8344d] {\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-6ac8344d] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n}\n.multiple-selector .tag-list[data-v-6ac8344d] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n}\n.multiple-selector .tag-wrapper[data-v-6ac8344d] {\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n}\n.multiple-selector .search-input[data-v-6ac8344d] {\n outline: none;\n border: none;\n height: 28px;\n min-width: 10px;\n background: transparent;\n}\n.multiple-selector .search-input[data-v-6ac8344d]::placeholder {\n color: #c4c6cc;\n}\n.multiple-selector .search-input.inline[data-v-6ac8344d] {\n min-width: 10px;\n}\n.multiple-selector .search-input.last[data-v-6ac8344d], .multiple-selector .search-input.collapsed[data-v-6ac8344d] {\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) {
@@ -3097,6 +3097,13 @@
3097
3097
  userGroupName: {
3098
3098
  type: String,
3099
3099
  default: "用户群组"
3100
+ },
3101
+ /**
3102
+ * 无匹配人员时的提示文本
3103
+ */
3104
+ emptyText: {
3105
+ type: String,
3106
+ default: "无匹配人员"
3100
3107
  }
3101
3108
  },
3102
3109
  emits: ["select-user"],
@@ -3146,7 +3153,7 @@
3146
3153
  vue.createElementVNode(
3147
3154
  "span",
3148
3155
  null,
3149
- vue.toDisplayString(__props.searchQuery.length > 1 ? "未找到匹配用户" : "请输入关键词搜索"),
3156
+ vue.toDisplayString(__props.searchQuery.length > 1 ? __props.emptyText : "请至少输入2个字符搜索"),
3150
3157
  1
3151
3158
  /* TEXT */
3152
3159
  )
@@ -3197,7 +3204,7 @@
3197
3204
  vue.createElementVNode(
3198
3205
  "span",
3199
3206
  null,
3200
- vue.toDisplayString(user.name),
3207
+ vue.toDisplayString(user.login_name) + "(" + vue.toDisplayString(user.name) + ")",
3201
3208
  1
3202
3209
  /* TEXT */
3203
3210
  ),
@@ -3229,7 +3236,7 @@
3229
3236
  };
3230
3237
  }
3231
3238
  });
3232
- const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-01b75e6e"]]);
3239
+ const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-8cd452d0"]]);
3233
3240
  const _hoisted_1$3 = { class: "tag-content" };
3234
3241
  const _hoisted_2$2 = { class: "user-name" };
3235
3242
  const _hoisted_3$2 = {
@@ -3309,7 +3316,8 @@
3309
3316
  currentUserId: { default: "" },
3310
3317
  exactSearchKey: { default: "bk_username" },
3311
3318
  userGroup: { default: () => [] },
3312
- userGroupName: { default: "用户群组" }
3319
+ userGroupName: { default: "用户群组" },
3320
+ emptyText: { default: "无匹配人员" }
3313
3321
  },
3314
3322
  emits: ["update:selectedUsers", "add-user", "remove-user"],
3315
3323
  setup(__props, { emit: __emit }) {
@@ -3386,7 +3394,13 @@
3386
3394
  }
3387
3395
  });
3388
3396
  };
3389
- 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
+ }
3390
3404
  isFocused.value = false;
3391
3405
  showDropdown.value = false;
3392
3406
  activeTagIndex.value = -1;
@@ -3451,7 +3465,8 @@
3451
3465
  const pastedText = ((_a = event.clipboardData) == null ? void 0 : _a.getData("text")) || "";
3452
3466
  if (pastedText.trim()) {
3453
3467
  try {
3454
- const users = pastedText.trim().split(/[,,;\n\s]+/).filter(Boolean);
3468
+ const usersList = pastedText.trim().split(/[,,;\n\s]+/).filter(Boolean);
3469
+ const users = usersList.map((user) => user.trim().replace(/\s*\(.*?\)\s*/, "")).filter((user) => user);
3455
3470
  const result = await lookupUsers(props.apiBaseUrl, props.tenantId, props.exactSearchKey, users);
3456
3471
  const formattedUsers = formatUsers(result);
3457
3472
  if (formattedUsers.length > 0) {
@@ -3495,7 +3510,14 @@
3495
3510
  emit("add-user", user);
3496
3511
  }
3497
3512
  searchQuery.value = "";
3498
- showDropdown.value = false;
3513
+ setTimeout(() => {
3514
+ showDropdown.value = false;
3515
+ }, 220);
3516
+ vue.nextTick(() => {
3517
+ if (lastInputRef.value) {
3518
+ lastInputRef.value.focus();
3519
+ }
3520
+ });
3499
3521
  };
3500
3522
  const removeUser = (user) => {
3501
3523
  if (!(user == null ? void 0 : user.id)) return;
@@ -3544,200 +3566,206 @@
3544
3566
  });
3545
3567
  });
3546
3568
  return (_ctx, _cache) => {
3547
- return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
3548
- ref_key: "containerRef",
3549
- ref: containerRef,
3550
- class: "multiple-selector"
3551
- }, [
3552
- vue.createCommentVNode(" 聚焦状态 - 可编辑模式 "),
3553
- isFocused.value ? (vue.openBlock(), vue.createElementBlock(
3554
- "div",
3555
- {
3556
- key: 0,
3557
- ref_key: "tagsContainerRef",
3558
- ref: tagsContainerRef,
3559
- class: "tags-container focused",
3560
- onClick: vue.withModifiers(handleContainerClick, ["stop"])
3561
- },
3562
- [
3563
- vue.createCommentVNode(" 用户标签列表 "),
3564
- vue.createElementVNode(
3565
- "div",
3566
- {
3567
- ref_key: "sortableContainerRef",
3568
- ref: sortableContainerRef,
3569
- class: "tag-list"
3570
- },
3571
- [
3572
- (vue.openBlock(true), vue.createElementBlock(
3573
- vue.Fragment,
3574
- null,
3575
- vue.renderList(_ctx.selectedUsers, (user, index) => {
3576
- return vue.openBlock(), vue.createElementBlock("div", {
3577
- class: "tag-wrapper",
3578
- key: user.id,
3579
- onClick: vue.withModifiers(($event) => handleTagClick(index), ["stop"])
3580
- }, [
3581
- vue.createVNode(UserTag, {
3582
- active: index === activeTagIndex.value,
3569
+ return vue.openBlock(), vue.createElementBlock(
3570
+ "div",
3571
+ {
3572
+ ref_key: "containerRef",
3573
+ ref: containerRef,
3574
+ class: "multiple-selector"
3575
+ },
3576
+ [
3577
+ vue.createCommentVNode(" 聚焦状态 - 可编辑模式 "),
3578
+ isFocused.value ? (vue.openBlock(), vue.createElementBlock(
3579
+ "div",
3580
+ {
3581
+ key: 0,
3582
+ ref_key: "tagsContainerRef",
3583
+ ref: tagsContainerRef,
3584
+ class: "tags-container focused",
3585
+ onClick: vue.withModifiers(handleContainerClick, ["stop"])
3586
+ },
3587
+ [
3588
+ vue.createCommentVNode(" 用户标签列表 "),
3589
+ vue.createElementVNode(
3590
+ "div",
3591
+ {
3592
+ ref_key: "sortableContainerRef",
3593
+ ref: sortableContainerRef,
3594
+ class: "tag-list"
3595
+ },
3596
+ [
3597
+ (vue.openBlock(true), vue.createElementBlock(
3598
+ vue.Fragment,
3599
+ null,
3600
+ vue.renderList(_ctx.selectedUsers, (user, index) => {
3601
+ return vue.openBlock(), vue.createElementBlock("div", {
3602
+ class: "tag-wrapper",
3603
+ key: user.id,
3604
+ onClick: vue.withModifiers(($event) => handleTagClick(index), ["stop"])
3605
+ }, [
3606
+ vue.createVNode(UserTag, {
3607
+ active: index === activeTagIndex.value,
3608
+ "current-tenant-id": _ctx.tenantId,
3609
+ draggable: _ctx.draggable,
3610
+ tenants: _ctx.tenants,
3611
+ user,
3612
+ onClick: ($event) => handleTagClick(index),
3613
+ onClose: ($event) => removeUser(user)
3614
+ }, null, 8, ["active", "current-tenant-id", "draggable", "tenants", "user", "onClick", "onClose"]),
3615
+ vue.createCommentVNode(" 在当前激活标签后插入输入框 "),
3616
+ index === activeTagIndex.value && activeTagIndex.value !== _ctx.selectedUsers.length - 1 ? vue.withDirectives((vue.openBlock(), vue.createElementBlock(
3617
+ "input",
3618
+ {
3619
+ key: 0,
3620
+ ref_for: true,
3621
+ ref_key: "inlineInputRef",
3622
+ ref: inlineInputRef,
3623
+ class: "search-input inline",
3624
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(searchQuery) ? searchQuery.value = $event : null),
3625
+ onFocus: handleInputFocus,
3626
+ onInput: handleInput,
3627
+ onKeydown: handleKeyDown,
3628
+ onPaste: handlePaste
3629
+ },
3630
+ null,
3631
+ 544
3632
+ /* NEED_HYDRATION, NEED_PATCH */
3633
+ )), [
3634
+ [vue.vModelText, vue.unref(searchQuery)]
3635
+ ]) : vue.createCommentVNode("v-if", true)
3636
+ ], 8, _hoisted_1$2);
3637
+ }),
3638
+ 128
3639
+ /* KEYED_FRAGMENT */
3640
+ )),
3641
+ vue.createCommentVNode(" 最后一个输入框 "),
3642
+ activeTagIndex.value === -1 || activeTagIndex.value === _ctx.selectedUsers.length - 1 ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
3643
+ key: 0,
3644
+ ref_key: "lastInputRef",
3645
+ ref: lastInputRef,
3646
+ class: "search-input last",
3647
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(searchQuery) ? searchQuery.value = $event : null),
3648
+ placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
3649
+ onFocus: handleInputFocus,
3650
+ onInput: handleInput,
3651
+ onKeydown: handleKeyDown,
3652
+ onPaste: handlePaste
3653
+ }, null, 40, _hoisted_2$1)), [
3654
+ [vue.vModelText, vue.unref(searchQuery)]
3655
+ ]) : vue.createCommentVNode("v-if", true),
3656
+ vue.createCommentVNode(' "我"标签 '),
3657
+ vue.createVNode(MeTag, {
3658
+ "current-user-id": _ctx.currentUserId,
3659
+ "is-disabled": !!_ctx.currentUserId && _ctx.selectedUsers.some((user) => user.id === _ctx.currentUserId),
3660
+ onClick: addCurrentUser
3661
+ }, null, 8, ["current-user-id", "is-disabled"])
3662
+ ],
3663
+ 512
3664
+ /* NEED_PATCH */
3665
+ )
3666
+ ],
3667
+ 512
3668
+ /* NEED_PATCH */
3669
+ )) : (vue.openBlock(), vue.createElementBlock(
3670
+ vue.Fragment,
3671
+ { key: 1 },
3672
+ [
3673
+ vue.createCommentVNode(" 未聚焦状态 - 只读展示模式 "),
3674
+ vue.createElementVNode(
3675
+ "div",
3676
+ {
3677
+ ref_key: "collapsedContainerRef",
3678
+ ref: collapsedContainerRef,
3679
+ class: "tags-container collapsed",
3680
+ onClick: vue.withModifiers(handleFocus, ["stop"])
3681
+ },
3682
+ [
3683
+ (vue.openBlock(true), vue.createElementBlock(
3684
+ vue.Fragment,
3685
+ null,
3686
+ vue.renderList(visibleUsers.value, (user) => {
3687
+ return vue.openBlock(), vue.createBlock(UserTag, {
3583
3688
  "current-tenant-id": _ctx.tenantId,
3584
- draggable: _ctx.draggable,
3689
+ key: user.id,
3690
+ "show-tenant": true,
3585
3691
  tenants: _ctx.tenants,
3586
3692
  user,
3587
- onClick: ($event) => handleTagClick(index),
3693
+ onClick: handleFocus,
3588
3694
  onClose: ($event) => removeUser(user)
3589
- }, null, 8, ["active", "current-tenant-id", "draggable", "tenants", "user", "onClick", "onClose"]),
3590
- vue.createCommentVNode(" 在当前激活标签后插入输入框 "),
3591
- index === activeTagIndex.value && activeTagIndex.value !== _ctx.selectedUsers.length - 1 ? vue.withDirectives((vue.openBlock(), vue.createElementBlock(
3592
- "input",
3593
- {
3594
- key: 0,
3595
- ref_for: true,
3596
- ref_key: "inlineInputRef",
3597
- ref: inlineInputRef,
3598
- class: "search-input inline",
3599
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(searchQuery) ? searchQuery.value = $event : null),
3600
- onFocus: handleInputFocus,
3601
- onInput: handleInput,
3602
- onKeydown: handleKeyDown,
3603
- onPaste: handlePaste
3604
- },
3605
- null,
3606
- 544
3607
- /* NEED_HYDRATION, NEED_PATCH */
3608
- )), [
3609
- [vue.vModelText, vue.unref(searchQuery)]
3610
- ]) : vue.createCommentVNode("v-if", true)
3611
- ], 8, _hoisted_1$2);
3612
- }),
3613
- 128
3614
- /* KEYED_FRAGMENT */
3615
- )),
3616
- vue.createCommentVNode(" 最后一个输入框 "),
3617
- activeTagIndex.value === -1 || activeTagIndex.value === _ctx.selectedUsers.length - 1 ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
3618
- key: 0,
3619
- ref_key: "lastInputRef",
3620
- ref: lastInputRef,
3621
- class: "search-input last",
3622
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(searchQuery) ? searchQuery.value = $event : null),
3623
- placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
3624
- onFocus: handleInputFocus,
3625
- onInput: handleInput,
3626
- onKeydown: handleKeyDown,
3627
- onPaste: handlePaste
3628
- }, null, 40, _hoisted_2$1)), [
3629
- [vue.vModelText, vue.unref(searchQuery)]
3630
- ]) : vue.createCommentVNode("v-if", true),
3631
- vue.createCommentVNode(' "我"标签 '),
3632
- vue.createVNode(MeTag, {
3633
- "current-user-id": _ctx.currentUserId,
3634
- "is-disabled": !!_ctx.currentUserId && _ctx.selectedUsers.some((user) => user.id === _ctx.currentUserId),
3635
- onClick: addCurrentUser
3636
- }, null, 8, ["current-user-id", "is-disabled"])
3637
- ],
3638
- 512
3639
- /* NEED_PATCH */
3640
- )
3641
- ],
3642
- 512
3643
- /* NEED_PATCH */
3644
- )) : (vue.openBlock(), vue.createElementBlock(
3645
- vue.Fragment,
3646
- { key: 1 },
3647
- [
3648
- vue.createCommentVNode(" 未聚焦状态 - 只读展示模式 "),
3649
- vue.createElementVNode(
3650
- "div",
3651
- {
3652
- ref_key: "collapsedContainerRef",
3653
- ref: collapsedContainerRef,
3654
- class: "tags-container collapsed",
3655
- onClick: vue.withModifiers(handleFocus, ["stop"])
3656
- },
3657
- [
3658
- (vue.openBlock(true), vue.createElementBlock(
3659
- vue.Fragment,
3660
- null,
3661
- vue.renderList(visibleUsers.value, (user) => {
3662
- return vue.openBlock(), vue.createBlock(UserTag, {
3663
- "current-tenant-id": _ctx.tenantId,
3664
- key: user.id,
3665
- "show-tenant": true,
3666
- tenants: _ctx.tenants,
3667
- user,
3668
- onClick: handleFocus,
3669
- onClose: ($event) => removeUser(user)
3670
- }, null, 8, ["current-tenant-id", "tenants", "user", "onClose"]);
3671
- }),
3672
- 128
3673
- /* KEYED_FRAGMENT */
3674
- )),
3675
- vue.createCommentVNode(" 显示折叠标签数量 "),
3676
- hiddenCount.value > 0 ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(bkuiVue.Tag), {
3677
- key: 0,
3678
- onClick: vue.withModifiers(handleFocus, ["stop"])
3679
- }, {
3680
- default: vue.withCtx(() => [
3681
- vue.createTextVNode(
3682
- " +" + vue.toDisplayString(hiddenCount.value),
3683
- 1
3684
- /* TEXT */
3685
- )
3695
+ }, null, 8, ["current-tenant-id", "tenants", "user", "onClose"]);
3696
+ }),
3697
+ 128
3698
+ /* KEYED_FRAGMENT */
3699
+ )),
3700
+ vue.createCommentVNode(" 显示折叠标签数量 "),
3701
+ hiddenCount.value > 0 ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(bkuiVue.Tag), {
3702
+ key: 0,
3703
+ onClick: vue.withModifiers(handleFocus, ["stop"])
3704
+ }, {
3705
+ default: vue.withCtx(() => [
3706
+ vue.createTextVNode(
3707
+ " +" + vue.toDisplayString(hiddenCount.value),
3708
+ 1
3709
+ /* TEXT */
3710
+ )
3711
+ ]),
3712
+ _: 1
3713
+ /* STABLE */
3714
+ })), [
3715
+ [vue.unref(bkuiVue.bkTooltips), {
3716
+ content: _ctx.selectedUsers.slice(visibleUsers.value.length).map((user) => user.display_name).join(","),
3717
+ placement: "top"
3718
+ }]
3719
+ ]) : vue.createCommentVNode("v-if", true),
3720
+ vue.createCommentVNode(" 搜索输入框 "),
3721
+ vue.withDirectives(vue.createElementVNode("input", {
3722
+ ref_key: "collapsedInputRef",
3723
+ ref: collapsedInputRef,
3724
+ class: "search-input collapsed",
3725
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.isRef(searchQuery) ? searchQuery.value = $event : null),
3726
+ placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
3727
+ onFocus: handleFocus
3728
+ }, null, 40, _hoisted_3$1), [
3729
+ [vue.vModelText, vue.unref(searchQuery)]
3686
3730
  ]),
3687
- _: 1
3688
- /* STABLE */
3689
- })), [
3690
- [vue.unref(bkuiVue.bkTooltips), {
3691
- content: _ctx.selectedUsers.slice(visibleUsers.value.length).map((user) => user.display_name).join(","),
3692
- placement: "top"
3693
- }]
3694
- ]) : vue.createCommentVNode("v-if", true),
3695
- vue.createCommentVNode(" 搜索输入框 "),
3696
- vue.withDirectives(vue.createElementVNode("input", {
3697
- ref_key: "collapsedInputRef",
3698
- ref: collapsedInputRef,
3699
- class: "search-input collapsed",
3700
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.isRef(searchQuery) ? searchQuery.value = $event : null),
3701
- placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
3702
- onFocus: handleFocus
3703
- }, null, 40, _hoisted_3$1), [
3704
- [vue.vModelText, vue.unref(searchQuery)]
3705
- ]),
3706
- vue.createCommentVNode(' 未聚焦状态下的"我"标签 '),
3707
- vue.createVNode(MeTag, {
3708
- "current-user-id": _ctx.currentUserId,
3709
- "is-disabled": !!_ctx.currentUserId && _ctx.selectedUsers.some((user) => user[props.exactSearchKey] === _ctx.currentUserId),
3710
- onClick: addCurrentUser
3711
- }, null, 8, ["current-user-id", "is-disabled"])
3712
- ],
3713
- 512
3714
- /* NEED_PATCH */
3715
- )
3716
- ],
3717
- 2112
3718
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
3719
- )),
3720
- vue.createCommentVNode(" 下拉选项列表 "),
3721
- vue.createVNode(SelectionPopover, {
3722
- "container-width": containerRef.value ? containerRef.value.offsetWidth : "auto",
3723
- "is-show": showDropdown.value,
3724
- loading: vue.unref(searchLoading),
3725
- options: options.value,
3726
- "search-query": vue.unref(searchQuery),
3727
- "tenant-id": _ctx.tenantId,
3728
- tenants: _ctx.tenants,
3729
- "user-group": _ctx.userGroup,
3730
- "user-group-name": _ctx.userGroupName,
3731
- onSelectUser: addUser
3732
- }, null, 8, ["container-width", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
3733
- ])), [
3734
- [vue.unref(bkuiVue.clickoutside), handleClickOutside]
3735
- ]);
3731
+ vue.createCommentVNode(' 未聚焦状态下的"我"标签 '),
3732
+ vue.createVNode(MeTag, {
3733
+ "current-user-id": _ctx.currentUserId,
3734
+ "is-disabled": !!_ctx.currentUserId && _ctx.selectedUsers.some((user) => user[props.exactSearchKey] === _ctx.currentUserId),
3735
+ onClick: addCurrentUser
3736
+ }, null, 8, ["current-user-id", "is-disabled"])
3737
+ ],
3738
+ 512
3739
+ /* NEED_PATCH */
3740
+ )
3741
+ ],
3742
+ 2112
3743
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
3744
+ )),
3745
+ vue.createCommentVNode(" 下拉选项列表 "),
3746
+ vue.createVNode(SelectionPopover, {
3747
+ "container-width": containerRef.value ? containerRef.value.offsetWidth : "auto",
3748
+ "empty-text": _ctx.emptyText,
3749
+ "is-show": showDropdown.value,
3750
+ loading: vue.unref(searchLoading),
3751
+ options: options.value,
3752
+ "search-query": vue.unref(searchQuery),
3753
+ "tenant-id": _ctx.tenantId,
3754
+ tenants: _ctx.tenants,
3755
+ "user-group": _ctx.userGroup,
3756
+ "user-group-name": _ctx.userGroupName,
3757
+ onClickoutside: handleClickOutside,
3758
+ onSelectUser: addUser
3759
+ }, null, 8, ["container-width", "empty-text", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
3760
+ ],
3761
+ 512
3762
+ /* NEED_PATCH */
3763
+ );
3736
3764
  };
3737
3765
  }
3738
3766
  });
3739
- const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-1a376d26"]]);
3740
- const _withScopeId = (n) => (vue.pushScopeId("data-v-22d9b76f"), n = n(), vue.popScopeId(), n);
3767
+ const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-6ac8344d"]]);
3768
+ const _withScopeId = (n) => (vue.pushScopeId("data-v-ad0d9e2e"), n = n(), vue.popScopeId(), n);
3741
3769
  const _hoisted_1$1 = { class: "input-container" };
3742
3770
  const _hoisted_2 = {
3743
3771
  key: 0,
@@ -3765,7 +3793,8 @@
3765
3793
  currentUserId: { default: "" },
3766
3794
  exactSearchKey: { default: "bk_username" },
3767
3795
  userGroup: { default: () => [] },
3768
- userGroupName: { default: "用户群组" }
3796
+ userGroupName: { default: "用户群组" },
3797
+ emptyText: { default: "无匹配人员" }
3769
3798
  },
3770
3799
  emits: ["update:modelValue", "change"],
3771
3800
  setup(__props, { emit: __emit }) {
@@ -3908,6 +3937,7 @@
3908
3937
  vue.createCommentVNode(" 使用新的公共下拉选项组件 "),
3909
3938
  vue.createVNode(SelectionPopover, {
3910
3939
  "container-width": containerRef.value ? containerRef.value.offsetWidth : "auto",
3940
+ "empty-text": _ctx.emptyText,
3911
3941
  "is-show": showDropdown.value,
3912
3942
  loading: isLoading.value,
3913
3943
  options: options.value,
@@ -3917,14 +3947,14 @@
3917
3947
  "user-group": _ctx.userGroup,
3918
3948
  "user-group-name": _ctx.userGroupName,
3919
3949
  onSelectUser: addUser
3920
- }, null, 8, ["container-width", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
3950
+ }, null, 8, ["container-width", "empty-text", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
3921
3951
  ])), [
3922
3952
  [vue.unref(bkuiVue.clickoutside), handleClickOutside]
3923
3953
  ]);
3924
3954
  };
3925
3955
  }
3926
3956
  });
3927
- const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-22d9b76f"]]);
3957
+ const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ad0d9e2e"]]);
3928
3958
  const _hoisted_1 = {
3929
3959
  ref: "containerRef",
3930
3960
  class: "bk-user-selector"
@@ -3944,7 +3974,8 @@
3944
3974
  currentUserId: { default: "" },
3945
3975
  exactSearchKey: { default: "bk_username" },
3946
3976
  userGroup: { default: () => [] },
3947
- userGroupName: { default: "用户群组" }
3977
+ userGroupName: { default: "用户群组" },
3978
+ emptyText: { default: "无匹配人员" }
3948
3979
  },
3949
3980
  emits: ["update:modelValue", "change"],
3950
3981
  setup(__props, { emit: __emit }) {
@@ -4002,6 +4033,7 @@
4002
4033
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedUser.value = $event),
4003
4034
  "api-base-url": _ctx.apiBaseUrl,
4004
4035
  "current-user-id": _ctx.currentUserId,
4036
+ "empty-text": _ctx.emptyText,
4005
4037
  "exact-search-key": _ctx.exactSearchKey,
4006
4038
  placeholder: _ctx.placeholder,
4007
4039
  "tenant-id": _ctx.tenantId,
@@ -4009,7 +4041,7 @@
4009
4041
  "user-group": _ctx.userGroup,
4010
4042
  "user-group-name": _ctx.userGroupName,
4011
4043
  onChange: handleUpdateUser
4012
- }, 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(
4044
+ }, 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(
4013
4045
  vue.Fragment,
4014
4046
  { key: 1 },
4015
4047
  [
@@ -4020,6 +4052,7 @@
4020
4052
  "api-base-url": _ctx.apiBaseUrl,
4021
4053
  "current-user-id": _ctx.currentUserId,
4022
4054
  draggable: _ctx.draggable,
4055
+ "empty-text": _ctx.emptyText,
4023
4056
  "exact-search-key": _ctx.exactSearchKey,
4024
4057
  placeholder: _ctx.placeholder,
4025
4058
  "selected-users": selectedUsers.value,
@@ -4028,7 +4061,7 @@
4028
4061
  "user-group": _ctx.userGroup,
4029
4062
  "user-group-name": _ctx.userGroupName,
4030
4063
  "onUpdate:selectedUsers": handleUpdateSelectedUsers
4031
- }, null, 8, ["modelValue", "api-base-url", "current-user-id", "draggable", "exact-search-key", "placeholder", "selected-users", "tenant-id", "tenants", "user-group", "user-group-name"])
4064
+ }, 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"])
4032
4065
  ],
4033
4066
  2112
4034
4067
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
@@ -4040,7 +4073,7 @@
4040
4073
  };
4041
4074
  }
4042
4075
  });
4043
- const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-84252deb"]]);
4076
+ const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6fd92757"]]);
4044
4077
  exports2.BkUserSelector = BkUserSelector;
4045
4078
  exports2.default = BkUserSelector;
4046
4079
  Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });