@progress/kendo-vue-dropdowns 3.14.2 → 3.15.0-dev.202309281301
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/ComboBox/ComboBox.js +244 -42
- package/dist/es/ComboBox/ComboBoxProps.d.ts +8 -0
- package/dist/es/DropDownList/DropDownList.d.ts +3 -0
- package/dist/es/DropDownList/DropDownList.js +197 -43
- package/dist/es/DropDownList/DropDownListProps.d.ts +8 -0
- package/dist/es/DropDownTree/DropDownTree.js +257 -105
- package/dist/es/DropDownTree/DropDownTreeProps.d.ts +8 -0
- package/dist/es/MultiSelect/MultiSelect.js +340 -65
- package/dist/es/MultiSelect/MultiSelectProps.d.ts +8 -0
- package/dist/es/MultiSelectTree/MultiSelectTree.js +345 -127
- package/dist/es/MultiSelectTree/MultiSelectTreeProps.d.ts +8 -0
- package/dist/es/common/DropDownBase.d.ts +7 -0
- package/dist/es/common/DropDownBase.js +13 -1
- package/dist/es/common/ListFilter.d.ts +1 -0
- package/dist/es/common/ListFilter.js +31 -25
- package/dist/es/common/constants.d.ts +4 -0
- package/dist/es/common/constants.js +4 -0
- package/dist/es/messages/main.d.ts +10 -0
- package/dist/es/messages/main.js +10 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/esm/ComboBox/ComboBox.js +244 -42
- package/dist/esm/ComboBox/ComboBoxProps.d.ts +8 -0
- package/dist/esm/DropDownList/DropDownList.d.ts +3 -0
- package/dist/esm/DropDownList/DropDownList.js +197 -43
- package/dist/esm/DropDownList/DropDownListProps.d.ts +8 -0
- package/dist/esm/DropDownTree/DropDownTree.js +257 -105
- package/dist/esm/DropDownTree/DropDownTreeProps.d.ts +8 -0
- package/dist/esm/MultiSelect/MultiSelect.js +340 -65
- package/dist/esm/MultiSelect/MultiSelectProps.d.ts +8 -0
- package/dist/esm/MultiSelectTree/MultiSelectTree.js +345 -127
- package/dist/esm/MultiSelectTree/MultiSelectTreeProps.d.ts +8 -0
- package/dist/esm/common/DropDownBase.d.ts +7 -0
- package/dist/esm/common/DropDownBase.js +13 -1
- package/dist/esm/common/ListFilter.d.ts +1 -0
- package/dist/esm/common/ListFilter.js +31 -25
- package/dist/esm/common/constants.d.ts +4 -0
- package/dist/esm/common/constants.js +4 -0
- package/dist/esm/messages/main.d.ts +10 -0
- package/dist/esm/messages/main.js +10 -0
- package/dist/esm/package-metadata.js +1 -1
- package/dist/npm/ComboBox/ComboBox.js +242 -40
- package/dist/npm/ComboBox/ComboBoxProps.d.ts +8 -0
- package/dist/npm/DropDownList/DropDownList.d.ts +3 -0
- package/dist/npm/DropDownList/DropDownList.js +195 -41
- package/dist/npm/DropDownList/DropDownListProps.d.ts +8 -0
- package/dist/npm/DropDownTree/DropDownTree.js +254 -102
- package/dist/npm/DropDownTree/DropDownTreeProps.d.ts +8 -0
- package/dist/npm/MultiSelect/MultiSelect.js +338 -63
- package/dist/npm/MultiSelect/MultiSelectProps.d.ts +8 -0
- package/dist/npm/MultiSelectTree/MultiSelectTree.js +343 -125
- package/dist/npm/MultiSelectTree/MultiSelectTreeProps.d.ts +8 -0
- package/dist/npm/common/DropDownBase.d.ts +7 -0
- package/dist/npm/common/DropDownBase.js +12 -0
- package/dist/npm/common/ListFilter.d.ts +1 -0
- package/dist/npm/common/ListFilter.js +31 -25
- package/dist/npm/common/constants.d.ts +4 -0
- package/dist/npm/common/constants.js +10 -0
- package/dist/npm/messages/main.d.ts +10 -0
- package/dist/npm/messages/main.js +11 -1
- package/dist/npm/package-metadata.js +1 -1
- package/package.json +12 -9
|
@@ -16,7 +16,7 @@ var allVue = Vue;
|
|
|
16
16
|
var gh = allVue.h;
|
|
17
17
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
18
18
|
var ref = allVue.ref;
|
|
19
|
-
import { templateRendering, getListeners, classNames, Keys, guid, noop, getTemplate, kendoThemeMaps, getTabIndex, setRef, getRef, Icon } from '@progress/kendo-vue-common';
|
|
19
|
+
import { templateRendering, getListeners, classNames, Keys, guid, noop, getTemplate, kendoThemeMaps, getTabIndex, setRef, getRef, Icon, canUseDOM } from '@progress/kendo-vue-common';
|
|
20
20
|
import { Button as KButton } from '@progress/kendo-vue-buttons';
|
|
21
21
|
var sizeMap = kendoThemeMaps.sizeMap,
|
|
22
22
|
roundedMap = kendoThemeMaps.roundedMap;
|
|
@@ -28,8 +28,10 @@ import DropDownBase from '../common/DropDownBase';
|
|
|
28
28
|
import { GroupStickyHeader } from '../common/GroupStickyHeader';
|
|
29
29
|
import { selectButton, messages } from '../messages/main';
|
|
30
30
|
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
31
|
+
import { MOBILE_SMALL_DEVICE, MOBILE_MEDIUM_DEVICE } from '../common/constants';
|
|
32
|
+
import { ActionSheet } from '@progress/kendo-vue-layout';
|
|
31
33
|
import { isPresent, getItemValue, sameCharsOnly, shuffleData, matchText, areSame, preventDefaultNonInputs, getFocusedItem } from '../common/utils';
|
|
32
|
-
import { caretAltDownIcon } from '@progress/kendo-svg-icons';
|
|
34
|
+
import { caretAltDownIcon, xIcon } from '@progress/kendo-svg-icons';
|
|
33
35
|
var VALIDATION_MESSAGE = 'Please select a value from the list!';
|
|
34
36
|
/**
|
|
35
37
|
* @hidden
|
|
@@ -169,6 +171,14 @@ var DropDownListVue2 = {
|
|
|
169
171
|
},
|
|
170
172
|
groupField: {
|
|
171
173
|
type: String
|
|
174
|
+
},
|
|
175
|
+
adaptive: {
|
|
176
|
+
type: Boolean,
|
|
177
|
+
default: undefined
|
|
178
|
+
},
|
|
179
|
+
adaptiveTitle: {
|
|
180
|
+
type: String,
|
|
181
|
+
default: undefined
|
|
172
182
|
}
|
|
173
183
|
},
|
|
174
184
|
inject: {
|
|
@@ -192,7 +202,9 @@ var DropDownListVue2 = {
|
|
|
192
202
|
_navigated: false,
|
|
193
203
|
group: undefined,
|
|
194
204
|
isScrolling: false,
|
|
195
|
-
itemHeight: 0
|
|
205
|
+
itemHeight: 0,
|
|
206
|
+
state: undefined,
|
|
207
|
+
windowWidth: 0
|
|
196
208
|
};
|
|
197
209
|
},
|
|
198
210
|
watch: {
|
|
@@ -209,9 +221,17 @@ var DropDownListVue2 = {
|
|
|
209
221
|
this.virtualTotalHasChanged = true;
|
|
210
222
|
}
|
|
211
223
|
this.virtualHasChanged = true;
|
|
224
|
+
},
|
|
225
|
+
isOpen: function isOpen() {
|
|
226
|
+
var _this = this;
|
|
227
|
+
setTimeout(function () {
|
|
228
|
+
var listItem = document.querySelector('.k-list-item');
|
|
229
|
+
_this.itemHeight = _this.base.getListItemHeight(listItem);
|
|
230
|
+
}, 100);
|
|
212
231
|
}
|
|
213
232
|
},
|
|
214
233
|
created: function created() {
|
|
234
|
+
this.observer = null;
|
|
215
235
|
this.valueDuringOnChange = undefined;
|
|
216
236
|
this.currentText = undefined;
|
|
217
237
|
this.currentValue = undefined;
|
|
@@ -236,12 +256,21 @@ var DropDownListVue2 = {
|
|
|
236
256
|
};
|
|
237
257
|
},
|
|
238
258
|
mounted: function mounted() {
|
|
259
|
+
this.observer = canUseDOM && new ResizeObserver(this.calculateMedia);
|
|
260
|
+
if ((document === null || document === void 0 ? void 0 : document.body) && this.observer) {
|
|
261
|
+
this.observer.observe(document.body);
|
|
262
|
+
}
|
|
239
263
|
this.hasMounted = true;
|
|
240
264
|
this.select = getRef(this, 'select');
|
|
241
265
|
this.base.wrapper = getRef(this, 'kendoAnchor', this.anchor);
|
|
242
266
|
this.base.didMount();
|
|
243
267
|
this.setValidity();
|
|
244
268
|
},
|
|
269
|
+
destroyed: !!isV3 ? undefined : function () {
|
|
270
|
+
if (this.observer) {
|
|
271
|
+
this.observer.disconnect();
|
|
272
|
+
}
|
|
273
|
+
},
|
|
245
274
|
updated: function updated() {
|
|
246
275
|
var _a;
|
|
247
276
|
var _b = this.$props,
|
|
@@ -251,7 +280,7 @@ var DropDownListVue2 = {
|
|
|
251
280
|
virtual = _b.virtual,
|
|
252
281
|
groupField = _b.groupField,
|
|
253
282
|
textField = _b.textField;
|
|
254
|
-
var opened = this
|
|
283
|
+
var opened = this.isOpen;
|
|
255
284
|
var prevOpened = this.prevOpened !== undefined ? this.prevOpened : this.prevCurrentOpened;
|
|
256
285
|
var opening = !prevOpened && opened;
|
|
257
286
|
var closing = prevOpened && !opened;
|
|
@@ -353,6 +382,30 @@ var DropDownListVue2 = {
|
|
|
353
382
|
get: function get() {
|
|
354
383
|
return "value-".concat(this.base.guid).concat(this.$props.ariaDescribedBy ? ' ' + this.$props.ariaDescribedBy : '');
|
|
355
384
|
}
|
|
385
|
+
},
|
|
386
|
+
isOpen: {
|
|
387
|
+
get: function get() {
|
|
388
|
+
return this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
animationStyles: {
|
|
392
|
+
get: function get() {
|
|
393
|
+
return this.windowWidth <= MOBILE_SMALL_DEVICE ? {
|
|
394
|
+
top: 0,
|
|
395
|
+
width: '100%',
|
|
396
|
+
height: '100%'
|
|
397
|
+
} : undefined;
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
classNameAdaptive: {
|
|
401
|
+
get: function get() {
|
|
402
|
+
return this.windowWidth <= MOBILE_SMALL_DEVICE ? 'k-adaptive-actionsheet k-actionsheet-fullscreen' : 'k-adaptive-actionsheet k-actionsheet-bottom';
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
adaptiveState: {
|
|
406
|
+
get: function get() {
|
|
407
|
+
return this.windowWidth <= MOBILE_MEDIUM_DEVICE && this.$props.adaptive;
|
|
408
|
+
}
|
|
356
409
|
}
|
|
357
410
|
},
|
|
358
411
|
methods: {
|
|
@@ -522,7 +575,7 @@ var DropDownListVue2 = {
|
|
|
522
575
|
total: 0,
|
|
523
576
|
pageSize: 0
|
|
524
577
|
} : _c;
|
|
525
|
-
var opened = this
|
|
578
|
+
var opened = this.isOpen;
|
|
526
579
|
var keyCode = event.keyCode;
|
|
527
580
|
var homeOrEndKeys = keyCode === Keys.home || keyCode === Keys.end;
|
|
528
581
|
var upOrDownKeys = keyCode === Keys.up || keyCode === Keys.down;
|
|
@@ -558,6 +611,10 @@ var DropDownListVue2 = {
|
|
|
558
611
|
this.base.togglePopup(state);
|
|
559
612
|
event.preventDefault();
|
|
560
613
|
} else if (shouldOpen || shouldClose) {
|
|
614
|
+
if (this.adaptiveState) {
|
|
615
|
+
this.handleWrapperClick(event); // Handle the closing on "Esc" key press in adaptive mode
|
|
616
|
+
}
|
|
617
|
+
|
|
561
618
|
this.base.togglePopup(state);
|
|
562
619
|
event.preventDefault();
|
|
563
620
|
} else if (shouldNavigate) {
|
|
@@ -580,14 +637,14 @@ var DropDownListVue2 = {
|
|
|
580
637
|
if (this._skipFocusEvent || !this.currentFocused) {
|
|
581
638
|
return;
|
|
582
639
|
}
|
|
583
|
-
var opened = this
|
|
640
|
+
var opened = this.isOpen;
|
|
584
641
|
var state = this.base.initState();
|
|
585
642
|
state.event = event;
|
|
586
643
|
state.data.currentFocused = false;
|
|
587
644
|
state.events.push({
|
|
588
645
|
type: 'blur'
|
|
589
646
|
});
|
|
590
|
-
if (opened) {
|
|
647
|
+
if (opened && !this.adaptiveState) {
|
|
591
648
|
this.base.togglePopup(state);
|
|
592
649
|
}
|
|
593
650
|
this.applyState(state);
|
|
@@ -705,6 +762,12 @@ var DropDownListVue2 = {
|
|
|
705
762
|
this.base.applyState(state);
|
|
706
763
|
this.valueDuringOnChange = undefined;
|
|
707
764
|
},
|
|
765
|
+
calculateMedia: function calculateMedia(entries) {
|
|
766
|
+
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
|
|
767
|
+
var entry = entries_1[_i];
|
|
768
|
+
this.windowWidth = entry.target.clientWidth;
|
|
769
|
+
}
|
|
770
|
+
},
|
|
708
771
|
repositionPopup: function repositionPopup() {
|
|
709
772
|
this.base.repositionPopup();
|
|
710
773
|
},
|
|
@@ -718,6 +781,7 @@ var DropDownListVue2 = {
|
|
|
718
781
|
var groupField = this.$props.groupField;
|
|
719
782
|
var _b = this.$props.dataItems,
|
|
720
783
|
dataItems = _b === void 0 ? [] : _b;
|
|
784
|
+
var group;
|
|
721
785
|
if (!groupField || !dataItems.length) {
|
|
722
786
|
return;
|
|
723
787
|
}
|
|
@@ -726,8 +790,8 @@ var DropDownListVue2 = {
|
|
|
726
790
|
var scrollTop = target.scrollTop - vs.skip * itemHeight;
|
|
727
791
|
if (groupField) {
|
|
728
792
|
dataItems = this.base.getGroupedDataModernMode(dataItems, groupField);
|
|
793
|
+
group = dataItems[0][groupField];
|
|
729
794
|
}
|
|
730
|
-
var group = dataItems[0][groupField];
|
|
731
795
|
for (var i = 1; i < dataItems.length; i++) {
|
|
732
796
|
if (itemHeight * i > scrollTop) {
|
|
733
797
|
break;
|
|
@@ -744,6 +808,7 @@ var DropDownListVue2 = {
|
|
|
744
808
|
},
|
|
745
809
|
render: function render(createElement) {
|
|
746
810
|
var _a;
|
|
811
|
+
var _this = this;
|
|
747
812
|
var h = gh || createElement;
|
|
748
813
|
var _b = this.$props,
|
|
749
814
|
style = _b.style,
|
|
@@ -756,8 +821,21 @@ var DropDownListVue2 = {
|
|
|
756
821
|
} : _c,
|
|
757
822
|
size = _b.size,
|
|
758
823
|
rounded = _b.rounded,
|
|
759
|
-
fillMode = _b.fillMode
|
|
760
|
-
|
|
824
|
+
fillMode = _b.fillMode,
|
|
825
|
+
dataItemKey = _b.dataItemKey,
|
|
826
|
+
_d = _b.dataItems,
|
|
827
|
+
dataItems = _d === void 0 ? [] : _d,
|
|
828
|
+
disabled = _b.disabled,
|
|
829
|
+
tabIndex = _b.tabIndex,
|
|
830
|
+
loading = _b.loading,
|
|
831
|
+
icon = _b.icon,
|
|
832
|
+
svgIcon = _b.svgIcon,
|
|
833
|
+
iconClassName = _b.iconClassName,
|
|
834
|
+
adaptiveTitle = _b.adaptiveTitle,
|
|
835
|
+
header = _b.header,
|
|
836
|
+
footer = _b.footer,
|
|
837
|
+
groupStickyHeaderItemRender = _b.groupStickyHeaderItemRender;
|
|
838
|
+
var opened = this.isOpen;
|
|
761
839
|
var text = getItemValue(this.computedValue(), this.$props.textField);
|
|
762
840
|
var isValid = !this.$props.validityStyles || this.validity().valid;
|
|
763
841
|
var base = this.base;
|
|
@@ -769,16 +847,10 @@ var DropDownListVue2 = {
|
|
|
769
847
|
height: '200px'
|
|
770
848
|
}, this.$props.popupSettings);
|
|
771
849
|
var ariaLabelSelectButton = provideLocalizationService(this).toLanguageString(selectButton, messages[selectButton]);
|
|
772
|
-
var
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
disabled = _d.disabled,
|
|
777
|
-
tabIndex = _d.tabIndex,
|
|
778
|
-
loading = _d.loading,
|
|
779
|
-
icon = _d.icon,
|
|
780
|
-
svgIcon = _d.svgIcon,
|
|
781
|
-
iconClassName = _d.iconClassName;
|
|
850
|
+
var renderAdaptive = this.adaptiveState;
|
|
851
|
+
if (this.group === undefined && this.$props.groupField !== undefined) {
|
|
852
|
+
this.group = getItemValue(this.$props.dataItems[0], this.$props.groupField);
|
|
853
|
+
}
|
|
782
854
|
var valueRender = templateRendering.call(this, this.$props.valueRender, getListeners.call(this));
|
|
783
855
|
var focused = this.currentFocused;
|
|
784
856
|
var value = this.primitiveValue();
|
|
@@ -833,6 +905,95 @@ var DropDownListVue2 = {
|
|
|
833
905
|
}
|
|
834
906
|
})]);
|
|
835
907
|
};
|
|
908
|
+
var adaptiveActionSheetHeaderTemplateDef = function adaptiveActionSheetHeaderTemplateDef() {
|
|
909
|
+
return [h("div", {
|
|
910
|
+
"class": "k-actionsheet-titlebar-group k-hbox"
|
|
911
|
+
}, [h("div", {
|
|
912
|
+
"class": "k-actionsheet-title"
|
|
913
|
+
}, [h("div", {
|
|
914
|
+
"class": "k-text-center"
|
|
915
|
+
}, [adaptiveTitle]), h("div", {
|
|
916
|
+
"class": "k-actionsheet-subtitle k-text-center"
|
|
917
|
+
})]), h("div", {
|
|
918
|
+
"class": "k-actionsheet-actions"
|
|
919
|
+
}, [h(KButton, {
|
|
920
|
+
tabindex: 5,
|
|
921
|
+
attrs: this.v3 ? undefined : {
|
|
922
|
+
tabindex: 5,
|
|
923
|
+
"aria-label": "Cancel",
|
|
924
|
+
"aria-disabled": "false",
|
|
925
|
+
type: "button",
|
|
926
|
+
fillMode: "flat",
|
|
927
|
+
icon: "x",
|
|
928
|
+
svgIcon: xIcon
|
|
929
|
+
},
|
|
930
|
+
"aria-label": "Cancel",
|
|
931
|
+
"aria-disabled": "false",
|
|
932
|
+
type: "button",
|
|
933
|
+
fillMode: "flat",
|
|
934
|
+
onClick: _this.handleWrapperClick,
|
|
935
|
+
on: this.v3 ? undefined : {
|
|
936
|
+
"click": _this.handleWrapperClick
|
|
937
|
+
},
|
|
938
|
+
icon: "x",
|
|
939
|
+
svgIcon: xIcon
|
|
940
|
+
})])]), h("div", {
|
|
941
|
+
"class": "k-actionsheet-titlebar-group k-actionsheet-filter"
|
|
942
|
+
}, [renderListFilter.call(_this)])];
|
|
943
|
+
};
|
|
944
|
+
var adaptiveActionSheetHeaderTemplate = templateRendering.call(this, adaptiveActionSheetHeaderTemplateDef, getListeners.call(this));
|
|
945
|
+
var adaptiveActionSheetContentTemplateDef = function adaptiveActionSheetContentTemplateDef() {
|
|
946
|
+
var _a;
|
|
947
|
+
var headerToRender = base.getTemplateDef.call(_this, header, h);
|
|
948
|
+
var footerToRender = base.getTemplateDef.call(_this, footer, h);
|
|
949
|
+
var groupStickyHeaderTemplate = templateRendering.call(_this, groupStickyHeaderItemRender, getListeners.call(_this));
|
|
950
|
+
return h("div", {
|
|
951
|
+
"class": "k-list-container"
|
|
952
|
+
}, [headerToRender && h("div", {
|
|
953
|
+
"class": "k-list-header"
|
|
954
|
+
}, [headerToRender]), h("div", {
|
|
955
|
+
"class": classNames('k-list', (_a = {}, _a["k-list-".concat(sizeMap[size] || size)] = !renderAdaptive ? size : false, _a['k-list-lg'] = renderAdaptive ? true : false, _a['k-virtual-list'] = vs.enabled, _a))
|
|
956
|
+
}, [renderDefaultItem.call(_this), _this.group && dataItems.length !== 0 && h(GroupStickyHeader, {
|
|
957
|
+
group: _this.group,
|
|
958
|
+
attrs: this.v3 ? undefined : {
|
|
959
|
+
group: _this.group,
|
|
960
|
+
render: groupStickyHeaderTemplate
|
|
961
|
+
},
|
|
962
|
+
render: groupStickyHeaderTemplate
|
|
963
|
+
}), renderList.call(_this), footerToRender && h("div", {
|
|
964
|
+
className: "k-list-footer",
|
|
965
|
+
attrs: this.v3 ? undefined : {
|
|
966
|
+
className: "k-list-footer"
|
|
967
|
+
}
|
|
968
|
+
}, [footerToRender])])]);
|
|
969
|
+
};
|
|
970
|
+
var adaptiveActionSheetContentTemplate = templateRendering.call(this, adaptiveActionSheetContentTemplateDef, getListeners.call(this));
|
|
971
|
+
var renderAdaptiveListContainer = function renderAdaptiveListContainer() {
|
|
972
|
+
return h(ActionSheet, {
|
|
973
|
+
expand: opened,
|
|
974
|
+
attrs: this.v3 ? undefined : {
|
|
975
|
+
expand: opened,
|
|
976
|
+
animation: true,
|
|
977
|
+
animationStyles: this.animationStyles,
|
|
978
|
+
className: this.classNameAdaptive,
|
|
979
|
+
contentClassName: '!k-overflow-hidden',
|
|
980
|
+
header: adaptiveActionSheetHeaderTemplate,
|
|
981
|
+
content: adaptiveActionSheetContentTemplate,
|
|
982
|
+
navigatableElements: ['input.k-input-inner', '.k-actionsheet-actions > button']
|
|
983
|
+
},
|
|
984
|
+
animation: true,
|
|
985
|
+
animationStyles: this.animationStyles,
|
|
986
|
+
className: this.classNameAdaptive,
|
|
987
|
+
contentClassName: '!k-overflow-hidden',
|
|
988
|
+
header: adaptiveActionSheetHeaderTemplate,
|
|
989
|
+
content: adaptiveActionSheetContentTemplate,
|
|
990
|
+
onClose: this.handleWrapperClick,
|
|
991
|
+
on: this.v3 ? undefined : {
|
|
992
|
+
"close": this.handleWrapperClick
|
|
993
|
+
},
|
|
994
|
+
navigatableElements: ['input.k-input-inner', '.k-actionsheet-actions > button']
|
|
995
|
+
});
|
|
996
|
+
};
|
|
836
997
|
var renderDefaultItem = function renderDefaultItem() {
|
|
837
998
|
var _a = this.$props,
|
|
838
999
|
textField = _a.textField,
|
|
@@ -960,21 +1121,10 @@ var DropDownListVue2 = {
|
|
|
960
1121
|
var renderListContainer = function renderListContainer() {
|
|
961
1122
|
var _this3 = this;
|
|
962
1123
|
var _a;
|
|
963
|
-
var headerTemplate = templateRendering.call(this, this.$props.header, getListeners.call(this));
|
|
964
|
-
var footerTemplate = templateRendering.call(this, this.$props.footer, getListeners.call(this));
|
|
965
1124
|
var groupStickyHeaderTemplate = templateRendering.call(this, this.$props.groupStickyHeaderItemRender, getListeners.call(this));
|
|
966
|
-
var
|
|
967
|
-
|
|
968
|
-
template: headerTemplate
|
|
969
|
-
});
|
|
970
|
-
var footer = getTemplate.call(this, {
|
|
971
|
-
h: h,
|
|
972
|
-
template: footerTemplate
|
|
973
|
-
});
|
|
1125
|
+
var headerListContainer = base.getTemplateDef.call(this, header);
|
|
1126
|
+
var footerListContainer = base.getTemplateDef.call(this, footer);
|
|
974
1127
|
var popupWidth = popupSettings.width !== undefined ? popupSettings.width : base.popupWidth;
|
|
975
|
-
if (this.group === undefined && this.$props.groupField !== undefined) {
|
|
976
|
-
this.group = getItemValue(dataItems[0], this.$props.groupField);
|
|
977
|
-
}
|
|
978
1128
|
return (
|
|
979
1129
|
// @ts-ignore function children
|
|
980
1130
|
h(ListContainer, {
|
|
@@ -1017,11 +1167,11 @@ var DropDownListVue2 = {
|
|
|
1017
1167
|
render: groupStickyHeaderTemplate
|
|
1018
1168
|
},
|
|
1019
1169
|
render: groupStickyHeaderTemplate
|
|
1020
|
-
}),
|
|
1170
|
+
}), headerListContainer && h("div", {
|
|
1021
1171
|
"class": "k-list-header"
|
|
1022
|
-
}, [
|
|
1172
|
+
}, [headerListContainer]), renderList.call(_this3), footerListContainer && h("div", {
|
|
1023
1173
|
"class": "k-list-footer"
|
|
1024
|
-
}, [
|
|
1174
|
+
}, [footerListContainer])];
|
|
1025
1175
|
} : [renderListFilter.call(_this3), renderDefaultItem.call(_this3), _this3.group && dataItems.length !== 0 && h(GroupStickyHeader, {
|
|
1026
1176
|
group: _this3.group,
|
|
1027
1177
|
attrs: _this3.v3 ? undefined : {
|
|
@@ -1029,11 +1179,11 @@ var DropDownListVue2 = {
|
|
|
1029
1179
|
render: groupStickyHeaderTemplate
|
|
1030
1180
|
},
|
|
1031
1181
|
render: groupStickyHeaderTemplate
|
|
1032
|
-
}),
|
|
1182
|
+
}), headerListContainer && h("div", {
|
|
1033
1183
|
"class": "k-list-header"
|
|
1034
|
-
}, [
|
|
1184
|
+
}, [headerListContainer]), renderList.call(_this3), footerListContainer && h("div", {
|
|
1035
1185
|
"class": "k-list-footer"
|
|
1036
|
-
}, [
|
|
1186
|
+
}, [footerListContainer])])
|
|
1037
1187
|
);
|
|
1038
1188
|
};
|
|
1039
1189
|
if (this.$props.virtual !== undefined) {
|
|
@@ -1043,7 +1193,7 @@ var DropDownListVue2 = {
|
|
|
1043
1193
|
// @ts-ignore
|
|
1044
1194
|
base.vs.pageSize = virtual.pageSize;
|
|
1045
1195
|
}
|
|
1046
|
-
var
|
|
1196
|
+
var dropdownlistDefault = h("span", {
|
|
1047
1197
|
ref: setRef(this, 'kendoAnchor', this.anchor),
|
|
1048
1198
|
"class": classNames('k-dropdownlist k-picker', className, (_a = {}, _a["k-picker-".concat(sizeMap[size] || size)] = size, _a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded, _a["k-picker-".concat(fillMode)] = fillMode, _a['k-focus'] = focused, _a['k-disabled'] = disabled, _a['k-invalid'] = !isValid, _a['k-loading'] = loading, _a['k-required'] = this.required, _a)),
|
|
1049
1199
|
style: !label ? style : __assign(__assign({}, style), {
|
|
@@ -1124,7 +1274,11 @@ var DropDownListVue2 = {
|
|
|
1124
1274
|
svgIcon: svgIcon || caretAltDownIcon,
|
|
1125
1275
|
iconClass: iconClassName,
|
|
1126
1276
|
"aria-hidden": true
|
|
1127
|
-
}), dummySelect.call(this, value), renderListContainer.call(this)]);
|
|
1277
|
+
}), dummySelect.call(this, value), !renderAdaptive && renderListContainer.call(this)]);
|
|
1278
|
+
// The following one combines the default rendering of the DropDownList and the Adaptive rendering.
|
|
1279
|
+
// This is needed because of Vue 2 specifics
|
|
1280
|
+
var dropdownlist = [dropdownlistDefault, renderAdaptive && renderAdaptiveListContainer.call(this)];
|
|
1281
|
+
var dropdownlistToRender = isV3 ? dropdownlist : this.$props.adaptive ? h("span", [dropdownlist]) : dropdownlistDefault;
|
|
1128
1282
|
return label ? h("span", {
|
|
1129
1283
|
"class": this.spanClassNames,
|
|
1130
1284
|
onFocusin: this.handleFocus,
|
|
@@ -1137,7 +1291,7 @@ var DropDownListVue2 = {
|
|
|
1137
1291
|
attrs: this.v3 ? undefined : {
|
|
1138
1292
|
dir: this.$props.dir
|
|
1139
1293
|
}
|
|
1140
|
-
}, [
|
|
1294
|
+
}, [dropdownlistToRender, this.$props.label ? id ? h("label", {
|
|
1141
1295
|
"for": id,
|
|
1142
1296
|
attrs: this.v3 ? undefined : {
|
|
1143
1297
|
"for": id
|
|
@@ -1145,7 +1299,7 @@ var DropDownListVue2 = {
|
|
|
1145
1299
|
"class": "k-label"
|
|
1146
1300
|
}, [this.$props.label]) : h("span", {
|
|
1147
1301
|
"class": "k-label"
|
|
1148
|
-
}, [this.$props.label]) : null]) :
|
|
1302
|
+
}, [this.$props.label]) : null]) : dropdownlistToRender;
|
|
1149
1303
|
}
|
|
1150
1304
|
};
|
|
1151
1305
|
/**
|
|
@@ -296,4 +296,12 @@ export interface DropDownListProps extends FormComponentProps {
|
|
|
296
296
|
* Fires when a DropDownList sticky group header item is about to be rendered. Used to override the default appearance of the sticky group header of the component.
|
|
297
297
|
*/
|
|
298
298
|
groupStickyHeaderItemRender?: any;
|
|
299
|
+
/**
|
|
300
|
+
* Provides different rendering of the popup element based on the screen dimensions ([see example]({% slug adaptive_rendering_dropdownlist %})).
|
|
301
|
+
*/
|
|
302
|
+
adaptive?: boolean;
|
|
303
|
+
/**
|
|
304
|
+
* Specifies the text that is rendered as title in the adaptive popup ([see example]({% slug adaptive_rendering_dropdownlist %})).
|
|
305
|
+
*/
|
|
306
|
+
adaptiveTitle?: string;
|
|
299
307
|
}
|