@blueking/bk-user-selector 0.0.18 → 0.0.20

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/README.md CHANGED
@@ -92,11 +92,12 @@ import '@blueking/bk-user-selector/vue2/vue2.css';
92
92
  const selectedUser = ref('');
93
93
  // 多选选中值
94
94
  const selectedUsers = ref([]);
95
- // 用户组
95
+ // 用户组, hidden 为 true 时,不会展示在下拉列表里,但回显时会展示
96
96
  const userGroup = ref([
97
97
  {
98
98
  id: '1',
99
99
  name: '运维人员',
100
+ hidden: true,
100
101
  },
101
102
  {
102
103
  id: '2',
@@ -122,21 +123,23 @@ import '@blueking/bk-user-selector/vue2/vue2.css';
122
123
 
123
124
  ### 属性
124
125
 
125
- | 参数 | 说明 | 类型 | 默认值 |
126
- | -------------------- | ----------------------------------------------------------------------- | -------------- | ------------------ |
127
- | modelValue / v-model | 绑定值,单选为字符串,多选为数组 | String / Array | '' / [] |
128
- | label | 文本标签 | String | 人员选择 |
129
- | required | 是否必填 | Boolean | false |
130
- | placeholder | 占位文本 | String | 请输入人员名称搜索 |
131
- | multiple | 是否多选 | Boolean | false |
132
- | draggable | 是否可拖拽(仅多选模式有效) | Boolean | false |
133
- | apiBaseUrl | API 基础 URL | String | '' |
134
- | tenantId | 租户 ID | String | '' |
135
- | exactSearchKey | 精确查找key,可选值为 bk_username、login_name、full_name, 多个以逗号分隔 | String | bk_username |
136
- | currentUserId | 当前用户ID(用于快速选择"我") | String | '' |
137
- | userGroup | 用户组列表,用于在下拉列表中显示用户组 | Array | [] |
138
- | userGroupName | 用户组名称,用于在下拉列表中显示用户组名称 | String | 用户群组 |
139
- | emptyText | 无匹配人员时的提示文本 | String | 无匹配人员 |
126
+ | 参数 | 说明 | 类型 | 默认值 |
127
+ | -------------------- | ----------------------------------------------------------------------- | ------------------------------ | ------------------ |
128
+ | modelValue / v-model | 绑定值,单选为字符串,多选为数组 | String / Array | '' / [] |
129
+ | label | 文本标签 | String | 人员选择 |
130
+ | required | 是否必填 | Boolean | false |
131
+ | placeholder | 占位文本 | String | 请输入人员名称搜索 |
132
+ | multiple | 是否多选 | Boolean | false |
133
+ | draggable | 是否可拖拽(仅多选模式有效) | Boolean | false |
134
+ | apiBaseUrl | API 基础 URL | String | '' |
135
+ | tenantId | 租户 ID | String | '' |
136
+ | exactSearchKey | 精确查找key,可选值为 bk_username、login_name、full_name, 多个以逗号分隔 | String | bk_username |
137
+ | currentUserId | 当前用户ID(用于快速选择"我") | String | '' |
138
+ | userGroup | 用户组列表,用于在下拉列表中显示用户组 | Array | [] |
139
+ | userGroupName | 用户组名称,用于在下拉列表中显示用户组名称 | String | 用户群组 |
140
+ | emptyText | 无匹配人员时的提示文本 | String | 无匹配人员 |
141
+ | renderTag | 渲染标签 | Function(h, userInfo) => VNode | - |
142
+ | renderListItem | 渲染列表项 | Function(h, userInfo) => VNode | - |
140
143
 
141
144
  ### 事件
142
145
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/bk-user-selector",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "蓝鲸用户选择器",
5
5
  "license": "MIT",
6
6
  "author": "Tencent BlueKing",
@@ -40,6 +40,11 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
40
40
  userGroup: {
41
41
  id: string;
42
42
  name: string;
43
+ hidden
44
+ /**
45
+ * 多选模式用户选择器组件
46
+ */
47
+ ?: boolean;
43
48
  }[];
44
49
  userGroupName: string;
45
50
  emptyText: string;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * 用户选择器下拉菜单组件
3
+ */
4
+ import { createVNode, VNode } from 'vue';
1
5
  import { FormattedUser } from '../types';
2
6
  declare const _default: import("vue").DefineComponent<{
3
7
  /**
@@ -74,6 +78,12 @@ declare const _default: import("vue").DefineComponent<{
74
78
  type: StringConstructor;
75
79
  default: string;
76
80
  };
81
+ /**
82
+ * 渲染列表项
83
+ */
84
+ renderListItem: {
85
+ type: () => (h: typeof createVNode, item: FormattedUser) => VNode;
86
+ };
77
87
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
78
88
  "select-user": (...args: any[]) => void;
79
89
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -151,6 +161,12 @@ declare const _default: import("vue").DefineComponent<{
151
161
  type: StringConstructor;
152
162
  default: string;
153
163
  };
164
+ /**
165
+ * 渲染列表项
166
+ */
167
+ renderListItem: {
168
+ type: () => (h: typeof createVNode, item: FormattedUser) => VNode;
169
+ };
154
170
  }>> & {
155
171
  "onSelect-user"?: ((...args: any[]) => any) | undefined;
156
172
  }, {
@@ -31,6 +31,11 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
31
31
  userGroup: {
32
32
  id: string;
33
33
  name: string;
34
+ hidden
35
+ /**
36
+ * 单选模式用户选择器组件
37
+ */
38
+ ?: boolean;
34
39
  }[];
35
40
  userGroupName: string;
36
41
  emptyText: string;
@@ -0,0 +1,21 @@
1
+ import type { FormattedUser } from '../types';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ render: {
4
+ type: FunctionConstructor;
5
+ required: true;
6
+ };
7
+ user: {
8
+ type: () => FormattedUser;
9
+ required: true;
10
+ };
11
+ }, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
12
+ render: {
13
+ type: FunctionConstructor;
14
+ required: true;
15
+ };
16
+ user: {
17
+ type: () => FormattedUser;
18
+ required: true;
19
+ };
20
+ }>>, {}, {}>;
21
+ export default _default;
@@ -35,6 +35,12 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
35
35
  userGroup: {
36
36
  id: string;
37
37
  name: string;
38
+ hidden
39
+ /**
40
+ * 蓝鲸用户选择器组件
41
+ * @module components/UserSelector
42
+ */
43
+ ?: boolean;
38
44
  }[];
39
45
  userGroupName: string;
40
46
  emptyText: string;
@@ -1,3 +1,4 @@
1
+ import { createVNode, VNode } from 'vue';
1
2
  import { FormattedUser } from '../types';
2
3
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
3
4
  /**
@@ -24,6 +25,10 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
24
25
  * 是否显示租户信息
25
26
  */
26
27
  showTenant?: boolean;
28
+ /**
29
+ * 渲染标签
30
+ */
31
+ renderTag?: (h: typeof createVNode, userInfo: FormattedUser) => VNode;
27
32
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
33
  click: (...args: any[]) => void;
29
34
  close: (...args: any[]) => void;
@@ -52,6 +57,10 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
52
57
  * 是否显示租户信息
53
58
  */
54
59
  showTenant?: boolean;
60
+ /**
61
+ * 渲染标签
62
+ */
63
+ renderTag?: (h: typeof createVNode, userInfo: FormattedUser) => VNode;
55
64
  }>>> & {
56
65
  onClick?: ((...args: any[]) => any) | undefined;
57
66
  onClose?: ((...args: any[]) => any) | undefined;
@@ -97,6 +97,7 @@ interface BaseSelectorProps {
97
97
  userGroup?: {
98
98
  id: string;
99
99
  name: string;
100
+ hidden?: boolean;
100
101
  }[];
101
102
  /**
102
103
  * 用户组名称
@@ -1,5 +1,5 @@
1
1
  import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "@blueking/bkui-library";
2
- import { ref, onBeforeMount, defineComponent, createElementBlock, createCommentVNode, openBlock, withModifiers, normalizeClass, computed, createBlock, unref, withCtx, createVNode, createElementVNode, toDisplayString, Fragment, renderList, watch, nextTick, onMounted, withDirectives, isRef, vModelText, createTextVNode, pushScopeId, popScopeId, createApp, h as h$1 } from "@blueking/bkui-library";
2
+ import { ref, onBeforeMount, defineComponent, createElementBlock, createCommentVNode, openBlock, withModifiers, normalizeClass, h as h$1, computed, createBlock, unref, withCtx, createVNode, createElementVNode, toDisplayString, Fragment, renderList, watch, nextTick, onMounted, withDirectives, isRef, vModelText, createTextVNode, createApp } from "@blueking/bkui-library";
3
3
  const getTenants = async (apiBaseUrl, tenantId) => {
4
4
  if (!apiBaseUrl || !tenantId) {
5
5
  console.warn("获取租户信息需要提供有效的apiBaseUrl和租户ID");
@@ -16690,17 +16690,40 @@ const _export_sfc = (sfc, props2) => {
16690
16690
  return target;
16691
16691
  };
16692
16692
  const MeTag = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-887b7c44"]]);
16693
+ const UserRender = defineComponent({
16694
+ name: "UserRender",
16695
+ props: {
16696
+ render: {
16697
+ type: Function,
16698
+ required: true
16699
+ },
16700
+ user: {
16701
+ type: Object,
16702
+ required: true
16703
+ }
16704
+ },
16705
+ setup(props2) {
16706
+ return () => {
16707
+ try {
16708
+ return props2.render(h$1, props2.user);
16709
+ } catch (error3) {
16710
+ console.error("Error rendering tag:", error3);
16711
+ return h$1("div", props2.user.name);
16712
+ }
16713
+ };
16714
+ }
16715
+ });
16693
16716
  const _hoisted_1$4 = {
16694
16717
  key: 0,
16695
16718
  class: "no-data"
16696
16719
  };
16697
16720
  const _hoisted_2$3 = { class: "group-name" };
16698
- const _hoisted_3$3 = { class: "group-count" };
16721
+ const _hoisted_3$2 = { class: "group-count" };
16699
16722
  const _hoisted_4$1 = ["onMousedown"];
16700
16723
  const _hoisted_5 = { key: 0 };
16701
16724
  const _hoisted_6 = { key: 1 };
16702
16725
  const _hoisted_7 = {
16703
- key: 2,
16726
+ key: 0,
16704
16727
  class: "tenant-name"
16705
16728
  };
16706
16729
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
@@ -16778,6 +16801,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
16778
16801
  emptyText: {
16779
16802
  type: String,
16780
16803
  default: "无匹配人员"
16804
+ },
16805
+ /**
16806
+ * 渲染列表项
16807
+ */
16808
+ renderListItem: {
16809
+ type: Function
16781
16810
  }
16782
16811
  },
16783
16812
  emits: ["select-user"],
@@ -16787,7 +16816,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
16787
16816
  const groupedUsers = computed(() => {
16788
16817
  const groups = {};
16789
16818
  if (Array.isArray(props2.userGroup) && props2.userGroup.length > 0) {
16790
- groups[props2.userGroupName] = props2.userGroup.filter((group) => !group.hidden).map((group) => ({
16819
+ groups[props2.userGroupName] = props2.userGroup.map((group) => ({
16791
16820
  ...group,
16792
16821
  tenantId: "",
16793
16822
  type: "userGroup"
@@ -16857,7 +16886,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
16857
16886
  ),
16858
16887
  createElementVNode(
16859
16888
  "span",
16860
- _hoisted_3$3,
16889
+ _hoisted_3$2,
16861
16890
  "(" + toDisplayString(group.length) + ")",
16862
16891
  1
16863
16892
  /* TEXT */
@@ -16875,20 +16904,19 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
16875
16904
  key: user.id,
16876
16905
  onMousedown: withModifiers(($event) => selectUser(user), ["prevent"])
16877
16906
  }, [
16878
- createElementVNode("div", null, [
16879
- user.login_name ? (openBlock(), createElementBlock(
16880
- "span",
16881
- _hoisted_5,
16882
- toDisplayString(user.login_name) + "(" + toDisplayString(user.name) + ")",
16883
- 1
16884
- /* TEXT */
16885
- )) : (openBlock(), createElementBlock(
16907
+ __props.renderListItem ? (openBlock(), createElementBlock("div", _hoisted_5, [
16908
+ createVNode(unref(UserRender), {
16909
+ render: __props.renderListItem,
16910
+ user
16911
+ }, null, 8, ["render", "user"])
16912
+ ])) : (openBlock(), createElementBlock("div", _hoisted_6, [
16913
+ createElementVNode(
16886
16914
  "span",
16887
- _hoisted_6,
16915
+ null,
16888
16916
  toDisplayString(user.name),
16889
16917
  1
16890
16918
  /* TEXT */
16891
- )),
16919
+ ),
16892
16920
  user.tenantId !== __props.tenantId && user.tenantId && __props.tenants[user.tenantId] ? (openBlock(), createElementBlock(
16893
16921
  "span",
16894
16922
  _hoisted_7,
@@ -16896,7 +16924,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
16896
16924
  1
16897
16925
  /* TEXT */
16898
16926
  )) : createCommentVNode("v-if", true)
16899
- ])
16927
+ ]))
16900
16928
  ], 40, _hoisted_4$1);
16901
16929
  }),
16902
16930
  128
@@ -16918,10 +16946,14 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
16918
16946
  };
16919
16947
  }
16920
16948
  });
16921
- const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-7bcec2be"]]);
16922
- const _hoisted_1$3 = { class: "tag-content" };
16923
- const _hoisted_2$2 = { class: "user-name" };
16924
- const _hoisted_3$2 = {
16949
+ const SelectionPopover = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-a24bd074"]]);
16950
+ const _hoisted_1$3 = { key: 0 };
16951
+ const _hoisted_2$2 = {
16952
+ key: 1,
16953
+ class: "tag-content"
16954
+ };
16955
+ const _hoisted_3$1 = { class: "user-name" };
16956
+ const _hoisted_4 = {
16925
16957
  key: 0,
16926
16958
  class: "tenant-name"
16927
16959
  };
@@ -16936,7 +16968,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
16936
16968
  currentTenantId: {},
16937
16969
  draggable: { type: Boolean },
16938
16970
  active: { type: Boolean },
16939
- showTenant: { type: Boolean }
16971
+ showTenant: { type: Boolean },
16972
+ renderTag: { type: Function }
16940
16973
  },
16941
16974
  emits: ["click", "close"],
16942
16975
  setup(__props, { emit: __emit }) {
@@ -16955,22 +16988,27 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
16955
16988
  onClose: handleClose
16956
16989
  }, {
16957
16990
  default: withCtx(() => [
16958
- createElementVNode("div", _hoisted_1$3, [
16991
+ _ctx.renderTag ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
16992
+ createVNode(unref(UserRender), {
16993
+ render: _ctx.renderTag,
16994
+ user: _ctx.user
16995
+ }, null, 8, ["render", "user"])
16996
+ ])) : (openBlock(), createElementBlock("div", _hoisted_2$2, [
16959
16997
  createElementVNode(
16960
16998
  "span",
16961
- _hoisted_2$2,
16999
+ _hoisted_3$1,
16962
17000
  toDisplayString(_ctx.user.name),
16963
17001
  1
16964
17002
  /* TEXT */
16965
17003
  ),
16966
17004
  _ctx.user.tenantId !== _ctx.currentTenantId && _ctx.user.tenantId ? (openBlock(), createElementBlock(
16967
17005
  "span",
16968
- _hoisted_3$2,
17006
+ _hoisted_4,
16969
17007
  " @" + toDisplayString(_ctx.tenants[_ctx.user.tenantId]),
16970
17008
  1
16971
17009
  /* TEXT */
16972
17010
  )) : createCommentVNode("v-if", true)
16973
- ])
17011
+ ]))
16974
17012
  ]),
16975
17013
  _: 1
16976
17014
  /* STABLE */
@@ -16978,10 +17016,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
16978
17016
  };
