@webitel/ui-sdk 1.0.8 → 1.0.9

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.8",
3
+ "version": "1.0.9",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -1,36 +1,32 @@
1
1
  <template>
2
2
  <div
3
- class="wt-datepicker"
4
3
  :class="{
5
4
  'wt-datepicker--disabled': disabled,
6
5
  }"
6
+ class="wt-datepicker"
7
7
  >
8
- <wt-label :disabled="disabled" v-bind="labelProps">
8
+ <wt-label v-bind="labelProps" :disabled="disabled">
9
9
  <!-- @slot Custom input label -->
10
- <slot name="label" v-bind="{ label }">{{ label }}</slot>
10
+ <slot v-bind="{ label }" name="label">{{ label }}</slot>
11
11
  </wt-label>
12
12
  <vue-datepicker
13
- class="wt-datepicker__datepicker"
14
- :value="+value"
15
- :format="format"
16
- :maximum-view="maximumView"
17
- :disabled="disabled"
18
- :disabled-dates="disabledDates"
13
+ v-bind="{ ...$attrs, ...$props }"
19
14
  :placeholder="label || placeholder"
20
- :lang="lang"
15
+ :value="+value"
16
+ class="wt-datepicker__datepicker"
21
17
  monday-first
22
18
  @input="$emit('change', $event.getTime())"
23
19
  >
24
20
  <template slot="afterDateInput">
25
21
  <wt-icon
22
+ :color="disabled ? 'disabled' : 'default'"
26
23
  class="wt-datepicker__calendar-icon"
27
24
  icon="calendar"
28
- :color="disabled ? 'disabled' : 'default'"
29
25
  ></wt-icon>
30
26
  <wt-icon
27
+ :color="disabled ? 'disabled' : 'default'"
31
28
  class="wt-datepicker__arrow-icon"
32
29
  icon="arrow-down"
33
- :color="disabled ? 'disabled' : 'default'"
34
30
  ></wt-icon>
35
31
  </template>
36
32
  <template slot="beforeCalendarHeader">
@@ -48,159 +44,160 @@
48
44
  </template>
49
45
 
50
46
  <script>
