@blueking/bk-user-selector 0.0.21 → 0.0.23-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/bk-user-selector",
3
- "version": "0.0.21",
3
+ "version": "0.0.23-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<{
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,39 +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
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
+ declare const _default: import("vue").DefineComponent<MultipleSelectorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
3
  "update:selectedUsers": (...args: any[]) => void;
17
4
  "add-user": (...args: any[]) => void;
18
5
  "remove-user": (...args: any[]) => void;
19
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<MultipleSelectorProps>, {
20
- modelValue: () => never[];
21
- placeholder: string;
22
- draggable: boolean;
23
- apiBaseUrl: string;
24
- tenantId: string;
25
- selectedUsers: () => never[];
26
- tenants: () => {};
27
- currentUserId: string;
28
- exactSearchKey: string;
29
- userGroup: () => never[];
30
- userGroupName: string;
31
- emptyText: string;
32
- }>>> & {
6
+ }, string, import("vue").PublicProps, Readonly<MultipleSelectorProps> & Readonly<{
33
7
  "onUpdate:selectedUsers"?: ((...args: any[]) => any) | undefined;
34
8
  "onAdd-user"?: ((...args: any[]) => any) | undefined;
35
9
  "onRemove-user"?: ((...args: any[]) => any) | undefined;
36
- }, {
10
+ }>, {
37
11
  tenantId: string;
38
12
  currentUserId: string;
39
13
  tenants: Record<string, string>;
@@ -54,22 +28,5 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
54
28
  apiBaseUrl: string;
55
29
  placeholder: string;
56
30
  exactSearchKey: string;
57
- }, {}>;
31
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
58
32
  export default _default;
59
- type __VLS_WithDefaults<P, D> = {
60
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
61
- default: D[K];
62
- }> : P[K];
63
- };
64
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
65
- type __VLS_TypePropsToOption<T> = {
66
- [K in keyof T]-?: {} extends Pick<T, K> ? {
67
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
68
- } : {
69
- type: import('vue').PropType<T[K]>;
70
- required: true;
71
- };
72
- };
73
- type __VLS_PrettifyLocal<T> = {
74
- [K in keyof T]: T[K];
75
- } & {};
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import { createVNode, VNode } from 'vue';
5
5
  import { FormattedUser } from '../types';
