@progress/kendo-react-grid 9.5.0-develop.2 → 9.5.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/GridComponent.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 bt=require("react"),d=require("@progress/kendo-react-common"),Ct=require("@progress/kendo-data-query"),b=require("@progress/kendo-react-data-tools"),yt=require("./cells/GridSelectionCell.js"),ht=require("./cells/GridHierarchyCell.js"),wt=require("./cells/GridEditCell.js"),Gt=require("./header/Header.js"),St=require("./header/HeaderRow.js"),Et=require("./header/FilterRow.js"),Rt=require("./header/GroupPanel.js"),It=require("./footer/Footer.js"),s=require("./utils/index.js"),vt=require("./cells/GridCell.js"),He=require("./cells/GridGroupCell.js"),xt=require("./rows/GridRow.js"),Nt=require("./header/GridHeaderSelectionCell.js"),Pe=require("./components/noRecords/GridNoRecords.js"),Ke=require("./filterCommon.js"),kt=require("./footer/FooterRow.js"),qt=require("./paging/GridPagerSettings.js"),Ft=require("./package-metadata.js"),Dt=require("./cells/GridDetailCell.js"),Tt=require("./cells/GridDetailHierarchyCell.js"),Ve=require("./components/noRecords/GridNoRecordsContainer.js"),Ht=require("./GridWatermarkOverlay.js"),Oe=require("./GridClientWrapper.js"),Pt=require("./components/colGroup/GridColGroup.js"),Kt=require("./components/table/GridTable.js"),Ae=require("./components/GridDropClue.js"),Be=require("./components/GridDragClue.js"),Le=require("./components/table/GridTableBody.js"),Vt=require("./components/PagerContainer.js"),Ot=require("./components/table/GridTableScrollable.js"),_e=require("./components/GridElementContainer.js"),At=require("./components/GridContainerElementContainer.js"),Bt=require("./components/VirtualScrollHeightContainer.js"),ze=require("@progress/kendo-react-intl"),ae=require("./messages/index.js"),$=require("./VirtualScrollFixed.js"),Lt=require("./VirtualScroll.js"),_t=require("./components/GridCustomCellClientContainer.js"),zt=require("./components/GridDraggableRowsContainer.js"),Mt=require("./cells/GridRowReorderCell.js"),Wt=require("./header/client/GridHeaderRowReorderCell.js"),Me=require("./components/GridLoader.js");function jt(e){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const C in e)if(C!=="default"){const S=Object.getOwnPropertyDescriptor(e,C);Object.defineProperty(k,C,S.get?S:{enumerable:!0,get:()=>e[C]})}}return k.default=e,Object.freeze(k)}const a=jt(bt),We=a.forwardRef((e,k)=>{var Ee,Re,Ie,ve,xe,Ne,ke;const C=e.id+"-role-element-id",S=e.navigatable?C:"";d.validatePackage(Ft.packageMetadata);const je=(t,r,c,o,i,l,u)=>{const g=[],w=s.flatData(g,E,t,{index:r},c!==void 0,o,i,l,lt.defaultExpand,u);return{flattedData:g,resolvedGroupsCount:w}},$e=t=>{const r=t.filter(i=>i&&i.type&&i.type.displayName==="KendoReactGridColumn"),c=f.current.filter(i=>i.declarationIndex>=0&&i.parentIndex===-1),o=s.sanitizeColumns(c);return s.readColumns(r,o,{prevId:0,idPrefix:S})},Ue=t=>t.filter(r=>d.canUseDOM&&r&&r.media?window.matchMedia(r.media).matches:r),Qe=()=>{const t=[],r=(c,o)=>c==null?void 0:c.forEach(i=>{const l=i.hidden||o;t.push({...i,hidden:l}),r(i.children,l)});return r(e.columnsState,!1),t},Je=t=>{const r=Qe();return t.filter(c=>{var o;return!((o=r.find(i=>i.id===c.id))!=null&&o.hidden)})},Xe=(t,r)=>{var i;const c=$e(t),o=Ue(c);f.current=o,f.current.length===0&&(f.current=s.autoGenerateColumns(E,e.group,{column:(i=V.column)!=null?i:e.expandField},{prevId:0,idPrefix:S})),f.current=Je(f.current),Ye(f.current,r),q=s.mapColumns(f.current,!0),re.current=f.current.map(s.clientColumn)},Ye=(t,r)=>{var i;t.filter(l=>e.selectedField&&l.field===e.selectedField||l.columnType==="checkbox").forEach(l=>{l.width=l.width||"50px",l.cell=l.cell||yt.GridSelectionCell,l._type="edit",l.headerCell=l.headerCell||Nt.GridHeaderSelectionCell}),D!==void 0&&t.filter(l=>l.columnType==="reorder").forEach(l=>{l.width=l.width||"50px",l.cell=l.cell||Mt.GridRowReorderCell,l.headerCell=l.headerCell||Wt.GridHeaderRowReorderCell,l.sortable=!1,l.filterable=!1,l.editable=!1});const c={id:"",resizable:!0,width:"32px",title:" ",declarationIndex:-1,orderIndex:-1,children:[],parentIndex:-1,depth:0,colSpan:0,headerColSpan:0,rowSpan:0,left:0,right:0,index:0,rightBorder:!1,ariaColumnIndex:0,isAccessible:!0};let o=0;(e.expandField||V.enabled)&&e.detail&&(t.unshift({...c,_type:"expand",cell:ht.GridHierarchyCell,field:(i=V.column)!=null?i:e.expandField,headerClassName:d.classNames(m.hierarchyCell({}))}),o++);for(let l=0;l<r;l++)t.unshift({...c,isAccessible:!1,cell:He.GridGroupCell,field:"value",locked:e.lockGroups}),o++;t.slice(o).forEach(l=>{l.parentIndex>=0&&(l.parentIndex+=o),l.rowSpannable=l.rowSpannable!==void 0?s.getRowSpanOptions(l.rowSpannable):ie})},le=()=>E.length===e.total,Ze=()=>{const{rowHeight:t,detailRowHeight:r,detail:c,expandField:o}=e,i=le(),l=t!==void 0&&t>0,u=r!==void 0&&r>0;return!l||K&&!i||!!(c&&o)&&(!u||!i)?Lt.VirtualScroll:$.VirtualScrollFixed},U=()=>e.isClient?f:re,pe=(t,r,c,o,i,l)=>{let u=s.getColSpan(t,r);if(e.columnVirtualization&&t.colSpan===1)return{colSpan:l,colsToSkip:i};let g=c.length-1===o,w=c.length-o;return e.columnVirtualization&&(g=h.length-1===o,w=h.length-o),u>1&&!g?i=u-1:u=1,w<=u&&!g&&(u=w),{colSpan:u,colsToSkip:i}};let Q,y=[],_;const f=e.columnsRef||{current:[]},re={current:[]};let q=[[]];const et=e.scrollLeftRef||{current:0},z=e.localization||new ze.LocalizationService,tt=e.intl||new ze.IntlService("en"),F=e.unstyled,m=F&&F.uGrid?F.uGrid:d.uGrid,D=s.isRowReorderEnabled(e.rowReorderable),T=e.autoProcessData===!0?{group:!0,sort:!0,filter:!0,search:!0,page:!0}:e.autoProcessData;let E,N;if(Array.isArray(e.data)?(E=e.data,N=(Ee=e.total)!=null?Ee:E.length):(E=((Re=e.data)==null?void 0:Re.data)||[],N=(xe=(ve=e.total)!=null?ve:(Ie=e.data)==null?void 0:Ie.total)!=null?xe:E.length),T){const{data:t,total:r}=Ct.process(E,{group:T.group?e.group:void 0,sort:T.sort?e.sort:void 0,filter:b.combineFilters(T.filter?e.filter:void 0,T.search?e.search:void 0),...T.page?{take:e.take,skip:e.skip}:{}});E=t,N=(Ne=e.total)!=null?Ne:r}const{size:I="medium"}=e,at=typeof e.groupable=="object"&&e.groupable.footer||"none",H=e.scrollable==="virtual",K=e.groupable===!0||typeof e.groupable=="object"&&e.groupable.enabled!==!1,V=b.getDetailExpandableOptions(!!e.detail),lt=b.getGroupExpandableOptions(typeof e.groupable=="object"&&e.groupable.enabled!==!1?e.groupable.expandable:e.groupable),{resolvedGroupsCount:rt,flattedData:nt}=je(at,e.skip||0,e.group,e.expandField,e.detailExpand,e.groupExpand,e.dataItemKey);y=nt;const J=Ze();J===$.VirtualScrollFixed&&le()&&(_=y.slice(e.skip||0,(e.skip||0)+((e.take!==void 0?e.take:e.pageSize)||0)));const ne=b.getSelectionOptions(e.selectable||!!e.selectedField),ie=s.getRowSpanOptions(e.rowSpannable),it=ne&&ne.drag?"none":void 0,M=a.Children.toArray(e.children);Xe(M,rt);const oe=M.map(t=>t&&t.type&&t.type.displayName==="KendoReactGridToolbar"?a.cloneElement(t,{...t.props,ariaControls:C}):null),W=M.filter(t=>t&&t.type&&t.type.displayName==="KendoReactGridNoRecords"),de=M.filter(t=>t&&t.type&&t.type.displayName==="KendoReactGridStatusBar"),h=f.current.filter(t=>t.children.length===0),ce=K&&a.createElement(Rt.GroupPanel,{columns:U().current,group:e.group||[],ariaControls:C}),se=a.createElement(Gt.Header,{size:I,staticHeaders:e.scrollable!=="none",draggable:e.reorderable||K,headerRow:a.createElement(St.HeaderRow,{cells:e.cells,sort:e.sort,sortable:e.sortable,group:e.group||[],groupable:K,filter:e.filter,filterable:e.filterable,filterOperators:e.filterOperators||Ke.operators,columnMenu:e.columnMenu,columnMenuIcon:e.columnMenuIcon,columns:f.current,columnsMap:q,cellRender:e.headerCellRender,navigatable:!!e.navigatable,localization:z,unstyled:F,headerSelectionValue:!!(e.select&&y.filter(t=>t.rowType==="data").every(t=>e.select&&e.dataItemKey&&d.getter(e.dataItemKey)(t.dataItem)!==void 0?e.select[d.getter(e.dataItemKey)(t.dataItem)]:void 0))}),filterRow:e.filterable&&a.createElement(Et.FilterRow,{cells:e.cells,size:I,columns:f.current,filter:e.filter,filterOperators:e.filterOperators||Ke.operators,sort:e.sort,cellRender:e.filterCellRender,navigatable:!!e.navigatable,ariaRowIndex:q.length+1,localization:z})||void 0,cols:h.map((t,r)=>a.createElement("col",{key:r.toString(),width:s.getColumnWidth(t)}))}),ot=et.current||0,dt=parseFloat(((e.style||{}).width||"").toString()),ct=(t,r,c,o,i)=>{let l=!1;const u=e.selectedField?s.getNestedValue(e.selectedField,t.dataItem):e.select&&e.dataItemKey&&d.getter(e.dataItemKey)(t.dataItem)!==void 0?e.select[d.getter(e.dataItemKey)(t.dataItem)]:void 0;let g=0;const{colSpans:w,hiddenColumns:P}=b.tableColumnsVirtualization({enabled:e.columnVirtualization,columns:h,tableViewPortWidth:dt,scrollLeft:ot,getColSpan:s.getColSpan,dataItem:t.dataItem}),v=h.filter((n,G)=>!P[G]);return{row:h.map((n,G)=>{var qe,Fe,De,Te;if(P[G])return null;if(g>0)return g--,null;let R;if((qe=n.rowSpannable)!=null&&qe.enabled&&t.rowType==="data"&&n.field&&i){const x=n.field?(De=(Fe=n.rowSpannable).valueGetter)==null?void 0:De.call(Fe,t.dataItem,n.field):null;R={value:x,count:1},i[n.field]&&((Te=i[n.field])==null?void 0:Te.value)===x&&i[n.field]!==null?(i[n.field].count++,R.count=null):i[n.field]=R}const{colSpan:A,colsToSkip:Z}=pe(n,t.dataItem,v,G,g,w[G]);g=Z;const B=n.id?n.id:G,gt=d.classNames(m.contentSticky({locked:n.locked}),n.className),ft=n.left!==void 0?{left:n.left,right:n.right}:{};let p=!1;if(n.editable&&(e.editable||e.editField)){const x=e.editField?s.getNestedValue(e.editField,t.dataItem):e.edit&&e.dataItemKey?e.edit[d.getter(e.dataItemKey)(t.dataItem)]:void 0,te=typeof x=="boolean"?x:Array.isArray(x)?x.indexOf(n.field)>-1:n.field!==void 0&&x===n.field;te&&n.columnType==="data"&&(te===!0||te===n.field)&&(l=!0,p=!0)}const ee=n.cell||p&&wt.GridEditCell||vt.GridCell,mt=e.expandField&&e.detail&&n.field===e.expandField||n._type==="expand",L={locked:e.lockGroups,id:b.tableKeyboardNavigationTools.generateNavigatableId(`${r}-${String(G)}`,S,mt||t.rowType==="groupHeader"||t.rowType==="groupFooter"||n.field==="value"?"nodata":"cell"),colSpan:A,dataItem:t.dataItem,field:n.field,editor:n.editor,format:n.format,columnType:n.columnType,rowReorderable:D,className:gt,render:e.cellRender,cells:s.resolveCells(e.cells,n.cells),columnIndex:G,columnsCount:h.length,rowType:t.rowType,level:t.level,expanded:t.expanded,dataIndex:t.dataIndex,rowDataIndex:c,columnPosition:ft,style:{},ariaColumnIndex:n.ariaColumnIndex,isSelected:(n==null?void 0:n._type)==="edit"?u:Array.isArray(u)&&u.indexOf(G)>-1,isSorted:!!s.isSorted(n.field,e.sort),isInEdit:p,isAlt:o,unstyled:F,group:t.group,localization:z,intl:tt,_rowSpan:R};return n.cell?a.createElement(_t.GridCustomCellClientContainer,{key:B,isClient:s.isClientReference(ee),dataItem:L.dataItem,rowDataIndex:L.rowDataIndex,columnIndex:L.columnIndex},a.createElement(ee,{...L})):a.createElement(ee,{key:B,...L})}),isInEdit:l,isSelected:typeof u=="boolean"&&u}};let ue=0;if(H&&Q)for(let t=0;t<Q.topCacheCount+Q.attendedSkip-(e.skip||0);t++){const r=y.shift();if(r)y.push(r),ue++,r.rowType==="groupHeader"&&t--;else break}const ge=t=>t>=y.length-ue;let fe=e.skip||0;const X=[],me=!y.length,be=q.length+(e.filterable?1:0)+1;let O=0;if(y.length){let t=-1,r=0;const c=ie.enabled?{}:void 0;(_||y).forEach((o,i)=>{o.rowType==="data"&&(fe++,t++);const l=fe%2===0,u=e.dataItemKey&&d.getter(e.dataItemKey)(o.dataItem),g=i+(e.skip||0),w=u||"ai"+g,P=w+"_1",v=ct(o,w,t,l,c);if(O=g+be+r,X.push(a.createElement(xt.GridRow,{key:w,dataItem:o.dataItem,isAltRow:l,isInEdit:v.isInEdit,rowType:o.rowType,isRowReorderable:D,isHidden:ge(i),onClick:null,onDoubleClick:null,selectedField:e.selectedField,rowHeight:e.rowHeight,render:e.rowRender,ariaRowIndex:O,absoluteRowIndex:g,dataIndex:H&&!e.groupable?g:t,isSelected:v.isSelected,rows:e.rows},v.row)),e.detail&&o.rowType==="data"&&o.expanded){const n=h.length-(e.expandField||V.enabled?1:0)-(e.group?e.group.length:0)||1;r++,O=g+be+r,X.push(a.createElement("tr",{key:P,className:d.classNames(m.detailTr({isAlt:l})),style:{visibility:ge(i)?"hidden":"",height:e.detailRowHeight},role:"row","aria-rowindex":O},e.group&&e.group.map((G,R)=>{var B;const A=(B=v==null?void 0:v.row[R])==null?void 0:B.props.style,Z=A?{left:A.left,right:A.right}:{};return a.createElement(He.GridGroupCell,{id:"",dataIndex:o.dataIndex,field:G.field,dataItem:o.dataItem,key:R,columnPosition:Z,style:{},ariaColumnIndex:1+R,isSelected:!1,locked:e.lockGroups,cells:e.cells,group:o.group})}),(e.expandField||V.enabled)&&a.createElement(Tt.GridDetailHierarchyCell,{unstyled:F,id:b.tableKeyboardNavigationTools.generateNavigatableId(`${P}-dhcell`,S)}),a.createElement(Dt.GridDetailCell,{dataItem:o.dataItem,dataIndex:o.dataIndex,colSpan:n,ariaColIndex:2+(e.group?e.group.length:0),detail:e.detail,id:b.tableKeyboardNavigationTools.generateNavigatableId(`${P}-dcell`,S)})))}})}const Ce={size:I,total:N,skip:e.skip||0,take:(e.take!==void 0?e.take:e.pageSize)||10,...qt.normalize(e.pageable||{})},ye=a.createElement(Vt.PagerContainer,null,e.pager?a.createElement(e.pager,{...Ce}):a.createElement(b.Pager,{className:d.classNames(m.pager({})),...Ce})),st=(t,r)=>a.createElement("col",{key:r.toString(),width:s.getColumnWidth(t)}),ut=(ke=e.cells)!=null&&ke.footerCell||f.current.some(t=>{var r;return!!(t.footerCell||(r=t.cells)!=null&&r.footerCell)})?a.createElement(It.Footer,{size:I,staticHeaders:e.scrollable!=="none",row:a.createElement(kt.FooterRow,{cells:e.cells,idPrefix:S,columns:f.current,ariaRowIndex:O+1}),cols:h.map(st)}):null,he=a.createElement(Pt.GridColGroup,null,h.map((t,r)=>a.createElement("col",{key:r.toString(),className:s.isSorted(t.field,e.sort)?d.classNames(m.sorted({})):void 0,width:s.getColumnWidth(t)}))),we=e.reorderable||K,{detail:$t,cells:Ut,rows:Qt,...Ge}=e,Se=a.createElement("tbody",{role:"rowgroup",className:d.classNames(m.tbody({})),...b.tableKeyboardNavigationBodyAttributes},X);let Y=Se;if(D&&(Y=a.createElement(zt.GridReorderableRowsContainer,{unstyled:m,columns:f.current,rowReorderSettings:e.rowReorderable},Se)),e.scrollable==="none")return a.createElement(Oe.GridClientWrapper,{gridRef:k,gridProps:Ge,columnsRef:U(),columnsMapRef:q,dataRef:y,slicedData:_,isFixedVirtualScroll:J===$.VirtualScrollFixed,id:C,total:N,detailExpandable:!!e.detail},a.createElement(_e.GridElementContainer,null,a.createElement("div",{id:e.id,style:e.style,className:d.classNames(m.wrapper({size:I}),e.className),"aria-label":e.ariaLabel,...b.tableKeyboardNavigationScopeAttributes},oe,ce,a.createElement(Kt.GridTable,{selectable:e.selectable,className:d.classNames(m.table({size:I}))},he,se,a.createElement(Le.GridTableBody,{rowReorderable:D},Y)),me&&a.createElement(Ve.GridNoRecordsContainer,null,W.length?W:a.createElement(Pe.GridNoRecords,null)),we&&a.createElement(a.Fragment,null,a.createElement(Ae.GridDropClue,null),a.createElement(Be.GridDragClue,null)))),de,e.pageable&&ye,a.createElement(Me.GridLoader,{loader:e.loader,showLoader:e.showLoader}));let j=e.style||{};return H&&(j.height||(j=Object.assign({},j,{height:"450px"}))),a.createElement(Oe.GridClientWrapper,{gridRef:k,gridProps:Ge,columnsRef:U(),columnsMapRef:q,dataRef:y,slicedData:_,isFixedVirtualScroll:J===$.VirtualScrollFixed,id:C,total:N,detailExpandable:!!e.detail},a.createElement(_e.GridElementContainer,null,a.createElement("div",{id:e.id,style:j,className:d.classNames(m.wrapper({size:I,virtual:H}),e.className),"aria-label":e.ariaLabel,...b.tableKeyboardNavigationScopeAttributes},oe,ce,a.createElement("div",{className:d.classNames(m.ariaRoot({})),role:"grid","aria-colcount":h.length,"aria-rowcount":N,id:C,"aria-label":z.toLanguageString(ae.gridAriaLabel,ae.messages[ae.gridAriaLabel])},se,a.createElement("div",{className:d.classNames(m.container({})),role:"presentation"},a.createElement(At.GridContainerElementContainer,null,a.createElement("div",{className:d.classNames(m.content({})),role:"presentation"},a.createElement("div",{className:d.classNames(m.tableWrap({})),role:"presentation"},a.createElement(Ot.GridTableScrollable,{selectable:e.selectable,tableClassName:d.classNames(m.table({size:I})),tableStyle:{userSelect:it}},he,a.createElement(Le.GridTableBody,{rowReorderable:D},Y)),me&&a.createElement(Ve.GridNoRecordsContainer,null,W.length?W:a.createElement(Pe.GridNoRecords,null))),H&&a.createElement("div",{className:d.classNames(m.heightContainer({})),role:"presentation"},a.createElement(Bt.VirtualScrollHeightContainer,{isVirtualScroll:H}))))),ut,we&&a.createElement(a.Fragment,null,a.createElement(Ae.GridDropClue,null),a.createElement(Be.GridDragClue,null)),a.createElement(Ht.GridWatermarkOverlay,null)),de,e.pageable&&ye,a.createElement(Me.GridLoader,{loader:e.loader,showLoader:e.showLoader}))))});We.displayName="KendoReactGridComponent";exports.GridComponent=We;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const bt=require("react"),d=require("@progress/kendo-react-common"),Ct=require("@progress/kendo-data-query"),b=require("@progress/kendo-react-data-tools"),yt=require("./cells/GridSelectionCell.js"),ht=require("./cells/GridHierarchyCell.js"),wt=require("./cells/GridEditCell.js"),Gt=require("./header/Header.js"),St=require("./header/HeaderRow.js"),Et=require("./header/FilterRow.js"),Rt=require("./header/GroupPanel.js"),It=require("./footer/Footer.js"),s=require("./utils/index.js"),vt=require("./cells/GridCell.js"),He=require("./cells/GridGroupCell.js"),xt=require("./rows/GridRow.js"),Nt=require("./header/GridHeaderSelectionCell.js"),Pe=require("./components/noRecords/GridNoRecords.js"),Ke=require("./filterCommon.js"),kt=require("./footer/FooterRow.js"),qt=require("./paging/GridPagerSettings.js"),Ft=require("./package-metadata.js"),Dt=require("./cells/GridDetailCell.js"),Tt=require("./cells/GridDetailHierarchyCell.js"),Ve=require("./components/noRecords/GridNoRecordsContainer.js"),Ht=require("./GridWatermarkOverlay.js"),Oe=require("./GridClientWrapper.js"),Pt=require("./components/colGroup/GridColGroup.js"),Kt=require("./components/table/GridTable.js"),Ae=require("./components/GridDropClue.js"),Be=require("./components/GridDragClue.js"),Le=require("./components/table/GridTableBody.js"),Vt=require("./components/PagerContainer.js"),Ot=require("./components/table/GridTableScrollable.js"),_e=require("./components/GridElementContainer.js"),At=require("./components/GridContainerElementContainer.js"),Bt=require("./components/VirtualScrollHeightContainer.js"),ze=require("@progress/kendo-react-intl"),ae=require("./messages/index.js"),$=require("./VirtualScrollFixed.js"),Lt=require("./VirtualScroll.js"),_t=require("./components/GridCustomCellClientContainer.js"),zt=require("./components/GridDraggableRowsContainer.js"),Mt=require("./cells/GridRowReorderCell.js"),Wt=require("./header/client/GridHeaderRowReorderCell.js"),Me=require("./components/GridLoader.js");function jt(e){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const C in e)if(C!=="default"){const S=Object.getOwnPropertyDescriptor(e,C);Object.defineProperty(k,C,S.get?S:{enumerable:!0,get:()=>e[C]})}}return k.default=e,Object.freeze(k)}const a=jt(bt),We=a.forwardRef((e,k)=>{var Ee,Re,Ie,ve,xe,Ne,ke;const C=e.id+"-role-element-id",S=e.navigatable?C:"";d.validatePackage(Ft.packageMetadata);const je=(t,r,c,o,i,l,u)=>{const g=[],w=s.flatData(g,E,t,{index:r},c!==void 0,o,i,l,lt.defaultExpand,u);return{flattedData:g,resolvedGroupsCount:w}},$e=t=>{const r=t.filter(i=>i&&i.type&&i.type.displayName==="KendoReactGridColumn"),c=f.current.filter(i=>i.declarationIndex>=0&&i.parentIndex===-1),o=s.sanitizeColumns(c);return s.readColumns(r,o,{prevId:0,idPrefix:S})},Ue=t=>t.filter(r=>d.canUseDOM&&r&&r.media?window.matchMedia(r.media).matches:r),Qe=()=>{const t=[],r=(c,o)=>c==null?void 0:c.forEach(i=>{const l=i.hidden||o;t.push({...i,hidden:l}),r(i.children,l)});return r(e.columnsState,!1),t},Je=t=>{const r=Qe();return t.filter(c=>{var o;return!((o=r.find(i=>i.id===c.id))!=null&&o.hidden)})},Xe=(t,r)=>{var i;const c=$e(t),o=Ue(c);f.current=o,f.current.length===0&&(f.current=s.autoGenerateColumns(E,e.group,{column:(i=O.column)!=null?i:e.expandField},{prevId:0,idPrefix:S})),f.current=Je(f.current),Ye(f.current,r),q=s.mapColumns(f.current,!0),re.current=f.current.map(s.clientColumn)},Ye=(t,r)=>{var i;t.filter(l=>e.selectedField&&l.field===e.selectedField||l.columnType==="checkbox").forEach(l=>{l.width=l.width||"50px",l.cell=l.cell||yt.GridSelectionCell,l._type="edit",l.headerCell=l.headerCell||Nt.GridHeaderSelectionCell}),D!==void 0&&t.filter(l=>l.columnType==="reorder").forEach(l=>{l.width=l.width||"50px",l.cell=l.cell||Mt.GridRowReorderCell,l.headerCell=l.headerCell||Wt.GridHeaderRowReorderCell,l.sortable=!1,l.filterable=!1,l.editable=!1});const c={id:"",resizable:!0,width:"32px",title:" ",declarationIndex:-1,orderIndex:-1,children:[],parentIndex:-1,depth:0,colSpan:0,headerColSpan:0,rowSpan:0,left:0,right:0,index:0,rightBorder:!1,ariaColumnIndex:0,isAccessible:!0};let o=0;(e.expandField||O.enabled)&&e.detail&&(t.unshift({...c,_type:"expand",cell:ht.GridHierarchyCell,field:(i=O.column)!=null?i:e.expandField,headerClassName:d.classNames(m.hierarchyCell({}))}),o++);for(let l=0;l<r;l++)t.unshift({...c,isAccessible:!1,cell:He.GridGroupCell,field:"value",locked:e.lockGroups}),o++;t.slice(o).forEach(l=>{l.parentIndex>=0&&(l.parentIndex+=o),l.rowSpannable=l.rowSpannable!==void 0?s.getRowSpanOptions(l.rowSpannable):ie})},le=()=>E.length===e.total,Ze=()=>{const{rowHeight:t,detailRowHeight:r,detail:c,expandField:o}=e,i=le(),l=t!==void 0&&t>0,u=r!==void 0&&r>0;return!l||V&&!i||!!(c&&o)&&(!u||!i)?Lt.VirtualScroll:$.VirtualScrollFixed},U=()=>e.isClient?f:re,pe=(t,r,c,o,i,l)=>{let u=s.getColSpan(t,r);if(e.columnVirtualization&&t.colSpan===1)return{colSpan:l,colsToSkip:i};let g=c.length-1===o,w=c.length-o;return e.columnVirtualization&&(g=h.length-1===o,w=h.length-o),u>1&&!g?i=u-1:u=1,w<=u&&!g&&(u=w),{colSpan:u,colsToSkip:i}};let Q,y=[],_;const f=e.columnsRef||{current:[]},re={current:[]};let q=[[]];const et=e.scrollLeftRef||{current:0},z=e.localization||new ze.LocalizationService,tt=e.intl||new ze.IntlService("en"),F=e.unstyled,m=F&&F.uGrid?F.uGrid:d.uGrid,D=s.isRowReorderEnabled(e.rowReorderable),T=e.autoProcessData===!0?{group:!0,sort:!0,filter:!0,search:!0,page:!0}:e.autoProcessData;let E,N;if(Array.isArray(e.data)?(E=e.data,N=(Ee=e.total)!=null?Ee:E.length):(E=((Re=e.data)==null?void 0:Re.data)||[],N=(xe=(ve=e.total)!=null?ve:(Ie=e.data)==null?void 0:Ie.total)!=null?xe:E.length),T){const{data:t,total:r}=Ct.process(E,{group:T.group?e.group:void 0,sort:T.sort?e.sort:void 0,filter:b.combineFilters(T.filter?e.filter:void 0,T.search?e.search:void 0),...T.page?{take:e.take,skip:e.skip}:{}});E=t,N=(Ne=e.total)!=null?Ne:r}const{size:I="medium"}=e,at=typeof e.groupable=="object"&&e.groupable.footer||"none",H=e.scrollable==="virtual",V=e.groupable===!0||typeof e.groupable=="object"&&e.groupable.enabled!==!1,O=b.getDetailExpandableOptions(!!e.detail),lt=b.getGroupExpandableOptions(typeof e.groupable=="object"&&e.groupable.enabled!==!1?e.groupable.expandable:e.groupable),{resolvedGroupsCount:rt,flattedData:nt}=je(at,e.skip||0,e.group,e.expandField,e.detailExpand,e.groupExpand,e.dataItemKey);y=nt;const J=Ze();J===$.VirtualScrollFixed&&le()&&(_=y.slice(e.skip||0,(e.skip||0)+((e.take!==void 0?e.take:e.pageSize)||0)));const ne=b.getSelectionOptions(e.selectable||!!e.selectedField),ie=s.getRowSpanOptions(e.rowSpannable),it=ne&&ne.drag?"none":void 0,M=a.Children.toArray(e.children);Xe(M,rt);const oe=M.map(t=>t&&t.type&&t.type.displayName==="KendoReactGridToolbar"?a.cloneElement(t,{...t.props,ariaControls:C}):null),W=M.filter(t=>t&&t.type&&t.type.displayName==="KendoReactGridNoRecords"),de=M.filter(t=>t&&t.type&&t.type.displayName==="KendoReactGridStatusBar"),h=f.current.filter(t=>t.children.length===0),ce=V&&a.createElement(Rt.GroupPanel,{columns:U().current,group:e.group||[],ariaControls:C}),se=a.createElement(Gt.Header,{size:I,staticHeaders:e.scrollable!=="none",draggable:e.reorderable||V,headerRow:a.createElement(St.HeaderRow,{cells:e.cells,sort:e.sort,sortable:e.sortable,group:e.group||[],groupable:V,filter:e.filter,filterable:e.filterable,filterOperators:e.filterOperators||Ke.operators,columnMenu:e.columnMenu,columnMenuIcon:e.columnMenuIcon,columns:f.current,columnsMap:q,cellRender:e.headerCellRender,navigatable:!!e.navigatable,localization:z,unstyled:F,headerSelectionValue:!!(e.select&&y.filter(t=>t.rowType==="data").every(t=>e.select&&e.dataItemKey&&d.getter(e.dataItemKey)(t.dataItem)!==void 0?e.select[d.getter(e.dataItemKey)(t.dataItem)]:void 0))}),filterRow:e.filterable&&a.createElement(Et.FilterRow,{cells:e.cells,size:I,columns:f.current,filter:e.filter,filterOperators:e.filterOperators||Ke.operators,sort:e.sort,cellRender:e.filterCellRender,navigatable:!!e.navigatable,ariaRowIndex:q.length+1,localization:z})||void 0,cols:h.map((t,r)=>a.createElement("col",{key:r.toString(),width:s.getColumnWidth(t)}))}),ot=et.current||0,dt=parseFloat(((e.style||{}).width||"").toString()),ct=(t,r,c,o,i)=>{let l=!1;const u=e.selectedField?s.getNestedValue(e.selectedField,t.dataItem):e.select&&e.dataItemKey&&d.getter(e.dataItemKey)(t.dataItem)!==void 0?e.select[d.getter(e.dataItemKey)(t.dataItem)]:void 0;let g=0;const{colSpans:w,hiddenColumns:P}=b.tableColumnsVirtualization({enabled:e.columnVirtualization,columns:h,tableViewPortWidth:dt,scrollLeft:ot,getColSpan:s.getColSpan,dataItem:t.dataItem}),v=h.filter((n,G)=>!P[G]);return{row:h.map((n,G)=>{var qe,Fe,De,Te;if(P[G])return null;if(g>0)return g--,null;let R;if((qe=n.rowSpannable)!=null&&qe.enabled&&t.rowType==="data"&&n.field&&i){const x=n.field?(De=(Fe=n.rowSpannable).valueGetter)==null?void 0:De.call(Fe,t.dataItem,n.field):null;R={value:x,count:1},i[n.field]&&((Te=i[n.field])==null?void 0:Te.value)===x&&i[n.field]!==null?(i[n.field].count++,R.count=null):i[n.field]=R}const{colSpan:B,colsToSkip:Z}=pe(n,t.dataItem,v,G,g,w[G]);g=Z;const L=n.id?n.id:G,gt=d.classNames(m.contentSticky({locked:n.locked}),n.className),ft=n.left!==void 0?{left:n.left,right:n.right}:{};let p=!1;if(n.editable&&(e.editable||e.editField)){const x=e.editField?s.getNestedValue(e.editField,t.dataItem):e.edit&&e.dataItemKey?e.edit[d.getter(e.dataItemKey)(t.dataItem)]:void 0,te=typeof x=="boolean"?x:Array.isArray(x)?x.indexOf(n.field)>-1:n.field!==void 0&&x===n.field;te&&n.columnType==="data"&&(te===!0||te===n.field)&&(l=!0,p=!0)}const ee=n.cell||p&&wt.GridEditCell||vt.GridCell,mt=e.expandField&&e.detail&&n.field===e.expandField||n._type==="expand",K={locked:e.lockGroups,id:b.tableKeyboardNavigationTools.generateNavigatableId(`${r}-${String(G)}`,S,mt||t.rowType==="groupHeader"||t.rowType==="groupFooter"||n.field==="value"?"nodata":"cell"),colSpan:B,dataItem:t.dataItem,field:n.field,editor:n.editor,format:n.format,columnType:n.columnType,rowReorderable:D,className:gt,render:e.cellRender,cells:s.resolveCells(e.cells,n.cells),columnIndex:G,columnsCount:h.length,rowType:t.rowType,level:t.level,expanded:t.expanded,dataIndex:t.dataIndex,rowDataIndex:c,columnPosition:ft,style:{},ariaColumnIndex:n.ariaColumnIndex,isSelected:(n==null?void 0:n._type)==="edit"?u:Array.isArray(u)&&u.indexOf(G)>-1,isSorted:!!s.isSorted(n.field,e.sort),isInEdit:p,isAlt:o,unstyled:F,group:t.group,localization:z,intl:tt,_rowSpan:R};return n.cell?a.createElement(_t.GridCustomCellClientContainer,{key:L,isClient:s.isClientReference(ee),dataItem:K.dataItem,rowDataIndex:K.rowDataIndex,columnIndex:K.columnIndex,columnPosition:K.columnPosition},a.createElement(ee,{...K})):a.createElement(ee,{key:L,...K})}),isInEdit:l,isSelected:typeof u=="boolean"&&u}};let ue=0;if(H&&Q)for(let t=0;t<Q.topCacheCount+Q.attendedSkip-(e.skip||0);t++){const r=y.shift();if(r)y.push(r),ue++,r.rowType==="groupHeader"&&t--;else break}const ge=t=>t>=y.length-ue;let fe=e.skip||0;const X=[],me=!y.length,be=q.length+(e.filterable?1:0)+1;let A=0;if(y.length){let t=-1,r=0;const c=ie.enabled?{}:void 0;(_||y).forEach((o,i)=>{o.rowType==="data"&&(fe++,t++);const l=fe%2===0,u=e.dataItemKey&&d.getter(e.dataItemKey)(o.dataItem),g=i+(e.skip||0),w=u||"ai"+g,P=w+"_1",v=ct(o,w,t,l,c);if(A=g+be+r,X.push(a.createElement(xt.GridRow,{key:w,dataItem:o.dataItem,isAltRow:l,isInEdit:v.isInEdit,rowType:o.rowType,isRowReorderable:D,isHidden:ge(i),onClick:null,onDoubleClick:null,selectedField:e.selectedField,rowHeight:e.rowHeight,render:e.rowRender,ariaRowIndex:A,absoluteRowIndex:g,dataIndex:H&&!e.groupable?g:t,isSelected:v.isSelected,rows:e.rows},v.row)),e.detail&&o.rowType==="data"&&o.expanded){const n=h.length-(e.expandField||O.enabled?1:0)-(e.group?e.group.length:0)||1;r++,A=g+be+r,X.push(a.createElement("tr",{key:P,className:d.classNames(m.detailTr({isAlt:l})),style:{visibility:ge(i)?"hidden":"",height:e.detailRowHeight},role:"row","aria-rowindex":A},e.group&&e.group.map((G,R)=>{var L;const B=(L=v==null?void 0:v.row[R])==null?void 0:L.props.style,Z=B?{left:B.left,right:B.right}:{};return a.createElement(He.GridGroupCell,{id:"",dataIndex:o.dataIndex,field:G.field,dataItem:o.dataItem,key:R,columnPosition:Z,style:{},ariaColumnIndex:1+R,isSelected:!1,locked:e.lockGroups,cells:e.cells,group:o.group})}),(e.expandField||O.enabled)&&a.createElement(Tt.GridDetailHierarchyCell,{unstyled:F,id:b.tableKeyboardNavigationTools.generateNavigatableId(`${P}-dhcell`,S)}),a.createElement(Dt.GridDetailCell,{dataItem:o.dataItem,dataIndex:o.dataIndex,colSpan:n,ariaColIndex:2+(e.group?e.group.length:0),detail:e.detail,id:b.tableKeyboardNavigationTools.generateNavigatableId(`${P}-dcell`,S)})))}})}const Ce={size:I,total:N,skip:e.skip||0,take:(e.take!==void 0?e.take:e.pageSize)||10,...qt.normalize(e.pageable||{})},ye=a.createElement(Vt.PagerContainer,null,e.pager?a.createElement(e.pager,{...Ce}):a.createElement(b.Pager,{className:d.classNames(m.pager({})),...Ce})),st=(t,r)=>a.createElement("col",{key:r.toString(),width:s.getColumnWidth(t)}),ut=(ke=e.cells)!=null&&ke.footerCell||f.current.some(t=>{var r;return!!(t.footerCell||(r=t.cells)!=null&&r.footerCell)})?a.createElement(It.Footer,{size:I,staticHeaders:e.scrollable!=="none",row:a.createElement(kt.FooterRow,{cells:e.cells,idPrefix:S,columns:f.current,ariaRowIndex:A+1}),cols:h.map(st)}):null,he=a.createElement(Pt.GridColGroup,null,h.map((t,r)=>a.createElement("col",{key:r.toString(),className:s.isSorted(t.field,e.sort)?d.classNames(m.sorted({})):void 0,width:s.getColumnWidth(t)}))),we=e.reorderable||V,{detail:$t,cells:Ut,rows:Qt,...Ge}=e,Se=a.createElement("tbody",{role:"rowgroup",className:d.classNames(m.tbody({})),...b.tableKeyboardNavigationBodyAttributes},X);let Y=Se;if(D&&(Y=a.createElement(zt.GridReorderableRowsContainer,{unstyled:m,columns:f.current,rowReorderSettings:e.rowReorderable},Se)),e.scrollable==="none")return a.createElement(Oe.GridClientWrapper,{gridRef:k,gridProps:Ge,columnsRef:U(),columnsMapRef:q,dataRef:y,slicedData:_,isFixedVirtualScroll:J===$.VirtualScrollFixed,id:C,total:N,detailExpandable:!!e.detail},a.createElement(_e.GridElementContainer,null,a.createElement("div",{id:e.id,style:e.style,className:d.classNames(m.wrapper({size:I}),e.className),"aria-label":e.ariaLabel,...b.tableKeyboardNavigationScopeAttributes},oe,ce,a.createElement(Kt.GridTable,{selectable:e.selectable,className:d.classNames(m.table({size:I}))},he,se,a.createElement(Le.GridTableBody,{rowReorderable:D},Y)),me&&a.createElement(Ve.GridNoRecordsContainer,null,W.length?W:a.createElement(Pe.GridNoRecords,null)),we&&a.createElement(a.Fragment,null,a.createElement(Ae.GridDropClue,null),a.createElement(Be.GridDragClue,null)))),de,e.pageable&&ye,a.createElement(Me.GridLoader,{loader:e.loader,showLoader:e.showLoader}));let j=e.style||{};return H&&(j.height||(j=Object.assign({},j,{height:"450px"}))),a.createElement(Oe.GridClientWrapper,{gridRef:k,gridProps:Ge,columnsRef:U(),columnsMapRef:q,dataRef:y,slicedData:_,isFixedVirtualScroll:J===$.VirtualScrollFixed,id:C,total:N,detailExpandable:!!e.detail},a.createElement(_e.GridElementContainer,null,a.createElement("div",{id:e.id,style:j,className:d.classNames(m.wrapper({size:I,virtual:H}),e.className),"aria-label":e.ariaLabel,...b.tableKeyboardNavigationScopeAttributes},oe,ce,a.createElement("div",{className:d.classNames(m.ariaRoot({})),role:"grid","aria-colcount":h.length,"aria-rowcount":N,id:C,"aria-label":z.toLanguageString(ae.gridAriaLabel,ae.messages[ae.gridAriaLabel])},se,a.createElement("div",{className:d.classNames(m.container({})),role:"presentation"},a.createElement(At.GridContainerElementContainer,null,a.createElement("div",{className:d.classNames(m.content({})),role:"presentation"},a.createElement("div",{className:d.classNames(m.tableWrap({})),role:"presentation"},a.createElement(Ot.GridTableScrollable,{selectable:e.selectable,tableClassName:d.classNames(m.table({size:I})),tableStyle:{userSelect:it}},he,a.createElement(Le.GridTableBody,{rowReorderable:D},Y)),me&&a.createElement(Ve.GridNoRecordsContainer,null,W.length?W:a.createElement(Pe.GridNoRecords,null))),H&&a.createElement("div",{className:d.classNames(m.heightContainer({})),role:"presentation"},a.createElement(Bt.VirtualScrollHeightContainer,{isVirtualScroll:H}))))),ut,we&&a.createElement(a.Fragment,null,a.createElement(Ae.GridDropClue,null),a.createElement(Be.GridDragClue,null)),a.createElement(Ht.GridWatermarkOverlay,null)),de,e.pageable&&ye,a.createElement(Me.GridLoader,{loader:e.loader,showLoader:e.showLoader}))))});We.displayName="KendoReactGridComponent";exports.GridComponent=We;
package/GridComponent.mjs CHANGED
@@ -6,18 +6,18 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as l from "react";
9
- import { validatePackage as wt, uGrid as Et, getter as H, classNames as f, canUseDOM as It } from "@progress/kendo-react-common";
9
+ import { validatePackage as wt, uGrid as Et, getter as K, classNames as f, canUseDOM as It } from "@progress/kendo-react-common";
10
10
  import { process as St } from "@progress/kendo-data-query";