51
- import VueDatepicker from 'vuejs-datepicker';
52
-
53
- export default {
54
- name: 'wt-datepicker',
55
- components: {
56
- VueDatepicker,
47
+ import VueDatepicker from 'vuejs-datepicker';
48
+
49
+ export default {
50
+ name: 'wt-datepicker',
51
+ components: {
52
+ VueDatepicker,
53
+ },
54
+ props: {
55
+ value: {
56
+ type: [String, Number],
57
+ default: 'Date.now()',
58
+ },
59
+ /**
60
+ * label above calendar input
61
+ */
62
+ label: {
63
+ type: String,
64
+ default: '',
65
+ },
66
+ placeholder: {
67
+ type: String,
68
+ default: '',
69
+ },
70
+ format: {
71
+ type: [String, Function],
72
+ },
73
+ maximumView: {
74
+ type: String,
75
+ default: 'day',
57
76
  },
58
- props: {
59
- value: {
60
- type: [String, Number],
61
- default: 'Date.now()',
62
- },
63
- /**
64
- * label above calendar input
65
- */
66
- label: {
67
- type: String,
68
- default: '',
69
- },
70
- placeholder: {
71
- type: String,
72
- default: '',
73
- },
74
- format: {
75
- type: [String, Function],
76
- },
77
- maximumView: {
78
- type: String,
79
- default: 'day',
80
- },
81
- disabled: {
82
- type: Boolean,
83
- default: false,
84
- },
85
- disabledDates: {
86
- type: Object,
87
- },
88
- lang: {
89
- type: String,
90
- default: 'en',
91
- },
92
- labelProps: {
93
- type: Object,
94
- description: 'Object with props, passed down to wt-label as props',
95
- },
77
+ disabled: {
78
+ type: Boolean,
79
+ default: false,
96
80
  },
97
- model: {
98
- prop: 'value',
99
- event: 'change',
81
+ disabledDates: {
82
+ type: Object,
100
83
  },
101
- };
84
+ lang: {
85
+ type: String,
86
+ default: 'en',
87
+ },
88
+ labelProps: {
89
+ type: Object,
90
+ description: 'Object with props, passed down to wt-label as props',
91
+ },
92
+ },
93
+ model: {
94
+ prop: 'value',
95
+ event: 'change',
96
+ },
97
+ };
102
98
  </script>
103
99
 
104
100
  <style lang="scss" scoped>
105
- .wt-datepicker__calendar-icon {
106
- position: absolute;
107
- top: var(--spacing-xs);
108
- left: var(--input-padding);
109
- pointer-events: none;
101
+ .wt-datepicker__calendar-icon {
102
+ position: absolute;
103
+ top: var(--spacing-xs);
104
+ left: var(--input-padding);
105
+ pointer-events: none;
106
+ }
107
+
108
+ .wt-datepicker__arrow-icon {
109
+ position: absolute;
110
+ top: var(--spacing-xs);
111
+ right: var(--input-padding);
112
+ pointer-events: none;
113
+ }
114
+
115
+ .wt-datepicker__month-arrow {
116
+ position: absolute;
117
+ top: var(--spacing-xs);
118
+ pointer-events: none;
119
+
120
+ &--right {
121
+ right: var(--spacing-xs);
110
122
  }
111
123
 
112
- .wt-datepicker__arrow-icon {
113
- position: absolute;
114
- top: var(--spacing-xs);
115
- right: var(--input-padding);
116
- pointer-events: none;
124
+ &--left {
125
+ left: var(--spacing-xs);
117
126
  }
118
-
119
- .wt-datepicker__month-arrow{
120
- position: absolute;
121
- top: var(--spacing-xs);
122
- pointer-events: none;
123
-
124
- &--right {
125
- right: var(--spacing-xs);
127
+ }
128
+
129
+ ::v-deep .vdp-datepicker {
130
+ min-width: var(--datepicker-width);
131
+
132
+ // preview input
133
+ > div:first-child {
134
+ position: relative;
135
+
136
+ input {
137
+ @extend %typo-body-1;
138
+ @include wt-placeholder;
139
+ box-sizing: border-box;
140
+ width: 100%;
141
+ padding: var(--datepicker-padding);
142
+ border: var(--datepicker-border);
143
+ border-color: var(--form-border-color);
144
+ border-radius: var(--border-radius);
145
+
146
+ &:focus {
147
+ @include wt-placeholder('focus');
148
+ }
126
149
  }
127
150
 
128
- &--left {
129
- left: var(--spacing-xs);
151
+ .vdp-datepicker__calendar-button {
152
+ display: none;
130
153
  }
131
154
  }
132
155
 
156
+ @import '../../../css/components/molecules/wt-datepicker/datepicker-calendar';
157
+ }
158
+
159
+ .wt-datepicker:hover,
160
+ .wt-datepicker:focus-within {
161
+ .wt-label {
162
+ color: var(--form-label--hover-color);
163
+ }
164
+
133
165
  ::v-deep .vdp-datepicker {
134
166
  min-width: var(--datepicker-width);
135
167
 
136
168
  // preview input
137
169
  > div:first-child {
138
- position: relative;
139
170
 
140
171
  input {
141
- @extend %typo-body-1;
142
- @include wt-placeholder;
143
- box-sizing: border-box;
144
- width: 100%;
145
- padding: var(--datepicker-padding);
146
- border: var(--datepicker-border);
147
- border-color: var(--form-border-color);
148
- border-radius: var(--border-radius);
149
-
150
- &:focus {
151
- @include wt-placeholder('focus');
152
- }
153
- }
154
-
155
- .vdp-datepicker__calendar-button {
156
- display: none;
157
- }
158
- }
159
- @import '../../../css/components/molecules/wt-datepicker/datepicker-calendar';
160
- }
161
-
162
- .wt-datepicker:hover,
163
- .wt-datepicker:focus-within {
164
- .wt-label {
165
- color: var(--form-label--hover-color);
166
- }
167
-
168
- ::v-deep .vdp-datepicker {
169
- min-width: var(--datepicker-width);
170
-
171
- // preview input
172
- > div:first-child {
173
-
174
- input {
175
- border-color: var(--form-border--hover-color);
176
- }
172
+ border-color: var(--form-border--hover-color);
177
173
  }
178
174
  }
179
175
  }
176
+ }
180
177
 
181
- .wt-datepicker:focus-within {
182
- ::v-deep .vdp-datepicker {
183
- // arrow down icon
184
- .vdp-datepicker__calendar-button:before {
185
- transform: rotate(180deg);
186
- }
178
+ .wt-datepicker:focus-within {
179
+ ::v-deep .vdp-datepicker {
180
+ // arrow down icon
181
+ .vdp-datepicker__calendar-button:before {
182
+ transform: rotate(180deg);
187
183
  }
188
184
  }
185
+ }
189
186
 
190
- .wt-datepicker--disabled {
191
- pointer-events: none;
187
+ .wt-datepicker--disabled {
188
+ pointer-events: none;
192
189
 
193
- ::v-deep .vdp-datepicker {
194
- min-width: var(--datepicker-width);
190
+ ::v-deep .vdp-datepicker {
191
+ min-width: var(--datepicker-width);
195
192
 
196
- // preview input
197
- > div:first-child {
193
+ // preview input
194
+ > div:first-child {
198
195
 
199
- input {
200
- background: var(--form-border--disabled-color);
201
- border-color: var(--form-border--disabled-color);
202
- }
196
+ input {
197
+ border-color: var(--form-border--disabled-color);
198
+ background: var(--form-border--disabled-color);
203
199
  }
204
200
  }
205
201
  }
202
+ }
206
203
  </style>
@@ -42,15 +42,24 @@
42
42
  </span>
43
43
  </div>
44
44
  <div class="wt-datetimepicker__form-wrapper">
45
- <datepicker
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
46
55
  class="wt-datetimepicker__datepicker"
47
56
  :value="draft"
48
57
  :maximum-view="'day'"
49
58
  :disabled-dates="disabledDates"
50
59
  monday-first
51
60
  inline
52
- @input="setDraft($event.getTime())"
53
- ></datepicker>
61
+ @change="setDraft"
62
+ ></wt-datepicker>
54
63
  <wt-timepicker
55
64
  class="wt-datetimepicker__timepicker"
56
65
  v-model="draft"
@@ -71,12 +80,12 @@
71
80
  </template>
72
81
 
73
82
  <script>
74
- import Datepicker from 'vuejs-datepicker';
83
+ // import Datepicker from 'vuejs-datepicker';
75
84
 
76
85
  export default {
77
86
  name: 'wt-datetimepicker',
78
87
  components: {
79
- Datepicker,
88
+ // Datepicker,
80
89
  },
81
90
 
82
91
  props: {
@@ -226,18 +235,15 @@
226
235
  display: flex;
227
236
  flex-direction: column;
228
237
 
229
- .wt-datetimepicker__datepicker {
230
- input {
238
+ .wt-datetimepicker__datepicker ::v-deep {
239
+ .wt-datepicker__calendar-icon,
240
+ .wt-datepicker__arrow-icon {
231
241
  display: none;
232
242
  }
233
-
234
- ::v-deep {
235
- @import '../../../css/components/molecules/wt-datepicker/datepicker-calendar';
236
-
237
- .vdp-datepicker__calendar {
238
- margin: auto;
239
- border: none;
240
- }
243
+ .vdp-datepicker__calendar {
244
+ padding: 0;
245
+ border-color: transparent;
246
+ box-shadow: none;
241
247
  }
242
248
  }
243
249
 
@@ -266,11 +272,6 @@
266
272
  .wt-datetimepicker__preview__input {
267
273
  border-color: var(--form-border--hover-color);
268
274
  }
269
-
270
- .wt-datetimepicker__calendar-icon ::v-deep .wt-icon__icon,
271
- .wt-datetimepicker__arrow-icon ::v-deep .wt-icon__icon {
272
- fill: var(--icon-color--hover);
273
- }
274
275
  }
275
276
 
276
277
  .wt-datetimepicker:focus-within,
@@ -286,11 +287,6 @@
286
287
  .wt-datetimepicker__arrow-icon {
287
288
  transform: translateY(-50%) rotate(180deg);
288
289
  }
289
-
290
- .wt-datetimepicker__calendar-icon ::v-deep .wt-icon__icon,
291
- .wt-datetimepicker__arrow-icon ::v-deep .wt-icon__icon {
292
- fill: var(--icon-color-active);
293
- }
294
290
  }
295
291
 
296
292
  .wt-datetimepicker--disabled {
@@ -300,10 +296,5 @@
300
296
  border-color: var(--form-border--disabled-color);
301
297
  background: var(--form-border--disabled-color);
302
298
  }
303
-
304
- .wt-datetimepicker__calendar-icon ::v-deep .wt-icon__icon,
305
- .wt-datetimepicker__arrow-icon ::v-deep .wt-icon__icon {
306
- fill: var(--icon-color-disabled);
307
- }
308
299
  }
309
300
  </style>
@@ -79,7 +79,7 @@ export default {
79
79
 
80
80
  &__wrapper {
81
81
  text-align: center;
82
- color: var(--text-contrast-color);
82
+ //color: var(--text-contrast-color);
83
83
  }
84
84
 
85
85
  &__img {
@@ -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;
@@ -201,23 +226,23 @@ export default {
201
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 {