🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

angular-pivot-table

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-pivot-table - npm Package Compare versions

Comparing version

to
0.0.2

esm2015/lib/models/Configs.model.js

2

angular-pivot-table.metadata.json

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":4,"metadata":{"AngularPivotTableService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":2,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor"}]},"statics":{"ɵprov":{}}},"AngularPivotTableComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":2,"character":1},"arguments":[{"selector":"db-angular-pivot-table","template":"\n <p>\n angular-pivot-table works!\n </p>\n ","styles":[]}]}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}]}},"AngularPivotTableModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":5,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"AngularPivotTableComponent"}],"imports":[],"exports":[{"__symbolic":"reference","name":"AngularPivotTableComponent"}]}]}],"members":{}}},"origins":{"AngularPivotTableService":"./lib/angular-pivot-table.service","AngularPivotTableComponent":"./lib/angular-pivot-table.component","AngularPivotTableModule":"./lib/angular-pivot-table.module"},"importAs":"angular-pivot-table"}
{"__symbolic":"module","version":4,"metadata":{"AngularPivotTableService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":2,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor"}]},"statics":{"ɵprov":{}}},"AngularPivotTableComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"db-angular-pivot-table","template":"<table [attr.class]=\"'db-table-view' + configs.css.table_class\">\r\n <thead>\r\n <tr>\r\n <th class=\"header-corner\">\r\n <table class=\"header-corner\">\r\n <tr>\r\n <td class=\"corner-top\">{{configs.columns}}</td>\r\n </tr>\r\n <tr>\r\n <td class=\"corner-bottom\">{{configs.rows}}</td>\r\n </tr>\r\n </table>\r\n </th>\r\n <th *ngFor=\"let header of processed_headers\">\r\n {{header}}\r\n </th>\r\n <th>\r\n Total\r\n </th>\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <tr *ngFor=\"let row of processed_data\">\r\n <td *ngFor=\"let col of row\">\r\n {{col}}\r\n </td>\r\n </tr>\r\n </tbody>\r\n</table>","styles":[".db-table-view{border:1px solid grey;border-collapse:collapse;border-spacing:0;color:#4b4b4b;display:table;line-height:1.5em;max-width:100%;overflow:auto;word-break:normal;word-break:keep-all}.db-table-view table.header-corner{border-collapse:collapse;width:100%}.db-table-view table.header-corner td{font-weight:400}.db-table-view table.header-corner td.corner-top{border-width:0 0 1px}.db-table-view table.header-corner td.corner-bottom{border-width:0}.db-table-view tbody tr td:first-child{font-weight:600}.db-table-view tr.selected{background-color:#e2e7eb}.db-table-view tr th{border:1px solid #cdd5dc;box-sizing:border-box;color:#181818;font-size:1rem;font-weight:600;line-height:1.25;padding:.5rem;position:relative;vertical-align:middle}.db-table-view tr th.header-corner{padding:0}.db-table-view tr td{border:1px solid #cdd5dc;box-sizing:border-box;padding:.5rem;position:relative;vertical-align:middle}"]}]}],"members":{"source":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":10,"character":3}}]}],"configs":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"validateConfigs":[{"__symbolic":"method"}],"setDefaultConfigs":[{"__symbolic":"method"}]}},"AngularPivotTableModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"AngularPivotTableComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":7,"character":4}],"exports":[{"__symbolic":"reference","name":"AngularPivotTableComponent"}]}]}],"members":{}}},"origins":{"AngularPivotTableService":"./lib/angular-pivot-table.service","AngularPivotTableComponent":"./lib/angular-pivot-table.component","AngularPivotTableModule":"./lib/angular-pivot-table.module"},"importAs":"angular-pivot-table"}
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :
typeof define === 'function' && define.amd ? define('angular-pivot-table', ['exports', '@angular/core'], factory) :
(global = global || self, factory(global['angular-pivot-table'] = {}, global.ng.core));
}(this, (function (exports, i0) { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('projects/angular-pivot-table/src/lib/store/store'), require('@angular/common')) :
typeof define === 'function' && define.amd ? define('angular-pivot-table', ['exports', '@angular/core', 'projects/angular-pivot-table/src/lib/store/store', '@angular/common'], factory) :
(global = global || self, factory(global['angular-pivot-table'] = {}, global.ng.core, global.store, global.ng.common));
}(this, (function (exports, i0, store, common) { 'use strict';

@@ -22,5 +22,45 @@ var AngularPivotTableService = /** @class */ (function () {

function AngularPivotTableComponent() {
this.source = [];
this.default_configs = {
rows: '',
columns: '',
css: {
row_selection_class: 'selected',
header_class: '',
table_class: ''
},
data_loading_text: 'Loading...',
row_class_function: function () { return true; },
row_select_function: function () { return true; }
};
this.store = new store.Store();
this.processed_data = [];
this.processed_headers = [];
}
AngularPivotTableComponent.prototype.ngOnInit = function () {
this.validateConfigs();
this.setDefaultConfigs();
};
AngularPivotTableComponent.prototype.ngOnChanges = function () {
this.validateConfigs();
this.setDefaultConfigs();
this.store.processData(this.source, this.configs);
this.processed_data = this.store.getProcessedData();
this.processed_headers = this.store.getProcessedHeaders();
};
AngularPivotTableComponent.prototype.validateConfigs = function () {
if (!this.source) {
window.console.warn('source can\'t be empty!');
return;
}
if (!this.configs) {
window.console.warn('configs can\'t be empty!');
return;
}
};
AngularPivotTableComponent.prototype.setDefaultConfigs = function () {
this.configs = Object.assign({}, this.default_configs, this.configs);
// Deep clone.
this.configs.css = Object.assign({}, this.default_configs.css, this.configs.css);
};
return AngularPivotTableComponent;

@@ -31,6 +71,11 @@ }());

selector: 'db-angular-pivot-table',
template: "\n <p>\n angular-pivot-table works!\n </p>\n "
template: "<table [attr.class]=\"'db-table-view' + configs.css.table_class\">\r\n <thead>\r\n <tr>\r\n <th class=\"header-corner\">\r\n <table class=\"header-corner\">\r\n <tr>\r\n <td class=\"corner-top\">{{configs.columns}}</td>\r\n </tr>\r\n <tr>\r\n <td class=\"corner-bottom\">{{configs.rows}}</td>\r\n </tr>\r\n </table>\r\n </th>\r\n <th *ngFor=\"let header of processed_headers\">\r\n {{header}}\r\n </th>\r\n <th>\r\n Total\r\n </th>\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <tr *ngFor=\"let row of processed_data\">\r\n <td *ngFor=\"let col of row\">\r\n {{col}}\r\n </td>\r\n </tr>\r\n </tbody>\r\n</table>",
styles: [".db-table-view{border:1px solid grey;border-collapse:collapse;border-spacing:0;color:#4b4b4b;display:table;line-height:1.5em;max-width:100%;overflow:auto;word-break:normal;word-break:keep-all}.db-table-view table.header-corner{border-collapse:collapse;width:100%}.db-table-view table.header-corner td{font-weight:400}.db-table-view table.header-corner td.corner-top{border-width:0 0 1px}.db-table-view table.header-corner td.corner-bottom{border-width:0}.db-table-view tbody tr td:first-child{font-weight:600}.db-table-view tr.selected{background-color:#e2e7eb}.db-table-view tr th{border:1px solid #cdd5dc;box-sizing:border-box;color:#181818;font-size:1rem;font-weight:600;line-height:1.25;padding:.5rem;position:relative;vertical-align:middle}.db-table-view tr th.header-corner{padding:0}.db-table-view tr td{border:1px solid #cdd5dc;box-sizing:border-box;padding:.5rem;position:relative;vertical-align:middle}"]
},] }
];
AngularPivotTableComponent.ctorParameters = function () { return []; };
AngularPivotTableComponent.propDecorators = {
source: [{ type: i0.Input }],
configs: [{ type: i0.Input }]
};

