@webitel/ui-sdk 24.8.20 → 24.8.22
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/dist/ui-sdk.js +1 -1
- package/dist/ui-sdk.umd.cjs +1 -1
- package/package.json +2 -2
- package/src/modules/Filters/store/FiltersStoreModule.js +0 -2
- package/src/store/BaseStoreModules/BaseStoreModule.js +8 -6
- package/src/store/new/helpers/createApiStoreModule.js +1 -1
- package/src/store/new/helpers/createBaseStoreModule.js +2 -3
- package/src/store/new/helpers/createCardStoreModule.js +2 -2
- package/src/store/new/helpers/createStoreModule.js +6 -5
- package/src/store/new/helpers/createTableStoreModule.js +2 -2
- package/src/store/new/index.js +2 -2
- package/src/store/new/modules/apiStoreModule/apiStoreModule.js +5 -5
- package/src/store/new/modules/baseStoreModule/baseStoreModule.js +4 -4
- package/src/store/new/modules/cardStoreModule/cardStoreModule.js +5 -5
- package/src/store/new/modules/tableStoreModule/__tests__/tableStoreModule.spec.js +7 -3
- package/src/store/new/modules/tableStoreModule/tableStoreModule.js +6 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webitel/ui-sdk",
|
|
3
|
-
"version": "24.8.
|
|
3
|
+
"version": "24.8.22",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"jszip": "^3.5.0",
|
|
108
108
|
"jszip-utils": "^0.1.0",
|
|
109
109
|
"lodash": "^4.17.21",
|
|
110
|
-
"mitt": "
|
|
110
|
+
"mitt": "3.0.1",
|
|
111
111
|
"path-browserify": "^1.0.1",
|
|
112
112
|
"plyr": "3.6.3",
|
|
113
113
|
"query-string": "^8.1.0",
|
|
@@ -99,7 +99,6 @@ export default class FiltersStoreModule extends BaseStoreModule {
|
|
|
99
99
|
},
|
|
100
100
|
|
|
101
101
|
RESTORE_FILTERS: async (context) => {
|
|
102
|
-
context.state._emitter = mitt(); // FIXME wtf
|
|
103
102
|
await Promise.allSettled(context.getters._STATE_FILTER_NAMES.map((name) => {
|
|
104
103
|
return context.dispatch('RESTORE_FILTER', { name });
|
|
105
104
|
}));
|
|
@@ -133,7 +132,6 @@ export default class FiltersStoreModule extends BaseStoreModule {
|
|
|
133
132
|
|
|
134
133
|
EMIT: async (context, { event, payload }) => {
|
|
135
134
|
return new Promise(async (resolve, reject) => {
|
|
136
|
-
console.info(context.state._emitter);
|
|
137
135
|
const wildcardListeners = context.state._emitter.all.get('*');
|
|
138
136
|
const eventListeners = context.state._emitter.all.get(event);
|
|
139
137
|
|
|
@@ -7,11 +7,7 @@ export default class BaseStoreModule {
|
|
|
7
7
|
|
|
8
8
|
actions = {};
|
|
9
9
|
|
|
10
|
-
mutations = {
|
|
11
|
-
SET: (state, { path, value }) => {
|
|
12
|
-
return set(state, path, value);
|
|
13
|
-
},
|
|
14
|
-
};
|
|
10
|
+
mutations = {};
|
|
15
11
|
|
|
16
12
|
modules = {};
|
|
17
13
|
|
|
@@ -61,7 +57,13 @@ export default class BaseStoreModule {
|
|
|
61
57
|
state: { ...this.state, ...state },
|
|
62
58
|
getters: { ...this.getters, ...getters },
|
|
63
59
|
actions: { ...this.actions, ...actions },
|
|
64
|
-
mutations: {
|
|
60
|
+
mutations: {
|
|
61
|
+
...this.mutations,
|
|
62
|
+
...mutations,
|
|
63
|
+
SET: (state, { path, value }) => {
|
|
64
|
+
return set(state, path, value);
|
|
65
|
+
},
|
|
66
|
+
},
|
|
65
67
|
modules: { ...this.modules, ...modules },
|
|
66
68
|
};
|
|
67
69
|
}
|
|
@@ -4,5 +4,5 @@ import { createBaseStoreModule } from './createBaseStoreModule.js';
|
|
|
4
4
|
export const createApiStoreModule = (modules = []) => {
|
|
5
5
|
const modulesArr = Array.isArray(modules) ? modules : [modules];
|
|
6
6
|
|
|
7
|
-
return createBaseStoreModule([apiStoreModule, ...modulesArr]);
|
|
7
|
+
return createBaseStoreModule([apiStoreModule(), ...modulesArr]);
|
|
8
8
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import deepmerge from 'deepmerge';
|
|
2
|
-
import { createStoreModule } from './createStoreModule.js';
|
|
3
1
|
import baseStoreModule from '../modules/baseStoreModule/baseStoreModule.js';
|
|
2
|
+
import { createStoreModule } from './createStoreModule.js';
|
|
4
3
|
|
|
5
4
|
export const createBaseStoreModule = (modules = []) => {
|
|
6
5
|
const modulesArr = Array.isArray(modules) ? modules : [modules];
|
|
7
6
|
|
|
8
|
-
return createStoreModule([baseStoreModule, ...modulesArr]);
|
|
7
|
+
return createStoreModule([baseStoreModule(), ...modulesArr]);
|
|
9
8
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createBaseStoreModule } from './createBaseStoreModule.js';
|
|
2
1
|
import cardStoreModule from '../modules/cardStoreModule/cardStoreModule.js';
|
|
2
|
+
import { createBaseStoreModule } from './createBaseStoreModule.js';
|
|
3
3
|
|
|
4
4
|
export const createCardStoreModule = (modules = []) => {
|
|
5
5
|
const modulesArr = Array.isArray(modules) ? modules : [modules];
|
|
6
6
|
|
|
7
|
-
return createBaseStoreModule([cardStoreModule, ...modulesArr]);
|
|
7
|
+
return createBaseStoreModule([cardStoreModule(), ...modulesArr]);
|
|
8
8
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import deepcopy from 'deep-copy';
|
|
2
1
|
import deepmerge from 'deepmerge';
|
|
2
|
+
import isPlainObject from 'lodash/isPlainObject.js';
|
|
3
3
|
|
|
4
4
|
export const createStoreModule = (modules = []) => {
|
|
5
|
-
const
|
|
5
|
+
const modulesArr = Array.isArray(modules) ? modules : [modules];
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const merged = deepmerge.all(modulesArr, {
|
|
8
|
+
isMergeableObject: isPlainObject, // don't try to merge Maps!
|
|
9
|
+
});
|
|
10
|
+
return merged;
|
|
10
11
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createBaseStoreModule } from './createBaseStoreModule';
|
|
2
1
|
import tableStoreModule from '../modules/tableStoreModule/tableStoreModule';
|
|
2
|
+
import { createBaseStoreModule } from './createBaseStoreModule';
|
|
3
3
|
|
|
4
4
|
export const createTableStoreModule = (modules = []) => {
|
|
5
5
|
const modulesArr = Array.isArray(modules) ? modules : [modules];
|
|
6
6
|
|
|
7
|
-
return createBaseStoreModule([tableStoreModule, ...modulesArr]);
|
|
7
|
+
return createBaseStoreModule([tableStoreModule(), ...modulesArr]);
|
|
8
8
|
};
|
package/src/store/new/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { createApiStoreModule } from './helpers/createApiStoreModule.js';
|
|
1
2
|
import { createBaseStoreModule } from './helpers/createBaseStoreModule.js';
|
|
2
|
-
import { createTableStoreModule } from './helpers/createTableStoreModule.js';
|
|
3
3
|
import { createCardStoreModule } from './helpers/createCardStoreModule.js';
|
|
4
|
-
import {
|
|
4
|
+
import { createTableStoreModule } from './helpers/createTableStoreModule.js';
|
|
5
5
|
|
|
6
6
|
import { useCardStore } from './modules/cardStoreModule/useCardStore.js';
|
|
7
7
|
import { useTableStore } from './modules/tableStoreModule/useTableStore.js';
|
|
@@ -2,9 +2,9 @@ const getParentIdFromContext = (context) => (
|
|
|
2
2
|
context?.getters?.PARENT_ID || context?.state?.parentId
|
|
3
3
|
);
|
|
4
4
|
|
|
5
|
-
const state = {
|
|
5
|
+
const state = () => ({
|
|
6
6
|
api: null,
|
|
7
|
-
};
|
|
7
|
+
});
|
|
8
8
|
|
|
9
9
|
const getters = {};
|
|
10
10
|
|
|
@@ -87,9 +87,9 @@ const actions = {
|
|
|
87
87
|
|
|
88
88
|
const mutations = {};
|
|
89
89
|
|
|
90
|
-
export default {
|
|
91
|
-
state,
|
|
90
|
+
export default () => ({
|
|
91
|
+
state: state(),
|
|
92
92
|
getters,
|
|
93
93
|
actions,
|
|
94
94
|
mutations,
|
|
95
|
-
};
|
|
95
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import set from 'lodash/set';
|
|
2
2
|
|
|
3
|
-
const state = {};
|
|
3
|
+
const state = () => ({});
|
|
4
4
|
|
|
5
5
|
const getters = {};
|
|
6
6
|
|
|
@@ -12,10 +12,10 @@ const mutations = {
|
|
|
12
12
|
},
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
export default {
|
|
16
|
-
state,
|
|
15
|
+
export default () => ({
|
|
16
|
+
state: state(),
|
|
17
17
|
getters,
|
|
18
18
|
actions,
|
|
19
19
|
mutations,
|
|
20
20
|
namespaced: true,
|
|
21
|
-
};
|
|
21
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import deepCopy from 'deep-copy';
|
|
2
2
|
import set from 'lodash/set.js';
|
|
3
3
|
|
|
4
|
-
const state = {
|
|
4
|
+
const state = () => ({
|
|
5
5
|
itemId: 0,
|
|
6
6
|
itemInstance: {},
|
|
7
|
-
};
|
|
7
|
+
});
|
|
8
8
|
|
|
9
9
|
const actions = {
|
|
10
10
|
SET_PARENT_ITEM_ID: (context, id) => {
|
|
@@ -66,9 +66,9 @@ const mutations = {
|
|
|
66
66
|
},
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
export default {
|
|
70
|
-
state,
|
|
69
|
+
export default () => ({
|
|
70
|
+
state: state(),
|
|
71
71
|
actions,
|
|
72
72
|
mutations,
|
|
73
|
-
};
|
|
73
|
+
});
|
|
74
74
|
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { createRouter, createWebHistory } from 'vue-router';
|
|
2
2
|
import { createStore } from 'vuex';
|
|
3
|
+
import FilterEvent
|
|
4
|
+
from '../../../../../modules/Filters/enums/FilterEvent.enum.js';
|
|
5
|
+
import FiltersStoreModule
|
|
6
|
+
from '../../../../../modules/Filters/store/FiltersStoreModule.js';
|
|
3
7
|
import { SortSymbols } from '../../../../../scripts/sortQueryAdapters.js';
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
import {
|
|
9
|
+
createTableStoreModule,
|
|
10
|
+
} from '../../../helpers/createTableStoreModule.js';
|
|
7
11
|
|
|
8
12
|
describe('TableStoreModule', () => {
|
|
9
13
|
it('correctly computes FIELDS getter', () => {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import FilterEvent from '../../../../modules/Filters/enums/FilterEvent.enum.js';
|
|
1
2
|
import {
|
|
2
3
|
queryToSortAdapter,
|
|
3
4
|
sortToQueryAdapter,
|
|
4
5
|
} from '../../../../scripts/sortQueryAdapters.js';
|
|
5
|
-
import FilterEvent from '../../../../modules/Filters/enums/FilterEvent.enum.js';
|
|
6
6
|
|
|
7
|
-
const state = {
|
|
7
|
+
const state = () => ({
|
|
8
8
|
headers: [],
|
|
9
9
|
dataList: [],
|
|
10
10
|
selected: [],
|
|
11
11
|
error: {},
|
|
12
12
|
isLoading: false,
|
|
13
13
|
isNextPage: false,
|
|
14
|
-
};
|
|
14
|
+
});
|
|
15
15
|
|
|
16
16
|
const getters = {
|
|
17
17
|
PARENT_ID: () => null, // override me
|
|
@@ -225,8 +225,8 @@ const actions = {
|
|
|
225
225
|
},
|
|
226
226
|
};
|
|
227
227
|
|
|
228
|
-
export default {
|
|
229
|
-
state,
|
|
228
|
+
export default () => ({
|
|
229
|
+
state: state(),
|
|
230
230
|
getters,
|
|
231
231
|
actions,
|
|
232
|
-
};
|
|
232
|
+
});
|