bfg-common 1.4.608 → 1.4.609

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.
@@ -68,6 +68,8 @@ const props = withDefaults(
68
68
  testId: string
69
69
  name: string
70
70
  label?: string
71
+ regex?: string
72
+ errorText?: string
71
73
  }>(),
72
74
  {
73
75
  label: 'enterNewName',
@@ -104,7 +106,14 @@ const initValidation = (): void => {
104
106
  }
105
107
 
106
108
  const nameErrorText = computed<string>(() => {
107
- return validForm.value?.errors?.name?.[0] || ''
109
+ if (!form.value.name.value) {
110
+ return validForm.value?.errors?.name?.[0] || ''
111
+ }
112
+
113
+ if (props.regex && !props.regex.test(form.value.name.value)) {
114
+ return props.errorText || ''
115
+ }
116
+ return ''
108
117
  })
109
118
  /* Validation Name input end */
110
119
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.608",
4
+ "version": "1.4.609",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",