@lenne.tech/ng-base 14.6.0 → 14.7.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.
@@ -1763,12 +1763,58 @@ class ChangePasswordComponent {
1763
1763
  }
1764
1764
  }
1765
1765
  ChangePasswordComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: ChangePasswordComponent, deps: [{ token: i1$1.FormsService }, { token: i1$1.UserService }, { token: i1$1.AuthService }, { token: i1$1.ToastService }], target: i0.ɵɵFactoryTarget.Component });
1766
- ChangePasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: ChangePasswordComponent, selector: "base-change-password", ngImport: i0, template: "<form [formGroup]=\"form\">\n <base-input\n [id]=\"'password'\"\n [label]=\"'Passwort'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('password')\"\n [tabIndex]=\"1\"\n [eyeButton]=\"true\"\n ></base-input>\n <base-input\n [id]=\"'password-confirm'\"\n [label]=\"'Passwort best\u00E4tigen'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('passwordConfirm')\"\n [tabIndex]=\"2\"\n [eyeButton]=\"true\"\n ></base-input>\n\n <div class=\"d-flex justify-content-end\">\n <div>\n <button class=\"btn btn-primary\" (click)=\"submit()\" *ngIf=\"!loading\">Passwort \u00E4ndern</button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n Loading...\n </button>\n </div>\n </div>\n</form>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InputComponent, selector: "base-input", inputs: ["id", "name", "label", "placeholder", "autocomplete", "tabIndex", "control", "type", "required", "eyeButton"], outputs: ["enter"] }] });
1766
+ ChangePasswordComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: ChangePasswordComponent, selector: "base-change-password", ngImport: i0, template: "<h3>Passwort \u00E4ndern</h3>\n\n<form [formGroup]=\"form\">\n <base-input\n [id]=\"'password'\"\n [label]=\"'Passwort'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('password')\"\n [tabIndex]=\"1\"\n [eyeButton]=\"true\"\n ></base-input>\n <base-input\n [id]=\"'password-confirm'\"\n [label]=\"'Passwort best\u00E4tigen'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('passwordConfirm')\"\n [tabIndex]=\"2\"\n [eyeButton]=\"true\"\n ></base-input>\n\n <div class=\"d-flex justify-content-end\">\n <div>\n <button class=\"btn btn-primary\" (click)=\"submit()\" *ngIf=\"!loading\">Passwort \u00E4ndern</button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n Loading...\n </button>\n </div>\n </div>\n</form>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InputComponent, selector: "base-input", inputs: ["id", "name", "label", "placeholder", "autocomplete", "tabIndex", "control", "type", "required", "eyeButton"], outputs: ["enter"] }] });
1767
1767
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: ChangePasswordComponent, decorators: [{
1768
1768
  type: Component,
1769
- args: [{ selector: 'base-change-password', template: "<form [formGroup]=\"form\">\n <base-input\n [id]=\"'password'\"\n [label]=\"'Passwort'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('password')\"\n [tabIndex]=\"1\"\n [eyeButton]=\"true\"\n ></base-input>\n <base-input\n [id]=\"'password-confirm'\"\n [label]=\"'Passwort best\u00E4tigen'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('passwordConfirm')\"\n [tabIndex]=\"2\"\n [eyeButton]=\"true\"\n ></base-input>\n\n <div class=\"d-flex justify-content-end\">\n <div>\n <button class=\"btn btn-primary\" (click)=\"submit()\" *ngIf=\"!loading\">Passwort \u00E4ndern</button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n Loading...\n </button>\n </div>\n </div>\n</form>\n" }]
1769
+ args: [{ selector: 'base-change-password', template: "<h3>Passwort \u00E4ndern</h3>\n\n<form [formGroup]=\"form\">\n <base-input\n [id]=\"'password'\"\n [label]=\"'Passwort'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('password')\"\n [tabIndex]=\"1\"\n [eyeButton]=\"true\"\n ></base-input>\n <base-input\n [id]=\"'password-confirm'\"\n [label]=\"'Passwort best\u00E4tigen'\"\n [required]=\"true\"\n [type]=\"'password'\"\n [control]=\"form.get('passwordConfirm')\"\n [tabIndex]=\"2\"\n [eyeButton]=\"true\"\n ></base-input>\n\n <div class=\"d-flex justify-content-end\">\n <div>\n <button class=\"btn btn-primary\" (click)=\"submit()\" *ngIf=\"!loading\">Passwort \u00E4ndern</button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n Loading...\n </button>\n </div>\n </div>\n</form>\n" }]
1770
1770
  }], ctorParameters: function () { return [{ type: i1$1.FormsService }, { type: i1$1.UserService }, { type: i1$1.AuthService }, { type: i1$1.ToastService }]; } });
1771
1771
 
