@webitel/ui-sdk 1.0.6 → 1.0.10

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.
@@ -1,44 +1,64 @@
1
1
  <template>
2
- <aside class="wt-navigation-bar" v-clickaway="close">
2
+ <aside v-clickaway="close" class="wt-navigation-bar">
3
3
  <wt-icon-btn
4
+ :class="{'active': isOpened}"
4
5
  class="wt-navigation-bar__menu-btn"
5
6
  icon="menu"
6
- :class="{'active': isOpened}"
7
7
  @click="isOpened = !isOpened"
8
8
  ></wt-icon-btn>
9
9
  <transition name="fade">
10
- <nav class="wt-navigation-bar__nav" v-show="isOpened">
10
+ <nav v-show="isOpened" class="wt-navigation-bar__nav">
11
11
  <header class="wt-navigation-bar__nav-header">
12
12
  <!-- vue cli build target lib cant handle dynamic require :( -->
13
- <img v-if="currentApp === 'admin'"
14
- src="../../../assets/components/organisms/wt-navigation-bar/logo-admin-app.svg" alt="admin">
15
- <img v-if="currentApp === 'agent'"
16
- src="../../../assets/components/organisms/wt-navigation-bar/logo-agent-app.svg" alt="agent">
17
- <img v-if="currentApp === 'audit'"
18
- src="../../../assets/components/organisms/wt-navigation-bar/logo-audit-app.svg" alt="audit">
19
- <img v-if="currentApp === 'history'"
20
- src="../../../assets/components/organisms/wt-navigation-bar/logo-history-app.svg" alt="history">
21
- <img v-if="currentApp === 'supervisor'"
22
- src="../../../assets/components/organisms/wt-navigation-bar/logo-supervisor-app.svg" alt="supervisor">
13
+ <img
14
+ v-if="currentApp === 'admin'"
15
+ alt="admin"
16
+ class="wt-navigation-bar__app-pic"
17
+ src="../../../assets/components/organisms/wt-navigation-bar/logo-admin-app.svg"
18
+ >
19
+ <img
20
+ v-if="currentApp === 'agent'"
21
+ alt="agent"
22
+ class="wt-navigation-bar__app-pic"
23
+ src="../../../assets/components/organisms/wt-navigation-bar/logo-agent-app.svg"
24
+ >
25
+ <img
26
+ v-if="currentApp === 'audit'"
27
+ alt="audit"
28
+ class="wt-navigation-bar__app-pic"
29
+ src="../../../assets/components/organisms/wt-navigation-bar/logo-audit-app.svg"
30
+ >
31
+ <img
32
+ v-if="currentApp === 'history'"
33
+ alt="history"
34
+ class="wt-navigation-bar__app-pic"
35
+ src="../../../assets/components/organisms/wt-navigation-bar/logo-history-app.svg"
36
+ >
37
+ <img
38
+ v-if="currentApp === 'supervisor'"
39
+ alt="supervisor"
40
+ class="wt-navigation-bar__app-pic"
41
+ src="../../../assets/components/organisms/wt-navigation-bar/logo-supervisor-app.svg"
42
+ >
23
43
  <wt-icon-btn
24
44
  class="wt-navigation-bar__nav-close"
25
45
  icon="close"
26
46
  @click="isOpened = false"
27
47
  ></wt-icon-btn>
28
48
  </header>
29
- <wt-divider/>
49
+ <wt-divider />
30
50
  <ul class="wt-navigation-bar__nav-list">
31
51
  <li
32
52
  v-for="(navItem, key) of nav"
33
- class="wt-navigation-bar__nav-item"
34
53
  :key="key"
54
+ class="wt-navigation-bar__nav-item"
35
55
  >
36
56
  <div v-if="!navItem.subNav">
37
57
  <div class="wt-navigation-bar__nav-item-wrapper">
38
58
  <router-link
39
- class="wt-navigation-bar__nav-item-link"
40
59
  :class="{'wt-navigation-bar__nav-item-link--active': currentNav.nav === navItem.value}"
41
60
  :to="navItem.route"
61
+ class="wt-navigation-bar__nav-item-link"
42
62
  @click.native="close"
43
63
  > {{ navItem.name || navItem.value }}
44
64
  </router-link>
@@ -46,33 +66,33 @@
46
66
  </div>
47
67
  <div v-else>
48
68
  <button
49
- class="wt-navigation-bar__nav-expansion"
50
69
  :class="{
51
70
  'wt-navigation-bar__nav-expansion--expanded': isExpanded(navItem),
52
71
  'wt-navigation-bar__nav-expansion--active': currentNav.expansion === navItem.value,
53
72
  }"
