@fidurcode/dashboard-widgets-skeleton 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -55,10 +55,10 @@ class WidgetService {
|
|
|
55
55
|
deleteWidget(id) {
|
|
56
56
|
this.addedWidgets.set(this.addedWidgets().filter((w) => w.id !== id));
|
|
57
57
|
}
|
|
58
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.
|
|
59
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.
|
|
58
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: WidgetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
59
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: WidgetService });
|
|
60
60
|
}
|
|
61
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: WidgetService, decorators: [{
|
|
62
62
|
type: Injectable
|
|
63
63
|
}] });
|
|
64
64
|
|
|
@@ -66,10 +66,10 @@ class WidgetOptionsComponent {
|
|
|
66
66
|
widget = input.required(...(ngDevMode ? [{ debugName: "widget" }] : []));
|
|
67
67
|
showOptions = model(false, ...(ngDevMode ? [{ debugName: "showOptions" }] : []));
|
|
68
68
|
store = inject(WidgetService);
|
|
69
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.
|
|
70
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.
|
|
69
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: WidgetOptionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
70
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.2", type: WidgetOptionsComponent, isStandalone: false, selector: "app-widget-options", inputs: { widget: { classPropertyName: "widget", publicName: "widget", isSignal: true, isRequired: true, transformFunction: null }, showOptions: { classPropertyName: "showOptions", publicName: "showOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { showOptions: "showOptionsChange" }, ngImport: i0, template: "<button (click)=\"showOptions.set(false)\" class=\"close-button\" mat-icon-button>\n <mat-icon>close</mat-icon>\n</button>\n\n<div (click)=\"store.moveWidgetToRight(widget().id)\" class=\"move-forward-button\">\n <mat-icon>chevron_right</mat-icon>\n</div>\n\n<div (click)=\"store.moveWidgetToLeft(widget().id)\" class=\"move-backward-button\">\n <mat-icon>chevron_left</mat-icon>\n</div>\n\n<div (click)=\"store.deleteWidget(widget().id)\" class=\"remove-widget-button\">\n <mat-icon>delete</mat-icon>\n</div>\n\n<div>\n Width\n <mat-button-toggle-group\n (change)=\"store.updateWidget(widget().id, { columns: +$event.value })\"\n [hideSingleSelectionIndicator]=\"true\"\n [value]=\"widget().columns ?? 1\">\n <mat-button-toggle [value]=\"1\">1</mat-button-toggle>\n <mat-button-toggle [value]=\"2\">2</mat-button-toggle>\n <mat-button-toggle [value]=\"3\">3</mat-button-toggle>\n <mat-button-toggle [value]=\"4\">4</mat-button-toggle>\n </mat-button-toggle-group>\n</div>\n\n<div>\n Height\n <mat-button-toggle-group\n (change)=\"store.updateWidget(widget().id, { rows: +$event.value })\"\n [hideSingleSelectionIndicator]=\"true\"\n [value]=\"widget().rows ?? 1\">\n <mat-button-toggle [value]=\"1\">1</mat-button-toggle>\n <mat-button-toggle [value]=\"2\">2</mat-button-toggle>\n <mat-button-toggle [value]=\"3\">3</mat-button-toggle>\n <mat-button-toggle [value]=\"4\">4</mat-button-toggle>\n </mat-button-toggle-group>\n</div>", styles: [":host{position:absolute;z-index:2;background:inherit;color:inherit;top:0;left:0;border-radius:inherit;width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;box-sizing:border-box;--mat-standard-button-toggle-height: 9px}:host>div{display:flex;gap:8px;align-items:center;margin-left:8px}.close-button{position:absolute;top:0;right:0}.move-forward-button{position:absolute;top:50%;transform:translateY(-50%);right:-5px}.move-backward-button{position:absolute;top:50%;transform:translateY(-50%);left:-5px}.remove-widget-button{position:absolute;top:0;left:0;padding:5px}\n"], dependencies: [{ kind: "directive", type: i1.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i1.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] });
|
|
71
71
|
}
|
|
72
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: WidgetOptionsComponent, decorators: [{
|
|
73
73
|
type: Component,
|
|
74
74
|
args: [{ selector: 'app-widget-options', standalone: false, template: "<button (click)=\"showOptions.set(false)\" class=\"close-button\" mat-icon-button>\n <mat-icon>close</mat-icon>\n</button>\n\n<div (click)=\"store.moveWidgetToRight(widget().id)\" class=\"move-forward-button\">\n <mat-icon>chevron_right</mat-icon>\n</div>\n\n<div (click)=\"store.moveWidgetToLeft(widget().id)\" class=\"move-backward-button\">\n <mat-icon>chevron_left</mat-icon>\n</div>\n\n<div (click)=\"store.deleteWidget(widget().id)\" class=\"remove-widget-button\">\n <mat-icon>delete</mat-icon>\n</div>\n\n<div>\n Width\n <mat-button-toggle-group\n (change)=\"store.updateWidget(widget().id, { columns: +$event.value })\"\n [hideSingleSelectionIndicator]=\"true\"\n [value]=\"widget().columns ?? 1\">\n <mat-button-toggle [value]=\"1\">1</mat-button-toggle>\n <mat-button-toggle [value]=\"2\">2</mat-button-toggle>\n <mat-button-toggle [value]=\"3\">3</mat-button-toggle>\n <mat-button-toggle [value]=\"4\">4</mat-button-toggle>\n </mat-button-toggle-group>\n</div>\n\n<div>\n Height\n <mat-button-toggle-group\n (change)=\"store.updateWidget(widget().id, { rows: +$event.value })\"\n [hideSingleSelectionIndicator]=\"true\"\n [value]=\"widget().rows ?? 1\">\n <mat-button-toggle [value]=\"1\">1</mat-button-toggle>\n <mat-button-toggle [value]=\"2\">2</mat-button-toggle>\n <mat-button-toggle [value]=\"3\">3</mat-button-toggle>\n <mat-button-toggle [value]=\"4\">4</mat-button-toggle>\n </mat-button-toggle-group>\n</div>", styles: [":host{position:absolute;z-index:2;background:inherit;color:inherit;top:0;left:0;border-radius:inherit;width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;box-sizing:border-box;--mat-standard-button-toggle-height: 9px}:host>div{display:flex;gap:8px;align-items:center;margin-left:8px}.close-button{position:absolute;top:0;right:0}.move-forward-button{position:absolute;top:50%;transform:translateY(-50%);right:-5px}.move-backward-button{position:absolute;top:50%;transform:translateY(-50%);left:-5px}.remove-widget-button{position:absolute;top:0;left:0;padding:5px}\n"] }]
|
|
75
75
|
}] });
|
|
@@ -81,10 +81,10 @@ class WidgetComponent {
|
|
|
81
81
|
const widget = this.data();
|
|
82
82
|
return `span ${widget.rows ?? 1} / span ${widget.columns ?? 1}`;
|
|
83
83
|
}
|
|
84
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.
|
|
85
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.
|
|
84
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: WidgetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
85
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: WidgetComponent, isStandalone: false, selector: "app-widget", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "style.grid-area": "gridArea" } }, ngImport: i0, template: "<div\n class=\"widget-container mat-elevation-z3\"\n>\n <h3 class=\"m-0\">{{ data().label }}</h3>\n <button (click)=\"showWidgetOptions.set(true)\" class=\"settings-button\" mat-icon-button>\n <mat-icon>settings</mat-icon>\n </button>\n\n <ng-container [ngComponentOutlet]=\"data().content\"/>\n\n @if (showWidgetOptions()) {\n <app-widget-options [(showOptions)]=\"showWidgetOptions\" [widget]=\"data()\"/>\n }\n</div>", styles: [":host{display:block;border-radius:16px}.widget-container{position:relative;height:100%;width:100%;padding:32px;box-sizing:border-box;border-radius:inherit;overflow:hidden;background-color:var(--mat-sys-background);cursor:pointer}.settings-button{position:absolute;top:20px;right:20px}\n"], dependencies: [{ kind: "directive", type: i1$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: WidgetOptionsComponent, selector: "app-widget-options", inputs: ["widget", "showOptions"], outputs: ["showOptionsChange"] }] });
|
|
86
86
|
}
|
|
87
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.
|
|
87
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: WidgetComponent, decorators: [{
|
|
88
88
|
type: Component,
|
|
89
89
|
args: [{ selector: 'app-widget', standalone: false, host: {
|
|
90
90
|
'[style.grid-area]': 'gridArea',
|
|
@@ -97,17 +97,17 @@ class DashboardWidgetsComponent {
|
|
|
97
97
|
ngOnInit() {
|
|
98
98
|
wrapGrid(this.dashboard().nativeElement, { duration: 300 });
|
|
99
99
|
}
|
|
100
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.
|
|
101
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.
|
|
100
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: DashboardWidgetsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
101
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.2", type: DashboardWidgetsComponent, isStandalone: false, selector: "app-dashboard-widgets", providers: [WidgetService], viewQueries: [{ propertyName: "dashboard", first: true, predicate: ["dashboard"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"dashboard-widgets-header\">\n <h2>Dashboard</h2>\n <button [matMenuTriggerFor]=\"menu\" mat-raised-button>\n <mat-icon>add_circle</mat-icon>\n Add widget\n </button>\n <mat-menu #menu=\"matMenu\">\n @for (widget of store.widgetsToAdd(); track widget.id) {\n <button mat-menu-item (click)=\"store.addWidget(widget)\">{{ widget.label }}</button>\n } @empty {\n <button mat-menu-item>No widget to add</button>\n }\n </mat-menu>\n</div>\n<div #dashboard class=\"dashboard-widgets\">\n @for (w of store.addedWidgets(); track w.id) {\n <app-widget [data]=\"w\"/>\n }\n</div>", styles: [".dashboard-widgets-header{display:flex;justify-content:space-between;align-items:center}.dashboard-widgets{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));grid-auto-rows:150px;gap:16px}\n"], dependencies: [{ kind: "component", type: i1$2.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1$2.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i1$2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: i2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: WidgetComponent, selector: "app-widget", inputs: ["data"] }] });
|
|
102
102
|
}
|
|
103
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.
|
|
103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: DashboardWidgetsComponent, decorators: [{
|
|
104
104
|
type: Component,
|
|
105
105
|
args: [{ selector: 'app-dashboard-widgets', standalone: false, providers: [WidgetService], template: "<div class=\"dashboard-widgets-header\">\n <h2>Dashboard</h2>\n <button [matMenuTriggerFor]=\"menu\" mat-raised-button>\n <mat-icon>add_circle</mat-icon>\n Add widget\n </button>\n <mat-menu #menu=\"matMenu\">\n @for (widget of store.widgetsToAdd(); track widget.id) {\n <button mat-menu-item (click)=\"store.addWidget(widget)\">{{ widget.label }}</button>\n } @empty {\n <button mat-menu-item>No widget to add</button>\n }\n </mat-menu>\n</div>\n<div #dashboard class=\"dashboard-widgets\">\n @for (w of store.addedWidgets(); track w.id) {\n <app-widget [data]=\"w\"/>\n }\n</div>", styles: [".dashboard-widgets-header{display:flex;justify-content:space-between;align-items:center}.dashboard-widgets{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));grid-auto-rows:150px;gap:16px}\n"] }]
|
|
106
106
|
}] });
|
|
107
107
|
|
|
108
108
|
class DashboardWidgetsSkeletonModule {
|
|
109
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.
|
|
110
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.
|
|
109
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: DashboardWidgetsSkeletonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
110
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.2", ngImport: i0, type: DashboardWidgetsSkeletonModule, declarations: [WidgetComponent,
|
|
111
111
|
WidgetOptionsComponent,
|
|
112
112
|
DashboardWidgetsComponent], imports: [CommonModule,
|
|
113
113
|
MatMenuModule,
|
|
@@ -120,7 +120,7 @@ class DashboardWidgetsSkeletonModule {
|
|
|
120
120
|
MatButtonToggleModule,
|
|
121
121
|
MatButtonModule,
|
|
122
122
|
MatIconModule] });
|
|
123
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.
|
|
123
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: DashboardWidgetsSkeletonModule, providers: [WidgetService], imports: [CommonModule,
|
|
124
124
|
MatMenuModule,
|
|
125
125
|
MatButtonToggleModule,
|
|
126
126
|
MatButtonModule,
|
|
@@ -129,7 +129,7 @@ class DashboardWidgetsSkeletonModule {
|
|
|
129
129
|
MatButtonModule,
|
|
130
130
|
MatIconModule] });
|
|
131
131
|
}
|
|
132
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.
|
|
132
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: DashboardWidgetsSkeletonModule, decorators: [{
|
|
133
133
|
type: NgModule,
|
|
134
134
|
args: [{
|
|
135
135
|
declarations: [
|