@blueking/bk-user-selector 0.0.29-beta.9 → 0.0.31-beta.1

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
@@ -124,24 +124,25 @@ export default {
124
124
 
125
125
  ### 属性
126
126
 
127
- | 参数 | 说明 | 类型 | 默认值 |
128
- | -------------------- | ----------------------------------------------------------------------- | ------------------------------ | ------------------ |
129
- | modelValue / v-model | 绑定值,单选为字符串,多选为数组 | String / Array | '' / [] |
130
- | apiBaseUrl | API 基础 URL | String | '' |
131
- | tenantId | 租户 ID | String | '' |
132
- | label | 文本标签 | String | 人员选择 |
133
- | placeholder | 占位文本 | String | 请输入人员名称搜索 |
134
- | multiple | 是否多选 | Boolean | false |
135
- | draggable | 是否可拖拽(仅多选模式有效) | Boolean | false |
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
- | disabled | 是否禁用 | Boolean | false |
142
- | renderTag | 渲染标签 | Function(h, userInfo) => VNode | - |
143
- | renderListItem | 渲染列表项 | Function(h, userInfo) => VNode | - |
144
- | excludeUserIds | 排除的用户ID列表 | Array | [] |
127
+ | 参数 | 说明 | 类型 | 默认值 |
128
+ | --------------------- | ----------------------------------------------------------------------- | ------------------------------ | ------------------ |
129
+ | modelValue / v-model | 绑定值,单选为字符串,多选为数组 | String / Array | '' / [] |
130
+ | apiBaseUrl | API 基础 URL | String | '' |
131
+ | tenantId | 租户 ID | String | '' |
132
+ | label | 文本标签 | String | 人员选择 |
133
+ | placeholder | 占位文本 | String | 请输入人员名称搜索 |
134
+ | multiple | 是否多选 | Boolean | false |
135
+ | draggable | 是否可拖拽(仅多选模式有效) | Boolean | false |
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
+ | disabled | 是否禁用 | Boolean | false |
142
+ | renderTag | 渲染标签 | Function(h, userInfo) => VNode | - |
143
+ | renderListItem | 渲染列表项 | Function(h, userInfo) => VNode | - |
144
+ | excludeUserIds | 排除的用户ID列表 | Array | [] |
145
+ | enableMultiTenantMode | 是否启用多租户模式,关闭后则使用原有用户管理接口查询 | Boolean | true |
145
146
 
146
147
  ### 事件
147
148
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/bk-user-selector",
3
- "version": "0.0.29-beta.9",
3
+ "version": "0.0.31-beta.1",
4
4
  "description": "蓝鲸用户选择器",
5
5
  "license": "MIT",
6
6
  "author": "Tencent BlueKing",
@@ -1,4 +1,4 @@
1
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
1
+ declare const _default: import("vue").DefineComponent<{
2
2
  /**
3
3
  * 当前用户ID
4
4
  */
@@ -13,7 +13,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
13
13
  type: BooleanConstructor;
14
14
  default: boolean;
15
15
  };
16
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
+ }, {}, unknown, {}, {}, 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<import("vue").ExtractPropT
30
30
  type: BooleanConstructor;
31
31
  default: boolean;
32
32
  };
33
- }>> & Readonly<{
33
+ }>> & {
34
34
  onClick?: ((...args: any[]) => any) | undefined;
35
- }>, {
35
+ }, {
36
36
  currentUserId: string;
37
37
  isDisabled: boolean;
38
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
38
+ }, {}>;
39
39
  export default _default;
@@ -1,13 +1,41 @@
1
1
  import { FormattedUser, MultipleSelectorProps } from '../types';