73
+ class="wt-navigation-bar__nav-expansion"
54
74
  type="button"
55
75
  @click="expand(navItem)"
56
76
  >
57
77
  <span class="wt-navigation-bar__nav-expansion-name">{{ navItem.name || navItem.value }}</span>
58
78
  <wt-icon
59
79
  class="wt-navigation-bar__expansion-arrow"
60
- icon="arrow-right"
61
80
  color="active"
81
+ icon="arrow-right"
62
82
  ></wt-icon>
63
83
  </button>
64
84
  <expand-transition>
65
85
  <ul v-if="isExpanded(navItem)">
66
86
  <li
67
87
  v-for="(subNavItem, subNavKey) of navItem.subNav"
68
- class="wt-navigation-bar__nav-item"
69
88
  :key="subNavKey"
89
+ class="wt-navigation-bar__nav-item"
70
90
  >
71
91
  <div class="wt-navigation-bar__nav-item-wrapper">
72
92
  <router-link
73
- class="wt-navigation-bar__nav-item-link wt-navigation-bar__nav-item-link--subnav"
74
93
  :class="{'wt-navigation-bar__nav-item-link--active': currentNav.nav === subNavItem.value}"
75
94
  :to="nestedRoute(subNavItem, navItem)"
95
+ class="wt-navigation-bar__nav-item-link wt-navigation-bar__nav-item-link--subnav"
76
96
  @click.native="close"
77
97
  >{{ subNavItem.name || subNavItem.value }}
78
98
  </router-link>
