@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
|
}
|
|
@@ -33,6 +33,7 @@ import { List } from '../common/List.js';
|
|
|
33
33
|
import { TagList } from './TagList.js';
|
|
34
34
|
import { SearchBar } from '../common/SearchBar.js';
|
|
35
35
|
import DropDownBase from '../common/DropDownBase.js';
|
|
36
|
+
import { GroupStickyHeader } from '../common/GroupStickyHeader.js';
|
|
36
37
|
import { ClearButton } from '../common/ClearButton.js';
|
|
37
38
|
import { ActiveDescendant } from './../common/settings.js';
|
|
38
39
|
import { itemIndexStartsWith, getItemValue, areSame, matchDataCollections, removeDataItems, isPresent, preventDefaultNonInputs } from '../common/utils.js';
|
|
@@ -139,6 +140,8 @@ var MultiSelectVue2 = {
|
|
|
139
140
|
}
|
|
140
141
|
},
|
|
141
142
|
itemRender: [String, Function, Object],
|
|
143
|
+
groupHeaderItemRender: [String, Function, Object],
|
|
144
|
+
groupStickyHeaderItemRender: [String, Function, Object],
|
|
142
145
|
listNoDataRender: [String, Function, Object],
|
|
143
146
|
focusedItemIndex: Function,
|
|
144
147
|
virtual: {
|
|
@@ -181,6 +184,9 @@ var MultiSelectVue2 = {
|
|
|
181
184
|
validator: function validator(value) {
|
|
182
185
|
return ['small', 'medium', 'large'].includes(value);
|
|
183
186
|
}
|
|
187
|
+
},
|
|
188
|
+
groupField: {
|
|
189
|
+
type: String
|
|
184
190
|
}
|
|
185
191
|
},
|
|
186
192
|
// @ts-ignore
|
|
@@ -232,7 +238,10 @@ var MultiSelectVue2 = {
|
|
|
232
238
|
last: ''
|
|
233
239
|
},
|
|
234
240
|
suggested: '',
|
|
235
|
-
activedescendant: ActiveDescendant.PopupList
|
|
241
|
+
activedescendant: ActiveDescendant.PopupList,
|
|
242
|
+
group: undefined,
|
|
243
|
+
isScrolling: false,
|
|
244
|
+
itemHeight: 0
|
|
236
245
|
};
|
|
237
246
|
},
|
|
238
247
|
watch: {
|
|
@@ -249,7 +258,13 @@ var MultiSelectVue2 = {
|
|
|
249
258
|
}
|
|
250
259
|
},
|
|
251
260
|
updated: function updated() {
|
|
252
|
-
var
|
|
261
|
+
var _a;
|
|
262
|
+
var _b = this.$props,
|
|
263
|
+
virtual = _b.virtual,
|
|
264
|
+
_c = _b.groupField,
|
|
265
|
+
groupField = _c === void 0 ? '' : _c,
|
|
266
|
+
_d = _b.dataItems,
|
|
267
|
+
dataItems = _d === void 0 ? [] : _d;
|
|
253
268
|
var skip = virtual ? virtual.skip : 0;
|
|
254
269
|
var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
|
|
255
270
|
var prevOpened = this.prevOpened !== undefined ? this.prevOpened : this.prevCurrentOpened;
|
|
@@ -270,29 +285,38 @@ var MultiSelectVue2 = {
|
|
|
270
285
|
if (scrollElement) {
|
|
271
286
|
this.base.vs.scrollElement = scrollElement;
|
|
272
287
|
}
|
|
273
|
-
if (list &&
|
|
288
|
+
if (list && dataItems.length) {
|
|
274
289
|
// @ts-ignore
|
|
275
290
|
this.base.vs.scrollerRef(list.$el);
|
|
276
291
|
}
|
|
277
292
|
if (!popupSettings.animate && closing) {
|
|
278
293
|
this.onPopupClosed();
|
|
279
294
|
}
|
|
280
|
-
if (
|
|
281
|
-
this.
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
295
|
+
if (!this.isScrolling) {
|
|
296
|
+
if (virtual && this.virtualTotalHasChanged) {
|
|
297
|
+
this.base.vs.calcScrollElementHeight();
|
|
298
|
+
this.base.vs.reset();
|
|
299
|
+
this.virtualTotalHasChanged = false;
|
|
300
|
+
} else {
|
|
301
|
+
var _e = this.getFocusedState(),
|
|
302
|
+
focusedItem = _e.focusedItem,
|
|
303
|
+
focusedIndex = _e.focusedIndex;
|
|
304
|
+
if (groupField !== '') {
|
|
305
|
+
focusedIndex = (_a = this.base.getGroupedDataModernMode(dataItems, groupField)) === null || _a === void 0 ? void 0 : _a.indexOf(focusedItem);
|
|
306
|
+
}
|
|
307
|
+
if (opening && virtual) {
|
|
308
|
+
this.base.scrollToVirtualItem(virtual, focusedIndex - skip);
|
|
309
|
+
this.prevCurrentOpened = true;
|
|
310
|
+
} else if (opening && !virtual) {
|
|
311
|
+
// Resets the sticky header group value for scenarios with open/close of component's popup
|
|
312
|
+
if (dataItems && dataItems.length !== 0) {
|
|
313
|
+
this.base.resetGroupStickyHeader(dataItems[0][groupField], this);
|
|
314
|
+
}
|
|
315
|
+
this.base.scrollToItem(focusedIndex);
|
|
316
|
+
this.prevCurrentOpened = true;
|
|
317
|
+
} else if (opened && prevOpened && focusedItem) {
|
|
318
|
+
this.base.scrollToItem(focusedIndex - skip);
|
|
319
|
+
}
|
|
296
320
|
}
|
|
297
321
|
}
|
|
298
322
|
this.scrollToFocused = false;
|
|
@@ -478,6 +502,10 @@ var MultiSelectVue2 = {
|
|
|
478
502
|
this.base.togglePopup(state);
|
|
479
503
|
}
|
|
480
504
|
this.base.filterChanged(value, state);
|
|
505
|
+
// Resets the value of the StickyHeader when filtering the data or just entering symbols in the input
|
|
506
|
+
if (this.$props.filterable) {
|
|
507
|
+
state.data.group = undefined;
|
|
508
|
+
}
|
|
481
509
|
this.applyState(state);
|
|
482
510
|
},
|
|
483
511
|
clearButtonClick: function clearButtonClick(event) {
|
|
@@ -505,6 +533,9 @@ var MultiSelectVue2 = {
|
|
|
505
533
|
},
|
|
506
534
|
onInputKeyDown: function onInputKeyDown(event) {
|
|
507
535
|
var _this = this;
|
|
536
|
+
if (this.isScrolling) {
|
|
537
|
+
this.isScrolling = false;
|
|
538
|
+
}
|
|
508
539
|
var keyCode = event.keyCode;
|
|
509
540
|
var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
|
|
510
541
|
var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
|
|
@@ -794,6 +825,39 @@ var MultiSelectVue2 = {
|
|
|
794
825
|
},
|
|
795
826
|
repositionPopup: function repositionPopup() {
|
|
796
827
|
this.base.repositionPopup();
|
|
828
|
+
},
|
|
829
|
+
onScroll: function onScroll(event) {
|
|
830
|
+
this.isScrolling = true;
|
|
831
|
+
var _a = this.base,
|
|
832
|
+
vs = _a.vs,
|
|
833
|
+
list = _a.list;
|
|
834
|
+
vs.scrollHandler(event);
|
|
835
|
+
var state = this.base.initState();
|
|
836
|
+
var groupField = this.$props.groupField;
|
|
837
|
+
var _b = this.$props.dataItems,
|
|
838
|
+
dataItems = _b === void 0 ? [] : _b;
|
|
839
|
+
if (!groupField || !dataItems.length) {
|
|
840
|
+
return;
|
|
841
|
+
}
|
|
842
|
+
var itemHeight = this.itemHeight = this.itemHeight || (vs.enabled ? vs.itemHeight : list ? list.children[0].offsetHeight : 0);
|
|
843
|
+
var target = event.target;
|
|
844
|
+
var scrollTop = target.scrollTop - vs.skip * itemHeight;
|
|
845
|
+
if (groupField) {
|
|
846
|
+
dataItems = this.base.getGroupedDataModernMode(dataItems, groupField);
|
|
847
|
+
}
|
|
848
|
+
var group = dataItems[0][groupField];
|
|
849
|
+
for (var i = 1; i < dataItems.length; i++) {
|
|
850
|
+
if (itemHeight * i > scrollTop) {
|
|
851
|
+
break;
|
|
852
|
+
}
|
|
853
|
+
if (dataItems[i] && dataItems[i][groupField]) {
|
|
854
|
+
group = dataItems[i][groupField];
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
if (group !== this.group) {
|
|
858
|
+
state.data.group = group;
|
|
859
|
+
this.applyState(state);
|
|
860
|
+
}
|
|
797
861
|
}
|
|
798
862
|
},
|
|
799
863
|
render: function render(createElement) {
|
|
@@ -899,14 +963,18 @@ var MultiSelectVue2 = {
|
|
|
899
963
|
};
|
|
900
964
|
var renderList = function renderList() {
|
|
901
965
|
var _this2 = this;
|
|
902
|
-
var
|
|
903
|
-
|
|
966
|
+
var groupField = this.$props.groupField;
|
|
967
|
+
var dataItems = this.$props.dataItems || [];
|
|
904
968
|
var itemRender = templateRendering.call(this, this.$props.itemRender, getListeners.call(this));
|
|
969
|
+
var groupHeaderItemRender = templateRendering.call(this, this.$props.groupHeaderItemRender, getListeners.call(this));
|
|
905
970
|
var listNoDataRender = templateRendering.call(this, this.$props.listNoDataRender, getListeners.call(this));
|
|
906
971
|
var skip = virtual ? virtual.skip : 0;
|
|
907
972
|
var opened = this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
|
|
908
973
|
var focusedIndex = this.getFocusedState().focusedIndex;
|
|
909
974
|
var translate = "translateY(".concat(vs.translate, "px)");
|
|
975
|
+
if (groupField) {
|
|
976
|
+
dataItems = this.base.getGroupedDataModernMode(dataItems, groupField);
|
|
977
|
+
}
|
|
910
978
|
return (
|
|
911
979
|
// @ts-ignore function children
|
|
912
980
|
h(List, {
|
|
@@ -929,7 +997,9 @@ var MultiSelectVue2 = {
|
|
|
929
997
|
} : undefined,
|
|
930
998
|
skip: skip,
|
|
931
999
|
itemRender: itemRender,
|
|
932
|
-
|
|
1000
|
+
groupHeaderItemRender: groupHeaderItemRender,
|
|
1001
|
+
noDataRender: listNoDataRender,
|
|
1002
|
+
groupField: groupField
|
|
933
1003
|
},
|
|
934
1004
|
show: opened,
|
|
935
1005
|
dataItems: dataItems.slice(),
|
|
@@ -951,11 +1021,13 @@ var MultiSelectVue2 = {
|
|
|
951
1021
|
onListclick: this.handleItemClick,
|
|
952
1022
|
on: this.v3 ? undefined : {
|
|
953
1023
|
"listclick": this.handleItemClick,
|
|
954
|
-
"scroll":
|
|
1024
|
+
"scroll": this.onScroll
|
|
955
1025
|
},
|
|
956
1026
|
itemRender: itemRender,
|
|
1027
|
+
groupHeaderItemRender: groupHeaderItemRender,
|
|
957
1028
|
noDataRender: listNoDataRender,
|
|
958
|
-
|
|
1029
|
+
groupField: groupField,
|
|
1030
|
+
onScroll: this.onScroll
|
|
959
1031
|
}, this.v3 ? function () {
|
|
960
1032
|
return [renderScrollElement.call(_this2)];
|
|
961
1033
|
} : [renderScrollElement.call(_this2)])
|
|
@@ -977,6 +1049,7 @@ var MultiSelectVue2 = {
|
|
|
977
1049
|
dataItems = _c === void 0 ? [] : _c;
|
|
978
1050
|
var headerTemplate = templateRendering.call(this, this.$props.header, getListeners.call(this));
|
|
979
1051
|
var footerTemplate = templateRendering.call(this, this.$props.footer, getListeners.call(this));
|
|
1052
|
+
var groupStickyHeaderTemplate = templateRendering.call(this, this.$props.groupStickyHeaderItemRender, getListeners.call(this));
|
|
980
1053
|
var header = getTemplate.call(this, {
|
|
981
1054
|
h: h,
|
|
982
1055
|
template: headerTemplate
|
|
@@ -1011,6 +1084,9 @@ var MultiSelectVue2 = {
|
|
|
1011
1084
|
float: 'right'
|
|
1012
1085
|
}
|
|
1013
1086
|
})])]);
|
|
1087
|
+
if (this.group === undefined && this.$props.groupField !== undefined) {
|
|
1088
|
+
this.group = getItemValue(dataItems[0], this.$props.groupField);
|
|
1089
|
+
}
|
|
1014
1090
|
return (
|
|
1015
1091
|
// @ts-ignore function children
|
|
1016
1092
|
h(ListContainer, {
|
|
@@ -1048,12 +1124,26 @@ var MultiSelectVue2 = {
|
|
|
1048
1124
|
}, this.v3 ? function () {
|
|
1049
1125
|
return [header && h("div", {
|
|
1050
1126
|
"class": "k-list-header"
|
|
1051
|
-
}, [header]), customItem,
|
|
1127
|
+
}, [header]), customItem, _this3.group && dataItems.length !== 0 && h(GroupStickyHeader, {
|
|
1128
|
+
group: _this3.group,
|
|
1129
|
+
attrs: _this3.v3 ? undefined : {
|
|
1130
|
+
group: _this3.group,
|
|
1131
|
+
render: groupStickyHeaderTemplate
|
|
1132
|
+
},
|
|
1133
|
+
render: groupStickyHeaderTemplate
|
|
1134
|
+
}), renderList.call(_this3), footer && h("div", {
|
|
1052
1135
|
"class": "k-list-footer"
|
|
1053
1136
|
}, [footer]), virtual && header];
|
|
1054
1137
|
} : [header && h("div", {
|
|
1055
1138
|
"class": "k-list-header"
|
|
1056
|
-
}, [header]), customItem,
|
|
1139
|
+
}, [header]), customItem, _this3.group && dataItems.length !== 0 && h(GroupStickyHeader, {
|
|
1140
|
+
group: _this3.group,
|
|
1141
|
+
attrs: _this3.v3 ? undefined : {
|
|
1142
|
+
group: _this3.group,
|
|
1143
|
+
render: groupStickyHeaderTemplate
|
|
1144
|
+
},
|
|
1145
|
+
render: groupStickyHeaderTemplate
|
|
1146
|
+
}), renderList.call(_this3), footer && h("div", {
|
|
1057
1147
|
"class": "k-list-footer"
|
|
1058
1148
|
}, [footer]), virtual && header])
|
|
1059
1149
|
);
|
|
@@ -1114,8 +1204,12 @@ var MultiSelectVue2 = {
|
|
|
1114
1204
|
on: this.v3 ? undefined : {
|
|
1115
1205
|
"clearclick": this.clearButtonClick
|
|
1116
1206
|
}
|
|
1117
|
-
}), h(
|
|
1118
|
-
|
|
1207
|
+
}), h(Icon, {
|
|
1208
|
+
name: loading ? 'loading' : '',
|
|
1209
|
+
attrs: this.v3 ? undefined : {
|
|
1210
|
+
name: loading ? 'loading' : ''
|
|
1211
|
+
},
|
|
1212
|
+
"class": 'k-input-loading-icon'
|
|
1119
1213
|
}), renderListContainer.call(this)]);
|
|
1120
1214
|
return label ? h("span", {
|
|
1121
1215
|
"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
|
}
|
|
@@ -70,8 +70,8 @@ var MultiSelectTreeVue2 = {
|
|
|
70
70
|
focus: null,
|
|
71
71
|
blur: null,
|
|
72
72
|
change: null,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
filterchange: null,
|
|
74
|
+
expandchange: null,
|
|
75
75
|
'changemodel': null,
|
|
76
76
|
'update:modelValue': null
|
|
77
77
|
},
|
|
@@ -298,7 +298,7 @@ var MultiSelectTreeVue2 = {
|
|
|
298
298
|
fillMode = _e.fillMode;
|
|
299
299
|
var multiselecttree = h("span", {
|
|
300
300
|
ref: setRef(this, 'kendoAnchor', this.anchor),
|
|
301
|
-
"class": classNames('k-
|
|
301
|
+
"class": 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)),
|
|
302
302
|
tabIndex: tabIndex,
|
|
303
303
|
attrs: this.v3 ? undefined : {
|
|
304
304
|
tabIndex: tabIndex,
|
|
@@ -306,12 +306,12 @@ var MultiSelectTreeVue2 = {
|
|
|
306
306
|
id: id,
|
|
307
307
|
dir: dir,
|
|
308
308
|
role: "combobox",
|
|
309
|
-
"aria-haspopup": "
|
|
309
|
+
"aria-haspopup": "tree",
|
|
310
310
|
"aria-expanded": this.isOpen,
|
|
311
311
|
"aria-disabled": disabled,
|
|
312
312
|
"aria-label": label,
|
|
313
313
|
"aria-labelledby": this.$props.ariaLabelledBy,
|
|
314
|
-
"aria-describedby": this.$props.
|
|
314
|
+
"aria-describedby": this.$props.ariaLabelledBy ? this.$props.ariaLabelledBy : 'tagslist-' + id,
|
|
315
315
|
"aria-required": this.$props.required
|
|
316
316
|
},
|
|
317
317
|
accessKey: this.$props.accessKey,
|
|
@@ -329,12 +329,12 @@ var MultiSelectTreeVue2 = {
|
|
|
329
329
|
onFocusin: this.onFocus,
|
|
330
330
|
onFocusout: this.onBlur,
|
|
331
331
|
role: "combobox",
|
|
332
|
-
"aria-haspopup": "
|
|
332
|
+
"aria-haspopup": "tree",
|
|
333
333
|
"aria-expanded": this.isOpen,
|
|
334
334
|
"aria-disabled": disabled,
|
|
335
335
|
"aria-label": label,
|
|
336
336
|
"aria-labelledby": this.$props.ariaLabelledBy,
|
|
337
|
-
"aria-describedby": this.$props.
|
|
337
|
+
"aria-describedby": this.$props.ariaLabelledBy ? this.$props.ariaLabelledBy : 'tagslist-' + id,
|
|
338
338
|
"aria-required": this.$props.required,
|
|
339
339
|
onClick: this.onWrapperClick
|
|
340
340
|
}, [h("div", {
|
|
@@ -350,7 +350,7 @@ var MultiSelectTreeVue2 = {
|
|
|
350
350
|
dataItems: this.tagsToRenderRef,
|
|
351
351
|
guid: id,
|
|
352
352
|
focused: this.focusedTagState ? this.tagsToRenderRef.find(function (t) {
|
|
353
|
-
return matchTags(t, _this.focusedTagState, dataItemKey);
|
|
353
|
+
return _this.focusedTagState && matchTags(t, _this.focusedTagState, dataItemKey);
|
|
354
354
|
}) : undefined,
|
|
355
355
|
tagsRounded: rounded,
|
|
356
356
|
size: size,
|
|
@@ -363,7 +363,7 @@ var MultiSelectTreeVue2 = {
|
|
|
363
363
|
dataItems: this.tagsToRenderRef,
|
|
364
364
|
guid: id,
|
|
365
365
|
focused: this.focusedTagState ? this.tagsToRenderRef.find(function (t) {
|
|
366
|
-
return matchTags(t, _this.focusedTagState, dataItemKey);
|
|
366
|
+
return _this.focusedTagState && matchTags(t, _this.focusedTagState, dataItemKey);
|
|
367
367
|
}) : undefined,
|
|
368
368
|
tagsRounded: rounded,
|
|
369
369
|
size: size,
|
|
@@ -429,9 +429,9 @@ var MultiSelectTreeVue2 = {
|
|
|
429
429
|
width: this.popupWidth,
|
|
430
430
|
direction: dir
|
|
431
431
|
},
|
|
432
|
-
popupClass: classNames(popupSettings.popupClass, 'k-
|
|
432
|
+
popupClass: classNames(popupSettings.popupClass, 'k-multiselecttree-popup', 'popup-' + this.componentGuid),
|
|
433
433
|
attrs: this.v3 ? undefined : {
|
|
434
|
-
popupClass: classNames(popupSettings.popupClass, 'k-
|
|
434
|
+
popupClass: classNames(popupSettings.popupClass, 'k-multiselecttree-popup', 'popup-' + this.componentGuid),
|
|
435
435
|
animate: popupSettings.animate,
|
|
436
436
|
anchor: this.anchor,
|
|
437
437
|
show: this.isOpen,
|
|
@@ -726,7 +726,7 @@ var MultiSelectTreeVue2 = {
|
|
|
726
726
|
onPopupClosed: function onPopupClosed() {
|
|
727
727
|
if (this.focusedState) {
|
|
728
728
|
// Move the focus from treeview to dropdown without triggering Focus or Blur events.
|
|
729
|
-
this.focusElement(this
|
|
729
|
+
this.focusElement(this.elementRef);
|
|
730
730
|
}
|
|
731
731
|
},
|
|
732
732
|
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
|
}
|
|
@@ -113,6 +113,26 @@ var DropDownBase = /** @class */function () {
|
|
|
113
113
|
return vs.enabled = true;
|
|
114
114
|
}, 10);
|
|
115
115
|
};
|
|
116
|
+
this.getGroupedDataModernMode = function (data, groupField) {
|
|
117
|
+
var newData = [];
|
|
118
|
+
data.forEach(function (el, index) {
|
|
119
|
+
var _a;
|
|
120
|
+
if (data[index - 1] && el[groupField] !== data[index - 1][groupField]) {
|
|
121
|
+
newData.push((_a = {}, _a[groupField] = el[groupField], _a));
|
|
122
|
+
newData.push(data[index]);
|
|
123
|
+
} else {
|
|
124
|
+
newData.push(data[index]);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
return newData;
|
|
128
|
+
};
|
|
129
|
+
this.resetGroupStickyHeader = function (groupName, that) {
|
|
130
|
+
var state = _this.initState();
|
|
131
|
+
if (groupName !== that.group && that.state) {
|
|
132
|
+
that.state.data.group = groupName;
|
|
133
|
+
_this.applyState(state);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
116
136
|
validatePackage(packageMetadata);
|
|
117
137
|
this.listBoxId = guid();
|
|
118
138
|
this.guid = 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,59 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) {
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
import * as Vue from 'vue';
|
|
15
|
+
var allVue = Vue;
|
|
16
|
+
var gh = allVue.h;
|
|
17
|
+
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
18
|
+
var ref = allVue.ref;
|
|
19
|
+
import { getTemplate } from '@progress/kendo-vue-common';
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
var GroupStickyHeaderVue2 = {
|
|
24
|
+
name: 'KendoGroupStickyHeader',
|
|
25
|
+
props: {
|
|
26
|
+
group: String,
|
|
27
|
+
render: Object
|
|
28
|
+
},
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
setup: !isV3 ? undefined : function () {
|
|
31
|
+
var v3 = !!isV3;
|
|
32
|
+
return {
|
|
33
|
+
v3: v3
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
render: function render(createElement) {
|
|
38
|
+
var h = gh || createElement;
|
|
39
|
+
var _a = this.$props,
|
|
40
|
+
group = _a.group,
|
|
41
|
+
render = _a.render;
|
|
42
|
+
var defaulGroupStickyHeader = h("div", {
|
|
43
|
+
"class": "k-list-group-sticky-header"
|
|
44
|
+
}, [h("div", {
|
|
45
|
+
"class": "k-list-header-text"
|
|
46
|
+
}, [group])]);
|
|
47
|
+
return getTemplate.call(this, {
|
|
48
|
+
h: h,
|
|
49
|
+
template: render,
|
|
50
|
+
defaultRendering: defaulGroupStickyHeader,
|
|
51
|
+
additionalProps: __assign({}, this.$props)
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* @hidden
|
|
57
|
+
*/
|
|
58
|
+
var GroupStickyHeader = GroupStickyHeaderVue2;
|
|
59
|
+
export { GroupStickyHeader, GroupStickyHeaderVue2 };
|
|
@@ -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
|