@blueking/bk-user-selector 0.0.31 → 0.0.32

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
@@ -143,6 +143,7 @@ export default {
143
143
  | renderListItem | 渲染列表项 | Function(h, userInfo) => VNode | - |
144
144
  | excludeUserIds | 排除的用户ID列表 | Array | [] |
145
145
  | enableMultiTenantMode | 是否启用多租户模式,关闭后则使用原有用户管理接口查询 | Boolean | true |
146
+ | allowCreate | 是否允许自定义用户输入,按 Enter 确认 | Boolean | false |
146
147
 
147
148
  ### 事件
148
149
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/bk-user-selector",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "description": "蓝鲸用户选择器",
5
5
  "license": "MIT",
6
6
  "author": "Tencent BlueKing",
@@ -1,4 +1,4 @@
1
- declare const _default: import("vue").DefineComponent<{
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
2
  /**
3
3
  * 当前用户ID
4
4
  */
@@ -13,7 +13,7 @@ declare const _default: import("vue").DefineComponent<{
13
13
  type: BooleanConstructor;
14
14
  default: boolean;
15
15
  };
16
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
17
  click: (...args: any[]) => void;
18
18
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
19
19
  /**
@@ -30,10 +30,10 @@ declare const _default: import("vue").DefineComponent<{
30
30
  type: BooleanConstructor;
31
31
  default: boolean;
32
32
  };
33
- }>> & {
33
+ }>> & Readonly<{
34
34
  onClick?: ((...args: any[]) => any) | undefined;
35
- }, {
35
+ }>, {
36
36
  currentUserId: string;
37
37
  isDisabled: boolean;
38
- }, {}>;
38
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
39
39
  export default _default;
@@ -1,41 +1,13 @@
1
1
  import { FormattedUser, MultipleSelectorProps } from '../types';
2
- declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<MultipleSelectorProps>, {
3
- modelValue: () => never[];
4
- placeholder: string;
5
- draggable: boolean;
6
- apiBaseUrl: string;
7
- tenantId: string;
8
- selectedUsers: () => never[];
9
- tenants: () => {};
10
- currentUserId: string;
11
- exactSearchKey: string;
12
- userGroup: () => never[];
13
- userGroupName: string;
14
- emptyText: string;
15
- excludeUserIds: () => never[];
16
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
+ declare const _default: import("vue").DefineComponent<MultipleSelectorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
3
  "update:selectedUsers": (...args: any[]) => void;
18
4
  "add-user": (...args: any[]) => void;
19
5
  "remove-user": (...args: any[]) => void;
20
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<MultipleSelectorProps>, {
21
- modelValue: () => never[];
22
- placeholder: string;
23
- draggable: boolean;
24
- apiBaseUrl: string;
25
- tenantId: string;
26
- selectedUsers: () => never[];
27
- tenants: () => {};
28
- currentUserId: string;
29
- exactSearchKey: string;
30
- userGroup: () => never[];
31
- userGroupName: string;
32
- emptyText: string;
33
- excludeUserIds: () => never[];
34
- }>>> & {
6
+ }, string, import("vue").PublicProps, Readonly<MultipleSelectorProps> & Readonly<{
35
7
  "onUpdate:selectedUsers"?: ((...args: any[]) => any) | undefined;
36
8
  "onAdd-user"?: ((...args: any[]) => any) | undefined;
37
9
  "onRemove-user"?: ((...args: any[]) => any) | undefined;
38
- }, {
10
+ }>, {
39
11
  tenantId: string;
40
12
  apiBaseUrl: string;
41
13
  exactSearchKey: string;
@@ -57,22 +29,6 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
57
29
  selectedUsers: FormattedUser[];
58
30
  placeholder: string;
59
31
  excludeUserIds: string[];
60
- }, {}>;
32
+ allowCreate: boolean;
33
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
61
34
  export default _default;
62
- type __VLS_WithDefaults<P, D> = {
63
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
64
- default: D[K];
65
- }> : P[K];
66
- };
67
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
68
- type __VLS_TypePropsToOption<T> = {
69
- [K in keyof T]-?: {} extends Pick<T, K> ? {
70
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
71
- } : {
72
- type: import('vue').PropType<T[K]>;
73
- required: true;
74
- };
75
- };
76
- type __VLS_PrettifyLocal<T> = {
77
- [K in keyof T]: T[K];
78
- } & {};
@@ -14,7 +14,7 @@ declare const __VLS_templateResult: {
14
14
  attrs: Partial<typeof __VLS_inheritedAttrs>;
15
15
  };
16
16
  type __VLS_Slots = typeof __VLS_templateResult['slots'];
17
- declare const __VLS_component: import("vue").DefineComponent<{
17
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
18
18
  /**
19
19
  * 是否显示下拉菜单
20
20
  */
@@ -102,7 +102,7 @@ declare const __VLS_component: import("vue").DefineComponent<{
102
102
  renderListItem: {
103
103
  type: () => (h: typeof createVNode, item: FormattedUser) => VNode;
104
104
  };
105
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
105
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
106
106
  "select-user": (...args: any[]) => void;
107
107
  "click-outside": (...args: any[]) => void;
108
108
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -193,10 +193,10 @@ declare const __VLS_component: import("vue").DefineComponent<{
193
193
  renderListItem: {
194
194
  type: () => (h: typeof createVNode, item: FormattedUser) => VNode;
195
195
  };
196
- }>> & {
196
+ }>> & Readonly<{
197
197
  "onSelect-user"?: ((...args: any[]) => any) | undefined;
198
198
  "onClick-outside"?: ((...args: any[]) => any) | undefined;
199
- }, {
199
+ }>, {
200
200
  tenantId: string;
201
201
  tenants: Record<string, string>;
202
202
  isShow: boolean;
@@ -212,7 +212,7 @@ declare const __VLS_component: import("vue").DefineComponent<{
212
212
  }[];
213
213
  userGroupName: string;
214
214
  emptyText: string;
215
- }, {}>;
215
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
216
216
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_Slots>;
217
217
  export default _default;
218
218
  type __VLS_PickRefsExpose<T> = T extends object ? {
@@ -1,33 +1,11 @@
1
1
  import { SingleSelectorProps } from '../types';
2
- declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<SingleSelectorProps>, {
3
- apiBaseUrl: string;
4
- tenantId: string;
5
- placeholder: string;
6
- modelValue: string;
7
- currentUserId: string;
8
- exactSearchKey: string;
9
- userGroup: () => never[];
10
- userGroupName: string;
11
- emptyText: string;
12
- excludeUserIds: () => never[];
13
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
+ declare const _default: import("vue").DefineComponent<SingleSelectorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
3
  change: (...args: any[]) => void;
15
4
  "update:modelValue": (...args: any[]) => void;
16
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<SingleSelectorProps>, {
17
- apiBaseUrl: string;
18
- tenantId: string;
19
- placeholder: string;
20
- modelValue: string;
21
- currentUserId: string;
22
- exactSearchKey: string;
23
- userGroup: () => never[];
24
- userGroupName: string;
25
- emptyText: string;
26
- excludeUserIds: () => never[];
27
- }>>> & {
5
+ }, string, import("vue").PublicProps, Readonly<SingleSelectorProps> & Readonly<{
28
6
  onChange?: ((...args: any[]) => any) | undefined;
29
7
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
30
- }, {
8
+ }>, {
31
9
  tenantId: string;
32
10
  apiBaseUrl: string;
33
11
  exactSearchKey: string;
@@ -46,22 +24,5 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
46
24
  modelValue: string;
47
25
  placeholder: string;
48
26
  excludeUserIds: string[];
49
- }, {}>;
27
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
50
28
  export default _default;
51
- type __VLS_WithDefaults<P, D> = {
52
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
53
- default: D[K];
54
- }> : P[K];
55
- };
56
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
57
- type __VLS_TypePropsToOption<T> = {
58
- [K in keyof T]-?: {} extends Pick<T, K> ? {
59
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
60
- } : {
61
- type: import('vue').PropType<T[K]>;
62
- required: true;
63
- };
64
- };
65
- type __VLS_PrettifyLocal<T> = {
66
- [K in keyof T]: T[K];
67
- } & {};
@@ -1,5 +1,5 @@
1
1
  import type { FormattedUser } from '../types';
2
- declare const _default: import("vue").DefineComponent<{
2
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
3
  user: {
4
4
  type: () => FormattedUser;
5
5
  required: true;
@@ -16,7 +16,7 @@ declare const _default: import("vue").DefineComponent<{
16
16
  type: FunctionConstructor;
17
17
  required: false;
18
18
  };
19
- }, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
19
+ }>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
20
20
  user: {
21
21
  type: () => FormattedUser;
22
22
  required: true;
@@ -33,5 +33,5 @@ declare const _default: import("vue").DefineComponent<{
33
33
  type: FunctionConstructor;
34
34
  required: false;
35
35
  };
36
- }>>, {}, {}>;
36
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
37
37
  export default _default;
@@ -1,41 +1,11 @@
1
1
  import { UserSelectorProps } from '../types';
2
- declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<UserSelectorProps>, {
3
- apiBaseUrl: string;
4
- tenantId: string;
5
- placeholder: string;
6
- modelValue: string;
7
- draggable: boolean;
8
- multiple: boolean;
9
- disabled: boolean;
10
- currentUserId: string;
11
- exactSearchKey: string;
12
- userGroup: () => never[];
13
- userGroupName: string;
14
- emptyText: string;
15
- excludeUserIds: () => never[];
16
- enableMultiTenantMode: boolean;
17
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
+ declare const _default: import("vue").DefineComponent<UserSelectorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
3
  change: (...args: any[]) => void;
19
4
  "update:modelValue": (...args: any[]) => void;
20
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<UserSelectorProps>, {
21
- apiBaseUrl: string;
22
- tenantId: string;
23
- placeholder: string;
24
- modelValue: string;
25
- draggable: boolean;
26
- multiple: boolean;
27
- disabled: boolean;
28
- currentUserId: string;
29
- exactSearchKey: string;
30
- userGroup: () => never[];
31
- userGroupName: string;
32
- emptyText: string;
33
- excludeUserIds: () => never[];
34
- enableMultiTenantMode: boolean;
35
- }>>> & {
5
+ }, string, import("vue").PublicProps, Readonly<UserSelectorProps> & Readonly<{
36
6
  onChange?: ((...args: any[]) => any) | undefined;
37
7
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
38
- }, {
8
+ }>, {
39
9
  tenantId: string;
40
10
  apiBaseUrl: string;
41
11
  enableMultiTenantMode: boolean;
@@ -58,23 +28,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
58
28
  modelValue: string | string[];
59
29
  placeholder: string;
60
30
  excludeUserIds: string[];
31
+ allowCreate: boolean;
61
32
  multiple: boolean;
62
- }, {}>;
33
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
63
34
  export default _default;
64
- type __VLS_WithDefaults<P, D> = {
65
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
66
- default: D[K];
67
- }> : P[K];
68
- };
69
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
70
- type __VLS_TypePropsToOption<T> = {
71
- [K in keyof T]-?: {} extends Pick<T, K> ? {
72
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
73
- } : {
74
- type: import('vue').PropType<T[K]>;
75
- required: true;
76
- };
77
- };
78
- type __VLS_PrettifyLocal<T> = {
79
- [K in keyof T]: T[K];
80
- } & {};
@@ -1,6 +1,6 @@
1
1
  import { createVNode, VNode } from 'vue';
2
2
  import { FormattedUser } from '../types';
3
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
3
+ declare const _default: import("vue").DefineComponent<{
4
4
  /**
5
5
  * 用户信息
6
6
  */
@@ -29,10 +29,10 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
29
29
  * 渲染标签
30
30
  */
31
31
  renderTag?: (h: typeof createVNode, userInfo: FormattedUser) => VNode;
32
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
32
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
33
33
  click: (...args: any[]) => void;
34
34
  close: (...args: any[]) => void;
35
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
35
+ }, string, import("vue").PublicProps, Readonly<{
36
36
  /**
37
37
  * 用户信息
38
38
  */
@@ -61,17 +61,8 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
61
61
  * 渲染标签
62
62
  */
63
63
  renderTag?: (h: typeof createVNode, userInfo: FormattedUser) => VNode;
64
- }>>> & {
64
+ }> & Readonly<{
65
65
  onClick?: ((...args: any[]) => any) | undefined;
66
66
  onClose?: ((...args: any[]) => any) | undefined;
67
- }, {}, {}>;
67
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
68
68
  export default _default;
69
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
70
- type __VLS_TypePropsToOption<T> = {
71
- [K in keyof T]-?: {} extends Pick<T, K> ? {
72
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
73
- } : {
74
- type: import('vue').PropType<T[K]>;
75
- required: true;
76
- };
77
- };
@@ -11,7 +11,7 @@ import { type Ref } from 'vue';
11
11
  * @returns 租户数据和加载状态
12
12
  */
13
13
  export declare const useTenantData: (apiBaseUrl: string, tenantId: string, enableMultiTenantMode?: boolean) => {
14
- tenants: Ref<Record<string, string>>;
15
- loading: Ref<boolean>;
14
+ tenants: Ref<Record<string, string>, Record<string, string>>;
15
+ loading: Ref<boolean, boolean>;
16
16
  fetchTenants: () => Promise<void>;
17
17
  };
@@ -11,9 +11,9 @@ import { type FormattedUser } from '../types';
11
11
  * @returns 用户搜索相关状态和方法
12
12
  */
13
13
  export declare const useUserSearch: (apiBaseUrl: string, tenantId: string, enableMultiTenantMode?: boolean) => {
14
- searchResults: Ref<FormattedUser[]>;
15
- loading: Ref<boolean>;
16
- searchQuery: Ref<string>;
14
+ searchResults: Ref<FormattedUser[], FormattedUser[]>;
15
+ loading: Ref<boolean, boolean>;
16
+ searchQuery: Ref<string, string>;
17
17
  performSearch: (keyword: string) => Promise<void>;
18
18
  handleSearchInput: (value: string) => void;
19
19
  clearSearch: () => void;
@@ -3,5 +3,7 @@ declare const _default: {
3
3
  请输入人员名称搜索: string;
4
4
  用户群组: string;
5
5
  无匹配人员: string;
6
+ 虚拟账号: string;
7
+ 用户: string;
6
8
  };
7
9
  export default _default;
@@ -3,5 +3,7 @@ declare const _default: {
3
3
  请输入人员名称搜索: string;
4
4
  用户群组: string;
5
5
  无匹配人员: string;
6
+ 虚拟账号: string;
7
+ 用户: string;
6
8
  };
7
9
  export default _default;
@@ -131,6 +131,10 @@ interface BaseSelectorProps {
131
131
  * 是否启用多租户模式
132
132
  */
133
133
  enableMultiTenantMode?: boolean;
134
+ /**
135
+ * 是否允许创建用户
136
+ */
137
+ allowCreate?: boolean;
134
138
  }
135
139
  /**
136
140
  * 用户选择器属性