@progress/kendo-react-grid 7.2.0-develop.1 → 7.2.0-develop.2
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/dist/cdn/js/kendo-react-grid.js +1 -1
- package/index.js +1 -1
- package/index.mjs +791 -791
- package/messages/index.d.ts +5 -0
- package/package.json +10 -10
package/index.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ts=require("react"),p=require("prop-types"),g=require("@progress/kendo-react-common"),C=require("@progress/kendo-react-data-tools"),I=require("@progress/kendo-react-intl"),w=require("@progress/kendo-svg-icons"),M=require("@progress/kendo-react-inputs"),Ae=require("@progress/kendo-react-dateinputs"),ss=require("@progress/kendo-react-popup"),B=require("@progress/kendo-react-buttons"),ie=require("@progress/kendo-react-dropdowns"),pe=require("@progress/kendo-data-query"),rs=require("@progress/kendo-react-animation");function is(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}return t.default=r,Object.freeze(t)}const n=is(ts),j=r=>null;j.displayName="KendoReactGridColumn";j.defaultProps={filterable:!0,editable:!0,sortable:!0,resizable:!0,reorderable:!0,groupable:!0};j.propTypes={field:p.string,title:p.string,editable:p.bool,sortable:p.oneOfType([p.bool,p.shape({allowUnsort:p.bool.isRequired})]),cell:p.any,filterCell:p.any,filterTitle:p.string,filterable:p.bool,filter:p.oneOf(["text","numeric","boolean","date"]),editor:p.oneOf(["text","numeric","boolean","date"]),width:p.oneOfType([p.string,p.number]),minResizableWidth:p.number,headerCell:p.any,footerCell:p.any,headerSelectionValue:p.bool,format:p.string,headerClassName:p.string,className:p.string,reorderable:p.bool,resizable:p.bool,orderIndex:p.number,groupable:p.bool,columnMenu:p.any,locked:p.bool};function L(r,t){const s=(r||"").split(".");let o=t;return s.forEach(e=>{o=o?o[e]:void 0}),o}function pt(r,t,s,o,e,i,l=0){let a=l;for(let c=0;c<t.length;c++){if(!e||t[c].value===void 0||t[c].items===void 0){r[r.length]={dataIndex:o.index,dataItem:t[c],rowType:"data",level:l,expanded:i===void 0||L(i,t[c])},o.index++;continue}a=Math.max(a,l+1);const h=i===void 0||L(i,t[c])===void 0||L(i,t[c]);r[r.length]={dataIndex:-1,dataItem:t[c],level:l,rowType:"groupHeader",expanded:h},h&&(a=Math.max(pt(r,t[c].items,s,o,e,i,l+1),a)),(s==="always"||h&&s==="visible")&&(r[r.length]={dataIndex:-1,dataItem:t[c],rowType:"groupFooter",level:l,expanded:h})}return a}function ut(r,t,s,o=0){let e=[];if(!r)return[];r&&r.length===void 0&&(r=[r]),r.forEach((l,a)=>{l=l.props?l.props:l;const c=t[a]||null,h=ut(l.children,c&&c.children||[],s,o+1);e.push(Object.assign({depth:o},j.defaultProps,h.length?{cell:()=>null,filterCell:()=>null}:{},c?{width:c.width,orderIndex:c.orderIndex}:{},l,{id:l.id?l.id:C.tableKeyboardNavigationTools.generateNavigatableId(`${s.prevId++}`,s.idPrefix,"column"),declarationIndex:e.length,children:h,rowSpan:0,colSpan:0,isAccessible:!0,left:c&&Math.floor(c.left),right:c&&Math.floor(c.right)}))});const i=(l,a)=>l.orderIndex===a.orderIndex?l.declarationIndex-a.declarationIndex:(l.orderIndex||0)-(a.orderIndex||0);if(e.sort(i),o===0){let l=[];const a=(c,h)=>c.forEach(d=>{d.parentIndex=h,a(d.children,l.push(d)-1)});return a(e,-1),l}return e}function os(r,t,s,o){let e=[];Array.isArray(r)?e=r:r&&(e=r.data);const i=[];if(e.length>0){let l=e[0];if(t)for(let c=0;c<t.length;c++)l=l.items&&l.items[0];Object.getOwnPropertyNames(l).forEach(c=>{c!==s&&i.push(Object.assign({id:C.tableKeyboardNavigationTools.generateNavigatableId(`${o.prevId++}`,o.idPrefix,"column"),declarationIndex:-1,parentIndex:-1,depth:0,colSpan:0,rowSpan:0,index:0,left:0,right:0,rightBorder:!1,children:[],ariaColumnIndex:0,isAccessible:!0},j.defaultProps,{field:c}))})}return i}const ns=(r,t)=>{let s=r[t.parentIndex];for(;s;){if(s.footerCell)return!0;s=r[s.parentIndex]}return!1},ls=r=>r.filter(t=>ns(r,t)?!1:!!t.footerCell||!(t.children&&t.children.length>0)),Ee=r=>r.width!==void 0?Math.floor(parseFloat(r.width.toString()))+"px":void 0,gt=r=>(r.sort((t,s)=>t.declarationIndex-s.declarationIndex),r.map(t=>{const{declarationIndex:s,parentIndex:o,depth:e,colSpan:i,rowSpan:l,index:a,kFirst:c,children:h,...d}=t;return h.length?{children:gt(h),...d}:d})),Ie=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),at=17895697,ge=(r,t)=>{if(!(!r&&!t))return t?r?{...r,...t,select:{...r.select||{},...t.select||{}},hierarchy:{...r.hierarchy||{},...t.hierarchy||{}},group:{...r.group||{},...t.group||{}},edit:{...r.edit||{},...t.edit||{}}}:t:r},ft=r=>{const t=n.useCallback(d=>{r.selectionChange&&r.selectionChange({syntheticEvent:d})},[r.selectionChange]),s=g.useId(),o=L(r.field,r.dataItem),e=C.useTableKeyboardNavigation(r.id),i={colSpan:r.colSpan,style:r.style,className:r.className,"aria-colindex":r.ariaColumnIndex,role:"gridcell",...e},l=[n.createElement("span",{key:1,className:"k-checkbox-wrap"},n.createElement("input",{checked:typeof o=="boolean"&&o,id:s,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:t})),n.createElement("label",{className:"k-checkbox-label",htmlFor:s,key:2})],a=r.rowType!=="groupHeader"?n.createElement("td",{...i},l):null,c=r.rowType||"data",h=r.cells;if(h&&h.select&&h.select[c]){const d=h.select[c];return n.createElement(d,{...r,tdProps:i},l)}return r.render?r.render.call(void 0,a,r):a},Se="grid.noRecords",mt="grid.pagerInfo",Ct="grid.pagerFirstPage",bt="grid.pagerPreviousPage",vt="grid.pagerNextPage",xt="grid.pagerLastPage",kt="grid.pagerItemsPerPage",as="grid.pagerPage",cs="grid.pagerPageSizeAriaLabel",hs="grid.pagerOf",ds="grid.pagerTotalPages",ye="grid.groupPanelEmpty",Et="grid.groupColumn",It="grid.ungroupColumn",we="grid.columnMenu",K="grid.filterClearButton",oe="grid.filterSubmitButton",ne="grid.filterTitle",Re="grid.sortAscending",Ne="grid.sortDescending",Fe="grid.searchPlaceholder",De="grid.filterCheckAll",Te="grid.filterChooseOperator",Ge="grid.filterSelectedItems",Me="grid.sortAriaLabel",ze="grid.filterAriaLabel",Le="grid.groupPanelAriaLabel",St="grid.groupExpand",yt="grid.groupCollapse",wt="grid.detailExpand",Rt="grid.detailCollapse",S={[wt]:"Expand detail row",[Rt]:"Collapse detail row",[St]:"Expand group",[yt]:"Collapse Group",[Se]:"No records available",[ye]:"Drag a column header and drop it here to group by that column",[K]:"Clear",[oe]:"Filter",[ne]:"Filter",[Re]:"Sort Ascending",[Ne]:"Sort Descending",[Me]:"Sortable",[Et]:"Group Column",[It]:"Ungroup Column",[we]:"Column menu",[kt]:"items per page",[mt]:"{0} - {1} of {2} items",[Ct]:"Go to the first page",[bt]:"Go to the previous page",[vt]:"Go to the next page",[xt]:"Go to the last page",[as]:"Page",[cs]:"Page size",[hs]:"of",[ds]:"{0}",[Fe]:"Search",[De]:"Check All",[Te]:"Choose Operator",[Ge]:"selected items",[ze]:"Filter",[Le]:"Group panel","grid.filterEqOperator":"Is equal to","grid.filterNotEqOperator":"Is not equal to","grid.filterIsNullOperator":"Is null","grid.filterIsNotNullOperator":"Is not null","grid.filterIsEmptyOperator":"Is empty","grid.filterIsNotEmptyOperator":"Is not empty","grid.filterStartsWithOperator":"Starts with","grid.filterContainsOperator":"Contains","grid.filterNotContainsOperator":"Does not contain","grid.filterEndsWithOperator":"Ends with","grid.filterGteOperator":"Is greater than or equal to","grid.filterGtOperator":"Is greater than","grid.filterLteOperator":"Is less than or equal to","grid.filterLtOperator":"Is less than","grid.filterIsTrue":"Is true","grid.filterIsFalse":"Is false","grid.filterBooleanAll":"(All)","grid.filterAfterOrEqualOperator":"Is after or equal to","grid.filterAfterOperator":"Is after","grid.filterBeforeOperator":"Is before","grid.filterBeforeOrEqualOperator":"Is before or equal to","grid.filterAndLogic":"And","grid.filterOrLogic":"Or"};function ps(r){const t=r.replace(/^pager\.([a-z])/,(s,o)=>"grid.pager"+o.toUpperCase());return{messageKey:t,defaultMessage:S[t]}}const Nt=r=>{let t=null,s=null,o=null;const e=L(r.field,r.dataItem),i=C.useTableKeyboardNavigation(r.id),l=I.useLocalization(),a=n.useCallback(d=>{d.isDefaultPrevented()||d.keyCode===g.Keys.enter&&r.onChange&&(d.preventDefault(),r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,syntheticEvent:d,field:r.field,value:!e}))},[r.dataItem,r.dataIndex,r.field,r.onChange,e]);if(r.rowType==="groupFooter")s={className:"k-table-td k-hierarchy-cell",role:"gridcell",...i},t=n.createElement("td",{...s});else if(r.rowType!=="groupHeader"){const d=e?Rt:wt,f=l.toLanguageString(d,S[d]);s={className:"k-table-td k-hierarchy-cell",onKeyDown:a,"aria-expanded":!!e,role:"gridcell","aria-colindex":r.ariaColumnIndex,...i},o=n.createElement("a",{onClick:b=>{b.preventDefault(),r.onChange&&r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,syntheticEvent:b,field:r.field,value:!e})},"aria-label":f,href:"#",tabIndex:-1},n.createElement(g.IconWrap,{name:e?"minus":"plus",icon:e?w.minusIcon:w.plusIcon})),t=n.createElement("td",{...s},o)}const c=r.rowType||"data",h=r.cells;if(h&&h.hierarchy&&h.hierarchy[c]){const d=h.hierarchy[c];return n.createElement(d,{...r,tdProps:s},o)}return r.render?r.render.call(void 0,t,r):t},Ft=C.TABLE_ROW_INDEX_ATTRIBUTE,U=C.TABLE_COL_INDEX_ATTRIBUTE,Dt=r=>{const t=L(r.field,r.dataItem);let s=null;const o=g.classNames("k-table-td","k-grid-edit-cell",{["k-selected"]:r.isSelected},r.className),e=g.useId(),i=C.useTableKeyboardNavigation(r.id);let l=null,a=null;const c=n.useCallback(u=>{if(r.onChange){const x=u.target.type==="checkbox"?u.target.checked:u.target.value;r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,field:r.field,syntheticEvent:u,value:x})}},[r.onChange,r.dataItem,r.dataIndex,r.field]),h=n.useCallback(u=>{r.onContextMenu&&r.onContextMenu.call(void 0,u,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]),d=n.useCallback(u=>{r.onChange&&r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,field:r.field,syntheticEvent:u.syntheticEvent,value:u.value})},[r.onChange,r.dataItem,r.dataIndex,r.field]);switch(r.editor){case"numeric":{l={onContextMenu:h,colSpan:r.colSpan,style:r.style,className:o,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...i},a=n.createElement(M.NumericTextBox,{width:"100%",value:t===void 0?null:t,onChange:d}),s=n.createElement("td",{...l},a);break}case"date":l={onContextMenu:h,colSpan:r.colSpan,style:r.style,className:o,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...i},a=n.createElement(Ae.DatePicker,{width:"100%",value:t,onChange:d}),s=n.createElement("td",{...l},a);break;case"boolean":l={onContextMenu:h,colSpan:r.colSpan,style:r.style,className:o,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...i},a=[n.createElement("span",{key:1,className:"k-checkbox-wrap"},n.createElement("input",{checked:t||!1,id:e,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:c})),n.createElement("label",{className:"k-checkbox-label",htmlFor:e,key:2})],s=n.createElement("td",{...l},a);break;default:l={onContextMenu:h,colSpan:r.colSpan,style:r.style,className:o,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...i},a=n.createElement("input",{style:{width:"100%"},className:"k-input",value:t||"",onChange:c}),s=n.createElement("td",{...l},a)}const f=r.editor||"text",b=r.cells;if(b&&b.edit&&b.edit[f]){const u=b.edit[f];return n.createElement(u,{...r,tdProps:l},a)}return r.render?r.render.call(void 0,s,r):s};class us extends n.Component{constructor(){super(...arguments),this.headerWrap=null,this.table=null,this.syncScroll=!1,this.scrollbarWidth=g.getScrollbarWidth(),this.onScroll=t=>{if(this.syncScroll){this.syncScroll=!1;return}if(!this.headerWrap)return;const s=this.headerWrap.scrollLeft,o=this.props.scrollableDataElement();o&&o.scrollLeft!==s&&(o.scrollLeft=s)}}get element(){return this.props.elemRef.current}componentDidMount(){const t=C.isRtl(this.element);this.props.columnResize&&this.props.columnResize.setIsRtl(t),this.forceUpdate()}setScrollLeft(t){this.headerWrap&&this.headerWrap.scrollLeft!==t&&(this.syncScroll=!0,this.headerWrap.scrollLeft=t)}setWidth(t){this.table&&(this.table.style.width=t+"px")}render(){return this.props.staticHeaders?n.createElement("div",{ref:this.props.elemRef,className:g.classNames("k-grid-header",{"k-grid-draggable-header":this.props.draggable}),role:"presentation"},n.createElement("div",{ref:t=>{this.headerWrap=t},className:"k-grid-header-wrap",style:this.scrollbarWidth?{}:{borderWidth:0},onScroll:this.onScroll,role:"presentation"},n.createElement("table",{ref:t=>{this.table=t},className:g.classNames("k-table k-grid-header-table",{"k-table-md":!this.props.size,[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),role:"presentation"},n.createElement("colgroup",{ref:t=>{this.props.columnResize.colGroupHeader=t}},this.props.cols),n.createElement("thead",{className:"k-table-thead",role:"rowgroup",...C.tableKeyboardNavigationHeaderAttributes},this.props.headerRow,this.props.filterRow)))):n.createElement("thead",{role:"presentation",className:g.classNames("k-table-thead",{"k-grid-draggable-header":this.props.draggable}),...C.tableKeyboardNavigationHeaderAttributes},this.props.headerRow,this.props.filterRow)}}const Tt=(...r)=>Object.assign({allowUnsort:!0,mode:"single"},...r);class gs extends n.PureComponent{constructor(){super(...arguments),this.draggable=null,this.onPress=t=>{const s=this.draggable&&this.draggable.element;s&&this.props.pressHandler&&this.props.pressHandler(t.event,s)},this.onDrag=t=>{const s=this.draggable&&this.draggable.element;s&&this.props.dragHandler&&this.props.dragHandler(t.event,s)},this.onRelease=t=>{this.draggable&&this.draggable.element&&this.props.releaseHandler&&this.props.releaseHandler(t.event)}}render(){return n.createElement(g.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,hint:this.props.dragClue,autoScroll:{boundaryElementRef:this.props.headerRef,direction:{horizontal:!0,vertical:!1}},scrollContainer:this.props.containerRef||void 0,ref:t=>{this.draggable=t}},n.createElement("tr",{className:"k-table-row",style:{touchAction:"none"},role:"row","aria-rowindex":this.props.ariaRowIndex},this.props.children))}}class Be extends n.Component{constructor(){super(...arguments),this.state={show:!1},this._anchor=null,this._content=null,this.blurTimeout=void 0,this.willBlur=!1,this.blur=()=>{if(this.willBlur){this.willBlur=!1;return}clearTimeout(this.blurTimeout),this.blurTimeout=window.setTimeout(()=>{this.closeMenu()})},this.focus=()=>{clearTimeout(this.blurTimeout)},this.anchorClick=t=>{t.preventDefault(),this.setState({show:!this.state.show},()=>this.state.show&&this._content&&this._content.focus())},this.closeMenu=()=>{this.setState({show:!1})},this.onAnchorMouseDown=t=>{this.willBlur=this.state.show&&t.currentTarget===this._anchor},this.onAnchorKeyDown=t=>{var s;if(t.keyCode===g.Keys.tab){const o=t.target,e=o&&((s=o.closest(".k-grid"))==null?void 0:s.getElementsByClassName("k-grid-content")[0]);e&&e.scrollWidth>e.clientWidth&&o.scrollIntoView({inline:"center"})}}}render(){const{columnMenu:t,...s}=this.props,{column:o}=this.props,e=I.provideLocalizationService(this),i=o.title||o.field,l=i?`${i} `:"";return n.createElement(n.Fragment,null,n.createElement("a",{className:"k-grid-header-menu k-grid-column-menu",ref:a=>this._anchor=a,onClick:this.anchorClick,onMouseDown:this.onAnchorMouseDown,onKeyDown:this.onAnchorKeyDown,href:"#","aria-label":`${l}${e.toLanguageString(we,S[we])}`},n.createElement(g.IconWrap,{name:"filter",icon:w.filterIcon})),n.createElement(ss.Popup,{anchor:this._anchor,show:this.state.show,popupClass:"k-column-menu k-column-menu-popup k-grid-columnmenu-popup"},n.createElement("div",{ref:a=>this._content=a,tabIndex:0,onBlur:this.blur,onFocus:this.focus,style:{outline:"none"}},t&&n.createElement(t,{...s,onCloseMenu:this.closeMenu}))))}}class Gt extends n.Component{render(){const{columnMenuWrapperProps:t}=this.props,s=this.props.onClick?{onClick:this.props.onClick}:{},o=n.createElement("span",{className:"k-cell-inner"},n.createElement("span",{className:g.classNames("k-link",{"!k-cursor-default":!this.props.columnMenuWrapperProps.sortable}),...s},n.createElement("span",{className:"k-column-title"},this.props.title||this.props.field||" "),this.props.children),t.columnMenu&&n.createElement(Be,{...t}));return this.props.render?this.props.render.call(void 0,o,this.props):o}}const fs={true:{asc:"desc",desc:"","":"asc"},false:{asc:"desc",desc:"asc","":"asc"}},ms={none:"none",asc:"ascending",desc:"descending"};class Mt extends n.Component{constructor(t){super(t),this.serviceIndex=0,this.index=-1,this.cellKeyDown=(s,o)=>{s.isDefaultPrevented()||s.keyCode===g.Keys.enter&&this.cellClick(s,o)},this.cells=s=>s.map(o=>{const e=this.props.columns[o],i=this.props.sortable&&e.sortable,l=this.props.sort?this.props.sort.findIndex(E=>E.field===e.field):-1,a=l>=0&&this.props.sort[l].dir||"none",c=e.columnMenu===null?null:e.columnMenu||this.props.columnMenu,h=g.classNames({"k-first":e.kFirst,"k-filterable":!!c,"k-table-th":!0,"k-header":!0,"k-grid-header-sticky":e.locked,"k-sorted":this.props.sort&&this.props.sort.some(E=>E.field===e.field)},e.headerClassName),d=e.left!==void 0?this.props.isRtl?{left:e.right,right:e.left}:{left:e.left,right:e.right}:{},f=I.provideLocalizationService(this).toLanguageString(Me,S[Me]);let b=e.isAccessible?{ariaSort:ms[a],role:"columnheader",ariaColumnIndex:e.ariaColumnIndex,ariaSelected:!1,ariaDescription:i?f:""}:{role:"presentation"};const u=e.declarationIndex>=0?++this.index:--this.serviceIndex,x=e.headerCell?e.headerCell:Gt,y=n.createElement(x,{key:1,field:e.field,onClick:i&&(E=>this.cellClick(E,e))||void 0,selectionChange:this.props.selectionChange,title:e.title,selectionValue:e.headerSelectionValue,render:this.props.cellRender,children:this.sortIcon(l),columnMenuWrapperProps:{column:{field:e.field,title:e.title,locked:e.locked,filter:e.filter,id:e.id},sortable:i&&this.props.sortable,sort:this.props.sort,onSortChange:this.props.sortChange,filter:this.props.filter,filterable:this.props.filterable&&e.filterable,filterOperators:this.props.filterOperators,onFilterChange:this.props.filterChange,group:this.props.group,groupable:this.props.groupable,onGroupChange:this.props.groupChange,columnMenu:c}}),v={...b,key:u,colSpan:e.colSpan,rowSpan:e.rowSpan,className:h,style:d,columnId:e.id,navigatable:e.navigatable,onKeyDown:i&&(E=>this.cellKeyDown(E,e))||void 0,role:"columnheader"},k=[y,this.props.columnResize&&this.props.columnResize.resizable&&e.resizable&&n.createElement(C.ColumnResizer,{key:2,resize:(E,P,z)=>this.props.columnResize&&this.props.columnResize.dragHandler(E,e,P,z),autofit:E=>this.props.columnResize&&this.props.columnResize.dblClickHandler(E,[e.id])})],R=ge(this.props.cells,e.cells);if(R&&R.headerCell){const E=R.headerCell;return n.createElement(E,{key:u,thProps:v,index:o},k)}return n.createElement(C.HeaderThElement,{...v,key:u},k)}),this.cellClick=this.cellClick.bind(this)}cellClick(t,s){if(t.preventDefault(),!this.props.sortChange)return;const{allowUnsort:o,mode:e}=Tt(this.props.sortable||!1,s.sortable||!1),i=(this.props.sort||[]).filter(c=>c.field===s.field)[0],l=fs[o][i&&i.dir||""],a=e==="single"?[]:(this.props.sort||[]).filter(c=>c.field!==s.field);l!==""&&s.field&&a.push({field:s.field,dir:l}),this.props.sortChange(a,t)}sortIcon(t){return this.props.sort?t>=0&&[n.createElement("span",{key:1,className:"k-sort-icon"},n.createElement(g.IconWrap,{name:"sort-"+this.props.sort[t].dir+"-small",icon:this.props.sort[t].dir==="asc"?w.sortAscSmallIcon:w.sortDescSmallIcon})),this.props.sort.length>1&&n.createElement("span",{key:2,className:"k-sort-icon"},n.createElement("span",{className:"k-sort-order"},t+1))]:null}render(){return this.serviceIndex=0,this.index=-1,this.props.columnsMap.map((t,s)=>this.props.pressHandler&&n.createElement(gs,{key:s,pressHandler:this.props.pressHandler,dragHandler:this.props.dragHandler,releaseHandler:this.props.releaseHandler,ariaRowIndex:s+1,dragClue:this.props.dragClue,headerRef:this.props.headerRef,containerRef:this.props.containerRef},this.cells(t))||n.createElement("tr",{key:s,className:"k-table-row",role:"row","aria-rowindex":s+1},this.cells(t)))}}I.registerForLocalization(Mt);const Cs=[{text:"grid.filterAndLogic",operator:"and"},{text:"grid.filterOrLogic",operator:"or"}],Oe={text:[{text:"grid.filterContainsOperator",operator:"contains"},{text:"grid.filterNotContainsOperator",operator:"doesnotcontain"},{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterStartsWithOperator",operator:"startswith"},{text:"grid.filterEndsWithOperator",operator:"endswith"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"},{text:"grid.filterIsEmptyOperator",operator:"isempty"},{text:"grid.filterIsNotEmptyOperator",operator:"isnotempty"}],numeric:[{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterGteOperator",operator:"gte"},{text:"grid.filterGtOperator",operator:"gt"},{text:"grid.filterLteOperator",operator:"lte"},{text:"grid.filterLtOperator",operator:"lt"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"}],date:[{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterAfterOrEqualOperator",operator:"gte"},{text:"grid.filterAfterOperator",operator:"gt"},{text:"grid.filterBeforeOperator",operator:"lt"},{text:"grid.filterBeforeOrEqualOperator",operator:"lte"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"}],boolean:[{text:"grid.filterEqOperator",operator:"eq"}]},H=r=>r==="isnull"||r==="isnotnull"||r==="isempty"||r==="isnotempty",se=(r,t)=>r.map(s=>({text:t.toLanguageString(s.text,S[s.text]),operator:s.operator})),bs="eq",We=[{text:"grid.filterBooleanAll",operator:""},{text:"grid.filterIsTrue",operator:!0},{text:"grid.filterIsFalse",operator:!1}],vs={text:!1,numeric:!1,date:!1,boolean:!0},Ke=(r,t,s)=>{const o=zt(s.operators);let e=s.operator;switch(s.filterType){case"numeric":(!e||H(e))&&(e=o),r===null&&e===o&&(e="");break;case"date":(!e||H(e))&&(e=o),r===null&&e===o&&(e="");break;case"text":(!e||H(e))&&(e=o),!r&&e===o&&(e="");break;default:return}s.onChange({value:r,operator:e,syntheticEvent:t})},zt=(r,t)=>t?r[t][0].operator:r[0].operator,He=r=>r||"text",Ve=(r,t)=>{const s=r.target.value;t({value:s.operator,operator:s.operator===""?"":bs,syntheticEvent:r.syntheticEvent})},qe=(r,t,s)=>{let o=t;const e=r.target.value;r.target.state.opened&&(H(e.operator)&&(o=null),t===null&&!H(e.operator)&&(o=void 0),s({value:o,operator:e.operator,syntheticEvent:r.syntheticEvent}))};class Ue extends n.Component{constructor(t){super(t),this._inputRef=n.createRef(),this.renderOperatorEditor=s=>{if(this.props.filterType==="boolean")return;const o=this.props.operators.find(e=>e.operator===this.props.operator)||null;return n.createElement(ie.DropDownList,{size:this.props.size,value:o,onChange:this.operatorChange,className:"k-dropdown-operator",iconClassName:"k-i-filter k-icon",svgIcon:w.filterIcon,data:this.props.operators,textField:"text",title:s.toLanguageString(Te,S[Te]),popupSettings:{width:""}})},this.inputChange=this.inputChange.bind(this),this.clear=this.clear.bind(this),this.operatorChange=this.operatorChange.bind(this),this.boolDropdownChange=this.boolDropdownChange.bind(this)}render(){const t=I.provideLocalizationService(this),s=n.createElement("div",{className:"k-filtercell"},n.createElement("div",{className:"k-filtercell-wrapper"},this.filterComponent(this.props.filterType,this.props.value,this.props.booleanValues),n.createElement("div",{className:"k-filtercell-operator"},this.renderOperatorEditor(t)," ",n.createElement(B.Button,{size:this.props.size,icon:"filter-clear",svgIcon:w.filterClearIcon,className:g.classNames({"k-clear-button-visible":!!(!(this.props.value===null||this.props.value==="")||this.props.operator)}),title:t.toLanguageString(K,S[K]),type:"button",onClick:this.clear,disabled:!(!(this.props.value===null||this.props.value==="")||this.props.operator)}))));return this.props.render?this.props.render.call(void 0,s,this.props):s}inputChange(t,s){Ke(t,s,this.props)}operatorChange(t){qe(t,this.props.value,this.props.onChange)}boolDropdownChange(t){Ve(t,this.props.onChange)}clear(t){t.preventDefault(),this.props.onChange({value:"",operator:"",syntheticEvent:t}),this._inputRef.current&&(this._inputRef.current.element.value="",setTimeout(()=>{this._inputRef.current.element.focus()},0))}filterComponent(t,s,o){switch(t){case"numeric":return n.createElement(M.NumericTextBox,{ref:this._inputRef,size:this.props.size,value:s,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},title:this.props.title,ariaLabel:this.props.ariaLabel});case"date":return n.createElement(Ae.DatePicker,{ref:this._inputRef,size:this.props.size,value:s,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},title:this.props.title,ariaLabel:this.props.ariaLabel});case"boolean":{const e=i=>i==null;return n.createElement(ie.DropDownList,{ref:this._inputRef,size:this.props.size,onChange:this.boolDropdownChange,value:o.find(i=>i.operator===(e(s)?"":s)),data:o,textField:"text",title:this.props.title,ariaLabel:this.props.ariaLabel})}default:return n.createElement(M.TextBox,{ref:this._inputRef,size:this.props.size,value:s||"",onChange:e=>{this.inputChange(e.target.value,e.syntheticEvent)},title:this.props.title,"aria-label":this.props.ariaLabel})}}}I.registerForLocalization(Ue);const xs="k-table-row k-filter-row";class Lt extends n.Component{headerCellClassName(t,s){let o=`${s?"k-grid-header-sticky":""}`;return this.props.sort&&this.props.sort.filter(e=>e.field===t).length>0&&(o+=" k-sorted"),o}setFilter(t,s,o,e){if(!this.props.filterChange)return;const i=[];(t!==""&&t!==null||s!=="")&&i.push({field:o,operator:s,value:t}),this.props.filter&&this.props.filter.filters&&(this.props.filter.filters||[]).forEach(c=>{const h=c;h&&h.field!==o&&i.push(h)});const l=this.props.filter&&this.props.filter.logic?this.props.filter.logic:"and";this.props.filterChange(i.length>0?{logic:l,filters:i}:null,e)}render(){const t=I.provideLocalizationService(this),s=this.props.filter&&this.props.filter.filters||[],o=a=>{if(a===void 0)return;const c=s.filter(h=>h.field===a);return c.length?c[0]:void 0};let e=0,i=-1;const l=this.props.columns.filter(a=>a.children.length===0).map(a=>{const c=He(a.filter),h=o(a.field),d=a.filterable?t.toLanguageString(ze,S[ze]):void 0;let f=h&&h.value;f===void 0&&(f=c==="text"?"":null);const b=a.filterable&&{render:this.props.cellRender,field:a.field,title:a.filterTitle,value:f,operator:h&&h.operator,operators:se(this.props.filterOperators[c]||[],t),booleanValues:se(We,t),filterType:c,ariaLabel:d,onChange:E=>{this.setFilter(E.value,E.operator,a.field,E.syntheticEvent)}},u=a.declarationIndex>=0?++i:--e,x={ariaLabel:d,ariaColumnIndex:a.ariaColumnIndex},y=a.left!==void 0?this.props.isRtl?{left:a.right,right:a.left}:{left:a.left,right:a.right}:{},v={columnId:C.tableKeyboardNavigationTools.getFilterColumnId(a.id),navigatable:a.navigatable,style:y,className:g.classNames("k-table-th",this.headerCellClassName(a.field,a.locked)||void 0),role:"columnheader",...x},k=b&&(a.filterCell?n.createElement(a.filterCell,{...b}):n.createElement(Ue,{size:this.props.size,...b})),R=ge(this.props.cells,a.cells);if(R&&R.filterCell){const E=R.filterCell;return n.createElement(E,{key:u,...b,thProps:v,index:i},k)}return n.createElement(C.HeaderThElement,{key:u,...v},k)});return n.createElement("tr",{className:xs,"aria-rowindex":this.props.ariaRowIndex,role:"row"},l)}}I.registerForLocalization(Lt);class Ot extends n.Component{constructor(){super(...arguments),this.draggable=null,this.onPress=t=>{const s=this.draggable&&this.draggable.element;s&&this.props.onPress&&this.props.onPress(t.event,s)},this.onDrag=t=>{const s=this.draggable&&this.draggable.element;s&&this.props.onDrag&&this.props.onDrag(t.event,s)},this.onRelease=t=>{this.draggable&&this.draggable.element&&this.props.onRelease&&this.props.onRelease(t.event)},this.sortChange=t=>{if(t.preventDefault(),this.props.onSortChange){const s=this.props.dir==="asc"?"desc":"asc";this.props.onSortChange(t,s)}},this.groupRemove=t=>{t.preventDefault(),t.stopPropagation(),this.props.onRemove&&this.props.onRemove(t)},this.onContextMenu=t=>{const s={title:this.props.title,dir:this.props.dir,index:this.props.index};this.props.onContextMenu&&this.props.onContextMenu.call(void 0,t,{dataItem:{...s}})}}render(){const{dir:t}=this.props;return n.createElement(g.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,ref:s=>{this.draggable=s}},n.createElement("div",{className:"k-chip k-chip-md k-chip-solid k-chip-solid-base k-rounded-md",onClick:this.sortChange,onContextMenu:this.onContextMenu,role:"button",style:{touchAction:"none"}},n.createElement("span",null,n.createElement(g.IconWrap,{name:"sort-"+t+"-small",icon:t==="asc"?w.sortAscSmallIcon:w.sortDescSmallIcon,size:"small"})),n.createElement("span",{className:"k-chip-content"},this.props.title),n.createElement("span",{className:"k-chip-actions"},n.createElement("span",{className:"k-chip-action k-chip-remove-action",onClick:this.groupRemove},n.createElement(g.IconWrap,{name:"x-circle",icon:w.xCircleIcon,size:"small"})))))}}I.registerForLocalization(Ot);class Ht extends n.Component{constructor(){super(...arguments),this.onGroupRemove=(t,s)=>{const o=this.props.group.slice();o.splice(s,1),this.props.groupChange(o,t)},this.onGroupSortChange=(t,s,o,e)=>{const i=Object.assign({},o,{dir:e}),l=this.props.group.slice();l.splice(s,1,i),this.props.groupChange(l,t)}}render(){const s=(this.props.group||[]).map((o,e)=>n.createElement(Ot,{key:e,index:e,dir:o.dir||"asc",title:this.props.resolveTitle(o.field),onRemove:i=>{this.onGroupRemove(i,e)},onSortChange:(i,l)=>{this.onGroupSortChange(i,e,o,l)},onPress:this.props.pressHandler,onDrag:this.props.dragHandler,onRelease:this.props.releaseHandler,onContextMenu:this.props.onContextMenu}));return n.createElement("div",{ref:this.props.refCallback,className:"k-grouping-header",role:"toolbar","aria-label":I.provideLocalizationService(this).toLanguageString(Le,S[Le]),"aria-controls":this.props.ariaControls||""},n.createElement("div",{className:"k-chip-list k-chip-list-md",role:"none"},s),n.createElement("div",{className:"k-grouping-drop-container"},!s.length&&I.provideLocalizationService(this).toLanguageString(ye,S[ye])," "))}}I.registerForLocalization(Ht);class ks extends n.Component{constructor(){super(...arguments),this.footerWrap=null,this.table=null,this.scrollbarWidth=g.getScrollbarWidth()}componentDidMount(){this.setState({})}setScrollLeft(t){this.footerWrap&&(this.footerWrap.scrollLeft=t)}setWidth(t){this.table&&(this.table.style.width=t+"px")}render(){return this.props.staticHeaders?n.createElement("div",{className:"k-grid-footer",role:"presentation"},n.createElement("div",{ref:t=>{this.footerWrap=t},className:"k-grid-footer-wrap",style:this.scrollbarWidth?{}:{borderWidth:0},role:"presentation"},n.createElement("table",{ref:t=>{this.table=t},className:g.classNames("k-table k-grid-footer-table",{"k-table-md":!this.props.size,[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),role:"presentation"},n.createElement("colgroup",{ref:t=>{this.props.columnResize.colGroupFooter=t},role:"presentation"},this.props.cols),n.createElement("tfoot",{className:"k-table-tfoot",role:"presentation"},this.props.row)))):n.createElement("tfoot",{className:"k-table-tfoot"},this.props.row)}}class Es{constructor(t){this.table=null,this.containerHeight=0,this.topCacheCount=0,this.attendedSkip=0,this.propsSkip=0,this.total=0,this.scrollableVirtual=!1,this.realSkip=0,this.pageSize=0,this.PageChange=null,this.tableBodyRef=n.createRef(),this.fixedScroll=!1,this.askedSkip=void 0,this.containerRef=n.createRef(),this.tableTransform="",this.prevScrollPos=0,this.tableTranslate=0,this.scrollSyncing=!1,this.reactVersion=Number.parseFloat(n.version),this.topItems=(s,o)=>{if(!this.container||o)return{topItemsCount:0,topItemsHeight:0};const e=this.container.clientHeight,i=Math.ceil(e/s[0].line),l=Math.ceil((s.length-i)/2);let a=0;for(let c=0;c<l;c++)a+=s[c].line+s[c].acc;return{topItemsCount:l,topItemsHeight:a,itemsNeededOnScreen:i+i/2}},this.horizontalScrollbarHeight=()=>this.container?this.container.offsetHeight-this.container.clientHeight:0,t&&(this.topCacheCount=4,this.attendedSkip=-this.topCacheCount),this.scrollHandler=this.scrollHandler.bind(this)}get container(){return this.containerRef.current}get rowHeights(){const t=[],s=this.tableBodyRef.current&&this.tableBodyRef.current.children||[];let o=0;for(let e=0;e<s.length;e++){if(s[e].className.indexOf("k-grouping-row")>-1){o+=s[e].scrollHeight;continue}s[e].className.indexOf("k-detail-row")>-1?t[t.length-1].line+=s[e].scrollHeight:(t.push({line:s[e].scrollHeight,acc:o}),o=0)}return t}changePage(t,s){this.attendedSkip=t-this.topCacheCount,this.PageChange&&this.PageChange({skip:Math.max(0,t-this.topCacheCount),take:this.pageSize},s)}translate(t,s){this.tableTranslate=t,this.scrollableVirtual&&this.table&&(this.reactVersion<=17||s?this.table.style.transform="translateY("+t+"px)":this.tableTransform="translateY("+t+"px)")}reset(){this.scrollSyncing=!0,!this.fixedScroll&&(this.container&&(this.container.scrollTop=0),this.translate(0,!0))}localScrollUp(t){if(!this.container)return;const s=this.rowHeights,o=this.container.scrollTop;let e=this.tableTranslate,i=0;const{topItemsCount:l,topItemsHeight:a,itemsNeededOnScreen:c}=this.topItems(s,!!this.topCacheCount),h=o-e;if(!(h>a||s.length<=c)){for(;i<this.topCacheCount+this.attendedSkip-this.realSkip+l&&this.propsSkip-i>0&&!(e+(s[s.length-1-i].line+s[s.length-1-i].acc)+h<=o);)e-=s[s.length-1-i].line+s[s.length-1-i].acc,i++;if(i===0&&this.topCacheCount===0&&this.attendedSkip>0&&(e=Math.max(e-s[0].line,0),i=1),this.propsSkip-i<=0&&e>o){this.translate(0),this.changePage(0,t),this.container.scrollTop=0;return}if(e>o&&(e=o),e!==this.tableTranslate){this.translate(Math.max(0,e-a));const d=Math.max(0,this.propsSkip-i-l);this.changePage(d,t)}}}localScrollDown(t){if(!this.container)return;const s=this.rowHeights,o=this.container.scrollTop;let e=this.tableTranslate,i=0;const{topItemsCount:l,topItemsHeight:a,itemsNeededOnScreen:c}=this.topItems(s,!!this.topCacheCount);for(;i<s.length-this.topCacheCount&&!(e+s[i].line+s[i].acc>o);)e+=s[i].line+s[i].acc,i++;l>this.propsSkip+i||s.length<=c||(i>=s.length-this.topCacheCount&&this.propsSkip+i>=this.total?(this.translate(e-a),this.changePage(this.total-1-l,t)):e!==this.tableTranslate&&this.propsSkip+i-l!==this.propsSkip&&(this.translate(e-a),this.changePage(this.propsSkip+i-l,t)))}scrollNonStrict(t){const s=this.total*this.prevScrollPos/this.containerHeight;let o=Math.floor(s);o>=this.total&&(o=this.total-1);const e=Math.min(s-o,1);let i=0;const l=o-this.propsSkip,a=this.rowHeights;l>=0&&l<=1?i=-((a[0].line+a[0].acc)*e):l===-1&&(i=-((a[a.length-1].line+a[a.length-1].acc)*e));const{topItemsCount:c,topItemsHeight:h}=this.topItems(a,!!this.topCacheCount);this.translate(Math.max(0,i-h-this.horizontalScrollbarHeight()+this.containerHeight*s/this.total)),this.changePage(o-c,t)}scrollHandler(t){if(!this.scrollableVirtual)return;if(this.scrollSyncing||!this.container||!this.table){this.scrollSyncing=!1;return}const s=this.container.scrollTop,o=this.prevScrollPos;if(this.prevScrollPos=s,this.askedSkip!==void 0){this.translate(this.containerHeight*this.askedSkip/this.total),this.changePage(this.askedSkip,t),this.prevScrollPos=s,this.askedSkip=void 0;return}s-o<0&&s>this.tableTranslate-this.table.scrollHeight/10?this.localScrollUp(t):s-o>0&&s<this.tableTranslate+this.table.scrollHeight*2/3?this.localScrollDown(t):this.scrollNonStrict(t),this.prevScrollPos=s}}class ct{constructor(t=0,s,o,e){this.total=t,this.offsets=[],this.heights=[];let i=0;for(let l=0;l<t;l++){this.offsets.push(i);const a=e&&e[l].expanded&&e[l].rowType==="data"?o:s;i+=a,this.heights.push(a)}}height(t){return this.heights[t]}index(t){if(t<0)return;const s=this.offsets.reduce((o,e,i)=>{if(o!==void 0)return o;if(e===t)return i;if(e>t)return i-1},void 0);return s===void 0?this.total-1:s}offset(t){return this.offsets[t]}totalHeight(){const t=this.offsets[this.offsets.length-1],s=this.heights[this.heights.length-1];return t+s}}class ht{constructor(t){this.table=null,this.containerHeight=0,this.topCacheCount=0,this.attendedSkip=0,this.propsSkip=0,this.total=0,this.scrollableVirtual=!1,this.realSkip=0,this.pageSize=0,this.PageChange=null,this.tableBodyRef=n.createRef(),this.fixedScroll=!1,this.askedSkip=void 0,this.containerRef=n.createRef(),this.tableTransform="",this.scrollSyncing=!1,this.lastLoaded=0,this.firstLoaded=0,this.lastScrollTop=0,this.reactVersion=Number.parseFloat(n.version),this.firstLoaded=this.pageSize,this.lastLoaded=this.realSkip+this.pageSize,this.scrollHandler=this.scrollHandler.bind(this)}get container(){return this.containerRef.current}translate(t,s){this.scrollableVirtual&&this.table&&(Ie||this.reactVersion<=17||s?this.table.style.transform="translateY("+t+"px)":this.tableTransform="translateY("+t+"px)")}changePage(t,s){this.PageChange&&this.PageChange({skip:Math.max(0,t),take:this.pageSize},s)}reset(){this.scrollSyncing=!0,!this.fixedScroll&&(this.container&&(this.container.scrollTop=0),this.translate(0,!0))}scrollHandler(t){if(!this.scrollableVirtual||!this.container||!this.table||!this.rowHeightService||!this.containerRef.current)return;if(this.scrollSyncing){this.scrollSyncing=!1;return}const s=this.container.scrollTop,o=this.lastScrollTop>=s,e=!o;this.lastScrollTop=s;let i=this.rowHeightService.index(s),l=this.rowHeightService.offset(i);const{offsetHeight:a}=this.containerRef.current,c=this.rowHeightService.index(s+a);if(e&&c>=this.lastLoaded&&this.lastLoaded<this.total){const h=i+this.pageSize-this.total;h>0&&(i=i-h,l=this.rowHeightService.offset(i)),this.firstLoaded=i,this.translate(l);let d=this.firstLoaded+this.pageSize;this.lastLoaded=Math.min(d,this.total),this.changePage(this.firstLoaded,t)}else if(o&&i<this.firstLoaded){const h=Math.floor(this.pageSize*.3);this.firstLoaded=Math.max(i-h,0),this.translate(this.rowHeightService.offset(this.firstLoaded)),this.lastLoaded=Math.min(this.firstLoaded+this.pageSize,this.total),this.changePage(this.firstLoaded,t)}}}const Is=1,Ss=20;class ys{constructor(t){this.columns=[],this.resizable=!1,this.isRtl=!1,this.setIsRtl=s=>{this.isRtl=s},this.dragHandler=(s,o,e,i)=>{const l=s.originalEvent;i||(l.preventDefault(),l.stopPropagation(),l.stopImmediatePropagation());const a=e.closest("th");if(!a||!a)return;const c=a.clientWidth;let h=c;if(this.isRtl?h+=e.getBoundingClientRect().right-e.offsetWidth/2-s.clientX:h+=s.clientX-e.getBoundingClientRect().left-e.offsetWidth/2,!i&&Math.abs(h-c)<1)return;this.fixateInitialWidths(a.parentElement.clientWidth),this.setWidths(o,Math.floor(h)/c);const d=this.columns.filter(f=>!f.children.length).findIndex(f=>f.id===o.id);this.onResize(d,c,h,l,i,o.id)},this.dblClickHandler=(s,o)=>{const e=this.columns.filter(b=>o.indexOf(b.id)>-1);if(!this.colGroupMain||!e.length)return;const i={},l=e;for(;l.length>0;){const b=l.pop();if(!b)break;b.children.length?l.push(...b.children):i[b.id]=b}const a=this.columns.filter(b=>!b.children.length),c=[];a.forEach((b,u)=>{i[b.id]&&c.push(u)});const h=[this.colGroupMain.parentElement],d=[this.colGroupMain];this.colGroupHeader&&(h.push(this.colGroupHeader.parentElement),d.push(this.colGroupHeader)),this.colGroupFooter&&(h.push(this.colGroupFooter.parentElement),d.push(this.colGroupFooter)),h.forEach(b=>b.classList.add("k-autofitting"));let f=[];d.forEach(b=>{c.forEach(u=>{b.children[u]&&(b.children[u].width="",f[u]=Math.max(f[u]||0,b.children[u].offsetWidth+Is))})}),d.forEach(b=>{c.forEach(u=>{b.children[u]&&(b.children[u].width=f[u]+"px",a[u].width=f[u])})}),h.forEach(b=>b.classList.remove("k-autofitting")),this.onResize(c[0],0,0,s,!0,o[0])},this.updateColElements=s=>{const o=this.columns.filter(i=>!i.children.length);let e=1e-10;for(let i=0;i<s.length;i++){const l=s[i],a=o.findIndex(f=>f.id===l.id),c=parseFloat((l.width||0).toString()),h=Math.floor(c);e+=c-h;const d=h+Math.floor(e);if(e-=Math.floor(e),this.colGroupMain&&this.colGroupMain.children[a]){const f=parseInt(this.colGroupMain.children[a].width,10);this.colGroupMain.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupMain.parentElement,l,f-d)}if(this.colGroupHeader&&this.colGroupHeader.children[a]){const f=parseInt(this.colGroupHeader.children[a].width,10);this.colGroupHeader.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupHeader.parentElement,l,f-d)}if(this.colGroupFooter&&this.colGroupFooter.children[a]){const f=parseInt(this.colGroupFooter.children[a].width,10);this.colGroupFooter.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupFooter.parentElement,l,f-d)}}},this.onResize=t}fixateInitialWidths(t){const s=this.columns.filter(l=>!l.children.length);let o=0,e=this.colGroupMain?this.colGroupMain.children:[];for(let l=0;l<e.length;l++)e[l].width?t-=parseFloat(e[l].width):o++;if(o===0)return;const i=Math.floor(t/o);for(let l=0;l<e.length;l++){const a=e[l];a.width||(a.width=i,s[l].width=i.toString(),this.colGroupHeader&&(this.colGroupHeader.children[l].width=i),this.colGroupFooter&&(this.colGroupFooter.children[l].width=i))}}setWidths(t,s){const o=this.columns.findIndex(l=>l.id===t.id),e=[];let i=t.children.length;for(let l=o+1;i>0&&l<this.columns.length;l++,i--){const a=this.columns[l];a.children.length?i+=a.children.length:e.push(a)}return e.length===0&&e.push(t),e.forEach(l=>{let a=l.width?parseFloat(l.width.toString())*s:0;const c=l.minResizableWidth===void 0?10:l.minResizableWidth;a<c&&(a=c),l.width=a}),this.updateColElements(e),e}updateNextLockedCol(t,s,o){const e=s.index,i=this.colGroupMain.parentElement.closest(".k-grid"),l=i==null?void 0:i.clientWidth,a=this.columns.filter(c=>c.locked).map(c=>parseInt(c.width+"",10)).reduce((c,h)=>c+h,0);!s.locked||l<=a+Ss||this.columns.forEach(c=>{if(c!=null&&c.locked&&o){const h=t==null?void 0:t.querySelectorAll('[aria-colindex="'+c.ariaColumnIndex+'"]');h==null||h.forEach(d=>{const f=d.style;this.isRtl?(c.index>e&&f&&f.right&&(f.right=parseInt(f.right,10)-o+"px"),c.index<e&&f&&f.left&&(f.left=parseInt(f.left,10)-o+"px")):(c.index>e&&f&&f.left&&(f.left=parseInt(f.left,10)-o+"px"),c.index<e&&f&&f.right&&(f.right=parseInt(f.right,10)-o+"px"))})}})}}class Pt{constructor(t,s,o){this.refDragElementClue=n.createRef(),this.refDropElementClue=n.createRef(),this.columns=[],this.reorderable=!1,this.groupable=!1,this.startColumn=-1,this.startGroup=-1,this.currentColumn=-1,this.currentGroup=-1,this.groupPanelDivElement=null,this.refGroupPanelDiv=e=>{this.groupPanelDivElement=e&&e.children?e.children[0]:e},this.pressHandler=(e,i)=>{const l=this.getColumnIndex(e,i);if(this.startGroup=this.getGroupIndex(e),l>=0){const a=this.columns[l];(a.reorderable&&this.reorderable||a.groupable&&this.groupable)&&(this.startColumn=l)}},this.dragHandler=(e,i)=>{if(e.isTouch||e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),this.startColumn===-1&&this.startGroup===-1)return;this.currentColumn=this.getColumnIndex(e,i);const l=this.groupPanelDivElement&&this.groupPanelDivElement.children;this.currentGroup=this.isTargetGroupingContainer(e)?l&&l.length?l.length:0:this.getGroupIndex(e);const a=!this.isValid();a&&(this.currentColumn=-1,this.currentGroup=-1);const c=this.currentColumn>=0?i.children[this.columns[this.currentColumn].index]:this.isTargetGroupingContainer(e)?e.originalEvent.target:this.groupPanelDivElement&&this.groupPanelDivElement.children[this.currentGroup];this.updateDragElementClue(e,i,c,a),this.updateDropElementClue(e,i,c,a)},this.releaseHandler=e=>{const i=this.startColumn,l=this.currentColumn,a=this.startGroup,c=this.currentGroup;e.originalEvent.preventDefault(),this.dropElementClue&&this.dropElementClue.setState({visible:!1}),this.dragElementClue&&this.dragElementClue.setState({visible:!1});const h=this.isValid();this.startColumn=this.startGroup=this.currentColumn=this.currentGroup=-1,h&&(i>=0&&l>=0?this.columnReorder(i,l,e.originalEvent):a>=0&&c>=0?this.groupReorder(a,c,e.originalEvent):i>=0&&c>=0&&this.columnToGroup(i,c,e.originalEvent))},this.columnReorder=t,this.groupReorder=s,this.columnToGroup=o}get dragClueRef(){return this.refDragElementClue}get dropClueRef(){return this.refDropElementClue}get dragElementClue(){return this.refDragElementClue.current}get dropElementClue(){return this.refDropElementClue.current}getColumnIndex(t,s){if(!s||s.parentElement===this.groupPanelDivElement)return-1;const o=C.getIndex(t,s);if(o===-1)return-1;for(let e=0;e<s.parentNode.children.length;e++)if(s.parentNode.children[e]===s)return this.columns.findIndex(i=>i.index===o&&i.depth===e);return-1}isTargetGroupingContainer(t){const s=t.originalEvent.target;return s.className.indexOf?s.className.indexOf("k-grouping-drop-container")!==-1:!1}getGroupIndex(t){return C.getIndex(t,this.groupPanelDivElement)}isValid(){return this.startGroup>=0?this.currentGroup>=0&&this.currentGroup!==this.startGroup:this.startColumn===-1?!1:this.currentGroup>=0?this.columns[this.startColumn].groupable===!0&&this.groupable===!0:this.reorderable===!0&&this.currentColumn>=0&&this.currentColumn!==this.startColumn&&this.columns[this.startColumn].reorderable===!0&&this.columns[this.currentColumn].parentIndex===this.columns[this.startColumn].parentIndex}updateDragElementClue(t,s,o,e){if(!this.dragElementClue)return;const i=this.startColumn>=0?s.children[this.columns[this.startColumn].index].innerText:s.innerText;this.dragElementClue.setState({visible:!0,top:t.pageY+10,left:t.pageX,innerText:i,status:e||!o?"k-i-cancel":"k-i-plus"})}updateDropElementClue(t,s,o,e){if(!this.dropElementClue)return;if(e||!o){this.dropElementClue.setState({visible:!1});return}const i=o.getBoundingClientRect(),a=(o.closest(".k-grouping-header")||o).getBoundingClientRect();let c=i.left+t.pageX-t.clientX-6;!this.isTargetGroupingContainer(t)&&(this.currentColumn>this.startColumn||this.currentGroup>this.startGroup&&this.startGroup!==-1)&&(c+=i.width);const h=a.top+t.pageY-t.clientY;this.dropElementClue.setState({visible:!0,top:h,left:c,height:this.currentColumn>=0?s.clientHeight:a.height})}}const _t=r=>{let t=null;const s=I.useInternationalization(),o=C.useTableKeyboardNavigation(r.id),e=n.useCallback(h=>{r.onContextMenu&&r.onContextMenu.call(void 0,h,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]);let i=null,l=null;if(r.rowType==="groupFooter")i={onContextMenu:e,className:r.className},t=n.createElement("td",{...i});else if(r.rowType!=="groupHeader"){if(r.field!==void 0){const d=L(r.field,r.dataItem);d!=null&&(l=r.format?s.format(r.format,d):d.toString())}const h=g.classNames("k-table-td",r.className,{"k-selected":r.isSelected});i={onContextMenu:e,colSpan:r.colSpan,style:r.style,className:h,role:"gridcell","aria-colindex":r.ariaColumnIndex,"aria-selected":r.isSelected,[U]:r.columnIndex,...o},t=n.createElement("td",{...i},l)}const a=r.rowType||"data",c=r.cells;if(c&&c[a]){const h=c[a];return n.createElement(h,{...r,tdProps:i},l)}return r.render?r.render.call(void 0,t,r):t},Pe=r=>{let t=null;const{columnIndex:s,level:o,columnsCount:e,rowType:i,dataItem:l,field:a,onChange:c,expanded:h,render:d,dataIndex:f,ariaColumnIndex:b,isRtl:u}=r,x=a||"",y=C.useTableKeyboardNavigation(r.id),v=I.useLocalization();let k=null,R=null,E=null;const P=n.useCallback(T=>{T.isDefaultPrevented()||T.keyCode===g.Keys.enter&&c&&(T.preventDefault(),c({dataItem:l,dataIndex:f,syntheticEvent:T,field:void 0,value:!h}))},[h,c,l,f]),z=n.useCallback(T=>{r.onContextMenu&&r.onContextMenu.call(void 0,T,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]),ae=(T,Ce)=>{const ce=h?yt:St,be=v.toLanguageString(ce,S[ce]);return k={className:"k-table-td",style:{...r.style,...Ce},colSpan:T,key:"g-colspan",role:"gridcell",["aria-selected"]:!1,["aria-expanded"]:h,["aria-colindex"]:b,onKeyDown:P,onContextMenu:z,...y},E=n.createElement("p",{className:"k-reset"},n.createElement("a",{onClick:Q=>{Q.preventDefault(),c&&c({dataItem:l,dataIndex:f,syntheticEvent:Q,field:void 0,value:!h})},href:"#",tabIndex:-1,"aria-label":be},n.createElement(g.IconWrap,{name:h?"caret-alt-down":u?"caret-alt-left":"caret-alt-right",icon:h?w.caretAltDownIcon:u?w.caretAltLeftIcon:w.caretAltRightIcon})),l[x]instanceof Date&&l[x].toString?l[x].toString():l[x]),n.createElement("td",{...k,key:k.key},E)};s===void 0||o===void 0||s<o||e===void 0||i!=="groupHeader"||l[x]===void 0?(k={style:r.style,key:"g"+s,className:g.classNames("k-table-td","k-group-cell",{"k-grid-content-sticky":r.locked}),role:"gridcell",onContextMenu:z},t=n.createElement("td",{...k,key:k.key})):s<=o&&!r.locked?t=ae(e-s,{}):s<=o&&r.locked&&(R={className:"k-table-td",role:"gridcell",colSpan:e-s,style:{borderLeftWidth:0,borderRightWidth:0},onContextMenu:z},t=n.createElement(n.Fragment,null,ae(0,{position:"sticky",zIndex:2}),n.createElement("td",{...R})));const Y=r.rowType||"data",V=r.cells;if(V&&V.group&&V.group[Y]){const T=V.group[Y];return n.createElement(T,{...r,tdProps:k,td2Props:R},E)}return d?d.call(void 0,t,r):t};class At extends n.Component{render(){const t=g.classNames("k-table-row",{"k-table-group-row k-grouping-row":this.props.rowType==="groupHeader","k-group-footer":this.props.rowType==="groupFooter","k-master-row":this.props.rowType!=="groupHeader"&&this.props.rowType!=="groupFooter","k-table-alt-row k-alt":this.props.rowType!=="groupHeader"&&this.props.rowType!=="groupFooter"&&this.props.isAltRow,"k-selected":this.props.isSelected,"k-grid-edit-row":this.props.isInEdit}),s=n.createElement("tr",{id:this.props.id,onClick:this.props.onClick,onDoubleClick:this.props.onDoubleClick,className:t,style:{height:this.props.rowHeight?this.props.rowHeight+"px":"",visibility:this.props.isHidden?"hidden":""},role:"row","aria-rowindex":this.props.ariaRowIndex,"absolute-row-index":this.props.absoluteRowIndex,key:this.props.absoluteRowIndex,[Ft]:this.props.rowType==="data"?this.props.dataIndex:void 0},this.props.children);return this.props.render?this.props.render.call(void 0,s,this.props):s}}class ws extends n.Component{get _inputId(){return this.props.id}render(){const{columnMenuWrapperProps:t}=this.props,s=[n.createElement("span",{key:0,className:"k-checkbox-wrap"},n.createElement("input",{checked:this.props.selectionValue,id:this._inputId,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:o=>this.props.selectionChange({field:this.props.field,syntheticEvent:o})})),n.createElement("label",{key:1,className:"k-checkbox-label",htmlFor:this._inputId}),t.columnMenu&&n.createElement(Be,{...t})];return this.props.render?this.props.render.call(void 0,s,this.props):s}}const Rs=g.withIdHOC(ws);class fe extends n.Component{render(){return this.props.children||I.provideLocalizationService(this).toLanguageString(Se,S[Se])}}fe.displayName="KendoReactGridNoRecords";I.registerForLocalization(fe);class Ns extends n.Component{constructor(){super(...arguments),this._element=null,this.renderCell=(t,s)=>{const o={colSpan:t.colSpan!==1?t.colSpan:void 0,style:t.left!==void 0?this.props.isRtl?{left:t.right,right:t.left}:{left:t.left,right:t.right}:{},className:g.classNames("k-table-td",t.locked&&t.left!==void 0?"k-grid-footer-sticky":""),key:s,role:"gridcell",["aria-colindex"]:t.ariaColumnIndex},e={field:t.field,ariaColumnIndex:t.ariaColumnIndex,...o},i=ge(this.props.cells,t.cells);if(i&&i.footerCell){const l=i.footerCell;return n.createElement(l,{...e,tdProps:o,index:s})}return t.footerCell&&n.createElement(t.footerCell,{...e,key:s})||n.createElement("td",{...o})}}get element(){return this._element}render(){return n.createElement("tr",{className:"k-table-row",role:"row","aria-rowindex":this.props.ariaRowIndex},ls(this.props.columns).map(this.renderCell))}}const Fs=({buttonCount:r=10,info:t=!0,type:s="numeric",pageSizes:o=void 0,previousNext:e=!0,responsive:i=void 0,pageSizeValue:l=void 0})=>({buttonCount:r,info:t,pageSizes:o===!0?[5,10,20]:o||void 0,previousNext:e,responsive:i!==!1,type:s,pageSizeValue:l}),Ds=r=>Fs(r===!0?{}:r),dt={name:"@progress/kendo-react-grid",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},Ts=r=>{const{colSpan:t,ariaColIndex:s,dataItem:o,dataIndex:e,id:i}=r,l=C.useTableKeyboardNavigation(i),a=n.useCallback(c=>{r.onContextMenu&&r.onContextMenu.call(void 0,c,r.dataItem)},[r.onContextMenu,r.dataItem]);return n.createElement("td",{onContextMenu:a,className:"k-table-td k-detail-cell",colSpan:t,"aria-colindex":s,role:"gridcell",...l},n.createElement(r.detail,{dataItem:o,dataIndex:e}))},Gs=r=>{const t=C.useTableKeyboardNavigation(r.id);return n.createElement("td",{className:"k-table-td k-hierarchy-cell",...t,role:"gridcell"})};let X=class extends n.Component{constructor(t){super(t),this._columns=[],this._columnsMap=[[]],this._columnsMutations=0,this._resized=!1,this._shouldUpdateLeftRight=!0,this.contextStateRef={current:void 0},this.navigationStateRef={current:void 0},this._data=[],this._slicedData=void 0,this.wrapperScrollTop=0,this.showLicenseWatermark=!1,this.headerRef=n.createRef(),this.headerElementRef=n.createRef(),this._element=null,this.tableElement=null,this.containerRef=n.createRef(),this.tableBodyRef=n.createRef(),this._footer=null,this.forceUpdateTimeout=void 0,this.isRtl=!1,this.observer=null,this.handleIntersection=e=>{const i={rowIndex:this.rowIndex};e.forEach(l=>{l.isIntersecting||this.setCurrentOnTop(i)})},this.setCurrentOnTop=e=>{if(!this.vs.container||this.props.scrollable==="none")return;this.observer&&this.observer.disconnect();const{rowIndex:i}=e;if(this.props.scrollable==="virtual")this.vs.askedSkip=i,this.vs.container.scroll(0,Math.round(this.vs.askedSkip/this.vs.total*this.vs.container.scrollHeight));else if(this.element){const l=i<1?this.element.querySelector("tbody > tr:nth-child(1)"):this.element.querySelector(`tbody > tr:nth-child(${i+1})`);l&&this.containerRef.current&&(this.containerRef.current.scrollTop=l.offsetTop)}},this.scrollIntoView=e=>{if(!this.vs.container||this.props.scrollable==="none")return;this.rowIndex=e.rowIndex;const{rowIndex:i}=e,l=this.element;if(this.observer&&l){this.observer.disconnect();const a=l.querySelector(`[absolute-row-index="${i}"]`);a?this.observer.observe(a):this.setCurrentOnTop(e)}},this.fitColumns=e=>{this.columnResize.dblClickHandler(null,e)},this.onContextMenu=(e,i,l)=>{if(this.props.onContextMenu){const a={target:this,syntheticEvent:e,nativeEvent:e.nativeEvent,dataItem:i,field:l};this.props.onContextMenu.call(void 0,a)}},this.getVirtualScroll=e=>{const{rowHeight:i,detailRowHeight:l,detail:a,expandField:c,groupable:h}=e,d=this.isAllData(),f=i!==void 0&&i>0,b=l!==void 0&&l>0,u=h===!0||typeof h=="object"&&h.enabled!==!1;return!f||u&&!d||!!(a&&c)&&(!b||!d)?Es:ht},this.isAllData=()=>{const{data:e,total:i}=this.props;return Array.isArray(e)?e.length===i:e?i===e.total:!1},this.initializeVirtualization=(e,i)=>{if(this.reInitVirtualization(this.props.scrollable==="virtual",this.props.total,this.props.filter,this.props.group,this.props.sort,i||this.props.rowHeight===void 0||this.props.rowHeight===0),this.vs.fixedScroll=this.props.fixedScroll||!1,this.vs.PageChange=this.pageChange,this.vs.realSkip=this.props.skip||0,this.vs.pageSize=(this.props.take!==void 0?this.props.take:this.props.pageSize)||0,this.vs.scrollableVirtual=this.props.scrollable==="virtual",this.vs.total=e,this.vs.propsSkip=(this.props.skip||0)+(this.props.scrollable==="virtual"?this.vs.topCacheCount+(this.vs.attendedSkip-(this.props.skip||0)):0),this.props.rowHeight!==void 0&&this.props.rowHeight>0&&!i){const l=this.props.rowHeight*e;this.vs.containerHeight=Ie?Math.min(at,l):l}else this.vs.containerHeight=1533915;if(this.vs.containerRef=this.containerRef,this.vs.tableBodyRef=this.tableBodyRef,this.vs.table=this.tableElement,this._slicedData=void 0,this.vs instanceof ht){const{rowHeight:l=0,detail:a,expandField:c}=this.props;let{detailRowHeight:h=0}=this.props;h=a&&c?h:l,this.isAllData()?(this.vs.total=this._data.length,this._slicedData=this._data.slice(this.vs.realSkip,this.vs.realSkip+this.vs.pageSize),this.vs.rowHeightService=this.rowHeightService(this.vs,this._data.length,l,h,this._data)):this.vs.rowHeightService=new ct(e,l,h);const d=this.vs.rowHeightService.totalHeight();this.vs.containerHeight=Ie?Math.min(at,d):d}},this.scrollHandler=e=>{if(e.target!==e.currentTarget)return;clearTimeout(this.forceUpdateTimeout),this.vs.table=this.tableElement;const i=e.currentTarget.scrollLeft,l=e.currentTarget.scrollTop;this.props.columnVirtualization&&(!this.vs.scrollableVirtual||l===this.wrapperScrollTop)&&(this.forceUpdateTimeout=window.setTimeout(()=>{this.forceUpdate()},0)),this._header&&this._header.setScrollLeft(i),this._footer&&this._footer.setScrollLeft(i),this.vs&&l!==this.wrapperScrollTop&&this.vs.scrollHandler(e),g.dispatchEvent(this.props.onScroll,e,this,void 0),this.wrapperScrollTop=l},this.onKeyDown=e=>{if(C.tableKeyboardNavigation.onKeyDown(e,{contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,onNavigationAction:this.onNavigationAction}),this.props.onKeyDown){const{mode:i,cell:l}=C.getSelectionOptions(this.props.selectable),a={dataItems:this.getLeafDataItems(),mode:i,cell:l,componentId:this._gridId,selectedField:this.props.selectedField,...this.getArguments(e)};this.props.onKeyDown.call(void 0,a)}},this.onFocus=e=>{C.tableKeyboardNavigation.onFocus(e,{contextStateRef:this.contextStateRef})},this.onNavigationAction=e=>{if(this.props.onNavigationAction){const i={focusElement:e.focusElement,...this.getArguments(e.event)};this.props.onNavigationAction.call(void 0,i)}},this.rowClick=(e,i)=>{this.props.onRowClick&&e.target.nodeName==="TD"&&this.props.onRowClick.call(void 0,{dataItem:i.dataItem,...this.getArguments(e)})},this.rowDblClick=(e,i)=>{this.props.onRowDoubleClick&&e.target.nodeName==="TD"&&this.props.onRowDoubleClick.call(void 0,{dataItem:i.dataItem,...this.getArguments(e)})},this.itemChange=e=>{const i=this.props.onItemChange;if(e.field===this.props.expandField||this.props.group&&e.field===void 0){const l=this.props.onExpandChange;l&&l.call(void 0,{...this.getArguments(e.syntheticEvent),dataItem:e.dataItem,dataIndex:e.dataIndex,value:e.value});return}i&&i.call(void 0,{...this.getArguments(e.syntheticEvent),dataItem:e.dataItem,field:e.field,value:e.value})},this.onHeaderSelectionChange=e=>{this.props.onHeaderSelectionChange&&this.props.onHeaderSelectionChange.call(void 0,{field:e.field,nativeEvent:e.syntheticEvent&&e.syntheticEvent.nativeEvent,syntheticEvent:e.syntheticEvent,target:this,dataItems:this.getLeafDataItems(),selectedField:this.props.selectedField})},this.selectionRelease=e=>{if(this.props.onSelectionChange){const i={syntheticEvent:void 0,target:this,selectedField:this.props.selectedField||"",componentId:this._gridId,dataItems:this.getLeafDataItems(),dataItem:null,...e};this.props.onSelectionChange.call(void 0,i)}},this.pageChange=(e,i,l)=>{this.raiseDataEvent(this.props.onPageChange,{page:e},{skip:e.skip,take:e.take},i,l)},this.pagerPageChange=e=>{this.pageChange({skip:e.skip,take:e.take},e.syntheticEvent,e.targetEvent)},this.sortChange=(e,i)=>{this.raiseDataEvent(this.props.onSortChange,{sort:e},{sort:e,...this.props.scrollable==="virtual"?{skip:0}:{}},i)},this.filterChange=(e,i)=>{this.raiseDataEvent(this.props.onFilterChange,{filter:e},{filter:e||void 0,skip:0},i)},this.groupChange=(e,i)=>{const l=i.nativeEvent?i:{nativeEvent:i.nativeEvent||i.originalEvent};this.raiseDataEvent(this.props.onGroupChange,{group:e},{group:e,skip:0},l)},this.onClipboard=(e,i)=>{if(this.props.onClipboard){if(!this.inActiveElement()||!e)return;this.props.onClipboard.call(void 0,{type:e,nativeEvent:i,columns:this._columns,dataItemKey:this.props.dataItemKey||"",...typeof this.props.clipboard!="boolean"?this.props.clipboard:{}})}},this.inActiveElement=()=>{var c,h,d;if(!g.canUseDOM)return!1;const e=g.getActiveElement(this.document),i=e?e.matches(".k-table-td")?e:(c=this.document)==null?void 0:c.body:(h=this.document)==null?void 0:h.body,l=i.closest(".k-grid-container"),a=i&&((d=this._element)==null?void 0:d.contains(i));return!!(i&&a&&l)},this.onResize=(e,i,l,a,c,h)=>{this.resetTableWidth(),this._shouldUpdateLeftRight=!0,this._resized=!0,this._columnsMutations++,this.props.onColumnResize&&this.props.onColumnResize.call(void 0,{columns:this.columns,nativeEvent:a,targetColumnId:h,index:e,newWidth:i,oldWidth:l,end:c,target:this})},this.reInitVirtualization=g.memoizeOne((e,i,l,a,c,h)=>{this.vs.reset();const d=this.getVirtualScroll(this.props);this.vs=new d(h)}),this.flatData=g.memoizeOne((e,i,l,a,c,h,d)=>{const f=[],b=pt(f,e,i,{index:l},a!==void 0,c);return{flattedData:f,resolvedGroupsCount:b}}),this.rowHeightService=g.memoizeOne((e,i,l,a,c)=>new ct(i,l,a,c)),this.childrenToArray=g.memoizeOne(e=>n.Children.toArray(e)),this.readColumns=g.memoizeOne((e,i,l)=>{const a=e.filter(c=>c&&c.type&&c.type.displayName==="KendoReactGridColumn");return ut(a,this.columns,{prevId:0,idPrefix:i})}),this.mapColumns=g.memoizeOne(e=>C.mapColumns(e)),this.configureColumns=g.memoizeOne((e,i,l)=>{this.props.selectedField&&e.filter(h=>h.field===this.props.selectedField).forEach(h=>{h.width=h.width||"50px",h.cell=h.cell||ft,h.headerCell=h.headerCell||Rs});const a={id:"",resizable:!0,width:"32px",title:" ",declarationIndex:-1,orderIndex:-1,children:[],parentIndex:-1,depth:0,colSpan:0,rowSpan:0,left:0,right:0,index:0,rightBorder:!1,ariaColumnIndex:0,isAccessible:!0};let c=0;this.props.expandField&&this.props.onExpandChange&&this.props.detail&&(e.unshift({...a,cell:Nt,field:this.props.expandField,headerClassName:"k-hierarchy-cell k-header",id:C.tableKeyboardNavigationTools.generateNavigatableId(`${this._columns.length}`,l,"column")}),c++);for(let h=0;h<i;h++)e.unshift({...a,isAccessible:!1,cell:Pe,field:"value",locked:this.props.lockGroups}),c++;e.slice(c).forEach(h=>h.parentIndex>=0&&(h.parentIndex+=c))}),this.getHeaderRow=g.memoizeOne((e,i,l,a,c,h,d,f,b,u,x,y)=>n.createElement(Mt,{cells:this.props.cells,sort:e,sortable:i,sortChange:this.sortChange,group:l||[],groupable:a,groupChange:this.groupChange,filter:c,filterable:h,filterOperators:d,filterChange:this.filterChange,columnMenu:b,selectionChange:this.onHeaderSelectionChange,columns:u,columnResize:this.columnResize,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler,columnsMap:x,cellRender:f,isRtl:y,dragClue:this.dragLogic.dragClueRef,headerRef:this.headerElementRef,containerRef:this.containerRef})),this.resolveTitle=e=>{const i=this._columns.find(a=>a.field===e),l=i&&(i.title||i.field);return l===void 0?e:l},this.getLeafDataItems=()=>this._data.filter(e=>e.rowType==="data").map(e=>e.dataItem),g.validatePackage(dt),this.showLicenseWatermark=g.shouldShowValidationUI(dt);const s=this.props.groupable===!0||typeof this.props.groupable=="object"&&this.props.groupable.enabled!==!1,o=this.getVirtualScroll(t);this.vs=new o(s||t.rowHeight===void 0||t.rowHeight===0),this.dragLogic=new Pt(this.columnReorder.bind(this),this.groupReorder.bind(this),this.columnToGroup.bind(this)),this.columnResize=new ys(this.onResize),this.props.clipboard&&(this.clipboardService=new C.ClipboardService(this.onClipboard)),C.tableKeyboardNavigation.onConstructor({navigatable:!!t.navigatable,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,idPrefix:this._gridId})}get columns(){const t=this._columns.filter(s=>s.declarationIndex>=0&&s.parentIndex===-1);return gt(t)}get element(){return this._element}get document(){if(g.canUseDOM)return this.element&&this.element.ownerDocument||document}get _header(){return this.headerRef.current}get _gridId(){return this.props.id+"-role-element-id"}componentDidMount(){this.resetTableWidth(),g.setScrollbarWidth();const t=C.isRtl(this.element);this.isRtl=t,C.tableKeyboardNavigation.onComponentDidMount({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),this.isRtl&&this.forceUpdate();const s={rootMargin:"0px",threshold:.9};this.clipboardService&&this.clipboardService.addEventListeners(this.document),this.observer=g.canUseDOM&&window.IntersectionObserver&&new window.IntersectionObserver(this.handleIntersection,s)||null}getSnapshotBeforeUpdate(){return C.tableKeyboardNavigation.onGetSnapshotBeforeUpdate({document:this.document,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),null}componentDidUpdate(){this.resetTableWidth(),g.setScrollbarWidth(),this.vs.tableTransform&&this.vs.table&&(this.vs.table.style.transform=this.vs.tableTransform,this.vs.tableTransform=""),C.tableKeyboardNavigation.onComponentDidUpdate({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}componentWillUnmount(){clearTimeout(this.forceUpdateTimeout),this.clipboardService&&this.clipboardService.removeEventListeners(this.document)}render(){var nt;let t=this.props.total||0;const s=C.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);let o=[];Array.isArray(this.props.data)?(o=this.props.data,t=t||this.props.data.length):this.props.data&&(o=this.props.data.data,t=t||this.props.data.total);const e=typeof this.props.groupable=="object"&&this.props.groupable.footer||"none",{resolvedGroupsCount:i,flattedData:l}=this.flatData(o,e,this.props.skip||0,this.props.group,this.props.expandField,this.props.filter,this.props.sort);this._data=l;const a=this.props.groupable===!0||typeof this.props.groupable=="object"&&this.props.groupable.enabled!==!1;this.columnResize.resizable=this.props.resizable||!1,this.dragLogic.reorderable=this.props.reorderable||!1,this.dragLogic.groupable=a;const c=this.props.selectable&&this.props.selectable.drag?"none":void 0;this.initializeVirtualization(t,a);const h=this.childrenToArray(this.props.children);this.initColumns(h,i);const d=h.map(m=>m&&m.type&&m.type.displayName==="KendoReactGridToolbar"?n.cloneElement(m,{...m.props,ariaControls:this._gridId}):null),f=h.filter(m=>m&&m.type&&m.type.displayName==="KendoReactGridNoRecords"),b=h.filter(m=>m&&m.type&&m.type.displayName==="KendoReactGridStatusBar"),u=this._columns.filter(m=>m.children.length===0),x=a&&n.createElement(Ht,{group:this.props.group||[],groupChange:this.groupChange,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler,refCallback:this.dragLogic.refGroupPanelDiv,resolveTitle:this.resolveTitle,ariaControls:this._gridId,onContextMenu:this.onContextMenu}),{sort:y,sortable:v,group:k,filter:R,filterable:E,filterOperators:P=Oe,headerCellRender:z,columnMenu:ae}=this.props,Y=n.createElement(us,{size:this.props.size,columnResize:this.columnResize,staticHeaders:this.props.scrollable!=="none",scrollableDataElement:()=>this.vs.container,draggable:this.props.reorderable||a,ref:this.headerRef,elemRef:this.headerElementRef,headerRow:this.getHeaderRow(y,v,k,a,R,E,P,z,ae,this._columns,this._columnsMap,this.isRtl),filterRow:this.props.filterable&&n.createElement(Lt,{cells:this.props.cells,size:this.props.size,columns:this._columns,filter:this.props.filter,filterOperators:this.props.filterOperators||Oe,filterChange:this.filterChange,sort:this.props.sort,cellRender:this.props.filterCellRender,isRtl:this.isRtl,ariaRowIndex:this._columnsMap.length+1})||void 0,cols:u.map((m,F)=>n.createElement("col",{key:F.toString(),width:Ee(m)}))}),V=this.vs&&this.vs.container&&this.vs.container.scrollLeft||0,T=parseFloat(((this.props.style||{}).width||"").toString()),{colSpans:Ce,hiddenColumns:ce}=C.tableColumnsVirtualization({enabled:this.props.columnVirtualization,columns:u,tableViewPortWidth:T,scrollLeft:V}),be=(m,F,D)=>{let q=!1;const W=this.props.selectedField?L(this.props.selectedField,m.dataItem):void 0;return{row:u.map((N,G)=>{if(ce[G])return null;const Z=N.id?N.id:G,ee=`${N.className?N.className+" ":""}${N.locked?"k-grid-content-sticky":""}`,_=N.left!==void 0?this.isRtl?{left:N.right,right:N.left}:{left:N.left,right:N.right}:{};let A=!1;if(N.editable&&this.props.editField){const O=L(this.props.editField,m.dataItem);O&&(O===!0||O===N.field)&&(q=!0,A=!0)}const ke=N.cell||A&&Dt||_t;return n.createElement(ke,{onContextMenu:this.onContextMenu,key:Z,locked:this.props.lockGroups,id:C.tableKeyboardNavigationTools.generateNavigatableId(`${F}-${String(G)}`,s),colSpan:Ce[G],dataItem:m.dataItem,field:N.field,editor:N.editor,format:N.format,className:ee,render:this.props.cellRender,cells:ge(this.props.cells,N.cells),onChange:this.itemChange,selectionChange:this.props.onSelectionChange?O=>{this.selectionChange({event:O,dataItem:m.dataItem,dataIndex:D,columnIndex:G})}:void 0,columnIndex:G,columnsCount:u.length,rowType:m.rowType,level:m.level,expanded:m.expanded,dataIndex:m.dataIndex,style:_,ariaColumnIndex:N.ariaColumnIndex,isSelected:Array.isArray(W)&&W.indexOf(G)>-1})}),isInEdit:q,isSelected:typeof W=="boolean"&&W}};let Q=0;if(this.props.scrollable==="virtual")for(let m=0;m<this.vs.topCacheCount+this.vs.attendedSkip-(this.props.skip||0);m++){const F=this._data.shift();if(F)this._data.push(F),Q++,F.rowType==="groupHeader"&&m--;else break}const Qe=m=>m>=this._data.length-Q;let Je=this.vs.realSkip||0;const he=[];let ve=!1;const xe=this._columnsMap.length+(this.props.filterable?1:0)+1,Ze=n.createElement("div",{key:"no-records",className:"k-grid-norecords","aria-rowindex":xe},n.createElement("div",{className:"k-grid-norecords-template"},f.length?f:n.createElement(fe,null)));let J=0;if(this._data.length){let m=-1,F=0;(this._slicedData||this._data).forEach((D,q)=>{D.rowType==="data"&&(Je++,m++);const W=Je%2===0,N=this.props.dataItemKey&&g.getter(this.props.dataItemKey)(D.dataItem),G=q+(this.vs.realSkip||0),Z=N||"ai"+G,ee=Z+"_1",_=be(D,Z,m);if(J=G+xe+F,he.push(n.createElement(At,{key:Z,dataItem:D.dataItem,isAltRow:W,isInEdit:_.isInEdit,rowType:D.rowType,isHidden:Qe(q),onClick:A=>this.rowClick(A,D),onDoubleClick:A=>this.rowDblClick(A,D),selectedField:this.props.selectedField,rowHeight:this.props.rowHeight,render:this.props.rowRender,ariaRowIndex:J,absoluteRowIndex:G,dataIndex:m,isSelected:_.isSelected},_.row)),this.props.detail&&D.rowType==="data"&&D.expanded){const A=u.length-(this.props.expandField?1:0)-(this.props.group?this.props.group.length:0)||1;F++,J=G+xe+F,he.push(n.createElement("tr",{key:ee,className:g.classNames("k-table-row",W?"k-detail-row k-table-alt-row k-alt":"k-detail-row"),style:{visibility:Qe(q)?"hidden":"",height:this.props.detailRowHeight},role:"row","aria-rowindex":J},this.props.group&&this.props.group.map((ke,O)=>{var lt;const te=(lt=_==null?void 0:_.row[O])==null?void 0:lt.props.style,es=te?this.isRtl?{left:te.right,right:te.left}:{left:te.left,right:te.right}:{};return n.createElement(Pe,{id:"",dataIndex:D.dataIndex,field:ke.field,dataItem:D.dataItem,key:O,style:es,ariaColumnIndex:1+O,isSelected:!1,locked:this.props.lockGroups,isRtl:this.isRtl,cells:this.props.cells})}),this.props.expandField&&n.createElement(Gs,{id:C.tableKeyboardNavigationTools.generateNavigatableId(`${ee}-dhcell`,s)}),n.createElement(Ts,{onContextMenu:this.onContextMenu,dataItem:D.dataItem,dataIndex:D.dataIndex,colSpan:A,ariaColIndex:2+(this.props.group?this.props.group.length:0),detail:this.props.detail,id:C.tableKeyboardNavigationTools.generateNavigatableId(`${ee}-dcell`,s)})))}})}else ve=!0;const et={size:this.props.size,onPageChange:this.pagerPageChange,total:t,dir:this.isRtl?"rtl":void 0,skip:this.vs.propsSkip||0,take:(this.props.take!==void 0?this.props.take:this.props.pageSize)||10,messagesMap:ps,...Ds(this.props.pageable||{})},tt=this.props.pager?n.createElement(this.props.pager,{...et}):n.createElement(C.Pager,{className:"k-grid-pager",...et}),Jt=m=>this.props.sort&&this.props.sort.filter(F=>F.field===m).length>0,Zt=(m,F)=>n.createElement("col",{key:F.toString(),width:Ee(m)}),st=(nt=this.props.cells)!=null&&nt.footerCell||this._columns.some(m=>{var F;return!!(m.footerCell||(F=m.cells)!=null&&F.footerCell)})?n.createElement(ks,{size:this.props.size,columnResize:this.columnResize,staticHeaders:this.props.scrollable!=="none",ref:m=>this._footer=m,row:n.createElement(Ns,{cells:this.props.cells,columns:this._columns,isRtl:this.isRtl,ariaRowIndex:J+1}),cols:u.map(Zt)}):null,rt=n.createElement("colgroup",{ref:m=>{this.columnResize.colGroupMain=m}},u.map((m,F)=>n.createElement("col",{key:F.toString(),className:Jt(m.field)?"k-sorted":void 0,width:Ee(m)}))),it=this.dragLogic.reorderable||this.dragLogic.groupable,ot=this.props.columnVirtualization?"block":"table";if(this.props.scrollable==="none")return n.createElement(C.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},n.createElement("div",{id:this.props.id,style:this.props.style,className:g.classNames("k-grid",{"k-grid-md":!this.props.size,[`k-grid-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),ref:m=>{this._element=m},"aria-label":this.props.ariaLabel,onKeyDown:this.onKeyDown,onFocus:this.onFocus,...C.tableKeyboardNavigationScopeAttributes},d,x,n.createElement(C.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:m=>{this.tableElement=m}},n.createElement("table",{className:g.classNames("k-table k-grid-table",{[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size}),style:{userSelect:c,display:ot}},rt,Y,n.createElement("tbody",{role:"rowgroup",className:"k-table-tbody",...C.tableKeyboardNavigationBodyAttributes},he),st)),ve&&Ze,it&&n.createElement(n.Fragment,null,n.createElement(C.DropClue,{ref:this.dragLogic.refDropElementClue}),n.createElement(C.DragClue,{ref:this.dragLogic.refDragElementClue}))),b,this.props.pageable&&tt);let de=this.props.style||{};return this.props.scrollable==="virtual"&&(de.height||(de=Object.assign({},de,{height:"450px"}))),n.createElement(C.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},n.createElement("div",{id:this.props.id,style:de,className:g.classNames("k-grid",{"k-grid-md":!this.props.size,[`k-grid-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size,"k-grid-virtual":this.props.scrollable==="virtual"},this.props.className),ref:m=>{this._element=m},"aria-label":this.props.ariaLabel,onKeyDown:this.onKeyDown,onFocus:this.onFocus,...C.tableKeyboardNavigationScopeAttributes},d,x,n.createElement("div",{className:"k-grid-aria-root",role:"grid","aria-colcount":u.length,"aria-rowcount":t,id:this._gridId},Y,n.createElement("div",{className:"k-grid-container",role:"presentation"},n.createElement("div",{ref:this.containerRef,className:"k-grid-content k-virtual-content",onScroll:this.scrollHandler,role:"presentation"},n.createElement("div",{className:"k-grid-table-wrap",role:"presentation"},n.createElement(C.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:m=>{this.tableElement=m}},n.createElement("table",{className:g.classNames("k-table k-grid-table",{"k-table-md":!this.props.size,[`k-table-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size}),role:"presentation",style:{userSelect:c,display:ot}},rt,n.createElement("tbody",{className:"k-table-tbody",ref:this.tableBodyRef,role:"rowgroup",...C.tableKeyboardNavigationBodyAttributes},he))),ve&&Ze),n.createElement("div",{className:"k-height-container",role:"presentation"},n.createElement("div",{style:this.props.scrollable==="virtual"?{height:this.vs.containerHeight+"px"}:{}})))),st,it&&n.createElement(n.Fragment,null,n.createElement(C.DropClue,{ref:this.dragLogic.refDropElementClue}),n.createElement(C.DragClue,{ref:this.dragLogic.refDragElementClue})),this.showLicenseWatermark&&n.createElement(g.WatermarkOverlay,null)),b,this.props.pageable&&tt))}selectionChange(t){if(this.props.onSelectionChange){const{event:s,dataItem:o,dataIndex:e,columnIndex:i}=t,{mode:l,cell:a}=C.getSelectionOptions(this.props.selectable),c={...this.getArguments(s.syntheticEvent),dataItem:o,startColIndex:i,endColIndex:i,startRowIndex:e,endRowIndex:e,dataItems:this.getLeafDataItems(),altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,mode:l,cell:a,isDrag:!1,componentId:this._gridId,selectedField:this.props.selectedField||""};this.props.onSelectionChange.call(void 0,c)}}raiseDataEvent(t,s,o,e,i){const l=this.props.onDataStateChange;if(t){const a={...this.getArguments(e),...s,targetEvent:i};t.call(void 0,a)}else l&&l.call(void 0,{...this.getArguments(e),targetEvent:i||{},dataState:{...this.getDataState(),...o}})}columnReorder(t,s,o){const e=this._columns[t],i=e.depth,l=d=>{do d++;while(d<this._columns.length&&this._columns[d].depth>i);return d},a=this._columns.splice(t,l(t)-t);this._columns.splice(t<s?l(s-a.length):s,0,...a),this._columns.filter(d=>d.declarationIndex>=0).forEach((d,f)=>d.orderIndex=f),this._columnsMutations++;const c=this._columns[t].locked&&this._columns[s].locked;C.updateLeft(this._columnsMap,this._columns,c||this._shouldUpdateLeftRight),C.updateRight(this._columnsMap,this._columns,c||this._shouldUpdateLeftRight),this._resized&&(this._shouldUpdateLeftRight=!1,this._resized=!1);const h=this.columns;if(this.forceUpdate(),this.props.onColumnReorder){const d={target:this,columns:h,columnId:e.id,nativeEvent:o};this.props.onColumnReorder.call(void 0,d)}}groupReorder(t,s,o){if(this.props.group===void 0)return;const e=this.props.group.slice();e.splice(s,0,...e.splice(t,1)),this.groupChange(e,o)}columnToGroup(t,s,o){const e=this._columns[t].field;if(!e)return;const i=(this.props.group||[]).slice();i.splice(s,0,{field:e}),this.groupChange(i,o)}resetTableWidth(){let t=0;if(!this.columnResize.colGroupMain)return;const s=this.columnResize.colGroupMain.children;for(let o=0;o<s.length;o++){const e=s[o].width;if(!e)return;t+=parseFloat(e.toString())}t=Math.round(t),this._header&&this._header.setWidth(t),this._footer&&this._footer.setWidth(t),this.tableElement&&(this.tableElement.style.width=t+"px")}initColumns(t,s){const o=C.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);this._columns=this.readColumns(t,o,this._columnsMutations),this._columns.length===0&&(this._columns=os(this.props.data,this.props.group,this.props.expandField,{prevId:0,idPrefix:o})),this.configureColumns(this._columns,s,o),this._columnsMap=this.mapColumns(this._columns),this.columnResize.columns=this._columns,this.dragLogic.columns=this._columns}getDataState(){return{filter:this.props.filter,sort:this.props.sort,skip:this.props.skip,take:this.props.take!==void 0?this.props.take:this.props.pageSize,group:this.props.group}}getArguments(t){return{nativeEvent:t&&t.nativeEvent,syntheticEvent:t,target:this}}};X.displayName="KendoReactGrid";X.defaultProps={};X.propTypes={data:p.oneOfType([p.array,p.shape({data:p.array,total:p.number})]),sortable:p.oneOfType([p.bool,p.shape({mode:p.oneOf(["single","multiple"]),allowUnsort:p.bool})]),onSortChange:p.func,sort:p.array,filterable:p.bool,filter:p.any,onFilterChange:p.func,pageable:p.oneOfType([p.bool,p.shape({buttonCount:p.number,responsive:p.bool,info:p.bool,type:p.oneOf(["numeric","input"]),pageSizes:p.oneOfType([p.bool,p.arrayOf(p.oneOfType([p.string,p.number]))]),previousNext:p.bool})]),pageSize:p.number,onPageChange:p.func,total:p.number,skip:p.number,take:p.number,fixedScroll:p.bool,onExpandChange:p.func,expandField:p.string,selectedField:p.string,onSelectionChange:p.func,onHeaderSelectionChange:p.func,resizable:p.bool,reorderable:p.bool,group:p.any,groupable:p.oneOfType([p.bool,p.shape({enabled:p.bool,footer:p.oneOf(["always","visible","none"])})]),onGroupChange:p.func,onRowClick:p.func,onRowDoubleClick:p.func,onItemChange:p.func,editField:p.string,scrollable:p.oneOf(["none","scrollable","virtual"]),rowHeight:p.number,detailRowHeight:p.number,detail:p.any,style:p.object,onDataStateChange:p.func,onColumnResize:p.func,onColumnReorder:p.func,dataItemKey:p.string,navigatable:p.bool,size:p.oneOf(["small","medium"])};X.contextType=C.TableKeyboardNavigationContext;class le extends n.Component{render(){const{children:t}=this.props;return n.createElement("div",{id:this.props.id,className:g.classNames("k-columnmenu-item-wrapper",this.props.className),style:this.props.style},t)}}class $ extends n.Component{render(){const{title:t,iconClass:s,svgIcon:o,selected:e}=this.props;return n.createElement("div",{onClick:this.props.onClick,className:`k-columnmenu-item ${e?"k-selected":""}`},(s||o)&&n.createElement(g.IconWrap,{name:s&&g.toIconName(s),icon:o}),t)}}class $e extends n.Component{constructor(){super(...arguments),this.onGroupClick=t=>{if(t.preventDefault(),this.props.onGroupChange){const{column:s}=this.props;if(!s.field)return;const o=(this.props.group||[]).slice(),e=o.findIndex(i=>i.field===s.field);e>-1?o.splice(e,1):o.push({field:s.field}),this.props.onGroupChange(o,t)}this.props.onCloseMenu&&this.props.onCloseMenu()}}render(){const{group:t,column:s}=this.props,o=I.provideLocalizationService(this),e=!!(t&&s.field&&t.find(l=>l.field===s.field)),i=e?It:Et;return n.createElement(le,null,n.createElement($,{title:o.toLanguageString(i,S[i]),iconClass:e?"k-i-ungroup":"k-i-group",svgIcon:e?w.ungroupIcon:w.groupIcon,onClick:this.onGroupClick}))}}I.registerForIntl($e);I.registerForLocalization($e);const Bt="asc",Wt="desc",Ms={true:{asc:{asc:"",desc:"desc"},desc:{asc:"asc",desc:""},"":{asc:"asc",desc:"desc"}},false:{asc:{asc:"asc",desc:"desc"},desc:{asc:"asc",desc:"desc"},"":{asc:"asc",desc:"desc"}}},Kt=(r,t)=>t?t.findIndex(s=>s.field===r):-1,Vt=(r,t)=>!!(t&&r>-1&&t[r].dir===Bt),qt=(r,t)=>!!(t&&r>-1&&t[r].dir===Wt);class me extends n.Component{constructor(){super(...arguments),this.onAscClick=t=>{this.onSort(t,Bt),this.props.onCloseMenu&&this.props.onCloseMenu()},this.onDescClick=t=>{this.onSort(t,Wt),this.props.onCloseMenu&&this.props.onCloseMenu()},this.onSort=(t,s)=>{if(t.preventDefault(),!this.props.onSortChange)return;const{column:o,sortable:e,sort:i}=this.props,{allowUnsort:l,mode:a}=Tt(e||!1,!1),c=(i||[]).filter(f=>f.field===o.field)[0],h=Ms[l][c&&c.dir||""][s],d=a==="single"?[]:(this.props.sort||[]).filter(f=>f.field!==o.field);h!==""&&o.field&&d.push({field:o.field,dir:h}),this.props.onSortChange(d,t)}}render(){const{sort:t,column:s}=this.props,o=Kt(s.field,t),e=I.provideLocalizationService(this);return n.createElement(le,null,n.createElement($,{title:e.toLanguageString(Re,S[Re]),iconClass:"k-i-sort-asc-sm",svgIcon:w.sortAscSmallIcon,selected:Vt(o,t),onClick:this.onAscClick}),n.createElement($,{title:e.toLanguageString(Ne,S[Ne]),iconClass:"k-i-sort-desc-sm",svgIcon:w.sortDescSmallIcon,selected:qt(o,t),onClick:this.onDescClick}))}}me.active=(r,t)=>{const s=Kt(r,t);return qt(s,t)||Vt(s,t)};I.registerForIntl(me);I.registerForLocalization(me);class je extends n.Component{render(){return n.createElement("div",{id:this.props.id,className:g.classNames("k-columnmenu-item-content",this.props.className),style:this.props.style},n.createElement(rs.Reveal,{style:{position:"relative",display:"block"}},this.props.show?this.props.children:null))}}class _e extends n.Component{constructor(t){super(t),this.renderOperatorEditor=()=>{if(this.props.filterType==="boolean")return;const s=this.props.operators.find(o=>o.operator===this.props.operator)||null;return n.createElement(ie.DropDownList,{value:s,onChange:this.operatorChange,data:this.props.operators,textField:"text"})},this.inputChange=this.inputChange.bind(this),this.operatorChange=this.operatorChange.bind(this),this.boolDropdownChange=this.boolDropdownChange.bind(this)}render(){return n.createElement(n.Fragment,null,this.renderOperatorEditor(),this.filterComponent(this.props.filterType,this.props.value,this.props.booleanValues))}inputChange(t,s){Ke(t,s,this.props)}operatorChange(t){qe(t,this.props.value,this.props.onChange)}boolDropdownChange(t){Ve(t,this.props.onChange)}filterComponent(t,s,o){switch(t){case"numeric":return n.createElement(M.NumericTextBox,{value:s,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},rangeOnEnter:!1});case"date":return n.createElement(Ae.DatePicker,{value:s,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)}});case"boolean":{const e=i=>i==null;return n.createElement(ie.DropDownList,{onChange:this.boolDropdownChange,value:o.find(i=>i.operator===(e(s)?"":s)),data:o,textField:"text"})}default:return n.createElement(M.Input,{value:s||"",onChange:e=>{this.inputChange(e.target.value,e.syntheticEvent)}})}}}class Ut extends n.Component{render(){const{firstFilterProps:t,hideSecondFilter:s,secondFilterProps:o,logicData:e,logicValue:i,onLogicChange:l}=this.props;return n.createElement(n.Fragment,null,n.createElement(_e,{...t}),!s&&n.createElement(n.Fragment,null,n.createElement(ie.DropDownList,{data:e,value:i,onChange:l,className:"k-filter-and",textField:"text"}),n.createElement(_e,{...o})))}}const ue=r=>r||{filters:[],logic:"and"},re=(r,t)=>ue(t).filters.filter(e=>pe.isCompositeFilterDescriptor(e)?e.filters&&e.filters.length&&e.filters.length<=2&&!e.filters.find(i=>pe.isCompositeFilterDescriptor(i)||i.field!==r):!1)[0]||null;class Xe extends n.Component{constructor(t){super(t),this.removeGroup=(o,e)=>{const i=[...e.filters],l=i.findIndex(a=>a===o);return l>-1&&i.splice(l,1),{...e,filters:i}},this.insertGroup=(o,e)=>({...e,filters:[o,...e.filters]}),this.isControlled=()=>this.props.expanded!==void 0,this.onFilterExpand=()=>{const o=this.isControlled(),e=!(o?this.props.expanded:this.state.expanded);this.props.onExpandChange&&this.props.onExpandChange(e),o||this.setState({expanded:e})},this.firstFilterChange=o=>{this.filterChange(0,o)},this.secondFilterChange=o=>{this.filterChange(1,o)},this.filterChange=(o,e)=>{const i=this.state.filterGroup.filters.map((l,a)=>a===o?{...l,value:e.value,operator:e.operator}:l);this.setState({filterGroup:{...this.state.filterGroup,filters:i}})},this.logicChange=o=>{this.setState({filterGroup:{...this.state.filterGroup,logic:o.target.value.operator}})},this.clear=o=>{if(o.preventDefault(),!this.props.onFilterChange)return;const e=this.props.column.field,i=ue(this.props.filter),l=re(e,this.props.filter),a=i.filters.filter(c=>c!==l);a.length?this.props.onFilterChange({...i,filters:a},o):this.props.onFilterChange(null,o),this.props.onCloseMenu&&this.props.onCloseMenu()},this.currentFilterGroup=()=>({...this.state.filterGroup,filters:this.state.filterGroup.filters.filter(o=>o.value!==void 0&&o.value!==null&&o.value!==""||o.value===null&&o.operator)}),this.submit=o=>{if(o.preventDefault(),!this.props.onFilterChange)return;const e=this.props.column.field,i=ue(this.props.filter),l=re(e,this.props.filter),a=this.currentFilterGroup();let c=null;if(l&&a.filters.length>0){const h=i.filters.map(d=>d===l?a:d);c={...i,filters:h}}else if(a.filters.length===0){const h=i.filters.filter(d=>d!==l);h.length&&(c={...i,filters:h})}else c={...i,filters:[...i.filters,a]};this.props.onFilterChange(c,o),this.props.onCloseMenu&&this.props.onCloseMenu()};let s;if(t.column&&t.column.field){const o=He(t.column.filter),e=zt(t.filterOperators,o);s=re(t.column.field,t.filter),s=s?{...s,filters:s.filters.map(i=>({...i}))}:{logic:"and",filters:[{field:t.column.field,operator:e,value:H(e)?null:void 0},{field:t.column.field,operator:e,value:H(e)?null:void 0}]},s.filters.filter(i=>i.field===t.column.field).length===1&&s.filters.splice(1,0,{field:t.column.field,operator:e})}this.state={expanded:t.expanded||!1,filterGroup:s}}render(){const{column:t,filterUI:s,hideSecondFilter:o,filterOperators:e}=this.props;if(!t||!t.field)return n.createElement("div",null);const i=He(t.filter),l=o!==void 0?o:vs[i],a=I.provideLocalizationService(this),c=this.state.filterGroup.filters,h=se(e[i],a),d=se(We,a),f={field:t.field,value:c[0].value,operator:c[0].operator,operators:h,booleanValues:d,onChange:this.firstFilterChange,filterType:i},b={field:t.field,value:c[1].value,operator:c[1].operator,operators:h,booleanValues:d,onChange:this.secondFilterChange,filterType:i},u=this.state.filterGroup.logic,x=se(Cs,a),y={value:x.find(z=>z.operator===(u===null?"":u)),onChange:this.logicChange,data:x},v=s,k={firstFilterProps:f,secondFilterProps:b,logicData:y.data,logicValue:y.value,onLogicChange:y.onChange,hideSecondFilter:l},R=this.currentFilterGroup().filters.length!==0||H(c[0].operator)||H(c[1].operator),E=this.isControlled()?this.props.expanded:this.state.expanded,P=this.props.alwaysExpand;return n.createElement(le,null,!P&&n.createElement($,{title:a.toLanguageString(ne,S[ne]),iconClass:"k-i-filter",svgIcon:w.filterIcon,onClick:this.onFilterExpand}),n.createElement(je,{show:P||!!E},n.createElement("form",{className:"k-filter-menu",onSubmit:this.submit,onReset:this.clear,onKeyDown:z=>z.stopPropagation()},n.createElement("div",{className:"k-filter-menu-container"},v?n.createElement(v,{...k}):n.createElement(Ut,{...k}),n.createElement("div",{className:"k-actions k-actions-stretched"},n.createElement(B.Button,{themeColor:"primary",disabled:!R},a.toLanguageString(oe,S[oe])),n.createElement(B.Button,{type:"reset"},a.toLanguageString(K,S[K])))))))}}Xe.active=(r,t)=>!!re(r,t);I.registerForLocalization(Xe);const zs=(r,t)=>r.length!==t.length?!1:r.every((s,o)=>s===t[o]);class Ye extends n.Component{constructor(t){super(t),this.defaultFilter=()=>this.props.filter?g.clone(this.props.filter):{filters:[],logic:"and"},this.isControlled=()=>this.props.expanded!==void 0,this.parseData=(s,o)=>{const e=this.props.column.field||"",i=s.map(l=>L(e,l));return o?i.filter((l,a)=>i.indexOf(l)===a):i},this.getFilterIndex=()=>{const s=this.props.column.field;return this.defaultFilter().filters.findIndex(i=>i.filters&&i.filters.length>0&&i.filters[0].field===s)},this.onFilterExpand=()=>{const s=this.isControlled(),o=!(s?this.props.expanded:this.state.expanded);this.props.onExpandChange&&this.props.onExpandChange(o),s||this.setState({expanded:o})},this.handleSearchChange=s=>{const o=this.props.searchBoxFilterOperator?this.props.searchBoxFilterOperator:"startswith",e={logic:"and",filters:[{field:this.props.column.field,operator:o,value:s.target.value,ignoreCase:!0}]};this.setState({value:s.target.value,data:this.parseData(pe.filterBy(this.props.data||[],e),this.props.uniqueData)})},this.handleClear=()=>{const s=this.props.searchBoxFilterOperator?this.props.searchBoxFilterOperator:"startswith",o={logic:"and",filters:[{field:this.props.column.field,operator:s,value:"",ignoreCase:!0}]};this.setState({value:"",data:this.parseData(pe.filterBy(this.props.data||[],o),this.props.uniqueData)})},this.clear=s=>{if(s.preventDefault(),!this.props.onFilterChange)return;const o=this.state.currentFilter||null;o!==null&&o.filters.length>0?(this.compositeFilterIndex>=0&&o.filters.splice(this.compositeFilterIndex,1),this.props.onFilterChange(o,s)):this.props.onFilterChange(null,s),this.props.onCloseMenu&&this.props.onCloseMenu()},this.submit=s=>{if(s.preventDefault(),!this.props.onFilterChange)return;const o=this.state.currentFilter||null;this.props.onFilterChange(o,s),this.props.onCloseMenu&&this.props.onCloseMenu()},this.handleCheckBoxChange=(s,o)=>{const e=this.props.column.field||"",i={...this.state.currentFilter},l=[...this.state.currentFilter.filters];let a=[];if(this.compositeFilterIndex!==-1&&i.filters[this.compositeFilterIndex].filters&&o!=="all"&&(a=i.filters[this.compositeFilterIndex].filters),s.value&&o==="all")this.state.data.forEach(c=>{a.push({field:e,operator:"eq",value:c})});else if(s.value)a.push({field:e,operator:"eq",value:o});else if(this.state.currentFilter){const c=a.findIndex(h=>h.value===o);a.splice(c,1)}i.logic="and",this.compositeFilterIndex!==-1?l[this.compositeFilterIndex]={logic:"or",filters:a}:l.push({logic:"or",filters:a}),(!s.value&&o==="all"||a.length===0)&&l.splice(this.compositeFilterIndex,1),i.filters=l,this.setState({currentFilter:i})},this.isAllSelected=()=>{let s=!1;if(this.state.currentFilter){const o=[...this.state.currentFilter.filters];return this.compositeFilterIndex===-1?!1:(s=this.state.data.every(e=>this.compositeFilterIndex!==-1&&o[this.compositeFilterIndex].filters?o[this.compositeFilterIndex].filters.findIndex(l=>l.value===e)>=0:!1),s)}return s},this.compositeFilterIndex=this.getFilterIndex(),this.state={expanded:t.expanded||!1,value:"",data:this.parseData(this.props.data,this.props.uniqueData)||[],dataFromProps:this.parseData(this.props.data,!1)||[],currentFilter:this.defaultFilter()}}componentDidUpdate(){const t=this.props.column.field||"",s=this.props.data.map(o=>L(t,o));zs(s,this.state.dataFromProps)||this.setState({data:s,dataFromProps:s})}render(){const{column:t}=this.props;if(!t||!t.field)return n.createElement("div",null);const s=I.provideLocalizationService(this),o=this.isControlled()?this.props.expanded:this.state.expanded,e=[];if(this.state.currentFilter){const a=[...this.state.currentFilter.filters];this.compositeFilterIndex=a.findIndex(c=>c.filters&&c.filters.length>0?c.filters[0].field===t.field:!1),this.compositeFilterIndex!==-1&&a[this.compositeFilterIndex].filters.length>0&&a[this.compositeFilterIndex].filters.forEach(c=>{c.field===this.props.column.field&&e.push(c.value)})}const i=this.props.searchBox?n.createElement(this.props.searchBox,{value:this.state.value,onChange:this.handleSearchChange}):n.createElement("div",{className:"k-searchbox k-textbox k-input k-input-md k-input-solid"},n.createElement(g.IconWrap,{className:"k-input-icon",name:"search",icon:w.searchIcon}),n.createElement(M.Input,{className:"k-input-inner",type:"text",placeholder:s.toLanguageString(Fe,S[Fe]),value:this.state.value,onChange:a=>this.handleSearchChange(a.nativeEvent)}),n.createElement(B.Button,{type:"button",rounded:null,className:"k-input-button",onClick:this.handleClear,icon:"x",svgIcon:w.xIcon})),l=e.filter((a,c)=>e.indexOf(a)===c);return n.createElement(le,null,n.createElement($,{title:s.toLanguageString(ne,S[ne]),iconClass:"k-i-filter",svgIcon:w.filterIcon,onClick:this.onFilterExpand}),n.createElement(je,{show:!!o},n.createElement("form",{className:"k-filter-menu",onSubmit:this.submit,onReset:this.clear},n.createElement("div",{className:"k-filter-menu-container"},i,n.createElement("ul",{className:"k-reset k-multicheck-wrap"},n.createElement("li",{className:"k-item k-check-all-wrap"},n.createElement(M.Checkbox,{label:s.toLanguageString(De,S[De]),onChange:a=>this.handleCheckBoxChange(a,"all"),checked:this.isAllSelected()})),this.state.data.map((a,c)=>n.createElement("li",{className:"k-item",key:c},n.createElement(M.Checkbox,{label:String(a),onChange:h=>this.handleCheckBoxChange(h,a),checked:l.includes(a)})))),n.createElement("div",{className:"k-filter-selected-items"},l.length+" "+s.toLanguageString(Ge,S[Ge])),n.createElement("div",{className:"k-actions k-hstack k-justify-content-stretch"},n.createElement(B.Button,{themeColor:"primary",type:"submit"},s.toLanguageString(oe,S[oe])),n.createElement(B.Button,{className:"k-button",type:"reset"},s.toLanguageString(K,S[K])))))))}}Ye.defaultProps={uniqueData:!0};I.registerForLocalization(Ye);const $t=r=>{const[t,s]=n.useState(""),o=n.useMemo(()=>new Set(r.columnsState.map(u=>u.id)),[r.columnsState]),e=n.useMemo(()=>r.columns.filter(u=>{var x;return(x=u.title||u.field)==null?void 0:x.toLowerCase().includes(t.toLowerCase())}),[r.columns,t]),[i,l]=n.useState(r.columns.map(u=>o.has(u.id))),a=n.useCallback(()=>{const u=r.columns.filter((x,y)=>i[y]);r.onColumnsChange.call(void 0,u),r.onCloseMenu.call(void 0)},[i,r.columns,r.onColumnsChange,r.onCloseMenu]),c=n.useCallback(()=>{l(r.columns.map(u=>o.has(u.id)))},[o,r.columns]),h=i.filter(u=>u).length,d=h===i.length,f=n.useCallback(()=>{l(r.columns.map((u,x)=>d&&x===0?!0:!d))},[r.columns,d]),b=n.useCallback((u,x)=>{const y=i.slice();y[x]=u,l(y)},[i]);return n.createElement("form",{className:"k-filter-menu"},n.createElement("div",{className:"k-filter-menu-container"},n.createElement(M.TextBox,{className:"k-searchbox",value:t,onChange:u=>s(String(u.target.value)),prefix:()=>n.createElement(M.InputPrefix,null,n.createElement(g.IconWrap,{name:"search",icon:w.searchIcon}))}),n.createElement("ul",{className:"k-reset k-multicheck-wrap"},!t&&n.createElement("li",{className:"k-item k-check-all-wrap"},n.createElement(M.Checkbox,{checked:d,onChange:f,label:"(Select all)"})),e.map((u,x)=>n.createElement("li",{key:u.id,className:"k-item"},n.createElement(M.Checkbox,{disabled:i[x]&&h===1,checked:i[x],onChange:y=>{var v;return b(!!((v=y.target.element)!=null&&v.checked),x)},label:u.title||u.field})))),n.createElement("div",{className:"k-filter-selected-items"},h," selected items"),n.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal"},n.createElement(B.Button,{type:"button",themeColor:"primary",onClick:a},"Apply"),n.createElement(B.Button,{type:"button",onClick:c},"Reset"))))};$t.displayName="GridColumnMenuColumnsList";class Ls extends n.Component{render(){return null}}class jt extends n.Component{render(){return n.createElement("div",{className:g.classNames("k-toolbar k-grid-toolbar",{"k-toolbar-md":!this.props.size,[`k-toolbar-${g.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),"aria-label":this.props.ariaLabel,"aria-controls":this.props.ariaControls,role:"toolbar"},this.props.children)}}jt.displayName="KendoReactGridToolbar";const Xt=r=>{const{data:t=[]}=r;return n.createElement("div",{className:"k-selection-aggregates k-grid-selection-aggregates"},t.map((s,o)=>n.createElement("div",{key:o},n.createElement("span",{className:"k-selection-aggregates-item-text"},s.type,": "),n.createElement("span",{className:"k-selection-aggregates-item-value"},s.formattedValue))))};Xt.displayName="KendoReactGridStatusBar";const Yt=r=>{var s;const t=r.slice();for(let o=0;o<t.length;o++)for(;t[o]&&((s=t[o].children)!=null&&s.length);)t.splice(o,1,...t[o].children);return t},Os=r=>{const{dataItems:t,target:s,selectedField:o}=r,i=Yt(s.columns).map(v=>v.field).filter(v=>v&&typeof v=="string").map(v=>g.getter(v)),l=g.getter(o),a={dates:[],numbers:[],booleans:[],others:[]},c=v=>{typeof v=="number"?a.numbers.push(v):typeof v=="boolean"?a.booleans.push(v):v instanceof Date?a.dates.push(v):a.others.push(v)};t.forEach(v=>{const k=l(v);k&&k.forEach(R=>{c(i[R](v))})});const h=a.dates.map(v=>v.getTime()),d=a.booleans.filter(v=>v).length,f=a.booleans.filter(v=>!v).length,b=a.numbers.length?a.numbers.reduce((v,k)=>v+=k,0):void 0,u={sum:b,average:typeof b=="number"?b/a.numbers.length:void 0,min:a.numbers.length?Math.min(...a.numbers):void 0,max:a.numbers.length?Math.max(...a.numbers):void 0,count:a.numbers.length+a.booleans.length+a.dates.length+a.others.length,isTrue:d>0?d:void 0,isFalse:f>0?f:void 0,earliest:a.dates.length?new Date(Math.min(...h)):void 0,latest:a.dates.length?new Date(Math.max(...h)):void 0},x=(v,k)=>(k==="sum"||k==="average")&&typeof v=="number"?v.toFixed(2):(k==="earliest"||k==="latest")&&v instanceof Date?v.toLocaleDateString():String(v),y=[];return Object.keys(u).forEach(v=>{const k=v,R=u[k];R!==void 0&&y.push({type:k,value:R,formattedValue:x(R,k)})}),y},Qt=g.withIdHOC(X);Qt.displayName="KendoReactGrid";Object.defineProperty(exports,"getSelectedState",{enumerable:!0,get:()=>C.getSelectedState});Object.defineProperty(exports,"getSelectedStateFromKeyDown",{enumerable:!0,get:()=>C.getSelectedStateFromKeyDown});Object.defineProperty(exports,"setSelectedState",{enumerable:!0,get:()=>C.setSelectedState});exports.GRID_COL_INDEX_ATTRIBUTE=U;exports.GRID_ROW_INDEX_ATTRIBUTE=Ft;exports.Grid=Qt;exports.GridCell=_t;exports.GridClassComponent=X;exports.GridColumn=j;exports.GridColumnMenuCheckboxFilter=Ye;exports.GridColumnMenuColumnsList=$t;exports.GridColumnMenuFilter=Xe;exports.GridColumnMenuFilterCell=_e;exports.GridColumnMenuFilterUI=Ut;exports.GridColumnMenuGroup=$e;exports.GridColumnMenuItem=$;exports.GridColumnMenuItemContent=je;exports.GridColumnMenuItemGroup=le;exports.GridColumnMenuSort=me;exports.GridColumnMenuWrapper=Be;exports.GridCommonDragLogic=Pt;exports.GridDetailRow=Ls;exports.GridEditCell=Dt;exports.GridFilterCell=Ue;exports.GridGroupCell=Pe;exports.GridHeaderCell=Gt;exports.GridHierarchyCell=Nt;exports.GridNoRecords=fe;exports.GridRow=At;exports.GridSelectionCell=ft;exports.GridToolbar=jt;exports.StatusBar=Xt;exports.booleanFilterValues=We;exports.cellBoolDropdownChange=Ve;exports.cellInputChange=Ke;exports.cellOperatorChange=qe;exports.filterGroupByField=re;exports.getStatusData=Os;exports.gridMessages=S;exports.leafColumns=Yt;exports.operators=Oe;exports.pagerFirstPage=Ct;exports.pagerInfo=mt;exports.pagerItemPerPage=kt;exports.pagerLastPage=xt;exports.pagerNextPage=vt;exports.pagerPreviousPage=bt;exports.rootFilterOrDefault=ue;
|
|
5
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rs=require("react"),p=require("prop-types"),f=require("@progress/kendo-react-common"),C=require("@progress/kendo-react-data-tools"),E=require("@progress/kendo-react-intl"),w=require("@progress/kendo-svg-icons"),z=require("@progress/kendo-react-inputs"),Be=require("@progress/kendo-react-dateinputs"),is=require("@progress/kendo-react-popup"),B=require("@progress/kendo-react-buttons"),ie=require("@progress/kendo-react-dropdowns"),ue=require("@progress/kendo-data-query"),os=require("@progress/kendo-react-animation");function ns(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}return t.default=r,Object.freeze(t)}const n=ns(rs),j=r=>null;j.displayName="KendoReactGridColumn";j.defaultProps={filterable:!0,editable:!0,sortable:!0,resizable:!0,reorderable:!0,groupable:!0};j.propTypes={field:p.string,title:p.string,editable:p.bool,sortable:p.oneOfType([p.bool,p.shape({allowUnsort:p.bool.isRequired})]),cell:p.any,filterCell:p.any,filterTitle:p.string,filterable:p.bool,filter:p.oneOf(["text","numeric","boolean","date"]),editor:p.oneOf(["text","numeric","boolean","date"]),width:p.oneOfType([p.string,p.number]),minResizableWidth:p.number,headerCell:p.any,footerCell:p.any,headerSelectionValue:p.bool,format:p.string,headerClassName:p.string,className:p.string,reorderable:p.bool,resizable:p.bool,orderIndex:p.number,groupable:p.bool,columnMenu:p.any,locked:p.bool};function L(r,t){const s=(r||"").split(".");let o=t;return s.forEach(e=>{o=o?o[e]:void 0}),o}function ut(r,t,s,o,e,i,l=0){let a=l;for(let c=0;c<t.length;c++){if(!e||t[c].value===void 0||t[c].items===void 0){r[r.length]={dataIndex:o.index,dataItem:t[c],rowType:"data",level:l,expanded:i===void 0||L(i,t[c])},o.index++;continue}a=Math.max(a,l+1);const h=i===void 0||L(i,t[c])===void 0||L(i,t[c]);r[r.length]={dataIndex:-1,dataItem:t[c],level:l,rowType:"groupHeader",expanded:h},h&&(a=Math.max(ut(r,t[c].items,s,o,e,i,l+1),a)),(s==="always"||h&&s==="visible")&&(r[r.length]={dataIndex:-1,dataItem:t[c],rowType:"groupFooter",level:l,expanded:h})}return a}function gt(r,t,s,o=0){let e=[];if(!r)return[];r&&r.length===void 0&&(r=[r]),r.forEach((l,a)=>{l=l.props?l.props:l;const c=t[a]||null,h=gt(l.children,c&&c.children||[],s,o+1);e.push(Object.assign({depth:o},j.defaultProps,h.length?{cell:()=>null,filterCell:()=>null}:{},c?{width:c.width,orderIndex:c.orderIndex}:{},l,{id:l.id?l.id:C.tableKeyboardNavigationTools.generateNavigatableId(`${s.prevId++}`,s.idPrefix,"column"),declarationIndex:e.length,children:h,rowSpan:0,colSpan:0,isAccessible:!0,left:c&&Math.floor(c.left),right:c&&Math.floor(c.right)}))});const i=(l,a)=>l.orderIndex===a.orderIndex?l.declarationIndex-a.declarationIndex:(l.orderIndex||0)-(a.orderIndex||0);if(e.sort(i),o===0){let l=[];const a=(c,h)=>c.forEach(d=>{d.parentIndex=h,a(d.children,l.push(d)-1)});return a(e,-1),l}return e}function ls(r,t,s,o){let e=[];Array.isArray(r)?e=r:r&&(e=r.data);const i=[];if(e.length>0){let l=e[0];if(t)for(let c=0;c<t.length;c++)l=l.items&&l.items[0];Object.getOwnPropertyNames(l).forEach(c=>{c!==s&&i.push(Object.assign({id:C.tableKeyboardNavigationTools.generateNavigatableId(`${o.prevId++}`,o.idPrefix,"column"),declarationIndex:-1,parentIndex:-1,depth:0,colSpan:0,rowSpan:0,index:0,left:0,right:0,rightBorder:!1,children:[],ariaColumnIndex:0,isAccessible:!0},j.defaultProps,{field:c}))})}return i}const as=(r,t)=>{let s=r[t.parentIndex];for(;s;){if(s.footerCell)return!0;s=r[s.parentIndex]}return!1},cs=r=>r.filter(t=>as(r,t)?!1:!!t.footerCell||!(t.children&&t.children.length>0)),Se=r=>r.width!==void 0?Math.floor(parseFloat(r.width.toString()))+"px":void 0,ft=r=>(r.sort((t,s)=>t.declarationIndex-s.declarationIndex),r.map(t=>{const{declarationIndex:s,parentIndex:o,depth:e,colSpan:i,rowSpan:l,index:a,kFirst:c,children:h,...d}=t;return h.length?{children:ft(h),...d}:d})),Ie=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),ct=17895697,fe=(r,t)=>{if(!(!r&&!t))return t?r?{...r,...t,select:{...r.select||{},...t.select||{}},hierarchy:{...r.hierarchy||{},...t.hierarchy||{}},group:{...r.group||{},...t.group||{}},edit:{...r.edit||{},...t.edit||{}}}:t:r},ye="grid.noRecords",mt="grid.pagerInfo",Ct="grid.pagerFirstPage",bt="grid.pagerPreviousPage",vt="grid.pagerNextPage",xt="grid.pagerLastPage",kt="grid.pagerItemsPerPage",hs="grid.pagerPage",ds="grid.pagerPageSizeAriaLabel",ps="grid.pagerOf",us="grid.pagerTotalPages",we="grid.groupPanelEmpty",Et="grid.groupColumn",St="grid.ungroupColumn",Re="grid.columnMenu",K="grid.filterClearButton",oe="grid.filterSubmitButton",ne="grid.filterTitle",Ne="grid.sortAscending",Fe="grid.sortDescending",De="grid.searchPlaceholder",Te="grid.filterCheckAll",Ge="grid.filterChooseOperator",ze="grid.filterSelectedItems",Me="grid.sortAriaLabel",Le="grid.filterAriaLabel",Oe="grid.groupPanelAriaLabel",It="grid.groupExpand",yt="grid.groupCollapse",wt="grid.detailExpand",Rt="grid.detailCollapse",le="grid.selectRow",I={[wt]:"Expand detail row",[Rt]:"Collapse detail row",[It]:"Expand group",[yt]:"Collapse Group",[ye]:"No records available",[we]:"Drag a column header and drop it here to group by that column",[K]:"Clear",[oe]:"Filter",[ne]:"Filter",[Ne]:"Sort Ascending",[Fe]:"Sort Descending",[Me]:"Sortable",[Et]:"Group Column",[St]:"Ungroup Column",[Re]:"Column menu",[kt]:"items per page",[mt]:"{0} - {1} of {2} items",[Ct]:"Go to the first page",[bt]:"Go to the previous page",[vt]:"Go to the next page",[xt]:"Go to the last page",[hs]:"Page",[ds]:"Page size",[ps]:"of",[us]:"{0}",[De]:"Search",[Te]:"Check All",[Ge]:"Choose Operator",[ze]:"selected items",[Le]:"Filter",[Oe]:"Group panel",[le]:"Select Row","grid.filterEqOperator":"Is equal to","grid.filterNotEqOperator":"Is not equal to","grid.filterIsNullOperator":"Is null","grid.filterIsNotNullOperator":"Is not null","grid.filterIsEmptyOperator":"Is empty","grid.filterIsNotEmptyOperator":"Is not empty","grid.filterStartsWithOperator":"Starts with","grid.filterContainsOperator":"Contains","grid.filterNotContainsOperator":"Does not contain","grid.filterEndsWithOperator":"Ends with","grid.filterGteOperator":"Is greater than or equal to","grid.filterGtOperator":"Is greater than","grid.filterLteOperator":"Is less than or equal to","grid.filterLtOperator":"Is less than","grid.filterIsTrue":"Is true","grid.filterIsFalse":"Is false","grid.filterBooleanAll":"(All)","grid.filterAfterOrEqualOperator":"Is after or equal to","grid.filterAfterOperator":"Is after","grid.filterBeforeOperator":"Is before","grid.filterBeforeOrEqualOperator":"Is before or equal to","grid.filterAndLogic":"And","grid.filterOrLogic":"Or"};function gs(r){const t=r.replace(/^pager\.([a-z])/,(s,o)=>"grid.pager"+o.toUpperCase());return{messageKey:t,defaultMessage:I[t]}}const Nt=r=>{const t=E.useLocalization(),s=n.useCallback(g=>{r.selectionChange&&r.selectionChange({syntheticEvent:g})},[r.selectionChange]),o=f.useId(),e=L(r.field,r.dataItem),i=C.useTableKeyboardNavigation(r.id),l={colSpan:r.colSpan,style:r.style,className:r.className,"aria-colindex":r.ariaColumnIndex,role:"gridcell",...i},a=n.createElement("span",{key:1,className:"k-checkbox-wrap"},n.createElement("input",{id:o,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md","aria-label":t.toLanguageString(le,I[le]),"aria-checked":typeof e=="boolean"&&e,onChange:s})),c=r.rowType!=="groupHeader"?n.createElement("td",{...l},a):null,h=r.rowType||"data",d=r.cells;if(d&&d.select&&d.select[h]){const g=d.select[h];return n.createElement(g,{...r,tdProps:l},a)}return r.render?r.render.call(void 0,c,r):c},Ft=r=>{let t=null,s=null,o=null;const e=L(r.field,r.dataItem),i=C.useTableKeyboardNavigation(r.id),l=E.useLocalization(),a=n.useCallback(d=>{d.isDefaultPrevented()||d.keyCode===f.Keys.enter&&r.onChange&&(d.preventDefault(),r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,syntheticEvent:d,field:r.field,value:!e}))},[r.dataItem,r.dataIndex,r.field,r.onChange,e]);if(r.rowType==="groupFooter")s={className:"k-table-td k-hierarchy-cell",role:"gridcell",...i},t=n.createElement("td",{...s});else if(r.rowType!=="groupHeader"){const d=e?Rt:wt,g=l.toLanguageString(d,I[d]);s={className:"k-table-td k-hierarchy-cell",onKeyDown:a,"aria-expanded":!!e,role:"gridcell","aria-colindex":r.ariaColumnIndex,...i},o=n.createElement("a",{onClick:b=>{b.preventDefault(),r.onChange&&r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,syntheticEvent:b,field:r.field,value:!e})},"aria-label":g,href:"#",tabIndex:-1},n.createElement(f.IconWrap,{name:e?"minus":"plus",icon:e?w.minusIcon:w.plusIcon})),t=n.createElement("td",{...s},o)}const c=r.rowType||"data",h=r.cells;if(h&&h.hierarchy&&h.hierarchy[c]){const d=h.hierarchy[c];return n.createElement(d,{...r,tdProps:s},o)}return r.render?r.render.call(void 0,t,r):t},Dt=C.TABLE_ROW_INDEX_ATTRIBUTE,U=C.TABLE_COL_INDEX_ATTRIBUTE,Tt=r=>{const t=L(r.field,r.dataItem);let s=null;const o=f.classNames("k-table-td","k-grid-edit-cell",{["k-selected"]:r.isSelected},r.className),e=f.useId(),i=C.useTableKeyboardNavigation(r.id);let l=null,a=null;const c=n.useCallback(u=>{if(r.onChange){const x=u.target.type==="checkbox"?u.target.checked:u.target.value;r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,field:r.field,syntheticEvent:u,value:x})}},[r.onChange,r.dataItem,r.dataIndex,r.field]),h=n.useCallback(u=>{r.onContextMenu&&r.onContextMenu.call(void 0,u,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]),d=n.useCallback(u=>{r.onChange&&r.onChange({dataItem:r.dataItem,dataIndex:r.dataIndex,field:r.field,syntheticEvent:u.syntheticEvent,value:u.value})},[r.onChange,r.dataItem,r.dataIndex,r.field]);switch(r.editor){case"numeric":{l={onContextMenu:h,colSpan:r.colSpan,style:r.style,className:o,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...i},a=n.createElement(z.NumericTextBox,{width:"100%",value:t===void 0?null:t,onChange:d}),s=n.createElement("td",{...l},a);break}case"date":l={onContextMenu:h,colSpan:r.colSpan,style:r.style,className:o,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...i},a=n.createElement(Be.DatePicker,{width:"100%",value:t,onChange:d}),s=n.createElement("td",{...l},a);break;case"boolean":l={onContextMenu:h,colSpan:r.colSpan,style:r.style,className:o,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...i},a=[n.createElement("span",{key:1,className:"k-checkbox-wrap"},n.createElement("input",{checked:t||!1,id:e,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:c})),n.createElement("label",{className:"k-checkbox-label",htmlFor:e,key:2})],s=n.createElement("td",{...l},a);break;default:l={onContextMenu:h,colSpan:r.colSpan,style:r.style,className:o,["aria-colindex"]:r.ariaColumnIndex,["aria-selected"]:r.isSelected,[U]:r.columnIndex,role:"gridcell",...i},a=n.createElement("input",{style:{width:"100%"},className:"k-input",value:t||"",onChange:c}),s=n.createElement("td",{...l},a)}const g=r.editor||"text",b=r.cells;if(b&&b.edit&&b.edit[g]){const u=b.edit[g];return n.createElement(u,{...r,tdProps:l},a)}return r.render?r.render.call(void 0,s,r):s};class fs extends n.Component{constructor(){super(...arguments),this.headerWrap=null,this.table=null,this.syncScroll=!1,this.scrollbarWidth=f.getScrollbarWidth(),this.onScroll=t=>{if(this.syncScroll){this.syncScroll=!1;return}if(!this.headerWrap)return;const s=this.headerWrap.scrollLeft,o=this.props.scrollableDataElement();o&&o.scrollLeft!==s&&(o.scrollLeft=s)}}get element(){return this.props.elemRef.current}componentDidMount(){const t=C.isRtl(this.element);this.props.columnResize&&this.props.columnResize.setIsRtl(t),this.forceUpdate()}setScrollLeft(t){this.headerWrap&&this.headerWrap.scrollLeft!==t&&(this.syncScroll=!0,this.headerWrap.scrollLeft=t)}setWidth(t){this.table&&(this.table.style.width=t+"px")}render(){return this.props.staticHeaders?n.createElement("div",{ref:this.props.elemRef,className:f.classNames("k-grid-header",{"k-grid-draggable-header":this.props.draggable}),role:"presentation"},n.createElement("div",{ref:t=>{this.headerWrap=t},className:"k-grid-header-wrap",style:this.scrollbarWidth?{}:{borderWidth:0},onScroll:this.onScroll,role:"presentation"},n.createElement("table",{ref:t=>{this.table=t},className:f.classNames("k-table k-grid-header-table",{"k-table-md":!this.props.size,[`k-table-${f.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),role:"presentation"},n.createElement("colgroup",{ref:t=>{this.props.columnResize.colGroupHeader=t}},this.props.cols),n.createElement("thead",{className:"k-table-thead",role:"rowgroup",...C.tableKeyboardNavigationHeaderAttributes},this.props.headerRow,this.props.filterRow)))):n.createElement("thead",{role:"presentation",className:f.classNames("k-table-thead",{"k-grid-draggable-header":this.props.draggable}),...C.tableKeyboardNavigationHeaderAttributes},this.props.headerRow,this.props.filterRow)}}const Gt=(...r)=>Object.assign({allowUnsort:!0,mode:"single"},...r);class ms extends n.PureComponent{constructor(){super(...arguments),this.draggable=null,this.onPress=t=>{const s=this.draggable&&this.draggable.element;s&&this.props.pressHandler&&this.props.pressHandler(t.event,s)},this.onDrag=t=>{const s=this.draggable&&this.draggable.element;s&&this.props.dragHandler&&this.props.dragHandler(t.event,s)},this.onRelease=t=>{this.draggable&&this.draggable.element&&this.props.releaseHandler&&this.props.releaseHandler(t.event)}}render(){return n.createElement(f.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,hint:this.props.dragClue,autoScroll:{boundaryElementRef:this.props.headerRef,direction:{horizontal:!0,vertical:!1}},scrollContainer:this.props.containerRef||void 0,ref:t=>{this.draggable=t}},n.createElement("tr",{className:"k-table-row",style:{touchAction:"none"},role:"row","aria-rowindex":this.props.ariaRowIndex},this.props.children))}}class We extends n.Component{constructor(){super(...arguments),this.state={show:!1},this._anchor=null,this._content=null,this.blurTimeout=void 0,this.willBlur=!1,this.blur=()=>{if(this.willBlur){this.willBlur=!1;return}clearTimeout(this.blurTimeout),this.blurTimeout=window.setTimeout(()=>{this.closeMenu()})},this.focus=()=>{clearTimeout(this.blurTimeout)},this.anchorClick=t=>{t.preventDefault(),this.setState({show:!this.state.show},()=>this.state.show&&this._content&&this._content.focus())},this.closeMenu=()=>{this.setState({show:!1})},this.onAnchorMouseDown=t=>{this.willBlur=this.state.show&&t.currentTarget===this._anchor},this.onAnchorKeyDown=t=>{var s;if(t.keyCode===f.Keys.tab){const o=t.target,e=o&&((s=o.closest(".k-grid"))==null?void 0:s.getElementsByClassName("k-grid-content")[0]);e&&e.scrollWidth>e.clientWidth&&o.scrollIntoView({inline:"center"})}}}render(){const{columnMenu:t,...s}=this.props,{column:o}=this.props,e=E.provideLocalizationService(this),i=o.title||o.field,l=i?`${i} `:"";return n.createElement(n.Fragment,null,n.createElement("a",{className:"k-grid-header-menu k-grid-column-menu",ref:a=>this._anchor=a,onClick:this.anchorClick,onMouseDown:this.onAnchorMouseDown,onKeyDown:this.onAnchorKeyDown,href:"#","aria-label":`${l}${e.toLanguageString(Re,I[Re])}`},n.createElement(f.IconWrap,{name:"filter",icon:w.filterIcon})),n.createElement(is.Popup,{anchor:this._anchor,show:this.state.show,popupClass:"k-column-menu k-column-menu-popup k-grid-columnmenu-popup"},n.createElement("div",{ref:a=>this._content=a,tabIndex:0,onBlur:this.blur,onFocus:this.focus,style:{outline:"none"}},t&&n.createElement(t,{...s,onCloseMenu:this.closeMenu}))))}}class zt extends n.Component{render(){const{columnMenuWrapperProps:t}=this.props,s=this.props.onClick?{onClick:this.props.onClick}:{},o=n.createElement("span",{className:"k-cell-inner"},n.createElement("span",{className:f.classNames("k-link",{"!k-cursor-default":!this.props.columnMenuWrapperProps.sortable}),...s},n.createElement("span",{className:"k-column-title"},this.props.title||this.props.field||" "),this.props.children),t.columnMenu&&n.createElement(We,{...t}));return this.props.render?this.props.render.call(void 0,o,this.props):o}}const Cs={true:{asc:"desc",desc:"","":"asc"},false:{asc:"desc",desc:"asc","":"asc"}},bs={none:"none",asc:"ascending",desc:"descending"};class Mt extends n.Component{constructor(t){super(t),this.serviceIndex=0,this.index=-1,this.cellKeyDown=(s,o)=>{s.isDefaultPrevented()||s.keyCode===f.Keys.enter&&this.cellClick(s,o)},this.cells=s=>s.map(o=>{const e=this.props.columns[o],i=this.props.sortable&&e.sortable,l=this.props.sort?this.props.sort.findIndex(S=>S.field===e.field):-1,a=l>=0&&this.props.sort[l].dir||"none",c=e.columnMenu===null?null:e.columnMenu||this.props.columnMenu,h=f.classNames({"k-first":e.kFirst,"k-filterable":!!c,"k-table-th":!0,"k-header":!0,"k-grid-header-sticky":e.locked,"k-sorted":this.props.sort&&this.props.sort.some(S=>S.field===e.field)},e.headerClassName),d=e.left!==void 0?this.props.isRtl?{left:e.right,right:e.left}:{left:e.left,right:e.right}:{},g=E.provideLocalizationService(this).toLanguageString(Me,I[Me]);let b=e.isAccessible?{ariaSort:bs[a],role:"columnheader",ariaColumnIndex:e.ariaColumnIndex,ariaSelected:!1,ariaDescription:i?g:""}:{role:"presentation"};const u=e.declarationIndex>=0?++this.index:--this.serviceIndex,x=e.headerCell?e.headerCell:zt,y=n.createElement(x,{key:1,field:e.field,onClick:i&&(S=>this.cellClick(S,e))||void 0,selectionChange:this.props.selectionChange,title:e.title,selectionValue:e.headerSelectionValue,render:this.props.cellRender,children:this.sortIcon(l),columnMenuWrapperProps:{column:{field:e.field,title:e.title,locked:e.locked,filter:e.filter,id:e.id},sortable:i&&this.props.sortable,sort:this.props.sort,onSortChange:this.props.sortChange,filter:this.props.filter,filterable:this.props.filterable&&e.filterable,filterOperators:this.props.filterOperators,onFilterChange:this.props.filterChange,group:this.props.group,groupable:this.props.groupable,onGroupChange:this.props.groupChange,columnMenu:c}}),v={...b,key:u,colSpan:e.colSpan,rowSpan:e.rowSpan,className:h,style:d,columnId:e.id,navigatable:e.navigatable,onKeyDown:i&&(S=>this.cellKeyDown(S,e))||void 0,role:"columnheader"},k=[y,this.props.columnResize&&this.props.columnResize.resizable&&e.resizable&&n.createElement(C.ColumnResizer,{key:2,resize:(S,P,M)=>this.props.columnResize&&this.props.columnResize.dragHandler(S,e,P,M),autofit:S=>this.props.columnResize&&this.props.columnResize.dblClickHandler(S,[e.id])})],R=fe(this.props.cells,e.cells);if(R&&R.headerCell){const S=R.headerCell;return n.createElement(S,{key:u,thProps:v,index:o},k)}return n.createElement(C.HeaderThElement,{...v,key:u},k)}),this.cellClick=this.cellClick.bind(this)}cellClick(t,s){if(t.preventDefault(),!this.props.sortChange)return;const{allowUnsort:o,mode:e}=Gt(this.props.sortable||!1,s.sortable||!1),i=(this.props.sort||[]).filter(c=>c.field===s.field)[0],l=Cs[o][i&&i.dir||""],a=e==="single"?[]:(this.props.sort||[]).filter(c=>c.field!==s.field);l!==""&&s.field&&a.push({field:s.field,dir:l}),this.props.sortChange(a,t)}sortIcon(t){return this.props.sort?t>=0&&[n.createElement("span",{key:1,className:"k-sort-icon"},n.createElement(f.IconWrap,{name:"sort-"+this.props.sort[t].dir+"-small",icon:this.props.sort[t].dir==="asc"?w.sortAscSmallIcon:w.sortDescSmallIcon})),this.props.sort.length>1&&n.createElement("span",{key:2,className:"k-sort-icon"},n.createElement("span",{className:"k-sort-order"},t+1))]:null}render(){return this.serviceIndex=0,this.index=-1,this.props.columnsMap.map((t,s)=>this.props.pressHandler&&n.createElement(ms,{key:s,pressHandler:this.props.pressHandler,dragHandler:this.props.dragHandler,releaseHandler:this.props.releaseHandler,ariaRowIndex:s+1,dragClue:this.props.dragClue,headerRef:this.props.headerRef,containerRef:this.props.containerRef},this.cells(t))||n.createElement("tr",{key:s,className:"k-table-row",role:"row","aria-rowindex":s+1},this.cells(t)))}}E.registerForLocalization(Mt);const vs=[{text:"grid.filterAndLogic",operator:"and"},{text:"grid.filterOrLogic",operator:"or"}],He={text:[{text:"grid.filterContainsOperator",operator:"contains"},{text:"grid.filterNotContainsOperator",operator:"doesnotcontain"},{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterStartsWithOperator",operator:"startswith"},{text:"grid.filterEndsWithOperator",operator:"endswith"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"},{text:"grid.filterIsEmptyOperator",operator:"isempty"},{text:"grid.filterIsNotEmptyOperator",operator:"isnotempty"}],numeric:[{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterGteOperator",operator:"gte"},{text:"grid.filterGtOperator",operator:"gt"},{text:"grid.filterLteOperator",operator:"lte"},{text:"grid.filterLtOperator",operator:"lt"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"}],date:[{text:"grid.filterEqOperator",operator:"eq"},{text:"grid.filterNotEqOperator",operator:"neq"},{text:"grid.filterAfterOrEqualOperator",operator:"gte"},{text:"grid.filterAfterOperator",operator:"gt"},{text:"grid.filterBeforeOperator",operator:"lt"},{text:"grid.filterBeforeOrEqualOperator",operator:"lte"},{text:"grid.filterIsNullOperator",operator:"isnull"},{text:"grid.filterIsNotNullOperator",operator:"isnotnull"}],boolean:[{text:"grid.filterEqOperator",operator:"eq"}]},H=r=>r==="isnull"||r==="isnotnull"||r==="isempty"||r==="isnotempty",se=(r,t)=>r.map(s=>({text:t.toLanguageString(s.text,I[s.text]),operator:s.operator})),xs="eq",Ke=[{text:"grid.filterBooleanAll",operator:""},{text:"grid.filterIsTrue",operator:!0},{text:"grid.filterIsFalse",operator:!1}],ks={text:!1,numeric:!1,date:!1,boolean:!0},Ve=(r,t,s)=>{const o=Lt(s.operators);let e=s.operator;switch(s.filterType){case"numeric":(!e||H(e))&&(e=o),r===null&&e===o&&(e="");break;case"date":(!e||H(e))&&(e=o),r===null&&e===o&&(e="");break;case"text":(!e||H(e))&&(e=o),!r&&e===o&&(e="");break;default:return}s.onChange({value:r,operator:e,syntheticEvent:t})},Lt=(r,t)=>t?r[t][0].operator:r[0].operator,Pe=r=>r||"text",qe=(r,t)=>{const s=r.target.value;t({value:s.operator,operator:s.operator===""?"":xs,syntheticEvent:r.syntheticEvent})},Ue=(r,t,s)=>{let o=t;const e=r.target.value;r.target.state.opened&&(H(e.operator)&&(o=null),t===null&&!H(e.operator)&&(o=void 0),s({value:o,operator:e.operator,syntheticEvent:r.syntheticEvent}))};class $e extends n.Component{constructor(t){super(t),this._inputRef=n.createRef(),this.renderOperatorEditor=s=>{if(this.props.filterType==="boolean")return;const o=this.props.operators.find(e=>e.operator===this.props.operator)||null;return n.createElement(ie.DropDownList,{size:this.props.size,value:o,onChange:this.operatorChange,className:"k-dropdown-operator",iconClassName:"k-i-filter k-icon",svgIcon:w.filterIcon,data:this.props.operators,textField:"text",title:s.toLanguageString(Ge,I[Ge]),popupSettings:{width:""}})},this.inputChange=this.inputChange.bind(this),this.clear=this.clear.bind(this),this.operatorChange=this.operatorChange.bind(this),this.boolDropdownChange=this.boolDropdownChange.bind(this)}render(){const t=E.provideLocalizationService(this),s=n.createElement("div",{className:"k-filtercell"},n.createElement("div",{className:"k-filtercell-wrapper"},this.filterComponent(this.props.filterType,this.props.value,this.props.booleanValues),n.createElement("div",{className:"k-filtercell-operator"},this.renderOperatorEditor(t)," ",n.createElement(B.Button,{size:this.props.size,icon:"filter-clear",svgIcon:w.filterClearIcon,className:f.classNames({"k-clear-button-visible":!!(!(this.props.value===null||this.props.value==="")||this.props.operator)}),title:t.toLanguageString(K,I[K]),type:"button",onClick:this.clear,disabled:!(!(this.props.value===null||this.props.value==="")||this.props.operator)}))));return this.props.render?this.props.render.call(void 0,s,this.props):s}inputChange(t,s){Ve(t,s,this.props)}operatorChange(t){Ue(t,this.props.value,this.props.onChange)}boolDropdownChange(t){qe(t,this.props.onChange)}clear(t){t.preventDefault(),this.props.onChange({value:"",operator:"",syntheticEvent:t}),this._inputRef.current&&(this._inputRef.current.element.value="",setTimeout(()=>{this._inputRef.current.element.focus()},0))}filterComponent(t,s,o){switch(t){case"numeric":return n.createElement(z.NumericTextBox,{ref:this._inputRef,size:this.props.size,value:s,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},title:this.props.title,ariaLabel:this.props.ariaLabel});case"date":return n.createElement(Be.DatePicker,{ref:this._inputRef,size:this.props.size,value:s,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},title:this.props.title,ariaLabel:this.props.ariaLabel});case"boolean":{const e=i=>i==null;return n.createElement(ie.DropDownList,{ref:this._inputRef,size:this.props.size,onChange:this.boolDropdownChange,value:o.find(i=>i.operator===(e(s)?"":s)),data:o,textField:"text",title:this.props.title,ariaLabel:this.props.ariaLabel})}default:return n.createElement(z.TextBox,{ref:this._inputRef,size:this.props.size,value:s||"",onChange:e=>{this.inputChange(e.target.value,e.syntheticEvent)},title:this.props.title,"aria-label":this.props.ariaLabel})}}}E.registerForLocalization($e);const Es="k-table-row k-filter-row";class Ot extends n.Component{headerCellClassName(t,s){let o=`${s?"k-grid-header-sticky":""}`;return this.props.sort&&this.props.sort.filter(e=>e.field===t).length>0&&(o+=" k-sorted"),o}setFilter(t,s,o,e){if(!this.props.filterChange)return;const i=[];(t!==""&&t!==null||s!=="")&&i.push({field:o,operator:s,value:t}),this.props.filter&&this.props.filter.filters&&(this.props.filter.filters||[]).forEach(c=>{const h=c;h&&h.field!==o&&i.push(h)});const l=this.props.filter&&this.props.filter.logic?this.props.filter.logic:"and";this.props.filterChange(i.length>0?{logic:l,filters:i}:null,e)}render(){const t=E.provideLocalizationService(this),s=this.props.filter&&this.props.filter.filters||[],o=a=>{if(a===void 0)return;const c=s.filter(h=>h.field===a);return c.length?c[0]:void 0};let e=0,i=-1;const l=this.props.columns.filter(a=>a.children.length===0).map(a=>{const c=Pe(a.filter),h=o(a.field),d=a.filterable?t.toLanguageString(Le,I[Le]):void 0;let g=h&&h.value;g===void 0&&(g=c==="text"?"":null);const b=a.filterable&&{render:this.props.cellRender,field:a.field,title:a.filterTitle,value:g,operator:h&&h.operator,operators:se(this.props.filterOperators[c]||[],t),booleanValues:se(Ke,t),filterType:c,ariaLabel:d,onChange:S=>{this.setFilter(S.value,S.operator,a.field,S.syntheticEvent)}},u=a.declarationIndex>=0?++i:--e,x={ariaLabel:d,ariaColumnIndex:a.ariaColumnIndex},y=a.left!==void 0?this.props.isRtl?{left:a.right,right:a.left}:{left:a.left,right:a.right}:{},v={columnId:C.tableKeyboardNavigationTools.getFilterColumnId(a.id),navigatable:a.navigatable,style:y,className:f.classNames("k-table-th",this.headerCellClassName(a.field,a.locked)||void 0),role:"columnheader",...x},k=b&&(a.filterCell?n.createElement(a.filterCell,{...b}):n.createElement($e,{size:this.props.size,...b})),R=fe(this.props.cells,a.cells);if(R&&R.filterCell){const S=R.filterCell;return n.createElement(S,{key:u,...b,thProps:v,index:i},k)}return n.createElement(C.HeaderThElement,{key:u,...v},k)});return n.createElement("tr",{className:Es,"aria-rowindex":this.props.ariaRowIndex,role:"row"},l)}}E.registerForLocalization(Ot);class Ht extends n.Component{constructor(){super(...arguments),this.draggable=null,this.onPress=t=>{const s=this.draggable&&this.draggable.element;s&&this.props.onPress&&this.props.onPress(t.event,s)},this.onDrag=t=>{const s=this.draggable&&this.draggable.element;s&&this.props.onDrag&&this.props.onDrag(t.event,s)},this.onRelease=t=>{this.draggable&&this.draggable.element&&this.props.onRelease&&this.props.onRelease(t.event)},this.sortChange=t=>{if(t.preventDefault(),this.props.onSortChange){const s=this.props.dir==="asc"?"desc":"asc";this.props.onSortChange(t,s)}},this.groupRemove=t=>{t.preventDefault(),t.stopPropagation(),this.props.onRemove&&this.props.onRemove(t)},this.onContextMenu=t=>{const s={title:this.props.title,dir:this.props.dir,index:this.props.index};this.props.onContextMenu&&this.props.onContextMenu.call(void 0,t,{dataItem:{...s}})}}render(){const{dir:t}=this.props;return n.createElement(f.Draggable,{onPress:this.onPress,onDrag:this.onDrag,onRelease:this.onRelease,ref:s=>{this.draggable=s}},n.createElement("div",{className:"k-chip k-chip-md k-chip-solid k-chip-solid-base k-rounded-md",onClick:this.sortChange,onContextMenu:this.onContextMenu,role:"button",style:{touchAction:"none"}},n.createElement("span",null,n.createElement(f.IconWrap,{name:"sort-"+t+"-small",icon:t==="asc"?w.sortAscSmallIcon:w.sortDescSmallIcon,size:"small"})),n.createElement("span",{className:"k-chip-content"},this.props.title),n.createElement("span",{className:"k-chip-actions"},n.createElement("span",{className:"k-chip-action k-chip-remove-action",onClick:this.groupRemove},n.createElement(f.IconWrap,{name:"x-circle",icon:w.xCircleIcon,size:"small"})))))}}E.registerForLocalization(Ht);class Pt extends n.Component{constructor(){super(...arguments),this.onGroupRemove=(t,s)=>{const o=this.props.group.slice();o.splice(s,1),this.props.groupChange(o,t)},this.onGroupSortChange=(t,s,o,e)=>{const i=Object.assign({},o,{dir:e}),l=this.props.group.slice();l.splice(s,1,i),this.props.groupChange(l,t)}}render(){const s=(this.props.group||[]).map((o,e)=>n.createElement(Ht,{key:e,index:e,dir:o.dir||"asc",title:this.props.resolveTitle(o.field),onRemove:i=>{this.onGroupRemove(i,e)},onSortChange:(i,l)=>{this.onGroupSortChange(i,e,o,l)},onPress:this.props.pressHandler,onDrag:this.props.dragHandler,onRelease:this.props.releaseHandler,onContextMenu:this.props.onContextMenu}));return n.createElement("div",{ref:this.props.refCallback,className:"k-grouping-header",role:"toolbar","aria-label":E.provideLocalizationService(this).toLanguageString(Oe,I[Oe]),"aria-controls":this.props.ariaControls||""},n.createElement("div",{className:"k-chip-list k-chip-list-md",role:"none"},s),n.createElement("div",{className:"k-grouping-drop-container"},!s.length&&E.provideLocalizationService(this).toLanguageString(we,I[we])," "))}}E.registerForLocalization(Pt);class Ss extends n.Component{constructor(){super(...arguments),this.footerWrap=null,this.table=null,this.scrollbarWidth=f.getScrollbarWidth()}componentDidMount(){this.setState({})}setScrollLeft(t){this.footerWrap&&(this.footerWrap.scrollLeft=t)}setWidth(t){this.table&&(this.table.style.width=t+"px")}render(){return this.props.staticHeaders?n.createElement("div",{className:"k-grid-footer",role:"presentation"},n.createElement("div",{ref:t=>{this.footerWrap=t},className:"k-grid-footer-wrap",style:this.scrollbarWidth?{}:{borderWidth:0},role:"presentation"},n.createElement("table",{ref:t=>{this.table=t},className:f.classNames("k-table k-grid-footer-table",{"k-table-md":!this.props.size,[`k-table-${f.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),role:"presentation"},n.createElement("colgroup",{ref:t=>{this.props.columnResize.colGroupFooter=t},role:"presentation"},this.props.cols),n.createElement("tfoot",{className:"k-table-tfoot",role:"presentation"},this.props.row)))):n.createElement("tfoot",{className:"k-table-tfoot"},this.props.row)}}class Is{constructor(t){this.table=null,this.containerHeight=0,this.topCacheCount=0,this.attendedSkip=0,this.propsSkip=0,this.total=0,this.scrollableVirtual=!1,this.realSkip=0,this.pageSize=0,this.PageChange=null,this.tableBodyRef=n.createRef(),this.fixedScroll=!1,this.askedSkip=void 0,this.containerRef=n.createRef(),this.tableTransform="",this.prevScrollPos=0,this.tableTranslate=0,this.scrollSyncing=!1,this.reactVersion=Number.parseFloat(n.version),this.topItems=(s,o)=>{if(!this.container||o)return{topItemsCount:0,topItemsHeight:0};const e=this.container.clientHeight,i=Math.ceil(e/s[0].line),l=Math.ceil((s.length-i)/2);let a=0;for(let c=0;c<l;c++)a+=s[c].line+s[c].acc;return{topItemsCount:l,topItemsHeight:a,itemsNeededOnScreen:i+i/2}},this.horizontalScrollbarHeight=()=>this.container?this.container.offsetHeight-this.container.clientHeight:0,t&&(this.topCacheCount=4,this.attendedSkip=-this.topCacheCount),this.scrollHandler=this.scrollHandler.bind(this)}get container(){return this.containerRef.current}get rowHeights(){const t=[],s=this.tableBodyRef.current&&this.tableBodyRef.current.children||[];let o=0;for(let e=0;e<s.length;e++){if(s[e].className.indexOf("k-grouping-row")>-1){o+=s[e].scrollHeight;continue}s[e].className.indexOf("k-detail-row")>-1?t[t.length-1].line+=s[e].scrollHeight:(t.push({line:s[e].scrollHeight,acc:o}),o=0)}return t}changePage(t,s){this.attendedSkip=t-this.topCacheCount,this.PageChange&&this.PageChange({skip:Math.max(0,t-this.topCacheCount),take:this.pageSize},s)}translate(t,s){this.tableTranslate=t,this.scrollableVirtual&&this.table&&(this.reactVersion<=17||s?this.table.style.transform="translateY("+t+"px)":this.tableTransform="translateY("+t+"px)")}reset(){this.scrollSyncing=!0,!this.fixedScroll&&(this.container&&(this.container.scrollTop=0),this.translate(0,!0))}localScrollUp(t){if(!this.container)return;const s=this.rowHeights,o=this.container.scrollTop;let e=this.tableTranslate,i=0;const{topItemsCount:l,topItemsHeight:a,itemsNeededOnScreen:c}=this.topItems(s,!!this.topCacheCount),h=o-e;if(!(h>a||s.length<=c)){for(;i<this.topCacheCount+this.attendedSkip-this.realSkip+l&&this.propsSkip-i>0&&!(e+(s[s.length-1-i].line+s[s.length-1-i].acc)+h<=o);)e-=s[s.length-1-i].line+s[s.length-1-i].acc,i++;if(i===0&&this.topCacheCount===0&&this.attendedSkip>0&&(e=Math.max(e-s[0].line,0),i=1),this.propsSkip-i<=0&&e>o){this.translate(0),this.changePage(0,t),this.container.scrollTop=0;return}if(e>o&&(e=o),e!==this.tableTranslate){this.translate(Math.max(0,e-a));const d=Math.max(0,this.propsSkip-i-l);this.changePage(d,t)}}}localScrollDown(t){if(!this.container)return;const s=this.rowHeights,o=this.container.scrollTop;let e=this.tableTranslate,i=0;const{topItemsCount:l,topItemsHeight:a,itemsNeededOnScreen:c}=this.topItems(s,!!this.topCacheCount);for(;i<s.length-this.topCacheCount&&!(e+s[i].line+s[i].acc>o);)e+=s[i].line+s[i].acc,i++;l>this.propsSkip+i||s.length<=c||(i>=s.length-this.topCacheCount&&this.propsSkip+i>=this.total?(this.translate(e-a),this.changePage(this.total-1-l,t)):e!==this.tableTranslate&&this.propsSkip+i-l!==this.propsSkip&&(this.translate(e-a),this.changePage(this.propsSkip+i-l,t)))}scrollNonStrict(t){const s=this.total*this.prevScrollPos/this.containerHeight;let o=Math.floor(s);o>=this.total&&(o=this.total-1);const e=Math.min(s-o,1);let i=0;const l=o-this.propsSkip,a=this.rowHeights;l>=0&&l<=1?i=-((a[0].line+a[0].acc)*e):l===-1&&(i=-((a[a.length-1].line+a[a.length-1].acc)*e));const{topItemsCount:c,topItemsHeight:h}=this.topItems(a,!!this.topCacheCount);this.translate(Math.max(0,i-h-this.horizontalScrollbarHeight()+this.containerHeight*s/this.total)),this.changePage(o-c,t)}scrollHandler(t){if(!this.scrollableVirtual)return;if(this.scrollSyncing||!this.container||!this.table){this.scrollSyncing=!1;return}const s=this.container.scrollTop,o=this.prevScrollPos;if(this.prevScrollPos=s,this.askedSkip!==void 0){this.translate(this.containerHeight*this.askedSkip/this.total),this.changePage(this.askedSkip,t),this.prevScrollPos=s,this.askedSkip=void 0;return}s-o<0&&s>this.tableTranslate-this.table.scrollHeight/10?this.localScrollUp(t):s-o>0&&s<this.tableTranslate+this.table.scrollHeight*2/3?this.localScrollDown(t):this.scrollNonStrict(t),this.prevScrollPos=s}}class ht{constructor(t=0,s,o,e){this.total=t,this.offsets=[],this.heights=[];let i=0;for(let l=0;l<t;l++){this.offsets.push(i);const a=e&&e[l].expanded&&e[l].rowType==="data"?o:s;i+=a,this.heights.push(a)}}height(t){return this.heights[t]}index(t){if(t<0)return;const s=this.offsets.reduce((o,e,i)=>{if(o!==void 0)return o;if(e===t)return i;if(e>t)return i-1},void 0);return s===void 0?this.total-1:s}offset(t){return this.offsets[t]}totalHeight(){const t=this.offsets[this.offsets.length-1],s=this.heights[this.heights.length-1];return t+s}}class dt{constructor(t){this.table=null,this.containerHeight=0,this.topCacheCount=0,this.attendedSkip=0,this.propsSkip=0,this.total=0,this.scrollableVirtual=!1,this.realSkip=0,this.pageSize=0,this.PageChange=null,this.tableBodyRef=n.createRef(),this.fixedScroll=!1,this.askedSkip=void 0,this.containerRef=n.createRef(),this.tableTransform="",this.scrollSyncing=!1,this.lastLoaded=0,this.firstLoaded=0,this.lastScrollTop=0,this.reactVersion=Number.parseFloat(n.version),this.firstLoaded=this.pageSize,this.lastLoaded=this.realSkip+this.pageSize,this.scrollHandler=this.scrollHandler.bind(this)}get container(){return this.containerRef.current}translate(t,s){this.scrollableVirtual&&this.table&&(Ie||this.reactVersion<=17||s?this.table.style.transform="translateY("+t+"px)":this.tableTransform="translateY("+t+"px)")}changePage(t,s){this.PageChange&&this.PageChange({skip:Math.max(0,t),take:this.pageSize},s)}reset(){this.scrollSyncing=!0,!this.fixedScroll&&(this.container&&(this.container.scrollTop=0),this.translate(0,!0))}scrollHandler(t){if(!this.scrollableVirtual||!this.container||!this.table||!this.rowHeightService||!this.containerRef.current)return;if(this.scrollSyncing){this.scrollSyncing=!1;return}const s=this.container.scrollTop,o=this.lastScrollTop>=s,e=!o;this.lastScrollTop=s;let i=this.rowHeightService.index(s),l=this.rowHeightService.offset(i);const{offsetHeight:a}=this.containerRef.current,c=this.rowHeightService.index(s+a);if(e&&c>=this.lastLoaded&&this.lastLoaded<this.total){const h=i+this.pageSize-this.total;h>0&&(i=i-h,l=this.rowHeightService.offset(i)),this.firstLoaded=i,this.translate(l);let d=this.firstLoaded+this.pageSize;this.lastLoaded=Math.min(d,this.total),this.changePage(this.firstLoaded,t)}else if(o&&i<this.firstLoaded){const h=Math.floor(this.pageSize*.3);this.firstLoaded=Math.max(i-h,0),this.translate(this.rowHeightService.offset(this.firstLoaded)),this.lastLoaded=Math.min(this.firstLoaded+this.pageSize,this.total),this.changePage(this.firstLoaded,t)}}}const ys=1,ws=20;class Rs{constructor(t){this.columns=[],this.resizable=!1,this.isRtl=!1,this.setIsRtl=s=>{this.isRtl=s},this.dragHandler=(s,o,e,i)=>{const l=s.originalEvent;i||(l.preventDefault(),l.stopPropagation(),l.stopImmediatePropagation());const a=e.closest("th");if(!a||!a)return;const c=a.clientWidth;let h=c;if(this.isRtl?h+=e.getBoundingClientRect().right-e.offsetWidth/2-s.clientX:h+=s.clientX-e.getBoundingClientRect().left-e.offsetWidth/2,!i&&Math.abs(h-c)<1)return;this.fixateInitialWidths(a.parentElement.clientWidth),this.setWidths(o,Math.floor(h)/c);const d=this.columns.filter(g=>!g.children.length).findIndex(g=>g.id===o.id);this.onResize(d,c,h,l,i,o.id)},this.dblClickHandler=(s,o)=>{const e=this.columns.filter(b=>o.indexOf(b.id)>-1);if(!this.colGroupMain||!e.length)return;const i={},l=e;for(;l.length>0;){const b=l.pop();if(!b)break;b.children.length?l.push(...b.children):i[b.id]=b}const a=this.columns.filter(b=>!b.children.length),c=[];a.forEach((b,u)=>{i[b.id]&&c.push(u)});const h=[this.colGroupMain.parentElement],d=[this.colGroupMain];this.colGroupHeader&&(h.push(this.colGroupHeader.parentElement),d.push(this.colGroupHeader)),this.colGroupFooter&&(h.push(this.colGroupFooter.parentElement),d.push(this.colGroupFooter)),h.forEach(b=>b.classList.add("k-autofitting"));let g=[];d.forEach(b=>{c.forEach(u=>{b.children[u]&&(b.children[u].width="",g[u]=Math.max(g[u]||0,b.children[u].offsetWidth+ys))})}),d.forEach(b=>{c.forEach(u=>{b.children[u]&&(b.children[u].width=g[u]+"px",a[u].width=g[u])})}),h.forEach(b=>b.classList.remove("k-autofitting")),this.onResize(c[0],0,0,s,!0,o[0])},this.updateColElements=s=>{const o=this.columns.filter(i=>!i.children.length);let e=1e-10;for(let i=0;i<s.length;i++){const l=s[i],a=o.findIndex(g=>g.id===l.id),c=parseFloat((l.width||0).toString()),h=Math.floor(c);e+=c-h;const d=h+Math.floor(e);if(e-=Math.floor(e),this.colGroupMain&&this.colGroupMain.children[a]){const g=parseInt(this.colGroupMain.children[a].width,10);this.colGroupMain.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupMain.parentElement,l,g-d)}if(this.colGroupHeader&&this.colGroupHeader.children[a]){const g=parseInt(this.colGroupHeader.children[a].width,10);this.colGroupHeader.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupHeader.parentElement,l,g-d)}if(this.colGroupFooter&&this.colGroupFooter.children[a]){const g=parseInt(this.colGroupFooter.children[a].width,10);this.colGroupFooter.children[a].width=d+"px",this.updateNextLockedCol(this.colGroupFooter.parentElement,l,g-d)}}},this.onResize=t}fixateInitialWidths(t){const s=this.columns.filter(l=>!l.children.length);let o=0,e=this.colGroupMain?this.colGroupMain.children:[];for(let l=0;l<e.length;l++)e[l].width?t-=parseFloat(e[l].width):o++;if(o===0)return;const i=Math.floor(t/o);for(let l=0;l<e.length;l++){const a=e[l];a.width||(a.width=i,s[l].width=i.toString(),this.colGroupHeader&&(this.colGroupHeader.children[l].width=i),this.colGroupFooter&&(this.colGroupFooter.children[l].width=i))}}setWidths(t,s){const o=this.columns.findIndex(l=>l.id===t.id),e=[];let i=t.children.length;for(let l=o+1;i>0&&l<this.columns.length;l++,i--){const a=this.columns[l];a.children.length?i+=a.children.length:e.push(a)}return e.length===0&&e.push(t),e.forEach(l=>{let a=l.width?parseFloat(l.width.toString())*s:0;const c=l.minResizableWidth===void 0?10:l.minResizableWidth;a<c&&(a=c),l.width=a}),this.updateColElements(e),e}updateNextLockedCol(t,s,o){const e=s.index,i=this.colGroupMain.parentElement.closest(".k-grid"),l=i==null?void 0:i.clientWidth,a=this.columns.filter(c=>c.locked).map(c=>parseInt(c.width+"",10)).reduce((c,h)=>c+h,0);!s.locked||l<=a+ws||this.columns.forEach(c=>{if(c!=null&&c.locked&&o){const h=t==null?void 0:t.querySelectorAll('[aria-colindex="'+c.ariaColumnIndex+'"]');h==null||h.forEach(d=>{const g=d.style;this.isRtl?(c.index>e&&g&&g.right&&(g.right=parseInt(g.right,10)-o+"px"),c.index<e&&g&&g.left&&(g.left=parseInt(g.left,10)-o+"px")):(c.index>e&&g&&g.left&&(g.left=parseInt(g.left,10)-o+"px"),c.index<e&&g&&g.right&&(g.right=parseInt(g.right,10)-o+"px"))})}})}}class _t{constructor(t,s,o){this.refDragElementClue=n.createRef(),this.refDropElementClue=n.createRef(),this.columns=[],this.reorderable=!1,this.groupable=!1,this.startColumn=-1,this.startGroup=-1,this.currentColumn=-1,this.currentGroup=-1,this.groupPanelDivElement=null,this.refGroupPanelDiv=e=>{this.groupPanelDivElement=e&&e.children?e.children[0]:e},this.pressHandler=(e,i)=>{const l=this.getColumnIndex(e,i);if(this.startGroup=this.getGroupIndex(e),l>=0){const a=this.columns[l];(a.reorderable&&this.reorderable||a.groupable&&this.groupable)&&(this.startColumn=l)}},this.dragHandler=(e,i)=>{if(e.isTouch||e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),this.startColumn===-1&&this.startGroup===-1)return;this.currentColumn=this.getColumnIndex(e,i);const l=this.groupPanelDivElement&&this.groupPanelDivElement.children;this.currentGroup=this.isTargetGroupingContainer(e)?l&&l.length?l.length:0:this.getGroupIndex(e);const a=!this.isValid();a&&(this.currentColumn=-1,this.currentGroup=-1);const c=this.currentColumn>=0?i.children[this.columns[this.currentColumn].index]:this.isTargetGroupingContainer(e)?e.originalEvent.target:this.groupPanelDivElement&&this.groupPanelDivElement.children[this.currentGroup];this.updateDragElementClue(e,i,c,a),this.updateDropElementClue(e,i,c,a)},this.releaseHandler=e=>{const i=this.startColumn,l=this.currentColumn,a=this.startGroup,c=this.currentGroup;e.originalEvent.preventDefault(),this.dropElementClue&&this.dropElementClue.setState({visible:!1}),this.dragElementClue&&this.dragElementClue.setState({visible:!1});const h=this.isValid();this.startColumn=this.startGroup=this.currentColumn=this.currentGroup=-1,h&&(i>=0&&l>=0?this.columnReorder(i,l,e.originalEvent):a>=0&&c>=0?this.groupReorder(a,c,e.originalEvent):i>=0&&c>=0&&this.columnToGroup(i,c,e.originalEvent))},this.columnReorder=t,this.groupReorder=s,this.columnToGroup=o}get dragClueRef(){return this.refDragElementClue}get dropClueRef(){return this.refDropElementClue}get dragElementClue(){return this.refDragElementClue.current}get dropElementClue(){return this.refDropElementClue.current}getColumnIndex(t,s){if(!s||s.parentElement===this.groupPanelDivElement)return-1;const o=C.getIndex(t,s);if(o===-1)return-1;for(let e=0;e<s.parentNode.children.length;e++)if(s.parentNode.children[e]===s)return this.columns.findIndex(i=>i.index===o&&i.depth===e);return-1}isTargetGroupingContainer(t){const s=t.originalEvent.target;return s.className.indexOf?s.className.indexOf("k-grouping-drop-container")!==-1:!1}getGroupIndex(t){return C.getIndex(t,this.groupPanelDivElement)}isValid(){return this.startGroup>=0?this.currentGroup>=0&&this.currentGroup!==this.startGroup:this.startColumn===-1?!1:this.currentGroup>=0?this.columns[this.startColumn].groupable===!0&&this.groupable===!0:this.reorderable===!0&&this.currentColumn>=0&&this.currentColumn!==this.startColumn&&this.columns[this.startColumn].reorderable===!0&&this.columns[this.currentColumn].parentIndex===this.columns[this.startColumn].parentIndex}updateDragElementClue(t,s,o,e){if(!this.dragElementClue)return;const i=this.startColumn>=0?s.children[this.columns[this.startColumn].index].innerText:s.innerText;this.dragElementClue.setState({visible:!0,top:t.pageY+10,left:t.pageX,innerText:i,status:e||!o?"k-i-cancel":"k-i-plus"})}updateDropElementClue(t,s,o,e){if(!this.dropElementClue)return;if(e||!o){this.dropElementClue.setState({visible:!1});return}const i=o.getBoundingClientRect(),a=(o.closest(".k-grouping-header")||o).getBoundingClientRect();let c=i.left+t.pageX-t.clientX-6;!this.isTargetGroupingContainer(t)&&(this.currentColumn>this.startColumn||this.currentGroup>this.startGroup&&this.startGroup!==-1)&&(c+=i.width);const h=a.top+t.pageY-t.clientY;this.dropElementClue.setState({visible:!0,top:h,left:c,height:this.currentColumn>=0?s.clientHeight:a.height})}}const At=r=>{let t=null;const s=E.useInternationalization(),o=C.useTableKeyboardNavigation(r.id),e=n.useCallback(h=>{r.onContextMenu&&r.onContextMenu.call(void 0,h,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]);let i=null,l=null;if(r.rowType==="groupFooter")i={onContextMenu:e,className:r.className},t=n.createElement("td",{...i});else if(r.rowType!=="groupHeader"){if(r.field!==void 0){const d=L(r.field,r.dataItem);d!=null&&(l=r.format?s.format(r.format,d):d.toString())}const h=f.classNames("k-table-td",r.className,{"k-selected":r.isSelected});i={onContextMenu:e,colSpan:r.colSpan,style:r.style,className:h,role:"gridcell","aria-colindex":r.ariaColumnIndex,"aria-selected":r.isSelected,[U]:r.columnIndex,...o},t=n.createElement("td",{...i},l)}const a=r.rowType||"data",c=r.cells;if(c&&c[a]){const h=c[a];return n.createElement(h,{...r,tdProps:i},l)}return r.render?r.render.call(void 0,t,r):t},_e=r=>{let t=null;const{columnIndex:s,level:o,columnsCount:e,rowType:i,dataItem:l,field:a,onChange:c,expanded:h,render:d,dataIndex:g,ariaColumnIndex:b,isRtl:u}=r,x=a||"",y=C.useTableKeyboardNavigation(r.id),v=E.useLocalization();let k=null,R=null,S=null;const P=n.useCallback(T=>{T.isDefaultPrevented()||T.keyCode===f.Keys.enter&&c&&(T.preventDefault(),c({dataItem:l,dataIndex:g,syntheticEvent:T,field:void 0,value:!h}))},[h,c,l,g]),M=n.useCallback(T=>{r.onContextMenu&&r.onContextMenu.call(void 0,T,r.dataItem,r.field)},[r.onContextMenu,r.dataItem,r.field]),ce=(T,be)=>{const he=h?yt:It,ve=v.toLanguageString(he,I[he]);return k={className:"k-table-td",style:{...r.style,...be},colSpan:T,key:"g-colspan",role:"gridcell",["aria-selected"]:!1,["aria-expanded"]:h,["aria-colindex"]:b,onKeyDown:P,onContextMenu:M,...y},S=n.createElement("p",{className:"k-reset"},n.createElement("a",{onClick:Q=>{Q.preventDefault(),c&&c({dataItem:l,dataIndex:g,syntheticEvent:Q,field:void 0,value:!h})},href:"#",tabIndex:-1,"aria-label":ve},n.createElement(f.IconWrap,{name:h?"caret-alt-down":u?"caret-alt-left":"caret-alt-right",icon:h?w.caretAltDownIcon:u?w.caretAltLeftIcon:w.caretAltRightIcon})),l[x]instanceof Date&&l[x].toString?l[x].toString():l[x]),n.createElement("td",{...k,key:k.key},S)};s===void 0||o===void 0||s<o||e===void 0||i!=="groupHeader"||l[x]===void 0?(k={style:r.style,key:"g"+s,className:f.classNames("k-table-td","k-group-cell",{"k-grid-content-sticky":r.locked}),role:"gridcell",onContextMenu:M},t=n.createElement("td",{...k,key:k.key})):s<=o&&!r.locked?t=ce(e-s,{}):s<=o&&r.locked&&(R={className:"k-table-td",role:"gridcell",colSpan:e-s,style:{borderLeftWidth:0,borderRightWidth:0},onContextMenu:M},t=n.createElement(n.Fragment,null,ce(0,{position:"sticky",zIndex:2}),n.createElement("td",{...R})));const Y=r.rowType||"data",V=r.cells;if(V&&V.group&&V.group[Y]){const T=V.group[Y];return n.createElement(T,{...r,tdProps:k,td2Props:R},S)}return d?d.call(void 0,t,r):t};class Bt extends n.Component{render(){const t=f.classNames("k-table-row",{"k-table-group-row k-grouping-row":this.props.rowType==="groupHeader","k-group-footer":this.props.rowType==="groupFooter","k-master-row":this.props.rowType!=="groupHeader"&&this.props.rowType!=="groupFooter","k-table-alt-row k-alt":this.props.rowType!=="groupHeader"&&this.props.rowType!=="groupFooter"&&this.props.isAltRow,"k-selected":this.props.isSelected,"k-grid-edit-row":this.props.isInEdit}),s=n.createElement("tr",{id:this.props.id,onClick:this.props.onClick,onDoubleClick:this.props.onDoubleClick,className:t,style:{height:this.props.rowHeight?this.props.rowHeight+"px":"",visibility:this.props.isHidden?"hidden":""},role:"row","aria-rowindex":this.props.ariaRowIndex,"absolute-row-index":this.props.absoluteRowIndex,key:this.props.absoluteRowIndex,[Dt]:this.props.rowType==="data"?this.props.dataIndex:void 0},this.props.children);return this.props.render?this.props.render.call(void 0,s,this.props):s}}class Wt extends n.Component{get _inputId(){return this.props.id}render(){const t=E.provideLocalizationService(this),{columnMenuWrapperProps:s}=this.props,o=[n.createElement("span",{key:0,className:"k-checkbox-wrap"},n.createElement("input",{id:this._inputId,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md","aria-label":t.toLanguageString(le,I[le]),"aria-checked":this.props.selectionValue,onChange:e=>this.props.selectionChange({field:this.props.field,syntheticEvent:e})})),s.columnMenu&&n.createElement(We,{...s})];return this.props.render?this.props.render.call(void 0,o,this.props):o}}E.registerForLocalization(Wt);const Ns=f.withIdHOC(Wt);class me extends n.Component{render(){return this.props.children||E.provideLocalizationService(this).toLanguageString(ye,I[ye])}}me.displayName="KendoReactGridNoRecords";E.registerForLocalization(me);class Fs extends n.Component{constructor(){super(...arguments),this._element=null,this.renderCell=(t,s)=>{const o={colSpan:t.colSpan!==1?t.colSpan:void 0,style:t.left!==void 0?this.props.isRtl?{left:t.right,right:t.left}:{left:t.left,right:t.right}:{},className:f.classNames("k-table-td",t.locked&&t.left!==void 0?"k-grid-footer-sticky":""),key:s,role:"gridcell",["aria-colindex"]:t.ariaColumnIndex},e={field:t.field,ariaColumnIndex:t.ariaColumnIndex,...o},i=fe(this.props.cells,t.cells);if(i&&i.footerCell){const l=i.footerCell;return n.createElement(l,{...e,tdProps:o,index:s})}return t.footerCell&&n.createElement(t.footerCell,{...e,key:s})||n.createElement("td",{...o})}}get element(){return this._element}render(){return n.createElement("tr",{className:"k-table-row",role:"row","aria-rowindex":this.props.ariaRowIndex},cs(this.props.columns).map(this.renderCell))}}const Ds=({buttonCount:r=10,info:t=!0,type:s="numeric",pageSizes:o=void 0,previousNext:e=!0,responsive:i=void 0,pageSizeValue:l=void 0})=>({buttonCount:r,info:t,pageSizes:o===!0?[5,10,20]:o||void 0,previousNext:e,responsive:i!==!1,type:s,pageSizeValue:l}),Ts=r=>Ds(r===!0?{}:r),pt={name:"@progress/kendo-react-grid",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},Gs=r=>{const{colSpan:t,ariaColIndex:s,dataItem:o,dataIndex:e,id:i}=r,l=C.useTableKeyboardNavigation(i),a=n.useCallback(c=>{r.onContextMenu&&r.onContextMenu.call(void 0,c,r.dataItem)},[r.onContextMenu,r.dataItem]);return n.createElement("td",{onContextMenu:a,className:"k-table-td k-detail-cell",colSpan:t,"aria-colindex":s,role:"gridcell",...l},n.createElement(r.detail,{dataItem:o,dataIndex:e}))},zs=r=>{const t=C.useTableKeyboardNavigation(r.id);return n.createElement("td",{className:"k-table-td k-hierarchy-cell",...t,role:"gridcell"})};let X=class extends n.Component{constructor(t){super(t),this._columns=[],this._columnsMap=[[]],this._columnsMutations=0,this._resized=!1,this._shouldUpdateLeftRight=!0,this.contextStateRef={current:void 0},this.navigationStateRef={current:void 0},this._data=[],this._slicedData=void 0,this.wrapperScrollTop=0,this.showLicenseWatermark=!1,this.headerRef=n.createRef(),this.headerElementRef=n.createRef(),this._element=null,this.tableElement=null,this.containerRef=n.createRef(),this.tableBodyRef=n.createRef(),this._footer=null,this.forceUpdateTimeout=void 0,this.isRtl=!1,this.observer=null,this.handleIntersection=e=>{const i={rowIndex:this.rowIndex};e.forEach(l=>{l.isIntersecting||this.setCurrentOnTop(i)})},this.setCurrentOnTop=e=>{if(!this.vs.container||this.props.scrollable==="none")return;this.observer&&this.observer.disconnect();const{rowIndex:i}=e;if(this.props.scrollable==="virtual")this.vs.askedSkip=i,this.vs.container.scroll(0,Math.round(this.vs.askedSkip/this.vs.total*this.vs.container.scrollHeight));else if(this.element){const l=i<1?this.element.querySelector("tbody > tr:nth-child(1)"):this.element.querySelector(`tbody > tr:nth-child(${i+1})`);l&&this.containerRef.current&&(this.containerRef.current.scrollTop=l.offsetTop)}},this.scrollIntoView=e=>{if(!this.vs.container||this.props.scrollable==="none")return;this.rowIndex=e.rowIndex;const{rowIndex:i}=e,l=this.element;if(this.observer&&l){this.observer.disconnect();const a=l.querySelector(`[absolute-row-index="${i}"]`);a?this.observer.observe(a):this.setCurrentOnTop(e)}},this.fitColumns=e=>{this.columnResize.dblClickHandler(null,e)},this.onContextMenu=(e,i,l)=>{if(this.props.onContextMenu){const a={target:this,syntheticEvent:e,nativeEvent:e.nativeEvent,dataItem:i,field:l};this.props.onContextMenu.call(void 0,a)}},this.getVirtualScroll=e=>{const{rowHeight:i,detailRowHeight:l,detail:a,expandField:c,groupable:h}=e,d=this.isAllData(),g=i!==void 0&&i>0,b=l!==void 0&&l>0,u=h===!0||typeof h=="object"&&h.enabled!==!1;return!g||u&&!d||!!(a&&c)&&(!b||!d)?Is:dt},this.isAllData=()=>{const{data:e,total:i}=this.props;return Array.isArray(e)?e.length===i:e?i===e.total:!1},this.initializeVirtualization=(e,i)=>{if(this.reInitVirtualization(this.props.scrollable==="virtual",this.props.total,this.props.filter,this.props.group,this.props.sort,i||this.props.rowHeight===void 0||this.props.rowHeight===0),this.vs.fixedScroll=this.props.fixedScroll||!1,this.vs.PageChange=this.pageChange,this.vs.realSkip=this.props.skip||0,this.vs.pageSize=(this.props.take!==void 0?this.props.take:this.props.pageSize)||0,this.vs.scrollableVirtual=this.props.scrollable==="virtual",this.vs.total=e,this.vs.propsSkip=(this.props.skip||0)+(this.props.scrollable==="virtual"?this.vs.topCacheCount+(this.vs.attendedSkip-(this.props.skip||0)):0),this.props.rowHeight!==void 0&&this.props.rowHeight>0&&!i){const l=this.props.rowHeight*e;this.vs.containerHeight=Ie?Math.min(ct,l):l}else this.vs.containerHeight=1533915;if(this.vs.containerRef=this.containerRef,this.vs.tableBodyRef=this.tableBodyRef,this.vs.table=this.tableElement,this._slicedData=void 0,this.vs instanceof dt){const{rowHeight:l=0,detail:a,expandField:c}=this.props;let{detailRowHeight:h=0}=this.props;h=a&&c?h:l,this.isAllData()?(this.vs.total=this._data.length,this._slicedData=this._data.slice(this.vs.realSkip,this.vs.realSkip+this.vs.pageSize),this.vs.rowHeightService=this.rowHeightService(this.vs,this._data.length,l,h,this._data)):this.vs.rowHeightService=new ht(e,l,h);const d=this.vs.rowHeightService.totalHeight();this.vs.containerHeight=Ie?Math.min(ct,d):d}},this.scrollHandler=e=>{if(e.target!==e.currentTarget)return;clearTimeout(this.forceUpdateTimeout),this.vs.table=this.tableElement;const i=e.currentTarget.scrollLeft,l=e.currentTarget.scrollTop;this.props.columnVirtualization&&(!this.vs.scrollableVirtual||l===this.wrapperScrollTop)&&(this.forceUpdateTimeout=window.setTimeout(()=>{this.forceUpdate()},0)),this._header&&this._header.setScrollLeft(i),this._footer&&this._footer.setScrollLeft(i),this.vs&&l!==this.wrapperScrollTop&&this.vs.scrollHandler(e),f.dispatchEvent(this.props.onScroll,e,this,void 0),this.wrapperScrollTop=l},this.onKeyDown=e=>{if(C.tableKeyboardNavigation.onKeyDown(e,{contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,onNavigationAction:this.onNavigationAction}),this.props.onKeyDown){const{mode:i,cell:l}=C.getSelectionOptions(this.props.selectable),a={dataItems:this.getLeafDataItems(),mode:i,cell:l,componentId:this._gridId,selectedField:this.props.selectedField,...this.getArguments(e)};this.props.onKeyDown.call(void 0,a)}},this.onFocus=e=>{C.tableKeyboardNavigation.onFocus(e,{contextStateRef:this.contextStateRef})},this.onNavigationAction=e=>{if(this.props.onNavigationAction){const i={focusElement:e.focusElement,...this.getArguments(e.event)};this.props.onNavigationAction.call(void 0,i)}},this.rowClick=(e,i)=>{this.props.onRowClick&&e.target.nodeName==="TD"&&this.props.onRowClick.call(void 0,{dataItem:i.dataItem,...this.getArguments(e)})},this.rowDblClick=(e,i)=>{this.props.onRowDoubleClick&&e.target.nodeName==="TD"&&this.props.onRowDoubleClick.call(void 0,{dataItem:i.dataItem,...this.getArguments(e)})},this.itemChange=e=>{const i=this.props.onItemChange;if(e.field===this.props.expandField||this.props.group&&e.field===void 0){const l=this.props.onExpandChange;l&&l.call(void 0,{...this.getArguments(e.syntheticEvent),dataItem:e.dataItem,dataIndex:e.dataIndex,value:e.value});return}i&&i.call(void 0,{...this.getArguments(e.syntheticEvent),dataItem:e.dataItem,field:e.field,value:e.value})},this.onHeaderSelectionChange=e=>{this.props.onHeaderSelectionChange&&this.props.onHeaderSelectionChange.call(void 0,{field:e.field,nativeEvent:e.syntheticEvent&&e.syntheticEvent.nativeEvent,syntheticEvent:e.syntheticEvent,target:this,dataItems:this.getLeafDataItems(),selectedField:this.props.selectedField})},this.selectionRelease=e=>{if(this.props.onSelectionChange){const i={syntheticEvent:void 0,target:this,selectedField:this.props.selectedField||"",componentId:this._gridId,dataItems:this.getLeafDataItems(),dataItem:null,...e};this.props.onSelectionChange.call(void 0,i)}},this.pageChange=(e,i,l)=>{this.raiseDataEvent(this.props.onPageChange,{page:e},{skip:e.skip,take:e.take},i,l)},this.pagerPageChange=e=>{this.pageChange({skip:e.skip,take:e.take},e.syntheticEvent,e.targetEvent)},this.sortChange=(e,i)=>{this.raiseDataEvent(this.props.onSortChange,{sort:e},{sort:e,...this.props.scrollable==="virtual"?{skip:0}:{}},i)},this.filterChange=(e,i)=>{this.raiseDataEvent(this.props.onFilterChange,{filter:e},{filter:e||void 0,skip:0},i)},this.groupChange=(e,i)=>{const l=i.nativeEvent?i:{nativeEvent:i.nativeEvent||i.originalEvent};this.raiseDataEvent(this.props.onGroupChange,{group:e},{group:e,skip:0},l)},this.onClipboard=(e,i)=>{if(this.props.onClipboard){if(!this.inActiveElement()||!e)return;this.props.onClipboard.call(void 0,{type:e,nativeEvent:i,columns:this._columns,dataItemKey:this.props.dataItemKey||"",...typeof this.props.clipboard!="boolean"?this.props.clipboard:{}})}},this.inActiveElement=()=>{var c,h,d;if(!f.canUseDOM)return!1;const e=f.getActiveElement(this.document),i=e?e.matches(".k-table-td")?e:(c=this.document)==null?void 0:c.body:(h=this.document)==null?void 0:h.body,l=i.closest(".k-grid-container"),a=i&&((d=this._element)==null?void 0:d.contains(i));return!!(i&&a&&l)},this.onResize=(e,i,l,a,c,h)=>{this.resetTableWidth(),this._shouldUpdateLeftRight=!0,this._resized=!0,this._columnsMutations++,this.props.onColumnResize&&this.props.onColumnResize.call(void 0,{columns:this.columns,nativeEvent:a,targetColumnId:h,index:e,newWidth:i,oldWidth:l,end:c,target:this})},this.reInitVirtualization=f.memoizeOne((e,i,l,a,c,h)=>{this.vs.reset();const d=this.getVirtualScroll(this.props);this.vs=new d(h)}),this.flatData=f.memoizeOne((e,i,l,a,c,h,d)=>{const g=[],b=ut(g,e,i,{index:l},a!==void 0,c);return{flattedData:g,resolvedGroupsCount:b}}),this.rowHeightService=f.memoizeOne((e,i,l,a,c)=>new ht(i,l,a,c)),this.childrenToArray=f.memoizeOne(e=>n.Children.toArray(e)),this.readColumns=f.memoizeOne((e,i,l)=>{const a=e.filter(c=>c&&c.type&&c.type.displayName==="KendoReactGridColumn");return gt(a,this.columns,{prevId:0,idPrefix:i})}),this.mapColumns=f.memoizeOne(e=>C.mapColumns(e)),this.configureColumns=f.memoizeOne((e,i,l)=>{this.props.selectedField&&e.filter(h=>h.field===this.props.selectedField).forEach(h=>{h.width=h.width||"50px",h.cell=h.cell||Nt,h.headerCell=h.headerCell||Ns});const a={id:"",resizable:!0,width:"32px",title:" ",declarationIndex:-1,orderIndex:-1,children:[],parentIndex:-1,depth:0,colSpan:0,rowSpan:0,left:0,right:0,index:0,rightBorder:!1,ariaColumnIndex:0,isAccessible:!0};let c=0;this.props.expandField&&this.props.onExpandChange&&this.props.detail&&(e.unshift({...a,cell:Ft,field:this.props.expandField,headerClassName:"k-hierarchy-cell k-header",id:C.tableKeyboardNavigationTools.generateNavigatableId(`${this._columns.length}`,l,"column")}),c++);for(let h=0;h<i;h++)e.unshift({...a,isAccessible:!1,cell:_e,field:"value",locked:this.props.lockGroups}),c++;e.slice(c).forEach(h=>h.parentIndex>=0&&(h.parentIndex+=c))}),this.getHeaderRow=f.memoizeOne((e,i,l,a,c,h,d,g,b,u,x,y)=>n.createElement(Mt,{cells:this.props.cells,sort:e,sortable:i,sortChange:this.sortChange,group:l||[],groupable:a,groupChange:this.groupChange,filter:c,filterable:h,filterOperators:d,filterChange:this.filterChange,columnMenu:b,selectionChange:this.onHeaderSelectionChange,columns:u,columnResize:this.columnResize,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler,columnsMap:x,cellRender:g,isRtl:y,dragClue:this.dragLogic.dragClueRef,headerRef:this.headerElementRef,containerRef:this.containerRef})),this.resolveTitle=e=>{const i=this._columns.find(a=>a.field===e),l=i&&(i.title||i.field);return l===void 0?e:l},this.getLeafDataItems=()=>this._data.filter(e=>e.rowType==="data").map(e=>e.dataItem),f.validatePackage(pt),this.showLicenseWatermark=f.shouldShowValidationUI(pt);const s=this.props.groupable===!0||typeof this.props.groupable=="object"&&this.props.groupable.enabled!==!1,o=this.getVirtualScroll(t);this.vs=new o(s||t.rowHeight===void 0||t.rowHeight===0),this.dragLogic=new _t(this.columnReorder.bind(this),this.groupReorder.bind(this),this.columnToGroup.bind(this)),this.columnResize=new Rs(this.onResize),this.props.clipboard&&(this.clipboardService=new C.ClipboardService(this.onClipboard)),C.tableKeyboardNavigation.onConstructor({navigatable:!!t.navigatable,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,idPrefix:this._gridId})}get columns(){const t=this._columns.filter(s=>s.declarationIndex>=0&&s.parentIndex===-1);return ft(t)}get element(){return this._element}get document(){if(f.canUseDOM)return this.element&&this.element.ownerDocument||document}get _header(){return this.headerRef.current}get _gridId(){return this.props.id+"-role-element-id"}componentDidMount(){this.resetTableWidth(),f.setScrollbarWidth();const t=C.isRtl(this.element);this.isRtl=t,C.tableKeyboardNavigation.onComponentDidMount({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),this.isRtl&&this.forceUpdate();const s={rootMargin:"0px",threshold:.9};this.clipboardService&&this.clipboardService.addEventListeners(this.document),this.observer=f.canUseDOM&&window.IntersectionObserver&&new window.IntersectionObserver(this.handleIntersection,s)||null}getSnapshotBeforeUpdate(){return C.tableKeyboardNavigation.onGetSnapshotBeforeUpdate({document:this.document,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),null}componentDidUpdate(){this.resetTableWidth(),f.setScrollbarWidth(),this.vs.tableTransform&&this.vs.table&&(this.vs.table.style.transform=this.vs.tableTransform,this.vs.tableTransform=""),C.tableKeyboardNavigation.onComponentDidUpdate({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}componentWillUnmount(){clearTimeout(this.forceUpdateTimeout),this.clipboardService&&this.clipboardService.removeEventListeners(this.document)}render(){var lt;let t=this.props.total||0;const s=C.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);let o=[];Array.isArray(this.props.data)?(o=this.props.data,t=t||this.props.data.length):this.props.data&&(o=this.props.data.data,t=t||this.props.data.total);const e=typeof this.props.groupable=="object"&&this.props.groupable.footer||"none",{resolvedGroupsCount:i,flattedData:l}=this.flatData(o,e,this.props.skip||0,this.props.group,this.props.expandField,this.props.filter,this.props.sort);this._data=l;const a=this.props.groupable===!0||typeof this.props.groupable=="object"&&this.props.groupable.enabled!==!1;this.columnResize.resizable=this.props.resizable||!1,this.dragLogic.reorderable=this.props.reorderable||!1,this.dragLogic.groupable=a;const c=this.props.selectable&&this.props.selectable.drag?"none":void 0;this.initializeVirtualization(t,a);const h=this.childrenToArray(this.props.children);this.initColumns(h,i);const d=h.map(m=>m&&m.type&&m.type.displayName==="KendoReactGridToolbar"?n.cloneElement(m,{...m.props,ariaControls:this._gridId}):null),g=h.filter(m=>m&&m.type&&m.type.displayName==="KendoReactGridNoRecords"),b=h.filter(m=>m&&m.type&&m.type.displayName==="KendoReactGridStatusBar"),u=this._columns.filter(m=>m.children.length===0),x=a&&n.createElement(Pt,{group:this.props.group||[],groupChange:this.groupChange,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler,refCallback:this.dragLogic.refGroupPanelDiv,resolveTitle:this.resolveTitle,ariaControls:this._gridId,onContextMenu:this.onContextMenu}),{sort:y,sortable:v,group:k,filter:R,filterable:S,filterOperators:P=He,headerCellRender:M,columnMenu:ce}=this.props,Y=n.createElement(fs,{size:this.props.size,columnResize:this.columnResize,staticHeaders:this.props.scrollable!=="none",scrollableDataElement:()=>this.vs.container,draggable:this.props.reorderable||a,ref:this.headerRef,elemRef:this.headerElementRef,headerRow:this.getHeaderRow(y,v,k,a,R,S,P,M,ce,this._columns,this._columnsMap,this.isRtl),filterRow:this.props.filterable&&n.createElement(Ot,{cells:this.props.cells,size:this.props.size,columns:this._columns,filter:this.props.filter,filterOperators:this.props.filterOperators||He,filterChange:this.filterChange,sort:this.props.sort,cellRender:this.props.filterCellRender,isRtl:this.isRtl,ariaRowIndex:this._columnsMap.length+1})||void 0,cols:u.map((m,F)=>n.createElement("col",{key:F.toString(),width:Se(m)}))}),V=this.vs&&this.vs.container&&this.vs.container.scrollLeft||0,T=parseFloat(((this.props.style||{}).width||"").toString()),{colSpans:be,hiddenColumns:he}=C.tableColumnsVirtualization({enabled:this.props.columnVirtualization,columns:u,tableViewPortWidth:T,scrollLeft:V}),ve=(m,F,D)=>{let q=!1;const W=this.props.selectedField?L(this.props.selectedField,m.dataItem):void 0;return{row:u.map((N,G)=>{if(he[G])return null;const Z=N.id?N.id:G,ee=`${N.className?N.className+" ":""}${N.locked?"k-grid-content-sticky":""}`,_=N.left!==void 0?this.isRtl?{left:N.right,right:N.left}:{left:N.left,right:N.right}:{};let A=!1;if(N.editable&&this.props.editField){const O=L(this.props.editField,m.dataItem);O&&(O===!0||O===N.field)&&(q=!0,A=!0)}const Ee=N.cell||A&&Tt||At;return n.createElement(Ee,{onContextMenu:this.onContextMenu,key:Z,locked:this.props.lockGroups,id:C.tableKeyboardNavigationTools.generateNavigatableId(`${F}-${String(G)}`,s),colSpan:be[G],dataItem:m.dataItem,field:N.field,editor:N.editor,format:N.format,className:ee,render:this.props.cellRender,cells:fe(this.props.cells,N.cells),onChange:this.itemChange,selectionChange:this.props.onSelectionChange?O=>{this.selectionChange({event:O,dataItem:m.dataItem,dataIndex:D,columnIndex:G})}:void 0,columnIndex:G,columnsCount:u.length,rowType:m.rowType,level:m.level,expanded:m.expanded,dataIndex:m.dataIndex,style:_,ariaColumnIndex:N.ariaColumnIndex,isSelected:Array.isArray(W)&&W.indexOf(G)>-1})}),isInEdit:q,isSelected:typeof W=="boolean"&&W}};let Q=0;if(this.props.scrollable==="virtual")for(let m=0;m<this.vs.topCacheCount+this.vs.attendedSkip-(this.props.skip||0);m++){const F=this._data.shift();if(F)this._data.push(F),Q++,F.rowType==="groupHeader"&&m--;else break}const Je=m=>m>=this._data.length-Q;let Ze=this.vs.realSkip||0;const de=[];let xe=!1;const ke=this._columnsMap.length+(this.props.filterable?1:0)+1,et=n.createElement("div",{key:"no-records",className:"k-grid-norecords","aria-rowindex":ke},n.createElement("div",{className:"k-grid-norecords-template"},g.length?g:n.createElement(me,null)));let J=0;if(this._data.length){let m=-1,F=0;(this._slicedData||this._data).forEach((D,q)=>{D.rowType==="data"&&(Ze++,m++);const W=Ze%2===0,N=this.props.dataItemKey&&f.getter(this.props.dataItemKey)(D.dataItem),G=q+(this.vs.realSkip||0),Z=N||"ai"+G,ee=Z+"_1",_=ve(D,Z,m);if(J=G+ke+F,de.push(n.createElement(Bt,{key:Z,dataItem:D.dataItem,isAltRow:W,isInEdit:_.isInEdit,rowType:D.rowType,isHidden:Je(q),onClick:A=>this.rowClick(A,D),onDoubleClick:A=>this.rowDblClick(A,D),selectedField:this.props.selectedField,rowHeight:this.props.rowHeight,render:this.props.rowRender,ariaRowIndex:J,absoluteRowIndex:G,dataIndex:m,isSelected:_.isSelected},_.row)),this.props.detail&&D.rowType==="data"&&D.expanded){const A=u.length-(this.props.expandField?1:0)-(this.props.group?this.props.group.length:0)||1;F++,J=G+ke+F,de.push(n.createElement("tr",{key:ee,className:f.classNames("k-table-row",W?"k-detail-row k-table-alt-row k-alt":"k-detail-row"),style:{visibility:Je(q)?"hidden":"",height:this.props.detailRowHeight},role:"row","aria-rowindex":J},this.props.group&&this.props.group.map((Ee,O)=>{var at;const te=(at=_==null?void 0:_.row[O])==null?void 0:at.props.style,ss=te?this.isRtl?{left:te.right,right:te.left}:{left:te.left,right:te.right}:{};return n.createElement(_e,{id:"",dataIndex:D.dataIndex,field:Ee.field,dataItem:D.dataItem,key:O,style:ss,ariaColumnIndex:1+O,isSelected:!1,locked:this.props.lockGroups,isRtl:this.isRtl,cells:this.props.cells})}),this.props.expandField&&n.createElement(zs,{id:C.tableKeyboardNavigationTools.generateNavigatableId(`${ee}-dhcell`,s)}),n.createElement(Gs,{onContextMenu:this.onContextMenu,dataItem:D.dataItem,dataIndex:D.dataIndex,colSpan:A,ariaColIndex:2+(this.props.group?this.props.group.length:0),detail:this.props.detail,id:C.tableKeyboardNavigationTools.generateNavigatableId(`${ee}-dcell`,s)})))}})}else xe=!0;const tt={size:this.props.size,onPageChange:this.pagerPageChange,total:t,dir:this.isRtl?"rtl":void 0,skip:this.vs.propsSkip||0,take:(this.props.take!==void 0?this.props.take:this.props.pageSize)||10,messagesMap:gs,...Ts(this.props.pageable||{})},st=this.props.pager?n.createElement(this.props.pager,{...tt}):n.createElement(C.Pager,{className:"k-grid-pager",...tt}),es=m=>this.props.sort&&this.props.sort.filter(F=>F.field===m).length>0,ts=(m,F)=>n.createElement("col",{key:F.toString(),width:Se(m)}),rt=(lt=this.props.cells)!=null&<.footerCell||this._columns.some(m=>{var F;return!!(m.footerCell||(F=m.cells)!=null&&F.footerCell)})?n.createElement(Ss,{size:this.props.size,columnResize:this.columnResize,staticHeaders:this.props.scrollable!=="none",ref:m=>this._footer=m,row:n.createElement(Fs,{cells:this.props.cells,columns:this._columns,isRtl:this.isRtl,ariaRowIndex:J+1}),cols:u.map(ts)}):null,it=n.createElement("colgroup",{ref:m=>{this.columnResize.colGroupMain=m}},u.map((m,F)=>n.createElement("col",{key:F.toString(),className:es(m.field)?"k-sorted":void 0,width:Se(m)}))),ot=this.dragLogic.reorderable||this.dragLogic.groupable,nt=this.props.columnVirtualization?"block":"table";if(this.props.scrollable==="none")return n.createElement(C.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},n.createElement("div",{id:this.props.id,style:this.props.style,className:f.classNames("k-grid",{"k-grid-md":!this.props.size,[`k-grid-${f.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),ref:m=>{this._element=m},"aria-label":this.props.ariaLabel,onKeyDown:this.onKeyDown,onFocus:this.onFocus,...C.tableKeyboardNavigationScopeAttributes},d,x,n.createElement(C.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:m=>{this.tableElement=m}},n.createElement("table",{className:f.classNames("k-table k-grid-table",{[`k-table-${f.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size}),style:{userSelect:c,display:nt}},it,Y,n.createElement("tbody",{role:"rowgroup",className:"k-table-tbody",...C.tableKeyboardNavigationBodyAttributes},de),rt)),xe&&et,ot&&n.createElement(n.Fragment,null,n.createElement(C.DropClue,{ref:this.dragLogic.refDropElementClue}),n.createElement(C.DragClue,{ref:this.dragLogic.refDragElementClue}))),b,this.props.pageable&&st);let pe=this.props.style||{};return this.props.scrollable==="virtual"&&(pe.height||(pe=Object.assign({},pe,{height:"450px"}))),n.createElement(C.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},n.createElement("div",{id:this.props.id,style:pe,className:f.classNames("k-grid",{"k-grid-md":!this.props.size,[`k-grid-${f.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size,"k-grid-virtual":this.props.scrollable==="virtual"},this.props.className),ref:m=>{this._element=m},"aria-label":this.props.ariaLabel,onKeyDown:this.onKeyDown,onFocus:this.onFocus,...C.tableKeyboardNavigationScopeAttributes},d,x,n.createElement("div",{className:"k-grid-aria-root",role:"grid","aria-colcount":u.length,"aria-rowcount":t,id:this._gridId},Y,n.createElement("div",{className:"k-grid-container",role:"presentation"},n.createElement("div",{ref:this.containerRef,className:"k-grid-content k-virtual-content",onScroll:this.scrollHandler,role:"presentation"},n.createElement("div",{className:"k-grid-table-wrap",role:"presentation"},n.createElement(C.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:m=>{this.tableElement=m}},n.createElement("table",{className:f.classNames("k-table k-grid-table",{"k-table-md":!this.props.size,[`k-table-${f.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size}),role:"presentation",style:{userSelect:c,display:nt}},it,n.createElement("tbody",{className:"k-table-tbody",ref:this.tableBodyRef,role:"rowgroup",...C.tableKeyboardNavigationBodyAttributes},de))),xe&&et),n.createElement("div",{className:"k-height-container",role:"presentation"},n.createElement("div",{style:this.props.scrollable==="virtual"?{height:this.vs.containerHeight+"px"}:{}})))),rt,ot&&n.createElement(n.Fragment,null,n.createElement(C.DropClue,{ref:this.dragLogic.refDropElementClue}),n.createElement(C.DragClue,{ref:this.dragLogic.refDragElementClue})),this.showLicenseWatermark&&n.createElement(f.WatermarkOverlay,null)),b,this.props.pageable&&st))}selectionChange(t){if(this.props.onSelectionChange){const{event:s,dataItem:o,dataIndex:e,columnIndex:i}=t,{mode:l,cell:a}=C.getSelectionOptions(this.props.selectable),c={...this.getArguments(s.syntheticEvent),dataItem:o,startColIndex:i,endColIndex:i,startRowIndex:e,endRowIndex:e,dataItems:this.getLeafDataItems(),altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,mode:l,cell:a,isDrag:!1,componentId:this._gridId,selectedField:this.props.selectedField||""};this.props.onSelectionChange.call(void 0,c)}}raiseDataEvent(t,s,o,e,i){const l=this.props.onDataStateChange;if(t){const a={...this.getArguments(e),...s,targetEvent:i};t.call(void 0,a)}else l&&l.call(void 0,{...this.getArguments(e),targetEvent:i||{},dataState:{...this.getDataState(),...o}})}columnReorder(t,s,o){const e=this._columns[t],i=e.depth,l=d=>{do d++;while(d<this._columns.length&&this._columns[d].depth>i);return d},a=this._columns.splice(t,l(t)-t);this._columns.splice(t<s?l(s-a.length):s,0,...a),this._columns.filter(d=>d.declarationIndex>=0).forEach((d,g)=>d.orderIndex=g),this._columnsMutations++;const c=this._columns[t].locked&&this._columns[s].locked;C.updateLeft(this._columnsMap,this._columns,c||this._shouldUpdateLeftRight),C.updateRight(this._columnsMap,this._columns,c||this._shouldUpdateLeftRight),this._resized&&(this._shouldUpdateLeftRight=!1,this._resized=!1);const h=this.columns;if(this.forceUpdate(),this.props.onColumnReorder){const d={target:this,columns:h,columnId:e.id,nativeEvent:o};this.props.onColumnReorder.call(void 0,d)}}groupReorder(t,s,o){if(this.props.group===void 0)return;const e=this.props.group.slice();e.splice(s,0,...e.splice(t,1)),this.groupChange(e,o)}columnToGroup(t,s,o){const e=this._columns[t].field;if(!e)return;const i=(this.props.group||[]).slice();i.splice(s,0,{field:e}),this.groupChange(i,o)}resetTableWidth(){let t=0;if(!this.columnResize.colGroupMain)return;const s=this.columnResize.colGroupMain.children;for(let o=0;o<s.length;o++){const e=s[o].width;if(!e)return;t+=parseFloat(e.toString())}t=Math.round(t),this._header&&this._header.setWidth(t),this._footer&&this._footer.setWidth(t),this.tableElement&&(this.tableElement.style.width=t+"px")}initColumns(t,s){const o=C.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);this._columns=this.readColumns(t,o,this._columnsMutations),this._columns.length===0&&(this._columns=ls(this.props.data,this.props.group,this.props.expandField,{prevId:0,idPrefix:o})),this.configureColumns(this._columns,s,o),this._columnsMap=this.mapColumns(this._columns),this.columnResize.columns=this._columns,this.dragLogic.columns=this._columns}getDataState(){return{filter:this.props.filter,sort:this.props.sort,skip:this.props.skip,take:this.props.take!==void 0?this.props.take:this.props.pageSize,group:this.props.group}}getArguments(t){return{nativeEvent:t&&t.nativeEvent,syntheticEvent:t,target:this}}};X.displayName="KendoReactGrid";X.defaultProps={};X.propTypes={data:p.oneOfType([p.array,p.shape({data:p.array,total:p.number})]),sortable:p.oneOfType([p.bool,p.shape({mode:p.oneOf(["single","multiple"]),allowUnsort:p.bool})]),onSortChange:p.func,sort:p.array,filterable:p.bool,filter:p.any,onFilterChange:p.func,pageable:p.oneOfType([p.bool,p.shape({buttonCount:p.number,responsive:p.bool,info:p.bool,type:p.oneOf(["numeric","input"]),pageSizes:p.oneOfType([p.bool,p.arrayOf(p.oneOfType([p.string,p.number]))]),previousNext:p.bool})]),pageSize:p.number,onPageChange:p.func,total:p.number,skip:p.number,take:p.number,fixedScroll:p.bool,onExpandChange:p.func,expandField:p.string,selectedField:p.string,onSelectionChange:p.func,onHeaderSelectionChange:p.func,resizable:p.bool,reorderable:p.bool,group:p.any,groupable:p.oneOfType([p.bool,p.shape({enabled:p.bool,footer:p.oneOf(["always","visible","none"])})]),onGroupChange:p.func,onRowClick:p.func,onRowDoubleClick:p.func,onItemChange:p.func,editField:p.string,scrollable:p.oneOf(["none","scrollable","virtual"]),rowHeight:p.number,detailRowHeight:p.number,detail:p.any,style:p.object,onDataStateChange:p.func,onColumnResize:p.func,onColumnReorder:p.func,dataItemKey:p.string,navigatable:p.bool,size:p.oneOf(["small","medium"])};X.contextType=C.TableKeyboardNavigationContext;class ae extends n.Component{render(){const{children:t}=this.props;return n.createElement("div",{id:this.props.id,className:f.classNames("k-columnmenu-item-wrapper",this.props.className),style:this.props.style},t)}}class $ extends n.Component{render(){const{title:t,iconClass:s,svgIcon:o,selected:e}=this.props;return n.createElement("div",{onClick:this.props.onClick,className:`k-columnmenu-item ${e?"k-selected":""}`},(s||o)&&n.createElement(f.IconWrap,{name:s&&f.toIconName(s),icon:o}),t)}}class je extends n.Component{constructor(){super(...arguments),this.onGroupClick=t=>{if(t.preventDefault(),this.props.onGroupChange){const{column:s}=this.props;if(!s.field)return;const o=(this.props.group||[]).slice(),e=o.findIndex(i=>i.field===s.field);e>-1?o.splice(e,1):o.push({field:s.field}),this.props.onGroupChange(o,t)}this.props.onCloseMenu&&this.props.onCloseMenu()}}render(){const{group:t,column:s}=this.props,o=E.provideLocalizationService(this),e=!!(t&&s.field&&t.find(l=>l.field===s.field)),i=e?St:Et;return n.createElement(ae,null,n.createElement($,{title:o.toLanguageString(i,I[i]),iconClass:e?"k-i-ungroup":"k-i-group",svgIcon:e?w.ungroupIcon:w.groupIcon,onClick:this.onGroupClick}))}}E.registerForIntl(je);E.registerForLocalization(je);const Kt="asc",Vt="desc",Ms={true:{asc:{asc:"",desc:"desc"},desc:{asc:"asc",desc:""},"":{asc:"asc",desc:"desc"}},false:{asc:{asc:"asc",desc:"desc"},desc:{asc:"asc",desc:"desc"},"":{asc:"asc",desc:"desc"}}},qt=(r,t)=>t?t.findIndex(s=>s.field===r):-1,Ut=(r,t)=>!!(t&&r>-1&&t[r].dir===Kt),$t=(r,t)=>!!(t&&r>-1&&t[r].dir===Vt);class Ce extends n.Component{constructor(){super(...arguments),this.onAscClick=t=>{this.onSort(t,Kt),this.props.onCloseMenu&&this.props.onCloseMenu()},this.onDescClick=t=>{this.onSort(t,Vt),this.props.onCloseMenu&&this.props.onCloseMenu()},this.onSort=(t,s)=>{if(t.preventDefault(),!this.props.onSortChange)return;const{column:o,sortable:e,sort:i}=this.props,{allowUnsort:l,mode:a}=Gt(e||!1,!1),c=(i||[]).filter(g=>g.field===o.field)[0],h=Ms[l][c&&c.dir||""][s],d=a==="single"?[]:(this.props.sort||[]).filter(g=>g.field!==o.field);h!==""&&o.field&&d.push({field:o.field,dir:h}),this.props.onSortChange(d,t)}}render(){const{sort:t,column:s}=this.props,o=qt(s.field,t),e=E.provideLocalizationService(this);return n.createElement(ae,null,n.createElement($,{title:e.toLanguageString(Ne,I[Ne]),iconClass:"k-i-sort-asc-sm",svgIcon:w.sortAscSmallIcon,selected:Ut(o,t),onClick:this.onAscClick}),n.createElement($,{title:e.toLanguageString(Fe,I[Fe]),iconClass:"k-i-sort-desc-sm",svgIcon:w.sortDescSmallIcon,selected:$t(o,t),onClick:this.onDescClick}))}}Ce.active=(r,t)=>{const s=qt(r,t);return $t(s,t)||Ut(s,t)};E.registerForIntl(Ce);E.registerForLocalization(Ce);class Xe extends n.Component{render(){return n.createElement("div",{id:this.props.id,className:f.classNames("k-columnmenu-item-content",this.props.className),style:this.props.style},n.createElement(os.Reveal,{style:{position:"relative",display:"block"}},this.props.show?this.props.children:null))}}class Ae extends n.Component{constructor(t){super(t),this.renderOperatorEditor=()=>{if(this.props.filterType==="boolean")return;const s=this.props.operators.find(o=>o.operator===this.props.operator)||null;return n.createElement(ie.DropDownList,{value:s,onChange:this.operatorChange,data:this.props.operators,textField:"text"})},this.inputChange=this.inputChange.bind(this),this.operatorChange=this.operatorChange.bind(this),this.boolDropdownChange=this.boolDropdownChange.bind(this)}render(){return n.createElement(n.Fragment,null,this.renderOperatorEditor(),this.filterComponent(this.props.filterType,this.props.value,this.props.booleanValues))}inputChange(t,s){Ve(t,s,this.props)}operatorChange(t){Ue(t,this.props.value,this.props.onChange)}boolDropdownChange(t){qe(t,this.props.onChange)}filterComponent(t,s,o){switch(t){case"numeric":return n.createElement(z.NumericTextBox,{value:s,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)},rangeOnEnter:!1});case"date":return n.createElement(Be.DatePicker,{value:s,onChange:e=>{this.inputChange(e.value,e.syntheticEvent)}});case"boolean":{const e=i=>i==null;return n.createElement(ie.DropDownList,{onChange:this.boolDropdownChange,value:o.find(i=>i.operator===(e(s)?"":s)),data:o,textField:"text"})}default:return n.createElement(z.Input,{value:s||"",onChange:e=>{this.inputChange(e.target.value,e.syntheticEvent)}})}}}class jt extends n.Component{render(){const{firstFilterProps:t,hideSecondFilter:s,secondFilterProps:o,logicData:e,logicValue:i,onLogicChange:l}=this.props;return n.createElement(n.Fragment,null,n.createElement(Ae,{...t}),!s&&n.createElement(n.Fragment,null,n.createElement(ie.DropDownList,{data:e,value:i,onChange:l,className:"k-filter-and",textField:"text"}),n.createElement(Ae,{...o})))}}const ge=r=>r||{filters:[],logic:"and"},re=(r,t)=>ge(t).filters.filter(e=>ue.isCompositeFilterDescriptor(e)?e.filters&&e.filters.length&&e.filters.length<=2&&!e.filters.find(i=>ue.isCompositeFilterDescriptor(i)||i.field!==r):!1)[0]||null;class Ye extends n.Component{constructor(t){super(t),this.removeGroup=(o,e)=>{const i=[...e.filters],l=i.findIndex(a=>a===o);return l>-1&&i.splice(l,1),{...e,filters:i}},this.insertGroup=(o,e)=>({...e,filters:[o,...e.filters]}),this.isControlled=()=>this.props.expanded!==void 0,this.onFilterExpand=()=>{const o=this.isControlled(),e=!(o?this.props.expanded:this.state.expanded);this.props.onExpandChange&&this.props.onExpandChange(e),o||this.setState({expanded:e})},this.firstFilterChange=o=>{this.filterChange(0,o)},this.secondFilterChange=o=>{this.filterChange(1,o)},this.filterChange=(o,e)=>{const i=this.state.filterGroup.filters.map((l,a)=>a===o?{...l,value:e.value,operator:e.operator}:l);this.setState({filterGroup:{...this.state.filterGroup,filters:i}})},this.logicChange=o=>{this.setState({filterGroup:{...this.state.filterGroup,logic:o.target.value.operator}})},this.clear=o=>{if(o.preventDefault(),!this.props.onFilterChange)return;const e=this.props.column.field,i=ge(this.props.filter),l=re(e,this.props.filter),a=i.filters.filter(c=>c!==l);a.length?this.props.onFilterChange({...i,filters:a},o):this.props.onFilterChange(null,o),this.props.onCloseMenu&&this.props.onCloseMenu()},this.currentFilterGroup=()=>({...this.state.filterGroup,filters:this.state.filterGroup.filters.filter(o=>o.value!==void 0&&o.value!==null&&o.value!==""||o.value===null&&o.operator)}),this.submit=o=>{if(o.preventDefault(),!this.props.onFilterChange)return;const e=this.props.column.field,i=ge(this.props.filter),l=re(e,this.props.filter),a=this.currentFilterGroup();let c=null;if(l&&a.filters.length>0){const h=i.filters.map(d=>d===l?a:d);c={...i,filters:h}}else if(a.filters.length===0){const h=i.filters.filter(d=>d!==l);h.length&&(c={...i,filters:h})}else c={...i,filters:[...i.filters,a]};this.props.onFilterChange(c,o),this.props.onCloseMenu&&this.props.onCloseMenu()};let s;if(t.column&&t.column.field){const o=Pe(t.column.filter),e=Lt(t.filterOperators,o);s=re(t.column.field,t.filter),s=s?{...s,filters:s.filters.map(i=>({...i}))}:{logic:"and",filters:[{field:t.column.field,operator:e,value:H(e)?null:void 0},{field:t.column.field,operator:e,value:H(e)?null:void 0}]},s.filters.filter(i=>i.field===t.column.field).length===1&&s.filters.splice(1,0,{field:t.column.field,operator:e})}this.state={expanded:t.expanded||!1,filterGroup:s}}render(){const{column:t,filterUI:s,hideSecondFilter:o,filterOperators:e}=this.props;if(!t||!t.field)return n.createElement("div",null);const i=Pe(t.filter),l=o!==void 0?o:ks[i],a=E.provideLocalizationService(this),c=this.state.filterGroup.filters,h=se(e[i],a),d=se(Ke,a),g={field:t.field,value:c[0].value,operator:c[0].operator,operators:h,booleanValues:d,onChange:this.firstFilterChange,filterType:i},b={field:t.field,value:c[1].value,operator:c[1].operator,operators:h,booleanValues:d,onChange:this.secondFilterChange,filterType:i},u=this.state.filterGroup.logic,x=se(vs,a),y={value:x.find(M=>M.operator===(u===null?"":u)),onChange:this.logicChange,data:x},v=s,k={firstFilterProps:g,secondFilterProps:b,logicData:y.data,logicValue:y.value,onLogicChange:y.onChange,hideSecondFilter:l},R=this.currentFilterGroup().filters.length!==0||H(c[0].operator)||H(c[1].operator),S=this.isControlled()?this.props.expanded:this.state.expanded,P=this.props.alwaysExpand;return n.createElement(ae,null,!P&&n.createElement($,{title:a.toLanguageString(ne,I[ne]),iconClass:"k-i-filter",svgIcon:w.filterIcon,onClick:this.onFilterExpand}),n.createElement(Xe,{show:P||!!S},n.createElement("form",{className:"k-filter-menu",onSubmit:this.submit,onReset:this.clear,onKeyDown:M=>M.stopPropagation()},n.createElement("div",{className:"k-filter-menu-container"},v?n.createElement(v,{...k}):n.createElement(jt,{...k}),n.createElement("div",{className:"k-actions k-actions-stretched"},n.createElement(B.Button,{themeColor:"primary",disabled:!R},a.toLanguageString(oe,I[oe])),n.createElement(B.Button,{type:"reset"},a.toLanguageString(K,I[K])))))))}}Ye.active=(r,t)=>!!re(r,t);E.registerForLocalization(Ye);const Ls=(r,t)=>r.length!==t.length?!1:r.every((s,o)=>s===t[o]);class Qe extends n.Component{constructor(t){super(t),this.defaultFilter=()=>this.props.filter?f.clone(this.props.filter):{filters:[],logic:"and"},this.isControlled=()=>this.props.expanded!==void 0,this.parseData=(s,o)=>{const e=this.props.column.field||"",i=s.map(l=>L(e,l));return o?i.filter((l,a)=>i.indexOf(l)===a):i},this.getFilterIndex=()=>{const s=this.props.column.field;return this.defaultFilter().filters.findIndex(i=>i.filters&&i.filters.length>0&&i.filters[0].field===s)},this.onFilterExpand=()=>{const s=this.isControlled(),o=!(s?this.props.expanded:this.state.expanded);this.props.onExpandChange&&this.props.onExpandChange(o),s||this.setState({expanded:o})},this.handleSearchChange=s=>{const o=this.props.searchBoxFilterOperator?this.props.searchBoxFilterOperator:"startswith",e={logic:"and",filters:[{field:this.props.column.field,operator:o,value:s.target.value,ignoreCase:!0}]};this.setState({value:s.target.value,data:this.parseData(ue.filterBy(this.props.data||[],e),this.props.uniqueData)})},this.handleClear=()=>{const s=this.props.searchBoxFilterOperator?this.props.searchBoxFilterOperator:"startswith",o={logic:"and",filters:[{field:this.props.column.field,operator:s,value:"",ignoreCase:!0}]};this.setState({value:"",data:this.parseData(ue.filterBy(this.props.data||[],o),this.props.uniqueData)})},this.clear=s=>{if(s.preventDefault(),!this.props.onFilterChange)return;const o=this.state.currentFilter||null;o!==null&&o.filters.length>0?(this.compositeFilterIndex>=0&&o.filters.splice(this.compositeFilterIndex,1),this.props.onFilterChange(o,s)):this.props.onFilterChange(null,s),this.props.onCloseMenu&&this.props.onCloseMenu()},this.submit=s=>{if(s.preventDefault(),!this.props.onFilterChange)return;const o=this.state.currentFilter||null;this.props.onFilterChange(o,s),this.props.onCloseMenu&&this.props.onCloseMenu()},this.handleCheckBoxChange=(s,o)=>{const e=this.props.column.field||"",i={...this.state.currentFilter},l=[...this.state.currentFilter.filters];let a=[];if(this.compositeFilterIndex!==-1&&i.filters[this.compositeFilterIndex].filters&&o!=="all"&&(a=i.filters[this.compositeFilterIndex].filters),s.value&&o==="all")this.state.data.forEach(c=>{a.push({field:e,operator:"eq",value:c})});else if(s.value)a.push({field:e,operator:"eq",value:o});else if(this.state.currentFilter){const c=a.findIndex(h=>h.value===o);a.splice(c,1)}i.logic="and",this.compositeFilterIndex!==-1?l[this.compositeFilterIndex]={logic:"or",filters:a}:l.push({logic:"or",filters:a}),(!s.value&&o==="all"||a.length===0)&&l.splice(this.compositeFilterIndex,1),i.filters=l,this.setState({currentFilter:i})},this.isAllSelected=()=>{let s=!1;if(this.state.currentFilter){const o=[...this.state.currentFilter.filters];return this.compositeFilterIndex===-1?!1:(s=this.state.data.every(e=>this.compositeFilterIndex!==-1&&o[this.compositeFilterIndex].filters?o[this.compositeFilterIndex].filters.findIndex(l=>l.value===e)>=0:!1),s)}return s},this.compositeFilterIndex=this.getFilterIndex(),this.state={expanded:t.expanded||!1,value:"",data:this.parseData(this.props.data,this.props.uniqueData)||[],dataFromProps:this.parseData(this.props.data,!1)||[],currentFilter:this.defaultFilter()}}componentDidUpdate(){const t=this.props.column.field||"",s=this.props.data.map(o=>L(t,o));Ls(s,this.state.dataFromProps)||this.setState({data:s,dataFromProps:s})}render(){const{column:t}=this.props;if(!t||!t.field)return n.createElement("div",null);const s=E.provideLocalizationService(this),o=this.isControlled()?this.props.expanded:this.state.expanded,e=[];if(this.state.currentFilter){const a=[...this.state.currentFilter.filters];this.compositeFilterIndex=a.findIndex(c=>c.filters&&c.filters.length>0?c.filters[0].field===t.field:!1),this.compositeFilterIndex!==-1&&a[this.compositeFilterIndex].filters.length>0&&a[this.compositeFilterIndex].filters.forEach(c=>{c.field===this.props.column.field&&e.push(c.value)})}const i=this.props.searchBox?n.createElement(this.props.searchBox,{value:this.state.value,onChange:this.handleSearchChange}):n.createElement("div",{className:"k-searchbox k-textbox k-input k-input-md k-input-solid"},n.createElement(f.IconWrap,{className:"k-input-icon",name:"search",icon:w.searchIcon}),n.createElement(z.Input,{className:"k-input-inner",type:"text",placeholder:s.toLanguageString(De,I[De]),value:this.state.value,onChange:a=>this.handleSearchChange(a.nativeEvent)}),n.createElement(B.Button,{type:"button",rounded:null,className:"k-input-button",onClick:this.handleClear,icon:"x",svgIcon:w.xIcon})),l=e.filter((a,c)=>e.indexOf(a)===c);return n.createElement(ae,null,n.createElement($,{title:s.toLanguageString(ne,I[ne]),iconClass:"k-i-filter",svgIcon:w.filterIcon,onClick:this.onFilterExpand}),n.createElement(Xe,{show:!!o},n.createElement("form",{className:"k-filter-menu",onSubmit:this.submit,onReset:this.clear},n.createElement("div",{className:"k-filter-menu-container"},i,n.createElement("ul",{className:"k-reset k-multicheck-wrap"},n.createElement("li",{className:"k-item k-check-all-wrap"},n.createElement(z.Checkbox,{label:s.toLanguageString(Te,I[Te]),onChange:a=>this.handleCheckBoxChange(a,"all"),checked:this.isAllSelected()})),this.state.data.map((a,c)=>n.createElement("li",{className:"k-item",key:c},n.createElement(z.Checkbox,{label:String(a),onChange:h=>this.handleCheckBoxChange(h,a),checked:l.includes(a)})))),n.createElement("div",{className:"k-filter-selected-items"},l.length+" "+s.toLanguageString(ze,I[ze])),n.createElement("div",{className:"k-actions k-hstack k-justify-content-stretch"},n.createElement(B.Button,{themeColor:"primary",type:"submit"},s.toLanguageString(oe,I[oe])),n.createElement(B.Button,{className:"k-button",type:"reset"},s.toLanguageString(K,I[K])))))))}}Qe.defaultProps={uniqueData:!0};E.registerForLocalization(Qe);const Xt=r=>{const[t,s]=n.useState(""),o=n.useMemo(()=>new Set(r.columnsState.map(u=>u.id)),[r.columnsState]),e=n.useMemo(()=>r.columns.filter(u=>{var x;return(x=u.title||u.field)==null?void 0:x.toLowerCase().includes(t.toLowerCase())}),[r.columns,t]),[i,l]=n.useState(r.columns.map(u=>o.has(u.id))),a=n.useCallback(()=>{const u=r.columns.filter((x,y)=>i[y]);r.onColumnsChange.call(void 0,u),r.onCloseMenu.call(void 0)},[i,r.columns,r.onColumnsChange,r.onCloseMenu]),c=n.useCallback(()=>{l(r.columns.map(u=>o.has(u.id)))},[o,r.columns]),h=i.filter(u=>u).length,d=h===i.length,g=n.useCallback(()=>{l(r.columns.map((u,x)=>d&&x===0?!0:!d))},[r.columns,d]),b=n.useCallback((u,x)=>{const y=i.slice();y[x]=u,l(y)},[i]);return n.createElement("form",{className:"k-filter-menu"},n.createElement("div",{className:"k-filter-menu-container"},n.createElement(z.TextBox,{className:"k-searchbox",value:t,onChange:u=>s(String(u.target.value)),prefix:()=>n.createElement(z.InputPrefix,null,n.createElement(f.IconWrap,{name:"search",icon:w.searchIcon}))}),n.createElement("ul",{className:"k-reset k-multicheck-wrap"},!t&&n.createElement("li",{className:"k-item k-check-all-wrap"},n.createElement(z.Checkbox,{checked:d,onChange:g,label:"(Select all)"})),e.map((u,x)=>n.createElement("li",{key:u.id,className:"k-item"},n.createElement(z.Checkbox,{disabled:i[x]&&h===1,checked:i[x],onChange:y=>{var v;return b(!!((v=y.target.element)!=null&&v.checked),x)},label:u.title||u.field})))),n.createElement("div",{className:"k-filter-selected-items"},h," selected items"),n.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal"},n.createElement(B.Button,{type:"button",themeColor:"primary",onClick:a},"Apply"),n.createElement(B.Button,{type:"button",onClick:c},"Reset"))))};Xt.displayName="GridColumnMenuColumnsList";class Os extends n.Component{render(){return null}}class Yt extends n.Component{render(){return n.createElement("div",{className:f.classNames("k-toolbar k-grid-toolbar",{"k-toolbar-md":!this.props.size,[`k-toolbar-${f.kendoThemeMaps.sizeMap[this.props.size]||this.props.size}`]:this.props.size},this.props.className),"aria-label":this.props.ariaLabel,"aria-controls":this.props.ariaControls,role:"toolbar"},this.props.children)}}Yt.displayName="KendoReactGridToolbar";const Qt=r=>{const{data:t=[]}=r;return n.createElement("div",{className:"k-selection-aggregates k-grid-selection-aggregates"},t.map((s,o)=>n.createElement("div",{key:o},n.createElement("span",{className:"k-selection-aggregates-item-text"},s.type,": "),n.createElement("span",{className:"k-selection-aggregates-item-value"},s.formattedValue))))};Qt.displayName="KendoReactGridStatusBar";const Jt=r=>{var s;const t=r.slice();for(let o=0;o<t.length;o++)for(;t[o]&&((s=t[o].children)!=null&&s.length);)t.splice(o,1,...t[o].children);return t},Hs=r=>{const{dataItems:t,target:s,selectedField:o}=r,i=Jt(s.columns).map(v=>v.field).filter(v=>v&&typeof v=="string").map(v=>f.getter(v)),l=f.getter(o),a={dates:[],numbers:[],booleans:[],others:[]},c=v=>{typeof v=="number"?a.numbers.push(v):typeof v=="boolean"?a.booleans.push(v):v instanceof Date?a.dates.push(v):a.others.push(v)};t.forEach(v=>{const k=l(v);k&&k.forEach(R=>{c(i[R](v))})});const h=a.dates.map(v=>v.getTime()),d=a.booleans.filter(v=>v).length,g=a.booleans.filter(v=>!v).length,b=a.numbers.length?a.numbers.reduce((v,k)=>v+=k,0):void 0,u={sum:b,average:typeof b=="number"?b/a.numbers.length:void 0,min:a.numbers.length?Math.min(...a.numbers):void 0,max:a.numbers.length?Math.max(...a.numbers):void 0,count:a.numbers.length+a.booleans.length+a.dates.length+a.others.length,isTrue:d>0?d:void 0,isFalse:g>0?g:void 0,earliest:a.dates.length?new Date(Math.min(...h)):void 0,latest:a.dates.length?new Date(Math.max(...h)):void 0},x=(v,k)=>(k==="sum"||k==="average")&&typeof v=="number"?v.toFixed(2):(k==="earliest"||k==="latest")&&v instanceof Date?v.toLocaleDateString():String(v),y=[];return Object.keys(u).forEach(v=>{const k=v,R=u[k];R!==void 0&&y.push({type:k,value:R,formattedValue:x(R,k)})}),y},Zt=f.withIdHOC(X);Zt.displayName="KendoReactGrid";Object.defineProperty(exports,"getSelectedState",{enumerable:!0,get:()=>C.getSelectedState});Object.defineProperty(exports,"getSelectedStateFromKeyDown",{enumerable:!0,get:()=>C.getSelectedStateFromKeyDown});Object.defineProperty(exports,"setSelectedState",{enumerable:!0,get:()=>C.setSelectedState});exports.GRID_COL_INDEX_ATTRIBUTE=U;exports.GRID_ROW_INDEX_ATTRIBUTE=Dt;exports.Grid=Zt;exports.GridCell=At;exports.GridClassComponent=X;exports.GridColumn=j;exports.GridColumnMenuCheckboxFilter=Qe;exports.GridColumnMenuColumnsList=Xt;exports.GridColumnMenuFilter=Ye;exports.GridColumnMenuFilterCell=Ae;exports.GridColumnMenuFilterUI=jt;exports.GridColumnMenuGroup=je;exports.GridColumnMenuItem=$;exports.GridColumnMenuItemContent=Xe;exports.GridColumnMenuItemGroup=ae;exports.GridColumnMenuSort=Ce;exports.GridColumnMenuWrapper=We;exports.GridCommonDragLogic=_t;exports.GridDetailRow=Os;exports.GridEditCell=Tt;exports.GridFilterCell=$e;exports.GridGroupCell=_e;exports.GridHeaderCell=zt;exports.GridHierarchyCell=Ft;exports.GridNoRecords=me;exports.GridRow=Bt;exports.GridSelectionCell=Nt;exports.GridToolbar=Yt;exports.StatusBar=Qt;exports.booleanFilterValues=Ke;exports.cellBoolDropdownChange=qe;exports.cellInputChange=Ve;exports.cellOperatorChange=Ue;exports.filterGroupByField=re;exports.getStatusData=Hs;exports.gridMessages=I;exports.leafColumns=Jt;exports.operators=He;exports.pagerFirstPage=Ct;exports.pagerInfo=mt;exports.pagerItemPerPage=kt;exports.pagerLastPage=xt;exports.pagerNextPage=vt;exports.pagerPreviousPage=bt;exports.rootFilterOrDefault=ge;
|