@progress/kendo-vue-grid 8.1.0-develop.2 → 8.1.0-develop.4
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 +56 -5
- package/Grid.js +1 -1
- package/Grid.mjs +667 -649
- package/GridNav.d.ts +24 -4
- package/GridNav.js +1 -1
- package/GridNav.mjs +62 -22
- package/GridState.d.ts +4 -0
- package/RootGrid.d.ts +32 -11
- package/RootGrid.js +1 -1
- package/RootGrid.mjs +96 -57
- package/cells/GridCell.js +1 -1
- package/cells/GridCell.mjs +35 -26
- package/cells/GridGroupCell.d.ts +10 -0
- package/cells/GridGroupCell.js +1 -1
- package/cells/GridGroupCell.mjs +95 -53
- package/columnMenu/GridColumnMenuCheckboxFilter.d.ts +1 -1
- package/columnMenu/GridColumnMenuCheckboxFilter.js +1 -1
- package/columnMenu/GridColumnMenuCheckboxFilter.mjs +11 -11
- package/common.d.ts +2 -0
- package/common.js +1 -1
- package/common.mjs +2 -0
- package/components/StickyGroupTable.d.ts +85 -0
- package/components/StickyGroupTable.js +8 -0
- package/components/StickyGroupTable.mjs +113 -0
- package/dist/cdn/js/kendo-vue-grid.js +1 -1
- package/drag/ColumnResize.d.ts +10 -1
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +129 -104
- package/drag/GroupingIndicator.d.ts +1 -0
- package/drag/GroupingIndicator.js +1 -1
- package/drag/GroupingIndicator.mjs +28 -18
- package/footer/FooterCell.d.ts +43 -0
- package/footer/FooterCell.js +8 -0
- package/footer/FooterCell.mjs +68 -0
- package/footer/FooterRow.d.ts +5 -6
- package/footer/FooterRow.js +1 -1
- package/footer/FooterRow.mjs +16 -39
- package/getRowContents.d.ts +85 -0
- package/getRowContents.js +8 -0
- package/getRowContents.mjs +172 -0
- package/header/GridHeaderGroupSpacerCell.d.ts +11 -0
- package/hooks/useStickyGroups.d.ts +72 -0
- package/hooks/useStickyGroups.js +8 -0
- package/hooks/useStickyGroups.mjs +350 -0
- package/index.d.mts +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -1
- package/index.mjs +74 -73
- package/interfaces/GridCellProps.d.ts +4 -0
- package/interfaces/GridCellsSettings.d.ts +320 -0
- package/interfaces/GridColumnProps.d.ts +11 -1
- package/interfaces/GridGroupableSettings.d.ts +23 -0
- package/interfaces/GridProps.d.ts +33 -0
- package/messages/main.d.ts +5 -0
- package/messages/main.js +2 -2
- package/messages/main.mjs +15 -13
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +12 -12
- package/utils/main.js +1 -1
- package/utils/main.mjs +80 -76
package/footer/FooterRow.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"),t=require("../utils/main.js"),l=require("./FooterCell.js"),s=o.defineComponent({name:"FooterRow",props:{isRtl:Boolean,columns:Array,rowIndex:Number,cells:Object},render(){return o.createVNode("tr",{class:"k-table-row",role:"row","aria-rowIndex":this.$props.rowIndex},[t.footerColumns(this.$props.columns).map((e,r)=>o.createVNode(l.FooterCell,{key:e.field||e.title||`footer-cell-${r}`,column:e,columnIndex:r,isRtl:this.$props.isRtl,rowIndex:this.$props.rowIndex,cells:this.$props.cells},null))])}});exports.FooterRow=s;
|
package/footer/FooterRow.mjs
CHANGED
|
@@ -5,55 +5,32 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
const
|
|
8
|
+
import { defineComponent as t, createVNode as e } from "vue";
|
|
9
|
+
import { footerColumns as l } from "../utils/main.mjs";
|
|
10
|
+
import { FooterCell as s } from "./FooterCell.mjs";
|
|
11
|
+
const m = /* @__PURE__ */ t({
|
|
12
12
|
name: "FooterRow",
|
|
13
13
|
props: {
|
|
14
14
|
isRtl: Boolean,
|
|
15
15
|
columns: Array,
|
|
16
|
-
rowIndex: Number
|
|
17
|
-
|
|
18
|
-
methods: {
|
|
19
|
-
columnStyles(t) {
|
|
20
|
-
return t.locked && t.left !== void 0 ? this.$props.isRtl ? {
|
|
21
|
-
left: t.right + "px",
|
|
22
|
-
right: t.left + "px"
|
|
23
|
-
} : {
|
|
24
|
-
left: t.left + "px",
|
|
25
|
-
right: t.right + "px"
|
|
26
|
-
} : void 0;
|
|
27
|
-
}
|
|
16
|
+
rowIndex: Number,
|
|
17
|
+
cells: Object
|
|
28
18
|
},
|
|
29
19
|
render() {
|
|
30
|
-
|
|
31
|
-
let r = null;
|
|
32
|
-
const o = e.locked && e.left !== void 0 ? "k-grid-footer-sticky" : "", d = e.footerClassName ? `k-table-td ${e.footerClassName} ${o}` : "k-table-td " + o;
|
|
33
|
-
return r = n.call(this, {
|
|
34
|
-
h: a,
|
|
35
|
-
template: e.footerCell,
|
|
36
|
-
defaultRendering: null,
|
|
37
|
-
additionalProps: {
|
|
38
|
-
field: e.field,
|
|
39
|
-
colSpan: e.colSpan !== 1 ? e.colSpan : void 0,
|
|
40
|
-
defaultStyle: this.columnStyles(e)
|
|
41
|
-
}
|
|
42
|
-
}), l("td", {
|
|
43
|
-
key: s,
|
|
44
|
-
colspan: e.colSpan !== 1 ? e.colSpan : void 0,
|
|
45
|
-
style: this.columnStyles(e),
|
|
46
|
-
class: d,
|
|
47
|
-
role: "gridcell"
|
|
48
|
-
}, [r]);
|
|
49
|
-
};
|
|
50
|
-
return l("tr", {
|
|
20
|
+
return e("tr", {
|
|
51
21
|
class: "k-table-row",
|
|
52
22
|
role: "row",
|
|
53
23
|
"aria-rowIndex": this.$props.rowIndex
|
|
54
|
-
}, [
|
|
24
|
+
}, [l(this.$props.columns).map((o, r) => e(s, {
|
|
25
|
+
key: o.field || o.title || `footer-cell-${r}`,
|
|
26
|
+
column: o,
|
|
27
|
+
columnIndex: r,
|
|
28
|
+
isRtl: this.$props.isRtl,
|
|
29
|
+
rowIndex: this.$props.rowIndex,
|
|
30
|
+
cells: this.$props.cells
|
|
31
|
+
}, null))]);
|
|
55
32
|
}
|
|
56
33
|
});
|
|
57
34
|
export {
|
|
58
|
-
|
|
35
|
+
m as FooterRow
|
|
59
36
|
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { GridCellProps } from './interfaces/GridCellProps';
|
|
9
|
+
import { GridCellRenderModel } from './interfaces/GridCellRenderModel';
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
interface CalculateIsInEditParams {
|
|
14
|
+
leafColumns: any[];
|
|
15
|
+
editField?: string;
|
|
16
|
+
item: any;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
interface CalculateIsSelectedParams {
|
|
22
|
+
selectedField?: string;
|
|
23
|
+
dataItemKey?: string;
|
|
24
|
+
select?: any;
|
|
25
|
+
item: any;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @hidden
|
|
29
|
+
*/
|
|
30
|
+
interface CalculateIsHighlightedParams {
|
|
31
|
+
highlight?: any;
|
|
32
|
+
dataItemKey?: string;
|
|
33
|
+
item: any;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @hidden
|
|
37
|
+
*/
|
|
38
|
+
export interface DataRowContext {
|
|
39
|
+
leafColumns: any[];
|
|
40
|
+
cellsToRender: GridCellRenderModel[];
|
|
41
|
+
hasDynamicColSpan?: boolean;
|
|
42
|
+
getCellsToRender?: (dataItem: any, items: any[]) => GridCellRenderModel[];
|
|
43
|
+
selectedField?: string;
|
|
44
|
+
dataItemKey?: string;
|
|
45
|
+
select?: any;
|
|
46
|
+
highlight?: any;
|
|
47
|
+
editField?: string;
|
|
48
|
+
cellRender?: any;
|
|
49
|
+
cells?: any;
|
|
50
|
+
itemChange: (event: any) => void;
|
|
51
|
+
selectionChangeHandler: (options: any) => void;
|
|
52
|
+
editHandler: (dataItem: any) => void;
|
|
53
|
+
removeHandler: (dataItem: any) => void;
|
|
54
|
+
saveHandler: (dataItem: any) => void;
|
|
55
|
+
cancelHandler: (dataItem: any) => void;
|
|
56
|
+
cellClickHandler: (event: any) => void;
|
|
57
|
+
cellKeydownHandler: (event: any) => void;
|
|
58
|
+
computedCollapsed?: any;
|
|
59
|
+
uniqueField?: string;
|
|
60
|
+
columnsRef: any[];
|
|
61
|
+
isRtl: boolean;
|
|
62
|
+
idPrefix: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @hidden
|
|
66
|
+
*/
|
|
67
|
+
export declare const calculateIsInEdit: ({ leafColumns, editField, item }: CalculateIsInEditParams) => boolean;
|
|
68
|
+
/**
|
|
69
|
+
* @hidden
|
|
70
|
+
*/
|
|
71
|
+
export declare const calculateIsSelected: ({ selectedField, dataItemKey, select, item }: CalculateIsSelectedParams) => boolean;
|
|
72
|
+
/**
|
|
73
|
+
* @hidden
|
|
74
|
+
*/
|
|
75
|
+
export declare const calculateIsHighlighted: ({ highlight, dataItemKey, item }: CalculateIsHighlightedParams) => boolean;
|
|
76
|
+
/**
|
|
77
|
+
* @hidden
|
|
78
|
+
*/
|
|
79
|
+
export declare const getRowContents: (context: DataRowContext, item: any, rowId: string, rowDataIndex: number, isAlt: boolean, spannedRows?: Record<string, Required<GridCellProps['rowSpan']>>) => {
|
|
80
|
+
row: import("vue/jsx-runtime").JSX.Element[];
|
|
81
|
+
isInEdit: boolean;
|
|
82
|
+
isSelected: boolean;
|
|
83
|
+
isHighlighted: boolean;
|
|
84
|
+
};
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("vue"),de=require("./cells/GridCell.js"),re=require("./cells/GridEditCell.js"),n=require("@progress/kendo-vue-common"),ie=require("./utils/main.js"),ce=require("@progress/kendo-vue-data-tools"),R=({leafColumns:t,editField:l,item:d})=>{if(!l)return!1;for(const a of t)if(a.editable){const r=n.getNestedValue(l,d.dataItem);if(r===!0||r===a.field)return!0}return!1},G=({selectedField:t,dataItemKey:l,select:d,item:a})=>{if(t){const r=n.getNestedValue(t,a.dataItem);return typeof r=="boolean"&&r}if(d&&l&&n.getter(l)(a.dataItem)!==void 0){const r=d[n.getter(l)(a.dataItem)];return typeof r=="boolean"&&r}return!1},$=({highlight:t,dataItemKey:l,item:d})=>{if(t&&l&&n.getter(l)(d.dataItem)!==void 0){const a=t[n.getter(l)(d.dataItem)];return typeof a=="boolean"&&a}return!1},se=(t,l,d,a,r,c)=>{const{leafColumns:f,selectedField:g,dataItemKey:i,select:p,highlight:I,editField:y,cellRender:A,cells:h,itemChange:D,selectionChangeHandler:P,editHandler:B,removeHandler:O,saveHandler:_,cancelHandler:j,cellClickHandler:M,cellKeydownHandler:z,computedCollapsed:C,uniqueField:J,columnsRef:K,isRtl:T,idPrefix:L}=t,Q=p&&i&&n.getter(i)(l.dataItem)!==void 0?p[n.getter(i)(l.dataItem)]:void 0,S=g?n.getNestedValue(g,l.dataItem):Q,v=I&&i&&n.getter(i)(l.dataItem)!==void 0?I[n.getter(i)(l.dataItem)]:void 0,U=R({leafColumns:f,editField:y,item:l}),W=G({selectedField:g,dataItemKey:i,select:p,item:l}),X=$({highlight:I,dataItemKey:i,item:l});return{row:(t.hasDynamicColSpan?t.getCellsToRender(l.dataItem,f):t.cellsToRender).map(({columnIndex:s,colSpan:Y})=>{var H,x,E,w,F,q;const e=f[s];let u;if((H=e.rowSpannable)!=null&&H.enabled&&l.rowType==="data"&&e.field&&c){const o=e.field?(E=(x=e.rowSpannable).valueGetter)==null?void 0:E.call(x,l.dataItem,e.field):null;u={value:o,count:1},c[e.field]&&((w=c[e.field])==null?void 0:w.value)===o&&c[e.field]!==null?(c[e.field].count++,u.count=null):c[e.field]=u}const Z=`${e.className?e.className+" ":""}${e.locked?"k-grid-content-sticky":""}`,ee=T?{left:e.right+"px",right:e.left+"px"}:{left:e.left+"px",right:e.right+"px"},le=e.locked&&e.left!==void 0?ee:void 0;let N=!1;if(e.editable&&y){const o=n.getNestedValue(y,l.dataItem);(o===!0||o===e.field)&&(N=!0)}let b;l.rowType==="groupFooter"?b=((F=e.cells)==null?void 0:F.groupFooter)||(h==null?void 0:h.groupFooter)||e.cell:e.cell&&(b=e.cell);const k=(q=C==null?void 0:C[l.level])==null?void 0:q.some(o=>o===ie.groupedFirstItemValue(l.dataItem,J)),te=e.id?e.id:s,ne=k?!k:l.expanded||l.dataItem.expanded,ae=e._type==="expand",oe=ce.tableKeyboardNavigationTools.generateNavigatableId(`${d}-${String(s)}`,L,ae||l.rowType==="groupHeader"||l.rowType==="groupFooter"||e.field==="value"?"nodata":"cell"),V={locked:e.locked,key:te,id:oe,colSpan:Y,dataItem:l.dataItem,field:e.field||"",editor:e.editor,format:e.format,readFormat:e.readFormat,type:e.type,columnType:e.columnType,className:Z,render:b||A,onChange:D,onSelectionchange:o=>P({event:o,dataItem:l.dataItem,dataIndex:a,columnIndex:s}),onCellclick:M,onCellkeydown:z,onEdit:B,onRemove:O,onSave:_,onCancel:j,columnIndex:s,columnsCount:K.filter(o=>!o.children.length).length,rowType:l.rowType,level:l.level,expanded:ne,dataIndex:l.dataIndex,style:le,ariaColumnIndex:e.ariaColumnIndex,isRtl:T,isSelected:!!((e==null?void 0:e._type)==="edit"?S:Array.isArray(S)&&S.indexOf(s)>-1),isHighlighted:!!(typeof v!="boolean"&&v&&e.field&&v[e.field]===!0),group:l.group,rowSpan:u};return e.internalCell?m.createVNode(e.internalCell,V,null):N?m.createVNode(re.GridEditCell,V,null):m.createVNode(de.GridCell,V,null)}),isInEdit:U,isSelected:W,isHighlighted:X}};exports.calculateIsHighlighted=$;exports.calculateIsInEdit=R;exports.calculateIsSelected=G;exports.getRowContents=se;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { createVNode as x } from "vue";
|
|
9
|
+
import { GridCell as ae } from "./cells/GridCell.mjs";
|
|
10
|
+
import { GridEditCell as oe } from "./cells/GridEditCell.mjs";
|
|
11
|
+
import { getter as i, getNestedValue as f } from "@progress/kendo-vue-common";
|
|
12
|
+
import { groupedFirstItemValue as re } from "./utils/main.mjs";
|
|
13
|
+
import { tableKeyboardNavigationTools as de } from "@progress/kendo-vue-data-tools";
|
|
14
|
+
const ie = ({
|
|
15
|
+
leafColumns: t,
|
|
16
|
+
editField: l,
|
|
17
|
+
item: o
|
|
18
|
+
}) => {
|
|
19
|
+
if (!l)
|
|
20
|
+
return !1;
|
|
21
|
+
for (const n of t)
|
|
22
|
+
if (n.editable) {
|
|
23
|
+
const r = f(l, o.dataItem);
|
|
24
|
+
if (r === !0 || r === n.field)
|
|
25
|
+
return !0;
|
|
26
|
+
}
|
|
27
|
+
return !1;
|
|
28
|
+
}, ce = ({
|
|
29
|
+
selectedField: t,
|
|
30
|
+
dataItemKey: l,
|
|
31
|
+
select: o,
|
|
32
|
+
item: n
|
|
33
|
+
}) => {
|
|
34
|
+
if (t) {
|
|
35
|
+
const r = f(t, n.dataItem);
|
|
36
|
+
return typeof r == "boolean" && r;
|
|
37
|
+
}
|
|
38
|
+
if (o && l && i(l)(n.dataItem) !== void 0) {
|
|
39
|
+
const r = o[i(l)(n.dataItem)];
|
|
40
|
+
return typeof r == "boolean" && r;
|
|
41
|
+
}
|
|
42
|
+
return !1;
|
|
43
|
+
}, se = ({
|
|
44
|
+
highlight: t,
|
|
45
|
+
dataItemKey: l,
|
|
46
|
+
item: o
|
|
47
|
+
}) => {
|
|
48
|
+
if (t && l && i(l)(o.dataItem) !== void 0) {
|
|
49
|
+
const n = t[i(l)(o.dataItem)];
|
|
50
|
+
return typeof n == "boolean" && n;
|
|
51
|
+
}
|
|
52
|
+
return !1;
|
|
53
|
+
}, Ce = (t, l, o, n, r, c) => {
|
|
54
|
+
const {
|
|
55
|
+
leafColumns: p,
|
|
56
|
+
selectedField: g,
|
|
57
|
+
dataItemKey: d,
|
|
58
|
+
select: I,
|
|
59
|
+
highlight: y,
|
|
60
|
+
editField: h,
|
|
61
|
+
cellRender: A,
|
|
62
|
+
cells: m,
|
|
63
|
+
itemChange: G,
|
|
64
|
+
selectionChangeHandler: B,
|
|
65
|
+
editHandler: D,
|
|
66
|
+
removeHandler: P,
|
|
67
|
+
saveHandler: _,
|
|
68
|
+
cancelHandler: q,
|
|
69
|
+
cellClickHandler: O,
|
|
70
|
+
cellKeydownHandler: j,
|
|
71
|
+
computedCollapsed: C,
|
|
72
|
+
uniqueField: z,
|
|
73
|
+
columnsRef: J,
|
|
74
|
+
isRtl: H,
|
|
75
|
+
idPrefix: K
|
|
76
|
+
} = t, L = I && d && i(d)(l.dataItem) !== void 0 ? I[i(d)(l.dataItem)] : void 0, v = g ? f(g, l.dataItem) : L, S = y && d && i(d)(l.dataItem) !== void 0 ? y[i(d)(l.dataItem)] : void 0, M = ie({
|
|
77
|
+
leafColumns: p,
|
|
78
|
+
editField: h,
|
|
79
|
+
item: l
|
|
80
|
+
}), Q = ce({
|
|
81
|
+
selectedField: g,
|
|
82
|
+
dataItemKey: d,
|
|
83
|
+
select: I,
|
|
84
|
+
item: l
|
|
85
|
+
}), U = se({
|
|
86
|
+
highlight: y,
|
|
87
|
+
dataItemKey: d,
|
|
88
|
+
item: l
|
|
89
|
+
});
|
|
90
|
+
return {
|
|
91
|
+
row: (t.hasDynamicColSpan ? t.getCellsToRender(l.dataItem, p) : t.cellsToRender).map(({
|
|
92
|
+
columnIndex: s,
|
|
93
|
+
colSpan: W
|
|
94
|
+
}) => {
|
|
95
|
+
var E, F, V, N, R, $;
|
|
96
|
+
const e = p[s];
|
|
97
|
+
let u;
|
|
98
|
+
if ((E = e.rowSpannable) != null && E.enabled && l.rowType === "data" && e.field && c) {
|
|
99
|
+
const a = e.field ? (V = (F = e.rowSpannable).valueGetter) == null ? void 0 : V.call(F, l.dataItem, e.field) : null;
|
|
100
|
+
u = {
|
|
101
|
+
value: a,
|
|
102
|
+
count: 1
|
|
103
|
+
}, c[e.field] && ((N = c[e.field]) == null ? void 0 : N.value) === a && c[e.field] !== null ? (c[e.field].count++, u.count = null) : c[e.field] = u;
|
|
104
|
+
}
|
|
105
|
+
const X = `${e.className ? e.className + " " : ""}${e.locked ? "k-grid-content-sticky" : ""}`, Y = H ? {
|
|
106
|
+
left: e.right + "px",
|
|
107
|
+
right: e.left + "px"
|
|
108
|
+
} : {
|
|
109
|
+
left: e.left + "px",
|
|
110
|
+
right: e.right + "px"
|
|
111
|
+
}, Z = e.locked && e.left !== void 0 ? Y : void 0;
|
|
112
|
+
let k = !1;
|
|
113
|
+
if (e.editable && h) {
|
|
114
|
+
const a = f(h, l.dataItem);
|
|
115
|
+
(a === !0 || a === e.field) && (k = !0);
|
|
116
|
+
}
|
|
117
|
+
let b;
|
|
118
|
+
l.rowType === "groupFooter" ? b = ((R = e.cells) == null ? void 0 : R.groupFooter) || (m == null ? void 0 : m.groupFooter) || e.cell : e.cell && (b = e.cell);
|
|
119
|
+
const w = ($ = C == null ? void 0 : C[l.level]) == null ? void 0 : $.some((a) => a === re(l.dataItem, z)), ee = e.id ? e.id : s, le = w ? !w : l.expanded || l.dataItem.expanded, te = e._type === "expand", ne = de.generateNavigatableId(`${o}-${String(s)}`, K, te || l.rowType === "groupHeader" || l.rowType === "groupFooter" || e.field === "value" ? "nodata" : "cell"), T = {
|
|
120
|
+
locked: e.locked,
|
|
121
|
+
key: ee,
|
|
122
|
+
id: ne,
|
|
123
|
+
colSpan: W,
|
|
124
|
+
dataItem: l.dataItem,
|
|
125
|
+
field: e.field || "",
|
|
126
|
+
editor: e.editor,
|
|
127
|
+
format: e.format,
|
|
128
|
+
readFormat: e.readFormat,
|
|
129
|
+
type: e.type,
|
|
130
|
+
columnType: e.columnType,
|
|
131
|
+
className: X,
|
|
132
|
+
render: b || A,
|
|
133
|
+
onChange: G,
|
|
134
|
+
onSelectionchange: (a) => B({
|
|
135
|
+
event: a,
|
|
136
|
+
dataItem: l.dataItem,
|
|
137
|
+
dataIndex: n,
|
|
138
|
+
columnIndex: s
|
|
139
|
+
}),
|
|
140
|
+
onCellclick: O,
|
|
141
|
+
onCellkeydown: j,
|
|
142
|
+
onEdit: D,
|
|
143
|
+
onRemove: P,
|
|
144
|
+
onSave: _,
|
|
145
|
+
onCancel: q,
|
|
146
|
+
columnIndex: s,
|
|
147
|
+
columnsCount: J.filter((a) => !a.children.length).length,
|
|
148
|
+
rowType: l.rowType,
|
|
149
|
+
level: l.level,
|
|
150
|
+
expanded: le,
|
|
151
|
+
dataIndex: l.dataIndex,
|
|
152
|
+
style: Z,
|
|
153
|
+
ariaColumnIndex: e.ariaColumnIndex,
|
|
154
|
+
isRtl: H,
|
|
155
|
+
isSelected: !!((e == null ? void 0 : e._type) === "edit" ? v : Array.isArray(v) && v.indexOf(s) > -1),
|
|
156
|
+
isHighlighted: !!(typeof S != "boolean" && S && e.field && S[e.field] === !0),
|
|
157
|
+
group: l.group,
|
|
158
|
+
rowSpan: u
|
|
159
|
+
};
|
|
160
|
+
return e.internalCell ? x(e.internalCell, T, null) : k ? x(oe, T, null) : x(ae, T, null);
|
|
161
|
+
}),
|
|
162
|
+
isInEdit: M,
|
|
163
|
+
isSelected: Q,
|
|
164
|
+
isHighlighted: U
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
export {
|
|
168
|
+
se as calculateIsHighlighted,
|
|
169
|
+
ie as calculateIsInEdit,
|
|
170
|
+
ce as calculateIsSelected,
|
|
171
|
+
Ce as getRowContents
|
|
172
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export declare const GridHeaderGroupSpacerCell: import('vue').DefineComponent<{}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { Ref } from 'vue';
|
|
9
|
+
import { RowHeightService } from '@progress/kendo-vue-common';
|
|
10
|
+
import { GroupState } from '@progress/kendo-vue-data-tools';
|
|
11
|
+
import { DataItemWrapper } from '../utils/main';
|
|
12
|
+
import { StickyGroupTable } from '../components/StickyGroupTable';
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
* Represents the range of a group within the flat data array.
|
|
16
|
+
*/
|
|
17
|
+
export interface GroupRange {
|
|
18
|
+
headerIndex: number;
|
|
19
|
+
footerIndex: number | null;
|
|
20
|
+
firstChildIndex: number;
|
|
21
|
+
lastChildIndex: number;
|
|
22
|
+
level: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @hidden
|
|
26
|
+
* Builds a map of group ranges from the flat data array.
|
|
27
|
+
* Each group header maps to its footer and child range.
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildGroupRangeMap(flatDataArray: DataItemWrapper[]): Map<number, GroupRange>;
|
|
30
|
+
/**
|
|
31
|
+
* @hidden
|
|
32
|
+
* Pairs a DataItemWrapper with its flat-data index.
|
|
33
|
+
*/
|
|
34
|
+
export interface StickyGroupItem {
|
|
35
|
+
item: DataItemWrapper;
|
|
36
|
+
flatIndex: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @hidden
|
|
40
|
+
*/
|
|
41
|
+
export declare function computeStickyItems(flatDataArray: DataItemWrapper[], groupRanges: Map<number, GroupRange>, firstVisibleIndex: number, lastVisibleIndex: number, rawFirstVisibleIndex?: number): StickyGroupItem[];
|
|
42
|
+
/**
|
|
43
|
+
* @hidden
|
|
44
|
+
* Computes which group footers should be sticky at the bottom of the viewport.
|
|
45
|
+
* A footer is sticky when it is scrolled below the viewport but its group's
|
|
46
|
+
* header (or first child) is still visible above.
|
|
47
|
+
*/
|
|
48
|
+
export declare function computeStickyFooterItems(flatDataArray: DataItemWrapper[], groupRanges: Map<number, GroupRange>, firstVisibleIndex: number, lastVisibleIndex: number): StickyGroupItem[];
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
* Composable that computes which group header/footer should be sticky
|
|
52
|
+
* based on the scroll position and the flat data array.
|
|
53
|
+
* Uses refs + direct DOM manipulation to avoid render-cycle flicker.
|
|
54
|
+
*/
|
|
55
|
+
export declare function useStickyGroups(options: {
|
|
56
|
+
enabled: boolean;
|
|
57
|
+
enabledFooters?: boolean;
|
|
58
|
+
flatData: Ref<DataItemWrapper[]>;
|
|
59
|
+
stickyHeaderRef: Ref<InstanceType<typeof StickyGroupTable> | null>;
|
|
60
|
+
stickyFooterRef: Ref<InstanceType<typeof StickyGroupTable> | null>;
|
|
61
|
+
containerRef: Ref<HTMLDivElement | null>;
|
|
62
|
+
tableBodyRef: Ref<HTMLTableSectionElement | null>;
|
|
63
|
+
rowHeight?: number;
|
|
64
|
+
isGrouped: Ref<boolean>;
|
|
65
|
+
virtualSkipRef?: Ref<number>;
|
|
66
|
+
rowHeightServiceRef?: Ref<RowHeightService | undefined>;
|
|
67
|
+
}): {
|
|
68
|
+
stickyHeaderItems: Ref<StickyGroupItem[]>;
|
|
69
|
+
stickyFooterItems: Ref<StickyGroupItem[]>;
|
|
70
|
+
scrollToStickyGroup: (group: GroupState) => void;
|
|
71
|
+
update: () => void;
|
|
72
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("vue");require("@progress/kendo-vue-common");require("@progress/kendo-vue-data-tools");function Pe(d){const u=[],a=[];for(let t=0;t<d.length;t++){const n=d[t];if(n.rowType==="groupHeader"){for(let e=a.length-1;e>=0;e--)if(a[e].level>=n.level){const r=a[e];u.push({headerIndex:r.headerIndex,footerIndex:null,firstChildIndex:r.headerIndex+1,lastChildIndex:t-1,level:r.level}),a.splice(e,1)}a.push({headerIndex:t,level:n.level})}else if(n.rowType==="groupFooter"){for(let e=a.length-1;e>=0;e--)if(a[e].level===n.level){const r=a[e];u.push({headerIndex:r.headerIndex,footerIndex:t,firstChildIndex:r.headerIndex+1,lastChildIndex:t-1,level:n.level}),a.splice(e,1);break}}}for(const t of a)u.push({headerIndex:t.headerIndex,footerIndex:null,firstChildIndex:t.headerIndex+1,lastChildIndex:d.length-1,level:t.level});const p=new Map;for(const t of u)p.set(t.headerIndex,t);return p}function ke(d,u,a,p,t){var I;const n=[],e=t!=null?t:a,r=[];for(const f of u.values())if(f.headerIndex<a){const v=(I=f.footerIndex)!=null?I:f.lastChildIndex;v>f.headerIndex&&v>=e&&r.push(f)}const o=new Map;for(const f of r){const v=o.get(f.level);(!v||f.headerIndex>v.headerIndex)&&o.set(f.level,f)}const c=Array.from(o.keys()).sort((f,v)=>f-v);for(const f of c){const v=o.get(f);n.push({item:d[v.headerIndex],flatIndex:v.headerIndex})}return n}function Re(d,u,a,p){const t=[],n=[];for(const o of u.values())o.footerIndex!==null&&o.footerIndex>p&&o.headerIndex<=p&&n.push(o);const e=new Map;for(const o of n){const c=e.get(o.level);(!c||o.footerIndex<c.footerIndex)&&e.set(o.level,o)}const r=Array.from(e.keys()).sort((o,c)=>c-o);for(const o of r){const c=e.get(o);t.push({item:d[c.footerIndex],flatIndex:c.footerIndex})}return t}function _(d,u){if(d.length!==u.length)return!0;for(let a=0;a<d.length;a++)if(d[a].flatIndex!==u[a].flatIndex)return!0;return!1}function be(d,u){const a=d.querySelectorAll("tbody > tr");let p=0,t=!1;for(let n=0;n<a.length&&n<u.length;n++){const e=a[n],r=e.offsetHeight||e.getBoundingClientRect().height,o=u[n];if(o<0){t=!0;const c=-o,I=Math.max(r-c,0);p+=I,I<=0?(e.style.display="none",e.style.transform="",e.style.clipPath=""):(e.style.display="",e.style.transform=`translateY(${o}px)`,e.style.clipPath=`inset(${c}px 0 0 0)`)}else p+=r,e.style.display="",e.style.transform="",e.style.clipPath=""}d.style.height=t?p+"px":""}function we(d,u){const a=d.querySelectorAll("tbody > tr");let p=0,t=!1,n=0;const e=[];for(let r=0;r<a.length&&r<u.length;r++){const o=a[r],c=o.offsetHeight||o.getBoundingClientRect().height;e.push(c);const I=u[r];if(I>0){t=!0;const f=Math.max(c-I,0);p+=f,n+=c-f}else p+=c}for(let r=0;r<a.length&&r<u.length;r++){const o=a[r],c=u[r],I=e[r];c>0?Math.max(I-c,0)<=0?(o.style.display="",o.style.transform="",o.style.clipPath="inset(0 0 100% 0)"):(o.style.display="",o.style.transform="",o.style.clipPath=`inset(0 0 ${c}px 0)`):(o.style.display="",o.style.transform=t?`translateY(${-n}px)`:"",o.style.clipPath="")}d.style.height=t?p+"px":""}function $e(d){const{enabled:u,enabledFooters:a,flatData:p,stickyHeaderRef:t,stickyFooterRef:n,containerRef:e,tableBodyRef:r,isGrouped:o,virtualSkipRef:c,rowHeight:I,rowHeightServiceRef:f}=d,v=u&&o.value,A=!!a&&o.value,G=w.ref([]),ee=w.ref([]),K=w.ref([]),N=w.ref([]),te=w.ref([]),Q=w.ref([]),oe=w.ref(!1),se=w.ref(!1);w.onUpdated(()=>{var h;oe.value&&((h=t.value)!=null&&h.$el)&&ee.value.length>0&&(be(t.value.$el,ee.value),oe.value=!1),t.value&&e.value&&(t.value.$el.scrollLeft=e.value.scrollLeft)}),w.onUpdated(()=>{var h,H;se.value&&((h=n.value)!=null&&h.$el)&&te.value.length>0&&(we((H=n.value)==null?void 0:H.$el,te.value),se.value=!1),n.value&&e.value&&(n.value.$el.scrollLeft=e.value.scrollLeft)});const Te=()=>{var ge,ve,pe,ye,me,xe,Ie;if(!v&&!A)return;const h=p.value,H=Pe(h);if(H.size===0)return;const B=new Map;if(A)for(const s of H.values())s.footerIndex!==null&&B.set(s.footerIndex,s);const R=e.value,O=r.value;if(!R||!O)return;const b=R.scrollTop,V=R.clientHeight,U=O.children;if(U.length===0)return;const T=f==null?void 0:f.value,W=I||36,g=(c==null?void 0:c.value)||0,M=R.getBoundingClientRect(),S=O.getBoundingClientRect().top-M.top+b,P=U.length,Y=new Array(P),X=new Array(P);for(let s=0;s<P;s++){const l=U[s];Y[s]=S+l.offsetTop,X[s]=l.offsetHeight}const le=s=>{const l=s-g;return l>=0&&l<P?X[l]:T&&s>=0&&s<h.length?T.height(s):W},ae=s=>{const l=s-g;if(l>=0&&l<P)return Y[l];if(T&&s>=0&&s<h.length)return T.offset(s)},Ce=s=>{let l=0,i=P;for(;l<i;){const y=l+i>>1;Y[y]<s?l=y+1:i=y}return l},ie=s=>{const l=Ce(s);return l<P?g+l:g},ce=s=>{let l=0,i=P-1;for(;l<=i;){const y=l+i>>1;Y[y]+X[y]<=s?l=y+1:i=y-1}return i>=0?g+i:h.length-1},fe=Math.min(ie(b),h.length-1);let j=fe;const ue=s=>{const l=s.querySelectorAll("tbody > tr");for(let i=0;i<l.length;i++){const y=l[i];y.style.transform="",y.style.clipPath="",y.style.display=""}s.style.height=""};if(v&&t.value){let s=0,l=[],i=[];const y=k=>{var x;const F=[];let m=0;for(const C of k){const $=le(C);let L=0;const q=H.get(C);if(q){const Z=(x=q.footerIndex)!=null?x:q.lastChildIndex+1,E=ae(Z);if(E!==void 0){const J=m+$,He=E-b;He<J&&(L=He-J)}}F.push(L),m+=Math.max($+L,0)}return{totalHeight:m,offsets:F}},z=new Set;for(;;){j=Math.min(ie(b+Math.max(s,0)),h.length-1);const k=z.has(j);z.add(j);const F=Math.min(ce(b+V),h.length-1),m=ke(h,H,j,F,fe),x=y(m.map($=>$.flatIndex)),C=!_(m,i)&&Math.abs(x.totalHeight-s)<1;if(i=m,s=x.totalHeight,l=x.offsets,C||k)break}const ne=i.length>0,re=G.value,D=_(i,re);ne?D?(G.value=i,ee.value=l,oe.value=!0):(t.value.$el.style.display="",be((ve=t.value)==null?void 0:ve.$el,l)):(t.value.$el.style.display="none",ue((ge=t.value)==null?void 0:ge.$el)),D&&(K.value=i,G.value=i)}if(A&&n.value){let s=0,l=[],i=[];const y=k=>{const F=[];let m=0;for(let x=k.length-1;x>=0;x--){const C=k[x],$=le(C);let L=0;const q=B.get(C);if(q){const Z=ae(q.headerIndex);if(Z!==void 0){const E=Z+le(q.headerIndex),J=b+V-m-$;E>J&&(L=E-J)}}F[x]=L,m+=Math.max($-L,0)}return{totalHeight:m,offsets:F}},z=new Set;for(;;){const k=Math.min(ce(b+V-s),h.length-1),F=z.has(k);z.add(k);const m=Re(h,H,j,k),x=y(m.map($=>$.flatIndex)),C=!_(m,i)&&Math.abs(x.totalHeight-s)<1;if(i=m,s=x.totalHeight,l=x.offsets,C||F)break}const ne=i.length>0,re=N.value,D=_(i,re);ne?D?(N.value=i,te.value=l,se.value=!0):(n.value.$el.style.display="",we(n.value.$el,l)):(n.value.$el.style.display="none",ue((pe=n.value)==null?void 0:pe.$el)),D&&(Q.value=i,N.value=i)}const de=((me=(ye=t.value)==null?void 0:ye.$el)==null?void 0:me.offsetHeight)||0,he=((Ie=(xe=n.value)==null?void 0:xe.$el)==null?void 0:Ie.offsetHeight)||0;return R.style.scrollPaddingTop=de>0?de+"px":"",R.style.scrollPaddingBottom=he>0?he+"px":"",{stickyHeaderItems:K,stickyFooterItems:Q}},Fe=h=>{var W;if(!v)return;const H=G.value.find(g=>{var M,S;return((M=g.item.group)==null?void 0:M.field)===h.field&&((S=g.item.group)==null?void 0:S.value)===h.value});if(!H)return;const B=e.value;if(!B)return;let R=0;const O=I||36,b=(W=t.value.$el)==null?void 0:W.querySelectorAll("tbody > tr"),V=G.value;for(let g=0;g<V.length;g++)if(V[g].item.level<H.item.level){const M=b&&g<b.length&&b[g].offsetHeight||O;R+=M}const U=f==null?void 0:f.value;let T;if(U)T=U.offset(H.flatIndex);else{const g=r.value,M=(c==null?void 0:c.value)||0,S=H.flatIndex-M;if(g&&S>=0&&S<g.children.length){const P=g.children[S],Y=B.getBoundingClientRect();T=g.getBoundingClientRect().top-Y.top+B.scrollTop+P.offsetTop}}T!==void 0&&(B.scrollTop=T-R)};return w.watch([()=>v,()=>A,e],()=>{v||(G.value=[],K.value=[]),A||(N.value=[],Q.value=[]),!v&&!A&&e.value&&(e.value.style.scrollPaddingTop="",e.value.style.scrollPaddingBottom="")}),{stickyHeaderItems:K,stickyFooterItems:Q,scrollToStickyGroup:Fe,update:Te}}exports.buildGroupRangeMap=Pe;exports.computeStickyFooterItems=Re;exports.computeStickyItems=ke;exports.useStickyGroups=$e;
|