@fieldia/vue 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 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,25 @@
1
+ # @fieldia/vue
2
+
3
+ [Fieldia](https://fieldia.dev) forms in Vue 3: a thin shell over
4
+ `@fieldia/viewer`, so a page looks and behaves the same as in any other framework.
5
+
6
+ ```sh
7
+ npm install @fieldia/vue
8
+ ```
9
+
10
+ ```vue
11
+ <script setup lang="ts">
12
+ import { FieldiaForm } from '@fieldia/vue';
13
+ import { createMemoryDataSource } from '@fieldia/core';
14
+ import page from './customer.page.json';
15
+
16
+ const dataSource = createMemoryDataSource();
17
+ </script>
18
+
19
+ <template>
20
+ <FieldiaForm :page="page" :data-source="dataSource" :record-id="1" skin="underline" />
21
+ </template>
22
+ ```
23
+
24
+ Custom fields can be Vue components (`fieldTypes`), slot content goes in named
25
+ slots, and `useFormState(form)` gives you a form's state as a ref. MIT licensed.
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@fieldia/vue",
3
+ "version": "0.1.0",
4
+ "description": "Vue binding for Fieldia: <FieldiaForm> over the plain-DOM viewer, with custom fields as Vue components and slots as Vue slots.",
5
+ "license": "MIT",
6
+ "homepage": "https://fieldia.dev",
7
+ "type": "commonjs",
8
+ "main": "./src/index.js",
9
+ "module": "./src/index.mjs",
10
+ "types": "./src/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": {
14
+ "import": "./src/index.d.mts",
15
+ "require": "./src/index.d.ts"
16
+ },
17
+ "import": "./src/index.mjs",
18
+ "require": "./src/index.js",
19
+ "default": "./src/index.js"
20
+ },
21
+ "./package.json": "./package.json"
22
+ },
23
+ "dependencies": {
24
+ "@fieldia/core": "0.1.0",
25
+ "@fieldia/viewer": "0.1.0",
26
+ "@fieldia/widgets": "0.1.0",
27
+ "tslib": "^2.8.1"
28
+ },
29
+ "sideEffects": false,
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/fieldia-dev/fieldia",
33
+ "directory": "libs/vue"
34
+ },
35
+ "files": [
36
+ "src",
37
+ "README.md",
38
+ "LICENSE"
39
+ ],
40
+ "peerDependencies": {
41
+ "vue": "^3.3.0"
42
+ }
43
+ }
@@ -0,0 +1,2 @@
1
+ export { FieldiaForm, useFormState, type FieldComponentProps } from './lib/fieldia-form.mjs';
2
+ export type { Skin, ViewerHandle, ViewerLabels } from '@fieldia/viewer';
package/src/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { FieldiaForm, useFormState, type FieldComponentProps } from './lib/fieldia-form';
2
+ export type { Skin, ViewerHandle, ViewerLabels } from '@fieldia/viewer';
package/src/index.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useFormState = exports.FieldiaForm = void 0;
4
+ var fieldia_form_1 = require("./lib/fieldia-form");
5
+ Object.defineProperty(exports, "FieldiaForm", { enumerable: true, get: function () { return fieldia_form_1.FieldiaForm; } });
6
+ Object.defineProperty(exports, "useFormState", { enumerable: true, get: function () { return fieldia_form_1.useFormState; } });
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/vue/src/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyF;AAAhF,2GAAA,WAAW,OAAA;AAAE,4GAAA,YAAY,OAAA"}
package/src/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ export { FieldiaForm, useFormState } from './lib/fieldia-form.mjs';
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../libs/vue/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAA4B,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,189 @@
1
+ import type { ActionRequest, DataSource, DraftStore, Field, FieldNode, Form, FormState, Locale, Page, RecordId, Scheduler, Value, Values } from '@fieldia/core';
2
+ import { type Skin, type ViewerHandle, type ViewerLabels } from '@fieldia/viewer';
3
+ import type { WidgetFactory, WidgetState } from '@fieldia/widgets';
4
+ import { type Component, type PropType, type ShallowRef } from 'vue';
5
+ /**
6
+ * `<FieldiaForm>` — the Vue shell. Thin in the same way as the React one:
7
+ * `mountViewer` makes every decision; this component owns an element Vue
8
+ * never renders into, prop changes forwarded without mounting again, custom
9
+ * fields and slots rendered into the viewer through `<Teleport>`, and teardown.
10
+ *
11
+ * Custom fields come in as Vue components (`fieldTypes`); slot content comes
12
+ * in as Vue named slots: `<template #chatter="{ form }">…</template>`.
13
+ */
14
+ /** What a custom field component receives. Call `onChange` to write the value. */
15
+ export interface FieldComponentProps extends Omit<WidgetState, 'value'> {
16
+ value: Value | undefined;
17
+ name: string;
18
+ field: Field;
19
+ node: FieldNode;
20
+ id: string;
21
+ form: Form;
22
+ onChange(value: Value): void;
23
+ }
24
+ /** A form's state as a Vue ref, current on every change. */
25
+ export declare function useFormState(form: Form): ShallowRef<FormState>;
26
+ export declare const FieldiaForm: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
27
+ page: {
28
+ type: PropType<Page>;
29
+ required: true;
30
+ };
31
+ form: {
32
+ type: PropType<Form>;
33
+ default: undefined;
34
+ };
35
+ dataSource: {
36
+ type: PropType<DataSource>;
37
+ default: undefined;
38
+ };
39
+ recordId: {
40
+ type: PropType<RecordId | null>;
41
+ default: null;
42
+ };
43
+ values: {
44
+ type: PropType<Values>;
45
+ default: undefined;
46
+ };
47
+ skin: {
48
+ type: PropType<Skin>;
49
+ default: string;
50
+ };
51
+ dir: {
52
+ type: PropType<"ltr" | "rtl">;
53
+ default: undefined;
54
+ };
55
+ locale: {
56
+ type: PropType<Locale>;
57
+ default: undefined;
58
+ };
59
+ labels: {
60
+ type: PropType<Partial<ViewerLabels>>;
61
+ default: undefined;
62
+ };
63
+ widgets: {
64
+ type: PropType<Record<string, WidgetFactory>>;
65
+ default: undefined;
66
+ };
67
+ fieldTypes: {
68
+ type: PropType<Record<string, Component>>;
69
+ default: undefined;
70
+ };
71
+ drafts: {
72
+ type: PropType<{
73
+ store: DraftStore;
74
+ restore?: "auto" | "ask";
75
+ delayMs?: number;
76
+ }>;
77
+ default: undefined;
78
+ };
79
+ autosave: {
80
+ type: PropType<{
81
+ delayMs: number;
82
+ }>;
83
+ default: undefined;
84
+ };
85
+ scheduler: {
86
+ type: PropType<Scheduler>;
87
+ default: undefined;
88
+ };
89
+ confirm: {
90
+ type: PropType<(message: string) => Promise<boolean>>;
91
+ default: undefined;
92
+ };
93
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
94
+ [key: string]: any;
95
+ }>[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
96
+ ready: (_handle: ViewerHandle) => true;
97
+ action: (_request: ActionRequest) => true;
98
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
99
+ page: {
100
+ type: PropType<Page>;
101
+ required: true;
102
+ };
103
+ form: {
104
+ type: PropType<Form>;
105
+ default: undefined;
106
+ };
107
+ dataSource: {
108
+ type: PropType<DataSource>;
109
+ default: undefined;
110
+ };
111
+ recordId: {
112
+ type: PropType<RecordId | null>;
113
+ default: null;
114
+ };
115
+ values: {
116
+ type: PropType<Values>;
117
+ default: undefined;
118
+ };
119
+ skin: {
120
+ type: PropType<Skin>;
121
+ default: string;
122
+ };
123
+ dir: {
124
+ type: PropType<"ltr" | "rtl">;
125
+ default: undefined;
126
+ };
127
+ locale: {
128
+ type: PropType<Locale>;
129
+ default: undefined;
130
+ };
131
+ labels: {
132
+ type: PropType<Partial<ViewerLabels>>;
133
+ default: undefined;
134
+ };
135
+ widgets: {
136
+ type: PropType<Record<string, WidgetFactory>>;
137
+ default: undefined;
138
+ };
139
+ fieldTypes: {
140
+ type: PropType<Record<string, Component>>;
141
+ default: undefined;
142
+ };
143
+ drafts: {
144
+ type: PropType<{
145
+ store: DraftStore;
146
+ restore?: "auto" | "ask";
147
+ delayMs?: number;
148
+ }>;
149
+ default: undefined;
150
+ };
151
+ autosave: {
152
+ type: PropType<{
153
+ delayMs: number;
154
+ }>;
155
+ default: undefined;
156
+ };
157
+ scheduler: {
158
+ type: PropType<Scheduler>;
159
+ default: undefined;
160
+ };
161
+ confirm: {
162
+ type: PropType<(message: string) => Promise<boolean>>;
163
+ default: undefined;
164
+ };
165
+ }>> & Readonly<{
166
+ onReady?: ((_handle: ViewerHandle) => any) | undefined;
167
+ onAction?: ((_request: ActionRequest) => any) | undefined;
168
+ }>, {
169
+ values: Values;
170
+ form: Form;
171
+ dataSource: DataSource;
172
+ recordId: RecordId | null;
173
+ skin: Skin;
174
+ dir: "ltr" | "rtl";
175
+ locale: Locale;
176
+ labels: Partial<ViewerLabels>;
177
+ widgets: Record<string, WidgetFactory>;
178
+ fieldTypes: Record<string, Component>;
179
+ drafts: {
180
+ store: DraftStore;
181
+ restore?: "auto" | "ask";
182
+ delayMs?: number;
183
+ };
184
+ autosave: {
185
+ delayMs: number;
186
+ };
187
+ scheduler: Scheduler;
188
+ confirm: (message: string) => Promise<boolean>;
189
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,189 @@
1
+ import type { ActionRequest, DataSource, DraftStore, Field, FieldNode, Form, FormState, Locale, Page, RecordId, Scheduler, Value, Values } from '@fieldia/core';
2
+ import { type Skin, type ViewerHandle, type ViewerLabels } from '@fieldia/viewer';
3
+ import type { WidgetFactory, WidgetState } from '@fieldia/widgets';
4
+ import { type Component, type PropType, type ShallowRef } from 'vue';
5
+ /**
6
+ * `<FieldiaForm>` — the Vue shell. Thin in the same way as the React one:
7
+ * `mountViewer` makes every decision; this component owns an element Vue
8
+ * never renders into, prop changes forwarded without mounting again, custom
9
+ * fields and slots rendered into the viewer through `<Teleport>`, and teardown.
10
+ *
11
+ * Custom fields come in as Vue components (`fieldTypes`); slot content comes
12
+ * in as Vue named slots: `<template #chatter="{ form }">…</template>`.
13
+ */
14
+ /** What a custom field component receives. Call `onChange` to write the value. */
15
+ export interface FieldComponentProps extends Omit<WidgetState, 'value'> {
16
+ value: Value | undefined;
17
+ name: string;
18
+ field: Field;
19
+ node: FieldNode;
20
+ id: string;
21
+ form: Form;
22
+ onChange(value: Value): void;
23
+ }
24
+ /** A form's state as a Vue ref, current on every change. */
25
+ export declare function useFormState(form: Form): ShallowRef<FormState>;
26
+ export declare const FieldiaForm: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
27
+ page: {
28
+ type: PropType<Page>;
29
+ required: true;
30
+ };
31
+ form: {
32
+ type: PropType<Form>;
33
+ default: undefined;
34
+ };
35
+ dataSource: {
36
+ type: PropType<DataSource>;
37
+ default: undefined;
38
+ };
39
+ recordId: {
40
+ type: PropType<RecordId | null>;
41
+ default: null;
42
+ };
43
+ values: {
44
+ type: PropType<Values>;
45
+ default: undefined;
46
+ };
47
+ skin: {
48
+ type: PropType<Skin>;
49
+ default: string;
50
+ };
51
+ dir: {
52
+ type: PropType<"ltr" | "rtl">;
53
+ default: undefined;
54
+ };
55
+ locale: {
56
+ type: PropType<Locale>;
57
+ default: undefined;
58
+ };
59
+ labels: {
60
+ type: PropType<Partial<ViewerLabels>>;
61
+ default: undefined;
62
+ };
63
+ widgets: {
64
+ type: PropType<Record<string, WidgetFactory>>;
65
+ default: undefined;
66
+ };
67
+ fieldTypes: {
68
+ type: PropType<Record<string, Component>>;
69
+ default: undefined;
70
+ };
71
+ drafts: {
72
+ type: PropType<{
73
+ store: DraftStore;
74
+ restore?: "auto" | "ask";
75
+ delayMs?: number;
76
+ }>;
77
+ default: undefined;
78
+ };
79
+ autosave: {
80
+ type: PropType<{
81
+ delayMs: number;
82
+ }>;
83
+ default: undefined;
84
+ };
85
+ scheduler: {
86
+ type: PropType<Scheduler>;
87
+ default: undefined;
88
+ };
89
+ confirm: {
90
+ type: PropType<(message: string) => Promise<boolean>>;
91
+ default: undefined;
92
+ };
93
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
94
+ [key: string]: any;
95
+ }>[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
96
+ ready: (_handle: ViewerHandle) => true;
97
+ action: (_request: ActionRequest) => true;
98
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
99
+ page: {
100
+ type: PropType<Page>;
101
+ required: true;
102
+ };
103
+ form: {
104
+ type: PropType<Form>;
105
+ default: undefined;
106
+ };
107
+ dataSource: {
108
+ type: PropType<DataSource>;
109
+ default: undefined;
110
+ };
111
+ recordId: {
112
+ type: PropType<RecordId | null>;
113
+ default: null;
114
+ };
115
+ values: {
116
+ type: PropType<Values>;
117
+ default: undefined;
118
+ };
119
+ skin: {
120
+ type: PropType<Skin>;
121
+ default: string;
122
+ };
123
+ dir: {
124
+ type: PropType<"ltr" | "rtl">;
125
+ default: undefined;
126
+ };
127
+ locale: {
128
+ type: PropType<Locale>;
129
+ default: undefined;
130
+ };
131
+ labels: {
132
+ type: PropType<Partial<ViewerLabels>>;
133
+ default: undefined;
134
+ };
135
+ widgets: {
136
+ type: PropType<Record<string, WidgetFactory>>;
137
+ default: undefined;
138
+ };
139
+ fieldTypes: {
140
+ type: PropType<Record<string, Component>>;
141
+ default: undefined;
142
+ };
143
+ drafts: {
144
+ type: PropType<{
145
+ store: DraftStore;
146
+ restore?: "auto" | "ask";
147
+ delayMs?: number;
148
+ }>;
149
+ default: undefined;
150
+ };
151
+ autosave: {
152
+ type: PropType<{
153
+ delayMs: number;
154
+ }>;
155
+ default: undefined;
156
+ };
157
+ scheduler: {
158
+ type: PropType<Scheduler>;
159
+ default: undefined;
160
+ };
161
+ confirm: {
162
+ type: PropType<(message: string) => Promise<boolean>>;
163
+ default: undefined;
164
+ };
165
+ }>> & Readonly<{
166
+ onReady?: ((_handle: ViewerHandle) => any) | undefined;
167
+ onAction?: ((_request: ActionRequest) => any) | undefined;
168
+ }>, {
169
+ values: Values;
170
+ form: Form;
171
+ dataSource: DataSource;
172
+ recordId: RecordId | null;
173
+ skin: Skin;
174
+ dir: "ltr" | "rtl";
175
+ locale: Locale;
176
+ labels: Partial<ViewerLabels>;
177
+ widgets: Record<string, WidgetFactory>;
178
+ fieldTypes: Record<string, Component>;
179
+ drafts: {
180
+ store: DraftStore;
181
+ restore?: "auto" | "ask";
182
+ delayMs?: number;
183
+ };
184
+ autosave: {
185
+ delayMs: number;
186
+ };
187
+ scheduler: Scheduler;
188
+ confirm: (message: string) => Promise<boolean>;
189
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldiaForm = void 0;
4
+ exports.useFormState = useFormState;
5
+ const viewer_1 = require("@fieldia/viewer");
6
+ const vue_1 = require("vue");
7
+ /** A form's state as a Vue ref, current on every change. */
8
+ function useFormState(form) {
9
+ const state = (0, vue_1.shallowRef)(form.getState());
10
+ const leave = form.subscribe((next) => (state.value = next));
11
+ if ((0, vue_1.getCurrentScope)())
12
+ (0, vue_1.onScopeDispose)(leave);
13
+ return state;
14
+ }
15
+ const EMPTY_STATE = { value: undefined, values: {}, readonly: false, required: false, invalid: false };
16
+ exports.FieldiaForm = (0, vue_1.defineComponent)({
17
+ name: 'FieldiaForm',
18
+ props: {
19
+ page: { type: Object, required: true },
20
+ form: { type: Object, default: undefined },
21
+ dataSource: { type: Object, default: undefined },
22
+ recordId: { type: [String, Number], default: null },
23
+ values: { type: Object, default: undefined },
24
+ skin: { type: String, default: 'underline' },
25
+ dir: { type: String, default: undefined },
26
+ locale: { type: String, default: undefined },
27
+ labels: { type: Object, default: undefined },
28
+ widgets: { type: Object, default: undefined },
29
+ fieldTypes: { type: Object, default: undefined },
30
+ drafts: { type: Object, default: undefined },
31
+ autosave: { type: Object, default: undefined },
32
+ scheduler: { type: Object, default: undefined },
33
+ confirm: { type: Function, default: undefined },
34
+ },
35
+ emits: {
36
+ ready: (_handle) => true,
37
+ action: (_request) => true,
38
+ },
39
+ setup(props, { slots, emit, expose }) {
40
+ const host = (0, vue_1.ref)();
41
+ const portals = (0, vue_1.shallowRef)([]);
42
+ let handle = null;
43
+ function mount() {
44
+ const element = host.value;
45
+ if (!element)
46
+ return;
47
+ const found = [];
48
+ const widgets = { ...props.widgets };
49
+ for (const key of Object.keys(props.fieldTypes ?? {})) {
50
+ widgets[key] = (context) => {
51
+ const box = context.document.createElement('div');
52
+ box.className = 'fd-custom';
53
+ const state = (0, vue_1.shallowRef)(EMPTY_STATE);
54
+ found.push({
55
+ key: `field:${context.node.id}`,
56
+ element: box,
57
+ render: () => {
58
+ const component = props.fieldTypes?.[key];
59
+ return component
60
+ ? (0, vue_1.h)(component, {
61
+ ...state.value,
62
+ name: context.name,
63
+ field: context.field,
64
+ node: context.node,
65
+ id: context.id,
66
+ form: context.form,
67
+ onChange: (value) => context.form.setValue(context.name, value),
68
+ })
69
+ : null;
70
+ },
71
+ });
72
+ return {
73
+ element: box,
74
+ update: (next) => (state.value = next),
75
+ focus: () => box.querySelector('input, select, textarea, button, [tabindex]')?.focus(),
76
+ };
77
+ };
78
+ }
79
+ const slotRenderers = {};
80
+ for (const name of Object.keys(slots)) {
81
+ if (name === 'default')
82
+ continue;
83
+ slotRenderers[name] = (box, context) => {
84
+ found.push({ key: `slot:${name}:${found.length}`, element: box, render: () => slots[name]?.({ form: context.form, name }) });
85
+ };
86
+ }
87
+ handle = (0, viewer_1.mountViewer)(element, {
88
+ page: props.page,
89
+ form: props.form,
90
+ dataSource: props.dataSource,
91
+ recordId: props.recordId,
92
+ values: props.values,
93
+ skin: props.skin,
94
+ dir: props.dir,
95
+ locale: props.locale,
96
+ labels: props.labels,
97
+ widgets,
98
+ slots: slotRenderers,
99
+ drafts: props.drafts,
100
+ autosave: props.autosave,
101
+ scheduler: props.scheduler,
102
+ confirm: props.confirm,
103
+ onAction: (request) => emit('action', request),
104
+ });
105
+ portals.value = found;
106
+ emit('ready', handle);
107
+ }
108
+ function unmount() {
109
+ handle?.destroy();
110
+ handle = null;
111
+ portals.value = [];
112
+ }
113
+ (0, vue_1.onMounted)(mount);
114
+ (0, vue_1.onBeforeUnmount)(unmount);
115
+ (0, vue_1.watch)(() => [props.page, props.form, props.dataSource, props.recordId, props.dir, props.locale, JSON.stringify(props.labels ?? {})], () => {
116
+ unmount();
117
+ mount();
118
+ });
119
+ (0, vue_1.watch)(() => props.skin, (skin) => handle?.setSkin(skin ?? 'underline'));
120
+ expose({
121
+ get handle() {
122
+ return handle;
123
+ },
124
+ });
125
+ return () => [
126
+ (0, vue_1.h)('div', { ref: host }),
127
+ ...portals.value.map((portal) => (0, vue_1.h)(vue_1.Teleport, { to: portal.element, key: portal.key }, [portal.render()])),
128
+ ];
129
+ },
130
+ });
131
+ //# sourceMappingURL=fieldia-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fieldia-form.js","sourceRoot":"","sources":["../../../../../libs/vue/src/lib/fieldia-form.ts"],"names":[],"mappings":";;;AA0CA,oCAKC;AA9CD,4CAAkH;AAElH,6BAea;AAuBb,4DAA4D;AAC5D,SAAgB,YAAY,CAAC,IAAU;IACrC,MAAM,KAAK,GAAG,IAAA,gBAAU,EAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;IAC7D,IAAI,IAAA,qBAAe,GAAE;QAAE,IAAA,oBAAc,EAAC,KAAK,CAAC,CAAC;IAC7C,OAAO,KAAK,CAAC;AACf,CAAC;AAQD,MAAM,WAAW,GAAgB,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAEvG,QAAA,WAAW,GAAG,IAAA,qBAAe,EAAC;IACzC,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE;QACL,IAAI,EAAE,EAAE,IAAI,EAAE,MAAwB,EAAE,QAAQ,EAAE,IAAI,EAAE;QACxD,IAAI,EAAE,EAAE,IAAI,EAAE,MAAwB,EAAE,OAAO,EAAE,SAAS,EAAE;QAC5D,UAAU,EAAE,EAAE,IAAI,EAAE,MAA8B,EAAE,OAAO,EAAE,SAAS,EAAE;QACxE,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAA8B,EAAE,OAAO,EAAE,IAAI,EAAE;QAChF,MAAM,EAAE,EAAE,IAAI,EAAE,MAA0B,EAAE,OAAO,EAAE,SAAS,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AE,CAAC,IAAA,OAAC,EAAC,cAAQ,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;SAC1G,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,127 @@
1
+ import { mountViewer } from '@fieldia/viewer';
2
+ import { defineComponent, getCurrentScope, h, onBeforeUnmount, onMounted, onScopeDispose, ref, shallowRef, Teleport, watch, } from 'vue';
3
+ /** A form's state as a Vue ref, current on every change. */
4
+ export function useFormState(form) {
5
+ const state = shallowRef(form.getState());
6
+ const leave = form.subscribe((next) => (state.value = next));
7
+ if (getCurrentScope())
8
+ onScopeDispose(leave);
9
+ return state;
10
+ }
11
+ const EMPTY_STATE = { value: undefined, values: {}, readonly: false, required: false, invalid: false };
12
+ export const FieldiaForm = defineComponent({
13
+ name: 'FieldiaForm',
14
+ props: {
15
+ page: { type: Object, required: true },
16
+ form: { type: Object, default: undefined },
17
+ dataSource: { type: Object, default: undefined },
18
+ recordId: { type: [String, Number], default: null },
19
+ values: { type: Object, default: undefined },
20
+ skin: { type: String, default: 'underline' },
21
+ dir: { type: String, default: undefined },
22
+ locale: { type: String, default: undefined },
23
+ labels: { type: Object, default: undefined },
24
+ widgets: { type: Object, default: undefined },
25
+ fieldTypes: { type: Object, default: undefined },
26
+ drafts: { type: Object, default: undefined },
27
+ autosave: { type: Object, default: undefined },
28
+ scheduler: { type: Object, default: undefined },
29
+ confirm: { type: Function, default: undefined },
30
+ },
31
+ emits: {
32
+ ready: (_handle) => true,
33
+ action: (_request) => true,
34
+ },
35
+ setup(props, { slots, emit, expose }) {
36
+ const host = ref();
37
+ const portals = shallowRef([]);
38
+ let handle = null;
39
+ function mount() {
40
+ const element = host.value;
41
+ if (!element)
42
+ return;
43
+ const found = [];
44
+ const widgets = { ...props.widgets };
45
+ for (const key of Object.keys(props.fieldTypes ?? {})) {
46
+ widgets[key] = (context) => {
47
+ const box = context.document.createElement('div');
48
+ box.className = 'fd-custom';
49
+ const state = shallowRef(EMPTY_STATE);
50
+ found.push({
51
+ key: `field:${context.node.id}`,
52
+ element: box,
53
+ render: () => {
54
+ const component = props.fieldTypes?.[key];
55
+ return component
56
+ ? h(component, {
57
+ ...state.value,
58
+ name: context.name,
59
+ field: context.field,
60
+ node: context.node,
61
+ id: context.id,
62
+ form: context.form,
63
+ onChange: (value) => context.form.setValue(context.name, value),
64
+ })
65
+ : null;
66
+ },
67
+ });
68
+ return {
69
+ element: box,
70
+ update: (next) => (state.value = next),
71
+ focus: () => box.querySelector('input, select, textarea, button, [tabindex]')?.focus(),
72
+ };
73
+ };
74
+ }
75
+ const slotRenderers = {};
76
+ for (const name of Object.keys(slots)) {
77
+ if (name === 'default')
78
+ continue;
79
+ slotRenderers[name] = (box, context) => {
80
+ found.push({ key: `slot:${name}:${found.length}`, element: box, render: () => slots[name]?.({ form: context.form, name }) });
81
+ };
82
+ }
83
+ handle = mountViewer(element, {
84
+ page: props.page,
85
+ form: props.form,
86
+ dataSource: props.dataSource,
87
+ recordId: props.recordId,
88
+ values: props.values,
89
+ skin: props.skin,
90
+ dir: props.dir,
91
+ locale: props.locale,
92
+ labels: props.labels,
93
+ widgets,
94
+ slots: slotRenderers,
95
+ drafts: props.drafts,
96
+ autosave: props.autosave,
97
+ scheduler: props.scheduler,
98
+ confirm: props.confirm,
99
+ onAction: (request) => emit('action', request),
100
+ });
101
+ portals.value = found;
102
+ emit('ready', handle);
103
+ }
104
+ function unmount() {
105
+ handle?.destroy();
106
+ handle = null;
107
+ portals.value = [];
108
+ }
109
+ onMounted(mount);
110
+ onBeforeUnmount(unmount);
111
+ watch(() => [props.page, props.form, props.dataSource, props.recordId, props.dir, props.locale, JSON.stringify(props.labels ?? {})], () => {
112
+ unmount();
113
+ mount();
114
+ });
115
+ watch(() => props.skin, (skin) => handle?.setSkin(skin ?? 'underline'));
116
+ expose({
117
+ get handle() {
118
+ return handle;
119
+ },
120
+ });
121
+ return () => [
122
+ h('div', { ref: host }),
123
+ ...portals.value.map((portal) => h(Teleport, { to: portal.element, key: portal.key }, [portal.render()])),
124
+ ];
125
+ },
126
+ });
127
+ //# sourceMappingURL=fieldia-form.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fieldia-form.mjs","sourceRoot":"","sources":["../../../../../libs/vue/src/lib/fieldia-form.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAsE,MAAM,iBAAiB,CAAC;AAElH,OAAO,EACL,eAAe,EACf,eAAe,EACf,CAAC,EACD,eAAe,EACf,SAAS,EACT,cAAc,EACd,GAAG,EACH,UAAU,EACV,QAAQ,EACR,KAAK,GAKN,MAAM,KAAK,CAAC;AAuBb,4DAA4D;AAC5D,MAAM,UAAU,YAAY,CAAC,IAAU;IACrC,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;IAC7D,IAAI,eAAe,EAAE;QAAE,cAAc,CAAC,KAAK,CAAC,CAAC;IAC7C,OAAO,KAAK,CAAC;AACf,CAAC;AAQD,MAAM,WAAW,GAAgB,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAEpH,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;IACzC,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE;QACL,IAAI,EAAE,EAAE,IAAI,EAAE,MAAwB,EAAE,QAAQ,EAAE,IAAI,EAAE;QACxD,IAAI,EAAE,EAAE,IAAI,EAAE,MAAwB,EAAE,OAAO,EAAE,SAA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