formly-form-viewer 0.0.2 → 0.0.3

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.
@@ -1,18 +1,16 @@
1
- import { OnInit } from '@angular/core';
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
2
  import { FormGroup } from '@angular/forms';
3
3
  import { FormlyFieldConfig, FormlyFormOptions } from '@ngx-formly/core';
4
4
  import * as i0 from "@angular/core";
5
- export declare class FormlyFormViewerComponent implements OnInit {
5
+ export declare class FormlyViewerComponent implements OnInit {
6
6
  form: FormGroup;
7
7
  fields: FormlyFieldConfig[];
8
8
  model: any;
9
9
  options: FormlyFormOptions;
10
- buttonLabel: string;
11
- className: string;
12
- onSubmitFunction: () => void;
10
+ customFieldClass?: string;
11
+ submitForm: EventEmitter<any>;
13
12
  ngOnInit(): void;
14
- applyClassNameToFields(): void;
15
- handleSubmit(): void;
16
- static ɵfac: i0.ɵɵFactoryDeclaration<FormlyFormViewerComponent, never>;
17
- static ɵcmp: i0.ɵɵComponentDeclaration<FormlyFormViewerComponent, "formly-form-viewer", never, { "form": { "alias": "form"; "required": false; }; "fields": { "alias": "fields"; "required": false; }; "model": { "alias": "model"; "required": false; }; "options": { "alias": "options"; "required": false; }; "buttonLabel": { "alias": "buttonLabel"; "required": false; }; "className": { "alias": "className"; "required": false; }; "onSubmitFunction": { "alias": "onSubmitFunction"; "required": false; }; }, {}, never, never, true, never>;
13
+ onSubmit(): void;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormlyViewerComponent, never>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<FormlyViewerComponent, "formly-form-viewer", never, { "form": { "alias": "form"; "required": false; }; "fields": { "alias": "fields"; "required": false; }; "model": { "alias": "model"; "required": false; }; "options": { "alias": "options"; "required": false; }; "customFieldClass": { "alias": "customFieldClass"; "required": false; }; }, { "submitForm": "submitForm"; }, never, never, true, never>;
18
16
  }
@@ -1,67 +1,51 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, Input } from '@angular/core';
2
+ import { EventEmitter, Output, Input, Component } from '@angular/core';
3
3
  import * as i2 from '@angular/forms';
4
4
  import { FormGroup, ReactiveFormsModule } from '@angular/forms';
5
- import * as i3 from '@ngx-formly/core';
6
- import { FormlyModule } from '@ngx-formly/core';
7
- import { FormlyIonicModule } from '@ngx-formly/ionic';
8
- import * as i4 from '@ionic/angular';
9
- import { IonicModule } from '@ionic/angular';
5
+ import { FormlyForm } from '@ngx-formly/core';
6
+ import * as i3 from '@angular/material/button';
7
+ import { MatButtonModule } from '@angular/material/button';
10
8
  import * as i1 from '@angular/common';
11
9
  import { CommonModule } from '@angular/common';
12
10
 
