@blueking/bk-user-selector 0.0.1-beta.2 → 0.0.3

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,228 @@
1
-
2
- .user-selector[data-v-5e8a952d] {
3
- width: 100%;
1
+ .user-tag[data-v-203c36cb] {
2
+ margin-right: 4px;
4
3
  }
5
- .form-item[data-v-5e8a952d] {
6
- display: flex;
7
- align-items: center;
8
- margin-bottom: 15px;
4
+ .user-tag.draggable[data-v-203c36cb] {
5
+ cursor: move;
9
6
  }
10
- .form-label[data-v-5e8a952d] {
11
- width: 80px;
12
- text-align: right;
13
- padding-right: 10px;
14
- font-size: 14px;
15
- color: #63656e;
7
+ .user-tag.active[data-v-203c36cb] {
8
+ background-color: #e1ecff;
9
+ border-color: #3a84ff;
16
10
  }
17
- .form-required[data-v-5e8a952d] {
18
- color: #ea3636;
19
- margin-right: 4px;
11
+ .user-tag .tag-content .user-name[data-v-203c36cb] {
12
+ white-space: nowrap;
13
+ overflow: hidden;
14
+ text-overflow: ellipsis;
15
+ font-size: 12px;
20
16
  }
21
- .form-content[data-v-5e8a952d] {
22
- flex: 1;
17
+ .user-tag .tag-content .tenant-name[data-v-203c36cb] {
18
+ color: #f59500;
19
+ margin-left: 3px;
20
+ white-space: nowrap;
21
+ padding: 0 3px;
22
+ border-radius: 2px;
23
+ }.bk-user-selector-popover.bk-popover.bk-pop2-content {
24
+ padding: 0;
25
+ }.multiple-selector[data-v-0bc02f6f] {
23
26
  position: relative;
27
+ width: 100%;
24
28
  }
25
- .tag-input-container[data-v-5e8a952d] {
26
- display: flex;
27
- flex-wrap: wrap;
29
+ .multiple-selector .tags-container[data-v-0bc02f6f] {
30
+ min-height: 32px;
28
31
  border: 1px solid #dcdee5;
29
32
  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-5e8a952d] {
36
- display: flex;
37
- flex-wrap: nowrap;
38
- align-items: center;
39
- gap: 4px;
40
- flex-grow: 1;
41
- min-height: 24px;
33
+ padding: 1px 4px;
34
+ transition: all 0.2s ease;
35
+ background-color: #fff;
42
36
  }
43
- .is-focused[data-v-5e8a952d] {
37
+ .multiple-selector .tags-container.focused[data-v-0bc02f6f] {
44
38
  border-color: #3a84ff;
39
+ box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);
45
40
  }
46
- .tag-group[data-v-5e8a952d] {
47
- display: contents;
48
- /* 让draggable的内容直接成为父容器的子元素 */
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;
41
+ .multiple-selector .tags-container.collapsed[data-v-0bc02f6f] {
42
+ display: flex;
43
+ flex-wrap: wrap;
57
44
  align-items: center;
58
45
  }
59
- .tag-content[data-v-5e8a952d] {
46
+ .multiple-selector .tag-list[data-v-0bc02f6f] {
60
47
  display: flex;
48
+ flex-wrap: wrap;
61
49
  align-items: center;
62
- height: 100%;
63
50
  }
64
-
65
- /* 输入框样式 */
66
- .tag-input[data-v-5e8a952d] {
67
- flex-grow: 0;
68
- width: 10px;
69
- min-width: 10px;
51
+ .multiple-selector .tag-wrapper[data-v-0bc02f6f] {
52
+ display: inline-flex;
53
+ align-items: center;
70
54
  max-width: 100%;
71
- border: none;
55
+ }
56
+ .multiple-selector .search-input[data-v-0bc02f6f] {
72
57
  outline: none;
73
- height: 32px;
74
- font-size: 14px;
75
- padding: 0 8px;
58
+ border: none;
59
+ height: 28px;
60
+ min-width: 10px;
76
61
  background: transparent;
77
- cursor: text;
78
- transition: width 0.1s ease-in-out;
79
62
  }
80
- .tag-input[data-v-5e8a952d]::placeholder {
63
+ .multiple-selector .search-input[data-v-0bc02f6f]::placeholder {
81
64
  color: #c4c6cc;
82
- font-size: 12px;
83
65
  }
84
- .full-width[data-v-5e8a952d] {
85
- flex-grow: 1;
86
- padding: 0 8px;
87
- /* 添加统一的内边距 */
66
+ .multiple-selector .search-input.inline[data-v-0bc02f6f] {
67
+ min-width: 10px;
88
68
  }
89
- .popover-content[data-v-5e8a952d] {
90
- min-height: 80px;
91
- max-height: 250px;
69
+ .multiple-selector .search-input.last[data-v-0bc02f6f], .multiple-selector .search-input.collapsed[data-v-0bc02f6f] {
70
+ flex: 1;
71
+ min-width: 60px;
72
+ }
73
+ .dropdown-content[data-v-0bc02f6f] {
74
+ min-height: 40px;
75
+ max-height: 300px;
92
76
  overflow-y: auto;
93
- background-color: #fff;
77
+ padding: 5px 0;
94
78
  }
95
- .user-option[data-v-5e8a952d] {
96
- display: flex;
97
- align-items: center;
79
+ .dropdown-content .no-data[data-v-0bc02f6f] {
80
+ padding: 10px;
81
+ text-align: center;
82
+ color: #979ba5;
83
+ }
84
+ .dropdown-content .user-option[data-v-0bc02f6f] {
98
85
  padding: 8px 12px;
99
86
  cursor: pointer;
87
+ display: flex;
88
+ align-items: center;
89
+ height: 32px;
100
90
  }
101
- .user-option[data-v-5e8a952d]:hover {
91
+ .dropdown-content .user-option[data-v-0bc02f6f]:hover {
102
92
  background-color: #f5f7fa;
103
93
  }
104
- .user-avatar[data-v-5e8a952d] {
105
- width: 24px;
106
- height: 24px;
107
- border-radius: 50%;
108
- margin-right: 8px;
94
+ .dropdown-content .user-option .tenant-name[data-v-0bc02f6f] {
95
+ color: #f59500;
96
+ margin-left: 4px;
97
+ padding: 0 4px;
109
98
  }
110
- .user-avatar-text[data-v-5e8a952d] {
111
- width: 24px;
112
- height: 24px;
113
- line-height: 24px;
114
- text-align: center;
99
+ .me-tag[data-v-0bc02f6f] {
100
+ display: inline-flex;
101
+ align-items: center;
102
+ justify-content: center;
103
+ background-color: #e1ecff;
104
+ color: #4d4f56;
115
105
  border-radius: 50%;
116
- background-color: #3a84ff;
117
- color: white;
106
+ padding: 0 8px;
107
+ height: 24px;
108
+ width: 24px;
109
+ cursor: pointer;
118
110
  font-size: 12px;
119
- margin-right: 8px;
111
+ position: absolute;
112
+ right: 8px;
113
+ top: 50%;
114
+ transform: translateY(-50%);
115
+ z-index: 1;
120
116
  }
121
- .user-name[data-v-5e8a952d] {
122
- font-size: 12px;
117
+ .me-tag[data-v-0bc02f6f]:hover {
118
+ background-color: #cddffe;
119
+ color: #3a84ff;
123
120
  }
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;
121
+ .me-tag.disabled[data-v-0bc02f6f] {
122
+ background-color: #f0f1f5;
123
+ color: #c4c6cc;
124
+ cursor: not-allowed;
125
+ }.single-selector[data-v-02788d3d] {
126
+ position: relative;
127
+ width: 100%;
133
128
  }
134
- .chosen-tag[data-v-5e8a952d] {
135
- box-shadow: 0 0 2px 2px #3a84ff;
129
+ .input-container[data-v-02788d3d] {
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;
136
138
  }
137
- .drag-tag[data-v-5e8a952d] {
138
- opacity: 0.8;
139
+ .input-container[data-v-02788d3d]:focus-within {
140
+ border-color: #3a84ff;
141
+ box-shadow: 0 0 0 2px rgba(58, 132, 255, 0.1);
139
142
  }
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;
143
+ .search-input[data-v-02788d3d] {
144
+ flex: 1;
145
+ outline: none;
146
+ border: none;
147
+ height: 30px;
148
+ background: transparent;
146
149
  }
147
- .drag-handle svg[data-v-5e8a952d] {
148
- fill: currentColor;
150
+ .search-input[data-v-02788d3d]::placeholder {
151
+ color: #c4c6cc;
149
152
  }
150
- .tag-wrapper[data-v-5e8a952d] {
151
- display: flex;
153
+ .selected-user[data-v-02788d3d] {
154
+ display: inline-flex;
152
155
  align-items: center;
153
- padding: 0;
156
+ background-color: #f0f1f5;
157
+ border-radius: 2px;
158
+ padding: 0 8px;
159
+ margin-right: 8px;
154
160
  height: 24px;
161
+ max-width: calc(100% - 32px);
155
162
  }
156
- .inline-input[data-v-5e8a952d] {
163
+ .selected-user .tenant-name[data-v-02788d3d] {
164
+ color: #f59500;
157
165
  margin-left: 4px;
158
- min-width: 10px;
159
- padding: 0 2px;
160
166
  }
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;
171
- }
172
-
173
- /* 单选模式样式 */
174
- .is-single[data-v-5e8a952d] {
167
+ .selected-user .close-icon[data-v-02788d3d] {
168
+ margin-left: 4px;
175
169
  cursor: pointer;
170
+ font-style: normal;
176
171
  }
177
- .single-select[data-v-5e8a952d] {
178
- display: flex;
179
- align-items: center;
180
- justify-content: space-between;
181
- width: 100%;
182
- height: 100%;
172
+ .dropdown-content[data-v-02788d3d] {
173
+ min-height: 40px;
174
+ max-height: 300px;
175
+ overflow-y: auto;
176
+ padding: 5px 0;
183
177
  }
184
- .single-value[data-v-5e8a952d] {
178
+ .dropdown-content .no-data[data-v-02788d3d] {
179
+ padding: 10px;
180
+ text-align: center;
181
+ color: #979ba5;
182
+ }
183
+ .dropdown-content .user-option[data-v-02788d3d] {
184
+ padding: 8px 12px;
185
+ cursor: pointer;
185
186
  display: flex;
186
187
  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;
188
+ height: 32px;
194
189
  }
195
- .placeholder[data-v-5e8a952d] {
196
- color: #c4c6cc;
190
+ .dropdown-content .user-option[data-v-02788d3d]:hover {
191
+ background-color: #f5f7fa;
197
192
  }
198
- .dropdown-arrow[data-v-5e8a952d] {
199
- margin-left: 8px;
200
- font-size: 10px;
201
- color: #979ba5;
193
+ .dropdown-content .user-option .tenant-name[data-v-02788d3d] {
194
+ color: #f59500;
195
+ margin-left: 4px;
196
+ padding: 0 4px;
202
197
  }
203
- .clear-icon[data-v-5e8a952d] {
204
- margin-left: 8px;
205
- font-size: 14px;
206
- color: #979ba5;
198
+ .me-tag[data-v-02788d3d] {
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;
207
208
  cursor: pointer;
209
+ font-size: 12px;
210
+ position: absolute;
211
+ right: 8px;
212
+ top: 50%;
213
+ transform: translateY(-50%);
214
+ z-index: 1;
208
215
  }
209
- .clear-icon[data-v-5e8a952d]:hover {
210
- color: #63656e;
216
+ .me-tag[data-v-02788d3d]:hover {
217
+ background-color: #cddffe;
218
+ color: #3a84ff;
211
219
  }
212
- .no-data[data-v-5e8a952d] {
213
- padding: 8px 12px;
220
+ .me-tag.disabled[data-v-02788d3d] {
221
+ background-color: #f0f1f5;
222
+ color: #c4c6cc;
223
+ cursor: not-allowed;
224
+ }.bk-user-selector[data-v-bb73e41f] {
225
+ width: 100%;
226
+ position: relative;
214
227
  font-size: 12px;
215
- text-align: center;
216
- display: flex;
217
- align-items: center;
218
- justify-content: center;
219
- }
228
+ }
@@ -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;