@webitel/ui-sdk 23.12.50-2 → 23.12.50

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "23.12.50-2",
3
+ "version": "23.12.50",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -1,4 +1,4 @@
1
- import { computed, isReactive, isRef } from 'vue';
1
+ import { computed, isReactive } from 'vue';
2
2
  import { useI18n } from 'vue-i18n';
3
3
 
4
4
  export function useValidation({ v: inputV, customValidators: inputCustomValidators }) {
@@ -13,16 +13,14 @@ export function useValidation({ v: inputV, customValidators: inputCustomValidato
13
13
  customValidators = computed(() => inputCustomValidators);
14
14
  }
15
15
 
16
- // end
17
-
18
- console.info(v, inputV, isRef(v), isReactive(inputV));
16
+ // support end
19
17
 
20
18
  const isValidation = computed(() => !!v && !!v.value && !!Object.keys(v.value).length);
21
19
  const invalid = computed(() => isValidation.value && v.value.$error);
22
20
 
23
21
  const validationText = computed(() => {
24
22
  let validationText = '';
25
- if (isValidation.value && invalid.value) {
23
+ if (isValidation.value && invalid) {
26
24
  if (v.value.required?.$invalid) validationText = t('validation.required');
27
25
  else if (v.value.numeric?.$invalid) validationText = t('validation.numeric');
28
26
  else if (v.value.email?.$invalid) validationText = t('validation.email');
@@ -42,7 +40,7 @@ export function useValidation({ v: inputV, customValidators: inputCustomValidato
42
40
  else if (v.value.integer?.$invalid) validationText = `${t('validation.integer')}`;
43
41
  }
44
42
  // eslint-disable-next-line no-restricted-syntax
45
- for (const { name, text } of customValidators.value) {
43
+ for (const { name, text } of customValidators) {
46
44
  if (v.value[name]?.$invalid) validationText = text;
47
45
  }
48
46
  return validationText;