@live-change/frontend-auto-form 0.3.6 → 0.3.8

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/AutoField.vue CHANGED
@@ -109,7 +109,10 @@
109
109
  const inputConfig = computed(() => {
110
110
  if(definition.value.input) return config.inputs?.[definition.value.input] ?? inputs[definition.value.input]
111
111
  if(definition.value.type) return config.types?.[definition.value.type] ?? types[definition.value.type]
112
- return config.inputs?.default ?? inputs.default
112
+ return {
113
+ ...(config.inputs?.default ?? inputs.default),
114
+ ...definition?.autoForm?.config, // possible to modify config per input
115
+ }
113
116
  })
114
117
 
115
118
  const label = computed(() => props.i18n + (props.label || definition.value.label || props.name))
package/AutoInput.vue CHANGED
@@ -49,7 +49,10 @@
49
49
  const inputConfig = computed(() => {
50
50
  if(definition.value.input) return config.inputs?.[definition.value.input] ?? inputs[definition.value.input]
51
51
  if(definition.value.type) return config.types?.[definition.value.type] ?? types[definition.value.type]
52
- return config.inputs?.default ?? inputs.default
52
+ return {
53
+ ...(config.inputs?.default ?? inputs.default),
54
+ ...definition?.autoForm?.config, // possible to modify config per input
55
+ }
53
56
  })
54
57
 
55
58
  const definitionIf = computed(() => {
@@ -85,6 +88,7 @@
85
88
  //console.log("PROPS", JSON.stringify(props))
86
89
  //console.log("PROPNAME", propName.value)
87
90
  return attributes({
91
+ config: inputConfig.value,
88
92
  definition: definition.value,
89
93
  i18n: props.i18n + fieldName,
90
94
  propName: props.propName,
package/config.js CHANGED
@@ -42,7 +42,7 @@ inputs.select = input(() => import('primevue/dropdown'), {
42
42
  return {
43
43
  options: definition.options,
44
44
  optionLabel: option => {
45
- const i18nId = i18n + ':options.' + option
45
+ const i18nId = (definition.i18n ?? i18n + ':options') + '.' + option
46
46
  if(te(i18nId)) return t(i18nId)
47
47
  return t(option)
48
48
  }
@@ -57,7 +57,7 @@ inputs.multiselect = input(() => import('primevue/multiselect'), {
57
57
  return {
58
58
  options: definition.of.options ?? definition.options,
59
59
  optionLabel: option => {
60
- const i18nId = i18n + ':options.' + option
60
+ const i18nId = (definition.i18n ?? i18n + ':options') + '.' + option
61
61
  if(te(i18nId)) return t(i18nId)
62
62
  return t(option)
63
63
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/frontend-auto-form",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "scripts": {
5
5
  "memDev": "lcli memDev --enableSessions --initScript ./init.js --dbAccess",
6
6
  "localDevInit": "rm tmp.db; lcli localDev --enableSessions --initScript ./init.js",
@@ -62,5 +62,5 @@
62
62
  "author": "",
63
63
  "license": "ISC",
64
64
  "description": "",
65
- "gitHead": "8ff79a540e7f206b51244b45fb0b39fc092f1600"
65
+ "gitHead": "637a0eb8e19a07c93f3c540b34934bd953f69aa6"
66
66
  }