@progress/kendo-vue-dropdowns 3.10.2 → 3.11.0-dev.202305230751
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.js +115 -15
- package/dist/es/AutoComplete/AutoCompleteProps.d.ts +12 -0
- package/dist/es/ComboBox/ComboBox.js +115 -16
- package/dist/es/ComboBox/ComboBoxProps.d.ts +12 -0
- package/dist/es/DropDownList/DropDownList.js +101 -14
- package/dist/es/DropDownList/DropDownListProps.d.ts +12 -0
- package/dist/es/DropDownTree/DropDownTree.d.ts +49 -1
- package/dist/es/DropDownTree/DropDownTree.js +863 -638
- package/dist/es/DropDownTree/DropDownTreeProps.d.ts +19 -8
- package/dist/es/MultiSelect/MultiSelect.js +122 -28
- package/dist/es/MultiSelect/MultiSelectProps.d.ts +12 -0
- package/dist/es/MultiSelectTree/MultiSelectTree.js +12 -12
- package/dist/es/common/DropDownBase.d.ts +2 -0
- package/dist/es/common/DropDownBase.js +20 -0
- package/dist/es/common/GroupStickyHeader.d.ts +29 -0
- package/dist/es/common/GroupStickyHeader.js +59 -0
- package/dist/es/common/List.d.ts +2 -0
- package/dist/es/common/List.js +53 -25
- package/dist/es/common/ListFilter.js +47 -25
- package/dist/es/common/ListGroupItem.d.ts +41 -0
- package/dist/es/common/ListGroupItem.js +71 -0
- package/dist/es/common/settings.d.ts +1 -0
- package/dist/es/main.d.ts +2 -1
- package/dist/es/main.js +2 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/esm/AutoComplete/AutoComplete.js +115 -15
- package/dist/esm/AutoComplete/AutoCompleteProps.d.ts +12 -0
- package/dist/esm/ComboBox/ComboBox.js +115 -16
- package/dist/esm/ComboBox/ComboBoxProps.d.ts +12 -0
- package/dist/esm/DropDownList/DropDownList.js +101 -14
- package/dist/esm/DropDownList/DropDownListProps.d.ts +12 -0
- package/dist/esm/DropDownTree/DropDownTree.d.ts +49 -1
- package/dist/esm/DropDownTree/DropDownTree.js +863 -638
- package/dist/esm/DropDownTree/DropDownTreeProps.d.ts +19 -8
- package/dist/esm/MultiSelect/MultiSelect.js +122 -28
- package/dist/esm/MultiSelect/MultiSelectProps.d.ts +12 -0
- package/dist/esm/MultiSelectTree/MultiSelectTree.js +12 -12
- package/dist/esm/common/DropDownBase.d.ts +2 -0
- package/dist/esm/common/DropDownBase.js +20 -0
- package/dist/esm/common/GroupStickyHeader.d.ts +29 -0
- package/dist/esm/common/GroupStickyHeader.js +59 -0
- package/dist/esm/common/List.d.ts +2 -0
- package/dist/esm/common/List.js +53 -25
- package/dist/esm/common/ListFilter.js +47 -25
- package/dist/esm/common/ListGroupItem.d.ts +41 -0
- package/dist/esm/common/ListGroupItem.js +71 -0
- package/dist/esm/common/settings.d.ts +1 -0
- package/dist/esm/main.d.ts +2 -1
- package/dist/esm/main.js +2 -1
- package/dist/esm/package-metadata.js +1 -1
- package/dist/npm/AutoComplete/AutoComplete.js +114 -14
- package/dist/npm/AutoComplete/AutoCompleteProps.d.ts +12 -0
- package/dist/npm/ComboBox/ComboBox.js +115 -16
- package/dist/npm/ComboBox/ComboBoxProps.d.ts +12 -0
- package/dist/npm/DropDownList/DropDownList.js +101 -14
- package/dist/npm/DropDownList/DropDownListProps.d.ts +12 -0
- package/dist/npm/DropDownTree/DropDownTree.d.ts +49 -1
- package/dist/npm/DropDownTree/DropDownTree.js +868 -639
- package/dist/npm/DropDownTree/DropDownTreeProps.d.ts +19 -8
- package/dist/npm/MultiSelect/MultiSelect.js +122 -28
- package/dist/npm/MultiSelect/MultiSelectProps.d.ts +12 -0
- package/dist/npm/MultiSelectTree/MultiSelectTree.js +12 -12
- package/dist/npm/common/DropDownBase.d.ts +2 -0
- package/dist/npm/common/DropDownBase.js +20 -0
- package/dist/npm/common/GroupStickyHeader.d.ts +29 -0
- package/dist/npm/common/GroupStickyHeader.js +66 -0
- package/dist/npm/common/List.d.ts +2 -0
- package/dist/npm/common/List.js +52 -24
- package/dist/npm/common/ListFilter.js +47 -25
- package/dist/npm/common/ListGroupItem.d.ts +41 -0
- package/dist/npm/common/ListGroupItem.js +78 -0
- package/dist/npm/common/settings.d.ts +1 -0
- package/dist/npm/main.d.ts +2 -1
- package/dist/npm/main.js +3 -1
- package/dist/npm/package-metadata.js +1 -1
- package/package.json +10 -8
- package/dist/es/DropDownTree/useDropdownWidth.d.ts +0 -4
- package/dist/es/DropDownTree/useDropdownWidth.js +0 -10
- package/dist/esm/DropDownTree/useDropdownWidth.d.ts +0 -4
- package/dist/esm/DropDownTree/useDropdownWidth.js +0 -10
- package/dist/npm/DropDownTree/useDropdownWidth.d.ts +0 -4
- package/dist/npm/DropDownTree/useDropdownWidth.js +0 -17
|
@@ -81,7 +81,7 @@ export interface DropDownTreeProps extends FormComponentProps {
|
|
|
81
81
|
/**
|
|
82
82
|
* Sets the data of the DropDownTree ([see example]({% slug overview_dropdowntree %})).
|
|
83
83
|
*/
|
|
84
|
-
|
|
84
|
+
dataItems?: any[];
|
|
85
85
|
/**
|
|
86
86
|
* Sets the opened state of the DropDownTree.
|
|
87
87
|
*/
|
|
@@ -91,6 +91,7 @@ export interface DropDownTreeProps extends FormComponentProps {
|
|
|
91
91
|
* It can be an object from the data-tree.
|
|
92
92
|
*/
|
|
93
93
|
value?: any;
|
|
94
|
+
modelValue?: any;
|
|
94
95
|
/**
|
|
95
96
|
* The hint that is displayed when the DropDownTree is empty.
|
|
96
97
|
*/
|
|
@@ -224,17 +225,27 @@ export interface DropDownTreeProps extends FormComponentProps {
|
|
|
224
225
|
*/
|
|
225
226
|
onExpandChange?: (event: any) => void;
|
|
226
227
|
/**
|
|
227
|
-
* Defines the
|
|
228
|
+
* Defines the slot that will be used for rendering each of the DropDownTree items
|
|
228
229
|
* ([see example]({% slug customrendering_dropdowntree %}#toc-items-and-value-element)).
|
|
229
230
|
*/
|
|
230
231
|
item?: any;
|
|
231
232
|
/**
|
|
232
|
-
* Defines the
|
|
233
|
+
* Defines the slot that will be used for rendering the selected value
|
|
233
234
|
* ([see example]({% slug customrendering_dropdowntree %}#toc-items-and-value-element)).
|
|
234
235
|
*/
|
|
235
|
-
|
|
236
|
+
valueRender?: any;
|
|
236
237
|
/**
|
|
237
|
-
* Defines the
|
|
238
|
+
* Defines the slot that will be used for header
|
|
239
|
+
* ([see example]({% slug customrendering_dropdowntree %}#toc-items-and-value-element)).
|
|
240
|
+
*/
|
|
241
|
+
header?: any;
|
|
242
|
+
/**
|
|
243
|
+
* Defines the slot that will be used for footer
|
|
244
|
+
* ([see example]({% slug customrendering_dropdowntree %}#toc-items-and-value-element)).
|
|
245
|
+
*/
|
|
246
|
+
footer?: any;
|
|
247
|
+
/**
|
|
248
|
+
* Defines the slot that will be rendered in the DropDownTree popup when no data is available
|
|
238
249
|
* ([see example]({% slug customrendering_dropdowntree %}#toc-no-data)).
|
|
239
250
|
*/
|
|
240
251
|
listNoData?: any;
|
|
@@ -249,7 +260,7 @@ export interface DropDownTreeProps extends FormComponentProps {
|
|
|
249
260
|
*
|
|
250
261
|
* @default `medium`
|
|
251
262
|
*/
|
|
252
|
-
size?: null | 'small' | 'medium' | 'large';
|
|
263
|
+
size?: null | 'small' | 'medium' | 'large' | string;
|
|
253
264
|
/**
|
|
254
265
|
* Configures the `roundness` of the DropDownTree.
|
|
255
266
|
*
|
|
@@ -262,7 +273,7 @@ export interface DropDownTreeProps extends FormComponentProps {
|
|
|
262
273
|
*
|
|
263
274
|
* @default `medium`
|
|
264
275
|
*/
|
|
265
|
-
rounded?: null | 'small' | 'medium' | 'large' | 'full';
|
|
276
|
+
rounded?: null | 'small' | 'medium' | 'large' | 'full' | string;
|
|
266
277
|
/**
|
|
267
278
|
* Configures the `fillMode` of the DropDownTree.
|
|
268
279
|
*
|
|
@@ -274,5 +285,5 @@ export interface DropDownTreeProps extends FormComponentProps {
|
|
|
274
285
|
*
|
|
275
286
|
* @default `solid`
|
|
276
287
|
*/
|
|
277
|
-
fillMode?: null | 'solid' | 'flat' | 'outline';
|
|
288
|
+
fillMode?: null | 'solid' | 'flat' | 'outline' | string;
|
|
278
289
|
}
|
|
@@ -39,6 +39,7 @@ var List_1 = require("../common/List");
|
|
|
39
39
|
var TagList_1 = require("./TagList");
|
|
40
40
|
var SearchBar_1 = require("../common/SearchBar");
|
|
41
41
|
var DropDownBase_1 = require("../common/DropDownBase");
|
|
42
|
+
var GroupStickyHeader_1 = require("../common/GroupStickyHeader");
|
|
42
43
|
var ClearButton_1 = require("../common/ClearButton");
|
|
43
44
|
var settings_1 = require("./../common/settings");
|
|
44
45
|
var utils_1 = require("../common/utils");
|
|
@@ -145,6 +146,8 @@ var MultiSelectVue2 = {
|
|
|
145
146
|
}
|
|
146
147
|
},
|
|
147
148
|
itemRender: [String, Function, Object],
|
|
149
|
+
groupHeaderItemRender: [String, Function, Object],
|
|
150
|
+
groupStickyHeaderItemRender: [String, Function, Object],
|
|
148
151
|
listNoDataRender: [String, Function, Object],
|
|
149
152
|
focusedItemIndex: Function,
|
|
150
153
|
virtual: {
|
|
@@ -187,6 +190,9 @@ var MultiSelectVue2 = {
|
|
|
187
190
|
validator: function validator(value) {
|
|
188
191
|
return ['small', 'medium', 'large'].includes(value);
|
|
189
192
|
}
|
|
193
|
+
},
|
|
194
|
+
groupField: {
|
|
195
|
+
type: String
|
|
190
196
|
}
|
|
191
197
|
},
|
|
192
198
|
// @ts-ignore
|
|
@@ -238,7 +244,10 @@ var MultiSelectVue2 = {
|
|
|
238
244
|
last: ''
|
|
239
245
|
},
|
|
240
246
|
suggested: '',
|
|
241
|
-
activedescendant: settings_1.ActiveDescendant.PopupList
|
|
247
|
+
activedescendant: settings_1.ActiveDescendant.PopupList,
|
|
248
|
+
group: undefined,
|
|
249
|
+
isScrolling: false,
|
|
250
|
+
itemHeight: 0
|
|
242
251
|
};
|
|
243
252
|
},
|
|
244
253
|
watch: {
|
|
@@ -255,7 +264,13 @@ var MultiSelectVue2 = {
|
|
|
255
264
|
}
|
|
256
265
|
},
|
|
257
266
|
updated: function updated() {
|
|
258
|
-
var
|
|
267
|
+
var _a;
|
|
268
|
+
var _b = this.$props,
|
|
269
|
+
virtual = _b.virtual,
|
|
270
|
+
_c = _b.groupField,
|
|
271
|
+
groupField = _c === void 0 ? '' : _c,
|
|
272
|
+
_d = _b.dataItems,
|
|
273
|
+
dataItems = _d === void 0 ? [] : _d;
|
|
259
274
|
var skip = virtual ? virtual.skip : 0;
|
|
260
275
|
var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
|
|
261
276
|
var prevOpened = this.prevOpened !== undefined ? this.prevOpened : this.prevCurrentOpened;
|
|
@@ -276,29 +291,38 @@ var MultiSelectVue2 = {
|
|
|
276
291
|
if (scrollElement) {
|
|
277
292
|
this.base.vs.scrollElement = scrollElement;
|
|
278
293
|
}
|
|
279
|
-
if (list &&
|
|
294
|
+
if (list && dataItems.length) {
|
|
280
295
|
// @ts-ignore
|
|
281
296
|
this.base.vs.scrollerRef(list.$el);
|
|
282
297
|
}
|
|
283
298
|
if (!popupSettings.animate && closing) {
|
|
284
299
|
this.onPopupClosed();
|
|
285
300
|
}
|
|
286
|
-
if (
|
|
287
|
-
this.
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
301
|
+
if (!this.isScrolling) {
|
|
302
|
+
if (virtual && this.virtualTotalHasChanged) {
|
|
303
|
+
this.base.vs.calcScrollElementHeight();
|
|
304
|
+
this.base.vs.reset();
|
|
305
|
+
this.virtualTotalHasChanged = false;
|
|
306
|
+
} else {
|
|
307
|
+
var _e = this.getFocusedState(),
|
|
308
|
+
focusedItem = _e.focusedItem,
|
|
309
|
+
focusedIndex = _e.focusedIndex;
|
|
310
|
+
if (groupField !== '') {
|
|
311
|
+
focusedIndex = (_a = this.base.getGroupedDataModernMode(dataItems, groupField)) === null || _a === void 0 ? void 0 : _a.indexOf(focusedItem);
|
|
312
|
+
}
|
|
313
|
+
if (opening && virtual) {
|
|
314
|
+
this.base.scrollToVirtualItem(virtual, focusedIndex - skip);
|
|
315
|
+
this.prevCurrentOpened = true;
|
|
316
|
+
} else if (opening && !virtual) {
|
|
317
|
+
// Resets the sticky header group value for scenarios with open/close of component's popup
|
|
318
|
+
if (dataItems && dataItems.length !== 0) {
|
|
319
|
+
this.base.resetGroupStickyHeader(dataItems[0][groupField], this);
|
|
320
|
+
}
|
|
321
|
+
this.base.scrollToItem(focusedIndex);
|
|
322
|
+
this.prevCurrentOpened = true;
|
|
323
|
+
} else if (opened && prevOpened && focusedItem) {
|
|
324
|
+
this.base.scrollToItem(focusedIndex - skip);
|
|
325
|
+
}
|
|
302
326
|
}
|
|
303
327
|
}
|
|
304
328
|
this.scrollToFocused = false;
|
|
@@ -484,6 +508,10 @@ var MultiSelectVue2 = {
|
|
|
484
508
|
this.base.togglePopup(state);
|
|
485
509
|
}
|
|
486
510
|
this.base.filterChanged(value, state);
|
|
511
|
+
// Resets the value of the StickyHeader when filtering the data or just entering symbols in the input
|
|
512
|
+
if (this.$props.filterable) {
|
|
513
|
+
state.data.group = undefined;
|
|
514
|
+
}
|
|
487
515
|
this.applyState(state);
|
|
488
516
|
},
|
|
489
517
|
clearButtonClick: function clearButtonClick(event) {
|
|
@@ -511,6 +539,9 @@ var MultiSelectVue2 = {
|
|
|
511
539
|
},
|
|
512
540
|
onInputKeyDown: function onInputKeyDown(event) {
|
|
513
541
|
var _this = this;
|
|
542
|
+
if (this.isScrolling) {
|
|
543
|
+
this.isScrolling = false;
|
|
544
|
+
}
|
|
514
545
|
var keyCode = event.keyCode;
|
|
515
546
|
var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
|
|
516
547
|
var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
|
|
@@ -800,6 +831,39 @@ var MultiSelectVue2 = {
|
|
|
800
831
|
},
|
|
801
832
|
repositionPopup: function repositionPopup() {
|
|
802
833
|
this.base.repositionPopup();
|
|
834
|
+
},
|
|
835
|
+
onScroll: function onScroll(event) {
|
|
836
|
+
this.isScrolling = true;
|
|
837
|
+
var _a = this.base,
|
|
838
|
+
vs = _a.vs,
|
|
839
|
+
list = _a.list;
|
|
840
|
+
vs.scrollHandler(event);
|
|
841
|
+
var state = this.base.initState();
|
|
842
|
+
var groupField = this.$props.groupField;
|
|
843
|
+
var _b = this.$props.dataItems,
|
|
844
|
+
dataItems = _b === void 0 ? [] : _b;
|
|
845
|
+
if (!groupField || !dataItems.length) {
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
var itemHeight = this.itemHeight = this.itemHeight || (vs.enabled ? vs.itemHeight : list ? list.children[0].offsetHeight : 0);
|
|
849
|
+
var target = event.target;
|
|
850
|
+
var scrollTop = target.scrollTop - vs.skip * itemHeight;
|
|
851
|
+
if (groupField) {
|
|
852
|
+
dataItems = this.base.getGroupedDataModernMode(dataItems, groupField);
|
|
853
|
+
}
|
|
854
|
+
var group = dataItems[0][groupField];
|
|
855
|
+
for (var i = 1; i < dataItems.length; i++) {
|
|
856
|
+
if (itemHeight * i > scrollTop) {
|
|
857
|
+
break;
|
|
858
|
+
}
|
|
859
|
+
if (dataItems[i] && dataItems[i][groupField]) {
|
|
860
|
+
group = dataItems[i][groupField];
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
if (group !== this.group) {
|
|
864
|
+
state.data.group = group;
|
|
865
|
+
this.applyState(state);
|
|
866
|
+
}
|
|
803
867
|
}
|
|
804
868
|
},
|
|
805
869
|
render: function render(createElement) {
|
|
@@ -905,14 +969,18 @@ var MultiSelectVue2 = {
|
|
|
905
969
|
};
|
|
906
970
|
var renderList = function renderList() {
|
|
907
971
|
var _this2 = this;
|
|
908
|
-
var
|
|
909
|
-
|
|
972
|
+
var groupField = this.$props.groupField;
|
|
973
|
+
var dataItems = this.$props.dataItems || [];
|
|
910
974
|
var itemRender = kendo_vue_common_1.templateRendering.call(this, this.$props.itemRender, kendo_vue_common_1.getListeners.call(this));
|
|
975
|
+
var groupHeaderItemRender = kendo_vue_common_1.templateRendering.call(this, this.$props.groupHeaderItemRender, kendo_vue_common_1.getListeners.call(this));
|
|
911
976
|
var listNoDataRender = kendo_vue_common_1.templateRendering.call(this, this.$props.listNoDataRender, kendo_vue_common_1.getListeners.call(this));
|
|
912
977
|
var skip = virtual ? virtual.skip : 0;
|
|
913
978
|
var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
|
|
914
979
|
var focusedIndex = this.getFocusedState().focusedIndex;
|
|
915
980
|
var translate = "translateY(".concat(vs.translate, "px)");
|
|
981
|
+
if (groupField) {
|
|
982
|
+
dataItems = this.base.getGroupedDataModernMode(dataItems, groupField);
|
|
983
|
+
}
|
|
916
984
|
return (
|
|
917
985
|
// @ts-ignore function children
|
|
918
986
|
h(List_1.List, {
|
|
@@ -935,7 +1003,9 @@ var MultiSelectVue2 = {
|
|
|
935
1003
|
} : undefined,
|
|
936
1004
|
skip: skip,
|
|
937
1005
|
itemRender: itemRender,
|
|
938
|
-
|
|
1006
|
+
groupHeaderItemRender: groupHeaderItemRender,
|
|
1007
|
+
noDataRender: listNoDataRender,
|
|
1008
|
+
groupField: groupField
|
|
939
1009
|
},
|
|
940
1010
|
show: opened,
|
|
941
1011
|
dataItems: dataItems.slice(),
|
|
@@ -957,11 +1027,13 @@ var MultiSelectVue2 = {
|
|
|
957
1027
|
onListclick: this.handleItemClick,
|
|
958
1028
|
on: this.v3 ? undefined : {
|
|
959
1029
|
"listclick": this.handleItemClick,
|
|
960
|
-
"scroll":
|
|
1030
|
+
"scroll": this.onScroll
|
|
961
1031
|
},
|
|
962
1032
|
itemRender: itemRender,
|
|
1033
|
+
groupHeaderItemRender: groupHeaderItemRender,
|
|
963
1034
|
noDataRender: listNoDataRender,
|
|
964
|
-
|
|
1035
|
+
groupField: groupField,
|
|
1036
|
+
onScroll: this.onScroll
|
|
965
1037
|
}, this.v3 ? function () {
|
|
966
1038
|
return [renderScrollElement.call(_this2)];
|
|
967
1039
|
} : [renderScrollElement.call(_this2)])
|
|
@@ -983,6 +1055,7 @@ var MultiSelectVue2 = {
|
|
|
983
1055
|
dataItems = _c === void 0 ? [] : _c;
|
|
984
1056
|
var headerTemplate = kendo_vue_common_1.templateRendering.call(this, this.$props.header, kendo_vue_common_1.getListeners.call(this));
|
|
985
1057
|
var footerTemplate = kendo_vue_common_1.templateRendering.call(this, this.$props.footer, kendo_vue_common_1.getListeners.call(this));
|
|
1058
|
+
var groupStickyHeaderTemplate = kendo_vue_common_1.templateRendering.call(this, this.$props.groupStickyHeaderItemRender, kendo_vue_common_1.getListeners.call(this));
|
|
986
1059
|
var header = kendo_vue_common_1.getTemplate.call(this, {
|
|
987
1060
|
h: h,
|
|
988
1061
|
template: headerTemplate
|
|
@@ -1017,6 +1090,9 @@ var MultiSelectVue2 = {
|
|
|
1017
1090
|
float: 'right'
|
|
1018
1091
|
}
|
|
1019
1092
|
})])]);
|
|
1093
|
+
if (this.group === undefined && this.$props.groupField !== undefined) {
|
|
1094
|
+
this.group = (0, utils_1.getItemValue)(dataItems[0], this.$props.groupField);
|
|
1095
|
+
}
|
|
1020
1096
|
return (
|
|
1021
1097
|
// @ts-ignore function children
|
|
1022
1098
|
h(ListContainer_1.ListContainer, {
|
|
@@ -1054,12 +1130,26 @@ var MultiSelectVue2 = {
|
|
|
1054
1130
|
}, this.v3 ? function () {
|
|
1055
1131
|
return [header && h("div", {
|
|
1056
1132
|
"class": "k-list-header"
|
|
1057
|
-
}, [header]), customItem,
|
|
1133
|
+
}, [header]), customItem, _this3.group && dataItems.length !== 0 && h(GroupStickyHeader_1.GroupStickyHeader, {
|
|
1134
|
+
group: _this3.group,
|
|
1135
|
+
attrs: _this3.v3 ? undefined : {
|
|
1136
|
+
group: _this3.group,
|
|
1137
|
+
render: groupStickyHeaderTemplate
|
|
1138
|
+
},
|
|
1139
|
+
render: groupStickyHeaderTemplate
|
|
1140
|
+
}), renderList.call(_this3), footer && h("div", {
|
|
1058
1141
|
"class": "k-list-footer"
|
|
1059
1142
|
}, [footer]), virtual && header];
|
|
1060
1143
|
} : [header && h("div", {
|
|
1061
1144
|
"class": "k-list-header"
|
|
1062
|
-
}, [header]), customItem,
|
|
1145
|
+
}, [header]), customItem, _this3.group && dataItems.length !== 0 && h(GroupStickyHeader_1.GroupStickyHeader, {
|
|
1146
|
+
group: _this3.group,
|
|
1147
|
+
attrs: _this3.v3 ? undefined : {
|
|
1148
|
+
group: _this3.group,
|
|
1149
|
+
render: groupStickyHeaderTemplate
|
|
1150
|
+
},
|
|
1151
|
+
render: groupStickyHeaderTemplate
|
|
1152
|
+
}), renderList.call(_this3), footer && h("div", {
|
|
1063
1153
|
"class": "k-list-footer"
|
|
1064
1154
|
}, [footer]), virtual && header])
|
|
1065
1155
|
);
|
|
@@ -1120,8 +1210,12 @@ var MultiSelectVue2 = {
|
|
|
1120
1210
|
on: this.v3 ? undefined : {
|
|
1121
1211
|
"clearclick": this.clearButtonClick
|
|
1122
1212
|
}
|
|
1123
|
-
}), h(
|
|
1124
|
-
|
|
1213
|
+
}), h(kendo_vue_common_1.Icon, {
|
|
1214
|
+
name: loading ? 'loading' : '',
|
|
1215
|
+
attrs: this.v3 ? undefined : {
|
|
1216
|
+
name: loading ? 'loading' : ''
|
|
1217
|
+
},
|
|
1218
|
+
"class": 'k-input-loading-icon'
|
|
1125
1219
|
}), renderListContainer.call(this)]);
|
|
1126
1220
|
return label ? h("span", {
|
|
1127
1221
|
"class": this.spanClassNames,
|
|
@@ -263,4 +263,16 @@ export interface MultiSelectProps extends FormComponentProps {
|
|
|
263
263
|
* @default `solid`
|
|
264
264
|
*/
|
|
265
265
|
fillMode?: null | 'solid' | 'outline' | 'flat' | string;
|
|
266
|
+
/**
|
|
267
|
+
* Sets the data item field that represents the start of a group. Applicable to objects data.
|
|
268
|
+
*/
|
|
269
|
+
groupField?: string;
|
|
270
|
+
/**
|
|
271
|
+
* Fires when a MultiSelect group header item is about to be rendered. Used to override the default appearance of the group's headers.
|
|
272
|
+
*/
|
|
273
|
+
groupHeaderItemRender?: any;
|
|
274
|
+
/**
|
|
275
|
+
* Fires when a MultiSelect sticky group header item is about to be rendered. Used to override the default appearance of the sticky group header of the component.
|
|
276
|
+
*/
|
|
277
|
+
groupStickyHeaderItemRender?: any;
|
|
266
278
|
}
|
|
@@ -76,8 +76,8 @@ var MultiSelectTreeVue2 = {
|
|
|
76
76
|
focus: null,
|
|
77
77
|
blur: null,
|
|
78
78
|
change: null,
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
filterchange: null,
|
|
80
|
+
expandchange: null,
|
|
81
81
|
'changemodel': null,
|
|
82
82
|
'update:modelValue': null
|
|
83
83
|
},
|
|
@@ -304,7 +304,7 @@ var MultiSelectTreeVue2 = {
|
|
|
304
304
|
fillMode = _e.fillMode;
|
|
305
305
|
var multiselecttree = h("span", {
|
|
306
306
|
ref: (0, kendo_vue_common_1.setRef)(this, 'kendoAnchor', this.anchor),
|
|
307
|
-
"class": (0, kendo_vue_common_1.classNames)('k-
|
|
307
|
+
"class": (0, kendo_vue_common_1.classNames)('k-multiselecttree k-input', this.$props.className, (_a = {}, _a["k-input-".concat(sizeMap[size] || size)] = size, _a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded, _a["k-input-".concat(fillMode)] = fillMode, _a['k-focus'] = this.focusedState && !disabled, _a['k-invalid'] = !isValid, _a['k-disabled'] = disabled, _a['k-loading'] = this.$props.loading, _a['k-required'] = required, _a)),
|
|
308
308
|
tabIndex: tabIndex,
|
|
309
309
|
attrs: this.v3 ? undefined : {
|
|
310
310
|
tabIndex: tabIndex,
|
|
@@ -312,12 +312,12 @@ var MultiSelectTreeVue2 = {
|
|
|
312
312
|
id: id,
|
|
313
313
|
dir: dir,
|
|
314
314
|
role: "combobox",
|
|
315
|
-
"aria-haspopup": "
|
|
315
|
+
"aria-haspopup": "tree",
|
|
316
316
|
"aria-expanded": this.isOpen,
|
|
317
317
|
"aria-disabled": disabled,
|
|
318
318
|
"aria-label": label,
|
|
319
319
|
"aria-labelledby": this.$props.ariaLabelledBy,
|
|
320
|
-
"aria-describedby": this.$props.
|
|
320
|
+
"aria-describedby": this.$props.ariaLabelledBy ? this.$props.ariaLabelledBy : 'tagslist-' + id,
|
|
321
321
|
"aria-required": this.$props.required
|
|
322
322
|
},
|
|
323
323
|
accessKey: this.$props.accessKey,
|
|
@@ -335,12 +335,12 @@ var MultiSelectTreeVue2 = {
|
|
|
335
335
|
onFocusin: this.onFocus,
|
|
336
336
|
onFocusout: this.onBlur,
|
|
337
337
|
role: "combobox",
|
|
338
|
-
"aria-haspopup": "
|
|
338
|
+
"aria-haspopup": "tree",
|
|
339
339
|
"aria-expanded": this.isOpen,
|
|
340
340
|
"aria-disabled": disabled,
|
|
341
341
|
"aria-label": label,
|
|
342
342
|
"aria-labelledby": this.$props.ariaLabelledBy,
|
|
343
|
-
"aria-describedby": this.$props.
|
|
343
|
+
"aria-describedby": this.$props.ariaLabelledBy ? this.$props.ariaLabelledBy : 'tagslist-' + id,
|
|
344
344
|
"aria-required": this.$props.required,
|
|
345
345
|
onClick: this.onWrapperClick
|
|
346
346
|
}, [h("div", {
|
|
@@ -356,7 +356,7 @@ var MultiSelectTreeVue2 = {
|
|
|
356
356
|
dataItems: this.tagsToRenderRef,
|
|
357
357
|
guid: id,
|
|
358
358
|
focused: this.focusedTagState ? this.tagsToRenderRef.find(function (t) {
|
|
359
|
-
return (0, utils_1.matchTags)(t, _this.focusedTagState, dataItemKey);
|
|
359
|
+
return _this.focusedTagState && (0, utils_1.matchTags)(t, _this.focusedTagState, dataItemKey);
|
|
360
360
|
}) : undefined,
|
|
361
361
|
tagsRounded: rounded,
|
|
362
362
|
size: size,
|
|
@@ -369,7 +369,7 @@ var MultiSelectTreeVue2 = {
|
|
|
369
369
|
dataItems: this.tagsToRenderRef,
|
|
370
370
|
guid: id,
|
|
371
371
|
focused: this.focusedTagState ? this.tagsToRenderRef.find(function (t) {
|
|
372
|
-
return (0, utils_1.matchTags)(t, _this.focusedTagState, dataItemKey);
|
|
372
|
+
return _this.focusedTagState && (0, utils_1.matchTags)(t, _this.focusedTagState, dataItemKey);
|
|
373
373
|
}) : undefined,
|
|
374
374
|
tagsRounded: rounded,
|
|
375
375
|
size: size,
|
|
@@ -435,9 +435,9 @@ var MultiSelectTreeVue2 = {
|
|
|
435
435
|
width: this.popupWidth,
|
|
436
436
|
direction: dir
|
|
437
437
|
},
|
|
438
|
-
popupClass: (0, kendo_vue_common_1.classNames)(popupSettings.popupClass, 'k-
|
|
438
|
+
popupClass: (0, kendo_vue_common_1.classNames)(popupSettings.popupClass, 'k-multiselecttree-popup', 'popup-' + this.componentGuid),
|
|
439
439
|
attrs: this.v3 ? undefined : {
|
|
440
|
-
popupClass: (0, kendo_vue_common_1.classNames)(popupSettings.popupClass, 'k-
|
|
440
|
+
popupClass: (0, kendo_vue_common_1.classNames)(popupSettings.popupClass, 'k-multiselecttree-popup', 'popup-' + this.componentGuid),
|
|
441
441
|
animate: popupSettings.animate,
|
|
442
442
|
anchor: this.anchor,
|
|
443
443
|
show: this.isOpen,
|
|
@@ -732,7 +732,7 @@ var MultiSelectTreeVue2 = {
|
|
|
732
732
|
onPopupClosed: function onPopupClosed() {
|
|
733
733
|
if (this.focusedState) {
|
|
734
734
|
// Move the focus from treeview to dropdown without triggering Focus or Blur events.
|
|
735
|
-
this.focusElement(this
|
|
735
|
+
this.focusElement(this.elementRef);
|
|
736
736
|
}
|
|
737
737
|
},
|
|
738
738
|
onFocus: function onFocus(event) {
|
|
@@ -82,4 +82,6 @@ export default class DropDownBase {
|
|
|
82
82
|
triggerOnPageChange(state: InternalState, skip: number, take: number): void;
|
|
83
83
|
triggerPageChangeCornerItems(item: any, state: InternalState): void;
|
|
84
84
|
scrollToVirtualItem: (virtual: VirtualizationSettings, selectedItemIndex: number) => void;
|
|
85
|
+
getGroupedDataModernMode: (data: any[], groupField: string) => any[];
|
|
86
|
+
resetGroupStickyHeader: (groupName: string, that: any) => void;
|
|
85
87
|
}
|
|
@@ -118,6 +118,26 @@ var DropDownBase = /** @class */function () {
|
|
|
118
118
|
return vs.enabled = true;
|
|
119
119
|
}, 10);
|
|
120
120
|
};
|
|
121
|
+
this.getGroupedDataModernMode = function (data, groupField) {
|
|
122
|
+
var newData = [];
|
|
123
|
+
data.forEach(function (el, index) {
|
|
124
|
+
var _a;
|
|
125
|
+
if (data[index - 1] && el[groupField] !== data[index - 1][groupField]) {
|
|
126
|
+
newData.push((_a = {}, _a[groupField] = el[groupField], _a));
|
|
127
|
+
newData.push(data[index]);
|
|
128
|
+
} else {
|
|
129
|
+
newData.push(data[index]);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
return newData;
|
|
133
|
+
};
|
|
134
|
+
this.resetGroupStickyHeader = function (groupName, that) {
|
|
135
|
+
var state = _this.initState();
|
|
136
|
+
if (groupName !== that.group && that.state) {
|
|
137
|
+
that.state.data.group = groupName;
|
|
138
|
+
_this.applyState(state);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
121
141
|
(0, kendo_vue_common_1.validatePackage)(package_metadata_1.packageMetadata);
|
|
122
142
|
this.listBoxId = (0, kendo_vue_common_1.guid)();
|
|
123
143
|
this.guid = (0, kendo_vue_common_1.guid)();
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
|
|
2
|
+
declare type DefaultData<V> = object | ((this: V) => {});
|
|
3
|
+
declare type DefaultMethods<V> = {
|
|
4
|
+
[key: string]: (this: V, ...args: any[]) => any;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Represents the props of the GroupStickyHeader component.
|
|
8
|
+
*/
|
|
9
|
+
export interface GroupStickyHeaderProps {
|
|
10
|
+
/**
|
|
11
|
+
* The group that will be rendered.
|
|
12
|
+
*/
|
|
13
|
+
group?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Fires when a sticky group header item is about to be rendered. Used to override the default appearance of the sticky group header of the component.
|
|
16
|
+
*/
|
|
17
|
+
render?: any;
|
|
18
|
+
}
|
|
19
|
+
export interface GroupStickyHeaderAll extends Vue2type {
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
declare let GroupStickyHeaderVue2: ComponentOptions<Vue2type, DefaultData<{}>, DefaultMethods<{}>, {}, RecordPropsDefinition<GroupStickyHeaderProps>>;
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
declare const GroupStickyHeader: DefineComponent<GroupStickyHeaderProps, any, {}, {}, {}, {}, {}, {}, string, GroupStickyHeaderProps, GroupStickyHeaderProps, {}>;
|
|
29
|
+
export { GroupStickyHeader, GroupStickyHeaderVue2 };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __assign = undefined && undefined.__assign || function () {
|
|
4
|
+
__assign = Object.assign || function (t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) {
|
|
8
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
return __assign.apply(this, arguments);
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", {
|
|
16
|
+
value: true
|
|
17
|
+
});
|
|
18
|
+
exports.GroupStickyHeaderVue2 = exports.GroupStickyHeader = void 0;
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
var Vue = require("vue");
|
|
21
|
+
var allVue = Vue;
|
|
22
|
+
var gh = allVue.h;
|
|
23
|
+
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
24
|
+
var ref = allVue.ref;
|
|
25
|
+
var kendo_vue_common_1 = require("@progress/kendo-vue-common");
|
|
26
|
+
/**
|
|
27
|
+
* @hidden
|
|
28
|
+
*/
|
|
29
|
+
var GroupStickyHeaderVue2 = {
|
|
30
|
+
name: 'KendoGroupStickyHeader',
|
|
31
|
+
props: {
|
|
32
|
+
group: String,
|
|
33
|
+
render: Object
|
|
34
|
+
},
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
setup: !isV3 ? undefined : function () {
|
|
37
|
+
var v3 = !!isV3;
|
|
38
|
+
return {
|
|
39
|
+
v3: v3
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
render: function render(createElement) {
|
|
44
|
+
var h = gh || createElement;
|
|
45
|
+
var _a = this.$props,
|
|
46
|
+
group = _a.group,
|
|
47
|
+
render = _a.render;
|
|
48
|
+
var defaulGroupStickyHeader = h("div", {
|
|
49
|
+
"class": "k-list-group-sticky-header"
|
|
50
|
+
}, [h("div", {
|
|
51
|
+
"class": "k-list-header-text"
|
|
52
|
+
}, [group])]);
|
|
53
|
+
return kendo_vue_common_1.getTemplate.call(this, {
|
|
54
|
+
h: h,
|
|
55
|
+
template: render,
|
|
56
|
+
defaultRendering: defaulGroupStickyHeader,
|
|
57
|
+
additionalProps: __assign({}, this.$props)
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
exports.GroupStickyHeaderVue2 = GroupStickyHeaderVue2;
|
|
62
|
+
/**
|
|
63
|
+
* @hidden
|
|
64
|
+
*/
|
|
65
|
+
var GroupStickyHeader = GroupStickyHeaderVue2;
|
|
66
|
+
exports.GroupStickyHeader = GroupStickyHeader;
|
|
@@ -23,8 +23,10 @@ export interface ListProps {
|
|
|
23
23
|
highlightSelected?: boolean;
|
|
24
24
|
onClick?: (index: number, event: any) => void;
|
|
25
25
|
itemRender?: any;
|
|
26
|
+
groupHeaderItemRender?: any;
|
|
26
27
|
noDataRender?: any;
|
|
27
28
|
scroller?: boolean;
|
|
29
|
+
groupField: string;
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
30
32
|
* @hidden
|