@progress/kendo-react-grid 9.4.0-develop.14 → 9.4.0-develop.15
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/GridComponent.js +1 -1
- package/GridComponent.mjs +337 -327
- package/cells/GridCell.js +1 -1
- package/cells/GridCell.mjs +24 -20
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/index.d.mts +42 -1
- package/index.d.ts +42 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -13
- package/utils/index.js +1 -1
- package/utils/index.mjs +122 -116
package/index.d.mts
CHANGED
|
@@ -252,6 +252,7 @@ declare interface ExtendedColumnProps extends GridColumnProps {
|
|
|
252
252
|
isAccessible: boolean;
|
|
253
253
|
/** @hidden _internal usage only */
|
|
254
254
|
_type?: 'edit' | 'expand';
|
|
255
|
+
rowSpannable?: Required<GridRowSpannableSettings>;
|
|
255
256
|
}
|
|
256
257
|
|
|
257
258
|
/**
|
|
@@ -305,7 +306,7 @@ export declare const GRID_PREVENT_SELECTION_ELEMENT = "data-prevent-selection";
|
|
|
305
306
|
/** The attribute required by the Grid selection on Grid `tr` elements. */
|
|
306
307
|
export declare const GRID_ROW_INDEX_ATTRIBUTE = "data-grid-row-index";
|
|
307
308
|
|
|
308
|
-
export declare const GridCell: (props: GridCellProps) => JSX_2.Element;
|
|
309
|
+
export declare const GridCell: (props: GridCellProps) => JSX_2.Element | null;
|
|
309
310
|
|
|
310
311
|
/**
|
|
311
312
|
* Represents the `GridCellBaseOptions` object that are passed to the handler.
|
|
@@ -410,6 +411,11 @@ export declare interface GridCellProps extends Omit<CellProps, 'onChange' | 'ren
|
|
|
410
411
|
localization?: LocalizationService;
|
|
411
412
|
/** @hidden */
|
|
412
413
|
intl?: IntlService;
|
|
414
|
+
/** @hidden */
|
|
415
|
+
_rowSpan?: {
|
|
416
|
+
count: number | null;
|
|
417
|
+
value: any;
|
|
418
|
+
};
|
|
413
419
|
}
|
|
414
420
|
|
|
415
421
|
/**
|
|
@@ -1096,6 +1102,10 @@ export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell'> {
|
|
|
1096
1102
|
* @default "data"
|
|
1097
1103
|
*/
|
|
1098
1104
|
columnType?: GridColumnType;
|
|
1105
|
+
/**
|
|
1106
|
+
* Defines if the cells of the column should be spanned when their values are the same.
|
|
1107
|
+
*/
|
|
1108
|
+
rowSpannable?: boolean | GridRowSpannableSettings;
|
|
1099
1109
|
}
|
|
1100
1110
|
|
|
1101
1111
|
/**
|
|
@@ -2433,6 +2443,10 @@ export declare interface GridProps extends KendoReactComponentBaseProps {
|
|
|
2433
2443
|
* @hidden
|
|
2434
2444
|
*/
|
|
2435
2445
|
unstyled?: GridClassStructure;
|
|
2446
|
+
/**
|
|
2447
|
+
* @hidden
|
|
2448
|
+
*/
|
|
2449
|
+
rowSpannable?: boolean | GridRowSpannableSettings;
|
|
2436
2450
|
}
|
|
2437
2451
|
|
|
2438
2452
|
/**
|
|
@@ -2580,6 +2594,33 @@ export declare type GridRowReorderSettings = {
|
|
|
2580
2594
|
dragClue?: string | ((dataItem: any) => React.ReactNode);
|
|
2581
2595
|
};
|
|
2582
2596
|
|
|
2597
|
+
/**
|
|
2598
|
+
* Represents the settings for the row-spanning functionality of the Grid.
|
|
2599
|
+
*
|
|
2600
|
+
* @example
|
|
2601
|
+
*
|
|
2602
|
+
* ```tsx
|
|
2603
|
+
* <Grid
|
|
2604
|
+
* data={data}
|
|
2605
|
+
* rowSpannable={{
|
|
2606
|
+
* enabled: true,
|
|
2607
|
+
* valueGetter: (dataItem, field) => `${dataItem['id']} - ${dataItem[field]}`,
|
|
2608
|
+
* }}
|
|
2609
|
+
* />
|
|
2610
|
+
* ```
|
|
2611
|
+
*/
|
|
2612
|
+
export declare type GridRowSpannableSettings = {
|
|
2613
|
+
/**
|
|
2614
|
+
* Determines if the row-spanning functionality is enabled or disabled
|
|
2615
|
+
*/
|
|
2616
|
+
enabled?: boolean;
|
|
2617
|
+
/**
|
|
2618
|
+
* A function that returns the value of the cell that should span the row.
|
|
2619
|
+
* The value could be combined from multiple fields of the dataItem to create a unique identifier and prevent the cell from being row-spanned.
|
|
2620
|
+
*/
|
|
2621
|
+
valueGetter?: (dataItem: any, field: string) => any;
|
|
2622
|
+
};
|
|
2623
|
+
|
|
2583
2624
|
/**
|
|
2584
2625
|
* The type of the GridRow component.
|
|
2585
2626
|
*
|
package/index.d.ts
CHANGED
|
@@ -252,6 +252,7 @@ declare interface ExtendedColumnProps extends GridColumnProps {
|
|
|
252
252
|
isAccessible: boolean;
|
|
253
253
|
/** @hidden _internal usage only */
|
|
254
254
|
_type?: 'edit' | 'expand';
|
|
255
|
+
rowSpannable?: Required<GridRowSpannableSettings>;
|
|
255
256
|
}
|
|
256
257
|
|
|
257
258
|
/**
|
|
@@ -305,7 +306,7 @@ export declare const GRID_PREVENT_SELECTION_ELEMENT = "data-prevent-selection";
|
|
|
305
306
|
/** The attribute required by the Grid selection on Grid `tr` elements. */
|
|
306
307
|
export declare const GRID_ROW_INDEX_ATTRIBUTE = "data-grid-row-index";
|
|
307
308
|
|
|
308
|
-
export declare const GridCell: (props: GridCellProps) => JSX_2.Element;
|
|
309
|
+
export declare const GridCell: (props: GridCellProps) => JSX_2.Element | null;
|
|
309
310
|
|
|
310
311
|
/**
|
|
311
312
|
* Represents the `GridCellBaseOptions` object that are passed to the handler.
|
|
@@ -410,6 +411,11 @@ export declare interface GridCellProps extends Omit<CellProps, 'onChange' | 'ren
|
|
|
410
411
|
localization?: LocalizationService;
|
|
411
412
|
/** @hidden */
|
|
412
413
|
intl?: IntlService;
|
|
414
|
+
/** @hidden */
|
|
415
|
+
_rowSpan?: {
|
|
416
|
+
count: number | null;
|
|
417
|
+
value: any;
|
|
418
|
+
};
|
|
413
419
|
}
|
|
414
420
|
|
|
415
421
|
/**
|
|
@@ -1096,6 +1102,10 @@ export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell'> {
|
|
|
1096
1102
|
* @default "data"
|
|
1097
1103
|
*/
|
|
1098
1104
|
columnType?: GridColumnType;
|
|
1105
|
+
/**
|
|
1106
|
+
* Defines if the cells of the column should be spanned when their values are the same.
|
|
1107
|
+
*/
|
|
1108
|
+
rowSpannable?: boolean | GridRowSpannableSettings;
|
|
1099
1109
|
}
|
|
1100
1110
|
|
|
1101
1111
|
/**
|
|
@@ -2433,6 +2443,10 @@ export declare interface GridProps extends KendoReactComponentBaseProps {
|
|
|
2433
2443
|
* @hidden
|
|
2434
2444
|
*/
|
|
2435
2445
|
unstyled?: GridClassStructure;
|
|
2446
|
+
/**
|
|
2447
|
+
* @hidden
|
|
2448
|
+
*/
|
|
2449
|
+
rowSpannable?: boolean | GridRowSpannableSettings;
|
|
2436
2450
|
}
|
|
2437
2451
|
|
|
2438
2452
|
/**
|
|
@@ -2580,6 +2594,33 @@ export declare type GridRowReorderSettings = {
|
|
|
2580
2594
|
dragClue?: string | ((dataItem: any) => React.ReactNode);
|
|
2581
2595
|
};
|
|
2582
2596
|
|
|
2597
|
+
/**
|
|
2598
|
+
* Represents the settings for the row-spanning functionality of the Grid.
|
|
2599
|
+
*
|
|
2600
|
+
* @example
|
|
2601
|
+
*
|
|
2602
|
+
* ```tsx
|
|
2603
|
+
* <Grid
|
|
2604
|
+
* data={data}
|
|
2605
|
+
* rowSpannable={{
|
|
2606
|
+
* enabled: true,
|
|
2607
|
+
* valueGetter: (dataItem, field) => `${dataItem['id']} - ${dataItem[field]}`,
|
|
2608
|
+
* }}
|
|
2609
|
+
* />
|
|
2610
|
+
* ```
|
|
2611
|
+
*/
|
|
2612
|
+
export declare type GridRowSpannableSettings = {
|
|
2613
|
+
/**
|
|
2614
|
+
* Determines if the row-spanning functionality is enabled or disabled
|
|
2615
|
+
*/
|
|
2616
|
+
enabled?: boolean;
|
|
2617
|
+
/**
|
|
2618
|
+
* A function that returns the value of the cell that should span the row.
|
|
2619
|
+
* The value could be combined from multiple fields of the dataItem to create a unique identifier and prevent the cell from being row-spanned.
|
|
2620
|
+
*/
|
|
2621
|
+
valueGetter?: (dataItem: any, field: string) => any;
|
|
2622
|
+
};
|
|
2623
|
+
|
|
2583
2624
|
/**
|
|
2584
2625
|
* The type of the GridRow component.
|
|
2585
2626
|
*
|
package/package-metadata.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-grid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-grid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1738772450,version:"9.4.0-develop.15",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "KendoReact",
|
|
11
11
|
productCode: "KENDOUIREACT",
|
|
12
12
|
productCodes: ["KENDOUIREACT"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "9.4.0-develop.
|
|
13
|
+
publishDate: 1738772450,
|
|
14
|
+
version: "9.4.0-develop.15",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-grid",
|
|
3
|
-
"version": "9.4.0-develop.
|
|
3
|
+
"version": "9.4.0-develop.15",
|
|
4
4
|
"description": "React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -28,17 +28,17 @@
|
|
|
28
28
|
"@progress/kendo-data-query": "^1.0.0",
|
|
29
29
|
"@progress/kendo-drawing": "^1.21.2",
|
|
30
30
|
"@progress/kendo-licensing": "^1.3.4",
|
|
31
|
-
"@progress/kendo-react-animation": "9.4.0-develop.
|
|
32
|
-
"@progress/kendo-react-buttons": "9.4.0-develop.
|
|
33
|
-
"@progress/kendo-react-common": "9.4.0-develop.
|
|
34
|
-
"@progress/kendo-react-data-tools": "9.4.0-develop.
|
|
35
|
-
"@progress/kendo-react-dateinputs": "9.4.0-develop.
|
|
36
|
-
"@progress/kendo-react-indicators": "9.4.0-develop.
|
|
37
|
-
"@progress/kendo-react-dropdowns": "9.4.0-develop.
|
|
38
|
-
"@progress/kendo-react-inputs": "9.4.0-develop.
|
|
39
|
-
"@progress/kendo-react-intl": "9.4.0-develop.
|
|
40
|
-
"@progress/kendo-react-popup": "9.4.0-develop.
|
|
41
|
-
"@progress/kendo-react-layout": "9.4.0-develop.
|
|
31
|
+
"@progress/kendo-react-animation": "9.4.0-develop.15",
|
|
32
|
+
"@progress/kendo-react-buttons": "9.4.0-develop.15",
|
|
33
|
+
"@progress/kendo-react-common": "9.4.0-develop.15",
|
|
34
|
+
"@progress/kendo-react-data-tools": "9.4.0-develop.15",
|
|
35
|
+
"@progress/kendo-react-dateinputs": "9.4.0-develop.15",
|
|
36
|
+
"@progress/kendo-react-indicators": "9.4.0-develop.15",
|
|
37
|
+
"@progress/kendo-react-dropdowns": "9.4.0-develop.15",
|
|
38
|
+
"@progress/kendo-react-inputs": "9.4.0-develop.15",
|
|
39
|
+
"@progress/kendo-react-intl": "9.4.0-develop.15",
|
|
40
|
+
"@progress/kendo-react-popup": "9.4.0-develop.15",
|
|
41
|
+
"@progress/kendo-react-layout": "9.4.0-develop.15",
|
|
42
42
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
43
43
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
44
44
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"package": {
|
|
85
85
|
"productName": "KendoReact",
|
|
86
86
|
"productCode": "KENDOUIREACT",
|
|
87
|
-
"publishDate":
|
|
87
|
+
"publishDate": 1738772450,
|
|
88
88
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
89
89
|
}
|
|
90
90
|
},
|
package/utils/index.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 v=require("../GridColumn.js"),y=require("@progress/kendo-data-query"),S=require("@progress/kendo-react-data-tools"),T=require("./_serverModule.js"),G=require("./_clientModule.js"),x=require("../contextMenu/enums.js");function m(e,t){const a=(e!=null?e:"").split(".");let i=t;return a.forEach(d=>{i=i?i[d]:void 0}),i}function w(e,t,a,i,d,s,n,r,o,l,f=0,h){var M;let u=f;for(let c=0;c<t.length;c++){let I;if(!d||t[c].value===void 0||t[c].items===void 0){e[e.length]={dataIndex:i.index,dataItem:t[c],rowType:"data",level:f,group:h,expanded:(M=s?m(s,t[c]):l&&!!(n!=null&&n[y.getter(l)(t[c])]))!=null?M:!1},i.index++;continue}else{let C;h!=null&&h.parents?C=[{field:h.field,value:h.value},...h.parents]:h?C=[h]:C=[],I={field:t[c].field,value:t[c].value,parents:C}}u=Math.max(u,f+1);let g=!1;if(s)g=m(s,t[c])!==!1;else{const C=S.findGroupExpand(r||[],I);C?g=C.expanded!==!1:g=o!==!1}e[e.length]={dataIndex:-1,dataItem:t[c],level:f,group:I,rowType:"groupHeader",expanded:g},g&&(I.expanded=g,u=Math.max(w(e,t[c].items,a,i,d,s,n,r,o,l,f+1,I),u)),(a==="always"||g&&a==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[c],rowType:"groupFooter",level:f,expanded:g})}return u}const R=(e,t)=>typeof e.colSpan=="function"?e.colSpan({dataItem:t,column:e}):e.colSpan||1;function k(e,t){const a=[[]];let i=0;for(let n=e.length-1;n>=0;n--)i=Math.max(i,e[n].depth),e[n].headerColSpan=e[n].headerColSpan||1,e[n].children.length>0&&(e[n].headerColSpan=e[n].children.reduce((r,o)=>o.hidden?r:r+o.headerColSpan,0));const d=[];let s=1;return e.forEach((n,r)=>{a[n.depth]=a[n.depth]||[];let o=!1;a[n.depth].length===0&&(s<=1?s=1+(n.children.length>0?0:i-n.depth):(s--,o=!0)),n.rowSpan=1+(n.children.length>0?0:i-n.depth),n.kFirst=o,n.index=a[n.depth].length,a[n.depth].push(r),n.ariaColumnIndex=d[n.depth]?d[n.depth]+1:1;for(let l=n.depth;l<n.depth+n.rowSpan;l++)d[l]=(d[l]||0)+n.headerColSpan}),S.updateLeft(a,e,t),S.updateRight(a,e,t),a}function b(e,t,a,i=0){const d=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.filter(r=>r&&r.props?!r.props.hidden:!r.hidden).forEach((r,o)=>{r=r.props?r.props:r;const l=t[o]||null,f=b(r.children,l&&l.children||[],a,i+1);d.push(Object.assign({depth:i},v.gridDefaultProps,f.length?{cell:()=>null,filterCell:()=>null}:{},l?{width:l.width,orderIndex:l.orderIndex}:{},r,{id:r.id?r.id:S.tableKeyboardNavigationTools.generateNavigatableId(`${a.prevId++}`,a.idPrefix,"column"),declarationIndex:d.length,children:f,headerColSpan:r.headerColSpan,rowSpan:0,columnType:r.columnType||"data",colSpan:r.colSpan||1,isAccessible:!0,left:r.lockedColumn?l&&Math.floor(l.left):null,right:r.lockedColumn?l&&Math.floor(l.right):null,rowSpannable:r.rowSpannable}))});const n=(r,o)=>r.orderIndex===o.orderIndex?r.declarationIndex-o.declarationIndex:(r.orderIndex||0)-(o.orderIndex||0);if(d.sort(n),i===0){const r=[],o=(l,f)=>l.forEach(h=>{h.parentIndex=f,o(h.children,r.push(h)-1)});return o(d,-1),r}return d}function A(e,t,a,i){let d=[];Array.isArray(e)?d=e:e&&(d=e.data);const s=[];if(d.length>0){let n=d[0];if(t)for(let o=0;o<t.length;o++)n=n.items&&n.items[0];Object.getOwnPropertyNames(n).forEach(o=>{o!==a.column&&s.push(Object.assign({id:S.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},v.gridDefaultProps,{field:o}))})}return s}const B=(e,t)=>{let a=e[t.parentIndex];for(;a;){if(a.footerCell)return!0;a=e[a.parentIndex]}return!1},q=e=>e.filter(t=>B(e,t)?!1:!!t.footerCell||!(t.children&&t.children.length>0)),O=e=>e.width!==void 0?Math.floor(parseFloat(e.width.toString()))+"px":void 0,j=(e,t)=>t&&t.filter(a=>a.field===e).length>0,N=e=>(e.sort((t,a)=>t.declarationIndex-a.declarationIndex),e.map(t=>{const{declarationIndex:a,parentIndex:i,depth:d,headerColSpan:s,rowSpan:n,index:r,kFirst:o,children:l,...f}=t;return l.length?{children:N(l),...f}:f})),D=e=>{const{filterCell:t,headerCell:a,footerCell:i,cells:d,cell:s,rowSpannable:n,...r}=e;return e.children.length?{...r,children:e.children.map(D)}:r},E=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),F=17895697,H=e=>{let t=[];return e.sortable&&(t=t.concat([x.GridContextMenuItemNames.sortAsc,x.GridContextMenuItemNames.sortDesc])),t},p=e=>{let t=[];return e.clipboard&&(t=t.concat([x.GridContextMenuItemNames.copySelection,x.GridContextMenuItemNames.copySelectionNoHeaders,x.GridContextMenuItemNames.paste])),e.editable&&(t.length&&(t=t.concat([x.GridContextMenuItemNames.separator])),t=t.concat([x.GridContextMenuItemNames.create,x.GridContextMenuItemNames.edit,x.GridContextMenuItemNames.delete])),e.selectable&&(t.length&&(t=t.concat([x.GridContextMenuItemNames.separator])),t=t.concat([x.GridContextMenuItemNames.select])),e.reorderable&&(t.length&&(t=t.concat([x.GridContextMenuItemNames.separator])),t=t.concat([x.GridContextMenuItemNames.reorderRow])),t},$=(e,t)=>{if(!(!e&&!t))return t?e?{...e,...t,select:{...e.select||{},...t.select||{}},hierarchy:{...e.hierarchy||{},...t.hierarchy||{}},group:{...e.group||{},...t.group||{}},edit:{...e.edit||{},...t.edit||{}}}:t:e},z=()=>T.ServerFragment===G.ClientFragment,L=e=>!!(e&&e.$$typeof===Symbol.for("react.client.reference")),V=e=>({id:e.id,ariaColumnIndex:e.ariaColumnIndex,isSelected:e.isSelected,isInEdit:e.isInEdit,isSorted:e.isSorted,isAlt:e.isAlt,expanded:e.expanded,className:e.className,style:e.style,field:e.field,dataItem:e.dataItem,format:e.format,colSpan:e.colSpan,dataIndex:e.dataIndex,columnIndex:e.columnIndex,columnsCount:e.columnsCount,rowType:e.rowType,level:e.level,editor:e.editor,render:e.render,locked:e.locked,isRtl:e.isRtl,rowDataIndex:e.rowDataIndex,columnPosition:e.columnPosition,group:e.group}),W=e=>{var i,d;const t=typeof e=="object"?(i=e.enabled)!=null?i:!0:e!=null?e:!1,a=typeof e=="object"?(d=e.valueGetter)!=null?d:(s,n)=>y.getter(n)(s):(s,n)=>y.getter(n)(s);return{enabled:t,valueGetter:a}};exports.autoGenerateColumns=A;exports.clientColumn=D;exports.firefox=E;exports.firefoxMaxHeight=F;exports.flatData=w;exports.footerColumns=q;exports.getClientCellProps=V;exports.getColSpan=R;exports.getColumnWidth=O;exports.getDefaultBodyContextMenuItems=p;exports.getDefaultHeadContextMenuItems=H;exports.getNestedValue=m;exports.getRowSpanOptions=W;exports.isClient=z;exports.isClientReference=L;exports.isSorted=j;exports.mapColumns=k;exports.readColumns=b;exports.resolveCells=$;exports.sanitizeColumns=N;
|
package/utils/index.mjs
CHANGED
|
@@ -5,160 +5,161 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { gridDefaultProps as
|
|
9
|
-
import { getter as
|
|
8
|
+
import { gridDefaultProps as u } from "../GridColumn.mjs";
|
|
9
|
+
import { getter as y } from "@progress/kendo-data-query";
|
|
10
10
|
import { findGroupExpand as M, updateLeft as T, updateRight as A, tableKeyboardNavigationTools as b } from "@progress/kendo-react-data-tools";
|
|
11
11
|
import { ServerFragment as D } from "./_serverModule.mjs";
|
|
12
12
|
import { ClientFragment as B } from "./_clientModule.mjs";
|
|
13
|
-
import { GridContextMenuItemNames as
|
|
14
|
-
function
|
|
15
|
-
const
|
|
16
|
-
let
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
}),
|
|
13
|
+
import { GridContextMenuItemNames as g } from "../contextMenu/enums.mjs";
|
|
14
|
+
function w(e, t) {
|
|
15
|
+
const a = (e != null ? e : "").split(".");
|
|
16
|
+
let i = t;
|
|
17
|
+
return a.forEach((d) => {
|
|
18
|
+
i = i ? i[d] : void 0;
|
|
19
|
+
}), i;
|
|
20
20
|
}
|
|
21
|
-
function k(e, t,
|
|
22
|
-
var
|
|
23
|
-
let
|
|
21
|
+
function k(e, t, a, i, d, f, r, n, l, o, h = 0, c) {
|
|
22
|
+
var v;
|
|
23
|
+
let C = h;
|
|
24
24
|
for (let s = 0; s < t.length; s++) {
|
|
25
|
-
let
|
|
26
|
-
if (!
|
|
25
|
+
let S;
|
|
26
|
+
if (!d || t[s].value === void 0 || t[s].items === void 0) {
|
|
27
27
|
e[e.length] = {
|
|
28
|
-
dataIndex:
|
|
28
|
+
dataIndex: i.index,
|
|
29
29
|
dataItem: t[s],
|
|
30
30
|
rowType: "data",
|
|
31
31
|
level: h,
|
|
32
32
|
group: c,
|
|
33
33
|
// This is related to detail-row expansion
|
|
34
|
-
expanded: (
|
|
35
|
-
},
|
|
34
|
+
expanded: (v = f ? w(f, t[s]) : o && !!(r != null && r[y(o)(t[s])])) != null ? v : !1
|
|
35
|
+
}, i.index++;
|
|
36
36
|
continue;
|
|
37
37
|
} else {
|
|
38
38
|
let I;
|
|
39
|
-
c != null && c.parents ? I = [{ field: c.field, value: c.value }, ...c.parents] : c ? I = [c] : I = [],
|
|
39
|
+
c != null && c.parents ? I = [{ field: c.field, value: c.value }, ...c.parents] : c ? I = [c] : I = [], S = {
|
|
40
40
|
field: t[s].field,
|
|
41
41
|
value: t[s].value,
|
|
42
42
|
parents: I
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
let
|
|
45
|
+
C = Math.max(C, h + 1);
|
|
46
|
+
let x = !1;
|
|
47
47
|
if (f)
|
|
48
|
-
|
|
48
|
+
x = w(f, t[s]) !== !1;
|
|
49
49
|
else {
|
|
50
|
-
const I = M(
|
|
51
|
-
I ?
|
|
50
|
+
const I = M(n || [], S);
|
|
51
|
+
I ? x = I.expanded !== !1 : x = l !== !1;
|
|
52
52
|
}
|
|
53
53
|
e[e.length] = {
|
|
54
54
|
dataIndex: -1,
|
|
55
55
|
dataItem: t[s],
|
|
56
56
|
level: h,
|
|
57
|
-
group:
|
|
57
|
+
group: S,
|
|
58
58
|
rowType: "groupHeader",
|
|
59
|
-
expanded:
|
|
60
|
-
},
|
|
59
|
+
expanded: x
|
|
60
|
+
}, x && (S.expanded = x, C = Math.max(
|
|
61
61
|
k(
|
|
62
62
|
e,
|
|
63
63
|
t[s].items,
|
|
64
|
-
n,
|
|
65
|
-
l,
|
|
66
|
-
o,
|
|
67
|
-
f,
|
|
68
|
-
r,
|
|
69
64
|
a,
|
|
70
65
|
i,
|
|
71
66
|
d,
|
|
67
|
+
f,
|
|
68
|
+
r,
|
|
69
|
+
n,
|
|
70
|
+
l,
|
|
71
|
+
o,
|
|
72
72
|
h + 1,
|
|
73
|
-
|
|
73
|
+
S
|
|
74
74
|
),
|
|
75
|
-
|
|
76
|
-
)), (
|
|
75
|
+
C
|
|
76
|
+
)), (a === "always" || x && a === "visible") && (e[e.length] = {
|
|
77
77
|
dataIndex: -1,
|
|
78
78
|
dataItem: t[s],
|
|
79
79
|
rowType: "groupFooter",
|
|
80
80
|
level: h,
|
|
81
|
-
expanded:
|
|
81
|
+
expanded: x
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
return
|
|
84
|
+
return C;
|
|
85
85
|
}
|
|
86
86
|
const L = (e, t) => typeof e.colSpan == "function" ? e.colSpan({ dataItem: t, column: e }) : e.colSpan || 1;
|
|
87
87
|
function q(e, t) {
|
|
88
|
-
const
|
|
89
|
-
let
|
|
88
|
+
const a = [[]];
|
|
89
|
+
let i = 0;
|
|
90
90
|
for (let r = e.length - 1; r >= 0; r--)
|
|
91
|
-
|
|
92
|
-
(
|
|
91
|
+
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(
|
|
92
|
+
(n, l) => l.hidden ? n : n + l.headerColSpan,
|
|
93
93
|
0
|
|
94
94
|
));
|
|
95
|
-
const
|
|
95
|
+
const d = [];
|
|
96
96
|
let f = 1;
|
|
97
|
-
return e.forEach((r,
|
|
98
|
-
|
|
99
|
-
let
|
|
100
|
-
|
|
101
|
-
for (let
|
|
102
|
-
o
|
|
103
|
-
}), T(
|
|
97
|
+
return e.forEach((r, n) => {
|
|
98
|
+
a[r.depth] = a[r.depth] || [];
|
|
99
|
+
let l = !1;
|
|
100
|
+
a[r.depth].length === 0 && (f <= 1 ? f = 1 + (r.children.length > 0 ? 0 : i - r.depth) : (f--, l = !0)), r.rowSpan = 1 + (r.children.length > 0 ? 0 : i - r.depth), r.kFirst = l, r.index = a[r.depth].length, a[r.depth].push(n), r.ariaColumnIndex = d[r.depth] ? d[r.depth] + 1 : 1;
|
|
101
|
+
for (let o = r.depth; o < r.depth + r.rowSpan; o++)
|
|
102
|
+
d[o] = (d[o] || 0) + r.headerColSpan;
|
|
103
|
+
}), T(a, e, t), A(a, e, t), a;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
const
|
|
105
|
+
function E(e, t, a, i = 0) {
|
|
106
|
+
const d = [];
|
|
107
107
|
if (!e)
|
|
108
108
|
return [];
|
|
109
|
-
e && e.length === void 0 && (e = [e]), e.filter((
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
e && e.length === void 0 && (e = [e]), e.filter((n) => n && n.props ? !n.props.hidden : !n.hidden).forEach((n, l) => {
|
|
110
|
+
n = n.props ? n.props : n;
|
|
111
|
+
const o = t[l] || null, h = E(
|
|
112
|
+
n.children,
|
|
113
|
+
o && o.children || [],
|
|
114
|
+
a,
|
|
115
|
+
i + 1
|
|
116
116
|
);
|
|
117
|
-
|
|
117
|
+
d.push(
|
|
118
118
|
Object.assign(
|
|
119
|
-
{ depth:
|
|
120
|
-
|
|
119
|
+
{ depth: i },
|
|
120
|
+
u,
|
|
121
121
|
h.length ? { cell: () => null, filterCell: () => null } : {},
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
o ? { width: o.width, orderIndex: o.orderIndex } : {},
|
|
123
|
+
n,
|
|
124
124
|
{
|
|
125
|
-
id:
|
|
126
|
-
declarationIndex:
|
|
125
|
+
id: n.id ? n.id : b.generateNavigatableId(`${a.prevId++}`, a.idPrefix, "column"),
|
|
126
|
+
declarationIndex: d.length,
|
|
127
127
|
children: h,
|
|
128
|
-
headerColSpan:
|
|
128
|
+
headerColSpan: n.headerColSpan,
|
|
129
129
|
rowSpan: 0,
|
|
130
|
-
columnType:
|
|
131
|
-
colSpan:
|
|
130
|
+
columnType: n.columnType || "data",
|
|
131
|
+
colSpan: n.colSpan || 1,
|
|
132
132
|
isAccessible: !0,
|
|
133
|
-
left:
|
|
134
|
-
right:
|
|
133
|
+
left: n.lockedColumn ? o && Math.floor(o.left) : null,
|
|
134
|
+
right: n.lockedColumn ? o && Math.floor(o.right) : null,
|
|
135
|
+
rowSpannable: n.rowSpannable
|
|
135
136
|
}
|
|
136
137
|
)
|
|
137
138
|
);
|
|
138
139
|
});
|
|
139
|
-
const r = (
|
|
140
|
-
if (
|
|
141
|
-
const
|
|
142
|
-
c.parentIndex = h,
|
|
140
|
+
const r = (n, l) => n.orderIndex === l.orderIndex ? n.declarationIndex - l.declarationIndex : (n.orderIndex || 0) - (l.orderIndex || 0);
|
|
141
|
+
if (d.sort(r), i === 0) {
|
|
142
|
+
const n = [], l = (o, h) => o.forEach((c) => {
|
|
143
|
+
c.parentIndex = h, l(c.children, n.push(c) - 1);
|
|
143
144
|
});
|
|
144
|
-
return
|
|
145
|
+
return l(d, -1), n;
|
|
145
146
|
}
|
|
146
|
-
return
|
|
147
|
+
return d;
|
|
147
148
|
}
|
|
148
|
-
function z(e, t,
|
|
149
|
-
let
|
|
150
|
-
Array.isArray(e) ?
|
|
149
|
+
function z(e, t, a, i) {
|
|
150
|
+
let d = [];
|
|
151
|
+
Array.isArray(e) ? d = e : e && (d = e.data);
|
|
151
152
|
const f = [];
|
|
152
|
-
if (
|
|
153
|
-
let r =
|
|
153
|
+
if (d.length > 0) {
|
|
154
|
+
let r = d[0];
|
|
154
155
|
if (t)
|
|
155
|
-
for (let
|
|
156
|
+
for (let l = 0; l < t.length; l++)
|
|
156
157
|
r = r.items && r.items[0];
|
|
157
|
-
Object.getOwnPropertyNames(r).forEach((
|
|
158
|
-
|
|
158
|
+
Object.getOwnPropertyNames(r).forEach((l) => {
|
|
159
|
+
l !== a.column && f.push(
|
|
159
160
|
Object.assign(
|
|
160
161
|
{
|
|
161
|
-
id: b.generateNavigatableId(`${
|
|
162
|
+
id: b.generateNavigatableId(`${i.prevId++}`, i.idPrefix, "column"),
|
|
162
163
|
declarationIndex: -1,
|
|
163
164
|
parentIndex: -1,
|
|
164
165
|
depth: 0,
|
|
@@ -174,48 +175,48 @@ function z(e, t, n, l) {
|
|
|
174
175
|
ariaColumnIndex: 0,
|
|
175
176
|
isAccessible: !0
|
|
176
177
|
},
|
|
177
|
-
|
|
178
|
-
{ field:
|
|
178
|
+
u,
|
|
179
|
+
{ field: l }
|
|
179
180
|
)
|
|
180
181
|
);
|
|
181
182
|
});
|
|
182
183
|
}
|
|
183
184
|
return f;
|
|
184
185
|
}
|
|
185
|
-
const
|
|
186
|
-
let
|
|
187
|
-
for (;
|
|
188
|
-
if (
|
|
186
|
+
const F = (e, t) => {
|
|
187
|
+
let a = e[t.parentIndex];
|
|
188
|
+
for (; a; ) {
|
|
189
|
+
if (a.footerCell)
|
|
189
190
|
return !0;
|
|
190
|
-
|
|
191
|
+
a = e[a.parentIndex];
|
|
191
192
|
}
|
|
192
193
|
return !1;
|
|
193
|
-
}, V = (e) => e.filter((t) =>
|
|
194
|
-
const { declarationIndex:
|
|
195
|
-
return
|
|
196
|
-
children:
|
|
194
|
+
}, V = (e) => e.filter((t) => F(e, t) ? !1 : !!t.footerCell || !(t.children && t.children.length > 0)), W = (e) => e.width !== void 0 ? Math.floor(parseFloat(e.width.toString())) + "px" : void 0, J = (e, t) => t && t.filter((a) => a.field === e).length > 0, R = (e) => (e.sort((t, a) => t.declarationIndex - a.declarationIndex), e.map((t) => {
|
|
195
|
+
const { declarationIndex: a, parentIndex: i, depth: d, headerColSpan: f, rowSpan: r, index: n, kFirst: l, children: o, ...h } = t;
|
|
196
|
+
return o.length ? {
|
|
197
|
+
children: R(o),
|
|
197
198
|
...h
|
|
198
199
|
} : h;
|
|
199
|
-
})),
|
|
200
|
-
const { filterCell: t, headerCell:
|
|
200
|
+
})), j = (e) => {
|
|
201
|
+
const { filterCell: t, headerCell: a, footerCell: i, cells: d, cell: f, rowSpannable: r, ...n } = e;
|
|
201
202
|
return e.children.length ? {
|
|
202
|
-
...
|
|
203
|
-
children: e.children.map(
|
|
204
|
-
} :
|
|
203
|
+
...n,
|
|
204
|
+
children: e.children.map(j)
|
|
205
|
+
} : n;
|
|
205
206
|
}, K = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), Q = 17895697, U = (e) => {
|
|
206
207
|
let t = [];
|
|
207
|
-
return e.sortable && (t = t.concat([
|
|
208
|
+
return e.sortable && (t = t.concat([g.sortAsc, g.sortDesc])), t;
|
|
208
209
|
}, X = (e) => {
|
|
209
210
|
let t = [];
|
|
210
211
|
return e.clipboard && (t = t.concat([
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
])), e.editable && (t.length && (t = t.concat([
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
])), e.selectable && (t.length && (t = t.concat([
|
|
212
|
+
g.copySelection,
|
|
213
|
+
g.copySelectionNoHeaders,
|
|
214
|
+
g.paste
|
|
215
|
+
])), e.editable && (t.length && (t = t.concat([g.separator])), t = t.concat([
|
|
216
|
+
g.create,
|
|
217
|
+
g.edit,
|
|
218
|
+
g.delete
|
|
219
|
+
])), e.selectable && (t.length && (t = t.concat([g.separator])), t = t.concat([g.select])), e.reorderable && (t.length && (t = t.concat([g.separator])), t = t.concat([g.reorderRow])), t;
|
|
219
220
|
}, Y = (e, t) => {
|
|
220
221
|
if (!(!e && !t))
|
|
221
222
|
return t ? e ? {
|
|
@@ -238,7 +239,7 @@ const E = (e, t) => {
|
|
|
238
239
|
...t.edit || {}
|
|
239
240
|
}
|
|
240
241
|
} : t : e;
|
|
241
|
-
}, Z = () => D === B, _ = (e) => !!(e && e.$$typeof === Symbol.for("react.client.reference")),
|
|
242
|
+
}, Z = () => D === B, _ = (e) => !!(e && e.$$typeof === Symbol.for("react.client.reference")), G = (e) => ({
|
|
242
243
|
id: e.id,
|
|
243
244
|
ariaColumnIndex: e.ariaColumnIndex,
|
|
244
245
|
isSelected: e.isSelected,
|
|
@@ -264,25 +265,30 @@ const E = (e, t) => {
|
|
|
264
265
|
rowDataIndex: e.rowDataIndex,
|
|
265
266
|
columnPosition: e.columnPosition,
|
|
266
267
|
group: e.group
|
|
267
|
-
})
|
|
268
|
+
}), P = (e) => {
|
|
269
|
+
var i, d;
|
|
270
|
+
const t = typeof e == "object" ? (i = e.enabled) != null ? i : !0 : e != null ? e : !1, a = typeof e == "object" ? (d = e.valueGetter) != null ? d : (f, r) => y(r)(f) : (f, r) => y(r)(f);
|
|
271
|
+
return { enabled: t, valueGetter: a };
|
|
272
|
+
};
|
|
268
273
|
export {
|
|
269
274
|
z as autoGenerateColumns,
|
|
270
|
-
|
|
275
|
+
j as clientColumn,
|
|
271
276
|
K as firefox,
|
|
272
277
|
Q as firefoxMaxHeight,
|
|
273
278
|
k as flatData,
|
|
274
279
|
V as footerColumns,
|
|
275
|
-
|
|
280
|
+
G as getClientCellProps,
|
|
276
281
|
L as getColSpan,
|
|
277
282
|
W as getColumnWidth,
|
|
278
283
|
X as getDefaultBodyContextMenuItems,
|
|
279
284
|
U as getDefaultHeadContextMenuItems,
|
|
280
|
-
|
|
285
|
+
w as getNestedValue,
|
|
286
|
+
P as getRowSpanOptions,
|
|
281
287
|
Z as isClient,
|
|
282
288
|
_ as isClientReference,
|
|
283
289
|
J as isSorted,
|
|
284
290
|
q as mapColumns,
|
|
285
|
-
|
|
291
|
+
E as readColumns,
|
|
286
292
|
Y as resolveCells,
|
|
287
|
-
|
|
293
|
+
R as sanitizeColumns
|
|
288
294
|
};
|