@progress/kendo-react-pivotgrid 13.3.0 → 13.4.0-develop.1
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/PivotGrid.d.ts +303 -0
- package/components/AxesEditor.d.ts +57 -0
- package/components/AxisEditor.d.ts +65 -0
- package/components/AxisEditor.mjs +3 -3
- package/components/AxisFilterFieldsEditor.d.ts +145 -0
- package/components/Cell.d.ts +114 -0
- package/components/Column.d.ts +91 -0
- package/components/Configurator.d.ts +140 -0
- package/components/ConfiguratorButton.d.ts +89 -0
- package/components/ConfiguratorButton.mjs +4 -4
- package/components/ConfiguratorEditor.d.ts +144 -0
- package/components/ConfiguratorEditor.js +1 -1
- package/components/ConfiguratorEditor.mjs +1 -2
- package/components/Container.d.ts +64 -0
- package/components/EditorContext.d.ts +14 -0
- package/components/FieldsEditor.d.ts +87 -0
- package/components/FieldsEditor.mjs +3 -3
- package/components/HeaderCell.d.ts +144 -0
- package/components/HeaderCell.mjs +4 -4
- package/components/Row.d.ts +99 -0
- package/dist/cdn/js/kendo-react-pivotgrid.js +1 -1
- package/hooks/index.d.ts +9 -0
- package/hooks/useExpansion.d.ts +26 -0
- package/hooks/useHeaders.d.ts +18 -0
- package/hooks/useHorizontalScrollSync.d.ts +12 -0
- package/hooks/usePivotConfiguratorEditor.d.ts +90 -0
- package/hooks/usePivotLocalDataService.d.ts +86 -0
- package/hooks/usePivotOLAPService.d.ts +84 -0
- package/hooks/useVerticalScrollSync.d.ts +12 -0
- package/index.d.mts +18 -1827
- package/index.d.ts +18 -1827
- package/messages/index.d.ts +77 -0
- package/models/index.d.ts +96 -0
- package/package-metadata.d.ts +12 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +10 -16
- package/package.json +10 -10
- package/shared/PivotGridConfiguratorEditorEventsContext.d.ts +20 -0
- package/shared/PivotGridConfiguratorEditorStateContext.d.ts +13 -0
- package/shared/index.d.ts +9 -0
- package/utils/index.d.ts +54 -0
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
13
|
*-------------------------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-react-common"),require("@progress/kendo-react-intl"),require("@progress/kendo-pivotgrid-common"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-form"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-data-tools"),require("@progress/kendo-react-treeview"),require("@progress/kendo-react-indicators")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-react-common","@progress/kendo-react-intl","@progress/kendo-pivotgrid-common","@progress/kendo-svg-icons","@progress/kendo-react-buttons","@progress/kendo-react-form","@progress/kendo-react-labels","@progress/kendo-react-data-tools","@progress/kendo-react-treeview","@progress/kendo-react-indicators"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactPivotgrid={},e.React,e.KendoReactCommon,e.KendoReactIntl,e.KendoPivotgridCommon,e.KendoSvgIcons,e.KendoReactButtons,e.KendoReactForm,e.KendoReactLabels,e.KendoReactDataTools,e.KendoReactTreeview,e.KendoReactIndicators)}(this,(function(e,t,r,n,a,o,l,s,i,c,u,d){"use strict";function m(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var p=m(t);const g=Object.freeze({name:"@progress/kendo-react-pivotgrid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"13.3.0",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"}),v="pivotgrid.emptyCellAriaLabel",f="pivotgrid.fieldMenuReset",h="pivotgrid.fieldMenuApply",x="pivotgrid.configuratorTitle",E="pivotgrid.configuratorCancel",y="pivotgrid.configuratorApply",A="pivotgrid.configuratorColumnsTitle",C="pivotgrid.configuratorRowsTitle",w="pivotgrid.configuratorMeasuresTitle",b="pivotgrid.configuratorEditorSearchTitle",I="pivotgrid.configuratorMissingFields",N="pivotgrid.configuratorButtonLabel",k={[v]:"PivotGrid component. Use the arrow keys to navigate.",[f]:"Reset",[h]:"Apply",[E]:"Cancel",[y]:"Apply",[x]:"Settings",[b]:"Fields","pivotgrid.configuratorEditorSearchPlaceholder":"Search...",[A]:"Columns",[C]:"Rows",[w]:"Values",[N]:"Change settings",[I]:"Select some fields to begin setup"},R=p.forwardRef(((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(n,(()=>({element:a.current,props:e}))),p.useImperativeHandle(t,(()=>n.current));const o=r.useMouse(e,n);return p.createElement("tr",{ref:a,...o,id:e.id,style:e.style,tabIndex:e.tabIndex,children:e.children,role:e.role,"aria-owns":e.ariaOwns,className:r.classNames("k-pivotgrid-row",e.className)})}));R.displayName="KendoReactPivotGridRow";const F=p.forwardRef(((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(n,(()=>({element:a.current,props:e}))),p.useImperativeHandle(t,(()=>n.current));const o=r.useMouse(e,n);return p.createElement("td",{ref:a,...o,id:e.id,style:e.style,tabIndex:e.tabIndex,role:e.role,"aria-describedby":e.ariaDescribedby,className:r.classNames("k-pivotgrid-cell",{"k-pivotgrid-header-total":e.total},e.className)},e.children)}));F.displayName="KendoReactPivotGridCell";const S=(e,t,r)=>[e,(n,o)=>{const l=a.headersReducer(e,{...n,tree:t});r&&r(l,o)}],P=p.forwardRef(((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(n,(()=>({element:a.current,props:e}))),p.useImperativeHandle(t,(()=>n.current));const[l,s]=r.useCustomComponent(e.icon||T.icon),i=r.useMouse(e,n);return p.createElement("th",{ref:a,...i,colSpan:e.colSpan,rowSpan:e.rowSpan,id:e.id,style:e.style,tabIndex:e.tabIndex,role:e.role,...e.expandable?{"aria-expanded":e.expanded}:{},className:r.classNames("k-pivotgrid-cell",{"k-pivotgrid-header-total":e.total,"k-pivotgrid-header-root":e.root,"k-pivotgrid-expanded":e.expanded,"k-first":e.first},e.className)},e.expandable&&p.createElement(l,{...s,className:"k-pivotgrid-toggle",onClick:t=>{e.onIconClick&&e.onIconClick.call(void 0,{syntheticEvent:t.syntheticEvent,target:n.current})},name:"chevron-"+(e.expanded?"up":"down"),"aria-hidden":!0,icon:e.expanded?o.chevronUpIcon:o.chevronDownIcon}),e.children)})),T={icon:r.IconWrap};P.displayName="KendoReactPivotGridHeaderCell";const L=p.forwardRef(((e,t)=>{const n=p.useRef(null),a=p.useRef(null),{id:o,style:l,tabIndex:s,children:i,className:c,path:u=D.path}=e;p.useImperativeHandle(n,(()=>({element:a.current,props:{path:u,...e}}))),p.useImperativeHandle(t,(()=>n.current));const d=r.useMouse(e,n);return p.createElement("col",{ref:a,...d,id:o,style:l,tabIndex:s,children:i,className:c})})),D={path:[]};L.displayName="KendoReactPivotGridColumn";const M=(e=[],t={},r=null)=>e.map((e=>{const n={dataItem:e};return Object.keys(t).forEach((e=>{n[e]=t[e](n,r)})),n})),O=(e=[])=>{let t=[...e];return(e||[]).forEach((e=>{t=t.concat(O(e.children))})),t},q=(e=[])=>{const t=new Set;return e.forEach((e=>{t.add(String(e.name))})),Array.from(t)},H=(e=[])=>`${e.join(",")}`,G=(e,t,r)=>{if(!e)return[];let n=0;const a=[],o=e.length;let l;for(;n<o;n++)l=e[n].operator,(!r&&"in"!==l||l===r)&&e[n].field===t&&a.push(e[n]);return a},K=(e,t)=>e.uniqueName===t.uniqueName,z=p.forwardRef(((e,t)=>{const o=!r.validatePackage(g,{component:"PivotGrid"}),l=r.getLicenseMessage(g),{rows:s,rowAxes:i,columns:c,columnAxes:u,data:d}={...U,...e},m=p.useRef(null),f=p.useRef(null),h=p.useRef(null),x=p.useRef(null),E=p.useRef(null),y=p.useRef(null),A=p.useRef(null),C=n.useLocalization(),w=a.toTree((s||[]).slice()),[,b]=S((i||[]).slice(),w,((t,r)=>{e.onRowAxesChange&&e.onRowAxesChange({value:t,target:f.current,syntheticEvent:r})})),[I,N,R,F]=a.toRows(w),P=a.toTree((c||[]).slice()),[,T]=S((u||[]).slice(),P,((t,r)=>{e.onColumnAxesChange&&e.onColumnAxesChange({value:t,target:f.current,syntheticEvent:r})})),[L,D,,M]=a.toColumns(P),O=a.toData((d||[]).slice(),D,N,M,R);p.useImperativeHandle(f,(()=>({props:e,element:m.current,columnHeaderRows:L,rowHeaderRows:I,dataCells:O,rowHeaderBreadth:F,columnHeaderBreadth:M}))),p.useImperativeHandle(t,(()=>f.current));const q=[],G=[],K=[],[z,j]=r.useCustomComponent(e.row||U.row),[B,V]=r.useCustomComponent(e.column||U.column),[X,Z]=r.useCustomComponent(e.cell||U.cell),[_,$]=r.useCustomComponent(e.headerCell||U.headerCell),J=e.columnHeadersRow||z,W=e.columnHeadersColumn||B,Y=e.columnHeadersCell||_,Q=e.rowHeadersRow||z,ee=e.rowHeadersColumn||B,te=e.rowHeadersCell||_,re=e.dataRow||z,ne=e.dataColumn||B;for(let e=0;e<D.length;e++)q.push(p.createElement(ne,{key:String(D[e].path),...V,path:D[e].path})),K.push(p.createElement(W,{key:String(D[e].path),...V,path:D[e].path}));for(let e=0;e<F;e++)G.push(p.createElement(ee,{key:e,...V}));const ae=e=>{e.target.props.expandable&&T({type:a.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},oe=e=>{e.target.props.expandable&&b({type:a.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},le=((...e)=>{const t=p.useRef(void 0);return r=>{void 0!==t.current&&window.cancelAnimationFrame(t.current);const n=r.currentTarget,a=n.scrollLeft;e.forEach((e=>{const r=e.current;r&&r!==n&&(t.current=window.requestAnimationFrame((()=>{r.scrollLeft=Math.round(a)})))}))}})(A,y),se=((...e)=>{const t=p.useRef(void 0);return r=>{void 0!==t.current&&window.cancelAnimationFrame(t.current);const n=r.currentTarget,a=n.scrollTop;e.forEach((e=>{const r=e.current;r&&r!==n&&(t.current=window.requestAnimationFrame((()=>{r.scrollTop=Math.round(a)})))}))}})(A,E),ie=p.useCallback((()=>{m.current&&x.current&&(m.current.style.gridTemplateRows="",m.current.style.gridTemplateRows=`${x.current.offsetHeight}px 1fr`)}),[]),ce=p.useCallback((()=>{m.current&&h.current&&(m.current.style.gridTemplateColumns="",m.current.style.gridTemplateColumns=`${h.current.offsetWidth}px 1fr`)}),[]),ue=p.useRef(new a.PivotGridNavigation({tabIndex:e.tabIndex||0}));p.useEffect((()=>{if(m.current){const t=e.tabIndex||0;if(ue.current.stop(),ue.current.tabIndex=t,e.navigatable){ue.current.start(m.current);const e=ue.current.first;e&&e.setAttribute("tabindex",String(t))}}return()=>{ue.current.stop()}}),[e.tabIndex,e.navigatable]),p.useEffect((()=>{ue.current.update()})),p.useEffect((()=>{if(x.current){const e=new window.ResizeObserver((()=>{window.requestAnimationFrame((()=>{ie()}))}));return e.observe(x.current),()=>{e.disconnect()}}}),[ie]),p.useEffect((()=>{if(h.current){const e=new window.ResizeObserver((()=>{window.requestAnimationFrame((()=>{ce()}))}));return e.observe(h.current),()=>{e.disconnect()}}}),[ce]),r.useIsomorphicLayoutEffect((()=>{if(r.setScrollbarWidth(),h.current){const e=new window.ResizeObserver((()=>window.requestAnimationFrame((()=>{r.setScrollbarWidth()}))));return e.observe(h.current),()=>{e.disconnect()}}}),[]);const de=new Array(L.length).fill([]).map((()=>new Array(D.length)));L.forEach(((e,t)=>{let r=0;Array.from(e.cells).forEach((e=>{const n=!!(e&&e.children&&e.children.length),a=(e?H(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(n?"|[EXPANDED]":""):"").replace(/\s/g,"-");if(e)for(let n=0;n<(e.colSpan||1);n++){for(let n=0;n<(e.rowSpan||1);n++){const e=de[t+n].findIndex(((e,t)=>t>=r&&!e));de[t+n][e]=a}r++}}))}));const me=O.map((e=>e.cells.map((e=>((e,t)=>`${H(e.map((e=>e.name)))}|${H(t.map((e=>e.name)))}`)(e.rowTuple.members,e.columnTuple.members).replace(/\s/g,"-")))));return p.createElement("div",{ref:m,id:e.id,style:e.style,tabIndex:e.navigatable?void 0:e.tabIndex,className:r.classNames("k-pivotgrid",e.className),role:"grid"},o&&p.createElement(r.WatermarkOverlay,{message:l}),p.createElement("span",{className:"k-pivotgrid-empty-cell"},p.createElement("span",{className:"k-sr-only"},C.toLanguageString(v,k[v]))),p.createElement("div",{ref:y,className:"k-pivotgrid-column-headers",onScroll:le},p.createElement("table",{ref:x,className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,K),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},L.map(((e,t)=>{let r=!1;return p.createElement(J,{key:e.name,role:"row",...j},e.cells.map(((e,n)=>{const a=0!==n&&!r;e&&(r=!0);const o=e&&!(!e.children||!e.children.length),l=e&&e.hasChildren&&(!e.total||e.total&&e.parent.total);return e?p.createElement(Y,{...$,key:de[t][n],"data-key":de[t][n],id:de[t][n],columnPath:e.normalizedPath,rowSpan:e.rowSpan||void 0,colSpan:e.colSpan||void 0,onIconClick:ae,dataItem:e,expanded:o,expandable:l,total:e.total,first:a,root:0===e.levelNum,role:"columnheader"},e.caption):null})))}))))),p.createElement("div",{ref:E,className:"k-pivotgrid-row-headers"},p.createElement("table",{ref:h,className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,G),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},I.map(((e,t)=>p.createElement(Q,{key:H(N[t].path),...j,path:N[t].path,role:"row",ariaOwns:me[t].join(" ")},e.cells.filter(Boolean).map((e=>e?p.createElement(te,{...$,key:H(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(e.children&&e.children.length?"|[EXPANDED]":""),"data-key":H(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(e.children&&e.children.length?"|[EXPANDED]":""),rowPath:e.normalizedPath,rowSpan:e.rowSpan||void 0,colSpan:e.colSpan||void 0,dataItem:e,expanded:!(!e.children||!e.children.length),expandable:e.hasChildren&&!e.total,total:e.total,onIconClick:oe,root:0===e.levelNum,role:"rowheader"},e.caption):null)))))))),p.createElement("div",{ref:A,className:"k-pivotgrid-values",onScroll:e=>{le(e),se(e)}},p.createElement("table",{className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,q),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"none"},O.map(((e,t)=>p.createElement(re,{key:H(N[t].path),...j,path:N[t].path,role:"none"},e.cells.map(((e,r)=>p.createElement(X,{key:me[t][r],"data-key":me[t][r],id:me[t][r],...Z,rowPath:e.rowTuple.members.map((e=>e.name)),columnPath:e.columnTuple.members.map((e=>e.name)),dataItem:e,total:N[t].total||D[r].total,role:"gridcell",ariaDescribedby:de.map((e=>e[r])).join(" ")},e&&e.data&&e.data.fmtValue?e.data.fmtValue:" "))))))))))})),U={rowAxes:[],columnAxes:[],data:[],row:R,column:L,cell:F,headerCell:P};z.displayName="KendoReactPivotGrid";const j=p.forwardRef(((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(a,(()=>({props:e,element:n.current}))),p.useImperativeHandle(t,(()=>a.current));const{id:o,style:l,tabIndex:s,configuratorPosition:i,className:c,children:u}={...B,...e};return p.createElement("div",{ref:n,id:o,style:l,tabIndex:s,className:r.classNames("k-d-flex k-pos-relative",{"k-flex-row":"right"===i,"k-flex-row-reverse":"left"===i,"k-flex-column":"bottom"===i,"k-flex-column-reverse":"top"===i},c)},u)})),B={configuratorPosition:"right"};j.displayName="KendoReactPivotGridContainer";const V=p.createContext({axes:null}),X=p.createContext({}),Z=p.createContext([{expanded:[],rowAxes:[],columnAxes:[],measureAxes:[],dragItem:null,dropZone:null,dropDirection:null,dropTarget:null},r.noop]);var _=(e=>(e.toggle="EXPAND_TOGGLE",e.expand="EXPAND_EXPAND",e.collapse="EXPAND_COLLAPSE",e))(_||{});const $=(e=[],t,r,n=((e,t)=>e===t))=>{const[a,o]=p.useState(e);return[a,(e,t)=>{const r=((e,t,r)=>{switch(t.type){case"EXPAND_TOGGLE":return Array.isArray(e)?e.find((e=>r(e,t.payload)))?[...e.filter((e=>!r(e,t.payload)))]:[...e,t.payload]:r(e,t.payload)?null:t.payload;case"EXPAND_EXPAND":if(Array.isArray(e)){if(!e.find((e=>r(e,t.payload))))return[...e,t.payload]}else if(!r(e,t.payload))return t.payload;break;case"EXPAND_COLLAPSE":if(Array.isArray(e)){if(e.find((e=>r(e,t.payload))))return[...e.filter((e=>!r(e,t.payload)))]}else r(e,t.payload);break;default:return e}})(a,e,n);o(r)}]};var J=(e=>(e.toggleExpansion="PIVOT_CONFIGURATOR_ACTION_TOGGLE_EXPANSION",e))(J||{});const W={...a.PIVOT_CONFIGURATOR_ACTION,...J},Y=(e,t)=>{const r=e.valueGetter("rowAxes"),n=e.valueGetter("columnAxes"),o=e.valueGetter("measureAxes"),l=e.valueGetter("sort"),s=e.valueGetter("filter"),[i,c]=$([],0,0,K),[u,d]=p.useState(null),[m,g]=p.useState(null),[v,f]=p.useState(null),[h,x]=p.useState(null);return[{dragItem:u,dropTarget:v,dropZone:m,dropDirection:h,columnAxes:n,rowAxes:r,measureAxes:o,sort:l,filter:s,expanded:i},(t,i)=>{if(t.type===W.toggleExpansion)c({type:_.toggle,payload:t.payload},i);else{const i=a.configuratorReducer({filter:t.override&&void 0!==t.override.filter?t.override.filter:s,sort:t.override&&void 0!==t.override.sort?t.override.sort:l,rowAxes:t.override&&void 0!==t.override.rowAxes?t.override.rowAxes:r,columnAxes:t.override&&void 0!==t.override.columnAxes?t.override.columnAxes:n,measureAxes:t.override&&void 0!==t.override.measureAxes?t.override.measureAxes:o,dragItem:t.override&&void 0!==t.override.dragItem?t.override.dragItem:u,dropDirection:t.override&&void 0!==t.override.dropDirection?t.override.dropDirection:h,dropTarget:t.override&&void 0!==t.override.dropTarget?t.override.dropTarget:v,dropZone:t.override&&void 0!==t.override.dropZone?t.override.dropZone:m},t);void 0!==i.columnAxes&&e.onChange("columnAxes",{value:i.columnAxes}),void 0!==i.rowAxes&&e.onChange("rowAxes",{value:i.rowAxes}),void 0!==i.measureAxes&&e.onChange("measureAxes",{value:i.measureAxes}),void 0!==i.sort&&e.onChange("sort",{value:i.sort}),void 0!==i.filter&&e.onChange("filter",{value:i.filter}),void 0!==i.dropDirection&&x(i.dropDirection),void 0!==i.dropTarget&&f(i.dropTarget),void 0!==i.dropZone&&g(i.dropZone),void 0!==i.dragItem&&d(i.dragItem)}}]},Q=p.forwardRef(((e,t)=>{const{data:a,dataItem:l,defaultFilter:s}={...ee,...e},i=p.useRef(null),c=p.useRef(null),u=n.useLocalization(),[d,m]=r.useCustomComponent(e.columnMenuItem||ee.columnMenuItem),[g,v]=r.useCustomComponent(e.columnMenuForm||ee.columnMenuForm),[x,E]=r.useCustomComponent(e.resetButton||ee.resetButton),[y,A]=r.useCustomComponent(e.applyButton||ee.applyButton),[C,w]=r.useCustomComponent(e.treeView||ee.treeView),[b,I]=r.useCustomComponent(e.noData||ee.noData);p.useImperativeHandle(c,(()=>({props:e,element:i.current}))),p.useImperativeHandle(t,(()=>c.current));const[N,R]=p.useState(!1),{onAxisFilterFieldsExpandChange:F,onAxisFilterFieldExpand:S}=p.useContext(X),[,P]=p.useContext(Z),[T,L]=p.useState(s),D=T?T.value.split(","):[],[q,H]=$([],0,0,K),G={caption:e=>e.dataItem.caption,id:e=>e.dataItem.uniqueName,parent:(e,t)=>t&&t.value,value:e=>e.dataItem.defaultHierarchy||e.dataItem.uniqueName,expanded:e=>q.some((t=>t.uniqueName===e.id)),checked:e=>!D.length||(D||[]).some((t=>t===e.dataItem.uniqueName)),hasChildren:e=>parseInt(e.dataItem.childrenCardinality,10)>0,children:e=>M(e.dataItem.children,G,e),checkIndeterminate:e=>{const t=(e.children||[]).length&&e.children.every((e=>e.checked));return t&&(e.checked=!0),(e.children||[]).some((e=>e.checked))&&!t}},z=M(a,G),U=O(z);return p.createElement("div",{ref:i,id:e.id,tabIndex:e.tabIndex,style:e.style,className:r.classNames("k-columnmenu-item-wrapper",e.className)},p.createElement(d,{...m,title:"Include Fields",iconClass:"k-i-grid-layout",svgIcon:o.gridLayoutIcon,onClick:e=>{R(!N),F&&F({value:!N,target:c.current,syntheticEvent:e})}}),p.createElement(g,{show:N,actions:p.createElement(p.Fragment,null,p.createElement(x,{type:"reset",onClick:e=>{R(!1),T&&P({type:W.removeFilter,payload:T},e)},...E},u.toLanguageString(f,k[f])),p.createElement(y,{themeColor:"primary",onClick:e=>{R(!1),T&&P({type:s?W.changeFilter:W.addFilter,payload:T},e)},...A},u.toLanguageString(h,k[h]))),...v},z&&z.length?p.createElement(C,{data:z,checkboxes:!0,onExpandChange:e=>{H({type:_.toggle,payload:e.item.dataItem},e.syntheticEvent),S&&S({value:e.item.dataItem,target:c.current,syntheticEvent:e.syntheticEvent})},onCheckChange:e=>{let t;t=e.item.checked?{field:String(l.name),operator:"in",value:U.filter((e=>e.checked)).map((e=>String(e.value))).filter((t=>t!==e.item.value&&t!==e.item.parent)).join(",")}:{field:String(l.name),operator:"in",value:U.filter((e=>e.checked)).map((e=>String(e.value))).concat([e.item.value]).join(",")},L(t)},textField:"caption",expandIcons:!0,hasChildrenField:"hasChildren",checkIndeterminateField:"checkIndeterminate",childrenField:"children",...w}):p.createElement(b,{...I})))})),ee={data:[],resetButton:l.Button,applyButton:l.Button,treeView:u.TreeView,noData:()=>p.createElement(d.Skeleton,{shape:"rectangle",style:{height:"20px",width:"calc(100% - 16px)",margin:8}}),columnMenuItem:c.ColumnMenuItem,columnMenuForm:c.ColumnMenuForm};Q.displayName="KendoReactPivotGridAxisFilterFieldsEditor";const te=p.forwardRef(((e,t)=>{const n=p.useRef(0),o=p.useRef(0),l=p.useRef(null),s=p.useRef(null),i=p.useRef(null),{axes:u}=p.useContext(V),[d,m]=p.useState(!1),[g,v]=p.useContext(Z);p.useImperativeHandle(s,(()=>l.current&&l.current.element)),p.useImperativeHandle(i,(()=>({props:e,element:s.current}))),p.useImperativeHandle(t,(()=>i.current));const[f,h]=r.useCustomComponent(e.chip||re.chip),[x,E]=r.useCustomComponent(e.dropClue||re.dropClue),[y,A]=r.useCustomComponent(e.columnMenuTextColumn||re.columnMenuTextColumn),[C,w]=r.useCustomComponent(e.filterFieldsEditor||re.filterFieldsEditor),b=G(g.filter,String(e.value),"in"),I=G(g.filter,String(e.value));return r.useDraggable(s,{onPress:e=>{n.current=e.clientX,o.current=e.clientY},onDrag:t=>{Math.abs(n.current-t.clientX)<10&&Math.abs(o.current-t.clientY)<10||(s.current&&(s.current.style.transform=`translate(${t.clientX-n.current}px, ${t.clientY-o.current}px)`),m(!0),v({type:W.setDragItem,payload:e.dataItem}))},onRelease:()=>{m(!1),g.dragItem&&(s.current&&(s.current.style.transform=""),v({type:W.drop,payload:e.dataItem}))}}),p.createElement(p.Fragment,null,g.dropTarget&&a.compareAxes(g.dropTarget,e.dataItem)&&"before"===g.dropDirection&&p.createElement(x,{...E}),p.createElement(f,{ref:r.canUseRef(f)?l:void 0,...e,removable:!0,onRemove:t=>{v({type:W.remove,payload:e.dataItem},t.syntheticEvent)},onMouseEnter:t=>{g.dragItem&&(v({type:W.setDropTarget,payload:e.dataItem},t.syntheticEvent),v({type:W.setDropZone,payload:u},t.syntheticEvent))},onMouseMove:e=>{if(g.dragItem&&!d&&s.current){const t=s.current.getBoundingClientRect(),r=e.syntheticEvent.clientX-t.left<t.width/2?"before":"after";v({type:W.setDropDirection,payload:r},e.syntheticEvent)}},style:{pointerEvents:d?"none":void 0},rounded:"full",...h},e.text,"measureAxes"!==u&&p.createElement(y,{field:String(e.value),itemsRender:t=>{const r=t.slice(),n=((e,t,r)=>{if(!e)return;let n,a=0;const o=e.length;let l;for(;a<o;a++)l=e[a].operator,l===r&&e[a].field===t&&(n=e[a]);return n})(g.filter,String(e.dataItem.name),"in");return r.splice(1,0,p.createElement(C,{key:"axis-filter-fields-editor",defaultFilter:n,dataItem:e.dataItem,data:e.dataItem.fields,axes:u,...w})),r},sort:g.sort,onSortChange:(e,t)=>{v({type:W.setSort,payload:t},e)},filter:I&&I.length?[{logic:"and",filters:I}]:void 0,onFilterChange:(e,t)=>{t.length?v({type:W.setFilter,payload:[...b||[],...t.reduce(((e,t)=>[...e,...t.filters.filter((e=>e.value))]),[])]},e):v({type:W.setFilter,payload:b},e)},filterContent:[c.ColumnMenuTextFilter],...A})),g.dropTarget&&a.compareAxes(g.dropTarget,e.dataItem)&&"after"===g.dropDirection&&p.createElement(x,{...E}))})),re={chip:l.Chip,columnMenuTextColumn:c.ColumnMenuTextColumn,filterFieldsEditor:Q,dropClue:e=>p.createElement("div",{className:"k-grouping-dropclue",style:{position:"relative",zIndex:1e4},...e})};te.displayName="KendoReactPivotGridAxisEditor";const ne=p.forwardRef(((e,t)=>{const{value:n=ae.value,field:a}=e,o=p.useRef(null),l=p.useRef(null),s=p.useRef(null),[i,c]=r.useCustomComponent(e.chipList||ae.chipList);p.useImperativeHandle(l,(()=>o.current&&o.current.element)),p.useImperativeHandle(s,(()=>({props:e,element:l.current}))),p.useImperativeHandle(t,(()=>s.current));const u=n.filter((e=>1===e.name.length&&e.name.every((e=>-1===e.indexOf("&"))))).map((e=>({...e,text:String(e.name)})));return p.createElement(V.Provider,{value:{axes:a}},p.createElement(i,{ref:r.canUseRef(i)?o:void 0,textField:"text",valueField:"name",data:u,chip:te,style:{position:"relative"},className:e.className,selection:"none",...c}))})),ae={value:[],chipList:l.ChipList};ne.displayName="KendoReactPivotGridAxesEditor";const oe=p.forwardRef(((e,t)=>{const{data:n,rowAxes:a,columnAxes:o,measureAxes:l,onExpand:s,onCheck:i}={...le,...e},c=p.useRef(null),d=p.useRef(null),[m,g]=r.useCustomComponent(e.treeView||le.treeView),[v,f]=r.useCustomComponent(e.noData||le.noData);p.useImperativeHandle(d,(()=>({props:e,element:c.current&&c.current.element}))),p.useImperativeHandle(t,(()=>d.current));const[h]=p.useContext(Z),x=q(o),E=q(a),y=q(l),A=O(n).filter((e=>[...x,...E,...y].some((t=>t===e.uniqueName||t===e.defaultHierarchy)))),C={caption:e=>e.dataItem.caption,id:e=>e.dataItem.uniqueName,value:e=>e.dataItem.defaultHierarchy||e.dataItem.uniqueName,expanded:e=>h.expanded.some((t=>t.uniqueName===e.dataItem.uniqueName)),hasChildren:e=>!("hierarchyUniqueName"in e.dataItem)&&!("aggregator"in e.dataItem),selectable:e=>!(!e.hasChildren&&!e.dataItem.aggregator&&!e.dataItem.measure||2===e.dataItem.type||"[KPIs]"===e.dataItem.uniqueName),children:e=>M(e.dataItem.children,C,e),checked:e=>A.some((t=>e.dataItem.defaultHierarchy?t.defaultHierarchy===e.dataItem.defaultHierarchy:t.uniqueName===e.dataItem.uniqueName))||e.children.length&&e.children.every((e=>e.checked))},w=M(e.data,C);return p.createElement(u.TreeViewItemPropsContext.Provider,{value:e=>({...e,checkboxes:e.item.selectable})},w&&w.length?p.createElement(m,{ref:r.canUseRef(m)?c:void 0,data:w,checkboxes:!0,onExpandChange:e=>{s&&s({value:e.item.dataItem,target:d.current,syntheticEvent:e.syntheticEvent})},onCheckChange:e=>{i&&i({value:e.item.dataItem,target:d.current,syntheticEvent:e.syntheticEvent})},textField:"caption",expandIcons:!0,hasChildrenField:"hasChildren",checkIndeterminateField:"checkIndeterminate",childrenField:"children",...g}):p.createElement(v,{...f}))})),le={data:[],rowAxes:[],columnAxes:[],measureAxes:[],treeView:u.TreeView,noData:()=>p.createElement("div",null,"NO DATA")};oe.displayName="KendoReactPivotGridFieldsEditor";const se=p.forwardRef(((e,t)=>{const{onFieldsEditorFieldCheck:a,onFieldsEditorFieldCheckAction:o=ie.onFieldsEditorFieldCheckAction,onFieldsEditorFieldExpand:l,onFieldsEditorFieldExpandAction:c=ie.onFieldsEditorFieldExpandAction,onAxisFilterFieldExpand:u,onAxisFilterFieldsExpandChange:d}=e,m={onFieldsEditorFieldCheck:a,onFieldsEditorFieldCheckAction:o,horizontal:ie.horizontal,axesEditor:ie.axesEditor,...e},[g,v]=r.useCustomComponent(m.fieldsLabel||ie.fieldsLabel),[f,h]=r.useCustomComponent(m.fieldsEditor||ie.fieldsEditor),[x,E]=r.useCustomComponent(m.columnAxesLabel||ie.columnAxesLabel),[y,N]=r.useCustomComponent(m.columnAxesEditor||ie.columnAxesEditor),[R,F]=r.useCustomComponent(m.rowAxesLabel||ie.rowAxesLabel),[S,P]=r.useCustomComponent(m.rowAxesEditor||ie.rowAxesEditor),[T,L]=r.useCustomComponent(m.measureAxesLabel||ie.measureAxesLabel),[D,M]=r.useCustomComponent(m.measureAxesEditor||ie.measureAxesEditor),O=p.useRef(null),q=p.useRef(null),H=n.useLocalization(),[G,K]=Y(m);p.useImperativeHandle(q,(()=>({element:O.current,props:m,state:G}))),p.useImperativeHandle(t,(()=>q.current));const z=()=>{G.dragItem&&K({type:W.setDropZone,payload:"columnAxes"})},U=()=>{G.dragItem&&K({type:W.setDropZone,payload:null})},j=()=>{G.dragItem&&K({type:W.setDropZone,payload:"rowAxes"})},B=()=>{G.dragItem&&K({type:W.setDropZone,payload:null})},V=()=>{G.dragItem&&K({type:W.setDropZone,payload:"measureAxes"})},_=()=>{G.dragItem&&K({type:W.setDropZone,payload:null})},$=m.horizontal?"div":p.Fragment,J=m.horizontal?{className:"k-form-field-wrapper"}:{};return p.createElement(X.Provider,{value:{onAxisFilterFieldExpand:e=>{const t={target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent};u&&u(t)},onAxisFilterFieldsExpandChange:e=>{const t={target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent};d&&d(t)}}},p.createElement(Z.Provider,{value:[G,K]},p.createElement($,{...J},p.createElement("div",{className:"k-form-field"},p.createElement(g,{name:"",component:i.Label,...v},H.toLanguageString(b,k[b]))),p.createElement("div",{className:"k-form-field"},p.createElement("div",{className:"k-fields-list-wrapper"},p.createElement(f,{data:m.data,onExpand:e=>{const t={target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent};if(c){const r=c(t,m,G);r&&(Array.isArray(r)?r.filter(Boolean).map((t=>t&&K({...t},e.syntheticEvent))):K({...r},e.syntheticEvent))}l&&l({target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent})},onCheck:e=>{const t={target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent};if(o){const r=o(t,m,G);r&&(Array.isArray(r)?r.filter(Boolean).map((t=>t&&K({...t},e.syntheticEvent))):K({...r},e.syntheticEvent))}a&&a(t)},columnAxes:G.columnAxes,rowAxes:G.rowAxes,measureAxes:G.measureAxes,...h})))),p.createElement($,{...J},p.createElement("div",{className:"k-form-field",onMouseEnter:z,onMouseLeave:U},p.createElement(s.Field,{name:"columnAxes",field:"columnAxes",component:x,...E},H.toLanguageString(A,k[A]))),m.valueGetter("columnAxes").length?p.createElement(s.Field,{name:"columnAxes",field:"columnAxes",component:y,onMouseEnter:z,onMouseLeave:U,className:"k-column-fields",...N}):p.createElement("div",{className:"k-settings-description",onMouseEnter:z,onMouseLeave:U},H.toLanguageString(I,k[I])),p.createElement("div",{className:"k-form-field",onMouseEnter:j,onMouseLeave:B},p.createElement(s.Field,{name:"rowAxes",field:"rowAxes",component:R,...F},H.toLanguageString(C,k[C]))),m.valueGetter("rowAxes").length?p.createElement(s.Field,{name:"rowAxes",field:"rowAxes",component:S,onMouseEnter:j,onMouseLeave:B,className:"k-column-fields",...P}):p.createElement("div",{className:"k-settings-description",onMouseEnter:j,onMouseLeave:B},H.toLanguageString(I,k[I]))),p.createElement($,{...J},p.createElement("div",{className:"k-form-field",onMouseEnter:V,onMouseLeave:_},p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:T,...L},H.toLanguageString(w,k[w]))),m.valueGetter("measureAxes").length?p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:D,onMouseEnter:V,onMouseLeave:_,className:"k-column-fields",...M}):p.createElement("div",{className:"k-settings-description",onMouseEnter:V,onMouseLeave:_},H.toLanguageString(I,k[I])))))})),ie={data:[],horizontal:!1,fieldsLabel:i.Label,fieldsEditor:oe,columnAxesLabel:i.Label,columnAxesEditor:ne,rowAxesLabel:i.Label,rowAxesEditor:ne,measureAxesLabel:i.Label,measureAxesEditor:ne,axesEditor:ne,onFieldsEditorFieldCheckAction:e=>({type:W.toggleSelection,payload:e.value}),onFieldsEditorFieldExpandAction:e=>({type:W.toggleExpansion,payload:e.value})};se.displayName="KendoReactPivotGridConfiguratorEditor";const ce=p.forwardRef(((e,t)=>{const{horizontal:a,data:o,rowAxes:s,columnAxes:i,measureAxes:c}={...ue,...e},u=p.useRef(null),d=p.useRef(null),m=p.useRef(null),g=n.useLocalization(),[v,f]=r.useCustomComponent(e.editor||ue.editor),[h,A]=r.useCustomComponent(e.form||ue.form),[C,w]=r.useCustomComponent(e.formElement||ue.formElement);p.useImperativeHandle(d,(()=>({props:e,element:u.current}))),p.useImperativeHandle(t,(()=>d.current));const b={rowAxes:s,columnAxes:i,measureAxes:c,sort:e.sort,filter:e.filter};return p.useEffect((()=>{m.current&&m.current.onChange("rowAxes",{value:s})}),[s]),p.useEffect((()=>{m.current&&m.current.onChange("columnAxes",{value:i})}),[i]),p.useEffect((()=>{m.current&&m.current.onChange("measureAxes",{value:c})}),[c]),p.useEffect((()=>{m.current&&m.current.onChange("sort",{value:e.sort})}),[e.sort]),p.useEffect((()=>{m.current&&m.current.onChange("filter",{value:e.filter})}),[e.filter]),p.createElement("div",{ref:u,id:e.id,tabIndex:e.tabIndex,style:e.style,className:r.classNames("k-pivotgrid-configurator",e.className)},p.createElement("div",{className:r.classNames("k-pivotgrid-configurator-panel","k-pivotgrid-configurator-push",{"k-pivotgrid-configurator-horizontal":a,"k-pivotgrid-configurator-vertical":!a})},p.createElement("div",{className:"k-pivotgrid-configurator-header"},p.createElement("div",{className:"k-pivotgrid-configurator-header-text"},g.toLanguageString(x,k[x]))),p.createElement(h,{ref:r.canUseRef(h)?m:void 0,initialValues:b,onSubmit:(t,r)=>{e.onRowAxesChange&&e.onRowAxesChange({target:d.current,value:t.rowAxes,syntheticEvent:r}),e.onColumnAxesChange&&e.onColumnAxesChange({target:d.current,value:t.columnAxes,syntheticEvent:r}),e.onMeasureAxesChange&&e.onMeasureAxesChange({target:d.current,value:t.measureAxes,syntheticEvent:r}),e.onSortChange&&e.onSortChange({target:d.current,value:t.sort,syntheticEvent:r}),e.onFilterChange&&e.onFilterChange({target:d.current,value:t.filter,syntheticEvent:r})},render:t=>p.createElement(p.Fragment,null,p.createElement("div",{className:"k-pivotgrid-configurator-content"},p.createElement(C,{horizontal:a,...w},p.createElement(v,{...t,horizontal:e.horizontal,onFieldsEditorFieldExpand:e.onFieldsEditorFieldExpand,onFieldsEditorFieldCheck:e.onFieldsEditorFieldCheck,onAxisFilterFieldExpand:e.onAxisFilterFieldExpand,onAxisFilterFieldsExpandChange:e.onAxisFilterFieldsExpandChange,data:o,...f}))),p.createElement("div",{className:"k-pivotgrid-configurator-actions k-actions k-hstack k-justify-content-end"},p.createElement(l.Button,{type:"submit",onClick:t.onFormReset},g.toLanguageString(E,k[E])),p.createElement(l.Button,{themeColor:"primary",type:"submit",onClick:t.onSubmit},g.toLanguageString(y,k[y])))),...A})))})),ue={form:s.Form,formElement:s.FormElement,editor:se,horizontal:!1,data:[],columnAxes:[],rowAxes:[],measureAxes:[]};ce.displayName="KendoReactPivotGridConfigurator";const de=p.forwardRef(((e,t)=>{const a=p.useRef(null),l=p.useRef(null),s=n.useLocalization();p.useImperativeHandle(a,(()=>({props:e,element:l.current}))),p.useImperativeHandle(t,(()=>a.current));const[i,c]=r.useCustomComponent(e.icon||me.icon),u=p.useMemo((()=>r.classNames("k-pivotgrid-configurator-button",e.className)),[e.className]),d=r.useMouse(e,a);return p.createElement("div",{ref:l,id:e.id,className:u,tabIndex:e.tabIndex,...d},p.createElement("span",null,s.toLanguageString(N,k[N]),p.createElement(i,{name:"gear",icon:o.gearIcon,...c})))})),me={icon:r.IconWrap};de.displayName="KendoReactPivotGridConfiguratorButton";const pe=e=>{const[t,n]=p.useState(!0),[o,l]=p.useState({data:[],columns:[],rows:[]}),[s,i]=p.useState([]),[c,u]=p.useState(e.defaultColumnAxes||[]),[d,m]=p.useState(e.defaultRowAxes||[]),[g,v]=p.useState(e.defaultMeasureAxes||[]),[f,h]=p.useState(e.defaultSort||[]),[x,E]=p.useState(e.defaultFilter||[]),y=e=>{m(e.value)},A=e=>{u(e.value)};p.useEffect((()=>{n(!0);const t={connection:{catalog:e.catalog,cube:e.cube},columnAxes:c.slice(),rowAxes:d.slice(),measureAxes:g,sort:f,filter:x};setTimeout((()=>{a.fetchData({url:e.url},r.clone(t)).then(a.createDataState).then((e=>{l(e),n(!1)}))}))}),[c,d,g,x,f,e.cube,e.catalog,e.url]),p.useEffect((()=>{n(!0);const t={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube},command:"schemaDimensions"};a.fetchDiscover({url:e.url},t).then((e=>{a.addKPI(e),i(e),n(!1)}))}),[e.catalog,e.cube,e.url]);const C=(e=[],t)=>{for(let r=0;r<e.length;r++){const n=e[r];if(String(n.name)===String(t.name))return n}return null},w=(e=[],t)=>{for(let r=0;r<e.length;r++){const n=e[r];if(n.uniqueName===t.uniqueName)return n;const a=w(n.children,t);if(null!==a)return a}return null};return{pivotProps:{rowAxes:d,columnAxes:c,data:o.data,rows:o.rows,columns:o.columns,onRowAxesChange:y,onColumnAxesChange:A},configuratorProps:{sort:f,onSortChange:e=>{h(e.value)},filter:x,onFilterChange:e=>{E(e.value)},data:s,rowAxes:d,columnAxes:c,measureAxes:g,onRowAxesChange:y,onColumnAxesChange:A,onMeasureAxesChange:e=>{v(e.value)},onFieldsEditorFieldExpand:async t=>{const r=s.slice(),n=w(r,t.value);if(n&&"[KPIs]"===n.uniqueName){const t=ge(await(async()=>{const t={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube},command:"schemaKPIs"};return a.fetchDiscover({url:e.url},t)})());n.children=t}else if(n&&"kpi"===n.type)n.children=a.buildKPIMeasures(n);else if(n&&!n.children){const t=await(async t=>{let r,n,o;2===t.type?r="schemaMeasures":t.dimensionUniqueName?(r="schemaLevels",o=t.uniqueName):(r="schemaHierarchies",n=t.uniqueName);const l={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:o,dimensionUniqueName:n,levelUniqueName:void 0,memberUniqueName:void 0,treeOp:void 0},command:r};return a.fetchDiscover({url:e.url},l)})(n);n.children=t}i(r)},onAxisFilterFieldExpand:async t=>{if(!t)return;const r={rowAxes:[d,m],columnAxes:[c,u],measureAxes:[g,v]},[n,o]=r[t.target.props.axes],l=n.slice(),s=C(l,t.target.props.dataItem);if(s){const r=(s.fields||[]).slice(),n=w(r,t.value);if(n&&(!n.children||!n.children.length)){const t=await(async t=>{let r,n,o;t.uniqueName&&(r="schemaMembers",n=t.uniqueName.replace(/\&/g,"&"),o=1);const l={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:void 0,dimensionUniqueName:void 0,levelUniqueName:void 0,memberUniqueName:n,treeOp:o},command:r};return a.fetchDiscover({url:e.url},l)})(n);n.children=t,s.fields=r,o(l)}}},onAxisFilterFieldsExpandChange:async t=>{if(!t)return;const r={rowAxes:[d,m],columnAxes:[c,u],measureAxes:[g,v]},[n,o]=r[t.target.props.axes],l=n.slice(),s=C(l,t.target.props.dataItem);if(s&&!s.fields){const t=await(async t=>{let r,n;t.name&&(r="schemaMembers",n=`${String(t.name)}.[(ALL)]`);const o={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:void 0,dimensionUniqueName:void 0,levelUniqueName:n,memberUniqueName:void 0,treeOp:void 0},command:r};return a.fetchDiscover({url:e.url},o)})(s);s.fields=t,o(l)}}},state:{loading:t}}},ge=e=>{for(let t=0,r=e.length;t<r;t++)e[t].uniqueName=e[t].name,e[t].type="kpi";return e},ve={dataField:"aggregate",columnsData:"columns"},fe="&",he=e=>{const[t,r]=p.useState(!0),[n,o]=p.useState(e.defaultColumnAxes||[]),[l,s]=p.useState(e.defaultRowAxes||[]),[i,c]=p.useState(e.defaultMeasureAxes||[]),[u,d]=p.useState(e.defaultSort||[]),[m,g]=p.useState(e.defaultFilter||[]),[v,f]=p.useState({data:[],rows:[],columns:[]}),h=p.useCallback((e=>{s(e.value)}),[]),x=p.useCallback((e=>{o(e.value)}),[]),E=p.useMemo((()=>Array.from(a.rootFields(n).keys()).join(fe)),[n]),y=p.useMemo((()=>Array.from(a.rootFields(l).keys()).join(fe)),[l]),A=p.useCallback((t=>({key:t,...e.dimensions[t]})),[e.dimensions]),C=p.useMemo((()=>E?E.split(fe).map(A):[]),[E,A]),w=p.useMemo((()=>y?y.split(fe).map(A):[]),[y,A]),b=p.useMemo((()=>i.map((t=>e.measures.find((e=>String(e.name)===String(t.name))))).filter(Boolean)),[i,e.measures]);p.useEffect((()=>{r(!0),setTimeout((()=>{const t=new Map(a.createDataTree(e.data,w,C,b,ve,m));f(a.createLocalDataState({dataTree:t,rowSettings:w,columnSettings:C,rowAxes:l,columnAxes:n,measures:b,sort:u,fields:ve})),r(!1)}),0)}),[e.data,w,C,b,m,l,n,u]);const I=p.useMemo((()=>a.createFlatSchemaDimensions(e.dimensions,e.measures)),[e.dimensions,e.measures]);return{pivotProps:{rowAxes:l,columnAxes:n,data:v.data,rows:v.rows,columns:v.columns,onRowAxesChange:h,onColumnAxesChange:x},configuratorProps:{sort:u,onSortChange:e=>{d(e.value)},filter:m,onFilterChange:e=>{g(e.value)},data:I,rowAxes:l,columnAxes:n,measureAxes:i,onRowAxesChange:h,onColumnAxesChange:x,onMeasureAxesChange:e=>{c(e.value)}},state:{loading:t}}};Object.defineProperty(e,"AggregateType",{enumerable:!0,get:function(){return a.AggregateType}}),Object.defineProperty(e,"averageAggregate",{enumerable:!0,get:function(){return a.averageAggregate}}),Object.defineProperty(e,"createAggregate",{enumerable:!0,get:function(){return a.createAggregate}}),Object.defineProperty(e,"maxAggregate",{enumerable:!0,get:function(){return a.maxAggregate}}),Object.defineProperty(e,"minAggregate",{enumerable:!0,get:function(){return a.minAggregate}}),Object.defineProperty(e,"sumAggregate",{enumerable:!0,get:function(){return a.sumAggregate}}),e.PivotGrid=z,e.PivotGridAxesEditor=ne,e.PivotGridAxisEditor=te,e.PivotGridAxisFilterFieldsEditor=Q,e.PivotGridCell=F,e.PivotGridColumn=L,e.PivotGridConfigurator=ce,e.PivotGridConfiguratorButton=de,e.PivotGridConfiguratorEditor=se,e.PivotGridContainer=j,e.PivotGridFieldsEditor=oe,e.PivotGridHeaderCell=P,e.PivotGridRow=R,e.PivotLocalDataService=e=>{const t=he(e);return e.children(t)},e.PivotOLAPService=e=>{const t=pe(e);return e.children(t)},e.dataCells=(e,t,r)=>{const n=JSON.parse(JSON.stringify(e||[])),o=JSON.parse(JSON.stringify(t||[])),l=JSON.parse(JSON.stringify(r||[])),s=a.toTree(n),[,i,c]=a.toRows(s),u=a.toTree(o),[,d,,m]=a.toColumns(u);return a.toData(l,d,i,m,c)},e.usePivotLocalDataService=he,e.usePivotOLAPService=pe}));
|
|
15
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-react-common"),require("@progress/kendo-react-intl"),require("@progress/kendo-pivotgrid-common"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-form"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-data-tools"),require("@progress/kendo-react-treeview"),require("@progress/kendo-react-indicators")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-react-common","@progress/kendo-react-intl","@progress/kendo-pivotgrid-common","@progress/kendo-svg-icons","@progress/kendo-react-buttons","@progress/kendo-react-form","@progress/kendo-react-labels","@progress/kendo-react-data-tools","@progress/kendo-react-treeview","@progress/kendo-react-indicators"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactPivotgrid={},e.React,e.KendoReactCommon,e.KendoReactIntl,e.KendoPivotgridCommon,e.KendoSvgIcons,e.KendoReactButtons,e.KendoReactForm,e.KendoReactLabels,e.KendoReactDataTools,e.KendoReactTreeview,e.KendoReactIndicators)}(this,function(e,t,r,n,a,o,l,s,i,c,u,d){"use strict";function m(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var p=m(t);const g=Object.freeze({name:"@progress/kendo-react-pivotgrid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"13.4.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"}),v="pivotgrid.emptyCellAriaLabel",f="pivotgrid.fieldMenuReset",h="pivotgrid.fieldMenuApply",x="pivotgrid.configuratorTitle",E="pivotgrid.configuratorCancel",y="pivotgrid.configuratorApply",A="pivotgrid.configuratorColumnsTitle",C="pivotgrid.configuratorRowsTitle",w="pivotgrid.configuratorMeasuresTitle",b="pivotgrid.configuratorEditorSearchTitle",I="pivotgrid.configuratorEditorSearchPlaceholder",N="pivotgrid.configuratorMissingFields",k="pivotgrid.configuratorButtonLabel",R={[v]:"PivotGrid component. Use the arrow keys to navigate.",[f]:"Reset",[h]:"Apply",[E]:"Cancel",[y]:"Apply",[x]:"Settings",[b]:"Fields",[I]:"Search...",[A]:"Columns",[C]:"Rows",[w]:"Values",[k]:"Change settings",[N]:"Select some fields to begin setup"},F=p.forwardRef((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(n,()=>({element:a.current,props:e})),p.useImperativeHandle(t,()=>n.current);const o=r.useMouse(e,n);return p.createElement("tr",{ref:a,...o,id:e.id,style:e.style,tabIndex:e.tabIndex,children:e.children,role:e.role,"aria-owns":e.ariaOwns,className:r.classNames("k-pivotgrid-row",e.className)})});F.displayName="KendoReactPivotGridRow";const S=p.forwardRef((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(n,()=>({element:a.current,props:e})),p.useImperativeHandle(t,()=>n.current);const o=r.useMouse(e,n);return p.createElement("td",{ref:a,...o,id:e.id,style:e.style,tabIndex:e.tabIndex,role:e.role,"aria-describedby":e.ariaDescribedby,className:r.classNames("k-pivotgrid-cell",{"k-pivotgrid-header-total":e.total},e.className)},e.children)});S.displayName="KendoReactPivotGridCell";const P=(e,t,r)=>[e,(n,o)=>{const l=a.headersReducer(e,{...n,tree:t});r&&r(l,o)}],T=p.forwardRef((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(n,()=>({element:a.current,props:e})),p.useImperativeHandle(t,()=>n.current);const[l,s]=r.useCustomComponent(e.icon||L.icon),i=r.useMouse(e,n);return p.createElement("th",{ref:a,...i,colSpan:e.colSpan,rowSpan:e.rowSpan,id:e.id,style:e.style,tabIndex:e.tabIndex,role:e.role,...e.expandable?{"aria-expanded":e.expanded}:{},className:r.classNames("k-pivotgrid-cell",{"k-pivotgrid-header-total":e.total,"k-pivotgrid-header-root":e.root,"k-pivotgrid-expanded":e.expanded,"k-first":e.first},e.className)},e.expandable&&p.createElement(l,{...s,className:"k-pivotgrid-toggle",onClick:t=>{e.onIconClick&&e.onIconClick.call(void 0,{syntheticEvent:t.syntheticEvent,target:n.current})},name:"chevron-"+(e.expanded?"up":"down"),"aria-hidden":!0,icon:e.expanded?o.chevronUpIcon:o.chevronDownIcon}),e.children)}),L={icon:r.IconWrap};T.displayName="KendoReactPivotGridHeaderCell";const D=p.forwardRef((e,t)=>{const n=p.useRef(null),a=p.useRef(null),{id:o,style:l,tabIndex:s,children:i,className:c,path:u=M.path}=e;p.useImperativeHandle(n,()=>({element:a.current,props:{path:u,...e}})),p.useImperativeHandle(t,()=>n.current);const d=r.useMouse(e,n);return p.createElement("col",{ref:a,...d,id:o,style:l,tabIndex:s,children:i,className:c})}),M={path:[]};D.displayName="KendoReactPivotGridColumn";const O=(e=[],t={},r=null)=>e.map(e=>{const n={dataItem:e};return Object.keys(t).forEach(e=>{n[e]=t[e](n,r)}),n}),q=(e=[])=>{let t=[...e];return(e||[]).forEach(e=>{t=t.concat(q(e.children))}),t},H=(e=[])=>{const t=new Set;return e.forEach(e=>{t.add(String(e.name))}),Array.from(t)},G=(e=[])=>`${e.join(",")}`,K=(e,t,r)=>{if(!e)return[];let n=0;const a=[],o=e.length;let l;for(;n<o;n++)l=e[n].operator,(!r&&"in"!==l||l===r)&&e[n].field===t&&a.push(e[n]);return a},z=(e,t)=>e.uniqueName===t.uniqueName,U=p.forwardRef((e,t)=>{const o=!r.validatePackage(g,{component:"PivotGrid"}),l=r.getLicenseMessage(g),{rows:s,rowAxes:i,columns:c,columnAxes:u,data:d}={...j,...e},m=p.useRef(null),f=p.useRef(null),h=p.useRef(null),x=p.useRef(null),E=p.useRef(null),y=p.useRef(null),A=p.useRef(null),C=n.useLocalization(),w=a.toTree((s||[]).slice()),[,b]=P((i||[]).slice(),w,(t,r)=>{e.onRowAxesChange&&e.onRowAxesChange({value:t,target:f.current,syntheticEvent:r})}),[I,N,k,F]=a.toRows(w),S=a.toTree((c||[]).slice()),[,T]=P((u||[]).slice(),S,(t,r)=>{e.onColumnAxesChange&&e.onColumnAxesChange({value:t,target:f.current,syntheticEvent:r})}),[L,D,,M]=a.toColumns(S),O=a.toData((d||[]).slice(),D,N,M,k);p.useImperativeHandle(f,()=>({props:e,element:m.current,columnHeaderRows:L,rowHeaderRows:I,dataCells:O,rowHeaderBreadth:F,columnHeaderBreadth:M})),p.useImperativeHandle(t,()=>f.current);const q=[],H=[],K=[],[z,U]=r.useCustomComponent(e.row||j.row),[B,V]=r.useCustomComponent(e.column||j.column),[X,Z]=r.useCustomComponent(e.cell||j.cell),[_,$]=r.useCustomComponent(e.headerCell||j.headerCell),J=e.columnHeadersRow||z,W=e.columnHeadersColumn||B,Y=e.columnHeadersCell||_,Q=e.rowHeadersRow||z,ee=e.rowHeadersColumn||B,te=e.rowHeadersCell||_,re=e.dataRow||z,ne=e.dataColumn||B;for(let e=0;e<D.length;e++)q.push(p.createElement(ne,{key:String(D[e].path),...V,path:D[e].path})),K.push(p.createElement(W,{key:String(D[e].path),...V,path:D[e].path}));for(let e=0;e<F;e++)H.push(p.createElement(ee,{key:e,...V}));const ae=e=>{e.target.props.expandable&&T({type:a.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},oe=e=>{e.target.props.expandable&&b({type:a.HEADERS_ACTION.toggle,payload:e.target.props.dataItem.path},e.syntheticEvent)},le=((...e)=>{const t=p.useRef(void 0);return r=>{void 0!==t.current&&window.cancelAnimationFrame(t.current);const n=r.currentTarget,a=n.scrollLeft;e.forEach(e=>{const r=e.current;r&&r!==n&&(t.current=window.requestAnimationFrame(()=>{r.scrollLeft=Math.round(a)}))})}})(A,y),se=((...e)=>{const t=p.useRef(void 0);return r=>{void 0!==t.current&&window.cancelAnimationFrame(t.current);const n=r.currentTarget,a=n.scrollTop;e.forEach(e=>{const r=e.current;r&&r!==n&&(t.current=window.requestAnimationFrame(()=>{r.scrollTop=Math.round(a)}))})}})(A,E),ie=p.useCallback(()=>{m.current&&x.current&&(m.current.style.gridTemplateRows="",m.current.style.gridTemplateRows=`${x.current.offsetHeight}px 1fr`)},[]),ce=p.useCallback(()=>{m.current&&h.current&&(m.current.style.gridTemplateColumns="",m.current.style.gridTemplateColumns=`${h.current.offsetWidth}px 1fr`)},[]),ue=p.useRef(new a.PivotGridNavigation({tabIndex:e.tabIndex||0}));p.useEffect(()=>{if(m.current){const t=e.tabIndex||0;if(ue.current.stop(),ue.current.tabIndex=t,e.navigatable){ue.current.start(m.current);const e=ue.current.first;e&&e.setAttribute("tabindex",String(t))}}return()=>{ue.current.stop()}},[e.tabIndex,e.navigatable]),p.useEffect(()=>{ue.current.update()}),p.useEffect(()=>{if(x.current){const e=new window.ResizeObserver(()=>{window.requestAnimationFrame(()=>{ie()})});return e.observe(x.current),()=>{e.disconnect()}}},[ie]),p.useEffect(()=>{if(h.current){const e=new window.ResizeObserver(()=>{window.requestAnimationFrame(()=>{ce()})});return e.observe(h.current),()=>{e.disconnect()}}},[ce]),r.useIsomorphicLayoutEffect(()=>{if(r.setScrollbarWidth(),h.current){const e=new window.ResizeObserver(()=>window.requestAnimationFrame(()=>{r.setScrollbarWidth()}));return e.observe(h.current),()=>{e.disconnect()}}},[]);const de=new Array(L.length).fill([]).map(()=>new Array(D.length));L.forEach((e,t)=>{let r=0;Array.from(e.cells).forEach(e=>{const n=!!(e&&e.children&&e.children.length),a=(e?G(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(n?"|[EXPANDED]":""):"").replace(/\s/g,"-");if(e)for(let n=0;n<(e.colSpan||1);n++){for(let n=0;n<(e.rowSpan||1);n++){const e=de[t+n].findIndex((e,t)=>t>=r&&!e);de[t+n][e]=a}r++}})});const me=O.map(e=>e.cells.map(e=>((e,t)=>`${G(e.map(e=>e.name))}|${G(t.map(e=>e.name))}`)(e.rowTuple.members,e.columnTuple.members).replace(/\s/g,"-")));return p.createElement("div",{ref:m,id:e.id,style:e.style,tabIndex:e.navigatable?void 0:e.tabIndex,className:r.classNames("k-pivotgrid",e.className),role:"grid"},o&&p.createElement(r.WatermarkOverlay,{message:l}),p.createElement("span",{className:"k-pivotgrid-empty-cell"},p.createElement("span",{className:"k-sr-only"},C.toLanguageString(v,R[v]))),p.createElement("div",{ref:y,className:"k-pivotgrid-column-headers",onScroll:le},p.createElement("table",{ref:x,className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,K),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},L.map((e,t)=>{let r=!1;return p.createElement(J,{key:e.name,role:"row",...U},e.cells.map((e,n)=>{const a=0!==n&&!r;e&&(r=!0);const o=e&&!(!e.children||!e.children.length),l=e&&e.hasChildren&&(!e.total||e.total&&e.parent.total);return e?p.createElement(Y,{...$,key:de[t][n],"data-key":de[t][n],id:de[t][n],columnPath:e.normalizedPath,rowSpan:e.rowSpan||void 0,colSpan:e.colSpan||void 0,onIconClick:ae,dataItem:e,expanded:o,expandable:l,total:e.total,first:a,root:0===e.levelNum,role:"columnheader"},e.caption):null}))})))),p.createElement("div",{ref:E,className:"k-pivotgrid-row-headers"},p.createElement("table",{ref:h,className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,H),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},I.map((e,t)=>p.createElement(Q,{key:G(N[t].path),...U,path:N[t].path,role:"row",ariaOwns:me[t].join(" ")},e.cells.filter(Boolean).map(e=>e?p.createElement(te,{...$,key:G(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(e.children&&e.children.length?"|[EXPANDED]":""),"data-key":G(e.normalizedPath)+(e.total?"|[TOTAL]":"")+(e.children&&e.children.length?"|[EXPANDED]":""),rowPath:e.normalizedPath,rowSpan:e.rowSpan||void 0,colSpan:e.colSpan||void 0,dataItem:e,expanded:!(!e.children||!e.children.length),expandable:e.hasChildren&&!e.total,total:e.total,onIconClick:oe,root:0===e.levelNum,role:"rowheader"},e.caption):null)))))),p.createElement("div",{ref:A,className:"k-pivotgrid-values",onScroll:e=>{le(e),se(e)}},p.createElement("table",{className:"k-pivotgrid-table",role:"none"},p.createElement("colgroup",null,q),p.createElement("tbody",{className:"k-pivotgrid-tbody",role:"none"},O.map((e,t)=>p.createElement(re,{key:G(N[t].path),...U,path:N[t].path,role:"none"},e.cells.map((e,r)=>p.createElement(X,{key:me[t][r],"data-key":me[t][r],id:me[t][r],...Z,rowPath:e.rowTuple.members.map(e=>e.name),columnPath:e.columnTuple.members.map(e=>e.name),dataItem:e,total:N[t].total||D[r].total,role:"gridcell",ariaDescribedby:de.map(e=>e[r]).join(" ")},e&&e.data&&e.data.fmtValue?e.data.fmtValue:" "))))))))}),j={rowAxes:[],columnAxes:[],data:[],row:F,column:D,cell:S,headerCell:T};U.displayName="KendoReactPivotGrid";const B=p.forwardRef((e,t)=>{const n=p.useRef(null),a=p.useRef(null);p.useImperativeHandle(a,()=>({props:e,element:n.current})),p.useImperativeHandle(t,()=>a.current);const{id:o,style:l,tabIndex:s,configuratorPosition:i,className:c,children:u}={...V,...e};return p.createElement("div",{ref:n,id:o,style:l,tabIndex:s,className:r.classNames("k-d-flex k-pos-relative",{"k-flex-row":"right"===i,"k-flex-row-reverse":"left"===i,"k-flex-column":"bottom"===i,"k-flex-column-reverse":"top"===i},c)},u)}),V={configuratorPosition:"right"};B.displayName="KendoReactPivotGridContainer";const X=p.createContext({axes:null}),Z=p.createContext({}),_=p.createContext([{expanded:[],rowAxes:[],columnAxes:[],measureAxes:[],dragItem:null,dropZone:null,dropDirection:null,dropTarget:null},r.noop]);var $=(e=>(e.toggle="EXPAND_TOGGLE",e.expand="EXPAND_EXPAND",e.collapse="EXPAND_COLLAPSE",e))($||{});const J=(e=[],t,r,n=(e,t)=>e===t)=>{const[a,o]=p.useState(e);return[a,(e,t)=>{const r=((e,t,r)=>{switch(t.type){case"EXPAND_TOGGLE":return Array.isArray(e)?e.find(e=>r(e,t.payload))?[...e.filter(e=>!r(e,t.payload))]:[...e,t.payload]:r(e,t.payload)?null:t.payload;case"EXPAND_EXPAND":if(Array.isArray(e)){if(!e.find(e=>r(e,t.payload)))return[...e,t.payload]}else if(!r(e,t.payload))return t.payload;break;case"EXPAND_COLLAPSE":if(Array.isArray(e)){if(e.find(e=>r(e,t.payload)))return[...e.filter(e=>!r(e,t.payload))]}else r(e,t.payload);break;default:return e}})(a,e,n);o(r)}]};var W=(e=>(e.toggleExpansion="PIVOT_CONFIGURATOR_ACTION_TOGGLE_EXPANSION",e))(W||{});const Y={...a.PIVOT_CONFIGURATOR_ACTION,...W},Q=(e,t)=>{const r=e.valueGetter("rowAxes"),n=e.valueGetter("columnAxes"),o=e.valueGetter("measureAxes"),l=e.valueGetter("sort"),s=e.valueGetter("filter"),[i,c]=J([],0,0,z),[u,d]=p.useState(null),[m,g]=p.useState(null),[v,f]=p.useState(null),[h,x]=p.useState(null);return[{dragItem:u,dropTarget:v,dropZone:m,dropDirection:h,columnAxes:n,rowAxes:r,measureAxes:o,sort:l,filter:s,expanded:i},(t,i)=>{if(t.type===Y.toggleExpansion)c({type:$.toggle,payload:t.payload},i);else{const i=a.configuratorReducer({filter:t.override&&void 0!==t.override.filter?t.override.filter:s,sort:t.override&&void 0!==t.override.sort?t.override.sort:l,rowAxes:t.override&&void 0!==t.override.rowAxes?t.override.rowAxes:r,columnAxes:t.override&&void 0!==t.override.columnAxes?t.override.columnAxes:n,measureAxes:t.override&&void 0!==t.override.measureAxes?t.override.measureAxes:o,dragItem:t.override&&void 0!==t.override.dragItem?t.override.dragItem:u,dropDirection:t.override&&void 0!==t.override.dropDirection?t.override.dropDirection:h,dropTarget:t.override&&void 0!==t.override.dropTarget?t.override.dropTarget:v,dropZone:t.override&&void 0!==t.override.dropZone?t.override.dropZone:m},t);void 0!==i.columnAxes&&e.onChange("columnAxes",{value:i.columnAxes}),void 0!==i.rowAxes&&e.onChange("rowAxes",{value:i.rowAxes}),void 0!==i.measureAxes&&e.onChange("measureAxes",{value:i.measureAxes}),void 0!==i.sort&&e.onChange("sort",{value:i.sort}),void 0!==i.filter&&e.onChange("filter",{value:i.filter}),void 0!==i.dropDirection&&x(i.dropDirection),void 0!==i.dropTarget&&f(i.dropTarget),void 0!==i.dropZone&&g(i.dropZone),void 0!==i.dragItem&&d(i.dragItem)}}]},ee=p.forwardRef((e,t)=>{const{data:a,dataItem:l,defaultFilter:s}={...te,...e},i=p.useRef(null),c=p.useRef(null),u=n.useLocalization(),[d,m]=r.useCustomComponent(e.columnMenuItem||te.columnMenuItem),[g,v]=r.useCustomComponent(e.columnMenuForm||te.columnMenuForm),[x,E]=r.useCustomComponent(e.resetButton||te.resetButton),[y,A]=r.useCustomComponent(e.applyButton||te.applyButton),[C,w]=r.useCustomComponent(e.treeView||te.treeView),[b,I]=r.useCustomComponent(e.noData||te.noData);p.useImperativeHandle(c,()=>({props:e,element:i.current})),p.useImperativeHandle(t,()=>c.current);const[N,k]=p.useState(!1),{onAxisFilterFieldsExpandChange:F,onAxisFilterFieldExpand:S}=p.useContext(Z),[,P]=p.useContext(_),[T,L]=p.useState(s),D=T?T.value.split(","):[],[M,H]=J([],0,0,z),G={caption:e=>e.dataItem.caption,id:e=>e.dataItem.uniqueName,parent:(e,t)=>t&&t.value,value:e=>e.dataItem.defaultHierarchy||e.dataItem.uniqueName,expanded:e=>M.some(t=>t.uniqueName===e.id),checked:e=>!D.length||(D||[]).some(t=>t===e.dataItem.uniqueName),hasChildren:e=>parseInt(e.dataItem.childrenCardinality,10)>0,children:e=>O(e.dataItem.children,G,e),checkIndeterminate:e=>{const t=(e.children||[]).length&&e.children.every(e=>e.checked);return t&&(e.checked=!0),(e.children||[]).some(e=>e.checked)&&!t}},K=O(a,G),U=q(K);return p.createElement("div",{ref:i,id:e.id,tabIndex:e.tabIndex,style:e.style,className:r.classNames("k-columnmenu-item-wrapper",e.className)},p.createElement(d,{...m,title:"Include Fields",iconClass:"k-i-grid-layout",svgIcon:o.gridLayoutIcon,onClick:e=>{k(!N),F&&F({value:!N,target:c.current,syntheticEvent:e})}}),p.createElement(g,{show:N,actions:p.createElement(p.Fragment,null,p.createElement(x,{type:"reset",onClick:e=>{k(!1),T&&P({type:Y.removeFilter,payload:T},e)},...E},u.toLanguageString(f,R[f])),p.createElement(y,{themeColor:"primary",onClick:e=>{k(!1),T&&P({type:s?Y.changeFilter:Y.addFilter,payload:T},e)},...A},u.toLanguageString(h,R[h]))),...v},K&&K.length?p.createElement(C,{data:K,checkboxes:!0,onExpandChange:e=>{H({type:$.toggle,payload:e.item.dataItem},e.syntheticEvent),S&&S({value:e.item.dataItem,target:c.current,syntheticEvent:e.syntheticEvent})},onCheckChange:e=>{let t;t=e.item.checked?{field:String(l.name),operator:"in",value:U.filter(e=>e.checked).map(e=>String(e.value)).filter(t=>t!==e.item.value&&t!==e.item.parent).join(",")}:{field:String(l.name),operator:"in",value:U.filter(e=>e.checked).map(e=>String(e.value)).concat([e.item.value]).join(",")},L(t)},textField:"caption",expandIcons:!0,hasChildrenField:"hasChildren",checkIndeterminateField:"checkIndeterminate",childrenField:"children",...w}):p.createElement(b,{...I})))}),te={data:[],resetButton:l.Button,applyButton:l.Button,treeView:u.TreeView,noData:()=>p.createElement(d.Skeleton,{shape:"rectangle",style:{height:"20px",width:"calc(100% - 16px)",margin:8}}),columnMenuItem:c.ColumnMenuItem,columnMenuForm:c.ColumnMenuForm};ee.displayName="KendoReactPivotGridAxisFilterFieldsEditor";const re=p.forwardRef((e,t)=>{const n=p.useRef(0),o=p.useRef(0),l=p.useRef(null),s=p.useRef(null),i=p.useRef(null),{axes:u}=p.useContext(X),[d,m]=p.useState(!1),[g,v]=p.useContext(_);p.useImperativeHandle(s,()=>l.current&&l.current.element),p.useImperativeHandle(i,()=>({props:e,element:s.current})),p.useImperativeHandle(t,()=>i.current);const[f,h]=r.useCustomComponent(e.chip||ne.chip),[x,E]=r.useCustomComponent(e.dropClue||ne.dropClue),[y,A]=r.useCustomComponent(e.columnMenuTextColumn||ne.columnMenuTextColumn),[C,w]=r.useCustomComponent(e.filterFieldsEditor||ne.filterFieldsEditor),b=K(g.filter,String(e.value),"in"),I=K(g.filter,String(e.value));return r.useDraggable(s,{onPress:e=>{n.current=e.clientX,o.current=e.clientY},onDrag:t=>{Math.abs(n.current-t.clientX)<10&&Math.abs(o.current-t.clientY)<10||(s.current&&(s.current.style.transform=`translate(${t.clientX-n.current}px, ${t.clientY-o.current}px)`),m(!0),v({type:Y.setDragItem,payload:e.dataItem}))},onRelease:()=>{m(!1),g.dragItem&&(s.current&&(s.current.style.transform=""),v({type:Y.drop,payload:e.dataItem}))}}),p.createElement(p.Fragment,null,g.dropTarget&&a.compareAxes(g.dropTarget,e.dataItem)&&"before"===g.dropDirection&&p.createElement(x,{...E}),p.createElement(f,{ref:r.canUseRef(f)?l:void 0,...e,removable:!0,onRemove:t=>{v({type:Y.remove,payload:e.dataItem},t.syntheticEvent)},onMouseEnter:t=>{g.dragItem&&(v({type:Y.setDropTarget,payload:e.dataItem},t.syntheticEvent),v({type:Y.setDropZone,payload:u},t.syntheticEvent))},onMouseMove:e=>{if(g.dragItem&&!d&&s.current){const t=s.current.getBoundingClientRect(),r=e.syntheticEvent.clientX-t.left<t.width/2?"before":"after";v({type:Y.setDropDirection,payload:r},e.syntheticEvent)}},style:{pointerEvents:d?"none":void 0},rounded:"full",...h},e.text,"measureAxes"!==u&&p.createElement(y,{field:String(e.value),itemsRender:t=>{const r=t.slice(),n=((e,t,r)=>{if(!e)return;let n,a=0;const o=e.length;let l;for(;a<o;a++)l=e[a].operator,l===r&&e[a].field===t&&(n=e[a]);return n})(g.filter,String(e.dataItem.name),"in");return r.splice(1,0,p.createElement(C,{key:"axis-filter-fields-editor",defaultFilter:n,dataItem:e.dataItem,data:e.dataItem.fields,axes:u,...w})),r},sort:g.sort,onSortChange:(e,t)=>{v({type:Y.setSort,payload:t},e)},filter:I&&I.length?[{logic:"and",filters:I}]:void 0,onFilterChange:(e,t)=>{t.length?v({type:Y.setFilter,payload:[...b||[],...t.reduce((e,t)=>[...e,...t.filters.filter(e=>e.value)],[])]},e):v({type:Y.setFilter,payload:b},e)},filterContent:[c.ColumnMenuTextFilter],...A})),g.dropTarget&&a.compareAxes(g.dropTarget,e.dataItem)&&"after"===g.dropDirection&&p.createElement(x,{...E}))}),ne={chip:l.Chip,columnMenuTextColumn:c.ColumnMenuTextColumn,filterFieldsEditor:ee,dropClue:e=>p.createElement("div",{className:"k-grouping-dropclue",style:{position:"relative",zIndex:1e4},...e})};re.displayName="KendoReactPivotGridAxisEditor";const ae=p.forwardRef((e,t)=>{const{value:n=oe.value,field:a}=e,o=p.useRef(null),l=p.useRef(null),s=p.useRef(null),[i,c]=r.useCustomComponent(e.chipList||oe.chipList);p.useImperativeHandle(l,()=>o.current&&o.current.element),p.useImperativeHandle(s,()=>({props:e,element:l.current})),p.useImperativeHandle(t,()=>s.current);const u=n.filter(e=>1===e.name.length&&e.name.every(e=>-1===e.indexOf("&"))).map(e=>({...e,text:String(e.name)}));return p.createElement(X.Provider,{value:{axes:a}},p.createElement(i,{ref:r.canUseRef(i)?o:void 0,textField:"text",valueField:"name",data:u,chip:re,style:{position:"relative"},className:e.className,selection:"none",...c}))}),oe={value:[],chipList:l.ChipList};ae.displayName="KendoReactPivotGridAxesEditor";const le=p.forwardRef((e,t)=>{const{data:n,rowAxes:a,columnAxes:o,measureAxes:l,onExpand:s,onCheck:i}={...se,...e},c=p.useRef(null),d=p.useRef(null),[m,g]=r.useCustomComponent(e.treeView||se.treeView),[v,f]=r.useCustomComponent(e.noData||se.noData);p.useImperativeHandle(d,()=>({props:e,element:c.current&&c.current.element})),p.useImperativeHandle(t,()=>d.current);const[h]=p.useContext(_),x=H(o),E=H(a),y=H(l),A=q(n).filter(e=>[...x,...E,...y].some(t=>t===e.uniqueName||t===e.defaultHierarchy)),C={caption:e=>e.dataItem.caption,id:e=>e.dataItem.uniqueName,value:e=>e.dataItem.defaultHierarchy||e.dataItem.uniqueName,expanded:e=>h.expanded.some(t=>t.uniqueName===e.dataItem.uniqueName),hasChildren:e=>!("hierarchyUniqueName"in e.dataItem)&&!("aggregator"in e.dataItem),selectable:e=>!(!e.hasChildren&&!e.dataItem.aggregator&&!e.dataItem.measure||2===e.dataItem.type||"[KPIs]"===e.dataItem.uniqueName),children:e=>O(e.dataItem.children,C,e),checked:e=>A.some(t=>e.dataItem.defaultHierarchy?t.defaultHierarchy===e.dataItem.defaultHierarchy:t.uniqueName===e.dataItem.uniqueName)||e.children.length&&e.children.every(e=>e.checked)},w=O(e.data,C);return p.createElement(u.TreeViewItemPropsContext.Provider,{value:e=>({...e,checkboxes:e.item.selectable})},w&&w.length?p.createElement(m,{ref:r.canUseRef(m)?c:void 0,data:w,checkboxes:!0,onExpandChange:e=>{s&&s({value:e.item.dataItem,target:d.current,syntheticEvent:e.syntheticEvent})},onCheckChange:e=>{i&&i({value:e.item.dataItem,target:d.current,syntheticEvent:e.syntheticEvent})},textField:"caption",expandIcons:!0,hasChildrenField:"hasChildren",checkIndeterminateField:"checkIndeterminate",childrenField:"children",...g}):p.createElement(v,{...f}))}),se={data:[],rowAxes:[],columnAxes:[],measureAxes:[],treeView:u.TreeView,noData:()=>p.createElement("div",null,"NO DATA")};le.displayName="KendoReactPivotGridFieldsEditor";const ie=p.forwardRef((e,t)=>{const{onFieldsEditorFieldCheck:a,onFieldsEditorFieldCheckAction:o=ce.onFieldsEditorFieldCheckAction,onFieldsEditorFieldExpand:l,onFieldsEditorFieldExpandAction:c=ce.onFieldsEditorFieldExpandAction,onAxisFilterFieldExpand:u,onAxisFilterFieldsExpandChange:d}=e,m={onFieldsEditorFieldCheck:a,onFieldsEditorFieldCheckAction:o,horizontal:ce.horizontal,axesEditor:ce.axesEditor,...e},[g,v]=r.useCustomComponent(m.fieldsLabel||ce.fieldsLabel),[f,h]=r.useCustomComponent(m.fieldsEditor||ce.fieldsEditor),[x,E]=r.useCustomComponent(m.columnAxesLabel||ce.columnAxesLabel),[y,I]=r.useCustomComponent(m.columnAxesEditor||ce.columnAxesEditor),[k,F]=r.useCustomComponent(m.rowAxesLabel||ce.rowAxesLabel),[S,P]=r.useCustomComponent(m.rowAxesEditor||ce.rowAxesEditor),[T,L]=r.useCustomComponent(m.measureAxesLabel||ce.measureAxesLabel),[D,M]=r.useCustomComponent(m.measureAxesEditor||ce.measureAxesEditor),O=p.useRef(null),q=p.useRef(null),H=n.useLocalization(),[G,K]=Q(m);p.useImperativeHandle(q,()=>({element:O.current,props:m,state:G})),p.useImperativeHandle(t,()=>q.current);const z=()=>{G.dragItem&&K({type:Y.setDropZone,payload:"columnAxes"})},U=()=>{G.dragItem&&K({type:Y.setDropZone,payload:null})},j=()=>{G.dragItem&&K({type:Y.setDropZone,payload:"rowAxes"})},B=()=>{G.dragItem&&K({type:Y.setDropZone,payload:null})},V=()=>{G.dragItem&&K({type:Y.setDropZone,payload:"measureAxes"})},X=()=>{G.dragItem&&K({type:Y.setDropZone,payload:null})},$=m.horizontal?"div":p.Fragment,J=m.horizontal?{className:"k-form-field-wrapper"}:{};return p.createElement(Z.Provider,{value:{onAxisFilterFieldExpand:e=>{const t={target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent};u&&u(t)},onAxisFilterFieldsExpandChange:e=>{const t={target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent};d&&d(t)}}},p.createElement(_.Provider,{value:[G,K]},p.createElement($,{...J},p.createElement("div",{className:"k-form-field"},p.createElement(g,{name:"",component:i.Label,...v},H.toLanguageString(b,R[b]))),p.createElement("div",{className:"k-form-field"},p.createElement("div",{className:"k-fields-list-wrapper"},p.createElement(f,{data:m.data,onExpand:e=>{const t={target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent};if(c){const r=c(t,m,G);r&&(Array.isArray(r)?r.filter(Boolean).map(t=>t&&K({...t},e.syntheticEvent)):K({...r},e.syntheticEvent))}l&&l({target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent})},onCheck:e=>{const t={target:e.target,currentTarget:q.current,value:e.value,syntheticEvent:e.syntheticEvent};if(o){const r=o(t,m,G);r&&(Array.isArray(r)?r.filter(Boolean).map(t=>t&&K({...t},e.syntheticEvent)):K({...r},e.syntheticEvent))}a&&a(t)},columnAxes:G.columnAxes,rowAxes:G.rowAxes,measureAxes:G.measureAxes,...h})))),p.createElement($,{...J},p.createElement("div",{className:"k-form-field",onMouseEnter:z,onMouseLeave:U},p.createElement(s.Field,{name:"columnAxes",field:"columnAxes",component:x,...E},H.toLanguageString(A,R[A]))),m.valueGetter("columnAxes").length?p.createElement(s.Field,{name:"columnAxes",field:"columnAxes",component:y,onMouseEnter:z,onMouseLeave:U,className:"k-column-fields",...I}):p.createElement("div",{className:"k-settings-description",onMouseEnter:z,onMouseLeave:U},H.toLanguageString(N,R[N])),p.createElement("div",{className:"k-form-field",onMouseEnter:j,onMouseLeave:B},p.createElement(s.Field,{name:"rowAxes",field:"rowAxes",component:k,...F},H.toLanguageString(C,R[C]))),m.valueGetter("rowAxes").length?p.createElement(s.Field,{name:"rowAxes",field:"rowAxes",component:S,onMouseEnter:j,onMouseLeave:B,className:"k-column-fields",...P}):p.createElement("div",{className:"k-settings-description",onMouseEnter:j,onMouseLeave:B},H.toLanguageString(N,R[N]))),p.createElement($,{...J},p.createElement("div",{className:"k-form-field",onMouseEnter:V,onMouseLeave:X},p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:T,...L},H.toLanguageString(w,R[w]))),m.valueGetter("measureAxes").length?p.createElement(s.Field,{name:"measureAxes",field:"measureAxes",component:D,onMouseEnter:V,onMouseLeave:X,className:"k-column-fields",...M}):p.createElement("div",{className:"k-settings-description",onMouseEnter:V,onMouseLeave:X},H.toLanguageString(N,R[N])))))}),ce={horizontal:!1,fieldsLabel:i.Label,fieldsEditor:le,columnAxesLabel:i.Label,columnAxesEditor:ae,rowAxesLabel:i.Label,rowAxesEditor:ae,measureAxesLabel:i.Label,measureAxesEditor:ae,axesEditor:ae,onFieldsEditorFieldCheckAction:e=>({type:Y.toggleSelection,payload:e.value}),onFieldsEditorFieldExpandAction:e=>({type:Y.toggleExpansion,payload:e.value})};ie.displayName="KendoReactPivotGridConfiguratorEditor";const ue=p.forwardRef((e,t)=>{const{horizontal:a,data:o,rowAxes:s,columnAxes:i,measureAxes:c}={...de,...e},u=p.useRef(null),d=p.useRef(null),m=p.useRef(null),g=n.useLocalization(),[v,f]=r.useCustomComponent(e.editor||de.editor),[h,A]=r.useCustomComponent(e.form||de.form),[C,w]=r.useCustomComponent(e.formElement||de.formElement);p.useImperativeHandle(d,()=>({props:e,element:u.current})),p.useImperativeHandle(t,()=>d.current);const b={rowAxes:s,columnAxes:i,measureAxes:c,sort:e.sort,filter:e.filter};return p.useEffect(()=>{m.current&&m.current.onChange("rowAxes",{value:s})},[s]),p.useEffect(()=>{m.current&&m.current.onChange("columnAxes",{value:i})},[i]),p.useEffect(()=>{m.current&&m.current.onChange("measureAxes",{value:c})},[c]),p.useEffect(()=>{m.current&&m.current.onChange("sort",{value:e.sort})},[e.sort]),p.useEffect(()=>{m.current&&m.current.onChange("filter",{value:e.filter})},[e.filter]),p.createElement("div",{ref:u,id:e.id,tabIndex:e.tabIndex,style:e.style,className:r.classNames("k-pivotgrid-configurator",e.className)},p.createElement("div",{className:r.classNames("k-pivotgrid-configurator-panel","k-pivotgrid-configurator-push",{"k-pivotgrid-configurator-horizontal":a,"k-pivotgrid-configurator-vertical":!a})},p.createElement("div",{className:"k-pivotgrid-configurator-header"},p.createElement("div",{className:"k-pivotgrid-configurator-header-text"},g.toLanguageString(x,R[x]))),p.createElement(h,{ref:r.canUseRef(h)?m:void 0,initialValues:b,onSubmit:(t,r)=>{e.onRowAxesChange&&e.onRowAxesChange({target:d.current,value:t.rowAxes,syntheticEvent:r}),e.onColumnAxesChange&&e.onColumnAxesChange({target:d.current,value:t.columnAxes,syntheticEvent:r}),e.onMeasureAxesChange&&e.onMeasureAxesChange({target:d.current,value:t.measureAxes,syntheticEvent:r}),e.onSortChange&&e.onSortChange({target:d.current,value:t.sort,syntheticEvent:r}),e.onFilterChange&&e.onFilterChange({target:d.current,value:t.filter,syntheticEvent:r})},render:t=>p.createElement(p.Fragment,null,p.createElement("div",{className:"k-pivotgrid-configurator-content"},p.createElement(C,{horizontal:a,...w},p.createElement(v,{...t,horizontal:e.horizontal,onFieldsEditorFieldExpand:e.onFieldsEditorFieldExpand,onFieldsEditorFieldCheck:e.onFieldsEditorFieldCheck,onAxisFilterFieldExpand:e.onAxisFilterFieldExpand,onAxisFilterFieldsExpandChange:e.onAxisFilterFieldsExpandChange,data:o,...f}))),p.createElement("div",{className:"k-pivotgrid-configurator-actions k-actions k-hstack k-justify-content-end"},p.createElement(l.Button,{type:"submit",onClick:t.onFormReset},g.toLanguageString(E,R[E])),p.createElement(l.Button,{themeColor:"primary",type:"submit",onClick:t.onSubmit},g.toLanguageString(y,R[y])))),...A})))}),de={form:s.Form,formElement:s.FormElement,editor:ie,horizontal:!1,data:[],columnAxes:[],rowAxes:[],measureAxes:[]};ue.displayName="KendoReactPivotGridConfigurator";const me=p.forwardRef((e,t)=>{const a=p.useRef(null),l=p.useRef(null),s=n.useLocalization();p.useImperativeHandle(a,()=>({props:e,element:l.current})),p.useImperativeHandle(t,()=>a.current);const[i,c]=r.useCustomComponent(e.icon||pe.icon),u=p.useMemo(()=>r.classNames("k-pivotgrid-configurator-button",e.className),[e.className]),d=r.useMouse(e,a);return p.createElement("div",{ref:l,id:e.id,className:u,tabIndex:e.tabIndex,...d},p.createElement("span",null,s.toLanguageString(k,R[k]),p.createElement(i,{name:"gear",icon:o.gearIcon,...c})))}),pe={icon:r.IconWrap};me.displayName="KendoReactPivotGridConfiguratorButton";const ge=e=>{const[t,n]=p.useState(!0),[o,l]=p.useState({data:[],columns:[],rows:[]}),[s,i]=p.useState([]),[c,u]=p.useState(e.defaultColumnAxes||[]),[d,m]=p.useState(e.defaultRowAxes||[]),[g,v]=p.useState(e.defaultMeasureAxes||[]),[f,h]=p.useState(e.defaultSort||[]),[x,E]=p.useState(e.defaultFilter||[]),y=e=>{m(e.value)},A=e=>{u(e.value)};p.useEffect(()=>{n(!0);const t={connection:{catalog:e.catalog,cube:e.cube},columnAxes:c.slice(),rowAxes:d.slice(),measureAxes:g,sort:f,filter:x};setTimeout(()=>{a.fetchData({url:e.url},r.clone(t)).then(a.createDataState).then(e=>{l(e),n(!1)})})},[c,d,g,x,f,e.cube,e.catalog,e.url]),p.useEffect(()=>{n(!0);const t={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube},command:"schemaDimensions"};a.fetchDiscover({url:e.url},t).then(e=>{a.addKPI(e),i(e),n(!1)})},[e.catalog,e.cube,e.url]);const C=(e=[],t)=>{for(let r=0;r<e.length;r++){const n=e[r];if(String(n.name)===String(t.name))return n}return null},w=(e=[],t)=>{for(let r=0;r<e.length;r++){const n=e[r];if(n.uniqueName===t.uniqueName)return n;const a=w(n.children,t);if(null!==a)return a}return null};return{pivotProps:{rowAxes:d,columnAxes:c,data:o.data,rows:o.rows,columns:o.columns,onRowAxesChange:y,onColumnAxesChange:A},configuratorProps:{sort:f,onSortChange:e=>{h(e.value)},filter:x,onFilterChange:e=>{E(e.value)},data:s,rowAxes:d,columnAxes:c,measureAxes:g,onRowAxesChange:y,onColumnAxesChange:A,onMeasureAxesChange:e=>{v(e.value)},onFieldsEditorFieldExpand:async t=>{const r=s.slice(),n=w(r,t.value);if(n&&"[KPIs]"===n.uniqueName){const t=ve(await(async()=>{const t={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube},command:"schemaKPIs"};return a.fetchDiscover({url:e.url},t)})());n.children=t}else if(n&&"kpi"===n.type)n.children=a.buildKPIMeasures(n);else if(n&&!n.children){const t=await(async t=>{let r,n,o;2===t.type?r="schemaMeasures":t.dimensionUniqueName?(r="schemaLevels",o=t.uniqueName):(r="schemaHierarchies",n=t.uniqueName);const l={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:o,dimensionUniqueName:n,levelUniqueName:void 0,memberUniqueName:void 0,treeOp:void 0},command:r};return a.fetchDiscover({url:e.url},l)})(n);n.children=t}i(r)},onAxisFilterFieldExpand:async t=>{if(!t)return;const r={rowAxes:[d,m],columnAxes:[c,u],measureAxes:[g,v]},[n,o]=r[t.target.props.axes],l=n.slice(),s=C(l,t.target.props.dataItem);if(s){const r=(s.fields||[]).slice(),n=w(r,t.value);if(n&&(!n.children||!n.children.length)){const t=await(async t=>{let r,n,o;t.uniqueName&&(r="schemaMembers",n=t.uniqueName.replace(/\&/g,"&"),o=1);const l={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:void 0,dimensionUniqueName:void 0,levelUniqueName:void 0,memberUniqueName:n,treeOp:o},command:r};return a.fetchDiscover({url:e.url},l)})(n);n.children=t,s.fields=r,o(l)}}},onAxisFilterFieldsExpandChange:async t=>{if(!t)return;const r={rowAxes:[d,m],columnAxes:[c,u],measureAxes:[g,v]},[n,o]=r[t.target.props.axes],l=n.slice(),s=C(l,t.target.props.dataItem);if(s&&!s.fields){const t=await(async t=>{let r,n;t.name&&(r="schemaMembers",n=`${String(t.name)}.[(ALL)]`);const o={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:void 0,dimensionUniqueName:void 0,levelUniqueName:n,memberUniqueName:void 0,treeOp:void 0},command:r};return a.fetchDiscover({url:e.url},o)})(s);s.fields=t,o(l)}}},state:{loading:t}}},ve=e=>{for(let t=0,r=e.length;t<r;t++)e[t].uniqueName=e[t].name,e[t].type="kpi";return e},fe={dataField:"aggregate",columnsData:"columns"},he="&",xe=e=>{const[t,r]=p.useState(!0),[n,o]=p.useState(e.defaultColumnAxes||[]),[l,s]=p.useState(e.defaultRowAxes||[]),[i,c]=p.useState(e.defaultMeasureAxes||[]),[u,d]=p.useState(e.defaultSort||[]),[m,g]=p.useState(e.defaultFilter||[]),[v,f]=p.useState({data:[],rows:[],columns:[]}),h=p.useCallback(e=>{s(e.value)},[]),x=p.useCallback(e=>{o(e.value)},[]),E=p.useMemo(()=>Array.from(a.rootFields(n).keys()).join(he),[n]),y=p.useMemo(()=>Array.from(a.rootFields(l).keys()).join(he),[l]),A=p.useCallback(t=>({key:t,...e.dimensions[t]}),[e.dimensions]),C=p.useMemo(()=>E?E.split(he).map(A):[],[E,A]),w=p.useMemo(()=>y?y.split(he).map(A):[],[y,A]),b=p.useMemo(()=>i.map(t=>e.measures.find(e=>String(e.name)===String(t.name))).filter(Boolean),[i,e.measures]);p.useEffect(()=>{r(!0),setTimeout(()=>{const t=new Map(a.createDataTree(e.data,w,C,b,fe,m));f(a.createLocalDataState({dataTree:t,rowSettings:w,columnSettings:C,rowAxes:l,columnAxes:n,measures:b,sort:u,fields:fe})),r(!1)},0)},[e.data,w,C,b,m,l,n,u]);const I=p.useMemo(()=>a.createFlatSchemaDimensions(e.dimensions,e.measures),[e.dimensions,e.measures]);return{pivotProps:{rowAxes:l,columnAxes:n,data:v.data,rows:v.rows,columns:v.columns,onRowAxesChange:h,onColumnAxesChange:x},configuratorProps:{sort:u,onSortChange:e=>{d(e.value)},filter:m,onFilterChange:e=>{g(e.value)},data:I,rowAxes:l,columnAxes:n,measureAxes:i,onRowAxesChange:h,onColumnAxesChange:x,onMeasureAxesChange:e=>{c(e.value)}},state:{loading:t}}};Object.defineProperty(e,"AggregateType",{enumerable:!0,get:function(){return a.AggregateType}}),Object.defineProperty(e,"averageAggregate",{enumerable:!0,get:function(){return a.averageAggregate}}),Object.defineProperty(e,"createAggregate",{enumerable:!0,get:function(){return a.createAggregate}}),Object.defineProperty(e,"maxAggregate",{enumerable:!0,get:function(){return a.maxAggregate}}),Object.defineProperty(e,"minAggregate",{enumerable:!0,get:function(){return a.minAggregate}}),Object.defineProperty(e,"sumAggregate",{enumerable:!0,get:function(){return a.sumAggregate}}),e.PivotGrid=U,e.PivotGridAxesEditor=ae,e.PivotGridAxisEditor=re,e.PivotGridAxisFilterFieldsEditor=ee,e.PivotGridCell=S,e.PivotGridColumn=D,e.PivotGridConfigurator=ue,e.PivotGridConfiguratorButton=me,e.PivotGridConfiguratorEditor=ie,e.PivotGridContainer=B,e.PivotGridFieldsEditor=le,e.PivotGridHeaderCell=T,e.PivotGridRow=F,e.PivotLocalDataService=e=>{const t=xe(e);return e.children(t)},e.PivotOLAPService=e=>{const t=ge(e);return e.children(t)},e.dataCells=(e,t,r)=>{const n=JSON.parse(JSON.stringify(e||[])),o=JSON.parse(JSON.stringify(t||[])),l=JSON.parse(JSON.stringify(r||[])),s=a.toTree(n),[,i,c]=a.toRows(s),u=a.toTree(o),[,d,,m]=a.toColumns(u);return a.toData(l,d,i,m,c)},e.usePivotLocalDataService=xe,e.usePivotOLAPService=ge});
|
package/hooks/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
export * from './useExpansion.js';
|
|
9
|
+
export * from './usePivotConfiguratorEditor.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export declare enum EXPANSION_ACTION {
|
|
12
|
+
toggle = "EXPAND_TOGGLE",
|
|
13
|
+
expand = "EXPAND_EXPAND",
|
|
14
|
+
collapse = "EXPAND_COLLAPSE"
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @hidden
|
|
18
|
+
*/
|
|
19
|
+
export type ExpansionAction = {
|
|
20
|
+
type: EXPANSION_ACTION;
|
|
21
|
+
payload: any;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
export declare const useExpansion: (defaultValue: never[] | undefined, callback: any, target: any, compare?: (a: any, b: any) => boolean) => any[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { HeadersAction, PivotGridAxis, AxisDataItem } from '@progress/kendo-pivotgrid-common';
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
export { HEADERS_ACTION } from '@progress/kendo-pivotgrid-common';
|
|
11
|
+
/**
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
14
|
+
export declare const useHeaders: (prop: PivotGridAxis[], tree: AxisDataItem, onChange?: ((value: PivotGridAxis[], event: React.SyntheticEvent) => void) | undefined) => [PivotGridAxis[], (action: Omit<HeadersAction, 'tree'>, event: React.SyntheticEvent) => void];
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*/
|
|
18
|
+
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export declare const useHorizontalScrollSync: (...elements: React.RefObject<HTMLElement | null>[]) => (event: React.SyntheticEvent) => void;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { PivotGridConfiguratorEditorProps } from '../components/ConfiguratorEditor.js';
|
|
9
|
+
import { PivotGridConfiguratorState as CommonConfiguratorState, PivotGridField, PIVOT_CONFIGURATOR_ACTION as COMMON_CONFIGURATOR_ACTION } from '@progress/kendo-pivotgrid-common';
|
|
10
|
+
import * as React from 'react';
|
|
11
|
+
/**
|
|
12
|
+
* @hidden
|
|
13
|
+
*/
|
|
14
|
+
export interface PivotGridConfiguratorEditorState extends CommonConfiguratorState {
|
|
15
|
+
expanded: PivotGridField[];
|
|
16
|
+
}
|
|
17
|
+
declare enum EXTENDED_CONFIGURATOR_ACTION {
|
|
18
|
+
toggleExpansion = "PIVOT_CONFIGURATOR_ACTION_TOGGLE_EXPANSION"
|
|
19
|
+
}
|
|
20
|
+
type PIVOT_CONFIGURATOR_ACTION_TYPE = COMMON_CONFIGURATOR_ACTION | EXTENDED_CONFIGURATOR_ACTION;
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
export declare const PIVOT_CONFIGURATOR_ACTION: {
|
|
25
|
+
toggleExpansion: EXTENDED_CONFIGURATOR_ACTION.toggleExpansion;
|
|
26
|
+
toggleSelection: COMMON_CONFIGURATOR_ACTION.toggleSelection;
|
|
27
|
+
addColumnAxis: COMMON_CONFIGURATOR_ACTION.addColumnAxis;
|
|
28
|
+
addColumnAxes: COMMON_CONFIGURATOR_ACTION.addColumnAxes;
|
|
29
|
+
removeColumnAxis: COMMON_CONFIGURATOR_ACTION.removeColumnAxis;
|
|
30
|
+
removeColumnAxes: COMMON_CONFIGURATOR_ACTION.removeColumnAxes;
|
|
31
|
+
addRowAxis: COMMON_CONFIGURATOR_ACTION.addRowAxis;
|
|
32
|
+
addRowAxes: COMMON_CONFIGURATOR_ACTION.addRowAxes;
|
|
33
|
+
removeRowAxis: COMMON_CONFIGURATOR_ACTION.removeRowAxis;
|
|
34
|
+
removeRowAxes: COMMON_CONFIGURATOR_ACTION.removeRowAxes;
|
|
35
|
+
addMeasureAxis: COMMON_CONFIGURATOR_ACTION.addMeasureAxis;
|
|
36
|
+
addMeasureAxes: COMMON_CONFIGURATOR_ACTION.addMeasureAxes;
|
|
37
|
+
removeMeasureAxis: COMMON_CONFIGURATOR_ACTION.removeMeasureAxis;
|
|
38
|
+
removeMeasureAxes: COMMON_CONFIGURATOR_ACTION.removeMeasureAxes;
|
|
39
|
+
remove: COMMON_CONFIGURATOR_ACTION.remove;
|
|
40
|
+
setSort: COMMON_CONFIGURATOR_ACTION.setSort;
|
|
41
|
+
setFilter: COMMON_CONFIGURATOR_ACTION.setFilter;
|
|
42
|
+
addFilter: COMMON_CONFIGURATOR_ACTION.addFilter;
|
|
43
|
+
changeFilter: COMMON_CONFIGURATOR_ACTION.changeFilter;
|
|
44
|
+
removeFilter: COMMON_CONFIGURATOR_ACTION.removeFilter;
|
|
45
|
+
setDragItem: COMMON_CONFIGURATOR_ACTION.setDragItem;
|
|
46
|
+
drop: COMMON_CONFIGURATOR_ACTION.drop;
|
|
47
|
+
setDropZone: COMMON_CONFIGURATOR_ACTION.setDropZone;
|
|
48
|
+
setDropTarget: COMMON_CONFIGURATOR_ACTION.setDropTarget;
|
|
49
|
+
setDropDirection: COMMON_CONFIGURATOR_ACTION.setDropDirection;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* @hidden
|
|
53
|
+
*/
|
|
54
|
+
export interface PivotGridConfiguratorExpandAction {
|
|
55
|
+
type: PIVOT_CONFIGURATOR_ACTION_TYPE;
|
|
56
|
+
payload: any;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Represents the available PivotGridConfigurator actions.
|
|
60
|
+
*
|
|
61
|
+
* Can be one of:
|
|
62
|
+
* - [PivotGridConfiguratorSelectionAction](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotgridconfigurator)
|
|
63
|
+
* - [PivotGridConfiguratorMultipleSelectionAction](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotgridconfigurator)
|
|
64
|
+
* - [PivotGridConfiguratorRemoveAction](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotgridconfigurator)
|
|
65
|
+
* - [PivotGridConfiguratorSortAction](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotgridconfigurator)
|
|
66
|
+
* - [PivotGridConfiguratorFilterAction](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotgridconfigurator)
|
|
67
|
+
* - [PivotConfiguratorDragAction](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotgridconfigurator)
|
|
68
|
+
* - [PivotConfiguratorDropAction](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotgridconfigurator)
|
|
69
|
+
* - [PivotGridConfiguratorDropZoneAction](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotgridconfigurator)
|
|
70
|
+
* - [PivotGridConfiguratorDropTargetAction](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotgridconfigurator)
|
|
71
|
+
* - [PivotGridConfiguratorDropDirectionAction](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotgridconfigurator)
|
|
72
|
+
* - [PivotGridConfiguratorExpandAction](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotgridconfigurator)
|
|
73
|
+
*
|
|
74
|
+
* The following `falsy` values will be ignored:
|
|
75
|
+
* - `null`
|
|
76
|
+
* - `false`
|
|
77
|
+
* - `undefined`
|
|
78
|
+
*
|
|
79
|
+
* @hidden
|
|
80
|
+
*/
|
|
81
|
+
export interface PivotGridConfiguratorAction {
|
|
82
|
+
type: PIVOT_CONFIGURATOR_ACTION_TYPE;
|
|
83
|
+
payload: any;
|
|
84
|
+
override?: PivotGridConfiguratorEditorState;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* @hidden
|
|
88
|
+
*/
|
|
89
|
+
export declare const usePivotConfiguratorEditor: (props: PivotGridConfiguratorEditorProps, target: any) => [PivotGridConfiguratorEditorState, (action: PivotGridConfiguratorAction, syntheticEvent?: React.SyntheticEvent) => void];
|
|
90
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { PivotGridAxis, Measure, Dimension } from '@progress/kendo-pivotgrid-common';
|
|
9
|
+
import { SortDescriptor, FilterDescriptor } from '@progress/kendo-data-query';
|
|
10
|
+
import { PivotGridProps } from '../PivotGrid.js';
|
|
11
|
+
import { PivotGridConfiguratorProps } from '../components/Configurator.js';
|
|
12
|
+
/**
|
|
13
|
+
* Represents the arguments of the [usePivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/usepivotlocaldataservice) hook.
|
|
14
|
+
*/
|
|
15
|
+
export interface PivotLocalDataServiceArgs {
|
|
16
|
+
/**
|
|
17
|
+
* Represents the dimensions object of the [usePivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/usepivotlocaldataservice) hook and the [PivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotlocaldataservice) component.
|
|
18
|
+
*/
|
|
19
|
+
dimensions: {
|
|
20
|
+
[key: string]: Dimension;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Represents the measures collection of the [usePivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/usepivotlocaldataservice) hook and the [PivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotlocaldataservice) component.
|
|
24
|
+
*/
|
|
25
|
+
measures: Measure[];
|
|
26
|
+
/**
|
|
27
|
+
* Represents the local data of the [usePivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/usepivotlocaldataservice) hook and the [PivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotlocaldataservice) component.
|
|
28
|
+
*/
|
|
29
|
+
data: any[];
|
|
30
|
+
/**
|
|
31
|
+
* Represents the default column axes configuration of the [usePivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/usepivotlocaldataservice) hook and the [PivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotlocaldataservice) component.
|
|
32
|
+
*/
|
|
33
|
+
defaultColumnAxes: PivotGridAxis[];
|
|
34
|
+
/**
|
|
35
|
+
* Represents the default row axes configuration of the [usePivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/usepivotlocaldataservice) hook and the [PivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotlocaldataservice) component.
|
|
36
|
+
*/
|
|
37
|
+
defaultRowAxes: PivotGridAxis[];
|
|
38
|
+
/**
|
|
39
|
+
* Represents the default measure axes configuration of the [usePivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/usepivotlocaldataservice) hook and the [PivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotlocaldataservice) component.
|
|
40
|
+
*/
|
|
41
|
+
defaultMeasureAxes: PivotGridAxis[];
|
|
42
|
+
/**
|
|
43
|
+
* Represents the default sort descriptors of the [usePivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/usepivotlocaldataservice) hook and the [PivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotlocaldataservice) component.
|
|
44
|
+
*/
|
|
45
|
+
defaultSort: SortDescriptor[];
|
|
46
|
+
/**
|
|
47
|
+
* Represents the default filter descriptors of the [usePivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/usepivotlocaldataservice) hook and the [PivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotlocaldataservice) component.
|
|
48
|
+
*/
|
|
49
|
+
defaultFilter: FilterDescriptor[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Represents the `state` of the [usePivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/usepivotlocaldataservice) hook and the [PivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotlocaldataservice) component.
|
|
53
|
+
*/
|
|
54
|
+
export interface PivotLocalDataServiceState {
|
|
55
|
+
/**
|
|
56
|
+
* Represents the `PivotGrid` component props.
|
|
57
|
+
*/
|
|
58
|
+
pivotProps: PivotGridProps;
|
|
59
|
+
/**
|
|
60
|
+
* Represents the `PivotGridConfigurator` component props.
|
|
61
|
+
*/
|
|
62
|
+
configuratorProps: PivotGridConfiguratorProps;
|
|
63
|
+
/**
|
|
64
|
+
* Represents an object containing additional state data.
|
|
65
|
+
*/
|
|
66
|
+
state: {
|
|
67
|
+
loading: boolean;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A [custom React hook](https://https://react.dev/learn/reusing-logic-with-custom-hooks) which provides data-binding to local data.
|
|
72
|
+
*/
|
|
73
|
+
export declare const usePivotLocalDataService: (args: PivotLocalDataServiceArgs) => PivotLocalDataServiceState;
|
|
74
|
+
/**
|
|
75
|
+
* Represents the properties of the [PivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotlocaldataservice) component.
|
|
76
|
+
*/
|
|
77
|
+
export interface PivotLocalDataServiceProps extends PivotLocalDataServiceArgs {
|
|
78
|
+
/**
|
|
79
|
+
* Represents the children prop of the [PivotLocalDataService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotlocaldataservice) component.
|
|
80
|
+
*/
|
|
81
|
+
children: (args: PivotLocalDataServiceState) => any;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* A [React higher-order component](https://reactjs.org/docs/higher-order-components.html) which provides data-binding to local data.
|
|
85
|
+
*/
|
|
86
|
+
export declare const PivotLocalDataService: (props: PivotLocalDataServiceProps) => any;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { PivotGridAxis } from '@progress/kendo-pivotgrid-common';
|
|
9
|
+
import { SortDescriptor, FilterDescriptor } from '@progress/kendo-data-query';
|
|
10
|
+
import { PivotGridProps } from '../PivotGrid.js';
|
|
11
|
+
import { PivotGridConfiguratorProps } from '../components/Configurator.js';
|
|
12
|
+
/**
|
|
13
|
+
* Represents the arguments of the [usePivotOLAPService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/usepivotolapservice) hook.
|
|
14
|
+
*/
|
|
15
|
+
export interface PivotOLAPServiceArgs {
|
|
16
|
+
/**
|
|
17
|
+
* The URL of the OLAP service endpoint.
|
|
18
|
+
*/
|
|
19
|
+
url: string;
|
|
20
|
+
/**
|
|
21
|
+
* The name of the cube to connect to.
|
|
22
|
+
*/
|
|
23
|
+
cube: string;
|
|
24
|
+
/**
|
|
25
|
+
* The name of the catalog containing the cube.
|
|
26
|
+
*/
|
|
27
|
+
catalog: string;
|
|
28
|
+
/**
|
|
29
|
+
* The default configuration of the column axes.
|
|
30
|
+
*/
|
|
31
|
+
defaultColumnAxes?: PivotGridAxis[];
|
|
32
|
+
/**
|
|
33
|
+
* The default configuration of the row axes.
|
|
34
|
+
*/
|
|
35
|
+
defaultRowAxes?: PivotGridAxis[];
|
|
36
|
+
/**
|
|
37
|
+
* The default configuration of the measure axes.
|
|
38
|
+
*/
|
|
39
|
+
defaultMeasureAxes?: PivotGridAxis[];
|
|
40
|
+
/**
|
|
41
|
+
* The default sort descriptors.
|
|
42
|
+
*/
|
|
43
|
+
defaultSort?: SortDescriptor[];
|
|
44
|
+
/**
|
|
45
|
+
* The default filter descriptors.
|
|
46
|
+
*/
|
|
47
|
+
defaultFilter?: FilterDescriptor[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Represents the `state` of the [usePivotOLAPService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/usepivotolapservice) hook and the [PivotOLAPService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotolapservice) component.
|
|
51
|
+
*/
|
|
52
|
+
export interface PivotOLAPServiceState {
|
|
53
|
+
/**
|
|
54
|
+
* Properties to pass to the `PivotGrid` component.
|
|
55
|
+
*/
|
|
56
|
+
pivotProps: PivotGridProps;
|
|
57
|
+
/**
|
|
58
|
+
* Properties to pass to the `PivotGridConfigurator` component.
|
|
59
|
+
*/
|
|
60
|
+
configuratorProps: PivotGridConfiguratorProps;
|
|
61
|
+
/**
|
|
62
|
+
* The loading state and other status information.
|
|
63
|
+
*/
|
|
64
|
+
state: {
|
|
65
|
+
loading: boolean;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A [custom React hook](https://https://react.dev/learn/reusing-logic-with-custom-hooks) which provides data-binding to an OLAP service.
|
|
70
|
+
*/
|
|
71
|
+
export declare const usePivotOLAPService: (args: PivotOLAPServiceArgs) => PivotOLAPServiceState;
|
|
72
|
+
/**
|
|
73
|
+
* Represents the properties of the [PivotOLAPService](https://www.telerik.com/kendo-react-ui/components/pivotgrid/api/pivotolapservice) component.
|
|
74
|
+
*/
|
|
75
|
+
export interface PivotOLAPServiceProps extends PivotOLAPServiceArgs {
|
|
76
|
+
/**
|
|
77
|
+
* A render prop function that receives the service state and returns JSX elements.
|
|
78
|
+
*/
|
|
79
|
+
children: (args: PivotOLAPServiceState) => any;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* A [React higher-order component](https://reactjs.org/docs/higher-order-components.html) which provides data-binding to an OLAP service.
|
|
83
|
+
*/
|
|
84
|
+
export declare const PivotOLAPService: (props: PivotOLAPServiceProps) => any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export declare const useVerticalScrollSync: (...elements: React.RefObject<HTMLElement | null>[]) => (event: React.SyntheticEvent) => void;
|