@progress/kendo-vue-grid 8.1.0-develop.4 → 8.1.0-develop.6
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.d.ts +30 -17
- package/Grid.js +1 -1
- package/Grid.mjs +567 -449
- package/GridState.d.ts +15 -1
- package/GridState.js +1 -1
- package/GridState.mjs +84 -71
- package/RootGrid.d.ts +10 -0
- package/cells/GridCell.d.ts +2 -0
- package/cells/GridCell.js +1 -1
- package/cells/GridCell.mjs +35 -30
- package/cells/GridDetailCell.js +1 -1
- package/cells/GridDetailCell.mjs +20 -20
- package/cells/GridFilterCell.js +1 -1
- package/cells/GridFilterCell.mjs +42 -37
- package/cells/GridGroupCell.d.ts +2 -0
- package/cells/GridGroupCell.js +1 -1
- package/cells/GridGroupCell.mjs +69 -55
- package/cells/GridHierarchyCell.d.ts +2 -0
- package/cells/GridHierarchyCell.js +1 -1
- package/cells/GridHierarchyCell.mjs +51 -41
- package/cells/GridSelectionCell.d.ts +2 -0
- package/cells/GridSelectionCell.js +1 -1
- package/cells/GridSelectionCell.mjs +35 -24
- package/cells/pincell/GridPinCell.d.ts +72 -0
- package/cells/pincell/GridPinCell.js +8 -0
- package/cells/pincell/GridPinCell.mjs +111 -0
- package/cells/pincell/GridPinDropdownButton.d.ts +27 -0
- package/cells/pincell/GridPinDropdownButton.js +8 -0
- package/cells/pincell/GridPinDropdownButton.mjs +111 -0
- package/common.d.ts +5 -0
- package/common.js +1 -1
- package/common.mjs +7 -2
- package/components/PinnedRowsTable.d.ts +63 -0
- package/components/PinnedRowsTable.js +8 -0
- package/components/PinnedRowsTable.mjs +141 -0
- package/components/StickyGroupTable.d.ts +0 -1
- package/components/StickyGroupTable.js +1 -1
- package/components/StickyGroupTable.mjs +24 -30
- package/constants/main.d.ts +15 -0
- package/dist/cdn/js/kendo-vue-grid.js +1 -1
- package/drag/ColumnResize.d.ts +2 -0
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +139 -123
- package/footer/FooterCell.js +1 -1
- package/footer/FooterCell.mjs +22 -20
- package/getRowContents.js +1 -1
- package/getRowContents.mjs +50 -48
- package/header/FilterRow.d.ts +4 -0
- package/header/FilterRow.js +1 -1
- package/header/FilterRow.mjs +52 -50
- package/header/HeaderRow.d.ts +4 -0
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +114 -105
- package/index.js +1 -1
- package/index.mjs +15 -14
- package/interfaces/ColumnType.d.ts +1 -1
- package/interfaces/GridCellProps.d.ts +5 -0
- package/interfaces/GridCellsSettings.d.ts +23 -0
- package/interfaces/GridColumnProps.d.ts +2 -2
- package/interfaces/GridProps.d.ts +88 -31
- package/interfaces/GridRowProps.d.ts +13 -4
- package/interfaces/GridRowsSettings.d.ts +48 -0
- package/interfaces/events.d.ts +19 -2
- package/messages/main.d.ts +30 -0
- package/messages/main.js +2 -2
- package/messages/main.mjs +108 -96
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -12
- package/rows/GridRow.d.ts +4 -10
- package/rows/GridRow.js +1 -1
- package/rows/GridRow.mjs +24 -23
- package/utils/main.d.ts +5 -0
- package/utils/main.js +1 -1
- package/utils/main.mjs +199 -167
- package/utils/virtualColumns.js +1 -1
- package/utils/virtualColumns.mjs +121 -105
package/drag/ColumnResize.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ export declare class ColumnResize {
|
|
|
31
31
|
* The sticky footer `colgroup` of the Grid (if any).
|
|
32
32
|
*/
|
|
33
33
|
colGroupStickyFooter: any;
|
|
34
|
+
colGroupPinnedTop: any;
|
|
35
|
+
colGroupPinnedBottom: any;
|
|
34
36
|
columns: ExtendedColumnProps[];
|
|
35
37
|
/**
|
|
36
38
|
* The `columnsState` of the Grid (if any).
|
package/drag/ColumnResize.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 k=require("../utils/main.js"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("../utils/main.js"),F=1,S=20;class x{constructor(p){this.columns=[],this.columnsState=[],this.resizable=!1,this.isRtl=!1,this.setIsRtl=n=>{this.isRtl=n},this.initWidths=()=>{var a;const n=((a=this.colGroupMain)==null?void 0:a.children)||[],c=k.getFlatColumnsState(this.columnsState),r=this.columns.filter(o=>{var d;return!((d=o.children)!=null&&d.length)});for(let o=0;o<n.length;o++){const d=n[o],t=r[o];let e="";const h=c.find(i=>i.id===r[o].id);h&&(e=this.applyWidthConstraints(h,t)),d.width=e,this.colGroupHeader&&(this.colGroupHeader.children[o].width=e),this.colGroupFooter&&(this.colGroupFooter.children[o].width=e),this.colGroupStickyHeader&&(this.colGroupStickyHeader.children[o].width=e),this.colGroupStickyFooter&&(this.colGroupStickyFooter.children[o].width=e),this.colGroupPinnedTop&&(this.colGroupPinnedTop.children[o].width=e),this.colGroupPinnedBottom&&(this.colGroupPinnedBottom.children[o].width=e)}},this.dragHandler=(n,c,r,a)=>{const o=n.originalEvent;a||(o.preventDefault(),o.stopPropagation(),o.stopImmediatePropagation());const d=r.closest("th");if(!d)return;const t=d.clientWidth;let e=t;if(this.isRtl?e+=r.getBoundingClientRect().right-r.offsetWidth/2-n.clientX:e+=n.clientX-r.getBoundingClientRect().left-r.offsetWidth/2,!a&&Math.abs(e-t)<1)return;this.fixateInitialWidths(d.parentElement.clientWidth),this.setWidths(c,Math.floor(e)/t);const h=this.columns.filter(i=>!i.children.length).findIndex(i=>i.id===c.id);this.onResize(h,t,e,o,a,this.columnsState,c.id)},this.dblClickHandler=(n,c)=>{const r=this.columns.filter(l=>c.indexOf(l.id)>-1),a=k.getFlatColumnsState(this.columnsState);if(!this.colGroupMain||!r.length)return;const o={},d=r;for(;d.length>0;){const l=d.pop();if(!l)break;l.children.length?d.push(...l.children):o[l.id]=l}const t=this.columns.filter(l=>!l.children.length),e=[];t.forEach((l,s)=>{o[l.id]&&e.push(s)});const h=[this.colGroupMain.parentElement],i=[this.colGroupMain];this.colGroupHeader&&(h.push(this.colGroupHeader.parentElement),i.push(this.colGroupHeader)),this.colGroupFooter&&(h.push(this.colGroupFooter.parentElement),i.push(this.colGroupFooter)),this.colGroupStickyHeader&&(h.push(this.colGroupStickyHeader.parentElement),i.push(this.colGroupStickyHeader)),this.colGroupStickyFooter&&(h.push(this.colGroupStickyFooter.parentElement),i.push(this.colGroupStickyFooter)),this.colGroupPinnedTop&&(h.push(this.colGroupPinnedTop.parentElement),i.push(this.colGroupPinnedTop)),this.colGroupPinnedBottom&&(h.push(this.colGroupPinnedBottom.parentElement),i.push(this.colGroupPinnedBottom)),h.forEach(l=>l.classList.add("k-autofitting"));const f=[];i.forEach(l=>{e.forEach(s=>{l.children[s]&&(l.children[s].width="",f[s]=Math.max(f[s]||0,l.children[s].offsetWidth+F))})}),i.forEach(l=>{e.forEach(s=>{if(l.children[s]){l.children[s].width=f[s]+"px";const w=a.find(g=>g.id===t[s].id);w&&(w.width=f[s])}})}),h.forEach(l=>l.classList.remove("k-autofitting")),this.onResize(e[0],0,0,n,!0,this.columnsState,c[0])},this.updateColElements=n=>{var a,o,d,t,e,h,i;const c=this.columns.filter(f=>!f.hidden&&!f.children.length);let r=1e-10;for(let f=0;f<n.length;f++){const l=n[f],s=c.findIndex(u=>u.id===l.id),w=parseFloat((l.width||0).toString()),g=Math.floor(w);r+=w-g;const G=g+Math.floor(r);r-=Math.floor(r);const m=c.find(u=>u.id===l.id);if(!m)return;if((a=this.colGroupMain)!=null&&a.children[s]){const u=parseInt(this.colGroupMain.children[s].width,10);this.colGroupMain.children[s].width=G+"px",this.updateNextLockedCol(this.colGroupMain.parentElement,m,u-G)}if((o=this.colGroupHeader)!=null&&o.children[s]){const u=parseInt(this.colGroupHeader.children[s].width,10);this.colGroupHeader.children[s].width=G+"px",this.updateNextLockedCol(this.colGroupHeader.parentElement,m,u-G)}if((d=this.colGroupFooter)!=null&&d.children[s]){const u=parseInt(this.colGroupFooter.children[s].width,10);this.colGroupFooter.children[s].width=G+"px",this.updateNextLockedCol(this.colGroupFooter.parentElement,m,u-G)}if((t=this.colGroupStickyHeader)!=null&&t.children[s]){const u=parseInt(this.colGroupStickyHeader.children[s].width,10);this.colGroupStickyHeader.children[s].width=G+"px",this.updateNextLockedCol(this.colGroupStickyHeader.parentElement,m,u-G)}if((e=this.colGroupStickyFooter)!=null&&e.children[s]){const u=parseInt(this.colGroupStickyFooter.children[s].width,10);this.colGroupStickyFooter.children[s].width=G+"px",this.updateNextLockedCol(this.colGroupStickyFooter.parentElement,m,u-G)}if((h=this.colGroupPinnedTop)!=null&&h.children[s]){const u=parseInt(this.colGroupPinnedTop.children[s].width,10);this.colGroupPinnedTop.children[s].width=G+"px",this.updateNextLockedCol(this.colGroupPinnedTop.parentElement,m,u-G)}if((i=this.colGroupPinnedBottom)!=null&&i.children[s]){const u=parseInt(this.colGroupPinnedBottom.children[s].width,10);this.colGroupPinnedBottom.children[s].width=G+"px",this.updateNextLockedCol(this.colGroupPinnedBottom.parentElement,m,u-G)}}},this.onResize=p}applyWidthConstraints(p,n,c=1){var i;if(!p.width)return p.width||"";const r=p.width.toString();if(r.includes("%")){const l=parseFloat(r)*c,s=Math.max(0,Math.min(100,l));return p.width=s+"%",p.width}let o=parseFloat(r)*c;const d=(i=n.minResizableWidth)!=null?i:10,t=n==null?void 0:n.minWidth,e=t!==void 0?Math.max(d,t):d,h=n==null?void 0:n.maxWidth;return o<e&&(o=e),h!==void 0&&o>h&&(o=h),p.width=o,o}fixateInitialWidths(p){var d;let n=0;const c=((d=this.colGroupMain)==null?void 0:d.children)||[];for(let t=0;t<c.length;t++)c[t].width?p-=c[t].clientWidth:n++;if(n===0)return;const r=Math.floor(p/n),a=k.getFlatColumnsState(this.columnsState),o=this.columns.filter(t=>!t.children.length);for(let t=0;t<c.length;t++){const e=c[t],h=e.width?e.clientWidth:r;e.width=h;const i=a.find(f=>f.id===o[t].id);i&&(i.width=h.toString()),this.colGroupHeader&&(this.colGroupHeader.children[t].width=h),this.colGroupFooter&&(this.colGroupFooter.children[t].width=h),this.colGroupStickyHeader&&(this.colGroupStickyHeader.children[t].width=h),this.colGroupStickyFooter&&(this.colGroupStickyFooter.children[t].width=h)}}setWidths(p,n){const c=k.getFlatColumnsState(this.columnsState),r=this.columns.findIndex(t=>t.id===p.id),a=[];let o=p.children.filter(t=>!t.hidden).length;for(let t=r+1;t<this.columns.length&&!(o<=0);t++){const e=this.columns[t];e.children.length?o+=e.children.filter(h=>!h.hidden).length:a.push(e),o--}a.length===0&&a.push(p);const d=[];a.forEach(t=>{const e=c.find(h=>h.id===t.id);e&&(this.applyWidthConstraints(e,t,n),d.push(e))}),this.updateColElements(d)}updateNextLockedCol(p,n,c){const r=n.index,a=this.colGroupMain.parentElement.closest(".k-grid"),o=a==null?void 0:a.clientWidth,d=this.columns.filter(t=>t.locked).map(t=>parseInt(t.width+"",10)).reduce((t,e)=>t+e,0);!n.locked||o<=d+S||this.columns.forEach(t=>{if(t!=null&&t.locked&&c){const e=p==null?void 0:p.querySelectorAll('[aria-colindex="'+t.ariaColumnIndex+'"]');e==null||e.forEach(h=>{const i=h.style;this.isRtl?(t.index>r&&(i!=null&&i.right)&&(i.right=parseInt(i.right,10)-c+"px"),t.index<r&&(i!=null&&i.left)&&(i.left=parseInt(i.left,10)-c+"px")):(t.index>r&&(i!=null&&i.left)&&(i.left=parseInt(i.left,10)-c+"px"),t.index<r&&(i!=null&&i.right)&&(i.right=parseInt(i.right,10)-c+"px"))})}})}}exports.ColumnResize=x;
|
package/drag/ColumnResize.mjs
CHANGED
|
@@ -5,170 +5,186 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { getFlatColumnsState as
|
|
9
|
-
const
|
|
10
|
-
class
|
|
11
|
-
constructor(
|
|
12
|
-
this.columns = [], this.columnsState = [], this.resizable = !1, this.isRtl = !1, this.setIsRtl = (
|
|
13
|
-
this.isRtl =
|
|
8
|
+
import { getFlatColumnsState as g } from "../utils/main.mjs";
|
|
9
|
+
const x = 1, F = 20;
|
|
10
|
+
class E {
|
|
11
|
+
constructor(a) {
|
|
12
|
+
this.columns = [], this.columnsState = [], this.resizable = !1, this.isRtl = !1, this.setIsRtl = (n) => {
|
|
13
|
+
this.isRtl = n;
|
|
14
14
|
}, this.initWidths = () => {
|
|
15
|
-
var
|
|
16
|
-
const
|
|
17
|
-
var
|
|
18
|
-
return !((
|
|
15
|
+
var p;
|
|
16
|
+
const n = ((p = this.colGroupMain) == null ? void 0 : p.children) || [], c = g(this.columnsState), r = this.columns.filter((e) => {
|
|
17
|
+
var d;
|
|
18
|
+
return !((d = e.children) != null && d.length);
|
|
19
19
|
});
|
|
20
|
-
for (let
|
|
21
|
-
const
|
|
22
|
-
let
|
|
23
|
-
const
|
|
24
|
-
|
|
20
|
+
for (let e = 0; e < n.length; e++) {
|
|
21
|
+
const d = n[e], t = r[e];
|
|
22
|
+
let o = "";
|
|
23
|
+
const h = c.find((i) => i.id === r[e].id);
|
|
24
|
+
h && (o = this.applyWidthConstraints(h, t)), d.width = o, this.colGroupHeader && (this.colGroupHeader.children[e].width = o), this.colGroupFooter && (this.colGroupFooter.children[e].width = o), this.colGroupStickyHeader && (this.colGroupStickyHeader.children[e].width = o), this.colGroupStickyFooter && (this.colGroupStickyFooter.children[e].width = o), this.colGroupPinnedTop && (this.colGroupPinnedTop.children[e].width = o), this.colGroupPinnedBottom && (this.colGroupPinnedBottom.children[e].width = o);
|
|
25
25
|
}
|
|
26
|
-
}, this.dragHandler = (
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
if (!
|
|
26
|
+
}, this.dragHandler = (n, c, r, p) => {
|
|
27
|
+
const e = n.originalEvent;
|
|
28
|
+
p || (e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation());
|
|
29
|
+
const d = r.closest("th");
|
|
30
|
+
if (!d)
|
|
31
31
|
return;
|
|
32
|
-
const t =
|
|
33
|
-
let
|
|
34
|
-
if (this.isRtl ?
|
|
32
|
+
const t = d.clientWidth;
|
|
33
|
+
let o = t;
|
|
34
|
+
if (this.isRtl ? o += r.getBoundingClientRect().right - r.offsetWidth / 2 - n.clientX : o += n.clientX - r.getBoundingClientRect().left - r.offsetWidth / 2, !p && Math.abs(o - t) < 1)
|
|
35
35
|
return;
|
|
36
|
-
this.fixateInitialWidths(
|
|
37
|
-
const
|
|
38
|
-
this.onResize(
|
|
39
|
-
}, this.dblClickHandler = (
|
|
40
|
-
const r = this.columns.filter((
|
|
36
|
+
this.fixateInitialWidths(d.parentElement.clientWidth), this.setWidths(c, Math.floor(o) / t);
|
|
37
|
+
const h = this.columns.filter((i) => !i.children.length).findIndex((i) => i.id === c.id);
|
|
38
|
+
this.onResize(h, t, o, e, p, this.columnsState, c.id);
|
|
39
|
+
}, this.dblClickHandler = (n, c) => {
|
|
40
|
+
const r = this.columns.filter((l) => c.indexOf(l.id) > -1), p = g(this.columnsState);
|
|
41
41
|
if (!this.colGroupMain || !r.length)
|
|
42
42
|
return;
|
|
43
|
-
const
|
|
44
|
-
for (;
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
43
|
+
const e = {}, d = r;
|
|
44
|
+
for (; d.length > 0; ) {
|
|
45
|
+
const l = d.pop();
|
|
46
|
+
if (!l)
|
|
47
47
|
break;
|
|
48
|
-
|
|
48
|
+
l.children.length ? d.push(...l.children) : e[l.id] = l;
|
|
49
49
|
}
|
|
50
|
-
const t = this.columns.filter((
|
|
51
|
-
t.forEach((
|
|
52
|
-
|
|
50
|
+
const t = this.columns.filter((l) => !l.children.length), o = [];
|
|
51
|
+
t.forEach((l, s) => {
|
|
52
|
+
e[l.id] && o.push(s);
|
|
53
53
|
});
|
|
54
|
-
const
|
|
55
|
-
this.colGroupHeader && (
|
|
56
|
-
const
|
|
57
|
-
i.forEach((
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
const h = [this.colGroupMain.parentElement], i = [this.colGroupMain];
|
|
55
|
+
this.colGroupHeader && (h.push(this.colGroupHeader.parentElement), i.push(this.colGroupHeader)), this.colGroupFooter && (h.push(this.colGroupFooter.parentElement), i.push(this.colGroupFooter)), this.colGroupStickyHeader && (h.push(this.colGroupStickyHeader.parentElement), i.push(this.colGroupStickyHeader)), this.colGroupStickyFooter && (h.push(this.colGroupStickyFooter.parentElement), i.push(this.colGroupStickyFooter)), this.colGroupPinnedTop && (h.push(this.colGroupPinnedTop.parentElement), i.push(this.colGroupPinnedTop)), this.colGroupPinnedBottom && (h.push(this.colGroupPinnedBottom.parentElement), i.push(this.colGroupPinnedBottom)), h.forEach((l) => l.classList.add("k-autofitting"));
|
|
56
|
+
const f = [];
|
|
57
|
+
i.forEach((l) => {
|
|
58
|
+
o.forEach((s) => {
|
|
59
|
+
l.children[s] && (l.children[s].width = "", f[s] = Math.max(
|
|
60
|
+
f[s] || 0,
|
|
61
|
+
l.children[s].offsetWidth + x
|
|
62
62
|
));
|
|
63
63
|
});
|
|
64
|
-
}), i.forEach((
|
|
65
|
-
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
|
|
64
|
+
}), i.forEach((l) => {
|
|
65
|
+
o.forEach((s) => {
|
|
66
|
+
if (l.children[s]) {
|
|
67
|
+
l.children[s].width = f[s] + "px";
|
|
68
|
+
const w = p.find((k) => k.id === t[s].id);
|
|
69
|
+
w && (w.width = f[s]);
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
-
}),
|
|
73
|
-
}, this.updateColElements = (
|
|
74
|
-
var
|
|
75
|
-
const
|
|
72
|
+
}), h.forEach((l) => l.classList.remove("k-autofitting")), this.onResize(o[0], 0, 0, n, !0, this.columnsState, c[0]);
|
|
73
|
+
}, this.updateColElements = (n) => {
|
|
74
|
+
var p, e, d, t, o, h, i;
|
|
75
|
+
const c = this.columns.filter((f) => !f.hidden && !f.children.length);
|
|
76
76
|
let r = 1e-10;
|
|
77
|
-
for (let
|
|
78
|
-
const
|
|
79
|
-
r +=
|
|
80
|
-
const
|
|
77
|
+
for (let f = 0; f < n.length; f++) {
|
|
78
|
+
const l = n[f], s = c.findIndex((u) => u.id === l.id), w = parseFloat((l.width || 0).toString()), k = Math.floor(w);
|
|
79
|
+
r += w - k;
|
|
80
|
+
const G = k + Math.floor(r);
|
|
81
81
|
r -= Math.floor(r);
|
|
82
|
-
const
|
|
83
|
-
if (!
|
|
82
|
+
const m = c.find((u) => u.id === l.id);
|
|
83
|
+
if (!m)
|
|
84
84
|
return;
|
|
85
|
-
if ((
|
|
86
|
-
const
|
|
87
|
-
this.colGroupMain.children[
|
|
85
|
+
if ((p = this.colGroupMain) != null && p.children[s]) {
|
|
86
|
+
const u = parseInt(this.colGroupMain.children[s].width, 10);
|
|
87
|
+
this.colGroupMain.children[s].width = G + "px", this.updateNextLockedCol(this.colGroupMain.parentElement, m, u - G);
|
|
88
88
|
}
|
|
89
|
-
if ((
|
|
90
|
-
const
|
|
91
|
-
this.colGroupHeader.children[
|
|
89
|
+
if ((e = this.colGroupHeader) != null && e.children[s]) {
|
|
90
|
+
const u = parseInt(this.colGroupHeader.children[s].width, 10);
|
|
91
|
+
this.colGroupHeader.children[s].width = G + "px", this.updateNextLockedCol(this.colGroupHeader.parentElement, m, u - G);
|
|
92
92
|
}
|
|
93
|
-
if ((
|
|
94
|
-
const
|
|
95
|
-
this.colGroupFooter.children[
|
|
93
|
+
if ((d = this.colGroupFooter) != null && d.children[s]) {
|
|
94
|
+
const u = parseInt(this.colGroupFooter.children[s].width, 10);
|
|
95
|
+
this.colGroupFooter.children[s].width = G + "px", this.updateNextLockedCol(this.colGroupFooter.parentElement, m, u - G);
|
|
96
96
|
}
|
|
97
|
-
if ((t = this.colGroupStickyHeader) != null && t.children[
|
|
98
|
-
const
|
|
99
|
-
this.colGroupStickyHeader.children[
|
|
97
|
+
if ((t = this.colGroupStickyHeader) != null && t.children[s]) {
|
|
98
|
+
const u = parseInt(this.colGroupStickyHeader.children[s].width, 10);
|
|
99
|
+
this.colGroupStickyHeader.children[s].width = G + "px", this.updateNextLockedCol(
|
|
100
100
|
this.colGroupStickyHeader.parentElement,
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
m,
|
|
102
|
+
u - G
|
|
103
103
|
);
|
|
104
104
|
}
|
|
105
|
-
if ((
|
|
106
|
-
const
|
|
107
|
-
this.colGroupStickyFooter.children[
|
|
105
|
+
if ((o = this.colGroupStickyFooter) != null && o.children[s]) {
|
|
106
|
+
const u = parseInt(this.colGroupStickyFooter.children[s].width, 10);
|
|
107
|
+
this.colGroupStickyFooter.children[s].width = G + "px", this.updateNextLockedCol(
|
|
108
108
|
this.colGroupStickyFooter.parentElement,
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
m,
|
|
110
|
+
u - G
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
if ((h = this.colGroupPinnedTop) != null && h.children[s]) {
|
|
114
|
+
const u = parseInt(this.colGroupPinnedTop.children[s].width, 10);
|
|
115
|
+
this.colGroupPinnedTop.children[s].width = G + "px", this.updateNextLockedCol(
|
|
116
|
+
this.colGroupPinnedTop.parentElement,
|
|
117
|
+
m,
|
|
118
|
+
u - G
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
if ((i = this.colGroupPinnedBottom) != null && i.children[s]) {
|
|
122
|
+
const u = parseInt(this.colGroupPinnedBottom.children[s].width, 10);
|
|
123
|
+
this.colGroupPinnedBottom.children[s].width = G + "px", this.updateNextLockedCol(
|
|
124
|
+
this.colGroupPinnedBottom.parentElement,
|
|
125
|
+
m,
|
|
126
|
+
u - G
|
|
111
127
|
);
|
|
112
128
|
}
|
|
113
129
|
}
|
|
114
|
-
}, this.onResize =
|
|
130
|
+
}, this.onResize = a;
|
|
115
131
|
}
|
|
116
|
-
applyWidthConstraints(
|
|
132
|
+
applyWidthConstraints(a, n, c = 1) {
|
|
117
133
|
var i;
|
|
118
|
-
if (!
|
|
119
|
-
return
|
|
120
|
-
const r =
|
|
134
|
+
if (!a.width)
|
|
135
|
+
return a.width || "";
|
|
136
|
+
const r = a.width.toString();
|
|
121
137
|
if (r.includes("%")) {
|
|
122
|
-
const
|
|
123
|
-
return
|
|
138
|
+
const l = parseFloat(r) * c, s = Math.max(0, Math.min(100, l));
|
|
139
|
+
return a.width = s + "%", a.width;
|
|
124
140
|
}
|
|
125
|
-
let
|
|
126
|
-
const
|
|
127
|
-
return
|
|
141
|
+
let e = parseFloat(r) * c;
|
|
142
|
+
const d = (i = n.minResizableWidth) != null ? i : 10, t = n == null ? void 0 : n.minWidth, o = t !== void 0 ? Math.max(d, t) : d, h = n == null ? void 0 : n.maxWidth;
|
|
143
|
+
return e < o && (e = o), h !== void 0 && e > h && (e = h), a.width = e, e;
|
|
128
144
|
}
|
|
129
|
-
fixateInitialWidths(
|
|
130
|
-
var
|
|
131
|
-
let
|
|
132
|
-
const
|
|
133
|
-
for (let t = 0; t <
|
|
134
|
-
|
|
135
|
-
if (
|
|
145
|
+
fixateInitialWidths(a) {
|
|
146
|
+
var d;
|
|
147
|
+
let n = 0;
|
|
148
|
+
const c = ((d = this.colGroupMain) == null ? void 0 : d.children) || [];
|
|
149
|
+
for (let t = 0; t < c.length; t++)
|
|
150
|
+
c[t].width ? a -= c[t].clientWidth : n++;
|
|
151
|
+
if (n === 0)
|
|
136
152
|
return;
|
|
137
|
-
const r = Math.floor(
|
|
138
|
-
for (let t = 0; t <
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
const i =
|
|
142
|
-
i && (i.width =
|
|
153
|
+
const r = Math.floor(a / n), p = g(this.columnsState), e = this.columns.filter((t) => !t.children.length);
|
|
154
|
+
for (let t = 0; t < c.length; t++) {
|
|
155
|
+
const o = c[t], h = o.width ? o.clientWidth : r;
|
|
156
|
+
o.width = h;
|
|
157
|
+
const i = p.find((f) => f.id === e[t].id);
|
|
158
|
+
i && (i.width = h.toString()), this.colGroupHeader && (this.colGroupHeader.children[t].width = h), this.colGroupFooter && (this.colGroupFooter.children[t].width = h), this.colGroupStickyHeader && (this.colGroupStickyHeader.children[t].width = h), this.colGroupStickyFooter && (this.colGroupStickyFooter.children[t].width = h);
|
|
143
159
|
}
|
|
144
160
|
}
|
|
145
|
-
setWidths(
|
|
146
|
-
const
|
|
147
|
-
let
|
|
148
|
-
for (let t = r + 1; t < this.columns.length && !(
|
|
149
|
-
const
|
|
150
|
-
|
|
161
|
+
setWidths(a, n) {
|
|
162
|
+
const c = g(this.columnsState), r = this.columns.findIndex((t) => t.id === a.id), p = [];
|
|
163
|
+
let e = a.children.filter((t) => !t.hidden).length;
|
|
164
|
+
for (let t = r + 1; t < this.columns.length && !(e <= 0); t++) {
|
|
165
|
+
const o = this.columns[t];
|
|
166
|
+
o.children.length ? e += o.children.filter((h) => !h.hidden).length : p.push(o), e--;
|
|
151
167
|
}
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
}), this.updateColElements(
|
|
168
|
+
p.length === 0 && p.push(a);
|
|
169
|
+
const d = [];
|
|
170
|
+
p.forEach((t) => {
|
|
171
|
+
const o = c.find((h) => h.id === t.id);
|
|
172
|
+
o && (this.applyWidthConstraints(o, t, n), d.push(o));
|
|
173
|
+
}), this.updateColElements(d);
|
|
158
174
|
}
|
|
159
|
-
updateNextLockedCol(
|
|
160
|
-
const r =
|
|
161
|
-
!
|
|
162
|
-
if (t != null && t.locked &&
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
const i =
|
|
166
|
-
this.isRtl ? (t.index > r && (i != null && i.right) && (i.right = parseInt(i.right, 10) -
|
|
175
|
+
updateNextLockedCol(a, n, c) {
|
|
176
|
+
const r = n.index, p = this.colGroupMain.parentElement.closest(".k-grid"), e = p == null ? void 0 : p.clientWidth, d = this.columns.filter((t) => t.locked).map((t) => parseInt(t.width + "", 10)).reduce((t, o) => t + o, 0);
|
|
177
|
+
!n.locked || e <= d + F || this.columns.forEach((t) => {
|
|
178
|
+
if (t != null && t.locked && c) {
|
|
179
|
+
const o = a == null ? void 0 : a.querySelectorAll('[aria-colindex="' + t.ariaColumnIndex + '"]');
|
|
180
|
+
o == null || o.forEach((h) => {
|
|
181
|
+
const i = h.style;
|
|
182
|
+
this.isRtl ? (t.index > r && (i != null && i.right) && (i.right = parseInt(i.right, 10) - c + "px"), t.index < r && (i != null && i.left) && (i.left = parseInt(i.left, 10) - c + "px")) : (t.index > r && (i != null && i.left) && (i.left = parseInt(i.left, 10) - c + "px"), t.index < r && (i != null && i.right) && (i.right = parseInt(i.right, 10) - c + "px"));
|
|
167
183
|
});
|
|
168
184
|
}
|
|
169
185
|
});
|
|
170
186
|
}
|
|
171
187
|
}
|
|
172
188
|
export {
|
|
173
|
-
|
|
189
|
+
E as ColumnResize
|
|
174
190
|
};
|
package/footer/FooterCell.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 l=require("vue"),s=require("@progress/kendo-vue-common"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),s=require("@progress/kendo-vue-common"),i=require("@progress/kendo-vue-data-tools"),a=require("../utils/main.js"),c=l.defineComponent({name:"FooterCell",props:{column:Object,columnIndex:Number,isRtl:Boolean,rowIndex:Number,cells:Object},inject:{getKeyboardNavigationAttributes:{default:s.noop}},computed:{columnStyles(){const e=this.$props.column;if(e.locked&&(e.left!==void 0||e.right!==void 0))return this.$props.isRtl?{left:e.right+"px",right:e.left+"px"}:{left:e.left+"px",right:e.right+"px"}},tdClassName(){const e=this.$props.column,t=e.locked&&(e.left!==void 0||e.right!==void 0)?"k-grid-footer-sticky":"";return e.footerClassName?`k-table-td ${e.footerClassName} ${t}`:"k-table-td "+t}},render(){const e=this.$props.column,t=`footer-${this.$props.rowIndex}-${this.$props.columnIndex}`,o=this.getKeyboardNavigationAttributes(t,!0),n=a.resolveCells(this.$props.cells,e.cells),r={key:this.$props.columnIndex,colspan:e.colSpan===1?void 0:e.colSpan,style:this.columnStyles,class:this.tdClassName,role:"gridcell",tabindex:o.tabIndex,"data-keyboardnavlevel":o[i.KEYBOARD_NAV_DATA_LEVEL],"data-keyboardnavid":o[i.KEYBOARD_NAV_DATA_ID]},d=s.getTemplate.call(this,{h:l.h,template:e.footerCell||(n==null?void 0:n.footerCell),defaultRendering:null,additionalProps:{...this.$props,field:e.field,colSpan:e.colSpan===1?void 0:e.colSpan,defaultStyle:this.columnStyles,tdProps:r}});return l.createVNode("td",r,[d])}});exports.FooterCell=c;
|
package/footer/FooterCell.mjs
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as s, h as i, createVNode as
|
|
9
|
-
import { noop as
|
|
8
|
+
import { defineComponent as s, h as i, createVNode as d } from "vue";
|
|
9
|
+
import { noop as a, getTemplate as c } from "@progress/kendo-vue-common";
|
|
10
10
|
import { KEYBOARD_NAV_DATA_ID as p, KEYBOARD_NAV_DATA_LEVEL as u } from "@progress/kendo-vue-data-tools";
|
|
11
|
-
|
|
11
|
+
import { resolveCells as f } from "../utils/main.mjs";
|
|
12
|
+
const $ = /* @__PURE__ */ s({
|
|
12
13
|
name: "FooterCell",
|
|
13
14
|
props: {
|
|
14
15
|
column: Object,
|
|
@@ -19,13 +20,13 @@ const b = /* @__PURE__ */ s({
|
|
|
19
20
|
},
|
|
20
21
|
inject: {
|
|
21
22
|
getKeyboardNavigationAttributes: {
|
|
22
|
-
default:
|
|
23
|
+
default: a
|
|
23
24
|
}
|
|
24
25
|
},
|
|
25
26
|
computed: {
|
|
26
27
|
columnStyles() {
|
|
27
28
|
const e = this.$props.column;
|
|
28
|
-
if (e.locked && e.left !== void 0)
|
|
29
|
+
if (e.locked && (e.left !== void 0 || e.right !== void 0))
|
|
29
30
|
return this.$props.isRtl ? {
|
|
30
31
|
left: e.right + "px",
|
|
31
32
|
right: e.left + "px"
|
|
@@ -35,23 +36,12 @@ const b = /* @__PURE__ */ s({
|
|
|
35
36
|
};
|
|
36
37
|
},
|
|
37
38
|
tdClassName() {
|
|
38
|
-
const e = this.$props.column, t = e.locked && e.left !== void 0 ? "k-grid-footer-sticky" : "";
|
|
39
|
+
const e = this.$props.column, t = e.locked && (e.left !== void 0 || e.right !== void 0) ? "k-grid-footer-sticky" : "";
|
|
39
40
|
return e.footerClassName ? `k-table-td ${e.footerClassName} ${t}` : "k-table-td " + t;
|
|
40
41
|
}
|
|
41
42
|
},
|
|
42
43
|
render() {
|
|
43
|
-
|
|
44
|
-
const e = this.$props.column, t = `footer-${this.$props.rowIndex}-${this.$props.columnIndex}`, o = this.getKeyboardNavigationAttributes(t, !0), r = c.call(this, {
|
|
45
|
-
h: i,
|
|
46
|
-
template: e.footerCell || ((l = e.cells) == null ? void 0 : l.footerCell) || ((n = this.$props.cells) == null ? void 0 : n.footerCell),
|
|
47
|
-
defaultRendering: null,
|
|
48
|
-
additionalProps: {
|
|
49
|
-
field: e.field,
|
|
50
|
-
colSpan: e.colSpan === 1 ? void 0 : e.colSpan,
|
|
51
|
-
defaultStyle: this.columnStyles
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
return a("td", {
|
|
44
|
+
const e = this.$props.column, t = `footer-${this.$props.rowIndex}-${this.$props.columnIndex}`, o = this.getKeyboardNavigationAttributes(t, !0), l = f(this.$props.cells, e.cells), n = {
|
|
55
45
|
key: this.$props.columnIndex,
|
|
56
46
|
colspan: e.colSpan === 1 ? void 0 : e.colSpan,
|
|
57
47
|
style: this.columnStyles,
|
|
@@ -60,9 +50,21 @@ const b = /* @__PURE__ */ s({
|
|
|
60
50
|
tabindex: o.tabIndex,
|
|
61
51
|
"data-keyboardnavlevel": o[u],
|
|
62
52
|
"data-keyboardnavid": o[p]
|
|
63
|
-
},
|
|
53
|
+
}, r = c.call(this, {
|
|
54
|
+
h: i,
|
|
55
|
+
template: e.footerCell || (l == null ? void 0 : l.footerCell),
|
|
56
|
+
defaultRendering: null,
|
|
57
|
+
additionalProps: {
|
|
58
|
+
...this.$props,
|
|
59
|
+
field: e.field,
|
|
60
|
+
colSpan: e.colSpan === 1 ? void 0 : e.colSpan,
|
|
61
|
+
defaultStyle: this.columnStyles,
|
|
62
|
+
tdProps: n
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return d("td", n, [r]);
|
|
64
66
|
}
|
|
65
67
|
});
|
|
66
68
|
export {
|
|
67
|
-
|
|
69
|
+
$ as FooterCell
|
|
68
70
|
};
|
package/getRowContents.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 T=require("vue"),re=require("./cells/GridCell.js"),ce=require("./cells/GridEditCell.js"),n=require("@progress/kendo-vue-common"),q=require("./utils/main.js"),ie=require("@progress/kendo-vue-data-tools"),R=({leafColumns:t,editField:l,item:o})=>{if(!l)return!1;for(const a of t)if(a.editable){const r=n.getNestedValue(l,o.dataItem);if(r===!0||r===a.field)return!0}return!1},G=({selectedField:t,dataItemKey:l,select:o,item:a})=>{if(t){const r=n.getNestedValue(t,a.dataItem);return typeof r=="boolean"&&r}if(o&&l&&n.getter(l)(a.dataItem)!==void 0){const r=o[n.getter(l)(a.dataItem)];return typeof r=="boolean"&&r}return!1},$=({highlight:t,dataItemKey:l,item:o})=>{if(t&&l&&n.getter(l)(o.dataItem)!==void 0){const a=t[n.getter(l)(o.dataItem)];return typeof a=="boolean"&&a}return!1},se=(t,l,o,a,r,i)=>{const{leafColumns:g,selectedField:p,dataItemKey:c,select:I,highlight:h,editField:y,cellRender:A,cells:D,itemChange:P,selectionChangeHandler:B,editHandler:O,removeHandler:_,saveHandler:j,cancelHandler:M,cellClickHandler:z,cellKeydownHandler:J,computedCollapsed:C,uniqueField:K,columnsRef:L,isRtl:N,idPrefix:Q}=t,U=I&&c&&n.getter(c)(l.dataItem)!==void 0?I[n.getter(c)(l.dataItem)]:void 0,v=p?n.getNestedValue(p,l.dataItem):U,S=h&&c&&n.getter(c)(l.dataItem)!==void 0?h[n.getter(c)(l.dataItem)]:void 0,W=R({leafColumns:g,editField:y,item:l}),X=G({selectedField:p,dataItemKey:c,select:I,item:l}),Y=$({highlight:h,dataItemKey:c,item:l});return{row:(t.hasDynamicColSpan?t.getCellsToRender(l.dataItem,g):t.cellsToRender).map(({columnIndex:u,colSpan:Z})=>{var H,x,E,w,F;const e=g[u];let f;if((H=e.rowSpannable)!=null&&H.enabled&&l.rowType==="data"&&e.field&&i){const d=e.field?(E=(x=e.rowSpannable).valueGetter)==null?void 0:E.call(x,l.dataItem,e.field):null;f={value:d,count:1},i[e.field]&&((w=i[e.field])==null?void 0:w.value)===d&&i[e.field]!==null?(i[e.field].count++,f.count=null):i[e.field]=f}const ee=`${e.className?e.className+" ":""}${e.locked?"k-grid-content-sticky":""}`,le=N?{left:e.right+"px",right:e.left+"px"}:{left:e.left+"px",right:e.right+"px"},te=e.locked&&(e.left!==void 0||e.right!==void 0)?le:void 0;let k=!1;if(e.editable&&y){const d=n.getNestedValue(y,l.dataItem);(d===!0||d===e.field)&&(k=!0)}const s=q.resolveCells(D,e.cells);let b;l.rowType==="groupFooter"?b=(s==null?void 0:s.groupFooter)||e.cell:(e.cell||s!=null&&s.data)&&(b=e.cell);const m=(F=C==null?void 0:C[l.level])==null?void 0:F.some(d=>d===q.groupedFirstItemValue(l.dataItem,K)),ne=e.id?e.id:u,ae=m?!m:l.expanded||l.dataItem.expanded,de=e._type==="expand",oe=ie.tableKeyboardNavigationTools.generateNavigatableId(`${o}-${String(u)}`,Q,de||l.rowType==="groupHeader"||l.rowType==="groupFooter"||e.field==="value"?"nodata":"cell"),V={locked:e.locked,key:ne,id:oe,colSpan:Z,dataItem:l.dataItem,field:e.field||"",editor:e.editor,format:e.format,readFormat:e.readFormat,type:e.type,columnType:e.columnType,className:ee,render:b||A,onChange:P,onSelectionchange:d=>B({event:d,dataItem:l.dataItem,dataIndex:a,columnIndex:u}),onCellclick:z,onCellkeydown:J,onEdit:O,onRemove:_,onSave:j,onCancel:M,cells:s,columnIndex:u,columnsCount:L.filter(d=>!d.children.length).length,rowType:l.rowType,level:l.level,expanded:ae,dataIndex:l.dataIndex,style:te,ariaColumnIndex:e.ariaColumnIndex,isRtl:N,isSelected:!!((e==null?void 0:e._type)==="edit"?v:Array.isArray(v)&&v.indexOf(u)>-1),isHighlighted:!!(typeof S!="boolean"&&S&&e.field&&S[e.field]===!0),group:l.group,rowSpan:f};return e.defaultCell?T.createVNode(e.defaultCell,V,null):k?T.createVNode(ce.GridEditCell,V,null):T.createVNode(re.GridCell,V,null)}),isInEdit:W,isSelected:X,isHighlighted:Y}};exports.calculateIsHighlighted=$;exports.calculateIsInEdit=R;exports.calculateIsSelected=G;exports.getRowContents=se;
|