@blueking/bk-user-selector 0.0.2-beta.1 → 0.0.4
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 +65 -38
- package/package.json +1 -1
- package/typings/api/user.d.ts +4 -3
- package/typings/components/multiple-selector.vue.d.ts +46 -1
- package/typings/components/single-selector.vue.d.ts +2 -2
- package/typings/components/user-selector.vue.d.ts +13 -13
- package/typings/hooks/useTenantData.d.ts +1 -1
- package/typings/hooks/useUserSearch.d.ts +2 -2
- package/typings/types/index.d.ts +18 -10
- package/typings/utils/common.d.ts +2 -2
- package/typings/vue2.d.ts +15 -1
- package/vue2/index.es.min.js +10032 -29345
- package/vue2/index.iife.min.js +8104 -27491
- package/vue2/index.umd.min.js +7490 -26803
- package/vue2/vue2.css +189 -1722
- package/vue3/index.es.min.js +3128 -2292
- package/vue3/index.iife.min.js +6491 -25802
- package/vue3/index.umd.min.js +3127 -2291
- package/vue3/vue3.css +148 -48
- package/typings/hooks/useUserSelection.d.ts +0 -23
- package/typings/index.d.ts +0 -18
package/vue3/vue3.css
CHANGED
|
@@ -1,34 +1,20 @@
|
|
|
1
|
-
.user-
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
}
|
|
5
|
-
.user-option .user-name[data-v-0ae61279] {
|
|
6
|
-
font-size: 14px;
|
|
7
|
-
}
|
|
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] {
|
|
1
|
+
.user-tag[data-v-203c36cb] {
|
|
16
2
|
margin-right: 4px;
|
|
17
3
|
}
|
|
18
|
-
.user-tag.draggable[data-v-
|
|
4
|
+
.user-tag.draggable[data-v-203c36cb] {
|
|
19
5
|
cursor: move;
|
|
20
6
|
}
|
|
21
|
-
.user-tag.active[data-v-
|
|
7
|
+
.user-tag.active[data-v-203c36cb] {
|
|
22
8
|
background-color: #e1ecff;
|
|
23
9
|
border-color: #3a84ff;
|
|
24
10
|
}
|
|
25
|
-
.user-tag .tag-content .user-name[data-v-
|
|
11
|
+
.user-tag .tag-content .user-name[data-v-203c36cb] {
|
|
26
12
|
white-space: nowrap;
|
|
27
13
|
overflow: hidden;
|
|
28
14
|
text-overflow: ellipsis;
|
|
29
15
|
font-size: 12px;
|
|
30
16
|
}
|
|
31
|
-
.user-tag .tag-content .tenant-name[data-v-
|
|
17
|
+
.user-tag .tag-content .tenant-name[data-v-203c36cb] {
|
|
32
18
|
color: #f59500;
|
|
33
19
|
margin-left: 3px;
|
|
34
20
|
white-space: nowrap;
|
|
@@ -36,11 +22,11 @@
|
|
|
36
22
|
border-radius: 2px;
|
|
37
23
|
}.bk-user-selector-popover.bk-popover.bk-pop2-content {
|
|
38
24
|
padding: 0;
|
|
39
|
-
}.multiple-selector[data-v-
|
|
25
|
+
}.multiple-selector[data-v-55945956] {
|
|
40
26
|
position: relative;
|
|
41
27
|
width: 100%;
|
|
42
28
|
}
|
|
43
|
-
.multiple-selector .tags-container[data-v-
|
|
29
|
+
.multiple-selector .tags-container[data-v-55945956] {
|
|
44
30
|
min-height: 32px;
|
|
45
31
|
border: 1px solid #dcdee5;
|
|
46
32
|
border-radius: 2px;
|
|
@@ -48,81 +34,195 @@
|
|
|
48
34
|
transition: all 0.2s ease;
|
|
49
35
|
background-color: #fff;
|
|
50
36
|
}
|
|
51
|
-
.multiple-selector .tags-container.focused[data-v-
|
|
37
|
+
.multiple-selector .tags-container.focused[data-v-55945956] {
|
|
52
38
|
border-color: #3a84ff;
|
|
53
39
|
box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);
|
|
54
40
|
}
|
|
55
|
-
.multiple-selector .tags-container.collapsed[data-v-
|
|
41
|
+
.multiple-selector .tags-container.collapsed[data-v-55945956] {
|
|
56
42
|
display: flex;
|
|
57
43
|
flex-wrap: wrap;
|
|
58
44
|
align-items: center;
|
|
59
45
|
}
|
|
60
|
-
.multiple-selector .tag-list[data-v-
|
|
46
|
+
.multiple-selector .tag-list[data-v-55945956] {
|
|
61
47
|
display: flex;
|
|
62
48
|
flex-wrap: wrap;
|
|
63
49
|
align-items: center;
|
|
64
50
|
}
|
|
65
|
-
.multiple-selector .tag-wrapper[data-v-
|
|
51
|
+
.multiple-selector .tag-wrapper[data-v-55945956] {
|
|
66
52
|
display: inline-flex;
|
|
67
53
|
align-items: center;
|
|
68
54
|
max-width: 100%;
|
|
69
55
|
}
|
|
70
|
-
.multiple-selector .search-input[data-v-
|
|
56
|
+
.multiple-selector .search-input[data-v-55945956] {
|
|
71
57
|
outline: none;
|
|
72
58
|
border: none;
|
|
73
|
-
font-size: 14px;
|
|
74
59
|
height: 28px;
|
|
60
|
+
min-width: 10px;
|
|
75
61
|
background: transparent;
|
|
76
62
|
}
|
|
77
|
-
.multiple-selector .search-input[data-v-
|
|
78
|
-
color: #
|
|
63
|
+
.multiple-selector .search-input[data-v-55945956]::placeholder {
|
|
64
|
+
color: #c4c6cc;
|
|
79
65
|
}
|
|
80
|
-
.multiple-selector .search-input.inline[data-v-
|
|
81
|
-
width:
|
|
82
|
-
min-width: 4px;
|
|
66
|
+
.multiple-selector .search-input.inline[data-v-55945956] {
|
|
67
|
+
min-width: 10px;
|
|
83
68
|
}
|
|
84
|
-
.multiple-selector .search-input.last[data-v-
|
|
69
|
+
.multiple-selector .search-input.last[data-v-55945956], .multiple-selector .search-input.collapsed[data-v-55945956] {
|
|
85
70
|
flex: 1;
|
|
86
71
|
min-width: 60px;
|
|
87
72
|
}
|
|
88
|
-
.
|
|
73
|
+
.dropdown-content[data-v-55945956] {
|
|
74
|
+
min-height: 40px;
|
|
75
|
+
max-height: 300px;
|
|
76
|
+
overflow-y: auto;
|
|
77
|
+
padding: 5px 0;
|
|
78
|
+
}
|
|
79
|
+
.dropdown-content .no-data[data-v-55945956] {
|
|
80
|
+
padding: 10px;
|
|
81
|
+
text-align: center;
|
|
82
|
+
color: #979ba5;
|
|
83
|
+
}
|
|
84
|
+
.dropdown-content .user-option[data-v-55945956] {
|
|
85
|
+
padding: 8px 12px;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
height: 32px;
|
|
90
|
+
}
|
|
91
|
+
.dropdown-content .user-option[data-v-55945956]:hover {
|
|
92
|
+
background-color: #f5f7fa;
|
|
93
|
+
}
|
|
94
|
+
.dropdown-content .user-option .tenant-name[data-v-55945956] {
|
|
95
|
+
color: #f59500;
|
|
96
|
+
margin-left: 4px;
|
|
97
|
+
padding: 0 4px;
|
|
98
|
+
}
|
|
99
|
+
.me-tag[data-v-55945956] {
|
|
100
|
+
display: inline-flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
justify-content: center;
|
|
103
|
+
background-color: #e1ecff;
|
|
104
|
+
color: #4d4f56;
|
|
105
|
+
border-radius: 50%;
|
|
106
|
+
padding: 0 8px;
|
|
107
|
+
height: 24px;
|
|
108
|
+
width: 24px;
|
|
109
|
+
cursor: pointer;
|
|
110
|
+
font-size: 12px;
|
|
111
|
+
position: absolute;
|
|
112
|
+
right: 8px;
|
|
113
|
+
top: 50%;
|
|
114
|
+
transform: translateY(-50%);
|
|
115
|
+
z-index: 1;
|
|
116
|
+
}
|
|
117
|
+
.me-tag[data-v-55945956]:hover {
|
|
118
|
+
background-color: #cddffe;
|
|
119
|
+
color: #3a84ff;
|
|
120
|
+
}
|
|
121
|
+
.me-tag.disabled[data-v-55945956] {
|
|
89
122
|
background-color: #f0f1f5;
|
|
90
|
-
color: #
|
|
91
|
-
|
|
123
|
+
color: #c4c6cc;
|
|
124
|
+
cursor: not-allowed;
|
|
125
|
+
}.single-selector[data-v-d17d0282] {
|
|
126
|
+
position: relative;
|
|
127
|
+
width: 100%;
|
|
128
|
+
}
|
|
129
|
+
.input-container[data-v-d17d0282] {
|
|
130
|
+
position: relative;
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
min-height: 32px;
|
|
134
|
+
border: 1px solid #dcdee5;
|
|
135
|
+
border-radius: 2px;
|
|
136
|
+
padding: 0 8px;
|
|
137
|
+
background-color: #fff;
|
|
138
|
+
}
|
|
139
|
+
.input-container[data-v-d17d0282]:focus-within {
|
|
140
|
+
border-color: #3a84ff;
|
|
141
|
+
box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);
|
|
142
|
+
}
|
|
143
|
+
.search-input[data-v-d17d0282] {
|
|
144
|
+
flex: 1;
|
|
145
|
+
outline: none;
|
|
146
|
+
border: none;
|
|
147
|
+
height: 30px;
|
|
148
|
+
background: transparent;
|
|
149
|
+
}
|
|
150
|
+
.search-input[data-v-d17d0282]::placeholder {
|
|
151
|
+
color: #c4c6cc;
|
|
152
|
+
}
|
|
153
|
+
.selected-user[data-v-d17d0282] {
|
|
154
|
+
display: inline-flex;
|
|
155
|
+
align-items: center;
|
|
156
|
+
background-color: #f0f1f5;
|
|
157
|
+
border-radius: 2px;
|
|
158
|
+
padding: 0 8px;
|
|
159
|
+
margin-right: 8px;
|
|
160
|
+
height: 24px;
|
|
161
|
+
max-width: calc(100% - 32px);
|
|
162
|
+
}
|
|
163
|
+
.selected-user .tenant-name[data-v-d17d0282] {
|
|
164
|
+
color: #f59500;
|
|
165
|
+
margin-left: 4px;
|
|
166
|
+
}
|
|
167
|
+
.selected-user .close-icon[data-v-d17d0282] {
|
|
168
|
+
margin-left: 4px;
|
|
92
169
|
cursor: pointer;
|
|
170
|
+
font-style: normal;
|
|
93
171
|
}
|
|
94
|
-
.dropdown-content[data-v-
|
|
172
|
+
.dropdown-content[data-v-d17d0282] {
|
|
95
173
|
min-height: 40px;
|
|
96
174
|
max-height: 300px;
|
|
97
175
|
overflow-y: auto;
|
|
98
176
|
padding: 5px 0;
|
|
99
177
|
}
|
|
100
|
-
.dropdown-content .no-data[data-v-
|
|
178
|
+
.dropdown-content .no-data[data-v-d17d0282] {
|
|
101
179
|
padding: 10px;
|
|
102
180
|
text-align: center;
|
|
103
181
|
color: #979ba5;
|
|
104
182
|
}
|
|
105
|
-
.dropdown-content .user-option[data-v-
|
|
183
|
+
.dropdown-content .user-option[data-v-d17d0282] {
|
|
106
184
|
padding: 8px 12px;
|
|
107
185
|
cursor: pointer;
|
|
108
186
|
display: flex;
|
|
109
187
|
align-items: center;
|
|
110
188
|
height: 32px;
|
|
111
189
|
}
|
|
112
|
-
.dropdown-content .user-option[data-v-
|
|
190
|
+
.dropdown-content .user-option[data-v-d17d0282]:hover {
|
|
113
191
|
background-color: #f5f7fa;
|
|
114
192
|
}
|
|
115
|
-
.dropdown-content .user-option .
|
|
116
|
-
font-size: 14px;
|
|
117
|
-
}
|
|
118
|
-
.dropdown-content .user-option .tenant-name[data-v-6a1779a9] {
|
|
119
|
-
font-size: 12px;
|
|
193
|
+
.dropdown-content .user-option .tenant-name[data-v-d17d0282] {
|
|
120
194
|
color: #f59500;
|
|
121
195
|
margin-left: 4px;
|
|
122
196
|
padding: 0 4px;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
197
|
+
}
|
|
198
|
+
.me-tag[data-v-d17d0282] {
|
|
199
|
+
display: inline-flex;
|
|
200
|
+
align-items: center;
|
|
201
|
+
justify-content: center;
|
|
202
|
+
background-color: #e1ecff;
|
|
203
|
+
color: #4d4f56;
|
|
204
|
+
border-radius: 50%;
|
|
205
|
+
padding: 0 8px;
|
|
206
|
+
height: 24px;
|
|
207
|
+
width: 24px;
|
|
208
|
+
cursor: pointer;
|
|
209
|
+
font-size: 12px;
|
|
210
|
+
position: absolute;
|
|
211
|
+
right: 8px;
|
|
212
|
+
top: 50%;
|
|
213
|
+
transform: translateY(-50%);
|
|
214
|
+
z-index: 1;
|
|
215
|
+
}
|
|
216
|
+
.me-tag[data-v-d17d0282]:hover {
|
|
217
|
+
background-color: #cddffe;
|
|
218
|
+
color: #3a84ff;
|
|
219
|
+
}
|
|
220
|
+
.me-tag.disabled[data-v-d17d0282] {
|
|
221
|
+
background-color: #f0f1f5;
|
|
222
|
+
color: #c4c6cc;
|
|
223
|
+
cursor: not-allowed;
|
|
224
|
+
}.bk-user-selector[data-v-ee509d86] {
|
|
126
225
|
width: 100%;
|
|
127
226
|
position: relative;
|
|
227
|
+
font-size: 12px;
|
|
128
228
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 用户选择 Hook
|
|
3
|
-
* @module hooks/useUserSelection
|
|
4
|
-
*/
|
|
5
|
-
import { Ref } from 'vue';
|
|
6
|
-
import { FormattedUser } from '../types';
|
|
7
|
-
/**
|
|
8
|
-
* 使用用户选择的Hook
|
|
9
|
-
* @param apiBaseUrl - API基础URL
|
|
10
|
-
* @param tenantId - 租户ID
|
|
11
|
-
* @param initialSelectedUsers - 初始选中的用户ID
|
|
12
|
-
* @param multiple - 是否多选
|
|
13
|
-
* @returns 用户选择相关状态和方法
|
|
14
|
-
*/
|
|
15
|
-
export declare const useUserSelection: (apiBaseUrl: string, tenantId: string, initialSelectedUsers?: string | string[], multiple?: boolean) => {
|
|
16
|
-
selectedUsers: Ref<FormattedUser[]>;
|
|
17
|
-
selectedUserIds: import("vue").ComputedRef<string | string[]>;
|
|
18
|
-
loading: Ref<boolean>;
|
|
19
|
-
addUser: (user: FormattedUser) => void;
|
|
20
|
-
removeUser: (user: FormattedUser) => void;
|
|
21
|
-
removeUserAtIndex: (index: number) => void;
|
|
22
|
-
clearSelection: () => void;
|
|
23
|
-
};
|
package/typings/index.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 蓝鲸用户选择器
|
|
3
|
-
* @module bk-user-selector
|
|
4
|
-
*/
|
|
5
|
-
import { type App } from 'vue';
|
|
6
|
-
import UserSelector from './components/user-selector.vue';
|
|
7
|
-
export { UserSelector };
|
|
8
|
-
/**
|
|
9
|
-
* 默认导出
|
|
10
|
-
*/
|
|
11
|
-
declare const _default: {
|
|
12
|
-
/**
|
|
13
|
-
* 安装插件
|
|
14
|
-
* @param app - Vue 应用实例
|
|
15
|
-
*/
|
|
16
|
-
install(app: App): void;
|
|
17
|
-
};
|
|
18
|
-
export default _default;
|