13
- class FormlyFormViewerComponent {
11
+ class FormlyViewerComponent {
14
12
  form = new FormGroup({});
15
13
  fields = [];
16
14
  model = {};
17
15
  options = {};
18
- buttonLabel = 'Submit';
19
- className = '';
20
- onSubmitFunction = () => { };
21
- ngOnInit() {
22
- this.applyClassNameToFields();
23
- }
24
- applyClassNameToFields() {
25
- if (this.className && this.fields) {
26
- this.fields.forEach(field => {
27
- field.className = this.className;
28
- });
29
- }
30
- }
31
- handleSubmit() {
16
+ customFieldClass;
17
+ submitForm = new EventEmitter();
18
+ ngOnInit() { }
19
+ onSubmit() {
32
20
  if (this.form.valid) {
33
- this.onSubmitFunction();
21
+ this.submitForm.emit(this.model);
34
22
  }
35
23
  }
36
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: FormlyFormViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
37
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.3", type: FormlyFormViewerComponent, isStandalone: true, selector: "formly-form-viewer", inputs: { form: "form", fields: "fields", model: "model", options: "options", buttonLabel: "buttonLabel", className: "className", onSubmitFunction: "onSubmitFunction" }, ngImport: i0, template: `
38
- <form [formGroup]="form" (ngSubmit)="handleSubmit()">
39
- <formly-form [form]="form" [fields]="fields" [model]="model" [options]="options">
40
- </formly-form>
41
- <ion-button type="submit" [ngClass]="className">{{ buttonLabel }}</ion-button>
42
- </form>
43
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i3.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { kind: "ngmodule", type: FormlyIonicModule }, { kind: "ngmodule", type: IonicModule }, { kind: "component", type: i4.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }] });
24
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: FormlyViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
25
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: FormlyViewerComponent, isStandalone: true, selector: "formly-form-viewer", inputs: { form: "form", fields: "fields", model: "model", options: "options", customFieldClass: "customFieldClass" }, outputs: { submitForm: "submitForm" }, ngImport: i0, template: `
26
+ <form [formGroup]="form" (ngSubmit)="onSubmit()">
27
+ <formly-form [form]="form" [fields]="fields" [model]="model" [options]="options"
28
+ [ngClass]="customFieldClass">
29
+ </formly-form>
30
+ <button mat-raised-button color="primary" type="submit">Enviar</button>
31
+ </form>
32
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] });
44
33
  }
45
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: FormlyFormViewerComponent, decorators: [{
34
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: FormlyViewerComponent, decorators: [{
46
35
  type: Component,
47
- args: [{
48
- selector: 'formly-form-viewer',
49
- standalone: true,
50
- template: `
51
- <form [formGroup]="form" (ngSubmit)="handleSubmit()">
52
- <formly-form [form]="form" [fields]="fields" [model]="model" [options]="options">
53
- </formly-form>
54
- <ion-button type="submit" [ngClass]="className">{{ buttonLabel }}</ion-button>
55
- </form>
56
- `,
57
- imports: [
36
+ args: [{ selector: 'formly-form-viewer', standalone: true, template: `
37
+ <form [formGroup]="form" (ngSubmit)="onSubmit()">
38
+ <formly-form [form]="form" [fields]="fields" [model]="model" [options]="options"
39
+ [ngClass]="customFieldClass">
40
+ </formly-form>
41
+ <button mat-raised-button color="primary" type="submit">Enviar</button>
42
+ </form>
43
+ `, imports: [
58
44
  CommonModule,
59
45
  ReactiveFormsModule,
60
- FormlyModule,
61
- FormlyIonicModule,
62
- IonicModule
63
- ]
64
- }]
46
+ FormlyForm,
47
+ MatButtonModule
48
+ ] }]
65
49
  }], propDecorators: { form: [{
66
50
  type: Input
67
51
  }], fields: [{
@@ -70,17 +54,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImpor
70
54
  type: Input
71
55
  }], options: [{
72
56
  type: Input
73
- }], buttonLabel: [{
74
- type: Input
75
- }], className: [{
76
- type: Input
77
- }], onSubmitFunction: [{
57
+ }], customFieldClass: [{
78
58
  type: Input
59
+ }], submitForm: [{
60
+ type: Output
79
61
  }] } });
80
62
 
81
63
  /**
82
64
  * Generated bundle index. Do not edit.
83
65
  */
84
66
 
85
- export { FormlyFormViewerComponent };
67
+ export { FormlyViewerComponent };
86
68
  //# sourceMappingURL=formly-form-viewer.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"formly-form-viewer.mjs","sources":["../../../src/app/formly-form-viewer/formly-form-viewer.component.ts","../../../src/formly-form-viewer.ts"],"sourcesContent":["import { Component, Input, OnInit } from '@angular/core';\r\nimport { FormGroup, ReactiveFormsModule } from '@angular/forms';\r\nimport { FormlyFieldConfig, FormlyFormOptions, FormlyModule } from '@ngx-formly/core';\r\nimport { FormlyIonicModule } from '@ngx-formly/ionic';\r\nimport { IonicModule } from '@ionic/angular';\r\nimport { CommonModule } from '@angular/common';\r\n\r\n@Component({\r\n selector: 'formly-form-viewer',\r\n standalone: true,\r\n template: `\r\n <form [formGroup]=\"form\" (ngSubmit)=\"handleSubmit()\">\r\n <formly-form [form]=\"form\" [fields]=\"fields\" [model]=\"model\" [options]=\"options\">\r\n </formly-form>\r\n <ion-button type=\"submit\" [ngClass]=\"className\">{{ buttonLabel }}</ion-button>\r\n </form>\r\n `,\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n FormlyModule,\r\n FormlyIonicModule,\r\n IonicModule\r\n ]\r\n})\r\nexport class FormlyFormViewerComponent implements OnInit {\r\n @Input() form: FormGroup = new FormGroup({});\r\n @Input() fields: FormlyFieldConfig[] = [];\r\n @Input() model: any = {};\r\n @Input() options: FormlyFormOptions = {};\r\n @Input() buttonLabel: string = 'Submit';\r\n @Input() className: string = '';\r\n @Input() onSubmitFunction: () => void = () => {};\r\n\r\n ngOnInit() {\r\n this.applyClassNameToFields();\r\n }\r\n\r\n applyClassNameToFields() {\r\n if (this.className && this.fields) {\r\n this.fields.forEach(field => {\r\n field.className = this.className;\r\n });\r\n }\r\n }\r\n\r\n handleSubmit() {\r\n if (this.form.valid) {\r\n this.onSubmitFunction();\r\n }\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;MAyBa,yBAAyB,CAAA;AAC3B,IAAA,IAAI,GAAc,IAAI,SAAS,CAAC,EAAE,CAAC,CAAC;IACpC,MAAM,GAAwB,EAAE,CAAC;IACjC,KAAK,GAAQ,EAAE,CAAC;IAChB,OAAO,GAAsB,EAAE,CAAC;IAChC,WAAW,GAAW,QAAQ,CAAC;IAC/B,SAAS,GAAW,EAAE,CAAC;AACvB,IAAA,gBAAgB,GAAe,MAAK,GAAG,CAAC;IAEjD,QAAQ,GAAA;QACN,IAAI,CAAC,sBAAsB,EAAE,CAAC;KAC/B;IAED,sBAAsB,GAAA;QACpB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,EAAE;AACjC,YAAA,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,IAAG;AAC1B,gBAAA,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;AACnC,aAAC,CAAC,CAAC;SACJ;KACF;IAED,YAAY,GAAA;AACV,QAAA,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACnB,IAAI,CAAC,gBAAgB,EAAE,CAAC;SACzB;KACF;uGAzBU,yBAAyB,EAAA,IAAA,EAAA,EAAA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A,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAiB,8BACjB,WAAW,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,YAAA,EAAA,OAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,MAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAGF,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAlBrC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,CAAA;;;;;;AAMT,EAAA,CAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,YAAY;wBACZ,iBAAiB;wBACjB,WAAW;AACZ,qBAAA;AACF,iBAAA,CAAA;8BAEU,IAAI,EAAA,CAAA;sBAAZ,KAAK;gBACG,MAAM,EAAA,CAAA;sBAAd,KAAK;gBACG,KAAK,EAAA,CAAA;sBAAb,KAAK;gBACG,OAAO,EAAA,CAAA;sBAAf,KAAK;gBACG,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBACG,SAAS,EAAA,CAAA;sBAAjB,KAAK;gBACG,gBAAgB,EAAA,CAAA;sBAAxB,KAAK;;;AChCR;;AAEG;;;;"}
