@progress/kendo-react-grid 9.4.0-develop.20 → 9.4.0-develop.22
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/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +383 -351
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +55 -55
- package/cells/client/GridRowReorderContainer.js +1 -1
- package/cells/client/GridRowReorderContainer.mjs +15 -9
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/index.d.mts +3 -3
- package/index.d.ts +3 -3
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +14 -14
- package/utils/index.js +1 -1
- package/utils/index.mjs +93 -89
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"),u=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"),te=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 Se,Ee,Re,Ie,ve,xe,Ne;const C=e.id+"-role-element-id",S=e.navigatable?C:"";d.validatePackage(Ft.packageMetadata);const je=(t,r,c,o,i,l,s)=>{const f=[],w=u.flatData(f,E,t,{index:r},c!==void 0,o,i,l,lt.defaultExpand,s);return{flattedData:f,resolvedGroupsCount:w}},$e=t=>{const r=t.filter(i=>i&&i.type&&i.type.displayName==="KendoReactGridColumn"),c=g.current.filter(i=>i.declarationIndex>=0&&i.parentIndex===-1),o=u.sanitizeColumns(c);return u.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);g.current=o,g.current.length===0&&(g.current=u.autoGenerateColumns(E,e.group,{column:(i=V.column)!=null?i:e.expandField},{prevId:0,idPrefix:S})),g.current=Je(g.current),Ye(g.current,r),q=u.mapColumns(g.current,!0),le.current=g.current.map(u.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?u.getRowSpanOptions(l.rowSpannable):ne})},ae=()=>E.length===e.total,Ze=()=>{const{rowHeight:t,detailRowHeight:r,detail:c,expandField:o}=e,i=ae(),l=t!==void 0&&t>0,s=r!==void 0&&r>0;return!l||K&&!i||!!(c&&o)&&(!s||!i)?Lt.VirtualScroll:$.VirtualScrollFixed},U=()=>e.isClient?g:le,pe=(t,r,c,o,i,l)=>{let s=u.getColSpan(t,r);if(e.columnVirtualization&&t.colSpan===1)return{colSpan:l,colsToSkip:i};let f=c.length-1===o,w=c.length-o;return e.columnVirtualization&&(f=h.length-1===o,w=h.length-o),s>1&&!f?i=s-1:s=1,w<=s&&!f&&(s=w),{colSpan:s,colsToSkip:i}};let Q,y=[],_;const g=e.columnsRef||{current:[]},le={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=typeof e.rowReorderable=="object"?e.rowReorderable.enabled: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=(Se=e.total)!=null?Se:E.length):(E=((Ee=e.data)==null?void 0:Ee.data)||[],N=(ve=(Ie=e.total)!=null?Ie:(Re=e.data)==null?void 0:Re.total)!=null?ve: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=(xe=e.total)!=null?xe: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&&ae()&&(_=y.slice(e.skip||0,(e.skip||0)+((e.take!==void 0?e.take:e.pageSize)||0)));const re=b.getSelectionOptions(e.selectable||!!e.selectedField),ne=u.getRowSpanOptions(e.rowSpannable),it=re&&re.drag?"none":void 0,M=a.Children.toArray(e.children);Xe(M,rt);const ie=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"),oe=M.filter(t=>t&&t.type&&t.type.displayName==="KendoReactGridStatusBar"),h=g.current.filter(t=>t.children.length===0),de=K&&a.createElement(Rt.GroupPanel,{columns:U().current,group:e.group||[],ariaControls:C}),ce=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:g.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:g.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:u.getColumnWidth(t)}))}),ot=et.current||0,dt=parseFloat(((e.style||{}).width||"").toString()),ct=(t,r,c,o,i)=>{let l=!1;const s=e.selectedField?u.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 f=0;const{colSpans:w,hiddenColumns:P}=b.tableColumnsVirtualization({enabled:e.columnVirtualization,columns:h,tableViewPortWidth:dt,scrollLeft:ot,getColSpan:u.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(f>0)return f--,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,f,w[G]);f=Z;const B=n.id?n.id:G,ft=d.classNames(m.contentSticky({locked:n.locked}),n.className),gt=n.left!==void 0?{left:n.left,right:n.right}:{};let ke=!1;if(n.editable&&(e.editable||e.editField)){const x=e.editField?u.getNestedValue(e.editField,t.dataItem):e.edit&&e.dataItemKey?e.edit[d.getter(e.dataItemKey)(t.dataItem)]:void 0,ee=typeof x=="boolean"?x:Array.isArray(x)?x.indexOf(n.field)>-1:n.field!==void 0&&x===n.field;ee&&n.columnType==="data"&&(ee===!0||ee===n.field)&&(l=!0,ke=!0)}const p=n.cell||ke&&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:ft,render:e.cellRender,cells:u.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:gt,style:{},ariaColumnIndex:n.ariaColumnIndex,isSelected:(n==null?void 0:n._type)==="edit"?s:Array.isArray(s)&&s.indexOf(G)>-1,isSorted:!!u.isSorted(n.field,e.sort),isInEdit:l,isAlt:o,unstyled:F,group:t.group,localization:z,intl:tt,_rowSpan:R};return n.cell?a.createElement(_t.GridCustomCellClientContainer,{key:B,isClient:u.isClientReference(p),dataItem:L.dataItem,rowDataIndex:L.rowDataIndex,columnIndex:L.columnIndex},a.createElement(p,{...L})):a.createElement(p,{key:B,...L})}),isInEdit:l,isSelected:typeof s=="boolean"&&s}};let se=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),se++,r.rowType==="groupHeader"&&t--;else break}const ue=t=>t>=y.length-se;let fe=e.skip||0;const X=[],ge=!y.length,me=q.length+(e.filterable?1:0)+1;let O=0;if(y.length){let t=-1,r=0;const c=ne.enabled?{}:void 0;(_||y).forEach((o,i)=>{o.rowType==="data"&&(fe++,t++);const l=fe%2===0,s=e.dataItemKey&&d.getter(e.dataItemKey)(o.dataItem),f=i+(e.skip||0),w=s||"ai"+f,P=w+"_1",v=ct(o,w,t,l,c);if(O=f+me+r,X.push(a.createElement(xt.GridRow,{key:w,dataItem:o.dataItem,isAltRow:l,isInEdit:v.isInEdit,rowType:o.rowType,isRowReorderable:D,isHidden:ue(i),onClick:null,onDoubleClick:null,selectedField:e.selectedField,rowHeight:e.rowHeight,render:e.rowRender,ariaRowIndex:O,absoluteRowIndex:f,dataIndex:H&&!e.groupable?f: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=f+me+r,X.push(a.createElement("tr",{key:P,className:d.classNames(m.detailTr({isAlt:l})),style:{visibility:ue(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 be={size:I,total:N,skip:e.skip||0,take:(e.take!==void 0?e.take:e.pageSize)||10,...qt.normalize(e.pageable||{})},Ce=a.createElement(Vt.PagerContainer,null,e.pager?a.createElement(e.pager,{...be}):a.createElement(b.Pager,{className:d.classNames(m.pager({})),...be})),st=(t,r)=>a.createElement("col",{key:r.toString(),width:u.getColumnWidth(t)}),ut=(Ne=e.cells)!=null&&Ne.footerCell||g.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:g.current,ariaRowIndex:O+1}),cols:h.map(st)}):null,ye=a.createElement(Pt.GridColGroup,null,h.map((t,r)=>a.createElement("col",{key:r.toString(),className:u.isSorted(t.field,e.sort)?d.classNames(m.sorted({})):void 0,width:u.getColumnWidth(t)}))),he=e.reorderable||K,{detail:$t,cells:Ut,rows:Qt,...we}=e,Ge=a.createElement("tbody",{role:"rowgroup",className:d.classNames(m.tbody({})),...b.tableKeyboardNavigationBodyAttributes},X);let Y=Ge;if(D&&(Y=a.createElement(zt.GridReorderableRowsContainer,{unstyled:m,columns:g.current,rowReorderSettings:e.rowReorderable},Ge)),e.scrollable==="none")return a.createElement(Oe.GridClientWrapper,{gridRef:k,gridProps:we,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},ie,de,a.createElement(Kt.GridTable,{selectable:e.selectable,className:d.classNames(m.table({size:I}))},ye,ce,a.createElement(Le.GridTableBody,{rowReorderable:D},Y)),ge&&a.createElement(Ve.GridNoRecordsContainer,null,W.length?W:a.createElement(Pe.GridNoRecords,null)),he&&a.createElement(a.Fragment,null,a.createElement(Ae.GridDropClue,null),a.createElement(Be.GridDragClue,null)))),oe,e.pageable&&Ce,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:we,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},ie,de,a.createElement("div",{className:d.classNames(m.ariaRoot({})),role:"grid","aria-colcount":h.length,"aria-rowcount":N,id:C,"aria-label":z.toLanguageString(te.gridAriaLabel,te.messages[te.gridAriaLabel])},ce,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}},ye,a.createElement(Le.GridTableBody,{rowReorderable:D},Y)),ge&&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,he&&a.createElement(a.Fragment,null,a.createElement(Ae.GridDropClue,null),a.createElement(Be.GridDragClue,null)),a.createElement(Ht.GridWatermarkOverlay,null)),oe,e.pageable&&Ce,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"),te=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 Se,Ee,Re,Ie,ve,xe,Ne;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),le.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):ne})},ae=()=>E.length===e.total,Ze=()=>{const{rowHeight:t,detailRowHeight:r,detail:c,expandField:o}=e,i=ae(),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:le,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:[]},le={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=(Se=e.total)!=null?Se:E.length):(E=((Ee=e.data)==null?void 0:Ee.data)||[],N=(ve=(Ie=e.total)!=null?Ie:(Re=e.data)==null?void 0:Re.total)!=null?ve: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=(xe=e.total)!=null?xe: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&&ae()&&(_=y.slice(e.skip||0,(e.skip||0)+((e.take!==void 0?e.take:e.pageSize)||0)));const re=b.getSelectionOptions(e.selectable||!!e.selectedField),ne=s.getRowSpanOptions(e.rowSpannable),it=re&&re.drag?"none":void 0,M=a.Children.toArray(e.children);Xe(M,rt);const ie=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"),oe=M.filter(t=>t&&t.type&&t.type.displayName==="KendoReactGridStatusBar"),h=f.current.filter(t=>t.children.length===0),de=K&&a.createElement(Rt.GroupPanel,{columns:U().current,group:e.group||[],ariaControls:C}),ce=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 ke=!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,ee=typeof x=="boolean"?x:Array.isArray(x)?x.indexOf(n.field)>-1:n.field!==void 0&&x===n.field;ee&&n.columnType==="data"&&(ee===!0||ee===n.field)&&(l=!0,ke=!0)}const p=n.cell||ke&&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:l,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(p),dataItem:L.dataItem,rowDataIndex:L.rowDataIndex,columnIndex:L.columnIndex},a.createElement(p,{...L})):a.createElement(p,{key:B,...L})}),isInEdit:l,isSelected:typeof u=="boolean"&&u}};let se=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),se++,r.rowType==="groupHeader"&&t--;else break}const ue=t=>t>=y.length-se;let ge=e.skip||0;const X=[],fe=!y.length,me=q.length+(e.filterable?1:0)+1;let O=0;if(y.length){let t=-1,r=0;const c=ne.enabled?{}:void 0;(_||y).forEach((o,i)=>{o.rowType==="data"&&(ge++,t++);const l=ge%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+me+r,X.push(a.createElement(xt.GridRow,{key:w,dataItem:o.dataItem,isAltRow:l,isInEdit:v.isInEdit,rowType:o.rowType,isRowReorderable:D,isHidden:ue(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+me+r,X.push(a.createElement("tr",{key:P,className:d.classNames(m.detailTr({isAlt:l})),style:{visibility:ue(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 be={size:I,total:N,skip:e.skip||0,take:(e.take!==void 0?e.take:e.pageSize)||10,...qt.normalize(e.pageable||{})},Ce=a.createElement(Vt.PagerContainer,null,e.pager?a.createElement(e.pager,{...be}):a.createElement(b.Pager,{className:d.classNames(m.pager({})),...be})),st=(t,r)=>a.createElement("col",{key:r.toString(),width:s.getColumnWidth(t)}),ut=(Ne=e.cells)!=null&&Ne.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,ye=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)}))),he=e.reorderable||K,{detail:$t,cells:Ut,rows:Qt,...we}=e,Ge=a.createElement("tbody",{role:"rowgroup",className:d.classNames(m.tbody({})),...b.tableKeyboardNavigationBodyAttributes},X);let Y=Ge;if(D&&(Y=a.createElement(zt.GridReorderableRowsContainer,{unstyled:m,columns:f.current,rowReorderSettings:e.rowReorderable},Ge)),e.scrollable==="none")return a.createElement(Oe.GridClientWrapper,{gridRef:k,gridProps:we,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},ie,de,a.createElement(Kt.GridTable,{selectable:e.selectable,className:d.classNames(m.table({size:I}))},ye,ce,a.createElement(Le.GridTableBody,{rowReorderable:D},Y)),fe&&a.createElement(Ve.GridNoRecordsContainer,null,W.length?W:a.createElement(Pe.GridNoRecords,null)),he&&a.createElement(a.Fragment,null,a.createElement(Ae.GridDropClue,null),a.createElement(Be.GridDragClue,null)))),oe,e.pageable&&Ce,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:we,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},ie,de,a.createElement("div",{className:d.classNames(m.ariaRoot({})),role:"grid","aria-colcount":h.length,"aria-rowcount":N,id:C,"aria-label":z.toLanguageString(te.gridAriaLabel,te.messages[te.gridAriaLabel])},ce,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}},ye,a.createElement(Le.GridTableBody,{rowReorderable:D},Y)),fe&&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,he&&a.createElement(a.Fragment,null,a.createElement(Ae.GridDropClue,null),a.createElement(Be.GridDragClue,null)),a.createElement(Ht.GridWatermarkOverlay,null)),oe,e.pageable&&Ce,a.createElement(Me.GridLoader,{loader:e.loader,showLoader:e.showLoader}))))});We.displayName="KendoReactGridComponent";exports.GridComponent=We;
|
package/GridComponent.mjs
CHANGED
|
@@ -17,46 +17,46 @@ import { HeaderRow as At } from "./header/HeaderRow.mjs";
|
|
|
17
17
|
import { FilterRow as Bt } from "./header/FilterRow.mjs";
|
|
18
18
|
import { GroupPanel as Pt } from "./header/GroupPanel.mjs";
|
|
19
19
|
import { Footer as Vt } from "./footer/Footer.mjs";
|
|
20
|
-
import { getRowSpanOptions as Ae, getColumnWidth as ee, isSorted as Be, flatData as
|
|
21
|
-
import { GridCell as
|
|
20
|
+
import { isRowReorderEnabled as Lt, getRowSpanOptions as Ae, getColumnWidth as ee, 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";
|
|
21
|
+
import { GridCell as Jt } from "./cells/GridCell.mjs";
|
|
22
22
|
import { GridGroupCell as Le } from "./cells/GridGroupCell.mjs";
|
|
23
|
-
import { GridRow as
|
|
24
|
-
import { GridHeaderSelectionCell as
|
|
23
|
+
import { GridRow as Qt } from "./rows/GridRow.mjs";
|
|
24
|
+
import { GridHeaderSelectionCell as Xt } from "./header/GridHeaderSelectionCell.mjs";
|
|
25
25
|
import { GridNoRecords as Oe } from "./components/noRecords/GridNoRecords.mjs";
|
|
26
26
|
import { operators as _e } from "./filterCommon.mjs";
|
|
27
|
-
import { FooterRow as
|
|
28
|
-
import { normalize as
|
|
29
|
-
import { packageMetadata as
|
|
30
|
-
import { GridDetailCell as
|
|
31
|
-
import { GridDetailHierarchyCell as
|
|
27
|
+
import { FooterRow as Yt } from "./footer/FooterRow.mjs";
|
|
28
|
+
import { normalize as Zt } from "./paging/GridPagerSettings.mjs";
|
|
29
|
+
import { packageMetadata as qt } from "./package-metadata.mjs";
|
|
30
|
+
import { GridDetailCell as pt } from "./cells/GridDetailCell.mjs";
|
|
31
|
+
import { GridDetailHierarchyCell as el } from "./cells/GridDetailHierarchyCell.mjs";
|
|
32
32
|
import { GridNoRecordsContainer as ze } from "./components/noRecords/GridNoRecordsContainer.mjs";
|
|
33
|
-
import { GridWatermarkOverlay as
|
|
33
|
+
import { GridWatermarkOverlay as tl } from "./GridWatermarkOverlay.mjs";
|
|
34
34
|
import { GridClientWrapper as Me } from "./GridClientWrapper.mjs";
|
|
35
|
-
import { GridColGroup as
|
|
36
|
-
import { GridTable as
|
|
35
|
+
import { GridColGroup as ll } from "./components/colGroup/GridColGroup.mjs";
|
|
36
|
+
import { GridTable as al } from "./components/table/GridTable.mjs";
|
|
37
37
|
import { GridDropClue as We } from "./components/GridDropClue.mjs";
|
|
38
38
|
import { GridDragClue as je } from "./components/GridDragClue.mjs";
|
|
39
39
|
import { GridTableBody as $e } from "./components/table/GridTableBody.mjs";
|
|
40
|
-
import { PagerContainer as
|
|
41
|
-
import { GridTableScrollable as
|
|
40
|
+
import { PagerContainer as rl } from "./components/PagerContainer.mjs";
|
|
41
|
+
import { GridTableScrollable as nl } from "./components/table/GridTableScrollable.mjs";
|
|
42
42
|
import { GridElementContainer as Ue } from "./components/GridElementContainer.mjs";
|
|
43
|
-
import { GridContainerElementContainer as
|
|
44
|
-
import { VirtualScrollHeightContainer as
|
|
45
|
-
import { LocalizationService as
|
|
46
|
-
import { gridAriaLabel as Je, messages as
|
|
43
|
+
import { GridContainerElementContainer as il } from "./components/GridContainerElementContainer.mjs";
|
|
44
|
+
import { VirtualScrollHeightContainer as ol } from "./components/VirtualScrollHeightContainer.mjs";
|
|
45
|
+
import { LocalizationService as dl, IntlService as cl } from "@progress/kendo-react-intl";
|
|
46
|
+
import { gridAriaLabel as Je, messages as sl } from "./messages/index.mjs";
|
|
47
47
|
import { VirtualScrollFixed as j } from "./VirtualScrollFixed.mjs";
|
|
48
|
-
import { VirtualScroll as
|
|
49
|
-
import { GridCustomCellClientContainer as
|
|
50
|
-
import { GridReorderableRowsContainer as
|
|
51
|
-
import { GridRowReorderCell as
|
|
52
|
-
import { GridHeaderRowReorderCell as
|
|
48
|
+
import { VirtualScroll as ml } from "./VirtualScroll.mjs";
|
|
49
|
+
import { GridCustomCellClientContainer as ul } from "./components/GridCustomCellClientContainer.mjs";
|
|
50
|
+
import { GridReorderableRowsContainer as fl } from "./components/GridDraggableRowsContainer.mjs";
|
|
51
|
+
import { GridRowReorderCell as gl } from "./cells/GridRowReorderCell.mjs";
|
|
52
|
+
import { GridHeaderRowReorderCell as bl } from "./header/client/GridHeaderRowReorderCell.mjs";
|
|
53
53
|
import { GridLoader as Qe } from "./components/GridLoader.mjs";
|
|
54
|
-
const
|
|
54
|
+
const hl = l.forwardRef((e, te) => {
|
|
55
55
|
var Ie, Se, ve, Re, xe, Ge, ke;
|
|
56
56
|
const R = e.id + "-role-element-id", x = e.navigatable ? R : "";
|
|
57
|
-
wt(
|
|
57
|
+
wt(qt);
|
|
58
58
|
const Xe = (t, r, d, o, i, a, c) => {
|
|
59
|
-
const s = [], h =
|
|
59
|
+
const s = [], h = Ot(
|
|
60
60
|
s,
|
|
61
61
|
C,
|
|
62
62
|
t,
|
|
@@ -72,8 +72,8 @@ const bl = l.forwardRef((e, te) => {
|
|
|
72
72
|
}, Ye = (t) => {
|
|
73
73
|
const r = t.filter(
|
|
74
74
|
(i) => i && i.type && i.type.displayName === "KendoReactGridColumn"
|
|
75
|
-
), d = m.current.filter((i) => i.declarationIndex >= 0 && i.parentIndex === -1), o =
|
|
76
|
-
return
|
|
75
|
+
), d = m.current.filter((i) => i.declarationIndex >= 0 && i.parentIndex === -1), o = $t(d);
|
|
76
|
+
return Ut(r, o, { prevId: 0, idPrefix: x });
|
|
77
77
|
}, Ze = (t) => t.filter((r) => It && r && r.media ? window.matchMedia(r.media).matches : r), qe = () => {
|
|
78
78
|
const t = [], r = (d, o) => d == null ? void 0 : d.forEach((i) => {
|
|
79
79
|
const a = i.hidden || o;
|
|
@@ -92,7 +92,7 @@ const bl = l.forwardRef((e, te) => {
|
|
|
92
92
|
}, et = (t, r) => {
|
|
93
93
|
var i;
|
|
94
94
|
const d = Ye(t), o = Ze(d);
|
|
95
|
-
m.current = o, m.current.length === 0 && (m.current =
|
|
95
|
+
m.current = o, m.current.length === 0 && (m.current = _t(
|
|
96
96
|
C,
|
|
97
97
|
e.group,
|
|
98
98
|
{
|
|
@@ -102,13 +102,13 @@ const bl = l.forwardRef((e, te) => {
|
|
|
102
102
|
prevId: 0,
|
|
103
103
|
idPrefix: x
|
|
104
104
|
}
|
|
105
|
-
)), m.current = pe(m.current), tt(m.current, r), G =
|
|
105
|
+
)), m.current = pe(m.current), tt(m.current, r), G = zt(m.current, !0), ae.current = m.current.map(Mt);
|
|
106
106
|
}, tt = (t, r) => {
|
|
107
107
|
var i;
|
|
108
108
|
t.filter((a) => e.selectedField && a.field === e.selectedField || a.columnType === "checkbox").forEach((a) => {
|
|
109
|
-
a.width = a.width || "50px", a.cell = a.cell || Dt, a._type = "edit", a.headerCell = a.headerCell ||
|
|
109
|
+
a.width = a.width || "50px", a.cell = a.cell || Dt, a._type = "edit", a.headerCell = a.headerCell || Xt;
|
|
110
110
|
}), N !== void 0 && t.filter((a) => a.columnType === "reorder").forEach((a) => {
|
|
111
|
-
a.width = a.width || "50px", a.cell = a.cell ||
|
|
111
|
+
a.width = a.width || "50px", a.cell = a.cell || gl, a.headerCell = a.headerCell || bl, a.sortable = !1, a.filterable = !1, a.editable = !1;
|
|
112
112
|
});
|
|
113
113
|
const d = {
|
|
114
114
|
id: "",
|
|
@@ -151,7 +151,7 @@ const bl = l.forwardRef((e, te) => {
|
|
|
151
151
|
});
|
|
152
152
|
}, le = () => C.length === e.total, lt = () => {
|
|
153
153
|
const { rowHeight: t, detailRowHeight: r, detail: d, expandField: o } = e, i = le(), a = t !== void 0 && t > 0, c = r !== void 0 && r > 0;
|
|
154
|
-
return !a || K && !i || !!(d && o) && (!c || !i) ?
|
|
154
|
+
return !a || K && !i || !!(d && o) && (!c || !i) ? ml : j;
|
|
155
155
|
}, $ = () => e.isClient ? m : ae, at = (t, r, d, o, i, a) => {
|
|
156
156
|
let c = Ve(t, r);
|
|
157
157
|
if (e.columnVirtualization && t.colSpan === 1)
|
|
@@ -162,7 +162,7 @@ const bl = l.forwardRef((e, te) => {
|
|
|
162
162
|
let U, g = [], O;
|
|
163
163
|
const m = e.columnsRef || { current: [] }, ae = { current: [] };
|
|
164
164
|
let G = [[]];
|
|
165
|
-
const rt = e.scrollLeftRef || { current: 0 }, _ = e.localization || new
|
|
165
|
+
const rt = e.scrollLeftRef || { current: 0 }, _ = e.localization || new dl(), nt = e.intl || new cl("en"), k = e.unstyled, u = k && k.uGrid ? k.uGrid : Et, N = Lt(e.rowReorderable), F = e.autoProcessData === !0 ? {
|
|
166
166
|
group: !0,
|
|
167
167
|
sort: !0,
|
|
168
168
|
filter: !0,
|
|
@@ -292,7 +292,7 @@ const bl = l.forwardRef((e, te) => {
|
|
|
292
292
|
const S = e.editField ? Pe(e.editField, t.dataItem) : e.edit && e.dataItemKey ? e.edit[H(e.dataItemKey)(t.dataItem)] : void 0, q = typeof S == "boolean" ? S : Array.isArray(S) ? S.indexOf(n.field) > -1 : n.field !== void 0 && S === n.field;
|
|
293
293
|
q && n.columnType === "data" && (q === !0 || q === n.field) && (a = !0, Ne = !0);
|
|
294
294
|
}
|
|
295
|
-
const Z = n.cell || Ne && Ht ||
|
|
295
|
+
const Z = n.cell || Ne && Ht || Jt, Ct = e.expandField && e.detail && n.field === e.expandField || n._type === "expand", L = {
|
|
296
296
|
locked: e.lockGroups,
|
|
297
297
|
id: p.generateNavigatableId(
|
|
298
298
|
`${r}-${String(y)}`,
|
|
@@ -308,7 +308,7 @@ const bl = l.forwardRef((e, te) => {
|
|
|
308
308
|
rowReorderable: N,
|
|
309
309
|
className: ht,
|
|
310
310
|
render: e.cellRender,
|
|
311
|
-
cells:
|
|
311
|
+
cells: Wt(e.cells, n.cells),
|
|
312
312
|
columnIndex: y,
|
|
313
313
|
columnsCount: b.length,
|
|
314
314
|
rowType: t.rowType,
|
|
@@ -330,10 +330,10 @@ const bl = l.forwardRef((e, te) => {
|
|
|
330
330
|
_rowSpan: w
|
|
331
331
|
};
|
|
332
332
|
return n.cell ? /* @__PURE__ */ l.createElement(
|
|
333
|
-
|
|
333
|
+
ul,
|
|
334
334
|
{
|
|
335
335
|
key: V,
|
|
336
|
-
isClient:
|
|
336
|
+
isClient: jt(Z),
|
|
337
337
|
dataItem: L.dataItem,
|
|
338
338
|
rowDataIndex: L.rowDataIndex,
|
|
339
339
|
columnIndex: L.columnIndex
|
|
@@ -366,7 +366,7 @@ const bl = l.forwardRef((e, te) => {
|
|
|
366
366
|
const a = ue % 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
367
|
if (B = s + ge + r, Q.push(
|
|
368
368
|
/* @__PURE__ */ l.createElement(
|
|
369
|
-
|
|
369
|
+
Qt,
|
|
370
370
|
{
|
|
371
371
|
key: h,
|
|
372
372
|
dataItem: o.dataItem,
|
|
@@ -425,14 +425,14 @@ const bl = l.forwardRef((e, te) => {
|
|
|
425
425
|
);
|
|
426
426
|
}),
|
|
427
427
|
(e.expandField || A.enabled) && /* @__PURE__ */ l.createElement(
|
|
428
|
-
|
|
428
|
+
el,
|
|
429
429
|
{
|
|
430
430
|
unstyled: k,
|
|
431
431
|
id: p.generateNavigatableId(`${T}-dhcell`, x)
|
|
432
432
|
}
|
|
433
433
|
),
|
|
434
434
|
/* @__PURE__ */ l.createElement(
|
|
435
|
-
|
|
435
|
+
pt,
|
|
436
436
|
{
|
|
437
437
|
dataItem: o.dataItem,
|
|
438
438
|
dataIndex: o.dataIndex,
|
|
@@ -452,8 +452,8 @@ const bl = l.forwardRef((e, te) => {
|
|
|
452
452
|
total: v,
|
|
453
453
|
skip: e.skip || 0,
|
|
454
454
|
take: (e.take !== void 0 ? e.take : e.pageSize) || 10,
|
|
455
|
-
...
|
|
456
|
-
}, he = /* @__PURE__ */ l.createElement(
|
|
455
|
+
...Zt(e.pageable || {})
|
|
456
|
+
}, he = /* @__PURE__ */ l.createElement(rl, null, e.pager ? /* @__PURE__ */ l.createElement(e.pager, { ...be }) : /* @__PURE__ */ l.createElement(kt, { className: f(u.pager({})), ...be })), gt = (t, r) => /* @__PURE__ */ l.createElement("col", { key: r.toString(), width: ee(t) }), bt = (ke = e.cells) != null && ke.footerCell || m.current.some((t) => {
|
|
457
457
|
var r;
|
|
458
458
|
return !!(t.footerCell || (r = t.cells) != null && r.footerCell);
|
|
459
459
|
}) ? /* @__PURE__ */ l.createElement(
|
|
@@ -462,7 +462,7 @@ const bl = l.forwardRef((e, te) => {
|
|
|
462
462
|
size: E,
|
|
463
463
|
staticHeaders: e.scrollable !== "none",
|
|
464
464
|
row: /* @__PURE__ */ l.createElement(
|
|
465
|
-
|
|
465
|
+
Yt,
|
|
466
466
|
{
|
|
467
467
|
cells: e.cells,
|
|
468
468
|
idPrefix: x,
|
|
@@ -472,14 +472,14 @@ const bl = l.forwardRef((e, te) => {
|
|
|
472
472
|
),
|
|
473
473
|
cols: b.map(gt)
|
|
474
474
|
}
|
|
475
|
-
) : null, ye = /* @__PURE__ */ l.createElement(
|
|
475
|
+
) : null, ye = /* @__PURE__ */ l.createElement(ll, null, b.map((t, r) => /* @__PURE__ */ l.createElement(
|
|
476
476
|
"col",
|
|
477
477
|
{
|
|
478
478
|
key: r.toString(),
|
|
479
479
|
className: Be(t.field, e.sort) ? f(u.sorted({})) : void 0,
|
|
480
480
|
width: ee(t)
|
|
481
481
|
}
|
|
482
|
-
))), Ce = e.reorderable || K, { detail:
|
|
482
|
+
))), Ce = e.reorderable || K, { detail: yl, cells: Cl, rows: wl, ...we } = e, Ee = /* @__PURE__ */ l.createElement(
|
|
483
483
|
"tbody",
|
|
484
484
|
{
|
|
485
485
|
role: "rowgroup",
|
|
@@ -490,7 +490,7 @@ const bl = l.forwardRef((e, te) => {
|
|
|
490
490
|
);
|
|
491
491
|
let X = Ee;
|
|
492
492
|
if (N && (X = /* @__PURE__ */ l.createElement(
|
|
493
|
-
|
|
493
|
+
fl,
|
|
494
494
|
{
|
|
495
495
|
unstyled: u,
|
|
496
496
|
columns: m.current,
|
|
@@ -524,7 +524,7 @@ const bl = l.forwardRef((e, te) => {
|
|
|
524
524
|
ie,
|
|
525
525
|
de,
|
|
526
526
|
/* @__PURE__ */ l.createElement(
|
|
527
|
-
|
|
527
|
+
al,
|
|
528
528
|
{
|
|
529
529
|
selectable: e.selectable,
|
|
530
530
|
className: f(u.table({ size: E }))
|
|
@@ -580,11 +580,11 @@ const bl = l.forwardRef((e, te) => {
|
|
|
580
580
|
"aria-colcount": b.length,
|
|
581
581
|
"aria-rowcount": v,
|
|
582
582
|
id: R,
|
|
583
|
-
"aria-label": _.toLanguageString(Je,
|
|
583
|
+
"aria-label": _.toLanguageString(Je, sl[Je])
|
|
584
584
|
},
|
|
585
585
|
ce,
|
|
586
|
-
/* @__PURE__ */ l.createElement("div", { className: f(u.container({})), role: "presentation" }, /* @__PURE__ */ l.createElement(
|
|
587
|
-
|
|
586
|
+
/* @__PURE__ */ l.createElement("div", { className: f(u.container({})), role: "presentation" }, /* @__PURE__ */ l.createElement(il, null, /* @__PURE__ */ l.createElement("div", { className: f(u.content({})), role: "presentation" }, /* @__PURE__ */ l.createElement("div", { className: f(u.tableWrap({})), role: "presentation" }, /* @__PURE__ */ l.createElement(
|
|
587
|
+
nl,
|
|
588
588
|
{
|
|
589
589
|
selectable: e.selectable,
|
|
590
590
|
tableClassName: f(
|
|
@@ -602,11 +602,11 @@ const bl = l.forwardRef((e, te) => {
|
|
|
602
602
|
className: f(u.heightContainer({})),
|
|
603
603
|
role: "presentation"
|
|
604
604
|
},
|
|
605
|
-
/* @__PURE__ */ l.createElement(
|
|
605
|
+
/* @__PURE__ */ l.createElement(ol, { isVirtualScroll: D })
|
|
606
606
|
)))),
|
|
607
607
|
bt,
|
|
608
608
|
Ce && /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(We, null), /* @__PURE__ */ l.createElement(je, null)),
|
|
609
|
-
/* @__PURE__ */ l.createElement(
|
|
609
|
+
/* @__PURE__ */ l.createElement(tl, null)
|
|
610
610
|
),
|
|
611
611
|
oe,
|
|
612
612
|
e.pageable && he,
|
|
@@ -614,7 +614,7 @@ const bl = l.forwardRef((e, te) => {
|
|
|
614
614
|
))
|
|
615
615
|
);
|
|
616
616
|
});
|
|
617
|
-
|
|
617
|
+
hl.displayName = "KendoReactGridComponent";
|
|
618
618
|
export {
|
|
619
|
-
|
|
619
|
+
hl as GridComponent
|
|
620
620
|
};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),m=require("@progress/kendo-react-intl"),w=require("@progress/kendo-react-data-tools"),f=require("../../GridClientWrapper.js"),n=require("../../messages/index.js"),q=a=>{const{cellProps:o,rowReorderable:i,children:r}=a,{id:l,dataItem:c}=o,s=m.useLocalization(),e=t.useContext(f.GridContext),d=w.useTableKeyboardNavigation(l),u=i,R=s.toLanguageString(n.gridRowReorderAriaLabel,n.messages[n.gridRowReorderAriaLabel]),g=()=>u?e.activeDragRowDataItemRef.current=c:null,b=t.useCallback(C=>{e!=null&&e.onContextMenu&&e.onContextMenu.call(void 0,C,o.dataItem,o.field)},[e,o.dataItem,o.field]);return r&&t.cloneElement(r,{"aria-label":R,...d,onMouseDown:g,onContextMenu:b})};exports.GridRowReorderCellContainer=q;
|
|
@@ -6,17 +6,23 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import
|
|
10
|
-
import { useLocalization as
|
|
11
|
-
import { useTableKeyboardNavigation as
|
|
12
|
-
import { GridContext as
|
|
13
|
-
import { gridRowReorderAriaLabel as
|
|
9
|
+
import t from "react";
|
|
10
|
+
import { useLocalization as b } from "@progress/kendo-react-intl";
|
|
11
|
+
import { useTableKeyboardNavigation as p } from "@progress/kendo-react-data-tools";
|
|
12
|
+
import { GridContext as C } from "../../GridClientWrapper.mjs";
|
|
13
|
+
import { gridRowReorderAriaLabel as a, messages as w } from "../../messages/index.mjs";
|
|
14
14
|
const L = (r) => {
|
|
15
|
-
const { cellProps:
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const { cellProps: e, rowReorderable: i, children: n } = r, { id: l, dataItem: s } = e, c = b(), o = t.useContext(C), m = p(l), d = i, u = c.toLanguageString(a, w[a]), f = () => d ? o.activeDragRowDataItemRef.current = s : null, R = t.useCallback(
|
|
16
|
+
(g) => {
|
|
17
|
+
o != null && o.onContextMenu && o.onContextMenu.call(void 0, g, e.dataItem, e.field);
|
|
18
|
+
},
|
|
19
|
+
[o, e.dataItem, e.field]
|
|
20
|
+
);
|
|
21
|
+
return n && t.cloneElement(n, {
|
|
22
|
+
"aria-label": u,
|
|
18
23
|
...m,
|
|
19
|
-
onMouseDown:
|
|
24
|
+
onMouseDown: f,
|
|
25
|
+
onContextMenu: R
|
|
20
26
|
});
|
|
21
27
|
};
|
|
22
28
|
export {
|