16979
17017
  }
16980
17018
  });
16981
- const UserTag = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-87c12feb"]]);
17019
+ const UserTag = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-7099192b"]]);
16982
17020
  const _hoisted_1$2 = ["onClick"];
16983
17021
  const _hoisted_2$1 = ["placeholder"];
16984
- const _hoisted_3$1 = ["placeholder"];
17022
+ const _hoisted_3 = ["placeholder"];
16985
17023
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
16986
17024
  ...{
16987
17025
  name: "BkUserSelectorMultiple"
@@ -17030,6 +17068,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
17030
17068
  const options = computed(() => {
17031
17069
  return searchResults.value.filter((user) => !props2.selectedUsers.some((selectedUser) => selectedUser.id === user.id));
17032
17070
  });
17071
+ const userGroupFilter = computed(() => {
17072
+ return props2.userGroup.filter((group) => !props2.selectedUsers.some((user) => user.id === group.id) && !group.hidden);
17073
+ });
17033
17074
  const initSortable = () => {
17034
17075
  if (!props2.draggable || !sortableContainerRef.value) return;
17035
17076
  if (sortableInstance.value) {
@@ -17288,11 +17329,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
17288
17329
  active: index === activeTagIndex.value,
17289
17330
  "current-tenant-id": _ctx.tenantId,
17290
17331
  draggable: _ctx.draggable,
17332
+ "render-tag": _ctx.renderTag,
17291
17333
  tenants: _ctx.tenants,
17292
17334
  user,
17293
17335
  onClick: ($event) => handleTagClick(index),
17294
17336
  onClose: ($event) => removeUser(user)
17295
- }, null, 8, ["active", "current-tenant-id", "draggable", "tenants", "user", "onClick", "onClose"]),
17337
+ }, null, 8, ["active", "current-tenant-id", "draggable", "render-tag", "tenants", "user", "onClick", "onClose"]),
17296
17338
  createCommentVNode(" 在当前激活标签后插入输入框 "),
