@webitel/ui-sdk 23.12.39-vite-6 → 23.12.40
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/dist/demo.html +1 -0
- package/dist/img/sprite/index.js +1 -147
- package/dist/ui-sdk.common.js +43304 -0
- package/dist/ui-sdk.common.js.map +1 -0
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.umd.js +43303 -18
- package/dist/ui-sdk.umd.js.map +1 -0
- package/dist/ui-sdk.umd.min.js +35 -0
- package/dist/ui-sdk.umd.min.js.map +1 -0
- package/package.json +38 -20
- package/src/components/on-demand/wt-cc-agent-status-timers/wt-cc-agent-status-timers.vue +3 -3
- package/src/components/on-demand/wt-save-failed-popup/__tests__/WtPopup.spec.js +9 -0
- package/src/components/on-demand/wt-save-failed-popup/wt-save-failed-popup.vue +70 -0
- package/src/components/transitions/wt-expand-transition.vue +2 -2
- package/src/components/wt-app-header/wt-app-header.vue +2 -2
- package/src/components/wt-app-header/wt-app-navigator.vue +5 -6
- package/src/components/wt-app-header/wt-header-actions.vue +14 -30
- package/src/components/wt-avatar/wt-avatar.vue +2 -2
- package/src/components/wt-badge/wt-badge.vue +3 -3
- package/src/components/wt-button/wt-button.vue +3 -5
- package/src/components/wt-button-select/__tests__/WtButtonSelect.spec.js +4 -4
- package/src/components/wt-button-select/wt-button-select.vue +3 -3
- package/src/components/wt-checkbox/wt-checkbox.vue +7 -12
- package/src/components/wt-chip/wt-chip.vue +3 -6
- package/src/components/wt-context-menu/wt-context-menu.vue +4 -4
- package/src/components/wt-copy-action/wt-copy-action.vue +6 -6
- package/src/components/wt-datepicker/wt-datepicker.vue +12 -14
- package/src/components/wt-divider/wt-divider.vue +1 -1
- package/src/components/wt-dummy/wt-dummy.vue +2 -6
- package/src/components/wt-error-page/wt-error-page.vue +4 -10
- package/src/components/wt-expansion-panel/wt-expansion-panel.vue +4 -4
- package/src/components/wt-filters-panel-wrapper/wt-filters-panel-wrapper.vue +4 -7
- package/src/components/wt-headline/wt-headline.vue +4 -4
- package/src/components/wt-headline-nav/wt-headline-nav.vue +4 -11
- package/src/components/wt-hint/wt-hint.vue +4 -4
- package/src/components/wt-icon/wt-icon.vue +5 -5
- package/src/components/wt-icon-action/_internals/wt-add-icon-action.vue +2 -2
- package/src/components/wt-icon-action/_internals/wt-delete-icon-action.vue +2 -2
- package/src/components/wt-icon-action/_internals/wt-download-icon-action.vue +2 -2
- package/src/components/wt-icon-action/_internals/wt-edit-icon-action.vue +2 -2
- package/src/components/wt-icon-action/_internals/wt-history-icon-action.vue +2 -2
- package/src/components/wt-icon-action/_internals/wt-refresh-icon-action.vue +2 -2
- package/src/components/wt-icon-action/wt-icon-action.vue +1 -1
- package/src/components/wt-icon-btn/wt-icon-btn.vue +1 -1
- package/src/components/wt-indicator/wt-indicator.vue +3 -6
- package/src/components/wt-input/wt-input.vue +182 -193
- package/src/components/wt-input-info/wt-input-info.vue +2 -2
- package/src/components/wt-item-link/wt-item-link.vue +1 -1
- package/src/components/wt-label/wt-label.vue +2 -2
- package/src/components/wt-load-bar/wt-load-bar.vue +2 -5
- package/src/components/wt-loader/_internals/wt-loader--md.vue +2 -11
- package/src/components/wt-loader/_internals/wt-loader--sm.vue +2 -9
- package/src/components/wt-loader/wt-loader.vue +3 -10
- package/src/components/wt-navigation-bar/wt-navigation-bar.vue +8 -16
- package/src/components/wt-notification/wt-notification.vue +3 -3
- package/src/components/wt-notifications-bar/wt-notifications-bar.vue +5 -9
- package/src/components/wt-page-header/wt-page-header.vue +8 -7
- package/src/components/wt-page-wrapper/wt-page-wrapper.vue +5 -8
- package/src/components/wt-pagination/wt-pagination.vue +15 -17
- package/src/components/wt-player/wt-player.vue +16 -16
- package/src/components/wt-popup/wt-popup.vue +7 -13
- package/src/components/wt-progress-bar/wt-progress-bar.vue +7 -11
- package/src/components/wt-radio/wt-radio.vue +7 -15
- package/src/components/wt-rounded-action/wt-rounded-action.vue +2 -2
- package/src/components/wt-search-bar/__tests__/WtSearchBar.spec.js +1 -1
- package/src/components/wt-search-bar/wt-search-bar.vue +5 -6
- package/src/components/wt-select/_multiselect.scss +1 -0
- package/src/components/wt-select/wt-select.vue +19 -33
- package/src/components/wt-slider/wt-slider.vue +5 -5
- package/src/components/wt-status-select/wt-status-select.vue +9 -9
- package/src/components/wt-stepper/wt-stepper.vue +6 -8
- package/src/components/wt-switcher/wt-switcher.vue +7 -12
- package/src/components/wt-table/wt-table.vue +72 -110
- package/src/components/wt-table-actions/wt-table-actions.vue +14 -14
- package/src/components/wt-table-column-select/wt-table-column-select.vue +26 -28
- package/src/components/wt-tabs/wt-tabs.vue +7 -7
- package/src/components/wt-tags-input/wt-tags-input.vue +15 -23
- package/src/components/wt-textarea/wt-textarea.vue +10 -15
- package/src/components/wt-time-input/wt-time-input.vue +4 -7
- package/src/components/wt-timepicker/wt-timepicker.vue +15 -19
- package/src/components/wt-tooltip/_internals/wt-tooltip-floating.vue +2 -2
- package/src/components/wt-tooltip/wt-tooltip.vue +4 -4
- package/src/composables/useCachedInterval/__tests__/useCachedInterval.spec.js +5 -5
- package/src/css/styleguide/colors/_colors.scss +8 -9
- package/src/locale/en/en.js +5 -0
- package/src/locale/i18n.js +1 -1
- package/src/locale/kz/kz.js +5 -0
- package/src/locale/ru/ru.js +5 -0
- package/src/locale/ua/ua.js +5 -0
- package/src/mixins/validationMixin/useValidation.js +2 -2
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-agent-status-select.spec.js +4 -4
- package/src/modules/AgentStatusSelect/components/_internals/wt-cc-pause-cause-popup.vue +9 -11
- package/src/modules/AgentStatusSelect/components/_internals/wt-cc-status-select-error-popup.vue +5 -6
- package/src/modules/AgentStatusSelect/components/wt-cc-agent-status-select.vue +3 -3
- package/src/modules/AuditForm/components/__tests__/audit-form.spec.js +1 -1
- package/src/modules/AuditForm/components/audit-form-question-read-wrapper.vue +6 -10
- package/src/modules/AuditForm/components/audit-form-question-write-wrapper.vue +8 -8
- package/src/modules/AuditForm/components/audit-form-question.vue +8 -8
- package/src/modules/AuditForm/components/audit-form.vue +5 -6
- package/src/modules/AuditForm/components/questions/options/audit-form-question-options-write-row.vue +4 -4
- package/src/modules/AuditForm/components/questions/options/audit-form-question-options.vue +4 -7
- package/src/modules/AuditForm/components/questions/score/audit-form-question-score.vue +3 -3
- package/src/modules/CSVExport/__tests__/CSVExport.spec.js +2 -2
- package/src/modules/DeleteConfirmationPopup/__tests__/delete-confirmation-popup.spec.js +6 -6
- package/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue +6 -13
- package/src/modules/FilesExport/__tests__/FilesExport.spec.js +3 -3
- package/src/modules/Filters/components/filter-pagination.vue +1 -1
- package/src/modules/Filters/components/filter-table-fields.vue +1 -1
- package/src/modules/Notifications/store/__tests__/NotificationsStoreModule.actions.spec.js +3 -3
- package/src/modules/QueryFilters/classes/__tests__/ApiFilterSchema.spec.js +1 -1
- package/src/modules/QueryFilters/components/__tests__/abstract-api-filter.spec.js +4 -4
- package/src/modules/QueryFilters/components/__tests__/filter-datetime.spec.js +2 -2
- package/src/modules/QueryFilters/components/__tests__/filter-from-to.spec.js +4 -4
- package/src/modules/QueryFilters/components/__tests__/filter-search.spec.js +2 -2
- package/src/modules/QueryFilters/components/abstract-api-filter.vue +2 -2
- package/src/modules/QueryFilters/components/abstract-enum-filter.vue +2 -2
- package/src/modules/QueryFilters/components/filter-datetime.vue +2 -2
- package/src/modules/QueryFilters/components/filter-from-to.vue +10 -12
- package/src/modules/QueryFilters/components/filter-search.vue +2 -2
- package/src/modules/QueryFilters/components/filter-table-fields.vue +7 -7
- package/src/modules/QueryFilters/mixins/__tests__/apiFilterMixin.spec.js +1 -1
- package/src/modules/QueryFilters/mixins/__tests__/enumFilterMixin.spec.js +2 -2
- package/src/modules/QueryFilters/mixins/__tests__/paginationFilterMixin.spec.js +2 -2
- package/src/modules/QueryFilters/mixins/__tests__/sortFilterMixin.spec.js +1 -1
- package/src/modules/QueryFilters/store/__tests__/QueryFiltersStoreModule.spec.js +2 -2
- package/src/modules/Userinfo/components/__tests__/auth.spec.js +4 -4
- package/src/modules/Userinfo/components/the-auth.vue +4 -7
- package/src/scripts/saveAsJSON.js +7 -0
- package/src/store/BaseStoreModules/__tests__/BaseStoreModule.spec.js +6 -6
- package/dist/favicon.ico +0 -0
- package/dist/plyr.svg +0 -70
- package/dist/ui-sdk.mjs +0 -22678
- package/src/components/wt-input/Readme.md +0 -96
- package/src/css/styleguide/colors/reusable/_text-field.scss +0 -20
- package/src/locale/.DS_Store +0 -0
|
@@ -19,14 +19,13 @@
|
|
|
19
19
|
<slot
|
|
20
20
|
name="label"
|
|
21
21
|
v-bind="{ label }"
|
|
22
|
-
>
|
|
23
|
-
{{ requiredLabel }}
|
|
22
|
+
>{{ requiredLabel }}
|
|
24
23
|
</slot>
|
|
25
24
|
</wt-label>
|
|
26
25
|
<div class="wt-input__wrapper">
|
|
27
26
|
<input
|
|
28
27
|
:id="name"
|
|
29
|
-
ref="
|
|
28
|
+
ref="wt-input"
|
|
30
29
|
:class="{
|
|
31
30
|
'wt-input--is-password': isPassword,
|
|
32
31
|
}"
|
|
@@ -42,234 +41,212 @@
|
|
|
42
41
|
@keyup="$emit('keyup', $event)"
|
|
43
42
|
>
|
|
44
43
|
<div
|
|
45
|
-
ref="
|
|
44
|
+
ref="after-wrapper"
|
|
46
45
|
class="wt-input__after-wrapper"
|
|
47
46
|
>
|
|
48
47
|
<slot
|
|
49
48
|
name="after-input"
|
|
50
|
-
|
|
49
|
+
></slot>
|
|
51
50
|
<slot
|
|
52
51
|
v-if="isPassword"
|
|
53
52
|
name="show-password"
|
|
54
53
|
v-bind="{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
isPasswordVisible,
|
|
55
|
+
switchVisibilityPassword,
|
|
56
|
+
}"
|
|
58
57
|
>
|
|
59
58
|
<wt-icon-btn
|
|
60
59
|
:disabled="disabled"
|
|
61
60
|
:icon="showPasswordIcon"
|
|
62
61
|
@click="switchVisibilityPassword"
|
|
63
|
-
|
|
62
|
+
></wt-icon-btn>
|
|
64
63
|
</slot>
|
|
65
64
|
</div>
|
|
66
65
|
</div>
|
|
67
66
|
<wt-input-info
|
|
68
67
|
v-if="isValidation"
|
|
69
68
|
:invalid="invalid"
|
|
70
|
-
>
|
|
71
|
-
{{ validationText }}
|
|
69
|
+
>{{ validationText }}
|
|
72
70
|
</wt-input-info>
|
|
73
71
|
</div>
|
|
74
72
|
</template>
|
|
75
73
|
|
|
76
|
-
<script
|
|
77
|
-
import
|
|
78
|
-
ref, computed, useSlots, onMounted,
|
|
79
|
-
} from 'vue';
|
|
80
|
-
import { useValidation } from '../../mixins/validationMixin/useValidation';
|
|
74
|
+
<script>
|
|
75
|
+
import validationMixin from '../../mixins/validationMixin/validationMixin';
|
|
81
76
|
|
|
82
77
|
/*
|
|
83
78
|
* IMPORTANT: WT-INPUT SHOULD SUPPORT VUE 3 AND VUE 2 V-MODEL INTERFACES SO THAT THERE'S
|
|
84
79
|
* TWO PROPS: VALUE AND MODELVALUE, AND 2 EVENTS: @UPDATE:MODELVALUE AND @INPUT
|
|
85
80
|
* */
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
81
|
+
export default {
|
|
82
|
+
name: 'wt-input',
|
|
83
|
+
mixins: [validationMixin],
|
|
84
|
+
props: {
|
|
85
|
+
value: {
|
|
86
|
+
type: [String, Number],
|
|
87
|
+
},
|
|
88
|
+
/**
|
|
89
|
+
* Current input modelValue (`v-model`)
|
|
90
|
+
*/
|
|
91
|
+
modelValue: {
|
|
92
|
+
type: [String, Number],
|
|
93
|
+
},
|
|
94
|
+
/**
|
|
95
|
+
* Form input label
|
|
96
|
+
*/
|
|
97
|
+
label: {
|
|
98
|
+
type: String,
|
|
99
|
+
default: '',
|
|
100
|
+
},
|
|
101
|
+
/**
|
|
102
|
+
* Form input placeholder
|
|
103
|
+
*/
|
|
104
|
+
placeholder: {
|
|
105
|
+
type: String,
|
|
106
|
+
},
|
|
107
|
+
/**
|
|
108
|
+
* Form input name
|
|
109
|
+
*/
|
|
110
|
+
name: {
|
|
111
|
+
type: String,
|
|
112
|
+
default: '',
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* Form input type
|
|
116
|
+
*/
|
|
117
|
+
type: {
|
|
118
|
+
type: String,
|
|
119
|
+
default: 'text',
|
|
120
|
+
},
|
|
121
|
+
/**
|
|
122
|
+
* Native input required attribute
|
|
123
|
+
*/
|
|
124
|
+
required: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
default: false,
|
|
127
|
+
description: 'Native input required attribute',
|
|
128
|
+
},
|
|
129
|
+
/**
|
|
130
|
+
* Native input disabled attribute
|
|
131
|
+
*/
|
|
132
|
+
disabled: {
|
|
133
|
+
type: Boolean,
|
|
134
|
+
default: false,
|
|
135
|
+
description: 'Native input disabled attribute',
|
|
136
|
+
},
|
|
137
|
+
/**
|
|
138
|
+
* Status of show password icon display
|
|
139
|
+
*/
|
|
140
|
+
hasShowPassword: {
|
|
141
|
+
type: Boolean,
|
|
142
|
+
default: false,
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Native number input restrictions
|
|
147
|
+
*/
|
|
148
|
+
numberMin: {
|
|
149
|
+
type: Number,
|
|
150
|
+
default: 0,
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Native number input restrictions
|
|
155
|
+
*/
|
|
156
|
+
numberMax: {
|
|
157
|
+
type: Number,
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
outline: {
|
|
161
|
+
type: Boolean,
|
|
162
|
+
default: false,
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
labelProps: {
|
|
166
|
+
type: Object,
|
|
167
|
+
description: 'Object with props, passed down to wt-label as props',
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
preventTrim: {
|
|
171
|
+
type: Boolean,
|
|
172
|
+
default: false,
|
|
173
|
+
},
|
|
138
174
|
},
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
175
|
+
emits: ['update:modelValue', 'input', 'keyup'],
|
|
176
|
+
data: () => ({
|
|
177
|
+
inputType: '',
|
|
178
|
+
isPasswordVisible: false,
|
|
179
|
+
}),
|
|
180
|
+
|
|
181
|
+
watch: {
|
|
182
|
+
type: {
|
|
183
|
+
immediate: true,
|
|
184
|
+
handler(type) {
|
|
185
|
+
let inputType = type;
|
|
186
|
+
// Safari has bug for number input
|
|
187
|
+
if (typeof window !== 'undefined' || typeof document !== 'undefined') {
|
|
188
|
+
const ua = navigator.userAgent.toLocaleLowerCase();
|
|
189
|
+
if (
|
|
190
|
+
ua.indexOf('safari') !== -1
|
|
191
|
+
&& ua.indexOf('chrome') === -1
|
|
192
|
+
&& type === 'number'
|
|
193
|
+
) {
|
|
194
|
+
this.isNumberTypeSafari = true;
|
|
195
|
+
inputType = 'text';
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
this.inputType = inputType;
|
|
199
|
+
},
|
|
200
|
+
},
|
|
145
201
|
},
|
|
146
202
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
type: Number,
|
|
152
|
-
default: 0,
|
|
153
|
-
},
|
|
203
|
+
computed: {
|
|
204
|
+
inputValue() {
|
|
205
|
+
return this.value !== undefined ? this.value : this.modelValue;
|
|
206
|
+
},
|
|
154
207
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
numberMax: {
|
|
159
|
-
type: Number,
|
|
160
|
-
},
|
|
208
|
+
hasLabel() {
|
|
209
|
+
return !!(this.label || this.$slots.label);
|
|
210
|
+
},
|
|
161
211
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
},
|
|
212
|
+
requiredLabel() {
|
|
213
|
+
return this.required ? `${this.label}*` : this.label;
|
|
214
|
+
},
|
|
166
215
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
},
|
|
216
|
+
isPassword() {
|
|
217
|
+
return this.type === 'password' && this.hasShowPassword;
|
|
218
|
+
},
|
|
171
219
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
220
|
+
showPasswordIcon() {
|
|
221
|
+
return this.isPasswordVisible ? 'eye--closed' : 'eye--opened';
|
|
222
|
+
},
|
|
175
223
|
},
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
224
|
+
methods: {
|
|
225
|
+
inputHandler(event) {
|
|
226
|
+
const value = this.preventTrim ? event.target.value : event.target.value.trim();
|
|
227
|
+
this.$emit('update:modelValue', value);
|
|
228
|
+
this.$emit('input', value);
|
|
229
|
+
},
|
|
230
|
+
|
|
231
|
+
switchVisibilityPassword() {
|
|
232
|
+
this.isPasswordVisible = !this.isPasswordVisible;
|
|
233
|
+
this.inputType = this.isPasswordVisible ? 'text' : 'password';
|
|
234
|
+
},
|
|
235
|
+
|
|
236
|
+
async updateInputPaddings() {
|
|
237
|
+
// cant test this thing cause vue test utils doesnt render elements width :/
|
|
238
|
+
const afterWrapperWidth = this.$refs['after-wrapper'].offsetWidth;
|
|
239
|
+
const inputEl = this.$refs['wt-input'];
|
|
240
|
+
const defaultInputPadding = getComputedStyle(document.documentElement)
|
|
241
|
+
.getPropertyValue('--input-padding');
|
|
242
|
+
if (afterWrapperWidth >= inputEl.offsetWidth) return; // fixes https://my.webitel.com/browse/WTEL-2635
|
|
243
|
+
inputEl.style.paddingRight = `calc(${defaultInputPadding} * 2 + ${afterWrapperWidth}px)`;
|
|
244
|
+
},
|
|
181
245
|
},
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
default: () => [],
|
|
246
|
+
mounted() {
|
|
247
|
+
this.updateInputPaddings();
|
|
185
248
|
},
|
|
186
|
-
}
|
|
187
|
-
const emit = defineEmits(['update:modelValue', 'input', 'keyup']);
|
|
188
|
-
|
|
189
|
-
const slots = useSlots();
|
|
190
|
-
const {
|
|
191
|
-
isValidation,
|
|
192
|
-
invalid,
|
|
193
|
-
validationText,
|
|
194
|
-
} = useValidation({ v: props.v, customValidators: props.customValidators });
|
|
195
|
-
|
|
196
|
-
// toggles password <-> text at showPassword
|
|
197
|
-
const inputType = ref('');
|
|
198
|
-
inputType.value = props.type;
|
|
199
|
-
|
|
200
|
-
// template ref
|
|
201
|
-
const AfterWrapper = ref(null);
|
|
202
|
-
// template ref
|
|
203
|
-
const WtInput = ref(null);
|
|
204
|
-
|
|
205
|
-
const isPasswordVisible = ref(false);
|
|
206
|
-
|
|
207
|
-
// FIXME: uncomment and test, because this code was copy-pasted from vue-storefront long ago
|
|
208
|
-
// watch: {
|
|
209
|
-
// type: {
|
|
210
|
-
// immediate: true,
|
|
211
|
-
// handler(type) {
|
|
212
|
-
// let inputType = type;
|
|
213
|
-
// // Safari has bug for number input
|
|
214
|
-
// if (typeof window !== 'undefined' || typeof document !== 'undefined') {
|
|
215
|
-
// const ua = navigator.userAgent.toLocaleLowerCase();
|
|
216
|
-
// if (
|
|
217
|
-
// ua.indexOf('safari') !== -1
|
|
218
|
-
// && ua.indexOf('chrome') === -1
|
|
219
|
-
// && type === 'number'
|
|
220
|
-
// ) {
|
|
221
|
-
// inputType = 'text';
|
|
222
|
-
// }
|
|
223
|
-
// }
|
|
224
|
-
// this.inputType = inputType;
|
|
225
|
-
// },
|
|
226
|
-
// },
|
|
227
|
-
// },
|
|
228
|
-
|
|
229
|
-
const inputValue = computed(() => {
|
|
230
|
-
return props.value !== undefined ? props.value : props.modelValue;
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
const hasLabel = computed(() => {
|
|
234
|
-
return !!(props.label || slots.label);
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
const requiredLabel = computed(() => {
|
|
238
|
-
return props.required ? `${props.label}*` : props.label;
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
const isPassword = computed(() => {
|
|
242
|
-
return props.type === 'password' && props.hasShowPassword;
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
const showPasswordIcon = computed(() => {
|
|
246
|
-
return isPasswordVisible.value ? 'eye--closed' : 'eye--opened';
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
function inputHandler(event) {
|
|
250
|
-
const value = props.preventTrim ? event.target.value : event.target.value.trim();
|
|
251
|
-
emit('update:modelValue', value);
|
|
252
|
-
emit('input', value);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
function switchVisibilityPassword() {
|
|
256
|
-
isPasswordVisible.value = !isPasswordVisible.value;
|
|
257
|
-
inputType.value = isPasswordVisible.value ? 'text' : 'password';
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
function updateInputPaddings() {
|
|
261
|
-
// cant test this thing cause vue test utils doesnt render elements width :/
|
|
262
|
-
const afterWrapperWidth = AfterWrapper.value.offsetWidth;
|
|
263
|
-
const inputEl = WtInput.value;
|
|
264
|
-
const defaultInputPadding = getComputedStyle(document.documentElement)
|
|
265
|
-
.getPropertyValue('--input-padding');
|
|
266
|
-
if (afterWrapperWidth >= inputEl.offsetWidth) return; // fixes https://my.webitel.com/browse/WTEL-2635
|
|
267
|
-
inputEl.style.paddingRight = `calc(${defaultInputPadding} * 2 + ${afterWrapperWidth}px)`;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
onMounted(() => {
|
|
271
|
-
updateInputPaddings();
|
|
272
|
-
});
|
|
249
|
+
};
|
|
273
250
|
</script>
|
|
274
251
|
|
|
275
252
|
<style lang="scss">
|
|
@@ -290,6 +267,18 @@ onMounted(() => {
|
|
|
290
267
|
position: relative;
|
|
291
268
|
}
|
|
292
269
|
|
|
270
|
+
.wt-label {
|
|
271
|
+
.wt-input:hover &,
|
|
272
|
+
.wt-input:focus-within & {
|
|
273
|
+
color: var(--form-label--hover-color);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.wt-input--invalid:hover &,
|
|
277
|
+
.wt-input--invalid:focus-within & {
|
|
278
|
+
color: var(--label--invalid-color);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
293
282
|
.wt-input__input {
|
|
294
283
|
@extend %typo-body-1;
|
|
295
284
|
@include wt-placeholder;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="wt-load-bar">
|
|
3
|
-
<span
|
|
4
|
-
:style="`width: ${progressWidth}%;`"
|
|
5
|
-
class="wt-load-bar__progress"
|
|
6
|
-
/>
|
|
3
|
+
<span :style="`width: ${this.progressWidth}%;`" class="wt-load-bar__progress"></span>
|
|
7
4
|
</div>
|
|
8
5
|
</template>
|
|
9
6
|
|
|
10
7
|
<script>
|
|
11
8
|
export default {
|
|
12
|
-
name: '
|
|
9
|
+
name: 'wt-load-bar',
|
|
13
10
|
props: {
|
|
14
11
|
max: {
|
|
15
12
|
type: [Number, String],
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="wt-loader wt-loader--md">
|
|
3
|
-
<svg
|
|
4
|
-
class="wt-loader--
|
|
5
|
-
viewBox="0 0 80 80"
|
|
6
|
-
>
|
|
7
|
-
<rect
|
|
8
|
-
class="wt-loader--md__svg__rect"
|
|
9
|
-
x="8"
|
|
10
|
-
y="8"
|
|
11
|
-
width="64"
|
|
12
|
-
height="64"
|
|
13
|
-
/>
|
|
3
|
+
<svg class="wt-loader--md__svg" viewBox="0 0 80 80">
|
|
4
|
+
<rect class="wt-loader--md__svg__rect" x="8" y="8" width="64" height="64"></rect>
|
|
14
5
|
</svg>
|
|
15
6
|
</div>
|
|
16
7
|
</template>
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
<!--https://codepen.io/zapdev/pen/MYJRaj-->
|
|
2
2
|
|
|
3
3
|
<template>
|
|
4
|
-
<div
|
|
5
|
-
class="wt-loader--sm"
|
|
6
|
-
:class="`wt-loader--sm--${color}`"
|
|
7
|
-
>
|
|
4
|
+
<div class="wt-loader--sm" :class="`wt-loader--sm--${color}`">
|
|
8
5
|
<svg viewBox="0 0 24 24">
|
|
9
|
-
<circle
|
|
10
|
-
cx="12"
|
|
11
|
-
cy="12"
|
|
12
|
-
r="8"
|
|
13
|
-
/>
|
|
6
|
+
<circle cx="12" cy="12" r="8" />
|
|
14
7
|
</svg>
|
|
15
8
|
</div>
|
|
16
9
|
</template>
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<wt-loader-sm
|
|
3
|
-
|
|
4
|
-
class="wt-loader"
|
|
5
|
-
:color="color"
|
|
6
|
-
/>
|
|
7
|
-
<wt-loader-md
|
|
8
|
-
v-else-if="size === 'md'"
|
|
9
|
-
class="wt-loader"
|
|
10
|
-
/>
|
|
2
|
+
<wt-loader-sm class="wt-loader" v-if="size === 'sm'" :color="color"></wt-loader-sm>
|
|
3
|
+
<wt-loader-md class="wt-loader" v-else-if="size === 'md'"></wt-loader-md>
|
|
11
4
|
</template>
|
|
12
5
|
|
|
13
6
|
<script>
|
|
@@ -15,7 +8,7 @@ import WtLoaderSm from './_internals/wt-loader--sm.vue';
|
|
|
15
8
|
import WtLoaderMd from './_internals/wt-loader--md.vue';
|
|
16
9
|
|
|
17
10
|
export default {
|
|
18
|
-
name: '
|
|
11
|
+
name: 'wt-loader',
|
|
19
12
|
components: {
|
|
20
13
|
WtLoaderSm,
|
|
21
14
|
WtLoaderMd,
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<aside
|
|
3
|
-
v-clickaway="close"
|
|
4
|
-
class="wt-navigation-bar"
|
|
5
|
-
>
|
|
2
|
+
<aside v-clickaway="close" class="wt-navigation-bar">
|
|
6
3
|
<wt-icon-btn
|
|
7
4
|
:class="{'active': isOpened}"
|
|
8
5
|
class="wt-navigation-bar__menu-btn"
|
|
9
6
|
icon="menu"
|
|
10
7
|
@click="isOpened = !isOpened"
|
|
11
|
-
|
|
8
|
+
></wt-icon-btn>
|
|
12
9
|
<transition name="fade">
|
|
13
|
-
<nav
|
|
14
|
-
v-show="isOpened"
|
|
15
|
-
class="wt-navigation-bar__nav"
|
|
16
|
-
>
|
|
10
|
+
<nav v-show="isOpened" class="wt-navigation-bar__nav">
|
|
17
11
|
<header class="wt-navigation-bar__nav-header">
|
|
18
12
|
<!-- vue cli build target lib cant handle dynamic require :( -->
|
|
19
13
|
<img
|
|
@@ -56,7 +50,7 @@
|
|
|
56
50
|
class="wt-navigation-bar__nav-close"
|
|
57
51
|
icon="close"
|
|
58
52
|
@click="isOpened = false"
|
|
59
|
-
|
|
53
|
+
></wt-icon-btn>
|
|
60
54
|
</header>
|
|
61
55
|
<wt-divider />
|
|
62
56
|
<ul class="wt-navigation-bar__nav-list">
|
|
@@ -72,8 +66,7 @@
|
|
|
72
66
|
:to="navItem.route"
|
|
73
67
|
class="wt-navigation-bar__nav-item-link"
|
|
74
68
|
@click="close"
|
|
75
|
-
>
|
|
76
|
-
{{ navItem.name || navItem.value }}
|
|
69
|
+
> {{ navItem.name || navItem.value }}
|
|
77
70
|
</router-link>
|
|
78
71
|
</div>
|
|
79
72
|
</div>
|
|
@@ -92,7 +85,7 @@
|
|
|
92
85
|
class="wt-navigation-bar__expansion-arrow"
|
|
93
86
|
color="active"
|
|
94
87
|
icon="arrow-right"
|
|
95
|
-
|
|
88
|
+
></wt-icon>
|
|
96
89
|
</button>
|
|
97
90
|
<expand-transition>
|
|
98
91
|
<ul v-if="isExpanded(navItem)">
|
|
@@ -107,8 +100,7 @@
|
|
|
107
100
|
:to="nestedRoute(subNavItem, navItem)"
|
|
108
101
|
class="wt-navigation-bar__nav-item-link wt-navigation-bar__nav-item-link--subnav"
|
|
109
102
|
@click="close"
|
|
110
|
-
>
|
|
111
|
-
{{ subNavItem.name || subNavItem.value }}
|
|
103
|
+
>{{ subNavItem.name || subNavItem.value }}
|
|
112
104
|
</router-link>
|
|
113
105
|
</div>
|
|
114
106
|
</li>
|
|
@@ -126,7 +118,7 @@
|
|
|
126
118
|
import ExpandTransition from '../transitions/wt-expand-transition.vue';
|
|
127
119
|
|
|
128
120
|
export default {
|
|
129
|
-
name: '
|
|
121
|
+
name: 'wt-navigation-bar',
|
|
130
122
|
components: { ExpandTransition },
|
|
131
123
|
props: {
|
|
132
124
|
currentApp: {
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
class="wt-notification__icon"
|
|
8
8
|
:icon="notificationIcon"
|
|
9
9
|
:color="notificationIconColor"
|
|
10
|
-
|
|
10
|
+
></wt-icon>
|
|
11
11
|
|
|
12
12
|
<p class="wt-notification__text">
|
|
13
|
-
<slot
|
|
13
|
+
<slot></slot>
|
|
14
14
|
</p>
|
|
15
15
|
</article>
|
|
16
16
|
</template>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<script>
|
|
19
19
|
|
|
20
20
|
export default {
|
|
21
|
-
name: '
|
|
21
|
+
name: 'wt-notification',
|
|
22
22
|
props: {
|
|
23
23
|
type: {
|
|
24
24
|
type: String,
|