@ngstarter-ui/components 21.0.41 → 21.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/ai/component-registry.json +67 -111
- package/fesm2022/ngstarter-ui-components-country-select.mjs +59 -16
- package/fesm2022/ngstarter-ui-components-country-select.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-form-builder.mjs +432 -34
- package/fesm2022/ngstarter-ui-components-form-builder.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-radio.mjs +8 -5
- package/fesm2022/ngstarter-ui-components-radio.mjs.map +1 -1
- package/fesm2022/ngstarter-ui-components-slide-toggle.mjs +12 -1
- package/fesm2022/ngstarter-ui-components-slide-toggle.mjs.map +1 -1
- package/package.json +1 -5
- package/types/ngstarter-ui-components-country-select.d.ts +20 -9
- package/types/ngstarter-ui-components-form-builder.d.ts +63 -5
- package/types/ngstarter-ui-components-radio.d.ts +4 -1
- package/types/ngstarter-ui-components-slide-toggle.d.ts +6 -1
- package/fesm2022/ngstarter-ui-components-form-renderer-autocomplete-many-field-CGQ3pJaG.mjs +0 -124
- package/fesm2022/ngstarter-ui-components-form-renderer-autocomplete-many-field-CGQ3pJaG.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-form-renderer-checkbox-field-CoyKdvhV.mjs +0 -22
- package/fesm2022/ngstarter-ui-components-form-renderer-checkbox-field-CoyKdvhV.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-form-renderer-datepicker-field-Cf3jfPv7.mjs +0 -44
- package/fesm2022/ngstarter-ui-components-form-renderer-datepicker-field-Cf3jfPv7.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-form-renderer-divider-content-D8Sffofu.mjs +0 -17
- package/fesm2022/ngstarter-ui-components-form-renderer-divider-content-D8Sffofu.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-form-renderer-image-content-ICTwkZPa.mjs +0 -17
- package/fesm2022/ngstarter-ui-components-form-renderer-image-content-ICTwkZPa.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-form-renderer-input-field-tZHU8-_L.mjs +0 -35
- package/fesm2022/ngstarter-ui-components-form-renderer-input-field-tZHU8-_L.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-form-renderer-radio-group-field-lc1V-NeL.mjs +0 -38
- package/fesm2022/ngstarter-ui-components-form-renderer-radio-group-field-lc1V-NeL.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-form-renderer-select-field-DyBidcIU.mjs +0 -39
- package/fesm2022/ngstarter-ui-components-form-renderer-select-field-DyBidcIU.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-form-renderer-text-content-BjzH_M3-.mjs +0 -24
- package/fesm2022/ngstarter-ui-components-form-renderer-text-content-BjzH_M3-.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-form-renderer-textarea-field-DxbPsw3z.mjs +0 -37
- package/fesm2022/ngstarter-ui-components-form-renderer-textarea-field-DxbPsw3z.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-form-renderer-timezone-field-DAWrM-jS.mjs +0 -35
- package/fesm2022/ngstarter-ui-components-form-renderer-timezone-field-DAWrM-jS.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-form-renderer-toggle-field-iyqUrWxt.mjs +0 -22
- package/fesm2022/ngstarter-ui-components-form-renderer-toggle-field-iyqUrWxt.mjs.map +0 -1
- package/fesm2022/ngstarter-ui-components-form-renderer.mjs +0 -317
- package/fesm2022/ngstarter-ui-components-form-renderer.mjs.map +0 -1
- package/types/ngstarter-ui-components-form-renderer.d.ts +0 -121
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngstarter-ui-components-form-renderer-textarea-field-DxbPsw3z.mjs","sources":["../../../projects/components/form-renderer/src/fields/textarea-field/textarea-field.ts","../../../projects/components/form-renderer/src/fields/textarea-field/textarea-field.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { ComponentConfig } from '../../models/form-config.model';\nimport { Error, FormField, Hint, Label } from '@ngstarter-ui/components/form-field';\nimport { Input } from '@ngstarter-ui/components/input';\nimport { TextareaAutoSize } from '@ngstarter-ui/components/core';\n\n@Component({\n selector: 'ngs-textarea-field',\n exportAs: 'ngsTextareaField',\n imports: [\n Error,\n Hint,\n Label,\n FormField,\n Input,\n ReactiveFormsModule,\n TextareaAutoSize\n ],\n templateUrl: './textarea-field.html',\n styleUrl: './textarea-field.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TextareaField {\n control = input.required<FormControl>();\n config = input.required<ComponentConfig>();\n\n getErrorMessage(): string {\n const errors = this.control().errors;\n if (!errors) return '';\n const errorKey = Object.keys(errors)[0];\n const validator = this.config().validators?.find((v: any) => v.type === errorKey);\n return validator?.message || 'Invalid value';\n }\n}\n","@if(control() && config()) {\n <ngs-form-field>\n <ngs-label>{{ config().label }}</ngs-label>\n <textarea ngsInput\n [formControl]=\"control()\"\n [placeholder]=\"config().placeholder || ''\"\n [readonly]=\"config().readonly\"\n ngsTextareaAutoSize></textarea>\n <ngs-hint>{{ config().hint }}</ngs-hint>\n @if (control().invalid && control().touched) {\n <ngs-error>{{ getErrorMessage() }}</ngs-error>\n }\n </ngs-form-field>\n}\n"],"names":[],"mappings":";;;;;;;;MAuBa,aAAa,CAAA;AACxB,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,6EAAe;AACvC,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,4EAAmB;IAE1C,eAAe,GAAA;QACb,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM;AACpC,QAAA,IAAI,CAAC,MAAM;AAAE,YAAA,OAAO,EAAE;QACtB,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACvC,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,EAA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A,wBAAA,EAAA,oBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACT,KAAK,EAAA,QAAA,EAAA,qCAAA,EAAA,MAAA,EAAA,CAAA,IAAA,EAAA,aAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACL,mBAAmB,0kBACnB,gBAAgB,EAAA,QAAA,EAAA,+BAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,SAAA,CAAA,EAAA,QAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAMP,aAAa,EAAA,UAAA,EAAA,CAAA;kBAhBzB,SAAS;+BACE,oBAAoB,EAAA,QAAA,EACpB,kBAAkB,EAAA,OAAA,EACnB;wBACP,KAAK;wBACL,IAAI;wBACJ,KAAK;wBACL,SAAS;wBACT,KAAK;wBACL,mBAAmB;wBACnB;qBACD,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,0fAAA,EAAA,MAAA,EAAA,CAAA,qHAAA,CAAA,EAAA;;;;;"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, Component } from '@angular/core';
|
|
3
|
-
import * as i1 from '@angular/forms';
|
|
4
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
5
|
-
import { TimezoneSelect } from '@ngstarter-ui/components/timezone-select';
|
|
6
|
-
import { Error, FormField, Label, Hint } from '@ngstarter-ui/components/form-field';
|
|
7
|
-
|
|
8
|
-
class TimezoneField {
|
|
9
|
-
control = input.required(...(ngDevMode ? [{ debugName: "control" }] : /* istanbul ignore next */ []));
|
|
10
|
-
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
|
|
11
|
-
getErrorMessage() {
|
|
12
|
-
const errors = this.control().errors;
|
|
13
|
-
if (!errors)
|
|
14
|
-
return '';
|
|
15
|
-
const errorKey = Object.keys(errors)[0];
|
|
16
|
-
const validator = this.config().validators?.find((v) => v.type === errorKey);
|
|
17
|
-
return validator?.message || 'Invalid value';
|
|
18
|
-
}
|
|
19
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: TimezoneField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
20
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: TimezoneField, isStandalone: true, selector: "ngs-timezone-field", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, exportAs: ["ngsTimezoneField"], ngImport: i0, template: "@if(control() && config()) {\n <ngs-form-field>\n <ngs-label>{{ config().label }}</ngs-label>\n <ngs-timezone-select [formControl]=\"control()\"\n [placeholder]=\"config().placeholder || ''\"/>\n <ngs-hint>{{ config().hint }}</ngs-hint>\n @if (control().invalid && control().touched) {\n <ngs-error>{{ getErrorMessage() }}</ngs-error>\n }\n </ngs-form-field>\n}\n", styles: [":host{display:block}:host ngs-form-field{width:100%}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: Error, selector: "ngs-error", exportAs: ["ngsError"] }, { kind: "component", type: FormField, selector: "ngs-form-field", inputs: ["subscriptHiddenIfEmpty", "sameHeightAsButton"], exportAs: ["ngsFormField"] }, { kind: "component", type: Label, selector: "ngs-label" }, { kind: "component", type: TimezoneSelect, selector: "ngs-timezone-select", inputs: ["aria-describedby", "locale", "placeholder", "required", "disabled", "value", "searchTerm"], outputs: ["valueChange", "searchTermChange", "opened", "closed"], exportAs: ["ngsTimezoneSelect"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: Hint, selector: "ngs-hint", inputs: ["align"], exportAs: ["ngsHint"] }] });
|
|
21
|
-
}
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: TimezoneField, decorators: [{
|
|
23
|
-
type: Component,
|
|
24
|
-
args: [{ selector: 'ngs-timezone-field', exportAs: 'ngsTimezoneField', imports: [
|
|
25
|
-
Error,
|
|
26
|
-
FormField,
|
|
27
|
-
Label,
|
|
28
|
-
TimezoneSelect,
|
|
29
|
-
ReactiveFormsModule,
|
|
30
|
-
Hint
|
|
31
|
-
], template: "@if(control() && config()) {\n <ngs-form-field>\n <ngs-label>{{ config().label }}</ngs-label>\n <ngs-timezone-select [formControl]=\"control()\"\n [placeholder]=\"config().placeholder || ''\"/>\n <ngs-hint>{{ config().hint }}</ngs-hint>\n @if (control().invalid && control().touched) {\n <ngs-error>{{ getErrorMessage() }}</ngs-error>\n }\n </ngs-form-field>\n}\n", styles: [":host{display:block}:host ngs-form-field{width:100%}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
32
|
-
}], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }] } });
|
|
33
|
-
|
|
34
|
-
export { TimezoneField };
|
|
35
|
-
//# sourceMappingURL=ngstarter-ui-components-form-renderer-timezone-field-DAWrM-jS.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngstarter-ui-components-form-renderer-timezone-field-DAWrM-jS.mjs","sources":["../../../projects/components/form-renderer/src/fields/timezone-field/timezone-field.ts","../../../projects/components/form-renderer/src/fields/timezone-field/timezone-field.html"],"sourcesContent":["import { Component, input } from '@angular/core';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { ComponentConfig } from '../../models/form-config.model';\nimport { TimezoneSelect } from '@ngstarter-ui/components/timezone-select';\nimport { Error, FormField, Hint, Label } from '@ngstarter-ui/components/form-field';\n\n@Component({\n selector: 'ngs-timezone-field',\n exportAs: 'ngsTimezoneField',\n imports: [\n Error,\n FormField,\n Label,\n TimezoneSelect,\n ReactiveFormsModule,\n Hint\n ],\n templateUrl: './timezone-field.html',\n styleUrl: './timezone-field.scss'\n})\nexport class TimezoneField {\n control = input.required<FormControl>();\n config = input.required<ComponentConfig>();\n\n getErrorMessage(): string {\n const errors = this.control().errors;\n if (!errors) return '';\n const errorKey = Object.keys(errors)[0];\n const validator = this.config().validators?.find((v: any) => v.type === errorKey);\n return validator?.message || 'Invalid value';\n }\n}\n","@if(control() && config()) {\n <ngs-form-field>\n <ngs-label>{{ config().label }}</ngs-label>\n <ngs-timezone-select [formControl]=\"control()\"\n [placeholder]=\"config().placeholder || ''\"/>\n <ngs-hint>{{ config().hint }}</ngs-hint>\n @if (control().invalid && control().touched) {\n <ngs-error>{{ getErrorMessage() }}</ngs-error>\n }\n </ngs-form-field>\n}\n"],"names":[],"mappings":";;;;;;;MAoBa,aAAa,CAAA;AACxB,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,6EAAe;AACvC,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,4EAAmB;IAE1C,eAAe,GAAA;QACb,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM;AACpC,QAAA,IAAI,CAAC,MAAM;AAAE,YAAA,OAAO,EAAE;QACtB,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACvC,MAAM,SAAS,GAAG,IAAI,CAAC,M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,EAAA,QAAA,EAAA,WAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACL,cAAc,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,CAAA,kBAAA,EAAA,QAAA,EAAA,aAAA,EAAA,UAAA,EAAA,UAAA,EAAA,OAAA,EAAA,YAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,QAAA,CAAA,EAAA,QAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACd,mBAAmB,0TACnB,IAAI,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,QAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAKK,aAAa,EAAA,UAAA,EAAA,CAAA;kBAdzB,SAAS;+BACE,oBAAoB,EAAA,QAAA,EACpB,kBAAkB,EAAA,OAAA,EACnB;wBACP,KAAK;wBACL,SAAS;wBACT,KAAK;wBACL,cAAc;wBACd,mBAAmB;wBACnB;AACD,qBAAA,EAAA,QAAA,EAAA,2ZAAA,EAAA,MAAA,EAAA,CAAA,2HAAA,CAAA,EAAA;;;;;"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { SlideToggle } from '@ngstarter-ui/components/slide-toggle';
|
|
4
|
-
import * as i1 from '@angular/forms';
|
|
5
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
6
|
-
|
|
7
|
-
class ToggleField {
|
|
8
|
-
control = input.required(...(ngDevMode ? [{ debugName: "control" }] : /* istanbul ignore next */ []));
|
|
9
|
-
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
|
|
10
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: ToggleField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: ToggleField, isStandalone: true, selector: "ngs-toggle-field", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: true, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, exportAs: ["ngsToggleField"], ngImport: i0, template: "@if(control() && config()) {\n <ngs-slide-toggle [formControl]=\"control()\">\n {{ config().label }}\n </ngs-slide-toggle>\n}\n", styles: [":host{display:block;margin-bottom:calc(var(--spacing, .25rem) * 3)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: SlideToggle, selector: "ngs-slide-toggle", inputs: ["id", "name", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "disabled", "disableRipple", "tabIndex", "hideIcon", "color", "checked"], outputs: ["disabledChange", "checkedChange", "change", "toggleChange"], exportAs: ["ngsSlideToggle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
12
|
-
}
|
|
13
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: ToggleField, decorators: [{
|
|
14
|
-
type: Component,
|
|
15
|
-
args: [{ selector: 'ngs-toggle-field', exportAs: 'ngsToggleField', imports: [
|
|
16
|
-
SlideToggle,
|
|
17
|
-
ReactiveFormsModule
|
|
18
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if(control() && config()) {\n <ngs-slide-toggle [formControl]=\"control()\">\n {{ config().label }}\n </ngs-slide-toggle>\n}\n", styles: [":host{display:block;margin-bottom:calc(var(--spacing, .25rem) * 3)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
19
|
-
}], propDecorators: { control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: true }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }] } });
|
|
20
|
-
|
|
21
|
-
export { ToggleField };
|
|
22
|
-
//# sourceMappingURL=ngstarter-ui-components-form-renderer-toggle-field-iyqUrWxt.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngstarter-ui-components-form-renderer-toggle-field-iyqUrWxt.mjs","sources":["../../../projects/components/form-renderer/src/fields/toggle-field/toggle-field.ts","../../../projects/components/form-renderer/src/fields/toggle-field/toggle-field.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { SlideToggle } from '@ngstarter-ui/components/slide-toggle';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { ComponentConfig } from '../../models/form-config.model';\n\n@Component({\n selector: 'ngs-toggle-field',\n exportAs: 'ngsToggleField',\n imports: [\n SlideToggle,\n ReactiveFormsModule\n ],\n templateUrl: './toggle-field.html',\n styleUrl: './toggle-field.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ToggleField {\n control = input.required<FormControl>();\n config = input.required<ComponentConfig>();\n}\n","@if(control() && config()) {\n <ngs-slide-toggle [formControl]=\"control()\">\n {{ config().label }}\n </ngs-slide-toggle>\n}\n"],"names":[],"mappings":";;;;;;MAgBa,WAAW,CAAA;AACtB,IAAA,OAAO,GAAG,KAAK,CAAC,QAAQ,6EAAe;AACvC,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,4EAAmB;uGAF/B,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAX,IAAA,O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A,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,sIAAA,EAAA,MAAA,EAAA,CAAA,0IAAA,CAAA,EAAA;;;;;"}
|
|
@@ -1,317 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, Injectable, input, computed, viewChild, ViewContainerRef, effect, Component, DestroyRef, output, ChangeDetectionStrategy } from '@angular/core';
|
|
3
|
-
import * as i3 from '@angular/common';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
import * as i1 from '@angular/forms';
|
|
6
|
-
import { Validators, FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
-
import { startWith } from 'rxjs/operators';
|
|
8
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
9
|
-
|
|
10
|
-
const FORM_RENDERER_FIELD_REGISTRY = new InjectionToken('FORM_RENDERER_FIELDS_CONFIG');
|
|
11
|
-
|
|
12
|
-
class ComponentRegistryService {
|
|
13
|
-
globalRegistry = inject(FORM_RENDERER_FIELD_REGISTRY, { optional: true });
|
|
14
|
-
componentMap = new Map();
|
|
15
|
-
constructor() {
|
|
16
|
-
this.registerDefaultComponents();
|
|
17
|
-
}
|
|
18
|
-
registerDefaultComponents() {
|
|
19
|
-
this.componentMap.set('input', () => import('./ngstarter-ui-components-form-renderer-input-field-tZHU8-_L.mjs').then(c => c.InputField));
|
|
20
|
-
this.componentMap.set('textarea', () => import('./ngstarter-ui-components-form-renderer-textarea-field-DxbPsw3z.mjs')
|
|
21
|
-
.then(c => c.TextareaField));
|
|
22
|
-
this.componentMap.set('select', () => import('./ngstarter-ui-components-form-renderer-select-field-DyBidcIU.mjs')
|
|
23
|
-
.then(c => c.SelectField));
|
|
24
|
-
this.componentMap.set('checkbox', () => import('./ngstarter-ui-components-form-renderer-checkbox-field-CoyKdvhV.mjs')
|
|
25
|
-
.then(c => c.CheckboxField));
|
|
26
|
-
this.componentMap.set('datepicker', () => import('./ngstarter-ui-components-form-renderer-datepicker-field-Cf3jfPv7.mjs')
|
|
27
|
-
.then(c => c.DatepickerField));
|
|
28
|
-
this.componentMap.set('toggle', () => import('./ngstarter-ui-components-form-renderer-toggle-field-iyqUrWxt.mjs')
|
|
29
|
-
.then(c => c.ToggleField));
|
|
30
|
-
this.componentMap.set('radioGroup', () => import('./ngstarter-ui-components-form-renderer-radio-group-field-lc1V-NeL.mjs')
|
|
31
|
-
.then(c => c.RadioGroupField));
|
|
32
|
-
this.componentMap.set('timezone', () => import('./ngstarter-ui-components-form-renderer-timezone-field-DAWrM-jS.mjs')
|
|
33
|
-
.then(c => c.TimezoneField));
|
|
34
|
-
this.componentMap.set('image', () => import('./ngstarter-ui-components-form-renderer-image-content-ICTwkZPa.mjs')
|
|
35
|
-
.then(c => c.ImageContent));
|
|
36
|
-
this.componentMap.set('text', () => import('./ngstarter-ui-components-form-renderer-text-content-BjzH_M3-.mjs')
|
|
37
|
-
.then(c => c.TextContent));
|
|
38
|
-
this.componentMap.set('divider', () => import('./ngstarter-ui-components-form-renderer-divider-content-D8Sffofu.mjs')
|
|
39
|
-
.then(c => c.DividerContent));
|
|
40
|
-
this.componentMap.set('autocompleteMany', () => import('./ngstarter-ui-components-form-renderer-autocomplete-many-field-CGQ3pJaG.mjs')
|
|
41
|
-
.then(c => c.AutocompleteManyField));
|
|
42
|
-
if (this.globalRegistry) {
|
|
43
|
-
const globalRegistry = this.globalRegistry;
|
|
44
|
-
Object.keys(globalRegistry).forEach(typeName => {
|
|
45
|
-
this.componentMap.set(typeName, globalRegistry[typeName]);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
getImporter(typeName) {
|
|
50
|
-
return this.componentMap.get(typeName);
|
|
51
|
-
}
|
|
52
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: ComponentRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
53
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: ComponentRegistryService, providedIn: 'root' });
|
|
54
|
-
}
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: ComponentRegistryService, decorators: [{
|
|
56
|
-
type: Injectable,
|
|
57
|
-
args: [{
|
|
58
|
-
providedIn: 'root',
|
|
59
|
-
}]
|
|
60
|
-
}], ctorParameters: () => [] });
|
|
61
|
-
|
|
62
|
-
class ComponentLoader {
|
|
63
|
-
registry;
|
|
64
|
-
componentConfig = input.required(...(ngDevMode ? [{ debugName: "componentConfig" }] : /* istanbul ignore next */ []));
|
|
65
|
-
control = input(null, ...(ngDevMode ? [{ debugName: "control" }] : /* istanbul ignore next */ []));
|
|
66
|
-
colspan = input(...(ngDevMode ? [undefined, { debugName: "colspan" }] : /* istanbul ignore next */ []));
|
|
67
|
-
gridColumnStyle = computed(() => {
|
|
68
|
-
const span = this.colspan();
|
|
69
|
-
return span ? `span ${span}` : null;
|
|
70
|
-
}, ...(ngDevMode ? [{ debugName: "gridColumnStyle" }] : /* istanbul ignore next */ []));
|
|
71
|
-
anchor = viewChild.required('anchor', { read: ViewContainerRef });
|
|
72
|
-
constructor(registry) {
|
|
73
|
-
this.registry = registry;
|
|
74
|
-
effect(async () => {
|
|
75
|
-
const config = this.componentConfig();
|
|
76
|
-
const control = this.control();
|
|
77
|
-
const vcr = this.anchor();
|
|
78
|
-
vcr.clear();
|
|
79
|
-
const importer = this.registry.getImporter(config.type);
|
|
80
|
-
if (importer) {
|
|
81
|
-
try {
|
|
82
|
-
const componentType = await importer();
|
|
83
|
-
const componentRef = vcr.createComponent(componentType);
|
|
84
|
-
componentRef.setInput('config', config);
|
|
85
|
-
if (control) {
|
|
86
|
-
componentRef.setInput('control', control);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
catch (error) {
|
|
90
|
-
console.error(`Error loading component for type "${config.type}":`, error);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: ComponentLoader, deps: [{ token: ComponentRegistryService }], target: i0.ɵɵFactoryTarget.Component });
|
|
96
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.4", type: ComponentLoader, isStandalone: true, selector: "ngs-component-loader", inputs: { componentConfig: { classPropertyName: "componentConfig", publicName: "componentConfig", isSignal: true, isRequired: true, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null }, colspan: { classPropertyName: "colspan", publicName: "colspan", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.grid-column": "gridColumnStyle()" } }, viewQueries: [{ propertyName: "anchor", first: true, predicate: ["anchor"], descendants: true, read: ViewContainerRef, isSignal: true }], exportAs: ["ngsComponentLoader"], ngImport: i0, template: "<ng-container #anchor/>\n" });
|
|
97
|
-
}
|
|
98
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: ComponentLoader, decorators: [{
|
|
99
|
-
type: Component,
|
|
100
|
-
args: [{ selector: 'ngs-component-loader', exportAs: 'ngsComponentLoader', host: {
|
|
101
|
-
'[style.grid-column]': 'gridColumnStyle()',
|
|
102
|
-
}, template: "<ng-container #anchor/>\n" }]
|
|
103
|
-
}], ctorParameters: () => [{ type: ComponentRegistryService }], propDecorators: { componentConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "componentConfig", required: true }] }], control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: false }] }], colspan: [{ type: i0.Input, args: [{ isSignal: true, alias: "colspan", required: false }] }], anchor: [{ type: i0.ViewChild, args: ['anchor', { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
|
|
104
|
-
|
|
105
|
-
class ValidatorRegistryService {
|
|
106
|
-
validatorMap = new Map();
|
|
107
|
-
constructor() {
|
|
108
|
-
this.registerDefaultValidators();
|
|
109
|
-
}
|
|
110
|
-
registerDefaultValidators() {
|
|
111
|
-
this.registerValidator('required', () => Validators.required);
|
|
112
|
-
this.registerValidator('email', () => Validators.email);
|
|
113
|
-
this.registerValidator('minLength', (config) => Validators.minLength(config.value));
|
|
114
|
-
this.registerValidator('maxLength', (config) => Validators.maxLength(config.value));
|
|
115
|
-
this.registerValidator('pattern', (config) => Validators.pattern(config.value));
|
|
116
|
-
}
|
|
117
|
-
registerValidator(name, factory) {
|
|
118
|
-
this.validatorMap.set(name, factory);
|
|
119
|
-
}
|
|
120
|
-
getValidator(config) {
|
|
121
|
-
const factory = this.validatorMap.get(config.type);
|
|
122
|
-
if (!factory) {
|
|
123
|
-
return Validators.nullValidator;
|
|
124
|
-
}
|
|
125
|
-
return factory(config);
|
|
126
|
-
}
|
|
127
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: ValidatorRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
128
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: ValidatorRegistryService, providedIn: 'root' });
|
|
129
|
-
}
|
|
130
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: ValidatorRegistryService, decorators: [{
|
|
131
|
-
type: Injectable,
|
|
132
|
-
args: [{
|
|
133
|
-
providedIn: 'root',
|
|
134
|
-
}]
|
|
135
|
-
}], ctorParameters: () => [] });
|
|
136
|
-
|
|
137
|
-
class FormGeneratorService {
|
|
138
|
-
fb;
|
|
139
|
-
validatorRegistry;
|
|
140
|
-
constructor(fb, validatorRegistry) {
|
|
141
|
-
this.fb = fb;
|
|
142
|
-
this.validatorRegistry = validatorRegistry;
|
|
143
|
-
}
|
|
144
|
-
createFormGroup(config, initialValue) {
|
|
145
|
-
const group = this.fb.group({}, { validators: config.crossValidators });
|
|
146
|
-
for (const elementConfig of config.elements) {
|
|
147
|
-
if (elementConfig.kind === 'field') {
|
|
148
|
-
let finalValue = initialValue?.[elementConfig.name] ?? elementConfig.value ?? null;
|
|
149
|
-
if (finalValue === null && 'defaultValue' in elementConfig) {
|
|
150
|
-
finalValue = elementConfig.defaultValue;
|
|
151
|
-
}
|
|
152
|
-
const validators = this.mapValidators(elementConfig.validators);
|
|
153
|
-
const formState = {
|
|
154
|
-
value: finalValue,
|
|
155
|
-
disabled: elementConfig.disabled ?? false
|
|
156
|
-
};
|
|
157
|
-
const control = new FormControl(formState, validators);
|
|
158
|
-
group.addControl(elementConfig.name, control);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return group;
|
|
162
|
-
}
|
|
163
|
-
mapValidators(validators) {
|
|
164
|
-
if (!validators) {
|
|
165
|
-
return [];
|
|
166
|
-
}
|
|
167
|
-
return validators.map(config => this.validatorRegistry.getValidator(config));
|
|
168
|
-
}
|
|
169
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: FormGeneratorService, deps: [{ token: i1.FormBuilder }, { token: ValidatorRegistryService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
170
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: FormGeneratorService, providedIn: 'root' });
|
|
171
|
-
}
|
|
172
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: FormGeneratorService, decorators: [{
|
|
173
|
-
type: Injectable,
|
|
174
|
-
args: [{
|
|
175
|
-
providedIn: 'root',
|
|
176
|
-
}]
|
|
177
|
-
}], ctorParameters: () => [{ type: i1.FormBuilder }, { type: ValidatorRegistryService }] });
|
|
178
|
-
|
|
179
|
-
class FormRenderer {
|
|
180
|
-
formGenerator;
|
|
181
|
-
validatorRegistry;
|
|
182
|
-
destroyRef = inject(DestroyRef);
|
|
183
|
-
config = input.required(...(ngDevMode ? [{ debugName: "config" }] : /* istanbul ignore next */ []));
|
|
184
|
-
initialValue = input(...(ngDevMode ? [undefined, { debugName: "initialValue" }] : /* istanbul ignore next */ []));
|
|
185
|
-
formSubmit = output();
|
|
186
|
-
valueChanges = output();
|
|
187
|
-
initialized = output();
|
|
188
|
-
elementsMap = computed(() => {
|
|
189
|
-
const map = new Map();
|
|
190
|
-
for (const element of this.config().elements) {
|
|
191
|
-
map.set(element.name, element);
|
|
192
|
-
}
|
|
193
|
-
return map;
|
|
194
|
-
}, ...(ngDevMode ? [{ debugName: "elementsMap" }] : /* istanbul ignore next */ []));
|
|
195
|
-
formGroup = computed(() => this.formGenerator.createFormGroup(this.config(), this.initialValue()), ...(ngDevMode ? [{ debugName: "formGroup" }] : /* istanbul ignore next */ []));
|
|
196
|
-
#initialized = false;
|
|
197
|
-
valueChangesSub;
|
|
198
|
-
constructor(formGenerator, validatorRegistry) {
|
|
199
|
-
this.formGenerator = formGenerator;
|
|
200
|
-
this.validatorRegistry = validatorRegistry;
|
|
201
|
-
effect(() => {
|
|
202
|
-
this.valueChangesSub?.unsubscribe();
|
|
203
|
-
const form = this.formGroup();
|
|
204
|
-
this.valueChangesSub = form.valueChanges
|
|
205
|
-
.pipe(startWith(form.value), takeUntilDestroyed(this.destroyRef))
|
|
206
|
-
.subscribe(() => {
|
|
207
|
-
for (const elementConfig of this.config().elements) {
|
|
208
|
-
if (elementConfig.kind === 'field') {
|
|
209
|
-
const control = form.get(elementConfig.name);
|
|
210
|
-
if (!control) {
|
|
211
|
-
continue;
|
|
212
|
-
}
|
|
213
|
-
const isVisible = elementConfig.visibleWhen ? elementConfig.visibleWhen(form) : true;
|
|
214
|
-
const shouldBeEnabled = !(elementConfig.disabled ?? false) && isVisible;
|
|
215
|
-
if (shouldBeEnabled && control.disabled) {
|
|
216
|
-
control.enable({ emitEvent: false });
|
|
217
|
-
const validators = this.mapValidators(elementConfig.validators);
|
|
218
|
-
control.setValidators(validators);
|
|
219
|
-
}
|
|
220
|
-
else if (!shouldBeEnabled && control.enabled) {
|
|
221
|
-
control.disable({ emitEvent: false });
|
|
222
|
-
control.clearValidators();
|
|
223
|
-
}
|
|
224
|
-
control.updateValueAndValidity({ emitEvent: false });
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
if (!this.#initialized) {
|
|
228
|
-
this.#initialized = true;
|
|
229
|
-
this.initialized.emit();
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
ngOnInit() {
|
|
235
|
-
const form = this.formGroup();
|
|
236
|
-
form
|
|
237
|
-
.valueChanges
|
|
238
|
-
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
239
|
-
.subscribe(() => {
|
|
240
|
-
if (!this.#initialized) {
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
this.valueChanges.emit(form.value);
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
ngOnDestroy() {
|
|
247
|
-
this.valueChangesSub?.unsubscribe();
|
|
248
|
-
}
|
|
249
|
-
submit() {
|
|
250
|
-
const form = this.formGroup();
|
|
251
|
-
if (form.valid) {
|
|
252
|
-
this.formSubmit.emit(form.getRawValue());
|
|
253
|
-
}
|
|
254
|
-
else {
|
|
255
|
-
form.markAllAsTouched();
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
get form() {
|
|
259
|
-
return this.formGroup();
|
|
260
|
-
}
|
|
261
|
-
get value() {
|
|
262
|
-
return this.formGroup().value;
|
|
263
|
-
}
|
|
264
|
-
get isValid() {
|
|
265
|
-
return this.form.valid;
|
|
266
|
-
}
|
|
267
|
-
get isInvalid() {
|
|
268
|
-
return this.form.invalid;
|
|
269
|
-
}
|
|
270
|
-
isFieldVisible(name) {
|
|
271
|
-
const componentConfig = this.elementsMap().get(name);
|
|
272
|
-
if (!componentConfig) {
|
|
273
|
-
return true;
|
|
274
|
-
}
|
|
275
|
-
if (componentConfig.kind === 'field' && componentConfig.visibleWhen) {
|
|
276
|
-
return componentConfig.visibleWhen(this.formGroup());
|
|
277
|
-
}
|
|
278
|
-
return true;
|
|
279
|
-
}
|
|
280
|
-
getComponentConfig(name) {
|
|
281
|
-
return this.elementsMap().get(name);
|
|
282
|
-
}
|
|
283
|
-
getControl(name) {
|
|
284
|
-
return this.formGroup().get(name);
|
|
285
|
-
}
|
|
286
|
-
isGridNode(node) {
|
|
287
|
-
return 'children' in node;
|
|
288
|
-
}
|
|
289
|
-
onSubmit() {
|
|
290
|
-
this.submit();
|
|
291
|
-
}
|
|
292
|
-
mapValidators(validators) {
|
|
293
|
-
if (!validators) {
|
|
294
|
-
return [];
|
|
295
|
-
}
|
|
296
|
-
return validators.map(config => this.validatorRegistry.getValidator(config));
|
|
297
|
-
}
|
|
298
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: FormRenderer, deps: [{ token: FormGeneratorService }, { token: ValidatorRegistryService }], target: i0.ɵɵFactoryTarget.Component });
|
|
299
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: FormRenderer, isStandalone: true, selector: "ngs-form-renderer", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, initialValue: { classPropertyName: "initialValue", publicName: "initialValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { formSubmit: "formSubmit", valueChanges: "valueChanges", initialized: "initialized" }, host: { classAttribute: "ngs-form-renderer" }, exportAs: ["ngsFormRenderer"], ngImport: i0, template: "@if (config(); as cfg) {\n <form [formGroup]=\"formGroup()\" (ngSubmit)=\"onSubmit()\">\n <ng-container *ngTemplateOutlet=\"renderNode; context: {$implicit: cfg.layout}\" />\n <ng-content/>\n </form>\n}\n\n<ng-template #renderNode let-node>\n @if (isGridNode(node)) {\n <div\n class=\"grid-layout\"\n [style.grid-template-columns]=\"'repeat(' + node.columns + ', 1fr)'\"\n [style.gap]=\"node.gap\">\n @for (childNode of node.children; track childNode) {\n <ng-container *ngTemplateOutlet=\"renderNode; context: {$implicit: childNode}\" />\n }\n </div>\n } @else {\n @if(isFieldVisible(node.name)) {\n <ngs-component-loader [componentConfig]=\"getComponentConfig(node.name)!\"\n [control]=\"getControl(node.name)\"\n [colspan]=\"node.colspan\" />\n }\n }\n</ng-template>\n", styles: [":host{display:block}:host .grid-layout{display:grid;width:100%;gap:calc(var(--spacing, .25rem) * 4) calc(var(--spacing, .25rem) * 7)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: ComponentLoader, selector: "ngs-component-loader", inputs: ["componentConfig", "control", "colspan"], exportAs: ["ngsComponentLoader"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
300
|
-
}
|
|
301
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: FormRenderer, decorators: [{
|
|
302
|
-
type: Component,
|
|
303
|
-
args: [{ selector: 'ngs-form-renderer', exportAs: 'ngsFormRenderer', imports: [
|
|
304
|
-
CommonModule,
|
|
305
|
-
ReactiveFormsModule,
|
|
306
|
-
ComponentLoader,
|
|
307
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
308
|
-
'class': 'ngs-form-renderer',
|
|
309
|
-
}, template: "@if (config(); as cfg) {\n <form [formGroup]=\"formGroup()\" (ngSubmit)=\"onSubmit()\">\n <ng-container *ngTemplateOutlet=\"renderNode; context: {$implicit: cfg.layout}\" />\n <ng-content/>\n </form>\n}\n\n<ng-template #renderNode let-node>\n @if (isGridNode(node)) {\n <div\n class=\"grid-layout\"\n [style.grid-template-columns]=\"'repeat(' + node.columns + ', 1fr)'\"\n [style.gap]=\"node.gap\">\n @for (childNode of node.children; track childNode) {\n <ng-container *ngTemplateOutlet=\"renderNode; context: {$implicit: childNode}\" />\n }\n </div>\n } @else {\n @if(isFieldVisible(node.name)) {\n <ngs-component-loader [componentConfig]=\"getComponentConfig(node.name)!\"\n [control]=\"getControl(node.name)\"\n [colspan]=\"node.colspan\" />\n }\n }\n</ng-template>\n", styles: [":host{display:block}:host .grid-layout{display:grid;width:100%;gap:calc(var(--spacing, .25rem) * 4) calc(var(--spacing, .25rem) * 7)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
310
|
-
}], ctorParameters: () => [{ type: FormGeneratorService }, { type: ValidatorRegistryService }], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], initialValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialValue", required: false }] }], formSubmit: [{ type: i0.Output, args: ["formSubmit"] }], valueChanges: [{ type: i0.Output, args: ["valueChanges"] }], initialized: [{ type: i0.Output, args: ["initialized"] }] } });
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Generated bundle index. Do not edit.
|
|
314
|
-
*/
|
|
315
|
-
|
|
316
|
-
export { ComponentRegistryService, FORM_RENDERER_FIELD_REGISTRY, FormRenderer, ValidatorRegistryService };
|
|
317
|
-
//# sourceMappingURL=ngstarter-ui-components-form-renderer.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngstarter-ui-components-form-renderer.mjs","sources":["../../../projects/components/form-renderer/src/models/form-config.model.ts","../../../projects/components/form-renderer/src/services/component-registry.service.ts","../../../projects/components/form-renderer/src/component-loader/component-loader.ts","../../../projects/components/form-renderer/src/component-loader/component-loader.html","../../../projects/components/form-renderer/src/services/validator-registry.service.ts","../../../projects/components/form-renderer/src/services/form-generator.service.ts","../../../projects/components/form-renderer/src/form-renderer/form-renderer.ts","../../../projects/components/form-renderer/src/form-renderer/form-renderer.html","../../../projects/components/form-renderer/ngstarter-ui-components-form-renderer.ts"],"sourcesContent":["import { FormGroup, ValidationErrors } from '@angular/forms';\nimport { InjectionToken } from '@angular/core';\nimport { ComponentImporter } from '../services/component-registry.service';\n\nexport const FORM_RENDERER_FIELD_REGISTRY =\n new InjectionToken<{[fieldName:string]: ComponentImporter}>('FORM_RENDERER_FIELDS_CONFIG');\n\nexport interface ValidatorConfig {\n type: string;\n value?: any;\n message: string;\n}\n\ninterface BaseComponentConfig {\n name: string;\n type: string;\n}\n\nexport interface FormFieldConfig extends BaseComponentConfig {\n kind: 'field';\n value?: any;\n validators?: ValidatorConfig[];\n label?: string;\n placeholder?: string;\n inputType?: 'text' | 'number' | 'email' | 'password';\n readonly?: boolean;\n disabled?: boolean;\n inline?: boolean;\n visibleWhen?: (formGroup: FormGroup) => boolean;\n payload?: {\n [key: string]: any;\n };\n hint?: string;\n}\n\nexport interface ContentConfig extends BaseComponentConfig {\n kind: 'content';\n content?: {\n [key: string]: any;\n };\n}\n\nexport type ComponentConfig = FormFieldConfig | ContentConfig | any;\n\nexport interface ComponentNode {\n name: string;\n colspan?: number;\n}\n\nexport interface GridNode {\n columns: number;\n gap?: string;\n children: LayoutNode[];\n}\n\nexport type LayoutNode = ComponentNode | GridNode;\n\nexport type CrossValidatorFn = (formGroup: FormGroup) => ValidationErrors | null;\n\nexport interface FormConfig {\n elements: ComponentConfig[];\n layout: LayoutNode;\n crossValidators?: CrossValidatorFn[];\n}\n","import { inject, Injectable, Type } from '@angular/core';\nimport { FORM_RENDERER_FIELD_REGISTRY } from '../models/form-config.model';\n\nexport type ComponentImporter = () => Promise<Type<any>>;\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ComponentRegistryService {\n private globalRegistry = inject(FORM_RENDERER_FIELD_REGISTRY, { optional: true });\n private componentMap = new Map<string, ComponentImporter>();\n\n constructor() {\n this.registerDefaultComponents();\n }\n\n private registerDefaultComponents(): void {\n this.componentMap.set('input', () =>\n import('../fields/input-field/input-field').then(c => c.InputField)\n );\n this.componentMap.set('textarea', () =>\n import('../fields/textarea-field/textarea-field')\n .then(c => c.TextareaField)\n );\n this.componentMap.set('select', () =>\n import('../fields/select-field/select-field')\n .then(c => c.SelectField)\n );\n this.componentMap.set('checkbox', () =>\n import('../fields/checkbox-field/checkbox-field')\n .then(c => c.CheckboxField)\n );\n this.componentMap.set('datepicker', () =>\n import('../fields/datepicker-field/datepicker-field')\n .then(c => c.DatepickerField)\n );\n this.componentMap.set('toggle', () =>\n import('../fields/toggle-field/toggle-field')\n .then(c => c.ToggleField)\n );\n this.componentMap.set('radioGroup', () =>\n import('../fields/radio-group-field/radio-group-field')\n .then(c => c.RadioGroupField)\n );\n this.componentMap.set('timezone', () =>\n import('../fields/timezone-field/timezone-field')\n .then(c => c.TimezoneField)\n );\n this.componentMap.set('image', () =>\n import('../content/image-content/image-content')\n .then(c => c.ImageContent));\n this.componentMap.set('text', () =>\n import('../content/text-content/text-content')\n .then(c => c.TextContent));\n this.componentMap.set('divider', () =>\n import('../content/divider-content/divider-content')\n .then(c => c.DividerContent));\n this.componentMap.set('autocompleteMany', () =>\n import('../fields/autocomplete-many-field/autocomplete-many-field')\n .then(c => c.AutocompleteManyField)\n );\n\n if (this.globalRegistry) {\n const globalRegistry = this.globalRegistry as any;\n Object.keys(globalRegistry).forEach(typeName => {\n this.componentMap.set(typeName, globalRegistry[typeName]);\n });\n }\n }\n\n getImporter(typeName: string): ComponentImporter | undefined {\n return this.componentMap.get(typeName);\n }\n}\n","import { Component, ViewContainerRef, input, effect, computed, viewChild } from '@angular/core';\nimport { FormControl } from '@angular/forms';\nimport { ComponentConfig } from '../models/form-config.model';\nimport { ComponentRegistryService } from '../services/component-registry.service';\n\n@Component({\n selector: 'ngs-component-loader',\n exportAs: 'ngsComponentLoader',\n templateUrl: './component-loader.html',\n host: {\n '[style.grid-column]': 'gridColumnStyle()',\n }\n})\nexport class ComponentLoader {\n componentConfig = input.required<ComponentConfig>();\n control = input<FormControl | null>(null);\n colspan = input<number | undefined>();\n\n protected gridColumnStyle = computed(() => {\n const span = this.colspan();\n return span ? `span ${span}` : null;\n });\n\n anchor = viewChild.required('anchor', { read: ViewContainerRef });\n\n constructor(private registry: ComponentRegistryService) {\n effect(async () => {\n const config = this.componentConfig();\n const control = this.control();\n const vcr = this.anchor();\n vcr.clear();\n const importer = this.registry.getImporter(config.type);\n\n if (importer) {\n try {\n const componentType = await importer();\n const componentRef = vcr.createComponent(componentType);\n\n componentRef.setInput('config', config);\n\n if (control) {\n componentRef.setInput('control', control);\n }\n } catch (error) {\n console.error(`Error loading component for type \"${config.type}\":`, error);\n }\n }\n });\n }\n}\n","<ng-container #anchor/>\n","import { Injectable } from '@angular/core';\nimport { ValidatorFn, Validators } from '@angular/forms';\nimport { ValidatorConfig } from '../models/form-config.model';\n\ntype ValidatorFactory = (config: ValidatorConfig) => ValidatorFn;\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ValidatorRegistryService {\n private validatorMap = new Map<string, ValidatorFactory>();\n\n constructor() {\n this.registerDefaultValidators();\n }\n\n private registerDefaultValidators(): void {\n this.registerValidator('required', () => Validators.required);\n this.registerValidator('email', () => Validators.email);\n this.registerValidator('minLength', (config) => Validators.minLength(config.value));\n this.registerValidator('maxLength', (config) => Validators.maxLength(config.value));\n this.registerValidator('pattern', (config) => Validators.pattern(config.value));\n }\n\n registerValidator(name: string, factory: ValidatorFactory): void {\n this.validatorMap.set(name, factory);\n }\n\n getValidator(config: ValidatorConfig): ValidatorFn {\n const factory = this.validatorMap.get(config.type);\n if (!factory) {\n return Validators.nullValidator;\n }\n return factory(config);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup, ValidatorFn } from '@angular/forms';\nimport { FormConfig, ValidatorConfig } from '../models/form-config.model';\nimport { ValidatorRegistryService } from './validator-registry.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class FormGeneratorService {\n constructor(\n private fb: FormBuilder,\n private validatorRegistry: ValidatorRegistryService\n ) {}\n\n createFormGroup(config: FormConfig, initialValue?: Record<string, any>): FormGroup {\n const group = this.fb.group({}, { validators: config.crossValidators });\n\n for (const elementConfig of config.elements) {\n if (elementConfig.kind === 'field') {\n let finalValue = initialValue?.[elementConfig.name] ?? elementConfig.value ?? null;\n\n if (finalValue === null && 'defaultValue' in elementConfig) {\n finalValue = elementConfig.defaultValue;\n }\n\n const validators = this.mapValidators(elementConfig.validators);\n const formState = {\n value: finalValue,\n disabled: elementConfig.disabled ?? false\n };\n const control = new FormControl(formState, validators);\n group.addControl(elementConfig.name, control);\n }\n }\n return group;\n }\n\n private mapValidators(validators: ValidatorConfig[] | undefined): ValidatorFn[] {\n if (!validators) {\n return [];\n }\n return validators.map(config => this.validatorRegistry.getValidator(config));\n }\n}\n","import {\n Component,\n computed,\n input,\n output,\n ChangeDetectionStrategy,\n Signal,\n effect,\n OnDestroy,\n OnInit, inject, DestroyRef\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule, FormGroup, FormControl, ValidatorFn } from '@angular/forms';\nimport { Subscription } from 'rxjs';\nimport { startWith } from 'rxjs/operators';\nimport { ComponentConfig, FormConfig, LayoutNode, GridNode, ValidatorConfig } from '../models/form-config.model';\nimport { FormGeneratorService } from '../services/form-generator.service';\nimport { ComponentLoader } from '../component-loader/component-loader';\nimport { ValidatorRegistryService } from '../services/validator-registry.service';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\n@Component({\n selector: 'ngs-form-renderer',\n exportAs: 'ngsFormRenderer',\n imports: [\n CommonModule,\n ReactiveFormsModule,\n ComponentLoader,\n ],\n templateUrl: './form-renderer.html',\n styleUrl: './form-renderer.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n 'class': 'ngs-form-renderer',\n }\n})\nexport class FormRenderer implements OnInit, OnDestroy {\n private destroyRef = inject(DestroyRef);\n\n readonly config = input.required<FormConfig>();\n readonly initialValue = input<Record<string, any> | undefined>();\n readonly formSubmit = output<any>();\n readonly valueChanges = output<any>();\n readonly initialized = output<void>();\n\n private elementsMap: Signal<Map<string, ComponentConfig>> = computed(() => {\n const map = new Map<string, ComponentConfig>();\n for (const element of this.config().elements) {\n map.set(element.name, element);\n }\n return map;\n });\n\n protected formGroup: Signal<FormGroup> = computed(() =>\n this.formGenerator.createFormGroup(this.config(), this.initialValue())\n );\n\n #initialized = false;\n private valueChangesSub?: Subscription;\n\n constructor(\n private formGenerator: FormGeneratorService,\n private validatorRegistry: ValidatorRegistryService\n ) {\n effect(() => {\n this.valueChangesSub?.unsubscribe();\n const form = this.formGroup();\n this.valueChangesSub = form.valueChanges\n .pipe(\n startWith(form.value),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe(() => {\n for (const elementConfig of this.config().elements) {\n if (elementConfig.kind === 'field') {\n const control = form.get(elementConfig.name);\n\n if (!control) {\n continue;\n }\n\n const isVisible = elementConfig.visibleWhen ? elementConfig.visibleWhen(form) : true;\n const shouldBeEnabled = !(elementConfig.disabled ?? false) && isVisible;\n\n if (shouldBeEnabled && control.disabled) {\n control.enable({ emitEvent: false });\n const validators = this.mapValidators(elementConfig.validators);\n control.setValidators(validators);\n } else if (!shouldBeEnabled && control.enabled) {\n control.disable({ emitEvent: false });\n control.clearValidators();\n }\n\n control.updateValueAndValidity({ emitEvent: false });\n }\n }\n\n if (!this.#initialized) {\n this.#initialized = true;\n this.initialized.emit();\n }\n });\n });\n }\n\n ngOnInit() {\n const form = this.formGroup();\n form\n .valueChanges\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n if (!this.#initialized) {\n return;\n }\n\n this.valueChanges.emit(form.value);\n });\n }\n\n ngOnDestroy(): void {\n this.valueChangesSub?.unsubscribe();\n }\n\n submit() {\n const form = this.formGroup();\n if (form.valid) {\n this.formSubmit.emit(form.getRawValue());\n } else {\n form.markAllAsTouched();\n }\n }\n\n get form() {\n return this.formGroup();\n }\n\n get value() {\n return this.formGroup().value;\n }\n\n get isValid() {\n return this.form.valid;\n }\n\n get isInvalid() {\n return this.form.invalid;\n }\n\n protected isFieldVisible(name: string): boolean {\n const componentConfig = this.elementsMap().get(name);\n if (!componentConfig) {\n return true;\n }\n\n if (componentConfig.kind === 'field' && componentConfig.visibleWhen) {\n return componentConfig.visibleWhen(this.formGroup());\n }\n\n return true;\n }\n\n protected getComponentConfig(name: string): ComponentConfig | undefined {\n return this.elementsMap().get(name);\n }\n\n protected getControl(name: string): FormControl | null {\n return this.formGroup().get(name) as FormControl | null;\n }\n\n protected isGridNode(node: LayoutNode): node is GridNode {\n return 'children' in node;\n }\n\n protected onSubmit(): void {\n this.submit();\n }\n\n private mapValidators(validators: ValidatorConfig[] | undefined): ValidatorFn[] {\n if (!validators) {\n return [];\n }\n\n return validators.map(config => this.validatorRegistry.getValidator(config));\n }\n}\n","@if (config(); as cfg) {\n <form [formGroup]=\"formGroup()\" (ngSubmit)=\"onSubmit()\">\n <ng-container *ngTemplateOutlet=\"renderNode; context: {$implicit: cfg.layout}\" />\n <ng-content/>\n </form>\n}\n\n<ng-template #renderNode let-node>\n @if (isGridNode(node)) {\n <div\n class=\"grid-layout\"\n [style.grid-template-columns]=\"'repeat(' + node.columns + ', 1fr)'\"\n [style.gap]=\"node.gap\">\n @for (childNode of node.children; track childNode) {\n <ng-container *ngTemplateOutlet=\"renderNode; context: {$implicit: childNode}\" />\n }\n </div>\n } @else {\n @if(isFieldVisible(node.name)) {\n <ngs-component-loader [componentConfig]=\"getComponentConfig(node.name)!\"\n [control]=\"getControl(node.name)\"\n [colspan]=\"node.colspan\" />\n }\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.ComponentRegistryService","i2.ValidatorRegistryService","i1.FormGeneratorService"],"mappings":";;;;;;;;;MAIa,4BAA4B,GACvC,IAAI,cAAc,CAA0C,6BAA6B;;MCG9E,wBAAwB,CAAA;IAC3B,cAAc,GAAG,MAAM,CAAC,4BAA4B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACzE,IAAA,YAAY,GAAG,IAAI,GAAG,EAA6B;AAE3D,IAAA,WAAA,GAAA;QACE,IAAI,CAAC,yBAAyB,EAAE;IAClC;IAEQ,yBAAyB,GAAA;QAC/B,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,MAC7B,OAAO,kEAAmC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CACpE;AACD,QAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,EAAE,MAChC,OAAO,qEAAyC;aAC7C,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,CAC9B;AACD,QAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,MAC9B,OAAO,mEAAqC;aACzC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,CAC5B;AACD,QAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,EAAE,MAChC,OAAO,qEAAyC;aAC7C,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,CAC9B;AACD,QAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,EAAE,MAClC,OAAO,uEAA6C;aACjD,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,CAChC;AACD,QAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,MAC9B,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,EAAA,IAAA,EACZ,mBAAmB,icACnB,eAAe,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,iBAAA,EAAA,SAAA,EAAA,SAAA,CAAA,EAAA,QAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FASN,YAAY,EAAA,UAAA,EAAA,CAAA;kBAfxB,SAAS;+BACE,mBAAmB,EAAA,QAAA,EACnB,iBAAiB,EAAA,OAAA,EAClB;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,eAAe;qBAChB,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,OAAO,EAAE,mBAAmB;AAC7B,qBAAA,EAAA,QAAA,EAAA,+0BAAA,EAAA,MAAA,EAAA,CAAA,4MAAA,CAAA,EAAA;;;AElCH;;AAEG;;;;"}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Type, InjectionToken, OnInit, OnDestroy, Signal } from '@angular/core';
|
|
3
|
-
import { FormGroup, ValidationErrors, ValidatorFn, FormBuilder, FormControl } from '@angular/forms';
|
|
4
|
-
|
|
5
|
-
type ComponentImporter = () => Promise<Type<any>>;
|
|
6
|
-
declare class ComponentRegistryService {
|
|
7
|
-
private globalRegistry;
|
|
8
|
-
private componentMap;
|
|
9
|
-
constructor();
|
|
10
|
-
private registerDefaultComponents;
|
|
11
|
-
getImporter(typeName: string): ComponentImporter | undefined;
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ComponentRegistryService, never>;
|
|
13
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ComponentRegistryService>;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare const FORM_RENDERER_FIELD_REGISTRY: InjectionToken<{
|
|
17
|
-
[fieldName: string]: ComponentImporter;
|
|
18
|
-
}>;
|
|
19
|
-
interface ValidatorConfig {
|
|
20
|
-
type: string;
|
|
21
|
-
value?: any;
|
|
22
|
-
message: string;
|
|
23
|
-
}
|
|
24
|
-
interface BaseComponentConfig {
|
|
25
|
-
name: string;
|
|
26
|
-
type: string;
|
|
27
|
-
}
|
|
28
|
-
interface FormFieldConfig extends BaseComponentConfig {
|
|
29
|
-
kind: 'field';
|
|
30
|
-
value?: any;
|
|
31
|
-
validators?: ValidatorConfig[];
|
|
32
|
-
label?: string;
|
|
33
|
-
placeholder?: string;
|
|
34
|
-
inputType?: 'text' | 'number' | 'email' | 'password';
|
|
35
|
-
readonly?: boolean;
|
|
36
|
-
disabled?: boolean;
|
|
37
|
-
inline?: boolean;
|
|
38
|
-
visibleWhen?: (formGroup: FormGroup) => boolean;
|
|
39
|
-
payload?: {
|
|
40
|
-
[key: string]: any;
|
|
41
|
-
};
|
|
42
|
-
hint?: string;
|
|
43
|
-
}
|
|
44
|
-
interface ContentConfig extends BaseComponentConfig {
|
|
45
|
-
kind: 'content';
|
|
46
|
-
content?: {
|
|
47
|
-
[key: string]: any;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
type ComponentConfig = FormFieldConfig | ContentConfig | any;
|
|
51
|
-
interface ComponentNode {
|
|
52
|
-
name: string;
|
|
53
|
-
colspan?: number;
|
|
54
|
-
}
|
|
55
|
-
interface GridNode {
|
|
56
|
-
columns: number;
|
|
57
|
-
gap?: string;
|
|
58
|
-
children: LayoutNode[];
|
|
59
|
-
}
|
|
60
|
-
type LayoutNode = ComponentNode | GridNode;
|
|
61
|
-
type CrossValidatorFn = (formGroup: FormGroup) => ValidationErrors | null;
|
|
62
|
-
interface FormConfig {
|
|
63
|
-
elements: ComponentConfig[];
|
|
64
|
-
layout: LayoutNode;
|
|
65
|
-
crossValidators?: CrossValidatorFn[];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
type ValidatorFactory = (config: ValidatorConfig) => ValidatorFn;
|
|
69
|
-
declare class ValidatorRegistryService {
|
|
70
|
-
private validatorMap;
|
|
71
|
-
constructor();
|
|
72
|
-
private registerDefaultValidators;
|
|
73
|
-
registerValidator(name: string, factory: ValidatorFactory): void;
|
|
74
|
-
getValidator(config: ValidatorConfig): ValidatorFn;
|
|
75
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ValidatorRegistryService, never>;
|
|
76
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ValidatorRegistryService>;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
declare class FormGeneratorService {
|
|
80
|
-
private fb;
|
|
81
|
-
private validatorRegistry;
|
|
82
|
-
constructor(fb: FormBuilder, validatorRegistry: ValidatorRegistryService);
|
|
83
|
-
createFormGroup(config: FormConfig, initialValue?: Record<string, any>): FormGroup;
|
|
84
|
-
private mapValidators;
|
|
85
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FormGeneratorService, never>;
|
|
86
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<FormGeneratorService>;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
declare class FormRenderer implements OnInit, OnDestroy {
|
|
90
|
-
#private;
|
|
91
|
-
private formGenerator;
|
|
92
|
-
private validatorRegistry;
|
|
93
|
-
private destroyRef;
|
|
94
|
-
readonly config: i0.InputSignal<FormConfig>;
|
|
95
|
-
readonly initialValue: i0.InputSignal<Record<string, any> | undefined>;
|
|
96
|
-
readonly formSubmit: i0.OutputEmitterRef<any>;
|
|
97
|
-
readonly valueChanges: i0.OutputEmitterRef<any>;
|
|
98
|
-
readonly initialized: i0.OutputEmitterRef<void>;
|
|
99
|
-
private elementsMap;
|
|
100
|
-
protected formGroup: Signal<FormGroup>;
|
|
101
|
-
private valueChangesSub?;
|
|
102
|
-
constructor(formGenerator: FormGeneratorService, validatorRegistry: ValidatorRegistryService);
|
|
103
|
-
ngOnInit(): void;
|
|
104
|
-
ngOnDestroy(): void;
|
|
105
|
-
submit(): void;
|
|
106
|
-
get form(): FormGroup<any>;
|
|
107
|
-
get value(): any;
|
|
108
|
-
get isValid(): boolean;
|
|
109
|
-
get isInvalid(): boolean;
|
|
110
|
-
protected isFieldVisible(name: string): boolean;
|
|
111
|
-
protected getComponentConfig(name: string): ComponentConfig | undefined;
|
|
112
|
-
protected getControl(name: string): FormControl | null;
|
|
113
|
-
protected isGridNode(node: LayoutNode): node is GridNode;
|
|
114
|
-
protected onSubmit(): void;
|
|
115
|
-
private mapValidators;
|
|
116
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FormRenderer, never>;
|
|
117
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FormRenderer, "ngs-form-renderer", ["ngsFormRenderer"], { "config": { "alias": "config"; "required": true; "isSignal": true; }; "initialValue": { "alias": "initialValue"; "required": false; "isSignal": true; }; }, { "formSubmit": "formSubmit"; "valueChanges": "valueChanges"; "initialized": "initialized"; }, never, ["*"], true, never>;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export { ComponentRegistryService, FORM_RENDERER_FIELD_REGISTRY, FormRenderer, ValidatorRegistryService };
|
|
121
|
-
export type { ComponentConfig, ComponentImporter, ComponentNode, ContentConfig, CrossValidatorFn, FormConfig, FormFieldConfig, GridNode, LayoutNode, ValidatorConfig };
|