@@ -45,3 +90,5 @@ var AngularPivotTableModule = /** @class */ (function () {

declarations: [AngularPivotTableComponent],
imports: [],
imports: [
common.CommonModule
],
exports: [AngularPivotTableComponent]

@@ -48,0 +95,0 @@ },] }

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core")):"function"==typeof define&&define.amd?define("angular-pivot-table",["exports","@angular/core"],t):t((e=e||self)["angular-pivot-table"]={},e.ng.core)}(this,(function(e,t){"use strict";var n=function(){};n.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new n},token:n,providedIn:"root"}),n.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],n.ctorParameters=function(){return[]};var o=function(){function e(){}return e.prototype.ngOnInit=function(){},e}();o.decorators=[{type:t.Component,args:[{selector:"db-angular-pivot-table",template:"\n <p>\n angular-pivot-table works!\n </p>\n "}]}],o.ctorParameters=function(){return[]};var r=function(){};r.decorators=[{type:t.NgModule,args:[{declarations:[o],imports:[],exports:[o]}]}],e.AngularPivotTableComponent=o,e.AngularPivotTableModule=r,e.AngularPivotTableService=n,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("projects/angular-pivot-table/src/lib/store/store"),require("@angular/common")):"function"==typeof define&&define.amd?define("angular-pivot-table",["exports","@angular/core","projects/angular-pivot-table/src/lib/store/store","@angular/common"],t):t((e=e||self)["angular-pivot-table"]={},e.ng.core,e.store,e.ng.common)}(this,(function(e,t,r,o){"use strict";var n=function(){};n.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new n},token:n,providedIn:"root"}),n.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],n.ctorParameters=function(){return[]};var s=function(){function e(){this.source=[],this.default_configs={rows:"",columns:"",css:{row_selection_class:"selected",header_class:"",table_class:""},data_loading_text:"Loading...",row_class_function:function(){return!0},row_select_function:function(){return!0}},this.store=new r.Store,this.processed_data=[],this.processed_headers=[]}return e.prototype.ngOnInit=function(){this.validateConfigs(),this.setDefaultConfigs()},e.prototype.ngOnChanges=function(){this.validateConfigs(),this.setDefaultConfigs(),this.store.processData(this.source,this.configs),this.processed_data=this.store.getProcessedData(),this.processed_headers=this.store.getProcessedHeaders()},e.prototype.validateConfigs=function(){this.source?this.configs||window.console.warn("configs can't be empty!"):window.console.warn("source can't be empty!")},e.prototype.setDefaultConfigs=function(){this.configs=Object.assign({},this.default_configs,this.configs),this.configs.css=Object.assign({},this.default_configs.css,this.configs.css)},e}();s.decorators=[{type:t.Component,args:[{selector:"db-angular-pivot-table",template:'<table [attr.class]="\'db-table-view\' + configs.css.table_class">\r\n <thead>\r\n <tr>\r\n <th class="header-corner">\r\n <table class="header-corner">\r\n <tr>\r\n <td class="corner-top">{{configs.columns}}</td>\r\n </tr>\r\n <tr>\r\n <td class="corner-bottom">{{configs.rows}}</td>\r\n </tr>\r\n </table>\r\n </th>\r\n <th *ngFor="let header of processed_headers">\r\n {{header}}\r\n </th>\r\n <th>\r\n Total\r\n </th>\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <tr *ngFor="let row of processed_data">\r\n <td *ngFor="let col of row">\r\n {{col}}\r\n </td>\r\n </tr>\r\n </tbody>\r\n</table>',styles:[".db-table-view{border:1px solid grey;border-collapse:collapse;border-spacing:0;color:#4b4b4b;display:table;line-height:1.5em;max-width:100%;overflow:auto;word-break:normal;word-break:keep-all}.db-table-view table.header-corner{border-collapse:collapse;width:100%}.db-table-view table.header-corner td{font-weight:400}.db-table-view table.header-corner td.corner-top{border-width:0 0 1px}.db-table-view table.header-corner td.corner-bottom{border-width:0}.db-table-view tbody tr td:first-child{font-weight:600}.db-table-view tr.selected{background-color:#e2e7eb}.db-table-view tr th{border:1px solid #cdd5dc;box-sizing:border-box;color:#181818;font-size:1rem;font-weight:600;line-height:1.25;padding:.5rem;position:relative;vertical-align:middle}.db-table-view tr th.header-corner{padding:0}.db-table-view tr td{border:1px solid #cdd5dc;box-sizing:border-box;padding:.5rem;position:relative;vertical-align:middle}"]}]}],s.ctorParameters=function(){return[]},s.propDecorators={source:[{type:t.Input}],configs:[{type:t.Input}]};var a=function(){};a.decorators=[{type:t.NgModule,args:[{declarations:[s],imports:[o.CommonModule],exports:[s]}]}],e.AngularPivotTableComponent=s,e.AngularPivotTableModule=a,e.AngularPivotTableService=n,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=angular-pivot-table.umd.min.js.map