17297
17339
  index === activeTagIndex.value && activeTagIndex.value !== _ctx.selectedUsers.length - 1 ? withDirectives((openBlock(), createElementBlock(
17298
17340
  "input",
@@ -17368,12 +17410,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
17368
17410
  return openBlock(), createBlock(UserTag, {
17369
17411
  "current-tenant-id": _ctx.tenantId,
17370
17412
  key: user.id,
17413
+ "render-tag": _ctx.renderTag,
17371
17414
  "show-tenant": true,
17372
17415
  tenants: _ctx.tenants,
17373
17416
  user,
17374
17417
  onClick: handleFocus,
17375
17418
  onClose: ($event) => removeUser(user)
17376
- }, null, 8, ["current-tenant-id", "tenants", "user", "onClose"]);
17419
+ }, null, 8, ["current-tenant-id", "render-tag", "tenants", "user", "onClose"]);
17377
17420
  }),
17378
17421
  128
17379
17422
  /* KEYED_FRAGMENT */
@@ -17406,7 +17449,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
17406
17449
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(searchQuery) ? searchQuery.value = $event : null),
17407
17450
  placeholder: !_ctx.selectedUsers.length ? _ctx.placeholder : "",
17408
17451
  onFocus: handleFocus
17409
- }, null, 40, _hoisted_3$1), [
17452
+ }, null, 40, _hoisted_3), [
17410
17453
  [vModelText, unref(searchQuery)]
17411
17454
  ]),
