@webitel/ui-datalist 26.8.9 → 26.8.10

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-datalist",
3
- "version": "26.8.9",
3
+ "version": "26.8.10",
4
4
  "description": "Toolkit for building data lists in webitel ui system",
5
5
  "scripts": {
6
6
  "build:types": "vue-tsc -b tsconfig.build.json",
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <wt-multi-select
3
- :label="t('webitelUI.filters.filterValue')"
3
+ :label="labelValue"
4
4
  :search-method="searchMethod"
5
5
  :model-value="model"
6
6
  :v="!disableValidation && v$.model"
@@ -13,9 +13,10 @@
13
13
  import { useVuelidate } from '@vuelidate/core';
14
14
  import { required } from '@vuelidate/validators';
15
15
  import { WtMultiSelect } from '@webitel/ui-sdk/components';
16
- import { computed, watch } from 'vue';
16
+ import { computed, onMounted, watch } from 'vue';
17
17
  import { useI18n } from 'vue-i18n';
18
18
 
19
+ import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
19
20
  import { searchMethod } from './config.js';
20
21
 
21
22
  type ModelValue = number[];
@@ -26,6 +27,11 @@ const props = defineProps<{
26
27
 
27
28
  const model = defineModel<ModelValue>();
28
29
 
30
+ const props = defineProps<{
31
+ filterConfig?: WtSysTypeFilterConfig;
32
+ disableValidation?: boolean;
33
+ }>();
34
+
29
35
  const emit = defineEmits<{
30
36
  'update:invalid': [
31
37
  boolean,
@@ -34,6 +40,13 @@ const emit = defineEmits<{
34
40
 
35
41
  const { t } = useI18n();
36
42
 
43
+ const labelValue = computed(() => {
44
+ const value = props?.filterConfig?.showFilterName
45
+ ? props?.filterConfig.name
46
+ : 'filterValue';
47
+ return t(`webitelUI.filters.${value}`);
48
+ });
49
+
37
50
  const v$ = useVuelidate(
38
51
  computed(() => ({
39
52
  model: {
@@ -48,7 +61,10 @@ const v$ = useVuelidate(
48
61
  },
49
62
  );
50
63
 
51
- if (!props?.disableValidation) v$.value.$touch();
64
+ onMounted(() => {
65
+ if (!props.disableValidation) v$.value.$touch();
66
+ });
67
+
52
68
  watch(
53
69
  () => v$.value.$invalid,
54
70
  (invalid) => {
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <wt-single-select
3
3
  :clearable="false"
4
- :label="t('webitelUI.filters.filterValue')"
4
+ :label="labelValue"
5
5
  :options="CallDirectionFilterOptions"
6
6
  v-model:model-value="model"
7
7
  :v="!disableValidation && v$.model"
@@ -14,9 +14,10 @@
14
14
  import { useVuelidate } from '@vuelidate/core';
15
15
  import { required } from '@vuelidate/validators';
16
16
  import { WtSingleSelect } from '@webitel/ui-sdk/components';
17
- import { computed, watch } from 'vue';
17
+ import { computed, onMounted, watch } from 'vue';
18
18
  import { useI18n } from 'vue-i18n';
19
19
 
20
+ import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
20
21
  import { CallDirectionFilterOptions } from '../../enums/options/CallDirectionFilterOptions';
21
22
 
22
23
  const props = defineProps<{
@@ -26,6 +27,18 @@ const props = defineProps<{
26
27
  const model = defineModel<string>();
27
28
  const { t } = useI18n();
28
29
 
30
+ const props = defineProps<{
31
+ filterConfig?: WtSysTypeFilterConfig;
32
+ disableValidation?: boolean;
33
+ }>();
34
+
35
+ const labelValue = computed(() => {
36
+ const value = props?.filterConfig?.showFilterName
37
+ ? props?.filterConfig.name
38
+ : 'filterValue';
39
+ return t(`webitelUI.filters.${value}`);
40
+ });
41
+
29
42
  const v$ = useVuelidate(
30
43
  computed(() => ({
31
44
  model: {
@@ -40,13 +53,16 @@ const v$ = useVuelidate(
40
53
  },
41
54
  );
42
55
 
43
- if (!props?.disableValidation) v$.value.$touch();
44
56
  const emit = defineEmits<{
45
57
  'update:invalid': [
46
58
  boolean,
47
59
  ];
48
60
  }>();
49
61
 
62
+ onMounted(() => {
63
+ if (!props.disableValidation) v$.value.$touch();
64
+ });
65
+
50
66
  watch(
51
67
  () => v$.value.$invalid,
52
68
  (invalid) => {
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <wt-multi-select
3
- :label="t('webitelUI.filters.filterValue')"
3
+ :label="labelValue"
4
4
  :search-method="searchGateway"
5
5
  :v="!disableValidation && v$.model"
6
6
  :model-value="model"
@@ -13,9 +13,10 @@
13
13
  import { useVuelidate } from '@vuelidate/core';
14
14
  import { required } from '@vuelidate/validators';
15
15
  import { WtMultiSelect } from '@webitel/ui-sdk/components';
16
- import { computed, watch } from 'vue';
16
+ import { computed, onMounted, watch } from 'vue';
17
17
  import { useI18n } from 'vue-i18n';
18
18
 
19
+ import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
19
20
  import { searchMethod } from './config.js';
20
21
 
21
22
  type ModelValue = number[];
@@ -26,6 +27,11 @@ const props = defineProps<{
26
27
 
27
28
  const model = defineModel<ModelValue>();
28
29
 
30
+ const props = defineProps<{
31
+ filterConfig?: WtSysTypeFilterConfig;
32
+ disableValidation?: boolean;
33
+ }>();
34
+
29
35
  const emit = defineEmits<{
30
36
  'update:invalid': [
31
37
  boolean,
@@ -33,6 +39,13 @@ const emit = defineEmits<{
33
39
  }>();
34
40
  const { t } = useI18n();
35
41
 
42
+ const labelValue = computed(() => {
43
+ const value = props?.filterConfig?.showFilterName
44
+ ? props?.filterConfig.name
45
+ : 'filterValue';
46
+ return t(`webitelUI.filters.${value}`);
47
+ });
48
+
36
49
  const v$ = useVuelidate(
37
50
  computed(() => ({
38
51
  model: {
@@ -46,7 +59,11 @@ const v$ = useVuelidate(
46
59
  $autoDirty: true,
47
60
  },
48
61
  );
49
- if (!props?.disableValidation) v$.value.$touch();
62
+
63
+ onMounted(() => {
64
+ if (!props.disableValidation) v$.value.$touch();
65
+ });
66
+
50
67
  const searchGateway = async (params: { search?: string }) => {
51
68
  return params.search
52
69
  ? await searchMethod({
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <wt-multi-select
3
- :label="t('webitelUI.filters.filterValue')"
3
+ :label="labelValue"
4
4
  :search-method="searchMethod"
5
5
  :model-value="model"
6
6
  :v="!disableValidation && v$.model"
@@ -13,9 +13,10 @@
13
13
  import { useVuelidate } from '@vuelidate/core';
14
14
  import { required } from '@vuelidate/validators';
15
15
  import { WtMultiSelect } from '@webitel/ui-sdk/components';
16
- import { computed, watch } from 'vue';
16
+ import { computed, onMounted, watch } from 'vue';
17
17
  import { useI18n } from 'vue-i18n';
18
18
 
19
+ import { WtSysTypeFilterConfig } from '../../classes/FilterConfig';
19
20
  import { searchMethod } from './config.js';
20
21
 
21
22
  type ModelValue = number[];
@@ -26,6 +27,11 @@ const props = defineProps<{
26
27
 
27
28
  const model = defineModel<ModelValue>();
28
29
 
30
+ const props = defineProps<{
31
+ filterConfig?: WtSysTypeFilterConfig;
32
+ disableValidation?: boolean;
33
+ }>();
34
+
29
35
  const emit = defineEmits<{
30
36
  'update:invalid': [
31
37
  boolean,
@@ -33,6 +39,13 @@ const emit = defineEmits<{
33
39
  }>();
34
40
  const { t } = useI18n();
35
41
 
42
+ const labelValue = computed(() => {
43
+ const value = props?.filterConfig?.showFilterName
44
+ ? props?.filterConfig.name
45
+ : 'filterValue';
46
+ return t(`webitelUI.filters.${value}`);
47
+ });
48
+
36
49
  const v$ = useVuelidate(
37
50
  computed(() => ({
38
51
  model: {
@@ -46,7 +59,11 @@ const v$ = useVuelidate(
46
59
  $autoDirty: true,
47
60
  },
48
61
  );
49
- if (!props?.disableValidation) v$.value.$touch();
62
+
63
+ onMounted(() => {
64
+ if (!props.disableValidation) v$.value.$touch();
65
+ });
66
+
50
67
  watch(
51
68
  () => v$.value.$invalid,
52
69
  (invalid) => {