@@ -1,6 +0,48 @@

import { Component } from '@angular/core';
import { Component, Input } from '@angular/core';
import { Store } from 'projects/angular-pivot-table/src/lib/store/store';
export class AngularPivotTableComponent {
constructor() { }
constructor() {
this.source = [];
this.default_configs = {
rows: '',
columns: '',
css: {
row_selection_class: 'selected',
header_class: '',
table_class: ''
},
data_loading_text: 'Loading...',
row_class_function: () => true,
row_select_function: () => true
};
this.store = new Store();
this.processed_data = [];
this.processed_headers = [];
}
ngOnInit() {
this.validateConfigs();
this.setDefaultConfigs();
}
ngOnChanges() {
this.validateConfigs();
this.setDefaultConfigs();
this.store.processData(this.source, this.configs);
this.processed_data = this.store.getProcessedData();
this.processed_headers = this.store.getProcessedHeaders();
}
validateConfigs() {
if (!this.source) {
window.console.warn('source can\'t be empty!');
return;
}
if (!this.configs) {
window.console.warn('configs can\'t be empty!');
return;
}
}
setDefaultConfigs() {
this.configs = Object.assign({}, this.default_configs, this.configs);
// Deep clone.
this.configs.css = Object.assign({}, this.default_configs.css, this.configs.css);
}
}

