@blueking/bk-user-selector 0.0.1-beta.2 → 0.0.2-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 +127 -1
- package/package.json +1 -1
- package/typings/api/user.d.ts +34 -0
- package/typings/components/multiple-selector.vue.d.ts +104 -0
- package/typings/components/single-selector.vue.d.ts +18 -0
- package/typings/components/user-selector.vue.d.ts +53 -0
- package/typings/components/user-tag.vue.d.ts +68 -0
- package/typings/hooks/useTenantData.d.ts +16 -0
- package/typings/hooks/useUserSearch.d.ts +20 -0
- package/typings/hooks/useUserSelection.d.ts +23 -0
- package/typings/index.d.ts +18 -0
- package/typings/types/index.d.ts +121 -0
- package/typings/utils/common.d.ts +33 -0
- package/typings/vue3.d.ts +1 -1
- package/vue2/index.es.min.js +13312 -13086
- package/vue2/index.iife.min.js +13312 -13092
- package/vue2/index.umd.min.js +13311 -13085
- package/vue2/vue2.css +88 -179
- package/vue3/index.es.min.js +846 -620
- package/vue3/index.iife.min.js +13311 -13085
- package/vue3/index.umd.min.js +845 -619
- package/vue3/vue3.css +89 -180
- package/typings/index.vue.d.ts +0 -22
- package/typings/single.vue.d.ts +0 -12
- package/typings/utils/index.d.ts +0 -59
- package/typings/utils/jsonp.d.ts +0 -4
- package/typings/utils/lang.d.ts +0 -3
- package/typings/utils/service.d.ts +0 -36
package/vue3/vue3.css
CHANGED
|
@@ -1,219 +1,128 @@
|
|
|
1
|
-
|
|
2
|
-
.user-selector[data-v-5e8a952d] {
|
|
3
|
-
width: 100%;
|
|
4
|
-
}
|
|
5
|
-
.form-item[data-v-5e8a952d] {
|
|
1
|
+
.user-option[data-v-0ae61279] {
|
|
6
2
|
display: flex;
|
|
7
3
|
align-items: center;
|
|
8
|
-
margin-bottom: 15px;
|
|
9
4
|
}
|
|
10
|
-
.
|
|
11
|
-
width: 80px;
|
|
12
|
-
text-align: right;
|
|
13
|
-
padding-right: 10px;
|
|
5
|
+
.user-option .user-name[data-v-0ae61279] {
|
|
14
6
|
font-size: 14px;
|
|
15
|
-
color: #63656e;
|
|
16
7
|
}
|
|
17
|
-
.
|
|
18
|
-
|
|
8
|
+
.user-option .tenant-name[data-v-0ae61279] {
|
|
9
|
+
font-size: 12px;
|
|
10
|
+
color: #f59500;
|
|
11
|
+
margin-left: 4px;
|
|
12
|
+
padding: 0 4px;
|
|
13
|
+
background: rgba(245, 149, 0, 0.1);
|
|
14
|
+
border-radius: 2px;
|
|
15
|
+
}.user-tag[data-v-cf26d9e2] {
|
|
19
16
|
margin-right: 4px;
|
|
20
17
|
}
|
|
21
|
-
.
|
|
22
|
-
|
|
18
|
+
.user-tag.draggable[data-v-cf26d9e2] {
|
|
19
|
+
cursor: move;
|
|
20
|
+
}
|
|
21
|
+
.user-tag.active[data-v-cf26d9e2] {
|
|
22
|
+
background-color: #e1ecff;
|
|
23
|
+
border-color: #3a84ff;
|
|
24
|
+
}
|
|
25
|
+
.user-tag .tag-content .user-name[data-v-cf26d9e2] {
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
text-overflow: ellipsis;
|
|
29
|
+
font-size: 12px;
|
|
30
|
+
}
|
|
31
|
+
.user-tag .tag-content .tenant-name[data-v-cf26d9e2] {
|
|
32
|
+
color: #f59500;
|
|
33
|
+
margin-left: 3px;
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
padding: 0 3px;
|
|
36
|
+
border-radius: 2px;
|
|
37
|
+
}.bk-user-selector-popover.bk-popover.bk-pop2-content {
|
|
38
|
+
padding: 0;
|
|
39
|
+
}.multiple-selector[data-v-6a1779a9] {
|
|
23
40
|
position: relative;
|
|
41
|
+
width: 100%;
|
|
24
42
|
}
|
|
25
|
-
.
|
|
26
|
-
|
|
27
|
-
flex-wrap: wrap;
|
|
43
|
+
.multiple-selector .tags-container[data-v-6a1779a9] {
|
|
44
|
+
min-height: 32px;
|
|
28
45
|
border: 1px solid #dcdee5;
|
|
29
46
|
border-radius: 2px;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
gap: 4px;
|
|
34
|
-
}
|
|
35
|
-
.tag-inline-container[data-v-5e8a952d] {
|
|
36
|
-
display: flex;
|
|
37
|
-
flex-wrap: nowrap;
|
|
38
|
-
align-items: center;
|
|
39
|
-
gap: 4px;
|
|
40
|
-
flex-grow: 1;
|
|
41
|
-
min-height: 24px;
|
|
47
|
+
padding: 1px 4px;
|
|
48
|
+
transition: all 0.2s ease;
|
|
49
|
+
background-color: #fff;
|
|
42
50
|
}
|
|
43
|
-
.
|
|
51
|
+
.multiple-selector .tags-container.focused[data-v-6a1779a9] {
|
|
44
52
|
border-color: #3a84ff;
|
|
53
|
+
box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);
|
|
45
54
|
}
|
|
46
|
-
.
|
|
47
|
-
display:
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
.tag-item[data-v-5e8a952d] {
|
|
51
|
-
flex-shrink: 0;
|
|
52
|
-
height: 24px;
|
|
53
|
-
line-height: 24px;
|
|
54
|
-
margin: 0;
|
|
55
|
-
cursor: pointer;
|
|
56
|
-
display: inline-flex;
|
|
55
|
+
.multiple-selector .tags-container.collapsed[data-v-6a1779a9] {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-wrap: wrap;
|
|
57
58
|
align-items: center;
|
|
58
59
|
}
|
|
59
|
-
.tag-
|
|
60
|
+
.multiple-selector .tag-list[data-v-6a1779a9] {
|
|
60
61
|
display: flex;
|
|
62
|
+
flex-wrap: wrap;
|
|
63
|
+
align-items: center;
|
|
64
|
+
}
|
|
65
|
+
.multiple-selector .tag-wrapper[data-v-6a1779a9] {
|
|
66
|
+
display: inline-flex;
|
|
61
67
|
align-items: center;
|
|
62
|
-
height: 100%;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/* 输入框样式 */
|
|
66
|
-
.tag-input[data-v-5e8a952d] {
|
|
67
|
-
flex-grow: 0;
|
|
68
|
-
width: 10px;
|
|
69
|
-
min-width: 10px;
|
|
70
68
|
max-width: 100%;
|
|
71
|
-
|
|
69
|
+
}
|
|
70
|
+
.multiple-selector .search-input[data-v-6a1779a9] {
|
|
72
71
|
outline: none;
|
|
73
|
-
|
|
72
|
+
border: none;
|
|
74
73
|
font-size: 14px;
|
|
75
|
-
|
|
74
|
+
height: 28px;
|
|
76
75
|
background: transparent;
|
|
77
|
-
cursor: text;
|
|
78
|
-
transition: width 0.1s ease-in-out;
|
|
79
76
|
}
|
|
80
|
-
.
|
|
81
|
-
color: #
|
|
82
|
-
font-size: 12px;
|
|
77
|
+
.multiple-selector .search-input[data-v-6a1779a9]::placeholder {
|
|
78
|
+
color: #C4C6CC;
|
|
83
79
|
}
|
|
84
|
-
.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
/* 添加统一的内边距 */
|
|
80
|
+
.multiple-selector .search-input.inline[data-v-6a1779a9] {
|
|
81
|
+
width: 4px;
|
|
82
|
+
min-width: 4px;
|
|
88
83
|
}
|
|
89
|
-
.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
overflow-y: auto;
|
|
93
|
-
background-color: #fff;
|
|
84
|
+
.multiple-selector .search-input.last[data-v-6a1779a9], .multiple-selector .search-input.collapsed[data-v-6a1779a9] {
|
|
85
|
+
flex: 1;
|
|
86
|
+
min-width: 60px;
|
|
94
87
|
}
|
|
95
|
-
.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
88
|
+
.multiple-selector .tag-more[data-v-6a1779a9] {
|
|
89
|
+
background-color: #f0f1f5;
|
|
90
|
+
color: #63656e;
|
|
91
|
+
margin: 0 4px 4px 0;
|
|
99
92
|
cursor: pointer;
|
|
100
93
|
}
|
|
101
|
-
.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
height: 24px;
|
|
107
|
-
border-radius: 50%;
|
|
108
|
-
margin-right: 8px;
|
|
94
|
+
.dropdown-content[data-v-6a1779a9] {
|
|
95
|
+
min-height: 40px;
|
|
96
|
+
max-height: 300px;
|
|
97
|
+
overflow-y: auto;
|
|
98
|
+
padding: 5px 0;
|
|
109
99
|
}
|
|
110
|
-
.
|
|
111
|
-
|
|
112
|
-
height: 24px;
|
|
113
|
-
line-height: 24px;
|
|
100
|
+
.dropdown-content .no-data[data-v-6a1779a9] {
|
|
101
|
+
padding: 10px;
|
|
114
102
|
text-align: center;
|
|
115
|
-
|
|
116
|
-
background-color: #3a84ff;
|
|
117
|
-
color: white;
|
|
118
|
-
font-size: 12px;
|
|
119
|
-
margin-right: 8px;
|
|
120
|
-
}
|
|
121
|
-
.user-name[data-v-5e8a952d] {
|
|
122
|
-
font-size: 12px;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/* 拖拽相关样式 */
|
|
126
|
-
.draggable[data-v-5e8a952d] {
|
|
127
|
-
cursor: move;
|
|
128
|
-
padding-left: 4px;
|
|
129
|
-
}
|
|
130
|
-
.ghost-tag[data-v-5e8a952d] {
|
|
131
|
-
opacity: 0.5;
|
|
132
|
-
background: #c8ebfb;
|
|
133
|
-
}
|
|
134
|
-
.chosen-tag[data-v-5e8a952d] {
|
|
135
|
-
box-shadow: 0 0 2px 2px #3a84ff;
|
|
136
|
-
}
|
|
137
|
-
.drag-tag[data-v-5e8a952d] {
|
|
138
|
-
opacity: 0.8;
|
|
139
|
-
}
|
|
140
|
-
.drag-handle[data-v-5e8a952d] {
|
|
141
|
-
display: inline-flex;
|
|
142
|
-
align-items: center;
|
|
143
|
-
margin-right: 4px;
|
|
144
|
-
opacity: 0.6;
|
|
145
|
-
cursor: move;
|
|
146
|
-
}
|
|
147
|
-
.drag-handle svg[data-v-5e8a952d] {
|
|
148
|
-
fill: currentColor;
|
|
149
|
-
}
|
|
150
|
-
.tag-wrapper[data-v-5e8a952d] {
|
|
151
|
-
display: flex;
|
|
152
|
-
align-items: center;
|
|
153
|
-
padding: 0;
|
|
154
|
-
height: 24px;
|
|
155
|
-
}
|
|
156
|
-
.inline-input[data-v-5e8a952d] {
|
|
157
|
-
margin-left: 4px;
|
|
158
|
-
min-width: 10px;
|
|
159
|
-
padding: 0 2px;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/* 测量元素样式 */
|
|
163
|
-
.measure-text[data-v-5e8a952d] {
|
|
164
|
-
position: absolute;
|
|
165
|
-
visibility: hidden;
|
|
166
|
-
height: 0;
|
|
167
|
-
white-space: pre;
|
|
168
|
-
font-size: 14px;
|
|
169
|
-
font-family: inherit;
|
|
170
|
-
padding: 0 2px;
|
|
103
|
+
color: #979ba5;
|
|
171
104
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
.is-single[data-v-5e8a952d] {
|
|
105
|
+
.dropdown-content .user-option[data-v-6a1779a9] {
|
|
106
|
+
padding: 8px 12px;
|
|
175
107
|
cursor: pointer;
|
|
176
|
-
}
|
|
177
|
-
.single-select[data-v-5e8a952d] {
|
|
178
108
|
display: flex;
|
|
179
109
|
align-items: center;
|
|
180
|
-
|
|
181
|
-
width: 100%;
|
|
182
|
-
height: 100%;
|
|
183
|
-
}
|
|
184
|
-
.single-value[data-v-5e8a952d] {
|
|
185
|
-
display: flex;
|
|
186
|
-
align-items: center;
|
|
187
|
-
padding: 0 8px;
|
|
188
|
-
margin-right: 4px;
|
|
189
|
-
height: 24px;
|
|
190
|
-
}
|
|
191
|
-
.single-input[data-v-5e8a952d] {
|
|
192
|
-
flex: 1;
|
|
193
|
-
width: auto;
|
|
194
|
-
}
|
|
195
|
-
.placeholder[data-v-5e8a952d] {
|
|
196
|
-
color: #c4c6cc;
|
|
110
|
+
height: 32px;
|
|
197
111
|
}
|
|
198
|
-
.dropdown-
|
|
199
|
-
|
|
200
|
-
font-size: 10px;
|
|
201
|
-
color: #979ba5;
|
|
112
|
+
.dropdown-content .user-option[data-v-6a1779a9]:hover {
|
|
113
|
+
background-color: #f5f7fa;
|
|
202
114
|
}
|
|
203
|
-
.
|
|
204
|
-
margin-left: 8px;
|
|
115
|
+
.dropdown-content .user-option .user-name[data-v-6a1779a9] {
|
|
205
116
|
font-size: 14px;
|
|
206
|
-
color: #979ba5;
|
|
207
|
-
cursor: pointer;
|
|
208
|
-
}
|
|
209
|
-
.clear-icon[data-v-5e8a952d]:hover {
|
|
210
|
-
color: #63656e;
|
|
211
117
|
}
|
|
212
|
-
.
|
|
213
|
-
padding: 8px 12px;
|
|
118
|
+
.dropdown-content .user-option .tenant-name[data-v-6a1779a9] {
|
|
214
119
|
font-size: 12px;
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
120
|
+
color: #f59500;
|
|
121
|
+
margin-left: 4px;
|
|
122
|
+
padding: 0 4px;
|
|
123
|
+
background: rgba(245, 149, 0, 0.1);
|
|
124
|
+
border-radius: 2px;
|
|
125
|
+
}.bk-user-selector[data-v-144c2518] {
|
|
126
|
+
width: 100%;
|
|
127
|
+
position: relative;
|
|
128
|
+
}
|
package/typings/index.vue.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
$emit: (event: "update:modelValue" | "change", ...args: any[]) => void;
|
|
3
|
-
label: string;
|
|
4
|
-
required: boolean;
|
|
5
|
-
placeholder: string;
|
|
6
|
-
modelValue: string | unknown[];
|
|
7
|
-
draggable: boolean;
|
|
8
|
-
multiple: boolean;
|
|
9
|
-
apiBaseUrl: string;
|
|
10
|
-
tenantId: string;
|
|
11
|
-
$props: {
|
|
12
|
-
readonly label?: string | undefined;
|
|
13
|
-
readonly required?: boolean | undefined;
|
|
14
|
-
readonly placeholder?: string | undefined;
|
|
15
|
-
readonly modelValue?: string | unknown[] | undefined;
|
|
16
|
-
readonly draggable?: boolean | undefined;
|
|
17
|
-
readonly multiple?: boolean | undefined;
|
|
18
|
-
readonly apiBaseUrl?: string | undefined;
|
|
19
|
-
readonly tenantId?: string | undefined;
|
|
20
|
-
};
|
|
21
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
22
|
-
export default _default;
|
package/typings/single.vue.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
$emit: (event: "update:modelValue" | "change", ...args: any[]) => void;
|
|
3
|
-
modelValue: string;
|
|
4
|
-
apiBaseUrl: string;
|
|
5
|
-
tenantId: string;
|
|
6
|
-
$props: {
|
|
7
|
-
readonly modelValue?: string | undefined;
|
|
8
|
-
readonly apiBaseUrl?: string | undefined;
|
|
9
|
-
readonly tenantId?: string | undefined;
|
|
10
|
-
};
|
|
11
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
12
|
-
export default _default;
|
package/typings/utils/index.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export interface IDept {
|
|
2
|
-
id: number | string;
|
|
3
|
-
name: string;
|
|
4
|
-
full_name: string;
|
|
5
|
-
has_children?: boolean;
|
|
6
|
-
parent?: number | string;
|
|
7
|
-
children?: IDept[];
|
|
8
|
-
order?: number;
|
|
9
|
-
extras?: {
|
|
10
|
-
code: string;
|
|
11
|
-
};
|
|
12
|
-
enabled?: boolean;
|
|
13
|
-
ancestors?: {
|
|
14
|
-
id: number | string;
|
|
15
|
-
name: string;
|
|
16
|
-
full_name: string;
|
|
17
|
-
has_children?: boolean;
|
|
18
|
-
children?: IDept[];
|
|
19
|
-
}[];
|
|
20
|
-
code?: string;
|
|
21
|
-
level?: number;
|
|
22
|
-
async?: boolean;
|
|
23
|
-
}
|
|
24
|
-
export declare const enum LookupFieldEnum {
|
|
25
|
-
ID = "id",
|
|
26
|
-
LEVEL = "level",
|
|
27
|
-
NAME = "name",
|
|
28
|
-
PARENT = "parent"
|
|
29
|
-
}
|
|
30
|
-
export interface IAPIParams {
|
|
31
|
-
lookup_field: Lowercase<keyof typeof LookupFieldEnum>;
|
|
32
|
-
exact_lookups?: number | string;
|
|
33
|
-
no_page?: boolean;
|
|
34
|
-
fuzzy_lookups?: string;
|
|
35
|
-
with_ancestors?: boolean;
|
|
36
|
-
}
|
|
37
|
-
export interface IAPIResponse {
|
|
38
|
-
code: number;
|
|
39
|
-
data: IDept[];
|
|
40
|
-
message: string;
|
|
41
|
-
result?: boolean;
|
|
42
|
-
request_id?: string;
|
|
43
|
-
}
|
|
44
|
-
export interface ITreeNode {
|
|
45
|
-
ids: IDept['id'][];
|
|
46
|
-
map: IDept;
|
|
47
|
-
remove?: boolean;
|
|
48
|
-
}
|
|
49
|
-
export interface IOrgSelectorProps {
|
|
50
|
-
modelValue: number | number[] | string | string[];
|
|
51
|
-
dataUrl: string;
|
|
52
|
-
multiple?: boolean;
|
|
53
|
-
disabled?: boolean;
|
|
54
|
-
showOnInit?: boolean;
|
|
55
|
-
dropdownMaxHeight?: number;
|
|
56
|
-
autoExpandTags?: boolean;
|
|
57
|
-
placeholder?: string;
|
|
58
|
-
searchPlaceholder?: string;
|
|
59
|
-
}
|
package/typings/utils/jsonp.d.ts
DELETED
package/typings/utils/lang.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { type IOrgSelectorProps, type IAPIParams, type IDept, LookupFieldEnum } from './index';
|
|
2
|
-
declare const _default: (props: IOrgSelectorProps) => {
|
|
3
|
-
level0Params: () => {
|
|
4
|
-
no_page: boolean;
|
|
5
|
-
lookup_field: LookupFieldEnum;
|
|
6
|
-
exact_lookups: number;
|
|
7
|
-
};
|
|
8
|
-
searchParams: (keyword: string) => {
|
|
9
|
-
no_page: boolean;
|
|
10
|
-
lookup_field: LookupFieldEnum;
|
|
11
|
-
fuzzy_lookups: string;
|
|
12
|
-
with_ancestors: boolean;
|
|
13
|
-
};
|
|
14
|
-
expandParentParams: (id: IDept["id"]) => {
|
|
15
|
-
no_page: boolean;
|
|
16
|
-
lookup_field: LookupFieldEnum;
|
|
17
|
-
exact_lookups: string | number;
|
|
18
|
-
with_ancestors: boolean;
|
|
19
|
-
};
|
|
20
|
-
defaultValueParams: (values: IDept["id"][]) => {
|
|
21
|
-
no_page: boolean;
|
|
22
|
-
lookup_field: LookupFieldEnum;
|
|
23
|
-
exact_lookups: string;
|
|
24
|
-
with_ancestors: boolean;
|
|
25
|
-
};
|
|
26
|
-
getCheckedFullTreeData: (checkedTreeData: IDept[]) => Promise<IDept[]>;
|
|
27
|
-
getTreeSearchData: (data: IDept[]) => IDept[];
|
|
28
|
-
fetchData: (params: IAPIParams) => Promise<IDept[]>;
|
|
29
|
-
loading: {
|
|
30
|
-
level0: boolean;
|
|
31
|
-
expandParent: boolean;
|
|
32
|
-
defaultValue: boolean;
|
|
33
|
-
search: boolean;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
export default _default;
|