@rxap/material-form-system 21.0.1 → 22.0.0-dev.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.
Files changed (111) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/compodoc/architecture.html +222 -0
  3. package/compodoc/changelog.html +70 -5
  4. package/compodoc/classes/ExtractHideShowMixin.html +95 -21
  5. package/compodoc/classes/RecordViewTuple.html +71 -18
  6. package/compodoc/components/FormControlsComponent.html +269 -165
  7. package/compodoc/dependencies.html +124 -35
  8. package/compodoc/directives/ChipInputAdapterDirective.html +83 -13
  9. package/compodoc/directives/ChipListIteratorDirective.html +98 -23
  10. package/compodoc/directives/CompareWithDirective.html +142 -57
  11. package/compodoc/directives/ControlErrorDirective.html +163 -56
  12. package/compodoc/directives/ControlErrorsDirective.html +120 -26
  13. package/compodoc/directives/FormFieldHideShowDirective.html +122 -33
  14. package/compodoc/directives/InputClearButtonDirective.html +125 -47
  15. package/compodoc/directives/RequiredDirective.html +98 -20
  16. package/compodoc/index.html +46 -5
  17. package/compodoc/interfaces/ChipListTemplateContext.html +155 -95
  18. package/compodoc/interfaces/ControlErrorDirectiveContext.html +149 -94
  19. package/compodoc/interfaces/ControlErrorsDirectiveContext.html +149 -94
  20. package/compodoc/js/architecture-graph.js +288 -0
  21. package/compodoc/js/libs/bootstrap-native.js +4 -2
  22. package/compodoc/js/libs/jszip.min.js +13 -0
  23. package/compodoc/js/libs/svg-pan-zoom.min.js +3 -3
  24. package/compodoc/js/libs/tablesort.min.js +3 -3
  25. package/compodoc/js/libs/tablesort.number.min.js +3 -3
  26. package/compodoc/js/libs/vis-network.min.js +78 -0
  27. package/compodoc/js/menu-wc.js +25 -12
  28. package/compodoc/js/menu.js +10 -11
  29. package/compodoc/js/routes/routes_index.js +1 -0
  30. package/compodoc/js/routes.js +142 -34
  31. package/compodoc/js/search/search-lunr.js +6 -8
  32. package/compodoc/js/search/search.js +118 -66
  33. package/compodoc/js/search/search_index.js +2 -2
  34. package/compodoc/js/tabs.js +98 -15
  35. package/compodoc/js/tree.js +44 -7
  36. package/compodoc/license.html +48 -6
  37. package/compodoc/llms.txt +196 -0
  38. package/compodoc/miscellaneous/functions.html +51 -8
  39. package/compodoc/miscellaneous/variables.html +148 -5
  40. package/compodoc/modules.html +44 -3
  41. package/compodoc/overview.html +54 -3
  42. package/compodoc/properties.html +45 -4
  43. package/compodoc/routes.html +227 -0
  44. package/compodoc/styles/compodoc.css +365 -44
  45. package/compodoc/styles/dark.css +16 -0
  46. package/compodoc/template-playground/default-templates.json +192 -0
  47. package/compodoc/template-playground/hbs-render.service.ts +217 -0
  48. package/compodoc/template-playground/main.ts +9 -0
  49. package/compodoc/template-playground/template-editor.service.ts +173 -0
  50. package/compodoc/template-playground/template-playground.component.ts +614 -0
  51. package/compodoc/template-playground/template-playground.module.ts +29 -0
  52. package/compodoc/template-playground/zip-export.service.ts +86 -0
  53. package/compodoc/template-playground-app/app.js +1389 -0
  54. package/compodoc/template-playground-app/index.html +462 -0
  55. package/docs/documentation.json +944 -739
  56. package/docs/html/assets/hierarchy.js +1 -1
  57. package/docs/html/assets/highlight.css +1 -1
  58. package/docs/html/assets/icons.js +1 -1
  59. package/docs/html/assets/icons.svg +1 -1
  60. package/docs/html/assets/main.js +5 -5
  61. package/docs/html/assets/search.js +1 -1
  62. package/docs/html/assets/style.css +265 -228
  63. package/docs/html/classes/ChipInputAdapterDirective.html +97 -6
  64. package/docs/html/classes/ChipListIteratorDirective.html +109 -7
  65. package/docs/html/classes/CompareWithDirective.html +95 -5
  66. package/docs/html/classes/ControlErrorDirective.html +160 -12
  67. package/docs/html/classes/ControlErrorsDirective.html +154 -11
  68. package/docs/html/classes/ExtractHideShowMixin.html +141 -8
  69. package/docs/html/classes/FormControlsComponent.html +183 -15
  70. package/docs/html/classes/FormFieldHideShowDirective.html +210 -15
  71. package/docs/html/classes/InputClearButtonDirective.html +122 -7
  72. package/docs/html/classes/RequiredDirective.html +81 -4
  73. package/docs/html/hierarchy.html +33 -1
  74. package/docs/html/index.html +40 -4
  75. package/docs/html/interfaces/ChipListTemplateContext.html +61 -3
  76. package/docs/html/interfaces/ControlErrorDirectiveContext.html +61 -3
  77. package/docs/html/interfaces/ControlErrorsDirectiveContext.html +61 -3
  78. package/docs/html/modules.html +40 -1
  79. package/docs/markdown/README.md +1 -1
  80. package/docs/markdown/classes/ChipInputAdapterDirective.md +8 -8
  81. package/docs/markdown/classes/ChipListIteratorDirective.md +8 -8
  82. package/docs/markdown/classes/CompareWithDirective.md +7 -7
  83. package/docs/markdown/classes/ControlErrorDirective.md +18 -16
  84. package/docs/markdown/classes/ControlErrorsDirective.md +17 -15
  85. package/docs/markdown/classes/ExtractHideShowMixin.md +23 -23
  86. package/docs/markdown/classes/FormControlsComponent.md +22 -20
  87. package/docs/markdown/classes/FormFieldHideShowDirective.md +31 -28
  88. package/docs/markdown/classes/InputClearButtonDirective.md +12 -12
  89. package/docs/markdown/classes/RequiredDirective.md +6 -6
  90. package/docs/markdown/globals.md +2 -2
  91. package/docs/markdown/interfaces/ChipListTemplateContext.md +5 -5
  92. package/docs/markdown/interfaces/ControlErrorDirectiveContext.md +4 -4
  93. package/docs/markdown/interfaces/ControlErrorsDirectiveContext.md +4 -4
  94. package/docs/wiki/Class.ChipInputAdapterDirective.md +7 -7
  95. package/docs/wiki/Class.ChipListIteratorDirective.md +7 -7
  96. package/docs/wiki/Class.CompareWithDirective.md +6 -6
  97. package/docs/wiki/Class.ControlErrorDirective.md +17 -15
  98. package/docs/wiki/Class.ControlErrorsDirective.md +16 -14
  99. package/docs/wiki/Class.ExtractHideShowMixin.md +22 -22
  100. package/docs/wiki/Class.FormControlsComponent.md +21 -19
  101. package/docs/wiki/Class.FormFieldHideShowDirective.md +30 -27
  102. package/docs/wiki/Class.InputClearButtonDirective.md +11 -11
  103. package/docs/wiki/Class.RequiredDirective.md +5 -5
  104. package/docs/wiki/Interface.ChipListTemplateContext.md +4 -4
  105. package/docs/wiki/Interface.ControlErrorDirectiveContext.md +3 -3
  106. package/docs/wiki/Interface.ControlErrorsDirectiveContext.md +3 -3
  107. package/docs/wiki/globals.md +1 -1
  108. package/fesm2022/rxap-material-form-system.mjs +544 -265
  109. package/fesm2022/rxap-material-form-system.mjs.map +1 -1
  110. package/package.json +39 -39
  111. package/types/rxap-material-form-system.d.ts +165 -148
