bkui-vue 0.0.1-beta.25 → 0.0.1-beta.26

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.
@@ -1,4 +1,4 @@
1
- import { OnFirstUpdateFnType } from '@bkui-vue/shared';
1
+ import { OptionInstanceType } from './type';
2
2
  declare const _default: import("vue").DefineComponent<{
3
3
  modelValue: import("vue-types").VueTypeValidableDef<any>;
4
4
  multiple: import("vue-types").VueTypeValidableDef<boolean> & {
@@ -6,11 +6,6 @@ declare const _default: import("vue").DefineComponent<{
6
6
  } & {
7
7
  default: boolean;
8
8
  };
9
- placeholder: import("vue-types").VueTypeValidableDef<string> & {
10
- default: string;
11
- } & {
12
- default: string;
13
- };
14
9
  disabled: import("vue-types").VueTypeValidableDef<boolean> & {
15
10
  default: boolean;
16
11
  } & {
@@ -42,34 +37,61 @@ declare const _default: import("vue").DefineComponent<{
42
37
  } & {
43
38
  default: number;
44
39
  };
40
+ showSelectAll: import("vue-types").VueTypeValidableDef<boolean> & {
41
+ default: boolean;
42
+ } & {
43
+ default: boolean;
44
+ };
45
+ popoverMinWidth: import("vue-types").VueTypeValidableDef<number> & {
46
+ default: number;
47
+ } & {
48
+ default: number;
49
+ };
50
+ showOnInit: import("vue-types").VueTypeValidableDef<boolean> & {
51
+ default: boolean;
52
+ } & {
53
+ default: boolean;
54
+ };
55
+ multipleMode: import("vue-types").VueTypeDef<string> & {
56
+ default: string;
57
+ };
58
+ tagTheme: import("vue-types").VueTypeDef<string> & {
59
+ default: string;
60
+ };
61
+ behavior: import("vue-types").VueTypeDef<string> & {
62
+ default: string;
63
+ };
64
+ collapseTags: import("vue-types").VueTypeValidableDef<boolean> & {
65
+ default: boolean;
66
+ } & {
67
+ default: boolean;
68
+ };
69
+ noDataText: import("vue-types").VueTypeValidableDef<string> & {
70
+ default: string;
71
+ } & {
72
+ default: string;
73
+ };
74
+ noMatchText: import("vue-types").VueTypeValidableDef<string> & {
75
+ default: string;
76
+ } & {
77
+ default: string;
78
+ };
79
+ loadingText: import("vue-types").VueTypeValidableDef<string> & {
80
+ default: string;
81
+ } & {
82
+ default: string;
83
+ };
84
+ placeholder: import("vue-types").VueTypeValidableDef<string> & {
85
+ default: string;
86
+ } & {
87
+ default: string;
88
+ };
89
+ selectAllText: import("vue-types").VueTypeValidableDef<string> & {
90
+ default: string;
91
+ } & {
92
+ default: string;
93
+ };
45
94
  }, {
46
- selectedLabel: import("vue").ComputedRef<string>;
47
- selectClass: import("vue").ComputedRef<{
48
- [x: string]: boolean;
49
- 'bk-select': boolean;
50
- 'popover-show': boolean;
51
- 'is-disabled': boolean;
52
- 'is-focus': boolean;
53
- }>;
54
- isPopoverShow: import("vue").Ref<boolean>;
55
- isHover: import("vue").Ref<boolean>;
56
- popperWidth: import("vue").Ref<string | number>;
57
- selectTriggerRef: import("vue").Ref<HTMLElement>;
58
- inputRef: import("vue").Ref<HTMLElement>;
59
- searchKey: import("vue").Ref<string>;
60
- searchLoading: import("vue").Ref<boolean>;
61
- isEmpty: import("vue").ComputedRef<boolean>;
62
- isFocus: import("vue").Ref<boolean>;
63
- setHover: () => void;
64
- cancelHover: () => void;
65
- handleFocus: () => void;
66
- handleInput: (e: any) => void;
67
- toggleMenu: () => void;
68
- handleClear: (e: Event) => void;
69
- onPopoverFirstUpdate: OnFirstUpdateFnType;
70
- hidePopover: () => void;
71
- showPopover: () => void;
72
- currentPlaceholder: import("vue").Ref<string>;
73
95
  options: import("vue").Ref<Set<{
74
96
  $: import("vue").ComponentInternalInstance;
75
97
  $data: {};
@@ -146,6 +168,34 @@ declare const _default: import("vue").DefineComponent<{
146
168
  handleOptionClick: () => void;
147
169
  visible: import("vue").Ref<boolean>;
148
170
  }> & {} & {} & import("vue").ComponentCustomProperties>>;
171
+ isDisabled: import("vue").ComputedRef<boolean>;
172
+ selectedLabel: import("vue").ComputedRef<(string | number)[]>;
173
+ isPopoverShow: import("vue").Ref<boolean>;
174
+ isHover: import("vue").Ref<boolean>;
175
+ popperWidth: import("vue").Ref<string | number>;
176
+ popoverRef: import("vue").Ref<any>;
177
+ inputRef: import("vue").Ref<HTMLElement>;
178
+ searchLoading: import("vue").Ref<boolean>;
179
+ isOptionsEmpty: import("vue").ComputedRef<boolean>;
180
+ isSearchEmpty: import("vue").ComputedRef<boolean>;
181
+ isFocus: import("vue").Ref<boolean>;
182
+ isShowSelectContent: import("vue").ComputedRef<boolean>;
183
+ curContentText: import("vue").ComputedRef<string>;
184
+ isGroup: import("vue").ComputedRef<boolean>;
185
+ searchKey: import("vue").Ref<string>;
186
+ setHover: () => void;
187
+ cancelHover: () => void;
188
+ handleFocus: () => void;
189
+ handleInput: (e: any) => void;
190
+ handleTogglePopover: () => void;
191
+ handleClear: (e: Event) => void;
192
+ onPopoverFirstUpdate: import("@bkui-vue/shared").OnFirstUpdateFnType;
193
+ hidePopover: () => void;
194
+ showPopover: () => void;
195
+ handleToggleAll: () => void;
196
+ handleOptionSelected: (option: OptionInstanceType) => void;
197
+ handleClickOutside: () => void;
198
+ currentPlaceholder: import("vue").Ref<string>;
149
199
  selectedOptions: import("vue").Ref<Set<{
150
200
  $: import("vue").ComponentInternalInstance;
151
201
  $data: {};
@@ -223,18 +273,13 @@ declare const _default: import("vue").DefineComponent<{
223
273
  visible: import("vue").Ref<boolean>;
224
274
  }> & {} & {} & import("vue").ComponentCustomProperties>>;
225
275
  currentSelectedLabel: import("vue").Ref<string>;
226
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "toggle" | "update:modelValue")[], "change" | "toggle" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
276
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "toggle" | "clear" | "update:modelValue")[], "change" | "toggle" | "clear" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
227
277
  modelValue: import("vue-types").VueTypeValidableDef<any>;
228
278
  multiple: import("vue-types").VueTypeValidableDef<boolean> & {
229
279
  default: boolean;
230
280
  } & {
231
281
  default: boolean;
232
282
  };
233
- placeholder: import("vue-types").VueTypeValidableDef<string> & {
234
- default: string;
235
- } & {
236
- default: string;
237
- };
238
283
  disabled: import("vue-types").VueTypeValidableDef<boolean> & {
239
284
  default: boolean;
240
285
  } & {
@@ -266,9 +311,64 @@ declare const _default: import("vue").DefineComponent<{
266
311
  } & {
267
312
  default: number;
268
313
  };
314
+ showSelectAll: import("vue-types").VueTypeValidableDef<boolean> & {
315
+ default: boolean;
316
+ } & {
317
+ default: boolean;
318
+ };
319
+ popoverMinWidth: import("vue-types").VueTypeValidableDef<number> & {
320
+ default: number;
321
+ } & {
322
+ default: number;
323
+ };
324
+ showOnInit: import("vue-types").VueTypeValidableDef<boolean> & {
325
+ default: boolean;
326
+ } & {
327
+ default: boolean;
328
+ };
329
+ multipleMode: import("vue-types").VueTypeDef<string> & {
330
+ default: string;
331
+ };
332
+ tagTheme: import("vue-types").VueTypeDef<string> & {
333
+ default: string;
334
+ };
335
+ behavior: import("vue-types").VueTypeDef<string> & {
336
+ default: string;
337
+ };
338
+ collapseTags: import("vue-types").VueTypeValidableDef<boolean> & {
339
+ default: boolean;
340
+ } & {
341
+ default: boolean;
342
+ };
343
+ noDataText: import("vue-types").VueTypeValidableDef<string> & {
344
+ default: string;
345
+ } & {
346
+ default: string;
347
+ };
348
+ noMatchText: import("vue-types").VueTypeValidableDef<string> & {
349
+ default: string;
350
+ } & {
351
+ default: string;
352
+ };
353
+ loadingText: import("vue-types").VueTypeValidableDef<string> & {
354
+ default: string;
355
+ } & {
356
+ default: string;
357
+ };
358
+ placeholder: import("vue-types").VueTypeValidableDef<string> & {
359
+ default: string;
360
+ } & {
361
+ default: string;
362
+ };
363
+ selectAllText: import("vue-types").VueTypeValidableDef<string> & {
364
+ default: string;
365
+ } & {
366
+ default: string;
367
+ };
269
368
  }>> & {
270
369
  onChange?: (...args: any[]) => any;
271
370
  "onUpdate:modelValue"?: (...args: any[]) => any;
371
+ onClear?: (...args: any[]) => any;
272
372
  onToggle?: (...args: any[]) => any;
273
373
  }, {
274
374
  placeholder: string;
@@ -276,9 +376,20 @@ declare const _default: import("vue").DefineComponent<{
276
376
  multiple: boolean;
277
377
  disabled: boolean;
278
378
  loading: boolean;
379
+ showOnInit: boolean;
279
380
  clearable: boolean;
381
+ behavior: string;
382
+ popoverMinWidth: number;
280
383
  filterable: boolean;
281
384
  remoteMethod: (...args: any[]) => any;
282
385
  scrollHeight: number;
386
+ showSelectAll: boolean;
387
+ multipleMode: string;
388
+ tagTheme: string;
389
+ collapseTags: boolean;
390
+ noDataText: string;
391
+ noMatchText: string;
392
+ loadingText: string;
393
+ selectAllText: string;
283
394
  }>;
284
395
  export default _default;
@@ -1,19 +1,7 @@
1
1
  @import '../styles/themes/themes.less';
2
+ @import '../styles/mixins/animate.less';
2
3
 
3
4
  .@{bk-prefix}-select {
4
- display: inline-block;
5
-
6
- ul {
7
- padding: 0;
8
- margin: 0;
9
- font-weight: normal;
10
- list-style: none;
11
- }
12
-
13
- .bk-popover-content {
14
- padding: 0;
15
- }
16
-
17
5
  .bk-select-icon(@fontSize: 20px, @color: #979ba5) {
18
6
  display: flex;
19
7
  align-items: center;
@@ -24,16 +12,13 @@
24
12
  color: @color;
25
13
  }
26
14
 
27
- .input-right-icon() {
15
+ .fix-icon() {
28
16
  position: absolute;
29
- top: 6px;
30
- right: 4px;
31
- }
32
-
33
- .input-left-icon() {
34
- position: absolute;
35
- top: 6px;
36
- left: 4px;
17
+ top: 0;
18
+ display: inline-flex;
19
+ height: 100%;
20
+ align-items: center;
21
+ justify-content: center;
37
22
  }
38
23
 
39
24
  .ellipsis() {
@@ -42,12 +27,93 @@
42
27
  white-space: nowrap;
43
28
  }
44
29
 
45
- &.is-focus {
30
+ .mr(@marginRight) {
31
+ margin-right: @marginRight;
32
+ }
33
+
34
+ .ml(@marginLeft) {
35
+ margin-left: @marginLeft;
36
+ }
37
+
38
+ .mr5 {
39
+ .mr(5px)
40
+ }
41
+
42
+ .ml5 {
43
+ .ml(5px)
44
+ }
45
+
46
+ .input {
47
+ width: 100%;
48
+ height: 32px;
49
+ padding: 0 28px 0 10px;
50
+ line-height: normal;
51
+ color: @default-color;
52
+ text-align: left;
53
+ vertical-align: middle;
54
+ cursor: pointer;
55
+ background-color: @white-color;
56
+ border: 1px solid @light-gray;
57
+ border-radius: 2px;
58
+ outline: none;
59
+ box-sizing: border-box;
60
+ transition: all .1s;
61
+ resize: none;
62
+ .ellipsis();
63
+
64
+ &::placeholder {
65
+ color: @light-gray;
66
+ }
67
+ }
68
+
69
+ ul {
70
+ padding: 0;
71
+ margin: 0;
72
+ font-weight: normal;
73
+ list-style: none;
74
+ }
75
+
76
+ .bk-popover-reference {
77
+ display: unset;
78
+ }
79
+ .bk-popover-content {
80
+ padding: 0;
81
+ }
82
+
83
+ &.small {
84
+ .bk-select-trigger .bk-select-input {
85
+ height: 24px;
86
+ }
87
+ }
88
+
89
+ &.large {
90
+ .bk-select-trigger .bk-select-input {
91
+ height: 36px;
92
+ font-size: 14px;
93
+ }
94
+ .bk-select-content {
95
+ font-size: 14px;
96
+ }
97
+ }
98
+
99
+ &.simplicity {
100
+ .bk-select-trigger .bk-select-input {
101
+ border: none;
102
+ border-bottom: 1px solid @light-gray;
103
+ }
104
+ }
105
+
106
+ &.is-focus.normal {
46
107
  .bk-select-trigger .bk-select-input {
47
108
  border-color: @primary-color;
48
109
  box-shadow: 0px 0px 3px 0px #a3c5fd;
49
110
  }
50
111
  }
112
+ &.is-focus.simplicity {
113
+ .bk-select-trigger .bk-select-input {
114
+ border-color: @primary-color;
115
+ }
116
+ }
51
117
 
52
118
  &.is-disabled {
53
119
  .bk-select-trigger .bk-select-input {
@@ -58,6 +124,14 @@
58
124
  }
59
125
  }
60
126
 
127
+ &.is-filterable {
128
+ .bk-select-trigger {
129
+ .bk-select-input, .bk-select-tag-input {
130
+ cursor: text;
131
+ }
132
+ }
133
+ }
134
+
61
135
  &.popover-show {
62
136
  .bk-select-trigger .angle-up {
63
137
  transform: rotate(0);
@@ -69,30 +143,30 @@
69
143
  cursor: pointer;
70
144
 
71
145
  .bk-select-input {
72
- width: 100%;
73
- height: 32px;
74
- padding: 0 28px 0 10px;
75
- font-size: 12px;
76
- line-height: normal;
77
- color: @default-color;
78
- text-align: left;
79
- vertical-align: middle;
80
- cursor: pointer;
81
- background-color: @white-color;
82
- border: 1px solid @light-gray;
83
- border-radius: 2px;
84
- outline: none;
85
- box-sizing: border-box;
86
- transition: all .1s;
87
- resize: none;
88
-
89
- &::placeholder {
90
- color: @light-gray;
146
+ .input()
147
+ }
148
+
149
+ .bk-select-tag {
150
+ .input();
151
+ width: auto;
152
+ height: auto;
153
+ min-height: 32px;
154
+ display: flex;
155
+ align-items: center;
156
+ flex-wrap: wrap;
157
+ &-input {
158
+ .input();
159
+ height: auto;
160
+ width: auto;
161
+ border: none;
162
+ outline: none;
163
+ padding: 0;
91
164
  }
92
165
  }
93
166
 
94
167
  .bk-select-prefix {
95
- .input-left-icon();
168
+ .fix-icon();
169
+ left: 4px;
96
170
  font-size: 14px;
97
171
  }
98
172
 
@@ -100,13 +174,15 @@
100
174
  transform: rotate(180deg);
101
175
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
102
176
  .bk-select-icon();
103
- .input-right-icon();
177
+ .fix-icon();
178
+ right: 4px;
104
179
  }
105
180
 
106
181
  .clear-icon {
107
182
  transition: all .1s;
108
183
  .bk-select-icon(14px, #c4c6cc);
109
- .input-right-icon();
184
+ .fix-icon();
185
+ right: 4px;
110
186
 
111
187
  &:hover {
112
188
  color: #979ba5;
@@ -114,8 +190,9 @@
114
190
  }
115
191
 
116
192
  .spinner {
117
- .input-right-icon();
118
- .bk-select-icon(16px, #3A84FF);
193
+ position: absolute;
194
+ top: 8px;
195
+ right: 6px;
119
196
  }
120
197
  }
121
198
 
@@ -140,32 +217,6 @@
140
217
 
141
218
  .bk-select-dropdown {
142
219
  overflow: auto;
143
-
144
- .bk-select-search {
145
- position: relative;
146
- padding: 0 5px;
147
-
148
- &-icon {
149
- position: absolute;
150
- top: 50%;
151
- left: 8px;
152
- font-size: 16px;
153
- color: #979ba5;
154
- transform: translateY(-50%);
155
- transform: translateY(-50%);
156
- }
157
-
158
- &-input {
159
- width: 100%;
160
- height: 32px;
161
- padding: 0 10px 0 26px;
162
- font-size: 12px;
163
- cursor: text;
164
- border: none;
165
- border-bottom: 1px solid #dcdee5;
166
- outline: 0;
167
- }
168
- }
169
220
  }
170
221
 
171
222
  .bk-select-extension {
@@ -202,7 +253,6 @@
202
253
  &.is-multiple::after {
203
254
  position: absolute;
204
255
  right: 12px;
205
- font-size: 12px;
206
256
  font-weight: 700;
207
257
  content: '\2713';
208
258
  }
@@ -235,6 +285,13 @@
235
285
  }
236
286
  }
237
287
 
288
+ &.disabled {
289
+ .default-group-label {
290
+ color: #C4C6CC;
291
+ cursor: not-allowed;
292
+ }
293
+ }
294
+
238
295
  .default-group-label {
239
296
  display: flex;
240
297
  user-select: none;
@@ -245,7 +302,6 @@
245
302
  width: 12px;
246
303
  height: 12px;
247
304
  margin-right: 8px;
248
- font-size: 12px;
249
305
  transition: all .1s;
250
306
  align-items: center;
251
307
  justify-content: center;