@@ -10,10 +52,11 @@ AngularPivotTableComponent.decorators = [

selector: 'db-angular-pivot-table',
template: `
<p>
angular-pivot-table works!
</p>
`
template: "<table [attr.class]=\"'db-table-view' + configs.css.table_class\">\r\n <thead>\r\n <tr>\r\n <th class=\"header-corner\">\r\n <table class=\"header-corner\">\r\n <tr>\r\n <td class=\"corner-top\">{{configs.columns}}</td>\r\n </tr>\r\n <tr>\r\n <td class=\"corner-bottom\">{{configs.rows}}</td>\r\n </tr>\r\n </table>\r\n </th>\r\n <th *ngFor=\"let header of processed_headers\">\r\n {{header}}\r\n </th>\r\n <th>\r\n Total\r\n </th>\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <tr *ngFor=\"let row of processed_data\">\r\n <td *ngFor=\"let col of row\">\r\n {{col}}\r\n </td>\r\n </tr>\r\n </tbody>\r\n</table>",
styles: [".db-table-view{border:1px solid grey;border-collapse:collapse;border-spacing:0;color:#4b4b4b;display:table;line-height:1.5em;max-width:100%;overflow:auto;word-break:normal;word-break:keep-all}.db-table-view table.header-corner{border-collapse:collapse;width:100%}.db-table-view table.header-corner td{font-weight:400}.db-table-view table.header-corner td.corner-top{border-width:0 0 1px}.db-table-view table.header-corner td.corner-bottom{border-width:0}.db-table-view tbody tr td:first-child{font-weight:600}.db-table-view tr.selected{background-color:#e2e7eb}.db-table-view tr th{border:1px solid #cdd5dc;box-sizing:border-box;color:#181818;font-size:1rem;font-weight:600;line-height:1.25;padding:.5rem;position:relative;vertical-align:middle}.db-table-view tr th.header-corner{padding:0}.db-table-view tr td{border:1px solid #cdd5dc;box-sizing:border-box;padding:.5rem;position:relative;vertical-align:middle}"]
},] }
];
AngularPivotTableComponent.ctorParameters = () => [];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5ndWxhci1waXZvdC10YWJsZS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyLXBpdm90LXRhYmxlL3NyYy9saWIvYW5ndWxhci1waXZvdC10YWJsZS5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBVSxNQUFNLGVBQWUsQ0FBQztBQVlsRCxNQUFNLE9BQU8sMEJBQTBCO0lBRXJDLGdCQUFnQixDQUFDO0lBRWpCLFFBQVE7SUFDUixDQUFDOzs7WUFmRixTQUFTLFNBQUM7Z0JBQ1QsUUFBUSxFQUFFLHdCQUF3QjtnQkFDbEMsUUFBUSxFQUFFOzs7O0dBSVQ7YUFHRiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENvbXBvbmVudCwgT25Jbml0IH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5cbkBDb21wb25lbnQoe1xuICBzZWxlY3RvcjogJ2RiLWFuZ3VsYXItcGl2b3QtdGFibGUnLFxuICB0ZW1wbGF0ZTogYFxuICAgIDxwPlxuICAgICAgYW5ndWxhci1waXZvdC10YWJsZSB3b3JrcyFcbiAgICA8L3A+XG4gIGAsXG4gIHN0eWxlczogW1xuICBdXG59KVxuZXhwb3J0IGNsYXNzIEFuZ3VsYXJQaXZvdFRhYmxlQ29tcG9uZW50IGltcGxlbWVudHMgT25Jbml0IHtcblxuICBjb25zdHJ1Y3RvcigpIHsgfVxuXG4gIG5nT25Jbml0KCk6IHZvaWQge1xuICB9XG5cbn1cbiJdfQ==
AngularPivotTableComponent.propDecorators = {
source: [{ type: Input }],
configs: [{ type: Input }]
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5ndWxhci1waXZvdC10YWJsZS5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyLXBpdm90LXRhYmxlL3NyYy9saWIvYW5ndWxhci1waXZvdC10YWJsZS5jb21wb25lbnQud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VjdC5hc3NpZ24oe30sIHRoaXMuZGVmYXVsdF9jb25maWdzLmNzcywgdGhpcy5jb25maWdzLmNzcyk7XG4gIH1cblxufVxuIl19

@@ -0,1 +1,2 @@

import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

@@ -8,6 +9,8 @@ import { AngularPivotTableComponent } from './angular-pivot-table.component';

declarations: [AngularPivotTableComponent],
imports: [],
imports: [
CommonModule
],
exports: [AngularPivotTableComponent]
},] }
];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5ndWxhci1waXZvdC10YWJsZS5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyLXBpdm90LXRhYmxlL3NyYy9saWIvYW5ndWxhci1waXZvdC10YWJsZS5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsMEJBQTBCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQVU3RSxNQUFNLE9BQU8sdUJBQXVCOzs7WUFObkMsUUFBUSxTQUFDO2dCQUNSLFlBQVksRUFBRSxDQUFDLDBCQUEwQixDQUFDO2dCQUMxQyxPQUFPLEVBQUUsRUFDUjtnQkFDRCxPQUFPLEVBQUUsQ0FBQywwQkFBMEIsQ0FBQzthQUN0QyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IE5nTW9kdWxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBBbmd1bGFyUGl2b3RUYWJsZUNvbXBvbmVudCB9IGZyb20gJy4vYW5ndWxhci1waXZvdC10YWJsZS5jb21wb25lbnQnO1xuXG5cblxuQE5nTW9kdWxlKHtcbiAgZGVjbGFyYXRpb25zOiBbQW5ndWxhclBpdm90VGF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ZSh7XG4gIGRlY2xhcmF0aW9uczogW0FuZ3VsYXJQaXZvdFRhYmxlQ29tcG9uZW50XSxcbiAgaW1wb3J0czogW1xuICAgIENvbW1vbk1vZHVsZVxuICBdLFxuICBleHBvcnRzOiBbQW5ndWxhclBpdm90VGFibGVDb21wb25lbnRdXG59KVxuZXhwb3J0IGNsYXNzIEFuZ3VsYXJQaXZvdFRhYmxlTW9kdWxlIHsgfVxuIl19