6
- declare const _default: import("vue").DefineComponent<{
6
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
7
7
  /**
8
8
  * 是否显示下拉菜单
9
9
  */
@@ -18,6 +18,13 @@ declare const _default: import("vue").DefineComponent<{
18
18
  type: (StringConstructor | NumberConstructor)[];
19
19
  default: string;
20
20
  };
21
+ /**
22
+ * popover crossAxis 偏移量
23
+ */
24
+ crossAxisOffset: {
25
+ type: NumberConstructor;
26
+ default: number;
27
+ };
21
28
  /**
22
29
  * 是否加载中
23
30
  */
@@ -84,8 +91,9 @@ declare const _default: import("vue").DefineComponent<{
84
91
  renderListItem: {
85
92
  type: () => (h: typeof createVNode, item: FormattedUser) => VNode;
86
93
  };
87
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
94
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
88
95
  "select-user": (...args: any[]) => void;
96
+ "click-outside": (...args: any[]) => void;
89
97
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
90
98
  /**
91
99
  * 是否显示下拉菜单
@@ -101,6 +109,13 @@ declare const _default: import("vue").DefineComponent<{
101
109
  type: (StringConstructor | NumberConstructor)[];
102
110
  default: string;
103
111
  };
112
+ /**
113
+ * popover crossAxis 偏移量
114
+ */
115
+ crossAxisOffset: {
116
+ type: NumberConstructor;
117
+ default: number;
118
+ };
104
119
  /**
105
120
  * 是否加载中
106
121
  */
@@ -167,16 +182,18 @@ declare const _default: import("vue").DefineComponent<{
167
182
  renderListItem: {
168
183
  type: () => (h: typeof createVNode, item: FormattedUser) => VNode;
169
184
  };
170
- }>> & {
185
+ }>> & Readonly<{
171
186
  "onSelect-user"?: ((...args: any[]) => any) | undefined;
172
- }, {
187
+ "onClick-outside"?: ((...args: any[]) => any) | undefined;
188
+ }>, {
173
189
  tenantId: string;
190
+ tenants: Record<string, string>;
174
191
  isShow: boolean;
175
192
  containerWidth: string | number;
193
+ crossAxisOffset: number;
176
194
  loading: boolean;
177
195
  options: FormattedUser[];
178
196
  searchQuery: string;
179
- tenants: Record<string, string>;
180
197
  userGroup: {
181
198
  id: string;
182
199
  name: string;
@@ -184,5 +201,5 @@ declare const _default: import("vue").DefineComponent<{
184
201
  }[];
185
202
  userGroupName: string;
186
203
  emptyText: string;
187
- }, {}>;
204
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
188
205
  export default _default;
@@ -1,31 +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
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
+ declare const _default: import("vue").DefineComponent<SingleSelectorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
3
  change: (...args: any[]) => void;
14
4
  "update:modelValue": (...args: any[]) => void;
15
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<SingleSelectorProps>, {
16
- apiBaseUrl: string;
17
- tenantId: string;
18
- placeholder: string;
19
- modelValue: string;
20
- currentUserId: string;
21
- exactSearchKey: string;
22
- userGroup: () => never[];
23
- userGroupName: string;
24
- emptyText: string;
25
- }>>> & {
5
+ }, string, import("vue").PublicProps, Readonly<SingleSelectorProps> & Readonly<{
26
6
  onChange?: ((...args: any[]) => any) | undefined;
27
7
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
28
- }, {
8
+ }>, {
29
9
  tenantId: string;
30
10
  currentUserId: string;
31
11
  userGroup: {
@@ -43,22 +23,5 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
43
23
  apiBaseUrl: string;
44
24
  placeholder: string;
45
25
  exactSearchKey: string;
46
- }, {}>;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
47
27
  export default _default;
48
- type __VLS_WithDefaults<P, D> = {
49
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
50
- default: D[K];
51
- }> : P[K];
52
- };
53
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
54
- type __VLS_TypePropsToOption<T> = {
55
- [K in keyof T]-?: {} extends Pick<T, K> ? {
56
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
57
- } : {
58
- type: import('vue').PropType<T[K]>;
59
- required: true;
60
- };
61
- };
62
- type __VLS_PrettifyLocal<T> = {
63
- [K in keyof T]: T[K];
64
- } & {};
@@ -1,21 +1,37 @@
1
1
  import type { FormattedUser } from '../types';
2
- declare const _default: import("vue").DefineComponent<{
3
- render: {
4
- type: FunctionConstructor;
5
- required: true;
6
- };
2
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
7
3
  user: {
8
4
  type: () => FormattedUser;
9
5
  required: true;
10
6
  };
11
- }, () => any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
7
+ tenantId: {
8
+ type: StringConstructor;
9
+ required: true;
10
+ };
11
+ tenants: {
12
+ type: () => Record<string, string>;
13
+ required: true;
14
+ };
12
15
  render: {
13
16
  type: FunctionConstructor;
14
- required: true;
17
+ required: false;
15
18
  };
19
+ }>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
16
20
  user: {
17
21
  type: () => FormattedUser;
18
22
  required: true;
19
23
  };
20
- }>>, {}, {}>;
24
+ tenantId: {
25
+ type: StringConstructor;
26
+ required: true;
27
+ };
28
+ tenants: {
29
+ type: () => Record<string, string>;
30
+ required: true;
31
+ };
32
+ render: {
33
+ type: FunctionConstructor;
34
+ required: false;
35
+ };
36
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
21
37
  export default _default;
@@ -1,35 +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
- currentUserId: string;
10
- exactSearchKey: string;
11
- userGroup: () => never[];
12
- userGroupName: string;
13
- emptyText: string;
14
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
2
+ declare const _default: import("vue").DefineComponent<UserSelectorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
3
  change: (...args: any[]) => void;
16
4
  "update:modelValue": (...args: any[]) => void;
17
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<UserSelectorProps>, {
18
- apiBaseUrl: string;
19
- tenantId: string;
20
- placeholder: string;
21
- modelValue: string;
22
- draggable: boolean;
23
- multiple: boolean;
24
- currentUserId: string;
25
- exactSearchKey: string;
26
- userGroup: () => never[];
27
- userGroupName: string;
28
- emptyText: string;
29
- }>>> & {
5
+ }, string, import("vue").PublicProps, Readonly<UserSelectorProps> & Readonly<{
30
6
  onChange?: ((...args: any[]) => any) | undefined;
31
7
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
32
- }, {
8
+ }>, {
33
9
  tenantId: string;
34
10
  currentUserId: string;
35
11
  userGroup: {
@@ -50,22 +26,5 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
50
26
  placeholder: string;
51
27
  exactSearchKey: string;
52
28
  multiple: boolean;
53
- }, {}>;
29
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
54
30
  export default _default;
55
- type __VLS_WithDefaults<P, D> = {
56
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
57
- default: D[K];
58
- }> : P[K];
59
- };
60
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
61
- type __VLS_TypePropsToOption<T> = {
62
- [K in keyof T]-?: {} extends Pick<T, K> ? {
63
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
64
- } : {
65
- type: import('vue').PropType<T[K]>;
66
- required: true;
67
- };
68
- };
69
- type __VLS_PrettifyLocal<T> = {
70
- [K in keyof T]: T[K];
71
- } & {};
@@ -1,6 +1,9 @@
1
1
  import { createVNode, VNode } from 'vue';
2
2
  import { FormattedUser } from '../types';
3
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
3
+ /**
4
+ * 组件属性
5
+ */
6
+ type __VLS_Props = {
4
7
  /**
5
8
  * 用户信息
6
9
  */
@@ -12,7 +15,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
12
15
  /**
13
16
  * 当前租户ID
14
17
  */
15
- currentTenantId?: string;
18
+ currentTenantId: string;
16
19
  /**
17
20
  * 是否可拖拽
18
21
  */
@@ -29,49 +32,12 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
29
32
  * 渲染标签
30
33
  */
31
34
  renderTag?: (h: typeof createVNode, userInfo: FormattedUser) => VNode;
32
- }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
35
+ };
36
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
33
37
  click: (...args: any[]) => void;
