@webitel/ui-sdk 3.1.0 → 3.1.2

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.
Files changed (25) hide show
  1. package/dist/ui-sdk.common.js +106 -1
  2. package/dist/ui-sdk.common.js.map +1 -1
  3. package/dist/ui-sdk.umd.js +109 -4
  4. package/dist/ui-sdk.umd.js.map +1 -1
  5. package/dist/ui-sdk.umd.min.js +3 -3
  6. package/dist/ui-sdk.umd.min.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/components/index.js +2 -0
  9. package/src/components/organisms/wt-icon-action/__tests__/WtIconAction.spec.js +9 -0
  10. package/src/components/organisms/wt-icon-action/_internals/__tests__/WtDeleteIconAction.spec.js +9 -0
  11. package/src/components/organisms/wt-icon-action/_internals/__tests__/WtEditIconAction.spec.js +9 -0
  12. package/src/components/organisms/{wt-table/table-cells/wt-table-delete-action.vue → wt-icon-action/_internals/wt-delete-icon-action.vue} +2 -2
  13. package/src/components/organisms/{wt-table/table-cells/wt-table-edit-action.vue → wt-icon-action/_internals/wt-edit-icon-action.vue} +2 -2
  14. package/src/components/organisms/wt-icon-action/wt-icon-action.vue +31 -0
  15. package/src/locale/en/en.js +7 -7
  16. package/src/locale/es/es.js +265 -265
  17. package/src/locale/ru/ru.js +9 -8
  18. package/src/locale/ua/ua.js +9 -8
  19. package/src/modules/QueryFilters/mixins/_urlControllerMixin/_urlControllerMixin.js +2 -2
  20. package/src/store/BaseStoreModules/ApiStoreModule.js +6 -6
  21. package/src/store/BaseStoreModules/CardStoreModule.js +3 -3
  22. package/src/store/BaseStoreModules/TableStoreModule.js +3 -3
  23. package/src/components/organisms/wt-table/__tests__/WtTableDeleteAction.spec.js +0 -9
  24. package/src/components/organisms/wt-table/__tests__/WtTableEditAction.spec.js +0 -9
  25. package/src/store/BaseStoreModules/ObjectStoreModule.js +0 -4
@@ -8,22 +8,22 @@ export default class ApiStoreModule extends BaseStoreModule {
8
8
  .GET_LIST = (
9
9
  context,
10
10
  params = {},
11
- ) => this.api.getList({ ...context.state, ...params });
11
+ ) => api.getList({ ...context.state, ...params });
12
12
  this.actions
13
13
  .GET_ITEM = (
14
14
  context,
15
15
  params = {},
16
- ) => this.api.get({ ...context.state, ...params });
16
+ ) => api.get({ ...context.state, ...params });
17
17
  this.actions
18
- .POST_ITEM = (context) => this.api.add(context.state);
18
+ .POST_ITEM = (context) => api.add(context.state);
19
19
  this.actions
20
20
  .PATCH_ITEM = (context, { id, changes }) => (
21
- this.api.patch({ ...context.state, id, changes })
21
+ api.patch({ ...context.state, id, changes })
22
22
  );
23
23
  this.actions
24
- .UPD_ITEM = (context) => this.api.update(context.state);
24
+ .UPD_ITEM = (context) => api.update(context.state);
25
25
  this.actions
26
- .DELETE_ITEM = (context, id) => this.api.delete({ ...context.state, id });
26
+ .DELETE_ITEM = (context, id) => api.delete({ ...context.state, id });
27
27
  return this;
28
28
  }
29
29
  }
@@ -18,20 +18,20 @@ export default class CardStoreModule extends BaseStoreModule {
18
18
  },
19
19
  LOAD_ITEM: async (context) => {
20
20
  if (context.state.itemId) {
21
- const item = await context.dispatch('GET_ITEM');
21
+ const item = await context.dispatch('api/GET_ITEM');
22
22
  context.commit('SET_ITEM', item);
23
23
  }
24
24
  },
25
25
  ADD_ITEM: async (context) => {
26
26
  if (!context.state.itemId) {
27
- const { id } = await context.dispatch('POST_ITEM');
27
+ const { id } = await context.dispatch('api/POST_ITEM');
28
28
  await context.dispatch('SET_ITEM_ID', id);
29
29
  context.dispatch('LOAD_ITEM');
30
30
  }
31
31
  },
32
32
  UPDATE_ITEM: async (context) => {
33
33
  if (context.state.itemInstance._dirty) {
34
- await context.dispatch('UPD_ITEM');
34
+ await context.dispatch('api/UPD_ITEM');
35
35
  context.dispatch('LOAD_ITEM');
36
36
  }
37
37
  },
@@ -27,7 +27,7 @@ export default class TableStoreModule extends BaseStoreModule {
27
27
  let {
28
28
  items = [],
29
29
  next = false,
30
- } = await context.dispatch('GET_LIST', query);
30
+ } = await context.dispatch('api/GET_LIST', query);
31
31
  /* we should set _isSelected property to all items in tables cause their checkbox selection
32
32
  * is based on this property. Previously, this prop was set it api consumers, but now
33
33
  * admin-specific were replaced by webitel-sdk consumers and i supposed it will be
@@ -100,7 +100,7 @@ export default class TableStoreModule extends BaseStoreModule {
100
100
  const id = item?.id || context.state.dataList[index].id;
101
101
  const changes = { [prop]: value };
102
102
  try {
103
- await context.dispatch('PATCH_ITEM', { id, changes });
103
+ await context.dispatch('api/PATCH_ITEM', { id, changes });
104
104
  context.commit('PATCH_ITEM_PROPERTY', {
105
105
  item, index, prop, value,
106
106
  });
@@ -124,7 +124,7 @@ export default class TableStoreModule extends BaseStoreModule {
124
124
  },
125
125
  DELETE_SINGLE: async (context, { id }) => {
126
126
  try {
127
- await context.dispatch('DELETE_ITEM', id);
127
+ await context.dispatch('api/DELETE_ITEM', id);
128
128
  } catch (err) {
129
129
  throw err;
130
130
  }
@@ -1,9 +0,0 @@
1
- import { shallowMount } from '@vue/test-utils';
2
- import WtTableDeleteAction from '../table-cells/wt-table-delete-action.vue';
3
-
4
- describe('WtTableDeleteAction', () => {
5
- it('renders a component', () => {
6
- const wrapper = shallowMount(WtTableDeleteAction);
7
- expect(wrapper.exists()).toBe(true);
8
- });
9
- });
@@ -1,9 +0,0 @@
1
- import { shallowMount } from '@vue/test-utils';
2
- import WtTableEditAction from '../table-cells/wt-table-edit-action.vue';
3
-
4
- describe('WtTableEditAction', () => {
5
- it('renders a component', () => {
6
- const wrapper = shallowMount(WtTableEditAction);
7
- expect(wrapper.exists()).toBe(true);
8
- });
9
- });
@@ -1,4 +0,0 @@
1
- import BaseStoreModule from '@webitel/ui-sdk/src/store/BaseStoreModules/BaseStoreModule';
2
-
3
- export default class ObjectStoreModule extends BaseStoreModule {
4
- }