11
11
  import { combineFilters as vt, getDetailExpandableOptions as Rt, getGroupExpandableOptions as xt, getSelectionOptions as Gt, tableKeyboardNavigationTools as ee, Pager as kt, tableKeyboardNavigationBodyAttributes as Nt, tableKeyboardNavigationScopeAttributes as Ke, tableColumnsVirtualization as Ft } from "@progress/kendo-react-data-tools";
12
12
  import { GridSelectionCell as Dt } from "./cells/GridSelectionCell.mjs";
13
13
  import { GridHierarchyCell as Tt } from "./cells/GridHierarchyCell.mjs";
14
14
  import { GridEditCell as Ht } from "./cells/GridEditCell.mjs";
15
15
  import { Header as Kt } from "./header/Header.mjs";
16
- import { HeaderRow as At } from "./header/HeaderRow.mjs";
17
- import { FilterRow as Bt } from "./header/FilterRow.mjs";
18
- import { GroupPanel as Pt } from "./header/GroupPanel.mjs";
16
+ import { HeaderRow as Pt } from "./header/HeaderRow.mjs";
17
+ import { FilterRow as At } from "./header/FilterRow.mjs";
18
+ import { GroupPanel as Bt } from "./header/GroupPanel.mjs";
19
19
  import { Footer as Vt } from "./footer/Footer.mjs";
