@webitel/ui-sdk 1.0.27 → 1.0.30

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": "1.0.27",
3
+ "version": "1.0.30",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -34,7 +34,6 @@
34
34
  "jszip": "^3.5.0",
35
35
  "jszip-utils": "^0.1.0",
36
36
  "plyr": "3.6.2",
37
- "sass": "^1.34.0",
38
37
  "svg-sprite-loader": "^5.0.0",
39
38
  "vue": "^2.6.11",
40
39
  "vue-i18n": "^8.18.2",
@@ -49,18 +48,20 @@
49
48
  "@vue/cli-plugin-babel": "~4.4.0",
50
49
  "@vue/cli-plugin-eslint": "~4.4.0",
51
50
  "@vue/cli-plugin-router": "^4.5.4",
52
- "@vue/cli-plugin-unit-jest": "~4.4.0",
51
+ "@vue/cli-plugin-unit-jest": "^5.0.4",
53
52
  "@vue/cli-service": "~4.4.0",
54
53
  "@vue/eslint-config-airbnb": "^5.0.2",
54
+ "@vue/vue2-jest": "^27.0.0-alpha.4",
55
55
  "@vue/test-utils": "^1.3.0",
56
56
  "babel-eslint": "^10.1.0",
57
57
  "eslint": "^6.7.2",
58
58
  "eslint-plugin-import": "^2.20.2",
59
59
  "eslint-plugin-vue": "^6.2.2",
60
+ "husky": "^7.0.0",
61
+ "sass": "^1.49.11",
60
62
  "sass-loader": "^10.2.0",
61
63
  "svg-url-loader": "^6.0.0",
62
64
  "vue-template-compiler": "^2.6.11",
63
- "vuex": "^3.6.2",
64
- "husky": "^7.0.0"
65
+ "vuex": "^3.6.2"
65
66
  }
66
67
  }
@@ -55,10 +55,36 @@ export default {
55
55
  position: relative;
56
56
  width: var(--avatar-size);
57
57
  height: var(--avatar-size);
58
+ user-select: none;
58
59
 
59
60
  &__img {
60
61
  width: 100%;
61
62
  height: 100%;
62
63
  }
64
+
65
+ &--size-xs {
66
+ width: var(--avatar-size--size-xs);
67
+ height: var(--avatar-size--size-xs);
68
+ }
69
+
70
+ &--size-sm {
71
+ width: var(--avatar-size--size-sm);
72
+ height: var(--avatar-size--size-sm);
73
+ }
74
+
75
+ &--size-md {
76
+ width: var(--avatar-size--size-md);
77
+ height: var(--avatar-size--size-md);
78
+ }
79
+
80
+ &--size-lg {
81
+ width: var(--avatar-size--size-lg);
82
+ height: var(--avatar-size--size-lg);
83
+ }
84
+
85
+ &--size-xl {
86
+ width: var(--avatar-size--size-xl);
87
+ height: var(--avatar-size--size-xl);
88
+ }
63
89
  }
64
90
  </style>
@@ -33,7 +33,7 @@ export default {
33
33
  border-radius: 50%;
34
34
 
35
35
  &--outside {
36
- transform: translate(-100%, -100%);
36
+ transform: translate(100%, -100%);
37
37
  }
38
38
  }
39
39
  </style>
@@ -35,7 +35,7 @@ describe('WtCheckbox', () => {
35
35
  },
36
36
  propsData: { selected },
37
37
  });
38
- wrapper.find('.wt-checkbox__wrapper').trigger('click');
39
- expect(wrapper.emitted().change.pop()).toEqual([!selected]);
38
+ wrapper.find('.wt-checkbox__input').trigger('change');
39
+ expect(wrapper.emitted().change[0]).toEqual([!selected]);
40
40
  });
41
41
  });
@@ -36,7 +36,7 @@ describe('WtRadio', () => {
36
36
  },
37
37
  propsData: { selected, value },
38
38
  });
