@progress/kendo-vue-dropdowns 8.0.0-develop.4 → 8.0.0-develop.5

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.
@@ -5,115 +5,128 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- var h = Object.defineProperty;
9
- var d = (a, e, t) => e in a ? h(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
10
- var p = (a, e, t) => d(a, typeof e != "symbol" ? e + "" : e, t);
11
- import u from "./VirtualScroll.mjs";
12
- import { Navigation as g } from "./Navigation.mjs";
13
- import { scrollToItem as m, areSame as r } from "./utils.mjs";
14
- import { validatePackage as f, guid as l, templateRendering as S, getListeners as v, getTemplate as y } from "@progress/kendo-vue-common";
15
- import { packageMetadata as k } from "../package-metadata.mjs";
16
- class C {
17
- constructor(e) {
18
- p(this, "vs", new u());
19
- p(this, "navigation", new g());
20
- p(this, "handleItemClick", (e, t) => {
21
- const n = this.initState();
22
- n.event = t, this.component.handleItemSelect(e, n), this.togglePopup(n), this.applyState(n);
8
+ var m = Object.defineProperty;
9
+ var f = (l, t, o) => t in l ? m(l, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : l[t] = o;
10
+ var p = (l, t, o) => f(l, typeof t != "symbol" ? t + "" : t, o);
11
+ import S from "./VirtualScroll.mjs";
12
+ import { Navigation as v } from "./Navigation.mjs";
13
+ import { scrollToItem as y, areSame as a } from "./utils.mjs";
14
+ import { validatePackage as k, guid as u, templateRendering as C, getListeners as T, getTemplate as w } from "@progress/kendo-vue-common";
15
+ import { packageMetadata as P } from "../package-metadata.mjs";
16
+ class $ {
17
+ constructor(t) {
18
+ p(this, "vs", new S());
19
+ p(this, "navigation", new v());
20
+ p(this, "handleItemClick", (t, o) => {
21
+ const e = this.initState();
22
+ e.event = o, this.component.handleItemSelect(t, e), this.togglePopup(e), this.applyState(e);
23
23
  });
24
- p(this, "handleFocus", (e) => {
24
+ p(this, "handleFocus", (t) => {
25
25
  if (!this.component.currentFocused) {
26
- const t = this.initState();
27
- t.data.currentFocused = !0, t.events.push({
26
+ const o = this.initState();
27
+ o.data.currentFocused = !0, o.events.push({
28
28
  type: "focus"
29
- }), t.event = e, this.applyState(t);
29
+ }), o.event = t, this.applyState(o);
30
30
  }
31
31
  });
32
- p(this, "filterChanged", (e, t) => {
33
- const n = this.component, {
32
+ p(this, "filterChanged", (t, o) => {
33
+ const e = this.component, {
34
34
  textField: i,
35
- filterable: o
36
- } = n.$props;
37
- o && (t.events.push({
35
+ filterable: n
36
+ } = e.$props;
37
+ n && (o.events.push({
38
38
  type: "filterchange",
39
39
  filter: {
40
40
  field: i,
41
41
  operator: "contains",
42
42
  ignoreCase: !0,
43
- value: e
43
+ value: t
44
44
  }
45
45
  }), this.repositionPopup());
46
46
  });
47
- p(this, "togglePopup", (e) => {
48
- const t = this.component.$props, n = t.opened !== void 0 ? t.opened : this.component.currentOpened;
49
- t.opened === void 0 && (e.data.currentOpened = !n), n ? e.events.push({
47
+ p(this, "togglePopup", (t) => {
48
+ const o = this.component.$props, e = o.opened !== void 0 ? o.opened : this.component.currentOpened;
49
+ o.opened === void 0 && (t.data.currentOpened = !e), e ? t.events.push({
50
50
  type: "close"
51
- }) : (e.events.push({
51
+ }) : (t.events.push({
52
52
  type: "open"
53
53
  }), this.calculatePopupWidth());
54
54
  });
55
- p(this, "pageChange", (e, t) => {
56
- const n = this.initState();
57
- n.event = t, this.triggerOnPageChange(n, e.skip, e.take), this.applyState(n);
55
+ p(this, "pageChange", (t, o) => {
56
+ const e = this.initState();
57
+ e.event = o, this.triggerOnPageChange(e, t.skip, t.take), this.applyState(e);
58
58
  });
59
- p(this, "scrollChange", (e) => {
60
- this.component.$emit("scroll", e);
59
+ p(this, "scrollChange", (t) => {
60
+ this.component.$emit("scroll", t);
61
61
  });
62
- p(this, "scrollToVirtualItem", (e, t) => {
63
- const n = this.vs;
64
- if (n.enabled = !1, e.skip === 0)
65
- n.reset();
66
- else if (e.skip + e.pageSize === e.total)
67
- n.scrollToEnd();
62
+ p(this, "scrollToVirtualItem", (t, o) => {
63
+ const e = this.vs;
64
+ if (e.enabled = !1, t.skip === 0)
65
+ e.reset();
66
+ else if (t.skip + t.pageSize === t.total)
67
+ e.scrollToEnd();
68
68
  else {
69
- let i = n.translate;
70
- i === 0 && (n.calcScrollElementHeight(), i = n.itemHeight * e.skip, n.translateTo(i - n.itemHeight)), n.container && (n.container.scrollTop = i), this.scrollToItem(t, !0);
69
+ let i = e.translate;
70
+ i === 0 && (e.calcScrollElementHeight(), i = e.itemHeight * t.skip, e.translateTo(i - e.itemHeight)), e.container && (e.container.scrollTop = i), this.scrollToItem(o, !0);
71
71
  }
72
- setTimeout(() => n.enabled = !0, 10);
72
+ setTimeout(() => e.enabled = !0, 10);
73
73
  });
74
- p(this, "getGroupedDataModernMode", (e, t) => {
75
- const n = [];
76
- return e.forEach((i, o) => {
77
- e[o - 1] && i[t] !== e[o - 1][t] && n.push({
78
- [t]: i[t]
79
- }), n.push(e[o]);
80
- }), n;
74
+ p(this, "getGroupedDataModernMode", (t, o) => {
75
+ const e = [];
76
+ return t.forEach((i, n) => {
77
+ t[n - 1] && i[o] !== t[n - 1][o] && e.push({
78
+ [o]: i[o]
79
+ }), e.push(t[n]);
80
+ }), e;
81
81
  });
82
- p(this, "resetGroupStickyHeader", (e, t) => {
83
- const n = this.initState();
84
- e !== t.group && t.state && (t.state.data.group = e, this.applyState(n));
82
+ p(this, "resetGroupStickyHeader", (t, o) => {
83
+ const e = this.initState();
84
+ t !== o.group && o.state && (o.state.data.group = t, this.applyState(e));
85
85
  });
86
- f(k), this.listBoxId = l(), this.guid = l(), this.component = e, this.vs.PageChange = this.pageChange, this.vs.ScrollChange = this.scrollChange;
86
+ k(P), this.listBoxId = u(), this.guid = u(), this.component = t, this.vs.PageChange = this.pageChange, this.vs.ScrollChange = this.scrollChange;
87
87
  }
88
88
  didMount() {
89
- const e = this.component.$props, t = e.popupSettings, n = e.style, i = t && t.width;
90
- let o = e.opened === !0;
91
- i === void 0 && this.calculatePopupWidth(), e.dir === void 0 && n && n.direction === void 0 && (this.calculateDir(), o = !0), o && this.component.$forceUpdate();
89
+ const t = this.component.$props, o = t.popupSettings, e = t.style, i = o && o.width;
90
+ let n = t.opened === !0;
91
+ i === void 0 && this.calculatePopupWidth(), t.dir === void 0 && e && e.direction === void 0 && (this.calculateDir(), n = !0), n && this.component.$forceUpdate();
92
92
  }
93
93
  calculateDir() {
94
94
  this.component.element && (this.dirCalculated = window.getComputedStyle(this.component.element).direction || void 0);
95
95
  }
96
96
  calculatePopupWidth() {
97
- const e = this.component.$props, t = e.popupSettings, n = t && t.width;
98
- this.wrapper && !n && (this.component.popupWidth = e.popupSettings.width !== void 0 ? e.popupSettings.width : this.wrapper.offsetWidth + "px");
97
+ const t = this.component.$props, o = t.popupSettings, e = o && o.width;
98
+ this.wrapper && !e && (this.component.popupWidth = t.popupSettings.width !== void 0 ? t.popupSettings.width : this.wrapper.offsetWidth + "px");
99
99
  }
100
- scrollToItem(e, t) {
101
- const n = this.list || this.vs.list, i = n ? n.children[0] : void 0;
102
- if (i && e >= 0) {
103
- const o = this.vs, s = o.container || n.parentNode;
104
- if (s) {
105
- const c = t !== void 0 ? t : o.enabled;
106
- m(s, i.offsetHeight, e, o.translate, c);
107
- }
108
- }
100
+ scrollVirtualized(t) {
101
+ const o = this.list || this.vs.list, e = o == null ? void 0 : o.querySelector(".k-list-item");
102
+ if (!e)
103
+ return;
104
+ const i = this.vs, n = i.container || o.parentNode;
105
+ n && y(n, e.offsetHeight, t, i.translate);
106
+ }
107
+ scrollNonVirtualized(t, o) {
108
+ const e = o.parentNode;
109
+ if (!e || e.scrollHeight <= e.offsetHeight)
110
+ return;
111
+ const n = e.querySelectorAll(".k-list-item, .k-list-group-item")[t];
112
+ if (!n)
113
+ return;
114
+ const s = n.getBoundingClientRect(), c = e.getBoundingClientRect(), r = s.top - c.top + e.scrollTop, g = r + s.height, h = e.scrollTop, d = h + e.offsetHeight;
115
+ g > d ? e.scrollTop = r + s.height - e.offsetHeight : r < h && (e.scrollTop = r);
116
+ }
117
+ scrollToItem(t, o) {
118
+ const e = this.list || this.vs.list;
119
+ if (!e || t < 0)
120
+ return;
121
+ (o != null ? o : this.vs.enabled) ? this.scrollVirtualized(t) : this.scrollNonVirtualized(t, e);
109
122
  }
110
123
  repositionPopup() {
111
- const e = this.component;
124
+ const t = this.component;
112
125
  setTimeout(function() {
113
- const t = e.$refs.container;
114
- if (t) {
115
- const n = t.$refs.popup;
116
- n && n.show && n.reposition();
126
+ const o = t.$refs.container;
127
+ if (o) {
128
+ const e = o.$refs.popup;
129
+ e && e.show && e.reposition();
117
130
  }
118
131
  }, 5);
119
132
  }
@@ -124,63 +137,63 @@ class C {
124
137
  event: void 0
125
138
  };
126
139
  }
127
- applyState(e) {
128
- Object.keys(e.data).length > 0 && Object.keys(e.data).forEach((i) => {
129
- this.component[i] = e.data[i];
140
+ applyState(t) {
141
+ Object.keys(t.data).length > 0 && Object.keys(t.data).forEach((i) => {
142
+ this.component[i] = t.data[i];
130
143
  });
131
- const t = this.component.primitiveValue(), n = {
132
- event: e.event,
144
+ const o = this.component.primitiveValue(), e = {
145
+ event: t.event,
133
146
  component: this.component,
134
147
  target: {
135
148
  name: this.component.$props.name,
136
- value: t
149
+ value: o
137
150
  },
138
- value: t
151
+ value: o
139
152
  };
140
- e.events.forEach((i) => {
153
+ t.events.forEach((i) => {
141
154
  const {
142
- type: o
155
+ type: n
143
156
  } = i;
144
- delete i.type, o && (o === "change" && (this.component.$emit("changemodel", t), this.component.$emit("update:modelValue", t)), this.component.$emit(o, {
145
- ...n,
157
+ delete i.type, n && (n === "change" && (this.component.$emit("changemodel", o), this.component.$emit("update:modelValue", o)), this.component.$emit(n, {
158
+ ...e,
146
159
  ...i
147
160
  }));
148
161
  });
149
162
  }
150
- triggerOnPageChange(e, t, n) {
163
+ triggerOnPageChange(t, o, e) {
151
164
  const i = this.component.$props.virtual;
152
165
  if (i) {
153
- const o = Math.min(Math.max(0, t), Math.max(0, i.total - n));
154
- o !== i.skip && e.events.push({
166
+ const n = Math.min(Math.max(0, o), Math.max(0, i.total - e));
167
+ n !== i.skip && t.events.push({
155
168
  type: "pagechange",
156
169
  page: {
157
- skip: o,
158
- take: n
170
+ skip: n,
171
+ take: e
159
172
  }
160
173
  });
161
174
  }
162
175
  }
163
- triggerPageChangeCornerItems(e, t) {
164
- const n = this.component.$props, {
176
+ triggerPageChangeCornerItems(t, o) {
177
+ const e = this.component.$props, {
165
178
  dataItems: i = [],
166
- dataItemKey: o,
179
+ dataItemKey: n,
167
180
  virtual: s
168
- } = n, c = n.opened !== void 0 ? n.opened : this.component.currentOpened;
169
- e && s && this.vs.enabled && (s.skip > 0 && r(e, i[0], o) ? this.triggerOnPageChange(t, s.skip - 1, s.pageSize) : s.skip + s.pageSize < s.total && r(e, i[i.length - 1], o) ? this.triggerOnPageChange(t, s.skip + 1, s.pageSize) : !c && s.skip + s.pageSize < s.total && r(e, i[i.length - 1], o) && this.triggerOnPageChange(t, s.skip + 1, s.pageSize));
181
+ } = e, c = e.opened !== void 0 ? e.opened : this.component.currentOpened;
182
+ t && s && this.vs.enabled && (s.skip > 0 && a(t, i[0], n) ? this.triggerOnPageChange(o, s.skip - 1, s.pageSize) : s.skip + s.pageSize < s.total && a(t, i[i.length - 1], n) ? this.triggerOnPageChange(o, s.skip + 1, s.pageSize) : !c && s.skip + s.pageSize < s.total && a(t, i[i.length - 1], n) && this.triggerOnPageChange(o, s.skip + 1, s.pageSize));
170
183
  }
171
- getTemplateDef(e, t) {
172
- const n = S.call(this, e, v.call(this));
173
- return y.call(this, {
174
- h: t,
175
- template: n
184
+ getTemplateDef(t, o) {
185
+ const e = C.call(this, t, T.call(this));
186
+ return w.call(this, {
187
+ h: o,
188
+ template: e
176
189
  });
177
190
  }
178
- getListItemHeight(e) {
179
- const t = e && window.getComputedStyle(e);
180
- return t ? t.height.slice(0, t.height.length - 2) : 0;
191
+ getListItemHeight(t) {
192
+ const o = t && window.getComputedStyle(t);
193
+ return o ? o.height.slice(0, o.height.length - 2) : 0;
181
194
  }
182
195
  }
183
- p(C, "defaultProps", {
196
+ p($, "defaultProps", {
184
197
  popupSettings: {
185
198
  animate: !0,
186
199
  height: "200px"
@@ -189,5 +202,5 @@ p(C, "defaultProps", {
189
202
  validityStyles: !0
190
203
  });
191
204
  export {
192
- C as default
205
+ $ as default
193
206
  };
package/common/List.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),w=require("./ListItem.js"),A=require("./ListGroupItem.js"),c=require("./utils.js"),u=require("@progress/kendo-vue-common"),z=require("@progress/kendo-vue-intl"),f=require("../messages/main.js"),D=e.defineComponent({name:"list",emits:{listclick:t=>!0,scroll:t=>!0},inheritAttrs:!1,props:{id:String,show:Boolean,dataItems:Array,value:[Object,String,Number,Boolean,Array],textField:String,valueField:String,optionsGuid:String,wrapperCssClass:String,wrapperStyle:Object,listStyle:Object,skip:Number,focusedIndex:Number,highlightSelected:{type:Boolean,default:!0},itemRender:[String,Function,Object],groupHeaderItemRender:[String,Function,Object],noDataRender:[String,Function,Object],scroller:Boolean,groupField:String},inject:{kendoLocalizationService:{default:null}},setup(){const t=e.ref(null),r=e.inject("kendoLocalizationService",{});return{listRef:t,kendoLocalizationService:r}},mounted(){this.list=u.getRef(this,"list")},methods:{handleClick(t,r){this.$emit("listclick",t,r)},handleScroll(t){this.$emit("scroll",t)}},render(){const t=u.getDefaultSlots(this),r=z.provideLocalizationService(this),{id:y,show:b,wrapperCssClass:R,wrapperStyle:j,listStyle:L,listRef:B}=this.$props,V=function(){const p=this.$props.noDataRender,l=e.createVNode("div",{class:"k-nodata"},[e.createVNode("div",null,[r.toLanguageString(f.nodata,f.messages[f.nodata])])]);return u.getTemplate.call(this,{h:e.h,template:p,defaultRendering:l})},S=function(){const{textField:p,valueField:l,optionsGuid:v,skip:C=0,focusedIndex:F,highlightSelected:N,value:g,groupField:o,itemRender:O,groupHeaderItemRender:$,dataItems:I}=this.$props,k=Array.isArray(g);let s=0;return I.map(function(n,h){const i=C+h,q=N&&(!k&&c.areSame(n,g,l)||k&&g.findIndex(x=>c.areSame(x,n,l))!==-1);let a,d,m;return h>0&&o!==void 0&&(d=c.getItemValue(n,o),m=c.getItemValue(I[h-1],o),d&&m&&d!==m!==void 0&&(a=d)),a!==void 0&&Object.keys(n).length===1&&(s+=1),a!==void 0&&n[o]!==void 0&&Object.keys(n).length===1?e.createVNode(A.ListGroupItem,{id:`option-${v}-${i}`,key:i+"-group-item",group:a,render:$},null):e.createVNode(w.ListItem,{id:`option-${v}-${i}`,dataItem:n,selected:q,focused:F===i-s,index:i-s,key:i-s,onItemClick:this.handleClick,textField:p,render:O},null)},this)}.call(this);return S.length?e.createVNode("div",{class:R,style:j,unselectable:"on",onScroll:this.handleScroll},[e.createVNode("ul",{id:y,role:"listbox","aria-live":"polite","aria-hidden":b?void 0:!0,class:"k-list-ul",ref:u.setRef(this,"list"),style:L},[S]),t]):V.call(this)}});exports.List=D;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),_=require("./ListItem.js"),E=require("./ListGroupItem.js"),j=require("./utils.js"),p=require("@progress/kendo-vue-common"),H=require("@progress/kendo-vue-intl"),S=require("../messages/main.js"),T=i.defineComponent({name:"list",emits:{listclick:s=>!0,scroll:s=>!0},inheritAttrs:!1,props:{id:String,show:Boolean,dataItems:Array,value:[Object,String,Number,Boolean,Array],textField:String,valueField:String,optionsGuid:String,wrapperCssClass:String,wrapperStyle:Object,listStyle:Object,skip:Number,focusedIndex:Number,highlightSelected:{type:Boolean,default:!0},itemRender:[String,Function,Object],groupHeaderItemRender:[String,Function,Object],noDataRender:[String,Function,Object],scroller:Boolean,groupField:String,actionsField:String,descriptionField:String,iconField:String,svgIconField:String,checkboxField:String},inject:{kendoLocalizationService:{default:null}},setup(){const s=i.ref(null),a=i.inject("kendoLocalizationService",{});return{listRef:s,kendoLocalizationService:a}},mounted(){this.list=p.getRef(this,"list")},methods:{handleClick(s,a){this.$emit("listclick",s,a)},handleScroll(s){this.$emit("scroll",s)}},render(){const s=p.getDefaultSlots(this),a=H.provideLocalizationService(this),{id:F,show:y,wrapperCssClass:V,wrapperStyle:C,listStyle:m,listRef:M}=this.$props,b=function(){const t=this.$props.noDataRender,n=i.createVNode("div",{class:"k-nodata","aria-live":"polite"},[i.createVNode("div",null,[a.toLanguageString(S.nodata,S.messages[S.nodata])])]);return p.getTemplate.call(this,{h:i.h,template:t,defaultRendering:n})},k=function(){const{textField:t,valueField:n,optionsGuid:e,skip:u=0,focusedIndex:c,highlightSelected:r,value:d,groupField:o,itemRender:I,groupHeaderItemRender:h,dataItems:g,actionsField:q,descriptionField:w,iconField:x,svgIconField:L,checkboxField:A}=this.$props,N=Array.isArray(d);let $=0;return g.map(function(l,R){const G=u+R;if(o&&(l==null?void 0:l[o])!==void 0&&(t?l[t]===void 0:Object.keys(l).length===1))return i.createVNode(E.ListGroupItem,{id:`option-${e}-${G}`,key:R+"-group-item",group:l[o],render:h,iconField:x,svgIconField:L,groupItem:l},null);const f=u+$;$+=1;const z=r&&(!N&&j.areSame(l,d,n)||N&&d.findIndex(B=>j.areSame(B,l,n))!==-1),D=c===f;return i.createVNode(_.ListItem,{id:`option-${e}-${G}`,dataItem:l,selected:z,focused:D,index:f,key:`item-${f}`,onItemClick:this.handleClick,textField:t,render:I,actionsField:q,descriptionField:w,iconField:x,svgIconField:L,checkboxField:A},null)},this)}.call(this),v=k.filter(t=>t),O=function(){if(!this.$props.groupField)return i.createVNode("ul",{id:F,role:"listbox","aria-hidden":y?void 0:!0,class:"k-list-ul",ref:p.setRef(this,"list"),style:m},[v]);const t=[];let n=[];return v.forEach(e=>{var r,d;(((r=e==null?void 0:e.type)==null?void 0:r.name)||((d=e==null?void 0:e.type)==null?void 0:d.__name)||"")==="ListGroupItem"?(n.length>0&&t.push(n),n=[e]):e&&n.push(e)}),n.length>0&&t.push(n),t.map((e,u)=>{var d;const c=e.find(o=>{var h,g;return(((h=o==null?void 0:o.type)==null?void 0:h.name)||((g=o==null?void 0:o.type)==null?void 0:g.__name)||"")==="ListGroupItem"}),r=(d=c==null?void 0:c.props)==null?void 0:d.id;return i.createVNode("ul",{id:r?void 0:F,key:r||`group-${u}`,role:r?"group":void 0,"aria-labelledby":r,class:"k-list-ul",ref:r?void 0:p.setRef(this,"list"),style:m},[e])})};return k.length?i.createVNode("div",{class:V,style:C,role:this.$props.groupField?"listbox":void 0,"aria-hidden":this.$props.groupField&&!y?!0:void 0,unselectable:"on",onScroll:this.handleScroll},[O.call(this),s]):b.call(this)}});exports.List=T;
package/common/List.mjs CHANGED
@@ -5,18 +5,18 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as D, createVNode as i, ref as N, inject as B, h as G } from "vue";
9
- import { ListItem as V } from "./ListItem.mjs";
10
- import { ListGroupItem as E } from "./ListGroupItem.mjs";
11
- import { areSame as v, getItemValue as k } from "./utils.mjs";
12
- import { getDefaultSlots as H, setRef as T, getRef as q, getTemplate as J } from "@progress/kendo-vue-common";
13
- import { provideLocalizationService as K } from "@progress/kendo-vue-intl";
14
- import { nodata as y, messages as M } from "../messages/main.mjs";
15
- const te = /* @__PURE__ */ D({
8
+ import { defineComponent as H, createVNode as d, ref as V, inject as T, h as q } from "vue";
9
+ import { ListItem as J } from "./ListItem.mjs";
10
+ import { ListGroupItem as K } from "./ListGroupItem.mjs";
11
+ import { areSame as G } from "./utils.mjs";
12
+ import { getDefaultSlots as M, getRef as P, getTemplate as Q, setRef as j } from "@progress/kendo-vue-common";
13
+ import { provideLocalizationService as U } from "@progress/kendo-vue-intl";
14
+ import { nodata as N, messages as W } from "../messages/main.mjs";
15
+ const de = /* @__PURE__ */ H({
16
16
  name: "list",
17
17
  emits: {
18
- listclick: (e) => !0,
19
- scroll: (e) => !0
18
+ listclick: (l) => !0,
19
+ scroll: (l) => !0
20
20
  },
21
21
  inheritAttrs: !1,
22
22
  props: {
@@ -40,7 +40,12 @@ const te = /* @__PURE__ */ D({
40
40
  groupHeaderItemRender: [String, Function, Object],
41
41
  noDataRender: [String, Function, Object],
42
42
  scroller: Boolean,
43
- groupField: String
43
+ groupField: String,
44
+ actionsField: String,
45
+ descriptionField: String,
46
+ iconField: String,
47
+ svgIconField: String,
48
+ checkboxField: String
44
49
  },
45
50
  inject: {
46
51
  kendoLocalizationService: {
@@ -48,92 +53,135 @@ const te = /* @__PURE__ */ D({
48
53
  }
49
54
  },
50
55
  setup() {
51
- const e = N(null), r = B("kendoLocalizationService", {});
56
+ const l = V(null), a = T("kendoLocalizationService", {});
52
57
  return {
53
- listRef: e,
54
- kendoLocalizationService: r
58
+ listRef: l,
59
+ kendoLocalizationService: a
55
60
  };
56
61
  },
57
62
  mounted() {
58
- this.list = q(this, "list");
63
+ this.list = P(this, "list");
59
64
  },
60
65
  methods: {
61
- handleClick(e, r) {
62
- this.$emit("listclick", e, r);
66
+ handleClick(l, a) {
67
+ this.$emit("listclick", l, a);
63
68
  },
64
- handleScroll(e) {
65
- this.$emit("scroll", e);
69
+ handleScroll(l) {
70
+ this.$emit("scroll", l);
66
71
  }
67
72
  },
68
73
  render() {
69
- const e = H(this), r = K(this), {
70
- id: I,
71
- show: b,
72
- wrapperCssClass: R,
73
- wrapperStyle: j,
74
- listStyle: F,
75
- listRef: P
76
- } = this.$props, C = function() {
77
- const c = this.$props.noDataRender, l = i("div", {
78
- class: "k-nodata"
79
- }, [i("div", null, [r.toLanguageString(y, M[y])])]);
80
- return J.call(this, {
81
- h: G,
82
- template: c,
83
- defaultRendering: l
74
+ const l = M(this), a = U(this), {
75
+ id: g,
76
+ show: S,
77
+ wrapperCssClass: C,
78
+ wrapperStyle: O,
79
+ listStyle: m,
80
+ listRef: X
81
+ } = this.$props, b = function() {
82
+ const t = this.$props.noDataRender, i = d("div", {
83
+ class: "k-nodata",
84
+ "aria-live": "polite"
85
+ }, [d("div", null, [a.toLanguageString(N, W[N])])]);
86
+ return Q.call(this, {
87
+ h: q,
88
+ template: t,
89
+ defaultRendering: i
84
90
  });
85
- }, f = function() {
91
+ }, F = function() {
86
92
  const {
87
- textField: c,
88
- valueField: l,
89
- optionsGuid: h,
90
- skip: $ = 0,
91
- focusedIndex: x,
92
- highlightSelected: L,
93
- value: u,
94
- groupField: o,
95
- itemRender: O,
96
- groupHeaderItemRender: w,
97
- dataItems: g
98
- } = this.$props, S = Array.isArray(u);
99
- let s = 0;
100
- return g.map(function(t, p) {
101
- const n = $ + p, A = L && (!S && v(t, u, l) || S && u.findIndex((z) => v(z, t, l)) !== -1);
102
- let a, d, m;
103
- return p > 0 && o !== void 0 && (d = k(t, o), m = k(g[p - 1], o), d && m && d !== m !== void 0 && (a = d)), a !== void 0 && Object.keys(t).length === 1 && (s += 1), a !== void 0 && t[o] !== void 0 && Object.keys(t).length === 1 ? i(E, {
104
- id: `option-${h}-${n}`,
105
- key: n + "-group-item",
106
- group: a,
107
- render: w
108
- }, null) : i(V, {
109
- id: `option-${h}-${n}`,
110
- dataItem: t,
111
- selected: A,
112
- focused: x === n - s,
113
- index: n - s,
114
- key: n - s,
93
+ textField: t,
94
+ valueField: i,
95
+ optionsGuid: e,
96
+ skip: p = 0,
97
+ focusedIndex: c,
98
+ highlightSelected: n,
99
+ value: s,
100
+ groupField: r,
101
+ itemRender: k,
102
+ groupHeaderItemRender: u,
103
+ dataItems: h,
104
+ actionsField: A,
105
+ descriptionField: z,
106
+ iconField: v,
107
+ svgIconField: I,
108
+ checkboxField: D
109
+ } = this.$props, x = Array.isArray(s);
110
+ let $ = 0;
111
+ return h.map(function(o, L) {
112
+ const R = p + L;
113
+ if (r && (o == null ? void 0 : o[r]) !== void 0 && (t ? o[t] === void 0 : Object.keys(o).length === 1))
114
+ return d(K, {
115
+ id: `option-${e}-${R}`,
116
+ key: L + "-group-item",
117
+ group: o[r],
118
+ render: u,
119
+ iconField: v,
120
+ svgIconField: I,
121
+ groupItem: o
122
+ }, null);
123
+ const f = p + $;
124
+ $ += 1;
125
+ const B = n && (!x && G(o, s, i) || x && s.findIndex((E) => G(E, o, i)) !== -1), _ = c === f;
126
+ return d(J, {
127
+ id: `option-${e}-${R}`,
128
+ dataItem: o,
129
+ selected: B,
130
+ focused: _,
131
+ index: f,
132
+ key: `item-${f}`,
115
133
  onItemClick: this.handleClick,
116
- textField: c,
117
- render: O
134
+ textField: t,
135
+ render: k,
136
+ actionsField: A,
137
+ descriptionField: z,
138
+ iconField: v,
139
+ svgIconField: I,
140
+ checkboxField: D
118
141
  }, null);
119
142
  }, this);
120
- }.call(this);
121
- return f.length ? i("div", {
122
- class: R,
123
- style: j,
143
+ }.call(this), y = F.filter((t) => t), w = function() {
144
+ if (!this.$props.groupField)
145
+ return d("ul", {
146
+ id: g,
147
+ role: "listbox",
148
+ "aria-hidden": S ? void 0 : !0,
149
+ class: "k-list-ul",
150
+ ref: j(this, "list"),
151
+ style: m
152
+ }, [y]);
153
+ const t = [];
154
+ let i = [];
155
+ return y.forEach((e) => {
156
+ var n, s;
157
+ (((n = e == null ? void 0 : e.type) == null ? void 0 : n.name) || ((s = e == null ? void 0 : e.type) == null ? void 0 : s.__name) || "") === "ListGroupItem" ? (i.length > 0 && t.push(i), i = [e]) : e && i.push(e);
158
+ }), i.length > 0 && t.push(i), t.map((e, p) => {
159
+ var s;
160
+ const c = e.find((r) => {
161
+ var u, h;
162
+ return (((u = r == null ? void 0 : r.type) == null ? void 0 : u.name) || ((h = r == null ? void 0 : r.type) == null ? void 0 : h.__name) || "") === "ListGroupItem";
163
+ }), n = (s = c == null ? void 0 : c.props) == null ? void 0 : s.id;
164
+ return d("ul", {
165
+ id: n ? void 0 : g,
166
+ key: n || `group-${p}`,
167
+ role: n ? "group" : void 0,
168
+ "aria-labelledby": n,
169
+ class: "k-list-ul",
170
+ ref: n ? void 0 : j(this, "list"),
171
+ style: m
172
+ }, [e]);
173
+ });
174
+ };
175
+ return F.length ? d("div", {
176
+ class: C,
177
+ style: O,
178
+ role: this.$props.groupField ? "listbox" : void 0,
179
+ "aria-hidden": this.$props.groupField && !S ? !0 : void 0,
124
180
  unselectable: "on",
125
181
  onScroll: this.handleScroll
126
- }, [i("ul", {
127
- id: I,
128
- role: "listbox",
129
- "aria-live": "polite",
130
- "aria-hidden": b ? void 0 : !0,
131
- class: "k-list-ul",
132
- ref: T(this, "list"),
133
- style: F
134
- }, [f]), e]) : C.call(this);
182
+ }, [w.call(this), l]) : b.call(this);
135
183
  }
136
184
  });
137
185
  export {
138
- te as List
186
+ de as List
139
187
  };
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("@progress/kendo-vue-common"),d=e.defineComponent({name:"KendoListItem",inheritAttrs:!1,props:{id:String,group:String,render:Object},render(){const{id:t,group:r,virtual:i,render:n}=this.$props,o=e.createVNode("li",{id:t,role:"group",class:"k-list-group-item",style:{position:i?"relative":"unset"}},[e.createVNode("span",{class:n?void 0:"k-list-item-text"},[r])]);return s.getTemplate.call(this,{h:e.h,template:this.$props.render,defaultRendering:o,additionalProps:{...this.$props}})}});exports.ListGroupItem=d;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),c=require("@progress/kendo-vue-common"),a=require("./ListItemIcon.js"),p=t.defineComponent({name:"ListGroupItem",inheritAttrs:!1,props:{id:String,group:String,render:Object,iconField:String,svgIconField:String,groupItem:Object,isMultiColumn:Boolean},render(){const{id:r,group:s,virtual:i,render:l,iconField:n,svgIconField:o,groupItem:e,isMultiColumn:d=!1}=this.$props,u=t.createVNode("li",{id:r,role:"presentation",class:"k-list-group-item",style:d?{boxSizing:"inherit",position:i?"relative":"unset"}:{position:i?"relative":"unset"}},[(o||n)&&t.createVNode(a.ListItemIcon,{icon:n?e==null?void 0:e.groupIcon:void 0,svgIcon:o?e==null?void 0:e.groupSvgIcon:void 0},null),t.createVNode("span",{class:l?void 0:"k-list-item-text"},[s])]);return c.getTemplate.call(this,{h:t.h,template:this.$props.render,defaultRendering:u,additionalProps:{...this.$props}})}});exports.ListGroupItem=p;