@lukfel/ng-scaffold 21.1.29 → 21.1.31
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/fesm2022/{lukfel-ng-scaffold-confirm-dialog.component-Cj5E5jtW.mjs → lukfel-ng-scaffold-confirm-dialog.component-CPAkFqh1.mjs} +3 -3
- package/fesm2022/lukfel-ng-scaffold-confirm-dialog.component-CPAkFqh1.mjs.map +1 -0
- package/fesm2022/lukfel-ng-scaffold.mjs +15 -15
- package/fesm2022/lukfel-ng-scaffold.mjs.map +1 -1
- package/package.json +1 -1
- package/styles/_classes.scss +66 -1
- package/types/lukfel-ng-scaffold.d.ts +2 -4
- package/fesm2022/lukfel-ng-scaffold-confirm-dialog.component-Cj5E5jtW.mjs.map +0 -1
|
@@ -7,8 +7,8 @@ import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
|
7
7
|
|
|
8
8
|
class ConfirmDialogComponent {
|
|
9
9
|
constructor() {
|
|
10
|
-
this.
|
|
11
|
-
this.config = signal(this.
|
|
10
|
+
this.data = inject(MAT_DIALOG_DATA);
|
|
11
|
+
this.config = signal(this.data, ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
12
12
|
}
|
|
13
13
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ConfirmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
14
14
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ConfirmDialogComponent, isStandalone: true, selector: "lf-confirm-dialog", ngImport: i0, template: "@if (config(); as config) {\r\n @if (config.title) {\r\n <h2 mat-dialog-title>{{ config.title }}</h2>\r\n }\r\n\r\n <mat-dialog-content>\r\n @if (config.message) {\r\n <p>{{ config.message }}</p>\r\n }\r\n </mat-dialog-content>\r\n\r\n <mat-dialog-actions align=\"end\">\r\n @if (config.closeLabel) {\r\n <button mat-button [mat-dialog-close]=\"false\">\r\n {{ config.closeLabel }}\r\n </button>\r\n }\r\n @if (config.confirmLabel) {\r\n <button mat-button color=\"primary\" [mat-dialog-close]=\"true\">\r\n {{ config.confirmLabel }}\r\n </button>\r\n }\r\n </mat-dialog-actions>\r\n}\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatButtonModule }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
@@ -22,4 +22,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
22
22
|
}] });
|
|
23
23
|
|
|
24
24
|
export { ConfirmDialogComponent };
|
|
25
|
-
//# sourceMappingURL=lukfel-ng-scaffold-confirm-dialog.component-
|
|
25
|
+
//# sourceMappingURL=lukfel-ng-scaffold-confirm-dialog.component-CPAkFqh1.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lukfel-ng-scaffold-confirm-dialog.component-CPAkFqh1.mjs","sources":["../../../projects/ng-scaffold/src/lib/shared/components/dialogs/confirm-dialog/confirm-dialog.component.ts","../../../projects/ng-scaffold/src/lib/shared/components/dialogs/confirm-dialog/confirm-dialog.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, inject, signal } from '@angular/core';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';\r\nimport { ConfirmDialogConfig } from '../../../../models';\r\n\r\n@Component({\r\n selector: 'lf-confirm-dialog',\r\n templateUrl: './confirm-dialog.component.html',\r\n styleUrls: ['./confirm-dialog.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n standalone: true,\r\n imports: [\r\n MatDialogModule,\r\n MatButtonModule\r\n ]\r\n})\r\nexport class ConfirmDialogComponent {\r\n \r\n private data = inject<ConfirmDialogConfig>(MAT_DIALOG_DATA);\r\n public config = signal<ConfirmDialogConfig>(this.data);\r\n\r\n}\r\n","@if (config(); as config) {\r\n @if (config.title) {\r\n <h2 mat-dialog-title>{{ config.title }}</h2>\r\n }\r\n\r\n <mat-dialog-content>\r\n @if (config.message) {\r\n <p>{{ config.message }}</p>\r\n }\r\n </mat-dialog-content>\r\n\r\n <mat-dialog-actions align=\"end\">\r\n @if (config.closeLabel) {\r\n <button mat-button [mat-dialog-close]=\"false\">\r\n {{ config.closeLabel }}\r\n </button>\r\n }\r\n @if (config.confirmLabel) {\r\n <button mat-button color=\"primary\" [mat-dialog-close]=\"true\">\r\n {{ config.confirmLabel }}\r\n </button>\r\n }\r\n </mat-dialog-actions>\r\n}\r\n"],"names":[],"mappings":";;;;;;;MAgBa,sBAAsB,CAAA;AAXnC,IAAA,WAAA,GAAA;AAaW,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAsB,eAAe,CAAC;AACpD,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAsB,IAAI,CAAC,IAAI,kDAAC;AAExD,IAAA;8GALY,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EChBnC,gpBAwBA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDZI,eAAe,+nBACf,eAAe,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,QAAA,EAAA,iOAAA,EAAA,MAAA,EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,CAAA,WAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAGN,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAXlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,mBAGZ,uBAAuB,CAAC,MAAM,EAAA,UAAA,EACnC,IAAI,EAAA,OAAA,EACP;wBACP,eAAe;wBACf;AACD,qBAAA,EAAA,QAAA,EAAA,gpBAAA,EAAA;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, makeEnvironmentProviders, inject, Injectable, PLATFORM_ID, DOCUMENT, input, output, ChangeDetectionStrategy, Component, viewChild, computed, model, effect, signal, TemplateRef, Directive, contentChild } from '@angular/core';
|
|
2
|
+
import { InjectionToken, makeEnvironmentProviders, inject, Injectable, PLATFORM_ID, DOCUMENT, input, output, ChangeDetectionStrategy, Component, viewChild, computed, model, effect, signal, TemplateRef, Directive, contentChild, linkedSignal } from '@angular/core';
|
|
3
3
|
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
|
|
4
4
|
import * as i1 from '@angular/common';
|
|
5
5
|
import { isPlatformBrowser, CommonModule } from '@angular/common';
|
|
@@ -79,7 +79,7 @@ class DialogService {
|
|
|
79
79
|
* @returns an asynchronous boolean response
|
|
80
80
|
*/
|
|
81
81
|
async openConfirmDialog(config) {
|
|
82
|
-
const { ConfirmDialogComponent } = await import('./lukfel-ng-scaffold-confirm-dialog.component-
|
|
82
|
+
const { ConfirmDialogComponent } = await import('./lukfel-ng-scaffold-confirm-dialog.component-CPAkFqh1.mjs');
|
|
83
83
|
const dialogRef = this.matDialog.open(ConfirmDialogComponent, {
|
|
84
84
|
autoFocus: false,
|
|
85
85
|
maxWidth: '368px',
|
|
@@ -597,11 +597,12 @@ class SnackbarService {
|
|
|
597
597
|
this.SNACKBAR_POSITION_HORIZONTAL = 'center';
|
|
598
598
|
this.SNACKBAR_POSITION_VERTICAL = 'bottom';
|
|
599
599
|
this.actionConfig = {
|
|
600
|
+
duration: this.SNACKBAR_DURATION,
|
|
600
601
|
horizontalPosition: this.SNACKBAR_POSITION_HORIZONTAL,
|
|
601
602
|
verticalPosition: this.SNACKBAR_POSITION_VERTICAL
|
|
602
603
|
};
|
|
603
604
|
this.defaultConfig = {
|
|
604
|
-
duration: this.SNACKBAR_DURATION,
|
|
605
|
+
duration: (this.SNACKBAR_DURATION / 2),
|
|
605
606
|
horizontalPosition: this.SNACKBAR_POSITION_HORIZONTAL,
|
|
606
607
|
verticalPosition: this.SNACKBAR_POSITION_VERTICAL
|
|
607
608
|
};
|
|
@@ -1488,35 +1489,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1488
1489
|
class ColorPickerComponent {
|
|
1489
1490
|
constructor() {
|
|
1490
1491
|
this.libraryConfig = inject(CONFIG, { optional: true });
|
|
1491
|
-
this.logger = inject(Logger);
|
|
1492
1492
|
this.color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
1493
1493
|
this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
1494
1494
|
this.matIcon = input(...(ngDevMode ? [undefined, { debugName: "matIcon" }] : []));
|
|
1495
1495
|
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
1496
1496
|
this.tooltip = input(...(ngDevMode ? [undefined, { debugName: "tooltip" }] : []));
|
|
1497
1497
|
this.colorChangeEvent = output();
|
|
1498
|
-
this.selectedColor =
|
|
1499
|
-
|
|
1498
|
+
this.selectedColor = linkedSignal(() => {
|
|
1499
|
+
const color = this.color();
|
|
1500
|
+
if (color && color !== 'primary' && color !== 'accent' && color !== 'warn') {
|
|
1501
|
+
return color;
|
|
1502
|
+
}
|
|
1503
|
+
return '';
|
|
1504
|
+
}, ...(ngDevMode ? [{ debugName: "selectedColor" }] : []));
|
|
1505
|
+
this.labelColor = computed(() => {
|
|
1500
1506
|
const hex = this.selectedColor().replace('#', '');
|
|
1501
1507
|
const r = parseInt(hex.substr(0, 2), 16);
|
|
1502
1508
|
const g = parseInt(hex.substr(2, 2), 16);
|
|
1503
1509
|
const b = parseInt(hex.substr(4, 2), 16);
|
|
1504
1510
|
const brightness = (r * 299 + g * 587 + b * 114) / 1000;
|
|
1505
1511
|
return brightness > 128 ? '#000000' : '#ffffff';
|
|
1506
|
-
}, ...(ngDevMode ? [{ debugName: "
|
|
1507
|
-
}
|
|
1508
|
-
ngOnInit() {
|
|
1509
|
-
const color = this.color();
|
|
1510
|
-
if (color && color !== 'primary' && color !== 'accent' && color !== 'warn') {
|
|
1511
|
-
this.selectedColor.set(color);
|
|
1512
|
-
}
|
|
1512
|
+
}, ...(ngDevMode ? [{ debugName: "labelColor" }] : []));
|
|
1513
1513
|
}
|
|
1514
1514
|
selectColor(event) {
|
|
1515
1515
|
this.selectedColor.set(event);
|
|
1516
1516
|
this.colorChangeEvent.emit(event);
|
|
1517
1517
|
}
|
|
1518
1518
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ColorPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1519
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ColorPickerComponent, isStandalone: true, selector: "lf-color-picker", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, matIcon: { classPropertyName: "matIcon", publicName: "matIcon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { colorChangeEvent: "colorChangeEvent" }, ngImport: i0, template: "<input\r\n #colorPicker\r\n type=\"color\"\r\n onclick=\"this.value = null\"\r\n [ngModel]=\"selectedColor()\"\r\n (ngModelChange)=\"selectColor($event)\"\r\n style=\"opacity: 0; position: absolute; width: 0; height: 36px; border: none\" />\r\n\r\n<button\r\n mat-flat-button\r\n class=\"lf-button\"\r\n type=\"button\"\r\n [color]=\"selectedColor() ? null : color()\"\r\n [style.background]=\"selectedColor()\"\r\n [style.color]=\"
|
|
1519
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ColorPickerComponent, isStandalone: true, selector: "lf-color-picker", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, matIcon: { classPropertyName: "matIcon", publicName: "matIcon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { colorChangeEvent: "colorChangeEvent" }, ngImport: i0, template: "<input\r\n #colorPicker\r\n type=\"color\"\r\n onclick=\"this.value = null\"\r\n [ngModel]=\"selectedColor()\"\r\n (ngModelChange)=\"selectColor($event)\"\r\n style=\"opacity: 0; position: absolute; width: 0; height: 36px; border: none\" />\r\n\r\n<button\r\n mat-flat-button\r\n class=\"lf-button\"\r\n type=\"button\"\r\n [color]=\"selectedColor() ? null : color()\"\r\n [style.background]=\"selectedColor()\"\r\n [style.color]=\"labelColor()\"\r\n [disabled]=\"disabled()\"\r\n (click)=\"colorPicker.click()\"\r\n [matTooltip]=\"tooltip()\">\r\n <!-- icon -->\r\n @if (matIcon()) {\r\n <mat-icon [class.material-icons-outlined]=\"libraryConfig?.outlineIcons\">\r\n {{ matIcon() }}\r\n </mat-icon>\r\n }\r\n <!-- @else if (svgIcon) {\r\n <mat-icon [svgIcon]=\"svgIcon\"></mat-icon>\r\n } -->\r\n {{ label() }}\r\n</button>\r\n", styles: [".lf-button{width:inherit}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatButtonModule }, { 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: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1520
1520
|
}
|
|
1521
1521
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ColorPickerComponent, decorators: [{
|
|
1522
1522
|
type: Component,
|
|
@@ -1526,7 +1526,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1526
1526
|
MatButtonModule,
|
|
1527
1527
|
MatIconModule,
|
|
1528
1528
|
MatTooltipModule
|
|
1529
|
-
], template: "<input\r\n #colorPicker\r\n type=\"color\"\r\n onclick=\"this.value = null\"\r\n [ngModel]=\"selectedColor()\"\r\n (ngModelChange)=\"selectColor($event)\"\r\n style=\"opacity: 0; position: absolute; width: 0; height: 36px; border: none\" />\r\n\r\n<button\r\n mat-flat-button\r\n class=\"lf-button\"\r\n type=\"button\"\r\n [color]=\"selectedColor() ? null : color()\"\r\n [style.background]=\"selectedColor()\"\r\n [style.color]=\"
|
|
1529
|
+
], template: "<input\r\n #colorPicker\r\n type=\"color\"\r\n onclick=\"this.value = null\"\r\n [ngModel]=\"selectedColor()\"\r\n (ngModelChange)=\"selectColor($event)\"\r\n style=\"opacity: 0; position: absolute; width: 0; height: 36px; border: none\" />\r\n\r\n<button\r\n mat-flat-button\r\n class=\"lf-button\"\r\n type=\"button\"\r\n [color]=\"selectedColor() ? null : color()\"\r\n [style.background]=\"selectedColor()\"\r\n [style.color]=\"labelColor()\"\r\n [disabled]=\"disabled()\"\r\n (click)=\"colorPicker.click()\"\r\n [matTooltip]=\"tooltip()\">\r\n <!-- icon -->\r\n @if (matIcon()) {\r\n <mat-icon [class.material-icons-outlined]=\"libraryConfig?.outlineIcons\">\r\n {{ matIcon() }}\r\n </mat-icon>\r\n }\r\n <!-- @else if (svgIcon) {\r\n <mat-icon [svgIcon]=\"svgIcon\"></mat-icon>\r\n } -->\r\n {{ label() }}\r\n</button>\r\n", styles: [".lf-button{width:inherit}\n"] }]
|
|
1530
1530
|
}], propDecorators: { color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], matIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "matIcon", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], colorChangeEvent: [{ type: i0.Output, args: ["colorChangeEvent"] }] } });
|
|
1531
1531
|
|
|
1532
1532
|
class PlaceholderComponent {
|