@blueking/bk-user-selector 0.0.8 → 0.0.10

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.8",
3
+ "version": "0.0.10",
4
4
  "description": "蓝鲸用户选择器",
5
5
  "license": "MIT",
6
6
  "author": "Tencent BlueKing",
@@ -1,171 +1,33 @@
1
- import { FormattedUser } from '../types';
2
- declare const _default: import("vue").DefineComponent<{
3
- /**
4
- * 绑定值
5
- */
6
- modelValue: {
7
- type: ArrayConstructor;
8
- default: () => never[];
9
- };
10
- /**
11
- * 占位文本
12
- */
13
- placeholder: {
14
- type: StringConstructor;
15
- default: string;
16
- };
17
- /**
18
- * 是否可拖拽
19
- */
20
- draggable: {
21
- type: BooleanConstructor;
22
- default: boolean;
23
- };
24
- /**
25
- * API 基础 URL
26
- */
27
- apiBaseUrl: {
28
- type: StringConstructor;
29
- default: string;
30
- };
31
- /**
32
- * 租户 ID
33
- */
34
- tenantId: {
35
- type: StringConstructor;
36
- default: string;
37
- };
38
- /**
39
- * 已选用户
40
- */
41
- selectedUsers: {
42
- type: () => FormattedUser[];
43
- default: () => never[];
44
- };
45
- /**
46
- * 租户信息映射
47
- */
48
- tenants: {
49
- type: () => Record<string, string>;
50
- default: () => {};
51
- };
52
- /**
53
- * 当前用户ID
54
- */
55
- currentUserId: {
56
- type: StringConstructor;
57
- default: string;
58
- };
59
- /**
60
- * 精确查找key
61
- */
62
- exactSearchKey: {
63
- type: StringConstructor;
64
- default: string;
65
- };
66
- /**
67
- * 用户组
68
- */
69
- userGroup: {
70
- type: () => {
71
- id: string;
72
- name: string;
73
- }[];
74
- default: () => never[];
75
- };
76
- /**
77
- * 用户组名称
78
- */
79
- userGroupName: {
80
- type: StringConstructor;
81
- default: string;
82
- };
83
- }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
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
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
84
15
  "update:selectedUsers": (...args: any[]) => void;
85
16
  "add-user": (...args: any[]) => void;
86
17
  "remove-user": (...args: any[]) => void;
