@koumoul/vjsf 3.3.4 → 3.4.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/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useDefaults } from 'vuetify'
|
|
1
|
+
import { useDefaults, useLocale } from 'vuetify'
|
|
2
2
|
import { StatefulLayout, produceCompileOptions } from '@json-layout/core'
|
|
3
3
|
import { inject, toRaw, shallowRef, computed, ref, watch, useSlots, getCurrentInstance } from 'vue'
|
|
4
4
|
import { useElementSize } from '@vueuse/core'
|
|
@@ -104,7 +104,9 @@ export const useVjsf = (schema, modelValue, options, nodeComponents, emit, compi
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
const
|
|
107
|
+
const locale = useLocale()
|
|
108
|
+
|
|
109
|
+
const fullOptions = computed(() => getFullOptions(options.value, form, width.value, locale.current.value, defaults?.global, slots, { ...nodeComponents }, onDataUpdate, onStatefulLayoutUpdate, onAutofocus))
|
|
108
110
|
|
|
109
111
|
// do not use a simple computed here as we want to prevent recompiling the layout when the options are the same
|
|
110
112
|
/** @type {import('vue').Ref<import('@json-layout/core').PartialCompileOptions>} */
|
package/src/options.js
CHANGED
|
@@ -28,6 +28,7 @@ export const defaultOptions = {
|
|
|
28
28
|
* @param {Partial<import("./types.js").VjsfOptions> | null} options
|
|
29
29
|
* @param {any} form
|
|
30
30
|
* @param {number} width
|
|
31
|
+
* @param {string} locale
|
|
31
32
|
* @param {Record<string, unknown> | undefined} globalDefaults
|
|
32
33
|
* @param {import("vue").Slots} slots
|
|
33
34
|
* @param {Record<string, import('vue').Component>} defaultNodeComponents
|
|
@@ -36,7 +37,7 @@ export const defaultOptions = {
|
|
|
36
37
|
* @param {(key: string) => void} onAutofocus
|
|
37
38
|
* @returns
|
|
38
39
|
*/
|
|
39
|
-
export const getFullOptions = (options, form, width, globalDefaults, slots, defaultNodeComponents, onData, onUpdate, onAutofocus) => {
|
|
40
|
+
export const getFullOptions = (options, form, width, locale, globalDefaults, slots, defaultNodeComponents, onData, onUpdate, onAutofocus) => {
|
|
40
41
|
const components = { ...options?.components }
|
|
41
42
|
const nodeComponents = { ...defaultNodeComponents, ...options?.nodeComponents }
|
|
42
43
|
if (options?.plugins) {
|
|
@@ -52,6 +53,7 @@ export const getFullOptions = (options, form, width, globalDefaults, slots, defa
|
|
|
52
53
|
...defaultOptions,
|
|
53
54
|
readOnly: !!(form && (form.isDisabled.value || form.isReadonly.value)),
|
|
54
55
|
density: /** @type {import("./types.js").VjsfOptions['density']} */(globalDefaults?.density),
|
|
56
|
+
locale,
|
|
55
57
|
...options,
|
|
56
58
|
onData,
|
|
57
59
|
onUpdate,
|
|
@@ -1 +1 @@
|
|
|
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;;;;
|
|
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;;;;EA6Ib"}
|
package/types/options.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export namespace defaultOptions {
|
|
|
5
5
|
let plugins: never[];
|
|
6
6
|
let pluginsOptions: {};
|
|
7
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;
|
|
8
|
+
export function getFullOptions(options: Partial<import("./types.js").VjsfOptions> | null, form: any, width: number, locale: string, 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
9
|
//# sourceMappingURL=options.d.ts.map
|
package/types/options.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.js"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,2BADW,OAAO,YAAY,EAAE,SAAS,CAiBxC;;;;;;
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.js"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,2BADW,OAAO,YAAY,EAAE,SAAS,CAiBxC;;;;;;AAsBM,wCAZI,QAAQ,OAAO,YAAY,EAAE,WAAW,CAAC,GAAG,IAAI,QAChD,GAAG,SACH,MAAM,UACN,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,oCAgC/B"}
|