@webitel/ui-datalist 1.1.57 → 1.1.58

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": "1.1.57",
3
+ "version": "1.1.58",
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,17 +1,15 @@
1
1
  <template>
2
2
  <div class="duration-filter">
3
3
  <wt-timepicker
4
- v-if="model"
5
4
  :label="t('reusable.from')"
6
- :model-value="model.from"
5
+ :model-value="value.from"
7
6
  :v="vFrom"
8
7
  format="hh:mm:ss"
9
8
  @update:model-value="handleInput('from', $event)"
10
9
  />
11
10
  <wt-timepicker
12
- v-if="model"
13
11
  :label="t('reusable.to')"
14
- :model-value="model.to"
12
+ :model-value="value.to"
15
13
  :v="vTo"
16
14
  format="hh:mm:ss"
17
15
  @update:model-value="handleInput('to', $event)"
@@ -38,6 +36,14 @@ const model = defineModel<ModelValue>({
38
36
  }),
39
37
  });
40
38
 
39
+ const value = computed<ModelValue>(
40
+ () =>
41
+ model.value ?? {
42
+ from: 0,
43
+ to: 0,
44
+ },
45
+ );
46
+
41
47
  const emit = defineEmits<{
42
48
  'update:invalid': [
43
49
  boolean,
@@ -81,12 +87,11 @@ const vTo = computed(() => {
81
87
  return modelValidation.to;
82
88
  });
83
89
 
84
- const handleInput = (key: keyof ModelValue, value: number) => {
85
- const newValue = {
86
- ...model.value,
90
+ const handleInput = (key: keyof ModelValue, newFieldValue: number) => {
91
+ model.value = {
92
+ ...value.value,
93
+ [key]: newFieldValue,
87
94
  };
88
- newValue[key] = value;
89
- model.value = newValue;
90
95
  };
91
96
 
92
97
  watch(