@fieldia/angular 0.1.0
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/LICENSE +21 -0
- package/README.md +30 -0
- package/package.json +37 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/index.js.map +1 -0
- package/src/lib/fieldia-form.component.d.ts +72 -0
- package/src/lib/fieldia-form.component.js +160 -0
- package/src/lib/fieldia-form.component.js.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 fieldia-dev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @fieldia/angular
|
|
2
|
+
|
|
3
|
+
[Fieldia](https://fieldia.dev) forms in Angular 21 and 22: a standalone component
|
|
4
|
+
over `@fieldia/viewer`, so a page looks and behaves the same as in any other
|
|
5
|
+
framework.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @fieldia/angular
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { Component } from '@angular/core';
|
|
13
|
+
import { FieldiaFormComponent } from '@fieldia/angular';
|
|
14
|
+
import { createMemoryDataSource } from '@fieldia/core';
|
|
15
|
+
import page from './customer.page.json';
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
selector: 'app-customer',
|
|
19
|
+
imports: [FieldiaFormComponent],
|
|
20
|
+
template: `<fieldia-form [page]="page" [dataSource]="dataSource" [recordId]="1" skin="underline" />`,
|
|
21
|
+
})
|
|
22
|
+
export class CustomerComponent {
|
|
23
|
+
readonly page = page;
|
|
24
|
+
readonly dataSource = createMemoryDataSource();
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Custom fields can be Angular components (`fieldTypes`), slot content goes in
|
|
29
|
+
`<ng-template fieldiaSlot="name">`, and `formState(form)` gives you a form's state
|
|
30
|
+
as a signal. MIT licensed.
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fieldia/angular",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Angular binding for Fieldia: <fieldia-form> over the plain-DOM viewer, with custom fields as Angular components and slots as ng-templates.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://fieldia.dev",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"module": "./src/index.js",
|
|
9
|
+
"types": "./src/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./src/index.d.ts",
|
|
13
|
+
"default": "./src/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@fieldia/core": "0.1.0",
|
|
19
|
+
"@fieldia/viewer": "0.1.0",
|
|
20
|
+
"@fieldia/widgets": "0.1.0",
|
|
21
|
+
"tslib": "^2.8.1"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"@angular/core": "^21.0.0 || ^22.0.0"
|
|
25
|
+
},
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/fieldia-dev/fieldia",
|
|
30
|
+
"directory": "libs/angular"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"src",
|
|
34
|
+
"README.md",
|
|
35
|
+
"LICENSE"
|
|
36
|
+
]
|
|
37
|
+
}
|
package/src/index.d.ts
ADDED
package/src/index.js
ADDED
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/angular/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,SAAS,EAA2B,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { DestroyRef, TemplateRef, type OnDestroy, type Signal, type Type } from '@angular/core';
|
|
2
|
+
import type { ActionRequest, DataSource, DraftStore, Form, FormState, Locale, Page, RecordId, Scheduler, Values } from '@fieldia/core';
|
|
3
|
+
import { type Skin, type ViewerHandle, type ViewerLabels } from '@fieldia/viewer';
|
|
4
|
+
import type { WidgetFactory } from '@fieldia/widgets';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* `<fieldia-form>` — the Angular shell. Thin like the React and Vue ones:
|
|
8
|
+
* `mountViewer` makes every decision. This component mounts into its own host
|
|
9
|
+
* element, forwards inputs without mounting again where it can, renders custom
|
|
10
|
+
* fields (Angular components) and slots (`<ng-template fieldiaSlot>`) into the
|
|
11
|
+
* viewer's elements, and tears down.
|
|
12
|
+
*
|
|
13
|
+
* Compiled with ngc in partial mode, the format Angular libraries ship in.
|
|
14
|
+
*/
|
|
15
|
+
export interface FieldiaSlotContext {
|
|
16
|
+
$implicit: Form;
|
|
17
|
+
form: Form;
|
|
18
|
+
name: string;
|
|
19
|
+
}
|
|
20
|
+
/** Slot content: `<ng-template fieldiaSlot="chatter" let-form>…</ng-template>`. */
|
|
21
|
+
export declare class FieldiaSlotDirective {
|
|
22
|
+
readonly name: import("@angular/core").InputSignal<string>;
|
|
23
|
+
readonly template: TemplateRef<FieldiaSlotContext>;
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FieldiaSlotDirective, never>;
|
|
25
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FieldiaSlotDirective, "ng-template[fieldiaSlot]", never, { "name": { "alias": "fieldiaSlot"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A form's state as a signal. It stops listening when `destroyRef` (or, when
|
|
29
|
+
* left out, the current injection context) is destroyed. Pass the DestroyRef
|
|
30
|
+
* when calling from `ngOnInit`, where the `form` input first has its value.
|
|
31
|
+
*/
|
|
32
|
+
export declare function formState(form: Form, destroyRef?: DestroyRef): Signal<FormState>;
|
|
33
|
+
export declare class FieldiaFormComponent implements OnDestroy {
|
|
34
|
+
readonly page: import("@angular/core").InputSignal<Page>;
|
|
35
|
+
readonly form: import("@angular/core").InputSignal<Form | undefined>;
|
|
36
|
+
readonly dataSource: import("@angular/core").InputSignal<DataSource | undefined>;
|
|
37
|
+
readonly recordId: import("@angular/core").InputSignal<RecordId | null>;
|
|
38
|
+
readonly values: import("@angular/core").InputSignal<Values | undefined>;
|
|
39
|
+
readonly skin: import("@angular/core").InputSignal<Skin>;
|
|
40
|
+
readonly dir: import("@angular/core").InputSignal<"ltr" | "rtl" | undefined>;
|
|
41
|
+
readonly locale: import("@angular/core").InputSignal<Locale | undefined>;
|
|
42
|
+
readonly labels: import("@angular/core").InputSignal<Partial<ViewerLabels> | undefined>;
|
|
43
|
+
readonly widgets: import("@angular/core").InputSignal<Record<string, WidgetFactory> | undefined>;
|
|
44
|
+
/** Custom fields as Angular components, by `type.widget` or `type`. They receive the inputs they declare. */
|
|
45
|
+
readonly fieldTypes: import("@angular/core").InputSignal<Record<string, Type<unknown>> | undefined>;
|
|
46
|
+
readonly drafts: import("@angular/core").InputSignal<{
|
|
47
|
+
store: DraftStore;
|
|
48
|
+
restore?: "auto" | "ask";
|
|
49
|
+
delayMs?: number;
|
|
50
|
+
} | undefined>;
|
|
51
|
+
readonly autosave: import("@angular/core").InputSignal<{
|
|
52
|
+
delayMs: number;
|
|
53
|
+
} | undefined>;
|
|
54
|
+
readonly scheduler: import("@angular/core").InputSignal<Scheduler | undefined>;
|
|
55
|
+
readonly confirm: import("@angular/core").InputSignal<((message: string) => Promise<boolean>) | undefined>;
|
|
56
|
+
readonly ready: import("@angular/core").OutputEmitterRef<ViewerHandle>;
|
|
57
|
+
readonly action: import("@angular/core").OutputEmitterRef<ActionRequest>;
|
|
58
|
+
private readonly slotTemplates;
|
|
59
|
+
private readonly host;
|
|
60
|
+
private readonly views;
|
|
61
|
+
private readonly app;
|
|
62
|
+
private readonly injector;
|
|
63
|
+
private handle;
|
|
64
|
+
private components;
|
|
65
|
+
private embedded;
|
|
66
|
+
constructor();
|
|
67
|
+
ngOnDestroy(): void;
|
|
68
|
+
private mount;
|
|
69
|
+
private unmount;
|
|
70
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FieldiaFormComponent, never>;
|
|
71
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FieldiaFormComponent, "fieldia-form", never, { "page": { "alias": "page"; "required": true; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "dataSource": { "alias": "dataSource"; "required": false; "isSignal": true; }; "recordId": { "alias": "recordId"; "required": false; "isSignal": true; }; "values": { "alias": "values"; "required": false; "isSignal": true; }; "skin": { "alias": "skin"; "required": false; "isSignal": true; }; "dir": { "alias": "dir"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; "widgets": { "alias": "widgets"; "required": false; "isSignal": true; }; "fieldTypes": { "alias": "fieldTypes"; "required": false; "isSignal": true; }; "drafts": { "alias": "drafts"; "required": false; "isSignal": true; }; "autosave": { "alias": "autosave"; "required": false; "isSignal": true; }; "scheduler": { "alias": "scheduler"; "required": false; "isSignal": true; }; "confirm": { "alias": "confirm"; "required": false; "isSignal": true; }; }, { "ready": "ready"; "action": "action"; }, ["slotTemplates"], never, true, never>;
|
|
72
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { ApplicationRef, ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, EnvironmentInjector, TemplateRef, ViewContainerRef, contentChildren, createComponent, effect, inject, input, output, reflectComponentType, signal, untracked, } from '@angular/core';
|
|
2
|
+
import { mountViewer } from '@fieldia/viewer';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/** Slot content: `<ng-template fieldiaSlot="chatter" let-form>…</ng-template>`. */
|
|
5
|
+
export class FieldiaSlotDirective {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.name = input.required({ ...(ngDevMode ? { debugName: "name" } : /* istanbul ignore next */ {}), alias: 'fieldiaSlot' });
|
|
8
|
+
this.template = inject(TemplateRef);
|
|
9
|
+
}
|
|
10
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FieldiaSlotDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
11
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.25", type: FieldiaSlotDirective, isStandalone: true, selector: "ng-template[fieldiaSlot]", inputs: { name: { classPropertyName: "name", publicName: "fieldiaSlot", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
|
|
12
|
+
}
|
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FieldiaSlotDirective, decorators: [{
|
|
14
|
+
type: Directive,
|
|
15
|
+
args: [{ selector: 'ng-template[fieldiaSlot]' }]
|
|
16
|
+
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldiaSlot", required: true }] }] } });
|
|
17
|
+
/**
|
|
18
|
+
* A form's state as a signal. It stops listening when `destroyRef` (or, when
|
|
19
|
+
* left out, the current injection context) is destroyed. Pass the DestroyRef
|
|
20
|
+
* when calling from `ngOnInit`, where the `form` input first has its value.
|
|
21
|
+
*/
|
|
22
|
+
export function formState(form, destroyRef = inject(DestroyRef)) {
|
|
23
|
+
const state = signal(form.getState(), ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
24
|
+
const leave = form.subscribe((next) => state.set(next));
|
|
25
|
+
destroyRef.onDestroy(leave);
|
|
26
|
+
return state.asReadonly();
|
|
27
|
+
}
|
|
28
|
+
const DYNAMIC_INPUTS = ['value', 'values', 'readonly', 'required', 'invalid', 'describedBy'];
|
|
29
|
+
export class FieldiaFormComponent {
|
|
30
|
+
constructor() {
|
|
31
|
+
this.page = input.required(...(ngDevMode ? [{ debugName: "page" }] : /* istanbul ignore next */ []));
|
|
32
|
+
this.form = input(undefined, ...(ngDevMode ? [{ debugName: "form" }] : /* istanbul ignore next */ []));
|
|
33
|
+
this.dataSource = input(undefined, ...(ngDevMode ? [{ debugName: "dataSource" }] : /* istanbul ignore next */ []));
|
|
34
|
+
this.recordId = input(null, ...(ngDevMode ? [{ debugName: "recordId" }] : /* istanbul ignore next */ []));
|
|
35
|
+
this.values = input(undefined, ...(ngDevMode ? [{ debugName: "values" }] : /* istanbul ignore next */ []));
|
|
36
|
+
this.skin = input('underline', ...(ngDevMode ? [{ debugName: "skin" }] : /* istanbul ignore next */ []));
|
|
37
|
+
this.dir = input(undefined, ...(ngDevMode ? [{ debugName: "dir" }] : /* istanbul ignore next */ []));
|
|
38
|
+
this.locale = input(undefined, ...(ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []));
|
|
39
|
+
this.labels = input(undefined, ...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
|
|
40
|
+
this.widgets = input(undefined, ...(ngDevMode ? [{ debugName: "widgets" }] : /* istanbul ignore next */ []));
|
|
41
|
+
/** Custom fields as Angular components, by `type.widget` or `type`. They receive the inputs they declare. */
|
|
42
|
+
this.fieldTypes = input(undefined, ...(ngDevMode ? [{ debugName: "fieldTypes" }] : /* istanbul ignore next */ []));
|
|
43
|
+
this.drafts = input(undefined, ...(ngDevMode ? [{ debugName: "drafts" }] : /* istanbul ignore next */ []));
|
|
44
|
+
this.autosave = input(undefined, ...(ngDevMode ? [{ debugName: "autosave" }] : /* istanbul ignore next */ []));
|
|
45
|
+
this.scheduler = input(undefined, ...(ngDevMode ? [{ debugName: "scheduler" }] : /* istanbul ignore next */ []));
|
|
46
|
+
this.confirm = input(undefined, ...(ngDevMode ? [{ debugName: "confirm" }] : /* istanbul ignore next */ []));
|
|
47
|
+
this.ready = output();
|
|
48
|
+
this.action = output();
|
|
49
|
+
this.slotTemplates = contentChildren(FieldiaSlotDirective, ...(ngDevMode ? [{ debugName: "slotTemplates" }] : /* istanbul ignore next */ []));
|
|
50
|
+
this.host = inject(ElementRef);
|
|
51
|
+
this.views = inject(ViewContainerRef);
|
|
52
|
+
this.app = inject(ApplicationRef);
|
|
53
|
+
this.injector = inject(EnvironmentInjector);
|
|
54
|
+
this.handle = null;
|
|
55
|
+
this.components = [];
|
|
56
|
+
this.embedded = [];
|
|
57
|
+
// Mount again only when what the record is changes; the skin is forwarded.
|
|
58
|
+
effect(() => {
|
|
59
|
+
const options = {
|
|
60
|
+
page: this.page(),
|
|
61
|
+
form: this.form(),
|
|
62
|
+
dataSource: this.dataSource(),
|
|
63
|
+
recordId: this.recordId(),
|
|
64
|
+
dir: this.dir(),
|
|
65
|
+
locale: this.locale(),
|
|
66
|
+
labels: this.labels(),
|
|
67
|
+
fieldTypes: this.fieldTypes(),
|
|
68
|
+
slotNames: this.slotTemplates().map((slot) => slot.name()).join('|'),
|
|
69
|
+
};
|
|
70
|
+
untracked(() => this.mount(options));
|
|
71
|
+
});
|
|
72
|
+
effect(() => {
|
|
73
|
+
const skin = this.skin();
|
|
74
|
+
untracked(() => this.handle?.setSkin(skin));
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
ngOnDestroy() {
|
|
78
|
+
this.unmount();
|
|
79
|
+
}
|
|
80
|
+
mount(options) {
|
|
81
|
+
this.unmount();
|
|
82
|
+
const widgets = { ...this.widgets() };
|
|
83
|
+
for (const [key, type] of Object.entries(options.fieldTypes ?? {})) {
|
|
84
|
+
const declared = new Set((reflectComponentType(type)?.inputs ?? []).map((i) => i.templateName));
|
|
85
|
+
const set = (ref, name, value) => {
|
|
86
|
+
if (declared.has(name))
|
|
87
|
+
ref.setInput(name, value);
|
|
88
|
+
};
|
|
89
|
+
widgets[key] = (context) => {
|
|
90
|
+
const box = context.document.createElement('div');
|
|
91
|
+
box.className = 'fd-custom';
|
|
92
|
+
const ref = createComponent(type, { environmentInjector: this.injector, hostElement: box });
|
|
93
|
+
this.app.attachView(ref.hostView);
|
|
94
|
+
this.components.push(ref);
|
|
95
|
+
set(ref, 'name', context.name);
|
|
96
|
+
set(ref, 'field', context.field);
|
|
97
|
+
set(ref, 'node', context.node);
|
|
98
|
+
set(ref, 'id', context.id);
|
|
99
|
+
set(ref, 'form', context.form);
|
|
100
|
+
set(ref, 'onChange', (value) => context.form.setValue(context.name, value));
|
|
101
|
+
return {
|
|
102
|
+
element: box,
|
|
103
|
+
update: (state) => {
|
|
104
|
+
for (const name of DYNAMIC_INPUTS)
|
|
105
|
+
set(ref, name, state[name]);
|
|
106
|
+
},
|
|
107
|
+
focus: () => box.querySelector('input, select, textarea, button, [tabindex]')?.focus(),
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const slots = {};
|
|
112
|
+
for (const slot of this.slotTemplates()) {
|
|
113
|
+
slots[slot.name()] = (box, context) => {
|
|
114
|
+
const view = this.views.createEmbeddedView(slot.template, { $implicit: context.form, form: context.form, name: context.name });
|
|
115
|
+
for (const node of view.rootNodes)
|
|
116
|
+
box.append(node);
|
|
117
|
+
view.detectChanges();
|
|
118
|
+
this.embedded.push(view);
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
this.handle = mountViewer(this.host.nativeElement, {
|
|
122
|
+
page: options.page,
|
|
123
|
+
form: options.form,
|
|
124
|
+
dataSource: options.dataSource,
|
|
125
|
+
recordId: options.recordId,
|
|
126
|
+
values: this.values(),
|
|
127
|
+
skin: this.skin(),
|
|
128
|
+
dir: options.dir,
|
|
129
|
+
locale: options.locale,
|
|
130
|
+
labels: options.labels,
|
|
131
|
+
widgets,
|
|
132
|
+
slots,
|
|
133
|
+
drafts: this.drafts(),
|
|
134
|
+
autosave: this.autosave(),
|
|
135
|
+
scheduler: this.scheduler(),
|
|
136
|
+
confirm: this.confirm(),
|
|
137
|
+
onAction: (request) => this.action.emit(request),
|
|
138
|
+
});
|
|
139
|
+
this.ready.emit(this.handle);
|
|
140
|
+
}
|
|
141
|
+
unmount() {
|
|
142
|
+
this.handle?.destroy();
|
|
143
|
+
this.handle = null;
|
|
144
|
+
for (const view of this.embedded)
|
|
145
|
+
view.destroy();
|
|
146
|
+
for (const ref of this.components) {
|
|
147
|
+
this.app.detachView(ref.hostView);
|
|
148
|
+
ref.destroy();
|
|
149
|
+
}
|
|
150
|
+
this.embedded = [];
|
|
151
|
+
this.components = [];
|
|
152
|
+
}
|
|
153
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FieldiaFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
154
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.25", type: FieldiaFormComponent, isStandalone: true, selector: "fieldia-form", inputs: { page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: true, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, dataSource: { classPropertyName: "dataSource", publicName: "dataSource", isSignal: true, isRequired: false, transformFunction: null }, recordId: { classPropertyName: "recordId", publicName: "recordId", isSignal: true, isRequired: false, transformFunction: null }, values: { classPropertyName: "values", publicName: "values", isSignal: true, isRequired: false, transformFunction: null }, skin: { classPropertyName: "skin", publicName: "skin", isSignal: true, isRequired: false, transformFunction: null }, dir: { classPropertyName: "dir", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, widgets: { classPropertyName: "widgets", publicName: "widgets", isSignal: true, isRequired: false, transformFunction: null }, fieldTypes: { classPropertyName: "fieldTypes", publicName: "fieldTypes", isSignal: true, isRequired: false, transformFunction: null }, drafts: { classPropertyName: "drafts", publicName: "drafts", isSignal: true, isRequired: false, transformFunction: null }, autosave: { classPropertyName: "autosave", publicName: "autosave", isSignal: true, isRequired: false, transformFunction: null }, scheduler: { classPropertyName: "scheduler", publicName: "scheduler", isSignal: true, isRequired: false, transformFunction: null }, confirm: { classPropertyName: "confirm", publicName: "confirm", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ready: "ready", action: "action" }, queries: [{ propertyName: "slotTemplates", predicate: FieldiaSlotDirective, isSignal: true }], ngImport: i0, template: '', isInline: true, styles: [":host { display: block; }"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
155
|
+
}
|
|
156
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FieldiaFormComponent, decorators: [{
|
|
157
|
+
type: Component,
|
|
158
|
+
args: [{ selector: 'fieldia-form', template: '', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host { display: block; }"] }]
|
|
159
|
+
}], ctorParameters: () => [], propDecorators: { page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: true }] }], form: [{ type: i0.Input, args: [{ isSignal: true, alias: "form", required: false }] }], dataSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataSource", required: false }] }], recordId: [{ type: i0.Input, args: [{ isSignal: true, alias: "recordId", required: false }] }], values: [{ type: i0.Input, args: [{ isSignal: true, alias: "values", required: false }] }], skin: [{ type: i0.Input, args: [{ isSignal: true, alias: "skin", required: false }] }], dir: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], widgets: [{ type: i0.Input, args: [{ isSignal: true, alias: "widgets", required: false }] }], fieldTypes: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldTypes", required: false }] }], drafts: [{ type: i0.Input, args: [{ isSignal: true, alias: "drafts", required: false }] }], autosave: [{ type: i0.Input, args: [{ isSignal: true, alias: "autosave", required: false }] }], scheduler: [{ type: i0.Input, args: [{ isSignal: true, alias: "scheduler", required: false }] }], confirm: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirm", required: false }] }], ready: [{ type: i0.Output, args: ["ready"] }], action: [{ type: i0.Output, args: ["action"] }], slotTemplates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => FieldiaSlotDirective), { isSignal: true }] }] } });
|
|
160
|
+
//# sourceMappingURL=fieldia-form.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldia-form.component.js","sourceRoot":"","sources":["../../../../../libs/angular/src/lib/fieldia-form.component.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