formly-form-viewer 0.0.1 → 0.0.2
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.
|
@@ -2,14 +2,17 @@ import { 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
|
|
5
|
+
export declare class FormlyFormViewerComponent implements OnInit {
|
|
6
6
|
form: FormGroup;
|
|
7
7
|
fields: FormlyFieldConfig[];
|
|
8
8
|
model: any;
|
|
9
9
|
options: FormlyFormOptions;
|
|
10
|
-
|
|
10
|
+
buttonLabel: string;
|
|
11
|
+
className: string;
|
|
12
|
+
onSubmitFunction: () => void;
|
|
11
13
|
ngOnInit(): void;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
static
|
|
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>;
|
|
15
18
|
}
|
|
@@ -9,44 +9,58 @@ import * as i1 from "@angular/common";
|
|
|
9
9
|
import * as i2 from "@angular/forms";
|
|
10
10
|
import * as i3 from "@ngx-formly/core";
|
|
11
11
|
import * as i4 from "@ionic/angular";
|
|
12
|
-
export class
|
|
12
|
+
export class FormlyFormViewerComponent {
|
|
13
13
|
form = new FormGroup({});
|
|
14
14
|
fields = [];
|
|
15
15
|
model = {};
|
|
16
16
|
options = {};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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() {
|
|
20
31
|
if (this.form.valid) {
|
|
21
|
-
|
|
32
|
+
this.onSubmitFunction();
|
|
22
33
|
}
|
|
23
34
|
}
|
|
24
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type:
|
|
25
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.3", type:
|
|
26
|
-
<form [formGroup]="form" (ngSubmit)="
|
|
27
|
-
<formly-form [form]="form" [fields]="fields" [model]="model" [options]="options"
|
|
28
|
-
[ngClass]="customFieldClass">
|
|
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">
|
|
29
39
|
</formly-form>
|
|
30
|
-
<ion-button type="submit">
|
|
40
|
+
<ion-button type="submit" [ngClass]="className">{{ buttonLabel }}</ion-button>
|
|
31
41
|
</form>
|
|
32
|
-
`, isInline: true,
|
|
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"] }] });
|
|
33
43
|
}
|
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type:
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: FormlyFormViewerComponent, decorators: [{
|
|
35
45
|
type: Component,
|
|
36
|
-
args: [{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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">
|
|
40
52
|
</formly-form>
|
|
41
|
-
<ion-button type="submit">
|
|
53
|
+
<ion-button type="submit" [ngClass]="className">{{ buttonLabel }}</ion-button>
|
|
42
54
|
</form>
|
|
43
|
-
`,
|
|
55
|
+
`,
|
|
56
|
+
imports: [
|
|
44
57
|
CommonModule,
|
|
45
58
|
ReactiveFormsModule,
|
|
46
59
|
FormlyModule,
|
|
47
60
|
FormlyIonicModule,
|
|
48
61
|
IonicModule
|
|
49
|
-
]
|
|
62
|
+
]
|
|
63
|
+
}]
|
|
50
64
|
}], propDecorators: { form: [{
|
|
51
65
|
type: Input
|
|
52
66
|
}], fields: [{
|
|
@@ -55,7 +69,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImpor
|
|
|
55
69
|
type: Input
|
|
56
70
|
}], options: [{
|
|
57
71
|
type: Input
|
|
58
|
-
}],
|
|
72
|
+
}], buttonLabel: [{
|
|
73
|
+
type: Input
|
|
74
|
+
}], className: [{
|
|
75
|
+
type: Input
|
|
76
|
+
}], onSubmitFunction: [{
|
|
59
77
|
type: Input
|
|
60
78
|
}] } });
|
|
61
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
79
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybWx5LWZvcm0tdmlld2VyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9hcHAvZm9ybWx5LWZvcm0tdmlld2VyL2Zvcm1seS1mb3JtLXZpZXdlci5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQVUsTUFBTSxlQUFlLENBQUM7QUFDekQsT0FBTyxFQUFFLFNBQVMsRUFBRSxtQkFBbUIsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ2hFLE9BQU8sRUFBd0MsWUFBWSxFQUFFLE1BQ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tbHlGb3JtT3B0aW9ucyA9IHt9O1xyXG4gIEBJbnB1dCgpIGJ1dHRvbkxhYmVsOiBzdHJpbmcgPSAnU3VibWl0JztcclxuICBASW5wdXQoKSBjbGFzc05hbWU6IHN0cmluZyA9ICcnO1xyXG4gIEBJbnB1dCgpIG9uU3VibWl0RnVuY3Rpb246ICgpID0+IHZvaWQgPSAoKSA9PiB7fTtcclxuXHJcbiAgbmdPbkluaXQoKSB7XHJcbiAgICB0aGlzLmFwcGx5Q2xhc3NOYW1lVG9GaWVsZHMoKTtcclxuICB9XHJcblxyXG4gIGFwcGx5Q2xhc3NOYW1lVG9GaWVsZHMoKSB7XHJcbiAgICBpZiAodGhpcy5jbGFzc05hbWUgJiYgdGhpcy5maWVsZHMpIHtcclxuICAgICAgdGhpcy5maWVsZHMuZm9yRWFjaChmaWVsZCA9PiB7XHJcbiAgICAgICAgZmllbGQuY2xhc3NOYW1lID0gdGhpcy5jbGFzc05hbWU7XHJcbiAgICAgIH0pO1xyXG4gICAgfVxyXG4gIH1cclxuXHJcbiAgaGFuZGxlU3VibWl0KCkge1xyXG4gICAgaWYgKHRoaXMuZm9ybS52YWxpZCkge1xyXG4gICAgICB0aGlzLm9uU3VibWl0RnVuY3Rpb24oKTtcclxuICAgIH1cclxuICB9XHJcbn1cclxuIl19
|
|
@@ -10,44 +10,58 @@ import { IonicModule } from '@ionic/angular';
|
|
|
10
10
|
import * as i1 from '@angular/common';
|
|
11
11
|
import { CommonModule } from '@angular/common';
|
|
12
12
|
|
|
13
|
-
class
|
|
13
|
+
class FormlyFormViewerComponent {
|
|
14
14
|
form = new FormGroup({});
|
|
15
15
|
fields = [];
|
|
16
16
|
model = {};
|
|
17
17
|
options = {};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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() {
|
|
21
32
|
if (this.form.valid) {
|
|
22
|
-
|
|
33
|
+
this.onSubmitFunction();
|
|
23
34
|
}
|
|
24
35
|
}
|
|
25
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type:
|
|
26
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.3", type:
|
|
27
|
-
<form [formGroup]="form" (ngSubmit)="
|
|
28
|
-
<formly-form [form]="form" [fields]="fields" [model]="model" [options]="options"
|
|
29
|
-
[ngClass]="customFieldClass">
|
|
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">
|
|
30
40
|
</formly-form>
|
|
31
|
-
<ion-button type="submit">
|
|
41
|
+
<ion-button type="submit" [ngClass]="className">{{ buttonLabel }}</ion-button>
|
|
32
42
|
</form>
|
|
33
|
-
`, isInline: true,
|
|
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"] }] });
|
|
34
44
|
}
|
|
35
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type:
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImport: i0, type: FormlyFormViewerComponent, decorators: [{
|
|
36
46
|
type: Component,
|
|
37
|
-
args: [{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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">
|
|
41
53
|
</formly-form>
|
|
42
|
-
<ion-button type="submit">
|
|
54
|
+
<ion-button type="submit" [ngClass]="className">{{ buttonLabel }}</ion-button>
|
|
43
55
|
</form>
|
|
44
|
-
`,
|
|
56
|
+
`,
|
|
57
|
+
imports: [
|
|
45
58
|
CommonModule,
|
|
46
59
|
ReactiveFormsModule,
|
|
47
60
|
FormlyModule,
|
|
48
61
|
FormlyIonicModule,
|
|
49
62
|
IonicModule
|
|
50
|
-
]
|
|
63
|
+
]
|
|
64
|
+
}]
|
|
51
65
|
}], propDecorators: { form: [{
|
|
52
66
|
type: Input
|
|
53
67
|
}], fields: [{
|
|
@@ -56,7 +70,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImpor
|
|
|
56
70
|
type: Input
|
|
57
71
|
}], options: [{
|
|
58
72
|
type: Input
|
|
59
|
-
}],
|
|
73
|
+
}], buttonLabel: [{
|
|
74
|
+
type: Input
|
|
75
|
+
}], className: [{
|
|
76
|
+
type: Input
|
|
77
|
+
}], onSubmitFunction: [{
|
|
60
78
|
type: Input
|
|
61
79
|
}] } });
|
|
62
80
|
|
|
@@ -64,5 +82,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.3", ngImpor
|
|
|
64
82
|
* Generated bundle index. Do not edit.
|
|
65
83
|
*/
|
|
66
84
|
|
|
67
|
-
export {
|
|
85
|
+
export { FormlyFormViewerComponent };
|
|
68
86
|
//# 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)=\"
|
|
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,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AAA,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;;;;"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "formly-form-viewer",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"author": "
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"author": "Juan Jose Arroyo Rivera",
|
|
5
|
+
"description": "Ionic 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/animations": "^18.0.0",
|
|
12
11
|
"@angular/common": "^18.0.0",
|
|
13
12
|
"@angular/compiler": "^18.0.0",
|
|
14
13
|
"@angular/core": "^18.0.0",
|
|
@@ -23,7 +22,6 @@
|
|
|
23
22
|
"rxjs": "~7.8.0",
|
|
24
23
|
"zone.js": "~0.14.2"
|
|
25
24
|
},
|
|
26
|
-
"description": "An Ionic project",
|
|
27
25
|
"module": "fesm2022/formly-form-viewer.mjs",
|
|
28
26
|
"typings": "index.d.ts",
|
|
29
27
|
"exports": {
|