1772
+ class DeleteAccountComponent {
1773
+ constructor(userService, authService, toastService, router) {
1774
+ this.userService = userService;
1775
+ this.authService = authService;
1776
+ this.toastService = toastService;
1777
+ this.router = router;
1778
+ this.description = 'Mit dem Löschen Deines Kontos werden alle persönlichen Daten sofort gelöscht und sind nicht wiederherstellbar.';
1779
+ this.loading = false;
1780
+ }
1781
+ deleteAccount() {
1782
+ this.loading = true;
1783
+ this.userService.delete(this.authService.currentUser.id).subscribe({
1784
+ next: (response) => {
1785
+ if (response) {
1786
+ this.toastService.show({
1787
+ id: 'delete-user-success',
1788
+ title: 'Erfolgreich',
1789
+ description: 'Dein Konto wurde erfolgreich gelöscht.',
1790
+ type: ToastType.SUCCESS,
1791
+ });
1792
+ }
1793
+ this.authService.logout();
1794
+ this.router.navigate(['/']);
1795
+ this.loading = false;
1796
+ },
1797
+ error: (error) => {
1798
+ this.loading = false;
1799
+ this.toastService.show({
1800
+ id: 'delete-user-error',
1801
+ title: 'Fehlgeschlagen',
1802
+ description: 'Konto löschen ist fehlgeschlagen, bitte versuche es später erneut.',
1803
+ type: ToastType.ERROR,
1804
+ });
1805
+ },
1806
+ });
1807
+ }
1808
+ }
1809
+ DeleteAccountComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: DeleteAccountComponent, deps: [{ token: i1$1.UserService }, { token: i1$1.AuthService }, { token: i1$1.ToastService }, { token: i2$1.Router }], target: i0.ɵɵFactoryTarget.Component });
1810
+ DeleteAccountComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: DeleteAccountComponent, selector: "base-delete-account", inputs: { description: "description" }, ngImport: i0, template: "<div>\n <h3>Konto l\u00F6schen</h3>\n\n <p>{{ description }}</p>\n\n <div class=\"d-flex justify-content-end mt-3\">\n <div>\n <button class=\"btn btn-primary\" (click)=\"deleteAccount()\" *ngIf=\"!loading\">Konto l\u00F6schen</button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n Loading...\n </button>\n </div>\n </div>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1811
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: DeleteAccountComponent, decorators: [{
1812
+ type: Component,
1813
+ args: [{ selector: 'base-delete-account', template: "<div>\n <h3>Konto l\u00F6schen</h3>\n\n <p>{{ description }}</p>\n\n <div class=\"d-flex justify-content-end mt-3\">\n <div>\n <button class=\"btn btn-primary\" (click)=\"deleteAccount()\" *ngIf=\"!loading\">Konto l\u00F6schen</button>\n <button class=\"btn btn-primary\" type=\"button\" disabled *ngIf=\"loading\">\n <span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>\n Loading...\n </button>\n </div>\n </div>\n</div>\n" }]
1814
+ }], ctorParameters: function () { return [{ type: i1$1.UserService }, { type: i1$1.AuthService }, { type: i1$1.ToastService }, { type: i2$1.Router }]; }, propDecorators: { description: [{
1815
+ type: Input
1816
+ }] } });
1817
+
1772
1818
  class BackButtonDirective {
1773
1819
  constructor(navigation) {
1774
1820
  this.navigation = navigation;
@@ -1813,6 +1859,7 @@ const elements = [
1813
1859
  UploadImageComponent,
1814
1860
  RefenceInputComponent,
1815
1861
  ChangePasswordComponent,
1862
+ DeleteAccountComponent,
1816
1863
  // Pipes
1817
1864
  EllipsesPipe,
1818
1865
  ];
@@ -1840,6 +1887,7 @@ BaseComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
1840
1887
  UploadImageComponent,
1841
1888
  RefenceInputComponent,
1842
1889
  ChangePasswordComponent,
1890
+ DeleteAccountComponent,
1843
1891
  // Pipes
1844
1892
  EllipsesPipe], imports: [FormsModule, ReactiveFormsModule, CommonModule], exports: [
1845
1893
  // Directives
@@ -1862,6 +1910,7 @@ BaseComponentsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
1862
1910
  UploadImageComponent,
1863
1911
  RefenceInputComponent,
1864
1912
  ChangePasswordComponent,
1913
+ DeleteAccountComponent,
1865
1914
  // Pipes
1866
1915
  EllipsesPipe] });
1867
1916
  BaseComponentsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: BaseComponentsModule, imports: [imports] });
@@ -1882,5 +1931,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImpor
1882
1931
  * Generated bundle index. Do not edit.
1883
1932
  */
1884
1933
 
1885
- export { BackButtonDirective, BaseComponentsModule, BreadcrumbComponent, ChangePasswordComponent, CheckboxComponent, ContextMenuDirective, EllipsesPipe, InputComponent, LoadingBarComponent, ModelFormComponent, ModelFormSubComponent, ModelTableComponent, RefenceInputComponent, SelectComponent, SkeletonLoaderComponent, SortDirective, TagsComponent, TextareaComponent, ToastComponent, UploadImageComponent };
1934
+ export { BackButtonDirective, BaseComponentsModule, BreadcrumbComponent, ChangePasswordComponent, CheckboxComponent, ContextMenuDirective, DeleteAccountComponent, EllipsesPipe, InputComponent, LoadingBarComponent, ModelFormComponent, ModelFormSubComponent, ModelTableComponent, RefenceInputComponent, SelectComponent, SkeletonLoaderComponent, SortDirective, TagsComponent, TextareaComponent, ToastComponent, UploadImageComponent };
1886
1935
  //# sourceMappingURL=lenne.tech-ng-base-base-components.mjs.map