@koumoul/vjsf 3.0.0-beta.5 → 3.0.0-beta.51
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 +12 -17
- package/src/compat/v2.js +132 -27
- package/src/compile/index.js +19 -4
- package/src/compile/options.js +4 -9
- package/src/compile/v-jsf-compiled.vue.ejs +1 -2
- 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 -4
- 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 +34 -16
- package/src/components/nodes/file-input.vue +15 -11
- package/src/components/nodes/list.vue +251 -111
- 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 +70 -40
- package/src/index.js +5 -2
- package/src/options.js +65 -0
- package/src/types.ts +64 -33
- package/src/utils/arrays.js +37 -6
- package/src/utils/build.js +1 -1
- 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 +4 -4
- 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/build.d.ts +1 -1
- package/types/utils/index.d.ts +0 -3
- package/types/utils/props.d.ts +8 -2
- 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/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 -109
- 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,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":"AAYA;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;;;;EAmIb"}
|
|
@@ -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, 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;;;;;;AAoBM,wCAVI,QAAQ,OAAO,YAAY,EAAE,WAAW,CAAC,GAAG,IAAI,QAChD,GAAG,SACH,MAAM,SACN,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,oCA8B/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,kBAAkB,EAClB,QAAQ,EACR,mBAAmB,EACnB,QAAQ,EACR,eAAe,EACf,eAAe,EACf,WAAW,EACX,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,UAAU,EACV,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,cAAc,EACf,MAAM,mBAAmB,CAAA;AAE1B,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAAA;AAE3D,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,EAAE,SAAS,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,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AM,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/build.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { commonjsDeps } from "@json-layout/core/utils/build";
|
|
1
|
+
export { commonjsDeps, commonjsDepsPaths } from "@json-layout/core/utils/build";
|
|
2
2
|
//# sourceMappingURL=build.d.ts.map
|
package/types/utils/index.d.ts
CHANGED
package/types/utils/props.d.ts
CHANGED
|
@@ -15,9 +15,15 @@ export function mergePropsLevels(propsLevels: (Record<string, any> | undefined)[
|
|
|
15
15
|
export function getInputProps(node: import('../types.js').VjsfNode, statefulLayout: import('../types.js').VjsfStatefulLayout, layoutPropsMap?: (string | [string, string])[] | undefined, isMainComp?: boolean | undefined): Record<string, any>;
|
|
16
16
|
/**
|
|
17
17
|
* @param {import('@json-layout/core').StateNode} node
|
|
18
|
-
* @param {string} comp
|
|
19
18
|
* @param {boolean} isMainComp
|
|
20
19
|
* @returns {Record<string, any>}
|
|
21
20
|
*/
|
|
22
|
-
export function getCompProps(node: import('@json-layout/core').StateNode,
|
|
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>;
|
|
23
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"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/** @type {import("../types.js").PartialVjsfOptions} */
|
|
2
|
-
export const defaultOptions = {
|
|
3
|
-
nodeComponents: {},
|
|
4
|
-
plugins: {}
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @param {Partial<import("../types.js").VjsfOptions> | null} options
|
|
10
|
-
* @param {any} form
|
|
11
|
-
* @param {number} width
|
|
12
|
-
* @param {import("vue").Slots} slots
|
|
13
|
-
* @param {Record<string, import('vue').Component>} nodeComponents
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
export const getFullOptions = (options, form, width, slots, nodeComponents) => {
|
|
17
|
-
const fullOptions = {
|
|
18
|
-
...defaultOptions,
|
|
19
|
-
readOnly: !!(form && (form.isDisabled.value || form.isReadonly.value)),
|
|
20
|
-
...options,
|
|
21
|
-
context: options?.context ? JSON.parse(JSON.stringify(options.context)) : {},
|
|
22
|
-
width: Math.round(width ?? 0),
|
|
23
|
-
vjsfSlots: { ...slots },
|
|
24
|
-
nodeComponents: { ...nodeComponents, ...options?.nodeComponents }
|
|
25
|
-
}
|
|
26
|
-
return /** @type import('../types.js').VjsfOptions */ (fullOptions)
|
|
27
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ref } from 'vue'
|
|
2
|
-
|
|
3
|
-
/** @type {import('vue').Ref<Record<string, import('vue').Component>>} */
|
|
4
|
-
export const registeredNodeComponents = ref({})
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @param {string} name
|
|
8
|
-
* @param {import('vue').Component} component
|
|
9
|
-
*/
|
|
10
|
-
export function registerNodeComponent (name, component) {
|
|
11
|
-
console.log('vjsf - register plugin node component', name)
|
|
12
|
-
registeredNodeComponents.value[name] = component
|
|
13
|
-
}
|
package/src/utils/index.js
DELETED
package/src/utils/props.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { camelize } from 'vue'
|
|
3
|
-
|
|
4
|
-
// NOTE: in a previous draft we used to have this in options,
|
|
5
|
-
// but it was not very flexible and not very easy to use, user defined props should be managed
|
|
6
|
-
// by a combination of layout.props, layout.getProps and vuetify defaults provider (https://vuetifyjs.com/en/components/defaults-providers/#usage)
|
|
7
|
-
const defaultProps = {
|
|
8
|
-
fieldPropsCompact: {
|
|
9
|
-
density: 'compact',
|
|
10
|
-
hideDetails: 'auto'
|
|
11
|
-
},
|
|
12
|
-
fieldPropsComfortable: {
|
|
13
|
-
density: 'comfortable'
|
|
14
|
-
},
|
|
15
|
-
fieldPropsReadOnly: { hideDetails: 'auto', variant: 'plain' },
|
|
16
|
-
fieldPropsSummary: { hideDetails: true }
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @param {(Record<string, any> | undefined)[]} propsLevels
|
|
21
|
-
* @returns {Record<string, any> & {class: string[]}}
|
|
22
|
-
*/
|
|
23
|
-
export function mergePropsLevels (propsLevels) {
|
|
24
|
-
/** @type {Record<string, any> & {class: string[]}} */
|
|
25
|
-
const fullProps = { class: [] }
|
|
26
|
-
for (const propsLevel of propsLevels) {
|
|
27
|
-
if (propsLevel) {
|
|
28
|
-
for (const key of Object.keys(propsLevel)) {
|
|
29
|
-
if (key === 'class') {
|
|
30
|
-
// a small convention for merging/overwriting classes:
|
|
31
|
-
// a class defined as a simple string overwrites the previous ones
|
|
32
|
-
// a class defined as an array is merged with the previous ones
|
|
33
|
-
if (Array.isArray(propsLevel.class)) fullProps.class = fullProps.class.concat(propsLevel.class)
|
|
34
|
-
else fullProps.class = [propsLevel.class]
|
|
35
|
-
} else {
|
|
36
|
-
fullProps[camelize(key)] = propsLevel[key]
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return fullProps
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// calculate the props of a field/input type component (text fields, etc)
|
|
45
|
-
// isMainComp is used to determine if this input component is also the main rendered component or if is mostly a wrapper (date picker, etc.)
|
|
46
|
-
/**
|
|
47
|
-
* @param {import('../types.js').VjsfNode} node
|
|
48
|
-
* @param {import('../types.js').VjsfStatefulLayout} statefulLayout
|
|
49
|
-
* @param {(string | [string, string])[]} [layoutPropsMap]
|
|
50
|
-
* @param {boolean} [isMainComp]
|
|
51
|
-
* @returns {Record<string, any>}
|
|
52
|
-
*/
|
|
53
|
-
export function getInputProps (node, statefulLayout, layoutPropsMap, isMainComp = true) {
|
|
54
|
-
const options = node.options
|
|
55
|
-
/** @type {(Record<string, any> | undefined)[]} */
|
|
56
|
-
const propsLevels = []
|
|
57
|
-
if (options.density === 'comfortable') propsLevels.push(defaultProps.fieldPropsComfortable)
|
|
58
|
-
if (options.density === 'compact') propsLevels.push(defaultProps.fieldPropsCompact)
|
|
59
|
-
if (node.options.readOnly) propsLevels.push(defaultProps.fieldPropsReadOnly)
|
|
60
|
-
if (isMainComp && node.props) propsLevels.push(node.props)
|
|
61
|
-
|
|
62
|
-
const fullProps = mergePropsLevels(propsLevels)
|
|
63
|
-
|
|
64
|
-
fullProps.label = node.layout.label
|
|
65
|
-
if (node.error && node.validated) {
|
|
66
|
-
fullProps.errorMessages = node.error
|
|
67
|
-
}
|
|
68
|
-
fullProps.modelValue = node.data
|
|
69
|
-
if (node.options.readOnly) {
|
|
70
|
-
fullProps.disabled = true
|
|
71
|
-
fullProps.class.push('vjsf-input--readonly')
|
|
72
|
-
}
|
|
73
|
-
if (node.autofocus) {
|
|
74
|
-
fullProps.class.push('vjsf-input--autofocus')
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (layoutPropsMap) {
|
|
78
|
-
for (const propMap of layoutPropsMap) {
|
|
79
|
-
if (typeof propMap === 'string') fullProps[propMap] = node.layout[propMap]
|
|
80
|
-
else fullProps[propMap[0]] = node.layout[propMap[1]]
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (isMainComp) {
|
|
85
|
-
fullProps['onUpdate:modelValue'] = (/** @type string */value) => statefulLayout.input(node, value)
|
|
86
|
-
fullProps.onBlur = () => statefulLayout.blur(node)
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return fullProps
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// calculate the props of components that are not of the field category
|
|
93
|
-
/**
|
|
94
|
-
* @param {import('@json-layout/core').StateNode} node
|
|
95
|
-
* @param {string} comp
|
|
96
|
-
* @param {boolean} isMainComp
|
|
97
|
-
* @returns {Record<string, any>}
|
|
98
|
-
*/
|
|
99
|
-
export function getCompProps (node, comp, isMainComp = true) {
|
|
100
|
-
const options = /** @type import('../types.js').VjsfOptions */(node.options)
|
|
101
|
-
/** @type {(Record<string, any> | undefined)[]} */
|
|
102
|
-
const propsLevels = [{ density: options.density }]
|
|
103
|
-
propsLevels.push(/** @type Record<string, any> | undefined */(options[`${comp}Props`]))
|
|
104
|
-
if (node.options.readOnly) propsLevels.push(/** @type Record<string, any> | undefined */(options[`${comp}PropsReadOnly`]))
|
|
105
|
-
if (isMainComp) propsLevels.push(node.layout.props)
|
|
106
|
-
const fullProps = mergePropsLevels(propsLevels)
|
|
107
|
-
if (isMainComp) fullProps.modelValue = node.data
|
|
108
|
-
return fullProps
|
|
109
|
-
}
|