@progress/kendo-vue-grid 7.1.0-develop.7 → 8.0.0-develop.2
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/Grid.js +1 -1
- package/Grid.mjs +220 -214
- package/GridSearchBox.js +1 -1
- package/GridSearchBox.mjs +18 -17
- package/GridState.js +1 -1
- package/GridState.mjs +2 -2
- package/common.js +1 -1
- package/common.mjs +1 -1
- package/dist/cdn/js/kendo-vue-grid.js +1 -1
- package/footer/FooterRow.js +1 -1
- package/footer/FooterRow.mjs +6 -6
- package/header/FilterRow.js +1 -1
- package/header/FilterRow.mjs +71 -60
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +99 -89
- package/index.d.mts +21 -20
- package/index.d.ts +21 -20
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +12 -12
- package/rows/GridRow.js +1 -1
- package/rows/GridRow.mjs +13 -10
- package/utils/main.js +1 -1
- package/utils/main.mjs +171 -146
- package/utils/virtualColumns.js +1 -1
- package/utils/virtualColumns.mjs +40 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-vue-grid",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-develop.2",
|
|
4
4
|
"description": "TODO",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
"@progress/kendo-data-query": "^1.7.0",
|
|
22
22
|
"@progress/kendo-drawing": "^1.21.1",
|
|
23
23
|
"@progress/kendo-licensing": "^1.7.2",
|
|
24
|
-
"@progress/kendo-vue-animation": "
|
|
25
|
-
"@progress/kendo-vue-buttons": "
|
|
26
|
-
"@progress/kendo-vue-common": "
|
|
27
|
-
"@progress/kendo-vue-data-tools": "
|
|
28
|
-
"@progress/kendo-vue-dateinputs": "
|
|
29
|
-
"@progress/kendo-vue-indicators": "
|
|
30
|
-
"@progress/kendo-vue-dropdowns": "
|
|
31
|
-
"@progress/kendo-vue-inputs": "
|
|
32
|
-
"@progress/kendo-vue-intl": "
|
|
33
|
-
"@progress/kendo-vue-popup": "
|
|
24
|
+
"@progress/kendo-vue-animation": "8.0.0-develop.2",
|
|
25
|
+
"@progress/kendo-vue-buttons": "8.0.0-develop.2",
|
|
26
|
+
"@progress/kendo-vue-common": "8.0.0-develop.2",
|
|
27
|
+
"@progress/kendo-vue-data-tools": "8.0.0-develop.2",
|
|
28
|
+
"@progress/kendo-vue-dateinputs": "8.0.0-develop.2",
|
|
29
|
+
"@progress/kendo-vue-indicators": "8.0.0-develop.2",
|
|
30
|
+
"@progress/kendo-vue-dropdowns": "8.0.0-develop.2",
|
|
31
|
+
"@progress/kendo-vue-inputs": "8.0.0-develop.2",
|
|
32
|
+
"@progress/kendo-vue-intl": "8.0.0-develop.2",
|
|
33
|
+
"@progress/kendo-vue-popup": "8.0.0-develop.2",
|
|
34
34
|
"@progress/kendo-svg-icons": "^4.4.0",
|
|
35
35
|
"vue": "^3.0.2"
|
|
36
36
|
},
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"package": {
|
|
52
52
|
"productName": "Kendo UI for Vue",
|
|
53
53
|
"productCode": "KENDOUIVUE",
|
|
54
|
-
"publishDate":
|
|
54
|
+
"publishDate": 1770620929,
|
|
55
55
|
"licensingDocsUrl": "https://www.telerik.com/kendo-vue-ui/my-license/"
|
|
56
56
|
}
|
|
57
57
|
},
|
package/rows/GridRow.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),i=require("@progress/kendo-vue-common"),n=o.defineComponent({name:"KendoGridRow",props:{rowType:String,item:Object,isAltRow:Boolean,isHidden:Boolean,isHighlighted:Boolean,onClick:Function,isInEdit:Boolean,isSelected:Boolean,selectedField:String,rowHeight:Number,ariaRowIndex:Number,absoluteRowIndex:Number,dataIndex:Number,render:[String,Function,Object],onRowclick:Function,onRowdblclick:Function},methods:{handleClick(e){this.$emit("rowclick",e)},handleDoubleClick(e){this.$emit("rowdblclick",e)}},computed:{trClass(){const{rowType:e,isAltRow:t,isInEdit:r,isHighlighted:s,isSelected:l}=this.$props;return{"k-table-row":!0,"k-selected":l,"k-highlighted":s,"k-table-group-row":e==="groupHeader","k-grouping-row":e==="groupHeader","k-group-footer":e==="groupFooter","k-master-row":e!=="groupHeader"&&e!=="groupFooter","k-table-alt-row":t,"k-edit-row":r}}},render(){const e=i.getDefaultSlots(this),t=o.createVNode("tr",{onClick:this.handleClick,onDblclick:this.handleDoubleClick,class:this.trClass,style:{height:this.$props.rowHeight?this.$props.rowHeight+"px":"",visibility:this.$props.isHidden?"hidden":""},role:"row","aria-rowindex":this.$props.ariaRowIndex,"absolute-row-index":this.$props.absoluteRowIndex,"data-grid-row-index":this.$props.rowType==="data"?this.$props.dataIndex:void 0},[e]);return i.getTemplate.call(this,{h:o.h,template:this.$props.render,defaultRendering:t,additionalProps:{...this.$props,dataItem:this.$props.item.dataItem},additionalListeners:{click:this.handleClick},defaultSlots:e,swapDefaultSlots:!0})}});exports.GridRow=n;
|
package/rows/GridRow.mjs
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as l, createVNode as s, h as
|
|
9
|
-
import { getDefaultSlots as
|
|
8
|
+
import { defineComponent as l, createVNode as s, h as d } from "vue";
|
|
9
|
+
import { getDefaultSlots as n, getTemplate as a } from "@progress/kendo-vue-common";
|
|
10
10
|
const c = /* @__PURE__ */ l({
|
|
11
11
|
name: "KendoGridRow",
|
|
12
12
|
props: {
|
|
@@ -39,8 +39,8 @@ const c = /* @__PURE__ */ l({
|
|
|
39
39
|
trClass() {
|
|
40
40
|
const {
|
|
41
41
|
rowType: e,
|
|
42
|
-
isAltRow:
|
|
43
|
-
isInEdit:
|
|
42
|
+
isAltRow: t,
|
|
43
|
+
isInEdit: o,
|
|
44
44
|
isHighlighted: i,
|
|
45
45
|
isSelected: r
|
|
46
46
|
} = this.$props;
|
|
@@ -52,13 +52,13 @@ const c = /* @__PURE__ */ l({
|
|
|
52
52
|
"k-grouping-row": e === "groupHeader",
|
|
53
53
|
"k-group-footer": e === "groupFooter",
|
|
54
54
|
"k-master-row": e !== "groupHeader" && e !== "groupFooter",
|
|
55
|
-
"k-table-alt-row":
|
|
56
|
-
"k-edit-row":
|
|
55
|
+
"k-table-alt-row": t,
|
|
56
|
+
"k-edit-row": o
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
render() {
|
|
61
|
-
const e =
|
|
61
|
+
const e = n(this), t = s("tr", {
|
|
62
62
|
onClick: this.handleClick,
|
|
63
63
|
onDblclick: this.handleDoubleClick,
|
|
64
64
|
class: this.trClass,
|
|
@@ -72,10 +72,13 @@ const c = /* @__PURE__ */ l({
|
|
|
72
72
|
"data-grid-row-index": this.$props.rowType === "data" ? this.$props.dataIndex : void 0
|
|
73
73
|
}, [e]);
|
|
74
74
|
return a.call(this, {
|
|
75
|
-
h:
|
|
75
|
+
h: d,
|
|
76
76
|
template: this.$props.render,
|
|
77
|
-
defaultRendering:
|
|
78
|
-
additionalProps:
|
|
77
|
+
defaultRendering: t,
|
|
78
|
+
additionalProps: {
|
|
79
|
+
...this.$props,
|
|
80
|
+
dataItem: this.$props.item.dataItem
|
|
81
|
+
},
|
|
79
82
|
additionalListeners: {
|
|
80
83
|
click: this.handleClick
|
|
81
84
|
},
|
package/utils/main.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("@progress/kendo-vue-data-tools"),I=require("@progress/kendo-vue-common"),D=require("../GridColumn.js"),y="string";function v(e,t){const n=e.split(".");let i=t;return n.forEach(a=>{i=i?i[a]:void 0}),i}function R(e,t,n,i,a,s,r,o,d,h,p=0,f){let c=p;for(let g=0;g<t.length;g++){let l;if(!a||t[g].value===void 0||t[g].items===void 0){const C=d?!!(s!=null&&s[I.getter(d)(t[g])]):!1;e[e.length]={dataIndex:i.index,dataItem:t[g],rowType:"data",level:p,group:f,expanded:h!==void 0?v(h,t[g]):C!=null?C:!1},i.index++;continue}else{let C;f!=null&&f.parents?C=[{field:f.field,value:f.value},...f.parents]:f?C=[f]:C=[],l={field:t[g].field,value:t[g].value,parents:C}}c=Math.max(c,p+1);let x=!1;const u=w.findGroupExpand(r||[],l);h?x=h===void 0||v(h,t[g])===void 0||v(h,t[g]):x=u?u.expanded!==!1:o!==!1,e[e.length]={dataIndex:-1,dataItem:t[g],level:p,group:l,rowType:"groupHeader",expanded:x},x&&(l.expanded=x,c=Math.max(R(e,t[g].items,n,i,a,s,r,o,d,h,p+1,l),c)),(n==="always"||x&&n==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[g],rowType:"groupFooter",level:p,expanded:x})}return c}function O(e){return e&&getComputedStyle(e).direction==="rtl"||!1}function N(e,t){if(!t||!e||!e.originalEvent||!I.canUseDOM)return-1;let n=document.elementFromPoint(e.clientX,e.originalEvent.clientY);for(;n&&n.parentElement!==t;)n=n.parentElement;const i=t.children;for(let a=0;a<i.length;a++)if(i[a]===n)return a;return-1}const A=["sortChange","filterChange","groupChange","pageChange","expandChange","selectionChange","headerSelectionChange","rowClick","itemChange","dataStateChange","columnResize","columnReorder"],H=(e,t)=>`The ${e} event handler property is deprecated, use https://www.telerik.com/kendo-vue-ui/components/grid/api/GridProps/#toc-${t} instead`;function L(e){for(let t=0;t<A.length;t++){const n=A[t];if(e[n]!==void 0){const i="on"+n.charAt(0).toUpperCase()+n.slice(1);console.warn(H(n,i))}}}function V(e,t){const n=[[]];let i=0;for(let r=e.length-1;r>=0;r--)i=Math.max(i,e[r].depth),e[r].headerColSpan=e[r].headerColSpan||1,e[r].children.length>0&&(e[r].headerColSpan=e[r].children.reduce((o,d)=>d.hidden?o:o+d.headerColSpan,0));const a=[];let s=1;return e.forEach((r,o)=>{n[r.depth]=n[r.depth]||[];let d=!1;n[r.depth].length===0&&(s<=1?s=1+(r.children.length>0?0:i-r.depth):(s--,d=!0)),r.rowSpan=1+(r.children.length>0?0:i-r.depth),r.kFirst=d,r.index=n[r.depth].length,r.ariaColumnIndex=a[r.depth]?a[r.depth]+1:1;let h=0;const p=[],f=new Set;let c=r.parentIndex;for(;c>=0&&!f.has(c);)f.add(c),p.unshift(c),c=e[c].parentIndex;for(let l=0;l<p.length;l++){const x=p[l],u=e[x],C=n[u.depth],E=C.indexOf(x);for(let S=0;S<E;S++){const m=C[S];h+=e[m].headerColSpan}}for(let l=0;l<r.depth;l++){const x=n[l]||[];for(const u of x){const C=e[u];C.depth+C.rowSpan-1>=r.depth&&(p.includes(u)||(h+=C.headerColSpan))}}const g=n[r.depth];for(const l of g){const x=e[l];x.parentIndex===r.parentIndex&&(h+=x.headerColSpan)}r.virtualColumnOffset=h,n[r.depth].push(o);for(let l=r.depth;l<r.depth+r.rowSpan;l++)a[l]=(a[l]||0)+r.headerColSpan}),w.updateLeft(n,e,t),w.updateRight(n,e,t),n}function M(e,t,n,i=0,a=!1){const s=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.forEach((o,d)=>{o=o;const h=o.id?o.id:w.tableKeyboardNavigationTools.generateNavigatableId(`${n.prevId++}`,n.idPrefix,"column"),p=I.canUseDOM&&o.media&&window.matchMedia?!window.matchMedia(o.media).matches:!1,f=a||p||o.hidden,c=t==null?void 0:t.find(l=>l.id===h),g=M(o.children,(c==null?void 0:c.children)||[],n,i+1,f);s.push({depth:i,...D.gridDefaultProps,...g.length?{cell:()=>null,filterCell:()=>null}:{},...o,id:h,declarationIndex:s.length,children:g,headerColSpan:0,rowSpan:0,columnType:o.columnType||"data",colSpan:o.colSpan||1,isAccessible:!0,hidden:f,left:null,right:null,rowSpannable:o.rowSpannable,...c?{width:c.width,orderIndex:c.orderIndex}:{}})});const r=(o,d)=>o.orderIndex===d.orderIndex?o.declarationIndex-d.declarationIndex:(o.orderIndex||0)-(d.orderIndex||0);if(s.sort(r),i===0){const o=[],d=(h,p)=>h.forEach(f=>{f.parentIndex=p,d(f.children,o.push(f)-1)});return d(s,-1),o}return s}const T=e=>Array.isArray(e)?e:e?e.data:[];function j(e,t,n,i){const a=T(e),s=[];if(a.length>0){let r=a[0];if(t)for(let d=0;d<t.length;d++)r=r.items&&r.items[0];Object.getOwnPropertyNames(r).forEach(d=>{d!==n.column&&s.push({id:w.tableKeyboardNavigationTools.generateNavigatableId(`${i.prevId++}`,i.idPrefix,"column"),declarationIndex:-1,parentIndex:-1,depth:0,colSpan:0,headerColSpan:0,rowSpan:0,index:0,columnType:"data",left:0,right:0,rightBorder:!1,children:[],ariaColumnIndex:0,isAccessible:!0,...D.gridDefaultProps,field:d})})}return s}const K=(e,t)=>{let n=e[t.parentIndex];for(;n;){if(n.footerCell)return!0;n=e[n.parentIndex]}return!1},P=e=>e.filter(t=>K(e,t)?!1:!!t.footerCell||!(t.children&&t.children.length>0)),$={number:function(e,t,n){return typeof e===y&&e.toLowerCase()==="null"?null:t.parseNumber(e,n)},date:function(e,t,n){return typeof e===y&&e.toLowerCase()==="null"?null:t.parseDate(e,n)},boolean:function(e){return typeof e===y?e.toLowerCase()==="null"?null:e.toLowerCase()==="true":e!=null?!!e:e},string:function(e){return typeof e===y&&e.toLowerCase()==="null"?null:e!=null?e+"":e},default:function(e){return e}};function F(e,t,n,i){return e.forEach(a=>{a.expanded=t[i]&&!t[i].includes(b(a,n)),a.items&&a.items.length&&(a.items=F(a.items,t,n,i+1))}),e}function z(e,t,n){return t&&t.length&&e.data.forEach(i=>{i.expanded=i.expanded!==void 0?i.expanded:t[0]&&!t[0].includes(b(i,n)),i.items&&i.items.length&&(i.items=F(i.items,t,n,1))}),e}function b(e,t){let n=e;for(;n.items&&n.items.length;)n=n.items[0];return t?n[t]:e.value}const B=e=>{const t=[],n=i=>i==null?void 0:i.forEach(a=>{t.push(a),n(a.children)});return n(e),t},U=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),q=17895697,W=e=>e.width!==void 0?Math.floor(parseFloat(e.width.toString()))+"px":void 0,X=(e,t)=>t&&t.filter(n=>n.field===e).length>0,k=e=>(e.sort((t,n)=>t.declarationIndex-n.declarationIndex),e.map(t=>{const{declarationIndex:n,parentIndex:i,depth:a,headerColSpan:s,rowSpan:r,index:o,kFirst:d,children:h,...p}=t;return h.length?{children:k(h),...p}:p})),Y=(e,t)=>typeof e.colSpan=="function"?e.colSpan({dataItem:t,column:e}):e.colSpan||1,J=e=>{var i,a;const t=typeof e=="object"?(i=e.enabled)!=null?i:!0:e!=null?e:!1,n=typeof e=="object"?(a=e.valueGetter)!=null?a:(s,r)=>I.getter(r)(s):(s,r)=>I.getter(r)(s);return{enabled:t,valueGetter:n}},Q=e=>{let t=0;if(e){const n=e.insertRow(0),i=n.insertCell(0);i.textContent=" ",t=n.getBoundingClientRect().height,e.deleteRow(0)}return t};exports.applyExpandedState=z;exports.autoGenerateColumns=j;exports.calcRowHeight=Q;exports.checkPropCompatibility=L;exports.firefox=U;exports.firefoxMaxHeight=q;exports.flatData=R;exports.footerColumns=P;exports.getColSpan=Y;exports.getColumnWidth=W;exports.getDataAsArray=T;exports.getFlatColumnsState=B;exports.getIndex=N;exports.getNestedValue=v;exports.getRowSpanOptions=J;exports.groupedFirstItemValue=b;exports.isRtl=O;exports.isSorted=X;exports.mapColumns=V;exports.parsers=$;exports.readColumns=M;exports.sanitizeColumns=k;
|
package/utils/main.mjs
CHANGED
|
@@ -5,93 +5,93 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { findGroupExpand as
|
|
9
|
-
import { getter as
|
|
10
|
-
import { gridDefaultProps as
|
|
11
|
-
const
|
|
12
|
-
function
|
|
8
|
+
import { findGroupExpand as T, updateLeft as k, updateRight as L, tableKeyboardNavigationTools as A } from "@progress/kendo-vue-data-tools";
|
|
9
|
+
import { getter as S, canUseDOM as b } from "@progress/kendo-vue-common";
|
|
10
|
+
import { gridDefaultProps as R } from "../GridColumn.mjs";
|
|
11
|
+
const u = "string";
|
|
12
|
+
function y(e, t) {
|
|
13
13
|
const n = e.split(".");
|
|
14
|
-
let
|
|
14
|
+
let i = t;
|
|
15
15
|
return n.forEach((a) => {
|
|
16
|
-
|
|
17
|
-
}),
|
|
16
|
+
i = i ? i[a] : void 0;
|
|
17
|
+
}), i;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
let
|
|
21
|
-
for (let
|
|
22
|
-
let
|
|
23
|
-
if (!a || t[
|
|
24
|
-
const
|
|
19
|
+
function N(e, t, n, i, a, s, r, d, o, h, p = 0, f) {
|
|
20
|
+
let c = p;
|
|
21
|
+
for (let g = 0; g < t.length; g++) {
|
|
22
|
+
let l;
|
|
23
|
+
if (!a || t[g].value === void 0 || t[g].items === void 0) {
|
|
24
|
+
const C = o ? !!(s != null && s[S(o)(t[g])]) : !1;
|
|
25
25
|
e[e.length] = {
|
|
26
|
-
dataIndex:
|
|
27
|
-
dataItem: t[
|
|
26
|
+
dataIndex: i.index,
|
|
27
|
+
dataItem: t[g],
|
|
28
28
|
rowType: "data",
|
|
29
|
-
level:
|
|
29
|
+
level: p,
|
|
30
30
|
group: f,
|
|
31
31
|
// This is related to detail-row expansion
|
|
32
|
-
expanded:
|
|
33
|
-
},
|
|
32
|
+
expanded: h !== void 0 ? y(h, t[g]) : C != null ? C : !1
|
|
33
|
+
}, i.index++;
|
|
34
34
|
continue;
|
|
35
35
|
} else {
|
|
36
|
-
let
|
|
37
|
-
f != null && f.parents ?
|
|
38
|
-
field: t[
|
|
39
|
-
value: t[
|
|
40
|
-
parents:
|
|
36
|
+
let C;
|
|
37
|
+
f != null && f.parents ? C = [{ field: f.field, value: f.value }, ...f.parents] : f ? C = [f] : C = [], l = {
|
|
38
|
+
field: t[g].field,
|
|
39
|
+
value: t[g].value,
|
|
40
|
+
parents: C
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
let
|
|
45
|
-
const
|
|
46
|
-
|
|
43
|
+
c = Math.max(c, p + 1);
|
|
44
|
+
let x = !1;
|
|
45
|
+
const w = T(r || [], l);
|
|
46
|
+
h ? x = h === void 0 || y(h, t[g]) === void 0 || y(h, t[g]) : x = w ? w.expanded !== !1 : d !== !1, e[e.length] = {
|
|
47
47
|
dataIndex: -1,
|
|
48
|
-
dataItem: t[
|
|
49
|
-
level:
|
|
50
|
-
group:
|
|
48
|
+
dataItem: t[g],
|
|
49
|
+
level: p,
|
|
50
|
+
group: l,
|
|
51
51
|
rowType: "groupHeader",
|
|
52
|
-
expanded:
|
|
53
|
-
},
|
|
54
|
-
|
|
52
|
+
expanded: x
|
|
53
|
+
}, x && (l.expanded = x, c = Math.max(
|
|
54
|
+
N(
|
|
55
55
|
e,
|
|
56
|
-
t[
|
|
56
|
+
t[g].items,
|
|
57
57
|
n,
|
|
58
|
-
r,
|
|
59
|
-
a,
|
|
60
|
-
l,
|
|
61
58
|
i,
|
|
59
|
+
a,
|
|
60
|
+
s,
|
|
61
|
+
r,
|
|
62
62
|
d,
|
|
63
63
|
o,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
h,
|
|
65
|
+
p + 1,
|
|
66
|
+
l
|
|
67
67
|
),
|
|
68
|
-
|
|
69
|
-
)), (n === "always" ||
|
|
68
|
+
c
|
|
69
|
+
)), (n === "always" || x && n === "visible") && (e[e.length] = {
|
|
70
70
|
dataIndex: -1,
|
|
71
|
-
dataItem: t[
|
|
71
|
+
dataItem: t[g],
|
|
72
72
|
rowType: "groupFooter",
|
|
73
|
-
level:
|
|
74
|
-
expanded:
|
|
73
|
+
level: p,
|
|
74
|
+
expanded: x
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
return
|
|
77
|
+
return c;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function U(e) {
|
|
80
80
|
return e && getComputedStyle(e).direction === "rtl" || !1;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
if (!t || !e || !e.originalEvent || !
|
|
82
|
+
function V(e, t) {
|
|
83
|
+
if (!t || !e || !e.originalEvent || !b)
|
|
84
84
|
return -1;
|
|
85
85
|
let n = document.elementFromPoint(e.clientX, e.originalEvent.clientY);
|
|
86
86
|
for (; n && n.parentElement !== t; )
|
|
87
87
|
n = n.parentElement;
|
|
88
|
-
const
|
|
89
|
-
for (let a = 0; a <
|
|
90
|
-
if (
|
|
88
|
+
const i = t.children;
|
|
89
|
+
for (let a = 0; a < i.length; a++)
|
|
90
|
+
if (i[a] === n)
|
|
91
91
|
return a;
|
|
92
92
|
return -1;
|
|
93
93
|
}
|
|
94
|
-
const
|
|
94
|
+
const E = [
|
|
95
95
|
"sortChange",
|
|
96
96
|
"filterChange",
|
|
97
97
|
"groupChange",
|
|
@@ -104,50 +104,75 @@ const S = [
|
|
|
104
104
|
"dataStateChange",
|
|
105
105
|
"columnResize",
|
|
106
106
|
"columnReorder"
|
|
107
|
-
],
|
|
108
|
-
function
|
|
109
|
-
for (let t = 0; t <
|
|
110
|
-
const n =
|
|
107
|
+
], O = (e, t) => `The ${e} event handler property is deprecated, use https://www.telerik.com/kendo-vue-ui/components/grid/api/GridProps/#toc-${t} instead`;
|
|
108
|
+
function P(e) {
|
|
109
|
+
for (let t = 0; t < E.length; t++) {
|
|
110
|
+
const n = E[t];
|
|
111
111
|
if (e[n] !== void 0) {
|
|
112
|
-
const
|
|
113
|
-
console.warn(
|
|
112
|
+
const i = "on" + n.charAt(0).toUpperCase() + n.slice(1);
|
|
113
|
+
console.warn(O(n, i));
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function W(e, t) {
|
|
118
118
|
const n = [[]];
|
|
119
|
-
let
|
|
120
|
-
for (let
|
|
121
|
-
|
|
119
|
+
let i = 0;
|
|
120
|
+
for (let r = e.length - 1; r >= 0; r--)
|
|
121
|
+
i = Math.max(i, e[r].depth), e[r].headerColSpan = e[r].headerColSpan || 1, e[r].children.length > 0 && (e[r].headerColSpan = e[r].children.reduce(
|
|
122
122
|
(d, o) => o.hidden ? d : d + o.headerColSpan,
|
|
123
123
|
0
|
|
124
124
|
));
|
|
125
125
|
const a = [];
|
|
126
|
-
let
|
|
127
|
-
return e.forEach((
|
|
128
|
-
n[
|
|
126
|
+
let s = 1;
|
|
127
|
+
return e.forEach((r, d) => {
|
|
128
|
+
n[r.depth] = n[r.depth] || [];
|
|
129
129
|
let o = !1;
|
|
130
|
-
n[
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
n[r.depth].length === 0 && (s <= 1 ? s = 1 + (r.children.length > 0 ? 0 : i - r.depth) : (s--, o = !0)), r.rowSpan = 1 + (r.children.length > 0 ? 0 : i - r.depth), r.kFirst = o, r.index = n[r.depth].length, r.ariaColumnIndex = a[r.depth] ? a[r.depth] + 1 : 1;
|
|
131
|
+
let h = 0;
|
|
132
|
+
const p = [], f = /* @__PURE__ */ new Set();
|
|
133
|
+
let c = r.parentIndex;
|
|
134
|
+
for (; c >= 0 && !f.has(c); )
|
|
135
|
+
f.add(c), p.unshift(c), c = e[c].parentIndex;
|
|
136
|
+
for (let l = 0; l < p.length; l++) {
|
|
137
|
+
const x = p[l], w = e[x], C = n[w.depth], v = C.indexOf(x);
|
|
138
|
+
for (let I = 0; I < v; I++) {
|
|
139
|
+
const F = C[I];
|
|
140
|
+
h += e[F].headerColSpan;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
for (let l = 0; l < r.depth; l++) {
|
|
144
|
+
const x = n[l] || [];
|
|
145
|
+
for (const w of x) {
|
|
146
|
+
const C = e[w];
|
|
147
|
+
C.depth + C.rowSpan - 1 >= r.depth && (p.includes(w) || (h += C.headerColSpan));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const g = n[r.depth];
|
|
151
|
+
for (const l of g) {
|
|
152
|
+
const x = e[l];
|
|
153
|
+
x.parentIndex === r.parentIndex && (h += x.headerColSpan);
|
|
154
|
+
}
|
|
155
|
+
r.virtualColumnOffset = h, n[r.depth].push(d);
|
|
156
|
+
for (let l = r.depth; l < r.depth + r.rowSpan; l++)
|
|
157
|
+
a[l] = (a[l] || 0) + r.headerColSpan;
|
|
158
|
+
}), k(n, e, t), L(n, e, t), n;
|
|
134
159
|
}
|
|
135
|
-
function
|
|
136
|
-
const
|
|
160
|
+
function H(e, t, n, i = 0, a = !1) {
|
|
161
|
+
const s = [];
|
|
137
162
|
if (!e)
|
|
138
163
|
return [];
|
|
139
164
|
e && e.length === void 0 && (e = [e]), e.forEach((d, o) => {
|
|
140
165
|
d = d;
|
|
141
|
-
const
|
|
142
|
-
|
|
166
|
+
const h = d.id ? d.id : A.generateNavigatableId(`${n.prevId++}`, n.idPrefix, "column"), p = b && d.media && window.matchMedia ? !window.matchMedia(d.media).matches : !1, f = a || p || d.hidden, c = t == null ? void 0 : t.find((l) => l.id === h), g = H(d.children, (c == null ? void 0 : c.children) || [], n, i + 1, f);
|
|
167
|
+
s.push(
|
|
143
168
|
{
|
|
144
|
-
depth:
|
|
145
|
-
...
|
|
146
|
-
...
|
|
169
|
+
depth: i,
|
|
170
|
+
...R,
|
|
171
|
+
...g.length ? { cell: () => null, filterCell: () => null } : {},
|
|
147
172
|
...d,
|
|
148
|
-
id:
|
|
149
|
-
declarationIndex:
|
|
150
|
-
children:
|
|
173
|
+
id: h,
|
|
174
|
+
declarationIndex: s.length,
|
|
175
|
+
children: g,
|
|
151
176
|
headerColSpan: 0,
|
|
152
177
|
rowSpan: 0,
|
|
153
178
|
columnType: d.columnType || "data",
|
|
@@ -157,31 +182,31 @@ function N(e, t, n, r = 0, a = !1) {
|
|
|
157
182
|
left: null,
|
|
158
183
|
right: null,
|
|
159
184
|
rowSpannable: d.rowSpannable,
|
|
160
|
-
...
|
|
185
|
+
...c ? { width: c.width, orderIndex: c.orderIndex } : {}
|
|
161
186
|
}
|
|
162
187
|
);
|
|
163
188
|
});
|
|
164
|
-
const
|
|
165
|
-
if (
|
|
166
|
-
const d = [], o = (
|
|
167
|
-
f.parentIndex =
|
|
189
|
+
const r = (d, o) => d.orderIndex === o.orderIndex ? d.declarationIndex - o.declarationIndex : (d.orderIndex || 0) - (o.orderIndex || 0);
|
|
190
|
+
if (s.sort(r), i === 0) {
|
|
191
|
+
const d = [], o = (h, p) => h.forEach((f) => {
|
|
192
|
+
f.parentIndex = p, o(f.children, d.push(f) - 1);
|
|
168
193
|
});
|
|
169
|
-
return o(
|
|
194
|
+
return o(s, -1), d;
|
|
170
195
|
}
|
|
171
|
-
return
|
|
196
|
+
return s;
|
|
172
197
|
}
|
|
173
|
-
const
|
|
174
|
-
function
|
|
175
|
-
const a =
|
|
198
|
+
const j = (e) => Array.isArray(e) ? e : e ? e.data : [];
|
|
199
|
+
function X(e, t, n, i) {
|
|
200
|
+
const a = j(e), s = [];
|
|
176
201
|
if (a.length > 0) {
|
|
177
|
-
let
|
|
202
|
+
let r = a[0];
|
|
178
203
|
if (t)
|
|
179
204
|
for (let o = 0; o < t.length; o++)
|
|
180
|
-
|
|
181
|
-
Object.getOwnPropertyNames(
|
|
182
|
-
o !== n.column &&
|
|
205
|
+
r = r.items && r.items[0];
|
|
206
|
+
Object.getOwnPropertyNames(r).forEach((o) => {
|
|
207
|
+
o !== n.column && s.push(
|
|
183
208
|
{
|
|
184
|
-
id:
|
|
209
|
+
id: A.generateNavigatableId(`${i.prevId++}`, i.idPrefix, "column"),
|
|
185
210
|
declarationIndex: -1,
|
|
186
211
|
parentIndex: -1,
|
|
187
212
|
depth: 0,
|
|
@@ -196,15 +221,15 @@ function V(e, t, n, r) {
|
|
|
196
221
|
children: [],
|
|
197
222
|
ariaColumnIndex: 0,
|
|
198
223
|
isAccessible: !0,
|
|
199
|
-
...
|
|
224
|
+
...R,
|
|
200
225
|
field: o
|
|
201
226
|
}
|
|
202
227
|
);
|
|
203
228
|
});
|
|
204
229
|
}
|
|
205
|
-
return
|
|
230
|
+
return s;
|
|
206
231
|
}
|
|
207
|
-
const
|
|
232
|
+
const $ = (e, t) => {
|
|
208
233
|
let n = e[t.parentIndex];
|
|
209
234
|
for (; n; ) {
|
|
210
235
|
if (n.footerCell)
|
|
@@ -212,83 +237,83 @@ const D = (e, t) => {
|
|
|
212
237
|
n = e[n.parentIndex];
|
|
213
238
|
}
|
|
214
239
|
return !1;
|
|
215
|
-
},
|
|
240
|
+
}, Y = (e) => e.filter((t) => $(e, t) ? !1 : !!t.footerCell || !(t.children && t.children.length > 0)), J = {
|
|
216
241
|
number: function(e, t, n) {
|
|
217
|
-
return typeof e ===
|
|
242
|
+
return typeof e === u && e.toLowerCase() === "null" ? null : t.parseNumber(e, n);
|
|
218
243
|
},
|
|
219
244
|
date: function(e, t, n) {
|
|
220
|
-
return typeof e ===
|
|
245
|
+
return typeof e === u && e.toLowerCase() === "null" ? null : t.parseDate(e, n);
|
|
221
246
|
},
|
|
222
247
|
boolean: function(e) {
|
|
223
|
-
return typeof e ===
|
|
248
|
+
return typeof e === u ? e.toLowerCase() === "null" ? null : e.toLowerCase() === "true" : e != null ? !!e : e;
|
|
224
249
|
},
|
|
225
250
|
string: function(e) {
|
|
226
|
-
return typeof e ===
|
|
251
|
+
return typeof e === u && e.toLowerCase() === "null" ? null : e != null ? e + "" : e;
|
|
227
252
|
},
|
|
228
253
|
default: function(e) {
|
|
229
254
|
return e;
|
|
230
255
|
}
|
|
231
256
|
};
|
|
232
|
-
function M(e, t, n,
|
|
257
|
+
function M(e, t, n, i) {
|
|
233
258
|
return e.forEach((a) => {
|
|
234
|
-
a.expanded = t[
|
|
259
|
+
a.expanded = t[i] && !t[i].includes(D(a, n)), a.items && a.items.length && (a.items = M(a.items, t, n, i + 1));
|
|
235
260
|
}), e;
|
|
236
261
|
}
|
|
237
|
-
function
|
|
238
|
-
return t && t.length && e.data.forEach((
|
|
239
|
-
|
|
262
|
+
function Q(e, t, n) {
|
|
263
|
+
return t && t.length && e.data.forEach((i) => {
|
|
264
|
+
i.expanded = i.expanded !== void 0 ? i.expanded : t[0] && !t[0].includes(D(i, n)), i.items && i.items.length && (i.items = M(i.items, t, n, 1));
|
|
240
265
|
}), e;
|
|
241
266
|
}
|
|
242
|
-
function
|
|
267
|
+
function D(e, t) {
|
|
243
268
|
let n = e;
|
|
244
269
|
for (; n.items && n.items.length; )
|
|
245
270
|
n = n.items[0];
|
|
246
271
|
return t ? n[t] : e.value;
|
|
247
272
|
}
|
|
248
|
-
const
|
|
249
|
-
const t = [], n = (
|
|
273
|
+
const Z = (e) => {
|
|
274
|
+
const t = [], n = (i) => i == null ? void 0 : i.forEach((a) => {
|
|
250
275
|
t.push(a), n(a.children);
|
|
251
276
|
});
|
|
252
277
|
return n(e), t;
|
|
253
|
-
},
|
|
254
|
-
const { declarationIndex: n, parentIndex:
|
|
255
|
-
return
|
|
256
|
-
children:
|
|
257
|
-
...
|
|
258
|
-
} :
|
|
259
|
-
})),
|
|
260
|
-
var
|
|
261
|
-
const t = typeof e == "object" ? (
|
|
278
|
+
}, _ = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), q = 17895697, G = (e) => e.width !== void 0 ? Math.floor(parseFloat(e.width.toString())) + "px" : void 0, ee = (e, t) => t && t.filter((n) => n.field === e).length > 0, B = (e) => (e.sort((t, n) => t.declarationIndex - n.declarationIndex), e.map((t) => {
|
|
279
|
+
const { declarationIndex: n, parentIndex: i, depth: a, headerColSpan: s, rowSpan: r, index: d, kFirst: o, children: h, ...p } = t;
|
|
280
|
+
return h.length ? {
|
|
281
|
+
children: B(h),
|
|
282
|
+
...p
|
|
283
|
+
} : p;
|
|
284
|
+
})), te = (e, t) => typeof e.colSpan == "function" ? e.colSpan({ dataItem: t, column: e }) : e.colSpan || 1, ne = (e) => {
|
|
285
|
+
var i, a;
|
|
286
|
+
const t = typeof e == "object" ? (i = e.enabled) != null ? i : !0 : e != null ? e : !1, n = typeof e == "object" ? (a = e.valueGetter) != null ? a : (s, r) => S(r)(s) : (s, r) => S(r)(s);
|
|
262
287
|
return { enabled: t, valueGetter: n };
|
|
263
|
-
},
|
|
288
|
+
}, re = (e) => {
|
|
264
289
|
let t = 0;
|
|
265
290
|
if (e) {
|
|
266
|
-
const n = e.insertRow(0),
|
|
267
|
-
|
|
291
|
+
const n = e.insertRow(0), i = n.insertCell(0);
|
|
292
|
+
i.textContent = " ", t = n.getBoundingClientRect().height, e.deleteRow(0);
|
|
268
293
|
}
|
|
269
294
|
return t;
|
|
270
295
|
};
|
|
271
296
|
export {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
297
|
+
Q as applyExpandedState,
|
|
298
|
+
X as autoGenerateColumns,
|
|
299
|
+
re as calcRowHeight,
|
|
300
|
+
P as checkPropCompatibility,
|
|
301
|
+
_ as firefox,
|
|
302
|
+
q as firefoxMaxHeight,
|
|
303
|
+
N as flatData,
|
|
304
|
+
Y as footerColumns,
|
|
305
|
+
te as getColSpan,
|
|
306
|
+
G as getColumnWidth,
|
|
307
|
+
j as getDataAsArray,
|
|
308
|
+
Z as getFlatColumnsState,
|
|
309
|
+
V as getIndex,
|
|
310
|
+
y as getNestedValue,
|
|
311
|
+
ne as getRowSpanOptions,
|
|
312
|
+
D as groupedFirstItemValue,
|
|
313
|
+
U as isRtl,
|
|
314
|
+
ee as isSorted,
|
|
315
|
+
W as mapColumns,
|
|
316
|
+
J as parsers,
|
|
317
|
+
H as readColumns,
|
|
318
|
+
B as sanitizeColumns
|
|
294
319
|
};
|
package/utils/virtualColumns.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"});function
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function m(u){const{cellsToRender:n,columns:i,rowIndex:a,enableVirtualization:s}=u;if(!s||a!==0||!n||n.length===0)return{columnsToRender:[],colSpans:[]};const t=[],o=[];let c=-1,d=-1;for(let l=0;l<n.length;l++)i[n[l].columnIndex].locked||(c===-1&&(c=l),d=l);return n.forEach((l,r)=>{if(t.push(l.columnIndex),r===c)o.push(l.colSpan);else if(r===d)o.push(l.colSpan);else{const f=i[l.columnIndex];o.push(f.headerColSpan||1)}}),{columnsToRender:t,colSpans:o}}function p(u){const{cellModels:n,columns:i=[],tableViewPortWidth:a,scrollLeft:s}=u;let t=0,o=n.length-1,c=0,d=0;for(let e=0;e<n.length;e++)if(!i[n[e].columnIndex].locked&&(c=d,d+=n[e].width||10,d>=s)){t=e;break}for(let e=t;e<n.length;e++)if(!i[n[e].columnIndex].locked)if(c<a+s)c+=n[e].width||10,o=e;else break;t>0&&t--,o<n.length-1&&o++;let l=0,r=0;for(let e=0;e<t;e++)i[n[e].columnIndex].locked||(l+=n[e].colSpan);for(let e=o+1;e<n.length;e++)i[n[e].columnIndex].locked||(r+=n[e].colSpan);n[t].colSpan+=l,n[o].colSpan+=r;const f=n.slice(0,t).filter(e=>i[e.columnIndex].locked),h=n.slice(o+1).filter(e=>i[e.columnIndex].locked);return[...f,...n.slice(t,o+1),...h]}exports.getVirtualCellsToRender=p;exports.getVirtualHeaderCellsToRender=m;
|