20
- import { isRowReorderEnabled as Lt, getRowSpanOptions as Ae, getColumnWidth as te, isSorted as Be, flatData as Ot, autoGenerateColumns as _t, mapColumns as zt, clientColumn as Mt, getNestedValue as Pe, getColSpan as Ve, resolveCells as Wt, isClientReference as jt, sanitizeColumns as $t, readColumns as Ut } from "./utils/index.mjs";
20
+ import { isRowReorderEnabled as Lt, getRowSpanOptions as Pe, getColumnWidth as te, isSorted as Ae, flatData as Ot, autoGenerateColumns as _t, mapColumns as zt, clientColumn as Mt, getNestedValue as Be, getColSpan as Ve, resolveCells as Wt, isClientReference as jt, sanitizeColumns as $t, readColumns as Ut } from "./utils/index.mjs";
21
21
  import { GridCell as Jt } from "./cells/GridCell.mjs";
22
22
  import { GridGroupCell as Le } from "./cells/GridGroupCell.mjs";
23
23
  import { GridRow as Qt } from "./rows/GridRow.mjs";
@@ -147,11 +147,11 @@ const hl = l.forwardRef((e, le) => {
147
147
  locked: e.lockGroups
148
148
  }), o++;
149
149
  t.slice(o).forEach((a) => {
150
- a.parentIndex >= 0 && (a.parentIndex += o), a.rowSpannable = a.rowSpannable !== void 0 ? Ae(a.rowSpannable) : ie;
150
+ a.parentIndex >= 0 && (a.parentIndex += o), a.rowSpannable = a.rowSpannable !== void 0 ? Pe(a.rowSpannable) : ie;
151
151
  });
