@koumoul/vjsf 3.0.0-beta.9 → 3.0.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/README.md +21 -0
- package/package.json +13 -20
- package/src/compat/v2.js +126 -27
- package/src/components/fragments/child-subtitle.vue +25 -0
- package/src/components/fragments/help-message.vue +33 -8
- package/src/components/fragments/section-header.vue +9 -7
- package/src/components/fragments/select-item-icon.vue +2 -2
- package/src/components/fragments/select-item.vue +2 -1
- package/src/components/fragments/select-selection.vue +2 -1
- package/src/components/fragments/selection-group.vue +105 -0
- package/src/components/fragments/text-field-menu.vue +16 -7
- package/src/components/node.vue +58 -41
- package/src/components/nodes/autocomplete.vue +14 -60
- package/src/components/nodes/card.vue +39 -0
- package/src/components/nodes/checkbox-group.vue +39 -0
- package/src/components/nodes/checkbox.vue +31 -26
- package/src/components/nodes/color-picker.vue +10 -5
- package/src/components/nodes/combobox.vue +17 -40
- package/src/components/nodes/date-picker.vue +30 -13
- package/src/components/nodes/date-time-picker.vue +83 -3
- package/src/components/nodes/expansion-panels.vue +17 -9
- package/src/components/nodes/file-input.vue +15 -11
- package/src/components/nodes/list.vue +246 -112
- package/src/components/nodes/number-combobox.vue +18 -39
- package/src/components/nodes/number-field.vue +17 -11
- package/src/components/nodes/one-of-select.vue +53 -27
- package/src/components/nodes/radio-group.vue +58 -0
- package/src/components/nodes/section.vue +4 -1
- package/src/components/nodes/select.vue +15 -54
- package/src/components/nodes/slider.vue +32 -29
- package/src/components/nodes/stepper.vue +10 -2
- package/src/components/nodes/switch-group.vue +39 -0
- package/src/components/nodes/switch.vue +31 -26
- package/src/components/nodes/tabs.vue +20 -8
- package/src/components/nodes/text-field.vue +10 -7
- package/src/components/nodes/textarea.vue +20 -12
- package/src/components/nodes/time-picker.vue +41 -1
- package/src/components/nodes/vertical-tabs.vue +16 -6
- package/src/components/tree.vue +1 -1
- package/src/components/vjsf.vue +11 -1
- package/src/composables/use-comp-defaults.js +19 -0
- package/src/composables/use-dnd.js +2 -1
- package/src/composables/use-get-items.js +53 -0
- package/src/composables/use-node.js +136 -0
- package/src/composables/use-select-node.js +67 -0
- package/src/composables/use-vjsf.js +72 -51
- package/src/index.js +5 -2
- package/src/options.js +67 -0
- package/src/types.ts +64 -33
- package/src/utils/arrays.js +37 -6
- package/types/compat/v2.d.ts.map +1 -1
- package/types/compile/index.d.ts +2 -2
- package/types/compile/index.d.ts.map +1 -1
- package/types/compile/options.d.ts +3 -2
- package/types/compile/options.d.ts.map +1 -1
- package/types/components/fragments/child-subtitle.vue.d.ts +8 -0
- package/types/components/fragments/child-subtitle.vue.d.ts.map +1 -0
- package/types/components/fragments/help-message.vue.d.ts +2 -2
- package/types/components/fragments/node-slot.vue.d.ts +2 -44
- package/types/components/fragments/node-slot.vue.d.ts.map +1 -1
- package/types/components/fragments/section-header.vue.d.ts +4 -2
- package/types/components/fragments/select-item-icon.vue.d.ts +2 -12
- package/types/components/fragments/select-item.vue.d.ts +2 -2
- package/types/components/fragments/select-selection.vue.d.ts +2 -2
- package/types/components/fragments/selection-group.vue.d.ts +5 -0
- package/types/components/fragments/selection-group.vue.d.ts.map +1 -0
- package/types/components/fragments/text-field-menu.vue.d.ts +2 -2
- package/types/components/fragments/text-field-menu.vue.d.ts.map +1 -1
- package/types/components/node.vue.d.ts +2 -2
- package/types/components/nodes/autocomplete.vue.d.ts +2 -24
- package/types/components/nodes/autocomplete.vue.d.ts.map +1 -1
- package/types/components/nodes/card.vue.d.ts +10 -0
- package/types/components/nodes/card.vue.d.ts.map +1 -0
- package/types/components/nodes/checkbox-group.vue.d.ts +5 -0
- package/types/components/nodes/checkbox-group.vue.d.ts.map +1 -0
- package/types/components/nodes/checkbox.vue.d.ts +3 -8
- package/types/components/nodes/color-picker.vue.d.ts +2 -2
- package/types/components/nodes/combobox.vue.d.ts +2 -24
- package/types/components/nodes/combobox.vue.d.ts.map +1 -1
- package/types/components/nodes/date-picker.vue.d.ts +2 -2
- package/types/components/nodes/date-time-picker.vue.d.ts +4 -4
- package/types/components/nodes/expansion-panels.vue.d.ts +2 -2
- package/types/components/nodes/file-input.vue.d.ts +2 -24
- package/types/components/nodes/file-input.vue.d.ts.map +1 -1
- package/types/components/nodes/list.vue.d.ts +2 -2
- package/types/components/nodes/number-combobox.vue.d.ts +2 -24
- package/types/components/nodes/number-combobox.vue.d.ts.map +1 -1
- package/types/components/nodes/number-field.vue.d.ts +2 -24
- package/types/components/nodes/number-field.vue.d.ts.map +1 -1
- package/types/components/nodes/one-of-select.vue.d.ts +2 -2
- package/types/components/nodes/radio-group.vue.d.ts +5 -0
- package/types/components/nodes/radio-group.vue.d.ts.map +1 -0
- package/types/components/nodes/section.vue.d.ts +2 -2
- package/types/components/nodes/select.vue.d.ts +2 -24
- package/types/components/nodes/select.vue.d.ts.map +1 -1
- package/types/components/nodes/slider.vue.d.ts +3 -8
- package/types/components/nodes/stepper.vue.d.ts +2 -2
- package/types/components/nodes/switch-group.vue.d.ts +5 -0
- package/types/components/nodes/switch-group.vue.d.ts.map +1 -0
- package/types/components/nodes/switch.vue.d.ts +3 -8
- package/types/components/nodes/tabs.vue.d.ts +2 -2
- package/types/components/nodes/text-field.vue.d.ts +2 -24
- package/types/components/nodes/text-field.vue.d.ts.map +1 -1
- package/types/components/nodes/textarea.vue.d.ts +2 -24
- package/types/components/nodes/textarea.vue.d.ts.map +1 -1
- package/types/components/nodes/time-picker.vue.d.ts +8 -1
- package/types/components/nodes/vertical-tabs.vue.d.ts +2 -2
- package/types/components/options.d.ts +1 -1
- package/types/components/options.d.ts.map +1 -1
- package/types/components/tree.vue.d.ts +2 -2
- package/types/components/vjsf.vue.d.ts +5 -5
- package/types/composables/use-comp-defaults.d.ts +8 -0
- package/types/composables/use-comp-defaults.d.ts.map +1 -0
- package/types/composables/use-dnd.d.ts +3 -3
- package/types/composables/use-dnd.d.ts.map +1 -1
- package/types/composables/use-field-props.d.ts +30 -0
- package/types/composables/use-field-props.d.ts.map +1 -0
- package/types/composables/use-field.d.ts +31 -0
- package/types/composables/use-field.d.ts.map +1 -0
- package/types/composables/use-get-items.d.ts +12 -0
- package/types/composables/use-get-items.d.ts.map +1 -0
- package/types/composables/use-node.d.ts +32 -0
- package/types/composables/use-node.d.ts.map +1 -0
- package/types/composables/use-select-field.d.ts +21 -0
- package/types/composables/use-select-field.d.ts.map +1 -0
- package/types/composables/use-select-node.d.ts +27 -0
- package/types/composables/use-select-node.d.ts.map +1 -0
- package/types/composables/use-select-props.d.ts +21 -0
- package/types/composables/use-select-props.d.ts.map +1 -0
- package/types/composables/use-select.d.ts +21 -0
- package/types/composables/use-select.d.ts.map +1 -0
- package/types/composables/use-vjsf.d.ts +2 -2
- package/types/composables/use-vjsf.d.ts.map +1 -1
- package/types/iconsets/default-aliases.d.ts +10 -0
- package/types/iconsets/default-aliases.d.ts.map +1 -0
- package/types/iconsets/mdi-svg.d.ts +3 -0
- package/types/iconsets/mdi-svg.d.ts.map +1 -0
- package/types/iconsets/mdi.d.ts +3 -0
- package/types/iconsets/mdi.d.ts.map +1 -0
- package/types/index.d.ts +5 -2
- package/types/index.d.ts.map +1 -1
- package/types/options.d.ts +9 -0
- package/types/options.d.ts.map +1 -0
- package/types/types.d.ts +65 -33
- package/types/types.d.ts.map +1 -1
- package/types/utils/arrays.d.ts +17 -4
- package/types/utils/arrays.d.ts.map +1 -1
- package/types/utils/index.d.ts +0 -3
- package/types/utils/props.d.ts +7 -0
- package/types/utils/props.d.ts.map +1 -1
- package/types/utils/slots.d.ts +8 -0
- package/types/utils/slots.d.ts.map +1 -1
- package/src/compile/index.js +0 -65
- package/src/compile/options.js +0 -19
- package/src/compile/v-jsf-compiled.vue.ejs +0 -61
- package/src/components/options.js +0 -27
- package/src/utils/global-register.js +0 -13
- package/src/utils/index.js +0 -5
- package/src/utils/props.js +0 -107
- package/src/utils/slots.js +0 -18
- package/types/utils/global-register.d.ts +0 -8
- package/types/utils/global-register.d.ts.map +0 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {(Record<string, any> | undefined)[]} propsLevels
|
|
3
|
+
* @returns {Record<string, any> & {class: string[]}}
|
|
4
|
+
*/
|
|
5
|
+
export function mergePropsLevels(propsLevels: (Record<string, any> | undefined)[]): Record<string, any> & {
|
|
6
|
+
class: string[];
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* @param {import('vue').Ref<import('../types.js').VjsfNode>} nodeRef
|
|
10
|
+
* @param {import('../types.js').VjsfStatefulLayout} statefulLayout
|
|
11
|
+
* @param {{isMainComp?: boolean, bindData?: boolean, layoutPropsMap?: (string | [string, string])[]}} [opts]
|
|
12
|
+
*/
|
|
13
|
+
export default function _default(nodeRef: import('vue').Ref<import('../types.js').VjsfNode>, statefulLayout: import('../types.js').VjsfStatefulLayout, opts?: {
|
|
14
|
+
isMainComp?: boolean | undefined;
|
|
15
|
+
bindData?: boolean | undefined;
|
|
16
|
+
layoutPropsMap?: (string | [string, string])[] | undefined;
|
|
17
|
+
} | undefined): {
|
|
18
|
+
localData: import("vue").Ref<any, any>;
|
|
19
|
+
inputProps: import("vue").ComputedRef<Record<string, any> & {
|
|
20
|
+
class: string[];
|
|
21
|
+
}>;
|
|
22
|
+
compProps: import("vue").ComputedRef<Record<string, any> & {
|
|
23
|
+
class: string[];
|
|
24
|
+
}>;
|
|
25
|
+
compSlots: import("vue").ComputedRef<Record<string, any>>;
|
|
26
|
+
options: import("vue").ComputedRef<Required<import("../types.js").VjsfOptions>>;
|
|
27
|
+
skeleton: import("vue").ComputedRef<import("../../../node_modules/@json-layout/core/types/compile/types.js").SkeletonNode>;
|
|
28
|
+
layout: import("vue").ComputedRef<import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").BaseCompObject>;
|
|
29
|
+
data: import("vue").ComputedRef<unknown>;
|
|
30
|
+
children: import("vue").ComputedRef<import("../../../node_modules/@json-layout/core/types/state/types.js").StateNode[] | undefined>;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=use-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-node.d.ts","sourceRoot":"","sources":["../../src/composables/use-node.js"],"names":[],"mappings":"AAcA;;;GAGG;AACH,8CAHW,CAAC,OAAO,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,EAAE,GACjC,OAAO,MAAM,EAAE,GAAG,CAAC,GAAG;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAC,CAqBnD;AAED;;;;GAIG;AACH,0CAJW,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,aAAa,EAAE,QAAQ,CAAC,kBACjD,OAAO,aAAa,EAAE,kBAAkB;;;;;;;eAzBR,MAAM,EAAE;;;eAAR,MAAM,EAAE;;;;;;;;EAuHlD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* specialized use of useFieldProps shared between select and autocomplete components
|
|
3
|
+
* @param {import('vue').Ref<import('../types.js').VjsfSelectNode>} nodeRef
|
|
4
|
+
* @param {import('../types.js').VjsfStatefulLayout} statefulLayout
|
|
5
|
+
*/
|
|
6
|
+
export default function _default(nodeRef: import('vue').Ref<import('../types.js').VjsfSelectNode>, statefulLayout: import('../types.js').VjsfStatefulLayout): {
|
|
7
|
+
localData: import("vue").Ref<any, any>;
|
|
8
|
+
inputProps: import("vue").ComputedRef<Record<string, any> & {
|
|
9
|
+
class: string[];
|
|
10
|
+
}>;
|
|
11
|
+
selectProps: import("vue").ComputedRef<Record<string, any>>;
|
|
12
|
+
compSlots: import("vue").ComputedRef<Record<string, any>>;
|
|
13
|
+
selectSlots: import("vue").ComputedRef<Record<string, any>>;
|
|
14
|
+
getItems: {
|
|
15
|
+
items: import("vue").Ref<import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItems, import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItems>;
|
|
16
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
17
|
+
search: import("vue").Ref<string, string>;
|
|
18
|
+
prepareSelectedItem: (selectedItem: any, itemValue: any) => any;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=use-select-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-select-field.d.ts","sourceRoot":"","sources":["../../src/composables/use-select-field.js"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,0CAHW,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,aAAa,EAAE,cAAc,CAAC,kBACvD,OAAO,aAAa,EAAE,kBAAkB;;;;;;;;;;;;;;EA2DlD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* specialized use of useFieldProps shared between select and autocomplete components
|
|
3
|
+
* @param {import('vue').Ref<import('../types.js').VjsfSelectNode>} nodeRef
|
|
4
|
+
* @param {import('../types.js').VjsfStatefulLayout} statefulLayout
|
|
5
|
+
*/
|
|
6
|
+
export default function _default(nodeRef: import('vue').Ref<import('../types.js').VjsfSelectNode>, statefulLayout: import('../types.js').VjsfStatefulLayout): {
|
|
7
|
+
localData: import("vue").Ref<any, any>;
|
|
8
|
+
inputProps: import("vue").ComputedRef<Record<string, any> & {
|
|
9
|
+
class: string[];
|
|
10
|
+
}>;
|
|
11
|
+
selectProps: import("vue").ComputedRef<{
|
|
12
|
+
[x: string]: any;
|
|
13
|
+
class: string[];
|
|
14
|
+
}>;
|
|
15
|
+
compSlots: import("vue").ComputedRef<Record<string, any>>;
|
|
16
|
+
selectSlots: import("vue").ComputedRef<{
|
|
17
|
+
[x: string]: any;
|
|
18
|
+
}>;
|
|
19
|
+
getItems: {
|
|
20
|
+
hasItems: import("vue").ComputedRef<boolean>;
|
|
21
|
+
items: import("vue").Ref<import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItems, import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItems>;
|
|
22
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
23
|
+
search: import("vue").Ref<string, string>;
|
|
24
|
+
prepareSelectedItem: (selectedItem: any, itemValue: any) => any;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=use-select-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-select-node.d.ts","sourceRoot":"","sources":["../../src/composables/use-select-node.js"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,0CAHW,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,aAAa,EAAE,cAAc,CAAC,kBACvD,OAAO,aAAa,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;;EAyDlD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* specialized use of useFieldProps shared between select and autocomplete components
|
|
3
|
+
* @param {import('vue').Ref<import('../types.js').VjsfSelectNode>} nodeRef
|
|
4
|
+
* @param {import('../types.js').VjsfStatefulLayout} statefulLayout
|
|
5
|
+
*/
|
|
6
|
+
export default function _default(nodeRef: import('vue').Ref<import('../types.js').VjsfSelectNode>, statefulLayout: import('../types.js').VjsfStatefulLayout): {
|
|
7
|
+
modelValue: import("vue").Ref<unknown, unknown>;
|
|
8
|
+
inputProps: import("vue").ComputedRef<Record<string, any> & {
|
|
9
|
+
class: string[];
|
|
10
|
+
}>;
|
|
11
|
+
selectProps: import("vue").ComputedRef<Record<string, any>>;
|
|
12
|
+
compSlots: import("vue").ComputedRef<Record<string, any>>;
|
|
13
|
+
selectSlots: import("vue").ComputedRef<Record<string, any>>;
|
|
14
|
+
getItems: {
|
|
15
|
+
items: import("vue").Ref<import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItems, import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItems>;
|
|
16
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
17
|
+
search: import("vue").Ref<string, string>;
|
|
18
|
+
prepareSelectedItem: (selectedItem: any, itemValue: any) => any;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=use-select-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-select-props.d.ts","sourceRoot":"","sources":["../../src/composables/use-select-props.js"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,0CAHW,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,aAAa,EAAE,cAAc,CAAC,kBACvD,OAAO,aAAa,EAAE,kBAAkB;;;;;;;;;;;;;;EA2DlD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* specialized use of useFieldProps shared between select and autocomplete components
|
|
3
|
+
* @param {import('vue').Ref<import('../types.js').VjsfSelectNode>} nodeRef
|
|
4
|
+
* @param {import('../types.js').VjsfStatefulLayout} statefulLayout
|
|
5
|
+
*/
|
|
6
|
+
export default function _default(nodeRef: import('vue').Ref<import('../types.js').VjsfSelectNode>, statefulLayout: import('../types.js').VjsfStatefulLayout): {
|
|
7
|
+
localData: import("vue").Ref<any, any>;
|
|
8
|
+
inputProps: import("vue").ComputedRef<Record<string, any> & {
|
|
9
|
+
class: string[];
|
|
10
|
+
}>;
|
|
11
|
+
selectProps: import("vue").ComputedRef<Record<string, any>>;
|
|
12
|
+
compSlots: import("vue").ComputedRef<Record<string, any>>;
|
|
13
|
+
selectSlots: import("vue").ComputedRef<Record<string, any>>;
|
|
14
|
+
getItems: {
|
|
15
|
+
items: import("vue").Ref<import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItems, import("../../../node_modules/@json-layout/vocabulary/types/normalized-layout/types.js").SelectItems>;
|
|
16
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
17
|
+
search: import("vue").Ref<string, string>;
|
|
18
|
+
prepareSelectedItem: (selectedItem: any, itemValue: any) => any;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=use-select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-select.d.ts","sourceRoot":"","sources":["../../src/composables/use-select.js"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,0CAHW,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,aAAa,EAAE,cAAc,CAAC,kBACvD,OAAO,aAAa,EAAE,kBAAkB;;;;;;;;;;;;;;EA2DlD"}
|
|
@@ -8,8 +8,8 @@ export const emits: {
|
|
|
8
8
|
*/
|
|
9
9
|
'update:state': (state: import('../types.js').VjsfStatefulLayout) => boolean;
|
|
10
10
|
};
|
|
11
|
-
export function useVjsf(schema: import('vue').Ref<Object>, modelValue: import('vue').Ref<any>, options: import('vue').Ref<import("../types.js").PartialVjsfOptions | null>, nodeComponents: Record<string, import('vue').Component>, emit: any, compile?: typeof import("@json-layout/core").compile | undefined, precompiledLayout?: import("vue").Ref<import("../../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout> | undefined): {
|
|
12
|
-
el: import("vue").Ref<null>;
|
|
11
|
+
export function useVjsf(schema: import('vue').Ref<Object>, modelValue: import('vue').Ref<any>, options: import('vue').Ref<import("../types.js").PartialVjsfOptions | null>, nodeComponents: Record<string, import('vue').Component>, emit: any, compile?: typeof import("@json-layout/core").compile | undefined, precompiledLayout?: import("vue").Ref<import("../../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout, import("../../../node_modules/@json-layout/core/types/compile/types.js").CompiledLayout> | undefined): {
|
|
12
|
+
el: import("vue").Ref<null, null>;
|
|
13
13
|
statefulLayout: import("vue").ShallowRef<import("../types.js").VjsfStatefulLayout | null>;
|
|
14
14
|
stateTree: import("vue").ShallowRef<import("../../../node_modules/@json-layout/core/types/state/types.js").StateTree | null>;
|
|
15
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-vjsf.d.ts","sourceRoot":"","sources":["../../src/composables/use-vjsf.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-vjsf.d.ts","sourceRoot":"","sources":["../../src/composables/use-vjsf.js"],"names":[],"mappings":"AAaA;IACE;;MAEE;gCADO,GAAG;IAGZ;;MAEE;4BADO,OAAO,aAAa,EAAE,kBAAkB;EAGlD;AAWM,gCARI,OAAO,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,cACzB,OAAO,KAAK,EAAE,GAAG,CAAC,GAAG,CAAC,WACtB,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,aAAa,EAAE,kBAAkB,GAAG,IAAI,CAAC,kBAClE,OAAO,MAAM,EAAE,OAAO,KAAK,EAAE,SAAS,CAAC,QACvC,GAAG;;;;EAwIb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-aliases.d.ts","sourceRoot":"","sources":["../../src/iconsets/default-aliases.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdi-svg.d.ts","sourceRoot":"","sources":["../../src/iconsets/mdi-svg.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mdi.d.ts","sourceRoot":"","sources":["../../src/iconsets/mdi.js"],"names":[],"mappings":""}
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export default Vjsf;
|
|
2
|
+
export type Options = import('./types.js').PartialVjsfOptions;
|
|
3
|
+
export type CompileOptions = import('./types.js').PartialVjsfCompileOptions;
|
|
2
4
|
import Vjsf from './components/vjsf.vue';
|
|
3
|
-
import { defaultOptions } from './
|
|
4
|
-
|
|
5
|
+
import { defaultOptions } from './options.js';
|
|
6
|
+
import { defaultIcons } from './options.js';
|
|
7
|
+
export { Vjsf, defaultOptions, defaultIcons };
|
|
5
8
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";sBAKc,OAAO,YAAY,EAAE,kBAAkB;6BACvC,OAAO,YAAY,EAAE,yBAAyB;iBAN3C,uBAAuB;+BACK,cAAc;6BAAd,cAAc"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @type {import('./types.js').VjsfIcons} */
|
|
2
|
+
export const defaultIcons: import('./types.js').VjsfIcons;
|
|
3
|
+
export namespace defaultOptions {
|
|
4
|
+
let nodeComponents: {};
|
|
5
|
+
let plugins: never[];
|
|
6
|
+
let pluginsOptions: {};
|
|
7
|
+
}
|
|
8
|
+
export function getFullOptions(options: Partial<import("./types.js").VjsfOptions> | null, form: any, width: number, globalDefaults: Record<string, unknown> | undefined, slots: import("vue").Slots, defaultNodeComponents: Record<string, import('vue').Component>, onData: (data: any) => void, onUpdate: (statefulLayout: import('@json-layout/core').StatefulLayout) => void, onAutofocus: (key: string) => void): import("./types.js").VjsfOptions;
|
|
9
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.js"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,2BADW,OAAO,YAAY,EAAE,SAAS,CAiBxC;;;;;;AAqBM,wCAXI,QAAQ,OAAO,YAAY,EAAE,WAAW,CAAC,GAAG,IAAI,QAChD,GAAG,SACH,MAAM,kBACN,OAAO,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,SACnC,OAAO,KAAK,EAAE,KAAK,yBACnB,OAAO,MAAM,EAAE,OAAO,KAAK,EAAE,SAAS,CAAC,iBAChC,GAAG,KAAK,IAAI,6BACF,OAAO,mBAAmB,EAAE,cAAc,KAAK,IAAI,qBAC9D,MAAM,KAAK,IAAI,oCA+B/B"}
|
package/types/types.d.ts
CHANGED
|
@@ -1,81 +1,113 @@
|
|
|
1
|
-
import { Component } from 'vue';
|
|
2
|
-
import {
|
|
1
|
+
import type { Component, Slots } from 'vue';
|
|
2
|
+
import type { ComponentInfo } from '@json-layout/vocabulary';
|
|
3
|
+
import { StatefulLayout, StatefulLayoutOptions, StateNode, CheckboxNode, ColorPickerNode, DatePickerNode, DateTimePickerNode, TabsNode, ExpansionPanelsNode, ListNode, NumberFieldNode, OneOfSelectNode, SectionNode, SelectNode, RadioGroupNode, CheckboxGroupNode, SwitchGroupNode, SliderNode, SwitchNode, TextFieldNode, TextareaNode, VerticalTabsNode, StepperNode, ComboboxNode, FileInputNode, CardNode, CompileOptions } from '@json-layout/core';
|
|
3
4
|
export type Density = 'default' | 'comfortable' | 'compact';
|
|
4
|
-
export type
|
|
5
|
-
|
|
5
|
+
export type Plugin = {
|
|
6
|
+
info: ComponentInfo;
|
|
7
|
+
nodeComponent: Component;
|
|
8
|
+
};
|
|
9
|
+
export type VjsfIcons = {
|
|
10
|
+
add: string;
|
|
11
|
+
alert: string;
|
|
12
|
+
calendar: string;
|
|
13
|
+
clock: string;
|
|
14
|
+
close: string;
|
|
15
|
+
delete: string;
|
|
16
|
+
duplicate: string;
|
|
17
|
+
edit: string;
|
|
18
|
+
infoSymbol: string;
|
|
19
|
+
menu: string;
|
|
20
|
+
sort: string;
|
|
21
|
+
sortUp: string;
|
|
22
|
+
sortDown: string;
|
|
23
|
+
};
|
|
24
|
+
export type VjsfStatefulLayoutOptions = Partial<StatefulLayoutOptions> & {
|
|
25
|
+
vjsfSlots: Slots;
|
|
6
26
|
nodeComponents: Record<string, Component>;
|
|
7
|
-
plugins:
|
|
27
|
+
plugins: Plugin[];
|
|
28
|
+
pluginsOptions: Record<string, unknown>;
|
|
29
|
+
icons: VjsfIcons;
|
|
8
30
|
};
|
|
9
|
-
export type VjsfCompileOptions = CompileOptions & {
|
|
10
|
-
|
|
31
|
+
export type VjsfCompileOptions = Partial<CompileOptions> & {
|
|
32
|
+
pluginsImports: string[];
|
|
11
33
|
};
|
|
12
|
-
export type
|
|
34
|
+
export type PartialVjsfCompileOptions = Partial<VjsfCompileOptions>;
|
|
35
|
+
export type VjsfOptions = PartialVjsfCompileOptions & VjsfStatefulLayoutOptions;
|
|
36
|
+
export type PartialVjsfOptions = Partial<Omit<VjsfOptions, 'width' | 'vjsfSlots' | 'onData' | 'onUpdate' | 'onAutofocus'>>;
|
|
37
|
+
export type FullVjsfNodeOptions = Required<VjsfOptions>;
|
|
13
38
|
export type VjsfStatefulLayout = Omit<StatefulLayout, 'options'> & {
|
|
14
39
|
options: VjsfStatefulLayoutOptions;
|
|
15
40
|
};
|
|
16
|
-
export type PartialVjsfCompileOptions = Partial<Omit<VjsfCompileOptions, 'width'>>;
|
|
17
|
-
export type PartialVjsfOptions = Partial<Omit<VjsfOptions, 'width'>>;
|
|
18
41
|
export type VjsfNode = Omit<StateNode, 'options'> & {
|
|
19
|
-
options:
|
|
42
|
+
options: FullVjsfNodeOptions;
|
|
20
43
|
};
|
|
21
44
|
export type VjsfTabsNode = Omit<TabsNode, 'options'> & {
|
|
22
|
-
options:
|
|
45
|
+
options: FullVjsfNodeOptions;
|
|
23
46
|
};
|
|
24
47
|
export type VjsfCheckboxNode = Omit<CheckboxNode, 'options'> & {
|
|
25
|
-
options:
|
|
48
|
+
options: FullVjsfNodeOptions;
|
|
26
49
|
};
|
|
27
50
|
export type VjsfColorPickerNode = Omit<ColorPickerNode, 'options'> & {
|
|
28
|
-
options:
|
|
51
|
+
options: FullVjsfNodeOptions;
|
|
29
52
|
};
|
|
30
53
|
export type VjsfDatePickerNode = Omit<DatePickerNode, 'options'> & {
|
|
31
|
-
options:
|
|
54
|
+
options: FullVjsfNodeOptions;
|
|
32
55
|
};
|
|
33
56
|
export type VjsfDateTimePickerNode = Omit<DateTimePickerNode, 'options'> & {
|
|
34
|
-
options:
|
|
57
|
+
options: FullVjsfNodeOptions;
|
|
35
58
|
};
|
|
36
59
|
export type VjsfExpansionPanelsNode = Omit<ExpansionPanelsNode, 'options'> & {
|
|
37
|
-
options:
|
|
60
|
+
options: FullVjsfNodeOptions;
|
|
38
61
|
};
|
|
39
62
|
export type VjsfListNode = Omit<ListNode, 'options'> & {
|
|
40
|
-
options:
|
|
63
|
+
options: FullVjsfNodeOptions;
|
|
41
64
|
};
|
|
42
65
|
export type VjsfNumberFieldNode = Omit<NumberFieldNode, 'options'> & {
|
|
43
|
-
options:
|
|
66
|
+
options: FullVjsfNodeOptions;
|
|
44
67
|
};
|
|
45
68
|
export type VjsfOneOfSelectNode = Omit<OneOfSelectNode, 'options'> & {
|
|
46
|
-
options:
|
|
69
|
+
options: FullVjsfNodeOptions;
|
|
47
70
|
};
|
|
48
71
|
export type VjsfSectionNode = Omit<SectionNode, 'options'> & {
|
|
49
|
-
options:
|
|
72
|
+
options: FullVjsfNodeOptions;
|
|
50
73
|
};
|
|
51
74
|
export type VjsfSelectNode = Omit<SelectNode, 'options'> & {
|
|
52
|
-
options:
|
|
75
|
+
options: FullVjsfNodeOptions;
|
|
76
|
+
};
|
|
77
|
+
export type VjsfRadioGroupNode = Omit<RadioGroupNode, 'options'> & {
|
|
78
|
+
options: FullVjsfNodeOptions;
|
|
79
|
+
};
|
|
80
|
+
export type VjsfCheckboxGroupNode = Omit<CheckboxGroupNode, 'options'> & {
|
|
81
|
+
options: FullVjsfNodeOptions;
|
|
82
|
+
};
|
|
83
|
+
export type VjsfSwitchGroupNode = Omit<SwitchGroupNode, 'options'> & {
|
|
84
|
+
options: FullVjsfNodeOptions;
|
|
53
85
|
};
|
|
54
86
|
export type VjsfSliderNode = Omit<SliderNode, 'options'> & {
|
|
55
|
-
options:
|
|
87
|
+
options: FullVjsfNodeOptions;
|
|
56
88
|
};
|
|
57
89
|
export type VjsfSwitchNode = Omit<SwitchNode, 'options'> & {
|
|
58
|
-
options:
|
|
90
|
+
options: FullVjsfNodeOptions;
|
|
59
91
|
};
|
|
60
92
|
export type VjsfTextFieldNode = Omit<TextFieldNode, 'options'> & {
|
|
61
|
-
options:
|
|
93
|
+
options: FullVjsfNodeOptions;
|
|
62
94
|
};
|
|
63
95
|
export type VjsfTextareaNode = Omit<TextareaNode, 'options'> & {
|
|
64
|
-
options:
|
|
65
|
-
};
|
|
66
|
-
export type VjsfMarkdownNode = Omit<MarkdownNode, 'options'> & {
|
|
67
|
-
options: VjsfOptions;
|
|
96
|
+
options: FullVjsfNodeOptions;
|
|
68
97
|
};
|
|
69
98
|
export type VjsfVerticalTabsNode = Omit<VerticalTabsNode, 'options'> & {
|
|
70
|
-
options:
|
|
99
|
+
options: FullVjsfNodeOptions;
|
|
71
100
|
};
|
|
72
101
|
export type VjsfStepperNode = Omit<StepperNode, 'options'> & {
|
|
73
|
-
options:
|
|
102
|
+
options: FullVjsfNodeOptions;
|
|
74
103
|
};
|
|
75
104
|
export type VjsfComboboxNode = Omit<ComboboxNode, 'options'> & {
|
|
76
|
-
options:
|
|
105
|
+
options: FullVjsfNodeOptions;
|
|
77
106
|
};
|
|
78
107
|
export type VjsfFileInputNode = Omit<FileInputNode, 'options'> & {
|
|
79
|
-
options:
|
|
108
|
+
options: FullVjsfNodeOptions;
|
|
109
|
+
};
|
|
110
|
+
export type VjsfCardNode = Omit<CardNode, 'options'> & {
|
|
111
|
+
options: FullVjsfNodeOptions;
|
|
80
112
|
};
|
|
81
113
|
//# sourceMappingURL=types.d.ts.map
|
package/types/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,KAAK,CAAA;AAE3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAE5D,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,SAAS,EACT,YAAY,EACZ,eAAe,EACf,cAAc,EACd,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GAAG;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAC,CAAA;AACzF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAC,CAAA;AAC/F,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAC,CAAA;AAC7F,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAC,CAAA;AACrG,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAC,CAAA;AAC3F,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAC,CAAA;AAC7F,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAC,CAAA;AAC/F,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAC,CAAA"}
|
package/types/utils/arrays.d.ts
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @
|
|
3
|
-
* @param {T[]} array
|
|
2
|
+
* @param {any[] | Record<string, any>} data
|
|
4
3
|
* @param {number} fromIndex
|
|
5
4
|
* @param {number} toIndex
|
|
6
|
-
* @return {
|
|
5
|
+
* @return {any[] | Record<string, any>}
|
|
7
6
|
*/
|
|
8
|
-
export function
|
|
7
|
+
export function moveDataItem(data: any[] | Record<string, any>, fromIndex: number, toIndex: number): any[] | Record<string, any>;
|
|
8
|
+
/**
|
|
9
|
+
* @param {any[]} data
|
|
10
|
+
* @param {number} fromIndex
|
|
11
|
+
* @param {number} toIndex
|
|
12
|
+
* @return {any[]}
|
|
13
|
+
*/
|
|
14
|
+
export function moveArrayItem(data: any[], fromIndex: number, toIndex: number): any[];
|
|
15
|
+
/**
|
|
16
|
+
* @param {Record<string, any>} data
|
|
17
|
+
* @param {number} fromIndex
|
|
18
|
+
* @param {number} toIndex
|
|
19
|
+
* @return {Record<string, any>}
|
|
20
|
+
*/
|
|
21
|
+
export function moveObjectItem(data: Record<string, any>, fromIndex: number, toIndex: number): Record<string, any>;
|
|
9
22
|
//# sourceMappingURL=arrays.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../../src/utils/arrays.js"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../../src/utils/arrays.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,mCALW,GAAG,EAAE,GAAG,OAAO,MAAM,EAAE,GAAG,CAAC,aAC3B,MAAM,WACN,MAAM,GACL,GAAG,EAAE,GAAG,OAAO,MAAM,EAAE,GAAG,CAAC,CAMtC;AAED;;;;;GAKG;AACH,oCALW,GAAG,EAAE,aACL,MAAM,WACN,MAAM,GACL,GAAG,EAAE,CAWhB;AAED;;;;;GAKG;AACH,qCALW,OAAO,MAAM,EAAE,GAAG,CAAC,aACnB,MAAM,WACN,MAAM,GACL,OAAO,MAAM,EAAE,GAAG,CAAC,CAY9B"}
|
package/types/utils/index.d.ts
CHANGED
package/types/utils/props.d.ts
CHANGED
|
@@ -19,4 +19,11 @@ export function getInputProps(node: import('../types.js').VjsfNode, statefulLayo
|
|
|
19
19
|
* @returns {Record<string, any>}
|
|
20
20
|
*/
|
|
21
21
|
export function getCompProps(node: import('@json-layout/core').StateNode, isMainComp?: boolean): Record<string, any>;
|
|
22
|
+
/**
|
|
23
|
+
* shared between select and autocomplete components
|
|
24
|
+
* @param {import('../types.js').VjsfNode} node
|
|
25
|
+
* @param {import('../types.js').VjsfStatefulLayout} statefulLayout
|
|
26
|
+
* @returns {Record<string, any>}
|
|
27
|
+
*/
|
|
28
|
+
export function getSelectProps(node: import('../types.js').VjsfNode, statefulLayout: import('../types.js').VjsfStatefulLayout): Record<string, any>;
|
|
22
29
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/utils/props.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/utils/props.js"],"names":[],"mappings":"AAcA;;;GAGG;AACH,8CAHW,CAAC,OAAO,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,EAAE,GACjC,OAAO,MAAM,EAAE,GAAG,CAAC,GAAG;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAC,CAqBnD;AAID;;;;;;GAMG;AACH,oCANW,OAAO,aAAa,EAAE,QAAQ,kBAC9B,OAAO,aAAa,EAAE,kBAAkB,iGAGtC,OAAO,MAAM,EAAE,GAAG,CAAC,CA2C/B;AAGD;;;;GAIG;AACH,mCAJW,OAAO,mBAAmB,EAAE,SAAS,eACrC,OAAO,GACL,OAAO,MAAM,EAAE,GAAG,CAAC,CAS/B;AAED;;;;;GAKG;AACH,qCAJW,OAAO,aAAa,EAAE,QAAQ,kBAC9B,OAAO,aAAa,EAAE,kBAAkB,GACtC,OAAO,MAAM,EAAE,GAAG,CAAC,CAyB/B"}
|
package/types/utils/slots.d.ts
CHANGED
|
@@ -4,4 +4,12 @@
|
|
|
4
4
|
* @returns {Record<string, any>}
|
|
5
5
|
*/
|
|
6
6
|
export function getCompSlots(node: import('../types.js').VjsfNode, statefulLayout: import('../types.js').VjsfStatefulLayout): Record<string, any>;
|
|
7
|
+
/**
|
|
8
|
+
* shared between select and autocomplete components
|
|
9
|
+
* @param {import('../types.js').VjsfSelectNode} node
|
|
10
|
+
* @param {import('../types.js').VjsfStatefulLayout} statefulLayout
|
|
11
|
+
* @param {any} getItems
|
|
12
|
+
* @returns {Record<string, any>}
|
|
13
|
+
*/
|
|
14
|
+
export function getSelectSlots(node: import('../types.js').VjsfSelectNode, statefulLayout: import('../types.js').VjsfStatefulLayout, getItems: any): Record<string, any>;
|
|
7
15
|
//# sourceMappingURL=slots.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../src/utils/slots.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../src/utils/slots.js"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,mCAJW,OAAO,aAAa,EAAE,QAAQ,kBAC9B,OAAO,aAAa,EAAE,kBAAkB,GACtC,OAAO,MAAM,EAAE,GAAG,CAAC,CAU/B;AAED;;;;;;GAMG;AACH,qCALW,OAAO,aAAa,EAAE,cAAc,kBACpC,OAAO,aAAa,EAAE,kBAAkB,YACxC,GAAG,GACD,OAAO,MAAM,EAAE,GAAG,CAAC,CAmB/B"}
|
package/src/compile/index.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from 'fs'
|
|
2
|
-
import { fileURLToPath } from 'url'
|
|
3
|
-
import path from 'path'
|
|
4
|
-
import ejs from 'ejs'
|
|
5
|
-
import { compile as compileLayout } from '@json-layout/core'
|
|
6
|
-
import { serialize as serializeCompiledLayout } from '@json-layout/core/src/compile/serialize'
|
|
7
|
-
import { childIsCompObject, isCompObject, isSwitchStruct } from '@json-layout/vocabulary'
|
|
8
|
-
import { getFullOptions } from './options.js'
|
|
9
|
-
|
|
10
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
11
|
-
|
|
12
|
-
const template = readFileSync(path.join(__dirname, 'v-jsf-compiled.vue.ejs'), 'utf8')
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
* @param {Set<string>} comps
|
|
17
|
-
* @param {import('@json-layout/vocabulary').NormalizedLayout} layout
|
|
18
|
-
*/
|
|
19
|
-
function listComps (comps, layout) {
|
|
20
|
-
if (isCompObject(layout)) {
|
|
21
|
-
comps.add(layout.comp)
|
|
22
|
-
if (layout.children) {
|
|
23
|
-
for (const child of /** @type {import('@json-layout/vocabulary').Children} */(layout.children)) {
|
|
24
|
-
if (childIsCompObject(child)) {
|
|
25
|
-
listComps(comps, child)
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
} else if (isSwitchStruct(layout)) {
|
|
30
|
-
for (const switchCase of layout.switch) {
|
|
31
|
-
listComps(comps, switchCase)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* @param {object} schema
|
|
38
|
-
* @param {import('../types.js').PartialVjsfCompileOptions} [options]
|
|
39
|
-
* @param {string} [baseImport]
|
|
40
|
-
* @returns {string}
|
|
41
|
-
*/
|
|
42
|
-
export function compile (schema, options = {}, baseImport = '@koumoul/vjsf') {
|
|
43
|
-
const fullOptions = getFullOptions(options)
|
|
44
|
-
const compiledLayout = compileLayout(schema, { ...fullOptions, code: true })
|
|
45
|
-
const compiledLayoutCode = serializeCompiledLayout(compiledLayout)
|
|
46
|
-
/** @type Set<string> */
|
|
47
|
-
const comps = new Set([])
|
|
48
|
-
for (const layout of Object.values(compiledLayout.normalizedLayouts)) {
|
|
49
|
-
listComps(comps, layout)
|
|
50
|
-
}
|
|
51
|
-
comps.delete('none')
|
|
52
|
-
|
|
53
|
-
const compImports = [...comps].map(comp => {
|
|
54
|
-
const compName = comp.replace(/-/g, '') + 'Node'
|
|
55
|
-
const compImport = fullOptions.nodeComponentImports[comp] ?? `${baseImport}/components/nodes/${comp}.vue`
|
|
56
|
-
return {
|
|
57
|
-
comp,
|
|
58
|
-
compName,
|
|
59
|
-
compImport
|
|
60
|
-
}
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
const code = ejs.render(template, { compiledLayoutCode, compImports, baseImport })
|
|
64
|
-
return code
|
|
65
|
-
}
|
package/src/compile/options.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** @type import("../types.js").PartialVjsfCompileOptions */
|
|
2
|
-
export const defaultOptions = {
|
|
3
|
-
nodeComponentImports: {
|
|
4
|
-
markdown: '@koumoul/vjsf-markdown/components/nodes/markdown.vue'
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param {import("../types.js").PartialVjsfCompileOptions} options
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
export const getFullOptions = (options) => {
|
|
14
|
-
const fullOptions = {
|
|
15
|
-
...defaultOptions,
|
|
16
|
-
nodeComponentImports: { ...defaultOptions.nodeComponentImports, ...options.nodeComponentImports }
|
|
17
|
-
}
|
|
18
|
-
return /** @type import('../types.js').VjsfCompileOptions */ (fullOptions)
|
|
19
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
|
|
4
|
-
import { StatefulLayout } from '@json-layout/core'
|
|
5
|
-
import { ref, shallowRef, getCurrentInstance, useSlots, computed } from 'vue'
|
|
6
|
-
import { useElementSize } from '@vueuse/core'
|
|
7
|
-
|
|
8
|
-
import { defaultOptions } from '<%- baseImport %>/components/options.js'
|
|
9
|
-
import Tree from '<%- baseImport %>/components/tree.vue'
|
|
10
|
-
import { useVjsf, emits } from '<%- baseImport %>/composables/use-vjsf.js'
|
|
11
|
-
import '<%- baseImport %>/styles/vjsf.css'
|
|
12
|
-
|
|
13
|
-
<% compImports.forEach(function({compName, compImport}){ %>
|
|
14
|
-
import <%= compName %> from '<%- compImport %>'
|
|
15
|
-
<% }); %>
|
|
16
|
-
|
|
17
|
-
<%- compiledLayoutCode %>
|
|
18
|
-
|
|
19
|
-
const nodeComponents = {
|
|
20
|
-
<% compImports.forEach(function({comp, compName}){ %>
|
|
21
|
-
"<%= comp %>": <%= compName %>,
|
|
22
|
-
<% }); %>
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const props = defineProps({
|
|
26
|
-
modelValue: {
|
|
27
|
-
type: null,
|
|
28
|
-
default: null
|
|
29
|
-
},
|
|
30
|
-
options: {
|
|
31
|
-
/** @type import('vue').PropType<import('<%- baseImport %>/types.js').PartialVjsfOptions | null> */
|
|
32
|
-
type: Object,
|
|
33
|
-
default: null
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
const emit = defineEmits(emits)
|
|
38
|
-
|
|
39
|
-
const { el, statefulLayout, stateTree } = useVjsf(
|
|
40
|
-
null,
|
|
41
|
-
computed(() => props.modelValue),
|
|
42
|
-
computed(() => props.options),
|
|
43
|
-
nodeComponents,
|
|
44
|
-
emit,
|
|
45
|
-
null,
|
|
46
|
-
computed(() => compiledLayout)
|
|
47
|
-
)
|
|
48
|
-
</script>
|
|
49
|
-
|
|
50
|
-
<template>
|
|
51
|
-
<div
|
|
52
|
-
ref="el"
|
|
53
|
-
class="vjsf"
|
|
54
|
-
>
|
|
55
|
-
<tree
|
|
56
|
-
v-if="statefulLayout && stateTree"
|
|
57
|
-
:model-value="stateTree"
|
|
58
|
-
:stateful-layout="statefulLayout"
|
|
59
|
-
/>
|
|
60
|
-
</div>
|
|
61
|
-
</template>
|