1
+ {"version":3,"file":"formly-form-viewer.mjs","sources":["../../../src/app/formly-form-viewer/formly-form-viewer.component.ts","../../../src/formly-form-viewer.ts"],"sourcesContent":["import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\nimport { FormGroup, ReactiveFormsModule } from '@angular/forms';\nimport { FormlyFieldConfig, FormlyForm, FormlyFormOptions } from '@ngx-formly/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { CommonModule } from '@angular/common';\n\n@Component({\n selector: 'formly-form-viewer',\n standalone: true,\n template: `\n <form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <formly-form [form]=\"form\" [fields]=\"fields\" [model]=\"model\" [options]=\"options\"\n [ngClass]=\"customFieldClass\">\n </formly-form>\n <button mat-raised-button color=\"primary\" type=\"submit\">Enviar</button>\n </form>\n `,\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FormlyForm,\n MatButtonModule\n ],\n styles: []\n})\nexport class FormlyViewerComponent implements OnInit {\n @Input() form: FormGroup = new FormGroup({});\n @Input() fields: FormlyFieldConfig[] = [];\n @Input() model: any = {};\n @Input() options: FormlyFormOptions = {};\n @Input() customFieldClass?: string;\n @Output() submitForm = new EventEmitter<any>();\n\n ngOnInit() {}\n\n onSubmit() {\n if (this.form.valid) {\n this.submitForm.emit(this.model);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAyBa,qBAAqB,CAAA;AACvB,IAAA,IAAI,GAAc,IAAI,SAAS,CAAC,EAAE,CAAC;IACnC,MAAM,GAAwB,EAAE;IAChC,KAAK,GAAQ,EAAE;IACf,OAAO,GAAsB,EAAE;AAC/B,IAAA,gBAAgB;AACf,IAAA,UAAU,GAAG,IAAI,YAAY,EAAO;AAE9C,IAAA,QAAQ;IAER,QAAQ,GAAA;AACN,QAAA,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACnB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;;;wGAZzB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAA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Ae,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,QAAA,EAAA,6GAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAIN,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAnBjC,SAAS;+BACE,oBAAoB,EAAA,UAAA,EAClB,IAAI,EACN,QAAA,EAAA;;;;;;;GAOT,EACQ,OAAA,EAAA;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,UAAU;wBACV;AACD,qBAAA,EAAA;8BAIQ,IAAI,EAAA,CAAA;sBAAZ;gBACQ,MAAM,EAAA,CAAA;sBAAd;gBACQ,KAAK,EAAA,CAAA;sBAAb;gBACQ,OAAO,EAAA,CAAA;sBAAf;gBACQ,gBAAgB,EAAA,CAAA;sBAAxB;gBACS,UAAU,EAAA,CAAA;sBAAnB;;;AC/BH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,27 +1,32 @@
1
1
  {
2
2
  "name": "formly-form-viewer",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "author": "Juan Jose Arroyo Rivera",
5
- "description": "Ionic standalone component to render a customizable FormlyForm",
5
+ "description": "Standalone component to render a customizable FormlyForm",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/JJKid/formly-form-viewer.git"
9
9
  },
10
10
  "peerDependencies": {
11
- "@angular/common": "^18.0.0",
12
- "@angular/compiler": "^18.0.0",
13
- "@angular/core": "^18.0.0",
14
- "@angular/forms": "^18.2.3",
15
- "@angular/platform-browser": "^18.0.0",
16
- "@angular/platform-browser-dynamic": "^18.0.0",
17
- "@angular/router": "^18.0.0",
18
- "@ionic/angular": "^7.0.0",
19
- "@ngx-formly/core": "^6.3.6",
20
- "@ngx-formly/ionic": "^6.3.6",
21
- "ionicons": "^7.0.0",
11
+ "@angular/animations": "^19.2.18",
12
+ "@angular/cdk": "^19.2.18",
13
+ "@angular/common": "^19.2.18",
14
+ "@angular/compiler": "^19.2.18",
15
+ "@angular/core": "^19.2.18",
16
+ "@angular/forms": "^19.2.18",
17
+ "@angular/material": "^19.2.18",
18
+ "@angular/platform-browser": "^19.2.18",
19
+ "@angular/platform-browser-dynamic": "^19.2.18",
20
+ "@angular/router": "^19.2.18",
21
+ "@ngx-formly/core": "^7.0.1",
22
+ "@ngx-formly/material": "^7.0.1",
22
23
  "rxjs": "~7.8.0",
23
- "zone.js": "~0.14.2"
24
+ "zone.js": "~0.15.0"
24
25
  },
26
+ "dependencies": {
27
+ "tslib": "^2.3.0"
28
+ },
29
+ "homepage": "https://github.com/JJKid/formly-form-viewer",
25
30
  "module": "fesm2022/formly-form-viewer.mjs",
26
31
  "typings": "index.d.ts",
27
32
  "exports": {
@@ -30,13 +35,8 @@
30
35
  },
31
36
  ".": {
32
37
  "types": "./index.d.ts",
33
- "esm2022": "./esm2022/formly-form-viewer.mjs",
34
- "esm": "./esm2022/formly-form-viewer.mjs",
35
38
  "default": "./fesm2022/formly-form-viewer.mjs"
36
39
  }
37
40
  },
38
- "sideEffects": false,
39
- "dependencies": {
40
- "tslib": "^2.3.0"
41
- }
41
+ "sideEffects": false
42
42
  }
