@blueking/bk-user-selector 0.0.23 → 0.0.24

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.
@@ -3351,7 +3351,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
3351
3351
  userGroupName: { default: "用户群组" },
3352
3352
  emptyText: { default: "无匹配人员" },
3353
3353
  renderListItem: {},
3354
- renderTag: {}
3354
+ renderTag: {},
3355
+ excludeUserIds: { default: () => [] }
3355
3356
  },
3356
3357
  emits: ["update:selectedUsers", "add-user", "remove-user"],
3357
3358
  setup(__props, { emit: __emit }) {
@@ -3378,7 +3379,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
3378
3379
  const visibleUsers = ref([]);
3379
3380
  const hiddenCount = ref(0);
3380
3381
  const options = computed(() => {
3381
- return searchResults.value.filter((user) => !props.selectedUsers.some((selectedUser) => selectedUser.id === user.id));
3382
+ return searchResults.value.filter((user) => !props.selectedUsers.some((selectedUser) => selectedUser.id === user.id)).filter((user) => !props.excludeUserIds.includes(user.id));
3382
3383
  });
3383
3384
  const userGroupFilter = computed(() => {
3384
3385
  return props.userGroup.filter((group) => !props.selectedUsers.some((user) => user.id === group.id) && !group.hidden);
@@ -3820,7 +3821,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
3820
3821
  };
3821
3822
  }
3822
3823
  });
3823
- const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-d9743f6d"]]);
3824
+ const MultipleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-9fc5bebf"]]);
3824
3825
  const _hoisted_1$1 = { class: "input-container" };
3825
3826
  const _hoisted_2 = ["placeholder"];
3826
3827
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
@@ -3840,7 +3841,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3840
3841
  userGroupName: { default: "用户群组" },
3841
3842
  emptyText: { default: "无匹配人员" },
3842
3843
  renderListItem: {},
3843
- renderTag: {}
3844
+ renderTag: {},
3845
+ excludeUserIds: { default: () => [] }
3844
3846
  },
3845
3847
  emits: ["update:modelValue", "change"],
3846
3848
  setup(__props, { emit: __emit }) {
@@ -3874,7 +3876,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3874
3876
  const result = await lookupUsers(props.apiBaseUrl || "", props.tenantId || "", props.exactSearchKey, [
3875
3877
  props.modelValue
3876
3878
  ]);
3877
- options.value = formatUsers(result);
3879
+ options.value = formatUsers(result).filter((user) => !props.excludeUserIds.includes(user.id));
3878
3880
  if (props.userGroup.length > 0) {
3879
3881
  const groupResult = props.userGroup.filter((group) => group.id == props.modelValue);
3880
3882
  options.value = groupResult.map((group) => ({
@@ -3901,7 +3903,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3901
3903
  const result = await lookupUsers(props.apiBaseUrl, props.tenantId, props.exactSearchKey, [props.currentUserId]);
3902
3904
  const formattedResults = formatUsers(result);
3903
3905
  if (formattedResults.length > 0) {
3904
- options.value = formattedResults;
3906
+ options.value = formattedResults.filter((user) => !props.excludeUserIds.includes(user.id));
3905
3907
  addUser(formattedResults[0]);
3906
3908
  }
3907
3909
  } catch (error) {
@@ -3916,7 +3918,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3916
3918
  isLoading.value = true;
3917
3919
  try {
3918
3920
  const result = await searchUsers(props.apiBaseUrl, props.tenantId, keyword);
3919
- options.value = formatUsers(result).filter((user) => !selectedUser.value || user.id !== selectedUser.value);
3921
+ options.value = formatUsers(result).filter((user) => !selectedUser.value || user.id !== selectedUser.value).filter((user) => !props.excludeUserIds.includes(user.id));
3920
3922
  } catch (error) {
3921
3923
  console.error("获取用户列表失败:", error);
3922
3924
  options.value = [];
@@ -4014,7 +4016,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
4014
4016
  };
4015
4017
  }
4016
4018
  });
4017
- const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-75a8e031"]]);
4019
+ const SingleSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-1454c121"]]);
4018
4020
  const _hoisted_1 = {
4019
4021
  ref: "containerRef",
4020
4022
  class: "bk-user-selector"
@@ -4037,7 +4039,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4037
4039
  userGroupName: { default: "用户群组" },
4038
4040
  emptyText: { default: "无匹配人员" },
4039
4041
  renderListItem: {},
4040
- renderTag: {}
4042
+ renderTag: {},
4043
+ excludeUserIds: { default: () => [] }
4041
4044
  },
4042
4045
  emits: ["update:modelValue", "change"],
4043
4046
  setup(__props, { emit: __emit }) {
@@ -4120,6 +4123,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4120
4123
  "current-user-id": _ctx.currentUserId,
4121
4124
  "empty-text": _ctx.emptyText,
4122
4125
  "exact-search-key": _ctx.exactSearchKey,
4126
+ "exclude-user-ids": _ctx.excludeUserIds,
4123
4127
  placeholder: _ctx.placeholder,
4124
4128
  "render-list-item": _ctx.renderListItem,
4125
4129
  "render-tag": _ctx.renderTag,
@@ -4128,7 +4132,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4128
4132
  "user-group": _ctx.userGroup,
4129
4133
  "user-group-name": _ctx.userGroupName,
4130
4134
  onChange: handleUpdateUser
4131
- }, null, 8, ["modelValue", "api-base-url", "current-user-id", "empty-text", "exact-search-key", "placeholder", "render-list-item", "render-tag", "tenant-id", "tenants", "user-group", "user-group-name"])) : (openBlock(), createElementBlock(
4135
+ }, null, 8, ["modelValue", "api-base-url", "current-user-id", "empty-text", "exact-search-key", "exclude-user-ids", "placeholder", "render-list-item", "render-tag", "tenant-id", "tenants", "user-group", "user-group-name"])) : (openBlock(), createElementBlock(
4132
4136
  Fragment,
4133
4137
  { key: 1 },
4134
4138
  [
@@ -4141,6 +4145,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4141
4145
  draggable: _ctx.draggable,
4142
4146
  "empty-text": _ctx.emptyText,
4143
4147
  "exact-search-key": _ctx.exactSearchKey,
4148
+ "exclude-user-ids": _ctx.excludeUserIds,
4144
4149
  placeholder: _ctx.placeholder,
4145
4150
  "render-list-item": _ctx.renderListItem,
4146
4151
  "render-tag": _ctx.renderTag,
@@ -4150,7 +4155,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4150
4155
  "user-group": _ctx.userGroup,
4151
4156
  "user-group-name": _ctx.userGroupName,
4152
4157
  "onUpdate:selectedUsers": handleUpdateSelectedUsers
4153
- }, null, 8, ["modelValue", "api-base-url", "current-user-id", "draggable", "empty-text", "exact-search-key", "placeholder", "render-list-item", "render-tag", "selected-users", "tenant-id", "tenants", "user-group", "user-group-name"])
4158
+ }, null, 8, ["modelValue", "api-base-url", "current-user-id", "draggable", "empty-text", "exact-search-key", "exclude-user-ids", "placeholder", "render-list-item", "render-tag", "selected-users", "tenant-id", "tenants", "user-group", "user-group-name"])
4154
4159
  ],
4155
4160
  2112
4156
4161
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
@@ -4162,7 +4167,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4162
4167
  };
4163
4168
  }
4164
4169
  });
4165
- const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-53d8b462"]]);
4170
+ const BkUserSelector = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-906da21c"]]);
4166
4171
  export {
4167
4172
  BkUserSelector,
4168
4173
  BkUserSelector as default