@@ -113,14 +133,14 @@ export default {
113
133
  currentNav() {
114
134
  const path = this.$route.fullPath;
115
135
  const currentNav = this.nav
116
- .reduce((flatNav, currentNavItem) => {
117
- if (currentNavItem.subNav) return flatNav.concat(currentNavItem.subNav);
118
- return [...flatNav, currentNavItem];
119
- }, [])
120
- .find((navItem) => path.includes(navItem.route));
136
+ .reduce((flatNav, currentNavItem) => {
137
+ if (currentNavItem.subNav) return flatNav.concat(currentNavItem.subNav);
138
+ return [...flatNav, currentNavItem];
139
+ }, [])
140
+ .find((navItem) => path.includes(navItem.route));
121
141
  const currentExpansion = this.nav
122
- .filter((nav) => nav.subNav)
123
- .find((nav) => nav.subNav.indexOf(currentNav) !== -1);
142
+ .filter((nav) => nav.subNav)
143
+ .find((nav) => nav.subNav.indexOf(currentNav) !== -1);
124
144
  return {
125
145
  nav: currentNav?.value,
126
146
  expansion: currentExpansion?.value,
@@ -154,21 +174,21 @@ export default {
154
174
  .wt-navigation-bar__nav {
155
175
  @extend %wt-scrollbar;
156
176
  position: fixed;
177
+ z-index: var(--navigation-bar-z-index);
157
178
  top: 0;
158
179
  bottom: 0;
159
180
  left: 0;
181
+ overflow: auto;
160
182
  width: var(--navigation-bar-width);
161
183
  padding: var(--navigation-bar-padding);
162
- overflow: auto;
163
- z-index: var(--navigation-bar-z-index);
164
184
  border-radius: var(--border-radius);
165
- box-shadow: var(--elevation-10);
166
185
  background: var(--navigation-bar-bg-color);
186
+ box-shadow: var(--elevation-10);
167
187
 
168
188
  // expand animation optimization
169
189
  * {
170
- will-change: height;
171
190
  transform: translateZ(0);
191
+ will-change: height;
172
192
  backface-visibility: hidden;
173
193
  perspective: 1000px;
174
194
  }
@@ -176,11 +196,16 @@ export default {
176
196
 
177
197
  .wt-navigation-bar__nav-header {
178
198
  display: flex;
179
- justify-content: space-between;
180
199
  align-items: center;
200
+ justify-content: space-between;
181
201
  padding: var(--navigation-bar-header-padding);
182
202
  }
183
203
 
204
+ .wt-navigation-bar__app-pic {
205
+ width: var(--navigation-bar-app-pic-width);
206
+ height: var(--navigation-bar-app-pic-height);
207
+ }
208
+
184
209
  .wt-navigation-bar__nav-item-link {
185
210
  @extend %typo-body-1;
186
211
  display: block;
@@ -198,26 +223,26 @@ export default {
198
223
  }
199
224
 
200
225
  .wt-navigation-bar__nav-expansion {
201
- @extend %typo-heading-3;
226
+ @extend %typo-subtitle-1;
202
227
  position: relative;
203
228
  display: flex;
204
- justify-content: space-between;
205
229
  align-items: center;
230
+ justify-content: space-between;
206
231
  width: 100%;
207
232
  padding: var(--navigation-bar-link-padding);
208
233
  outline: none;
209
234
 
210
235
  &:before {
211
- opacity: 0;
212
- content: "";
213
236
  position: absolute;
214
237
  top: 0;
215
238
  bottom: 0;
216
239
  left: 0;
217
240
  width: var(--navigation-bar-active-expansion-flag-width);
241
+ content: '';
242
+ transition: var(--transition);
243
+ opacity: 0;
218
244
  border-radius: var(--border-radius);
219
245
  background: var(--accent-color);
220
- transition: var(--transition);
221
246
  }
222
247
 
223
248
  .wt-navigation-bar__expansion-arrow {
@@ -3,27 +3,29 @@
3
3
  <div class="wt-pagination__size">
4
4
  <div class="wt-pagination__size-text">{{ $t('webitelUI.pagination.sizeText') }}</div>
5
5
  <wt-input
6
- class="wt-pagination__size-input"
6
+ :number-max="1000"
7
+ :number-min="1"
7
8
  :value="size"
9
+ class="wt-pagination__size-input"
8
10
  type="number"
9
- :number-min="1"
10
- :number-max="1000"
11
11
  @input="inputHandler"
12
12
  ></wt-input>
13
13
  </div>
14
14
  <div class="wt-pagination__page-controls">
15
15
  <wt-icon-btn
16
+ :disabled="!prev"
17
+ :tooltip="$t('webitelUI.pagination.prev')"
16
18
  class="wt-pagination__page-control"
17
19
  icon="arrow-left"
18
- :tooltip="$t('webitelUI.pagination.prev')"
19
- :disabled="!prev"
20
+ tooltip-position="left"
20
21
  @click="goPrev"
21
22
  ></wt-icon-btn>
22
23
  <wt-icon-btn
24
+ :disabled="!next"
25
+ :tooltip="$t('webitelUI.pagination.next')"
23
26
  class="wt-pagination__page-control"
24
27
  icon="arrow-right"
25
- :tooltip="$t('webitelUI.pagination.next')"
26
- :disabled="!next"
28
+ tooltip-position="left"
27
29
  @click="goNext"
28
30
  ></wt-icon-btn>
29
31
  </div>
@@ -2,38 +2,38 @@
2
2
  <div class="wt-table">
3
3
  <table class="wt-table__table">
4
4
  <thead class="wt-table__head">
5
- <tr class="wt-table__tr wt-table__tr__head" :style="columnsStyle">
6
- <th class="wt-table__th wt-table__th--checkbox" v-if="selectable">
5
+ <tr :style="columnsStyle" class="wt-table__tr wt-table__tr__head">
6
+ <th v-if="selectable" class="wt-table__th wt-table__th--checkbox">
7
7
  <wt-checkbox
8
8
  :selected="isAllSelected"
9
9
  @change="selectAll"
10
10
  ></wt-checkbox>
11
11
  </th>
12
12
  <th
13
- class="wt-table__th"
13
+ v-for="(col, key) of dataHeaders"
14
+ :key="key"
14
15
  :class="[
15
16
  {'wt-table__th--sortable': sortable},
16
17
  `wt-table__th--sort-${col.sort}`,
17
18
  ]"
18
- v-for="(col, key) of dataHeaders"
19
- :key="key"
19
+ class="wt-table__th"
20
20
  @click="sort(col)"
21
21
  >
22
22
  <div class="wt-table__th__text">{{ col.text }}</div>
23
23
  <wt-icon
24
- class="wt-table__th__sort-arrow wt-table__th__sort-arrow--asc"
25
24
  v-if="sortable"
25
+ class="wt-table__th__sort-arrow wt-table__th__sort-arrow--asc"
26
26
  icon="sort-arrow-up"
27
27
  size="sm"
28
28
  ></wt-icon>
29
29
  <wt-icon
30
- class="wt-table__th__sort-arrow wt-table__th__sort-arrow--desc"
31
30
  v-if="sortable"
31
+ class="wt-table__th__sort-arrow wt-table__th__sort-arrow--desc"
32
32
  icon="sort-arrow-down"
33
33
  size="sm"
34
34
  ></wt-icon>
35
35
  </th>
36
- <th class="wt-table__th__actions" v-if="gridActions">
36
+ <th v-if="gridActions" class="wt-table__th__actions">
37
37
  <slot name="actions-header"></slot>
38
38
  </th>
39
39
  </tr>
@@ -41,44 +41,44 @@
41
41
 
42
42
  <tbody class="wt-table__body">
43
43
  <tr
44
- class="wt-table__tr wt-table__tr__body"
45
44
  v-for="(row, dataKey) of data"
46
- :class="`wt-table__tr__${row.id || dataKey}`"
47
45
  :key="dataKey"
46
+ :class="`wt-table__tr__${row.id || dataKey}`"
48
47
  :style="columnsStyle"
48
+ class="wt-table__tr wt-table__tr__body"
49
49
  >
50
- <td class="wt-table__td wt-table__td--checkbox" v-if="selectable">
50
+ <td v-if="selectable" class="wt-table__td wt-table__td--checkbox">
51
51
  <wt-checkbox
52
52
  v-model="row._isSelected"
53
53
  ></wt-checkbox>
54
54
  </td>
55
55
 
56
56
  <td
57
- class="wt-table__td"
58
57
  v-for="(col, headerKey) of dataHeaders"
59
58
  :key="headerKey"
59
+ class="wt-table__td"
60
60
  >
61
- <slot :name="col.value" :item="row" :index="dataKey">
61
+ <slot :index="dataKey" :item="row" :name="col.value">
62
62
  <div>{{ row[col.value] }}</div>
63
63
  </slot>
64
64
  </td>
65
65
 
66
- <td class="wt-table__td__actions" v-if="gridActions">
67
- <slot name="actions" :item="row" :index="dataKey"></slot>
66
+ <td v-if="gridActions" class="wt-table__td__actions">
67
+ <slot :index="dataKey" :item="row" name="actions"></slot>
68
68
  </td>
69
69
  </tr>
70
70
  </tbody>
71
71
 
72
- <tfoot class="wt-table__foot" v-if="isTableFooter">
73
- <tr class="wt-table__tr wt-table__tr__foot" :style="columnsStyle">
72
+ <tfoot v-if="isTableFooter" class="wt-table__foot">
73
+ <tr :style="columnsStyle" class="wt-table__tr wt-table__tr__foot">
74
74
  <!-- empty checkbox column -->
75
- <th class="wt-table__th__checkbox" v-if="selectable"></th>
75
+ <th v-if="selectable" class="wt-table__th__checkbox"></th>
76
76
  <td
77
- class="wt-table__td"
78
77
  v-for="(col, headerKey) of dataHeaders"
79
78
  :key="headerKey"
79
+ class="wt-table__td"
80
80
  >
81
- <slot :name="`${col.value}-footer`" :header="col" :index="headerKey"></slot>
81
+ <slot :header="col" :index="headerKey" :name="`${col.value}-footer`"></slot>
82
82
  </td>
83
83
  </tr>
84
84
  </tfoot>
@@ -165,15 +165,16 @@ export default {
165
165
  }
166
166
 
167
167
  .wt-table__table {
168
- border-collapse: collapse;
169
168
  width: 100%;
169
+ border-collapse: collapse;
170
170
  }
171
171
 
172
172
  .wt-table__head {
173
173
  display: block;
174
- border-radius: var(--border-radius);
174
+ box-sizing: border-box;
175
175
  border: var(--table-head-border);
176
176
  border-color: var(--table-head-border-color);
177
+ border-radius: var(--border-radius);
177
178
  }
178
179
 
179
180
  //.wt-table__head {
@@ -182,10 +183,10 @@ export default {
182
183
 
183
184
  .wt-table__tr {
184
185
  display: grid;
185
- grid-template-columns: repeat(auto-fit, var(--table-col-min-width));
186
- grid-column-gap: var(--table-column-gap);
187
186
  padding: var(--table-row-padding);
188
187
  transition: var(--transition);
188
+ grid-template-columns: repeat(auto-fit, var(--table-col-min-width));
189
+ grid-column-gap: var(--table-column-gap);
189
190
 
190
191
  &:nth-child(2n) {
191
192
  background: var(--table-secondary-color);
@@ -197,13 +198,13 @@ export default {
197
198
  @extend %typo-body-1;
198
199
  display: flex;
199
200
  align-items: center;
200
- padding: 0;
201
201
  width: 100%;
202
202
  max-width: 100%;
203
- min-height: var(--table-min-height);
204
203
  height: fit-content;
205
- overflow-wrap: break-word;
204
+ min-height: var(--table-min-height);
205
+ padding: 0;
206
206
  word-break: break-all;
207
+ overflow-wrap: break-word;
207
208
 
208
209
  &__actions {
209
210
  display: flex;
@@ -238,7 +239,7 @@ export default {
238
239
  }
239
240
 
240
241
  .wt-table__foot {
241
- border-top: var(--table-head-border);
242
242
  border-color: var(--table-head-border-color);
243
+ border-top: var(--table-head-border);
243
244
  }
244
245
  </style>
@@ -81,7 +81,6 @@ export default {
81
81
  .wt-table-actions {
82
82
  display: flex;
83
83
  align-items: center;
84
- flex-wrap: wrap;
85
84
  gap: var(--table-actions-icon-gap);
86
85
  padding: var(--table-actions-padding);
87
86
  }
@@ -1,6 +1,6 @@
1
1
 
2
2
  :root {
3
- --tooltip-padding: var(--spacing-3xs) var(--spacing-2xs);
3
+ --tooltip-padding: var(--spacing-2xs) var(--spacing-xs);
4
4
  --tooltip-z-index: 100;
5
5
 
6
6
  --tooltip-light-text-color: var(--text-primary-color);
@@ -5,6 +5,8 @@
5
5
  --navigation-bar-padding: var(--spacing-sm);
6
6
 
7
7
  --navigation-bar-header-padding: var(--spacing-xs);
8
+ --navigation-bar-app-pic-width: 200px;
9
+ --navigation-bar-app-pic-height: 30px;
8
10
 
9
11
  --navigation-bar-list-padding: var(--navigation-bar-padding);
10
12
  --navigation-bar-link-padding: var(--navigation-bar-padding);
@@ -22,7 +22,7 @@
22
22
  --_main-color: var(--_accent-color-hue), 20%, 99%;
23
23
  --_contrast-color: var(--_accent-color-hue), 20%, 1%;
24
24
  --_secondary-color: var(--_secondary-color-hue), 20%, 90%;
25
- --_secondary-color-50: var(--_secondary-color-hue), 22%, 94%;
25
+ --_secondary-color-50: var(--_secondary-color-hue), 22%, 95%;
26
26
  --_page-bg-color: var(--_page-bg-color-hue), 20%, 95%;
27
27
  --_header-color: var(--_page-bg-color-hue), 20%, 90%;
28
28
  --_positive-color: var(--_positive-color-hue), 60%, 40%;