87
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
88
- /**
89
- * 绑定值
90
- */
91
- modelValue: {
92
- type: ArrayConstructor;
93
- default: () => never[];
94
- };
95
- /**
96
- * 占位文本
97
- */
98
- placeholder: {
99
- type: StringConstructor;
100
- default: string;
101
- };
102
- /**
103
- * 是否可拖拽
104
- */
105
- draggable: {
106
- type: BooleanConstructor;
107
- default: boolean;
108
- };
109
- /**
110
- * API 基础 URL
111
- */
112
- apiBaseUrl: {
113
- type: StringConstructor;
114
- default: string;
115
- };
116
- /**
117
- * 租户 ID
118
- */
119
- tenantId: {
120
- type: StringConstructor;
121
- default: string;
122
- };
123
- /**
124
- * 已选用户
125
- */
126
- selectedUsers: {
127
- type: () => FormattedUser[];
128
- default: () => never[];
129
- };
130
- /**
131
- * 租户信息映射
132
- */
133
- tenants: {
134
- type: () => Record<string, string>;
135
- default: () => {};
136
- };
137
- /**
138
- * 当前用户ID
139
- */
140
- currentUserId: {
141
- type: StringConstructor;
142
- default: string;
143
- };
144
- /**
145
- * 精确查找key
146
- */
147
- exactSearchKey: {
148
- type: StringConstructor;
149
- default: string;
150
- };
151
- /**
152
- * 用户组
153
- */
154
- userGroup: {
155
- type: () => {
156
- id: string;
157
- name: string;
158
- }[];
159
- default: () => never[];
160
- };
161
- /**
162
- * 用户组名称
163
- */
164
- userGroupName: {
165
- type: StringConstructor;
166
- default: string;
167
- };
168
- }>> & {
18
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<MultipleSelectorProps>, {
19
+ modelValue: () => never[];
20
+ placeholder: string;
21
+ draggable: boolean;
22
+ apiBaseUrl: string;
23
+ tenantId: string;
24
+ selectedUsers: () => never[];
25
+ tenants: () => {};
26
+ currentUserId: string;
27
+ exactSearchKey: string;
28
+ userGroup: () => never[];
29
+ userGroupName: string;
30
+ }>>> & {
169
31
  "onUpdate:selectedUsers"?: ((...args: any[]) => any) | undefined;
170
32
  "onAdd-user"?: ((...args: any[]) => any) | undefined;
171
33
  "onRemove-user"?: ((...args: any[]) => any) | undefined;
@@ -179,10 +41,27 @@ declare const _default: import("vue").DefineComponent<{
179
41
  }[];
180
42
  userGroupName: string;
181
43
  draggable: boolean;
182
- modelValue: unknown[];
183
- placeholder: string;
184
- apiBaseUrl: string;
44
+ modelValue: string[];
185
45
  selectedUsers: FormattedUser[];
46
+ apiBaseUrl: string;
47
+ placeholder: string;
186
48
  exactSearchKey: string;
187
49
  }, {}>;
188
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,12 +1,47 @@
1
1
  import { SingleSelectorProps } from '../types';
2
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<SingleSelectorProps>, {}, unknown, {}, {}, 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
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
12
  change: (...args: any[]) => void;
4
13
  "update:modelValue": (...args: any[]) => void;
5
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<SingleSelectorProps>>> & {
14
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<SingleSelectorProps>, {
15
+ apiBaseUrl: string;
16
+ tenantId: string;
17
+ placeholder: string;
18
+ modelValue: string;
19
+ currentUserId: string;
20
+ exactSearchKey: string;
21
+ userGroup: () => never[];
22
+ userGroupName: string;
23
+ }>>> & {
6
24
  onChange?: ((...args: any[]) => any) | undefined;
7
25
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
8
- }, {}, {}>;
26
+ }, {
27
+ tenantId: string;
28
+ currentUserId: string;
29
+ userGroup: {
30
+ id: string;
31
+ name: string;
32
+ }[];
33
+ userGroupName: string;
34
+ modelValue: string;
35
+ apiBaseUrl: string;
36
+ placeholder: string;
37
+ exactSearchKey: string;
38
+ }, {}>;
9
39
  export default _default;
40
+ type __VLS_WithDefaults<P, D> = {
41
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
42
+ default: D[K];
43
+ }> : P[K];
44
+ };
10
45
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
11
46
  type __VLS_TypePropsToOption<T> = {
12
47
  [K in keyof T]-?: {} extends Pick<T, K> ? {
@@ -16,3 +51,6 @@ type __VLS_TypePropsToOption<T> = {
16
51
  required: true;
17
52
  };
18
53
  };
54
+ type __VLS_PrettifyLocal<T> = {
55
+ [K in keyof T]: T[K];
56
+ } & {};
@@ -37,8 +37,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
37
37
  userGroupName: string;
38
38
  draggable: boolean;
39
39
  modelValue: string | string[];
40
- placeholder: string;
41
40
  apiBaseUrl: string;
41
+ placeholder: string;
42
42
  exactSearchKey: string;
43
43
  multiple: boolean;
44
44
  }, {}>;
@@ -127,4 +127,25 @@ export interface SingleSelectorProps extends BaseSelectorProps {
127
127
  */
128
128
  tenants: Record<string, string>;
129
129
  }
130
+ /**
131
+ * 多选模式属性
132
+ */
133
+ export interface MultipleSelectorProps extends BaseSelectorProps {
134
+ /**
135
+ * 选中的用户ID列表
136
+ */
137
+ modelValue: string[];
138
+ /**
139
+ * 是否支持拖拽排序
140
+ */
141
+ draggable?: boolean;
142
+ /**
143
+ * 已选用户列表
144
+ */
145
+ selectedUsers: FormattedUser[];
146
+ /**
147
+ * 租户信息映射
148
+ */
149
+ tenants: Record<string, string>;
150
+ }
130
151
  export {};
package/typings/vue2.d.ts CHANGED
@@ -1,5 +1,9 @@
1
1
  import BkUserSelector from './components/user-selector.vue';
2
2
  declare const _default: {
3
+ model: {
4
+ prop: string;
5
+ event: string;
6
+ };
3
7
  beforeDestroy(): void;
4
8
  created(): void;
5
9
  data(): {