@live-change/frontend-auto-form 0.8.107 → 0.8.109
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/{ArrayInput.vue → components/ArrayInput.vue} +1 -1
- package/{AutoField.vue → components/AutoField.vue} +17 -9
- package/{AutoInput.vue → components/AutoInput.vue} +1 -1
- package/{GroupField.vue → components/GroupField.vue} +1 -1
- package/config.js +5 -5
- package/index.js +3 -3
- package/locales/en.json +1 -1
- package/package.json +13 -13
- /package/{AutoEditor.vue → components/AutoEditor.vue} +0 -0
- /package/{Calendar.vue → components/Calendar.vue} +0 -0
- /package/{ObjectInput.vue → components/ObjectInput.vue} +0 -0
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
import Button from "primevue/button";
|
|
67
67
|
import AutoInput from "./AutoInput.vue"
|
|
68
68
|
|
|
69
|
-
import { inputs, types } from '
|
|
69
|
+
import { inputs, types } from '../config.js'
|
|
70
70
|
import { computed, getCurrentInstance, toRefs } from 'vue'
|
|
71
71
|
|
|
72
72
|
const props = defineProps({
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
<component v-if="fieldComponent && visible" :is="fieldComponent" v-bind="attributes"
|
|
3
3
|
@update:modelValue="value => emit('update:modelValue', value)" :i18n="i18n" />
|
|
4
4
|
<div v-else-if="visible" class="field" :class="fieldClass" :style="fieldStyle">
|
|
5
|
-
<label
|
|
6
|
-
|
|
5
|
+
<slot name="label" v-bind="{ validationResult, uid }">
|
|
6
|
+
<label :for="uid">{{ t( label ) }}</label>
|
|
7
|
+
</slot>
|
|
8
|
+
<slot v-bind="{ validationResult, uid }">
|
|
7
9
|
<auto-input :modelValue="modelValue" :definition="definition"
|
|
8
10
|
:class="props.inputClass" :style="props.inputStyle"
|
|
9
11
|
:attributes="props.inputAttributes"
|
|
@@ -14,11 +16,13 @@
|
|
|
14
16
|
:i18n="i18n" />
|
|
15
17
|
</slot>
|
|
16
18
|
<div>
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
<slot name="error" v-bind="{ validationResult, uid }" >
|
|
20
|
+
<small v-if="validationResult" class="p-error mt-1">
|
|
21
|
+
{{ (typeof validationResult === 'object')
|
|
22
|
+
? t( 'errors.' + validationResult.error, validationResult.validator )
|
|
23
|
+
: t( 'errors.' + validationResult ) }}
|
|
24
|
+
</small>
|
|
25
|
+
</slot>
|
|
22
26
|
<small v-if="maxLengthValidation || minLengthValidation" style="float: right" class="mt-1"
|
|
23
27
|
:class="{
|
|
24
28
|
'p-error': (maxLengthValidation && props.modelValue?.length
|
|
@@ -40,7 +44,7 @@
|
|
|
40
44
|
|
|
41
45
|
import AutoInput from "./AutoInput.vue"
|
|
42
46
|
|
|
43
|
-
import { inputs, types } from '
|
|
47
|
+
import { inputs, types } from '../config.js'
|
|
44
48
|
import { computed, getCurrentInstance, inject, toRefs, onMounted, ref } from 'vue'
|
|
45
49
|
|
|
46
50
|
const isMounted = ref(false)
|
|
@@ -86,6 +90,10 @@
|
|
|
86
90
|
i18n: {
|
|
87
91
|
type: String,
|
|
88
92
|
default: ''
|
|
93
|
+
},
|
|
94
|
+
ignoreFieldComponent: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: false
|
|
89
97
|
}
|
|
90
98
|
})
|
|
91
99
|
|
|
@@ -180,7 +188,7 @@
|
|
|
180
188
|
propName: props.propName,
|
|
181
189
|
}))
|
|
182
190
|
|
|
183
|
-
const fieldComponent = computed(() => inputConfig.value?.fieldComponent)
|
|
191
|
+
const fieldComponent = computed(() => props.ignoreFieldComponent ? null : inputConfig.value?.fieldComponent)
|
|
184
192
|
|
|
185
193
|
|
|
186
194
|
</script>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
<script setup>
|
|
15
15
|
import AutoInput from "./AutoInput.vue"
|
|
16
|
-
import { inputs, types } from "
|
|
16
|
+
import { inputs, types } from "../config.js";
|
|
17
17
|
import { computed, inject, toRefs, getCurrentInstance } from 'vue'
|
|
18
18
|
|
|
19
19
|
import { useI18n } from 'vue-i18n'
|
package/config.js
CHANGED
|
@@ -25,15 +25,15 @@ const number = input(() => import('primevue/inputnumber'))
|
|
|
25
25
|
inputs.integer = number
|
|
26
26
|
types.Number = inputs.decimal = number.with({ attributes: { mode: 'decimal' } })
|
|
27
27
|
|
|
28
|
-
types.Object = inputs.object = input(() => import('./AutoEditor.vue'), {
|
|
29
|
-
fieldComponent: defineAsyncComponent(() => import('./GroupField.vue'))
|
|
28
|
+
types.Object = inputs.object = input(() => import('./components/AutoEditor.vue'), {
|
|
29
|
+
fieldComponent: defineAsyncComponent(() => import('./components/GroupField.vue'))
|
|
30
30
|
})
|
|
31
31
|
|
|
32
|
-
types.Array = inputs.list = input(() => import('./ArrayInput.vue'), {
|
|
33
|
-
fieldComponent: defineAsyncComponent(() => import('./GroupField.vue'))
|
|
32
|
+
types.Array = inputs.list = input(() => import('./components/ArrayInput.vue'), {
|
|
33
|
+
fieldComponent: defineAsyncComponent(() => import('./components/GroupField.vue'))
|
|
34
34
|
})
|
|
35
35
|
|
|
36
|
-
types.Date = inputs.datetime = input(() => import('./Calendar.vue'), { attributes: { showTime: true } })
|
|
36
|
+
types.Date = inputs.datetime = input(() => import('./components/Calendar.vue'), { attributes: { showTime: true } })
|
|
37
37
|
|
|
38
38
|
inputs.select = input(() => import('primevue/dropdown'), {
|
|
39
39
|
attributes: (config) => {
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import AutoInput from './AutoInput.vue'
|
|
2
|
-
import AutoField from './AutoField.vue'
|
|
3
|
-
import AutoEditor from './AutoEditor.vue'
|
|
1
|
+
import AutoInput from './components/AutoInput.vue'
|
|
2
|
+
import AutoField from './components/AutoField.vue'
|
|
3
|
+
import AutoEditor from './components/AutoEditor.vue'
|
|
4
4
|
|
|
5
5
|
export { AutoInput, AutoField, AutoEditor }
|
|
6
6
|
|
package/locales/en.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"empty": "This field is required.",
|
|
5
5
|
"tooShort": "Too short, minimum {length} characters.",
|
|
6
6
|
"tooLong": "Too long, maximum {length} characters.",
|
|
7
|
-
"wrongUrl": "Invalid URL. Acceptable url formats:
|
|
7
|
+
"wrongUrl": "Invalid URL. Acceptable url formats: https://example.com or www.example.com"
|
|
8
8
|
},
|
|
9
9
|
"info": {
|
|
10
10
|
"minLength": "Minimum length - {minLength} characters.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/frontend-auto-form",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.109",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"memDev": "node server/start.js memDev --enableSessions --initScript ./init.js --dbAccess",
|
|
6
6
|
"localDevInit": "rm tmp.db; lcli localDev --enableSessions --initScript ./init.js",
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
"type": "module",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@fortawesome/fontawesome-free": "^6.5.2",
|
|
25
|
-
"@live-change/cli": "^0.8.
|
|
26
|
-
"@live-change/dao": "^0.8.
|
|
27
|
-
"@live-change/dao-vue3": "^0.8.
|
|
28
|
-
"@live-change/dao-websocket": "^0.8.
|
|
29
|
-
"@live-change/framework": "^0.8.
|
|
30
|
-
"@live-change/image-frontend": "^0.8.
|
|
31
|
-
"@live-change/image-service": "^0.8.
|
|
32
|
-
"@live-change/session-service": "^0.8.
|
|
33
|
-
"@live-change/vue3-components": "^0.8.
|
|
34
|
-
"@live-change/vue3-ssr": "^0.8.
|
|
25
|
+
"@live-change/cli": "^0.8.109",
|
|
26
|
+
"@live-change/dao": "^0.8.109",
|
|
27
|
+
"@live-change/dao-vue3": "^0.8.109",
|
|
28
|
+
"@live-change/dao-websocket": "^0.8.109",
|
|
29
|
+
"@live-change/framework": "^0.8.109",
|
|
30
|
+
"@live-change/image-frontend": "^0.8.109",
|
|
31
|
+
"@live-change/image-service": "^0.8.109",
|
|
32
|
+
"@live-change/session-service": "^0.8.109",
|
|
33
|
+
"@live-change/vue3-components": "^0.8.109",
|
|
34
|
+
"@live-change/vue3-ssr": "^0.8.109",
|
|
35
35
|
"@vueuse/core": "^10.11.0",
|
|
36
36
|
"codeceptjs-assert": "^0.0.5",
|
|
37
37
|
"compression": "^1.7.4",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"vue3-scroll-border": "0.1.6"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@live-change/codeceptjs-helper": "^0.8.
|
|
55
|
+
"@live-change/codeceptjs-helper": "^0.8.109",
|
|
56
56
|
"codeceptjs": "^3.6.5",
|
|
57
57
|
"generate-password": "1.7.1",
|
|
58
58
|
"playwright": "^1.41.2",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"author": "Michał Łaszczewski <michal@laszczewski.pl>",
|
|
64
64
|
"license": "ISC",
|
|
65
65
|
"description": "",
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "075bf3759fae6c40fb8e44d77d9f12c5c175e098"
|
|
67
67
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|