2
- declare const _default: import("vue").DefineComponent<MultipleSelectorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
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, {
3
17
  "update:selectedUsers": (...args: any[]) => void;
4
18
  "add-user": (...args: any[]) => void;
5
19
  "remove-user": (...args: any[]) => void;
6
- }, string, import("vue").PublicProps, Readonly<MultipleSelectorProps> & Readonly<{
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
+ }>>> & {
7
35
  "onUpdate:selectedUsers"?: ((...args: any[]) => any) | undefined;
8
36
  "onAdd-user"?: ((...args: any[]) => any) | undefined;
9
37
  "onRemove-user"?: ((...args: any[]) => any) | undefined;
10
- }>, {
38
+ }, {
11
39
  tenantId: string;
12
40
  apiBaseUrl: string;
13
41
  exactSearchKey: string;
@@ -29,5 +57,22 @@ declare const _default: import("vue").DefineComponent<MultipleSelectorProps, {},
29
57
  selectedUsers: FormattedUser[];
30
58
  placeholder: string;
31
59
  excludeUserIds: string[];
32
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
60
+ }, {}>;
33
61
  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
+ } & {};
@@ -3,7 +3,18 @@
3
3
  */
4
4
  import { createVNode, VNode } from 'vue';
5
5
  import { FormattedUser } from '../types';
6
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
+ declare var __VLS_20: {};
7
+ declare var __VLS_inheritedAttrs: {};
8
+ declare const __VLS_refs: {};
9
+ declare const __VLS_templateResult: {
10
+ slots: {
11
+ default?(_: typeof __VLS_20): any;
12
+ };
13
+ refs: __VLS_PickRefsExpose<typeof __VLS_refs>;
14
+ attrs: Partial<typeof __VLS_inheritedAttrs>;
15
+ };
16
+ type __VLS_Slots = typeof __VLS_templateResult['slots'];
17
+ declare const __VLS_component: import("vue").DefineComponent<{
7
18
  /**
8
19
  * 是否显示下拉菜单
9
20
  */
@@ -91,7 +102,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
91
102
  renderListItem: {
92
103
  type: () => (h: typeof createVNode, item: FormattedUser) => VNode;
93
104
  };
94
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
105
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
95
106
  "select-user": (...args: any[]) => void;
96
107
  "click-outside": (...args: any[]) => void;
97
108
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -182,10 +193,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
182
193
  renderListItem: {
183
194
  type: () => (h: typeof createVNode, item: FormattedUser) => VNode;
184
195
  };
185
- }>> & Readonly<{
196
+ }>> & {
186
197
  "onSelect-user"?: ((...args: any[]) => any) | undefined;
187
198
  "onClick-outside"?: ((...args: any[]) => any) | undefined;
188
- }>, {
199
+ }, {
189
200
  tenantId: string;
190
201
  tenants: Record<string, string>;
191
202
  isShow: boolean;
@@ -201,5 +212,16 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
201
212
  }[];
202
213
  userGroupName: string;
203
214
  emptyText: string;
204
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
215
+ }, {}>;
216
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_Slots>;
205
217
  export default _default;
218
+ type __VLS_PickRefsExpose<T> = T extends object ? {
219
+ [K in keyof T]: (T[K] extends any[] ? Parameters<T[K][0]['expose']>[0][] : T[K] extends {
220
+ expose?: (exposed: infer E) => void;
221
+ } ? E : T[K]) | null;
222
+ } : never;
223
+ type __VLS_WithTemplateSlots<T, S> = T & {
224
+ new (): {
225
+ $slots: S;
226
+ };
227
+ };
@@ -1,11 +1,33 @@
1
1
  import { SingleSelectorProps } from '../types';
