@progress/kendo-react-pivotgrid 7.2.4-develop.2 → 7.2.4-develop.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PivotGrid.js +8 -0
- package/PivotGrid.mjs +252 -0
- package/components/AxesEditor.js +8 -0
- package/components/AxesEditor.mjs +43 -0
- package/components/AxisEditor.js +8 -0
- package/components/AxisEditor.mjs +108 -0
- package/components/AxisFilterFieldsEditor.js +8 -0
- package/components/AxisFilterFieldsEditor.mjs +159 -0
- package/components/Cell.js +8 -0
- package/components/Cell.mjs +45 -0
- package/components/Column.js +8 -0
- package/components/Column.mjs +40 -0
- package/components/Configurator.js +8 -0
- package/components/Configurator.mjs +134 -0
- package/components/ConfiguratorButton.js +8 -0
- package/components/ConfiguratorButton.mjs +42 -0
- package/components/ConfiguratorEditor.js +8 -0
- package/components/ConfiguratorEditor.mjs +240 -0
- package/components/Container.js +8 -0
- package/components/Container.mjs +40 -0
- package/components/EditorContext.js +8 -0
- package/components/EditorContext.mjs +13 -0
- package/components/FieldsEditor.js +8 -0
- package/components/FieldsEditor.mjs +78 -0
- package/components/HeaderCell.js +8 -0
- package/components/HeaderCell.mjs +69 -0
- package/components/Row.js +8 -0
- package/components/Row.mjs +42 -0
- package/dist/cdn/js/kendo-react-pivotgrid.js +8 -5
- package/hooks/useExpansion.js +8 -0
- package/hooks/useExpansion.mjs +46 -0
- package/hooks/useHeaders.js +8 -0
- package/hooks/useHeaders.mjs +18 -0
- package/hooks/useHorizontalScrollSync.js +8 -0
- package/hooks/useHorizontalScrollSync.mjs +25 -0
- package/hooks/usePivotConfiguratorEditor.js +8 -0
- package/hooks/usePivotConfiguratorEditor.mjs +67 -0
- package/hooks/usePivotLocalDataService.js +8 -0
- package/hooks/usePivotLocalDataService.mjs +94 -0
- package/hooks/usePivotOLAPService.js +8 -0
- package/hooks/usePivotOLAPService.mjs +230 -0
- package/hooks/useVerticalScrollSync.js +8 -0
- package/hooks/useVerticalScrollSync.mjs +25 -0
- package/index.d.mts +1342 -5
- package/index.d.ts +1342 -22
- package/index.js +8 -5
- package/index.mjs +46 -1583
- package/messages/index.js +8 -0
- package/messages/index.mjs +39 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +9 -9
- package/shared/PivotGridConfiguratorEditorEventsContext.js +8 -0
- package/shared/PivotGridConfiguratorEditorEventsContext.mjs +13 -0
- package/shared/PivotGridConfiguratorEditorStateContext.js +8 -0
- package/shared/PivotGridConfiguratorEditorStateContext.mjs +28 -0
- package/utils/index.js +8 -0
- package/utils/index.mjs +59 -0
- package/PivotGrid.d.ts +0 -181
- package/components/AxesEditor.d.ts +0 -44
- package/components/AxisEditor.d.ts +0 -56
- package/components/AxisFilterFieldsEditor.d.ts +0 -118
- package/components/Cell.d.ts +0 -69
- package/components/Column.d.ts +0 -46
- package/components/Configurator.d.ts +0 -129
- package/components/ConfiguratorButton.d.ts +0 -44
- package/components/ConfiguratorEditor.d.ts +0 -130
- package/components/Container.d.ts +0 -50
- package/components/EditorContext.d.ts +0 -11
- package/components/FieldsEditor.d.ts +0 -78
- package/components/HeaderCell.d.ts +0 -100
- package/components/Row.d.ts +0 -54
- package/hooks/index.d.ts +0 -6
- package/hooks/useExpansion.d.ts +0 -23
- package/hooks/useHeaders.d.ts +0 -16
- package/hooks/useHorizontalScrollSync.d.ts +0 -9
- package/hooks/usePivotConfiguratorEditor.d.ts +0 -87
- package/hooks/usePivotLocalDataService.d.ts +0 -83
- package/hooks/usePivotOLAPService.d.ts +0 -45
- package/hooks/useVerticalScrollSync.d.ts +0 -9
- package/messages/index.d.ts +0 -74
- package/models/index.d.ts +0 -48
- package/package-metadata.d.ts +0 -9
- package/shared/PivotGridConfiguratorEditorEventsContext.d.ts +0 -17
- package/shared/PivotGridConfiguratorEditorStateContext.d.ts +0 -10
- package/shared/index.d.ts +0 -6
- package/utils/index.d.ts +0 -51
package/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const bt=require("react"),c=require("@progress/kendo-react-common"),he=require("@progress/kendo-react-intl"),b=require("@progress/kendo-pivotgrid-common"),pe=require("@progress/kendo-svg-icons"),ue=require("@progress/kendo-react-buttons"),ne=require("@progress/kendo-react-form"),me=require("@progress/kendo-react-labels"),Ae=require("@progress/kendo-react-data-tools"),Ve=require("@progress/kendo-react-treeview"),Ft=require("@progress/kendo-react-indicators");function Pt(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(o,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return o.default=e,Object.freeze(o)}const t=Pt(bt),Rt={name:"@progress/kendo-react-pivotgrid",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},Me="pivotgrid.emptyCellAriaLabel",Le="pivotgrid.fieldMenuReset",Te="pivotgrid.fieldMenuApply",De="pivotgrid.configuratorTitle",He="pivotgrid.configuratorCancel",Ge="pivotgrid.configuratorApply",Oe="pivotgrid.configuratorColumnsTitle",qe="pivotgrid.configuratorRowsTitle",Be="pivotgrid.configuratorMeasuresTitle",ze="pivotgrid.configuratorEditorSearchTitle",It="pivotgrid.configuratorEditorSearchPlaceholder",ae="pivotgrid.configuratorMissingFields",Ke="pivotgrid.configuratorButtonLabel",Z={[Me]:"PivotGrid component. Use the arrow keys to navigate.",[Le]:"Reset",[Te]:"Apply",[He]:"Cancel",[Ge]:"Apply",[De]:"Settings",[ze]:"Fields",[It]:"Search...",[Oe]:"Columns",[qe]:"Rows",[Be]:"Values",[Ke]:"Change settings",[ae]:"Select some fields to begin setup"},$e=t.forwardRef((e,o)=>{const n=t.useRef(null),a=t.useRef(null);t.useImperativeHandle(n,()=>({element:a.current,props:e})),t.useImperativeHandle(o,()=>n.current);const l=c.useMouse(e,n);return t.createElement("tr",{ref:a,...l,id:e.id,style:e.style,tabIndex:e.tabIndex,children:e.children,role:e.role,"aria-owns":e.ariaOwns,className:c.classNames("k-pivotgrid-row",e.className)})});$e.displayName="KendoReactPivotGridRow";const je=t.forwardRef((e,o)=>{const n=t.useRef(null),a=t.useRef(null);t.useImperativeHandle(n,()=>({element:a.current,props:e})),t.useImperativeHandle(o,()=>n.current);const l=c.useMouse(e,n);return t.createElement("td",{ref:a,...l,id:e.id,style:e.style,tabIndex:e.tabIndex,role:e.role,"aria-describedby":e.ariaDescribedby,className:c.classNames("k-pivotgrid-cell",{"k-pivotgrid-header-total":e.total},e.className)},e.children)});je.displayName="KendoReactPivotGridCell";const tt=(e,o,n)=>[e,(l,s)=>{const m=b.headersReducer(e,{...l,tree:o});n&&n(m,s)}],we=t.forwardRef((e,o)=>{const n=t.useRef(null),a=t.useRef(null);t.useImperativeHandle(n,()=>({element:a.current,props:e})),t.useImperativeHandle(o,()=>n.current);const[l,s]=c.useCustomComponent(e.icon||at.icon),m=c.useMouse(e,n),i=p=>{e.onIconClick&&e.onIconClick.call(void 0,{syntheticEvent:p.syntheticEvent,target:n.current})};return t.createElement("th",{ref:a,...m,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:c.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&&t.createElement(l,{...s,onClick:i,name:`chevron-${e.expanded?"up":"down"}`,"aria-hidden":!0,icon:e.expanded?pe.chevronUpIcon:pe.chevronDownIcon}),e.children)}),at={icon:c.IconWrap};we.defaultProps=at;we.displayName="KendoReactPivotGridHeaderCell";const St=(...e)=>{const o=t.useRef();return a=>{o.current!==void 0&&window.cancelAnimationFrame(o.current);const l=a.currentTarget,s=l.scrollLeft;e.forEach(m=>{const i=m.current;i&&i!==l&&(o.current=window.requestAnimationFrame(()=>{i.scrollLeft=Math.round(s)}))})}},Nt=(...e)=>{const o=t.useRef();return a=>{o.current!==void 0&&window.cancelAnimationFrame(o.current);const l=a.currentTarget,s=l.scrollTop;e.forEach(m=>{const i=m.current;i&&i!==l&&(o.current=window.requestAnimationFrame(()=>{i.scrollTop=Math.round(s)}))})}},be=t.forwardRef((e,o)=>{const n=t.useRef(null),a=t.useRef(null);t.useImperativeHandle(n,()=>({element:a.current,props:e})),t.useImperativeHandle(o,()=>n.current);const l=c.useMouse(e,n);return t.createElement("col",{ref:a,...l,id:e.id,style:e.style,tabIndex:e.tabIndex,children:e.children,className:e.className})}),kt={path:[]};be.defaultProps=kt;be.displayName="KendoReactPivotGridColumn";const Mt=(e,o,n)=>{const a=JSON.parse(JSON.stringify(e||[])),l=JSON.parse(JSON.stringify(o||[])),s=JSON.parse(JSON.stringify(n||[])),m=b.toTree(a),[,i,p]=b.toRows(m),f=b.toTree(l),[,v,,w]=b.toColumns(f);return b.toData(s,v,i,w,p)},ye=(e=[],o={},n=null)=>e.map(a=>{const l={dataItem:a};return Object.keys(o).forEach(s=>{l[s]=o[s](l,n)}),l}),_e=(e=[])=>{let o=[...e];return(e||[]).forEach(n=>{o=o.concat(_e(n.children))}),o},ke=(e=[])=>{const o=new Set;return e.forEach(n=>{o.add(String(n.name))}),Array.from(o)},re=(e=[])=>`${e.join(",")}`,Lt=(e,o)=>`${re(e.map(n=>n.name))}|${re(o.map(n=>n.name))}`,Tt=(e,o,n)=>{if(!e)return;let a=0,l,s=e.length,m;for(;a<s;a++)m=e[a].operator,(!n&&m!=="in"||m===n)&&e[a].field===o&&(l=e[a]);return l},nt=(e,o,n)=>{if(!e)return[];let a=0,l=[],s=e.length,m;for(;a<s;a++)m=e[a].operator,(!n&&m!=="in"||m===n)&&e[a].field===o&&l.push(e[a]);return l},rt=(e,o)=>e.uniqueName===o.uniqueName,lt=t.forwardRef((e,o)=>{c.validatePackage(Rt);const{rows:n,rowAxes:a,columns:l,columnAxes:s,data:m}={...de,...e},i=t.useRef(null),p=t.useRef(null),f=t.useRef(null),v=t.useRef(null),w=t.useRef(null),O=t.useRef(null),M=t.useRef(null),V=he.useLocalization(),D=(C,S)=>{e.onRowAxesChange&&e.onRowAxesChange({value:C,target:p.current,syntheticEvent:S})},$=(C,S)=>{e.onColumnAxesChange&&e.onColumnAxesChange({value:C,target:p.current,syntheticEvent:S})},j=b.toTree((n||[]).slice()),[,x]=tt((a||[]).slice(),j,D),[N,g,K,U]=b.toRows(j),H=b.toTree((l||[]).slice()),[,u]=tt((s||[]).slice(),H,$),[A,L,,I]=b.toColumns(H),y=b.toData((m||[]).slice(),L,g,I,K);t.useImperativeHandle(p,()=>({props:e,element:i.current,columnHeaderRows:A,rowHeaderRows:N,dataCells:y,rowHeaderBreadth:U,columnHeaderBreadth:I})),t.useImperativeHandle(o,()=>p.current);const X=[],J=[],r=[],[h,E]=c.useCustomComponent(e.row||de.row),[F,k]=c.useCustomComponent(e.column||de.column),[q,_]=c.useCustomComponent(e.cell||de.cell),[d,G]=c.useCustomComponent(e.headerCell||de.headerCell),z=e.columnHeadersRow||h,T=e.columnHeadersColumn||F,Q=e.columnHeadersCell||d,Y=e.rowHeadersRow||h,oe=e.rowHeadersColumn||F,gt=e.rowHeadersCell||d,ht=e.dataRow||h,Ct=e.dataColumn||F;for(let C=0;C<L.length;C++)X.push(t.createElement(Ct,{key:String(L[C].path),...k,path:L[C].path})),r.push(t.createElement(T,{key:String(L[C].path),...k,path:L[C].path}));for(let C=0;C<U;C++)J.push(t.createElement(oe,{key:C,...k}));const vt=C=>{C.target.props.expandable&&u({type:b.HEADERS_ACTION.toggle,payload:C.target.props.dataItem.path},C.syntheticEvent)},xt=C=>{C.target.props.expandable&&x({type:b.HEADERS_ACTION.toggle,payload:C.target.props.dataItem.path},C.syntheticEvent)},Ye=St(M,O),Et=Nt(M,w),pt=C=>{Ye(C),Et(C)},Qe=t.useCallback(()=>{i.current&&v.current&&(i.current.style.gridTemplateRows="",i.current.style.gridTemplateRows=`${v.current.offsetHeight}px 1fr`)},[]),et=t.useCallback(()=>{i.current&&f.current&&(i.current.style.gridTemplateColumns="",i.current.style.gridTemplateColumns=`${f.current.offsetWidth}px 1fr`)},[]),se=t.useRef(new b.PivotGridNavigation({tabIndex:e.tabIndex||0}));t.useEffect(()=>{if(i.current){const C=e.tabIndex||0;if(se.current.stop(),se.current.tabIndex=C,e.navigatable){se.current.start(i.current);const S=se.current.first;S&&S.setAttribute("tabindex",String(C))}}return()=>{se.current.stop()}},[e.tabIndex,e.navigatable]),t.useEffect(()=>{se.current.update()}),t.useEffect(()=>{if(v.current){const C=new window.ResizeObserver(Qe);return C.observe(v.current),()=>{C.disconnect()}}},[Qe]),t.useEffect(()=>{if(f.current){const C=new window.ResizeObserver(et);return C.observe(f.current),()=>{C.disconnect()}}},[et]),c.useIsomorphicLayoutEffect(()=>{if(c.setScrollbarWidth(),f.current){const C=new window.ResizeObserver(c.setScrollbarWidth);return C.observe(f.current),()=>{C.disconnect()}}},[]);const ie=new Array(A.length).fill([]).map(()=>new Array(L.length));A.forEach((C,S)=>{let P=0;Array.from(C.cells).forEach(R=>{const W=!!(R&&R.children&&R.children.length),Ne=(R?re(R.normalizedPath)+(R.total?"|[TOTAL]":"")+(W?"|[EXPANDED]":""):"").replace(/\s/g,"-");if(R)for(let ve=0;ve<(R.colSpan||1);ve++){for(let ce=0;ce<(R.rowSpan||1);ce++){const At=ie[S+ce].findIndex((yt,wt)=>wt>=P&&!yt);ie[S+ce][At]=Ne}P++}})});const Ce=y.map(C=>C.cells.map(S=>Lt(S.rowTuple.members,S.columnTuple.members).replace(/\s/g,"-")));return t.createElement("div",{ref:i,id:e.id,style:e.style,tabIndex:e.navigatable?void 0:e.tabIndex,className:c.classNames("k-pivotgrid",e.className),role:"grid"},t.createElement("span",{className:"k-pivotgrid-empty-cell"},t.createElement("span",{className:"k-sr-only"},V.toLanguageString(Me,Z[Me]))),t.createElement("div",{ref:O,className:"k-pivotgrid-column-headers",onScroll:Ye},t.createElement("table",{ref:v,className:"k-pivotgrid-table",role:"none"},t.createElement("colgroup",null,r),t.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},A.map((C,S)=>{let P=!1;return t.createElement(z,{key:C.name,role:"row",...E},C.cells.map((R,W)=>{const Ne=W!==0&&!P;R&&(P=!0);const ve=R&&!!(R.children&&R.children.length),ce=R&&R.hasChildren&&(!R.total||R.total&&R.parent.total);return R?t.createElement(Q,{...G,key:ie[S][W],"data-key":ie[S][W],id:ie[S][W],columnPath:R.normalizedPath,rowSpan:R.rowSpan||void 0,colSpan:R.colSpan||void 0,onIconClick:vt,dataItem:R,expanded:ve,expandable:ce,total:R.total,first:Ne,root:R.levelNum===0,role:"columnheader"},R.caption):null}))})))),t.createElement("div",{ref:w,className:"k-pivotgrid-row-headers"},t.createElement("table",{ref:f,className:"k-pivotgrid-table",role:"none"},t.createElement("colgroup",null,J),t.createElement("tbody",{className:"k-pivotgrid-tbody",role:"rowgroup"},N.map((C,S)=>t.createElement(Y,{key:re(g[S].path),...E,path:g[S].path,role:"row",ariaOwns:Ce[S].join(" ")},C.cells.filter(Boolean).map(P=>P?t.createElement(gt,{...G,key:re(P.normalizedPath)+(P.total?"|[TOTAL]":"")+(P.children&&P.children.length?"|[EXPANDED]":""),"data-key":re(P.normalizedPath)+(P.total?"|[TOTAL]":"")+(P.children&&P.children.length?"|[EXPANDED]":""),rowPath:P.normalizedPath,rowSpan:P.rowSpan||void 0,colSpan:P.colSpan||void 0,dataItem:P,expanded:!!(P.children&&P.children.length),expandable:P.hasChildren&&!P.total,total:P.total,onIconClick:xt,root:P.levelNum===0,role:"rowheader"},P.caption):null)))))),t.createElement("div",{ref:M,className:"k-pivotgrid-values",onScroll:pt},t.createElement("table",{className:"k-pivotgrid-table",role:"none"},t.createElement("colgroup",null,X),t.createElement("tbody",{className:"k-pivotgrid-tbody",role:"none"},y.map((C,S)=>t.createElement(ht,{key:re(g[S].path),...E,path:g[S].path,role:"none"},C.cells.map((P,R)=>t.createElement(q,{key:Ce[S][R],"data-key":Ce[S][R],id:Ce[S][R],..._,rowPath:P.rowTuple.members.map(W=>W.name),columnPath:P.columnTuple.members.map(W=>W.name),dataItem:P,total:g[S].total||L[R].total,role:"gridcell",ariaDescribedby:ie.map(W=>W[R]).join(" ")},P&&P.data&&P.data.fmtValue?P.data.fmtValue:" "))))))))}),de={rowAxes:[],columnAxes:[],data:[],row:$e,column:be,cell:je,headerCell:we};lt.displayName="KendoReactPivotGrid";const Xe=t.forwardRef((e,o)=>{const n=t.useRef(null),a=t.useRef(null);return t.useImperativeHandle(a,()=>({props:e,element:n.current})),t.useImperativeHandle(o,()=>a.current),t.createElement("div",{ref:n,id:e.id,style:e.style,tabIndex:e.tabIndex,className:c.classNames("k-d-flex k-pos-relative",{"k-flex-row":e.configuratorPosition==="right","k-flex-row-reverse":e.configuratorPosition==="left","k-flex-column":e.configuratorPosition==="bottom","k-flex-column-reverse":e.configuratorPosition==="top"},e.className)},e.children)}),Dt={configuratorPosition:"right"};Xe.defaultProps=Dt;Xe.displayName="KendoReactPivotGridContainer";const st=t.createContext({axes:null});var Ze=(e=>(e.toggle="EXPAND_TOGGLE",e.expand="EXPAND_EXPAND",e.collapse="EXPAND_COLLAPSE",e))(Ze||{});const Ht=(e,o,n)=>{switch(o.type){case"EXPAND_TOGGLE":return Array.isArray(e)?e.find(a=>n(a,o.payload))?[...e.filter(a=>!n(a,o.payload))]:[...e,o.payload]:n(e,o.payload)?null:o.payload;case"EXPAND_EXPAND":if(Array.isArray(e)){if(!e.find(a=>n(a,o.payload)))return[...e,o.payload]}else if(!n(e,o.payload))return o.payload;break;case"EXPAND_COLLAPSE":if(Array.isArray(e)){if(e.find(a=>n(a,o.payload)))return[...e.filter(a=>!n(a,o.payload))]}else n(e,o.payload);break;default:return e}},it=(e=[],o,n,a=(l,s)=>l===s)=>{const[l,s]=t.useState(e);return[l,(i,p)=>{const f=Ht(l,i,a);o&&o.call(void 0,{value:f,target:n.current,syntheticEvent:p}),s(f)}]};var ct=(e=>(e.toggleExpansion="PIVOT_CONFIGURATOR_ACTION_TOGGLE_EXPANSION",e))(ct||{});const B={...b.PIVOT_CONFIGURATOR_ACTION,...ct},Gt=(e,o)=>{const n=e.valueGetter("rowAxes"),a=e.valueGetter("columnAxes"),l=e.valueGetter("measureAxes"),s=e.valueGetter("sort"),m=e.valueGetter("filter"),[i,p]=it([],void 0,o,rt),[f,v]=t.useState(null),[w,O]=t.useState(null),[M,V]=t.useState(null),[D,$]=t.useState(null);return[{dragItem:f,dropTarget:M,dropZone:w,dropDirection:D,columnAxes:a,rowAxes:n,measureAxes:l,sort:s,filter:m,expanded:i},(x,N)=>{switch(x.type){case B.toggleExpansion:{p({type:Ze.toggle,payload:x.payload},N);break}default:const g=b.configuratorReducer({filter:x.override&&x.override.filter!==void 0?x.override.filter:m,sort:x.override&&x.override.sort!==void 0?x.override.sort:s,rowAxes:x.override&&x.override.rowAxes!==void 0?x.override.rowAxes:n,columnAxes:x.override&&x.override.columnAxes!==void 0?x.override.columnAxes:a,measureAxes:x.override&&x.override.measureAxes!==void 0?x.override.measureAxes:l,dragItem:x.override&&x.override.dragItem!==void 0?x.override.dragItem:f,dropDirection:x.override&&x.override.dropDirection!==void 0?x.override.dropDirection:D,dropTarget:x.override&&x.override.dropTarget!==void 0?x.override.dropTarget:M,dropZone:x.override&&x.override.dropZone!==void 0?x.override.dropZone:w},x);g.columnAxes!==void 0&&e.onChange("columnAxes",{value:g.columnAxes}),g.rowAxes!==void 0&&e.onChange("rowAxes",{value:g.rowAxes}),g.measureAxes!==void 0&&e.onChange("measureAxes",{value:g.measureAxes}),g.sort!==void 0&&e.onChange("sort",{value:g.sort}),g.filter!==void 0&&e.onChange("filter",{value:g.filter}),g.dropDirection!==void 0&&$(g.dropDirection),g.dropTarget!==void 0&&V(g.dropTarget),g.dropZone!==void 0&&O(g.dropZone),g.dragItem!==void 0&&v(g.dragItem);break}}]},ut=t.createContext({}),Fe=t.createContext([{expanded:[],rowAxes:[],columnAxes:[],measureAxes:[],dragItem:null,dropZone:null,dropDirection:null,dropTarget:null},c.noop]),Pe=t.forwardRef((e,o)=>{const{data:n,dataItem:a,defaultFilter:l}={...te,...e},s=t.useRef(null),m=t.useRef(null),i=he.useLocalization(),[p,f]=c.useCustomComponent(e.columnMenuItem||te.columnMenuItem),[v,w]=c.useCustomComponent(e.columnMenuForm||te.columnMenuForm),[O,M]=c.useCustomComponent(e.resetButton||te.resetButton),[V,D]=c.useCustomComponent(e.applyButton||te.applyButton),[$,j]=c.useCustomComponent(e.treeView||te.treeView),[x,N]=c.useCustomComponent(e.noData||te.noData);t.useImperativeHandle(m,()=>({props:e,element:s.current})),t.useImperativeHandle(o,()=>m.current);const[g,K]=t.useState(!1),{onAxisFilterFieldsExpandChange:U,onAxisFilterFieldExpand:H}=t.useContext(ut),[,u]=t.useContext(Fe),[A,L]=t.useState(l),I=A?A.value.split(","):[],[y,X]=it([],void 0,m,rt),J={caption:d=>d.dataItem.caption,id:d=>d.dataItem.uniqueName,parent:(d,G)=>G&&G.value,value:d=>d.dataItem.defaultHierarchy||d.dataItem.uniqueName,expanded:d=>y.some(G=>G.uniqueName===d.id),checked:d=>!I.length||(I||[]).some(G=>G===d.dataItem.uniqueName),hasChildren:d=>parseInt(d.dataItem.childrenCardinality,10)>0,children:d=>ye(d.dataItem.children,J,d),checkIndeterminate:d=>{const G=(d.children||[]).length&&d.children.every(z=>z.checked);return G&&(d.checked=!0),(d.children||[]).some(z=>z.checked)&&!G}},r=ye(n,J),h=_e(r),E=d=>{K(!g),U&&U({value:!g,target:m.current,syntheticEvent:d})},F=d=>{X({type:Ze.toggle,payload:d.item.dataItem},d.syntheticEvent),H&&H({value:d.item.dataItem,target:m.current,syntheticEvent:d.syntheticEvent})},k=d=>{let G;d.item.checked?G={field:String(a.name),operator:"in",value:h.filter(z=>z.checked).map(z=>String(z.value)).filter(z=>z!==d.item.value&&z!==d.item.parent).join(",")}:G={field:String(a.name),operator:"in",value:h.filter(z=>z.checked).map(z=>String(z.value)).concat([d.item.value]).join(",")},L(G)},q=d=>{K(!1),A&&u({type:B.removeFilter,payload:A},d)},_=d=>{K(!1),A&&u({type:l?B.changeFilter:B.addFilter,payload:A},d)};return t.createElement("div",{ref:s,id:e.id,tabIndex:e.tabIndex,style:e.style,className:c.classNames("k-columnmenu-item-wrapper",e.className)},t.createElement(p,{...f,title:"Include Fields",iconClass:"k-i-grid-layout",svgIcon:pe.gridLayoutIcon,onClick:E}),t.createElement(v,{show:g,actions:t.createElement(t.Fragment,null,t.createElement(O,{type:"reset",onClick:q,...M},i.toLanguageString(Le,Z[Le])),t.createElement(V,{themeColor:"primary",onClick:_,...D},i.toLanguageString(Te,Z[Te]))),...w},r&&r.length?t.createElement($,{data:r,checkboxes:!0,onExpandChange:F,onCheckChange:k,textField:"caption",expandIcons:!0,hasChildrenField:"hasChildren",checkIndeterminateField:"checkIndeterminate",childrenField:"children",...j}):t.createElement(x,{...N})))}),te={data:[],resetButton:ue.Button,applyButton:ue.Button,treeView:Ve.TreeView,noData:()=>t.createElement(Ft.Skeleton,{shape:"rectangle",style:{height:"20px",width:"calc(100% - 16px)",margin:8}}),columnMenuItem:Ae.ColumnMenuItem,columnMenuForm:Ae.ColumnMenuForm};Pe.defaultProps=te;Pe.displayName="KendoReactPivotGridAxisFilterFieldsEditor";const Re=t.forwardRef((e,o)=>{const n=t.useRef(0),a=t.useRef(0),l=t.useRef(null),s=t.useRef(null),m=t.useRef(null),{axes:i}=t.useContext(st),[p,f]=t.useState(!1),[v,w]=t.useContext(Fe);t.useImperativeHandle(s,()=>l.current&&l.current.element),t.useImperativeHandle(m,()=>({props:e,element:s.current})),t.useImperativeHandle(o,()=>m.current);const[O,M]=c.useCustomComponent(e.chip||fe.chip),[V,D]=c.useCustomComponent(e.dropClue||fe.dropClue),[$,j]=c.useCustomComponent(e.columnMenuTextColumn||fe.columnMenuTextColumn),[x,N]=c.useCustomComponent(e.filterFieldsEditor||fe.filterFieldsEditor),g=nt(v.filter,String(e.value),"in"),K=nt(v.filter,String(e.value)),U=(r,h)=>{w({type:B.setSort,payload:h},r)},H=(r,h)=>{h.length?w({type:B.setFilter,payload:[...g||[],...h.reduce((E,F)=>[...E,...F.filters.filter(k=>k.value)],[])]},r):w({type:B.setFilter,payload:g},r)},u=r=>{w({type:B.remove,payload:e.dataItem},r.syntheticEvent)},A=r=>{const h=r.slice(),E=Tt(v.filter,String(e.dataItem.name),"in");return h.splice(1,0,t.createElement(x,{key:"axis-filter-fields-editor",defaultFilter:E,dataItem:e.dataItem,data:e.dataItem.fields,axes:i,...N})),h},L=r=>{n.current=r.clientX,a.current=r.clientY},I=r=>{Math.abs(n.current-r.clientX)<10&&Math.abs(a.current-r.clientY)<10||(s.current&&(s.current.style.transform=`translate(${r.clientX-n.current}px, ${r.clientY-a.current}px)`),f(!0),w({type:B.setDragItem,payload:e.dataItem}))},y=()=>{f(!1),v.dragItem&&(s.current&&(s.current.style.transform=""),w({type:B.drop,payload:e.dataItem}))},X=r=>{v.dragItem&&(w({type:B.setDropTarget,payload:e.dataItem},r.syntheticEvent),w({type:B.setDropZone,payload:i},r.syntheticEvent))},J=r=>{if(v.dragItem&&!p&&s.current){const h=s.current.getBoundingClientRect(),F=r.syntheticEvent.clientX-h.left<h.width/2?"before":"after";w({type:B.setDropDirection,payload:F},r.syntheticEvent)}};return c.useDraggable(s,{onPress:L,onDrag:I,onRelease:y}),t.createElement(t.Fragment,null,v.dropTarget&&b.compareAxes(v.dropTarget,e.dataItem)&&v.dropDirection==="before"&&t.createElement(V,{...D}),t.createElement(O,{ref:c.canUseRef(O)?l:void 0,...e,removable:!0,onRemove:u,onMouseEnter:X,onMouseMove:J,style:{pointerEvents:p?"none":void 0},rounded:"full",...M},e.text,i!=="measureAxes"&&t.createElement($,{field:String(e.value),itemsRender:A,sort:v.sort,onSortChange:U,filter:K&&K.length?[{logic:"and",filters:K}]:void 0,onFilterChange:H,filterContent:[Ae.ColumnMenuTextFilter],...j})),v.dropTarget&&b.compareAxes(v.dropTarget,e.dataItem)&&v.dropDirection==="after"&&t.createElement(V,{...D}))}),fe={chip:ue.Chip,columnMenuTextColumn:Ae.ColumnMenuTextColumn,filterFieldsEditor:Pe,dropClue:e=>t.createElement("div",{className:"k-grouping-dropclue",style:{position:"relative",zIndex:1e4},...e})};Re.defaultProps=fe;Re.displayName="KendoReactPivotGridAxisEditor";const le=t.forwardRef((e,o)=>{const{value:n,field:a}={...Ue,...e},l=t.useRef(null),s=t.useRef(null),m=t.useRef(null),[i,p]=c.useCustomComponent(e.chipList||Ue.chipList);t.useImperativeHandle(s,()=>l.current&&l.current.element),t.useImperativeHandle(m,()=>({props:e,element:s.current})),t.useImperativeHandle(o,()=>m.current);const f=n.filter(v=>v.name.length===1&&v.name.every(w=>w.indexOf("&")===-1)).map(v=>({...v,text:String(v.name)}));return t.createElement(st.Provider,{value:{axes:a}},t.createElement(i,{ref:c.canUseRef(i)?l:void 0,textField:"text",valueField:"name",data:f,chip:Re,style:{position:"relative"},className:e.className,selection:"none",...p}))}),Ue={value:[],chipList:ue.ChipList};le.defaultProps=Ue;le.displayName="KendoReactPivotGridAxesEditor";const Ie=t.forwardRef((e,o)=>{const{data:n,rowAxes:a,columnAxes:l,measureAxes:s,onExpand:m,onCheck:i}={...Ee,...e},p=t.useRef(null),f=t.useRef(null),[v,w]=c.useCustomComponent(e.treeView||Ee.treeView),[O,M]=c.useCustomComponent(e.noData||Ee.noData);t.useImperativeHandle(f,()=>({props:e,element:p.current&&p.current.element})),t.useImperativeHandle(o,()=>f.current);const[V]=t.useContext(Fe),D=ke(l),$=ke(a),j=ke(s),N=_e(n).filter(u=>[...D,...$,...j].some(A=>A===u.uniqueName||A===u.defaultHierarchy)),g={caption:u=>u.dataItem.caption,id:u=>u.dataItem.uniqueName,value:u=>u.dataItem.defaultHierarchy||u.dataItem.uniqueName,expanded:u=>V.expanded.some(A=>A.uniqueName===u.dataItem.uniqueName),hasChildren:u=>!("hierarchyUniqueName"in u.dataItem)&&!("aggregator"in u.dataItem),selectable:u=>!(!u.hasChildren&&!u.dataItem.aggregator&&!u.dataItem.measure||u.dataItem.type===2||u.dataItem.uniqueName==="[KPIs]"),children:u=>ye(u.dataItem.children,g,u),checked:u=>N.some(A=>u.dataItem.defaultHierarchy?A.defaultHierarchy===u.dataItem.defaultHierarchy:A.uniqueName===u.dataItem.uniqueName)||u.children.length&&u.children.every(A=>A.checked)},K=u=>{m&&m({value:u.item.dataItem,target:f.current,syntheticEvent:u.syntheticEvent})},U=u=>{i&&i({value:u.item.dataItem,target:f.current,syntheticEvent:u.syntheticEvent})},H=ye(e.data,g);return t.createElement(Ve.TreeViewItemPropsContext.Provider,{value:u=>({...u,checkboxes:u.item.selectable})},H&&H.length?t.createElement(v,{ref:c.canUseRef(v)?p:void 0,data:H,checkboxes:!0,onExpandChange:K,onCheckChange:U,textField:"caption",expandIcons:!0,hasChildrenField:"hasChildren",checkIndeterminateField:"checkIndeterminate",childrenField:"children",...w}):t.createElement(O,{...M}))}),Ee={data:[],rowAxes:[],columnAxes:[],measureAxes:[],treeView:Ve.TreeView,noData:()=>t.createElement("div",null,"NO DATA")};Ie.defaultProps=Ee;Ie.displayName="KendoReactPivotGridFieldsEditor";const Se=t.forwardRef((e,o)=>{const{onFieldsEditorFieldCheck:n,onFieldsEditorFieldCheckAction:a,onFieldsEditorFieldExpand:l,onFieldsEditorFieldExpandAction:s,onAxisFilterFieldExpand:m,onAxisFilterFieldsExpandChange:i}=e,[p,f]=c.useCustomComponent(e.fieldsLabel||ee.fieldsLabel),[v,w]=c.useCustomComponent(e.fieldsEditor||ee.fieldsEditor),[O,M]=c.useCustomComponent(e.columnAxesLabel||ee.columnAxesLabel),[V,D]=c.useCustomComponent(e.columnAxesEditor||ee.columnAxesEditor),[$,j]=c.useCustomComponent(e.rowAxesLabel||ee.rowAxesLabel),[x,N]=c.useCustomComponent(e.rowAxesEditor||ee.rowAxesEditor),[g,K]=c.useCustomComponent(e.measureAxesLabel||ee.measureAxesLabel),[U,H]=c.useCustomComponent(e.measureAxesEditor||ee.measureAxesEditor),u=t.useRef(null),A=t.useRef(null),L=he.useLocalization(),[I,y]=Gt(e,A);t.useImperativeHandle(A,()=>({element:u.current,props:e,state:I})),t.useImperativeHandle(o,()=>A.current);const X=()=>{I.dragItem&&y({type:B.setDropZone,payload:"columnAxes"})},J=()=>{I.dragItem&&y({type:B.setDropZone,payload:null})},r=()=>{I.dragItem&&y({type:B.setDropZone,payload:"rowAxes"})},h=()=>{I.dragItem&&y({type:B.setDropZone,payload:null})},E=()=>{I.dragItem&&y({type:B.setDropZone,payload:"measureAxes"})},F=()=>{I.dragItem&&y({type:B.setDropZone,payload:null})},k=T=>{const Q={target:T.target,currentTarget:A.current,value:T.value,syntheticEvent:T.syntheticEvent};if(s){const Y=s(Q,e,I);Y&&(Array.isArray(Y)?Y.filter(Boolean).map(oe=>oe&&y({...oe},T.syntheticEvent)):y({...Y},T.syntheticEvent))}l&&l({target:T.target,currentTarget:A.current,value:T.value,syntheticEvent:T.syntheticEvent})},q=T=>{const Q={target:T.target,currentTarget:A.current,value:T.value,syntheticEvent:T.syntheticEvent};if(a){const Y=a(Q,e,I);Y&&(Array.isArray(Y)?Y.filter(Boolean).map(oe=>oe&&y({...oe},T.syntheticEvent)):y({...Y},T.syntheticEvent))}n&&n(Q)},_=T=>{const Q={target:T.target,currentTarget:A.current,value:T.value,syntheticEvent:T.syntheticEvent};m&&m(Q)},d=T=>{const Q={target:T.target,currentTarget:A.current,value:T.value,syntheticEvent:T.syntheticEvent};i&&i(Q)},G=e.horizontal?"div":t.Fragment,z=e.horizontal?{className:"k-form-field-wrapper"}:{};return t.createElement(ut.Provider,{value:{onAxisFilterFieldExpand:_,onAxisFilterFieldsExpandChange:d}},t.createElement(Fe.Provider,{value:[I,y]},t.createElement(G,{...z},t.createElement("div",{className:"k-form-field"},t.createElement(p,{name:"",component:me.Label,...f},L.toLanguageString(ze,Z[ze]))),t.createElement("div",{className:"k-form-field"},t.createElement("div",{className:"k-fields-list-wrapper"},t.createElement(v,{data:e.data,onExpand:k,onCheck:q,columnAxes:I.columnAxes,rowAxes:I.rowAxes,measureAxes:I.measureAxes,...w})))),t.createElement(G,{...z},t.createElement("div",{className:"k-form-field",onMouseEnter:X,onMouseLeave:J},t.createElement(ne.Field,{name:"columnAxes",field:"columnAxes",component:O,...M},L.toLanguageString(Oe,Z[Oe]))),e.valueGetter("columnAxes").length?t.createElement(ne.Field,{name:"columnAxes",field:"columnAxes",component:V,onMouseEnter:X,onMouseLeave:J,className:"k-column-fields",...D}):t.createElement("div",{className:"k-settings-description",onMouseEnter:X,onMouseLeave:J},L.toLanguageString(ae,Z[ae])),t.createElement("div",{className:"k-form-field",onMouseEnter:r,onMouseLeave:h},t.createElement(ne.Field,{name:"rowAxes",field:"rowAxes",component:$,...j},L.toLanguageString(qe,Z[qe]))),e.valueGetter("rowAxes").length?t.createElement(ne.Field,{name:"rowAxes",field:"rowAxes",component:x,onMouseEnter:r,onMouseLeave:h,className:"k-column-fields",...N}):t.createElement("div",{className:"k-settings-description",onMouseEnter:r,onMouseLeave:h},L.toLanguageString(ae,Z[ae]))),t.createElement(G,{...z},t.createElement("div",{className:"k-form-field",onMouseEnter:E,onMouseLeave:F},t.createElement(ne.Field,{name:"measureAxes",field:"measureAxes",component:g,...K},L.toLanguageString(Be,Z[Be]))),e.valueGetter("measureAxes").length?t.createElement(ne.Field,{name:"measureAxes",field:"measureAxes",component:U,onMouseEnter:E,onMouseLeave:F,className:"k-column-fields",...H}):t.createElement("div",{className:"k-settings-description",onMouseEnter:E,onMouseLeave:F},L.toLanguageString(ae,Z[ae])))))}),ee={data:[],horizontal:!1,fieldsLabel:me.Label,fieldsEditor:Ie,columnAxesLabel:me.Label,columnAxesEditor:le,rowAxesLabel:me.Label,rowAxesEditor:le,measureAxesLabel:me.Label,measureAxesEditor:le,axesEditor:le,onFieldsEditorFieldCheckAction:e=>({type:B.toggleSelection,payload:e.value}),onFieldsEditorFieldExpandAction:e=>({type:B.toggleExpansion,payload:e.value})};Se.defaultProps=ee;Se.displayName="KendoReactPivotGridConfiguratorEditor";const Je=t.forwardRef((e,o)=>{const{horizontal:n,data:a,rowAxes:l,columnAxes:s,measureAxes:m}={...ge,...e},i=t.useRef(null),p=t.useRef(null),f=t.useRef(null),v=he.useLocalization(),[w,O]=c.useCustomComponent(e.editor||ge.editor),[M,V]=c.useCustomComponent(e.form||ge.form),[D,$]=c.useCustomComponent(e.formElement||ge.formElement);t.useImperativeHandle(p,()=>({props:e,element:i.current})),t.useImperativeHandle(o,()=>p.current);const j=(N,g)=>{e.onRowAxesChange&&e.onRowAxesChange({target:p.current,value:N.rowAxes,syntheticEvent:g}),e.onColumnAxesChange&&e.onColumnAxesChange({target:p.current,value:N.columnAxes,syntheticEvent:g}),e.onMeasureAxesChange&&e.onMeasureAxesChange({target:p.current,value:N.measureAxes,syntheticEvent:g}),e.onSortChange&&e.onSortChange({target:p.current,value:N.sort,syntheticEvent:g}),e.onFilterChange&&e.onFilterChange({target:p.current,value:N.filter,syntheticEvent:g})},x={rowAxes:l,columnAxes:s,measureAxes:m,sort:e.sort,filter:e.filter};return t.useEffect(()=>{f.current&&f.current.onChange("rowAxes",{value:l})},[l]),t.useEffect(()=>{f.current&&f.current.onChange("columnAxes",{value:s})},[s]),t.useEffect(()=>{f.current&&f.current.onChange("measureAxes",{value:m})},[m]),t.useEffect(()=>{f.current&&f.current.onChange("sort",{value:e.sort})},[e.sort]),t.useEffect(()=>{f.current&&f.current.onChange("filter",{value:e.filter})},[e.filter]),t.createElement("div",{ref:i,id:e.id,tabIndex:e.tabIndex,style:e.style,className:c.classNames("k-pivotgrid-configurator",e.className)},t.createElement("div",{className:c.classNames("k-pivotgrid-configurator-panel","k-pivotgrid-configurator-push",{"k-pivotgrid-configurator-horizontal":n,"k-pivotgrid-configurator-vertical":!n})},t.createElement("div",{className:"k-pivotgrid-configurator-header"},t.createElement("div",{className:"k-pivotgrid-configurator-header-text"},v.toLanguageString(De,Z[De]))),t.createElement(M,{ref:c.canUseRef(M)?f:void 0,initialValues:x,onSubmit:j,render:N=>t.createElement(t.Fragment,null,t.createElement("div",{className:"k-pivotgrid-configurator-content"},t.createElement(D,{horizontal:n,...$},t.createElement(w,{...N,horizontal:e.horizontal,onFieldsEditorFieldExpand:e.onFieldsEditorFieldExpand,onFieldsEditorFieldCheck:e.onFieldsEditorFieldCheck,onAxisFilterFieldExpand:e.onAxisFilterFieldExpand,onAxisFilterFieldsExpandChange:e.onAxisFilterFieldsExpandChange,data:a,...O}))),t.createElement("div",{className:"k-pivotgrid-configurator-actions k-actions k-hstack k-justify-content-end"},t.createElement(ue.Button,{type:"submit",onClick:N.onFormReset},v.toLanguageString(He,Z[He])),t.createElement(ue.Button,{themeColor:"primary",type:"submit",onClick:N.onSubmit},v.toLanguageString(Ge,Z[Ge])))),...V})))}),ge={form:ne.Form,formElement:ne.FormElement,editor:Se,horizontal:!1,data:[],columnAxes:[],rowAxes:[],measureAxes:[]};Je.defaultProps=ge;Je.displayName="KendoReactPivotGridConfigurator";const We=t.forwardRef((e,o)=>{const n=t.useRef(null),a=t.useRef(null),l=he.useLocalization();t.useImperativeHandle(n,()=>({props:e,element:a.current})),t.useImperativeHandle(o,()=>n.current);const[s,m]=c.useCustomComponent(e.icon||dt.icon),i=t.useMemo(()=>c.classNames("k-pivotgrid-configurator-button",e.className),[e.className]),p=c.useMouse(e,n);return t.createElement("div",{ref:a,id:e.id,className:i,tabIndex:e.tabIndex,...p},t.createElement("span",null,l.toLanguageString(Ke,Z[Ke]),t.createElement(s,{name:"gear",icon:pe.gearIcon,...m})))}),dt={icon:c.IconWrap};We.defaultProps=dt;We.displayName="KendoReactPivotGridConfiguratorButton";const mt=e=>{const[o,n]=t.useState(!0),[a,l]=t.useState({data:[],columns:[],rows:[]}),[s,m]=t.useState([]),[i,p]=t.useState(e.defaultColumnAxes||[]),[f,v]=t.useState(e.defaultRowAxes||[]),[w,O]=t.useState(e.defaultMeasureAxes||[]),[M,V]=t.useState(e.defaultSort||[]),[D,$]=t.useState(e.defaultFilter||[]),j=r=>{v(r.value)},x=r=>{p(r.value)},N=r=>{O(r.value)},g=r=>{V(r.value)},K=r=>{$(r.value)};t.useEffect(()=>{n(!0);const r={connection:{catalog:e.catalog,cube:e.cube},columnAxes:i.slice(),rowAxes:f.slice(),measureAxes:w,sort:M,filter:D};setTimeout(()=>{b.fetchData({url:e.url},c.clone(r)).then(b.createDataState).then(h=>{l(h),n(!1)})})},[i,f,w,D,M,e.cube,e.catalog,e.url]),t.useEffect(()=>{n(!0);const r={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube},command:"schemaDimensions"};b.fetchDiscover({url:e.url},r).then(h=>{b.addKPI(h),m(h),n(!1)})},[e.catalog,e.cube,e.url]);const U=(r=[],h)=>{for(let E=0;E<r.length;E++){const F=r[E];if(String(F.name)===String(h.name))return F}return null},H=(r=[],h)=>{for(let E=0;E<r.length;E++){const F=r[E];if(F.uniqueName===h.uniqueName)return F;let k=H(F.children,h);if(k!==null)return k}return null},u=async r=>{let h,E,F,k,q,_;r.name&&(h="schemaMembers",k=`${String(r.name)}.[(ALL)]`);const d={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:F,dimensionUniqueName:E,levelUniqueName:k,memberUniqueName:q,treeOp:_},command:h};return b.fetchDiscover({url:e.url},d)},A=async r=>{let h,E,F,k,q,_;r.uniqueName&&(h="schemaMembers",q=r.uniqueName.replace(/\&/g,"&"),_=1);const d={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:F,dimensionUniqueName:E,levelUniqueName:k,memberUniqueName:q,treeOp:_},command:h};return b.fetchDiscover({url:e.url},d)},L=async r=>{let h,E,F,k,q,_;r.type===2?h="schemaMeasures":r.dimensionUniqueName?(h="schemaLevels",F=r.uniqueName):(h="schemaHierarchies",E=r.uniqueName);const d={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube,hierarchyUniqueName:F,dimensionUniqueName:E,levelUniqueName:k,memberUniqueName:q,treeOp:_},command:h};return b.fetchDiscover({url:e.url},d)},I=async()=>{const r={connection:{catalog:e.catalog,cube:e.cube},restrictions:{catalogName:e.catalog,cubeName:e.cube},command:"schemaKPIs"};return b.fetchDiscover({url:e.url},r)},y=async r=>{const h=s.slice(),E=H(h,r.value);if(E&&E.uniqueName==="[KPIs]"){const F=qt(await I());E.children=F}else if(E&&E.type==="kpi")E.children=b.buildKPIMeasures(E);else if(E&&!E.children){const F=await L(E);E.children=F}m(h)},X=async r=>{if(!r)return;const h={rowAxes:[f,v],columnAxes:[i,p],measureAxes:[w,O]},[E,F]=h[r.target.props.axes],k=E.slice(),q=U(k,r.target.props.dataItem);if(q&&!q.fields){const _=await u(q);q.fields=_,F(k)}},J=async r=>{if(!r)return;const h={rowAxes:[f,v],columnAxes:[i,p],measureAxes:[w,O]},[E,F]=h[r.target.props.axes],k=E.slice(),q=U(k,r.target.props.dataItem);if(q){const _=(q.fields||[]).slice(),d=H(_,r.value);if(d&&(!d.children||!d.children.length)){const G=await A(d);d.children=G,q.fields=_,F(k)}}};return{pivotProps:{rowAxes:f,columnAxes:i,data:a.data,rows:a.rows,columns:a.columns,onRowAxesChange:j,onColumnAxesChange:x},configuratorProps:{sort:M,onSortChange:g,filter:D,onFilterChange:K,data:s,rowAxes:f,columnAxes:i,measureAxes:w,onRowAxesChange:j,onColumnAxesChange:x,onMeasureAxesChange:N,onFieldsEditorFieldExpand:y,onAxisFilterFieldExpand:J,onAxisFilterFieldsExpandChange:X},state:{loading:o}}},Ot=e=>{const o=mt(e);return e.children(o)},qt=e=>{for(let o=0,n=e.length;o<n;o++)e[o].uniqueName=e[o].name,e[o].type="kpi";return e},Bt="aggregate",zt="columns",ot={dataField:Bt,columnsData:zt},xe="&",ft=e=>{const[o,n]=t.useState(!0),[a,l]=t.useState(e.defaultColumnAxes||[]),[s,m]=t.useState(e.defaultRowAxes||[]),[i,p]=t.useState(e.defaultMeasureAxes||[]),[f,v]=t.useState(e.defaultSort||[]),[w,O]=t.useState(e.defaultFilter||[]),[M,V]=t.useState(new Map),D=t.useCallback(y=>{m(y.value)},[]),$=t.useCallback(y=>{l(y.value)},[]),j=y=>{p(y.value)},x=y=>{v(y.value)},N=y=>{O(y.value)},g=t.useMemo(()=>Array.from(b.rootFields(a).keys()).join(xe),[a]),K=t.useMemo(()=>Array.from(b.rootFields(s).keys()).join(xe),[s]),U=t.useCallback(y=>({key:y,...e.dimensions[y]}),[e.dimensions]),H=t.useMemo(()=>g?g.split(xe).map(U):[],[g,U]),u=t.useMemo(()=>K?K.split(xe).map(U):[],[K,U]),A=t.useMemo(()=>i.map(y=>e.measures.find(X=>String(X.name)===String(y.name))).filter(Boolean),[i,e.measures]);t.useEffect(()=>{n(!0),setTimeout(()=>{const y=b.createDataTree(e.data,u,H,A,ot,w);V(y),n(!1)},0)},[e.data,u,H,A,w]);const L=t.useMemo(()=>b.createFlatSchemaDimensions(e.dimensions,e.measures),[e.dimensions,e.measures]),I=t.useMemo(()=>b.createLocalDataState({dataTree:M,rowSettings:u,columnSettings:H,rowAxes:s,columnAxes:a,measures:A,sort:f,fields:ot}),[a,H,M,s,u,f]);return{pivotProps:{rowAxes:s,columnAxes:a,data:I.data,rows:I.rows,columns:I.columns,onRowAxesChange:D,onColumnAxesChange:$},configuratorProps:{sort:f,onSortChange:x,filter:w,onFilterChange:N,data:L,rowAxes:s,columnAxes:a,measureAxes:i,onRowAxesChange:D,onColumnAxesChange:$,onMeasureAxesChange:j},state:{loading:o}}},Kt=e=>{const o=ft(e);return e.children(o)};Object.defineProperty(exports,"averageAggregate",{enumerable:!0,get:()=>b.averageAggregate});Object.defineProperty(exports,"maxAggregate",{enumerable:!0,get:()=>b.maxAggregate});Object.defineProperty(exports,"minAggregate",{enumerable:!0,get:()=>b.minAggregate});Object.defineProperty(exports,"sumAggregate",{enumerable:!0,get:()=>b.sumAggregate});exports.PivotGrid=lt;exports.PivotGridAxesEditor=le;exports.PivotGridAxisEditor=Re;exports.PivotGridAxisFilterFieldsEditor=Pe;exports.PivotGridCell=je;exports.PivotGridColumn=be;exports.PivotGridConfigurator=Je;exports.PivotGridConfiguratorButton=We;exports.PivotGridConfiguratorEditor=Se;exports.PivotGridContainer=Xe;exports.PivotGridFieldsEditor=Ie;exports.PivotGridHeaderCell=we;exports.PivotGridRow=$e;exports.PivotLocalDataService=Kt;exports.PivotOLAPService=Ot;exports.dataCells=Mt;exports.usePivotLocalDataService=ft;exports.usePivotOLAPService=mt;
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./PivotGrid.js"),o=require("./components/Column.js"),d=require("./components/Row.js"),a=require("./components/Cell.js"),n=require("./components/HeaderCell.js"),u=require("./components/Container.js"),v=require("./components/Configurator.js"),P=require("./components/ConfiguratorEditor.js"),s=require("./components/ConfiguratorButton.js"),g=require("./components/FieldsEditor.js"),l=require("./components/AxesEditor.js"),c=require("./components/AxisEditor.js"),G=require("./components/AxisFilterFieldsEditor.js"),i=require("./hooks/usePivotOLAPService.js"),r=require("./hooks/usePivotLocalDataService.js"),C=require("./utils/index.js"),e=require("@progress/kendo-pivotgrid-common");exports.PivotGrid=t.PivotGrid;exports.PivotGridColumn=o.PivotGridColumn;exports.PivotGridRow=d.PivotGridRow;exports.PivotGridCell=a.PivotGridCell;exports.PivotGridHeaderCell=n.PivotGridHeaderCell;exports.PivotGridContainer=u.PivotGridContainer;exports.PivotGridConfigurator=v.PivotGridConfigurator;exports.PivotGridConfiguratorEditor=P.PivotGridConfiguratorEditor;exports.PivotGridConfiguratorButton=s.PivotGridConfiguratorButton;exports.PivotGridFieldsEditor=g.PivotGridFieldsEditor;exports.PivotGridAxesEditor=l.PivotGridAxesEditor;exports.PivotGridAxisEditor=c.PivotGridAxisEditor;exports.PivotGridAxisFilterFieldsEditor=G.PivotGridAxisFilterFieldsEditor;exports.PivotOLAPService=i.PivotOLAPService;exports.usePivotOLAPService=i.usePivotOLAPService;exports.PivotLocalDataService=r.PivotLocalDataService;exports.usePivotLocalDataService=r.usePivotLocalDataService;exports.dataCells=C.dataCells;Object.defineProperty(exports,"averageAggregate",{enumerable:!0,get:()=>e.averageAggregate});Object.defineProperty(exports,"maxAggregate",{enumerable:!0,get:()=>e.maxAggregate});Object.defineProperty(exports,"minAggregate",{enumerable:!0,get:()=>e.minAggregate});Object.defineProperty(exports,"sumAggregate",{enumerable:!0,get:()=>e.sumAggregate});
|