@blueking/bk-user-selector 0.0.1-beta.1 → 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/vue3/vue3.css CHANGED
@@ -1,219 +1,128 @@
1
-
2
- .user-selector[data-v-f60d399f] {
3
- width: 100%;
4
- }
5
- .form-item[data-v-f60d399f] {
1
+ .user-option[data-v-0ae61279] {
6
2
  display: flex;
7
3
  align-items: center;
8
- margin-bottom: 15px;
9
4
  }
10
- .form-label[data-v-f60d399f] {
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
- .form-required[data-v-f60d399f] {
18
- color: #ea3636;
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
- .form-content[data-v-f60d399f] {
22
- flex: 1;
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
- .tag-input-container[data-v-f60d399f] {
26
- display: flex;
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
- min-height: 32px;
31
- align-items: center;
32
- padding: 2px 8px;
33
- gap: 4px;
34
- }
35
- .tag-inline-container[data-v-f60d399f] {
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
- .is-focused[data-v-f60d399f] {
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
- .tag-group[data-v-f60d399f] {
47
- display: contents;
48
- /* 让draggable的内容直接成为父容器的子元素 */
49
- }
50
- .tag-item[data-v-f60d399f] {
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-content[data-v-f60d399f] {
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-f60d399f] {
67
- flex-grow: 0;
68
- width: 10px;
69
- min-width: 10px;
70
68
  max-width: 100%;
71
- border: none;
69
+ }
70
+ .multiple-selector .search-input[data-v-6a1779a9] {
72
71
  outline: none;
73
- height: 32px;
72
+ border: none;
74
73
  font-size: 14px;
75
- padding: 0 8px;
74
+ height: 28px;
76
75
  background: transparent;
77
- cursor: text;
78
- transition: width 0.1s ease-in-out;
79
76
  }
80
- .tag-input[data-v-f60d399f]::placeholder {
81
- color: #c4c6cc;
82
- font-size: 12px;
77
+ .multiple-selector .search-input[data-v-6a1779a9]::placeholder {
78
+ color: #C4C6CC;
83
79
  }
84
- .full-width[data-v-f60d399f] {
85
- flex-grow: 1;
86
- padding: 0 8px;
87
- /* 添加统一的内边距 */
80
+ .multiple-selector .search-input.inline[data-v-6a1779a9] {
81
+ width: 4px;
82
+ min-width: 4px;
88
83
  }
89
- .popover-content[data-v-f60d399f] {
90
- min-height: 80px;
91
- max-height: 250px;
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
- .user-option[data-v-f60d399f] {
96
- display: flex;
97
- align-items: center;
98
- padding: 8px 12px;
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
- .user-option[data-v-f60d399f]:hover {
102
- background-color: #f5f7fa;
103
- }
104
- .user-avatar[data-v-f60d399f] {
105
- width: 24px;
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
- .user-avatar-text[data-v-f60d399f] {
111
- width: 24px;
112
- height: 24px;
113
- line-height: 24px;
100
+ .dropdown-content .no-data[data-v-6a1779a9] {
101
+ padding: 10px;
114
102
  text-align: center;
115
- border-radius: 50%;
116
- background-color: #3a84ff;
117
- color: white;
118
- font-size: 12px;
119
- margin-right: 8px;
120
- }
121
- .user-name[data-v-f60d399f] {
122
- font-size: 12px;
123
- }
124
-
125
- /* 拖拽相关样式 */
126
- .draggable[data-v-f60d399f] {
127
- cursor: move;
128
- padding-left: 4px;
129
- }
130
- .ghost-tag[data-v-f60d399f] {
131
- opacity: 0.5;
132
- background: #c8ebfb;
133
- }
134
- .chosen-tag[data-v-f60d399f] {
135
- box-shadow: 0 0 2px 2px #3a84ff;
136
- }
137
- .drag-tag[data-v-f60d399f] {
138
- opacity: 0.8;
139
- }
140
- .drag-handle[data-v-f60d399f] {
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-f60d399f] {
148
- fill: currentColor;
149
- }
150
- .tag-wrapper[data-v-f60d399f] {
151
- display: flex;
152
- align-items: center;
153
- padding: 0;
154
- height: 24px;
155
- }
156
- .inline-input[data-v-f60d399f] {
157
- margin-left: 4px;
158
- min-width: 10px;
159
- padding: 0 2px;
160
- }
161
-
162
- /* 测量元素样式 */
163
- .measure-text[data-v-f60d399f] {
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-f60d399f] {
105
+ .dropdown-content .user-option[data-v-6a1779a9] {
106
+ padding: 8px 12px;
175
107
  cursor: pointer;
176
- }
177
- .single-select[data-v-f60d399f] {
178
108
  display: flex;
179
109
  align-items: center;
180
- justify-content: space-between;
181
- width: 100%;
182
- height: 100%;
183
- }
184
- .single-value[data-v-f60d399f] {
185
- display: flex;
186
- align-items: center;
187
- padding: 0 8px;
188
- margin-right: 4px;
189
- height: 24px;
190
- }
191
- .single-input[data-v-f60d399f] {
192
- flex: 1;
193
- width: auto;
194
- }
195
- .placeholder[data-v-f60d399f] {
196
- color: #c4c6cc;
110
+ height: 32px;
197
111
  }
198
- .dropdown-arrow[data-v-f60d399f] {
199
- margin-left: 8px;
200
- font-size: 10px;
201
- color: #979ba5;
112
+ .dropdown-content .user-option[data-v-6a1779a9]:hover {
113
+ background-color: #f5f7fa;
202
114
  }
203
- .clear-icon[data-v-f60d399f] {
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-f60d399f]:hover {
210
- color: #63656e;
211
117
  }
212
- .no-data[data-v-f60d399f] {
213
- padding: 8px 12px;
118
+ .dropdown-content .user-option .tenant-name[data-v-6a1779a9] {
214
119
  font-size: 12px;
215
- text-align: center;
216
- display: flex;
217
- align-items: center;
218
- justify-content: center;
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
+ }
@@ -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;
@@ -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;
@@ -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
- }
@@ -1,4 +0,0 @@
1
- export declare const jsonp: <T>(url: string, data: object, { cbName, v }: {
2
- cbName?: string | undefined;
3
- v?: string | undefined;
4
- }) => Promise<T>;
@@ -1,3 +0,0 @@
1
- export declare const LANG: string;
2
- export declare const langData: {};
3
- export declare const t: (key: keyof typeof langData, query?: Record<string, string>) => string;
@@ -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;