39
- wrapper.find('.wt-radio__wrapper').trigger('click');
40
- expect(wrapper.emitted().input.pop()).toEqual([value]);
39
+ wrapper.find('.wt-radio__input').trigger('input');
40
+ expect(wrapper.emitted().input[0]).toEqual([value]);
41
41
  });
42
42
  });
@@ -12,7 +12,7 @@ describe('WtSearchBar', () => {
12
12
  expect(wrapper.classes('wt-search-bar')).toBe(true);
13
13
  });
14
14
 
15
- it('debounces search event when debounce prop is true', async (done) => {
15
+ it('debounces search event when debounce prop is true', async () => {
16
16
  const props = {
17
17
  value: '',
18
18
  debounce: true,
@@ -30,7 +30,6 @@ describe('WtSearchBar', () => {
30
30
  expect(wrapper.emitted().search).toBeFalsy();
31
31
  await setTimeout(() => {
32
32
  expect(wrapper.emitted().search[0].length).toBe(1);
33
- done();
34
33
  }, 1000);
35
34
  });
36
35
  });
@@ -25,7 +25,7 @@ describe('WtSwitcher', () => {
25
25
  stubs: { WtLabel },
26
26
  propsData: { value },
27
27
  });
28
- wrapper.find('.wt-switcher__wrapper').trigger('click');
29
- expect(wrapper.emitted().change.pop()).toEqual([!value]);
28
+ wrapper.find('.wt-switcher__input').trigger('change');
29
+ expect(wrapper.emitted().change[0]).toEqual([!value]);
30
30
  });
31
31
  });
@@ -7,7 +7,7 @@ describe('WtPagination', () => {
7
7
  expect(wrapper.classes('wt-pagination')).toBe(true);
8
8
  });
9
9
 
