@net7/boilerplate-dataviz 4.9.7 → 5.0.0
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/{esm2020 → esm2022}/lib/components/card/card.mjs +4 -4
- package/esm2022/lib/components/card-state-wrapper/card-state-wrapper.mjs +57 -0
- package/{esm2020 → esm2022}/lib/components/card-text-item/card-text-item.mjs +4 -4
- package/{esm2020 → esm2022}/lib/components/data-widget-wrapper/data-widget-wrapper.mjs +4 -4
- package/{esm2020 → esm2022}/lib/components/datepicker-wrapper/datepicker-wrapper.mjs +4 -4
- package/esm2022/lib/data-sources/card-items/apex-chart-item.ds.mjs +26 -0
- package/esm2022/lib/data-sources/card-items/map-item.ds.mjs +33 -0
- package/{esm2020 → esm2022}/lib/data-sources/data-widget-wrapper.ds.mjs +1 -1
- package/esm2022/lib/data-sources/datepicker-wrapper.ds.mjs +55 -0
- package/esm2022/lib/event-handlers/datepicker-wrapper.eh.mjs +27 -0
- package/esm2022/lib/layout/card-example-layout/card-example-layout.eh.mjs +23 -0
- package/{esm2020 → esm2022}/lib/layout/card-example-layout/card-example-layout.mjs +5 -5
- package/{esm2020 → esm2022}/lib/layout/example-layout/example-layout.eh.mjs +1 -1
- package/{esm2020 → esm2022}/lib/layout/example-layout/example-layout.mjs +5 -5
- package/esm2022/lib/models/apex/apex-handler.mjs +12 -0
- package/{esm2020 → esm2022}/lib/models/apex/apex-helpers.mjs +1 -1
- package/esm2022/lib/models/card-loader.mjs +127 -0
- package/{esm2020 → esm2022}/lib/n7-boilerplate-dataviz.module.mjs +21 -21
- package/{fesm2020 → fesm2022}/net7-boilerplate-dataviz.mjs +61 -60
- package/{fesm2015 → fesm2022}/net7-boilerplate-dataviz.mjs.map +1 -1
- package/lib/components/card/card.d.ts +1 -1
- package/lib/components/card-state-wrapper/card-state-wrapper.d.ts +1 -1
- package/lib/components/card-text-item/card-text-item.d.ts +2 -2
- package/lib/components/data-widget-wrapper/data-widget-wrapper.d.ts +1 -1
- package/lib/components/datepicker-wrapper/datepicker-wrapper.d.ts +1 -1
- package/lib/layout/card-example-layout/card-example-layout.d.ts +1 -1
- package/lib/layout/example-layout/example-layout.d.ts +1 -1
- package/lib/types/card-item.types.d.ts +1 -1
- package/lib/types/card.types.d.ts +7 -7
- package/lib/types/response.types.d.ts +3 -3
- package/package.json +5 -11
- package/esm2020/lib/components/card-state-wrapper/card-state-wrapper.mjs +0 -57
- package/esm2020/lib/data-sources/card-items/apex-chart-item.ds.mjs +0 -26
- package/esm2020/lib/data-sources/card-items/map-item.ds.mjs +0 -33
- package/esm2020/lib/data-sources/datepicker-wrapper.ds.mjs +0 -55
- package/esm2020/lib/event-handlers/datepicker-wrapper.eh.mjs +0 -27
- package/esm2020/lib/layout/card-example-layout/card-example-layout.eh.mjs +0 -23
- package/esm2020/lib/models/apex/apex-handler.mjs +0 -12
- package/esm2020/lib/models/card-loader.mjs +0 -127
- package/fesm2015/net7-boilerplate-dataviz.mjs +0 -1045
- package/fesm2020/net7-boilerplate-dataviz.mjs.map +0 -1
- /package/{esm2020 → esm2022}/lib/components/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/data-sources/card-items/data-widget-item.ds.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/data-sources/card-items/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/data-sources/card-items/inner-title-item.ds.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/data-sources/card-items/select-item.ds.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/data-sources/card-items/table-item.ds.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/data-sources/card-items/text-item.ds.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/data-sources/card.ds.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/data-sources/graph.ds.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/data-sources/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/data-sources/inner-title.ds.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/data-sources/widget.ds.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/event-handlers/card.eh.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/event-handlers/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/layout/card-example-layout/card-example-layout.config.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/layout/card-example-layout/card-example-layout.ds.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/layout/example-layout/example-layout.config.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/layout/example-layout/example-layout.ds.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/layout/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/apex/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/apex/transformers/bar-chart.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/apex/transformers/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/apex/transformers/line-chart.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/apex/transformers/pie-chart.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/apex/transformers/radar-chart.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/apex/transformers/radialbar-chart.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/models/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/types/card-item.types.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/types/card.types.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/types/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/types/response.types.mjs +0 -0
- /package/{esm2020 → esm2022}/net7-boilerplate-dataviz.mjs +0 -0
- /package/{esm2020 → esm2022}/public-api.mjs +0 -0
|
@@ -1,1045 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Input, ViewContainerRef, ViewChild, NgModule } from '@angular/core';
|
|
3
|
-
import * as i1 from '@angular/common';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
import * as i2 from '@net7/components';
|
|
6
|
-
import { DATA_WIDGET_MOCK, DvComponentsLibModule } from '@net7/components';
|
|
7
|
-
import * as i1$1 from '@net7/boilerplate-common';
|
|
8
|
-
import { AbstractLayout, N7BoilerplateCommonModule } from '@net7/boilerplate-common';
|
|
9
|
-
import { delay, filter, first } from 'rxjs/operators';
|
|
10
|
-
import { LayoutDataSource, EventHandler, DataSource } from '@net7/core';
|
|
11
|
-
import { isObject, merge } from 'lodash';
|
|
12
|
-
import { BehaviorSubject, forkJoin } from 'rxjs';
|
|
13
|
-
import * as i2$1 from '@angular/router';
|
|
14
|
-
|
|
15
|
-
class DataWidgetWrapperComponent {
|
|
16
|
-
}
|
|
17
|
-
DataWidgetWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DataWidgetWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
18
|
-
DataWidgetWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DataWidgetWrapperComponent, selector: "dv-data-widget-wrapper", inputs: { data: "data" }, ngImport: i0, template: "<div class=\"dv-data-widget-wrapper {{ data && data.classes || '' }}\">\n <ng-content></ng-content>\n</div>" });
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DataWidgetWrapperComponent, decorators: [{
|
|
20
|
-
type: Component,
|
|
21
|
-
args: [{ selector: 'dv-data-widget-wrapper', template: "<div class=\"dv-data-widget-wrapper {{ data && data.classes || '' }}\">\n <ng-content></ng-content>\n</div>" }]
|
|
22
|
-
}], propDecorators: { data: [{
|
|
23
|
-
type: Input
|
|
24
|
-
}] } });
|
|
25
|
-
|
|
26
|
-
class DatepickerWrapperComponent {
|
|
27
|
-
onClick(payload) {
|
|
28
|
-
if (!this.emit)
|
|
29
|
-
return;
|
|
30
|
-
this.emit('click', payload);
|
|
31
|
-
}
|
|
32
|
-
toggleDropDown(payload) {
|
|
33
|
-
if (!this.emit)
|
|
34
|
-
return;
|
|
35
|
-
this.emit('toggle', payload);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
DatepickerWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DatepickerWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
39
|
-
DatepickerWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DatepickerWrapperComponent, selector: "dv-datepicker-wrapper", inputs: { data: "data", emit: "emit" }, ngImport: i0, template: "<div *ngIf=\"data\" class=\"dv-datepicker-wrapper {{ data.select.classes || '' }}\">\n <div class=\"dv-datepicker-wrapper__label\" (click)=\"toggleDropDown(data.payload)\">\n <input type=\"text\" [value]=\"data.select.label\" [readOnly]=\"true\"/>\n <span class=\"{{data.select.icon}}\"></span>\n </div>\n <div class=\"dv-datepicker-wrapper__dropdown\" [hidden]=\"data.select.hidden\">\n <ul class=\"dv-datepicker-wrapper__dropdown-list\">\n <li class=\"dv-datepicker-wrapper__dropdown-list-option {{ opt.classes || '' }}\" *ngFor=\"let opt of data.select.items\" (click)=\"onClick(opt.payload)\">{{opt.text}}</li>\n </ul>\n </div>\n <n7-datepicker\n [data]=\"data.datepicker.data\"\n [emit]=\"emit\">\n </n7-datepicker>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.DatepickerComponent, selector: "n7-datepicker", inputs: ["data", "emit"] }] });
|
|
40
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DatepickerWrapperComponent, decorators: [{
|
|
41
|
-
type: Component,
|
|
42
|
-
args: [{ selector: 'dv-datepicker-wrapper', template: "<div *ngIf=\"data\" class=\"dv-datepicker-wrapper {{ data.select.classes || '' }}\">\n <div class=\"dv-datepicker-wrapper__label\" (click)=\"toggleDropDown(data.payload)\">\n <input type=\"text\" [value]=\"data.select.label\" [readOnly]=\"true\"/>\n <span class=\"{{data.select.icon}}\"></span>\n </div>\n <div class=\"dv-datepicker-wrapper__dropdown\" [hidden]=\"data.select.hidden\">\n <ul class=\"dv-datepicker-wrapper__dropdown-list\">\n <li class=\"dv-datepicker-wrapper__dropdown-list-option {{ opt.classes || '' }}\" *ngFor=\"let opt of data.select.items\" (click)=\"onClick(opt.payload)\">{{opt.text}}</li>\n </ul>\n </div>\n <n7-datepicker\n [data]=\"data.datepicker.data\"\n [emit]=\"emit\">\n </n7-datepicker>\n</div>\n" }]
|
|
43
|
-
}], propDecorators: { data: [{
|
|
44
|
-
type: Input
|
|
45
|
-
}], emit: [{
|
|
46
|
-
type: Input
|
|
47
|
-
}] } });
|
|
48
|
-
|
|
49
|
-
class CardStateWrapperComponent {
|
|
50
|
-
constructor() {
|
|
51
|
-
this.componentRef = {};
|
|
52
|
-
}
|
|
53
|
-
ngOnInit() {
|
|
54
|
-
// Called after the constructor, initializing input properties,
|
|
55
|
-
// and the first call to ngOnChanges.
|
|
56
|
-
this.state$
|
|
57
|
-
// This subscriber must run AFTER the HTML async pipe
|
|
58
|
-
.pipe(delay(0))
|
|
59
|
-
.subscribe({
|
|
60
|
-
next: (stateID) => {
|
|
61
|
-
if (this.stateComponents && this.stateComponents[stateID]) {
|
|
62
|
-
// only clear the state if the view exists
|
|
63
|
-
if (this[stateID]) {
|
|
64
|
-
// this[stateID] will be one of the states declared as @ViewChild
|
|
65
|
-
this[stateID].clear();
|
|
66
|
-
}
|
|
67
|
-
const { component, data } = this.stateComponents[stateID];
|
|
68
|
-
if (component) {
|
|
69
|
-
this.componentRef[stateID] = this[stateID].createComponent(component);
|
|
70
|
-
if (data) {
|
|
71
|
-
this.componentRef[stateID].instance.data = data;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
CardStateWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CardStateWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
80
|
-
CardStateWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: CardStateWrapperComponent, selector: "dv-card-state-wrapper", inputs: { state$: "state$", stateComponents: "stateComponents" }, viewQueries: [{ propertyName: "loading", first: true, predicate: ["loading"], descendants: true, read: ViewContainerRef }, { propertyName: "empty", first: true, predicate: ["empty"], descendants: true, read: ViewContainerRef }, { propertyName: "error", first: true, predicate: ["error"], descendants: true, read: ViewContainerRef }, { propertyName: "idle", first: true, predicate: ["idle"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<ng-container *ngIf=\"(state$ | async) as state\">\n <ng-container [ngSwitch]=\"state\">\n <ng-container *ngSwitchCase=\"'idle'\">\n <ng-container #idle></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'loading'\">\n <ng-container #loading></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'empty'\">\n <ng-container #empty></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'success'\">\n <!-- card content -->\n <ng-content></ng-content>\n <!-- ------------ -->\n </ng-container>\n </ng-container>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
|
|
81
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CardStateWrapperComponent, decorators: [{
|
|
82
|
-
type: Component,
|
|
83
|
-
args: [{ selector: 'dv-card-state-wrapper', template: "<ng-container *ngIf=\"(state$ | async) as state\">\n <ng-container [ngSwitch]=\"state\">\n <ng-container *ngSwitchCase=\"'idle'\">\n <ng-container #idle></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'loading'\">\n <ng-container #loading></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'empty'\">\n <ng-container #empty></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'success'\">\n <!-- card content -->\n <ng-content></ng-content>\n <!-- ------------ -->\n </ng-container>\n </ng-container>\n</ng-container>\n" }]
|
|
84
|
-
}], propDecorators: { state$: [{
|
|
85
|
-
type: Input
|
|
86
|
-
}], stateComponents: [{
|
|
87
|
-
type: Input
|
|
88
|
-
}], loading: [{
|
|
89
|
-
type: ViewChild,
|
|
90
|
-
args: ['loading', { read: ViewContainerRef }]
|
|
91
|
-
}], empty: [{
|
|
92
|
-
type: ViewChild,
|
|
93
|
-
args: ['empty', { read: ViewContainerRef }]
|
|
94
|
-
}], error: [{
|
|
95
|
-
type: ViewChild,
|
|
96
|
-
args: ['error', { read: ViewContainerRef }]
|
|
97
|
-
}], idle: [{
|
|
98
|
-
type: ViewChild,
|
|
99
|
-
args: ['idle', { read: ViewContainerRef }]
|
|
100
|
-
}] } });
|
|
101
|
-
|
|
102
|
-
class CardTextItemComponent {
|
|
103
|
-
onClick(payload) {
|
|
104
|
-
if (!this.emit)
|
|
105
|
-
return;
|
|
106
|
-
this.emit('click', payload);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
CardTextItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CardTextItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
110
|
-
CardTextItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: CardTextItemComponent, selector: "dv-card-text-item", inputs: { data: "data", emit: "emit" }, ngImport: i0, template: "<div *ngIf=\"data\" class=\"dv-card-text-item {{ data.classes || '' }}\">\n <span [innerHTML]=\"data.text\" (click)=\"onClick(data.payload)\"></span>\n</div>", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
111
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CardTextItemComponent, decorators: [{
|
|
112
|
-
type: Component,
|
|
113
|
-
args: [{ selector: 'dv-card-text-item', template: "<div *ngIf=\"data\" class=\"dv-card-text-item {{ data.classes || '' }}\">\n <span [innerHTML]=\"data.text\" (click)=\"onClick(data.payload)\"></span>\n</div>" }]
|
|
114
|
-
}], propDecorators: { data: [{
|
|
115
|
-
type: Input
|
|
116
|
-
}], emit: [{
|
|
117
|
-
type: Input
|
|
118
|
-
}] } });
|
|
119
|
-
|
|
120
|
-
class CardComponent {
|
|
121
|
-
}
|
|
122
|
-
CardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
123
|
-
CardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: CardComponent, selector: "dv-card", inputs: { data: "data", emit: "emit" }, ngImport: i0, template: "<div *ngIf=\"data\"\n class=\"dv-card {{ data.classes || '' }}\">\n <dv-card-state-wrapper [state$]=\"data.state$[data.id]\"\n [stateComponents]=\"data.stateComponents[data.id]\">\n <ng-container *ngFor=\"let area of ['header', 'content', 'footer']\">\n <div *ngIf=\"data[area]\"\n class=\"dv-card__{{ area }}\">\n <ng-container *ngFor=\"let section of data[area].sections\">\n <dv-card-state-wrapper [state$]=\"data.state$[section.id]\"\n [stateComponents]=\"section.stateComponents\">\n <section class=\"dv-card__section {{ section.classes || '' }}\">\n <ng-container *ngTemplateOutlet=\"blocks; context: { $implicit: section.items }\"></ng-container>\n </section>\n </dv-card-state-wrapper>\n </ng-container>\n </div>\n </ng-container>\n </dv-card-state-wrapper>\n</div>\n\n<ng-template #blocks\n let-items>\n <ng-container *ngFor=\"let item of items\">\n <dv-card-state-wrapper [state$]=\"data.state$[item.id]\"\n [stateComponents]=\"data.stateComponents[item.id]\">\n <div class=\"{{ 'dv-card__item dv-card__' + item.type }}\">\n <!-- TEXT -->\n <ng-container *ngIf=\"item.type === 'text'\">\n <dv-card-text-item [data]=\"data.widgets[item.id].ds.out$ | async\"\n [emit]=\"data.widgets[item.id].emit\"></dv-card-text-item>\n </ng-container>\n\n <!-- DATA WIDGET -->\n <ng-container *ngIf=\"item.type === 'data-widget'\">\n <n7-data-widget [data]=\"data.widgets[item.id].ds.out$ | async\"\n [emit]=\"data.widgets[item.id].emit\">\n </n7-data-widget>\n </ng-container>\n\n <!-- TABLE -->\n <ng-container *ngIf=\"item.type === 'table'\">\n <n7-table [data]=\"data.widgets[item.id].ds.out$ | async\"\n [emit]=\"data.widgets[item.id].emit\"></n7-table>\n </ng-container>\n\n <!-- INNER TITLE -->\n <ng-container *ngIf=\"item.type === 'inner-title'\">\n <n7-inner-title [data]=\"data.widgets[item.id].ds.out$ | async\"\n [emit]=\"data.widgets[item.id].emit\"></n7-inner-title>\n </ng-container>\n\n <!-- SELECT -->\n <ng-container *ngIf=\"item.type === 'select'\">\n <n7-input-select [data]=\"data.widgets[item.id].ds.out$ | async\"\n [emit]=\"data.widgets[item.id].emit\"></n7-input-select>\n </ng-container>\n\n <!-- APEX CHARTS -->\n <ng-container *ngIf=\"item.type.includes('apex')\">\n <n7-chart [data]=\"data.widgets[item.id].ds.out$ | async\"></n7-chart>\n </ng-container>\n\n <!-- MAP -->\n <ng-container *ngIf=\"item.type === 'map'\">\n <n7-map [data]=\"data.widgets[item.id].ds.out$ | async\"></n7-map>\n </ng-container>\n </div>\n </dv-card-state-wrapper>\n </ng-container>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.ChartComponent, selector: "n7-chart", inputs: ["data", "emit"] }, { kind: "component", type: i2.DataWidgetComponent, selector: "n7-data-widget", inputs: ["data", "emit"] }, { kind: "component", type: i2.InnerTitleComponent, selector: "n7-inner-title", inputs: ["data", "emit"] }, { kind: "component", type: i2.InputSelectComponent, selector: "n7-input-select", inputs: ["data", "emit"] }, { kind: "component", type: i2.MapComponent, selector: "n7-map", inputs: ["data", "emit"] }, { kind: "component", type: i2.TableComponent, selector: "n7-table", inputs: ["data", "emit"] }, { kind: "component", type: CardStateWrapperComponent, selector: "dv-card-state-wrapper", inputs: ["state$", "stateComponents"] }, { kind: "component", type: CardTextItemComponent, selector: "dv-card-text-item", inputs: ["data", "emit"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
|
|
124
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CardComponent, decorators: [{
|
|
125
|
-
type: Component,
|
|
126
|
-
args: [{ selector: 'dv-card', template: "<div *ngIf=\"data\"\n class=\"dv-card {{ data.classes || '' }}\">\n <dv-card-state-wrapper [state$]=\"data.state$[data.id]\"\n [stateComponents]=\"data.stateComponents[data.id]\">\n <ng-container *ngFor=\"let area of ['header', 'content', 'footer']\">\n <div *ngIf=\"data[area]\"\n class=\"dv-card__{{ area }}\">\n <ng-container *ngFor=\"let section of data[area].sections\">\n <dv-card-state-wrapper [state$]=\"data.state$[section.id]\"\n [stateComponents]=\"section.stateComponents\">\n <section class=\"dv-card__section {{ section.classes || '' }}\">\n <ng-container *ngTemplateOutlet=\"blocks; context: { $implicit: section.items }\"></ng-container>\n </section>\n </dv-card-state-wrapper>\n </ng-container>\n </div>\n </ng-container>\n </dv-card-state-wrapper>\n</div>\n\n<ng-template #blocks\n let-items>\n <ng-container *ngFor=\"let item of items\">\n <dv-card-state-wrapper [state$]=\"data.state$[item.id]\"\n [stateComponents]=\"data.stateComponents[item.id]\">\n <div class=\"{{ 'dv-card__item dv-card__' + item.type }}\">\n <!-- TEXT -->\n <ng-container *ngIf=\"item.type === 'text'\">\n <dv-card-text-item [data]=\"data.widgets[item.id].ds.out$ | async\"\n [emit]=\"data.widgets[item.id].emit\"></dv-card-text-item>\n </ng-container>\n\n <!-- DATA WIDGET -->\n <ng-container *ngIf=\"item.type === 'data-widget'\">\n <n7-data-widget [data]=\"data.widgets[item.id].ds.out$ | async\"\n [emit]=\"data.widgets[item.id].emit\">\n </n7-data-widget>\n </ng-container>\n\n <!-- TABLE -->\n <ng-container *ngIf=\"item.type === 'table'\">\n <n7-table [data]=\"data.widgets[item.id].ds.out$ | async\"\n [emit]=\"data.widgets[item.id].emit\"></n7-table>\n </ng-container>\n\n <!-- INNER TITLE -->\n <ng-container *ngIf=\"item.type === 'inner-title'\">\n <n7-inner-title [data]=\"data.widgets[item.id].ds.out$ | async\"\n [emit]=\"data.widgets[item.id].emit\"></n7-inner-title>\n </ng-container>\n\n <!-- SELECT -->\n <ng-container *ngIf=\"item.type === 'select'\">\n <n7-input-select [data]=\"data.widgets[item.id].ds.out$ | async\"\n [emit]=\"data.widgets[item.id].emit\"></n7-input-select>\n </ng-container>\n\n <!-- APEX CHARTS -->\n <ng-container *ngIf=\"item.type.includes('apex')\">\n <n7-chart [data]=\"data.widgets[item.id].ds.out$ | async\"></n7-chart>\n </ng-container>\n\n <!-- MAP -->\n <ng-container *ngIf=\"item.type === 'map'\">\n <n7-map [data]=\"data.widgets[item.id].ds.out$ | async\"></n7-map>\n </ng-container>\n </div>\n </dv-card-state-wrapper>\n </ng-container>\n</ng-template>\n" }]
|
|
127
|
-
}], propDecorators: { data: [{
|
|
128
|
-
type: Input
|
|
129
|
-
}], emit: [{
|
|
130
|
-
type: Input
|
|
131
|
-
}] } });
|
|
132
|
-
|
|
133
|
-
// import { EMPTY } from 'rxjs';
|
|
134
|
-
// import { catchError } from 'rxjs/operators';
|
|
135
|
-
class DvExampleLayoutDS extends LayoutDataSource {
|
|
136
|
-
constructor() {
|
|
137
|
-
super(...arguments);
|
|
138
|
-
this.Items = [
|
|
139
|
-
{
|
|
140
|
-
text: 'Last week',
|
|
141
|
-
payload: 'Last week',
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
text: 'Last month',
|
|
145
|
-
payload: 'Last month',
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
text: 'Last year',
|
|
149
|
-
payload: 'Last year',
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
text: 'Select Date',
|
|
153
|
-
// this payload key is use for visualise the datepicker.
|
|
154
|
-
payload: 'ByDate',
|
|
155
|
-
},
|
|
156
|
-
];
|
|
157
|
-
this.datepickerOptions = {
|
|
158
|
-
dateFormat: 'Y-m-d',
|
|
159
|
-
mode: 'range',
|
|
160
|
-
};
|
|
161
|
-
this.datePickerExternalData = {
|
|
162
|
-
select: {
|
|
163
|
-
id: 'dv-select',
|
|
164
|
-
label: 'Last week',
|
|
165
|
-
items: this.Items,
|
|
166
|
-
},
|
|
167
|
-
datepicker: {
|
|
168
|
-
id: 'datepicker',
|
|
169
|
-
libOptions: this.datepickerOptions,
|
|
170
|
-
},
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
onInit(payload) {
|
|
174
|
-
this.communication = payload.communication;
|
|
175
|
-
this.one('dv-datepicker-wrapper').update(this.datePickerExternalData);
|
|
176
|
-
// communication test
|
|
177
|
-
// get
|
|
178
|
-
// this.communication.request$('posts').subscribe((response) => {
|
|
179
|
-
// console.log('GET: posts------------>', response);
|
|
180
|
-
// });
|
|
181
|
-
// this.communication.request$('firstPost').subscribe((response) => {
|
|
182
|
-
// console.log('GET: firstPost------------>', response);
|
|
183
|
-
// });
|
|
184
|
-
// this.communication.request$('firstPost', {
|
|
185
|
-
// method: 'DELETE'
|
|
186
|
-
// }).subscribe((response) => {
|
|
187
|
-
// console.log('GET: firstPost------------>', response);
|
|
188
|
-
// });
|
|
189
|
-
// // post
|
|
190
|
-
// this.communication.request$<object, object>('firstPost', {
|
|
191
|
-
// method: 'PATCH',
|
|
192
|
-
// params: {
|
|
193
|
-
// title: 'new title',
|
|
194
|
-
// }
|
|
195
|
-
// }).subscribe((response) => {
|
|
196
|
-
// console.log('POST: posts------------>', response);
|
|
197
|
-
// });
|
|
198
|
-
// // dynamic
|
|
199
|
-
const user$ = this.communication.request$('comments', {
|
|
200
|
-
method: 'GET',
|
|
201
|
-
// urlParams: '/2', // <api>posts/2
|
|
202
|
-
urlParams: { id: 1 }, // <api>posts/2/5/details
|
|
203
|
-
// queryParams: {
|
|
204
|
-
// userId: 1
|
|
205
|
-
// }
|
|
206
|
-
});
|
|
207
|
-
user$.subscribe((response) => {
|
|
208
|
-
console.log('response----------------------------->', response);
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/* eslint-disable */
|
|
214
|
-
class DvExampleLayoutEH extends EventHandler {
|
|
215
|
-
listen() {
|
|
216
|
-
this.innerEvents$.subscribe(({ type, payload }) => {
|
|
217
|
-
if (type === 'dv-example-layout.init') {
|
|
218
|
-
this.dataSource.onInit(payload);
|
|
219
|
-
}
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
class DvDataWidgetDS extends DataSource {
|
|
225
|
-
transform(data) {
|
|
226
|
-
if (!data) {
|
|
227
|
-
return null;
|
|
228
|
-
}
|
|
229
|
-
return null;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
class DvDatepickerWrapperDS extends DataSource {
|
|
234
|
-
constructor() {
|
|
235
|
-
super(...arguments);
|
|
236
|
-
this._datepicker = null;
|
|
237
|
-
}
|
|
238
|
-
transform(data) {
|
|
239
|
-
if (!data) {
|
|
240
|
-
return null;
|
|
241
|
-
}
|
|
242
|
-
return {
|
|
243
|
-
// set select option
|
|
244
|
-
select: {
|
|
245
|
-
id: data.select.id,
|
|
246
|
-
hidden: true,
|
|
247
|
-
icon: data.select.icon || 'n7-icon-angle-down',
|
|
248
|
-
label: data.select.label,
|
|
249
|
-
items: data.select.items,
|
|
250
|
-
classes: data.select.classes,
|
|
251
|
-
},
|
|
252
|
-
// set picker
|
|
253
|
-
datepicker: {
|
|
254
|
-
hidden: true,
|
|
255
|
-
data: {
|
|
256
|
-
id: data.datepicker.id,
|
|
257
|
-
libOptions: data.datepicker.libOptions,
|
|
258
|
-
getInstance: (datepicker) => { this._datepicker = datepicker; },
|
|
259
|
-
},
|
|
260
|
-
},
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
openDatepicker() {
|
|
264
|
-
setTimeout(() => this._datepicker.open());
|
|
265
|
-
this.output.select.hidden = true;
|
|
266
|
-
this.output.datepicker.hidden = false;
|
|
267
|
-
}
|
|
268
|
-
closeDatepicker() {
|
|
269
|
-
setTimeout(() => this._datepicker.close());
|
|
270
|
-
this.output.select.hidden = true;
|
|
271
|
-
this.output.datepicker.hidden = true;
|
|
272
|
-
}
|
|
273
|
-
setLabel(payload) {
|
|
274
|
-
this.output.select.label = payload;
|
|
275
|
-
this.output.datepicker.hidden = true;
|
|
276
|
-
}
|
|
277
|
-
toggleDropDown() {
|
|
278
|
-
if (this.output.select.hidden === false) {
|
|
279
|
-
this.output.select.hidden = true;
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
this.output.select.hidden = false;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
class DvGraphDS extends DataSource {
|
|
288
|
-
transform() {
|
|
289
|
-
return {
|
|
290
|
-
containerId: 'test-Chart',
|
|
291
|
-
libOptions: {
|
|
292
|
-
chart: {
|
|
293
|
-
height: 550,
|
|
294
|
-
width: 1500,
|
|
295
|
-
type: 'area',
|
|
296
|
-
toolbar: { show: true },
|
|
297
|
-
},
|
|
298
|
-
dataLabels: { enabled: false },
|
|
299
|
-
colors: ['rgba(15,200,255)'],
|
|
300
|
-
fill: {
|
|
301
|
-
colors: ['#0fc8ff'],
|
|
302
|
-
gradient: { opacityFrom: 0.5, opacityTo: 0.1 },
|
|
303
|
-
},
|
|
304
|
-
stroke: { curve: 'straight', width: [2, 1] },
|
|
305
|
-
series: [
|
|
306
|
-
{
|
|
307
|
-
name: 'Reddish value',
|
|
308
|
-
data: [['2019-08-01', '770.17'], ['2019-08-02', '645.03'],
|
|
309
|
-
['2019-08-03', '709.32'], ['2019-08-04', '708.11'],
|
|
310
|
-
['2019-08-05', '706.59'], ['2019-08-06', '607.28'],
|
|
311
|
-
['2019-08-07', '494.59'], ['2019-08-08', '636.81'],
|
|
312
|
-
['2019-08-09', '709.04'], ['2019-08-10', '717.31'],
|
|
313
|
-
['2019-08-11', '805.61'], ['2019-08-12', '758.60'],
|
|
314
|
-
['2019-08-13', '612.82'], ['2019-08-14', '608.90'],
|
|
315
|
-
['2019-08-15', '734.68'], ['2019-08-16', '838.54'],
|
|
316
|
-
['2019-08-17', '692.88']],
|
|
317
|
-
},
|
|
318
|
-
],
|
|
319
|
-
grid: {
|
|
320
|
-
borderColor: '#e7e7e7',
|
|
321
|
-
strokeDashArray: 3,
|
|
322
|
-
xaxis: { lines: { show: true } },
|
|
323
|
-
},
|
|
324
|
-
markers: { size: 3, hover: { size: 6 } },
|
|
325
|
-
xaxis: {
|
|
326
|
-
axisBorder: { show: true, color: '#f4f6fc' },
|
|
327
|
-
labels: {},
|
|
328
|
-
type: 'datetime',
|
|
329
|
-
tickAmount: 6,
|
|
330
|
-
},
|
|
331
|
-
yaxis: [
|
|
332
|
-
{
|
|
333
|
-
show: true,
|
|
334
|
-
showAlways: false,
|
|
335
|
-
opposite: false,
|
|
336
|
-
reversed: false,
|
|
337
|
-
logarithmic: false,
|
|
338
|
-
forceNiceScale: false,
|
|
339
|
-
floating: false,
|
|
340
|
-
labels: {
|
|
341
|
-
show: true,
|
|
342
|
-
minWidth: 0,
|
|
343
|
-
maxWidth: 160,
|
|
344
|
-
offsetX: 0,
|
|
345
|
-
offsetY: 0,
|
|
346
|
-
rotate: 0,
|
|
347
|
-
padding: 20,
|
|
348
|
-
style: { colors: [], fontSize: '11px', cssClass: '' },
|
|
349
|
-
},
|
|
350
|
-
axisBorder: {
|
|
351
|
-
show: true, color: '#f4f6fc', offsetX: 0, offsetY: 0,
|
|
352
|
-
},
|
|
353
|
-
axisTicks: {
|
|
354
|
-
show: false, color: '#78909C', width: 6, offsetX: 0, offsetY: 0,
|
|
355
|
-
},
|
|
356
|
-
title: {
|
|
357
|
-
text: 'P Totale °C', rotate: 90, offsetY: 0, offsetX: 0, style: { fontSize: '11px', cssClass: '' },
|
|
358
|
-
},
|
|
359
|
-
tooltip: { enabled: false, offsetX: 0 },
|
|
360
|
-
crosshairs: { show: true, position: 'front', stroke: { color: '#b6b6b6', width: 1, dashArray: 0 } },
|
|
361
|
-
},
|
|
362
|
-
],
|
|
363
|
-
legend: { show: true },
|
|
364
|
-
tooltip: {},
|
|
365
|
-
annotations: { yaxis: [], xaxis: [], points: [] },
|
|
366
|
-
},
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
class DvInnerTitleDS extends DataSource {
|
|
372
|
-
transform() {
|
|
373
|
-
return {
|
|
374
|
-
title: {
|
|
375
|
-
main: {
|
|
376
|
-
text: 'Dipendenti',
|
|
377
|
-
classes: 'n7-main-widget-title',
|
|
378
|
-
},
|
|
379
|
-
secondary: {
|
|
380
|
-
text: 'Dipendeti al 10/10/10',
|
|
381
|
-
classes: 'n7-secondary-widget-title',
|
|
382
|
-
},
|
|
383
|
-
},
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
class DvWidgetDS extends DataSource {
|
|
389
|
-
transform() {
|
|
390
|
-
return DATA_WIDGET_MOCK;
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
class CardDS extends DataSource {
|
|
395
|
-
transform(data) {
|
|
396
|
-
return data;
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
class TextItemDS extends DataSource {
|
|
401
|
-
transform(data) {
|
|
402
|
-
return data;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
class DataWidgetItemDS extends DataSource {
|
|
407
|
-
transform(data) {
|
|
408
|
-
return data;
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
const getSeries = (series) => series.map(({ id, name, data }) => ({
|
|
413
|
-
id,
|
|
414
|
-
name,
|
|
415
|
-
data: data.map((point) => (isObject(point) ? point.value : point))
|
|
416
|
-
}));
|
|
417
|
-
const getSeriesMetadata = (series) => series.map(({ data }) => {
|
|
418
|
-
const serieMetadata = [];
|
|
419
|
-
data.forEach((point) => {
|
|
420
|
-
if (isObject(point)) {
|
|
421
|
-
serieMetadata.push((point === null || point === void 0 ? void 0 : point.metadata) || null);
|
|
422
|
-
}
|
|
423
|
-
else {
|
|
424
|
-
serieMetadata.push(null);
|
|
425
|
-
}
|
|
426
|
-
});
|
|
427
|
-
return serieMetadata;
|
|
428
|
-
});
|
|
429
|
-
var apexHelpers = {
|
|
430
|
-
getContainerId: (id) => `chart-${id}`,
|
|
431
|
-
getSeries,
|
|
432
|
-
getSeriesMetadata
|
|
433
|
-
};
|
|
434
|
-
|
|
435
|
-
var barChart = {
|
|
436
|
-
run: (id, data, options) => ({
|
|
437
|
-
containerId: apexHelpers.getContainerId(id),
|
|
438
|
-
libOptions: merge({
|
|
439
|
-
chart: {
|
|
440
|
-
type: 'bar',
|
|
441
|
-
},
|
|
442
|
-
series: apexHelpers.getSeries(data.series),
|
|
443
|
-
xaxis: {
|
|
444
|
-
categories: data.categories,
|
|
445
|
-
},
|
|
446
|
-
metadata: {
|
|
447
|
-
series: apexHelpers.getSeriesMetadata(data.series),
|
|
448
|
-
},
|
|
449
|
-
}, options)
|
|
450
|
-
})
|
|
451
|
-
};
|
|
452
|
-
|
|
453
|
-
var lineChart = {
|
|
454
|
-
run: (id, data, options) => ({
|
|
455
|
-
containerId: apexHelpers.getContainerId(id),
|
|
456
|
-
libOptions: merge({
|
|
457
|
-
chart: {
|
|
458
|
-
type: 'line',
|
|
459
|
-
},
|
|
460
|
-
series: apexHelpers.getSeries(data.series),
|
|
461
|
-
xaxis: {
|
|
462
|
-
categories: data.categories,
|
|
463
|
-
},
|
|
464
|
-
metadata: {
|
|
465
|
-
series: apexHelpers.getSeriesMetadata(data.series),
|
|
466
|
-
},
|
|
467
|
-
}, options)
|
|
468
|
-
})
|
|
469
|
-
};
|
|
470
|
-
|
|
471
|
-
var pieChart = {
|
|
472
|
-
run: (id, data, options) => ({
|
|
473
|
-
containerId: apexHelpers.getContainerId(id),
|
|
474
|
-
libOptions: merge({
|
|
475
|
-
chart: {
|
|
476
|
-
type: 'pie',
|
|
477
|
-
},
|
|
478
|
-
series: apexHelpers.getSeries(data.series)[0].data,
|
|
479
|
-
labels: data.categories,
|
|
480
|
-
metadata: {
|
|
481
|
-
series: apexHelpers.getSeriesMetadata(data.series),
|
|
482
|
-
},
|
|
483
|
-
}, options)
|
|
484
|
-
})
|
|
485
|
-
};
|
|
486
|
-
|
|
487
|
-
var radarChart = {
|
|
488
|
-
run: (id, data, options) => ({
|
|
489
|
-
containerId: apexHelpers.getContainerId(id),
|
|
490
|
-
libOptions: merge({
|
|
491
|
-
chart: {
|
|
492
|
-
type: 'radar',
|
|
493
|
-
},
|
|
494
|
-
series: apexHelpers.getSeries(data.series),
|
|
495
|
-
xaxis: {
|
|
496
|
-
categories: data.categories,
|
|
497
|
-
},
|
|
498
|
-
metadata: {
|
|
499
|
-
series: apexHelpers.getSeriesMetadata(data.series),
|
|
500
|
-
},
|
|
501
|
-
}, options)
|
|
502
|
-
})
|
|
503
|
-
};
|
|
504
|
-
|
|
505
|
-
var radialbarChart = {
|
|
506
|
-
run: (id, data, options) => ({
|
|
507
|
-
containerId: apexHelpers.getContainerId(id),
|
|
508
|
-
libOptions: merge({
|
|
509
|
-
chart: {
|
|
510
|
-
type: 'radialBar',
|
|
511
|
-
},
|
|
512
|
-
plotOptions: {
|
|
513
|
-
radialBar: {
|
|
514
|
-
startAngle: -90,
|
|
515
|
-
endAngle: 90,
|
|
516
|
-
}
|
|
517
|
-
},
|
|
518
|
-
series: apexHelpers.getSeries(data.series)[0].data,
|
|
519
|
-
labels: data.categories,
|
|
520
|
-
metadata: {
|
|
521
|
-
series: apexHelpers.getSeriesMetadata(data.series),
|
|
522
|
-
},
|
|
523
|
-
}, options)
|
|
524
|
-
})
|
|
525
|
-
};
|
|
526
|
-
|
|
527
|
-
const transformers = {
|
|
528
|
-
'apex-pie-chart': pieChart,
|
|
529
|
-
'apex-line-chart': lineChart,
|
|
530
|
-
'apex-bar-chart': barChart,
|
|
531
|
-
'apex-radialbar-chart': radialbarChart,
|
|
532
|
-
'apex-radar-chart': radarChart
|
|
533
|
-
};
|
|
534
|
-
|
|
535
|
-
class ApexHandler {
|
|
536
|
-
transform({ id, type, data, options }) {
|
|
537
|
-
if (!transformers[type]) {
|
|
538
|
-
throw Error(`Apex transformer ${type} does not exists`);
|
|
539
|
-
}
|
|
540
|
-
return transformers[type].run(id, data, options);
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
// exports
|
|
544
|
-
const apexHandler = new ApexHandler();
|
|
545
|
-
|
|
546
|
-
class ApexChartItemDS extends DataSource {
|
|
547
|
-
transform(data) {
|
|
548
|
-
return data;
|
|
549
|
-
}
|
|
550
|
-
update(newData) {
|
|
551
|
-
const formattedData = apexHandler.transform({
|
|
552
|
-
data: newData,
|
|
553
|
-
id: this.id,
|
|
554
|
-
type: this.type,
|
|
555
|
-
options: this.options,
|
|
556
|
-
});
|
|
557
|
-
if (this.instance) {
|
|
558
|
-
// lib api update
|
|
559
|
-
this.instance.updateOptions(formattedData.libOptions);
|
|
560
|
-
}
|
|
561
|
-
else {
|
|
562
|
-
formattedData.setChart = (chart) => {
|
|
563
|
-
this.instance = chart;
|
|
564
|
-
};
|
|
565
|
-
this.run(formattedData);
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
class TableItemDS extends DataSource {
|
|
571
|
-
transform(data) {
|
|
572
|
-
return data;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
class InnerTitleItemDS extends DataSource {
|
|
577
|
-
transform(data) {
|
|
578
|
-
return data;
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
class SelectItemDS extends DataSource {
|
|
583
|
-
transform(data) {
|
|
584
|
-
return data;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
class MapItemDS extends DataSource {
|
|
589
|
-
transform(data) {
|
|
590
|
-
return data;
|
|
591
|
-
}
|
|
592
|
-
update(newData) {
|
|
593
|
-
if (!this.instance) {
|
|
594
|
-
const formattedData = merge({
|
|
595
|
-
containerId: `map-${this.id}`,
|
|
596
|
-
libOptions: {
|
|
597
|
-
attributionControl: false,
|
|
598
|
-
},
|
|
599
|
-
tileLayers: [],
|
|
600
|
-
initialView: {
|
|
601
|
-
center: []
|
|
602
|
-
},
|
|
603
|
-
markers: []
|
|
604
|
-
}, newData);
|
|
605
|
-
formattedData._setInstance = (map) => {
|
|
606
|
-
this.instance = map;
|
|
607
|
-
};
|
|
608
|
-
this.run(formattedData);
|
|
609
|
-
}
|
|
610
|
-
else {
|
|
611
|
-
console.warn(`
|
|
612
|
-
Map ${this.id} instance update is delegated on project.
|
|
613
|
-
Try using the datasource instance property (ds.instance)
|
|
614
|
-
`);
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
// Data Widget
|
|
620
|
-
|
|
621
|
-
var DS = /*#__PURE__*/Object.freeze({
|
|
622
|
-
__proto__: null,
|
|
623
|
-
DvDataWidgetDS: DvDataWidgetDS,
|
|
624
|
-
DvDatepickerWrapperDS: DvDatepickerWrapperDS,
|
|
625
|
-
DvGraphDS: DvGraphDS,
|
|
626
|
-
DvInnerTitleDS: DvInnerTitleDS,
|
|
627
|
-
DvWidgetDS: DvWidgetDS,
|
|
628
|
-
CardDS: CardDS,
|
|
629
|
-
TextItemDS: TextItemDS,
|
|
630
|
-
DataWidgetItemDS: DataWidgetItemDS,
|
|
631
|
-
ApexChartItemDS: ApexChartItemDS,
|
|
632
|
-
TableItemDS: TableItemDS,
|
|
633
|
-
InnerTitleItemDS: InnerTitleItemDS,
|
|
634
|
-
SelectItemDS: SelectItemDS,
|
|
635
|
-
MapItemDS: MapItemDS
|
|
636
|
-
});
|
|
637
|
-
|
|
638
|
-
class DvDatepickerWrapperEH extends EventHandler {
|
|
639
|
-
listen() {
|
|
640
|
-
this.innerEvents$.subscribe(({ type, payload }) => {
|
|
641
|
-
switch (type) {
|
|
642
|
-
case 'dv-datepicker-wrapper.click':
|
|
643
|
-
this.dataSource.setLabel(payload);
|
|
644
|
-
if (payload === 'ByDate') {
|
|
645
|
-
this.dataSource.openDatepicker();
|
|
646
|
-
}
|
|
647
|
-
else {
|
|
648
|
-
this.dataSource.closeDatepicker();
|
|
649
|
-
}
|
|
650
|
-
break;
|
|
651
|
-
case 'dv-datepicker-wrapper.toggle':
|
|
652
|
-
this.dataSource.toggleDropDown();
|
|
653
|
-
break;
|
|
654
|
-
case 'dv-datepicker-wrapper.change':
|
|
655
|
-
this.dataSource.setLabel(payload.dateStr);
|
|
656
|
-
break;
|
|
657
|
-
default:
|
|
658
|
-
break;
|
|
659
|
-
}
|
|
660
|
-
});
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
class CardEH extends EventHandler {
|
|
665
|
-
listen() {
|
|
666
|
-
this.innerEvents$.subscribe(({ type, payload }) => {
|
|
667
|
-
// redirect signal
|
|
668
|
-
this.emitOuter(type.replace(`${this.hostId}.`, ''), payload);
|
|
669
|
-
});
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
// Data Widget
|
|
674
|
-
|
|
675
|
-
var EH = /*#__PURE__*/Object.freeze({
|
|
676
|
-
__proto__: null,
|
|
677
|
-
DvDatepickerWrapperEH: DvDatepickerWrapperEH,
|
|
678
|
-
CardEH: CardEH
|
|
679
|
-
});
|
|
680
|
-
|
|
681
|
-
const DvExampleLayoutConfig = {
|
|
682
|
-
layoutId: 'dv-example-layout',
|
|
683
|
-
/**
|
|
684
|
-
* Array of components you want to use
|
|
685
|
-
* in this leyout
|
|
686
|
-
*/
|
|
687
|
-
widgets: [
|
|
688
|
-
{ id: 'dv-inner-title', hasStaticData: true },
|
|
689
|
-
{ id: 'dv-widget', hasStaticData: true },
|
|
690
|
-
{ id: 'dv-datepicker-wrapper' },
|
|
691
|
-
{ id: 'dv-graph', hasStaticData: true },
|
|
692
|
-
],
|
|
693
|
-
layoutDS: DvExampleLayoutDS,
|
|
694
|
-
layoutEH: DvExampleLayoutEH,
|
|
695
|
-
widgetsDataSources: DS,
|
|
696
|
-
widgetsEventHandlers: EH,
|
|
697
|
-
options: {
|
|
698
|
-
// TODO
|
|
699
|
-
},
|
|
700
|
-
};
|
|
701
|
-
|
|
702
|
-
/* eslint-disable */
|
|
703
|
-
class DvExampleLayoutComponent extends AbstractLayout {
|
|
704
|
-
constructor(communication) {
|
|
705
|
-
super(DvExampleLayoutConfig);
|
|
706
|
-
this.communication = communication;
|
|
707
|
-
}
|
|
708
|
-
initPayload() {
|
|
709
|
-
return {
|
|
710
|
-
communication: this.communication
|
|
711
|
-
};
|
|
712
|
-
}
|
|
713
|
-
ngOnInit() {
|
|
714
|
-
this.onInit();
|
|
715
|
-
}
|
|
716
|
-
ngOnDestroy() {
|
|
717
|
-
this.onDestroy();
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
DvExampleLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DvExampleLayoutComponent, deps: [{ token: i1$1.CommunicationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
721
|
-
DvExampleLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DvExampleLayoutComponent, selector: "dv-example-layout", usesInheritance: true, ngImport: i0, template: "<div class=\"dv-example-layout\" id=\"example-layout\">\n <h2>Grid component</h2>\n <p>Four columns equal width</p>\n <n7-grid templateColumns=\"1fr 1fr 1fr 1fr\" classes=\"custom-grid\">\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/200\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/201\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/199\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/198\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/197\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/195\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/203\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/204\" />\n </div>\n </n7-grid>\n\n <br />\n\n <p>Two columns, first is 33%</p>\n <n7-grid templateColumns=\"33% 1fr\" classes=\"custom-grid\">\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/600\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/600/600\" />\n </div>\n </n7-grid>\n\n <p>Nested grids</p>\n <n7-grid templateColumns=\"33% 1fr\" classes=\"custom-grid\">\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/500\" />\n </div>\n <div class=\"n7-grid__item\">\n <n7-grid templateColumns=\"1fr 1fr 1fr 1fr\" classes=\"custom-grid\">\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/200\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/201\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/199\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/198\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/197\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/195\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/203\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/204\" />\n </div>\n </n7-grid>\n </div>\n </n7-grid>\n\n <h2>Container component</h2>\n <p>Full width container</p>\n <n7-container classes=\"big-container-class\">Container content</n7-container>\n <n7-container classes=\"big-container-class\" fluid=\"true\">\n Container fluid content\n </n7-container>\n\n <h2>Combined components</h2>\n <p>Container with grids inside</p>\n <n7-container classes=\"big-container-class\">\n <n7-grid templateColumns=\"33% 1fr\" classes=\"custom-grid\">\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/500\" />\n </div>\n <div class=\"n7-grid__item\">\n <n7-grid templateColumns=\"1fr 1fr 1fr 1fr\" classes=\"custom-grid\">\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/200\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/201\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/199\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/198\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/197\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/195\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/203\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/204\" />\n </div>\n </n7-grid>\n </div>\n </n7-grid>\n </n7-container>\n\n\n <h2>Side scroller component</h2>\n \n <n7-container classes=\"big-container-class\" fluid=\"true\">\n <n7-side-scroller>\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n </n7-side-scroller>\n </n7-container>\n\n <!-- Data widget wrapper with not-fixed height, two rows -->\n <!-- <dv-data-widget-wrapper>\n <div class=\"dv-data-widget-wrapper__title\">\n <n7-inner-title\n [data]=\"lb.widgets['dv-inner-title'].ds.out$ | async\">\n </n7-inner-title>\n </div>\n <div class=\"dv-data-widget-wrapper__content\">\n <div class=\"dv-data-widget-wrapper__content-row\">\n <n7-data-widget\n [data]=\"lb.widgets['dv-widget'].ds.out$ | async\">\n </n7-data-widget>\n </div>\n <div class=\"dv-data-widget-wrapper__content-row\">\n <n7-chart\n [data]=\"lb.widgets['dv-graph'].ds.out$ | async\">\n </n7-chart>\n </div>\n </div>\n </dv-data-widget-wrapper> -->\n\n <!-- Data widget wrapper with fixed height, two rows -->\n <!-- <dv-data-widget-wrapper\n [data]=\"{ classes: 'dv-data-widget-wrapper-fixed-height' }\"\n >\n <div class=\"dv-data-widget-wrapper__title\">\n <n7-inner-title [data]=\"lb.widgets['dv-inner-title'].ds.out$ | async\">\n </n7-inner-title>\n </div>\n <div class=\"dv-data-widget-wrapper__content\">\n <div class=\"dv-data-widget-wrapper__content-row\">\n <n7-data-widget [data]=\"lb.widgets['dv-widget'].ds.out$ | async\">\n </n7-data-widget>\n </div>\n <div class=\"dv-data-widget-wrapper__content-row\">Row content</div>\n </div>\n </dv-data-widget-wrapper> -->\n\n <!-- Data widget wrapper with fixed height, one row -->\n <!-- <dv-data-widget-wrapper\n [data]=\"{ classes: 'dv-data-widget-wrapper-fixed-height' }\"\n >\n <div class=\"dv-data-widget-wrapper__title\">\n <n7-inner-title [data]=\"lb.widgets['dv-inner-title'].ds.out$ | async\">\n </n7-inner-title>\n </div>\n <div class=\"dv-data-widget-wrapper__content\">\n <div class=\"dv-data-widget-wrapper__content-row\">\n <n7-data-widget [data]=\"lb.widgets['dv-widget'].ds.out$ | async\">\n </n7-data-widget>\n </div>\n </div>\n </dv-data-widget-wrapper>\n\n <dv-datepicker-wrapper\n [data]=\"lb.widgets['dv-datepicker-wrapper'].ds.out$ | async\"\n [emit]=\"lb.widgets['dv-datepicker-wrapper'].emit\"\n >\n </dv-datepicker-wrapper> -->\n</div>\n", dependencies: [{ kind: "component", type: i1$1.GridComponent, selector: "n7-grid", inputs: ["templateColumns", "classes"] }, { kind: "component", type: i1$1.ContainerComponent, selector: "n7-container", inputs: ["fluid", "classes"] }, { kind: "component", type: i1$1.SideScrollerComponent, selector: "n7-side-scroller", inputs: ["classes"] }] });
|
|
722
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DvExampleLayoutComponent, decorators: [{
|
|
723
|
-
type: Component,
|
|
724
|
-
args: [{ selector: 'dv-example-layout', template: "<div class=\"dv-example-layout\" id=\"example-layout\">\n <h2>Grid component</h2>\n <p>Four columns equal width</p>\n <n7-grid templateColumns=\"1fr 1fr 1fr 1fr\" classes=\"custom-grid\">\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/200\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/201\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/199\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/198\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/197\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/195\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/203\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/204\" />\n </div>\n </n7-grid>\n\n <br />\n\n <p>Two columns, first is 33%</p>\n <n7-grid templateColumns=\"33% 1fr\" classes=\"custom-grid\">\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/600\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/600/600\" />\n </div>\n </n7-grid>\n\n <p>Nested grids</p>\n <n7-grid templateColumns=\"33% 1fr\" classes=\"custom-grid\">\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/500\" />\n </div>\n <div class=\"n7-grid__item\">\n <n7-grid templateColumns=\"1fr 1fr 1fr 1fr\" classes=\"custom-grid\">\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/200\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/201\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/199\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/198\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/197\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/195\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/203\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/204\" />\n </div>\n </n7-grid>\n </div>\n </n7-grid>\n\n <h2>Container component</h2>\n <p>Full width container</p>\n <n7-container classes=\"big-container-class\">Container content</n7-container>\n <n7-container classes=\"big-container-class\" fluid=\"true\">\n Container fluid content\n </n7-container>\n\n <h2>Combined components</h2>\n <p>Container with grids inside</p>\n <n7-container classes=\"big-container-class\">\n <n7-grid templateColumns=\"33% 1fr\" classes=\"custom-grid\">\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/300/500\" />\n </div>\n <div class=\"n7-grid__item\">\n <n7-grid templateColumns=\"1fr 1fr 1fr 1fr\" classes=\"custom-grid\">\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/200\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/201\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/199\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/198\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/197\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/195\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/203\" />\n </div>\n <div class=\"n7-grid__item\">\n <img src=\"http://placekitten.com/200/204\" />\n </div>\n </n7-grid>\n </div>\n </n7-grid>\n </n7-container>\n\n\n <h2>Side scroller component</h2>\n \n <n7-container classes=\"big-container-class\" fluid=\"true\">\n <n7-side-scroller>\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n <img src=\"http://placekitten.com/200/204\" />\n </n7-side-scroller>\n </n7-container>\n\n <!-- Data widget wrapper with not-fixed height, two rows -->\n <!-- <dv-data-widget-wrapper>\n <div class=\"dv-data-widget-wrapper__title\">\n <n7-inner-title\n [data]=\"lb.widgets['dv-inner-title'].ds.out$ | async\">\n </n7-inner-title>\n </div>\n <div class=\"dv-data-widget-wrapper__content\">\n <div class=\"dv-data-widget-wrapper__content-row\">\n <n7-data-widget\n [data]=\"lb.widgets['dv-widget'].ds.out$ | async\">\n </n7-data-widget>\n </div>\n <div class=\"dv-data-widget-wrapper__content-row\">\n <n7-chart\n [data]=\"lb.widgets['dv-graph'].ds.out$ | async\">\n </n7-chart>\n </div>\n </div>\n </dv-data-widget-wrapper> -->\n\n <!-- Data widget wrapper with fixed height, two rows -->\n <!-- <dv-data-widget-wrapper\n [data]=\"{ classes: 'dv-data-widget-wrapper-fixed-height' }\"\n >\n <div class=\"dv-data-widget-wrapper__title\">\n <n7-inner-title [data]=\"lb.widgets['dv-inner-title'].ds.out$ | async\">\n </n7-inner-title>\n </div>\n <div class=\"dv-data-widget-wrapper__content\">\n <div class=\"dv-data-widget-wrapper__content-row\">\n <n7-data-widget [data]=\"lb.widgets['dv-widget'].ds.out$ | async\">\n </n7-data-widget>\n </div>\n <div class=\"dv-data-widget-wrapper__content-row\">Row content</div>\n </div>\n </dv-data-widget-wrapper> -->\n\n <!-- Data widget wrapper with fixed height, one row -->\n <!-- <dv-data-widget-wrapper\n [data]=\"{ classes: 'dv-data-widget-wrapper-fixed-height' }\"\n >\n <div class=\"dv-data-widget-wrapper__title\">\n <n7-inner-title [data]=\"lb.widgets['dv-inner-title'].ds.out$ | async\">\n </n7-inner-title>\n </div>\n <div class=\"dv-data-widget-wrapper__content\">\n <div class=\"dv-data-widget-wrapper__content-row\">\n <n7-data-widget [data]=\"lb.widgets['dv-widget'].ds.out$ | async\">\n </n7-data-widget>\n </div>\n </div>\n </dv-data-widget-wrapper>\n\n <dv-datepicker-wrapper\n [data]=\"lb.widgets['dv-datepicker-wrapper'].ds.out$ | async\"\n [emit]=\"lb.widgets['dv-datepicker-wrapper'].emit\"\n >\n </dv-datepicker-wrapper> -->\n</div>\n" }]
|
|
725
|
-
}], ctorParameters: function () { return [{ type: i1$1.CommunicationService }]; } });
|
|
726
|
-
|
|
727
|
-
/**
|
|
728
|
-
* All possible states of a card item.
|
|
729
|
-
*/
|
|
730
|
-
// eslint-disable-next-line no-shadow
|
|
731
|
-
var CardState;
|
|
732
|
-
(function (CardState) {
|
|
733
|
-
CardState["Idle"] = "idle";
|
|
734
|
-
CardState["Loading"] = "loading";
|
|
735
|
-
CardState["Success"] = "success";
|
|
736
|
-
CardState["Error"] = "error";
|
|
737
|
-
CardState["Empty"] = "empty";
|
|
738
|
-
})(CardState || (CardState = {}));
|
|
739
|
-
|
|
740
|
-
class DvCardExampleLayoutDS extends LayoutDataSource {
|
|
741
|
-
onInit(payload) {
|
|
742
|
-
this.cardLoader = payload.cardLoader;
|
|
743
|
-
this.cards = this.cardLoader.getCards();
|
|
744
|
-
setTimeout(() => {
|
|
745
|
-
this.cardLoader.setAllStates(CardState.Success);
|
|
746
|
-
// this.cardLoader.setState('first-card', CardState.Success);
|
|
747
|
-
this.one('item-1').update('<b>Hola</b> <i>mundo</i>!!!');
|
|
748
|
-
// this.one('item-2').update({
|
|
749
|
-
// icon: 'n7-icon-earth',
|
|
750
|
-
// text: '197 <em>Dipendenti</em>',
|
|
751
|
-
// subtitle: {
|
|
752
|
-
// text: 'Going down...',
|
|
753
|
-
// icon: 'n7-icon-caret-down',
|
|
754
|
-
// value: '-49%',
|
|
755
|
-
// payload: 'view percent tooltip'
|
|
756
|
-
// },
|
|
757
|
-
// payload: 'view earth tooltip',
|
|
758
|
-
// classes: 'is-negative'
|
|
759
|
-
// });
|
|
760
|
-
// this.getWidgetDataSource('item-2').status$.next('loading');
|
|
761
|
-
// (this.one('item-2') as any).status$.next('loading');
|
|
762
|
-
this.one('item-3').update({
|
|
763
|
-
series: [{
|
|
764
|
-
id: 'serie-1',
|
|
765
|
-
name: 'Serie 1',
|
|
766
|
-
data: [24, 35, 23, 33]
|
|
767
|
-
}],
|
|
768
|
-
categories: ['Fetta A', 'Fetta B', 'Fetta C', 'Fetta D'],
|
|
769
|
-
});
|
|
770
|
-
this.one('item-4').update({
|
|
771
|
-
series: [{
|
|
772
|
-
id: 'serie-desktops',
|
|
773
|
-
name: 'Desktops',
|
|
774
|
-
data: [10, 41, 35, 51, 49, 62, 69, 91, 148].map((value) => ({
|
|
775
|
-
value,
|
|
776
|
-
metadata: {
|
|
777
|
-
info: `è questo il valore: ${value}`
|
|
778
|
-
}
|
|
779
|
-
})).reverse()
|
|
780
|
-
}],
|
|
781
|
-
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep'],
|
|
782
|
-
});
|
|
783
|
-
this.one('item-5').update({
|
|
784
|
-
series: [{
|
|
785
|
-
id: 'serie-2021',
|
|
786
|
-
name: '2021',
|
|
787
|
-
data: [400, 430, 448, 470, 540, 580, 690, 1100, 1200, 1380].reverse()
|
|
788
|
-
}, {
|
|
789
|
-
id: 'serie-2020',
|
|
790
|
-
name: '2020',
|
|
791
|
-
data: [300, 530, 418, 370, 240, 680, 390, 100, 200, 1280].reverse()
|
|
792
|
-
}],
|
|
793
|
-
categories: ['South Korea', 'Canada', 'United Kingdom', 'Netherlands', 'Italy', 'France', 'Japan', 'United States', 'China', 'Germany'],
|
|
794
|
-
});
|
|
795
|
-
}, 3000);
|
|
796
|
-
setTimeout(() => {
|
|
797
|
-
this.cardLoader.setState('section-02', CardState.Loading);
|
|
798
|
-
this.cardLoader.setState('item-4', CardState.Loading);
|
|
799
|
-
// this.cardLoader.setSomeStates(['item-4', 'text-3', 'section-04'], CardState.Empty);
|
|
800
|
-
}, 4000);
|
|
801
|
-
}
|
|
802
|
-
onDestroy() {
|
|
803
|
-
console.warn('DvCardExampleLayout destroyed!');
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
class DvCardExampleLayoutEH extends EventHandler {
|
|
808
|
-
listen() {
|
|
809
|
-
this.innerEvents$.subscribe(({ type, payload }) => {
|
|
810
|
-
console.log('innerEvents$----->', type, payload);
|
|
811
|
-
switch (type) {
|
|
812
|
-
case 'dv-card-example-layout.init':
|
|
813
|
-
this.dataSource.onInit(payload);
|
|
814
|
-
break;
|
|
815
|
-
case 'dv-card-example-layout.destroy':
|
|
816
|
-
this.dataSource.onDestroy();
|
|
817
|
-
break;
|
|
818
|
-
default:
|
|
819
|
-
break;
|
|
820
|
-
}
|
|
821
|
-
});
|
|
822
|
-
this.outerEvents$.subscribe(({ type, payload }) => {
|
|
823
|
-
console.log('outerEvents$----->', type, payload);
|
|
824
|
-
// TODO
|
|
825
|
-
});
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
const DvCardExampleLayoutConfig = {
|
|
830
|
-
layoutId: 'dv-card-example-layout',
|
|
831
|
-
// widgets added dinamically
|
|
832
|
-
widgets: [],
|
|
833
|
-
layoutDS: DvCardExampleLayoutDS,
|
|
834
|
-
layoutEH: DvCardExampleLayoutEH,
|
|
835
|
-
widgetsDataSources: {},
|
|
836
|
-
widgetsEventHandlers: {},
|
|
837
|
-
options: {},
|
|
838
|
-
};
|
|
839
|
-
|
|
840
|
-
const DATASOURCE_MAP = {
|
|
841
|
-
text: TextItemDS,
|
|
842
|
-
table: TableItemDS,
|
|
843
|
-
select: SelectItemDS,
|
|
844
|
-
map: MapItemDS,
|
|
845
|
-
'inner-title': InnerTitleItemDS,
|
|
846
|
-
'data-widget': DataWidgetItemDS,
|
|
847
|
-
'apex-bar-chart': ApexChartItemDS,
|
|
848
|
-
'apex-line-chart': ApexChartItemDS,
|
|
849
|
-
'apex-pie-chart': ApexChartItemDS,
|
|
850
|
-
'apex-radialbar-chart': ApexChartItemDS,
|
|
851
|
-
'apex-radar-chart': ApexChartItemDS,
|
|
852
|
-
};
|
|
853
|
-
class CardLoader {
|
|
854
|
-
constructor(layout, config) {
|
|
855
|
-
this.layout = layout;
|
|
856
|
-
this.config = config;
|
|
857
|
-
this.itemsInitialized = false;
|
|
858
|
-
/**
|
|
859
|
-
* Holds the state of all the internal widgets and sections
|
|
860
|
-
* of the cards.
|
|
861
|
-
*/
|
|
862
|
-
this.state$ = {};
|
|
863
|
-
this.addLayoutWidgets();
|
|
864
|
-
}
|
|
865
|
-
getCards() {
|
|
866
|
-
const { cards } = this.config;
|
|
867
|
-
const cardsWithWidgets = [];
|
|
868
|
-
// initialize items
|
|
869
|
-
if (cards && !this.itemsInitialized) {
|
|
870
|
-
const { widgets } = this.layout.lb;
|
|
871
|
-
this.itemsInitialized = true;
|
|
872
|
-
cards.forEach(({ id, header, content, footer }, index) => {
|
|
873
|
-
const cardWidgets = {};
|
|
874
|
-
const cardSections = content.sections
|
|
875
|
-
.concat((header === null || header === void 0 ? void 0 : header.sections) || [])
|
|
876
|
-
.concat((footer === null || footer === void 0 ? void 0 : footer.sections) || []);
|
|
877
|
-
const state$ = {
|
|
878
|
-
[id]: new BehaviorSubject(CardState.Idle),
|
|
879
|
-
[`${id}.content`]: new BehaviorSubject(CardState.Idle),
|
|
880
|
-
[`${id}.header`]: new BehaviorSubject(CardState.Idle),
|
|
881
|
-
[`${id}.footer`]: new BehaviorSubject(CardState.Idle),
|
|
882
|
-
};
|
|
883
|
-
const cardStateComponents = {};
|
|
884
|
-
cardSections.forEach(({ id: sectionID, items }) => {
|
|
885
|
-
state$[sectionID] = new BehaviorSubject(CardState.Idle);
|
|
886
|
-
items.forEach(({ id: widgetID, type: itemType, initialData, stateComponents }) => {
|
|
887
|
-
const { ds } = widgets[widgetID];
|
|
888
|
-
const { eh } = widgets[widgetID];
|
|
889
|
-
ds.id = widgetID;
|
|
890
|
-
ds.type = itemType;
|
|
891
|
-
const emit = (type, payload) => eh.emitInner(type, payload);
|
|
892
|
-
// setup card status stream
|
|
893
|
-
// widgets[id].ds.status$ = new BehaviorSubject<Status>(CardState.Idle);
|
|
894
|
-
state$[widgetID] = new BehaviorSubject(CardState.Idle);
|
|
895
|
-
cardStateComponents[widgetID] = stateComponents;
|
|
896
|
-
cardWidgets[widgetID] = { ds, emit };
|
|
897
|
-
// with initialData
|
|
898
|
-
if (initialData) {
|
|
899
|
-
state$[widgetID].pipe(filter((stateID) => stateID === CardState.Success), first()).subscribe({
|
|
900
|
-
next: () => ds.update(initialData)
|
|
901
|
-
});
|
|
902
|
-
}
|
|
903
|
-
});
|
|
904
|
-
});
|
|
905
|
-
// add widgets to card
|
|
906
|
-
cardsWithWidgets[index] = Object.assign(Object.assign({}, cards[index]), { widgets: cardWidgets, state$, stateComponents: cardStateComponents });
|
|
907
|
-
// merge the new states with the existing ones
|
|
908
|
-
this.state$ = Object.assign(Object.assign({}, this.state$), state$);
|
|
909
|
-
});
|
|
910
|
-
}
|
|
911
|
-
return cardsWithWidgets;
|
|
912
|
-
}
|
|
913
|
-
updateState(ids, newState) {
|
|
914
|
-
const updates = forkJoin(ids.map((id) => this.state$[id]));
|
|
915
|
-
ids.forEach((id) => {
|
|
916
|
-
if (this.state$[id]) {
|
|
917
|
-
this.state$[id].next(newState);
|
|
918
|
-
}
|
|
919
|
-
});
|
|
920
|
-
return updates;
|
|
921
|
-
}
|
|
922
|
-
setState(id, newState) {
|
|
923
|
-
return this.updateState([id], newState);
|
|
924
|
-
}
|
|
925
|
-
setAllStates(newState) {
|
|
926
|
-
return this.updateState(Object.keys(this.state$), newState);
|
|
927
|
-
}
|
|
928
|
-
setSomeStates(ids, newState) {
|
|
929
|
-
return this.updateState(ids, newState);
|
|
930
|
-
}
|
|
931
|
-
addLayoutWidgets() {
|
|
932
|
-
const { cards } = this.config;
|
|
933
|
-
if (cards) {
|
|
934
|
-
this.layout.widgets = this.layout.widgets || [];
|
|
935
|
-
cards.forEach(({ header, content, footer }) => {
|
|
936
|
-
const cardSections = content.sections
|
|
937
|
-
.concat((header === null || header === void 0 ? void 0 : header.sections) || [])
|
|
938
|
-
.concat((footer === null || footer === void 0 ? void 0 : footer.sections) || []);
|
|
939
|
-
cardSections.forEach(({ items }) => {
|
|
940
|
-
items.forEach(({ id, type, options }) => {
|
|
941
|
-
this.layout.widgets.push({
|
|
942
|
-
id,
|
|
943
|
-
options,
|
|
944
|
-
dataSource: DATASOURCE_MAP[type],
|
|
945
|
-
eventHandler: CardEH
|
|
946
|
-
});
|
|
947
|
-
});
|
|
948
|
-
});
|
|
949
|
-
});
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
class DvCardExampleLayoutComponent extends AbstractLayout {
|
|
955
|
-
constructor(layoutsConfiguration, configuration, communication, activatedRoute) {
|
|
956
|
-
super(layoutsConfiguration.get('MrResourceLayoutConfig') || DvCardExampleLayoutConfig);
|
|
957
|
-
this.configuration = configuration;
|
|
958
|
-
this.communication = communication;
|
|
959
|
-
this.activatedRoute = activatedRoute;
|
|
960
|
-
}
|
|
961
|
-
initPayload() {
|
|
962
|
-
return {
|
|
963
|
-
configId: this.configId,
|
|
964
|
-
configuration: this.configuration,
|
|
965
|
-
communication: this.communication,
|
|
966
|
-
cardLoader: this.cardLoader,
|
|
967
|
-
options: this.config.options || {},
|
|
968
|
-
};
|
|
969
|
-
}
|
|
970
|
-
ngOnInit() {
|
|
971
|
-
this.activatedRoute.data.subscribe((data) => {
|
|
972
|
-
this.configId = data.configId;
|
|
973
|
-
const pageConfig = this.configuration.get(this.configId);
|
|
974
|
-
this.cardLoader = new CardLoader(this, pageConfig);
|
|
975
|
-
this.onInit();
|
|
976
|
-
});
|
|
977
|
-
}
|
|
978
|
-
ngOnDestroy() {
|
|
979
|
-
this.onDestroy();
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
DvCardExampleLayoutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DvCardExampleLayoutComponent, deps: [{ token: i1$1.LayoutsConfigurationService }, { token: i1$1.ConfigurationService }, { token: i1$1.CommunicationService }, { token: i2$1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
|
983
|
-
DvCardExampleLayoutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: DvCardExampleLayoutComponent, selector: "dv-card-example-layout", usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"lb.dataSource && lb.dataSource.cards\" class=\"dv-card-example-layout\">\n <ng-container *ngFor=\"let card of lb.dataSource.cards\">\n <dv-card [data]=\"card\"></dv-card>\n </ng-container>\n</div>", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CardComponent, selector: "dv-card", inputs: ["data", "emit"] }] });
|
|
984
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: DvCardExampleLayoutComponent, decorators: [{
|
|
985
|
-
type: Component,
|
|
986
|
-
args: [{ selector: 'dv-card-example-layout', template: "<div *ngIf=\"lb.dataSource && lb.dataSource.cards\" class=\"dv-card-example-layout\">\n <ng-container *ngFor=\"let card of lb.dataSource.cards\">\n <dv-card [data]=\"card\"></dv-card>\n </ng-container>\n</div>" }]
|
|
987
|
-
}], ctorParameters: function () { return [{ type: i1$1.LayoutsConfigurationService }, { type: i1$1.ConfigurationService }, { type: i1$1.CommunicationService }, { type: i2$1.ActivatedRoute }]; } });
|
|
988
|
-
|
|
989
|
-
// MODULES
|
|
990
|
-
const COMPONENTS = [
|
|
991
|
-
DataWidgetWrapperComponent,
|
|
992
|
-
DatepickerWrapperComponent,
|
|
993
|
-
CardComponent,
|
|
994
|
-
CardStateWrapperComponent,
|
|
995
|
-
CardTextItemComponent,
|
|
996
|
-
DvExampleLayoutComponent,
|
|
997
|
-
DvCardExampleLayoutComponent
|
|
998
|
-
];
|
|
999
|
-
class N7BoilerplateDatavizModule {
|
|
1000
|
-
}
|
|
1001
|
-
N7BoilerplateDatavizModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: N7BoilerplateDatavizModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1002
|
-
N7BoilerplateDatavizModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: N7BoilerplateDatavizModule, declarations: [DataWidgetWrapperComponent,
|
|
1003
|
-
DatepickerWrapperComponent,
|
|
1004
|
-
CardComponent,
|
|
1005
|
-
CardStateWrapperComponent,
|
|
1006
|
-
CardTextItemComponent,
|
|
1007
|
-
DvExampleLayoutComponent,
|
|
1008
|
-
DvCardExampleLayoutComponent], imports: [CommonModule,
|
|
1009
|
-
DvComponentsLibModule,
|
|
1010
|
-
N7BoilerplateCommonModule], exports: [DataWidgetWrapperComponent,
|
|
1011
|
-
DatepickerWrapperComponent,
|
|
1012
|
-
CardComponent,
|
|
1013
|
-
CardStateWrapperComponent,
|
|
1014
|
-
CardTextItemComponent,
|
|
1015
|
-
DvExampleLayoutComponent,
|
|
1016
|
-
DvCardExampleLayoutComponent] });
|
|
1017
|
-
N7BoilerplateDatavizModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: N7BoilerplateDatavizModule, imports: [CommonModule,
|
|
1018
|
-
DvComponentsLibModule,
|
|
1019
|
-
N7BoilerplateCommonModule] });
|
|
1020
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: N7BoilerplateDatavizModule, decorators: [{
|
|
1021
|
-
type: NgModule,
|
|
1022
|
-
args: [{
|
|
1023
|
-
declarations: COMPONENTS,
|
|
1024
|
-
imports: [
|
|
1025
|
-
CommonModule,
|
|
1026
|
-
DvComponentsLibModule,
|
|
1027
|
-
N7BoilerplateCommonModule,
|
|
1028
|
-
],
|
|
1029
|
-
providers: [],
|
|
1030
|
-
exports: COMPONENTS
|
|
1031
|
-
}]
|
|
1032
|
-
}] });
|
|
1033
|
-
|
|
1034
|
-
// example layout
|
|
1035
|
-
|
|
1036
|
-
/*
|
|
1037
|
-
* Public API Surface of n7-boilerplate-dataviz
|
|
1038
|
-
*/
|
|
1039
|
-
|
|
1040
|
-
/**
|
|
1041
|
-
* Generated bundle index. Do not edit.
|
|
1042
|
-
*/
|
|
1043
|
-
|
|
1044
|
-
export { ApexChartItemDS, ApexHandler, CardComponent, CardDS, CardEH, CardLoader, CardState, CardStateWrapperComponent, CardTextItemComponent, DataWidgetItemDS, DataWidgetWrapperComponent, DatepickerWrapperComponent, DvCardExampleLayoutComponent, DvCardExampleLayoutConfig, DvCardExampleLayoutDS, DvCardExampleLayoutEH, DvDataWidgetDS, DvDatepickerWrapperDS, DvDatepickerWrapperEH, DvExampleLayoutComponent, DvExampleLayoutConfig, DvExampleLayoutDS, DvExampleLayoutEH, DvGraphDS, DvInnerTitleDS, DvWidgetDS, InnerTitleItemDS, MapItemDS, N7BoilerplateDatavizModule, SelectItemDS, TableItemDS, TextItemDS, apexHandler };
|
|
1045
|
-
//# sourceMappingURL=net7-boilerplate-dataviz.mjs.map
|