@mapomodule/form 2.0.0-beta.1 → 2.0.0-beta.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.
- package/dist/__tests__/__mocks__/nuxt-imports.d.ts +4 -0
- package/dist/__tests__/__mocks__/nuxt-imports.d.ts.map +1 -0
- package/dist/__tests__/registry.test.d.ts +2 -0
- package/dist/__tests__/registry.test.d.ts.map +1 -0
- package/dist/__tests__/useFormFromSchema.test.d.ts +2 -0
- package/dist/__tests__/useFormFromSchema.test.d.ts.map +1 -0
- package/dist/__tests__/useMapoForm.test.d.ts +2 -0
- package/dist/__tests__/useMapoForm.test.d.ts.map +1 -0
- package/dist/index.d.mts +9 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +7 -34
- package/dist/module.d.mts +20 -2
- package/dist/module.d.ts +12 -2
- package/dist/module.d.ts.map +1 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +167 -13
- package/dist/runtime/components/MapoFocusPortal.vue +113 -0
- package/dist/runtime/components/MapoFocusPortal.vue.d.ts +4 -0
- package/dist/runtime/components/MapoFocusPortal.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoForm.vue +168 -0
- package/dist/runtime/components/MapoForm.vue.d.ts +47 -0
- package/dist/runtime/components/MapoForm.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoFormField.vue +269 -0
- package/dist/runtime/components/MapoFormField.vue.d.ts +46 -0
- package/dist/runtime/components/MapoFormField.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoFormFlatSection.vue +149 -0
- package/dist/runtime/components/MapoFormFlatSection.vue.d.ts +15 -0
- package/dist/runtime/components/MapoFormFlatSection.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoFormGroup.vue +247 -0
- package/dist/runtime/components/MapoFormGroup.vue.d.ts +44 -0
- package/dist/runtime/components/MapoFormGroup.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoFormTabs.vue +108 -0
- package/dist/runtime/components/MapoFormTabs.vue.d.ts +15 -0
- package/dist/runtime/components/MapoFormTabs.vue.d.ts.map +1 -0
- package/dist/runtime/components/MapoUnknownField.vue +62 -0
- package/dist/runtime/components/MapoUnknownField.vue.d.ts +16 -0
- package/dist/runtime/components/MapoUnknownField.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/MapoDateField.vue +86 -0
- package/dist/runtime/components/fields/MapoDateField.vue.d.ts +17 -0
- package/dist/runtime/components/fields/MapoDateField.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/MapoDateTimeField.vue +157 -0
- package/dist/runtime/components/fields/MapoDateTimeField.vue.d.ts +17 -0
- package/dist/runtime/components/fields/MapoDateTimeField.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/MapoFileField.vue +97 -0
- package/dist/runtime/components/fields/MapoFileField.vue.d.ts +16 -0
- package/dist/runtime/components/fields/MapoFileField.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/MapoFksField.vue +118 -0
- package/dist/runtime/components/fields/MapoFksField.vue.d.ts +16 -0
- package/dist/runtime/components/fields/MapoFksField.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/MapoMapField.vue +97 -0
- package/dist/runtime/components/fields/MapoMapField.vue.d.ts +22 -0
- package/dist/runtime/components/fields/MapoMapField.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/MapoMapFieldClient.vue +67 -0
- package/dist/runtime/components/fields/MapoMapFieldClient.vue.d.ts +20 -0
- package/dist/runtime/components/fields/MapoMapFieldClient.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/MapoRepeater.vue +449 -0
- package/dist/runtime/components/fields/MapoRepeater.vue.d.ts +16 -0
- package/dist/runtime/components/fields/MapoRepeater.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/MapoRepeaterItem.vue +341 -0
- package/dist/runtime/components/fields/MapoRepeaterItem.vue.d.ts +55 -0
- package/dist/runtime/components/fields/MapoRepeaterItem.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/MapoSeoPreview.vue +118 -0
- package/dist/runtime/components/fields/MapoSeoPreview.vue.d.ts +22 -0
- package/dist/runtime/components/fields/MapoSeoPreview.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/MapoTimeField.vue +44 -0
- package/dist/runtime/components/fields/MapoTimeField.vue.d.ts +17 -0
- package/dist/runtime/components/fields/MapoTimeField.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/MapoWygEditor.vue +227 -0
- package/dist/runtime/components/fields/MapoWygEditor.vue.d.ts +16 -0
- package/dist/runtime/components/fields/MapoWygEditor.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/nui/NuiCheckbox.vue +9 -0
- package/dist/runtime/components/fields/nui/NuiCheckbox.vue.d.ts +4 -0
- package/dist/runtime/components/fields/nui/NuiCheckbox.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/nui/NuiInput.vue +9 -0
- package/dist/runtime/components/fields/nui/NuiInput.vue.d.ts +4 -0
- package/dist/runtime/components/fields/nui/NuiInput.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/nui/NuiSelectMenu.vue +18 -0
- package/dist/runtime/components/fields/nui/NuiSelectMenu.vue.d.ts +4 -0
- package/dist/runtime/components/fields/nui/NuiSelectMenu.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/nui/NuiSlider.vue +9 -0
- package/dist/runtime/components/fields/nui/NuiSlider.vue.d.ts +4 -0
- package/dist/runtime/components/fields/nui/NuiSlider.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/nui/NuiSwitch.vue +9 -0
- package/dist/runtime/components/fields/nui/NuiSwitch.vue.d.ts +4 -0
- package/dist/runtime/components/fields/nui/NuiSwitch.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/nui/NuiTextarea.vue +9 -0
- package/dist/runtime/components/fields/nui/NuiTextarea.vue.d.ts +4 -0
- package/dist/runtime/components/fields/nui/NuiTextarea.vue.d.ts.map +1 -0
- package/dist/runtime/components/fields/nui/useNuiFieldAttrs.d.ts +13 -0
- package/dist/runtime/components/fields/nui/useNuiFieldAttrs.d.ts.map +1 -0
- package/dist/runtime/components/fields/nui/useNuiFieldAttrs.js +19 -0
- package/dist/runtime/composables/defineFormField.d.ts +25 -0
- package/dist/runtime/composables/defineFormField.d.ts.map +1 -0
- package/dist/runtime/composables/defineFormField.js +27 -0
- package/dist/runtime/composables/useCurrentLang.d.ts +6 -0
- package/dist/runtime/composables/useCurrentLang.d.ts.map +1 -0
- package/dist/runtime/composables/useCurrentLang.js +9 -0
- package/dist/runtime/composables/useFocusMode.d.ts +40 -0
- package/dist/runtime/composables/useFocusMode.d.ts.map +1 -0
- package/dist/runtime/composables/useFocusMode.js +31 -0
- package/dist/runtime/composables/useFormDraft.d.ts +60 -0
- package/dist/runtime/composables/useFormDraft.d.ts.map +1 -0
- package/dist/runtime/composables/useFormDraft.js +52 -0
- package/dist/runtime/composables/useFormFromSchema.d.ts +21 -0
- package/dist/runtime/composables/useFormFromSchema.d.ts.map +1 -0
- package/dist/runtime/composables/useFormFromSchema.js +142 -0
- package/dist/runtime/composables/useMapoForm.d.ts +96 -0
- package/dist/runtime/composables/useMapoForm.d.ts.map +1 -0
- package/dist/runtime/composables/useMapoForm.js +323 -0
- package/dist/runtime/composables/useProgressiveDisclosure.d.ts +44 -0
- package/dist/runtime/composables/useProgressiveDisclosure.d.ts.map +1 -0
- package/dist/runtime/composables/useProgressiveDisclosure.js +23 -0
- package/dist/runtime/composables/useUnsavedChangesGuard.d.ts +24 -0
- package/dist/runtime/composables/useUnsavedChangesGuard.d.ts.map +1 -0
- package/dist/runtime/composables/useUnsavedChangesGuard.js +27 -0
- package/dist/runtime/devtools/DevtoolsFormsPage.vue +235 -0
- package/dist/runtime/devtools/DevtoolsFormsPage.vue.d.ts +4 -0
- package/dist/runtime/devtools/DevtoolsFormsPage.vue.d.ts.map +1 -0
- package/dist/runtime/plugins/form-registry.d.ts +18 -0
- package/dist/runtime/plugins/form-registry.d.ts.map +1 -0
- package/dist/runtime/plugins/form-registry.js +19 -0
- package/dist/runtime/registry/defaults.d.ts +3 -0
- package/dist/runtime/registry/defaults.d.ts.map +1 -0
- package/dist/runtime/registry/defaults.js +87 -0
- package/dist/runtime/types/descriptor.d.ts +359 -0
- package/dist/runtime/types/descriptor.d.ts.map +1 -0
- package/dist/runtime/types/descriptor.js +26 -0
- package/dist/runtime/types/index.d.ts +11 -0
- package/dist/runtime/types/index.d.ts.map +1 -0
- package/dist/runtime/types/index.js +6 -0
- package/dist/runtime/types/layout.d.ts +21 -0
- package/dist/runtime/types/layout.d.ts.map +1 -0
- package/dist/runtime/types/layout.js +0 -0
- package/dist/runtime/types/registry.d.ts +62 -0
- package/dist/runtime/types/registry.d.ts.map +1 -0
- package/dist/runtime/types/registry.js +19 -0
- package/dist/runtime/utils/flattenFieldGroups.d.ts +50 -0
- package/dist/runtime/utils/flattenFieldGroups.d.ts.map +1 -0
- package/dist/runtime/utils/flattenFieldGroups.js +24 -0
- package/dist/types.d.mts +6 -10
- package/package.json +3 -3
- package/dist/index.d.cts +0 -1
- package/dist/module.d.cts +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nuxt-imports.d.ts","sourceRoot":"","sources":["../../../src/__tests__/__mocks__/nuxt-imports.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;EAEvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/registry.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormFromSchema.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/useFormFromSchema.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMapoForm.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/useMapoForm.test.ts"],"names":[],"mappings":""}
|
package/dist/index.d.mts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { MapoFormOptions } from './module.mjs';
|
|
2
|
+
export { UseFormFromSchemaOptions, useFormFromSchema } from '../dist/runtime/composables/useFormFromSchema.js';
|
|
3
|
+
export { UseFormDraftOptions, useFormDraft } from '../dist/runtime/composables/useFormDraft.js';
|
|
4
|
+
export { FocusTarget, useFocusMode } from '../dist/runtime/composables/useFocusMode.js';
|
|
5
|
+
export { UnsavedChangesGuardOptions, useUnsavedChangesGuard } from '../dist/runtime/composables/useUnsavedChangesGuard.js';
|
|
6
|
+
export { greaterThan, isEmpty, isNoneOf, isNotEmpty, isOneOf, lessThan, matches, matchesField, when, whenAny, whenNot } from '../dist/runtime/composables/useProgressiveDisclosure.js';
|
|
7
|
+
export { FieldGroupDescriptor, flattenFieldGroups } from '../dist/runtime/utils/flattenFieldGroups.js';
|
|
8
|
+
export { AnyFieldDescriptor, BooleanDescriptor, ColorDescriptor, CustomDescriptor, DateDescriptor, EditorDescriptor, FieldAccessor, FieldComponentEntry, FieldDescriptor, FieldRegistry, FieldType, FileDescriptor, FksDescriptor, KnownFieldType, MapDescriptor, MediaDescriptor, NumberDescriptor, PartialFieldRegistry, RepeaterDescriptor, SelectDescriptor, SeoDescriptor, TextDescriptor } from '../dist/runtime/types/index.js';
|
|
9
|
+
import '@nuxt/schema';
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,15 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type { MapoFormOptions } from "./module.js";
|
|
2
|
+
export { useFormFromSchema } from "./runtime/composables/useFormFromSchema.js";
|
|
3
|
+
export type { UseFormFromSchemaOptions } from "./runtime/composables/useFormFromSchema.js";
|
|
4
|
+
export { useFormDraft } from "./runtime/composables/useFormDraft.js";
|
|
5
|
+
export type { UseFormDraftOptions } from "./runtime/composables/useFormDraft.js";
|
|
6
|
+
export { useFocusMode } from "./runtime/composables/useFocusMode.js";
|
|
7
|
+
export type { FocusTarget } from "./runtime/composables/useFocusMode.js";
|
|
8
|
+
export { useUnsavedChangesGuard } from "./runtime/composables/useUnsavedChangesGuard.js";
|
|
9
|
+
export type { UnsavedChangesGuardOptions } from "./runtime/composables/useUnsavedChangesGuard.js";
|
|
10
|
+
export { when, whenAny, whenNot, matchesField, isOneOf, isNoneOf, isNotEmpty, isEmpty, greaterThan, lessThan, matches, } from "./runtime/composables/useProgressiveDisclosure.js";
|
|
11
|
+
export { flattenFieldGroups } from "./runtime/utils/flattenFieldGroups.js";
|
|
12
|
+
export type { FieldGroupDescriptor } from "./runtime/utils/flattenFieldGroups.js";
|
|
13
|
+
export { KnownFieldType } from "./runtime/types/index.js";
|
|
14
|
+
export type { FieldType, FieldAccessor, FieldDescriptor, AnyFieldDescriptor, TextDescriptor, NumberDescriptor, BooleanDescriptor, SelectDescriptor, FksDescriptor, DateDescriptor, ColorDescriptor, FileDescriptor, EditorDescriptor, SeoDescriptor, MapDescriptor, RepeaterDescriptor, MediaDescriptor, CustomDescriptor, FieldComponentEntry, FieldRegistry, PartialFieldRegistry, } from "./runtime/types/index.js";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,YAAY,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,YAAY,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,YAAY,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,YAAY,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;AAElG,OAAO,EACL,IAAI,EACJ,OAAO,EACP,OAAO,EACP,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,UAAU,EACV,OAAO,EACP,WAAW,EACX,QAAQ,EACR,OAAO,GACR,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,YAAY,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,YAAY,EACV,SAAS,EACT,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,oBAAoB,GACrB,MAAM,0BAA0B,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,34 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"transformOptions": {
|
|
9
|
-
"babel": {
|
|
10
|
-
"plugins": []
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
/** @type {import("/home/runner/work/mapo-new/mapo-new/packages/@mapomodule/form/src/index.js")} */
|
|
16
|
-
const _module = await jiti.import("/home/runner/work/mapo-new/mapo-new/packages/@mapomodule/form/src/index.ts");
|
|
17
|
-
|
|
18
|
-
export const useFormFromSchema = _module.useFormFromSchema;
|
|
19
|
-
export const useFormDraft = _module.useFormDraft;
|
|
20
|
-
export const useFocusMode = _module.useFocusMode;
|
|
21
|
-
export const useUnsavedChangesGuard = _module.useUnsavedChangesGuard;
|
|
22
|
-
export const when = _module.when;
|
|
23
|
-
export const whenAny = _module.whenAny;
|
|
24
|
-
export const whenNot = _module.whenNot;
|
|
25
|
-
export const matchesField = _module.matchesField;
|
|
26
|
-
export const isOneOf = _module.isOneOf;
|
|
27
|
-
export const isNoneOf = _module.isNoneOf;
|
|
28
|
-
export const isNotEmpty = _module.isNotEmpty;
|
|
29
|
-
export const isEmpty = _module.isEmpty;
|
|
30
|
-
export const greaterThan = _module.greaterThan;
|
|
31
|
-
export const lessThan = _module.lessThan;
|
|
32
|
-
export const matches = _module.matches;
|
|
33
|
-
export const flattenFieldGroups = _module.flattenFieldGroups;
|
|
34
|
-
export const KnownFieldType = _module.KnownFieldType;
|
|
1
|
+
export { useFormFromSchema } from '../dist/runtime/composables/useFormFromSchema.js';
|
|
2
|
+
export { useFormDraft } from '../dist/runtime/composables/useFormDraft.js';
|
|
3
|
+
export { useFocusMode } from '../dist/runtime/composables/useFocusMode.js';
|
|
4
|
+
export { useUnsavedChangesGuard } from '../dist/runtime/composables/useUnsavedChangesGuard.js';
|
|
5
|
+
export { greaterThan, isEmpty, isNoneOf, isNotEmpty, isOneOf, lessThan, matches, matchesField, when, whenAny, whenNot } from '../dist/runtime/composables/useProgressiveDisclosure.js';
|
|
6
|
+
export { flattenFieldGroups } from '../dist/runtime/utils/flattenFieldGroups.js';
|
|
7
|
+
export { KnownFieldType } from '../dist/runtime/types/index.js';
|
package/dist/module.d.mts
CHANGED
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { NuxtModule } from '@nuxt/schema';
|
|
2
|
+
import { PartialFieldRegistry } from '../dist/runtime/types/index.js';
|
|
3
|
+
import '../dist/runtime/composables/useFormFromSchema.js';
|
|
4
|
+
import '../dist/runtime/composables/useFormDraft.js';
|
|
5
|
+
import '../dist/runtime/composables/useFocusMode.js';
|
|
6
|
+
import '../dist/runtime/composables/useUnsavedChangesGuard.js';
|
|
7
|
+
import '../dist/runtime/composables/useProgressiveDisclosure.js';
|
|
8
|
+
import '../dist/runtime/utils/flattenFieldGroups.js';
|
|
9
|
+
|
|
10
|
+
interface MapoFormOptions {
|
|
11
|
+
fields?: PartialFieldRegistry;
|
|
12
|
+
groups?: {
|
|
13
|
+
expanded?: boolean;
|
|
14
|
+
};
|
|
15
|
+
debounce?: number;
|
|
16
|
+
}
|
|
17
|
+
declare const _default: NuxtModule<MapoFormOptions, MapoFormOptions, false>;
|
|
18
|
+
|
|
19
|
+
export { _default as default };
|
|
20
|
+
export type { MapoFormOptions };
|
package/dist/module.d.ts
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { NuxtModule } from "@nuxt/schema";
|
|
2
|
+
import type { PartialFieldRegistry } from "./runtime/types/index.js";
|
|
3
|
+
export interface MapoFormOptions {
|
|
4
|
+
fields?: PartialFieldRegistry;
|
|
5
|
+
groups?: {
|
|
6
|
+
expanded?: boolean;
|
|
7
|
+
};
|
|
8
|
+
debounce?: number;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: NuxtModule<MapoFormOptions, MapoFormOptions, false>;
|
|
11
|
+
export default _default;
|
|
12
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;;AAED,wBAkMyC"}
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,18 +1,172 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineNuxtModule, createResolver, addPlugin, addTypeTemplate, extendPages, addComponent, addImports } from '@nuxt/kit';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const module$1 = defineNuxtModule({
|
|
4
|
+
meta: {
|
|
5
|
+
name: "@mapomodule/form",
|
|
6
|
+
configKey: "mapoForm"
|
|
7
7
|
},
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
defaults: {
|
|
9
|
+
debounce: 300,
|
|
10
|
+
groups: { expanded: true }
|
|
11
|
+
},
|
|
12
|
+
async setup(options, nuxt) {
|
|
13
|
+
const resolver = createResolver(import.meta.url);
|
|
14
|
+
nuxt.options.runtimeConfig.public.mapoForm = {
|
|
15
|
+
groups: { expanded: options.groups?.expanded ?? true },
|
|
16
|
+
debounce: options.debounce ?? 300,
|
|
17
|
+
// attrs is JSON-serialisable (plain objects) — merged in the plugin
|
|
18
|
+
fields: { attrs: options.fields?.attrs ?? {} }
|
|
19
|
+
};
|
|
20
|
+
addPlugin(resolver.resolve("./runtime/plugins/form-registry"));
|
|
21
|
+
addTypeTemplate({
|
|
22
|
+
filename: "types/mapo-form-registry.d.ts",
|
|
23
|
+
getContents: () => `
|
|
24
|
+
import type { FieldRegistry } from '@mapomodule/form/types';
|
|
25
|
+
declare module '#app' {
|
|
26
|
+
interface NuxtApp {
|
|
27
|
+
$mapoFormRegistry: FieldRegistry;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
declare module 'vue' {
|
|
31
|
+
interface ComponentCustomProperties {
|
|
32
|
+
$mapoFormRegistry: FieldRegistry;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
36
|
+
`
|
|
37
|
+
});
|
|
38
|
+
if (nuxt.options.dev) {
|
|
39
|
+
extendPages((pages) => {
|
|
40
|
+
pages.push({
|
|
41
|
+
name: "mapo-devtools-forms",
|
|
42
|
+
path: "/_mapo/devtools/forms",
|
|
43
|
+
file: resolver.resolve("./runtime/devtools/DevtoolsFormsPage.vue")
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
nuxt.hook(
|
|
47
|
+
"devtools:customTabs",
|
|
48
|
+
(tabs) => {
|
|
49
|
+
tabs.push({
|
|
50
|
+
name: "mapo-forms",
|
|
51
|
+
title: "Mapo Forms",
|
|
52
|
+
icon: "i-lucide-layout-list",
|
|
53
|
+
view: { type: "iframe", src: "/_mapo/devtools/forms" }
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
);
|
|
11
57
|
}
|
|
58
|
+
const shellComponents = [
|
|
59
|
+
"MapoForm",
|
|
60
|
+
"MapoFormField",
|
|
61
|
+
"MapoFormGroup",
|
|
62
|
+
"MapoFormTabs",
|
|
63
|
+
"MapoUnknownField",
|
|
64
|
+
"MapoFocusPortal"
|
|
65
|
+
];
|
|
66
|
+
for (const name of shellComponents) {
|
|
67
|
+
addComponent({
|
|
68
|
+
name,
|
|
69
|
+
filePath: resolver.resolve(`./runtime/components/${name}.vue`)
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
addImports([
|
|
73
|
+
{
|
|
74
|
+
name: "useMapoForm",
|
|
75
|
+
from: resolver.resolve("./runtime/composables/useMapoForm")
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "useCurrentLang",
|
|
79
|
+
from: resolver.resolve("./runtime/composables/useCurrentLang")
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "provideCurrentLang",
|
|
83
|
+
from: resolver.resolve("./runtime/composables/useCurrentLang")
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "useFormFromSchema",
|
|
87
|
+
from: resolver.resolve("./runtime/composables/useFormFromSchema")
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "useFormDraft",
|
|
91
|
+
from: resolver.resolve("./runtime/composables/useFormDraft")
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "useFocusMode",
|
|
95
|
+
from: resolver.resolve("./runtime/composables/useFocusMode")
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "defineFormField",
|
|
99
|
+
from: resolver.resolve("./runtime/composables/defineFormField")
|
|
100
|
+
},
|
|
101
|
+
// Progressive disclosure DSL
|
|
102
|
+
{
|
|
103
|
+
name: "when",
|
|
104
|
+
from: resolver.resolve(
|
|
105
|
+
"./runtime/composables/useProgressiveDisclosure"
|
|
106
|
+
)
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "whenAny",
|
|
110
|
+
from: resolver.resolve(
|
|
111
|
+
"./runtime/composables/useProgressiveDisclosure"
|
|
112
|
+
)
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: "whenNot",
|
|
116
|
+
from: resolver.resolve(
|
|
117
|
+
"./runtime/composables/useProgressiveDisclosure"
|
|
118
|
+
)
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "matchesField",
|
|
122
|
+
from: resolver.resolve(
|
|
123
|
+
"./runtime/composables/useProgressiveDisclosure"
|
|
124
|
+
)
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: "isOneOf",
|
|
128
|
+
from: resolver.resolve(
|
|
129
|
+
"./runtime/composables/useProgressiveDisclosure"
|
|
130
|
+
)
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "isNoneOf",
|
|
134
|
+
from: resolver.resolve(
|
|
135
|
+
"./runtime/composables/useProgressiveDisclosure"
|
|
136
|
+
)
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: "isNotEmpty",
|
|
140
|
+
from: resolver.resolve(
|
|
141
|
+
"./runtime/composables/useProgressiveDisclosure"
|
|
142
|
+
)
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "isEmpty",
|
|
146
|
+
from: resolver.resolve(
|
|
147
|
+
"./runtime/composables/useProgressiveDisclosure"
|
|
148
|
+
)
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "greaterThan",
|
|
152
|
+
from: resolver.resolve(
|
|
153
|
+
"./runtime/composables/useProgressiveDisclosure"
|
|
154
|
+
)
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "lessThan",
|
|
158
|
+
from: resolver.resolve(
|
|
159
|
+
"./runtime/composables/useProgressiveDisclosure"
|
|
160
|
+
)
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "matches",
|
|
164
|
+
from: resolver.resolve(
|
|
165
|
+
"./runtime/composables/useProgressiveDisclosure"
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
]);
|
|
12
169
|
}
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
/** @type {import("/home/runner/work/mapo-new/mapo-new/packages/@mapomodule/form/src/module.js")} */
|
|
16
|
-
const _module = await jiti.import("/home/runner/work/mapo-new/mapo-new/packages/@mapomodule/form/src/module.ts");
|
|
170
|
+
});
|
|
17
171
|
|
|
18
|
-
export
|
|
172
|
+
export { module$1 as default };
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref, onMounted, onUnmounted } from "vue";
|
|
3
|
+
import { watch } from "vue";
|
|
4
|
+
import { useFocusMode } from "../composables/useFocusMode.js";
|
|
5
|
+
import MapoForm from "./MapoForm.vue";
|
|
6
|
+
const { focusTarget, exit } = useFocusMode();
|
|
7
|
+
const isOpen = computed(() => focusTarget.value !== null);
|
|
8
|
+
const canUseDocument = typeof document !== "undefined";
|
|
9
|
+
function onKeyDown(e) {
|
|
10
|
+
if (e.key === "Escape" && isOpen.value) exit();
|
|
11
|
+
}
|
|
12
|
+
onMounted(() => window.addEventListener("keydown", onKeyDown));
|
|
13
|
+
onUnmounted(() => window.removeEventListener("keydown", onKeyDown));
|
|
14
|
+
watch(isOpen, (open) => {
|
|
15
|
+
if (!canUseDocument) return;
|
|
16
|
+
document.body.style.overflow = open ? "hidden" : "";
|
|
17
|
+
});
|
|
18
|
+
const localModel = ref({});
|
|
19
|
+
watch(
|
|
20
|
+
() => focusTarget.value?.model,
|
|
21
|
+
(val) => {
|
|
22
|
+
if (val) localModel.value = { ...val };
|
|
23
|
+
},
|
|
24
|
+
{ immediate: true }
|
|
25
|
+
);
|
|
26
|
+
function onUpdate(val) {
|
|
27
|
+
localModel.value = val;
|
|
28
|
+
focusTarget.value?.onUpdate(val);
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<Teleport to="body">
|
|
34
|
+
<Transition name="mapo-focus-portal">
|
|
35
|
+
<div
|
|
36
|
+
v-if="isOpen && focusTarget"
|
|
37
|
+
class="mapo-focus-portal fixed inset-0 z-[9999] flex flex-col bg-white"
|
|
38
|
+
role="dialog"
|
|
39
|
+
aria-modal="true"
|
|
40
|
+
>
|
|
41
|
+
<!-- ── Header ────────────────────────────────────────────────────── -->
|
|
42
|
+
<div
|
|
43
|
+
class="flex shrink-0 items-center gap-3 border-b border-gray-200 px-6 py-3"
|
|
44
|
+
>
|
|
45
|
+
<!-- Breadcrumb -->
|
|
46
|
+
<nav class="flex min-w-0 flex-1 items-center gap-1 text-sm">
|
|
47
|
+
<template v-for="(crumb, i) in focusTarget.breadcrumb" :key="i">
|
|
48
|
+
<span
|
|
49
|
+
:class="
|
|
50
|
+
i < focusTarget.breadcrumb.length - 1 ? 'text-gray-400' : 'font-semibold text-gray-800'
|
|
51
|
+
"
|
|
52
|
+
class="truncate"
|
|
53
|
+
>
|
|
54
|
+
{{ crumb }}
|
|
55
|
+
</span>
|
|
56
|
+
<UIcon
|
|
57
|
+
v-if="i < focusTarget.breadcrumb.length - 1"
|
|
58
|
+
name="i-lucide-chevron-right"
|
|
59
|
+
class="h-3.5 w-3.5 shrink-0 text-gray-300"
|
|
60
|
+
/>
|
|
61
|
+
</template>
|
|
62
|
+
</nav>
|
|
63
|
+
|
|
64
|
+
<!-- Close button -->
|
|
65
|
+
<UButton
|
|
66
|
+
variant="ghost"
|
|
67
|
+
color="neutral"
|
|
68
|
+
icon="i-lucide-x"
|
|
69
|
+
label="Close"
|
|
70
|
+
size="sm"
|
|
71
|
+
@click="exit"
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<!-- ── Body: scrollable sub-form ────────────────────────────────── -->
|
|
76
|
+
<div class="min-h-0 flex-1 overflow-y-auto">
|
|
77
|
+
<div class="mx-auto max-w-3xl px-6 py-8">
|
|
78
|
+
<MapoForm
|
|
79
|
+
:model-value="localModel"
|
|
80
|
+
:fields="focusTarget.fields"
|
|
81
|
+
:errors="focusTarget.errors.value"
|
|
82
|
+
:languages="focusTarget.languages"
|
|
83
|
+
:current-lang="focusTarget.currentLang"
|
|
84
|
+
:registry="focusTarget.registry"
|
|
85
|
+
@update:model-value="onUpdate"
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<!-- ── Footer ───────────────────────────────────────────────────── -->
|
|
91
|
+
<div
|
|
92
|
+
class="flex shrink-0 items-center justify-end gap-3 border-t border-gray-200 px-6 py-3"
|
|
93
|
+
>
|
|
94
|
+
<p class="mr-auto text-xs text-gray-400">
|
|
95
|
+
<UIcon name="i-lucide-keyboard" class="mr-1 inline h-3 w-3" />
|
|
96
|
+
Press
|
|
97
|
+
<kbd class="rounded bg-gray-100 px-1 py-0.5 font-mono text-xs"
|
|
98
|
+
>ESC</kbd
|
|
99
|
+
>
|
|
100
|
+
to return to the form
|
|
101
|
+
</p>
|
|
102
|
+
<UButton variant="ghost" color="neutral" @click="exit">
|
|
103
|
+
Close
|
|
104
|
+
</UButton>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</Transition>
|
|
108
|
+
</Teleport>
|
|
109
|
+
</template>
|
|
110
|
+
|
|
111
|
+
<style scoped>
|
|
112
|
+
.mapo-focus-portal-enter-active{transition:opacity .2s ease,transform .2s ease}.mapo-focus-portal-leave-active{transition:opacity .15s ease,transform .15s ease}.mapo-focus-portal-enter-from,.mapo-focus-portal-leave-to{opacity:0;transform:scale(.98)}.mapo-focus-portal-enter-to,.mapo-focus-portal-leave-from{opacity:1;transform:scale(1)}
|
|
113
|
+
</style>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
4
|
+
//# sourceMappingURL=MapoFocusPortal.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapoFocusPortal.vue.d.ts","sourceRoot":"","sources":["../../../src/runtime/components/MapoFocusPortal.vue"],"names":[],"mappings":"AAkdA,QAAA,MAAM,YAAY,+QAChB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, useSlots, watchEffect, inject, onUnmounted } from "vue";
|
|
3
|
+
import { useNuxtApp, useRuntimeConfig } from "#app";
|
|
4
|
+
import { useMapoForm, injectMapoForm } from "../composables/useMapoForm.js";
|
|
5
|
+
import { provideCurrentLang } from "../composables/useCurrentLang.js";
|
|
6
|
+
import MapoFormGroup from "./MapoFormGroup.vue";
|
|
7
|
+
import MapoFormTabs from "./MapoFormTabs.vue";
|
|
8
|
+
import MapoFormFlatSection from "./MapoFormFlatSection.vue";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
modelValue: { type: null, required: true },
|
|
11
|
+
fields: { type: Array, required: true },
|
|
12
|
+
errors: { type: Object, required: false, default: () => ({}) },
|
|
13
|
+
languages: { type: Array, required: false, default: () => [] },
|
|
14
|
+
currentLang: { type: String, required: false, default: "" },
|
|
15
|
+
readonly: { type: Boolean, required: false, default: false },
|
|
16
|
+
immediate: { type: Boolean, required: false, default: false },
|
|
17
|
+
registry: { type: Object, required: false, default: void 0 }
|
|
18
|
+
});
|
|
19
|
+
const injectedRegistry = computed(() => {
|
|
20
|
+
if (props.registry) return props.registry;
|
|
21
|
+
const nuxt = useNuxtApp();
|
|
22
|
+
if (!nuxt.$mapoFormRegistry) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
"[MapoForm] No registry available: pass the `registry` prop or make sure the @mapomodule/form module is installed."
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
return nuxt.$mapoFormRegistry;
|
|
28
|
+
});
|
|
29
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
30
|
+
defineSlots();
|
|
31
|
+
const model = computed({
|
|
32
|
+
get: () => props.modelValue,
|
|
33
|
+
set: (val) => emit("update:modelValue", val)
|
|
34
|
+
});
|
|
35
|
+
const currentLangRef = computed(() => props.currentLang);
|
|
36
|
+
const errorsRef = computed(() => props.errors);
|
|
37
|
+
const globalDebounce = useRuntimeConfig().public.mapoForm?.debounce ?? 300;
|
|
38
|
+
const form = useMapoForm({
|
|
39
|
+
model,
|
|
40
|
+
fields: computed(() => props.fields),
|
|
41
|
+
errors: errorsRef,
|
|
42
|
+
languages: props.languages,
|
|
43
|
+
currentLang: currentLangRef,
|
|
44
|
+
immediate: props.immediate,
|
|
45
|
+
debounce: globalDebounce,
|
|
46
|
+
registry: injectedRegistry.value
|
|
47
|
+
});
|
|
48
|
+
const parentCtx = injectMapoForm();
|
|
49
|
+
watchEffect(() => {
|
|
50
|
+
form.readonly.value = props.readonly;
|
|
51
|
+
if (parentCtx) form.ctx.submitted.value = parentCtx.submitted.value;
|
|
52
|
+
});
|
|
53
|
+
defineExpose({
|
|
54
|
+
submit: form.submit,
|
|
55
|
+
validateClient: form.validateClient,
|
|
56
|
+
resetDirty: form.resetDirty,
|
|
57
|
+
getPatch: form.getPatch,
|
|
58
|
+
isDirty: form.isDirty,
|
|
59
|
+
isLoading: form.isLoading
|
|
60
|
+
});
|
|
61
|
+
const registerValidator = inject(
|
|
62
|
+
"mapoDetailRegisterValidator",
|
|
63
|
+
null
|
|
64
|
+
);
|
|
65
|
+
if (registerValidator) {
|
|
66
|
+
const unregister = registerValidator(form.validateClient);
|
|
67
|
+
onUnmounted(unregister);
|
|
68
|
+
}
|
|
69
|
+
const slots = useSlots();
|
|
70
|
+
const fieldSlotNames = computed(
|
|
71
|
+
() => Object.keys(slots).filter(
|
|
72
|
+
(name) => name.startsWith("field.") || name.startsWith("group.") || name.startsWith("tab.") || name === "tab-bar-end"
|
|
73
|
+
)
|
|
74
|
+
);
|
|
75
|
+
provideCurrentLang(currentLangRef);
|
|
76
|
+
function getOrCreateTab(map, name) {
|
|
77
|
+
if (!map.has(name)) {
|
|
78
|
+
map.set(name, { name, groups: /* @__PURE__ */ new Map(), children: /* @__PURE__ */ new Map() });
|
|
79
|
+
}
|
|
80
|
+
return map.get(name);
|
|
81
|
+
}
|
|
82
|
+
const grouped = computed(() => {
|
|
83
|
+
const tabs = /* @__PURE__ */ new Map();
|
|
84
|
+
for (const field of props.fields) {
|
|
85
|
+
const rawTab = field.tab;
|
|
86
|
+
const tabPath = !rawTab ? ["__default__"] : Array.isArray(rawTab) ? rawTab : rawTab.split("/");
|
|
87
|
+
const groupName = field.group ?? "__flat__";
|
|
88
|
+
let currentMap = tabs;
|
|
89
|
+
for (let i = 0; i < tabPath.length - 1; i++) {
|
|
90
|
+
const parent = getOrCreateTab(currentMap, tabPath[i]);
|
|
91
|
+
currentMap = parent.children;
|
|
92
|
+
}
|
|
93
|
+
const leaf = getOrCreateTab(currentMap, tabPath[tabPath.length - 1]);
|
|
94
|
+
if (!leaf.groups.has(groupName)) {
|
|
95
|
+
leaf.groups.set(groupName, { fields: [], subtabs: /* @__PURE__ */ new Map() });
|
|
96
|
+
}
|
|
97
|
+
const grp = leaf.groups.get(groupName);
|
|
98
|
+
if (field.subtab) {
|
|
99
|
+
if (!grp.subtabs.has(field.subtab)) {
|
|
100
|
+
grp.subtabs.set(field.subtab, []);
|
|
101
|
+
}
|
|
102
|
+
grp.subtabs.get(field.subtab).push(field);
|
|
103
|
+
} else {
|
|
104
|
+
grp.fields.push(field);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return tabs;
|
|
108
|
+
});
|
|
109
|
+
const hasTabs = computed(() => {
|
|
110
|
+
const keys = [...grouped.value.keys()];
|
|
111
|
+
return keys.length > 1 || keys.length === 1 && keys[0] !== "__default__";
|
|
112
|
+
});
|
|
113
|
+
const defaultGroups = computed(
|
|
114
|
+
() => grouped.value.get("__default__")?.groups ?? /* @__PURE__ */ new Map()
|
|
115
|
+
);
|
|
116
|
+
const tabList = computed(() => [...grouped.value.values()]);
|
|
117
|
+
</script>
|
|
118
|
+
|
|
119
|
+
<template>
|
|
120
|
+
<div class="mapo-form space-y-5">
|
|
121
|
+
<!-- All field slots (field.<key>, field.<key>.append, .prepend, .label, …)
|
|
122
|
+
are forwarded generically to inner layers (Tabs → Group → Field). -->
|
|
123
|
+
<MapoFormTabs v-if="hasTabs" :tabs="tabList">
|
|
124
|
+
<template
|
|
125
|
+
v-for="slotName in fieldSlotNames"
|
|
126
|
+
:key="slotName"
|
|
127
|
+
#[slotName]="slotProps"
|
|
128
|
+
>
|
|
129
|
+
<slot :name="slotName" v-bind="slotProps ?? {}" />
|
|
130
|
+
</template>
|
|
131
|
+
</MapoFormTabs>
|
|
132
|
+
|
|
133
|
+
<template v-else>
|
|
134
|
+
<template v-for="[groupName, group] of defaultGroups" :key="groupName">
|
|
135
|
+
<template v-if="groupName !== '__flat__'">
|
|
136
|
+
<slot :name="`group.${groupName}.before`" />
|
|
137
|
+
<MapoFormGroup
|
|
138
|
+
:name="groupName"
|
|
139
|
+
:fields="group.fields"
|
|
140
|
+
:subtabs="group.subtabs"
|
|
141
|
+
>
|
|
142
|
+
<template
|
|
143
|
+
v-for="slotName in fieldSlotNames"
|
|
144
|
+
:key="slotName"
|
|
145
|
+
#[slotName]="slotProps"
|
|
146
|
+
>
|
|
147
|
+
<slot :name="slotName" v-bind="slotProps ?? {}" />
|
|
148
|
+
</template>
|
|
149
|
+
</MapoFormGroup>
|
|
150
|
+
<slot :name="`group.${groupName}.after`" />
|
|
151
|
+
</template>
|
|
152
|
+
|
|
153
|
+
<MapoFormFlatSection
|
|
154
|
+
v-else
|
|
155
|
+
:fields="group.fields"
|
|
156
|
+
>
|
|
157
|
+
<template
|
|
158
|
+
v-for="slotName in fieldSlotNames"
|
|
159
|
+
:key="slotName"
|
|
160
|
+
#[slotName]="slotProps"
|
|
161
|
+
>
|
|
162
|
+
<slot :name="slotName" v-bind="slotProps ?? {}" />
|
|
163
|
+
</template>
|
|
164
|
+
</MapoFormFlatSection>
|
|
165
|
+
</template>
|
|
166
|
+
</template>
|
|
167
|
+
</div>
|
|
168
|
+
</template>
|