152
152
  }, ae = () => C.length === e.total, lt = () => {
153
153
  const { rowHeight: t, detailRowHeight: r, detail: d, expandField: o } = e, i = ae(), a = t !== void 0 && t > 0, c = r !== void 0 && r > 0;
154
- return !a || K && !i || !!(d && o) && (!c || !i) ? ml : j;
154
+ return !a || P && !i || !!(d && o) && (!c || !i) ? ml : j;
155
155
  }, $ = () => e.isClient ? m : re, at = (t, r, d, o, i, a) => {
156
156
  let c = Ve(t, r);
157
157
  if (e.columnVirtualization && t.colSpan === 1)
@@ -185,7 +185,7 @@ const hl = l.forwardRef((e, le) => {
185
185
  });
186
186
  C = t, v = (ke = e.total) != null ? ke : r;
187
187
  }
188
- const { size: E = "medium" } = e, it = typeof e.groupable == "object" && e.groupable.footer || "none", D = e.scrollable === "virtual", K = e.groupable === !0 || typeof e.groupable == "object" && e.groupable.enabled !== !1, A = Rt(!!e.detail), ot = xt(
188
+ const { size: E = "medium" } = e, it = typeof e.groupable == "object" && e.groupable.footer || "none", D = e.scrollable === "virtual", P = e.groupable === !0 || typeof e.groupable == "object" && e.groupable.enabled !== !1, A = Rt(!!e.detail), ot = xt(
189
189
  typeof e.groupable == "object" && e.groupable.enabled !== !1 ? e.groupable.expandable : e.groupable
190
190
  ), { resolvedGroupsCount: dt, flattedData: ct } = Xe(
191
191
  it,
@@ -202,24 +202,24 @@ const hl = l.forwardRef((e, le) => {
202
202
  e.skip || 0,
203
203
  (e.skip || 0) + ((e.take !== void 0 ? e.take : e.pageSize) || 0)
204
204
  ));
205
- const ne = Gt(e.selectable || !!e.selectedField), ie = Ae(e.rowSpannable), st = ne && ne.drag ? "none" : void 0, z = l.Children.toArray(e.children);
205
+ const ne = Gt(e.selectable || !!e.selectedField), ie = Pe(e.rowSpannable), st = ne && ne.drag ? "none" : void 0, z = l.Children.toArray(e.children);
206
206
  et(z, dt);
207
207
  const oe = z.map((t) => t && t.type && t.type.displayName === "KendoReactGridToolbar" ? l.cloneElement(t, { ...t.props, ariaControls: R }) : null), M = z.filter((t) => t && t.type && t.type.displayName === "KendoReactGridNoRecords"), de = z.filter(
208
208
  (t) => t && t.type && t.type.displayName === "KendoReactGridStatusBar"
209
- ), b = m.current.filter((t) => t.children.length === 0), ce = K && /* @__PURE__ */ l.createElement(Pt, { columns: $().current, group: e.group || [], ariaControls: R }), se = /* @__PURE__ */ l.createElement(
209
+ ), b = m.current.filter((t) => t.children.length === 0), ce = P && /* @__PURE__ */ l.createElement(Bt, { columns: $().current, group: e.group || [], ariaControls: R }), se = /* @__PURE__ */ l.createElement(
210
210
  Kt,
211
211
  {
212
212
  size: E,
213
213
  staticHeaders: e.scrollable !== "none",
214
- draggable: e.reorderable || K,
214
+ draggable: e.reorderable || P,
215
215
  headerRow: /* @__PURE__ */ l.createElement(
216
- At,
216
+ Pt,
217
217
  {
218
218
  cells: e.cells,
219
219
  sort: e.sort,
220
220
  sortable: e.sortable,
221
221
  group: e.group || [],
222
- groupable: K,
222
+ groupable: P,
223
223
  filter: e.filter,
224
224
  filterable: e.filterable,
225
225
  filterOperators: e.filterOperators || _e,
@@ -232,12 +232,12 @@ const hl = l.forwardRef((e, le) => {
232
232
  localization: _,
233
233
  unstyled: k,
234
234
  headerSelectionValue: !!(e.select && g.filter((t) => t.rowType === "data").every(
235
- (t) => e.select && e.dataItemKey && H(e.dataItemKey)(t.dataItem) !== void 0 ? e.select[H(e.dataItemKey)(t.dataItem)] : void 0
235
+ (t) => e.select && e.dataItemKey && K(e.dataItemKey)(t.dataItem) !== void 0 ? e.select[K(e.dataItemKey)(t.dataItem)] : void 0
236
236
  ))
237
237
  }
238
238
  ),
239
239
  filterRow: e.filterable && /* @__PURE__ */ l.createElement(
240
- Bt,
240
+ At,
241
241
  {
242
242
  cells: e.cells,
243
243
  size: E,
@@ -255,7 +255,7 @@ const hl = l.forwardRef((e, le) => {
255
255
  }
256
256
  ), mt = rt.current || 0, ut = parseFloat(((e.style || {}).width || "").toString()), ft = (t, r, d, o, i) => {
257
257
  let a = !1;
258
- const c = e.selectedField ? Pe(e.selectedField, t.dataItem) : e.select && e.dataItemKey && H(e.dataItemKey)(t.dataItem) !== void 0 ? e.select[H(e.dataItemKey)(t.dataItem)] : void 0;
258
+ const c = e.selectedField ? Be(e.selectedField, t.dataItem) : e.select && e.dataItemKey && K(e.dataItemKey)(t.dataItem) !== void 0 ? e.select[K(e.dataItemKey)(t.dataItem)] : void 0;
259
259
  let s = 0;
260
260
  const { colSpans: h, hiddenColumns: T } = Ft({
261
261
  enabled: e.columnVirtualization,
@@ -277,7 +277,7 @@ const hl = l.forwardRef((e, le) => {
277
277
  const S = n.field ? (Te = (De = n.rowSpannable).valueGetter) == null ? void 0 : Te.call(De, t.dataItem, n.field) : null;
278
278
  w = { value: S, count: 1 }, i[n.field] && ((He = i[n.field]) == null ? void 0 : He.value) === S && i[n.field] !== null ? (i[n.field].count++, w.count = null) : i[n.field] = w;
279
279
  }
280
- const { colSpan: P, colsToSkip: Y } = at(
280
+ const { colSpan: V, colsToSkip: Y } = at(
281
281
  n,
282
282
  t.dataItem,
283
283
  I,
@@ -286,20 +286,20 @@ const hl = l.forwardRef((e, le) => {
286
286
  h[y]
287
287
  );
288
288
  s = Y;
289
- const V = n.id ? n.id : y, ht = f(u.contentSticky({ locked: n.locked }), n.className), yt = n.left !== void 0 ? { left: n.left, right: n.right } : {};
289
+ const L = n.id ? n.id : y, ht = f(u.contentSticky({ locked: n.locked }), n.className), yt = n.left !== void 0 ? { left: n.left, right: n.right } : {};
290
290
  let Z = !1;
291
291
  if (n.editable && (e.editable || e.editField)) {
292
- const S = e.editField ? Pe(e.editField, t.dataItem) : e.edit && e.dataItemKey ? e.edit[H(e.dataItemKey)(t.dataItem)] : void 0, p = typeof S == "boolean" ? S : Array.isArray(S) ? S.indexOf(n.field) > -1 : n.field !== void 0 && S === n.field;
292
+ const S = e.editField ? Be(e.editField, t.dataItem) : e.edit && e.dataItemKey ? e.edit[K(e.dataItemKey)(t.dataItem)] : void 0, p = typeof S == "boolean" ? S : Array.isArray(S) ? S.indexOf(n.field) > -1 : n.field !== void 0 && S === n.field;
293
293
  p && n.columnType === "data" && (p === !0 || p === n.field) && (a = !0, Z = !0);
294
294
  }
295
- const q = n.cell || Z && Ht || Jt, Ct = e.expandField && e.detail && n.field === e.expandField || n._type === "expand", L = {
295
+ const q = n.cell || Z && Ht || Jt, Ct = e.expandField && e.detail && n.field === e.expandField || n._type === "expand", H = {
296
296
  locked: e.lockGroups,
297
297
  id: ee.generateNavigatableId(
298
298
  `${r}-${String(y)}`,
299
299
  x,
300
300
  Ct || t.rowType === "groupHeader" || t.rowType === "groupFooter" || n.field === "value" ? "nodata" : "cell"
301
301
  ),
302
- colSpan: P,
302
+ colSpan: V,
303
303
  dataItem: t.dataItem,
304
304
  field: n.field,
305
305
  editor: n.editor,
@@ -320,7 +320,7 @@ const hl = l.forwardRef((e, le) => {
320
320
  style: {},
321
321
  ariaColumnIndex: n.ariaColumnIndex,
322
322
  isSelected: (n == null ? void 0 : n._type) === "edit" ? c : Array.isArray(c) && c.indexOf(y) > -1,
323
- isSorted: !!Be(n.field, e.sort),
323
+ isSorted: !!Ae(n.field, e.sort),
324
324
  isInEdit: Z,
325
325
  isAlt: o,
326
326
  unstyled: k,
@@ -332,14 +332,15 @@ const hl = l.forwardRef((e, le) => {
332
332
  return n.cell ? /* @__PURE__ */ l.createElement(
333
333
  ul,
334
334
  {
335
- key: V,
335
+ key: L,
336
336
  isClient: jt(q),
337
- dataItem: L.dataItem,
338
- rowDataIndex: L.rowDataIndex,
339
- columnIndex: L.columnIndex
337
+ dataItem: H.dataItem,
338
+ rowDataIndex: H.rowDataIndex,
339
+ columnIndex: H.columnIndex,
340
+ columnPosition: H.columnPosition
340
341
  },
341
- /* @__PURE__ */ l.createElement(q, { ...L })
342
- ) : /* @__PURE__ */ l.createElement(q, { key: V, ...L });
342
+ /* @__PURE__ */ l.createElement(q, { ...H })
343
+ ) : /* @__PURE__ */ l.createElement(q, { key: L, ...H });
343
344
  }),
344
345
  isInEdit: a,
345
346
  isSelected: typeof c == "boolean" && c
@@ -363,7 +364,7 @@ const hl = l.forwardRef((e, le) => {
363
364
  const d = ie.enabled ? {} : void 0;
364
365
  (O || g).forEach((o, i) => {
365
366
  o.rowType === "data" && (fe++, t++);
366
- const a = fe % 2 === 0, c = e.dataItemKey && H(e.dataItemKey)(o.dataItem), s = i + (e.skip || 0), h = c || "ai" + s, T = h + "_1", I = ft(o, h, t, a, d);
367
+ const a = fe % 2 === 0, c = e.dataItemKey && K(e.dataItemKey)(o.dataItem), s = i + (e.skip || 0), h = c || "ai" + s, T = h + "_1", I = ft(o, h, t, a, d);
367
368
  if (B = s + be + r, Q.push(
368
369
  /* @__PURE__ */ l.createElement(
369
370
  Qt,
@@ -404,8 +405,8 @@ const hl = l.forwardRef((e, le) => {
404
405
  "aria-rowindex": B
405
406
  },
406
407
  e.group && e.group.map((y, w) => {
407
- var V;
408
- const P = (V = I == null ? void 0 : I.row[w]) == null ? void 0 : V.props.style, Y = P ? { left: P.left, right: P.right } : {};
408
+ var L;
409
+ const V = (L = I == null ? void 0 : I.row[w]) == null ? void 0 : L.props.style, Y = V ? { left: V.left, right: V.right } : {};
409
410
  return /* @__PURE__ */ l.createElement(
410
411
  Le,
411
412
  {
@@ -476,10 +477,10 @@ const hl = l.forwardRef((e, le) => {
476
477
  "col",
477
478
  {
478
479
  key: r.toString(),
479
- className: Be(t.field, e.sort) ? f(u.sorted({})) : void 0,
480
+ className: Ae(t.field, e.sort) ? f(u.sorted({})) : void 0,
480
481
  width: te(t)
481
482
  }
482
- ))), we = e.reorderable || K, { detail: yl, cells: Cl, rows: wl, ...Ee } = e, Ie = /* @__PURE__ */ l.createElement(
483
+ ))), we = e.reorderable || P, { detail: yl, cells: Cl, rows: wl, ...Ee } = e, Ie = /* @__PURE__ */ l.createElement(
483
484
  "tbody",
484
485
  {
485
486
  role: "rowgroup",
@@ -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 f=require("react"),u=require("../utils/index.js"),C=require("@progress/kendo-react-common"),g=require("../constants/index.js"),G=require("./client/GridEditCellEditor.js"),m=require("./client/GridEditCellContainer.js");function y(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const r=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,r.get?r:{enumerable:!0,get:()=>e[l]})}}return t.default=e,Object.freeze(t)}const i=y(f),S=e=>{const t=e.unstyled,l=t&&t.uGrid?t.uGrid:C.uGrid,r=C.classNames(l.editTd({selected:e.isSelected}),e.className),c={colSpan:e.colSpan,style:e.style,className:r,"aria-colindex":e.ariaColumnIndex,"aria-selected":e.isSelected,[g.GRID_COL_INDEX_ATTRIBUTE]:e.columnIndex,role:"gridcell"},d=u.getClientCellProps(e),o=i.createElement(G.GridEditCellEditor,{cellProps:d}),a=e.editor||"text",n=e.cells;if(n){let s;n.edit&&n.edit[a]?s=n.edit[a]:n.data&&(s=n.data);const E=u.isClientReference(s);return i.createElement(m.GridEditCellContainer,{cellProps:d,tdProps:c,isCustom:!0,isClient:E},i.createElement(s,{...d,tdProps:c},o))}return i.createElement(m.GridEditCellContainer,{cellProps:d,content:o,tdProps:c},i.createElement("td",{...c},o))};exports.GridEditCell=S;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),u=require("../utils/index.js"),C=require("@progress/kendo-react-common"),g=require("../constants/index.js"),G=require("./client/GridEditCellEditor.js"),m=require("./client/GridEditCellContainer.js");function y(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const c=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,c.get?c:{enumerable:!0,get:()=>e[l]})}}return t.default=e,Object.freeze(t)}const r=y(f),S=e=>{const t=e.unstyled,l=t&&t.uGrid?t.uGrid:C.uGrid,c=C.classNames(l.editTd({selected:e.isSelected}),e.className),d={colSpan:e.colSpan,style:e.style,className:c,"aria-colindex":e.ariaColumnIndex,"aria-selected":e.isSelected,[g.GRID_COL_INDEX_ATTRIBUTE]:e.columnIndex,role:"gridcell"},s=u.getClientCellProps(e),o=r.createElement(G.GridEditCellEditor,{cellProps:s}),a=e.editor||"text",i=e.cells;if(i){let n;if(i.edit&&i.edit[a]?n=i.edit[a]:i.data&&(n=i.data),n){const E=u.isClientReference(n);return r.createElement(m.GridEditCellContainer,{cellProps:s,tdProps:d,isCustom:!0,isClient:E},r.createElement(n,{...s,tdProps:d},o))}}return r.createElement(m.GridEditCellContainer,{cellProps:s,content:o,tdProps:d},r.createElement("td",{...d},o))};exports.GridEditCell=S;
@@ -5,14 +5,14 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as l from "react";
9
- import { getClientCellProps as u, isClientReference as E } from "../utils/index.mjs";
10
- import { uGrid as f, classNames as G } from "@progress/kendo-react-common";
8
+ import * as i from "react";
9
+ import { getClientCellProps as u, isClientReference as f } from "../utils/index.mjs";
10
+ import { uGrid as E, classNames as G } from "@progress/kendo-react-common";
11
11
  import { GRID_COL_INDEX_ATTRIBUTE as x } from "../constants/index.mjs";
12
12
  import { GridEditCellEditor as I } from "./client/GridEditCellEditor.mjs";
13
13
  import { GridEditCellContainer as o } from "./client/GridEditCellContainer.mjs";
14
14
  const T = (e) => {
15
- const c = e.unstyled, a = c && c.uGrid ? c.uGrid : f, m = G(a.editTd({ selected: e.isSelected }), e.className), i = {
15
+ const c = e.unstyled, a = c && c.uGrid ? c.uGrid : E, m = G(a.editTd({ selected: e.isSelected }), e.className), n = {
16
16
  colSpan: e.colSpan,
17
17
  style: e.style,
18
18
  className: m,
@@ -20,14 +20,15 @@ const T = (e) => {
20
20
  "aria-selected": e.isSelected,
21
21
  [x]: e.columnIndex,
22
22
  role: "gridcell"
23
- }, n = u(e), d = /* @__PURE__ */ l.createElement(I, { cellProps: n }), r = e.editor || "text", t = e.cells;
23
+ }, s = u(e), d = /* @__PURE__ */ i.createElement(I, { cellProps: s }), r = e.editor || "text", t = e.cells;
24
24
  if (t) {
25
- let s;
26
- t.edit && t.edit[r] ? s = t.edit[r] : t.data && (s = t.data);
27
- const C = E(s);
28
- return /* @__PURE__ */ l.createElement(o, { cellProps: n, tdProps: i, isCustom: !0, isClient: C }, /* @__PURE__ */ l.createElement(s, { ...n, tdProps: i }, d));
25
+ let l;
26
+ if (t.edit && t.edit[r] ? l = t.edit[r] : t.data && (l = t.data), l) {
27
+ const C = f(l);
28
+ return /* @__PURE__ */ i.createElement(o, { cellProps: s, tdProps: n, isCustom: !0, isClient: C }, /* @__PURE__ */ i.createElement(l, { ...s, tdProps: n }, d));
29
+ }
29
30
  }
30
- return /* @__PURE__ */ l.createElement(o, { cellProps: n, content: d, tdProps: i }, /* @__PURE__ */ l.createElement("td", { ...i }, d));
31
+ return /* @__PURE__ */ i.createElement(o, { cellProps: s, content: d, tdProps: n }, /* @__PURE__ */ i.createElement("td", { ...n }, d));
31
32
  };
32
33
  export {
33
34
  T as GridEditCell
@@ -6,4 +6,4 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),o=require("../GridClientWrapper.js"),a=require("../utils/index.js");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const l=c(r),u=e=>{const t=l.useContext(o.GridContext);return t.isClient||e.isClient?e.children&&a.cloneReactElement(e.children,{onContextMenu:t.onContextMenu,onChange:t.itemChange,selectionChange:n=>{t.selectionChange({event:n,dataItem:e.dataItem,dataIndex:e.rowDataIndex,columnIndex:e.columnIndex})}}):e.children};exports.GridCustomCellClientContainer=u;
9
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),l=require("../GridClientWrapper.js"),r=require("../utils/index.js");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const a=c(o),u=e=>{const t=a.useContext(l.GridContext);if(t.isClient||e.isClient){const n=t.getCellPositionStyle(e.columnPosition);return e.children&&r.cloneReactElement(e.children,{style:{...e.style,...n},onContextMenu:t.onContextMenu,onChange:t.itemChange,selectionChange:i=>{t.selectionChange({event:i,dataItem:e.dataItem,dataIndex:e.rowDataIndex,columnIndex:e.columnIndex})}})}return e.children};exports.GridCustomCellClientContainer=u;
@@ -7,23 +7,28 @@
7
7
  */
8
8
  "use client";
9
9
  import * as i from "react";
10
- import { GridContext as o } from "../GridClientWrapper.mjs";
10
+ import { GridContext as l } from "../GridClientWrapper.mjs";
11
11
  import { cloneReactElement as a } from "../utils/index.mjs";
12
- const d = (e) => {
13
- const n = i.useContext(o);
14
- return n.isClient || e.isClient ? e.children && a(e.children, {
15
- onContextMenu: n.onContextMenu,
16
- onChange: n.itemChange,
17
- selectionChange: (t) => {
18
- n.selectionChange({
19
- event: t,
20
- dataItem: e.dataItem,
21
- dataIndex: e.rowDataIndex,
22
- columnIndex: e.columnIndex
23
- });
24
- }
25
- }) : e.children;
12
+ const m = (e) => {
13
+ const t = i.useContext(l);
14
+ if (t.isClient || e.isClient) {
15
+ const n = t.getCellPositionStyle(e.columnPosition);
16
+ return e.children && a(e.children, {
17
+ style: { ...e.style, ...n },
18
+ onContextMenu: t.onContextMenu,
19
+ onChange: t.itemChange,
20
+ selectionChange: (o) => {
21
+ t.selectionChange({
22
+ event: o,
23
+ dataItem: e.dataItem,
24
+ dataIndex: e.rowDataIndex,
25
+ columnIndex: e.columnIndex
26
+ });
27
+ }
28
+ });
29
+ }
30
+ return e.children;
26
31
  };
27
32
  export {
28
- d as GridCustomCellClientContainer
33
+ m as GridCustomCellClientContainer
29
34
  };