34
38
  close: (...args: any[]) => void;
35
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
36
- /**
37
- * 用户信息
38
- */
39
- user: FormattedUser;
40
- /**
41
- * 租户数据映射
42
- */
43
- tenants: Record<string, string>;
44
- /**
45
- * 当前租户ID
46
- */
47
- currentTenantId?: string;
48
- /**
49
- * 是否可拖拽
50
- */
51
- draggable?: boolean;
52
- /**
53
- * 是否激活状态
54
- */
55
- active?: boolean;
56
- /**
57
- * 是否显示租户信息
58
- */
59
- showTenant?: boolean;
60
- /**
61
- * 渲染标签
62
- */
63
- renderTag?: (h: typeof createVNode, userInfo: FormattedUser) => VNode;
64
- }>>> & {
39
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
65
40
  onClick?: ((...args: any[]) => any) | undefined;
66
41
  onClose?: ((...args: any[]) => any) | undefined;
67
- }, {}, {}>;
42
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
68
43
  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
- };
@@ -10,7 +10,7 @@ import { type Ref } from 'vue';
10
10
  * @returns 租户数据和加载状态
11
11
  */
12
12
  export declare const useTenantData: (apiBaseUrl: string, tenantId: string) => {
13
- tenants: Ref<Record<string, string>>;
14
- loading: Ref<boolean>;
13
+ tenants: Ref<Record<string, string>, Record<string, string>>;
14
+ loading: Ref<boolean, boolean>;
15
15
  fetchTenants: () => Promise<void>;
16
16
  };
@@ -11,9 +11,9 @@ import { type FormattedUser } from '../types';
11
11
  * @returns 用户搜索相关状态和方法
12
12
  */
13
13
  export declare const useUserSearch: (apiBaseUrl: string, tenantId: string) => {
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;
package/typings/vue2.d.ts CHANGED
@@ -1,16 +1,10 @@
1
1
  import BkUserSelector from './components/user-selector.vue';
2
2
  declare const _default: {
3
+ created(): void;
3
4
  model: {
4
5
  prop: string;
5
6
  event: string;
6
7
  };
7
- beforeDestroy(): void;
8
- created(): void;
9
- data(): {
10
- app: null;
11
- unWatchStack: never[];
12
- };
13
- mounted(): void;
14
8
  name: string;
15
9
  props: any;
16
10
  render(createElement: any): any;