17412
17455
  createCommentVNode(' 未聚焦状态下的"我"标签 '),
@@ -17430,14 +17473,15 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
17430
17473
  "is-show": showDropdown.value,
17431
17474
  loading: unref(searchLoading),
17432
17475
  options: options.value,
17476
+ "render-list-item": _ctx.renderListItem,
17433
17477
  "search-query": unref(searchQuery),
17434
17478
  "tenant-id": _ctx.tenantId,
17435
17479
  tenants: _ctx.tenants,
17436
- "user-group": _ctx.userGroup,
17480
+ "user-group": userGroupFilter.value,
17437
17481
  "user-group-name": _ctx.userGroupName,
17438
17482
  onClickoutside: handleClickOutside,
17439
17483
  onSelectUser: addUser
17440
- }, null, 8, ["container-width", "empty-text", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
17484
+ }, null, 8, ["container-width", "empty-text", "is-show", "loading", "options", "render-list-item", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
17441
17485
  ],
17442
17486
  512
17443
17487
  /* NEED_PATCH */
@@ -17445,21 +17489,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
17445
17489
  };
17446
17490
  }
17447
17491
  });
17448
- const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-1b988eae"]]);
17449
- const _withScopeId = (n2) => (pushScopeId("data-v-5040d42f"), n2 = n2(), popScopeId(), n2);
17492
+ const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-5e95d86c"]]);
17450
17493
  const _hoisted_1$1 = { class: "input-container" };