@@ -1,61 +1,54 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, signal, input, output, isDevMode, ChangeDetectionStrategy, Component, Directive, TemplateRef, ViewContainerRef, IterableDiffers, ChangeDetectorRef, Renderer2, ElementRef } from '@angular/core';
3
- import { outputToObservable } from '@angular/core/rxjs-interop';
4
- import { FormDirective, controlErrorChanges$, RxapFormControl } from '@rxap/forms';
5
- import { coerceBoolean, clone, unique, getFromObject, equals } from '@rxap/utilities';
6
- import { take, tap, filter, startWith, catchError } from 'rxjs/operators';
7
- import { Router } from '@angular/router';
8
- import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
9
- import * as i2 from '@angular/material/progress-spinner';
10
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
11
- import { NgClass } from '@angular/common';
12
- import * as i1 from '@angular/material/button';
13
- import { MatButtonModule } from '@angular/material/button';
14
- import { ENTER, COMMA } from '@angular/cdk/keycodes';
15
- import { NgControl } from '@angular/forms';
16
- import { MatChipInput } from '@angular/material/chips';
17
- import { MatSelect } from '@angular/material/select';
18
- import { MAT_FORM_FIELD } from '@angular/material/form-field';
19
- import { __decorate } from 'tslib';
20
- import { Subscription, of } from 'rxjs';
21
- import { RXAP_FORM_SYSTEM_HIDE_SHOW_OPTIONS, RXAP_FORM_SYSTEM_HIDE_METADATA, RXAP_FORM_SYSTEM_SHOW_METADATA, ExtractFormDefinitionMixin } from '@rxap/form-system';
22
- import { Mixin } from '@rxap/mixin';
23
- import { getMetadata } from '@rxap/reflect-metadata';
24
-
25
- class FormControlsComponent {
1
+ import { __decorate } from "tslib";
2
+ import * as i0 from "@angular/core";
3
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Directive, ElementRef, IterableDiffers, Renderer2, TemplateRef, ViewContainerRef, inject, input, isDevMode, output, signal } from "@angular/core";
4
+ import { outputToObservable } from "@angular/core/rxjs-interop";
5
+ import { FormDirective, RxapFormControl, controlErrorChanges$ } from "@rxap/forms";
6
+ import { clone, coerceBoolean, equals, getFromObject, unique } from "@rxap/utilities";
7
+ import { catchError, filter, startWith, take, tap } from "rxjs/operators";
8
+ import { Router } from "@angular/router";
9
+ import { MatSnackBar, MatSnackBarModule } from "@angular/material/snack-bar";
10
+ import * as i2 from "@angular/material/progress-spinner";
11
+ import { MatProgressSpinnerModule } from "@angular/material/progress-spinner";
12
+ import { NgClass } from "@angular/common";
13
+ import * as i1 from "@angular/material/button";
14
+ import { MatButtonModule } from "@angular/material/button";
15
+ import { COMMA, ENTER } from "@angular/cdk/keycodes";
16
+ import { NgControl } from "@angular/forms";
17
+ import { MatChipInput } from "@angular/material/chips";
18
+ import { MatSelect } from "@angular/material/select";
19
+ import { MAT_FORM_FIELD } from "@angular/material/form-field";
20
+ import { Subscription, of } from "rxjs";
21
+ import { ExtractFormDefinitionMixin, RXAP_FORM_SYSTEM_HIDE_METADATA, RXAP_FORM_SYSTEM_HIDE_SHOW_OPTIONS, RXAP_FORM_SYSTEM_SHOW_METADATA } from "@rxap/form-system";
22
+ import { Mixin } from "@rxap/mixin";
23
+ import { getMetadata } from "@rxap/reflect-metadata";
24
+ let FormControlsComponent = class FormControlsComponent {
26
25
  constructor() {
27
26
  this.formDirective = inject(FormDirective);
28
27
  this.snackBar = inject(MatSnackBar);
29
28
  this.router = inject(Router, { optional: true });
30
29
  this.submitting = this.formDirective.submitting;
31
- this.invalid = signal(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
32
- this.navigateAfterSubmit = input(...(ngDevMode ? [undefined, { debugName: "navigateAfterSubmit" }] : /* istanbul ignore next */ []));
33
- // eslint-disable-next-line @angular-eslint/no-output-native
30
+ this.invalid = signal(false, ...ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []);
31
+ this.navigateAfterSubmit = input(...ngDevMode ? [void 0, { debugName: "navigateAfterSubmit" }] : /* istanbul ignore next */ []);
34
32
  this.close = output();
35
33
  this.submitted = output();
36
34
  this.isDevMode = isDevMode();
37
- /**
38
- * Collection of successful submitted values
39
- * @private
40
- */
41
35
  this._submitted = [];
42
- this.allowResubmit = input(false, { ...(ngDevMode ? { debugName: "allowResubmit" } : /* istanbul ignore next */ {}), transform: coerceBoolean });
36
+ this.allowResubmit = input(false, {
37
+ ...ngDevMode ? { debugName: "allowResubmit" } : /* istanbul ignore next */ {},
38
+ transform: coerceBoolean
39
+ });
43
40
  }
44
41
  ngOnInit() {
45
- outputToObservable(this.close)
46
- .pipe(take(1), tap(() => {
42
+ outputToObservable(this.close).pipe(take(1), tap(() => {
47
43
  const navigateAfterSubmit = this.navigateAfterSubmit();
48
44
  if (navigateAfterSubmit) {
49
- if (this.router) {
45
+ if (this.router)
50
46
  return this.router.navigate(navigateAfterSubmit);
51
- }
52
- else {
53
- console.warn('The Router is not available. Ensure that tha RouterModule is imported');
54
- }
47
+ else
48
+ console.warn("The Router is not available. Ensure that tha RouterModule is imported");
55
49
  }
56
50
  return Promise.resolve();
57
- }))
58
- .subscribe();
51
+ })).subscribe();
59
52
  }
60
53
  reset() {
61
54
  this.invalid.set(false);
@@ -67,47 +60,156 @@ class FormControlsComponent {
67
60
  submit(closeAfterSubmit) {
68
61
  this.formDirective.form.markAllAsDirty();
69
62
  this.formDirective.form.markAllAsTouched();
70
- // eslint-disable-next-line prefer-const
71
63
  let submitSubscription;
72
- const invalidSubmitSubscription = outputToObservable(this.formDirective.invalidSubmit)
73
- .pipe(take(1), tap(() => submitSubscription?.unsubscribe()), tap(() => this.invalid.set(true)), tap(() => this.snackBar.open($localize `:@@rxap-material.form-system.form-controls.form-is-invalid:Form is not valid`, 'ok', { duration: 5000 })))
74
- .subscribe();
75
- submitSubscription = outputToObservable(this.formDirective.rxapSubmit)
76
- .pipe(take(1), tap((value) => {
64
+ const invalidSubmitSubscription = outputToObservable(this.formDirective.invalidSubmit).pipe(take(1), tap(() => submitSubscription?.unsubscribe()), tap(() => this.invalid.set(true)), tap(() => this.snackBar.open($localize `:@@rxap-material.form-system.form-controls.form-is-invalid:Form is not valid`, "ok", { duration: 5e3 }))).subscribe();
65
+ submitSubscription = outputToObservable(this.formDirective.rxapSubmit).pipe(take(1), tap((value) => {
77
66
  const clonedValue = clone(value);
78
67
  this._submitted.push(clonedValue);
79
68
  this.submitted.emit(clonedValue);
80
- if (closeAfterSubmit) {
69
+ if (closeAfterSubmit)
81
70
  this.close.emit(this._submitted.length > 1 ? this._submitted : this._submitted[0]);
82
- }
83
- else {
84
- if (typeof this.formDirective.formDefinition.rxapReuse === 'function') {
85
- this.formDirective.formDefinition.rxapReuse();
86
- }
87
- }
71
+ else if (typeof this.formDirective.formDefinition.rxapReuse === "function")
72
+ this.formDirective.formDefinition.rxapReuse();
88
73
  invalidSubmitSubscription.unsubscribe();
89
74
  this.invalid.set(false);
90
- }))
91
- .subscribe();
92
- this.formDirective.onSubmit(new Event('submit'));
75
+ })).subscribe();
76
+ this.formDirective.onSubmit(new Event("submit"));
93
77
  }
94
78
  logCurrentFormState() {
95
79
  console.log(clone(this.formDirective.form.value));
96
80
  }
97
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormControlsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
98
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: FormControlsComponent, isStandalone: true, selector: "rxap-form-controls", inputs: { navigateAfterSubmit: { classPropertyName: "navigateAfterSubmit", publicName: "navigateAfterSubmit", isSignal: true, isRequired: false, transformFunction: null }, allowResubmit: { classPropertyName: "allowResubmit", publicName: "allowResubmit", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", submitted: "submitted" }, ngImport: i0, template: "<div class=\"flex flex-row justify-between items-center gap-8\">\n <div class=\"flex grow-0 flex-row justify-end items-center gap-8 w-full\">\n <button (click)=\"reset()\"\n [disabled]=\"submitting()\"\n class=\"grow-0\"\n mat-stroked-button\n type=\"button\">\n <ng-container i18n>Reset</ng-container>\n </button>\n <button (click)=\"cancel()\"\n [disabled]=\"submitting()\"\n color=\"warn\"\n class=\"grow-0\"\n mat-stroked-button\n type=\"button\">\n <ng-container i18n>Cancel</ng-container>\n </button>\n <button (click)=\"submit(!allowResubmit())\"\n [disabled]=\"submitting()\"\n [ngClass]=\"{ invalid: invalid() }\"\n color=\"primary\"\n class=\"grow-0\"\n mat-raised-button\n type=\"button\">\n <span class=\"flex flex-row items-center gap-2\">\n <span class=\"grow-0\">\n <ng-container i18n>Submit</ng-container>\n </span>\n @if (submitting()) {\n <mat-spinner [diameter]=\"15\" color=\"accent\" class=\"grow-0\"\n mode=\"indeterminate\"></mat-spinner>\n }\n </span>\n </button>\n @if (allowResubmit()) {\n <button (click)=\"submit(true)\"\n [disabled]=\"submitting()\"\n [ngClass]=\"{ invalid: invalid() }\"\n color=\"primary\"\n class=\"grow-0\"\n mat-raised-button\n type=\"button\">\n <span class=\"flex flex-row items-center gap-2\">\n <span class=\"grow-0\">\n <ng-container i18n>Submit and Close</ng-container>\n </span>\n @if (submitting()) {\n <mat-spinner [diameter]=\"15\" color=\"accent\" class=\"grow-0\"\n mode=\"indeterminate\"></mat-spinner>\n }\n </span>\n </button>\n }\n @if (isDevMode) {\n <button (click)=\"logCurrentFormState()\" mat-button type=\"button\" class=\"grow-0\">\n Current Form State\n </button>\n }\n </div>\n</div>\n", styles: ["button{overflow:hidden}button.invalid{border:6px solid darkred}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.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: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i2.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatSnackBarModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
99
- }
100
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormControlsComponent, decorators: [{
81
+ static {
82
+ this.ɵfac = i0.ɵɵngDeclareFactory({
83
+ minVersion: "12.0.0",
84
+ version: "22.3.0",
85
+ ngImport: i0,
86
+ type: FormControlsComponent,
87
+ deps: [],
88
+ target: i0.ɵɵFactoryTarget.Component
89
+ });
90
+ }
91
+ static {
92
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
93
+ minVersion: "17.0.0",
94
+ version: "22.3.0",
95
+ type: FormControlsComponent,
96
+ isStandalone: true,
97
+ selector: "rxap-form-controls",
98
+ inputs: {
99
+ navigateAfterSubmit: {
100
+ classPropertyName: "navigateAfterSubmit",
101
+ publicName: "navigateAfterSubmit",
102
+ isSignal: true,
103
+ isRequired: false,
104
+ transformFunction: null
105
+ },
106
+ allowResubmit: {
107
+ classPropertyName: "allowResubmit",
108
+ publicName: "allowResubmit",
109
+ isSignal: true,
110
+ isRequired: false,
111
+ transformFunction: null
112
+ }
113
+ },
114
+ outputs: {
115
+ close: "close",
116
+ submitted: "submitted"
117
+ },
118
+ ngImport: i0,
119
+ template: "<div class=\"flex flex-row justify-between items-center gap-8\">\n <div class=\"flex grow-0 flex-row justify-end items-center gap-8 w-full\">\n <button (click)=\"reset()\"\n [disabled]=\"submitting()\"\n class=\"grow-0\"\n mat-stroked-button\n type=\"button\">\n <ng-container i18n>Reset</ng-container>\n </button>\n <button (click)=\"cancel()\"\n [disabled]=\"submitting()\"\n color=\"warn\"\n class=\"grow-0\"\n mat-stroked-button\n type=\"button\">\n <ng-container i18n>Cancel</ng-container>\n </button>\n <button (click)=\"submit(!allowResubmit())\"\n [disabled]=\"submitting()\"\n [ngClass]=\"{ invalid: invalid() }\"\n color=\"primary\"\n class=\"grow-0\"\n mat-raised-button\n type=\"button\">\n <span class=\"flex flex-row items-center gap-2\">\n <span class=\"grow-0\">\n <ng-container i18n>Submit</ng-container>\n </span>\n @if (submitting()) {\n <mat-spinner [diameter]=\"15\" color=\"accent\" class=\"grow-0\"\n mode=\"indeterminate\"></mat-spinner>\n }\n </span>\n </button>\n @if (allowResubmit()) {\n <button (click)=\"submit(true)\"\n [disabled]=\"submitting()\"\n [ngClass]=\"{ invalid: invalid() }\"\n color=\"primary\"\n class=\"grow-0\"\n mat-raised-button\n type=\"button\">\n <span class=\"flex flex-row items-center gap-2\">\n <span class=\"grow-0\">\n <ng-container i18n>Submit and Close</ng-container>\n </span>\n @if (submitting()) {\n <mat-spinner [diameter]=\"15\" color=\"accent\" class=\"grow-0\"\n mode=\"indeterminate\"></mat-spinner>\n }\n </span>\n </button>\n }\n @if (isDevMode) {\n <button (click)=\"logCurrentFormState()\" mat-button type=\"button\" class=\"grow-0\">\n Current Form State\n </button>\n }\n </div>\n</div>\n",
120
+ styles: ["button{overflow:hidden}button.invalid{border:6px solid darkred}\n"],
121
+ dependencies: [
122
+ {
123
+ kind: "ngmodule",
124
+ type: MatButtonModule
125
+ },
126
+ {
127
+ kind: "component",
128
+ type: i1.MatButton,
129
+ 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] ",
130
+ inputs: ["matButton"],
131
+ exportAs: ["matButton", "matAnchor"]
132
+ },
133
+ {
134
+ kind: "directive",
135
+ type: NgClass,
136
+ selector: "[ngClass]",
137
+ inputs: ["class", "ngClass"]
138
+ },
139
+ {
140
+ kind: "ngmodule",
141
+ type: MatProgressSpinnerModule
142
+ },
143
+ {
144
+ kind: "component",
145
+ type: i2.MatProgressSpinner,
146
+ selector: "mat-progress-spinner, mat-spinner",
147
+ inputs: [
148
+ "color",
149
+ "mode",
150
+ "value",
151
+ "diameter",
152
+ "strokeWidth"
153
+ ],
154
+ exportAs: ["matProgressSpinner"]
155
+ },
156
+ {
157
+ kind: "ngmodule",
158
+ type: MatSnackBarModule
159
+ }
160
+ ],
161
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
162
+ });
163
+ }
164
+ };
165
+ i0.ɵɵngDeclareClassMetadata({
166
+ minVersion: "12.0.0",
167
+ version: "22.3.0",
168
+ ngImport: i0,
169
+ type: FormControlsComponent,
170
+ decorators: [{
101
171
  type: Component,
102
- args: [{ selector: 'rxap-form-controls', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
172
+ args: [{
173
+ selector: "rxap-form-controls",
174
+ changeDetection: ChangeDetectionStrategy.OnPush,
175
+ imports: [
103
176
  MatButtonModule,
104
177
  NgClass,
105
178
  MatProgressSpinnerModule,
106
179
  MatSnackBarModule
107
- ], template: "<div class=\"flex flex-row justify-between items-center gap-8\">\n <div class=\"flex grow-0 flex-row justify-end items-center gap-8 w-full\">\n <button (click)=\"reset()\"\n [disabled]=\"submitting()\"\n class=\"grow-0\"\n mat-stroked-button\n type=\"button\">\n <ng-container i18n>Reset</ng-container>\n </button>\n <button (click)=\"cancel()\"\n [disabled]=\"submitting()\"\n color=\"warn\"\n class=\"grow-0\"\n mat-stroked-button\n type=\"button\">\n <ng-container i18n>Cancel</ng-container>\n </button>\n <button (click)=\"submit(!allowResubmit())\"\n [disabled]=\"submitting()\"\n [ngClass]=\"{ invalid: invalid() }\"\n color=\"primary\"\n class=\"grow-0\"\n mat-raised-button\n type=\"button\">\n <span class=\"flex flex-row items-center gap-2\">\n <span class=\"grow-0\">\n <ng-container i18n>Submit</ng-container>\n </span>\n @if (submitting()) {\n <mat-spinner [diameter]=\"15\" color=\"accent\" class=\"grow-0\"\n mode=\"indeterminate\"></mat-spinner>\n }\n </span>\n </button>\n @if (allowResubmit()) {\n <button (click)=\"submit(true)\"\n [disabled]=\"submitting()\"\n [ngClass]=\"{ invalid: invalid() }\"\n color=\"primary\"\n class=\"grow-0\"\n mat-raised-button\n type=\"button\">\n <span class=\"flex flex-row items-center gap-2\">\n <span class=\"grow-0\">\n <ng-container i18n>Submit and Close</ng-container>\n </span>\n @if (submitting()) {\n <mat-spinner [diameter]=\"15\" color=\"accent\" class=\"grow-0\"\n mode=\"indeterminate\"></mat-spinner>\n }\n </span>\n </button>\n }\n @if (isDevMode) {\n <button (click)=\"logCurrentFormState()\" mat-button type=\"button\" class=\"grow-0\">\n Current Form State\n </button>\n }\n </div>\n</div>\n", styles: ["button{overflow:hidden}button.invalid{border:6px solid darkred}\n"] }]
108
- }], propDecorators: { navigateAfterSubmit: [{ type: i0.Input, args: [{ isSignal: true, alias: "navigateAfterSubmit", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], submitted: [{ type: i0.Output, args: ["submitted"] }], allowResubmit: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowResubmit", required: false }] }] } });
109
-
110
- class ChipInputAdapterDirective {
180
+ ],
181
+ template: "<div class=\"flex flex-row justify-between items-center gap-8\">\n <div class=\"flex grow-0 flex-row justify-end items-center gap-8 w-full\">\n <button (click)=\"reset()\"\n [disabled]=\"submitting()\"\n class=\"grow-0\"\n mat-stroked-button\n type=\"button\">\n <ng-container i18n>Reset</ng-container>\n </button>\n <button (click)=\"cancel()\"\n [disabled]=\"submitting()\"\n color=\"warn\"\n class=\"grow-0\"\n mat-stroked-button\n type=\"button\">\n <ng-container i18n>Cancel</ng-container>\n </button>\n <button (click)=\"submit(!allowResubmit())\"\n [disabled]=\"submitting()\"\n [ngClass]=\"{ invalid: invalid() }\"\n color=\"primary\"\n class=\"grow-0\"\n mat-raised-button\n type=\"button\">\n <span class=\"flex flex-row items-center gap-2\">\n <span class=\"grow-0\">\n <ng-container i18n>Submit</ng-container>\n </span>\n @if (submitting()) {\n <mat-spinner [diameter]=\"15\" color=\"accent\" class=\"grow-0\"\n mode=\"indeterminate\"></mat-spinner>\n }\n </span>\n </button>\n @if (allowResubmit()) {\n <button (click)=\"submit(true)\"\n [disabled]=\"submitting()\"\n [ngClass]=\"{ invalid: invalid() }\"\n color=\"primary\"\n class=\"grow-0\"\n mat-raised-button\n type=\"button\">\n <span class=\"flex flex-row items-center gap-2\">\n <span class=\"grow-0\">\n <ng-container i18n>Submit and Close</ng-container>\n </span>\n @if (submitting()) {\n <mat-spinner [diameter]=\"15\" color=\"accent\" class=\"grow-0\"\n mode=\"indeterminate\"></mat-spinner>\n }\n </span>\n </button>\n }\n @if (isDevMode) {\n <button (click)=\"logCurrentFormState()\" mat-button type=\"button\" class=\"grow-0\">\n Current Form State\n </button>\n }\n </div>\n</div>\n",
182
+ styles: ["button{overflow:hidden}button.invalid{border:6px solid darkred}\n"]
183
+ }]
184
+ }],
185
+ propDecorators: {
186
+ navigateAfterSubmit: [{
187
+ type: i0.Input,
188
+ args: [{
189
+ isSignal: true,
190
+ alias: "navigateAfterSubmit",
191
+ required: false
192
+ }]
193
+ }],
194
+ close: [{
195
+ type: i0.Output,
196
+ args: ["close"]
197
+ }],
198
+ submitted: [{
199
+ type: i0.Output,
200
+ args: ["submitted"]
201
+ }],
202
+ allowResubmit: [{
203
+ type: i0.Input,
204
+ args: [{
205
+ isSignal: true,
206
+ alias: "allowResubmit",
207
+ required: false
208
+ }]
209
+ }]
210
+ }
211
+ });
212
+ var ChipInputAdapterDirective = class ChipInputAdapterDirective {
111
213
  constructor() {
112
214
  this.matChipInput = inject(MatChipInput);
113
215
  this.ngControl = inject(NgControl);
@@ -118,65 +220,85 @@ class ChipInputAdapterDirective {
118
220
  this._subscription?.unsubscribe();
119
221
  }
120
222
  ngOnInit() {
121
- this._subscription = this.matChipInput.chipEnd
122
- .pipe(filter((add) => !!add.value?.trim()), tap((add) => {
223
+ this._subscription = this.matChipInput.chipEnd.pipe(filter((add) => !!add.value?.trim()), tap((add) => {
123
224
  const value = this.ngControl.value ?? [];
124
225
  this.ngControl.control?.setValue([...value, add.value].filter(unique()));
125
226
  this.matChipInput.clear();
126
- }))
127
- .subscribe();
227
+ })).subscribe();
228
+ }
229
+ static {
230
+ this.ɵfac = i0.ɵɵngDeclareFactory({
231
+ minVersion: "12.0.0",
232
+ version: "22.3.0",
233
+ ngImport: i0,
234
+ type: ChipInputAdapterDirective,
235
+ deps: [],
236
+ target: i0.ɵɵFactoryTarget.Directive
237
+ });
128
238
  }
129
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ChipInputAdapterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
130
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: ChipInputAdapterDirective, isStandalone: true, selector: "[matChipInputFor][rxapChipInputAdapter]", ngImport: i0 }); }
131
- }
132
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ChipInputAdapterDirective, decorators: [{
239
+ static {
240
+ this.ɵdir = i0.ɵɵngDeclareDirective({
241
+ minVersion: "14.0.0",
242
+ version: "22.3.0",
243
+ type: ChipInputAdapterDirective,
244
+ isStandalone: true,
245
+ selector: "[matChipInputFor][rxapChipInputAdapter]",
246
+ ngImport: i0
247
+ });
248
+ }
249
+ };
250
+ i0.ɵɵngDeclareClassMetadata({
251
+ minVersion: "12.0.0",
252
+ version: "22.3.0",
253
+ ngImport: i0,
254
+ type: ChipInputAdapterDirective,
255
+ decorators: [{
133
256
  type: Directive,
134
257
  args: [{
135
- selector: '[matChipInputFor][rxapChipInputAdapter]',
136
- standalone: true,
258
+ selector: "[matChipInputFor][rxapChipInputAdapter]",
259
+ standalone: true
137
260
  }]
138
- }], ctorParameters: () => [] });
139
-
261
+ }],
262
+ ctorParameters: () => []
263
+ });
140
264
  function getTypeName(type) {
141
- return type['name'] || typeof type;
265
+ return type["name"] || typeof type;
142
266
  }
143
- class RecordViewTuple {
267
+ var RecordViewTuple = class {
144
268
  constructor(record, view) {
145
269
  this.record = record;
146
270
  this.view = view;
147
271
  }
148
- }
149
- class ChipListIteratorDirective {
272
+ };
273
+ var ChipListIteratorDirective = class ChipListIteratorDirective {
150
274
  constructor() {
151
275
  this.template = inject(TemplateRef);
152
276
  this.viewContainerRef = inject(ViewContainerRef);
153
277
  this.ngControl = inject(NgControl);
154
278
  this.differs = inject(IterableDiffers);
279
+ this.cdr = inject(ChangeDetectorRef);
155
280
  this._dirty = true;
156
281
  this._differ = null;
157
282
  }
158
283
  ngOnInit() {
159
- this._subscription = this.ngControl.valueChanges
160
- ?.pipe(startWith(this.ngControl.value), filter((value) => Array.isArray(value)), tap((items) => {
284
+ this._subscription = this.ngControl.valueChanges?.pipe(startWith(this.ngControl.value), filter((value) => Array.isArray(value)), tap((items) => {
161
285
  this._dirty = false;
162
- // React on ngForOf changes only once all inputs have been initialized
163
286
  const value = items;
164
- if (!this._differ && value) {
287
+ if (!this._differ && value)
165
288
  try {
166
289
  this._differ = this.differs.find(value).create((_, item) => item);
167
290
  }
168
291
  catch {
169
292
  throw new Error(`Cannot find a differ supporting object '${value}' of type '${getTypeName(value)}'. NgFor only supports binding to Iterables such as Arrays.`);
170
293
  }
171
- }
172
294
  if (this._differ) {
173
295
  const changes = this._differ.diff(items);
174
296
  if (changes) {
175
297
  this.applyChanges(changes);
298
+ this.cdr.markForCheck();
176
299
  }
177
300
  }
178
- }))
179
- .subscribe();
301
+ })).subscribe();
180
302
  }
181
303
  ngOnDestroy() {
182
304
  this._subscription?.unsubscribe();
@@ -185,19 +307,14 @@ class ChipListIteratorDirective {
185
307
  const insertTuples = [];
186
308
  changes.forEachOperation((item, adjustedPreviousIndex, currentIndex) => {
187
309
  if (item.previousIndex == null) {
188
- // NgForOf is never "null" or "undefined" here because the differ detected
189
- // that a new item needs to be inserted from the iterable. This implies that
190
- // there is an iterable value for "_ngForOf".
191
- const view = this.viewContainerRef.createEmbeddedView(this.template, {
310
+ const tuple = new RecordViewTuple(item, this.viewContainerRef.createEmbeddedView(this.template, {
192
311
  $implicit: item.item,
193
- onRemoved: this.onRemoved.bind(this),
194
- }, currentIndex === null ? undefined : currentIndex);
195
- const tuple = new RecordViewTuple(item, view);
312
+ onRemoved: this.onRemoved.bind(this)
313
+ }, currentIndex === null ? void 0 : currentIndex));
196
314
  insertTuples.push(tuple);
197
315
  }
198
- else if (currentIndex == null) {
199
- this.viewContainerRef.remove(adjustedPreviousIndex === null ? undefined : adjustedPreviousIndex);
200
- }
316
+ else if (currentIndex == null)
317
+ this.viewContainerRef.remove(adjustedPreviousIndex === null ? void 0 : adjustedPreviousIndex);
201
318
  else if (adjustedPreviousIndex !== null) {
202
319
  const view = this.viewContainerRef.get(adjustedPreviousIndex);
203
320
  this.viewContainerRef.move(view, currentIndex);
@@ -205,11 +322,10 @@ class ChipListIteratorDirective {
205
322
  insertTuples.push(tuple);
206
323
  }
207
324
  });
208
- for (let i = 0; i < insertTuples.length; i++) {
325
+ for (let i = 0; i < insertTuples.length; i++)
209
326
  this.perViewChange(insertTuples[i].view, insertTuples[i].record);
210
- }
211
327
  changes.forEachIdentityChange((record) => {
212
- const viewRef = (this.viewContainerRef.get(record.currentIndex));
328
+ const viewRef = this.viewContainerRef.get(record.currentIndex);
213
329
  viewRef.context.$implicit = record.item;
214
330
  });
215
331
  }
@@ -219,21 +335,48 @@ class ChipListIteratorDirective {
219
335
  perViewChange(view, record) {
220
336
  view.context.$implicit = record.item;
221
337
  }
222
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ChipListIteratorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
223
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: ChipListIteratorDirective, isStandalone: true, selector: "[rxapChipListIterator]", ngImport: i0 }); }
224
- }
225
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ChipListIteratorDirective, decorators: [{
338
+ static {
339
+ this.ɵfac = i0.ɵɵngDeclareFactory({
340
+ minVersion: "12.0.0",
341
+ version: "22.3.0",
342
+ ngImport: i0,
343
+ type: ChipListIteratorDirective,
344
+ deps: [],
345
+ target: i0.ɵɵFactoryTarget.Directive
346
+ });
347
+ }
348
+ static {
349
+ this.ɵdir = i0.ɵɵngDeclareDirective({
350
+ minVersion: "14.0.0",
351
+ version: "22.3.0",
352
+ type: ChipListIteratorDirective,
353
+ isStandalone: true,
354
+ selector: "[rxapChipListIterator]",
355
+ ngImport: i0
356
+ });
357
+ }
358
+ };
359
+ i0.ɵɵngDeclareClassMetadata({
360
+ minVersion: "12.0.0",
361
+ version: "22.3.0",
362
+ ngImport: i0,
363
+ type: ChipListIteratorDirective,
364
+ decorators: [{
226
365
  type: Directive,
227
366
  args: [{
228
- selector: '[rxapChipListIterator]',
229
- standalone: true,
367
+ selector: "[rxapChipListIterator]",
368
+ standalone: true
230
369
  }]
231
- }] });
232
-
233
- class CompareWithDirective {
370
+ }]
371
+ });
372
+ const PRISM_FORM_STYLE$2 = "display: flex; flex-direction: column; gap: 8px; min-width: 280px";
373
+ let CompareWithDirective = class CompareWithDirective {
234
374
  constructor() {
235
375
  this.matSelect = inject(MatSelect);
236
- this.objectPath = input.required({ ...(ngDevMode ? { debugName: "objectPath" } : /* istanbul ignore next */ {}), alias: "rxapCompareWith" });
376
+ this.objectPath = input.required({
377
+ ...ngDevMode ? { debugName: "objectPath" } : /* istanbul ignore next */ {},
378
+ alias: "rxapCompareWith"
379
+ });
237
380
  }
238
381
  ngOnInit() {
239
382
  this.matSelect.compareWith = this.compareWith.bind(this);
@@ -241,47 +384,84 @@ class CompareWithDirective {
241
384
  compareWith(o1, o2) {
242
385
  const objectPath = this.objectPath();
243
386
  if (objectPath) {
244
- if (typeof o1 !== 'object' || typeof o2 !== 'object') {
245
- if (isDevMode()) {
246
- console.warn('At least one of the select options value is not an object');
247
- }
387
+ if (typeof o1 !== "object" || typeof o2 !== "object") {
388
+ if (isDevMode())
389
+ console.warn("At least one of the select options value is not an object");
248
390
  return false;
249
391
  }
250
- if (o1 === null || o1 === undefined || o2 === null || o2 === undefined) {
251
- if (isDevMode()) {
252
- console.warn('At least one of the select options value is undefined or null');
253
- }
392
+ if (o1 === null || o1 === void 0 || o2 === null || o2 === void 0) {
393
+ if (isDevMode())
394
+ console.warn("At least one of the select options value is undefined or null");
254
395
  return false;
255
396
  }
256
397
  const o1Value = getFromObject(o1, objectPath);
257
398
  const o2Value = getFromObject(o2, objectPath);
258
- if (o1Value === undefined || o2Value === undefined) {
399
+ if (o1Value === void 0 || o2Value === void 0)
259
400
  return false;
260
- }
261
401
  return o1Value === o2Value;
262
402
  }
263
- else {
403
+ else
264
404
  return equals(o1, o2);
265
- }
266
405
  }
267
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CompareWithDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
268
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: CompareWithDirective, isStandalone: true, selector: "mat-select[rxapCompareWith]", inputs: { objectPath: { classPropertyName: "objectPath", publicName: "rxapCompareWith", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
269
- }
270
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CompareWithDirective, decorators: [{
406
+ static {
407
+ this.ɵfac = i0.ɵɵngDeclareFactory({
408
+ minVersion: "12.0.0",
409
+ version: "22.3.0",
410
+ ngImport: i0,
411
+ type: CompareWithDirective,
412
+ deps: [],
413
+ target: i0.ɵɵFactoryTarget.Directive
414
+ });
415
+ }
416
+ static {
417
+ this.ɵdir = i0.ɵɵngDeclareDirective({
418
+ minVersion: "17.1.0",
419
+ version: "22.3.0",
420
+ type: CompareWithDirective,
421
+ isStandalone: true,
422
+ selector: "mat-select[rxapCompareWith]",
423
+ inputs: { objectPath: {
424
+ classPropertyName: "objectPath",
425
+ publicName: "rxapCompareWith",
426
+ isSignal: true,
427
+ isRequired: true,
428
+ transformFunction: null
429
+ } },
430
+ ngImport: i0
431
+ });
432
+ }
433
+ };
434
+ i0.ɵɵngDeclareClassMetadata({
435
+ minVersion: "12.0.0",
436
+ version: "22.3.0",
437
+ ngImport: i0,
438
+ type: CompareWithDirective,
439
+ decorators: [{
271
440
  type: Directive,
272
441
  args: [{
273
- selector: 'mat-select[rxapCompareWith]',
274
- standalone: true,
442
+ selector: "mat-select[rxapCompareWith]",
443
+ standalone: true
275
444
  }]
276
- }], propDecorators: { objectPath: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapCompareWith", required: true }] }] } });
277
-
278
- class ControlErrorDirective {
445
+ }],
446
+ propDecorators: { objectPath: [{
447
+ type: i0.Input,
448
+ args: [{
449
+ isSignal: true,
450
+ alias: "rxapCompareWith",
451
+ required: true
452
+ }]
453
+ }] }
454
+ });
455
+ var ControlErrorDirective = class ControlErrorDirective {
279
456
  constructor() {
280
457
  this.formField = inject(MAT_FORM_FIELD);
281
458
  this.template = inject(TemplateRef);
282
459
  this.viewContainerRef = inject(ViewContainerRef);
283
460
  this.cdr = inject(ChangeDetectorRef);
284
- this.key = input.required({ ...(ngDevMode ? { debugName: "key" } : /* istanbul ignore next */ {}), alias: "rxapControlErrorKey" });
461
+ this.key = input.required({
462
+ ...ngDevMode ? { debugName: "key" } : /* istanbul ignore next */ {},
463
+ alias: "rxapControlErrorKey"
464
+ });
285
465
  }
286
466
  static ngTemplateContextGuard(dir, ctx) {
287
467
  return true;
@@ -290,13 +470,10 @@ class ControlErrorDirective {
290
470
  const control = this.formField._control.ngControl?.control;
291
471
  if (control) {
292
472
  this._control = control;
293
- this._subscription = controlErrorChanges$(control)
294
- .pipe(tap((errors) => this.render(errors)))
295
- .subscribe();
296
- }
297
- else {
298
- throw new Error('The form field has not a control associated!');
473
+ this._subscription = controlErrorChanges$(control).pipe(tap((errors) => this.render(errors))).subscribe();
299
474
  }
475
+ else
476
+ throw new Error("The form field has not a control associated!");
300
477
  }
301
478
  ngOnDestroy() {
302
479
  this._subscription?.unsubscribe();
@@ -304,33 +481,69 @@ class ControlErrorDirective {
304
481
  render(errors) {
305
482
  this.viewContainerRef.clear();
306
483
  if (errors) {
307
- const errorKeys = Object.keys(errors);
308
- const matchingKey = errorKeys.find((key) => key.toLowerCase() === this.key().toLowerCase());
484
+ const matchingKey = Object.keys(errors).find((key) => key.toLowerCase() === this.key().toLowerCase());
309
485
  if (matchingKey) {
310
486
  const error = errors[matchingKey];
311
- if (!this._control) {
312
- throw new Error('The control is not defined!');
313
- }
487
+ if (!this._control)
488
+ throw new Error("The control is not defined!");
314
489
  this.viewContainerRef.createEmbeddedView(this.template, {
315
490
  $implicit: error,
316
- control: this._control,
491
+ control: this._control
317
492
  });
318
493
  }
319
494
  }
320
495
  this.cdr.detectChanges();
321
496
  }
322
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ControlErrorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
323
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: ControlErrorDirective, isStandalone: true, selector: "[rxapControlError]", inputs: { key: { classPropertyName: "key", publicName: "rxapControlErrorKey", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
324
- }
325
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ControlErrorDirective, decorators: [{
497
+ static {
498
+ this.ɵfac = i0.ɵɵngDeclareFactory({
499
+ minVersion: "12.0.0",
500
+ version: "22.3.0",
501
+ ngImport: i0,
502
+ type: ControlErrorDirective,
503
+ deps: [],
504
+ target: i0.ɵɵFactoryTarget.Directive
505
+ });
506
+ }
507
+ static {
508
+ this.ɵdir = i0.ɵɵngDeclareDirective({
509
+ minVersion: "17.1.0",
510
+ version: "22.3.0",
511
+ type: ControlErrorDirective,
512
+ isStandalone: true,
513
+ selector: "[rxapControlError]",
514
+ inputs: { key: {
515
+ classPropertyName: "key",
516
+ publicName: "rxapControlErrorKey",
517
+ isSignal: true,
518
+ isRequired: true,
519
+ transformFunction: null
520
+ } },
521
+ ngImport: i0
522
+ });
523
+ }
524
+ };
525
+ i0.ɵɵngDeclareClassMetadata({
526
+ minVersion: "12.0.0",
527
+ version: "22.3.0",
528
+ ngImport: i0,
529
+ type: ControlErrorDirective,
530
+ decorators: [{
326
531
  type: Directive,
327
532
  args: [{
328
- selector: '[rxapControlError]',
329
- standalone: true,
533
+ selector: "[rxapControlError]",
534
+ standalone: true
330
535
  }]
331
- }], propDecorators: { key: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapControlErrorKey", required: true }] }] } });
332
-
333
- class ControlErrorsDirective {
536
+ }],
537
+ propDecorators: { key: [{
538
+ type: i0.Input,
539
+ args: [{
540
+ isSignal: true,
541
+ alias: "rxapControlErrorKey",
542
+ required: true
543
+ }]
544
+ }] }
545
+ });
546
+ var ControlErrorsDirective = class ControlErrorsDirective {
334
547
  constructor() {
335
548
  this.formField = inject(MAT_FORM_FIELD);
336
549
  this.template = inject(TemplateRef);
@@ -344,13 +557,10 @@ class ControlErrorsDirective {
344
557
  const control = this.formField._control.ngControl?.control;
345
558
  if (control) {
346
559
  this._control = control;
347
- this._subscription = controlErrorChanges$(control)
348
- .pipe(tap((errors) => this.render(errors)))
349
- .subscribe();
350
- }
351
- else {
352
- throw new Error('The form field has not a control associated!');
560
+ this._subscription = controlErrorChanges$(control).pipe(tap((errors) => this.render(errors))).subscribe();
353
561
  }
562
+ else
563
+ throw new Error("The form field has not a control associated!");
354
564
  }
355
565
  ngOnDestroy() {
356
566
  this._subscription?.unsubscribe();
@@ -358,51 +568,69 @@ class ControlErrorsDirective {
358
568
  render(errors) {
359
569
  this.viewContainerRef.clear();
360
570
  if (errors) {
361
- if (!this._control) {
362
- throw new Error('The control is not defined!');
363
- }
571
+ if (!this._control)
572
+ throw new Error("The control is not defined!");
364
573
  this.viewContainerRef.createEmbeddedView(this.template, {
365
574
  $implicit: errors,
366
- control: this._control,
575
+ control: this._control
367
576
  });
368
577
  }
369
578
  this.cdr.detectChanges();
370
579
  }
371
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ControlErrorsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
372
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: ControlErrorsDirective, isStandalone: true, selector: "[rxapControlErrors]", ngImport: i0 }); }
373
- }
374
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ControlErrorsDirective, decorators: [{
580
+ static {
581
+ this.ɵfac = i0.ɵɵngDeclareFactory({
582
+ minVersion: "12.0.0",
583
+ version: "22.3.0",
584
+ ngImport: i0,
585
+ type: ControlErrorsDirective,
586
+ deps: [],
587
+ target: i0.ɵɵFactoryTarget.Directive
588
+ });
589
+ }
590
+ static {
591
+ this.ɵdir = i0.ɵɵngDeclareDirective({
592
+ minVersion: "14.0.0",
593
+ version: "22.3.0",
594
+ type: ControlErrorsDirective,
595
+ isStandalone: true,
596
+ selector: "[rxapControlErrors]",
597
+ ngImport: i0
598
+ });
599
+ }
600
+ };
601
+ i0.ɵɵngDeclareClassMetadata({
602
+ minVersion: "12.0.0",
603
+ version: "22.3.0",
604
+ ngImport: i0,
605
+ type: ControlErrorsDirective,
606
+ decorators: [{
375
607
  type: Directive,
376
608
  args: [{
377
- selector: '[rxapControlErrors]',
378
- standalone: true,
609
+ selector: "[rxapControlErrors]",
610
+ standalone: true
379
611
  }]
380
- }] });
381
-
382
- class ExtractHideShowMixin {
612
+ }]
613
+ });
614
+ var ExtractHideShowMixin = class {
383
615
  extractOptions(formDefinition = this.formDefinition, controlId = this.control?.controlId ?? this.controlId) {
384
616
  const map = getMetadata(RXAP_FORM_SYSTEM_HIDE_SHOW_OPTIONS, Object.getPrototypeOf(formDefinition)) ?? null;
385
- if (!map || !map.has(controlId)) {
617
+ if (!map || !map.has(controlId))
386
618
  return {};
387
- }
388
619
  return map.get(controlId);
389
620
  }
390
621
  extractHideFunction(formDefinition = this.formDefinition, controlId = this.control?.controlId ?? this.controlId) {
391
622
  const map = getMetadata(RXAP_FORM_SYSTEM_HIDE_METADATA, Object.getPrototypeOf(formDefinition)) ?? null;
392
- if (!map || !map.has(controlId)) {
623
+ if (!map || !map.has(controlId))
393
624
  return null;
394
- }
395
625
  return map.get(controlId);
396
626
  }
397
627
  extractShowFunction(formDefinition = this.formDefinition, controlId = this.control?.controlId ?? this.controlId) {
398
628
  const map = getMetadata(RXAP_FORM_SYSTEM_SHOW_METADATA, Object.getPrototypeOf(formDefinition)) ?? null;
399
- if (!map || !map.has(controlId)) {
629
+ if (!map || !map.has(controlId))
400
630
  return null;
401
- }
402
631
  return map.get(controlId);
403
632
  }
404
- }
405
- // TODO : create mixin for hide and show logic (this class and ControlHideShowDirective in @rxap/form-system)
633
+ };
406
634
  let FormFieldHideShowDirective = class FormFieldHideShowDirective {
407
635
  constructor() {
408
636
  this.formField = inject(MAT_FORM_FIELD);
@@ -412,94 +640,103 @@ let FormFieldHideShowDirective = class FormFieldHideShowDirective {
412
640
  }
413
641
  ngAfterContentInit() {
414
642
  const control = this.formField._control.ngControl?.control;
415
- if (!control) {
416
- throw new Error('The form field has not a control associated!');
417
- }
418
- if (!(control instanceof RxapFormControl)) {
419
- throw new Error('The associated control is not a RxapFormControl');
420
- }
643
+ if (!control)
644
+ throw new Error("The form field has not a control associated!");
645
+ if (!(control instanceof RxapFormControl))
646
+ throw new Error("The associated control is not a RxapFormControl");
421
647
  this.control = control;
422
648
  this.formDefinition = this.extractFormDefinition(control);
423
649
  const hideFunction = this.extractHideFunction(this.formDefinition);
424
650
  const showFunction = this.extractShowFunction(this.formDefinition);
425
651
  const options = this.extractOptions(this.formDefinition);
426
652
  let changeTrigger = this.formDefinition.rxapFormGroup.valueChanges;
427
- if (options.rootChange) {
653
+ if (options.rootChange)
428
654
  changeTrigger = this.formDefinition.rxapFormGroup.root.valueChanges;
429
- }
430
655
  changeTrigger = changeTrigger.pipe(startWith(null));
431
- if (showFunction) {
656
+ if (showFunction)
432
657
  this.subscription.add(changeTrigger.pipe(tap(() => {
433
- // TODO : resubscribe if the showFunction throws an error
434
- const show = showFunction.call(this.formDefinition, control);
435
- switch (show) {
658
+ switch (showFunction.call(this.formDefinition, control)) {
436
659
  case true:
437
660
  this.show();
438
661
  break;
439
662
  case false:
440
663
  this.hide();
441
664
  break;
442
- case null:
443
- this.reset();
444
- break;
665
+ case null: this.reset();
445
666
  }
446
- }), catchError(err => {
667
+ }), catchError((err) => {
447
668
  console.error(err);
448
669
  return of(null);
449
670
  })).subscribe());
450
- }
451
- if (hideFunction) {
671
+ if (hideFunction)
452
672
  this.subscription.add(changeTrigger.pipe(tap(() => {
453
- // TODO : resubscribe if the hideFunction throws an error
454
- const hide = hideFunction.call(this.formDefinition, control);
455
- switch (hide) {
673
+ switch (hideFunction.call(this.formDefinition, control)) {
456
674
  case true:
457
675
  this.hide();
458
676
  break;
459
677
  case false:
460
678
  this.show();
461
679
  break;
462
- case null:
463
- this.reset();
464
- break;
680
+ case null: this.reset();
465
681
  }
466
- }), catchError(err => {
682
+ }), catchError((err) => {
467
683
  console.error(err);
468
684
  return of(null);
469
685
  })).subscribe());
470
- }
471
686
  }
472
687
  ngOnDestroy() {
473
688
  this.subscription.unsubscribe();
474
689
  }
475
690
  hide() {
476
- this.renderer.setStyle(this.elementRef.nativeElement, 'display', 'none');
691
+ this.renderer.setStyle(this.elementRef.nativeElement, "display", "none");
477
692
  }
478
693
  show() {
479
- this.renderer.setStyle(this.elementRef.nativeElement, 'display', 'block');
694
+ this.renderer.setStyle(this.elementRef.nativeElement, "display", "block");
480
695
  }
481
696
  reset() {
482
- this.renderer.removeStyle(this.elementRef.nativeElement, 'display');
697
+ this.renderer.removeStyle(this.elementRef.nativeElement, "display");
698
+ }
699
+ static {
700
+ this.ɵfac = i0.ɵɵngDeclareFactory({
701
+ minVersion: "12.0.0",
702
+ version: "22.3.0",
703
+ ngImport: i0,
704
+ type: FormFieldHideShowDirective,
705
+ deps: [],
706
+ target: i0.ɵɵFactoryTarget.Directive
707
+ });
708
+ }
709
+ static {
710
+ this.ɵdir = i0.ɵɵngDeclareDirective({
711
+ minVersion: "14.0.0",
712
+ version: "22.3.0",
713
+ type: FormFieldHideShowDirective,
714
+ isStandalone: true,
715
+ selector: "mat-form-field[rxapHideShow]",
716
+ ngImport: i0
717
+ });
483
718
  }
484
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormFieldHideShowDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
485
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: FormFieldHideShowDirective, isStandalone: true, selector: "mat-form-field[rxapHideShow]", ngImport: i0 }); }
486
719
  };
487
- FormFieldHideShowDirective = __decorate([
488
- Mixin(ExtractHideShowMixin, ExtractFormDefinitionMixin)
489
- ], FormFieldHideShowDirective);
490
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FormFieldHideShowDirective, decorators: [{
720
+ FormFieldHideShowDirective = __decorate([Mixin(ExtractHideShowMixin, ExtractFormDefinitionMixin)], FormFieldHideShowDirective);
721
+ i0.ɵɵngDeclareClassMetadata({
722
+ minVersion: "12.0.0",
723
+ version: "22.3.0",
724
+ ngImport: i0,
725
+ type: FormFieldHideShowDirective,
726
+ decorators: [{
491
727
  type: Directive,
492
728
  args: [{
493
- selector: 'mat-form-field[rxapHideShow]',
494
- standalone: true,
729
+ selector: "mat-form-field[rxapHideShow]",
730
+ standalone: true
495
731
  }]
496
- }] });
497
-
498
- class InputClearButtonDirective {
732
+ }]
733
+ });
734
+ const PRISM_FORM_STYLE$1 = "display: flex; flex-direction: column; gap: 8px; min-width: 280px";
735
+ let InputClearButtonDirective = class InputClearButtonDirective {
499
736
  constructor() {
500
737
  this.formField = inject(MAT_FORM_FIELD);
501
- this.type = 'button';
502
- this.tabIndex = '-1';
738
+ this.type = "button";
739
+ this.tabIndex = "-1";
503
740
  }
504
741
  get control() {
505
742
  return this.formField._control;
@@ -509,68 +746,110 @@ class InputClearButtonDirective {
509
746
  }
510
747
  onClick() {
511
748
  if (this.control.ngControl) {
512
- if (this.control.ngControl.control) {
749
+ if (this.control.ngControl.control)
513
750
  this.control.ngControl.control.setValue(null);
514
- }
515
- else {
751
+ else
516
752
  this.control.ngControl.reset();
517
- }
518
753
  }
519
754
  else {
520
- console.log('InputClearButtonDirective.onClick', 'value = null');
755
+ console.log("InputClearButtonDirective.onClick", "value = null");
521
756
  this.control.value = null;
522
757
  }
523
758
  }
524
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: InputClearButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
525
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: InputClearButtonDirective, isStandalone: true, selector: "[rxapInputClearButton]", host: { listeners: { "click": "onClick()" }, properties: { "attr.type": "type", "attr.tabindex": "tabIndex", "disabled": "isDisabled" } }, ngImport: i0 }); }
526
- }
527
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: InputClearButtonDirective, decorators: [{
759
+ static {
760
+ this.ɵfac = i0.ɵɵngDeclareFactory({
761
+ minVersion: "12.0.0",
762
+ version: "22.3.0",
763
+ ngImport: i0,
764
+ type: InputClearButtonDirective,
765
+ deps: [],
766
+ target: i0.ɵɵFactoryTarget.Directive
767
+ });
768
+ }
769
+ static {
770
+ this.ɵdir = i0.ɵɵngDeclareDirective({
771
+ minVersion: "14.0.0",
772
+ version: "22.3.0",
773
+ type: InputClearButtonDirective,
774
+ isStandalone: true,
775
+ selector: "[rxapInputClearButton]",
776
+ host: {
777
+ listeners: { "click": "onClick()" },
778
+ properties: {
779
+ "attr.type": "type",
780
+ "attr.tabindex": "tabIndex",
781
+ "disabled": "isDisabled"
782
+ }
783
+ },
784
+ ngImport: i0
785
+ });
786
+ }
787
+ };
788
+ i0.ɵɵngDeclareClassMetadata({
789
+ minVersion: "12.0.0",
790
+ version: "22.3.0",
791
+ ngImport: i0,
792
+ type: InputClearButtonDirective,
793
+ decorators: [{
528
794
  type: Directive,
529
795
  args: [{
530
- selector: '[rxapInputClearButton]',
796
+ selector: "[rxapInputClearButton]",
531
797
  standalone: true,
532
798
  host: {
533
- '[attr.type]': 'type',
534
- '[attr.tabindex]': 'tabIndex',
535
- '[disabled]': 'isDisabled',
536
- '(click)': 'onClick()',
537
- },
799
+ "[attr.type]": "type",
800
+ "[attr.tabindex]": "tabIndex",
801
+ "[disabled]": "isDisabled",
802
+ "(click)": "onClick()"
803
+ }
538
804
  }]
539
- }] });
540
-
541
- class RequiredDirective {
805
+ }]
806
+ });
807
+ const PRISM_FORM_STYLE = "display: flex; flex-direction: column; gap: 8px; min-width: 280px";
808
+ let RequiredDirective = class RequiredDirective {
542
809
  constructor() {
543
810
  this.formField = inject(MAT_FORM_FIELD);
544
811
  }
545
812
  ngAfterContentInit() {
546
813
  const control = this.formField._control.ngControl?.control;
547
814
  if (control) {
548
- const hasRequiredValidator = Reflect.get(control, 'hasRequiredValidator');
549
- if (hasRequiredValidator) {
815
+ if (Reflect.get(control, "hasRequiredValidator"))
550
816
  this.formField._control.required = true;
551
- }
552
- }
553
- else {
554
- throw new Error('The form field has not a control associated!');
555
817
  }
818
+ else
819
+ throw new Error("The form field has not a control associated!");
820
+ }
821
+ static {
822
+ this.ɵfac = i0.ɵɵngDeclareFactory({
823
+ minVersion: "12.0.0",
824
+ version: "22.3.0",
825
+ ngImport: i0,
826
+ type: RequiredDirective,
827
+ deps: [],
828
+ target: i0.ɵɵFactoryTarget.Directive
829
+ });
556
830
  }
557
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RequiredDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
558
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: RequiredDirective, isStandalone: true, selector: "[formControlName][rxapRequired],[formControl][rxapRequired]", ngImport: i0 }); }
559
- }
560
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: RequiredDirective, decorators: [{
831
+ static {
832
+ this.ɵdir = i0.ɵɵngDeclareDirective({
833
+ minVersion: "14.0.0",
834
+ version: "22.3.0",
835
+ type: RequiredDirective,
836
+ isStandalone: true,
837
+ selector: "[formControlName][rxapRequired],[formControl][rxapRequired]",
838
+ ngImport: i0
839
+ });
840
+ }
841
+ };
842
+ i0.ɵɵngDeclareClassMetadata({
843
+ minVersion: "12.0.0",
844
+ version: "22.3.0",
845
+ ngImport: i0,
846
+ type: RequiredDirective,
847
+ decorators: [{
561
848
  type: Directive,
562
849
  args: [{
563
- selector: '[formControlName][rxapRequired],[formControl][rxapRequired]',
564
- standalone: true,
850
+ selector: "[formControlName][rxapRequired],[formControl][rxapRequired]",
851
+ standalone: true
565
852
  }]
566
- }] });
567
-
568
- // region form-controls
569
- // endregion
570
-
571
- /**
572
- * Generated bundle index. Do not edit.
573
- */
574
-
853
+ }]
854
+ });
575
855
  export { ChipInputAdapterDirective, ChipListIteratorDirective, CompareWithDirective, ControlErrorDirective, ControlErrorsDirective, ExtractHideShowMixin, FormControlsComponent, FormFieldHideShowDirective, InputClearButtonDirective, RequiredDirective };
576
- //# sourceMappingURL=rxap-material-form-system.mjs.map