@webitel/ui-sdk 23.12.18 → 23.12.19

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": "23.12.18",
3
+ "version": "23.12.19",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "build": "vue-cli-service build --target lib --name ui-sdk ./src/install.js",
@@ -24,15 +24,16 @@ describe('WtSelectButton', () => {
24
24
  expect(wrapper.find('.wt-button-select__button').text()).toBe(content);
25
25
  });
26
26
 
27
- it('should rotate the arrow', () => {
27
+ it('should rotate the arrow', async () => {
28
28
  const wrapper = mount(WtSelectButton, {
29
- data: () => ({
30
- isOpened: true,
31
- }),
32
29
  props: {
33
30
  options: [],
34
31
  },
35
32
  });
33
+ const arrowBtn = wrapper.findAllComponents({ name: 'wt-button' })
34
+ .find((component) => component.classes().includes('wt-button-select__select-btn'));
35
+ arrowBtn.vm.$emit('click');
36
+ await wrapper.vm.$nextTick();
36
37
  const wtIcon = wrapper.find('.wt-button-select__select-arrow');
37
38
  expect(wtIcon.classes()).toContain('wt-button-select__select-arrow--active');
38
39
  });
@@ -15,7 +15,7 @@
15
15
 
16
16
  <wt-context-menu
17
17
  :options="options"
18
- :visible="isContextMenuVisible"
18
+ :visible="isOpened"
19
19
  @click="selectOption"
20
20
  >
21
21
  <template v-slot:activator>
@@ -41,7 +41,7 @@
41
41
  </template>
42
42
 
43
43
  <script setup>
44
- import { computed, ref } from 'vue';
44
+ import { ref } from 'vue';
45
45
 
46
46
  const props = defineProps({
47
47
  /**
@@ -83,11 +83,6 @@ const emit = defineEmits([
83
83
 
84
84
  const isOpened = ref(false);
85
85
 
86
- const isContextMenuVisible = computed(() => {
87
- if (props.disabled) return false;
88
- return isOpened.value;
89
- });
90
-
91
86
  function selectOption({ option, index }) {
92
87
  emit('click:option', option, index);
93
88
  isOpened.value = false;
@@ -0,0 +1,9 @@
1
+ ```vue
2
+ <wt-headline-nav
3
+ :path="[
4
+ { name: 'Admin' },
5
+ { name: 'Contact-center' },
6
+ { name: 'Queues', route: 'https://dev.webitel.com/contact-center/queues' },
7
+ ]"
8
+ ></wt-headline-nav>
9
+ ```
@@ -1,5 +1,8 @@
1
1
 
2
2
  :root {
3
- --headline-nav-indicator-size: 6px;
4
- --headline-nav-indicator-margin: 19px;
3
+ --headline-nav-indicator-size: 4px;
4
+ --headline-nav-gap: var(--spacing-sm);
5
+ --headline-nav-dot-gap: var(--spacing-2xs);
6
+ --headline-nav-indicator-color: var(--primary-color);
7
+ --headline-nav-accent-indicator-color: var(--primary-color);
5
8
  }
@@ -1,16 +1,16 @@
1
1
  <template>
2
2
  <nav class="wt-headline-nav">
3
3
  <div
4
- class="wt-headline-nav__wrapper"
5
4
  v-for="(singlePath, key) of path"
6
5
  :key="key"
6
+ class="wt-headline-nav__wrapper"
7
7
  >
8
8
  <span v-if="key !== 0" class="wt-headline-nav__indicator"></span>
9
9
  <h1 class="wt-headline-nav__title">
10
10
  <router-link
11
11
  v-if="singlePath.route"
12
- class="wt-headline-nav__text wt-headline-nav__title-link"
13
12
  :to="singlePath.route"
13
+ class="wt-headline-nav__text wt-headline-nav__text--link"
14
14
  >{{ singlePath.name }}
15
15
  </router-link>
16
16
  <span v-else class="wt-headline-nav__text">{{ singlePath.name }}</span>
@@ -19,22 +19,21 @@
19
19
  </nav>
20
20
  </template>
21
21
 
22
- <script>
23
- export default {
24
- name: 'wt-headline-nav',
25
- props: {
26
- path: {
27
- type: Array,
28
- required: true,
29
- // PATH EXAMPLE
30
- // default: () => [
31
- // { name: 'directory' },
32
- // { name: 'users', route: '/directory/users' },
33
- // { name: 'adm', route: '/directory/users/3' },
34
- // ],
35
- },
22
+ <script setup>
23
+ const props = defineProps({
24
+ /**
25
+ * PATH EXAMPLE
26
+ * default: () => [
27
+ * { name: 'directory' },
28
+ * { name: 'users', route: '/directory/users' },
29
+ * { name: 'adm', route: '/directory/users/3' },
30
+ * ],
31
+ */
32
+ path: {
33
+ type: Array,
34
+ required: true,
36
35
  },
37
- };
36
+ });
38
37
  </script>
39
38
 
40
39
  <style lang="scss">
@@ -42,26 +41,35 @@ export default {
42
41
  </style>
43
42
 
44
43
  <style lang="scss" scoped>
45
-
46
44
  .wt-headline-nav {
47
45
  display: flex;
48
46
  align-items: center;
49
47
  max-width: 100%;
48
+ gap: var(--headline-nav-gap);
50
49
  }
51
50
 
52
51
  .wt-headline-nav__wrapper {
53
52
  display: flex;
54
53
  align-items: center;
54
+ gap: var(--headline-nav-dot-gap);
55
55
  }
56
56
 
57
57
  .wt-headline-nav__indicator {
58
- display: inline-block;
59
- width: var(--headline-nav-indicator-size);
60
- height: var(--headline-nav-indicator-size);
61
- margin: 0 var(--headline-nav-indicator-margin);
62
- background: var(--icon-color);
63
- border-radius: 50%;
58
+ display: flex;
59
+ align-items: center;
64
60
  flex-shrink: 0;
61
+ justify-content: center;
62
+ width: var(--icon-md-size);
63
+ height: var(--icon-md-size);
64
+
65
+ &:before {
66
+ display: block;
67
+ width: var(--headline-nav-indicator-size);
68
+ height: var(--headline-nav-indicator-size);
69
+ content: '';
70
+ border-radius: 50%;
71
+ background: var(--icon-color);
72
+ }
65
73
  }
66
74
 
67
75
  .wt-headline-nav__title {
@@ -69,23 +77,21 @@ export default {
69
77
  }
70
78
 
71
79
  .wt-headline-nav__text {
72
- color: var(--text-outline-color);
80
+ color: var(--main-text-color);
73
81
  }
74
82
 
75
83
  .wt-headline-nav__wrapper:last-child {
76
84
  min-width: 0;
77
85
 
78
86
  .wt-headline-nav__indicator {
79
- background: var(--icon-color-accent);
87
+ &:before {
88
+ background: var(--icon-primary-color);
89
+ }
80
90
  }
81
91
 
82
92
  .wt-headline-nav__title {
83
93
  overflow: hidden;
84
94
  text-overflow: ellipsis;
85
95
  }
86
-
87
- .wt-headline-nav__text {
88
- color: var(--text-primary-color);
89
- }
90
96
  }
91
97
  </style>