@webitel/ui-sdk 24.6.36 → 24.6.38

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": "24.6.36",
3
+ "version": "24.6.38",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -47,7 +47,7 @@
47
47
  "deep-copy": "^1.4.2",
48
48
  "deep-equal": "^2.0.3",
49
49
  "deepmerge": "^4.3.1",
50
- "file-saver": "^2.0.2",
50
+ "file-saver-es": "^2.0.5",
51
51
  "is-valid-domain": "^0.1.6",
52
52
  "jszip": "^3.5.0",
53
53
  "jszip-utils": "^0.1.0",
@@ -1,5 +1,5 @@
1
1
  import stringify from 'csv-stringify/lib/sync';
2
- import { saveAs } from 'file-saver';
2
+ import { saveAs } from 'file-saver-es';
3
3
  import { objSnakeToCamel } from '../../scripts/caseConverters.js';
4
4
 
5
5
  const cast = {
@@ -1,11 +1,11 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
2
  import stringify from 'csv-stringify/lib/sync';
3
- import * as fileSaver from 'file-saver';
3
+ import * as fileSaver from 'file-saver-es';
4
4
  import CSVExportMixin from '../mixins/exportCSVMixin.js';
5
5
  import '../../../../tests/mocks/localStorageMock.js';
6
6
 
7
7
  vi.mock('csv-stringify/lib/sync');
8
- vi.mock('file-saver', () => ({
8
+ vi.mock('file-saver-es', () => ({
9
9
  saveAs: vi.fn(),
10
10
  }));
11
11
 
@@ -1,4 +1,4 @@
1
- import { saveAs } from 'file-saver';
1
+ import { saveAs } from 'file-saver-es';
2
2
  import JSZip from 'jszip';
3
3
  import jszipUtils from 'jszip-utils';
4
4
  import path from 'path-browserify';
@@ -1,5 +1,5 @@
1
1
  import { shallowMount } from '@vue/test-utils';
2
- import * as fileSaver from 'file-saver';
2
+ import * as fileSaver from 'file-saver-es';
3
3
  import jszip from 'jszip';
4
4
  import jszipUtils from 'jszip-utils';
5
5
  import FilesExportMixin from '../mixins/exportFilesMixin.js';
@@ -7,7 +7,7 @@ import '../../../../tests/mocks/localStorageMock';
7
7
 
8
8
  vi.mock('jszip');
9
9
  vi.mock('jszip-utils');
10
- vi.mock('file-saver', () => ({
10
+ vi.mock('file-saver-es', () => ({
11
11
  saveAs: vi.fn(),
12
12
  }));
13
13
 
@@ -4,7 +4,7 @@
4
4
  :search-mode-options="multisearch && searchModeOpts"
5
5
  :hint="multisearch && currentSearchMode.hint"
6
6
  :value="localValue"
7
- :v="multisearch && currentSearchMode.v"
7
+ :v="multisearch && v$"
8
8
  class="filter-search"
9
9
  @input="localValue = $event"
10
10
  @search="setValue({ name: filterName, value: localValue })"
@@ -13,6 +13,7 @@
13
13
  </template>
14
14
 
15
15
  <script setup>
16
+ import { useVuelidate } from '@vuelidate/core';
16
17
  import { computed, ref, watch } from 'vue';
17
18
  import { useStore } from 'vuex';
18
19
  import FilterEvent from '../enums/FilterEvent.enum.js';
@@ -49,13 +50,23 @@ function setValue(payload) {
49
50
  const filterName = ref(props.multisearch ? props.searchModeOpts[0].value : props.name);
50
51
 
51
52
  const currentSearchMode = computed(
52
- () => props.searchModeOpts.find(({ value }) => value === filterName.value)
53
+ () => props.searchModeOpts.find(({ value }) => value === filterName.value),
53
54
  );
54
55
 
55
56
  const filterValue = computed(() => getValue(filterName.value));
56
57
 
57
58
  const localValue = ref(filterValue.value);
58
59
 
60
+ const v$ = props.multisearch && useVuelidate(computed(() => {
61
+ return {
62
+ localValue: {
63
+ ...currentSearchMode.value.v || {},
64
+ },
65
+ };
66
+ }), { localValue }, { $autoDirty: true });
67
+
68
+ v$.value.$touch();
69
+
59
70
  async function changeMode({ value }, { clearValue = true } = {}) {
60
71
  if (clearValue) await setValue({ name: filterName.value, value: '' });
61
72
  filterName.value = value;
@@ -2,7 +2,6 @@ import { computed } from 'vue';
2
2
  import { useStore } from 'vuex';
3
3
  import getNamespacedState from '../../../store/helpers/getNamespacedState.js';
4
4
 
5
- // eslint-disable-next-line import/prefer-default-export
6
5
  export const useTableStore = (namespace) => {
7
6
  const store = useStore();
8
7
 
@@ -1,4 +1,4 @@
1
- import { saveAs } from 'file-saver';
1
+ import { saveAs } from 'file-saver-es';
2
2
 
3
3
  const saveAsJSON = (name, content) => {
4
4
  const fileName = name.replace(/[ ,]+/g, '-');