2
- declare const _default: import("vue").DefineComponent<SingleSelectorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
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, {
3
14
  change: (...args: any[]) => void;
4
15
  "update:modelValue": (...args: any[]) => void;
5
- }, string, import("vue").PublicProps, Readonly<SingleSelectorProps> & Readonly<{
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
+ }>>> & {
6
28
  onChange?: ((...args: any[]) => any) | undefined;
7
29
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
8
- }>, {
30
+ }, {
9
31
  tenantId: string;
10
32
  apiBaseUrl: string;
11
33
  exactSearchKey: string;
@@ -24,5 +46,22 @@ declare const _default: import("vue").DefineComponent<SingleSelectorProps, {}, {
24
46
  modelValue: string;
25
47
  placeholder: string;
26
48
  excludeUserIds: string[];
27
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
49
+ }, {}>;
28
50
  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<import("vue").ExtractPropTypes<{
2
+ declare const _default: import("vue").DefineComponent<{
3
3
  user: {
4
4
  type: () => FormattedUser;
5
5
  required: true;
@@ -16,7 +16,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
16
16
  type: FunctionConstructor;
17
17
  required: false;
18
18
  };
19
- }>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
19
+ }, () => any, unknown, {}, {}, 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<import("vue").ExtractPropT
33
33
  type: FunctionConstructor;
34
34
  required: false;
35
35
  };
36
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
36
+ }>>, {}, {}>;
37
37
  export default _default;
@@ -1,11 +1,41 @@
1
1
  import { UserSelectorProps } from '../types';
2
- declare const _default: import("vue").DefineComponent<UserSelectorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
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, {
3
18
  change: (...args: any[]) => void;
4
19
  "update:modelValue": (...args: any[]) => void;
5
- }, string, import("vue").PublicProps, Readonly<UserSelectorProps> & Readonly<{
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
+ }>>> & {
6
36
  onChange?: ((...args: any[]) => any) | undefined;
7
37
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
8
- }>, {
38
+ }, {
9
39
  tenantId: string;
10
40
  apiBaseUrl: string;
11
41
  enableMultiTenantMode: boolean;
@@ -29,5 +59,22 @@ declare const _default: import("vue").DefineComponent<UserSelectorProps, {}, {},
29
59
  placeholder: string;
30
60
  excludeUserIds: string[];
31
61
  multiple: boolean;
32
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
62
+ }, {}>;
33
63
  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<{
3
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
4
4
  /**
5
5
  * 用户信息
6
6
  */
@@ -29,10 +29,10 @@ declare const _default: import("vue").DefineComponent<{
29
29
  * 渲染标签
30
30
  */
31
31
  renderTag?: (h: typeof createVNode, userInfo: FormattedUser) => VNode;
32
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
32
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
33
33
  click: (...args: any[]) => void;
34
34
  close: (...args: any[]) => void;
35
- }, string, import("vue").PublicProps, Readonly<{
35
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
36
36
  /**
37
37
  * 用户信息
38
38
  */
@@ -61,8 +61,17 @@ declare const _default: import("vue").DefineComponent<{
61
61
  * 渲染标签
62
62
  */
63
63
  renderTag?: (h: typeof createVNode, userInfo: FormattedUser) => VNode;
64
- }> & Readonly<{
64
+ }>>> & {
65
65
  onClick?: ((...args: any[]) => any) | undefined;
66
66
  onClose?: ((...args: any[]) => any) | undefined;
67
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
67
+ }, {}, {}>;
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
+ };
@@ -0,0 +1,5 @@
1
+ declare const _default: () => {
2
+ local: "en-US" | "zh-CN";
3
+ t: (path: string, variable?: any) => any;
4
+ };
5
+ export default _default;
@@ -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>, Record<string, string>>;
15
- loading: Ref<boolean, boolean>;
14
+ tenants: Ref<Record<string, string>>;
15
+ loading: Ref<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[], FormattedUser[]>;
15
- loading: Ref<boolean, boolean>;
16
- searchQuery: Ref<string, string>;
14
+ searchResults: Ref<FormattedUser[]>;
15
+ loading: Ref<boolean>;
16
+ searchQuery: Ref<string>;
17
17
  performSearch: (keyword: string) => Promise<void>;
18
18
  handleSearchInput: (value: string) => void;
19
19
  clearSearch: () => void;
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ 我: string;
3
+ 请输入人员名称搜索: string;
4
+ 用户群组: string;
5
+ 无匹配人员: string;
6
+ };
7
+ export default _default;
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ 我: string;
3
+ 请输入人员名称搜索: string;
4
+ 用户群组: string;
5
+ 无匹配人员: string;
6
+ };
7
+ export default _default;