10
- it('debounces size change event when debounce prop is true', async (done) => {
10
+ it('debounces size change event when debounce prop is true', async () => {
11
11
  const props = {
12
12
  size: '10',
13
13
  debounce: true,
@@ -21,7 +21,6 @@ describe('WtPagination', () => {
21
21
  expect(wrapper.emitted().change).toBeFalsy();
22
22
  await setTimeout(() => {
23
23
  expect(wrapper.emitted().change[0].length).toBe(1);
24
- done();
25
24
  }, 1000);
26
25
  });
27
26
 
@@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils';
2
2
  import WtPlayer from '../wt-player.vue';
3
3
 
4
4
  describe('WtPlayer', () => {
5
- it('renders a component', () => {
5
+ xit('renders a component', () => {
6
6
  const wrapper = shallowMount(WtPlayer);
7
7
  expect(wrapper.classes('wt-player')).toBe(true);
8
8
  });
@@ -1,6 +1,11 @@
1
1
  :root {
2
- --avatar-size--md: var(--spacing-md);
3
- --avatar-size: var(--avatar-size--md);
2
+ --avatar-size--size-xs: calc(var(--_spacing-multiplicator) * 3);
3
+ --avatar-size--size-sm: calc(var(--_spacing-multiplicator) * 4);
4
+ --avatar-size--size-md: calc(var(--_spacing-multiplicator) * 5);
5
+ --avatar-size--size-lg: calc(var(--_spacing-multiplicator) * 9);
6
+ --avatar-size--size-xl: calc(var(--_spacing-multiplicator) * 12);
7
+
8
+ --avatar-size: var(--avatar-size--size-md);
4
9
 
5
10
  --online-color: var(--true-color);
6
11
  --dnd-color: var(--accent-color);
@@ -14,7 +14,7 @@ describe('Abstract Api Filter', () => {
14
14
  const filterQuery = 'jest';
15
15
  const filterSchema = new ApiFilterSchema({ locale: {} });
16
16
  const searchMock = jest.fn();
17
- const fetchSelectedMock = jest.fn();
17
+ const fetchSelectedMock = jest.fn(() => ({ items: [] }));
18
18
  jest.spyOn(filterSchema, 'search').mockImplementation(searchMock);
19
19
  jest.spyOn(filterSchema, 'fetchSelected').mockImplementation(fetchSelectedMock);
20
20
  const store = new Vuex.Store({
@@ -43,7 +43,7 @@ describe('Auth', () => {
43
43
  expect(wrapper.classes('auth-wrap')).toBe(true);
44
44
  });
45
45
 
46
- it('sets token, gets session and opens app after auth token message emit', async (done) => {
46
+ it('sets token, gets session and opens app after auth token message emit', async () => {
47
47
  const accessToken = 'hello there';
48
48
  window.postMessage({ accessToken }, '*');
49
49
  await setTimeout(() => {
@@ -51,7 +51,6 @@ describe('Auth', () => {
51
51
  expect(userinfoAPI.getSession).toHaveBeenCalled();
52
52
  expect(userinfoAPI.getApplicationsAccess).toHaveBeenCalled();
53
53
  expect(router.replace).toHaveBeenCalled();
54
- done();
55
54
  }, 100);
56
55
  });
57
56
  });
@@ -1,7 +1,7 @@
1
1
  import debounce from '../debounce';
2
2
 
3
3
  describe('debounce', () => {
4
- it('debounces call', async (done) => {
4
+ it('debounces call', async () => {
5
5
  let isFnCalled = false;
6
6
  let fn = () => { isFnCalled = true; };
7
7
  fn = debounce(fn, 50);
@@ -9,7 +9,6 @@ describe('debounce', () => {
9
9
  expect(isFnCalled).toBeFalsy();
10
10
  await setTimeout(() => {
11
11
  expect(isFnCalled).toBeTruthy();
12
- done();
13
12
  }, 100);
14
13
  });
15
14
  });
package/CHANGELOG.md DELETED
@@ -1,44 +0,0 @@
1
- # Webitel UI Changelog
2
-
3
- ## [1.0.0] - 02.02.2022
4
-
5
- ### What's new
6
-
7
- 1. Border-radius pill style: `--border-radius--pill: 50px`
8
- 1. New typography styles (`subtitle`, `caption`, `overline`)
9
- 1. 10 different Elevation variables (`--elevation-1` - `--elevation-10`)
10
- 1. `secondary-50` icon color
11
- 1. added `size` prop with `sm` and `md` values (default is `md`) for:
12
- - `<wt-rounded-action>`
13
- - `<wt-button>`
14
- - `<wt-indicator>`
15
-
16
- ### Breaking changes
17
-
18
- 1. `<wt-badge>` renamed to `<wt-chip>`
19
- 1. removed a dash (`-`) from spacings system (for ex. `--spacing--sm` -> `--spacing-sm`)
20
- 1. Removed all deprecated spacings variables. Existing components moved to newest ones.
21
- 1. Removed all deprecated colors variables. Existing components moved to newest ones.
22
- 1. Removed deprecated `--box-shadow` css variable
23
- 1. Removed `strong` typography classes. (`strong` typo -> `subtitle` typo)
24
- 1. Now font-family is used like "Montserrat" (without "Regular" or "Semi"). Boldness
25
- is regulated by `font-weight` property.
26
- 1. Typo size suffixes update: `-sm`, `-md`, `-lg` -> `-3`, `-2`, `-1`
27
- 1. Removed `--label-margin` variable. Now visual offset between label and input is
28
- provided by label's line-height
29
-
30
- ### Changes
31
-
32
- 1. Updated spacings: `spacing-multiplicator` value increased from `4px` to `8px`.
33
- 1. Updated typography:
34
- - updated font files, added special font files for each `font-weight`
35
- property (`100`-`900`) and style (`italic`)
36
- - font-sizes of typography
37
- - line-heights of typography
38
-
39
- 1. (Almost?) all component paddings, spacings, etc. moved to `spacing` variables
40
- 1. Refactored placeholder:
41
- - removed hover
42
- - removeed outline styles
43
- - focus style now is more transparent than default state
44
- 1. Many component styles reviewed and updated