@@ -1,2 +0,4 @@

import { ɵɵdefineInjectable, Injectable, Component, NgModule } from '@angular/core';
import { ɵɵdefineInjectable, Injectable, Component, Input, NgModule } from '@angular/core';
import { Store } from 'projects/angular-pivot-table/src/lib/store/store';
import { CommonModule } from '@angular/common';

@@ -15,5 +17,46 @@ class AngularPivotTableService {

class AngularPivotTableComponent {
constructor() { }
constructor() {
this.source = [];
this.default_configs = {
rows: '',
columns: '',
css: {
row_selection_class: 'selected',
header_class: '',
table_class: ''
},
data_loading_text: 'Loading...',
row_class_function: () => true,
row_select_function: () => true
};
this.store = new Store();
this.processed_data = [];
this.processed_headers = [];
}
ngOnInit() {
this.validateConfigs();
this.setDefaultConfigs();
}
ngOnChanges() {
this.validateConfigs();
this.setDefaultConfigs();
this.store.processData(this.source, this.configs);
this.processed_data = this.store.getProcessedData();
this.processed_headers = this.store.getProcessedHeaders();
}
validateConfigs() {
if (!this.source) {
window.console.warn('source can\'t be empty!');
return;
}
if (!this.configs) {
window.console.warn('configs can\'t be empty!');
return;
}
}
setDefaultConfigs() {
this.configs = Object.assign({}, this.default_configs, this.configs);
// Deep clone.
this.configs.css = Object.assign({}, this.default_configs.css, this.configs.css);
}
}

@@ -23,10 +66,11 @@ AngularPivotTableComponent.decorators = [

selector: 'db-angular-pivot-table',
template: `
<p>
angular-pivot-table works!
</p>
`
template: "<table [attr.class]=\"'db-table-view' + configs.css.table_class\">\r\n <thead>\r\n <tr>\r\n <th class=\"header-corner\">\r\n <table class=\"header-corner\">\r\n <tr>\r\n <td class=\"corner-top\">{{configs.columns}}</td>\r\n </tr>\r\n <tr>\r\n <td class=\"corner-bottom\">{{configs.rows}}</td>\r\n </tr>\r\n </table>\r\n </th>\r\n <th *ngFor=\"let header of processed_headers\">\r\n {{header}}\r\n </th>\r\n <th>\r\n Total\r\n </th>\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <tr *ngFor=\"let row of processed_data\">\r\n <td *ngFor=\"let col of row\">\r\n {{col}}\r\n </td>\r\n </tr>\r\n </tbody>\r\n</table>",
styles: [".db-table-view{border:1px solid grey;border-collapse:collapse;border-spacing:0;color:#4b4b4b;display:table;line-height:1.5em;max-width:100%;overflow:auto;word-break:normal;word-break:keep-all}.db-table-view table.header-corner{border-collapse:collapse;width:100%}.db-table-view table.header-corner td{font-weight:400}.db-table-view table.header-corner td.corner-top{border-width:0 0 1px}.db-table-view table.header-corner td.corner-bottom{border-width:0}.db-table-view tbody tr td:first-child{font-weight:600}.db-table-view tr.selected{background-color:#e2e7eb}.db-table-view tr th{border:1px solid #cdd5dc;box-sizing:border-box;color:#181818;font-size:1rem;font-weight:600;line-height:1.25;padding:.5rem;position:relative;vertical-align:middle}.db-table-view tr th.header-corner{padding:0}.db-table-view tr td{border:1px solid #cdd5dc;box-sizing:border-box;padding:.5rem;position:relative;vertical-align:middle}"]
},] }
];
AngularPivotTableComponent.ctorParameters = () => [];
AngularPivotTableComponent.propDecorators = {
source: [{ type: Input }],
configs: [{ type: Input }]
};

