@progress/kendo-vue-grid 8.3.0-develop.3 → 8.3.0-develop.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Grid.d.ts +1 -0
- package/Grid.js +1 -1
- package/Grid.mjs +127 -122
- package/cells/GridSelectionCell.d.ts +1 -1
- package/cells/GridSelectionCell.js +1 -1
- package/cells/GridSelectionCell.mjs +24 -21
- package/dist/cdn/js/kendo-vue-grid.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -13
package/Grid.d.ts
CHANGED
|
@@ -381,6 +381,7 @@ declare const Grid: import('vue').DefineComponent<import('vue').ExtractPropTypes
|
|
|
381
381
|
}): void;
|
|
382
382
|
cellClickHandler(event: any): void;
|
|
383
383
|
cellKeydownHandler(event: any): void;
|
|
384
|
+
navigationActionHandler(event: any): void;
|
|
384
385
|
editHandler(dataItem: any): void;
|
|
385
386
|
removeHandler(dataItem: any): void;
|
|
386
387
|
saveHandler(dataItem: any): void;
|
package/Grid.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 a=require("vue"),l=require("@progress/kendo-vue-common"),f=require("@progress/kendo-vue-data-tools"),Ye=require("@progress/kendo-vue-indicators"),Ee=require("./GridNav.js"),Pe=require("./cells/GridSelectionCell.js"),De=require("./cells/GridHierarchyCell.js"),Ze=require("./cells/GridDetailHierarchyCell.js"),et=require("./cells/GridDetailCell.js"),tt=require("./header/Header.js"),st=require("./header/HeaderRow.js"),it=require("./header/FilterRow.js"),ot=require("./header/GroupPanel.js"),nt=require("./footer/Footer.js"),rt=require("./footer/FooterRow.js"),at=require("./components/table/GridTable.js"),lt=require("./components/table/GridTableScrollable.js"),Ne=require("./filterCommon.js"),dt=require("./VirtualScroll.js"),ht=require("./drag/ColumnResize.js"),ct=require("./drag/CommonDragLogic.js"),pt=require("./drag/DragClue.js"),ut=require("./drag/DropClue.js"),v=require("./utils/main.js"),ze=require("./cells/GridGroupCell.js"),ft=require("./rows/GridRow.js"),gt=require("./common.js"),Ve=require("./header/GridHeaderSelectionCell.js"),Fe=require("./components/noRecords/GridNoRecords.js"),Le=require("./components/noRecords/GridNoRecordsContainer.js"),ne=require("./package-metadata.js"),Ke=require("./messages/messagesMap.js"),re=require("@progress/kendo-data-query"),mt=require("./key.js"),Rt=require("./utils/virtualColumns.js"),_e=require("./components/StickyGroupTable.js"),Ct=require("./getRowContents.js"),bt=require("./hooks/useStickyGroups.js"),Ae=require("./components/PinnedRowsTable.js"),St=require("./cells/pincell/GridPinCell.js"),q=require("./contextMenu/GridContextMenu.js"),D=require("./contextMenu/enums.js"),It=a.defineComponent({name:"KendoGrid",inheritAttrs:!1,props:{...gt.gridProps,toolbar:{type:Object},noRecords:{type:Object}},data(){return{isRtl:!1,context:void 0,navigation:void 0,showLicenseWatermark:!1,licenseMessage:void 0,notHiddenColumns:[],contextMenuState:{show:!1,offset:{left:0,top:0},dataItem:void 0,field:void 0}}},watch:{clipboard:function(e){e?this.clipboardServiceRef||(this.clipboardServiceRef=new f.ClipboardService(this.handleClipboardEvent),this.clipboardServiceRef.addEventListeners(document)):this.clipboardServiceRef&&(this.clipboardServiceRef.removeEventListeners(document),this.clipboardServiceRef=null)},rowHeight:function(e,t){var s;this.onRowHeightChanged(e,t),(s=this.vsRef)==null||s.reset()},scrollable:function(){var e;(e=this.vsRef)==null||e.reset()},filter:function(){var e;(e=this.vsRef)==null||e.reset()},group:function(){var e;(e=this.vsRef)==null||e.reset()},currentGroupable:function(){var e;(e=this.vsRef)==null||e.reset()},sort:function(){var e;(e=this.vsRef)==null||e.reset()}},created(){l.validatePackage(ne.packageMetadata),this.showLicenseWatermark=l.shouldShowValidationUI(ne.packageMetadata),this.licenseMessage=l.getLicenseMessage(ne.packageMetadata),this.initialHeight=null,this.columnsRef=[],this.dragLogic=new ct.CommonDragLogic(this.columnReorder.bind(this),this.groupReorder.bind(this),this.columnToGroup.bind(this)),this.columnResize=new ht.ColumnResize(this.onResize.bind(this)),this._columnsMap=[[]],this._header=null,this._footer=null,this.tableRef=null,this.scrollHeightContainerRef=null,this.forceUpdateTimeout=void 0,this._gridId=l.guid(),this._gridRoleElementId=l.guid(),this.slicedCurrentData=void 0,this._prevTotal=void 0,this._containerHeightRef=0,this._minRowHeightRef=0,this.wrapperScrollTopRef=0,this.scrollLeftRef=0,this.previousCopiedItems=[],this.clipboardServiceRef=null},mounted(){var t,s;this.setRefs();const e=l.isRtl(this._element);if(this._prevTotal=this.$props.total,this.isRtl=e,this.initialHeight=((s=(t=this._element)==null?void 0:t.style)==null?void 0:s.height)||null,this.resizeObserver=l.canUseDOM&&(window==null?void 0:window.ResizeObserver)&&new ResizeObserver(this.calculateMedia),document!=null&&document.body&&this.resizeObserver&&this.resizeObserver.observe(document.body),l.canUseDOM){const i={rootMargin:"0px",threshold:.9};this.observerRef=window.IntersectionObserver&&new window.IntersectionObserver(this.handleIntersection,i)||null}this.$props.clipboard&&(this.clipboardServiceRef=new f.ClipboardService(this.handleClipboardEvent),this.clipboardServiceRef.addEventListeners(document))},updated(){var s;this.setRefs();const e=l.isRtl(this._element);this.isRtl=e,this._prevTotal=this.$props.total,this.vsRef.tableTransform&&this.vsRef.table&&(this.vsRef.table.style.transform=this.vsRef.tableTransform,this.vsRef.tableTransform="");const t=this.updateStickyGroups();this.sticky.headerItems=t==null?void 0:t.stickyHeaderItems,this.sticky.footerItems=t==null?void 0:t.stickyFooterItems,this.isVirtualScroll&&(this.setContainerHeight(),this.setMinRowHeight(),(s=this.vsRef)==null||s.update())},unmounted(){this.gridUnmounted()},computed:{gridId(){return this.$props.id+"-role-element-id"},idPrefix(){return this.$props.navigatable?this.gridId:""},groupExpandable(){return f.getGroupExpandableOptions(typeof this.$props.groupable=="object"&&this.$props.groupable.enabled!==!1?this.$props.groupable.expandable:this.$props.groupable)},hierarchClass(){return l.uGrid.hierarchyCell({})},computedRowSpannable(){return v.getRowSpanOptions(this.$props.rowSpannable)},computedSelectable(){return f.getSelectionOptions(this.$props.selectable)},detailExpandable(){return f.getDetailExpandableOptions(!!this.$props.detail)},nonscrollableWrapperClass(){const{size:e}=this.$props,t=this.$attrs.class;return{"k-grid":!0,"k-grid-md":!e,[`k-grid-${l.kendoThemeMaps.sizeMap[e]||e}`]:e,[t]:!!t}},scrollableWrapperClass(){const{scrollable:e}=this.$props;return{...this.nonscrollableWrapperClass,"k-grid-virtual":e==="virtual"}},gridTableClass(){const{size:e}=this.$props;return{"k-table":!0,"k-grid-table":!0,"k-grid-md":!e,[`k-table-${l.kendoThemeMaps.sizeMap[e]||e}`]:e}},getCorrectHeight(){return this.$props.scrollable==="virtual"?this.initialHeight||"450px":null},currentGroupable(){var t;const e=(t=this.gridStateContext.group)==null?void 0:t.value;return this.$props.groupable===!0&&(e==null?void 0:e.length)||l.isObject(this.$props.groupable)&&this.$props.groupable.enabled!==!1},computedCollapsed(){let e=[];if(this.$props.group)for(let t=0;t<this.$props.group.length;t++)this.$props.collapsedGroups[t]?e.push(this.$props.collapsedGroups[t]):e.push([]);return e},getAriaRowCount(){var s,i;const e=this.$props.dataItems,t=this.$props.total||(e==null?void 0:e.total)||(e==null?void 0:e.length)||0;return this.$props.detail?this._columnsMap.length+(this.$props.filterable?1:0)+t*2+(this.columnsRef.some(o=>{var n;return!!(o.footerCell||(n=o.cells)!=null&&n.footerCell)})||(s=this.$props.cells)!=null&&s.footerCell?1:0):!this.$props.pageable&&this.$props.scrollable==="scrollable"?void 0:this.$props.groupable?-1:this._columnsMap.length+(this.$props.filterable?1:0)+t+(this.columnsRef.some(o=>{var n;return!!(o.footerCell||(n=o.cells)!=null&&n.footerCell)})||(i=this.$props.cells)!=null&&i.footerCell?1:0)},getAriaColCount(){const e=this.$props.columns,t=this.$props.columnVirtualization,s=(e==null?void 0:e.filter(i=>i.hidden!==void 0).length)!==0;if(t||s)return(e==null?void 0:e.length)!==0?e==null?void 0:e.length:-1},isVirtualScroll(){return this.$props.scrollable==="virtual"||this.$props.scrollable===void 0||!1},pinnedSourceSet(){var t,s;const e=new Set;return(t=this.gridStateContext.pinnedTopRows)!=null&&t.value&&this.gridStateContext.pinnedTopRows.value.forEach(i=>e.add(i)),(s=this.gridStateContext.pinnedBottomRows)!=null&&s.value&&this.gridStateContext.pinnedBottomRows.value.forEach(i=>e.add(i)),e},sortedPinnedTopRows(){var s,i;const e=((s=this.gridStateContext.pinnedTopRows)==null?void 0:s.value)||[],t=(i=this.gridStateContext.sort)==null?void 0:i.value;return this.autoProcessData&&(t!=null&&t.length)?re.orderBy([...e],t):e},sortedPinnedBottomRows(){var s,i;const e=((s=this.gridStateContext.pinnedBottomRows)==null?void 0:s.value)||[],t=(i=this.gridStateContext.sort)==null?void 0:i.value;return this.autoProcessData&&(t!=null&&t.length)?re.orderBy([...e],t):e},hasPinnedTopRows(){return this.$props.pinnable&&this.sortedPinnedTopRows.length>0},hasPinnedBottomRows(){return this.$props.pinnable&&this.sortedPinnedBottomRows.length>0},contextMenuColumn(){return this.columnsRef.find(e=>e.field===this.contextMenuState.field)},headMenuItems(){var t;const e=this.$props.sortable&&((t=this.contextMenuColumn)==null?void 0:t.sortable);return q.getDefaultHeadContextMenuItems({sortable:!!e,selectable:this.computedSelectable.enabled})},bodyMenuItems(){var e;return this.$props.sortable&&((e=this.contextMenuColumn)==null||e.sortable),q.getDefaultBodyContextMenuItems({selectable:this.computedSelectable.enabled,pinnable:!!this.$props.pinnable,clipboard:!!this.$props.clipboard})},contextMenuItems(){var s;const e=((s=this.contextMenuColumn)==null?void 0:s.contextMenu)||this.$props.contextMenu,t=typeof e=="function"?e(this.contextMenuState):e;if(t&&this.contextMenuState.offset){const i=this.contextMenuState.dataItem?D.GridContextMenuAnchorPart.body:D.GridContextMenuAnchorPart.head,o=t[i],n=this.contextMenuState.dataItem?this.bodyMenuItems:this.headMenuItems;let r;return o===!0||o===void 0?r=n:o!==!1&&(r=o),this.$props.pinnable&&r&&this.contextMenuState.dataItem?this.filterPinContextMenuItems(r):r}}},methods:{getCellPositionStyle(e,t){return e.left!==void 0?t?{left:e.right+"px",right:e.left+"px"}:{left:e.left+"px",right:e.right+"px"}:{}},handleContextMenuOpen(e,t,s){e.preventDefault(),this.contextMenuState={show:!0,offset:{left:e.pageX,top:e.pageY},dataItem:t,field:s}},handleContextMenuClose(){this.contextMenuState={show:!1,offset:{left:0,top:0},dataItem:void 0,field:void 0}},inActiveElement(){var o;if(!l.canUseDOM)return!1;const e=document==null?void 0:document.activeElement;let t=document==null?void 0:document.body;e!=null&&e.matches(".k-table-td")&&(t=e);const s=t==null?void 0:t.closest(".k-grid-container"),i=t&&((o=this._element)==null?void 0:o.contains(t));return!!(t&&i&&s)},handleClipboardEvent(e,t,s,i,o){var c,g,u;if(!this.inActiveElement()&&!s||!e)return;const n={type:e,nativeEvent:t,columns:this.columnsRef,dataItemKey:this.$props.dataItemKey||"",dataItem:i,field:o,...typeof this.$props.clipboard!="boolean"?this.$props.clipboard:{},...s},r=this.getLeafDataItems(),d=f.populateClipboardData({event:n,data:r,selectedState:(u=(g=this.$props.select)!=null?g:(c=this.gridStateContext.select)==null?void 0:c.value)!=null?u:{},previousCopiedItems:this.previousCopiedItems});e!==f.ClipboardActionType.paste&&(this.previousCopiedItems=d.copiedItems),l.hasListener.call(this,"clipboard")&&this.$emit("clipboard",{...n,...d})},handleContextMenuSelect(e){this.handleContextMenuItemClick({event:e,dataItem:this.contextMenuState.dataItem,field:this.contextMenuState.field})},renderContextMenu(){var e;return a.createVNode(q.GridContextMenu,{show:!!(this.contextMenuState.show&&((e=this.contextMenuItems)!=null&&e.length)),dataItem:this.contextMenuState.dataItem,field:this.contextMenuState.field,items:this.contextMenuItems,offset:this.contextMenuState.offset,onClose:this.handleContextMenuClose,onSelect:this.handleContextMenuSelect},null)},filterPinContextMenuItems(e){var c,g;const t=this.$props.dataItemKey||"",s=this.contextMenuState.dataItem,i=((c=this.gridStateContext.pinnedTopRows)==null?void 0:c.value)||[],o=((g=this.gridStateContext.pinnedBottomRows)==null?void 0:g.value)||[],n=t?s[t]:void 0,r=n!==void 0&&i.some(u=>u[t]===n),d=n!==void 0&&o.some(u=>u[t]===n);return e.map(u=>{const p=typeof u=="string"?q.contextMenuItemsMap[u]:u;return(p==null?void 0:p.name)===D.GridContextMenuItemNames.pinRow&&p.items?{...p,items:p.items.filter(m=>m.name===D.GridContextMenuItemNames.pinTop?!r:m.name===D.GridContextMenuItemNames.pinBottom?!d:m.name===D.GridContextMenuItemNames.unpin?r||d:!0)}:u})},handleContextMenuItemClick(e){var i,o,n,r,d,c,g,u;const t=e.event.event.item,s={event:e.event,menuItem:t,dataItem:e.dataItem,field:e.field};switch(this.$emit("contextmenuitemclick",s),(i=t.data)==null?void 0:i.action){case"SortCommand":if(this.contextMenuColumn){const p=(o=t.name)==null?void 0:o.toLowerCase().includes("asc"),R=((n=t.name)==null?void 0:n.toLowerCase().includes("desc"))?"desc":void 0,x=p?"asc":R,b=t.name?x:void 0,w=(((r=this.gridStateContext.sort)==null?void 0:r.value)||[]).filter(y=>{var I;return y.field!==((I=this.contextMenuColumn)==null?void 0:I.field)});b&&((d=this.contextMenuColumn)!=null&&d.field)&&w.push({field:this.contextMenuColumn.field,dir:b}),this.sortChangeHandler(w,{event:e.event})}break;case"SelectRowCommand":{const p=e.dataItem;if(this.computedSelectable.enabled&&p&&this.$props.dataItemKey){const R=l.getter(this.$props.dataItemKey)(p),x=this.getLeafDataItems(),b=x.findIndex(M=>M[this.$props.dataItemKey]===p[this.$props.dataItemKey]),$=0,w=this.columnsRef.length-1,y={...this.getArguments(e.event),dataItem:p,startDataItem:b,endDataItem:b,startRowIndex:b,endRowIndex:b,startColIndex:$,endColIndex:w,dataItems:x,ctrlKey:!1,altKey:!1,metaKey:!1,shiftKey:!1,isDrag:!1,mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,componentId:this.$props.id||this._gridId,selectedField:this.$props.selectedField||""},I=this.computedSelectable.mode==="multiple"?{...(g=(c=this.gridStateContext.select)==null?void 0:c.value)!=null?g:{}}:{};I[R]===!0||Array.isArray(I[R])&&I[R].length===this.columnsRef.length?delete I[R]:I[R]=this.computedSelectable.cell?[...Array(this.columnsRef.length).keys()]:!0,this.raiseSelectionEvent(y,I)}break}case"SelectAllRowsCommand":{if(this.computedSelectable.enabled&&this.$props.dataItemKey){const p=this.getLeafDataItems(),m={},R=p[0],x=p[p.length-1];p.forEach(b=>{const $=l.getter(this.$props.dataItemKey)(b);m[$]=this.computedSelectable.cell?[...Array(this.columnsRef.length).keys()]:!0}),this.raiseSelectionEvent({...this.getArguments(e.event),dataItems:p,dataItem:R,startDataItem:R,endDataItem:x,startRowIndex:0,endRowIndex:p.length-1,startColIndex:0,endColIndex:this.columnsRef.length-1,ctrlKey:!1,altKey:!1,metaKey:!1,shiftKey:!1,isDrag:!1,mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,componentId:this.$props.id||this._gridId,selectedField:this.$props.selectedField||""},m)}break}case"ClearSelectionCommand":this.computedSelectable.enabled&&this.clearSelection({...this.getArguments(e.event),dataItems:this.getLeafDataItems(),startRowIndex:-1,endRowIndex:-1,startColIndex:-1,endColIndex:-1,ctrlKey:!1,altKey:!1,metaKey:!1,shiftKey:!1,isDrag:!1,mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,componentId:this.$props.id||this._gridId,selectedField:this.$props.selectedField||""});break;case"PinTopCommand":this.handleRowPin("pinTop",e.dataItem);break;case"PinBottomCommand":this.handleRowPin("pinBottom",e.dataItem);break;case"UnpinCommand":this.handleRowPin("unpin",e.dataItem);break;case"CopySelectionCommand":this.handleClipboardEvent(f.ClipboardActionType.copy,e.event.nativeEvent,{copyHeaders:!((u=t.name)!=null&&u.toLowerCase().includes("noheaders"))},e.dataItem,e.field);break;case"PasteCommand":this.handleClipboardEvent(f.ClipboardActionType.paste,e.event.nativeEvent,{},e.dataItem,e.field);break}this.handleContextMenuClose()},triggerCellContextMenu(e,t,s){this.$emit("contextmenu",{dataItem:t,field:s,event:e}),this.$props.contextMenu&&this.handleContextMenuOpen(e,t,s)},handleIntersection(e){const t={rowIndex:this.rowIndexRef.value};e.forEach(s=>{s.boundingClientRect.height!==s.intersectionRect.height&&this.setCurrentOnTop(t)})},scrollIntoView(e){var i;if(!((i=this.vsRef)!=null&&i.container)||this.$props.scrollable==="none")return;const{rowIndex:t}=e;this.rowIndexRef.value=t;const s=this._element;if(this.observerRef&&s){this.observerRef.disconnect();const o=s.querySelector(`[absolute-row-index="${this.rowIndexRef.value}"]`);o?this.observerRef.observe(o):this.setCurrentOnTop(e)}},setCurrentOnTop(e){var i,o;if(!((i=this.vsRef)!=null&&i.container)||this.$props.scrollable==="none")return;this.observerRef&&this.observerRef.disconnect();const{rowIndex:t}=e,s=this._element;if(this.isVirtualScroll){const n=((o=this.vsRef.rowHeightService)==null?void 0:o.offset(t))||0;this.vsRef.container.scroll(0,n)}else if(s){const n=t<1?s.querySelector("tbody > tr:nth-child(1)"):s.querySelector(`tbody > tr:nth-child(${t+1})`);n&&this.containerElementRef&&(this.containerElementRef.scrollTop=n.offsetTop)}},getTotal(){let e=this.$props.total||0;return Array.isArray(this.$props.dataItems)?e=e||this.$props.dataItems.length:this.$props.dataItems&&(e=e||this.$props.dataItems.total),e},readColumnElements(){return v.readColumns(this.$props.columns,this.currentColumnsState,{prevId:0,idPrefix:this.idPrefix})},getResolvedFlatColumnsState(){const e=[],t=(s,i)=>s==null?void 0:s.forEach(o=>{const n=o.hidden||i;e.push({...o,hidden:n}),t(o.children,n)});return t(this.currentColumnsState,!1),e},filterColumns(e){const t=this.getResolvedFlatColumnsState();return[e.filter(s=>{var i;return!s.hidden&&!((i=t.find(o=>o.id===s.id))!=null&&i.hidden)}),e.filter(s=>{var i;return s.hidden||((i=t.find(o=>o.id===s.id))==null?void 0:i.hidden)})]},getFlatData(e,t,s,i,o,n,r){const d=[],c=v.flatData(d,e,t,{index:s},i!==void 0,o,n,this.groupExpandable.defaultExpand,r,this.$props.expandField);return{flattedData:d,resolvedGroupsCount:c}},getColumnsEssentialProps(e){return e&&JSON.stringify(e.map(t=>({id:t.id,field:t.field,title:t.title,children:t.children})))},calculateMedia(){const e=this.filterHiddenColumns(this.$props.columns||[]);this.getColumnsEssentialProps(this.notHiddenColumns)!==this.getColumnsEssentialProps(e)&&this.$forceUpdate()},filterHiddenColumns(e){if(!e||e.length===0)return e;const t=s=>({...s,children:s.children&&s.children.length>0?this.filterHiddenColumns(s.children):s.children});return[...e].filter(s=>!s.hidden).filter(s=>l.canUseDOM&&s&&s.media?window.matchMedia(s.media).matches:s).map(s=>t(s))},getColumns(){const e=this.columnsRef.filter(s=>s.declarationIndex>=0&&s.parentIndex===-1),t=s=>(s.sort((i,o)=>i.declarationIndex-o.declarationIndex),s.map(i=>{const{declarationIndex:o,parentIndex:n,depth:r,colSpan:d,rowSpan:c,index:g,kFirst:u,children:p,...m}=i;return p.length?{children:t(p),...m}:m}));return t(e)},setRefs(){var n,r,d,c;let e="$el";const t=l.getRef(this,"gridNav");t&&(this._element=t[e]);const s=l.getRef(this,"groupPanelDiv");if(s){let g=s[e]||null;this.dragLogic.refGroupPanelDiv(g)}this.stickyHeaderRef=l.getRef(this,"stickyHeader"),this.stickyFooterRef=l.getRef(this,"stickyFooter"),this.pinnedTopRef=l.getRef(this,"pinnedTop"),this.pinnedBottomRef=l.getRef(this,"pinnedBottom");const i=l.getRef(this,"dropElementClue"),o=l.getRef(this,"dragElementClue");this.dragLogic.refDropElementClue(i),this.dragLogic.refDragElementClue(o),this.columnResize.colGroupMain=l.getRef(this,"colGroup"),this.columnResize.colGroupStickyHeader=(n=this.stickyHeaderRef)==null?void 0:n.colGroupRef,this.columnResize.colGroupStickyFooter=(r=this.stickyFooterRef)==null?void 0:r.colGroupRef,this.columnResize.colGroupPinnedTop=(d=this.pinnedTopRef)==null?void 0:d.colGroupRef,this.columnResize.colGroupPinnedBottom=(c=this.pinnedBottomRef)==null?void 0:c.colGroupRef,this._header=l.getRef(this,"header"),this._footer=l.getRef(this,"footer"),this.resetTableWidth(),l.setScrollbarWidth()},gridUnmounted(){clearTimeout(this.forceUpdateTimeout),this.columnResize.columns=[],this.dragLogic.columns=[],this.dragLogic&&this.dragLogic.dragElementClue&&(this.dragLogic.dragElementClue.$el.remove(),this.dragLogic.dropElementClue.$el.remove()),this.dataRef=[],this.columnsRef=[],document!=null&&document.body&&this.resizeObserver&&this.resizeObserver.disconnect(),this.observerRef&&(this.observerRef.disconnect(),this.observerRef=null),this.clipboardServiceRef&&(this.clipboardServiceRef.removeEventListeners(document),this.clipboardServiceRef=null)},isAllData(){const{dataItems:e,total:t}=this.$props;return Array.isArray(e)?e.length===t:e?t===e.total:!1},resetVirtualSkip(){this.isVirtualScroll&&this.virtualSkipRef&&(this.virtualSkipRef=0)},virtualPageChange(e,t){var i;const s=(i=this.gridStateContext.group)==null?void 0:i.value;this.$props.pageable||s!=null&&s.length?(this.virtualSkipRef=e.skip,this.$forceUpdate()):this.pageChangeHandler(e,t)},initializeVirtualization(){const e=this.vsRef,t=this.$props.rowHeight||this._minRowHeightRef||0;this.tableBodyRef=l.getRef(this,"tableBody"),this.scrollTableRef=l.getComponentElementRef(this,"table"),e&&(e.fixedScroll=this.$props.fixedScroll||!1,e.PageChange=this.virtualPageChange,e.pageSize=this._virtualPageSize,e.scrollableVirtual=this.isVirtualScroll,this.scrollContainerRef=e.container=l.getRef(this,"scrollContainer"),e.tableBody=this.tableBodyRef,e.scrollHeightContainer=l.getRef(this,"scrollHeightContainer"),e.table=this.scrollTableRef,(!e.rowHeightService||e.total!==this._virtualTotal)&&t&&(e.total=this._virtualTotal,e.rowHeightService=new l.RowHeightService(this._virtualTotal,t)))},setContainerHeight(){const e=l.getRef(this,"scrollContainer");this._containerHeightRef=(e==null?void 0:e.offsetHeight)||0},setMinRowHeight(){if(!this._minRowHeightRef&&!this.$props.rowHeight){const t=v.calcRowHeight(l.getRef(this,"tableBody"));t&&(this._minRowHeightRef=t,this.$forceUpdate())}},onRowHeightChanged(e,t){this.setRefs()},onHeaderScroll(e){const s=e.target.scrollLeft,i=l.getRef(this,"scrollContainer");i&&(i.scrollLeft=s),this.scrollLeftRef=s},scrollHandler(e){clearTimeout(this.forceUpdateTimeout);const t=e.currentTarget.scrollLeft,s=e.currentTarget.scrollTop;this.$props.columnVirtualization&&(!this.isVirtualScroll||s===this.wrapperScrollTopRef)&&(this.forceUpdateTimeout=setTimeout(()=>{this.$forceUpdate()},0)),this.scrollLeftRef=t,this._header&&this._header.setScrollLeft(e.currentTarget.scrollLeft),this._footer&&this._footer.setScrollLeft(e.currentTarget.scrollLeft),this.stickyHeaderRef&&this.stickyHeaderRef.setScrollLeft(e.currentTarget.scrollLeft),this.stickyFooterRef&&this.stickyFooterRef.setScrollLeft(e.currentTarget.scrollLeft),this.pinnedTopRef&&this.pinnedTopRef.setScrollLeft(t),this.pinnedBottomRef&&this.pinnedBottomRef.setScrollLeft(t),this.vsRef&&s!==this.wrapperScrollTopRef&&this.vsRef.scrollHandler(e);const i=this.virtualSkipRef;this.vsRef&&s!==this.wrapperScrollTopRef&&this.vsRef.scrollHandler(e);const o=this.isVirtualScroll&&this.virtualSkipRef!==i;if(this.$emit("scroll",e),this.wrapperScrollTopRef=s,!o){const n=this.updateStickyGroups();this.sticky.headerItems=n==null?void 0:n.stickyHeaderItems,this.sticky.footerItems=n==null?void 0:n.stickyFooterItems}},rowClick(e,t){e.target.type!=="checkbox"&&this.$emit("rowclick",{dataItem:t.dataItem,...this.getArguments(e)})},rowDoubleClick(e,t){e.target.type!=="checkbox"&&this.$emit("rowdblclick",{dataItem:t.dataItem,...this.getArguments(e)})},loopGroupedItems(e,t,s=0,i=null){return e.forEach(o=>{!i&&t(o,s)&&(i=o),o.items&&o.items.length&&!i&&(i=this.loopGroupedItems(o.items,t,s+1,i))}),i},updateGroupCollapsed(e){let t=this.computedCollapsed,s=t[e.level];const i=this.$props.uniqueField,o=function(d,c){return d.value===e.dataItem.value&&c===e.level},n=this.allGroupedItems?this.loopGroupedItems(this.allGroupedItems.data,o,0,null):e.dataItem,r=v.groupedFirstItemValue(n||e.dataItem,i);if(e.value){if(s&&s.length){const d=s.indexOf(r);d>-1&&s.splice(d,1)}}else s?s.includes(r)||s.push(r):s=[r];return t},itemChange(e){var i;const t=l.hasListener.call(this,"itemchange"),s=(i=this.gridStateContext.group)==null?void 0:i.value;if(e.field===this.$props.expandField||(s||this.$props.detail)&&e.field===void 0){l.hasListener.call(this,"expandchange")&&e.dataItem&&this.$emit("expandchange",{...this.getArguments(e.event),collapsedGroups:this.updateGroupCollapsed(e),dataItem:e.dataItem,value:e.value});return}t&&this.$emit("itemchange",{...this.getArguments(e.event),dataItem:e.dataItem,field:e.field,value:e.value})},cellClickHandler(e){this.$emit("cellclick",{dataItem:e.dataItem,field:e.field})},cellKeydownHandler(e){this.$emit("cellkeydown",e)},editHandler(e){this.$emit("edit",{dataItem:e})},removeHandler(e){this.$emit("remove",{dataItem:e})},saveHandler(e){this.$emit("save",{dataItem:e})},cancelHandler(e){this.$emit("cancel",{dataItem:e})},selectionChangeHandler(e){var t,s,i;if(this.computedSelectable.enabled){const{event:o,dataItem:n,dataIndex:r,columnIndex:d}=e,c={...this.getArguments(o),dataItem:n,startColIndex:d,endColIndex:d,startRowIndex:r,endRowIndex:r,dataItems:this.getLeafDataItems(),altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,isDrag:!1,componentId:this.$props.id||this._gridId,selectedField:this.$props.selectedField||""};this.gridStateContext.selectionchange({...c,select:this.$props.dataItemKey?f.getSelectedState({event:c,selectedState:(i=(s=this.$props.select)!=null?s:(t=this.gridStateContext.select)==null?void 0:t.value)!=null?i:{},dataItemKey:this.$props.dataItemKey}):{}})}},onKeyboardSelectionChangeHandler(e){var g,u;if(!this.computedSelectable.enabled||!this.$props.dataItemKey)return;const t=(g=this.gridStateContext.select)==null?void 0:g.value,s={dataItems:this.getLeafDataItems(),mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,componentId:this.$props.id,selectedField:"",...this.getArguments(e)},i=f.getSelectedStateFromKeyDown({event:s,selectedState:t!=null?t:{},dataItemKey:this.$props.dataItemKey});if(i===t)return;const o=e.target,n=f.closestTagName(o,"TD"),r=f.closestTagName(o,"TR"),d=f.getColumnIndex(n),c=f.getRowIndex(r);if(d!==void 0&&c!==void 0){const p=(u=v.getDataAsArray(this.$props.dataItems))==null?void 0:u[c];this.gridStateContext.selectionchange({...s,select:i,dataItem:p,startRowIndex:c,startColIndex:d,startDataItem:p,endDataItem:p,endRowIndex:c,endColIndex:d,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey,isDrag:!1})}},onHeaderSelectionChangeHandler(e){if(this.computedSelectable.enabled){const t=this.getLeafDataItems();this.gridStateContext.headerselectionchange({select:e.event.target.checked?t.reduce((s,i)=>(this.$props.dataItemKey&&l.getter(this.$props.dataItemKey)(i)!==void 0&&(s[l.getter(this.$props.dataItemKey)(i)]=!0),s),{}):{},field:e.field,event:e.event,target:this,dataItems:t})}},selectionRelease(e){var t,s,i;if(this.computedSelectable.enabled){const o=this.getLeafDataItems(),n=o[e.startRowIndex],r=o[e.endRowIndex],d={event:void 0,target:this,selectedField:"",componentId:this.$props.id||this._gridId,dataItems:o,dataItem:null,startDataItem:n,endDataItem:r,...e},c=f.getSelectedState({event:d,selectedState:(i=(s=this.$props.select)!=null?s:(t=this.gridStateContext.select)==null?void 0:t.value)!=null?i:{},dataItemKey:this.$props.dataItemKey});this.raiseSelectionEvent(d,c)}},clearSelection(e){this.computedSelectable.enabled&&this.raiseSelectionEvent(e,{})},raiseSelectionEvent(e,t){this.computedSelectable.enabled&&this.gridStateContext.selectionchange({...e,select:t})},moveToNextPage(e){var o,n,r,d;const t=(r=(n=(o=this.gridStateContext.take)==null?void 0:o.value)!=null?n:this.$props.pageSize)!=null?r:0,s=(((d=this.gridStateContext.skip)==null?void 0:d.value)||0)+t,i=this.getTotal();s<i&&this.pageChangeHandler({skip:s,take:t},e)},moveToPrevPage(e){var i,o,n,r;const t=(n=(o=(i=this.gridStateContext.take)==null?void 0:i.value)!=null?o:this.$props.pageSize)!=null?n:0,s=(((r=this.gridStateContext.skip)==null?void 0:r.value)||0)-t;s>=0&&this.pageChangeHandler({skip:s,take:t},e)},pageChangeHandler(e,t){this.raiseDataEvent("pagechange",{page:e,event:t},{skip:e.skip,take:e.take},t)},sortChangeHandler(e,t){this.raiseDataEvent("sortchange",{sort:e},{sort:e},t)},filterChangeHandler(e,t){this.raiseDataEvent("filterchange",{filter:e},{filter:e,skip:0},t)},groupChangeHandler(e,t){this.raiseDataEvent("groupchange",{group:e},{group:e,skip:0},t)},handleDetailExpandAction(e,t){var s;if(this.detailExpandable.enabled){const i=(s=this.gridStateContext.detailExpand)==null?void 0:s.value,o=f.detailExpandReducer(i!=null?i:{},e);this.gridStateContext.detailexpandchange({...this.getArguments(t),detailExpand:o})}},handleGroupExpandAction(e,t){var s;if(this.groupExpandable.enabled){const i=(s=this.gridStateContext.groupExpand)==null?void 0:s.value,o=f.groupExpandReducer(i!=null?i:[],e,this.groupExpandable);this.$props.expandField||this.gridStateContext.groupexpandchange({...this.getArguments(t),groupExpand:o})}this.scrollToStickyGroup(e.group)},raiseDataEvent(e,t,s,i){if(this.resetVirtualSkip(),this.$props.autoProcessData)this.gridStateContext[e]({...this.getArguments(i),...t});else if(l.hasListener.call(this,e))this.$emit(e,{...this.getArguments(i),...t});else if(l.hasListener.call(this,"datastatechange")){const o={...this.getDataState(),...s};this.gridStateContext.datastatechange({...this.getArguments(i),data:o,dataState:o})}},columnReorder(e,t,s){const i=this.columnsRef[e],o=v.getFlatColumnsState(this.currentColumnsState),n=i.depth,r=u=>{do u++;while(u<this.columnsRef.length&&this.columnsRef[u].depth>n);return u},d=this.columnsRef.splice(e,r(e)-e);this.columnsRef.splice(e<t?r(t-d.length):t,0,...d),this.columnsRef.filter(u=>u.declarationIndex>=0).forEach((u,p)=>{u.orderIndex=p;const m=o.find(R=>R.id===u.id);m&&(m.orderIndex=p)});const c=this.columnsRef[e].locked&&this.columnsRef[t].locked;f.updateLeft(this._columnsMap,this.columnsRef,c||this.shouldUpdateLeftRightRef),f.updateRight(this._columnsMap,this.columnsRef,c||this.shouldUpdateLeftRightRef),this.resizedRef&&(this.shouldUpdateLeftRightRef=!1,this.resizedRef=!1);const g=this.getColumns();this.$emit("columnreorder",{target:this,columns:g,event:s,prev:e,next:t}),this.gridStateContext.columnsstatechange({columnsState:this.currentColumnsState})},groupReorder(e,t,s){var o;const i=(o=this.gridStateContext.group)==null?void 0:o.value;i!==void 0&&(i.splice(t,0,...i.splice(e,1)),this.groupChangeHandler(i,s))},columnToGroup(e,t,s){var n;const i=this.columnsRef[e].field;if(!i)return;const o=(((n=this.gridStateContext.group)==null?void 0:n.value)||[]).slice();o.splice(t,0,{field:i}),this.groupChangeHandler(o,s)},resetTableWidth(){var i;let e=0;if(!this.columnResize.colGroupMain)return;const t=(i=this.columnResize.colGroupMain)==null?void 0:i.children;for(let o=0;o<t.length;o++){const n=t[o].width;if(!n)return;e+=parseFloat(n.toString())}e=Math.round(e),this._header&&this._header.setWidth(e),this._footer&&this._footer.setWidth(e),this.stickyHeaderRef&&this.stickyHeaderRef.setWidth(e),this.stickyFooterRef&&this.stickyFooterRef.setWidth(e),this.pinnedTopRef&&this.pinnedTopRef.setWidth(e),this.pinnedBottomRef&&this.pinnedBottomRef.setWidth(e);const s=l.getComponentElementRef(this,"table");s&&e&&(s.style.width=e+"px"),this.stickyFooterRef&&this.setStickyFooterOffset()},setStickyFooterOffset(){const e=this.containerElementRef,t=e?e.scrollWidth>e.clientWidth:!1;this.stickyFooterRef&&(this.stickyFooterRef.$el.style.marginBlockEnd=t?"var(--kendo-scrollbar-width, 0px)":"")},onResize(e,t,s,i,o,n,r){this.resetTableWidth(),this.shouldUpdateLeftRightRef=!0,this.resizedRef=!0,this.$emit("columnresize",{columns:this.getColumns(),index:e,targetColumnId:r,event:i,newWidth:t,oldWidth:s,end:o,target:this}),o&&this.gridStateContext.columnsstatechange({columnsState:n})},initColumnsState(e,t){const s=i=>{var n;const o=t.find(r=>r.id===i.id);if(o){const r={...o};return r.children=(n=i.children)==null?void 0:n.map(s),r}return i};this.currentColumnsState=e.filter(i=>i.parentIndex===-1).map(s)},configureColumns(e,t){e.filter(n=>n.columnType==="checkbox").forEach(n=>{n.width=n.width||"50px",n.defaultCell=a.markRaw(Pe.GridSelectionCell),n.defaultHeaderCell=a.markRaw(Ve.GridHeaderSelectionCell),n._type="edit",n.columnMenu=!1}),this.$props.selectedField&&this.columnsRef.filter(n=>n.field===this.$props.selectedField).forEach(n=>{n.width=n.width||"50px",n.defaultCell=a.markRaw(Pe.GridSelectionCell),n.defaultHeaderCell=a.markRaw(Ve.GridHeaderSelectionCell),n.columnMenu=!1}),this.$props.pinnable&&e.filter(n=>n.columnType==="pin").forEach(n=>{n.width=n.width||"48px",n.defaultCell=a.markRaw(St.GridPinCell),n.defaultHeaderCell=a.markRaw(f.HeaderCell),n.sortable=!1,n.filterable=!1,n.editable=!1});const s=v.getFlatColumnsState(this.currentColumnsState);this.initColumnsState(e,s);const i={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;if(this.detailExpandable.enabled&&this.$props.detail&&!this.$props.expandField){const n={...i,_type:"expand",id:f.tableKeyboardNavigationTools.generateNavigatableId(`${o++}`,"expand","column"),defaultCell:a.markRaw(De.GridHierarchyCell),field:this.detailExpandable.column,headerClassName:this.hierarchClass};e.unshift(n),this.currentColumnsState.unshift(s.find(r=>r.id===n.id)||n)}this.$props.expandField&&l.hasListener.call(this,"expandchange")&&this.$props.detail&&(e.unshift({...i,defaultCell:a.markRaw(De.GridHierarchyCell),field:this.$props.expandField,headerClassName:"k-hierarchy-cell k-header",id:f.tableKeyboardNavigationTools.generateNavigatableId(`${e.length}`,this.idPrefix,"column"),...this.expandColumn}),o++);for(let n=0;n<t;n++){const r={...i,isAccessible:!1,defaultCell:a.markRaw(ze.GridGroupCell),id:f.tableKeyboardNavigationTools.generateNavigatableId(`${o++}`,"group","column"),field:"value",locked:this.$props.lockGroups,columnMenu:!1};e.unshift(r),this.currentColumnsState.unshift(s.find(d=>d.id===r.id)||r)}e.slice(o).forEach(n=>{n.parentIndex>=0&&(n.parentIndex+=o),n.rowSpannable=n.rowSpannable!==void 0?v.getRowSpanOptions(n.rowSpannable):this.computedRowSpannable})},initColumns(e,t){var n;this.columnsRef=this.readColumnElements();const s=(n=this.gridStateContext.group)==null?void 0:n.value;this.columnsRef.filter(r=>!r.hidden).length===0&&(this.columnsRef=v.autoGenerateColumns(e,s,{column:this.$props.expandField?this.$props.expandField:this.groupExpandable.column},{prevId:0,idPrefix:this.idPrefix})),this.configureColumns(this.columnsRef,t);const[i,o]=this.filterColumns(this.columnsRef);this.columnsRef=i,this.hiddenColumnsRef=o,this._columnsMap=v.mapColumns(this.columnsRef,!0)},resolveTitle(e){const t=this.findColumnByField(e),s=t&&(t.title||t.field);return s===void 0?e:s},findColumnByField(e){let t;return this.$props.columns.forEach(s=>{const i=this.searchColumn(s,e);i&&(t=i)}),t},searchColumn(e,t){if(e.field===t)return e;if(e.children){let s,i=null;for(s=0;i==null&&s<e.children.length;s++)i=this.searchColumn(e.children[s],t);return i}return null},getDataState(){var n,r,d,c,g;const e=(n=this.gridStateContext.sort)==null?void 0:n.value,t=(r=this.gridStateContext.filter)==null?void 0:r.value,s=(d=this.gridStateContext.skip)==null?void 0:d.value,i=(c=this.gridStateContext.take)==null?void 0:c.value,o=(g=this.gridStateContext.group)==null?void 0:g.value;return{filter:t,sort:e,skip:s,take:i!==void 0?i:this.$props.pageSize,group:o}},getArguments(e){return{event:e,target:this}},getLeafDataItems(){return this.dataRef.filter(e=>e.rowType==="data").map(e=>e.dataItem)},totalGroupedRows(e){let t=0;return e&&(t=this.addSubItems(e,t)),t},addSubItems(e,t){return e.forEach(s=>{t++,s.expanded!==!1&&s.items&&(t=this.addSubItems(s.items,t)),this.group&&this.group.length&&(this.$props.groupable.footer==="always"||s.expanded!==!1&&s.items&&this.$props.groupable.footer==="visible")&&t++}),t},searchChange(e){const t=this.$props.searchFields||this.columnsRef.map(o=>o.field)||[],s=e.event.target.value,i={logic:"or",filters:t.filter(o=>o!==void 0).map(o=>{var n;return typeof o=="string"?{field:o,value:s,operator:"contains"}:{value:s,operator:(n=o.operator)!=null?n:"contains",field:o.field,ignoreCase:o.ignoreCase}})};this.raiseDataEvent("searchchange",{search:i},{skip:0},e)},getCellsToRender(e,t){var n;const s=[];let i=null,o=0;if(t.forEach((r,d)=>{const c=parseFloat((r.width||"").toString())||10;if(o){o--,i&&(i.width+=c);return}const g=Math.min(v.getColSpan(r,e),t.length-d);o=g-1,i={width:c,colSpan:g,columnIndex:d},s.push(i)}),this.$props.columnVirtualization){const r=this.scrollLeftRef||0,d=this.tableWidth||parseFloat((((n=this.$attrs.style)==null?void 0:n.width)||"").toString());return Rt.getVirtualCellsToRender({cellModels:s,columns:t,tableViewPortWidth:d,scrollLeft:r})}return s},calcVirtualPageSize(){const{pageable:e,take:t,pageSize:s}=this.$props;if(!this.isVirtualScroll)return 0;if(!e){if(t)return t;if(s)return s}const i=this.$props.rowHeight||this._minRowHeightRef,o=this._containerHeightRef;return o&&i?Math.ceil(o/i*1.5):0},getRowPinPosition(e){var n,r;const{dataItemKey:t=""}=this.$props,s=((n=this.gridStateContext.pinnedTopRows)==null?void 0:n.value)||[],i=((r=this.gridStateContext.pinnedBottomRows)==null?void 0:r.value)||[];if(!t||!e)return"none";const o=e[t];return s!=null&&s.some(d=>d[t]===o)?"top":i!=null&&i.some(d=>d[t]===o)?"bottom":"none"},handleRowPin(e,t){var g,u,p,m;if(!this.$props.pinnable)return;const{dataItemKey:s=""}=this.$props,i=((g=this.gridStateContext.pinnedTopRows)==null?void 0:g.value)||[],o=((u=this.gridStateContext.pinnedBottomRows)==null?void 0:u.value)||[],n=t[s],r=i.filter(R=>R[s]!==n),d=o.filter(R=>R[s]!==n);let c;switch(e){case"pinTop":c={pinnedTopRows:[...r,t],pinnedBottomRows:d,dataItem:t};break;case"pinBottom":c={pinnedTopRows:r,pinnedBottomRows:[...d,t],dataItem:t};break;case"unpin":c={pinnedTopRows:r,pinnedBottomRows:d,dataItem:t};break;default:return}(m=(p=this.gridStateContext).rowpinchange)==null||m.call(p,c)},pinnedSelectionRelease(e,t){const s=this.$props.dataItemKey;if(!s||!t)return;const i=l.getter(s),o=this.getLeafDataItems().findIndex(n=>i(n)===i(t));o!==-1&&this.selectionRelease({...e,startRowIndex:o,endRowIndex:o})}},provide(){return{gridContext:{dataItemKey:this.$props.dataItemKey,searchChange:this.searchChange,selectionRelease:this.selectionRelease,pinnedSelectionRelease:this.pinnedSelectionRelease,dispatchGroupExpand:this.handleGroupExpandAction,dispatchDetailExpand:this.handleDetailExpandAction,scrollToStickyGroup:this.scrollToStickyGroup,getCellPositionStyle:this.getCellPositionStyle,onRowPin:this.handleRowPin,getRowPinPosition:this.getRowPinPosition,onContextMenu:this.triggerCellContextMenu},sticky:this.sticky}},setup(e){const t=a.ref(null),s=a.ref(null),i=a.ref(null),o=a.ref(null),n=a.ref(null),r=a.ref(null),d=a.ref(null),c=a.ref([]),g=a.ref([]),u=a.ref(null),p=a.ref(null),m=a.ref(null),R=a.ref(null),x=a.ref(null),b=a.ref(null),$=a.ref(!0),w=a.ref(!1),y=new dt.VirtualScroll,I=a.ref(0),M=a.inject(mt.KendoKey,{}),O=typeof e.groupable=="object"&&!!e.groupable.stickyHeaders,W=typeof e.groupable=="object"&&!!e.groupable.stickyFooters,T=a.ref([]),U=a.computed(()=>{var N,_;return!!((_=(N=M.group)==null?void 0:N.value)!=null&&_.length)}),F=null,G=a.ref(void 0),H=a.ref({headerItems:[],footerItems:[]}),{scrollToStickyGroup:L,update:K}=bt.useStickyGroups({enabled:O,enabledFooters:W,flatData:T,containerRef:u,stickyHeaderRef:p,stickyFooterRef:m,tableBodyRef:b,rowHeight:e.rowHeight,isGrouped:U,virtualSkipRef:I,rowHeightServiceRef:a.computed(()=>y==null?void 0:y.rowHeightService)});return{rowIndexRef:G,observerRef:F,dataRef:T,groupPanelDivRef:t,dropElementClueRef:s,dragElementClueRef:i,headerRef:o,footerRef:n,gridNavRef:r,colGroupRef:d,scrollContainerRef:u,tableBodyRef:b,gridStateContext:M,shouldUpdateLeftRightRef:$,resizedRef:w,currentColumnsState:e.columnsState,vsRef:y,virtualSkipRef:I,stickyHeaderItems:c,stickyHeaderRef:p,stickyFooterItems:g,stickyFooterRef:m,pinnedTopRef:R,pinnedBottomRef:x,sticky:H,scrollToStickyGroup:L,updateStickyGroups:K}},render(){var ue,fe,ge,me,Re,Ce,be,Se,Ie,xe,we,ve,$e,ye,ke,He,Te,Me;const e=(ue=this.gridStateContext.sort)==null?void 0:ue.value,t=(fe=this.gridStateContext.filter)==null?void 0:fe.value,s=(ge=this.gridStateContext.search)==null?void 0:ge.value,i=(me=this.gridStateContext.select)==null?void 0:me.value,o=(Re=this.gridStateContext.skip)==null?void 0:Re.value,n=(Ce=this.gridStateContext.take)==null?void 0:Ce.value,r=(be=this.gridStateContext.group)==null?void 0:be.value,d=(Se=this.gridStateContext.groupExpand)==null?void 0:Se.value,c=(Ie=this.gridStateContext.detailExpand)==null?void 0:Ie.value,g=(r==null?void 0:r.length)||0,u=typeof this.$props.groupable=="object"&&!!this.$props.groupable.stickyHeaders,p=typeof this.$props.groupable=="object"&&!!this.$props.groupable.stickyFooters,m=!!(r!=null&&r.length);let R;this.currentColumnsState=(xe=this.gridStateContext.columnsState)==null?void 0:xe.value;const x=this.$props.autoProcessData===!0?{group:!0,sort:!0,filter:!0,search:!0,page:!0}:this.$props.autoProcessData;let b;const $=f.tableKeyboardNavigationTools.getIdPrefix(this.navigation);let w=[];Array.isArray(this.$props.dataItems)?(w=this.$props.dataItems,b=(we=this.$props.total)!=null?we:w.length):(w=((ve=v.applyExpandedState(this.$props.dataItems,this.$props.collapsedGroups.length?this.computedCollapsed:[],this.$props.uniqueField))==null?void 0:ve.data)||[],b=(ke=(ye=this.$props.total)!=null?ye:($e=this.$props.dataItems)==null?void 0:$e.total)!=null?ke:w.length);const y=this.$props.groupable===!0||l.isObject(this.$props.groupable)&&this.$props.groupable.enabled!==!1;this.dragLogic.reorderable=this.$props.reorderable||!1,this.dragLogic.groupable=y,this._virtualPageSize=this.calcVirtualPageSize();const I=w.length===b,M=l.isObject(this.$props.groupable)&&this.$props.groupable.footer||"none";if(x){const h=x.page&&!(this.isVirtualScroll&&!this.$props.pageable),{data:S,total:k}=re.process(w,{group:x.group?r:void 0,sort:x.sort?e:void 0,filter:f.combineFilters(x.filter?t:void 0,x.search?s:void 0),...h?{take:this.$props.pageable?n||10:n,skip:o||0}:{}});w=S,b=(He=this.$props.total)!=null?He:k}const{resolvedGroupsCount:O,flattedData:W}=this.getFlatData(w,M,I?0:this.$props.skip||0,r,c,d,this.$props.dataItemKey);this.dataRef=W;const T=this.virtualSkipRef||0;if(this._virtualTotal=b,this.isVirtualScroll){let h=o||0;if((m||this.$props.pageable)&&(h=T,this._virtualTotal=this.dataRef.length),I||m||this.$props.pageable)if(this._virtualPageSize===0){const S=Math.min(n||this.$props.pageSize||20,this.dataRef.length);R=this.dataRef.slice(h,h+S)}else R=this.dataRef.slice(h,h+this._virtualPageSize)}this.initializeVirtualization();const U=(Te=this.selectable)!=null&&Te.drag?"none":void 0;this.initColumns(this.$props.dataItems,O),this.columnResize.resizable=this.$props.resizable||!1,this.columnResize.columns=this.columnsRef,this.columnResize.columnsState=l.cloneArray(this.currentColumnsState||[]),this.dragLogic.columns=this.columnsRef;const F=this.$props.toolbar,G=this.$props.noRecords,H=this.columnsRef.filter(h=>h.children.length===0),L=y&&a.createVNode(ot.GroupPanel,{ref:h=>{this.groupPanelDivRef=h},group:r||[],ariaControls:this._gridRoleElementId,onGroupChange:this.groupChangeHandler,onPressHandler:this.dragLogic.pressHandler,onDragHandler:this.dragLogic.dragHandler,onReleaseHandler:this.dragLogic.releaseHandler,resolveTitle:this.resolveTitle},null),K=(this.dragLogic.reorderable||this.dragLogic.groupable)&&l.canUseDOM&&document&&document.body,N=[K&&a.createVNode(ut.DropClue,{ref:h=>{this.dropElementClueRef=h}},null),K&&a.createVNode(pt.DragClue,{ref:h=>{this.dragElementClueRef=h}},null)],_=this.showLicenseWatermark?a.createVNode(l.WatermarkOverlay,{message:this.licenseMessage},null):null,j=this.$attrs.style,Be=j&&l.isObject(j)&&j["width"]||"";this.tableWidth=parseFloat(Be.toString());const qe=H.findIndex(h=>typeof h.colSpan=="function")>-1;let A;A=this.getCellsToRender({},H);const E=H.map(function(h,S){return a.createVNode("col",{key:h.id||`col-${S}`,width:h.width!==void 0?Math.floor(parseFloat(h.width.toString())):void 0},null)},this),ae=a.createVNode(tt.Header,{size:this.$props.size,columnResize:this.columnResize,staticHeaders:this.$props.scrollable!=="none",ref:h=>{this.headerRef=h},onHeaderscroll:this.onHeaderScroll,headerRow:a.createVNode(st.HeaderRow,{grid:this,sort:e,groupable:this.$props.groupable,reorderable:this.$props.reorderable,sortable:this.$props.sortable,onSortChange:this.sortChangeHandler,filter:t,filterable:this.$props.filterable,filterOperators:this.$props.filterOperators||Ne.operators,onFilterChange:this.filterChangeHandler,columnMenu:this.$props.columnMenu,columnMenuIcon:this.$props.columnMenuIcon,columnMenuAnimate:this.$props.columnMenuAnimate,onSelectionchange:this.onHeaderSelectionChangeHandler,columns:this.columnsRef,cellsToRender:A,columnVirtualization:this.$props.columnVirtualization,columnsInitial:this.$props.columns,columnResize:this.columnResize,onPressHandler:this.dragLogic.pressHandler,onDragHandler:this.dragLogic.dragHandler,onReleaseHandler:this.dragLogic.releaseHandler,columnsMap:this._columnsMap,cellRender:this.$props.headerCellRender,cells:this.$props.cells,isRtl:this.isRtl,isColCountDefined:this.getAriaColCount!==void 0,headerSelectionValue:!!(i&&this.dataRef.filter(h=>h.rowType==="data").every(h=>i&&this.$props.dataItemKey&&l.getter(this.$props.dataItemKey)(h.dataItem)!==void 0?i[l.getter(this.$props.dataItemKey)(h.dataItem)]:void 0)),filterRow:this.$props.filterable&&a.createVNode(it.FilterRow,{grid:this,size:this.$props.size,columns:this.columnsRef,columnsMap:this._columnsMap,cellsToRender:A,columnVirtualization:this.$props.columnVirtualization,filter:t,filterOperators:this.$props.filterOperators||Ne.operators,onFilterchange:this.filterChangeHandler,sort:this.$props.sort,cellRender:this.$props.filterCellRender,cells:this.$props.cells,isRtl:this.isRtl,ariaRowIndex:this._columnsMap.length+1},null)||void 0},null),cols:E},null),le=this.columnsRef.some(h=>{var S;return!!(h.footerCell||(S=h.cells)!=null&&S.footerCell)})||(Me=this.$props.cells)!=null&&Me.footerCell?a.createVNode(nt.Footer,{size:this.$props.size,columnResize:this.columnResize,staticHeaders:this.$props.scrollable!=="none",ref:h=>{this.footerRef=h},row:a.createVNode(rt.FooterRow,{isRtl:this.isRtl,rowIndex:this.getAriaRowCount+1,columns:this.columnsRef,cells:this.$props.cells},null),cols:E},null):a.createVNode("span",null,null),z={leafColumns:H,cellsToRender:A,selectedField:this.$props.selectedField,dataItemKey:this.$props.dataItemKey,select:i,highlight:this.$props.highlight,editField:this.$props.editField,cellRender:this.$props.cellRender,cells:this.$props.cells,getCellsToRender:this.getCellsToRender,hasDynamicColSpan:qe,itemChange:this.itemChange,selectionChangeHandler:this.selectionChangeHandler,editHandler:this.editHandler,removeHandler:this.removeHandler,saveHandler:this.saveHandler,cancelHandler:this.cancelHandler,cellClickHandler:this.cellClickHandler,cellKeydownHandler:this.cellKeydownHandler,computedCollapsed:this.computedCollapsed,uniqueField:this.$props.uniqueField,columnsRef:this.columnsRef,isRtl:this.isRtl,idPrefix:$},Oe=function(h,S,k,Z,ee){return Ct.getRowContents(z,h,S,k,Z,ee)};let We=0,J=[];const Q=!this.dataRef.length,de=h=>h>=this.dataRef.length-We;let X=0;if(this.dataRef.length){const h=this._columnsMap.length+(this.$props.filterable?1:0)+1;let S=this.$props.skip||0,k=-1,Z=0;const ee=this.computedRowSpannable.enabled?{}:void 0;if(this.isVirtualScroll){if(T>0){const C=this.dataRef.slice(0,T).filter(V=>V.rowType==="data").length;k+=C,S+=T}!this.$props.pageable&&I&&(k+=this.$props.skip||0)}J=(R||this.dataRef).map(function(C,V){C.rowType==="data"&&k++;const te=C.dataIndex%2!==0,Ge=this.$props.dataItemKey&&l.getter(this.$props.dataItemKey)(C.dataItem),se=V+S,ie=Ge||"ai"+se,oe=ie+"_1",B=Oe.call(this,C,ie,k,te,ee),Qe=C.rowType==="data"?this.pinnedSourceSet.has(C.dataItem):!1,Xe=H.length-(this.detailExpandable.enabled?1:0)-((r==null?void 0:r.length)||0)||1;return X=se+h+Z,[a.createVNode(ft.GridRow,{key:ie,item:C,dataIndex:k,ariaRowIndex:X,absoluteRowIndex:se,isAltRow:te,isHidden:de(V),rowHeight:this.$props.rowHeight,isSelected:B.isSelected,isHighlighted:B.isHighlighted,isInEdit:B.isInEdit,rowType:C.rowType,onRowclick:P=>this.rowClick(P,C),onRowdblclick:P=>this.rowDoubleClick(P,C),render:this.$props.rowRender,class:this.$props.rowClass?this.$props.rowClass(C):"",isPinned:Qe,rows:this.$props.rows},{default:()=>[B.row]}),this.$props.detail&&C.rowType==="data"&&(C.expanded||C.dataItem.expanded)&&a.createVNode("tr",{key:oe,class:te?"k-table-row k-table-alt-row k-detail-row":"k-table-row k-detail-row",style:{visibility:de(V)?"hidden":"",height:this.$props.detailRowHeight+"px"},role:"row","aria-rowindex":X},[r==null?void 0:r.map(function(P){return a.createVNode(ze.GridGroupCell,{id:"",dataIndex:C.dataIndex,field:P.field,dataItem:C.dataItem,key:`group-${P.field}-${C.dataIndex}`,locked:this.$props.lockGroups,group:C.group},null)},this),(this.$props.expandField||this.detailExpandable.enabled)&&a.createVNode(Ze.GridDetailHierarchyCell,{id:f.tableKeyboardNavigationTools.generateNavigatableId(`${oe}-dhcell`,$)},null),a.createVNode(et.GridDetailCell,{dataItem:C.dataItem,dataIndex:C.dataIndex,colSpan:Xe,ariaColIndex:2+(r?r.length:0),detail:this.$props.detail?this.$props.detail:void 0,id:f.tableKeyboardNavigationTools.generateNavigatableId(`${oe}-dcell`,$)},null)])]},this)}const Ue=this.$props.pageable&&a.createVNode(f.Pager,{class:"k-grid-pager",onPagesizechange:this.pageChangeHandler,onPagechange:this.pageChangeHandler,size:this.$props.size,total:b,skip:o||0,pageSize:(n!==void 0?n:this.$props.pageSize)||10,messagesMap:Ke.pagerMessagesMap,settings:f.normalize(this.$props.pageable||{})},null),he=l.getTemplate.call(this,{h:a.h,template:this.$props.pager,defaultRendering:Ue,additionalProps:{...this.$props,skip:this.$props.skip||0,messagesMap:Ke.pagerMessagesMap},additionalListeners:{pagesizechange:this.pageChangeHandler,pagechange:this.pageChangeHandler}}),je=h=>e&&e.filter(S=>S.field===h).length>0,ce=a.createVNode("colgroup",{ref:l.setRef(this,"colGroup")},[H.map(function(h,S){return a.createVNode("col",{key:h.id||`col-${S}`,class:je(h.field)?"k-sorted":void 0,width:h.width!==void 0?h.width.toString().indexOf("%")!==-1?h.width:Math.floor(parseFloat(h.width.toString()))+"px":void 0},null)},this)]),pe={height:this.getCorrectHeight,...this.$attrs.style},Je=a.createVNode("div",{class:"k-loading-mask"},[a.createVNode("div",{class:"k-loading-color"},null),a.createVNode("div",{style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},[a.createVNode(Ye.Loader,{size:"large",type:"converging-spinner"},null)])]),Y=this.$props.showLoader&&l.getTemplate.call(this,{h:a.h,template:this.$props.loader,defaultRendering:Je});return this.$props.scrollable==="none"?a.createVNode(a.Fragment,null,[a.createVNode(f.TableKeyboardNavigationProvider,{ref:"navRef",id:this._gridId,navigatable:this.$props.navigatable,scrollable:this.$props.scrollable,columnVirtualization:this.$props.columnVirtualization},{default:()=>[a.createVNode(Ee.GridNav,{ref:h=>{this.gridNavRef=h},columnsRef:this.columnsRef,dataRef:this.dataRef,id:this.$props.id,dir:this.$props.dir,style:pe,class:this.nonscrollableWrapperClass,onMovetonextpage:this.moveToNextPage,onMovetoprevpage:this.moveToPrevPage,onColumnreorder:this.columnReorder,onKeyboardselectionchange:this.onKeyboardSelectionChangeHandler},{default:()=>[F,L,a.createVNode("div",{role:"grid",class:"k-grid-aria-root",id:this._gridRoleElementId,"aria-colcount":this.getAriaColCount,"aria-rowcount":this.getAriaRowCount},[a.createVNode(at.GridTable,{selectable:this.computedSelectable,class:"k-table",ref:l.setRef(this,"table")},{default:()=>[ce,ae,a.createVNode("tbody",{class:"k-table-tbody","data-keyboardnavbody":!0,ref:l.setRef(this,"tableBody")},[J,a.createTextVNode(" "),Y]),le]}),Q&&a.createVNode(Le.GridNoRecordsContainer,{id:f.tableKeyboardNavigationTools.generateNavigatableId("no-records",$)},{default:()=>[G.length?G:a.createVNode(Fe.GridNoRecords,null,null)]})]),he,Y,N]})]}),this.renderContextMenu()]):a.createVNode(a.Fragment,null,[a.createVNode(f.TableKeyboardNavigationProvider,{ref:"navRef",id:this._gridId,navigatable:this.$props.navigatable,scrollable:this.$props.scrollable,columnVirtualization:this.$props.columnVirtualization},{default:()=>[a.createVNode(Ee.GridNav,{ref:h=>{this.gridNavRef=h},dataRef:this.dataRef,id:this.$props.id,dir:this.$props.dir,style:pe,class:this.scrollableWrapperClass,onMovetonextpage:this.moveToNextPage,onMovetoprevpage:this.moveToPrevPage,onColumnreorder:this.columnReorder,onKeyboardselectionchange:this.onKeyboardSelectionChangeHandler,onSetcurrentontop:this.setCurrentOnTop},{default:()=>[F,L,a.createVNode("div",{role:"grid",class:"k-grid-aria-root",id:this._gridRoleElementId,"aria-colcount":this.getAriaColCount,"aria-rowcount":this.getAriaRowCount},[ae,this.hasPinnedTopRows&&a.createVNode(Ae.PinnedRowsTable,{ref:l.setRef(this,"pinnedTop"),size:this.$props.size,cols:E,dataRowContext:z,position:"top",pinnedItems:this.sortedPinnedTopRows,rowHeight:this.$props.rowHeight,rows:this.$props.rows,selectable:this.computedSelectable},null),a.createVNode("div",{class:"k-grid-container",role:"presentation"},[m&&u&&a.createVNode(_e.StickyGroupTable,{ref:l.setRef(this,"stickyHeader"),size:this.$props.size,cols:E,dataRowContext:z,position:"top",groupLevelCount:g,rowHeight:this.$props.rowHeight},null),a.createVNode("div",{role:"presentation",ref:l.setRef(this,"scrollContainer"),class:"k-grid-content k-virtual-content",onScroll:this.scrollHandler},[a.createVNode("div",{class:"k-grid-table-wrap",role:"presentation"},[a.createVNode(lt.GridTableScrollable,{selectable:this.computedSelectable,tableClassName:this.gridTableClass,tableStyle:{userSelect:U},ref:l.setRef(this,"table")},{default:()=>[ce,a.createVNode("tbody",{class:"k-table-tbody",role:"rowgroup","data-keyboardnavbody":!0,ref:l.setRef(this,"tableBody")},[J])]}),Q&&a.createVNode(Le.GridNoRecordsContainer,{id:f.tableKeyboardNavigationTools.generateNavigatableId("no-records",$)},{default:()=>[G.length?G:a.createVNode(Fe.GridNoRecords,null,null)]})]),!Q&&a.createVNode("div",{class:"k-height-container",role:"presentation"},[a.createVNode("div",{ref:l.setRef(this,"scrollHeightContainer"),style:this.$props.scrollable==="virtual"?{height:this._containerHeightRef+"px"}:{}},null)])]),m&&p&&a.createVNode(_e.StickyGroupTable,{ref:l.setRef(this,"stickyFooter"),size:this.$props.size,cols:E,dataRowContext:z,position:"bottom",groupLevelCount:g,rowHeight:this.$props.rowHeight},null)]),this.hasPinnedBottomRows&&a.createVNode(Ae.PinnedRowsTable,{ref:l.setRef(this,"pinnedBottom"),size:this.$props.size,cols:E,dataRowContext:z,position:"bottom",pinnedItems:this.sortedPinnedBottomRows,rowHeight:this.$props.rowHeight,rows:this.$props.rows,selectable:this.computedSelectable},null),le,_]),he,Y,N]})]}),this.renderContextMenu()])}});exports.Grid=It;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),l=require("@progress/kendo-vue-common"),f=require("@progress/kendo-vue-data-tools"),Ye=require("@progress/kendo-vue-indicators"),Ee=require("./GridNav.js"),Pe=require("./cells/GridSelectionCell.js"),De=require("./cells/GridHierarchyCell.js"),Ze=require("./cells/GridDetailHierarchyCell.js"),et=require("./cells/GridDetailCell.js"),tt=require("./header/Header.js"),st=require("./header/HeaderRow.js"),it=require("./header/FilterRow.js"),ot=require("./header/GroupPanel.js"),nt=require("./footer/Footer.js"),rt=require("./footer/FooterRow.js"),at=require("./components/table/GridTable.js"),lt=require("./components/table/GridTableScrollable.js"),Ne=require("./filterCommon.js"),dt=require("./VirtualScroll.js"),ht=require("./drag/ColumnResize.js"),ct=require("./drag/CommonDragLogic.js"),pt=require("./drag/DragClue.js"),ut=require("./drag/DropClue.js"),w=require("./utils/main.js"),ze=require("./cells/GridGroupCell.js"),ft=require("./rows/GridRow.js"),gt=require("./common.js"),Ve=require("./header/GridHeaderSelectionCell.js"),Fe=require("./components/noRecords/GridNoRecords.js"),Le=require("./components/noRecords/GridNoRecordsContainer.js"),ne=require("./package-metadata.js"),Ke=require("./messages/messagesMap.js"),re=require("@progress/kendo-data-query"),mt=require("./key.js"),Rt=require("./utils/virtualColumns.js"),_e=require("./components/StickyGroupTable.js"),Ct=require("./getRowContents.js"),bt=require("./hooks/useStickyGroups.js"),Ae=require("./components/PinnedRowsTable.js"),St=require("./cells/pincell/GridPinCell.js"),q=require("./contextMenu/GridContextMenu.js"),D=require("./contextMenu/enums.js"),It=a.defineComponent({name:"KendoGrid",inheritAttrs:!1,props:{...gt.gridProps,toolbar:{type:Object},noRecords:{type:Object}},data(){return{isRtl:!1,context:void 0,navigation:void 0,showLicenseWatermark:!1,licenseMessage:void 0,notHiddenColumns:[],contextMenuState:{show:!1,offset:{left:0,top:0},dataItem:void 0,field:void 0}}},watch:{clipboard:function(e){e?this.clipboardServiceRef||(this.clipboardServiceRef=new f.ClipboardService(this.handleClipboardEvent),this.clipboardServiceRef.addEventListeners(document)):this.clipboardServiceRef&&(this.clipboardServiceRef.removeEventListeners(document),this.clipboardServiceRef=null)},rowHeight:function(e,t){var s;this.onRowHeightChanged(e,t),(s=this.vsRef)==null||s.reset()},scrollable:function(){var e;(e=this.vsRef)==null||e.reset()},filter:function(){var e;(e=this.vsRef)==null||e.reset()},group:function(){var e;(e=this.vsRef)==null||e.reset()},currentGroupable:function(){var e;(e=this.vsRef)==null||e.reset()},sort:function(){var e;(e=this.vsRef)==null||e.reset()}},created(){l.validatePackage(ne.packageMetadata),this.showLicenseWatermark=l.shouldShowValidationUI(ne.packageMetadata),this.licenseMessage=l.getLicenseMessage(ne.packageMetadata),this.initialHeight=null,this.columnsRef=[],this.dragLogic=new ct.CommonDragLogic(this.columnReorder.bind(this),this.groupReorder.bind(this),this.columnToGroup.bind(this)),this.columnResize=new ht.ColumnResize(this.onResize.bind(this)),this._columnsMap=[[]],this._header=null,this._footer=null,this.tableRef=null,this.scrollHeightContainerRef=null,this.forceUpdateTimeout=void 0,this._gridId=l.guid(),this._gridRoleElementId=l.guid(),this.slicedCurrentData=void 0,this._prevTotal=void 0,this._containerHeightRef=0,this._minRowHeightRef=0,this.wrapperScrollTopRef=0,this.scrollLeftRef=0,this.previousCopiedItems=[],this.clipboardServiceRef=null},mounted(){var t,s;this.setRefs();const e=l.isRtl(this._element);if(this._prevTotal=this.$props.total,this.isRtl=e,this.initialHeight=((s=(t=this._element)==null?void 0:t.style)==null?void 0:s.height)||null,this.resizeObserver=l.canUseDOM&&(window==null?void 0:window.ResizeObserver)&&new ResizeObserver(this.calculateMedia),document!=null&&document.body&&this.resizeObserver&&this.resizeObserver.observe(document.body),l.canUseDOM){const i={rootMargin:"0px",threshold:.9};this.observerRef=window.IntersectionObserver&&new window.IntersectionObserver(this.handleIntersection,i)||null}this.$props.clipboard&&(this.clipboardServiceRef=new f.ClipboardService(this.handleClipboardEvent),this.clipboardServiceRef.addEventListeners(document))},updated(){var s;this.setRefs();const e=l.isRtl(this._element);this.isRtl=e,this._prevTotal=this.$props.total,this.vsRef.tableTransform&&this.vsRef.table&&(this.vsRef.table.style.transform=this.vsRef.tableTransform,this.vsRef.tableTransform="");const t=this.updateStickyGroups();this.sticky.headerItems=t==null?void 0:t.stickyHeaderItems,this.sticky.footerItems=t==null?void 0:t.stickyFooterItems,this.isVirtualScroll&&(this.setContainerHeight(),this.setMinRowHeight(),(s=this.vsRef)==null||s.update())},unmounted(){this.gridUnmounted()},computed:{gridId(){return this.$props.id+"-role-element-id"},idPrefix(){return this.$props.navigatable?this.gridId:""},groupExpandable(){return f.getGroupExpandableOptions(typeof this.$props.groupable=="object"&&this.$props.groupable.enabled!==!1?this.$props.groupable.expandable:this.$props.groupable)},hierarchClass(){return l.uGrid.hierarchyCell({})},computedRowSpannable(){return w.getRowSpanOptions(this.$props.rowSpannable)},computedSelectable(){return f.getSelectionOptions(this.$props.selectable)},detailExpandable(){return f.getDetailExpandableOptions(!!this.$props.detail)},nonscrollableWrapperClass(){const{size:e}=this.$props,t=this.$attrs.class;return{"k-grid":!0,"k-grid-md":!e,[`k-grid-${l.kendoThemeMaps.sizeMap[e]||e}`]:e,[t]:!!t}},scrollableWrapperClass(){const{scrollable:e}=this.$props;return{...this.nonscrollableWrapperClass,"k-grid-virtual":e==="virtual"}},gridTableClass(){const{size:e}=this.$props;return{"k-table":!0,"k-grid-table":!0,"k-grid-md":!e,[`k-table-${l.kendoThemeMaps.sizeMap[e]||e}`]:e}},getCorrectHeight(){return this.$props.scrollable==="virtual"?this.initialHeight||"450px":null},currentGroupable(){var t;const e=(t=this.gridStateContext.group)==null?void 0:t.value;return this.$props.groupable===!0&&(e==null?void 0:e.length)||l.isObject(this.$props.groupable)&&this.$props.groupable.enabled!==!1},computedCollapsed(){let e=[];if(this.$props.group)for(let t=0;t<this.$props.group.length;t++)this.$props.collapsedGroups[t]?e.push(this.$props.collapsedGroups[t]):e.push([]);return e},getAriaRowCount(){var s,i;const e=this.$props.dataItems,t=this.$props.total||(e==null?void 0:e.total)||(e==null?void 0:e.length)||0;return this.$props.detail?this._columnsMap.length+(this.$props.filterable?1:0)+t*2+(this.columnsRef.some(o=>{var n;return!!(o.footerCell||(n=o.cells)!=null&&n.footerCell)})||(s=this.$props.cells)!=null&&s.footerCell?1:0):!this.$props.pageable&&this.$props.scrollable==="scrollable"?void 0:this.$props.groupable?-1:this._columnsMap.length+(this.$props.filterable?1:0)+t+(this.columnsRef.some(o=>{var n;return!!(o.footerCell||(n=o.cells)!=null&&n.footerCell)})||(i=this.$props.cells)!=null&&i.footerCell?1:0)},getAriaColCount(){const e=this.$props.columns,t=this.$props.columnVirtualization,s=(e==null?void 0:e.filter(i=>i.hidden!==void 0).length)!==0;if(t||s)return(e==null?void 0:e.length)!==0?e==null?void 0:e.length:-1},isVirtualScroll(){return this.$props.scrollable==="virtual"||this.$props.scrollable===void 0||!1},pinnedSourceSet(){var t,s;const e=new Set;return(t=this.gridStateContext.pinnedTopRows)!=null&&t.value&&this.gridStateContext.pinnedTopRows.value.forEach(i=>e.add(i)),(s=this.gridStateContext.pinnedBottomRows)!=null&&s.value&&this.gridStateContext.pinnedBottomRows.value.forEach(i=>e.add(i)),e},sortedPinnedTopRows(){var s,i;const e=((s=this.gridStateContext.pinnedTopRows)==null?void 0:s.value)||[],t=(i=this.gridStateContext.sort)==null?void 0:i.value;return this.autoProcessData&&(t!=null&&t.length)?re.orderBy([...e],t):e},sortedPinnedBottomRows(){var s,i;const e=((s=this.gridStateContext.pinnedBottomRows)==null?void 0:s.value)||[],t=(i=this.gridStateContext.sort)==null?void 0:i.value;return this.autoProcessData&&(t!=null&&t.length)?re.orderBy([...e],t):e},hasPinnedTopRows(){return this.$props.pinnable&&this.sortedPinnedTopRows.length>0},hasPinnedBottomRows(){return this.$props.pinnable&&this.sortedPinnedBottomRows.length>0},contextMenuColumn(){return this.columnsRef.find(e=>e.field===this.contextMenuState.field)},headMenuItems(){var t;const e=this.$props.sortable&&((t=this.contextMenuColumn)==null?void 0:t.sortable);return q.getDefaultHeadContextMenuItems({sortable:!!e,selectable:this.computedSelectable.enabled})},bodyMenuItems(){var e;return this.$props.sortable&&((e=this.contextMenuColumn)==null||e.sortable),q.getDefaultBodyContextMenuItems({selectable:this.computedSelectable.enabled,pinnable:!!this.$props.pinnable,clipboard:!!this.$props.clipboard})},contextMenuItems(){var s;const e=((s=this.contextMenuColumn)==null?void 0:s.contextMenu)||this.$props.contextMenu,t=typeof e=="function"?e(this.contextMenuState):e;if(t&&this.contextMenuState.offset){const i=this.contextMenuState.dataItem?D.GridContextMenuAnchorPart.body:D.GridContextMenuAnchorPart.head,o=t[i],n=this.contextMenuState.dataItem?this.bodyMenuItems:this.headMenuItems;let r;return o===!0||o===void 0?r=n:o!==!1&&(r=o),this.$props.pinnable&&r&&this.contextMenuState.dataItem?this.filterPinContextMenuItems(r):r}}},methods:{getCellPositionStyle(e,t){return e.left!==void 0?t?{left:e.right+"px",right:e.left+"px"}:{left:e.left+"px",right:e.right+"px"}:{}},handleContextMenuOpen(e,t,s){e.preventDefault(),this.contextMenuState={show:!0,offset:{left:e.pageX,top:e.pageY},dataItem:t,field:s}},handleContextMenuClose(){this.contextMenuState={show:!1,offset:{left:0,top:0},dataItem:void 0,field:void 0}},inActiveElement(){var o;if(!l.canUseDOM)return!1;const e=document==null?void 0:document.activeElement;let t=document==null?void 0:document.body;e!=null&&e.matches(".k-table-td")&&(t=e);const s=t==null?void 0:t.closest(".k-grid-container"),i=t&&((o=this._element)==null?void 0:o.contains(t));return!!(t&&i&&s)},handleClipboardEvent(e,t,s,i,o){var c,g,u;if(!this.inActiveElement()&&!s||!e)return;const n={type:e,nativeEvent:t,columns:this.columnsRef,dataItemKey:this.$props.dataItemKey||"",dataItem:i,field:o,...typeof this.$props.clipboard!="boolean"?this.$props.clipboard:{},...s},r=this.getLeafDataItems(),d=f.populateClipboardData({event:n,data:r,selectedState:(u=(g=this.$props.select)!=null?g:(c=this.gridStateContext.select)==null?void 0:c.value)!=null?u:{},previousCopiedItems:this.previousCopiedItems});e!==f.ClipboardActionType.paste&&(this.previousCopiedItems=d.copiedItems),l.hasListener.call(this,"clipboard")&&this.$emit("clipboard",{...n,...d})},handleContextMenuSelect(e){this.handleContextMenuItemClick({event:e,dataItem:this.contextMenuState.dataItem,field:this.contextMenuState.field})},renderContextMenu(){var e;return a.createVNode(q.GridContextMenu,{show:!!(this.contextMenuState.show&&((e=this.contextMenuItems)!=null&&e.length)),dataItem:this.contextMenuState.dataItem,field:this.contextMenuState.field,items:this.contextMenuItems,offset:this.contextMenuState.offset,onClose:this.handleContextMenuClose,onSelect:this.handleContextMenuSelect},null)},filterPinContextMenuItems(e){var c,g;const t=this.$props.dataItemKey||"",s=this.contextMenuState.dataItem,i=((c=this.gridStateContext.pinnedTopRows)==null?void 0:c.value)||[],o=((g=this.gridStateContext.pinnedBottomRows)==null?void 0:g.value)||[],n=t?s[t]:void 0,r=n!==void 0&&i.some(u=>u[t]===n),d=n!==void 0&&o.some(u=>u[t]===n);return e.map(u=>{const p=typeof u=="string"?q.contextMenuItemsMap[u]:u;return(p==null?void 0:p.name)===D.GridContextMenuItemNames.pinRow&&p.items?{...p,items:p.items.filter(m=>m.name===D.GridContextMenuItemNames.pinTop?!r:m.name===D.GridContextMenuItemNames.pinBottom?!d:m.name===D.GridContextMenuItemNames.unpin?r||d:!0)}:u})},handleContextMenuItemClick(e){var i,o,n,r,d,c,g,u;const t=e.event.event.item,s={event:e.event,menuItem:t,dataItem:e.dataItem,field:e.field};switch(this.$emit("contextmenuitemclick",s),(i=t.data)==null?void 0:i.action){case"SortCommand":if(this.contextMenuColumn){const p=(o=t.name)==null?void 0:o.toLowerCase().includes("asc"),R=((n=t.name)==null?void 0:n.toLowerCase().includes("desc"))?"desc":void 0,x=p?"asc":R,b=t.name?x:void 0,v=(((r=this.gridStateContext.sort)==null?void 0:r.value)||[]).filter(y=>{var I;return y.field!==((I=this.contextMenuColumn)==null?void 0:I.field)});b&&((d=this.contextMenuColumn)!=null&&d.field)&&v.push({field:this.contextMenuColumn.field,dir:b}),this.sortChangeHandler(v,{event:e.event})}break;case"SelectRowCommand":{const p=e.dataItem;if(this.computedSelectable.enabled&&p&&this.$props.dataItemKey){const R=l.getter(this.$props.dataItemKey)(p),x=this.getLeafDataItems(),b=x.findIndex(M=>M[this.$props.dataItemKey]===p[this.$props.dataItemKey]),$=0,v=this.columnsRef.length-1,y={...this.getArguments(e.event),dataItem:p,startDataItem:b,endDataItem:b,startRowIndex:b,endRowIndex:b,startColIndex:$,endColIndex:v,dataItems:x,ctrlKey:!1,altKey:!1,metaKey:!1,shiftKey:!1,isDrag:!1,mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,componentId:this.$props.id||this._gridId,selectedField:this.$props.selectedField||""},I=this.computedSelectable.mode==="multiple"?{...(g=(c=this.gridStateContext.select)==null?void 0:c.value)!=null?g:{}}:{};I[R]===!0||Array.isArray(I[R])&&I[R].length===this.columnsRef.length?delete I[R]:I[R]=this.computedSelectable.cell?[...Array(this.columnsRef.length).keys()]:!0,this.raiseSelectionEvent(y,I)}break}case"SelectAllRowsCommand":{if(this.computedSelectable.enabled&&this.$props.dataItemKey){const p=this.getLeafDataItems(),m={},R=p[0],x=p[p.length-1];p.forEach(b=>{const $=l.getter(this.$props.dataItemKey)(b);m[$]=this.computedSelectable.cell?[...Array(this.columnsRef.length).keys()]:!0}),this.raiseSelectionEvent({...this.getArguments(e.event),dataItems:p,dataItem:R,startDataItem:R,endDataItem:x,startRowIndex:0,endRowIndex:p.length-1,startColIndex:0,endColIndex:this.columnsRef.length-1,ctrlKey:!1,altKey:!1,metaKey:!1,shiftKey:!1,isDrag:!1,mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,componentId:this.$props.id||this._gridId,selectedField:this.$props.selectedField||""},m)}break}case"ClearSelectionCommand":this.computedSelectable.enabled&&this.clearSelection({...this.getArguments(e.event),dataItems:this.getLeafDataItems(),startRowIndex:-1,endRowIndex:-1,startColIndex:-1,endColIndex:-1,ctrlKey:!1,altKey:!1,metaKey:!1,shiftKey:!1,isDrag:!1,mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,componentId:this.$props.id||this._gridId,selectedField:this.$props.selectedField||""});break;case"PinTopCommand":this.handleRowPin("pinTop",e.dataItem);break;case"PinBottomCommand":this.handleRowPin("pinBottom",e.dataItem);break;case"UnpinCommand":this.handleRowPin("unpin",e.dataItem);break;case"CopySelectionCommand":this.handleClipboardEvent(f.ClipboardActionType.copy,e.event.nativeEvent,{copyHeaders:!((u=t.name)!=null&&u.toLowerCase().includes("noheaders"))},e.dataItem,e.field);break;case"PasteCommand":this.handleClipboardEvent(f.ClipboardActionType.paste,e.event.nativeEvent,{},e.dataItem,e.field);break}this.handleContextMenuClose()},triggerCellContextMenu(e,t,s){this.$emit("contextmenu",{dataItem:t,field:s,event:e}),this.$props.contextMenu&&this.handleContextMenuOpen(e,t,s)},handleIntersection(e){const t={rowIndex:this.rowIndexRef.value};e.forEach(s=>{s.boundingClientRect.height!==s.intersectionRect.height&&this.setCurrentOnTop(t)})},scrollIntoView(e){var i;if(!((i=this.vsRef)!=null&&i.container)||this.$props.scrollable==="none")return;const{rowIndex:t}=e;this.rowIndexRef.value=t;const s=this._element;if(this.observerRef&&s){this.observerRef.disconnect();const o=s.querySelector(`[absolute-row-index="${this.rowIndexRef.value}"]`);o?this.observerRef.observe(o):this.setCurrentOnTop(e)}},setCurrentOnTop(e){var i,o;if(!((i=this.vsRef)!=null&&i.container)||this.$props.scrollable==="none")return;this.observerRef&&this.observerRef.disconnect();const{rowIndex:t}=e,s=this._element;if(this.isVirtualScroll){const n=((o=this.vsRef.rowHeightService)==null?void 0:o.offset(t))||0;this.vsRef.container.scroll(0,n)}else if(s){const n=t<1?s.querySelector("tbody > tr:nth-child(1)"):s.querySelector(`tbody > tr:nth-child(${t+1})`);n&&this.containerElementRef&&(this.containerElementRef.scrollTop=n.offsetTop)}},getTotal(){let e=this.$props.total||0;return Array.isArray(this.$props.dataItems)?e=e||this.$props.dataItems.length:this.$props.dataItems&&(e=e||this.$props.dataItems.total),e},readColumnElements(){return w.readColumns(this.$props.columns,this.currentColumnsState,{prevId:0,idPrefix:this.idPrefix})},getResolvedFlatColumnsState(){const e=[],t=(s,i)=>s==null?void 0:s.forEach(o=>{const n=o.hidden||i;e.push({...o,hidden:n}),t(o.children,n)});return t(this.currentColumnsState,!1),e},filterColumns(e){const t=this.getResolvedFlatColumnsState();return[e.filter(s=>{var i;return!s.hidden&&!((i=t.find(o=>o.id===s.id))!=null&&i.hidden)}),e.filter(s=>{var i;return s.hidden||((i=t.find(o=>o.id===s.id))==null?void 0:i.hidden)})]},getFlatData(e,t,s,i,o,n,r){const d=[],c=w.flatData(d,e,t,{index:s},i!==void 0,o,n,this.groupExpandable.defaultExpand,r,this.$props.expandField);return{flattedData:d,resolvedGroupsCount:c}},getColumnsEssentialProps(e){return e&&JSON.stringify(e.map(t=>({id:t.id,field:t.field,title:t.title,children:t.children})))},calculateMedia(){const e=this.filterHiddenColumns(this.$props.columns||[]);this.getColumnsEssentialProps(this.notHiddenColumns)!==this.getColumnsEssentialProps(e)&&this.$forceUpdate()},filterHiddenColumns(e){if(!e||e.length===0)return e;const t=s=>({...s,children:s.children&&s.children.length>0?this.filterHiddenColumns(s.children):s.children});return[...e].filter(s=>!s.hidden).filter(s=>l.canUseDOM&&s&&s.media?window.matchMedia(s.media).matches:s).map(s=>t(s))},getColumns(){const e=this.columnsRef.filter(s=>s.declarationIndex>=0&&s.parentIndex===-1),t=s=>(s.sort((i,o)=>i.declarationIndex-o.declarationIndex),s.map(i=>{const{declarationIndex:o,parentIndex:n,depth:r,colSpan:d,rowSpan:c,index:g,kFirst:u,children:p,...m}=i;return p.length?{children:t(p),...m}:m}));return t(e)},setRefs(){var n,r,d,c;let e="$el";const t=l.getRef(this,"gridNav");t&&(this._element=t[e]);const s=l.getRef(this,"groupPanelDiv");if(s){let g=s[e]||null;this.dragLogic.refGroupPanelDiv(g)}this.stickyHeaderRef=l.getRef(this,"stickyHeader"),this.stickyFooterRef=l.getRef(this,"stickyFooter"),this.pinnedTopRef=l.getRef(this,"pinnedTop"),this.pinnedBottomRef=l.getRef(this,"pinnedBottom");const i=l.getRef(this,"dropElementClue"),o=l.getRef(this,"dragElementClue");this.dragLogic.refDropElementClue(i),this.dragLogic.refDragElementClue(o),this.columnResize.colGroupMain=l.getRef(this,"colGroup"),this.columnResize.colGroupStickyHeader=(n=this.stickyHeaderRef)==null?void 0:n.colGroupRef,this.columnResize.colGroupStickyFooter=(r=this.stickyFooterRef)==null?void 0:r.colGroupRef,this.columnResize.colGroupPinnedTop=(d=this.pinnedTopRef)==null?void 0:d.colGroupRef,this.columnResize.colGroupPinnedBottom=(c=this.pinnedBottomRef)==null?void 0:c.colGroupRef,this._header=l.getRef(this,"header"),this._footer=l.getRef(this,"footer"),this.resetTableWidth(),l.setScrollbarWidth()},gridUnmounted(){clearTimeout(this.forceUpdateTimeout),this.columnResize.columns=[],this.dragLogic.columns=[],this.dragLogic&&this.dragLogic.dragElementClue&&(this.dragLogic.dragElementClue.$el.remove(),this.dragLogic.dropElementClue.$el.remove()),this.dataRef=[],this.columnsRef=[],document!=null&&document.body&&this.resizeObserver&&this.resizeObserver.disconnect(),this.observerRef&&(this.observerRef.disconnect(),this.observerRef=null),this.clipboardServiceRef&&(this.clipboardServiceRef.removeEventListeners(document),this.clipboardServiceRef=null)},isAllData(){const{dataItems:e,total:t}=this.$props;return Array.isArray(e)?e.length===t:e?t===e.total:!1},resetVirtualSkip(){this.isVirtualScroll&&this.virtualSkipRef&&(this.virtualSkipRef=0)},virtualPageChange(e,t){var i;const s=(i=this.gridStateContext.group)==null?void 0:i.value;this.$props.pageable||s!=null&&s.length?(this.virtualSkipRef=e.skip,this.$forceUpdate()):this.pageChangeHandler(e,t)},initializeVirtualization(){const e=this.vsRef,t=this.$props.rowHeight||this._minRowHeightRef||0;this.tableBodyRef=l.getRef(this,"tableBody"),this.scrollTableRef=l.getComponentElementRef(this,"table"),e&&(e.fixedScroll=this.$props.fixedScroll||!1,e.PageChange=this.virtualPageChange,e.pageSize=this._virtualPageSize,e.scrollableVirtual=this.isVirtualScroll,this.scrollContainerRef=e.container=l.getRef(this,"scrollContainer"),e.tableBody=this.tableBodyRef,e.scrollHeightContainer=l.getRef(this,"scrollHeightContainer"),e.table=this.scrollTableRef,(!e.rowHeightService||e.total!==this._virtualTotal)&&t&&(e.total=this._virtualTotal,e.rowHeightService=new l.RowHeightService(this._virtualTotal,t)))},setContainerHeight(){const e=l.getRef(this,"scrollContainer");this._containerHeightRef=(e==null?void 0:e.offsetHeight)||0},setMinRowHeight(){if(!this._minRowHeightRef&&!this.$props.rowHeight){const t=w.calcRowHeight(l.getRef(this,"tableBody"));t&&(this._minRowHeightRef=t,this.$forceUpdate())}},onRowHeightChanged(e,t){this.setRefs()},onHeaderScroll(e){const s=e.target.scrollLeft,i=l.getRef(this,"scrollContainer");i&&(i.scrollLeft=s),this.scrollLeftRef=s},scrollHandler(e){clearTimeout(this.forceUpdateTimeout);const t=e.currentTarget.scrollLeft,s=e.currentTarget.scrollTop;this.$props.columnVirtualization&&(!this.isVirtualScroll||s===this.wrapperScrollTopRef)&&(this.forceUpdateTimeout=setTimeout(()=>{this.$forceUpdate()},0)),this.scrollLeftRef=t,this._header&&this._header.setScrollLeft(e.currentTarget.scrollLeft),this._footer&&this._footer.setScrollLeft(e.currentTarget.scrollLeft),this.stickyHeaderRef&&this.stickyHeaderRef.setScrollLeft(e.currentTarget.scrollLeft),this.stickyFooterRef&&this.stickyFooterRef.setScrollLeft(e.currentTarget.scrollLeft),this.pinnedTopRef&&this.pinnedTopRef.setScrollLeft(t),this.pinnedBottomRef&&this.pinnedBottomRef.setScrollLeft(t),this.vsRef&&s!==this.wrapperScrollTopRef&&this.vsRef.scrollHandler(e);const i=this.virtualSkipRef;this.vsRef&&s!==this.wrapperScrollTopRef&&this.vsRef.scrollHandler(e);const o=this.isVirtualScroll&&this.virtualSkipRef!==i;if(this.$emit("scroll",e),this.wrapperScrollTopRef=s,!o){const n=this.updateStickyGroups();this.sticky.headerItems=n==null?void 0:n.stickyHeaderItems,this.sticky.footerItems=n==null?void 0:n.stickyFooterItems}},rowClick(e,t){e.target.type!=="checkbox"&&this.$emit("rowclick",{dataItem:t.dataItem,...this.getArguments(e)})},rowDoubleClick(e,t){e.target.type!=="checkbox"&&this.$emit("rowdblclick",{dataItem:t.dataItem,...this.getArguments(e)})},loopGroupedItems(e,t,s=0,i=null){return e.forEach(o=>{!i&&t(o,s)&&(i=o),o.items&&o.items.length&&!i&&(i=this.loopGroupedItems(o.items,t,s+1,i))}),i},updateGroupCollapsed(e){let t=this.computedCollapsed,s=t[e.level];const i=this.$props.uniqueField,o=function(d,c){return d.value===e.dataItem.value&&c===e.level},n=this.allGroupedItems?this.loopGroupedItems(this.allGroupedItems.data,o,0,null):e.dataItem,r=w.groupedFirstItemValue(n||e.dataItem,i);if(e.value){if(s&&s.length){const d=s.indexOf(r);d>-1&&s.splice(d,1)}}else s?s.includes(r)||s.push(r):s=[r];return t},itemChange(e){var i;const t=l.hasListener.call(this,"itemchange"),s=(i=this.gridStateContext.group)==null?void 0:i.value;if(e.field===this.$props.expandField||(s||this.$props.detail)&&e.field===void 0){l.hasListener.call(this,"expandchange")&&e.dataItem&&this.$emit("expandchange",{...this.getArguments(e.event),collapsedGroups:this.updateGroupCollapsed(e),dataItem:e.dataItem,value:e.value});return}t&&this.$emit("itemchange",{...this.getArguments(e.event),dataItem:e.dataItem,field:e.field,value:e.value})},cellClickHandler(e){this.$emit("cellclick",{dataItem:e.dataItem,field:e.field})},cellKeydownHandler(e){this.$emit("cellkeydown",e)},navigationActionHandler(e){this.$emit("navigationaction",e)},editHandler(e){this.$emit("edit",{dataItem:e})},removeHandler(e){this.$emit("remove",{dataItem:e})},saveHandler(e){this.$emit("save",{dataItem:e})},cancelHandler(e){this.$emit("cancel",{dataItem:e})},selectionChangeHandler(e){var t,s,i;if(this.computedSelectable.enabled){const{event:o,dataItem:n,dataIndex:r,columnIndex:d}=e,c={...this.getArguments(o),dataItem:n,startColIndex:d,endColIndex:d,startRowIndex:r,endRowIndex:r,dataItems:this.getLeafDataItems(),altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,isDrag:!1,componentId:this.$props.id||this._gridId,selectedField:this.$props.selectedField||""};this.gridStateContext.selectionchange({...c,select:this.$props.dataItemKey?f.getSelectedState({event:c,selectedState:(i=(s=this.$props.select)!=null?s:(t=this.gridStateContext.select)==null?void 0:t.value)!=null?i:{},dataItemKey:this.$props.dataItemKey}):{}})}},onKeyboardSelectionChangeHandler(e){var g,u;if(!this.computedSelectable.enabled||!this.$props.dataItemKey)return;const t=(g=this.gridStateContext.select)==null?void 0:g.value,s={dataItems:this.getLeafDataItems(),mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,componentId:this.$props.id,selectedField:"",...this.getArguments(e)},i=f.getSelectedStateFromKeyDown({event:s,selectedState:t!=null?t:{},dataItemKey:this.$props.dataItemKey});if(i===t)return;const o=e.target,n=f.closestTagName(o,"TD"),r=f.closestTagName(o,"TR"),d=f.getColumnIndex(n),c=f.getRowIndex(r);if(d!==void 0&&c!==void 0){const p=(u=w.getDataAsArray(this.$props.dataItems))==null?void 0:u[c];this.gridStateContext.selectionchange({...s,select:i,dataItem:p,startRowIndex:c,startColIndex:d,startDataItem:p,endDataItem:p,endRowIndex:c,endColIndex:d,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey,isDrag:!1})}},onHeaderSelectionChangeHandler(e){if(this.computedSelectable.enabled){const t=this.getLeafDataItems();this.gridStateContext.headerselectionchange({select:e.event.target.checked?t.reduce((s,i)=>(this.$props.dataItemKey&&l.getter(this.$props.dataItemKey)(i)!==void 0&&(s[l.getter(this.$props.dataItemKey)(i)]=!0),s),{}):{},field:e.field,event:e.event,target:this,dataItems:t})}},selectionRelease(e){var t,s,i;if(this.computedSelectable.enabled){const o=this.getLeafDataItems(),n=o[e.startRowIndex],r=o[e.endRowIndex],d={event:void 0,target:this,selectedField:"",componentId:this.$props.id||this._gridId,dataItems:o,dataItem:null,startDataItem:n,endDataItem:r,...e},c=f.getSelectedState({event:d,selectedState:(i=(s=this.$props.select)!=null?s:(t=this.gridStateContext.select)==null?void 0:t.value)!=null?i:{},dataItemKey:this.$props.dataItemKey});this.raiseSelectionEvent(d,c)}},clearSelection(e){this.computedSelectable.enabled&&this.raiseSelectionEvent(e,{})},raiseSelectionEvent(e,t){this.computedSelectable.enabled&&this.gridStateContext.selectionchange({...e,select:t})},moveToNextPage(e){var o,n,r,d;const t=(r=(n=(o=this.gridStateContext.take)==null?void 0:o.value)!=null?n:this.$props.pageSize)!=null?r:0,s=(((d=this.gridStateContext.skip)==null?void 0:d.value)||0)+t,i=this.getTotal();s<i&&this.pageChangeHandler({skip:s,take:t},e)},moveToPrevPage(e){var i,o,n,r;const t=(n=(o=(i=this.gridStateContext.take)==null?void 0:i.value)!=null?o:this.$props.pageSize)!=null?n:0,s=(((r=this.gridStateContext.skip)==null?void 0:r.value)||0)-t;s>=0&&this.pageChangeHandler({skip:s,take:t},e)},pageChangeHandler(e,t){this.raiseDataEvent("pagechange",{page:e,event:t},{skip:e.skip,take:e.take},t)},sortChangeHandler(e,t){this.raiseDataEvent("sortchange",{sort:e},{sort:e},t)},filterChangeHandler(e,t){this.raiseDataEvent("filterchange",{filter:e},{filter:e,skip:0},t)},groupChangeHandler(e,t){this.raiseDataEvent("groupchange",{group:e},{group:e,skip:0},t)},handleDetailExpandAction(e,t){var s;if(this.detailExpandable.enabled){const i=(s=this.gridStateContext.detailExpand)==null?void 0:s.value,o=f.detailExpandReducer(i!=null?i:{},e);this.gridStateContext.detailexpandchange({...this.getArguments(t),detailExpand:o})}},handleGroupExpandAction(e,t){var s;if(this.groupExpandable.enabled){const i=(s=this.gridStateContext.groupExpand)==null?void 0:s.value,o=f.groupExpandReducer(i!=null?i:[],e,this.groupExpandable);this.$props.expandField||this.gridStateContext.groupexpandchange({...this.getArguments(t),groupExpand:o})}this.scrollToStickyGroup(e.group)},raiseDataEvent(e,t,s,i){if(this.resetVirtualSkip(),this.$props.autoProcessData)this.gridStateContext[e]({...this.getArguments(i),...t});else if(l.hasListener.call(this,e))this.$emit(e,{...this.getArguments(i),...t});else if(l.hasListener.call(this,"datastatechange")){const o={...this.getDataState(),...s};this.gridStateContext.datastatechange({...this.getArguments(i),data:o,dataState:o})}},columnReorder(e,t,s){const i=this.columnsRef[e],o=w.getFlatColumnsState(this.currentColumnsState),n=i.depth,r=u=>{do u++;while(u<this.columnsRef.length&&this.columnsRef[u].depth>n);return u},d=this.columnsRef.splice(e,r(e)-e);this.columnsRef.splice(e<t?r(t-d.length):t,0,...d),this.columnsRef.filter(u=>u.declarationIndex>=0).forEach((u,p)=>{u.orderIndex=p;const m=o.find(R=>R.id===u.id);m&&(m.orderIndex=p)});const c=this.columnsRef[e].locked&&this.columnsRef[t].locked;f.updateLeft(this._columnsMap,this.columnsRef,c||this.shouldUpdateLeftRightRef),f.updateRight(this._columnsMap,this.columnsRef,c||this.shouldUpdateLeftRightRef),this.resizedRef&&(this.shouldUpdateLeftRightRef=!1,this.resizedRef=!1);const g=this.getColumns();this.$emit("columnreorder",{target:this,columns:g,event:s,prev:e,next:t}),this.gridStateContext.columnsstatechange({columnsState:this.currentColumnsState})},groupReorder(e,t,s){var o;const i=(o=this.gridStateContext.group)==null?void 0:o.value;i!==void 0&&(i.splice(t,0,...i.splice(e,1)),this.groupChangeHandler(i,s))},columnToGroup(e,t,s){var n;const i=this.columnsRef[e].field;if(!i)return;const o=(((n=this.gridStateContext.group)==null?void 0:n.value)||[]).slice();o.splice(t,0,{field:i}),this.groupChangeHandler(o,s)},resetTableWidth(){var i;let e=0;if(!this.columnResize.colGroupMain)return;const t=(i=this.columnResize.colGroupMain)==null?void 0:i.children;for(let o=0;o<t.length;o++){const n=t[o].width;if(!n)return;e+=parseFloat(n.toString())}e=Math.round(e),this._header&&this._header.setWidth(e),this._footer&&this._footer.setWidth(e),this.stickyHeaderRef&&this.stickyHeaderRef.setWidth(e),this.stickyFooterRef&&this.stickyFooterRef.setWidth(e),this.pinnedTopRef&&this.pinnedTopRef.setWidth(e),this.pinnedBottomRef&&this.pinnedBottomRef.setWidth(e);const s=l.getComponentElementRef(this,"table");s&&e&&(s.style.width=e+"px"),this.stickyFooterRef&&this.setStickyFooterOffset()},setStickyFooterOffset(){const e=this.containerElementRef,t=e?e.scrollWidth>e.clientWidth:!1;this.stickyFooterRef&&(this.stickyFooterRef.$el.style.marginBlockEnd=t?"var(--kendo-scrollbar-width, 0px)":"")},onResize(e,t,s,i,o,n,r){this.resetTableWidth(),this.shouldUpdateLeftRightRef=!0,this.resizedRef=!0,this.$emit("columnresize",{columns:this.getColumns(),index:e,targetColumnId:r,event:i,newWidth:t,oldWidth:s,end:o,target:this}),o&&this.gridStateContext.columnsstatechange({columnsState:n})},initColumnsState(e,t){const s=i=>{var n;const o=t.find(r=>r.id===i.id);if(o){const r={...o};return r.children=(n=i.children)==null?void 0:n.map(s),r}return i};this.currentColumnsState=e.filter(i=>i.parentIndex===-1).map(s)},configureColumns(e,t){e.filter(n=>n.columnType==="checkbox").forEach(n=>{n.width=n.width||"50px",n.defaultCell=a.markRaw(Pe.GridSelectionCell),n.defaultHeaderCell=a.markRaw(Ve.GridHeaderSelectionCell),n._type="edit",n.columnMenu=!1}),this.$props.selectedField&&this.columnsRef.filter(n=>n.field===this.$props.selectedField).forEach(n=>{n.width=n.width||"50px",n.defaultCell=a.markRaw(Pe.GridSelectionCell),n.defaultHeaderCell=a.markRaw(Ve.GridHeaderSelectionCell),n.columnMenu=!1}),this.$props.pinnable&&e.filter(n=>n.columnType==="pin").forEach(n=>{n.width=n.width||"48px",n.defaultCell=a.markRaw(St.GridPinCell),n.defaultHeaderCell=a.markRaw(f.HeaderCell),n.sortable=!1,n.filterable=!1,n.editable=!1});const s=w.getFlatColumnsState(this.currentColumnsState);this.initColumnsState(e,s);const i={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;if(this.detailExpandable.enabled&&this.$props.detail&&!this.$props.expandField){const n={...i,_type:"expand",id:f.tableKeyboardNavigationTools.generateNavigatableId(`${o++}`,"expand","column"),defaultCell:a.markRaw(De.GridHierarchyCell),field:this.detailExpandable.column,headerClassName:this.hierarchClass};e.unshift(n),this.currentColumnsState.unshift(s.find(r=>r.id===n.id)||n)}this.$props.expandField&&l.hasListener.call(this,"expandchange")&&this.$props.detail&&(e.unshift({...i,defaultCell:a.markRaw(De.GridHierarchyCell),field:this.$props.expandField,headerClassName:"k-hierarchy-cell k-header",id:f.tableKeyboardNavigationTools.generateNavigatableId(`${e.length}`,this.idPrefix,"column"),...this.expandColumn}),o++);for(let n=0;n<t;n++){const r={...i,isAccessible:!1,defaultCell:a.markRaw(ze.GridGroupCell),id:f.tableKeyboardNavigationTools.generateNavigatableId(`${o++}`,"group","column"),field:"value",locked:this.$props.lockGroups,columnMenu:!1};e.unshift(r),this.currentColumnsState.unshift(s.find(d=>d.id===r.id)||r)}e.slice(o).forEach(n=>{n.parentIndex>=0&&(n.parentIndex+=o),n.rowSpannable=n.rowSpannable!==void 0?w.getRowSpanOptions(n.rowSpannable):this.computedRowSpannable})},initColumns(e,t){var n;this.columnsRef=this.readColumnElements();const s=(n=this.gridStateContext.group)==null?void 0:n.value;this.columnsRef.filter(r=>!r.hidden).length===0&&(this.columnsRef=w.autoGenerateColumns(e,s,{column:this.$props.expandField?this.$props.expandField:this.groupExpandable.column},{prevId:0,idPrefix:this.idPrefix})),this.configureColumns(this.columnsRef,t);const[i,o]=this.filterColumns(this.columnsRef);this.columnsRef=i,this.hiddenColumnsRef=o,this._columnsMap=w.mapColumns(this.columnsRef,!0)},resolveTitle(e){const t=this.findColumnByField(e),s=t&&(t.title||t.field);return s===void 0?e:s},findColumnByField(e){let t;return this.$props.columns.forEach(s=>{const i=this.searchColumn(s,e);i&&(t=i)}),t},searchColumn(e,t){if(e.field===t)return e;if(e.children){let s,i=null;for(s=0;i==null&&s<e.children.length;s++)i=this.searchColumn(e.children[s],t);return i}return null},getDataState(){var n,r,d,c,g;const e=(n=this.gridStateContext.sort)==null?void 0:n.value,t=(r=this.gridStateContext.filter)==null?void 0:r.value,s=(d=this.gridStateContext.skip)==null?void 0:d.value,i=(c=this.gridStateContext.take)==null?void 0:c.value,o=(g=this.gridStateContext.group)==null?void 0:g.value;return{filter:t,sort:e,skip:s,take:i!==void 0?i:this.$props.pageSize,group:o}},getArguments(e){return{event:e,target:this}},getLeafDataItems(){return this.dataRef.filter(e=>e.rowType==="data").map(e=>e.dataItem)},totalGroupedRows(e){let t=0;return e&&(t=this.addSubItems(e,t)),t},addSubItems(e,t){return e.forEach(s=>{t++,s.expanded!==!1&&s.items&&(t=this.addSubItems(s.items,t)),this.group&&this.group.length&&(this.$props.groupable.footer==="always"||s.expanded!==!1&&s.items&&this.$props.groupable.footer==="visible")&&t++}),t},searchChange(e){const t=this.$props.searchFields||this.columnsRef.map(o=>o.field)||[],s=e.event.target.value,i={logic:"or",filters:t.filter(o=>o!==void 0).map(o=>{var n;return typeof o=="string"?{field:o,value:s,operator:"contains"}:{value:s,operator:(n=o.operator)!=null?n:"contains",field:o.field,ignoreCase:o.ignoreCase}})};this.raiseDataEvent("searchchange",{search:i},{skip:0},e)},getCellsToRender(e,t){var n;const s=[];let i=null,o=0;if(t.forEach((r,d)=>{const c=parseFloat((r.width||"").toString())||10;if(o){o--,i&&(i.width+=c);return}const g=Math.min(w.getColSpan(r,e),t.length-d);o=g-1,i={width:c,colSpan:g,columnIndex:d},s.push(i)}),this.$props.columnVirtualization){const r=this.scrollLeftRef||0,d=this.tableWidth||parseFloat((((n=this.$attrs.style)==null?void 0:n.width)||"").toString());return Rt.getVirtualCellsToRender({cellModels:s,columns:t,tableViewPortWidth:d,scrollLeft:r})}return s},calcVirtualPageSize(){const{pageable:e,take:t,pageSize:s}=this.$props;if(!this.isVirtualScroll)return 0;if(!e){if(t)return t;if(s)return s}const i=this.$props.rowHeight||this._minRowHeightRef,o=this._containerHeightRef;return o&&i?Math.ceil(o/i*1.5):0},getRowPinPosition(e){var n,r;const{dataItemKey:t=""}=this.$props,s=((n=this.gridStateContext.pinnedTopRows)==null?void 0:n.value)||[],i=((r=this.gridStateContext.pinnedBottomRows)==null?void 0:r.value)||[];if(!t||!e)return"none";const o=e[t];return s!=null&&s.some(d=>d[t]===o)?"top":i!=null&&i.some(d=>d[t]===o)?"bottom":"none"},handleRowPin(e,t){var g,u,p,m;if(!this.$props.pinnable)return;const{dataItemKey:s=""}=this.$props,i=((g=this.gridStateContext.pinnedTopRows)==null?void 0:g.value)||[],o=((u=this.gridStateContext.pinnedBottomRows)==null?void 0:u.value)||[],n=t[s],r=i.filter(R=>R[s]!==n),d=o.filter(R=>R[s]!==n);let c;switch(e){case"pinTop":c={pinnedTopRows:[...r,t],pinnedBottomRows:d,dataItem:t};break;case"pinBottom":c={pinnedTopRows:r,pinnedBottomRows:[...d,t],dataItem:t};break;case"unpin":c={pinnedTopRows:r,pinnedBottomRows:d,dataItem:t};break;default:return}(m=(p=this.gridStateContext).rowpinchange)==null||m.call(p,c)},pinnedSelectionRelease(e,t){const s=this.$props.dataItemKey;if(!s||!t)return;const i=l.getter(s),o=this.getLeafDataItems().findIndex(n=>i(n)===i(t));o!==-1&&this.selectionRelease({...e,startRowIndex:o,endRowIndex:o})}},provide(){return{gridContext:{dataItemKey:this.$props.dataItemKey,searchChange:this.searchChange,selectionRelease:this.selectionRelease,pinnedSelectionRelease:this.pinnedSelectionRelease,dispatchGroupExpand:this.handleGroupExpandAction,dispatchDetailExpand:this.handleDetailExpandAction,scrollToStickyGroup:this.scrollToStickyGroup,getCellPositionStyle:this.getCellPositionStyle,onRowPin:this.handleRowPin,getRowPinPosition:this.getRowPinPosition,onContextMenu:this.triggerCellContextMenu},sticky:this.sticky}},setup(e){const t=a.ref(null),s=a.ref(null),i=a.ref(null),o=a.ref(null),n=a.ref(null),r=a.ref(null),d=a.ref(null),c=a.ref([]),g=a.ref([]),u=a.ref(null),p=a.ref(null),m=a.ref(null),R=a.ref(null),x=a.ref(null),b=a.ref(null),$=a.ref(!0),v=a.ref(!1),y=new dt.VirtualScroll,I=a.ref(0),M=a.inject(mt.KendoKey,{}),O=typeof e.groupable=="object"&&!!e.groupable.stickyHeaders,W=typeof e.groupable=="object"&&!!e.groupable.stickyFooters,T=a.ref([]),U=a.computed(()=>{var N,_;return!!((_=(N=M.group)==null?void 0:N.value)!=null&&_.length)}),F=null,G=a.ref(void 0),H=a.ref({headerItems:[],footerItems:[]}),{scrollToStickyGroup:L,update:K}=bt.useStickyGroups({enabled:O,enabledFooters:W,flatData:T,containerRef:u,stickyHeaderRef:p,stickyFooterRef:m,tableBodyRef:b,rowHeight:e.rowHeight,isGrouped:U,virtualSkipRef:I,rowHeightServiceRef:a.computed(()=>y==null?void 0:y.rowHeightService)});return{rowIndexRef:G,observerRef:F,dataRef:T,groupPanelDivRef:t,dropElementClueRef:s,dragElementClueRef:i,headerRef:o,footerRef:n,gridNavRef:r,colGroupRef:d,scrollContainerRef:u,tableBodyRef:b,gridStateContext:M,shouldUpdateLeftRightRef:$,resizedRef:v,currentColumnsState:e.columnsState,vsRef:y,virtualSkipRef:I,stickyHeaderItems:c,stickyHeaderRef:p,stickyFooterItems:g,stickyFooterRef:m,pinnedTopRef:R,pinnedBottomRef:x,sticky:H,scrollToStickyGroup:L,updateStickyGroups:K}},render(){var ue,fe,ge,me,Re,Ce,be,Se,Ie,xe,ve,we,$e,ye,ke,He,Te,Me;const e=(ue=this.gridStateContext.sort)==null?void 0:ue.value,t=(fe=this.gridStateContext.filter)==null?void 0:fe.value,s=(ge=this.gridStateContext.search)==null?void 0:ge.value,i=(me=this.gridStateContext.select)==null?void 0:me.value,o=(Re=this.gridStateContext.skip)==null?void 0:Re.value,n=(Ce=this.gridStateContext.take)==null?void 0:Ce.value,r=(be=this.gridStateContext.group)==null?void 0:be.value,d=(Se=this.gridStateContext.groupExpand)==null?void 0:Se.value,c=(Ie=this.gridStateContext.detailExpand)==null?void 0:Ie.value,g=(r==null?void 0:r.length)||0,u=typeof this.$props.groupable=="object"&&!!this.$props.groupable.stickyHeaders,p=typeof this.$props.groupable=="object"&&!!this.$props.groupable.stickyFooters,m=!!(r!=null&&r.length);let R;this.currentColumnsState=(xe=this.gridStateContext.columnsState)==null?void 0:xe.value;const x=this.$props.autoProcessData===!0?{group:!0,sort:!0,filter:!0,search:!0,page:!0}:this.$props.autoProcessData;let b;const $=f.tableKeyboardNavigationTools.getIdPrefix(this.navigation);let v=[];Array.isArray(this.$props.dataItems)?(v=this.$props.dataItems,b=(ve=this.$props.total)!=null?ve:v.length):(v=((we=w.applyExpandedState(this.$props.dataItems,this.$props.collapsedGroups.length?this.computedCollapsed:[],this.$props.uniqueField))==null?void 0:we.data)||[],b=(ke=(ye=this.$props.total)!=null?ye:($e=this.$props.dataItems)==null?void 0:$e.total)!=null?ke:v.length);const y=this.$props.groupable===!0||l.isObject(this.$props.groupable)&&this.$props.groupable.enabled!==!1;this.dragLogic.reorderable=this.$props.reorderable||!1,this.dragLogic.groupable=y,this._virtualPageSize=this.calcVirtualPageSize();const I=v.length===b,M=l.isObject(this.$props.groupable)&&this.$props.groupable.footer||"none";if(x){const h=x.page&&!(this.isVirtualScroll&&!this.$props.pageable),{data:S,total:k}=re.process(v,{group:x.group?r:void 0,sort:x.sort?e:void 0,filter:f.combineFilters(x.filter?t:void 0,x.search?s:void 0),...h?{take:this.$props.pageable?n||10:n,skip:o||0}:{}});v=S,b=(He=this.$props.total)!=null?He:k}const{resolvedGroupsCount:O,flattedData:W}=this.getFlatData(v,M,I?0:this.$props.skip||0,r,c,d,this.$props.dataItemKey);this.dataRef=W;const T=this.virtualSkipRef||0;if(this._virtualTotal=b,this.isVirtualScroll){let h=o||0;if((m||this.$props.pageable)&&(h=T,this._virtualTotal=this.dataRef.length),I||m||this.$props.pageable)if(this._virtualPageSize===0){const S=Math.min(n||this.$props.pageSize||20,this.dataRef.length);R=this.dataRef.slice(h,h+S)}else R=this.dataRef.slice(h,h+this._virtualPageSize)}this.initializeVirtualization();const U=(Te=this.selectable)!=null&&Te.drag?"none":void 0;this.initColumns(this.$props.dataItems,O),this.columnResize.resizable=this.$props.resizable||!1,this.columnResize.columns=this.columnsRef,this.columnResize.columnsState=l.cloneArray(this.currentColumnsState||[]),this.dragLogic.columns=this.columnsRef;const F=this.$props.toolbar,G=this.$props.noRecords,H=this.columnsRef.filter(h=>h.children.length===0),L=y&&a.createVNode(ot.GroupPanel,{ref:h=>{this.groupPanelDivRef=h},group:r||[],ariaControls:this._gridRoleElementId,onGroupChange:this.groupChangeHandler,onPressHandler:this.dragLogic.pressHandler,onDragHandler:this.dragLogic.dragHandler,onReleaseHandler:this.dragLogic.releaseHandler,resolveTitle:this.resolveTitle},null),K=(this.dragLogic.reorderable||this.dragLogic.groupable)&&l.canUseDOM&&document&&document.body,N=[K&&a.createVNode(ut.DropClue,{ref:h=>{this.dropElementClueRef=h}},null),K&&a.createVNode(pt.DragClue,{ref:h=>{this.dragElementClueRef=h}},null)],_=this.showLicenseWatermark?a.createVNode(l.WatermarkOverlay,{message:this.licenseMessage},null):null,j=this.$attrs.style,Be=j&&l.isObject(j)&&j["width"]||"";this.tableWidth=parseFloat(Be.toString());const qe=H.findIndex(h=>typeof h.colSpan=="function")>-1;let A;A=this.getCellsToRender({},H);const E=H.map(function(h,S){return a.createVNode("col",{key:h.id||`col-${S}`,width:h.width!==void 0?Math.floor(parseFloat(h.width.toString())):void 0},null)},this),ae=a.createVNode(tt.Header,{size:this.$props.size,columnResize:this.columnResize,staticHeaders:this.$props.scrollable!=="none",ref:h=>{this.headerRef=h},onHeaderscroll:this.onHeaderScroll,headerRow:a.createVNode(st.HeaderRow,{grid:this,sort:e,groupable:this.$props.groupable,reorderable:this.$props.reorderable,sortable:this.$props.sortable,onSortChange:this.sortChangeHandler,filter:t,filterable:this.$props.filterable,filterOperators:this.$props.filterOperators||Ne.operators,onFilterChange:this.filterChangeHandler,columnMenu:this.$props.columnMenu,columnMenuIcon:this.$props.columnMenuIcon,columnMenuAnimate:this.$props.columnMenuAnimate,onSelectionchange:this.onHeaderSelectionChangeHandler,columns:this.columnsRef,cellsToRender:A,columnVirtualization:this.$props.columnVirtualization,columnsInitial:this.$props.columns,columnResize:this.columnResize,onPressHandler:this.dragLogic.pressHandler,onDragHandler:this.dragLogic.dragHandler,onReleaseHandler:this.dragLogic.releaseHandler,columnsMap:this._columnsMap,cellRender:this.$props.headerCellRender,cells:this.$props.cells,isRtl:this.isRtl,isColCountDefined:this.getAriaColCount!==void 0,headerSelectionValue:!!(i&&this.dataRef.filter(h=>h.rowType==="data").every(h=>i&&this.$props.dataItemKey&&l.getter(this.$props.dataItemKey)(h.dataItem)!==void 0?i[l.getter(this.$props.dataItemKey)(h.dataItem)]:void 0)),filterRow:this.$props.filterable&&a.createVNode(it.FilterRow,{grid:this,size:this.$props.size,columns:this.columnsRef,columnsMap:this._columnsMap,cellsToRender:A,columnVirtualization:this.$props.columnVirtualization,filter:t,filterOperators:this.$props.filterOperators||Ne.operators,onFilterchange:this.filterChangeHandler,sort:this.$props.sort,cellRender:this.$props.filterCellRender,cells:this.$props.cells,isRtl:this.isRtl,ariaRowIndex:this._columnsMap.length+1},null)||void 0},null),cols:E},null),le=this.columnsRef.some(h=>{var S;return!!(h.footerCell||(S=h.cells)!=null&&S.footerCell)})||(Me=this.$props.cells)!=null&&Me.footerCell?a.createVNode(nt.Footer,{size:this.$props.size,columnResize:this.columnResize,staticHeaders:this.$props.scrollable!=="none",ref:h=>{this.footerRef=h},row:a.createVNode(rt.FooterRow,{isRtl:this.isRtl,rowIndex:this.getAriaRowCount+1,columns:this.columnsRef,cells:this.$props.cells},null),cols:E},null):a.createVNode("span",null,null),z={leafColumns:H,cellsToRender:A,selectedField:this.$props.selectedField,dataItemKey:this.$props.dataItemKey,select:i,highlight:this.$props.highlight,editField:this.$props.editField,cellRender:this.$props.cellRender,cells:this.$props.cells,getCellsToRender:this.getCellsToRender,hasDynamicColSpan:qe,itemChange:this.itemChange,selectionChangeHandler:this.selectionChangeHandler,editHandler:this.editHandler,removeHandler:this.removeHandler,saveHandler:this.saveHandler,cancelHandler:this.cancelHandler,cellClickHandler:this.cellClickHandler,cellKeydownHandler:this.cellKeydownHandler,computedCollapsed:this.computedCollapsed,uniqueField:this.$props.uniqueField,columnsRef:this.columnsRef,isRtl:this.isRtl,idPrefix:$},Oe=function(h,S,k,Z,ee){return Ct.getRowContents(z,h,S,k,Z,ee)};let We=0,J=[];const Q=!this.dataRef.length,de=h=>h>=this.dataRef.length-We;let X=0;if(this.dataRef.length){const h=this._columnsMap.length+(this.$props.filterable?1:0)+1;let S=this.$props.skip||0,k=-1,Z=0;const ee=this.computedRowSpannable.enabled?{}:void 0;if(this.isVirtualScroll){if(T>0){const C=this.dataRef.slice(0,T).filter(V=>V.rowType==="data").length;k+=C,S+=T}!this.$props.pageable&&I&&(k+=this.$props.skip||0)}J=(R||this.dataRef).map(function(C,V){C.rowType==="data"&&k++;const te=C.dataIndex%2!==0,Ge=this.$props.dataItemKey&&l.getter(this.$props.dataItemKey)(C.dataItem),se=V+S,ie=Ge||"ai"+se,oe=ie+"_1",B=Oe.call(this,C,ie,k,te,ee),Qe=C.rowType==="data"?this.pinnedSourceSet.has(C.dataItem):!1,Xe=H.length-(this.detailExpandable.enabled?1:0)-((r==null?void 0:r.length)||0)||1;return X=se+h+Z,[a.createVNode(ft.GridRow,{key:ie,item:C,dataIndex:k,ariaRowIndex:X,absoluteRowIndex:se,isAltRow:te,isHidden:de(V),rowHeight:this.$props.rowHeight,isSelected:B.isSelected,isHighlighted:B.isHighlighted,isInEdit:B.isInEdit,rowType:C.rowType,onRowclick:P=>this.rowClick(P,C),onRowdblclick:P=>this.rowDoubleClick(P,C),render:this.$props.rowRender,class:this.$props.rowClass?this.$props.rowClass(C):"",isPinned:Qe,rows:this.$props.rows},{default:()=>[B.row]}),this.$props.detail&&C.rowType==="data"&&(C.expanded||C.dataItem.expanded)&&a.createVNode("tr",{key:oe,class:te?"k-table-row k-table-alt-row k-detail-row":"k-table-row k-detail-row",style:{visibility:de(V)?"hidden":"",height:this.$props.detailRowHeight+"px"},role:"row","aria-rowindex":X},[r==null?void 0:r.map(function(P){return a.createVNode(ze.GridGroupCell,{id:"",dataIndex:C.dataIndex,field:P.field,dataItem:C.dataItem,key:`group-${P.field}-${C.dataIndex}`,locked:this.$props.lockGroups,group:C.group},null)},this),(this.$props.expandField||this.detailExpandable.enabled)&&a.createVNode(Ze.GridDetailHierarchyCell,{id:f.tableKeyboardNavigationTools.generateNavigatableId(`${oe}-dhcell`,$)},null),a.createVNode(et.GridDetailCell,{dataItem:C.dataItem,dataIndex:C.dataIndex,colSpan:Xe,ariaColIndex:2+(r?r.length:0),detail:this.$props.detail?this.$props.detail:void 0,id:f.tableKeyboardNavigationTools.generateNavigatableId(`${oe}-dcell`,$)},null)])]},this)}const Ue=this.$props.pageable&&a.createVNode(f.Pager,{class:"k-grid-pager",onPagesizechange:this.pageChangeHandler,onPagechange:this.pageChangeHandler,size:this.$props.size,total:b,skip:o||0,pageSize:(n!==void 0?n:this.$props.pageSize)||10,messagesMap:Ke.pagerMessagesMap,settings:f.normalize(this.$props.pageable||{})},null),he=l.getTemplate.call(this,{h:a.h,template:this.$props.pager,defaultRendering:Ue,additionalProps:{...this.$props,skip:this.$props.skip||0,messagesMap:Ke.pagerMessagesMap},additionalListeners:{pagesizechange:this.pageChangeHandler,pagechange:this.pageChangeHandler}}),je=h=>e&&e.filter(S=>S.field===h).length>0,ce=a.createVNode("colgroup",{ref:l.setRef(this,"colGroup")},[H.map(function(h,S){return a.createVNode("col",{key:h.id||`col-${S}`,class:je(h.field)?"k-sorted":void 0,width:h.width!==void 0?h.width.toString().indexOf("%")!==-1?h.width:Math.floor(parseFloat(h.width.toString()))+"px":void 0},null)},this)]),pe={height:this.getCorrectHeight,...this.$attrs.style},Je=a.createVNode("div",{class:"k-loading-mask"},[a.createVNode("div",{class:"k-loading-color"},null),a.createVNode("div",{style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},[a.createVNode(Ye.Loader,{size:"large",type:"converging-spinner"},null)])]),Y=this.$props.showLoader&&l.getTemplate.call(this,{h:a.h,template:this.$props.loader,defaultRendering:Je});return this.$props.scrollable==="none"?a.createVNode(a.Fragment,null,[a.createVNode(f.TableKeyboardNavigationProvider,{ref:"navRef",id:this._gridId,navigatable:this.$props.navigatable,scrollable:this.$props.scrollable,columnVirtualization:this.$props.columnVirtualization},{default:()=>[a.createVNode(Ee.GridNav,{ref:h=>{this.gridNavRef=h},columnsRef:this.columnsRef,dataRef:this.dataRef,id:this.$props.id,dir:this.$props.dir,style:pe,class:this.nonscrollableWrapperClass,onMovetonextpage:this.moveToNextPage,onMovetoprevpage:this.moveToPrevPage,onColumnreorder:this.columnReorder,onKeyboardselectionchange:this.onKeyboardSelectionChangeHandler,onNavigationaction:this.navigationActionHandler},{default:()=>[F,L,a.createVNode("div",{role:"grid",class:"k-grid-aria-root",id:this._gridRoleElementId,"aria-colcount":this.getAriaColCount,"aria-rowcount":this.getAriaRowCount},[a.createVNode(at.GridTable,{selectable:this.computedSelectable,class:"k-table",ref:l.setRef(this,"table")},{default:()=>[ce,ae,a.createVNode("tbody",{class:"k-table-tbody","data-keyboardnavbody":!0,ref:l.setRef(this,"tableBody")},[J,a.createTextVNode(" "),Y]),le]}),Q&&a.createVNode(Le.GridNoRecordsContainer,{id:f.tableKeyboardNavigationTools.generateNavigatableId("no-records",$)},{default:()=>[G.length?G:a.createVNode(Fe.GridNoRecords,null,null)]})]),he,Y,N]})]}),this.renderContextMenu()]):a.createVNode(a.Fragment,null,[a.createVNode(f.TableKeyboardNavigationProvider,{ref:"navRef",id:this._gridId,navigatable:this.$props.navigatable,scrollable:this.$props.scrollable,columnVirtualization:this.$props.columnVirtualization},{default:()=>[a.createVNode(Ee.GridNav,{ref:h=>{this.gridNavRef=h},dataRef:this.dataRef,id:this.$props.id,dir:this.$props.dir,style:pe,class:this.scrollableWrapperClass,onMovetonextpage:this.moveToNextPage,onMovetoprevpage:this.moveToPrevPage,onColumnreorder:this.columnReorder,onKeyboardselectionchange:this.onKeyboardSelectionChangeHandler,onSetcurrentontop:this.setCurrentOnTop,onNavigationaction:this.navigationActionHandler},{default:()=>[F,L,a.createVNode("div",{role:"grid",class:"k-grid-aria-root",id:this._gridRoleElementId,"aria-colcount":this.getAriaColCount,"aria-rowcount":this.getAriaRowCount},[ae,this.hasPinnedTopRows&&a.createVNode(Ae.PinnedRowsTable,{ref:l.setRef(this,"pinnedTop"),size:this.$props.size,cols:E,dataRowContext:z,position:"top",pinnedItems:this.sortedPinnedTopRows,rowHeight:this.$props.rowHeight,rows:this.$props.rows,selectable:this.computedSelectable},null),a.createVNode("div",{class:"k-grid-container",role:"presentation"},[m&&u&&a.createVNode(_e.StickyGroupTable,{ref:l.setRef(this,"stickyHeader"),size:this.$props.size,cols:E,dataRowContext:z,position:"top",groupLevelCount:g,rowHeight:this.$props.rowHeight},null),a.createVNode("div",{role:"presentation",ref:l.setRef(this,"scrollContainer"),class:"k-grid-content k-virtual-content",onScroll:this.scrollHandler},[a.createVNode("div",{class:"k-grid-table-wrap",role:"presentation"},[a.createVNode(lt.GridTableScrollable,{selectable:this.computedSelectable,tableClassName:this.gridTableClass,tableStyle:{userSelect:U},ref:l.setRef(this,"table")},{default:()=>[ce,a.createVNode("tbody",{class:"k-table-tbody",role:"rowgroup","data-keyboardnavbody":!0,ref:l.setRef(this,"tableBody")},[J])]}),Q&&a.createVNode(Le.GridNoRecordsContainer,{id:f.tableKeyboardNavigationTools.generateNavigatableId("no-records",$)},{default:()=>[G.length?G:a.createVNode(Fe.GridNoRecords,null,null)]})]),!Q&&a.createVNode("div",{class:"k-height-container",role:"presentation"},[a.createVNode("div",{ref:l.setRef(this,"scrollHeightContainer"),style:this.$props.scrollable==="virtual"?{height:this._containerHeightRef+"px"}:{}},null)])]),m&&p&&a.createVNode(_e.StickyGroupTable,{ref:l.setRef(this,"stickyFooter"),size:this.$props.size,cols:E,dataRowContext:z,position:"bottom",groupLevelCount:g,rowHeight:this.$props.rowHeight},null)]),this.hasPinnedBottomRows&&a.createVNode(Ae.PinnedRowsTable,{ref:l.setRef(this,"pinnedBottom"),size:this.$props.size,cols:E,dataRowContext:z,position:"bottom",pinnedItems:this.sortedPinnedBottomRows,rowHeight:this.$props.rowHeight,rows:this.$props.rows,selectable:this.computedSelectable},null),le,_]),he,Y,N]})]}),this.renderContextMenu()])}});exports.Grid=It;
|