@live-change/frontend-auto-form 0.8.143 → 0.8.145

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.
@@ -17,7 +17,7 @@
17
17
  </slot>
18
18
  <div>
19
19
  <slot name="error" v-bind="{ validationResult, uid }" >
20
- <small v-if="validationResult" class="p-error mt-1">
20
+ <small v-if="validationResult && !minLengthErrorVisible" class="p-error mt-1">
21
21
  {{ (typeof validationResult === 'object')
22
22
  ? t( 'errors.' + validationResult.error, validationResult.validator )
23
23
  : t( 'errors.' + validationResult ) }}
@@ -25,13 +25,10 @@
25
25
  </slot>
26
26
  <small v-if="maxLengthValidation || minLengthValidation" style="float: right" class="mt-1"
27
27
  :class="{
28
- 'p-error': (maxLengthValidation && props.modelValue?.length
29
- && props.modelValue?.length > maxLengthValidation.length)
30
- || (minLengthValidation && props.modelValue?.length
31
- && props.modelValue?.length < minLengthValidation.length)
28
+ 'p-error': minMaxError
32
29
  }">
33
30
  {{
34
- (minLengthValidation && props.modelValue?.length && props.modelValue?.length < minLengthValidation.length)
31
+ (minLengthErrorVisible)
35
32
  ? t( 'info.minLength', { minLength: minLengthValidation.length, length: props.modelValue?.length ?? 0 })
36
33
  : t( 'info.maxLength', { maxLength: maxLengthValidation.length, length: props.modelValue?.length ?? 0 })
37
34
  }}
@@ -147,6 +144,18 @@
147
144
  const maxLengthValidation = computed(() => findValidation('maxLength'))
148
145
  const minLengthValidation = computed(() => findValidation('minLength'))
149
146
 
147
+ const minMaxError = computed(() =>
148
+ (maxLengthValidation.value && props.modelValue?.length
149
+ && props.modelValue?.length > maxLengthValidation.value.length)
150
+ || (minLengthValidation.value && props.modelValue?.length
151
+ && props.modelValue?.length < minLengthValidation.value.length)
152
+ )
153
+
154
+ const minLengthErrorVisible = computed(() =>
155
+ minLengthValidation.value && props.modelValue?.length
156
+ && props.modelValue?.length < minLengthValidation.value.length
157
+ )
158
+
150
159
  const config = inject('auto-form', {
151
160
  inputs: {},
152
161
  types: {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/frontend-auto-form",
3
- "version": "0.8.143",
3
+ "version": "0.8.145",
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.143",
26
- "@live-change/dao": "^0.8.143",
27
- "@live-change/dao-vue3": "^0.8.143",
28
- "@live-change/dao-websocket": "^0.8.143",
29
- "@live-change/framework": "^0.8.143",
30
- "@live-change/image-frontend": "^0.8.143",
31
- "@live-change/image-service": "^0.8.143",
32
- "@live-change/session-service": "^0.8.143",
33
- "@live-change/vue3-components": "^0.8.143",
34
- "@live-change/vue3-ssr": "^0.8.143",
25
+ "@live-change/cli": "^0.8.145",
26
+ "@live-change/dao": "^0.8.145",
27
+ "@live-change/dao-vue3": "^0.8.145",
28
+ "@live-change/dao-websocket": "^0.8.145",
29
+ "@live-change/framework": "^0.8.145",
30
+ "@live-change/image-frontend": "^0.8.145",
31
+ "@live-change/image-service": "^0.8.145",
32
+ "@live-change/session-service": "^0.8.145",
33
+ "@live-change/vue3-components": "^0.8.145",
34
+ "@live-change/vue3-ssr": "^0.8.145",
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.143",
55
+ "@live-change/codeceptjs-helper": "^0.8.145",
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": "66b5f7afb324c434fbc61971fa8e3ec8bf9359d0"
66
+ "gitHead": "fadc33dc99f47714c3d40f2ce1b5cdf3f050a70a"
67
67
  }