17451
- const _hoisted_2 = {
17452
- key: 0,
17453
- class: "tenant-name"
17454
- };
17455
- const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode(
17456
- "i",
17457
- { class: "close-icon" },
17458
- "×",
17459
- -1
17460
- /* HOISTED */
17461
- ));
17462
- const _hoisted_4 = ["placeholder"];
17494
+ const _hoisted_2 = ["placeholder"];
17463
17495
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
17464
17496
  ...{
17465
17497
  name: "BkUserSelectorSingle"
@@ -17490,6 +17522,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
17490
17522
  const selectedUser = ref(props2.modelValue || "");
17491
17523
  const searchQuery = ref("");
17492
17524
  const showDropdown = ref(false);
17525
+ const userGroupFilter = computed(() => {
17526
+ return props2.userGroup.filter((group) => group.id !== selectedUser.value && !group.hidden);
17527
+ });
17493
17528
  const selectedUserInfo = computed(() => {
17494
17529
  const userGroup = (props2.userGroup || []).map((group) => ({
17495
17530
  ...group,
@@ -17588,24 +17623,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
17588
17623
  createCommentVNode(" 用户标签显示 "),
17589
17624
  selectedUserInfo.value ? (openBlock(), createElementBlock("div", {
17590
17625
  key: 0,
17591
- class: "selected-user",
17592
17626
  onClick: withModifiers(removeSelectedUser, ["stop"])
17593
17627
  }, [
17594
- createElementVNode(
17595
- "span",
17596
- null,
17597
- toDisplayString(selectedUserInfo.value.name),
17598
- 1
17599
- /* TEXT */
17600
- ),
17601
- selectedUserInfo.value.tenantId !== _ctx.tenantId && selectedUserInfo.value.tenantId && _ctx.tenants[selectedUserInfo.value.tenantId] ? (openBlock(), createElementBlock(
17602
- "span",
17603
- _hoisted_2,
17604
- "@" + toDisplayString(_ctx.tenants[selectedUserInfo.value.tenantId]),
17605
- 1
17606
- /* TEXT */
17607
- )) : createCommentVNode("v-if", true),
17608
- _hoisted_3
17628
+ createVNode(UserTag, {
17629
+ "render-tag": _ctx.renderTag,
17630
+ tenants: _ctx.tenants,
17631
+ user: selectedUserInfo.value,
17632
+ onClose: removeSelectedUser
17633
+ }, null, 8, ["render-tag", "tenants", "user"])
17609
17634
  ])) : createCommentVNode("v-if", true),
17610
17635
  withDirectives(createElementVNode("input", {
17611
17636
  ref_key: "inputRef",
@@ -17615,7 +17640,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
17615
17640
  placeholder: selectedUserInfo.value ? "" : _ctx.placeholder,
17616
17641
  onFocus: handleInputFocus,
17617
17642
  onInput: handleInput
17618
- }, null, 40, _hoisted_4), [
17643
+ }, null, 40, _hoisted_2), [
17619
17644
  [vModelText, searchQuery.value]
17620
17645
  ]),
17621
17646
  createCommentVNode(' "我"标签 '),
@@ -17632,20 +17657,21 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
17632
17657
  "is-show": showDropdown.value,
17633
17658
  loading: isLoading.value,
17634
17659
  options: options.value,
17660
+ "render-list-item": _ctx.renderListItem,
17635
17661
  "search-query": searchQuery.value,
17636
17662
  "tenant-id": _ctx.tenantId,
17637
17663
  tenants: _ctx.tenants,
17638
- "user-group": _ctx.userGroup,
17664
+ "user-group": userGroupFilter.value,
17639
17665
  "user-group-name": _ctx.userGroupName,
17640
17666
  onSelectUser: addUser
17641
- }, null, 8, ["container-width", "empty-text", "is-show", "loading", "options", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
17667
+ }, null, 8, ["container-width", "empty-text", "is-show", "loading", "options", "render-list-item", "search-query", "tenant-id", "tenants", "user-group", "user-group-name"])
17642
17668
  ])), [
17643
17669
  [unref(__webpack_exports__clickoutside), handleClickOutside]
17644
17670
  ]);
17645
17671
  };
17646
17672
  }
17647
17673
  });
17648
- const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-5040d42f"]]);
17674
+ const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-02021e20"]]);
17649
17675
  const _hoisted_1 = {
17650
17676
  ref: "containerRef",
17651
17677
  class: "bk-user-selector"