@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
|
@@ -26,7 +26,7 @@ var gh = allVue.h;
|
|
|
26
26
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
27
27
|
import { classNames, noop,
|
|
28
28
|
// useRtl,
|
|
29
|
-
getTabIndex, Keys, guid, kendoThemeMaps, Icon, getRef, templateRendering, getListeners, getTemplate, setRef } from '@progress/kendo-vue-common';
|
|
29
|
+
getTabIndex, Keys, guid, kendoThemeMaps, Icon, getRef, templateRendering, getListeners, getTemplate, canUseDOM, setRef } from '@progress/kendo-vue-common';
|
|
30
30
|
import { Popup } from '@progress/kendo-vue-popup';
|
|
31
31
|
import { provideLocalizationService } from '@progress/kendo-vue-intl';
|
|
32
32
|
import { TreeView } from '@progress/kendo-vue-treeview';
|
|
@@ -37,8 +37,11 @@ import { ListNoData } from './ListNoData';
|
|
|
37
37
|
import { messages, clear, nodata } from './../messages/main';
|
|
38
38
|
import { FloatingLabel } from '@progress/kendo-vue-labels';
|
|
39
39
|
import { ListFilter } from '../common/ListFilter';
|
|
40
|
-
import { Button } from '@progress/kendo-vue-buttons';
|
|
40
|
+
import { Button as KButton } from '@progress/kendo-vue-buttons';
|
|
41
41
|
import { xIcon, caretAltDownIcon } from '@progress/kendo-svg-icons';
|
|
42
|
+
import { MOBILE_SMALL_DEVICE, MOBILE_MEDIUM_DEVICE } from '../common/constants';
|
|
43
|
+
import { ActionSheet } from '@progress/kendo-vue-layout';
|
|
44
|
+
import DropDownBase from '../common/DropDownBase';
|
|
42
45
|
var sizeMap = kendoThemeMaps.sizeMap,
|
|
43
46
|
roundedMap = kendoThemeMaps.roundedMap;
|
|
44
47
|
var VALIDATION_MESSAGE = 'Please select a value from the list!';
|
|
@@ -182,7 +185,15 @@ var DropDownTreeVue2 = {
|
|
|
182
185
|
header: [String, Function, Object],
|
|
183
186
|
footer: [String, Function, Object],
|
|
184
187
|
valueRender: [String, Function, Object],
|
|
185
|
-
listNoData: [String, Function, Object]
|
|
188
|
+
listNoData: [String, Function, Object],
|
|
189
|
+
adaptive: {
|
|
190
|
+
type: Boolean,
|
|
191
|
+
default: undefined
|
|
192
|
+
},
|
|
193
|
+
adaptiveTitle: {
|
|
194
|
+
type: String,
|
|
195
|
+
default: undefined
|
|
196
|
+
}
|
|
186
197
|
},
|
|
187
198
|
inject: {
|
|
188
199
|
kendoLocalizationService: {
|
|
@@ -190,7 +201,9 @@ var DropDownTreeVue2 = {
|
|
|
190
201
|
}
|
|
191
202
|
},
|
|
192
203
|
created: function created() {
|
|
204
|
+
this.observer = null;
|
|
193
205
|
validatePackage(packageMetadata);
|
|
206
|
+
this.base = new DropDownBase(this);
|
|
194
207
|
this.componentGuid = guid();
|
|
195
208
|
this.anchor = guid();
|
|
196
209
|
},
|
|
@@ -200,7 +213,9 @@ var DropDownTreeVue2 = {
|
|
|
200
213
|
focused: false,
|
|
201
214
|
filterState: '',
|
|
202
215
|
currentValue: undefined,
|
|
203
|
-
popupWidth: '200px'
|
|
216
|
+
popupWidth: '200px',
|
|
217
|
+
windowWidth: 0,
|
|
218
|
+
initialAdaptiveRenderingValues: undefined
|
|
204
219
|
};
|
|
205
220
|
},
|
|
206
221
|
computed: {
|
|
@@ -226,6 +241,25 @@ var DropDownTreeVue2 = {
|
|
|
226
241
|
'k-picker': true
|
|
227
242
|
}, _a[this.$props.className] = this.$props.className, _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'] = this.focused, _a['k-invalid'] = !isValid, _a['k-loading'] = this.$props.loading, _a['k-required'] = required, _a['k-disabled'] = this.$props.disabled, _a;
|
|
228
243
|
},
|
|
244
|
+
animationStyles: {
|
|
245
|
+
get: function get() {
|
|
246
|
+
return this.windowWidth <= MOBILE_SMALL_DEVICE ? {
|
|
247
|
+
top: 0,
|
|
248
|
+
width: '100%',
|
|
249
|
+
height: '100%'
|
|
250
|
+
} : undefined;
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
classNameAdaptive: {
|
|
254
|
+
get: function get() {
|
|
255
|
+
return this.windowWidth <= MOBILE_SMALL_DEVICE ? 'k-adaptive-actionsheet k-actionsheet-fullscreen' : 'k-adaptive-actionsheet k-actionsheet-bottom';
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
adaptiveState: {
|
|
259
|
+
get: function get() {
|
|
260
|
+
return this.windowWidth <= MOBILE_MEDIUM_DEVICE && this.$props.adaptive;
|
|
261
|
+
}
|
|
262
|
+
},
|
|
229
263
|
isOpen: function isOpen() {
|
|
230
264
|
return this.opened !== undefined ? this.opened : this.currentOpened;
|
|
231
265
|
},
|
|
@@ -239,7 +273,21 @@ var DropDownTreeVue2 = {
|
|
|
239
273
|
return this.hasValue ? getItemValue(this.computedValue, this.$props.textField) : '';
|
|
240
274
|
}
|
|
241
275
|
},
|
|
276
|
+
watch: {
|
|
277
|
+
// This watch gets the state of the data when the adaptive mode is activated
|
|
278
|
+
isOpen: function isOpen(newValue) {
|
|
279
|
+
if (newValue && this.value) {
|
|
280
|
+
this.initialAdaptiveRenderingValues = __spreadArray([], this.value, true);
|
|
281
|
+
} else {
|
|
282
|
+
this.initialAdaptiveRenderingValues = undefined;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
},
|
|
242
286
|
mounted: function mounted() {
|
|
287
|
+
this.observer = canUseDOM && new ResizeObserver(this.calculateMedia);
|
|
288
|
+
if ((document === null || document === void 0 ? void 0 : document.body) && this.observer) {
|
|
289
|
+
this.observer.observe(document.body);
|
|
290
|
+
}
|
|
243
291
|
this.elementRef = getRef(this, 'kendoAnchor', this.anchor);
|
|
244
292
|
this.inputRef = getRef(this, 'input');
|
|
245
293
|
this.selectRef = getRef(this, 'select');
|
|
@@ -248,6 +296,11 @@ var DropDownTreeVue2 = {
|
|
|
248
296
|
this.popupRef = getRef(this, 'popup');
|
|
249
297
|
this.calculatePopupWidth();
|
|
250
298
|
},
|
|
299
|
+
destroyed: !!isV3 ? undefined : function () {
|
|
300
|
+
if (this.observer) {
|
|
301
|
+
this.observer.disconnect();
|
|
302
|
+
}
|
|
303
|
+
},
|
|
251
304
|
updated: function updated() {
|
|
252
305
|
this.inputRef = getRef(this, 'input');
|
|
253
306
|
this.treeViewRef = getRef(this, 'treeView');
|
|
@@ -266,7 +319,7 @@ var DropDownTreeVue2 = {
|
|
|
266
319
|
},
|
|
267
320
|
// @ts-ignore
|
|
268
321
|
render: function render(createElement) {
|
|
269
|
-
var
|
|
322
|
+
var _this = this;
|
|
270
323
|
var h = gh || createElement;
|
|
271
324
|
var id = this.$props.id || this.componentGuid;
|
|
272
325
|
var _a = this.$props,
|
|
@@ -282,7 +335,8 @@ var DropDownTreeVue2 = {
|
|
|
282
335
|
validationMessage = _a.validationMessage,
|
|
283
336
|
valid = _a.valid,
|
|
284
337
|
required = _a.required,
|
|
285
|
-
validityStyles = _a.validityStyles
|
|
338
|
+
validityStyles = _a.validityStyles,
|
|
339
|
+
adaptiveTitle = _a.adaptiveTitle;
|
|
286
340
|
var tabIndex = getTabIndex(this.$props.tabIndex, disabled);
|
|
287
341
|
var localization = provideLocalizationService(this);
|
|
288
342
|
var validity = getValidity({
|
|
@@ -290,6 +344,7 @@ var DropDownTreeVue2 = {
|
|
|
290
344
|
valid: valid,
|
|
291
345
|
required: required
|
|
292
346
|
}, this.hasValue);
|
|
347
|
+
var renderAdaptive = this.adaptiveState;
|
|
293
348
|
var dir = this.$props.dir; // useRtl(elementRef, props.dir);
|
|
294
349
|
var itemTemplate = templateRendering.call(this, this.item, getListeners.call(this));
|
|
295
350
|
var valueTemplate = templateRendering.call(this, this.valueRender, getListeners.call(this));
|
|
@@ -325,12 +380,152 @@ var DropDownTreeVue2 = {
|
|
|
325
380
|
value: this.computedValue
|
|
326
381
|
}
|
|
327
382
|
});
|
|
383
|
+
var adaptiveActionSheetHeaderTemplateDef = function adaptiveActionSheetHeaderTemplateDef() {
|
|
384
|
+
return [h("div", {
|
|
385
|
+
"class": "k-actionsheet-titlebar-group k-hbox"
|
|
386
|
+
}, [h("div", {
|
|
387
|
+
"class": "k-actionsheet-title"
|
|
388
|
+
}, [h("div", {
|
|
389
|
+
"class": "k-text-center"
|
|
390
|
+
}, [adaptiveTitle]), h("div", {
|
|
391
|
+
"class": "k-actionsheet-subtitle k-text-center"
|
|
392
|
+
}, [placeholder])]), h("div", {
|
|
393
|
+
"class": "k-actionsheet-actions"
|
|
394
|
+
}, [h(KButton, {
|
|
395
|
+
tabindex: 1,
|
|
396
|
+
attrs: this.v3 ? undefined : {
|
|
397
|
+
tabindex: 1,
|
|
398
|
+
"aria-label": "Cancel",
|
|
399
|
+
"aria-disabled": "false",
|
|
400
|
+
type: "button",
|
|
401
|
+
fillMode: "flat",
|
|
402
|
+
icon: "x",
|
|
403
|
+
svgIcon: xIcon
|
|
404
|
+
},
|
|
405
|
+
"aria-label": "Cancel",
|
|
406
|
+
"aria-disabled": "false",
|
|
407
|
+
type: "button",
|
|
408
|
+
fillMode: "flat",
|
|
409
|
+
onClick: _this.onWrapperClick,
|
|
410
|
+
on: this.v3 ? undefined : {
|
|
411
|
+
"click": _this.onWrapperClick
|
|
412
|
+
},
|
|
413
|
+
icon: "x",
|
|
414
|
+
svgIcon: xIcon
|
|
415
|
+
})])]), h("div", {
|
|
416
|
+
"class": "k-actionsheet-titlebar-group k-actionsheet-filter"
|
|
417
|
+
}, [_this.$props.filterable &&
|
|
418
|
+
// @ts-ignore
|
|
419
|
+
h(ListFilter, {
|
|
420
|
+
tabindex: 0,
|
|
421
|
+
attrs: this.v3 ? undefined : {
|
|
422
|
+
tabindex: 0,
|
|
423
|
+
value: _this.$props.filter === undefined ? _this.filterState : _this.$props.filter,
|
|
424
|
+
size: size,
|
|
425
|
+
rounded: rounded,
|
|
426
|
+
fillMode: fillMode
|
|
427
|
+
},
|
|
428
|
+
value: _this.$props.filter === undefined ? _this.filterState : _this.$props.filter,
|
|
429
|
+
ref: setRef(_this, 'input'),
|
|
430
|
+
onChange: _this.onFilterChange,
|
|
431
|
+
on: this.v3 ? undefined : {
|
|
432
|
+
"change": _this.onFilterChange,
|
|
433
|
+
"keydown": _this.onInputKeyDown,
|
|
434
|
+
"focus": _this.onFocus,
|
|
435
|
+
"blur": _this.onBlur
|
|
436
|
+
},
|
|
437
|
+
onKeydown: _this.onInputKeyDown,
|
|
438
|
+
size: size,
|
|
439
|
+
rounded: rounded,
|
|
440
|
+
fillMode: fillMode,
|
|
441
|
+
onFocus: _this.onFocus,
|
|
442
|
+
onBlur: _this.onBlur
|
|
443
|
+
})])];
|
|
444
|
+
};
|
|
445
|
+
var adaptiveActionSheetHeaderTemplate = templateRendering.call(this, adaptiveActionSheetHeaderTemplateDef, getListeners.call(this));
|
|
446
|
+
var adaptiveActionSheetContentTemplateDef = function adaptiveActionSheetContentTemplateDef() {
|
|
447
|
+
var headerToRender = _this.base.getTemplateDef.call(_this, header, h);
|
|
448
|
+
var footerToRender = _this.base.getTemplateDef.call(_this, footer, h);
|
|
449
|
+
return [headerToRender && h("div", {
|
|
450
|
+
"class": "k-list-header"
|
|
451
|
+
}, [headerToRender]), dataItems.length > 0 ?
|
|
452
|
+
// @ts-ignore
|
|
453
|
+
h(TreeView, {
|
|
454
|
+
ref: setRef(_this, 'treeView'),
|
|
455
|
+
tabIndex: tabIndex,
|
|
456
|
+
attrs: this.v3 ? undefined : {
|
|
457
|
+
tabIndex: tabIndex,
|
|
458
|
+
dataItems: dataItems,
|
|
459
|
+
focusIdField: dataItemKey,
|
|
460
|
+
textField: _this.$props.textField,
|
|
461
|
+
selectField: selectField,
|
|
462
|
+
expandField: _this.$props.expandField,
|
|
463
|
+
childrenField: subItemsField,
|
|
464
|
+
expandIcons: true,
|
|
465
|
+
size: 'large',
|
|
466
|
+
item: itemTemplate
|
|
467
|
+
},
|
|
468
|
+
dataItems: dataItems,
|
|
469
|
+
focusIdField: dataItemKey,
|
|
470
|
+
textField: _this.$props.textField,
|
|
471
|
+
selectField: selectField,
|
|
472
|
+
expandField: _this.$props.expandField,
|
|
473
|
+
childrenField: subItemsField,
|
|
474
|
+
expandIcons: true,
|
|
475
|
+
onItemclick: _this.onChange,
|
|
476
|
+
on: this.v3 ? undefined : {
|
|
477
|
+
"itemclick": _this.onChange,
|
|
478
|
+
"expandchange": _this.onExpand,
|
|
479
|
+
"focus": _this.onFocus,
|
|
480
|
+
"blur": _this.onBlur,
|
|
481
|
+
"keydown": _this.onWrapperKeyDown
|
|
482
|
+
},
|
|
483
|
+
onExpandchange: _this.onExpand,
|
|
484
|
+
onFocus: _this.onFocus,
|
|
485
|
+
onBlur: _this.onBlur,
|
|
486
|
+
onKeydown: _this.onWrapperKeyDown,
|
|
487
|
+
size: 'large',
|
|
488
|
+
item: itemTemplate
|
|
489
|
+
}) : noDataTemplate, footerToRender && h("div", {
|
|
490
|
+
className: "k-list-footer",
|
|
491
|
+
attrs: this.v3 ? undefined : {
|
|
492
|
+
className: "k-list-footer"
|
|
493
|
+
}
|
|
494
|
+
}, [footerToRender])];
|
|
495
|
+
};
|
|
496
|
+
var adaptiveActionSheetContentTemplate = templateRendering.call(this, adaptiveActionSheetContentTemplateDef, getListeners.call(this));
|
|
497
|
+
var renderAdaptiveListContainer = function renderAdaptiveListContainer() {
|
|
498
|
+
return h(ActionSheet, {
|
|
499
|
+
expand: this.isOpen,
|
|
500
|
+
attrs: this.v3 ? undefined : {
|
|
501
|
+
expand: this.isOpen,
|
|
502
|
+
animation: true,
|
|
503
|
+
animationStyles: this.animationStyles,
|
|
504
|
+
className: this.classNameAdaptive,
|
|
505
|
+
header: adaptiveActionSheetHeaderTemplate,
|
|
506
|
+
content: adaptiveActionSheetContentTemplate,
|
|
507
|
+
contentClassName: '!k-overflow-hidden',
|
|
508
|
+
navigatableElements: ['input.k-input-inner', '.k-actionsheet-actions > button']
|
|
509
|
+
},
|
|
510
|
+
animation: true,
|
|
511
|
+
animationStyles: this.animationStyles,
|
|
512
|
+
className: this.classNameAdaptive,
|
|
513
|
+
header: adaptiveActionSheetHeaderTemplate,
|
|
514
|
+
content: adaptiveActionSheetContentTemplate,
|
|
515
|
+
contentClassName: '!k-overflow-hidden',
|
|
516
|
+
onClose: this.onWrapperClick,
|
|
517
|
+
on: this.v3 ? undefined : {
|
|
518
|
+
"close": this.onWrapperClick
|
|
519
|
+
},
|
|
520
|
+
navigatableElements: ['input.k-input-inner', '.k-actionsheet-actions > button']
|
|
521
|
+
});
|
|
522
|
+
};
|
|
328
523
|
var isValid = !validityStyles || validity.valid;
|
|
329
524
|
var _b = this.$props,
|
|
330
525
|
size = _b.size,
|
|
331
526
|
rounded = _b.rounded,
|
|
332
527
|
fillMode = _b.fillMode;
|
|
333
|
-
var
|
|
528
|
+
var component = h("span", {
|
|
334
529
|
"class": this.wrapperClass,
|
|
335
530
|
tabIndex: tabIndex,
|
|
336
531
|
attrs: this.v3 ? undefined : {
|
|
@@ -406,7 +601,7 @@ var DropDownTreeVue2 = {
|
|
|
406
601
|
icon: xIcon
|
|
407
602
|
},
|
|
408
603
|
icon: xIcon
|
|
409
|
-
})]), h(
|
|
604
|
+
})]), h(KButton, {
|
|
410
605
|
tabIndex: -1,
|
|
411
606
|
attrs: this.v3 ? undefined : {
|
|
412
607
|
tabIndex: -1,
|
|
@@ -455,7 +650,7 @@ var DropDownTreeVue2 = {
|
|
|
455
650
|
}
|
|
456
651
|
})]),
|
|
457
652
|
// @ts-ignore function children
|
|
458
|
-
h(Popup, {
|
|
653
|
+
!renderAdaptive && h(Popup, {
|
|
459
654
|
style: {
|
|
460
655
|
width: this.popupWidth,
|
|
461
656
|
direction: dir
|
|
@@ -482,100 +677,40 @@ var DropDownTreeVue2 = {
|
|
|
482
677
|
},
|
|
483
678
|
onClose: this.onPopupClosed,
|
|
484
679
|
appendTo: popupSettings.appendTo
|
|
485
|
-
}, this.
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
value: _this2.$props.filter === undefined ? _this2.filterState : _this2.$props.filter,
|
|
492
|
-
size: size,
|
|
493
|
-
rounded: rounded,
|
|
494
|
-
fillMode: fillMode
|
|
495
|
-
},
|
|
496
|
-
ref: setRef(_this2, 'input'),
|
|
497
|
-
onChange: _this2.onFilterChange,
|
|
498
|
-
on: _this2.v3 ? undefined : {
|
|
499
|
-
"change": _this2.onFilterChange,
|
|
500
|
-
"keydown": _this2.onInputKeyDown
|
|
501
|
-
},
|
|
502
|
-
onKeydown: _this2.onInputKeyDown,
|
|
503
|
-
size: size,
|
|
504
|
-
rounded: rounded,
|
|
505
|
-
fillMode: fillMode
|
|
506
|
-
}), header && h("div", {
|
|
507
|
-
"class": "k-list-header"
|
|
508
|
-
}, [header]), dataItems.length > 0 ?
|
|
509
|
-
// @ts-ignore
|
|
510
|
-
h(TreeView, {
|
|
511
|
-
ref: setRef(_this2, 'treeView'),
|
|
512
|
-
tabIndex: tabIndex,
|
|
513
|
-
attrs: _this2.v3 ? undefined : {
|
|
514
|
-
tabIndex: tabIndex,
|
|
515
|
-
dataItems: dataItems,
|
|
516
|
-
focusIdField: dataItemKey,
|
|
517
|
-
textField: _this2.$props.textField,
|
|
518
|
-
selectField: selectField,
|
|
519
|
-
expandField: _this2.$props.expandField,
|
|
520
|
-
childrenField: subItemsField,
|
|
521
|
-
expandIcons: true,
|
|
522
|
-
size: size,
|
|
523
|
-
item: itemTemplate
|
|
524
|
-
},
|
|
525
|
-
dataItems: dataItems,
|
|
526
|
-
focusIdField: dataItemKey,
|
|
527
|
-
textField: _this2.$props.textField,
|
|
528
|
-
selectField: selectField,
|
|
529
|
-
expandField: _this2.$props.expandField,
|
|
530
|
-
childrenField: subItemsField,
|
|
531
|
-
expandIcons: true,
|
|
532
|
-
onItemclick: _this2.onChange,
|
|
533
|
-
on: _this2.v3 ? undefined : {
|
|
534
|
-
"itemclick": _this2.onChange,
|
|
535
|
-
"expandchange": _this2.onExpand,
|
|
536
|
-
"focus": _this2.onFocus,
|
|
537
|
-
"blur": _this2.onBlur,
|
|
538
|
-
"keydown": _this2.onWrapperKeyDown
|
|
539
|
-
},
|
|
540
|
-
onExpandchange: _this2.onExpand,
|
|
541
|
-
onFocus: _this2.onFocus,
|
|
542
|
-
onBlur: _this2.onBlur,
|
|
543
|
-
onKeydown: _this2.onWrapperKeyDown,
|
|
544
|
-
size: size,
|
|
545
|
-
item: itemTemplate
|
|
546
|
-
}) : noDataTemplate, footer && h("div", {
|
|
547
|
-
"class": "k-list-footer"
|
|
548
|
-
}, [footer])];
|
|
549
|
-
} : [_this2.$props.filterable && h(ListFilter, {
|
|
550
|
-
value: _this2.$props.filter === undefined ? _this2.filterState : _this2.$props.filter,
|
|
551
|
-
attrs: _this2.v3 ? undefined : {
|
|
552
|
-
value: _this2.$props.filter === undefined ? _this2.filterState : _this2.$props.filter,
|
|
680
|
+
}, [this.$props.filterable &&
|
|
681
|
+
// @ts-ignore
|
|
682
|
+
h(ListFilter, {
|
|
683
|
+
value: this.$props.filter === undefined ? this.filterState : this.$props.filter,
|
|
684
|
+
attrs: this.v3 ? undefined : {
|
|
685
|
+
value: this.$props.filter === undefined ? this.filterState : this.$props.filter,
|
|
553
686
|
size: size,
|
|
554
687
|
rounded: rounded,
|
|
555
688
|
fillMode: fillMode
|
|
556
689
|
},
|
|
557
|
-
ref: setRef(
|
|
558
|
-
onChange:
|
|
559
|
-
on:
|
|
560
|
-
"change":
|
|
561
|
-
"keydown":
|
|
690
|
+
ref: setRef(this, 'input'),
|
|
691
|
+
onChange: this.onFilterChange,
|
|
692
|
+
on: this.v3 ? undefined : {
|
|
693
|
+
"change": this.onFilterChange,
|
|
694
|
+
"keydown": this.onInputKeyDown
|
|
562
695
|
},
|
|
563
|
-
onKeydown:
|
|
696
|
+
onKeydown: this.onInputKeyDown,
|
|
564
697
|
size: size,
|
|
565
698
|
rounded: rounded,
|
|
566
699
|
fillMode: fillMode
|
|
567
700
|
}), header && h("div", {
|
|
568
701
|
"class": "k-list-header"
|
|
569
|
-
}, [header]), dataItems.length > 0 ?
|
|
570
|
-
|
|
702
|
+
}, [header]), dataItems.length > 0 ?
|
|
703
|
+
// @ts-ignore
|
|
704
|
+
h(TreeView, {
|
|
705
|
+
ref: setRef(this, 'treeView'),
|
|
571
706
|
tabIndex: tabIndex,
|
|
572
|
-
attrs:
|
|
707
|
+
attrs: this.v3 ? undefined : {
|
|
573
708
|
tabIndex: tabIndex,
|
|
574
709
|
dataItems: dataItems,
|
|
575
710
|
focusIdField: dataItemKey,
|
|
576
|
-
textField:
|
|
711
|
+
textField: this.$props.textField,
|
|
577
712
|
selectField: selectField,
|
|
578
|
-
expandField:
|
|
713
|
+
expandField: this.$props.expandField,
|
|
579
714
|
childrenField: subItemsField,
|
|
580
715
|
expandIcons: true,
|
|
581
716
|
size: size,
|
|
@@ -583,28 +718,32 @@ var DropDownTreeVue2 = {
|
|
|
583
718
|
},
|
|
584
719
|
dataItems: dataItems,
|
|
585
720
|
focusIdField: dataItemKey,
|
|
586
|
-
textField:
|
|
721
|
+
textField: this.$props.textField,
|
|
587
722
|
selectField: selectField,
|
|
588
|
-
expandField:
|
|
723
|
+
expandField: this.$props.expandField,
|
|
589
724
|
childrenField: subItemsField,
|
|
590
725
|
expandIcons: true,
|
|
591
|
-
onItemclick:
|
|
592
|
-
on:
|
|
593
|
-
"itemclick":
|
|
594
|
-
"expandchange":
|
|
595
|
-
"focus":
|
|
596
|
-
"blur":
|
|
597
|
-
"keydown":
|
|
726
|
+
onItemclick: this.onChange,
|
|
727
|
+
on: this.v3 ? undefined : {
|
|
728
|
+
"itemclick": this.onChange,
|
|
729
|
+
"expandchange": this.onExpand,
|
|
730
|
+
"focus": this.onFocus,
|
|
731
|
+
"blur": this.onBlur,
|
|
732
|
+
"keydown": this.onWrapperKeyDown
|
|
598
733
|
},
|
|
599
|
-
onExpandchange:
|
|
600
|
-
onFocus:
|
|
601
|
-
onBlur:
|
|
602
|
-
onKeydown:
|
|
734
|
+
onExpandchange: this.onExpand,
|
|
735
|
+
onFocus: this.onFocus,
|
|
736
|
+
onBlur: this.onBlur,
|
|
737
|
+
onKeydown: this.onWrapperKeyDown,
|
|
603
738
|
size: size,
|
|
604
739
|
item: itemTemplate
|
|
605
740
|
}) : noDataTemplate, footer && h("div", {
|
|
606
741
|
"class": "k-list-footer"
|
|
607
742
|
}, [footer])])]);
|
|
743
|
+
// The following one combines the default rendering of the MultiSelect and the Adaptive rendering.
|
|
744
|
+
// This is needed because of Vue 2 specifics
|
|
745
|
+
var dropdowntree = [component, renderAdaptive && renderAdaptiveListContainer.call(this)];
|
|
746
|
+
var dropdowntreeToRender = isV3 ? dropdowntree : this.$props.adaptive ? h("span", [dropdowntree]) : component;
|
|
608
747
|
return label ?
|
|
609
748
|
// @ts-ignore function children
|
|
610
749
|
h(FloatingLabel, {
|
|
@@ -627,10 +766,16 @@ var DropDownTreeVue2 = {
|
|
|
627
766
|
focused: this.focused,
|
|
628
767
|
dir: dir
|
|
629
768
|
}, this.v3 ? function () {
|
|
630
|
-
return [
|
|
631
|
-
} : [
|
|
769
|
+
return [dropdowntreeToRender];
|
|
770
|
+
} : [dropdowntreeToRender]) : dropdowntreeToRender;
|
|
632
771
|
},
|
|
633
772
|
methods: {
|
|
773
|
+
calculateMedia: function calculateMedia(entries) {
|
|
774
|
+
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
|
|
775
|
+
var entry = entries_1[_i];
|
|
776
|
+
this.windowWidth = entry.target.clientWidth;
|
|
777
|
+
}
|
|
778
|
+
},
|
|
634
779
|
calculatePopupWidth: function calculatePopupWidth() {
|
|
635
780
|
if (this.elementRef) {
|
|
636
781
|
this.popupWidth = this.popupSettings.width !== undefined ? this.popupSettings.width : this.elementRef.offsetWidth + 'px';
|
|
@@ -670,6 +815,11 @@ var DropDownTreeVue2 = {
|
|
|
670
815
|
}
|
|
671
816
|
},
|
|
672
817
|
onWrapperClick: function onWrapperClick(event) {
|
|
818
|
+
this.onFilterChange(__assign(__assign({}, event), {
|
|
819
|
+
target: {
|
|
820
|
+
value: ''
|
|
821
|
+
}
|
|
822
|
+
}));
|
|
673
823
|
if (!event.defaultPrevented && this.$el) {
|
|
674
824
|
this.focused = true;
|
|
675
825
|
var ev = {
|
|
@@ -733,7 +883,9 @@ var DropDownTreeVue2 = {
|
|
|
733
883
|
var _this = this;
|
|
734
884
|
var keyCode = event.keyCode,
|
|
735
885
|
altKey = event.altKey;
|
|
736
|
-
if (
|
|
886
|
+
if (keyCode === Keys.esc) {
|
|
887
|
+
this.onWrapperClick(event);
|
|
888
|
+
} else if (altKey || keyCode !== Keys.up && keyCode !== Keys.down) {
|
|
737
889
|
return;
|
|
738
890
|
}
|
|
739
891
|
event.preventDefault();
|
|
@@ -788,7 +940,7 @@ var DropDownTreeVue2 = {
|
|
|
788
940
|
target: this
|
|
789
941
|
};
|
|
790
942
|
var focusEvent = __assign({}, ev);
|
|
791
|
-
if (!event.relatedTarget || !event.relatedTarget.closest('.popup-' + this.componentGuid)) {
|
|
943
|
+
if ((!event.relatedTarget || !event.relatedTarget.closest('.popup-' + this.componentGuid)) && !this.adaptiveState) {
|
|
792
944
|
this.$emit('blur', focusEvent);
|
|
793
945
|
this.closePopup(ev);
|
|
794
946
|
}
|
|
@@ -290,4 +290,12 @@ export interface DropDownTreeProps extends FormComponentProps {
|
|
|
290
290
|
* @default `solid`
|
|
291
291
|
*/
|
|
292
292
|
fillMode?: null | 'solid' | 'flat' | 'outline' | string;
|
|
293
|
+
/**
|
|
294
|
+
* Provides different rendering of the popup element based on the screen dimensions.
|
|
295
|
+
*/
|
|
296
|
+
adaptive?: boolean;
|
|
297
|
+
/**
|
|
298
|
+
* Specifies the text that is rendered as title in the adaptive popup.
|
|
299
|
+
*/
|
|
300
|
+
adaptiveTitle?: string;
|
|
293
301
|
}
|