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