@webitel/ui-sdk 1.0.40 → 1.0.43

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.40",
3
+ "version": "1.0.43",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -9,6 +9,7 @@
9
9
  "test:unit": "vue-cli-service test:unit",
10
10
  "lint": "vue-cli-service lint --fix",
11
11
  "publish-lib": "npm run test:unit && npm run build && npm publish --access public",
12
+ "publish-lib:testless": "npm run build && npm publish --access public",
12
13
  "prepare": "husky install"
13
14
  },
14
15
  "main": "./dist/@webitel/ui-sdk.common.js",
@@ -25,14 +26,17 @@
25
26
  ],
26
27
  "dependencies": {
27
28
  "@johmun/vue-tags-input": "^2.1.0",
28
- "csv-stringify": "^5.5.3",
29
29
  "core-js": "^3.6.5",
30
+ "csv-stringify": "^5.5.3",
30
31
  "deep-copy": "^1.4.2",
31
32
  "deep-equal": "^2.0.3",
32
33
  "file-saver": "^2.0.2",
34
+ "floating-vue": "^1.0.0-beta.17",
35
+ "i": "^0.3.7",
33
36
  "jszip": "^3.5.0",
34
37
  "jszip-utils": "^0.1.0",
35
38
  "node-polyfill-webpack-plugin": "^1.1.4",
39
+ "npm": "^8.10.0",
36
40
  "plyr": "3.6.2",
37
41
  "vue": "^2.6.11",
38
42
  "vue-i18n": "^8.18.2",
@@ -1,9 +1,13 @@
1
- import { shallowMount } from '@vue/test-utils';
1
+ import { shallowMount, mount, createLocalVue } from '@vue/test-utils';
2
+ import FloatingVue from 'floating-vue';
2
3
  import WtDatetimepicker from '../wt-datetimepicker.vue';
3
4
  import WtLabel from '../../wt-label/wt-label.vue';
4
5
  import WtIcon from '../../../atoms/wt-icon/wt-icon.vue';
5
6
  import WtButton from '../../../atoms/wt-button/wt-button.vue';
6
7
 
8
+ const localVue = createLocalVue();
9
+ localVue.use(FloatingVue);
10
+
7
11
  describe('WtDatetimepicker', () => {
8
12
  it('renders a component', () => {
9
13
  const wrapper = shallowMount(WtDatetimepicker, {
@@ -48,7 +52,8 @@ describe('WtDatetimepicker', () => {
48
52
 
49
53
  it('Triggers change event after button "add" click', async () => {
50
54
  const now = Date.now();
51
- const wrapper = shallowMount(WtDatetimepicker, {
55
+ const wrapper = mount(WtDatetimepicker, {
56
+ localVue,
52
57
  stubs: {
53
58
  WtLabel,
54
59
  WtIcon,
@@ -59,8 +64,13 @@ describe('WtDatetimepicker', () => {
59
64
  value: now,
60
65
  },
61
66
  });
62
- wrapper.find('.wt-datetimepicker__preview').trigger('click');
67
+ wrapper.setData({ isOpened: true });
68
+ // wrapper.find('.wt-datetimepicker__preview').trigger('keyup.enter');
69
+ await wrapper.vm.$nextTick();
70
+ await wrapper.vm.$nextTick();
63
71
  await wrapper.vm.$nextTick();
72
+ console.info(wrapper.html());
73
+ expect(wrapper.find('.wt-datetimepicker__form').exists()).toBe(true);
64
74
  wrapper.find('.wt-datetimepicker__actions > .wt-button').trigger('click');
65
75
  expect(wrapper.emitted().change.pop()).toEqual([now]);
66
76
  });
@@ -1,11 +1,12 @@
1
1
  <template>
2
- <div
2
+ <v-dropdown
3
3
  class="wt-datetimepicker"
4
4
  :class="{
5
5
  'wt-datetimepicker--active': isOpened,
6
6
  'wt-datetimepicker--disabled': disabled,
7
7
  }"
8
- v-clickaway="close"
8
+ :shown.sync="isOpened"
9
+ placement="bottom-start"
9
10
  >
10
11
  <wt-label :disabled="disabled" v-bind="labelProps">
11
12
  <!-- @slot Custom input label -->
@@ -13,11 +14,8 @@
13
14
  </wt-label>
14
15
  <div
15
16
  class="wt-datetimepicker__preview"
16
- :class="{'wt-datetimepicker__preview--opened': isOpened}"
17
17
  tabindex="0"
18
- @click="isOpened = !isOpened"
19
18
  @keyup.enter="isOpened = !isOpened"
20
- @keyup.esc="isOpened = false"
21
19
  >
22
20
  <wt-icon class="wt-datetimepicker__calendar-icon" icon="calendar"></wt-icon>
23
21
  <input
@@ -26,57 +24,61 @@
26
24
  autocomplete="off"
27
25
  readonly
28
26
  >
29
- <wt-icon class="wt-datetimepicker__arrow-icon" icon="arrow-down"></wt-icon>
27
+ <wt-icon
28
+ class="wt-datetimepicker__arrow-icon"
29
+ icon="arrow-down"
30
+ ></wt-icon>
30
31
  </div>
31
-
32
- <div
33
- class="wt-datetimepicker__form"
34
- v-show="isOpened"
35
- >
36
- <div class="wt-datetimepicker__quick-filters-wrapper">
32
+ <template v-slot:popper>
33
+ <div
34
+ class="wt-datetimepicker__form"
35
+ >
36
+ <div class="wt-datetimepicker__quick-filters-wrapper">
37
37
  <span class="wt-datetimepicker__quick-filter" @click="setLastHour">
38
38
  {{$t('webitelUI.datetimepicker.lastHour')}}
39
39
  </span>
40
- <span class="wt-datetimepicker__quick-filter" @click="setLastDay">
40
+ <span class="wt-datetimepicker__quick-filter" @click="setLastDay">
41
41
  {{$t('webitelUI.datetimepicker.lastDay')}}
42
42
  </span>
43
+ </div>
44
+ <div class="wt-datetimepicker__form-wrapper">
45
+ <!-- <datepicker-->
46
+ <!-- class="wt-datetimepicker__datepicker"-->
47
+ <!-- :value="draft"-->
48
+ <!-- :maximum-view="'day'"-->
49
+ <!-- :disabled-dates="disabledDates"-->
50
+ <!-- monday-first-->
51
+ <!-- inline-->
52
+ <!-- @input="setDraft($event.getTime())"-->
53
+ <!-- ></datepicker>-->
54
+ <wt-datepicker
55
+ class="wt-datetimepicker__datepicker"
56
+ :value="draft"
57
+ :maximum-view="'day'"
58
+ :disabled-dates="disabledDates"
59
+ monday-first
60
+ inline
61
+ @change="setDraft"
62
+ ></wt-datepicker>
63
+ <wt-timepicker
64
+ class="wt-datetimepicker__timepicker"
65
+ v-model="draft"
66
+ format="hh:mm"
67
+ date-mode
68
+ ></wt-timepicker>
69
+ </div>
70
+ <div class="wt-datetimepicker__actions">
71
+ <wt-button @click="input">
72
+ {{$t('reusable.add')}}
73
+ </wt-button>
74
+ <wt-button color="secondary" @click="close">
75
+ {{$t('reusable.cancel')}}
76
+ </wt-button>
77
+ </div>
43
78
  </div>
44
- <div class="wt-datetimepicker__form-wrapper">
45
- <!-- <datepicker-->
46
- <!-- class="wt-datetimepicker__datepicker"-->
47
- <!-- :value="draft"-->
48
- <!-- :maximum-view="'day'"-->
49
- <!-- :disabled-dates="disabledDates"-->
50
- <!-- monday-first-->
51
- <!-- inline-->
52
- <!-- @input="setDraft($event.getTime())"-->
53
- <!-- ></datepicker>-->
54
- <wt-datepicker
55
- class="wt-datetimepicker__datepicker"
56
- :value="draft"
57
- :maximum-view="'day'"
58
- :disabled-dates="disabledDates"
59
- monday-first
60
- inline
61
- @change="setDraft"
62
- ></wt-datepicker>
63
- <wt-timepicker
64
- class="wt-datetimepicker__timepicker"
65
- v-model="draft"
66
- format="hh:mm"
67
- date-mode
68
- ></wt-timepicker>
69
- </div>
70
- <div class="wt-datetimepicker__actions">
71
- <wt-button @click="input">
72
- {{$t('reusable.add')}}
73
- </wt-button>
74
- <wt-button color="secondary" @click="close">
75
- {{$t('reusable.cancel')}}
76
- </wt-button>
77
- </div>
78
- </div>
79
- </div>
79
+
80
+ </template>
81
+ </v-dropdown>
80
82
  </template>
81
83
 
82
84
  <script>
@@ -206,16 +208,12 @@
206
208
  }
207
209
 
208
210
  .wt-datetimepicker__form {
209
- position: absolute;
210
- top: 100%;
211
- left: 0;
212
211
  padding: var(--datetimepicker-form-padding);
213
212
  background: var(--datetimepicker-form-bg-color);
214
213
  box-sizing: border-box;
215
214
  border: var(--datetimepicker-border);
216
215
  border-color: var(--form-border-color);
217
216
  border-radius: var(--border-radius);
218
- z-index: var(--datetimepicker-form-z-index);
219
217
  }
220
218
 
221
219
  .wt-datetimepicker__quick-filters-wrapper {
@@ -283,7 +281,9 @@
283
281
  .wt-datetimepicker__preview__input {
284
282
  border-color: var(--form-border--active-color);
285
283
  }
284
+ }
286
285
 
286
+ .wt-datetimepicker--active {
287
287
  .wt-datetimepicker__arrow-icon {
288
288
  transform: translateY(-50%) rotate(180deg);
289
289
  }
@@ -6,7 +6,6 @@
6
6
 
7
7
  --datetimepicker-form-padding: var(--spacing-xs);
8
8
  --datetimepicker-form-bg-color: var(--main-color);
9
- --datetimepicker-form-z-index: 5; // overflow selects' arrow
10
9
 
11
10
  --datetimepicker-form-content-margin: var(--spacing-xs);
12
- }
11
+ }
package/src/css/main.scss CHANGED
@@ -67,4 +67,9 @@ a {
67
67
  .hidden {
68
68
  opacity: 0;
69
69
  pointer-events: none;
70
- }
70
+ }
71
+
72
+ // https://github.com/Akryum/floating-vue/issues/488
73
+ .v-popper__arrow-container {
74
+ display: none;
75
+ }
@@ -130,7 +130,7 @@ export default {
130
130
  [AdminSections.RESOURCE_GROUPS]: 'Resource groups',
131
131
  [AdminSections.QUEUES]: 'Queues',
132
132
  [AdminSections.STORAGE]: 'Storage',
133
- [AdminSections.STORAGE]: 'Cognitive profiles',
133
+ [AdminSections.COGNITIVE_PROFILES]: 'Cognitive profiles',
134
134
  [AdminSections.MEDIA]: 'Media',
135
135
  [AdminSections.BLACKLIST]: 'Call lists',
136
136
  [AdminSections.ROLES]: 'Roles',
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