@@ -38,3 +82,5 @@ class AngularPivotTableModule {

declarations: [AngularPivotTableComponent],
imports: [],
imports: [
CommonModule
],
exports: [AngularPivotTableComponent]

@@ -41,0 +87,0 @@ },] }

import { OnInit } from '@angular/core';
import { Configs } from 'projects/angular-pivot-table/src/lib/models/Configs.model';
import { Store } from 'projects/angular-pivot-table/src/lib/store/store';
export declare class AngularPivotTableComponent implements OnInit {
source: any[];
configs: Configs;
default_configs: Configs;
store: Store;
processed_data: any[];
processed_headers: any[];
constructor();
ngOnInit(): void;
ngOnChanges(): void;
validateConfigs(): void;
setDefaultConfigs(): void;
}
{
"name": "angular-pivot-table",
"version": "0.0.1",
"version": "0.0.2",
"peerDependencies": {

@@ -11,2 +11,26 @@ "@angular/common": "^10.0.14",

},
"homepage": "https://debabratapatra.github.io/pages/angular-pivot-table/demo",
"license": "MIT",
"author": {
"name": "Debabrata Patra",
"email": "debabratapatra12@gmail.com",
"url": "https://debabratapatra.github.io/"
},
"repository": {
"type": "git",
"url": "https://github.com/debabratapatra/angular-pivot-table.git"
},
"bugs": {
"url": "https://github.com/debabratapatra/angular-pivot-table/issues",
"email": "debabratapatra12@gmail.com"
},
"keywords": [
"Angular",
"Pivot Table",
"Angular Pivot Table",
"Angular 4",
"Angular 5",
"Angular 6",
"Angular 10"
],
"main": "bundles/angular-pivot-table.umd.js",

@@ -13,0 +37,0 @@ "module": "fesm2015/angular-pivot-table.js",

@@ -1,24 +0,88 @@

# AngularPivotTable
# Angular Pivot Table
Angular Tree Grid is a simple pivot table built in Angular. If data needs to be grouped by fields then check out this <a href="https://github.com/debabratapatra/ngtreegrid" target="_blank">ngtreegrid</a> Package. If header needs to be fixed/freezed and body needs to be scrollable then check out this <a href="https://debabratapatra.github.io/pages/angular-fix-header-grid/demo" target="_blank">Fix Header Grid</a> Package.
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.0.14.
## Demo
## Code scaffolding
Click <a href="https://debabratapatra.github.io/pages/angular-pivot-table/demo" target="_blank">here</a> for demo. This readme is the documentation. Visit my <a href="https://debabratapatra.github.io" target="_blank">Website</a> to know other packages.
<div>
<img src="https://debabratapatra.github.io/resources/images/cards/angular-pivot-table.png" alt="Loading" />
</div>
Run `ng generate component component-name --project angular-pivot-table` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project angular-pivot-table`.
> Note: Don't forget to add `--project angular-pivot-table` or else it will be added to the default project in your `angular.json` file.
## Donate :hearts:
## Build
Please consider a <a href="https://debabratapatra.github.io/donate.html" target="_blank">donation</a> if it is useful to you.
Run `ng build angular-pivot-table` to build the project. The build artifacts will be stored in the `dist/` directory.
## Installation
## Publishing
```bash
npm i angular-pivot-table
```
After building your library with `ng build angular-pivot-table`, go to the dist folder `cd dist/angular-pivot-table` and run `npm publish`.
## Usage
## Running unit tests
### Import
Import NgtreegridModule Module in your application module.
Run `ng test angular-pivot-table` to execute the unit tests via [Karma](https://karma-runner.github.io).
```javascript
import {AngularPivotTableModule} from 'angular-pivot-table';
```
## Further help
Add it to your imports array.
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
```javascript
@NgModule({
imports: [
AngularPivotTableModule
]
})
```
### Data
Data should look like below.
```
source= [
{'author': 'Deba', 'book': 'Angular'},
{'author': 'Deba', 'book': 'Physics'},
{'author': 'Aditya', 'book': 'Angular'}
];
```
### Configs
Below are configs that can be set
#### Table Configurations
| Field |Type |Default | Description |
|---|---|---|---|
| rows | string | n/a | Mandatory field. It is name of the column that will be treated as rows |
| columns | string | n/a | Mandatory field. It is name of the column that will be treated as columns |
| data_loading_text | string | 'Loading...' | Loading place holder. This will be displayed when data is empty. |
| row_class_function | Function | n/a | Callback function for row class. A custom class can be returned which will be added to the row. |
| css | Object | n/a | Css class for icons. See Below |
##### css
| Field |Type |Default | Description |
|---|---|---|---|
| row_selection_class | string | n/a | CSS Class for selected row. |
| header_class | string | n/a | CSS Class for header. |
| table_class | string | n/a | CSS Class for Table. |
#### Example
```
configs: any = {
'rows': 'author',
'columns': 'book'
};
```
### HTML
Add below node to your html.
```
<db-angular-pivot-table [source]="source" [configs]='configs'></db-angular-pivot-table>
```
### Can I hire you guys?
Yes. Please contact us at <a href="mailto:debabratapatra12@gmail.com">debabratapatra12@gmail.com</a> for any professional support. We will be happy to work with you!
## License
This project is licensed under the MIT license.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet