@progress/kendo-angular-pivotgrid 0.1.1 → 0.1.3-dev.202205121546
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/bundles/kendo-angular-pivotgrid.umd.js +1 -1
- package/esm2015/package-metadata.js +1 -1
- package/esm2015/pivotgrid.component.js +9 -15
- package/fesm2015/kendo-angular-pivotgrid.js +9 -60
- package/models/loader-settings.d.ts +3 -3
- package/package.json +1 -1
- package/pivotgrid.component.d.ts +2 -2
- package/esm2015/util.js +0 -49
- package/util.d.ts +0 -18
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@progress/kendo-licensing"),require("@progress/kendo-angular-common"),require("@progress/kendo-pivotgrid-common"),require("rxjs"),require("@angular/common"),require("@progress/kendo-angular-indicators"),require("@progress/kendo-angular-l10n")):"function"==typeof define&&define.amd?define("KendoAngularPivotgrid",["exports","@angular/core","@progress/kendo-licensing","@progress/kendo-angular-common","@progress/kendo-pivotgrid-common","rxjs","@angular/common","@progress/kendo-angular-indicators","@progress/kendo-angular-l10n"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoAngularPivotgrid={},e.ng.core,e.KendoLicensing,e.KendoAngularCommon,e.KendoPivotgridCommon,e.rxjs,e.ng.common,e.KendoAngularIndicators,e.KendoAngularL10N)}(this,function(e,t,o,n,s,i,r,a,l){"use strict";function d(n){if(n&&n.__esModule)return n;var o=Object.create(null);return n&&Object.keys(n).forEach(function(e){var t;"default"!==e&&(t=Object.getOwnPropertyDescriptor(n,e),Object.defineProperty(o,e,t.get?t:{enumerable:!0,get:function(){return n[e]}}))}),o.default=n,Object.freeze(o)}function V(){var e;return null===v&&n.isDocumentAvailable()&&document.createElement&&((e=document.createElement("div")).style.cssText="overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block",e.innerHTML=" ",document.body.appendChild(e),v=e.offsetWidth-e.scrollWidth,document.body.removeChild(e)),v}var c=d(t),p=d(n),u=d(r),g=d(a),N={name:"@progress/kendo-angular-pivotgrid",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1652253558,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning"},v=null,m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function y(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)a.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function f(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||((o=o||Array.prototype.slice.call(t,0,r))[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}Object.create;k.prototype.updateRowsAndCols=function(){var e=s.toTree((this.rows||[]).slice()),e=y(s.toRows(e),4),t=e[0],n=e[1],o=e[2],e=e[3],r=s.toTree((this.columns||[]).slice()),r=y(s.toColumns(r),3),i=r[0],a=r[1],r=r[2];this.columnHeaderLeaves=a,this.columnHeaderCols.next(new Array(r).fill({})),this.columnHeaderRows.next(i),this.rowHeaderLeaves=n,this.rowHeaderCols.next(new Array(e).fill({})),this.rowHeaderRows.next(t),this.valuesRows.next(s.toData((this.normalizedData||[]).slice(),a,n,r,o))};var b=k;function k(){this.expandedStateChange=new t.EventEmitter,this.columnHeaderRows=new i.BehaviorSubject([]),this.columnHeaderCols=new i.BehaviorSubject([]),this.rowHeaderCols=new i.BehaviorSubject([]),this.rowHeaderRows=new i.BehaviorSubject([]),this.valuesRows=new i.BehaviorSubject([]),this.loading=new i.BehaviorSubject(!1)}b.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:b,deps:[],target:c.ɵɵFactoryTarget.Injectable}),b.ɵprov=c.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:b}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:b,decorators:[{type:t.Injectable}],propDecorators:{expandedStateChange:[{type:t.Output}]}});Object.defineProperty(x.prototype,"expanded",{get:function(){var e;return(null==(e=this.kendoPivotGridCell)?void 0:e.hasChildren)&&this.kendoPivotGridCell.children.length},enumerable:!1,configurable:!0}),x.prototype.ngOnInit=function(){var e,t=this.hostEl.nativeElement,n=(this.renderer.setAttribute(t,"rowspan",this.kendoPivotGridCell.rowSpan||1),this.renderer.setAttribute(t,"colspan",this.kendoPivotGridCell.colSpan||1),{"k-pivotgrid-header-total":this.kendoPivotGridCell.total||"values"===this.tableType&&(this.dataService.rowHeaderLeaves[this.rowIndex].total||this.dataService.columnHeaderLeaves[this.colIndex].total),"k-pivotgrid-header-root":0===this.kendoPivotGridCell.levelNum,"k-pivotgrid-expanded":this.kendoPivotGridCell.hasChildren&&this.kendoPivotGridCell.children.length,"k-first":1===this.colIndex});for(e in n)n[e]&&this.renderer.addClass(t,e)};var I=x;function x(e,t,n){var o=this;this.hostEl=e,this.renderer=t,this.dataService=n,this.cellClass=!0,this.handleClick=function(){o.dataService.expandedStateChange.emit({action:o.expanded?"collapse":"expand",cell:o.kendoPivotGridCell,tableType:o.tableType})}}I.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:I,deps:[{token:c.ElementRef},{token:c.Renderer2},{token:b}],target:c.ɵɵFactoryTarget.Component}),I.ɵcmp=c.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.16",type:I,selector:"[kendoPivotGridCell]",inputs:{kendoPivotGridCell:"kendoPivotGridCell",tableType:"tableType",rowIndex:"rowIndex",colIndex:"colIndex"},host:{properties:{"class.k-pivotgrid-cell":"this.cellClass"}},ngImport:c,template:'\n <span \n *ngIf="kendoPivotGridCell.hasChildren && !kendoPivotGridCell.total"\n class="k-icon"\n [kendoEventsOutsideAngular]="{\n click: handleClick\n }"\n [ngClass]="{\n \'k-i-arrow-chevron-up\': expanded,\n \'k-i-arrow-chevron-down\': !expanded\n }"></span>{{ kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption }}',isInline:!0,directives:[{type:u.NgIf,selector:"[ngIf]",inputs:["ngIf","ngIfThen","ngIfElse"]},{type:p.EventsOutsideAngularDirective,selector:"[kendoEventsOutsideAngular]",inputs:["kendoEventsOutsideAngular","scope"]},{type:u.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:I,decorators:[{type:t.Component,args:[{selector:"[kendoPivotGridCell]",template:'\n <span \n *ngIf="kendoPivotGridCell.hasChildren && !kendoPivotGridCell.total"\n class="k-icon"\n [kendoEventsOutsideAngular]="{\n click: handleClick\n }"\n [ngClass]="{\n \'k-i-arrow-chevron-up\': expanded,\n \'k-i-arrow-chevron-down\': !expanded\n }"></span>{{ kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption }}'}]}],ctorParameters:function(){return[{type:c.ElementRef},{type:c.Renderer2},{type:b}]},propDecorators:{cellClass:[{type:t.HostBinding,args:["class.k-pivotgrid-cell"]}],kendoPivotGridCell:[{type:t.Input}],tableType:[{type:t.Input}],rowIndex:[{type:t.Input}],colIndex:[{type:t.Input}]}});C.prototype.ngOnInit=function(){var t=this;this.dataChangeSubs.add(this.dataService[this.tableType+"Rows"].subscribe(function(e){return t.rows=e})),this.dataChangeSubs.add("values"===this.tableType?this.dataService.columnHeaderCols.subscribe(function(e){return t.headerItems=e}):this.dataService[this.tableType+"Cols"].subscribe(function(e){return t.headerItems=e}))},C.prototype.ngOnDestroy=function(){this.dataChangeSubs.unsubscribe()};p=C;function C(e){this.dataService=e,this.dataChangeSubs=new i.Subscription}p.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:p,deps:[{token:b}],target:c.ɵɵFactoryTarget.Component}),p.ɵcmp=c.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.16",type:p,selector:"kendo-pivotgrid-table",inputs:{tableType:"tableType"},ngImport:c,template:'\n <table class="k-pivotgrid-table">\n <colgroup>\n <col *ngFor="let item of headerItems;" />\n </colgroup>\n <tbody class="k-pivotgrid-tbody">\n <tr *ngFor="let row of rows; index as rowIndex"\n class="k-pivotgrid-row">\n <ng-container *ngFor="let cell of row.cells; index as colIndex">\n <th\n *ngIf="cell && tableType !== \'values\'" \n [kendoPivotGridCell]="cell"\n [tableType]="tableType"\n [colIndex]="colIndex"\n [rowIndex]="rowIndex"></th>\n <td\n *ngIf="cell && tableType === \'values\'"\n [kendoPivotGridCell]="cell"\n tableType="values"\n [colIndex]="colIndex"\n [rowIndex]="rowIndex"></td>\n </ng-container>\n </tr>\n </tbody>\n </table>\n ',isInline:!0,components:[{type:I,selector:"[kendoPivotGridCell]",inputs:["kendoPivotGridCell","tableType","rowIndex","colIndex"]}],directives:[{type:u.NgForOf,selector:"[ngFor][ngForOf]",inputs:["ngForOf","ngForTrackBy","ngForTemplate"]},{type:u.NgIf,selector:"[ngIf]",inputs:["ngIf","ngIfThen","ngIfElse"]}]}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:p,decorators:[{type:t.Component,args:[{selector:"kendo-pivotgrid-table",template:'\n <table class="k-pivotgrid-table">\n <colgroup>\n <col *ngFor="let item of headerItems;" />\n </colgroup>\n <tbody class="k-pivotgrid-tbody">\n <tr *ngFor="let row of rows; index as rowIndex"\n class="k-pivotgrid-row">\n <ng-container *ngFor="let cell of row.cells; index as colIndex">\n <th\n *ngIf="cell && tableType !== \'values\'" \n [kendoPivotGridCell]="cell"\n [tableType]="tableType"\n [colIndex]="colIndex"\n [rowIndex]="rowIndex"></th>\n <td\n *ngIf="cell && tableType === \'values\'"\n [kendoPivotGridCell]="cell"\n tableType="values"\n [colIndex]="colIndex"\n [rowIndex]="rowIndex"></td>\n </ng-container>\n </tr>\n </tbody>\n </table>\n '}]}],ctorParameters:function(){return[{type:b}]},propDecorators:{tableType:[{type:t.Input}]}});var w={type:"converging-spinner",themeColor:"primary",size:"large"},A=(Object.defineProperty(S.prototype,"scrollbarWidth",{get:function(){return V()+"px"},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"loaderSettings",{get:function(){return this._loaderSettings},set:function(e){this._loaderSettings=Object.assign({},w,e)},enumerable:!1,configurable:!0}),S.prototype.ngAfterViewInit=function(){var r=this;n.isDocumentAvailable()&&this.zone.runOutsideAngular(function(){var e=document.querySelector(".k-pivotgrid-row-headers .k-pivotgrid-table"),t=new ResizeObserver(function(){return r.resizeContainer("Columns",e)}),n=(t.observe(e),document.querySelector(".k-pivotgrid-column-headers .k-pivotgrid-table")),o=new ResizeObserver(function(){return r.resizeContainer("Rows",n)});o.observe(n),r.resizeObservers=[t,o]})},S.prototype.ngAfterContentInit=function(){var t=this;this.loadingSubscription.add(this.dataService.loading.subscribe(function(e){return t.loading=e}))},S.prototype.ngOnDestroy=function(){this.resizeObservers.forEach(function(e){return e.disconnect()}),this.loadingSubscription.unsubscribe()},S);function S(e,t,n){var r=this;this.hostEl=e,this.zone=t,this.dataService=n,this.hostClass=!0,this.resizeObservers=[],this._loaderSettings=w,this.loadingSubscription=new i.Subscription,this.resizeContainer=function(e,t){var n=r.hostEl.nativeElement,o="Rows"===e?"offsetHeight":"offsetWidth";n.style["gridTemplate"+e]="",n.style["gridTemplate"+e]=t[o]+"px 1fr"},o.validatePackage(N)}A.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:A,deps:[{token:c.ElementRef},{token:c.NgZone},{token:b}],target:c.ɵɵFactoryTarget.Component}),A.ɵcmp=c.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.16",type:A,selector:"kendo-pivotgrid",inputs:{loaderSettings:"loaderSettings"},host:{properties:{"class.k-pivotgrid":"this.hostClass","style.--kendo-scrollbar-width":"this.scrollbarWidth"}},providers:[b],ngImport:c,template:'\n <span class="k-pivotgrid-empty-cell"></span>\n <kendo-pivotgrid-table\n class="k-pivotgrid-column-headers"\n tableType="columnHeader"></kendo-pivotgrid-table>\n <kendo-pivotgrid-table\n class="k-pivotgrid-row-headers"\n tableType="rowHeader"></kendo-pivotgrid-table>\n <kendo-pivotgrid-table\n class="k-pivotgrid-values"\n tableType="values"></kendo-pivotgrid-table>\n\n <div *ngIf="loading" class="k-loader">\n <kendo-loader\n [type]="loaderSettings?.type"\n [themeColor]="loaderSettings?.themeColor"\n [size]="loaderSettings?.size"\n >\n </kendo-loader>\n </div>\n ',isInline:!0,styles:["\n /** TODO: Remove if added to themes */\n div.k-loader {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n "],components:[{type:p,selector:"kendo-pivotgrid-table",inputs:["tableType"]},{type:g.LoaderComponent,selector:"kendo-loader",inputs:["type","themeColor","size"]}],directives:[{type:u.NgIf,selector:"[ngIf]",inputs:["ngIf","ngIfThen","ngIfElse"]}]}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:A,decorators:[{type:t.Component,args:[{selector:"kendo-pivotgrid",providers:[b],template:'\n <span class="k-pivotgrid-empty-cell"></span>\n <kendo-pivotgrid-table\n class="k-pivotgrid-column-headers"\n tableType="columnHeader"></kendo-pivotgrid-table>\n <kendo-pivotgrid-table\n class="k-pivotgrid-row-headers"\n tableType="rowHeader"></kendo-pivotgrid-table>\n <kendo-pivotgrid-table\n class="k-pivotgrid-values"\n tableType="values"></kendo-pivotgrid-table>\n\n <div *ngIf="loading" class="k-loader">\n <kendo-loader\n [type]="loaderSettings?.type"\n [themeColor]="loaderSettings?.themeColor"\n [size]="loaderSettings?.size"\n >\n </kendo-loader>\n </div>\n ',styles:["\n /** TODO: Remove if added to themes */\n div.k-loader {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n "]}]}],ctorParameters:function(){return[{type:c.ElementRef},{type:c.NgZone},{type:b}]},propDecorators:{hostClass:[{type:t.HostBinding,args:["class.k-pivotgrid"]}],scrollbarWidth:[{type:t.HostBinding,args:["style.--kendo-scrollbar-width"]}],loaderSettings:[{type:t.Input}]}});P.prototype.ngOnInit=function(){var o=this;this.loadData(),this.expandedStateSub=this.dataService.expandedStateChange.subscribe(function(n){o.zone.run(function(){var e="columnHeader"===n.tableType,t=e?"columnAxes":"rowAxes",e=s.toTree((e?o.dataService.columns:o.dataService.rows||[]).slice());o.updateHeaders(t,e,n.cell.path)})})},P.prototype.ngOnDestroy=function(){this.expandedStateSub.unsubscribe()},P.prototype.updateDataServiceFields=function(){this.dataService.normalizedData=this.dataState.data,this.dataService.rows=this.dataState.rows,this.dataService.columns=this.dataState.columns,this.dataService.updateRowsAndCols()},P.prototype.updateHeaders=function(e,t,n){n={type:s.HEADERS_ACTION.toggle,payload:n},n=s.headersReducer(this[e].slice(),Object.assign(Object.assign({},n),{tree:t}));this[e]=n,this.loadData()};g=P;function P(e,t){this.dataService=e,this.zone=t,this.columnAxes=[],this.rowAxes=[],this.measureAxes=[],this.expandedStateSub=new i.Subscription}g.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:g,deps:[{token:b},{token:c.NgZone}],target:c.ɵɵFactoryTarget.Directive}),g.ɵdir=c.ɵɵngDeclareDirective({minVersion:"12.0.0",version:"12.2.16",type:g,selector:"kendo-base-binding-directive",inputs:{columnAxes:"columnAxes",rowAxes:"rowAxes",measureAxes:"measureAxes"},ngImport:c}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:g,decorators:[{type:t.Directive,args:[{selector:"kendo-base-binding-directive"}]}],ctorParameters:function(){return[{type:b},{type:c.NgZone}]},propDecorators:{columnAxes:[{type:t.Input}],rowAxes:[{type:t.Input}],measureAxes:[{type:t.Input}]}});var D,O={dataField:"aggregate",columnsData:"columns"},u=(h(T,D=g),T.prototype.ngOnChanges=function(e){n.anyChanged(["data","dimensions","columnAxes","rowAxes","measureAxes","measures"],e)&&this.loadData()},T.prototype.loadData=function(){var e=this,t=this.getRootAxes(this.columnAxes),n=this.getRootAxes(this.rowAxes),t=t.split("&").map(this.createAxisSettings),n=n.split("&").map(this.createAxisSettings),o=this.measureAxes.map(function(t){return e.measures.find(function(e){return String(e.name)===String(t.name)})}).filter(Boolean),r=s.createDataTree(this.data,n,t,o,O);this.dataState=s.createLocalDataState({dataTree:r,rowSettings:n,columnSettings:t,rowAxes:this.rowAxes,columnAxes:this.columnAxes,measures:o,sort:[],fields:O}),this.updateDataServiceFields()},T.prototype.getRootAxes=function(e){return Array.from(s.rootFields(e).keys()).join("&")},T);function T(e,t){var n=D.call(this,e,t)||this;return n.createAxisSettings=function(e){return Object.assign({key:e},n.dimensions[e])},n}u.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:u,deps:[{token:b},{token:c.NgZone}],target:c.ɵɵFactoryTarget.Directive}),u.ɵdir=c.ɵɵngDeclareDirective({minVersion:"12.0.0",version:"12.2.16",type:u,selector:"[kendoPivotLocalBinding]",inputs:{data:["kendoPivotLocalBinding","data"],dimensions:"dimensions",measures:"measures"},exportAs:["kendoPivotLocalBinding"],usesInheritance:!0,usesOnChanges:!0,ngImport:c}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:u,decorators:[{type:t.Directive,args:[{selector:"[kendoPivotLocalBinding]",exportAs:"kendoPivotLocalBinding"}]}],ctorParameters:function(){return[{type:b},{type:c.NgZone}]},propDecorators:{data:[{type:t.Input,args:["kendoPivotLocalBinding"]}],dimensions:[{type:t.Input}],measures:[{type:t.Input}]}});h(E,j=g),E.prototype.ngOnChanges=function(e){n.anyChanged(["url","cube","catalog","columnAxes","rowAxes","measureAxes"],e)&&this.loadData()},E.prototype.loadData=function(){var t=this,e=(this.dataService.loading.next(!0),{connection:{catalog:this.catalog,cube:this.cube},columnAxes:this.columnAxes,rowAxes:this.rowAxes,measureAxes:this.measureAxes});s.fetchData({url:this.url},JSON.parse(JSON.stringify(e))).then(s.createDataState).then(function(e){t.dataState=e,t.updateDataServiceFields(),t.dataService.loading.next(!1)})};var j,g=E;function E(e,t){return j.call(this,e,t)||this}g.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:g,deps:[{token:b},{token:c.NgZone}],target:c.ɵɵFactoryTarget.Directive}),g.ɵdir=c.ɵɵngDeclareDirective({minVersion:"12.0.0",version:"12.2.16",type:g,selector:"[kendoPivotOLAPBinding]",inputs:{url:"url",cube:"cube",catalog:"catalog"},exportAs:["kendoPivotOLAPBinding"],usesInheritance:!0,usesOnChanges:!0,ngImport:c}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:g,decorators:[{type:t.Directive,args:[{selector:"[kendoPivotOLAPBinding]",exportAs:"kendoPivotOLAPBinding"}]}],ctorParameters:function(){return[{type:b},{type:c.NgZone}]},propDecorators:{url:[{type:t.Input}],cube:[{type:t.Input}],catalog:[{type:t.Input}]}});var F=[r.CommonModule,n.EventsModule,a.IndicatorsModule],G=[A,p,I,u,g],R=function(){};R.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:R,deps:[],target:c.ɵɵFactoryTarget.NgModule}),R.ɵmod=c.ɵɵngDeclareNgModule({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:R,declarations:[A,p,I,u,g],imports:[r.CommonModule,n.EventsModule,a.IndicatorsModule],exports:[A,p,I,u,g]}),R.ɵinj=c.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:R,providers:[{provide:l.L10N_PREFIX,useValue:"kendo.pivotgrid"}],imports:[f([],y(F))]}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:R,decorators:[{type:t.NgModule,args:[{imports:f([],y(F)),declarations:f([],y(G)),exports:f([],y(G)),providers:[{provide:l.L10N_PREFIX,useValue:"kendo.pivotgrid"}]}]}]}),Object.defineProperty(e,"averageAggregate",{enumerable:!0,get:function(){return s.averageAggregate}}),Object.defineProperty(e,"maxAggregate",{enumerable:!0,get:function(){return s.maxAggregate}}),Object.defineProperty(e,"minAggregate",{enumerable:!0,get:function(){return s.minAggregate}}),Object.defineProperty(e,"sumAggregate",{enumerable:!0,get:function(){return s.sumAggregate}}),e.PivotGridCellDirective=I,e.PivotGridComponent=A,e.PivotGridModule=R,e.PivotGridTableComponent=p,e.PivotLocalBindingDirective=u,e.PivotOLAPBindingDirective=g,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
5
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@progress/kendo-licensing"),require("@progress/kendo-angular-common"),require("@progress/kendo-pivotgrid-common"),require("rxjs"),require("@angular/common"),require("@progress/kendo-angular-indicators"),require("@progress/kendo-angular-l10n")):"function"==typeof define&&define.amd?define("KendoAngularPivotgrid",["exports","@angular/core","@progress/kendo-licensing","@progress/kendo-angular-common","@progress/kendo-pivotgrid-common","rxjs","@angular/common","@progress/kendo-angular-indicators","@progress/kendo-angular-l10n"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoAngularPivotgrid={},e.ng.core,e.KendoLicensing,e.KendoAngularCommon,e.KendoPivotgridCommon,e.rxjs,e.ng.common,e.KendoAngularIndicators,e.KendoAngularL10N)}(this,function(e,t,i,n,s,a,o,r,l){"use strict";function d(n){if(n&&n.__esModule)return n;var o=Object.create(null);return n&&Object.keys(n).forEach(function(e){var t;"default"!==e&&(t=Object.getOwnPropertyDescriptor(n,e),Object.defineProperty(o,e,t.get?t:{enumerable:!0,get:function(){return n[e]}}))}),o.default=n,Object.freeze(o)}var c=d(t),p=d(n),g=d(o),u=d(r),V={name:"@progress/kendo-angular-pivotgrid",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1652370365,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning"},v=function(e,t){return(v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}v(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function h(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)a.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function y(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||((o=o||Array.prototype.slice.call(t,0,r))[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}Object.create;b.prototype.updateRowsAndCols=function(){var e=s.toTree((this.rows||[]).slice()),e=h(s.toRows(e),4),t=e[0],n=e[1],o=e[2],e=e[3],r=s.toTree((this.columns||[]).slice()),r=h(s.toColumns(r),3),i=r[0],a=r[1],r=r[2];this.columnHeaderLeaves=a,this.columnHeaderCols.next(new Array(r).fill({})),this.columnHeaderRows.next(i),this.rowHeaderLeaves=n,this.rowHeaderCols.next(new Array(e).fill({})),this.rowHeaderRows.next(t),this.valuesRows.next(s.toData((this.normalizedData||[]).slice(),a,n,r,o))};var f=b;function b(){this.expandedStateChange=new t.EventEmitter,this.columnHeaderRows=new a.BehaviorSubject([]),this.columnHeaderCols=new a.BehaviorSubject([]),this.rowHeaderCols=new a.BehaviorSubject([]),this.rowHeaderRows=new a.BehaviorSubject([]),this.valuesRows=new a.BehaviorSubject([]),this.loading=new a.BehaviorSubject(!1)}f.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:f,deps:[],target:c.ɵɵFactoryTarget.Injectable}),f.ɵprov=c.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:f}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:f,decorators:[{type:t.Injectable}],propDecorators:{expandedStateChange:[{type:t.Output}]}});Object.defineProperty(I.prototype,"expanded",{get:function(){var e;return(null==(e=this.kendoPivotGridCell)?void 0:e.hasChildren)&&this.kendoPivotGridCell.children.length},enumerable:!1,configurable:!0}),I.prototype.ngOnInit=function(){var e,t=this.hostEl.nativeElement,n=(this.renderer.setAttribute(t,"rowspan",this.kendoPivotGridCell.rowSpan||1),this.renderer.setAttribute(t,"colspan",this.kendoPivotGridCell.colSpan||1),{"k-pivotgrid-header-total":this.kendoPivotGridCell.total||"values"===this.tableType&&(this.dataService.rowHeaderLeaves[this.rowIndex].total||this.dataService.columnHeaderLeaves[this.colIndex].total),"k-pivotgrid-header-root":0===this.kendoPivotGridCell.levelNum,"k-pivotgrid-expanded":this.kendoPivotGridCell.hasChildren&&this.kendoPivotGridCell.children.length,"k-first":1===this.colIndex});for(e in n)n[e]&&this.renderer.addClass(t,e)};var k=I;function I(e,t,n){var o=this;this.hostEl=e,this.renderer=t,this.dataService=n,this.cellClass=!0,this.handleClick=function(){o.dataService.expandedStateChange.emit({action:o.expanded?"collapse":"expand",cell:o.kendoPivotGridCell,tableType:o.tableType})}}k.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:k,deps:[{token:c.ElementRef},{token:c.Renderer2},{token:f}],target:c.ɵɵFactoryTarget.Component}),k.ɵcmp=c.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.16",type:k,selector:"[kendoPivotGridCell]",inputs:{kendoPivotGridCell:"kendoPivotGridCell",tableType:"tableType",rowIndex:"rowIndex",colIndex:"colIndex"},host:{properties:{"class.k-pivotgrid-cell":"this.cellClass"}},ngImport:c,template:'\n <span \n *ngIf="kendoPivotGridCell.hasChildren && !kendoPivotGridCell.total"\n class="k-icon"\n [kendoEventsOutsideAngular]="{\n click: handleClick\n }"\n [ngClass]="{\n \'k-i-arrow-chevron-up\': expanded,\n \'k-i-arrow-chevron-down\': !expanded\n }"></span>{{ kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption }}',isInline:!0,directives:[{type:g.NgIf,selector:"[ngIf]",inputs:["ngIf","ngIfThen","ngIfElse"]},{type:p.EventsOutsideAngularDirective,selector:"[kendoEventsOutsideAngular]",inputs:["kendoEventsOutsideAngular","scope"]},{type:g.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:k,decorators:[{type:t.Component,args:[{selector:"[kendoPivotGridCell]",template:'\n <span \n *ngIf="kendoPivotGridCell.hasChildren && !kendoPivotGridCell.total"\n class="k-icon"\n [kendoEventsOutsideAngular]="{\n click: handleClick\n }"\n [ngClass]="{\n \'k-i-arrow-chevron-up\': expanded,\n \'k-i-arrow-chevron-down\': !expanded\n }"></span>{{ kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption }}'}]}],ctorParameters:function(){return[{type:c.ElementRef},{type:c.Renderer2},{type:f}]},propDecorators:{cellClass:[{type:t.HostBinding,args:["class.k-pivotgrid-cell"]}],kendoPivotGridCell:[{type:t.Input}],tableType:[{type:t.Input}],rowIndex:[{type:t.Input}],colIndex:[{type:t.Input}]}});C.prototype.ngOnInit=function(){var t=this;this.dataChangeSubs.add(this.dataService[this.tableType+"Rows"].subscribe(function(e){return t.rows=e})),this.dataChangeSubs.add("values"===this.tableType?this.dataService.columnHeaderCols.subscribe(function(e){return t.headerItems=e}):this.dataService[this.tableType+"Cols"].subscribe(function(e){return t.headerItems=e}))},C.prototype.ngOnDestroy=function(){this.dataChangeSubs.unsubscribe()};var x=C;function C(e){this.dataService=e,this.dataChangeSubs=new a.Subscription}x.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:x,deps:[{token:f}],target:c.ɵɵFactoryTarget.Component}),x.ɵcmp=c.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.16",type:x,selector:"kendo-pivotgrid-table",inputs:{tableType:"tableType"},ngImport:c,template:'\n <table class="k-pivotgrid-table">\n <colgroup>\n <col *ngFor="let item of headerItems;" />\n </colgroup>\n <tbody class="k-pivotgrid-tbody">\n <tr *ngFor="let row of rows; index as rowIndex"\n class="k-pivotgrid-row">\n <ng-container *ngFor="let cell of row.cells; index as colIndex">\n <th\n *ngIf="cell && tableType !== \'values\'" \n [kendoPivotGridCell]="cell"\n [tableType]="tableType"\n [colIndex]="colIndex"\n [rowIndex]="rowIndex"></th>\n <td\n *ngIf="cell && tableType === \'values\'"\n [kendoPivotGridCell]="cell"\n tableType="values"\n [colIndex]="colIndex"\n [rowIndex]="rowIndex"></td>\n </ng-container>\n </tr>\n </tbody>\n </table>\n ',isInline:!0,components:[{type:k,selector:"[kendoPivotGridCell]",inputs:["kendoPivotGridCell","tableType","rowIndex","colIndex"]}],directives:[{type:g.NgForOf,selector:"[ngFor][ngForOf]",inputs:["ngForOf","ngForTrackBy","ngForTemplate"]},{type:g.NgIf,selector:"[ngIf]",inputs:["ngIf","ngIfThen","ngIfElse"]}]}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:x,decorators:[{type:t.Component,args:[{selector:"kendo-pivotgrid-table",template:'\n <table class="k-pivotgrid-table">\n <colgroup>\n <col *ngFor="let item of headerItems;" />\n </colgroup>\n <tbody class="k-pivotgrid-tbody">\n <tr *ngFor="let row of rows; index as rowIndex"\n class="k-pivotgrid-row">\n <ng-container *ngFor="let cell of row.cells; index as colIndex">\n <th\n *ngIf="cell && tableType !== \'values\'" \n [kendoPivotGridCell]="cell"\n [tableType]="tableType"\n [colIndex]="colIndex"\n [rowIndex]="rowIndex"></th>\n <td\n *ngIf="cell && tableType === \'values\'"\n [kendoPivotGridCell]="cell"\n tableType="values"\n [colIndex]="colIndex"\n [rowIndex]="rowIndex"></td>\n </ng-container>\n </tr>\n </tbody>\n </table>\n '}]}],ctorParameters:function(){return[{type:f}]},propDecorators:{tableType:[{type:t.Input}]}});var w={type:"converging-spinner",themeColor:"primary",size:"large"},S=(Object.defineProperty(A.prototype,"loaderSettings",{get:function(){return this._loaderSettings},set:function(e){this._loaderSettings=Object.assign({},w,e)},enumerable:!1,configurable:!0}),A.prototype.ngAfterViewInit=function(){var r=this;n.isDocumentAvailable()&&this.zone.runOutsideAngular(function(){var e=document.querySelector(".k-pivotgrid-row-headers .k-pivotgrid-table"),t=new ResizeObserver(function(){return r.resizeContainer("Columns",e)}),n=(t.observe(e),document.querySelector(".k-pivotgrid-column-headers .k-pivotgrid-table")),o=new ResizeObserver(function(){return r.resizeContainer("Rows",n)});o.observe(n),r.resizeObservers=[t,o]})},A.prototype.ngAfterContentInit=function(){var t=this;this.loadingSubscription.add(this.dataService.loading.subscribe(function(e){return t.loading=e}))},A.prototype.ngOnDestroy=function(){this.resizeObservers.forEach(function(e){return e.disconnect()}),this.loadingSubscription.unsubscribe()},A);function A(e,t,n,o){var r=this;this.hostEl=e,this.zone=t,this.dataService=n,this.hostClass=!0,this.resizeObservers=[],this._loaderSettings=w,this.loadingSubscription=new a.Subscription,this.resizeContainer=function(e,t){var n=r.hostEl.nativeElement,o="Rows"===e?"offsetHeight":"offsetWidth";n.style["gridTemplate"+e]="",n.style["gridTemplate"+e]=t[o]+"px 1fr"},i.validatePackage(V)}S.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:S,deps:[{token:c.ElementRef},{token:c.NgZone},{token:f},{token:p.ScrollbarWidthService}],target:c.ɵɵFactoryTarget.Component}),S.ɵcmp=c.ɵɵngDeclareComponent({minVersion:"12.0.0",version:"12.2.16",type:S,selector:"kendo-pivotgrid",inputs:{loaderSettings:"loaderSettings"},host:{properties:{"class.k-pivotgrid":"this.hostClass"}},providers:[f],ngImport:c,template:'\n <span class="k-pivotgrid-empty-cell"></span>\n <kendo-pivotgrid-table\n class="k-pivotgrid-column-headers"\n tableType="columnHeader"></kendo-pivotgrid-table>\n <kendo-pivotgrid-table\n class="k-pivotgrid-row-headers"\n tableType="rowHeader"></kendo-pivotgrid-table>\n <kendo-pivotgrid-table\n class="k-pivotgrid-values"\n tableType="values"></kendo-pivotgrid-table>\n\n <div *ngIf="loading" class="k-loader">\n <kendo-loader\n [type]="loaderSettings?.type"\n [themeColor]="loaderSettings?.themeColor"\n [size]="loaderSettings?.size"\n >\n </kendo-loader>\n </div>\n ',isInline:!0,styles:["\n /** TODO: Remove if added to themes */\n div.k-loader {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n "],components:[{type:x,selector:"kendo-pivotgrid-table",inputs:["tableType"]},{type:u.LoaderComponent,selector:"kendo-loader",inputs:["type","themeColor","size"]}],directives:[{type:g.NgIf,selector:"[ngIf]",inputs:["ngIf","ngIfThen","ngIfElse"]}]}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:S,decorators:[{type:t.Component,args:[{selector:"kendo-pivotgrid",providers:[f],template:'\n <span class="k-pivotgrid-empty-cell"></span>\n <kendo-pivotgrid-table\n class="k-pivotgrid-column-headers"\n tableType="columnHeader"></kendo-pivotgrid-table>\n <kendo-pivotgrid-table\n class="k-pivotgrid-row-headers"\n tableType="rowHeader"></kendo-pivotgrid-table>\n <kendo-pivotgrid-table\n class="k-pivotgrid-values"\n tableType="values"></kendo-pivotgrid-table>\n\n <div *ngIf="loading" class="k-loader">\n <kendo-loader\n [type]="loaderSettings?.type"\n [themeColor]="loaderSettings?.themeColor"\n [size]="loaderSettings?.size"\n >\n </kendo-loader>\n </div>\n ',styles:["\n /** TODO: Remove if added to themes */\n div.k-loader {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n "]}]}],ctorParameters:function(){return[{type:c.ElementRef},{type:c.NgZone},{type:f},{type:p.ScrollbarWidthService}]},propDecorators:{hostClass:[{type:t.HostBinding,args:["class.k-pivotgrid"]}],loaderSettings:[{type:t.Input}]}});P.prototype.ngOnInit=function(){var o=this;this.loadData(),this.expandedStateSub=this.dataService.expandedStateChange.subscribe(function(n){o.zone.run(function(){var e="columnHeader"===n.tableType,t=e?"columnAxes":"rowAxes",e=s.toTree((e?o.dataService.columns:o.dataService.rows||[]).slice());o.updateHeaders(t,e,n.cell.path)})})},P.prototype.ngOnDestroy=function(){this.expandedStateSub.unsubscribe()},P.prototype.updateDataServiceFields=function(){this.dataService.normalizedData=this.dataState.data,this.dataService.rows=this.dataState.rows,this.dataService.columns=this.dataState.columns,this.dataService.updateRowsAndCols()},P.prototype.updateHeaders=function(e,t,n){n={type:s.HEADERS_ACTION.toggle,payload:n},n=s.headersReducer(this[e].slice(),Object.assign(Object.assign({},n),{tree:t}));this[e]=n,this.loadData()};u=P;function P(e,t){this.dataService=e,this.zone=t,this.columnAxes=[],this.rowAxes=[],this.measureAxes=[],this.expandedStateSub=new a.Subscription}u.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:u,deps:[{token:f},{token:c.NgZone}],target:c.ɵɵFactoryTarget.Directive}),u.ɵdir=c.ɵɵngDeclareDirective({minVersion:"12.0.0",version:"12.2.16",type:u,selector:"kendo-base-binding-directive",inputs:{columnAxes:"columnAxes",rowAxes:"rowAxes",measureAxes:"measureAxes"},ngImport:c}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:u,decorators:[{type:t.Directive,args:[{selector:"kendo-base-binding-directive"}]}],ctorParameters:function(){return[{type:f},{type:c.NgZone}]},propDecorators:{columnAxes:[{type:t.Input}],rowAxes:[{type:t.Input}],measureAxes:[{type:t.Input}]}});var D,O={dataField:"aggregate",columnsData:"columns"},g=(m(T,D=u),T.prototype.ngOnChanges=function(e){n.anyChanged(["data","dimensions","columnAxes","rowAxes","measureAxes","measures"],e)&&this.loadData()},T.prototype.loadData=function(){var e=this,t=this.getRootAxes(this.columnAxes),n=this.getRootAxes(this.rowAxes),t=t.split("&").map(this.createAxisSettings),n=n.split("&").map(this.createAxisSettings),o=this.measureAxes.map(function(t){return e.measures.find(function(e){return String(e.name)===String(t.name)})}).filter(Boolean),r=s.createDataTree(this.data,n,t,o,O);this.dataState=s.createLocalDataState({dataTree:r,rowSettings:n,columnSettings:t,rowAxes:this.rowAxes,columnAxes:this.columnAxes,measures:o,sort:[],fields:O}),this.updateDataServiceFields()},T.prototype.getRootAxes=function(e){return Array.from(s.rootFields(e).keys()).join("&")},T);function T(e,t){var n=D.call(this,e,t)||this;return n.createAxisSettings=function(e){return Object.assign({key:e},n.dimensions[e])},n}g.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:g,deps:[{token:f},{token:c.NgZone}],target:c.ɵɵFactoryTarget.Directive}),g.ɵdir=c.ɵɵngDeclareDirective({minVersion:"12.0.0",version:"12.2.16",type:g,selector:"[kendoPivotLocalBinding]",inputs:{data:["kendoPivotLocalBinding","data"],dimensions:"dimensions",measures:"measures"},exportAs:["kendoPivotLocalBinding"],usesInheritance:!0,usesOnChanges:!0,ngImport:c}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:g,decorators:[{type:t.Directive,args:[{selector:"[kendoPivotLocalBinding]",exportAs:"kendoPivotLocalBinding"}]}],ctorParameters:function(){return[{type:f},{type:c.NgZone}]},propDecorators:{data:[{type:t.Input,args:["kendoPivotLocalBinding"]}],dimensions:[{type:t.Input}],measures:[{type:t.Input}]}});m(F,j=u),F.prototype.ngOnChanges=function(e){n.anyChanged(["url","cube","catalog","columnAxes","rowAxes","measureAxes"],e)&&this.loadData()},F.prototype.loadData=function(){var t=this,e=(this.dataService.loading.next(!0),{connection:{catalog:this.catalog,cube:this.cube},columnAxes:this.columnAxes,rowAxes:this.rowAxes,measureAxes:this.measureAxes});s.fetchData({url:this.url},JSON.parse(JSON.stringify(e))).then(s.createDataState).then(function(e){t.dataState=e,t.updateDataServiceFields(),t.dataService.loading.next(!1)})};var j,u=F;function F(e,t){return j.call(this,e,t)||this}u.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:u,deps:[{token:f},{token:c.NgZone}],target:c.ɵɵFactoryTarget.Directive}),u.ɵdir=c.ɵɵngDeclareDirective({minVersion:"12.0.0",version:"12.2.16",type:u,selector:"[kendoPivotOLAPBinding]",inputs:{url:"url",cube:"cube",catalog:"catalog"},exportAs:["kendoPivotOLAPBinding"],usesInheritance:!0,usesOnChanges:!0,ngImport:c}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:u,decorators:[{type:t.Directive,args:[{selector:"[kendoPivotOLAPBinding]",exportAs:"kendoPivotOLAPBinding"}]}],ctorParameters:function(){return[{type:f},{type:c.NgZone}]},propDecorators:{url:[{type:t.Input}],cube:[{type:t.Input}],catalog:[{type:t.Input}]}});var G=[o.CommonModule,n.EventsModule,r.IndicatorsModule],E=[S,x,k,g,u],R=function(){};R.ɵfac=c.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:R,deps:[],target:c.ɵɵFactoryTarget.NgModule}),R.ɵmod=c.ɵɵngDeclareNgModule({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:R,declarations:[S,x,k,g,u],imports:[o.CommonModule,n.EventsModule,r.IndicatorsModule],exports:[S,x,k,g,u]}),R.ɵinj=c.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:R,providers:[{provide:l.L10N_PREFIX,useValue:"kendo.pivotgrid"}],imports:[y([],h(G))]}),c.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"12.2.16",ngImport:c,type:R,decorators:[{type:t.NgModule,args:[{imports:y([],h(G)),declarations:y([],h(E)),exports:y([],h(E)),providers:[{provide:l.L10N_PREFIX,useValue:"kendo.pivotgrid"}]}]}]}),Object.defineProperty(e,"averageAggregate",{enumerable:!0,get:function(){return s.averageAggregate}}),Object.defineProperty(e,"maxAggregate",{enumerable:!0,get:function(){return s.maxAggregate}}),Object.defineProperty(e,"minAggregate",{enumerable:!0,get:function(){return s.minAggregate}}),Object.defineProperty(e,"sumAggregate",{enumerable:!0,get:function(){return s.sumAggregate}}),e.PivotGridCellDirective=k,e.PivotGridComponent=S,e.PivotGridModule=R,e.PivotGridTableComponent=x,e.PivotLocalBindingDirective=g,e.PivotOLAPBindingDirective=u,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-pivotgrid',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
12
|
+
publishDate: 1652370365,
|
|
13
13
|
version: '',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
15
15
|
};
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
import { Component, HostBinding, Input } from '@angular/core';
|
|
6
6
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
7
7
|
import { packageMetadata } from './package-metadata';
|
|
8
|
-
import { scrollbarWidth } from './util';
|
|
9
8
|
import { isDocumentAvailable } from '@progress/kendo-angular-common';
|
|
10
9
|
import { PivotGridDataService } from './data-binding/pivotgrid-data.service';
|
|
11
10
|
import { Subscription } from 'rxjs';
|
|
12
11
|
import * as i0 from "@angular/core";
|
|
13
12
|
import * as i1 from "./data-binding/pivotgrid-data.service";
|
|
14
|
-
import * as i2 from "
|
|
15
|
-
import * as i3 from "
|
|
16
|
-
import * as i4 from "@angular
|
|
13
|
+
import * as i2 from "@progress/kendo-angular-common";
|
|
14
|
+
import * as i3 from "./rendering/pivotgrid-table.component";
|
|
15
|
+
import * as i4 from "@progress/kendo-angular-indicators";
|
|
16
|
+
import * as i5 from "@angular/common";
|
|
17
17
|
const DEFAULT_LOADER_SETTINGS = {
|
|
18
18
|
type: 'converging-spinner',
|
|
19
19
|
themeColor: 'primary',
|
|
@@ -23,7 +23,7 @@ const DEFAULT_LOADER_SETTINGS = {
|
|
|
23
23
|
* A sample component
|
|
24
24
|
*/
|
|
25
25
|
export class PivotGridComponent {
|
|
26
|
-
constructor(hostEl, zone, dataService) {
|
|
26
|
+
constructor(hostEl, zone, dataService, _scrollbarWidthService) {
|
|
27
27
|
this.hostEl = hostEl;
|
|
28
28
|
this.zone = zone;
|
|
29
29
|
this.dataService = dataService;
|
|
@@ -40,9 +40,6 @@ export class PivotGridComponent {
|
|
|
40
40
|
};
|
|
41
41
|
validatePackage(packageMetadata);
|
|
42
42
|
}
|
|
43
|
-
get scrollbarWidth() {
|
|
44
|
-
return `${scrollbarWidth()}px`;
|
|
45
|
-
}
|
|
46
43
|
/**
|
|
47
44
|
* Specify the type, size and color of the PivotGrid's loader.
|
|
48
45
|
*
|
|
@@ -79,8 +76,8 @@ export class PivotGridComponent {
|
|
|
79
76
|
this.loadingSubscription.unsubscribe();
|
|
80
77
|
}
|
|
81
78
|
}
|
|
82
|
-
PivotGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i1.PivotGridDataService }], target: i0.ɵɵFactoryTarget.Component });
|
|
83
|
-
PivotGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PivotGridComponent, selector: "kendo-pivotgrid", inputs: { loaderSettings: "loaderSettings" }, host: { properties: { "class.k-pivotgrid": "this.hostClass"
|
|
79
|
+
PivotGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: i1.PivotGridDataService }, { token: i2.ScrollbarWidthService }], target: i0.ɵɵFactoryTarget.Component });
|
|
80
|
+
PivotGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PivotGridComponent, selector: "kendo-pivotgrid", inputs: { loaderSettings: "loaderSettings" }, host: { properties: { "class.k-pivotgrid": "this.hostClass" } }, providers: [
|
|
84
81
|
PivotGridDataService
|
|
85
82
|
], ngImport: i0, template: `
|
|
86
83
|
<span class="k-pivotgrid-empty-cell"></span>
|
|
@@ -102,7 +99,7 @@ PivotGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ver
|
|
|
102
99
|
>
|
|
103
100
|
</kendo-loader>
|
|
104
101
|
</div>
|
|
105
|
-
`, isInline: true, styles: ["\n /** TODO: Remove if added to themes */\n div.k-loader {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n "], components: [{ type:
|
|
102
|
+
`, isInline: true, styles: ["\n /** TODO: Remove if added to themes */\n div.k-loader {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n "], components: [{ type: i3.PivotGridTableComponent, selector: "kendo-pivotgrid-table", inputs: ["tableType"] }, { type: i4.LoaderComponent, selector: "kendo-loader", inputs: ["type", "themeColor", "size"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
106
103
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridComponent, decorators: [{
|
|
107
104
|
type: Component,
|
|
108
105
|
args: [{
|
|
@@ -141,12 +138,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
141
138
|
}
|
|
142
139
|
`]
|
|
143
140
|
}]
|
|
144
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i1.PivotGridDataService }]; }, propDecorators: { hostClass: [{
|
|
141
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: i1.PivotGridDataService }, { type: i2.ScrollbarWidthService }]; }, propDecorators: { hostClass: [{
|
|
145
142
|
type: HostBinding,
|
|
146
143
|
args: ['class.k-pivotgrid']
|
|
147
|
-
}], scrollbarWidth: [{
|
|
148
|
-
type: HostBinding,
|
|
149
|
-
args: ['style.--kendo-scrollbar-width']
|
|
150
144
|
}], loaderSettings: [{
|
|
151
145
|
type: Input
|
|
152
146
|
}] } });
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
6
|
import { EventEmitter, Injectable, Output, Component, HostBinding, Input, Directive, NgModule } from '@angular/core';
|
|
7
7
|
import { validatePackage } from '@progress/kendo-licensing';
|
|
8
|
-
import * as
|
|
8
|
+
import * as i2$1 from '@progress/kendo-angular-common';
|
|
9
9
|
import { isDocumentAvailable, anyChanged, EventsModule } from '@progress/kendo-angular-common';
|
|
10
10
|
import { toTree, toRows, toColumns, toData, HEADERS_ACTION, headersReducer, createDataTree, createLocalDataState, rootFields, fetchData, createDataState } from '@progress/kendo-pivotgrid-common';
|
|
11
11
|
export { averageAggregate, maxAggregate, minAggregate, sumAggregate } from '@progress/kendo-pivotgrid-common';
|
|
12
12
|
import { BehaviorSubject, Subscription } from 'rxjs';
|
|
13
13
|
import * as i2 from '@angular/common';
|
|
14
14
|
import { CommonModule } from '@angular/common';
|
|
15
|
-
import * as
|
|
15
|
+
import * as i4 from '@progress/kendo-angular-indicators';
|
|
16
16
|
import { IndicatorsModule } from '@progress/kendo-angular-indicators';
|
|
17
17
|
import { L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
18
18
|
|
|
@@ -23,56 +23,11 @@ const packageMetadata = {
|
|
|
23
23
|
name: '@progress/kendo-angular-pivotgrid',
|
|
24
24
|
productName: 'Kendo UI for Angular',
|
|
25
25
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
26
|
-
publishDate:
|
|
26
|
+
publishDate: 1652370365,
|
|
27
27
|
version: '',
|
|
28
28
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
/**
|
|
32
|
-
* @hidden
|
|
33
|
-
*/
|
|
34
|
-
const canCreateElement = () => isDocumentAvailable() && document.createElement;
|
|
35
|
-
/**
|
|
36
|
-
* @hidden
|
|
37
|
-
*/
|
|
38
|
-
let cachedScrollbarWidth = null;
|
|
39
|
-
/**
|
|
40
|
-
* @hidden
|
|
41
|
-
*/
|
|
42
|
-
const scrollbarWidth = () => {
|
|
43
|
-
if (cachedScrollbarWidth === null && canCreateElement()) {
|
|
44
|
-
const div = document.createElement("div");
|
|
45
|
-
div.style.cssText = "overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block";
|
|
46
|
-
div.innerHTML = " ";
|
|
47
|
-
document.body.appendChild(div);
|
|
48
|
-
cachedScrollbarWidth = div.offsetWidth - div.scrollWidth;
|
|
49
|
-
document.body.removeChild(div);
|
|
50
|
-
}
|
|
51
|
-
return cachedScrollbarWidth;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* @hidden
|
|
55
|
-
*/
|
|
56
|
-
const isPresent = (value) => value !== null && value !== undefined;
|
|
57
|
-
/**
|
|
58
|
-
* @hidden
|
|
59
|
-
* Returns whether two arrays contain the same values.
|
|
60
|
-
* Assumes array elements are primitive types
|
|
61
|
-
*/
|
|
62
|
-
const areSameArrays = (a1, a2) => {
|
|
63
|
-
const areArrays = (isPresent(a1) && Array.isArray(a1) && isPresent(a2) && Array.isArray(a2));
|
|
64
|
-
const areOfEqualLength = a1.length === a2.length;
|
|
65
|
-
if (!areArrays || !areOfEqualLength) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
for (let i = 0; i < a1.length; i++) {
|
|
69
|
-
if (a1[i] !== a2[i]) {
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return true;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
31
|
/**
|
|
77
32
|
* @hidden
|
|
78
33
|
*/
|
|
@@ -159,7 +114,7 @@ PivotGridCellDirective.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0",
|
|
|
159
114
|
[ngClass]="{
|
|
160
115
|
'k-i-arrow-chevron-up': expanded,
|
|
161
116
|
'k-i-arrow-chevron-down': !expanded
|
|
162
|
-
}"></span>{{ kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption }}`, isInline: true, directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type:
|
|
117
|
+
}"></span>{{ kendoPivotGridCell.data ? kendoPivotGridCell.data.fmtValue : kendoPivotGridCell.caption }}`, isInline: true, directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
163
118
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridCellDirective, decorators: [{
|
|
164
119
|
type: Component,
|
|
165
120
|
args: [{
|
|
@@ -279,7 +234,7 @@ const DEFAULT_LOADER_SETTINGS = {
|
|
|
279
234
|
* A sample component
|
|
280
235
|
*/
|
|
281
236
|
class PivotGridComponent {
|
|
282
|
-
constructor(hostEl, zone, dataService) {
|
|
237
|
+
constructor(hostEl, zone, dataService, _scrollbarWidthService) {
|
|
283
238
|
this.hostEl = hostEl;
|
|
284
239
|
this.zone = zone;
|
|
285
240
|
this.dataService = dataService;
|
|
@@ -296,9 +251,6 @@ class PivotGridComponent {
|
|
|
296
251
|
};
|
|
297
252
|
validatePackage(packageMetadata);
|
|
298
253
|
}
|
|
299
|
-
get scrollbarWidth() {
|
|
300
|
-
return `${scrollbarWidth()}px`;
|
|
301
|
-
}
|
|
302
254
|
/**
|
|
303
255
|
* Specify the type, size and color of the PivotGrid's loader.
|
|
304
256
|
*
|
|
@@ -335,8 +287,8 @@ class PivotGridComponent {
|
|
|
335
287
|
this.loadingSubscription.unsubscribe();
|
|
336
288
|
}
|
|
337
289
|
}
|
|
338
|
-
PivotGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: PivotGridDataService }], target: i0.ɵɵFactoryTarget.Component });
|
|
339
|
-
PivotGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PivotGridComponent, selector: "kendo-pivotgrid", inputs: { loaderSettings: "loaderSettings" }, host: { properties: { "class.k-pivotgrid": "this.hostClass"
|
|
290
|
+
PivotGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: PivotGridDataService }, { token: i2$1.ScrollbarWidthService }], target: i0.ɵɵFactoryTarget.Component });
|
|
291
|
+
PivotGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: PivotGridComponent, selector: "kendo-pivotgrid", inputs: { loaderSettings: "loaderSettings" }, host: { properties: { "class.k-pivotgrid": "this.hostClass" } }, providers: [
|
|
340
292
|
PivotGridDataService
|
|
341
293
|
], ngImport: i0, template: `
|
|
342
294
|
<span class="k-pivotgrid-empty-cell"></span>
|
|
@@ -358,7 +310,7 @@ PivotGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ver
|
|
|
358
310
|
>
|
|
359
311
|
</kendo-loader>
|
|
360
312
|
</div>
|
|
361
|
-
`, isInline: true, styles: ["\n /** TODO: Remove if added to themes */\n div.k-loader {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n "], components: [{ type: PivotGridTableComponent, selector: "kendo-pivotgrid-table", inputs: ["tableType"] }, { type:
|
|
313
|
+
`, isInline: true, styles: ["\n /** TODO: Remove if added to themes */\n div.k-loader {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n "], components: [{ type: PivotGridTableComponent, selector: "kendo-pivotgrid-table", inputs: ["tableType"] }, { type: i4.LoaderComponent, selector: "kendo-loader", inputs: ["type", "themeColor", "size"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
362
314
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: PivotGridComponent, decorators: [{
|
|
363
315
|
type: Component,
|
|
364
316
|
args: [{
|
|
@@ -397,12 +349,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
397
349
|
}
|
|
398
350
|
`]
|
|
399
351
|
}]
|
|
400
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: PivotGridDataService }]; }, propDecorators: { hostClass: [{
|
|
352
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: PivotGridDataService }, { type: i2$1.ScrollbarWidthService }]; }, propDecorators: { hostClass: [{
|
|
401
353
|
type: HostBinding,
|
|
402
354
|
args: ['class.k-pivotgrid']
|
|
403
|
-
}], scrollbarWidth: [{
|
|
404
|
-
type: HostBinding,
|
|
405
|
-
args: ['style.--kendo-scrollbar-width']
|
|
406
355
|
}], loaderSettings: [{
|
|
407
356
|
type: Input
|
|
408
357
|
}] } });
|
|
@@ -41,7 +41,7 @@ export declare type LoaderType = Partial<LoaderTypeSource>;
|
|
|
41
41
|
* Specifies the type, size and color of the PivotGrid's loader.
|
|
42
42
|
*/
|
|
43
43
|
export interface LoaderSettings {
|
|
44
|
-
size
|
|
45
|
-
themeColor
|
|
46
|
-
type
|
|
44
|
+
size?: LoaderSize;
|
|
45
|
+
themeColor?: LoaderThemeColor;
|
|
46
|
+
type?: LoaderType;
|
|
47
47
|
}
|
package/package.json
CHANGED
package/pivotgrid.component.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { AfterContentInit, AfterViewInit, ElementRef, NgZone, OnDestroy } from '@angular/core';
|
|
6
|
+
import { ScrollbarWidthService } from '@progress/kendo-angular-common';
|
|
6
7
|
import { PivotGridDataService } from './data-binding/pivotgrid-data.service';
|
|
7
8
|
import { LoaderSettings } from './models/loader-settings';
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
@@ -14,7 +15,6 @@ export declare class PivotGridComponent implements AfterViewInit, AfterContentIn
|
|
|
14
15
|
private zone;
|
|
15
16
|
private dataService;
|
|
16
17
|
hostClass: boolean;
|
|
17
|
-
get scrollbarWidth(): string;
|
|
18
18
|
/**
|
|
19
19
|
* Specify the type, size and color of the PivotGrid's loader.
|
|
20
20
|
*
|
|
@@ -29,7 +29,7 @@ export declare class PivotGridComponent implements AfterViewInit, AfterContentIn
|
|
|
29
29
|
private resizeObservers;
|
|
30
30
|
private _loaderSettings;
|
|
31
31
|
private loadingSubscription;
|
|
32
|
-
constructor(hostEl: ElementRef, zone: NgZone, dataService: PivotGridDataService);
|
|
32
|
+
constructor(hostEl: ElementRef, zone: NgZone, dataService: PivotGridDataService, _scrollbarWidthService: ScrollbarWidthService);
|
|
33
33
|
ngAfterViewInit(): void;
|
|
34
34
|
ngAfterContentInit(): void;
|
|
35
35
|
ngOnDestroy(): void;
|
package/esm2015/util.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { isDocumentAvailable } from "@progress/kendo-angular-common";
|
|
6
|
-
/**
|
|
7
|
-
* @hidden
|
|
8
|
-
*/
|
|
9
|
-
const canCreateElement = () => isDocumentAvailable() && document.createElement;
|
|
10
|
-
/**
|
|
11
|
-
* @hidden
|
|
12
|
-
*/
|
|
13
|
-
let cachedScrollbarWidth = null;
|
|
14
|
-
/**
|
|
15
|
-
* @hidden
|
|
16
|
-
*/
|
|
17
|
-
export const scrollbarWidth = () => {
|
|
18
|
-
if (cachedScrollbarWidth === null && canCreateElement()) {
|
|
19
|
-
const div = document.createElement("div");
|
|
20
|
-
div.style.cssText = "overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block";
|
|
21
|
-
div.innerHTML = " ";
|
|
22
|
-
document.body.appendChild(div);
|
|
23
|
-
cachedScrollbarWidth = div.offsetWidth - div.scrollWidth;
|
|
24
|
-
document.body.removeChild(div);
|
|
25
|
-
}
|
|
26
|
-
return cachedScrollbarWidth;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* @hidden
|
|
30
|
-
*/
|
|
31
|
-
export const isPresent = (value) => value !== null && value !== undefined;
|
|
32
|
-
/**
|
|
33
|
-
* @hidden
|
|
34
|
-
* Returns whether two arrays contain the same values.
|
|
35
|
-
* Assumes array elements are primitive types
|
|
36
|
-
*/
|
|
37
|
-
export const areSameArrays = (a1, a2) => {
|
|
38
|
-
const areArrays = (isPresent(a1) && Array.isArray(a1) && isPresent(a2) && Array.isArray(a2));
|
|
39
|
-
const areOfEqualLength = a1.length === a2.length;
|
|
40
|
-
if (!areArrays || !areOfEqualLength) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
for (let i = 0; i < a1.length; i++) {
|
|
44
|
-
if (a1[i] !== a2[i]) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return true;
|
|
49
|
-
};
|
package/util.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
*/
|
|
8
|
-
export declare const scrollbarWidth: () => number;
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
*/
|
|
12
|
-
export declare const isPresent: (value: any) => boolean;
|
|
13
|
-
/**
|
|
14
|
-
* @hidden
|
|
15
|
-
* Returns whether two arrays contain the same values.
|
|
16
|
-
* Assumes array elements are primitive types
|
|
17
|
-
*/
|
|
18
|
-
export declare const areSameArrays: (a1: any[], a2: any[]) => boolean;
|