@progress/kendo-vue-dropdowns 2.7.3 → 3.0.0-dev.202201141128
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/dist/cdn/js/kendo-vue-dropdowns.js +1 -1
- package/dist/es/AutoComplete/AutoComplete.d.ts +5 -6
- package/dist/es/AutoComplete/AutoComplete.js +62 -28
- package/dist/es/AutoComplete/AutoCompleteProps.d.ts +39 -0
- package/dist/es/ComboBox/ComboBox.d.ts +5 -6
- package/dist/es/ComboBox/ComboBox.js +101 -79
- package/dist/es/ComboBox/ComboBoxProps.d.ts +39 -0
- package/dist/es/DropDownList/DropDownList.d.ts +5 -6
- package/dist/es/DropDownList/DropDownList.js +181 -152
- package/dist/es/DropDownList/DropDownListProps.d.ts +43 -0
- package/dist/es/MultiSelect/MultiSelect.d.ts +5 -6
- package/dist/es/MultiSelect/MultiSelect.js +105 -77
- package/dist/es/MultiSelect/MultiSelectProps.d.ts +53 -0
- package/dist/es/MultiSelect/TagList.d.ts +8 -4
- package/dist/es/MultiSelect/TagList.js +60 -11
- package/dist/es/additionalTypes.ts +7 -1
- package/dist/es/common/ClearButton.d.ts +5 -6
- package/dist/es/common/ClearButton.js +7 -5
- package/dist/es/common/DropDownBase.d.ts +4 -5
- package/dist/es/common/DropDownBase.js +5 -2
- package/dist/es/common/List.d.ts +7 -4
- package/dist/es/common/List.js +21 -6
- package/dist/es/common/ListContainer.d.ts +5 -6
- package/dist/es/common/ListContainer.js +7 -4
- package/dist/es/common/ListDefaultItem.d.ts +5 -6
- package/dist/es/common/ListDefaultItem.js +7 -4
- package/dist/es/common/ListFilter.d.ts +8 -6
- package/dist/es/common/ListFilter.js +50 -7
- package/dist/es/common/ListItem.d.ts +5 -6
- package/dist/es/common/ListItem.js +17 -9
- package/dist/es/common/SearchBar.d.ts +6 -6
- package/dist/es/common/SearchBar.js +13 -13
- package/dist/es/common/VirtualScroll.js +6 -4
- package/dist/es/main.d.ts +5 -5
- package/dist/es/main.js +5 -5
- package/dist/es/package-metadata.js +1 -1
- package/dist/npm/AutoComplete/AutoComplete.d.ts +5 -6
- package/dist/npm/AutoComplete/AutoComplete.js +63 -29
- package/dist/npm/AutoComplete/AutoCompleteProps.d.ts +39 -0
- package/dist/npm/ComboBox/ComboBox.d.ts +5 -6
- package/dist/npm/ComboBox/ComboBox.js +104 -80
- package/dist/npm/ComboBox/ComboBoxProps.d.ts +39 -0
- package/dist/npm/DropDownList/DropDownList.d.ts +5 -6
- package/dist/npm/DropDownList/DropDownList.js +184 -153
- package/dist/npm/DropDownList/DropDownListProps.d.ts +43 -0
- package/dist/npm/MultiSelect/MultiSelect.d.ts +5 -6
- package/dist/npm/MultiSelect/MultiSelect.js +107 -78
- package/dist/npm/MultiSelect/MultiSelectProps.d.ts +53 -0
- package/dist/npm/MultiSelect/TagList.d.ts +8 -4
- package/dist/npm/MultiSelect/TagList.js +60 -10
- package/dist/npm/additionalTypes.ts +7 -1
- package/dist/npm/common/ClearButton.d.ts +5 -6
- package/dist/npm/common/ClearButton.js +9 -7
- package/dist/npm/common/DropDownBase.d.ts +4 -5
- package/dist/npm/common/DropDownBase.js +5 -2
- package/dist/npm/common/List.d.ts +7 -4
- package/dist/npm/common/List.js +21 -5
- package/dist/npm/common/ListContainer.d.ts +5 -6
- package/dist/npm/common/ListContainer.js +9 -6
- package/dist/npm/common/ListDefaultItem.d.ts +5 -6
- package/dist/npm/common/ListDefaultItem.js +9 -6
- package/dist/npm/common/ListFilter.d.ts +8 -6
- package/dist/npm/common/ListFilter.js +54 -9
- package/dist/npm/common/ListItem.d.ts +5 -6
- package/dist/npm/common/ListItem.js +18 -10
- package/dist/npm/common/SearchBar.d.ts +6 -6
- package/dist/npm/common/SearchBar.js +15 -15
- package/dist/npm/common/VirtualScroll.js +6 -4
- package/dist/npm/main.d.ts +5 -5
- package/dist/npm/main.js +5 -5
- package/dist/npm/package-metadata.js +1 -1
- package/package.json +5 -4
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
|
|
2
1
|
declare type DefaultData<V> = object | ((this: V) => AutoCompleteData);
|
|
3
2
|
declare type DefaultMethods<V> = {
|
|
4
3
|
[key: string]: (this: V, ...args: any[]) => any;
|
|
@@ -6,7 +5,7 @@ declare type DefaultMethods<V> = {
|
|
|
6
5
|
import { AutoCompleteProps } from './AutoCompleteProps';
|
|
7
6
|
import { DropDownStateBase, InternalState } from './../common/settings';
|
|
8
7
|
import { FormComponentValidity } from '@progress/kendo-vue-common';
|
|
9
|
-
import { DefineComponent } from '../additionalTypes';
|
|
8
|
+
import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
|
|
10
9
|
/**
|
|
11
10
|
* @hidden
|
|
12
11
|
*/
|
|
@@ -95,11 +94,11 @@ export interface AutoCompleteComputed {
|
|
|
95
94
|
/**
|
|
96
95
|
* @hidden
|
|
97
96
|
*/
|
|
98
|
-
export interface AutoCompleteAll extends AutoCompleteMethods, AutoCompleteState, AutoCompleteData, AutoCompleteComputed,
|
|
97
|
+
export interface AutoCompleteAll extends AutoCompleteMethods, AutoCompleteState, AutoCompleteData, AutoCompleteComputed, Vue2type {
|
|
99
98
|
}
|
|
100
99
|
/**
|
|
101
100
|
* Represents the default `AutoComplete` component.
|
|
102
101
|
*/
|
|
103
|
-
declare let
|
|
104
|
-
declare const
|
|
105
|
-
export { AutoComplete,
|
|
102
|
+
declare let AutoCompleteVue2: ComponentOptions<Vue2type, DefaultData<AutoCompleteData>, DefaultMethods<AutoCompleteAll>, AutoCompleteComputed, RecordPropsDefinition<AutoCompleteProps>>;
|
|
103
|
+
declare const AutoComplete: DefineComponent<AutoCompleteProps, any, AutoCompleteData, AutoCompleteComputed, AutoCompleteMethods, {}, {}, {}, string, AutoCompleteProps, AutoCompleteProps, {}>;
|
|
104
|
+
export { AutoComplete, AutoCompleteVue2 };
|
|
@@ -25,13 +25,15 @@ import { List } from './../common/List';
|
|
|
25
25
|
import DropDownBase from '../common/DropDownBase';
|
|
26
26
|
import { ClearButton } from '../common/ClearButton';
|
|
27
27
|
import { itemIndexStartsWith, getItemValue, areSame, getFocusedItem } from '../common/utils';
|
|
28
|
-
import { guid, Keys, classNames, templateRendering, getListeners, getTemplate } from '@progress/kendo-vue-common';
|
|
28
|
+
import { guid, Keys, classNames, templateRendering, getListeners, getTemplate, kendoThemeMaps } from '@progress/kendo-vue-common';
|
|
29
|
+
var sizeMap = kendoThemeMaps.sizeMap,
|
|
30
|
+
roundedMap = kendoThemeMaps.roundedMap;
|
|
29
31
|
var VALIDATION_MESSAGE = 'Please enter a valid value!';
|
|
30
32
|
/**
|
|
31
33
|
* Represents the default `AutoComplete` component.
|
|
32
34
|
*/
|
|
33
35
|
|
|
34
|
-
var
|
|
36
|
+
var AutoCompleteVue2 = {
|
|
35
37
|
name: 'KendoAutoComplete',
|
|
36
38
|
model: {
|
|
37
39
|
event: 'changemodel'
|
|
@@ -88,7 +90,6 @@ var AutoComplete = {
|
|
|
88
90
|
accessKey: String,
|
|
89
91
|
dataItems: Array,
|
|
90
92
|
textField: String,
|
|
91
|
-
className: String,
|
|
92
93
|
loading: Boolean,
|
|
93
94
|
popupSettings: {
|
|
94
95
|
type: Object,
|
|
@@ -109,7 +110,28 @@ var AutoComplete = {
|
|
|
109
110
|
default: false
|
|
110
111
|
},
|
|
111
112
|
ariaLabelledBy: String,
|
|
112
|
-
ariaDescribedBy: String
|
|
113
|
+
ariaDescribedBy: String,
|
|
114
|
+
rounded: {
|
|
115
|
+
type: String,
|
|
116
|
+
default: 'medium',
|
|
117
|
+
validator: function validator(value) {
|
|
118
|
+
return ['small', 'medium', 'large', 'full'].includes(value);
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
fillMode: {
|
|
122
|
+
type: String,
|
|
123
|
+
default: 'solid',
|
|
124
|
+
validator: function validator(value) {
|
|
125
|
+
return ['solid', 'flat', 'outline'].includes(value);
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
size: {
|
|
129
|
+
type: String,
|
|
130
|
+
default: 'medium',
|
|
131
|
+
validator: function validator(value) {
|
|
132
|
+
return ['small', 'medium', 'large'].includes(value);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
113
135
|
},
|
|
114
136
|
data: function data() {
|
|
115
137
|
return {
|
|
@@ -201,10 +223,10 @@ var AutoComplete = {
|
|
|
201
223
|
get: function get() {
|
|
202
224
|
var isValid = !this.hasMounted || !this.$props.validityStyles || this.validity().valid;
|
|
203
225
|
return {
|
|
204
|
-
'k-
|
|
205
|
-
'k-
|
|
226
|
+
'k-floating-label-container': true,
|
|
227
|
+
'k-focus': this.currentFocused,
|
|
206
228
|
'k-state-empty': !this.computedValue(),
|
|
207
|
-
'k-
|
|
229
|
+
'k-invalid': !isValid && isValid !== undefined,
|
|
208
230
|
'k-rtl': this.$props.dir === 'rtl'
|
|
209
231
|
};
|
|
210
232
|
}
|
|
@@ -463,17 +485,21 @@ var AutoComplete = {
|
|
|
463
485
|
}
|
|
464
486
|
},
|
|
465
487
|
render: function render(createElement) {
|
|
488
|
+
var _a;
|
|
489
|
+
|
|
466
490
|
var _this = this;
|
|
467
491
|
|
|
468
492
|
var h = gh || createElement;
|
|
469
|
-
var
|
|
470
|
-
dir =
|
|
471
|
-
disabled =
|
|
472
|
-
label =
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
493
|
+
var _b = this.$props,
|
|
494
|
+
dir = _b.dir,
|
|
495
|
+
disabled = _b.disabled,
|
|
496
|
+
label = _b.label,
|
|
497
|
+
size = _b.size,
|
|
498
|
+
rounded = _b.rounded,
|
|
499
|
+
fillMode = _b.fillMode,
|
|
500
|
+
style = _b.style,
|
|
501
|
+
loading = _b.loading,
|
|
502
|
+
suggest = _b.suggest;
|
|
477
503
|
var isValid = !this.$props.validityStyles || this.validity().valid;
|
|
478
504
|
var focused = this.currentFocused;
|
|
479
505
|
var base = this.base;
|
|
@@ -574,7 +600,7 @@ var AutoComplete = {
|
|
|
574
600
|
wrapperStyle: {
|
|
575
601
|
maxHeight: popupSettings.height
|
|
576
602
|
},
|
|
577
|
-
wrapperCssClass: "k-list-
|
|
603
|
+
wrapperCssClass: "k-list-content",
|
|
578
604
|
itemRender: itemRender,
|
|
579
605
|
noDataRender: listNoDataRender
|
|
580
606
|
},
|
|
@@ -590,7 +616,7 @@ var AutoComplete = {
|
|
|
590
616
|
wrapperStyle: {
|
|
591
617
|
maxHeight: popupSettings.height
|
|
592
618
|
},
|
|
593
|
-
wrapperCssClass: "k-list-
|
|
619
|
+
wrapperCssClass: "k-list-content",
|
|
594
620
|
onListclick: this.handleItemClick,
|
|
595
621
|
on: this.v3 ? undefined : {
|
|
596
622
|
"listclick": this.handleItemClick
|
|
@@ -604,6 +630,8 @@ var AutoComplete = {
|
|
|
604
630
|
var renderListContainer = function renderListContainer() {
|
|
605
631
|
var _this2 = this;
|
|
606
632
|
|
|
633
|
+
var _a;
|
|
634
|
+
|
|
607
635
|
var headerTemplate = templateRendering.call(this, this.$props.header, getListeners.call(this));
|
|
608
636
|
var footerTemplate = templateRendering.call(this, this.$props.footer, getListeners.call(this));
|
|
609
637
|
var header = getTemplate.call(this, {
|
|
@@ -633,7 +661,8 @@ var AutoComplete = {
|
|
|
633
661
|
animate: popupSettings.animate,
|
|
634
662
|
anchor: this.anchor,
|
|
635
663
|
show: opened,
|
|
636
|
-
|
|
664
|
+
popupClass: classNames(popupSettings.popupClass, 'k-list', (_a = {}, _a["k-list-" + (sizeMap[size] || size)] = size, _a)),
|
|
665
|
+
className: popupSettings.className,
|
|
637
666
|
appendTo: popupSettings.appendTo
|
|
638
667
|
},
|
|
639
668
|
dir: dir !== undefined ? dir : this.base.dirCalculated
|
|
@@ -643,13 +672,22 @@ var AutoComplete = {
|
|
|
643
672
|
animate: popupSettings.animate,
|
|
644
673
|
anchor: this.anchor,
|
|
645
674
|
show: opened,
|
|
646
|
-
|
|
675
|
+
popupClass: classNames(popupSettings.popupClass, 'k-list', (_a = {}, _a["k-list-" + (sizeMap[size] || size)] = size, _a)),
|
|
676
|
+
className: popupSettings.className,
|
|
647
677
|
appendTo: popupSettings.appendTo
|
|
648
678
|
},
|
|
649
679
|
dir: dir !== undefined ? dir : this.base.dirCalculated
|
|
650
680
|
}, this.v3 ? function () {
|
|
651
|
-
return [header
|
|
652
|
-
|
|
681
|
+
return [header && h("div", {
|
|
682
|
+
"class": "k-list-header"
|
|
683
|
+
}, [header]), renderList.call(_this2), footer && h("div", {
|
|
684
|
+
"class": "k-list-footer"
|
|
685
|
+
}, [footer])];
|
|
686
|
+
} : [header && h("div", {
|
|
687
|
+
"class": "k-list-header"
|
|
688
|
+
}, [header]), renderList.call(_this2), footer && h("div", {
|
|
689
|
+
"class": "k-list-footer"
|
|
690
|
+
}, [footer])])
|
|
653
691
|
);
|
|
654
692
|
};
|
|
655
693
|
|
|
@@ -679,11 +717,7 @@ var AutoComplete = {
|
|
|
679
717
|
};
|
|
680
718
|
|
|
681
719
|
var autoComplete = h("span", {
|
|
682
|
-
"class": classNames('k-
|
|
683
|
-
'k-state-disabled': disabled,
|
|
684
|
-
'k-state-focused': focused && !disabled,
|
|
685
|
-
'k-state-invalid': !isValid
|
|
686
|
-
}),
|
|
720
|
+
"class": classNames('k-autocomplete k-input', (_a = {}, _a["k-input-" + (sizeMap[size] || size)] = size, _a["k-rounded-" + (roundedMap[rounded] || rounded)] = rounded, _a["k-input-" + fillMode] = fillMode, _a['k-valid'] = isValid, _a['k-invalid'] = !isValid, _a['k-focus'] = focused && !disabled, _a['k-loading'] = loading, _a['k-required'] = this.required, _a['k-disabled'] = disabled, _a)),
|
|
687
721
|
ref: this.v3 ? function (el) {
|
|
688
722
|
_this.kendoAnchorRef = el;
|
|
689
723
|
} : this.anchor,
|
|
@@ -712,5 +746,5 @@ var AutoComplete = {
|
|
|
712
746
|
}, [this.$props.label]) : null]) : autoComplete;
|
|
713
747
|
}
|
|
714
748
|
};
|
|
715
|
-
var
|
|
716
|
-
export { AutoComplete,
|
|
749
|
+
var AutoComplete = AutoCompleteVue2;
|
|
750
|
+
export { AutoComplete, AutoCompleteVue2 };
|
|
@@ -165,4 +165,43 @@ export interface AutoCompleteProps extends FormComponentProps {
|
|
|
165
165
|
* Sets the footer component of the AutoComplete ([see example]({% slug customrendering_autocomplete %}#toc-headers-and-footers)).
|
|
166
166
|
*/
|
|
167
167
|
footer?: any;
|
|
168
|
+
/**
|
|
169
|
+
* Configures the `size` of the AutoComnplete.
|
|
170
|
+
*
|
|
171
|
+
* The available options are:
|
|
172
|
+
* - small
|
|
173
|
+
* - medium
|
|
174
|
+
* - large
|
|
175
|
+
* - null—Does not set a size `class`.
|
|
176
|
+
*
|
|
177
|
+
* @default `medium`
|
|
178
|
+
*/
|
|
179
|
+
size?: null | 'small' | 'medium' | 'large' | string;
|
|
180
|
+
/**
|
|
181
|
+
* Configures the `roundness` of the AutoComnplete.
|
|
182
|
+
*
|
|
183
|
+
* The available options are:
|
|
184
|
+
* - small
|
|
185
|
+
* - medium
|
|
186
|
+
* - large
|
|
187
|
+
* - circle
|
|
188
|
+
* - full
|
|
189
|
+
* - null—Does not set a rounded `class`.
|
|
190
|
+
*
|
|
191
|
+
* @default `medium`
|
|
192
|
+
*/
|
|
193
|
+
rounded?: null | 'small' | 'medium' | 'large' | 'full' | string;
|
|
194
|
+
/**
|
|
195
|
+
* Configures the `fillMode` of the AutoComnplete.
|
|
196
|
+
*
|
|
197
|
+
* The available options are:
|
|
198
|
+
* - solid
|
|
199
|
+
* - outline
|
|
200
|
+
* - flat
|
|
201
|
+
* - link
|
|
202
|
+
* - null—Does not set a fillMode `class`.
|
|
203
|
+
*
|
|
204
|
+
* @default `solid`
|
|
205
|
+
*/
|
|
206
|
+
fillMode?: null | 'solid' | 'outline' | 'flat' | string;
|
|
168
207
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
|
|
2
1
|
declare type DefaultData<V> = object | ((this: V) => ComboBoxData);
|
|
3
2
|
declare type DefaultMethods<V> = {
|
|
4
3
|
[key: string]: (this: V, ...args: any[]) => any;
|
|
@@ -6,7 +5,7 @@ declare type DefaultMethods<V> = {
|
|
|
6
5
|
import { ComboBoxProps } from './ComboBoxProps';
|
|
7
6
|
import { DropDownStateBase, InternalState } from './../common/settings';
|
|
8
7
|
import { FormComponentValidity } from '@progress/kendo-vue-common';
|
|
9
|
-
import { DefineComponent } from '../additionalTypes';
|
|
8
|
+
import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
|
|
10
9
|
/**
|
|
11
10
|
* @hidden
|
|
12
11
|
*/
|
|
@@ -88,11 +87,11 @@ export interface ComboBoxComputed {
|
|
|
88
87
|
/**
|
|
89
88
|
* @hidden
|
|
90
89
|
*/
|
|
91
|
-
export interface ComboBoxAll extends ComboBoxMethods, ComboBoxState, ComboBoxData, ComboBoxComputed,
|
|
90
|
+
export interface ComboBoxAll extends ComboBoxMethods, ComboBoxState, ComboBoxData, ComboBoxComputed, Vue2type {
|
|
92
91
|
}
|
|
93
92
|
/**
|
|
94
93
|
* Represents the default `ComboBox` component.
|
|
95
94
|
*/
|
|
96
|
-
declare let
|
|
97
|
-
declare const
|
|
98
|
-
export { ComboBox,
|
|
95
|
+
declare let ComboBoxVue2: ComponentOptions<Vue2type, DefaultData<ComboBoxData>, DefaultMethods<ComboBoxAll>, ComboBoxComputed, RecordPropsDefinition<ComboBoxProps>>;
|
|
96
|
+
declare const ComboBox: DefineComponent<ComboBoxProps, any, ComboBoxData, ComboBoxComputed, ComboBoxMethods, {}, {}, {}, string, ComboBoxProps, ComboBoxProps, {}>;
|
|
97
|
+
export { ComboBox, ComboBoxVue2 };
|
|
@@ -20,7 +20,10 @@ var allVue = Vue;
|
|
|
20
20
|
var gh = allVue.h;
|
|
21
21
|
var ref = allVue.ref;
|
|
22
22
|
import DropDownBase from '../common/DropDownBase';
|
|
23
|
-
import { guid, classNames, Keys, templateRendering, getListeners, getTemplate } from '@progress/kendo-vue-common';
|
|
23
|
+
import { guid, classNames, Keys, templateRendering, getListeners, getTemplate, kendoThemeMaps } from '@progress/kendo-vue-common';
|
|
24
|
+
import { Button as KButton } from '@progress/kendo-vue-buttons';
|
|
25
|
+
var sizeMap = kendoThemeMaps.sizeMap,
|
|
26
|
+
roundedMap = kendoThemeMaps.roundedMap;
|
|
24
27
|
import { areSame, itemIndexStartsWith, getItemIndexByText, getItemValue, isPresent, suggestValue as _suggestValue } from '../common/utils';
|
|
25
28
|
import { SearchBar } from '../common/SearchBar';
|
|
26
29
|
import { ListContainer } from '../common/ListContainer';
|
|
@@ -31,7 +34,7 @@ var VALIDATION_MESSAGE = 'Please enter a valid value!';
|
|
|
31
34
|
* Represents the default `ComboBox` component.
|
|
32
35
|
*/
|
|
33
36
|
|
|
34
|
-
var
|
|
37
|
+
var ComboBoxVue2 = {
|
|
35
38
|
name: 'KendoComboBox',
|
|
36
39
|
model: {
|
|
37
40
|
event: 'changemodel'
|
|
@@ -140,7 +143,28 @@ var ComboBox = {
|
|
|
140
143
|
default: true
|
|
141
144
|
},
|
|
142
145
|
ariaLabelledBy: String,
|
|
143
|
-
ariaDescribedBy: String
|
|
146
|
+
ariaDescribedBy: String,
|
|
147
|
+
rounded: {
|
|
148
|
+
type: String,
|
|
149
|
+
default: 'medium',
|
|
150
|
+
validator: function validator(value) {
|
|
151
|
+
return ['small', 'medium', 'large', 'full'].includes(value);
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
fillMode: {
|
|
155
|
+
type: String,
|
|
156
|
+
default: 'solid',
|
|
157
|
+
validator: function validator(value) {
|
|
158
|
+
return ['solid', 'flat', 'outline'].includes(value);
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
size: {
|
|
162
|
+
type: String,
|
|
163
|
+
default: 'medium',
|
|
164
|
+
validator: function validator(value) {
|
|
165
|
+
return ['small', 'medium', 'large'].includes(value);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
144
168
|
},
|
|
145
169
|
data: function data() {
|
|
146
170
|
return {
|
|
@@ -186,8 +210,8 @@ var ComboBox = {
|
|
|
186
210
|
this.hasMounted = true; // @ts-ignore
|
|
187
211
|
|
|
188
212
|
this.input = this.v3 ? this.inputRef.input : this.$refs.input.input;
|
|
189
|
-
this.base.wrapper = this.v3 ? this.
|
|
190
|
-
this.element = this.v3 ? this.
|
|
213
|
+
this.base.wrapper = this.v3 ? this.kendoAnchorRef : this.$refs[this.anchor];
|
|
214
|
+
this.element = this.v3 ? this.kendoAnchorRef : this.$refs[this.anchor];
|
|
191
215
|
this.base.didMount();
|
|
192
216
|
this.setValidity();
|
|
193
217
|
},
|
|
@@ -203,7 +227,6 @@ var ComboBox = {
|
|
|
203
227
|
var closing = prevOpened && !opened;
|
|
204
228
|
var list = this.$refs.list;
|
|
205
229
|
var scrollElement = this.$refs.scrollElement;
|
|
206
|
-
var scroller = this.$refs.scroller;
|
|
207
230
|
var selectedItem = this.computedValue();
|
|
208
231
|
this.valueOnDidUpdate = selectedItem;
|
|
209
232
|
|
|
@@ -218,8 +241,9 @@ var ComboBox = {
|
|
|
218
241
|
this.base.vs.scrollElement = scrollElement;
|
|
219
242
|
}
|
|
220
243
|
|
|
221
|
-
if (
|
|
222
|
-
|
|
244
|
+
if (list && dataItems.length) {
|
|
245
|
+
// @ts-ignore
|
|
246
|
+
this.base.vs.scrollerRef(list.$el);
|
|
223
247
|
} // @ts-ignore
|
|
224
248
|
|
|
225
249
|
|
|
@@ -290,10 +314,10 @@ var ComboBox = {
|
|
|
290
314
|
get: function get() {
|
|
291
315
|
var isValid = !this.hasMounted || !this.$props.validityStyles || this.validity().valid;
|
|
292
316
|
return {
|
|
293
|
-
'k-
|
|
294
|
-
'k-
|
|
317
|
+
'k-floating-label-container': true,
|
|
318
|
+
'k-focus': this.currentFocused,
|
|
295
319
|
'k-state-empty': !this.computedValue(),
|
|
296
|
-
'k-
|
|
320
|
+
'k-invalid': !isValid && isValid !== undefined,
|
|
297
321
|
'k-rtl': this.$props.dir === 'rtl'
|
|
298
322
|
};
|
|
299
323
|
}
|
|
@@ -681,20 +705,25 @@ var ComboBox = {
|
|
|
681
705
|
}
|
|
682
706
|
},
|
|
683
707
|
render: function render(createElement) {
|
|
708
|
+
var _a;
|
|
709
|
+
|
|
684
710
|
var _this = this;
|
|
685
711
|
|
|
686
712
|
var h = gh || createElement;
|
|
687
|
-
var
|
|
688
|
-
dir =
|
|
689
|
-
disabled =
|
|
690
|
-
clearButton =
|
|
691
|
-
label =
|
|
692
|
-
textField =
|
|
693
|
-
className =
|
|
694
|
-
style =
|
|
695
|
-
loading =
|
|
696
|
-
iconClassName =
|
|
697
|
-
virtual =
|
|
713
|
+
var _b = this.$props,
|
|
714
|
+
dir = _b.dir,
|
|
715
|
+
disabled = _b.disabled,
|
|
716
|
+
clearButton = _b.clearButton,
|
|
717
|
+
label = _b.label,
|
|
718
|
+
textField = _b.textField,
|
|
719
|
+
className = _b.className,
|
|
720
|
+
style = _b.style,
|
|
721
|
+
loading = _b.loading,
|
|
722
|
+
iconClassName = _b.iconClassName,
|
|
723
|
+
virtual = _b.virtual,
|
|
724
|
+
size = _b.size,
|
|
725
|
+
fillMode = _b.fillMode,
|
|
726
|
+
rounded = _b.rounded;
|
|
698
727
|
var focused = this.currentFocused;
|
|
699
728
|
var isValid = !this.$props.validityStyles || this.validity().valid;
|
|
700
729
|
var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
|
|
@@ -717,6 +746,8 @@ var ComboBox = {
|
|
|
717
746
|
}
|
|
718
747
|
|
|
719
748
|
var renderList = function renderList() {
|
|
749
|
+
var _this2 = this;
|
|
750
|
+
|
|
720
751
|
var _a = this.$props,
|
|
721
752
|
dataItemKey = _a.dataItemKey,
|
|
722
753
|
_b = _a.dataItems,
|
|
@@ -735,7 +766,7 @@ var ComboBox = {
|
|
|
735
766
|
var translate = "translateY(" + vs.translate + "px)";
|
|
736
767
|
var focusedIndex = opened ? this.getFocusedIndex() : undefined;
|
|
737
768
|
var value = isPresent(text) && text !== selectedItemText ? null : this.computedValue();
|
|
738
|
-
return (// @ts-ignore
|
|
769
|
+
return (// @ts-ignore function children
|
|
739
770
|
h(List, {
|
|
740
771
|
id: base.listBoxId,
|
|
741
772
|
attrs: this.v3 ? undefined : {
|
|
@@ -747,13 +778,10 @@ var ComboBox = {
|
|
|
747
778
|
textField: textField,
|
|
748
779
|
valueField: dataItemKey,
|
|
749
780
|
optionsGuid: base.guid,
|
|
750
|
-
wrapperStyle:
|
|
781
|
+
wrapperStyle: {
|
|
751
782
|
maxHeight: popupSettings.height
|
|
752
|
-
} : {
|
|
753
|
-
float: 'left',
|
|
754
|
-
width: '100%'
|
|
755
783
|
},
|
|
756
|
-
wrapperCssClass:
|
|
784
|
+
wrapperCssClass: 'k-list-content',
|
|
757
785
|
listStyle: vs.enabled ? {
|
|
758
786
|
transform: translate
|
|
759
787
|
} : undefined,
|
|
@@ -769,13 +797,10 @@ var ComboBox = {
|
|
|
769
797
|
valueField: dataItemKey,
|
|
770
798
|
optionsGuid: base.guid,
|
|
771
799
|
ref: 'list',
|
|
772
|
-
wrapperStyle:
|
|
800
|
+
wrapperStyle: {
|
|
773
801
|
maxHeight: popupSettings.height
|
|
774
|
-
} : {
|
|
775
|
-
float: 'left',
|
|
776
|
-
width: '100%'
|
|
777
802
|
},
|
|
778
|
-
wrapperCssClass:
|
|
803
|
+
wrapperCssClass: 'k-list-content',
|
|
779
804
|
listStyle: vs.enabled ? {
|
|
780
805
|
transform: translate
|
|
781
806
|
} : undefined,
|
|
@@ -783,27 +808,16 @@ var ComboBox = {
|
|
|
783
808
|
skip: skip,
|
|
784
809
|
onListclick: this.handleItemClick,
|
|
785
810
|
on: this.v3 ? undefined : {
|
|
786
|
-
"listclick": this.handleItemClick
|
|
811
|
+
"listclick": this.handleItemClick,
|
|
812
|
+
"scroll": vs.scrollHandler
|
|
787
813
|
},
|
|
788
814
|
itemRender: itemRender,
|
|
789
|
-
noDataRender: listNoDataRender
|
|
790
|
-
|
|
815
|
+
noDataRender: listNoDataRender,
|
|
816
|
+
onScroll: vs.scrollHandler
|
|
817
|
+
}, this.v3 ? function () {
|
|
818
|
+
return [renderScrollElement.call(_this2)];
|
|
819
|
+
} : [renderScrollElement.call(_this2)])
|
|
791
820
|
);
|
|
792
|
-
}; // Common rendering
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
var renderScrollWrapper = function renderScrollWrapper(children) {
|
|
796
|
-
return vs.enabled ? h("div", {
|
|
797
|
-
onScroll: vs.scrollHandler,
|
|
798
|
-
on: this.v3 ? undefined : {
|
|
799
|
-
"scroll": vs.scrollHandler
|
|
800
|
-
},
|
|
801
|
-
ref: 'scroller',
|
|
802
|
-
style: {
|
|
803
|
-
height: popupSettings.height,
|
|
804
|
-
overflowY: 'scroll'
|
|
805
|
-
}
|
|
806
|
-
}, [children]) : children;
|
|
807
821
|
};
|
|
808
822
|
|
|
809
823
|
var renderScrollElement = function renderScrollElement() {
|
|
@@ -814,7 +828,9 @@ var ComboBox = {
|
|
|
814
828
|
};
|
|
815
829
|
|
|
816
830
|
var renderListContainer = function renderListContainer() {
|
|
817
|
-
var
|
|
831
|
+
var _this3 = this;
|
|
832
|
+
|
|
833
|
+
var _a;
|
|
818
834
|
|
|
819
835
|
var headerTemplate = templateRendering.call(this, this.$props.header, getListeners.call(this));
|
|
820
836
|
var footerTemplate = templateRendering.call(this, this.$props.footer, getListeners.call(this));
|
|
@@ -845,7 +861,8 @@ var ComboBox = {
|
|
|
845
861
|
animate: popupSettings.animate,
|
|
846
862
|
anchor: this.anchor,
|
|
847
863
|
show: opened,
|
|
848
|
-
|
|
864
|
+
popupClass: classNames(popupSettings.popupClass, 'k-list', (_a = {}, _a["k-list-" + (sizeMap[size] || size)] = size, _a['k-virtual-list'] = this.base.vs.enabled, _a)),
|
|
865
|
+
className: popupSettings.className,
|
|
849
866
|
appendTo: popupSettings.appendTo
|
|
850
867
|
},
|
|
851
868
|
dir: dir !== undefined ? dir : this.base.dirCalculated
|
|
@@ -854,13 +871,22 @@ var ComboBox = {
|
|
|
854
871
|
animate: popupSettings.animate,
|
|
855
872
|
anchor: this.anchor,
|
|
856
873
|
show: opened,
|
|
857
|
-
|
|
874
|
+
popupClass: classNames(popupSettings.popupClass, 'k-list', (_a = {}, _a["k-list-" + (sizeMap[size] || size)] = size, _a['k-virtual-list'] = this.base.vs.enabled, _a)),
|
|
875
|
+
className: popupSettings.className,
|
|
858
876
|
appendTo: popupSettings.appendTo
|
|
859
877
|
},
|
|
860
878
|
dir: dir !== undefined ? dir : this.base.dirCalculated
|
|
861
879
|
}, this.v3 ? function () {
|
|
862
|
-
return [header
|
|
863
|
-
|
|
880
|
+
return [header && h("div", {
|
|
881
|
+
"class": "k-list-header"
|
|
882
|
+
}, [header]), renderList.call(_this3), footer && h("div", {
|
|
883
|
+
"class": "k-list-footer"
|
|
884
|
+
}, [footer])];
|
|
885
|
+
} : [header && h("div", {
|
|
886
|
+
"class": "k-list-header"
|
|
887
|
+
}, [header]), renderList.call(_this3), footer && h("div", {
|
|
888
|
+
"class": "k-list-footer"
|
|
889
|
+
}, [footer])])
|
|
864
890
|
);
|
|
865
891
|
};
|
|
866
892
|
|
|
@@ -936,10 +962,7 @@ var ComboBox = {
|
|
|
936
962
|
};
|
|
937
963
|
|
|
938
964
|
var combobox = h("span", {
|
|
939
|
-
"class": classNames('k-
|
|
940
|
-
'k-combobox-clearable': clearButton,
|
|
941
|
-
'k-state-invalid': !isValid
|
|
942
|
-
}, className),
|
|
965
|
+
"class": classNames('k-combobox k-input', (_a = {}, _a["k-input-" + (sizeMap[size] || size)] = size, _a["k-rounded-" + (roundedMap[rounded] || rounded)] = rounded, _a["k-input-" + fillMode] = fillMode, _a['k-valid'] = isValid, _a['k-invalid'] = !isValid, _a['k-loading'] = loading, _a['k-required'] = this.required, _a['k-disabled'] = disabled, _a['k-focus'] = focused && !disabled, _a), className),
|
|
943
966
|
ref: this.v3 ? function (el) {
|
|
944
967
|
_this.kendoAnchorRef = el;
|
|
945
968
|
} : this.anchor,
|
|
@@ -950,23 +973,27 @@ var ComboBox = {
|
|
|
950
973
|
attrs: this.v3 ? undefined : {
|
|
951
974
|
dir: dir
|
|
952
975
|
}
|
|
953
|
-
}, [
|
|
954
|
-
ref: this.v3 ? function (el) {
|
|
955
|
-
_this.baseWrapperRef = el;
|
|
956
|
-
} : 'baseWrapper',
|
|
957
|
-
"class": classNames('k-dropdown-wrap', {
|
|
958
|
-
'k-state-disabled': disabled,
|
|
959
|
-
'k-state-focused': focused && !disabled
|
|
960
|
-
})
|
|
961
|
-
}, [renderSearchBar.call(this, inputText || '', id), renderClearButton && // @ts-ignore function children
|
|
976
|
+
}, [renderSearchBar.call(this, inputText || '', id), renderClearButton && !loading && // @ts-ignore function children
|
|
962
977
|
h(ClearButton, {
|
|
963
978
|
onClearclick: this.clearButtonClick,
|
|
964
979
|
on: this.v3 ? undefined : {
|
|
965
980
|
"clearclick": this.clearButtonClick
|
|
966
981
|
},
|
|
967
982
|
key: "clearbutton"
|
|
968
|
-
}), h("span", {
|
|
969
|
-
"class": "k-
|
|
983
|
+
}), loading && h("span", {
|
|
984
|
+
"class": "k-icon k-i-loading",
|
|
985
|
+
key: "loading"
|
|
986
|
+
}), // @ts-ignore
|
|
987
|
+
h(KButton, {
|
|
988
|
+
size: size,
|
|
989
|
+
attrs: this.v3 ? undefined : {
|
|
990
|
+
size: size,
|
|
991
|
+
fillMode: fillMode,
|
|
992
|
+
iconClass: classNames('k-icon k-i-arrow-s', iconClassName)
|
|
993
|
+
},
|
|
994
|
+
fillMode: fillMode,
|
|
995
|
+
"class": 'k-input-button',
|
|
996
|
+
iconClass: classNames('k-icon k-i-arrow-s', iconClassName),
|
|
970
997
|
onClick: this.toggleBtnClick,
|
|
971
998
|
on: this.v3 ? undefined : {
|
|
972
999
|
"click": this.toggleBtnClick,
|
|
@@ -977,12 +1004,7 @@ var ComboBox = {
|
|
|
977
1004
|
onMousedown: function mousedown(e) {
|
|
978
1005
|
return e.preventDefault();
|
|
979
1006
|
}
|
|
980
|
-
},
|
|
981
|
-
"class": classNames('k-icon', iconClassName, {
|
|
982
|
-
'k-i-arrow-s': !loading && !iconClassName,
|
|
983
|
-
'k-i-loading': loading && !iconClassName
|
|
984
|
-
})
|
|
985
|
-
})])]), renderListContainer.call(this)]);
|
|
1007
|
+
}), renderListContainer.call(this)]);
|
|
986
1008
|
return label ? h("span", {
|
|
987
1009
|
"class": this.spanClassNames,
|
|
988
1010
|
onFocusin: this.handleFocus,
|
|
@@ -1004,5 +1026,5 @@ var ComboBox = {
|
|
|
1004
1026
|
}, [this.$props.label]) : null]) : combobox;
|
|
1005
1027
|
}
|
|
1006
1028
|
};
|
|
1007
|
-
var
|
|
1008
|
-
export { ComboBox,
|
|
1029
|
+
var ComboBox = ComboBoxVue2;
|
|
1030
|
+
export { ComboBox, ComboBoxVue2 };
|
|
@@ -195,4 +195,43 @@ export interface ComboBoxProps extends FormComponentProps {
|
|
|
195
195
|
* Sets the footer component of the ComboBox ([see example]({% slug customrendering_combobox %}#toc-headers-and-footers)).
|
|
196
196
|
*/
|
|
197
197
|
footer?: any;
|
|
198
|
+
/**
|
|
199
|
+
* Configures the `size` of the ComboBox.
|
|
200
|
+
*
|
|
201
|
+
* The available options are:
|
|
202
|
+
* - small
|
|
203
|
+
* - medium
|
|
204
|
+
* - large
|
|
205
|
+
* - null—Does not set a size `class`.
|
|
206
|
+
*
|
|
207
|
+
* @default `medium`
|
|
208
|
+
*/
|
|
209
|
+
size?: null | 'small' | 'medium' | 'large' | string;
|
|
210
|
+
/**
|
|
211
|
+
* Configures the `roundness` of the ComboBox.
|
|
212
|
+
*
|
|
213
|
+
* The available options are:
|
|
214
|
+
* - small
|
|
215
|
+
* - medium
|
|
216
|
+
* - large
|
|
217
|
+
* - circle
|
|
218
|
+
* - full
|
|
219
|
+
* - null—Does not set a rounded `class`.
|
|
220
|
+
*
|
|
221
|
+
* @default `medium`
|
|
222
|
+
*/
|
|
223
|
+
rounded?: null | 'small' | 'medium' | 'large' | 'full' | string;
|
|
224
|
+
/**
|
|
225
|
+
* Configures the `fillMode` of the ComboBox.
|
|
226
|
+
*
|
|
227
|
+
* The available options are:
|
|
228
|
+
* - solid
|
|
229
|
+
* - outline
|
|
230
|
+
* - flat
|
|
231
|
+
* - link
|
|
232
|
+
* - null—Does not set a fillMode `class`.
|
|
233
|
+
*
|
|
234
|
+
* @default `solid`
|
|
235
|
+
*/
|
|
236
|
+
fillMode?: null | 'solid' | 'outline' | 'flat' | string;
|
|
198
237
|
}
|