vxe-table 4.2.6-beta.3 → 4.2.6
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 +1 -1
- package/README.zh-TW.md +0 -4
- package/es/edit/src/hook.js +2 -2
- package/es/export/src/export-panel.js +19 -19
- package/es/export/src/import-panel.js +9 -9
- package/es/filter/src/hook.js +5 -5
- package/es/form/src/form-item.js +1 -1
- package/es/form/src/render.js +1 -1
- package/es/grid/src/grid.js +12 -8
- package/es/input/src/input.js +19 -16
- package/es/locale/lang/en-US.js +2 -0
- package/es/locale/lang/ja-JP.js +2 -0
- package/es/locale/lang/zh-CN.js +2 -0
- package/es/locale/lang/zh-TC.js +2 -0
- package/es/menu/src/hooks.js +0 -6
- package/es/select/src/select.js +145 -15
- package/es/select/style.css +17 -3
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/body.js +1 -1
- package/es/table/src/cell.js +3 -3
- package/es/table/src/columnInfo.js +1 -1
- package/es/table/src/table.js +59 -47
- package/es/table/src/util.js +2 -2
- package/es/toolbar/style.css +11 -9
- package/es/tools/log.js +1 -1
- package/es/v-x-e-table/index.js +1 -1
- package/es/v-x-e-table/src/conf.js +2 -2
- package/lib/edit/src/hook.js +2 -2
- package/lib/filter/src/hook.js +8 -5
- package/lib/filter/src/hook.min.js +1 -1
- package/lib/form/src/form-item.js +1 -0
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/form/src/render.js +1 -0
- package/lib/form/src/render.min.js +1 -1
- package/lib/grid/src/grid.js +16 -11
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +327 -123
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +21 -18
- package/lib/input/src/input.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -0
- package/lib/locale/lang/ja-JP.js +2 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -0
- package/lib/locale/lang/zh-CN.js +2 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -0
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +2 -0
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +2 -0
- package/lib/locale/lang/zh-TC.js +2 -0
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +2 -0
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +2 -0
- package/lib/menu/src/hooks.js +0 -6
- package/lib/select/src/select.js +194 -16
- package/lib/select/src/select.min.js +1 -1
- package/lib/select/style/style.css +17 -3
- package/lib/select/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +1 -1
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +3 -3
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -1
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/table.js +66 -51
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +2 -2
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/style/style.css +11 -9
- package/lib/toolbar/style/style.min.css +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +2 -2
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/package.json +1 -1
- package/packages/edit/src/hook.ts +2 -2
- package/packages/export/src/export-panel.ts +19 -19
- package/packages/export/src/import-panel.ts +9 -9
- package/packages/filter/src/hook.ts +7 -7
- package/packages/form/src/form-item.ts +1 -1
- package/packages/form/src/render.ts +1 -1
- package/packages/grid/src/grid.ts +15 -9
- package/packages/input/src/input.ts +19 -16
- package/packages/locale/lang/en-US.ts +2 -0
- package/packages/locale/lang/ja-JP.ts +2 -0
- package/packages/locale/lang/zh-CN.ts +2 -0
- package/packages/locale/lang/zh-TC.ts +2 -0
- package/packages/menu/src/hooks.ts +0 -6
- package/packages/select/src/select.ts +146 -16
- package/packages/table/src/body.ts +1 -1
- package/packages/table/src/cell.ts +3 -3
- package/packages/table/src/columnInfo.ts +1 -1
- package/packages/table/src/table.ts +61 -49
- package/packages/table/src/util.ts +4 -4
- package/packages/v-x-e-table/src/conf.ts +2 -2
- package/styles/select.scss +24 -5
- package/styles/toolbar.scss +9 -5
- package/styles/variable.scss +0 -4
- package/types/form-item.d.ts +16 -1
- package/types/form.d.ts +1 -1
- package/types/input.d.ts +4 -0
- package/types/select.d.ts +19 -4
- package/types/table.d.ts +2 -0
package/es/select/src/select.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent, h, Teleport, ref, inject,
|
|
1
|
+
import { defineComponent, h, Teleport, ref, inject, computed, provide, onUnmounted, reactive, nextTick, watch, onMounted, createCommentVNode } from 'vue';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
3
|
import GlobalConfig from '../../v-x-e-table/src/conf';
|
|
4
4
|
import { useSize } from '../../hooks/size';
|
|
5
5
|
import { getEventTargetNode, getAbsolutePos } from '../../tools/dom';
|
|
6
6
|
import { getLastZIndex, nextZIndex, getFuncText, formatText } from '../../tools/utils';
|
|
7
7
|
import { GlobalEvent, hasEventKey, EVENT_KEYS } from '../../tools/event';
|
|
8
|
+
import VxeInputComponent from '../../input/src/input';
|
|
8
9
|
function isOptionVisible(option) {
|
|
9
10
|
return option.visible !== false;
|
|
10
11
|
}
|
|
@@ -30,6 +31,10 @@ export default defineComponent({
|
|
|
30
31
|
optionConfig: Object,
|
|
31
32
|
className: [String, Function],
|
|
32
33
|
size: { type: String, default: function () { return GlobalConfig.select.size || GlobalConfig.size; } },
|
|
34
|
+
filterable: Boolean,
|
|
35
|
+
filterMethod: Function,
|
|
36
|
+
remote: Boolean,
|
|
37
|
+
remoteMethod: Function,
|
|
33
38
|
emptyText: String,
|
|
34
39
|
// 已废弃,被 option-config.keyField 替换
|
|
35
40
|
optionId: { type: String, default: function () { return GlobalConfig.select.optionId; } },
|
|
@@ -55,16 +60,21 @@ export default defineComponent({
|
|
|
55
60
|
fullOptionList: [],
|
|
56
61
|
visibleGroupList: [],
|
|
57
62
|
visibleOptionList: [],
|
|
63
|
+
remoteValueList: [],
|
|
58
64
|
panelIndex: 0,
|
|
59
65
|
panelStyle: {},
|
|
60
66
|
panelPlacement: null,
|
|
67
|
+
currentOption: null,
|
|
61
68
|
currentValue: null,
|
|
62
69
|
visiblePanel: false,
|
|
63
70
|
animatVisible: false,
|
|
64
|
-
isActivated: false
|
|
71
|
+
isActivated: false,
|
|
72
|
+
searchValue: '',
|
|
73
|
+
searchLoading: false
|
|
65
74
|
});
|
|
66
75
|
var refElem = ref();
|
|
67
76
|
var refInput = ref();
|
|
77
|
+
var refInpSearch = ref();
|
|
68
78
|
var refOptionWrapper = ref();
|
|
69
79
|
var refOptionPanel = ref();
|
|
70
80
|
var refMaps = {
|
|
@@ -139,16 +149,27 @@ export default defineComponent({
|
|
|
139
149
|
}
|
|
140
150
|
return fullOptionList.find(function (item) { return optionValue === item[valueField]; });
|
|
141
151
|
};
|
|
152
|
+
var getRemoteSelectLabel = function (value) {
|
|
153
|
+
var remoteValueList = reactData.remoteValueList;
|
|
154
|
+
var labelField = computeLabelField.value;
|
|
155
|
+
var remoteItem = remoteValueList.find(function (item) { return value === item.key; });
|
|
156
|
+
var item = remoteItem ? remoteItem.result : null;
|
|
157
|
+
return XEUtils.toValueString(item ? item[labelField] : value);
|
|
158
|
+
};
|
|
142
159
|
var getSelectLabel = function (value) {
|
|
143
160
|
var labelField = computeLabelField.value;
|
|
144
161
|
var item = findOption(value);
|
|
145
162
|
return XEUtils.toValueString(item ? item[labelField] : value);
|
|
146
163
|
};
|
|
147
164
|
var computeSelectLabel = computed(function () {
|
|
148
|
-
var modelValue = props.modelValue, multiple = props.multiple;
|
|
165
|
+
var modelValue = props.modelValue, multiple = props.multiple, remote = props.remote;
|
|
149
166
|
var multiMaxCharNum = computeMultiMaxCharNum.value;
|
|
150
167
|
if (modelValue && multiple) {
|
|
151
|
-
|
|
168
|
+
var vals = XEUtils.isArray(modelValue) ? modelValue : [modelValue];
|
|
169
|
+
if (remote) {
|
|
170
|
+
return vals.map(function (val) { return getRemoteSelectLabel(val); }).join(', ');
|
|
171
|
+
}
|
|
172
|
+
return vals.map(function (val) {
|
|
152
173
|
var label = getSelectLabel(val);
|
|
153
174
|
if (multiMaxCharNum > 0 && label.length > multiMaxCharNum) {
|
|
154
175
|
return label.substring(0, multiMaxCharNum) + "...";
|
|
@@ -156,6 +177,9 @@ export default defineComponent({
|
|
|
156
177
|
return label;
|
|
157
178
|
}).join(', ');
|
|
158
179
|
}
|
|
180
|
+
if (remote) {
|
|
181
|
+
return getRemoteSelectLabel(modelValue);
|
|
182
|
+
}
|
|
159
183
|
return getSelectLabel(modelValue);
|
|
160
184
|
});
|
|
161
185
|
var getOptkey = function () {
|
|
@@ -170,13 +194,32 @@ export default defineComponent({
|
|
|
170
194
|
* 刷新选项,当选项被动态显示/隐藏时可能会用到
|
|
171
195
|
*/
|
|
172
196
|
var refreshOption = function () {
|
|
173
|
-
var
|
|
197
|
+
var filterable = props.filterable, filterMethod = props.filterMethod;
|
|
198
|
+
var fullOptionList = reactData.fullOptionList, fullGroupList = reactData.fullGroupList, searchValue = reactData.searchValue;
|
|
174
199
|
var isGroup = computeIsGroup.value;
|
|
200
|
+
var groupLabelField = computeGroupLabelField.value;
|
|
201
|
+
var labelField = computeLabelField.value;
|
|
175
202
|
if (isGroup) {
|
|
176
|
-
|
|
203
|
+
if (filterable && filterMethod) {
|
|
204
|
+
reactData.visibleGroupList = fullGroupList.filter(function (group) { return isOptionVisible(group) && filterMethod({ group: group, option: null, searchValue: searchValue }); });
|
|
205
|
+
}
|
|
206
|
+
else if (filterable) {
|
|
207
|
+
reactData.visibleGroupList = fullGroupList.filter(function (group) { return isOptionVisible(group) && (!searchValue || ("" + group[groupLabelField]).indexOf(searchValue) > -1); });
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
reactData.visibleGroupList = fullGroupList.filter(isOptionVisible);
|
|
211
|
+
}
|
|
177
212
|
}
|
|
178
213
|
else {
|
|
179
|
-
|
|
214
|
+
if (filterable && filterMethod) {
|
|
215
|
+
reactData.visibleOptionList = fullOptionList.filter(function (option) { return isOptionVisible(option) && filterMethod({ group: null, option: option, searchValue: searchValue }); });
|
|
216
|
+
}
|
|
217
|
+
else if (filterable) {
|
|
218
|
+
reactData.visibleOptionList = fullOptionList.filter(function (option) { return isOptionVisible(option) && (!searchValue || ("" + option[labelField]).indexOf(searchValue) > -1); });
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
reactData.visibleOptionList = fullOptionList.filter(isOptionVisible);
|
|
222
|
+
}
|
|
180
223
|
}
|
|
181
224
|
return nextTick();
|
|
182
225
|
};
|
|
@@ -205,6 +248,7 @@ export default defineComponent({
|
|
|
205
248
|
var setCurrentOption = function (option) {
|
|
206
249
|
var valueField = computeValueField.value;
|
|
207
250
|
if (option) {
|
|
251
|
+
reactData.currentOption = option;
|
|
208
252
|
reactData.currentValue = option[valueField];
|
|
209
253
|
}
|
|
210
254
|
};
|
|
@@ -310,7 +354,7 @@ export default defineComponent({
|
|
|
310
354
|
};
|
|
311
355
|
var hidePanelTimeout;
|
|
312
356
|
var showOptionPanel = function () {
|
|
313
|
-
var loading = props.loading, disabled = props.disabled;
|
|
357
|
+
var loading = props.loading, disabled = props.disabled, filterable = props.filterable;
|
|
314
358
|
if (!loading && !disabled) {
|
|
315
359
|
clearTimeout(hidePanelTimeout);
|
|
316
360
|
if (!reactData.inited) {
|
|
@@ -318,6 +362,9 @@ export default defineComponent({
|
|
|
318
362
|
}
|
|
319
363
|
reactData.isActivated = true;
|
|
320
364
|
reactData.animatVisible = true;
|
|
365
|
+
if (filterable) {
|
|
366
|
+
refreshOption();
|
|
367
|
+
}
|
|
321
368
|
setTimeout(function () {
|
|
322
369
|
var modelValue = props.modelValue, multiple = props.multiple;
|
|
323
370
|
var currOption = findOption(multiple && modelValue ? modelValue[0] : modelValue);
|
|
@@ -326,12 +373,15 @@ export default defineComponent({
|
|
|
326
373
|
setCurrentOption(currOption);
|
|
327
374
|
scrollToOption(currOption);
|
|
328
375
|
}
|
|
376
|
+
handleFocusSearch();
|
|
329
377
|
}, 10);
|
|
330
378
|
updateZindex();
|
|
331
379
|
updatePlacement();
|
|
332
380
|
}
|
|
333
381
|
};
|
|
334
382
|
var hideOptionPanel = function () {
|
|
383
|
+
reactData.searchValue = '';
|
|
384
|
+
reactData.searchLoading = false;
|
|
335
385
|
reactData.visiblePanel = false;
|
|
336
386
|
hidePanelTimeout = window.setTimeout(function () {
|
|
337
387
|
reactData.animatVisible = false;
|
|
@@ -348,6 +398,7 @@ export default defineComponent({
|
|
|
348
398
|
}
|
|
349
399
|
};
|
|
350
400
|
var clearValueEvent = function (evnt, selectValue) {
|
|
401
|
+
reactData.remoteValueList = [];
|
|
351
402
|
changeEvent(evnt, selectValue);
|
|
352
403
|
selectMethods.dispatchEvent('clear', { value: selectValue }, evnt);
|
|
353
404
|
};
|
|
@@ -355,8 +406,9 @@ export default defineComponent({
|
|
|
355
406
|
clearValueEvent(evnt, null);
|
|
356
407
|
hideOptionPanel();
|
|
357
408
|
};
|
|
358
|
-
var changeOptionEvent = function (evnt, selectValue) {
|
|
409
|
+
var changeOptionEvent = function (evnt, selectValue, option) {
|
|
359
410
|
var modelValue = props.modelValue, multiple = props.multiple;
|
|
411
|
+
var remoteValueList = reactData.remoteValueList;
|
|
360
412
|
if (multiple) {
|
|
361
413
|
var multipleValue = void 0;
|
|
362
414
|
if (modelValue) {
|
|
@@ -370,9 +422,17 @@ export default defineComponent({
|
|
|
370
422
|
else {
|
|
371
423
|
multipleValue = [selectValue];
|
|
372
424
|
}
|
|
425
|
+
var remoteItem = remoteValueList.find(function (item) { return item.key === selectValue; });
|
|
426
|
+
if (remoteItem) {
|
|
427
|
+
remoteItem.result = option;
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
remoteValueList.push({ key: selectValue, result: option });
|
|
431
|
+
}
|
|
373
432
|
changeEvent(evnt, multipleValue);
|
|
374
433
|
}
|
|
375
434
|
else {
|
|
435
|
+
reactData.remoteValueList = [{ key: selectValue, result: option }];
|
|
376
436
|
changeEvent(evnt, selectValue);
|
|
377
437
|
hideOptionPanel();
|
|
378
438
|
}
|
|
@@ -481,7 +541,7 @@ export default defineComponent({
|
|
|
481
541
|
};
|
|
482
542
|
var handleGlobalKeydownEvent = function (evnt) {
|
|
483
543
|
var clearable = props.clearable, disabled = props.disabled;
|
|
484
|
-
var visiblePanel = reactData.visiblePanel, currentValue = reactData.currentValue;
|
|
544
|
+
var visiblePanel = reactData.visiblePanel, currentValue = reactData.currentValue, currentOption = reactData.currentOption;
|
|
485
545
|
if (!disabled) {
|
|
486
546
|
var isTab = hasEventKey(evnt, EVENT_KEYS.TAB);
|
|
487
547
|
var isEnter = hasEventKey(evnt, EVENT_KEYS.ENTER);
|
|
@@ -500,7 +560,7 @@ export default defineComponent({
|
|
|
500
560
|
else if (isEnter) {
|
|
501
561
|
evnt.preventDefault();
|
|
502
562
|
evnt.stopPropagation();
|
|
503
|
-
changeOptionEvent(evnt, currentValue);
|
|
563
|
+
changeOptionEvent(evnt, currentValue, currentOption);
|
|
504
564
|
}
|
|
505
565
|
else if (isUpArrow || isDwArrow) {
|
|
506
566
|
evnt.preventDefault();
|
|
@@ -529,6 +589,16 @@ export default defineComponent({
|
|
|
529
589
|
var handleGlobalBlurEvent = function () {
|
|
530
590
|
hideOptionPanel();
|
|
531
591
|
};
|
|
592
|
+
var handleFocusSearch = function () {
|
|
593
|
+
if (props.filterable) {
|
|
594
|
+
nextTick(function () {
|
|
595
|
+
var inpSearch = refInpSearch.value;
|
|
596
|
+
if (inpSearch) {
|
|
597
|
+
inpSearch.focus();
|
|
598
|
+
}
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
};
|
|
532
602
|
var focusEvent = function () {
|
|
533
603
|
if (!props.disabled) {
|
|
534
604
|
reactData.isActivated = true;
|
|
@@ -537,6 +607,34 @@ export default defineComponent({
|
|
|
537
607
|
var blurEvent = function () {
|
|
538
608
|
reactData.isActivated = false;
|
|
539
609
|
};
|
|
610
|
+
var modelSearchEvent = function (value) {
|
|
611
|
+
reactData.searchValue = value;
|
|
612
|
+
};
|
|
613
|
+
var focusSearchEvent = function () {
|
|
614
|
+
reactData.isActivated = true;
|
|
615
|
+
};
|
|
616
|
+
var keydownSearchEvent = function (params) {
|
|
617
|
+
var $event = params.$event;
|
|
618
|
+
var isEnter = hasEventKey($event, EVENT_KEYS.ENTER);
|
|
619
|
+
if (isEnter) {
|
|
620
|
+
$event.preventDefault();
|
|
621
|
+
$event.stopPropagation();
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
var triggerSearchEvent = XEUtils.debounce(function () {
|
|
625
|
+
var remote = props.remote, remoteMethod = props.remoteMethod;
|
|
626
|
+
var searchValue = reactData.searchValue;
|
|
627
|
+
if (remote && remoteMethod) {
|
|
628
|
+
reactData.searchLoading = true;
|
|
629
|
+
Promise.resolve(remoteMethod({ searchValue: searchValue })).then(function () { return nextTick(); }).catch(function () { return nextTick(); }).finally(function () {
|
|
630
|
+
reactData.searchLoading = false;
|
|
631
|
+
refreshOption();
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
else {
|
|
635
|
+
refreshOption();
|
|
636
|
+
}
|
|
637
|
+
}, 350, { trailing: true });
|
|
540
638
|
var togglePanelEvent = function (params) {
|
|
541
639
|
var $event = params.$event;
|
|
542
640
|
$event.preventDefault();
|
|
@@ -580,7 +678,7 @@ export default defineComponent({
|
|
|
580
678
|
},
|
|
581
679
|
onClick: function (evnt) {
|
|
582
680
|
if (!isDisabled) {
|
|
583
|
-
changeOptionEvent(evnt, optionValue);
|
|
681
|
+
changeOptionEvent(evnt, optionValue, option);
|
|
584
682
|
}
|
|
585
683
|
},
|
|
586
684
|
onMouseenter: function () {
|
|
@@ -621,8 +719,22 @@ export default defineComponent({
|
|
|
621
719
|
});
|
|
622
720
|
};
|
|
623
721
|
var renderOpts = function () {
|
|
624
|
-
var visibleGroupList = reactData.visibleGroupList, visibleOptionList = reactData.visibleOptionList;
|
|
722
|
+
var visibleGroupList = reactData.visibleGroupList, visibleOptionList = reactData.visibleOptionList, searchLoading = reactData.searchLoading;
|
|
625
723
|
var isGroup = computeIsGroup.value;
|
|
724
|
+
if (searchLoading) {
|
|
725
|
+
return [
|
|
726
|
+
h('div', {
|
|
727
|
+
class: 'vxe-select--search-loading'
|
|
728
|
+
}, [
|
|
729
|
+
h('i', {
|
|
730
|
+
class: ['vxe-select--search-icon', GlobalConfig.icon.SELECT_LOADED]
|
|
731
|
+
}),
|
|
732
|
+
h('span', {
|
|
733
|
+
class: 'vxe-select--search-text'
|
|
734
|
+
}, GlobalConfig.i18n('vxe.select.loadingText'))
|
|
735
|
+
])
|
|
736
|
+
];
|
|
737
|
+
}
|
|
626
738
|
if (isGroup) {
|
|
627
739
|
if (visibleGroupList.length) {
|
|
628
740
|
return renderOptgroup();
|
|
@@ -727,7 +839,7 @@ export default defineComponent({
|
|
|
727
839
|
});
|
|
728
840
|
var renderVN = function () {
|
|
729
841
|
var _a, _b;
|
|
730
|
-
var className = props.className, transfer = props.transfer, disabled = props.disabled, loading = props.loading;
|
|
842
|
+
var className = props.className, transfer = props.transfer, disabled = props.disabled, loading = props.loading, filterable = props.filterable;
|
|
731
843
|
var inited = reactData.inited, isActivated = reactData.isActivated, visiblePanel = reactData.visiblePanel;
|
|
732
844
|
var vSize = computeSize.value;
|
|
733
845
|
var selectLabel = computeSelectLabel.value;
|
|
@@ -738,6 +850,7 @@ export default defineComponent({
|
|
|
738
850
|
_a["size--" + vSize] = vSize,
|
|
739
851
|
_a['is--visivle'] = visiblePanel,
|
|
740
852
|
_a['is--disabled'] = disabled,
|
|
853
|
+
_a['is--filter'] = filterable,
|
|
741
854
|
_a['is--loading'] = loading,
|
|
742
855
|
_a['is--active'] = isActivated,
|
|
743
856
|
_a)]
|
|
@@ -746,7 +859,7 @@ export default defineComponent({
|
|
|
746
859
|
class: 'vxe-select-slots',
|
|
747
860
|
ref: 'hideOption'
|
|
748
861
|
}, slots.default ? slots.default({}) : []),
|
|
749
|
-
h(
|
|
862
|
+
h(VxeInputComponent, {
|
|
750
863
|
ref: refInput,
|
|
751
864
|
clearable: props.clearable,
|
|
752
865
|
placeholder: props.placeholder,
|
|
@@ -779,6 +892,23 @@ export default defineComponent({
|
|
|
779
892
|
placement: reactData.panelPlacement,
|
|
780
893
|
style: reactData.panelStyle
|
|
781
894
|
}, inited ? [
|
|
895
|
+
filterable ? h('div', {
|
|
896
|
+
class: 'vxe-select-filter--wrapper'
|
|
897
|
+
}, [
|
|
898
|
+
h(VxeInputComponent, {
|
|
899
|
+
ref: refInpSearch,
|
|
900
|
+
class: 'vxe-select-filter--input',
|
|
901
|
+
modelValue: reactData.searchValue,
|
|
902
|
+
clearable: true,
|
|
903
|
+
placeholder: GlobalConfig.i18n('vxe.select.search'),
|
|
904
|
+
prefixIcon: GlobalConfig.icon.INPUT_SEARCH,
|
|
905
|
+
'onUpdate:modelValue': modelSearchEvent,
|
|
906
|
+
onFocus: focusSearchEvent,
|
|
907
|
+
onKeydown: keydownSearchEvent,
|
|
908
|
+
onChange: triggerSearchEvent,
|
|
909
|
+
onSearch: triggerSearchEvent
|
|
910
|
+
})
|
|
911
|
+
]) : createCommentVNode(),
|
|
782
912
|
h('div', {
|
|
783
913
|
ref: refOptionWrapper,
|
|
784
914
|
class: 'vxe-select-option--wrapper'
|
package/es/select/style.css
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
width: 100%; }
|
|
40
40
|
.vxe-select > .vxe-input .vxe-input--suffix-icon {
|
|
41
41
|
transition: transform 0.2s ease-in-out; }
|
|
42
|
-
.vxe-select.is--active > .vxe-input .vxe-input--inner {
|
|
42
|
+
.vxe-select.is--active:not(.is--filter) > .vxe-input .vxe-input--inner {
|
|
43
43
|
border: 1px solid #409eff; }
|
|
44
44
|
|
|
45
45
|
.vxe-select-slots {
|
|
@@ -71,7 +71,13 @@
|
|
|
71
71
|
opacity: 1;
|
|
72
72
|
transform: scaleY(1); }
|
|
73
73
|
|
|
74
|
+
.vxe-select-filter--wrapper {
|
|
75
|
+
display: block; }
|
|
76
|
+
.vxe-select-filter--wrapper .vxe-select-filter--input {
|
|
77
|
+
width: 100%; }
|
|
78
|
+
|
|
74
79
|
.vxe-select-option--wrapper {
|
|
80
|
+
position: relative;
|
|
75
81
|
overflow-x: hidden;
|
|
76
82
|
overflow-y: auto;
|
|
77
83
|
padding: 4px 0;
|
|
@@ -90,7 +96,7 @@
|
|
|
90
96
|
padding: 0 20px; }
|
|
91
97
|
|
|
92
98
|
.vxe-select-option {
|
|
93
|
-
padding: 0
|
|
99
|
+
padding: 0 0.6em;
|
|
94
100
|
max-width: 600px;
|
|
95
101
|
white-space: nowrap;
|
|
96
102
|
overflow: hidden;
|
|
@@ -111,8 +117,12 @@
|
|
|
111
117
|
color: #BFBFBF;
|
|
112
118
|
cursor: no-drop; }
|
|
113
119
|
|
|
120
|
+
.vxe-select--search-icon {
|
|
121
|
+
margin-right: 0.5em; }
|
|
122
|
+
|
|
123
|
+
.vxe-select--search-loading,
|
|
114
124
|
.vxe-select--empty-placeholder {
|
|
115
|
-
padding: 0
|
|
125
|
+
padding: 0 0.6em;
|
|
116
126
|
text-align: center;
|
|
117
127
|
color: #C0C4CC; }
|
|
118
128
|
|
|
@@ -135,6 +145,7 @@
|
|
|
135
145
|
|
|
136
146
|
.vxe-select--panel .vxe-optgroup--title,
|
|
137
147
|
.vxe-select--panel .vxe-select-option,
|
|
148
|
+
.vxe-select--panel .vxe-select--search-loading,
|
|
138
149
|
.vxe-select--panel .vxe-select--empty-placeholder {
|
|
139
150
|
line-height: 30px; }
|
|
140
151
|
|
|
@@ -144,6 +155,7 @@
|
|
|
144
155
|
|
|
145
156
|
.vxe-select--panel.size--medium .vxe-optgroup--title,
|
|
146
157
|
.vxe-select--panel.size--medium .vxe-select-option,
|
|
158
|
+
.vxe-select--panel.size--medium .vxe-select--search-loading,
|
|
147
159
|
.vxe-select--panel.size--medium .vxe-select--empty-placeholder {
|
|
148
160
|
line-height: 28px; }
|
|
149
161
|
|
|
@@ -153,6 +165,7 @@
|
|
|
153
165
|
|
|
154
166
|
.vxe-select--panel.size--small .vxe-optgroup--title,
|
|
155
167
|
.vxe-select--panel.size--small .vxe-select-option,
|
|
168
|
+
.vxe-select--panel.size--small .vxe-select--search-loading,
|
|
156
169
|
.vxe-select--panel.size--small .vxe-select--empty-placeholder {
|
|
157
170
|
line-height: 26px; }
|
|
158
171
|
|
|
@@ -162,5 +175,6 @@
|
|
|
162
175
|
|
|
163
176
|
.vxe-select--panel.size--mini .vxe-optgroup--title,
|
|
164
177
|
.vxe-select--panel.size--mini .vxe-select-option,
|
|
178
|
+
.vxe-select--panel.size--mini .vxe-select--search-loading,
|
|
165
179
|
.vxe-select--panel.size--mini .vxe-select--empty-placeholder {
|
|
166
180
|
line-height: 24px; }
|