@@ -1,79 +0,0 @@
1
- import { Component, Input } from '@angular/core';
2
- import { FormGroup, ReactiveFormsModule } from '@angular/forms';
3
- import { FormlyModule } from '@ngx-formly/core';
4
- import { FormlyIonicModule } from '@ngx-formly/ionic';
5
- import { IonicModule } from '@ionic/angular';
6
- import { CommonModule } from '@angular/common';
7
- import * as i0 from "@angular/core";
8
- import * as i1 from "@angular/common";
9
- import * as i2 from "@angular/forms";
10
- import * as i3 from "@ngx-formly/core";
11
- import * as i4 from "@ionic/angular";
12
- export class FormlyFormViewerComponent {
13
- form = new FormGroup({});
14
- fields = [];
15
- model = {};
16
- options = {};
17
- buttonLabel = 'Submit';
18
- className = '';
19
- onSubmitFunction = () => { };
20
- ngOnInit() {
21
- this.applyClassNameToFields();
22
- }
23
- applyClassNameToFields() {
24
- if (this.className && this.fields) {
25
- this.fields.forEach(field => {
26
- field.className = this.className;
27
- });
28
- }
29
- }
30
- handleSubmit() {
31
- if (this.form.valid) {
32
- this.onSubmitFunction();
33
- }
34
- }
35
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: FormlyFormViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
36
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.3", type: FormlyFormViewerComponent, isStandalone: true, selector: "formly-form-viewer", inputs: { form: "form", fields: "fields", model: "model", options: "options", buttonLabel: "buttonLabel", className: "className", onSubmitFunction: "onSubmitFunction" }, ngImport: i0, template: `
37
- <form [formGroup]="form" (ngSubmit)="handleSubmit()">
38
- <formly-form [form]="form" [fields]="fields" [model]="model" [options]="options">
39
- </formly-form>
40
- <ion-button type="submit" [ngClass]="className">{{ buttonLabel }}</ion-button>
41
- </form>
42
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormlyModule }, { kind: "component", type: i3.FormlyForm, selector: "formly-form", inputs: ["form", "model", "fields", "options"], outputs: ["modelChange"] }, { kind: "ngmodule", type: FormlyIonicModule }, { kind: "ngmodule", type: IonicModule }, { kind: "component", type: i4.IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }] });
43
- }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: FormlyFormViewerComponent, decorators: [{
45
- type: Component,
46
- args: [{
47
- selector: 'formly-form-viewer',
48
- standalone: true,
49
- template: `
50
- <form [formGroup]="form" (ngSubmit)="handleSubmit()">
51
- <formly-form [form]="form" [fields]="fields" [model]="model" [options]="options">
52
- </formly-form>
53
- <ion-button type="submit" [ngClass]="className">{{ buttonLabel }}</ion-button>
54
- </form>
55
- `,
56
- imports: [
57
- CommonModule,
58
- ReactiveFormsModule,
59
- FormlyModule,
60
- FormlyIonicModule,
61
- IonicModule
62
- ]
63
- }]
64
- }], propDecorators: { form: [{
65
- type: Input
66
- }], fields: [{
67
- type: Input
68
- }], model: [{
69
- type: Input
70
- }], options: [{
71
- type: Input
72
- }], buttonLabel: [{
73
- type: Input
74
- }], className: [{
75
- type: Input
76
- }], onSubmitFunction: [{
77
- type: Input
78
- }] } });
79
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybWx5LWZvcm0tdmlld2VyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9hcHAvZm9ybWx5LWZvcm0tdmlld2VyL2Zvcm1seS1mb3JtLXZpZXdlci5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQVUsTUFBTSxlQUFlLENBQUM7QUFDekQsT0FBTyxFQUFFLFNBQVMsRUFBRSxtQkFBbUIsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ2hFLE9BQU8sRUFBd0MsWUFBWSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDdEYsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sbUJB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zdHJpbmcgPSAnU3VibWl0JztcclxuICBASW5wdXQoKSBjbGFzc05hbWU6IHN0cmluZyA9ICcnO1xyXG4gIEBJbnB1dCgpIG9uU3VibWl0RnVuY3Rpb246ICgpID0+IHZvaWQgPSAoKSA9PiB7fTtcclxuXHJcbiAgbmdPbkluaXQoKSB7XHJcbiAgICB0aGlzLmFwcGx5Q2xhc3NOYW1lVG9GaWVsZHMoKTtcclxuICB9XHJcblxyXG4gIGFwcGx5Q2xhc3NOYW1lVG9GaWVsZHMoKSB7XHJcbiAgICBpZiAodGhpcy5jbGFzc05hbWUgJiYgdGhpcy5maWVsZHMpIHtcclxuICAgICAgdGhpcy5maWVsZHMuZm9yRWFjaChmaWVsZCA9PiB7XHJcbiAgICAgICAgZmllbGQuY2xhc3NOYW1lID0gdGhpcy5jbGFzc05hbWU7XHJcbiAgICAgIH0pO1xyXG4gICAgfVxyXG4gIH1cclxuXHJcbiAgaGFuZGxlU3VibWl0KCkge1xyXG4gICAgaWYgKHRoaXMuZm9ybS52YWxpZCkge1xyXG4gICAgICB0aGlzLm9uU3VibWl0RnVuY3Rpb24oKTtcclxuICAgIH1cclxuICB9XHJcbn1cclxuIl19
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public-api';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybWx5LWZvcm0tdmlld2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2Zvcm1seS1mb3JtLXZpZXdlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpYy1hcGknO1xuIl19
@@ -1,2 +0,0 @@
1
- export * from './app/formly-form-viewer/formly-form-viewer.component';
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsdURBQXVELENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2FwcC9mb3JtbHktZm9ybS12aWV3ZXIvZm9ybWx5LWZvcm0tdmlld2VyLmNvbXBvbmVudCc7XHJcbiJdfQ==