@webitel/ui-sdk 23.12.41 → 23.12.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/dist/favicon.ico +0 -0
- package/dist/img/sprite/index.js +147 -1
- package/dist/plyr.svg +70 -0
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.mjs +22672 -0
- package/dist/ui-sdk.umd.js +37 -43322
- package/package.json +33 -41
- package/src/components/on-demand/wt-cc-agent-status-timers/wt-cc-agent-status-timers.vue +3 -3
- 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 +6 -5
- package/src/components/wt-app-header/wt-header-actions.vue +30 -14
- 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 +5 -3
- 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 +12 -7
- package/src/components/wt-chip/wt-chip.vue +6 -3
- 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 +14 -12
- package/src/components/wt-divider/wt-divider.vue +1 -1
- package/src/components/wt-dummy/wt-dummy.vue +6 -2
- package/src/components/wt-error-page/wt-error-page.vue +10 -4
- package/src/components/wt-expansion-panel/wt-expansion-panel.vue +4 -4
- package/src/components/wt-filters-panel-wrapper/wt-filters-panel-wrapper.vue +7 -4
- package/src/components/wt-headline/wt-headline.vue +4 -4
- package/src/components/wt-headline-nav/wt-headline-nav.vue +11 -4
- 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 +6 -3
- package/src/components/wt-input/wt-input.vue +189 -198
- 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/_variables.scss +4 -2
- package/src/components/wt-label/wt-label.vue +5 -18
- package/src/components/wt-load-bar/wt-load-bar.vue +5 -2
- package/src/components/wt-loader/_internals/wt-loader--md.vue +11 -2
- package/src/components/wt-loader/_internals/wt-loader--sm.vue +9 -2
- package/src/components/wt-loader/wt-loader.vue +10 -3
- package/src/components/wt-navigation-bar/wt-navigation-bar.vue +16 -8
- package/src/components/wt-notification/wt-notification.vue +3 -3
- package/src/components/wt-notifications-bar/wt-notifications-bar.vue +9 -5
- package/src/components/wt-page-header/wt-page-header.vue +7 -8
- package/src/components/wt-page-wrapper/wt-page-wrapper.vue +8 -5
- package/src/components/wt-pagination/wt-pagination.vue +17 -15
- package/src/components/wt-player/wt-player.vue +16 -16
- package/src/components/wt-popup/wt-popup.vue +13 -7
- package/src/components/wt-progress-bar/wt-progress-bar.vue +11 -7
- package/src/components/wt-radio/wt-radio.vue +15 -7
- 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 +6 -5
- package/src/components/wt-select/_multiselect.scss +1 -2
- package/src/components/wt-select/wt-select.vue +33 -19
- 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 +8 -6
- package/src/components/wt-switcher/wt-switcher.vue +12 -7
- package/src/components/wt-table/wt-table.vue +110 -72
- package/src/components/wt-table-actions/wt-table-actions.vue +14 -14
- package/src/components/wt-table-column-select/wt-table-column-select.vue +28 -26
- package/src/components/wt-tabs/wt-tabs.vue +7 -7
- package/src/components/wt-tags-input/wt-tags-input.vue +23 -15
- package/src/components/wt-textarea/wt-textarea.vue +16 -11
- package/src/components/wt-time-input/wt-time-input.vue +8 -5
- package/src/components/wt-timepicker/wt-timepicker.vue +20 -16
- 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 +9 -8
- package/src/css/styleguide/colors/reusable/_text-field.scss +20 -0
- package/src/css/styleguide/placeholder/_placeholder.scss +6 -11
- package/src/locale/i18n.js +1 -1
- package/src/locale/kz/kz.js +74 -78
- 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 +11 -9
- package/src/modules/AgentStatusSelect/components/_internals/wt-cc-status-select-error-popup.vue +6 -5
- 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 +10 -6
- 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 +6 -5
- 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 +7 -4
- package/src/modules/AuditForm/components/questions/score/audit-form-question-score.vue +3 -3
- package/src/modules/CSVExport/__tests__/CSVExport.spec.js +5 -2
- package/src/modules/DeleteConfirmationPopup/__tests__/delete-confirmation-popup.spec.js +6 -6
- package/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue +13 -6
- package/src/modules/FilesExport/__tests__/FilesExport.spec.js +6 -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 +6 -6
- 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 +12 -10
- 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 +7 -8
- package/src/modules/Userinfo/components/the-auth.vue +7 -4
- package/src/store/BaseStoreModules/__tests__/BaseStoreModule.spec.js +6 -6
- package/dist/demo.html +0 -1
- package/dist/ui-sdk.common.js +0 -43304
- package/dist/ui-sdk.common.js.map +0 -1
- package/dist/ui-sdk.umd.js.map +0 -1
- package/dist/ui-sdk.umd.min.js +0 -35
- package/dist/ui-sdk.umd.min.js.map +0 -1
- package/src/components/wt-button/Readme.md +0 -23
- package/src/components/wt-button-select/Readme.md +0 -13
- package/src/components/wt-headline-nav/Readme.md +0 -9
- package/src/components/wt-icon/Readme.md +0 -327
- package/src/components/wt-icon/docs/cleanup-svg-fill-none.png +0 -0
- package/src/components/wt-icon/docs/cleanup-svg-fill.png +0 -0
- package/src/components/wt-icon/docs/cleanup-svg-viewbox-correct.png +0 -0
- package/src/components/wt-icon/docs/cleanup-svg-viewbox-incorrect.png +0 -0
- package/src/components/wt-icon/docs/cleanup-svg-width-height.png +0 -0
- package/src/components/wt-icon/docs/svg-icon-code-example.png +0 -0
- package/src/components/wt-icon/docs/svg-sprite-in-dom.png +0 -0
- package/src/components/wt-icon-btn/Readme.md +0 -10
- package/src/components/wt-rounded-action/Readme.md +0 -68
- package/src/validators/variableSearchValidator/Readme.md +0 -13
- package/src/validators/websocketValidator/Readme.md +0 -7
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
:class="{
|
|
4
|
-
'wt-input--outline': outline,
|
|
5
4
|
'wt-input--disabled': disabled,
|
|
6
5
|
'wt-input--invalid': invalid,
|
|
7
6
|
}"
|
|
@@ -12,20 +11,20 @@
|
|
|
12
11
|
:disabled="disabled"
|
|
13
12
|
:for="name"
|
|
14
13
|
:invalid="invalid"
|
|
15
|
-
:outline="outline"
|
|
16
14
|
v-bind="labelProps"
|
|
17
15
|
>
|
|
18
16
|
<!-- @slot Custom input label -->
|
|
19
17
|
<slot
|
|
20
18
|
name="label"
|
|
21
19
|
v-bind="{ label }"
|
|
22
|
-
>
|
|
20
|
+
>
|
|
21
|
+
{{ requiredLabel }}
|
|
23
22
|
</slot>
|
|
24
23
|
</wt-label>
|
|
25
24
|
<div class="wt-input__wrapper">
|
|
26
25
|
<input
|
|
27
26
|
:id="name"
|
|
28
|
-
ref="
|
|
27
|
+
ref="WtInput"
|
|
29
28
|
:class="{
|
|
30
29
|
'wt-input--is-password': isPassword,
|
|
31
30
|
}"
|
|
@@ -41,212 +40,229 @@
|
|
|
41
40
|
@keyup="$emit('keyup', $event)"
|
|
42
41
|
>
|
|
43
42
|
<div
|
|
44
|
-
ref="
|
|
43
|
+
ref="AfterWrapper"
|
|
45
44
|
class="wt-input__after-wrapper"
|
|
46
45
|
>
|
|
47
46
|
<slot
|
|
48
47
|
name="after-input"
|
|
49
|
-
|
|
48
|
+
/>
|
|
50
49
|
<slot
|
|
51
50
|
v-if="isPassword"
|
|
52
51
|
name="show-password"
|
|
53
52
|
v-bind="{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
isPasswordVisible,
|
|
54
|
+
switchVisibilityPassword,
|
|
55
|
+
}"
|
|
57
56
|
>
|
|
58
57
|
<wt-icon-btn
|
|
59
58
|
:disabled="disabled"
|
|
60
59
|
:icon="showPasswordIcon"
|
|
61
60
|
@click="switchVisibilityPassword"
|
|
62
|
-
|
|
61
|
+
/>
|
|
63
62
|
</slot>
|
|
64
63
|
</div>
|
|
65
64
|
</div>
|
|
66
65
|
<wt-input-info
|
|
67
66
|
v-if="isValidation"
|
|
68
67
|
:invalid="invalid"
|
|
69
|
-
>
|
|
68
|
+
>
|
|
69
|
+
{{ validationText }}
|
|
70
70
|
</wt-input-info>
|
|
71
71
|
</div>
|
|
72
72
|
</template>
|
|
73
73
|
|
|
74
|
-
<script>
|
|
75
|
-
import
|
|
74
|
+
<script setup>
|
|
75
|
+
import {
|
|
76
|
+
ref, computed, useSlots, onMounted,
|
|
77
|
+
} from 'vue';
|
|
78
|
+
import { useValidation } from '../../mixins/validationMixin/useValidation';
|
|
76
79
|
|
|
77
80
|
/*
|
|
78
81
|
* IMPORTANT: WT-INPUT SHOULD SUPPORT VUE 3 AND VUE 2 V-MODEL INTERFACES SO THAT THERE'S
|
|
79
82
|
* TWO PROPS: VALUE AND MODELVALUE, AND 2 EVENTS: @UPDATE:MODELVALUE AND @INPUT
|
|
80
83
|
* */
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
type: Boolean,
|
|
142
|
-
default: false,
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Native number input restrictions
|
|
147
|
-
*/
|
|
148
|
-
numberMin: {
|
|
149
|
-
type: Number,
|
|
150
|
-
default: 0,
|
|
151
|
-
},
|
|
84
|
+
const props = defineProps({
|
|
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
|
+
},
|
|
152
144
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
145
|
+
/**
|
|
146
|
+
* Native number input restrictions
|
|
147
|
+
*/
|
|
148
|
+
numberMin: {
|
|
149
|
+
type: Number,
|
|
150
|
+
default: 0,
|
|
151
|
+
},
|
|
159
152
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
153
|
+
/**
|
|
154
|
+
* Native number input restrictions
|
|
155
|
+
*/
|
|
156
|
+
numberMax: {
|
|
157
|
+
type: Number,
|
|
158
|
+
},
|
|
164
159
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
160
|
+
labelProps: {
|
|
161
|
+
type: Object,
|
|
162
|
+
description: 'Object with props, passed down to wt-label as props',
|
|
163
|
+
},
|
|
169
164
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
},
|
|
165
|
+
preventTrim: {
|
|
166
|
+
type: Boolean,
|
|
167
|
+
default: false,
|
|
174
168
|
},
|
|
175
|
-
emits: ['update:modelValue', 'input', 'keyup'],
|
|
176
|
-
data: () => ({
|
|
177
|
-
inputType: '',
|
|
178
|
-
isPasswordVisible: false,
|
|
179
|
-
}),
|
|
180
169
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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
|
-
},
|
|
170
|
+
// validation rules
|
|
171
|
+
// TODO: move to separate file to make it reusable
|
|
172
|
+
v: {
|
|
173
|
+
type: Object,
|
|
201
174
|
},
|
|
175
|
+
customValidators: {
|
|
176
|
+
type: Array,
|
|
177
|
+
default: () => [],
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
const emit = defineEmits(['update:modelValue', 'input', 'keyup']);
|
|
202
181
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
182
|
+
const slots = useSlots();
|
|
183
|
+
const {
|
|
184
|
+
isValidation,
|
|
185
|
+
invalid,
|
|
186
|
+
validationText,
|
|
187
|
+
} = useValidation({ v: props.v, customValidators: props.customValidators });
|
|
207
188
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
189
|
+
// toggles password <-> text at showPassword
|
|
190
|
+
const inputType = ref('');
|
|
191
|
+
inputType.value = props.type;
|
|
211
192
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
193
|
+
// template ref
|
|
194
|
+
const AfterWrapper = ref(null);
|
|
195
|
+
// template ref
|
|
196
|
+
const WtInput = ref(null);
|
|
215
197
|
|
|
216
|
-
|
|
217
|
-
return this.type === 'password' && this.hasShowPassword;
|
|
218
|
-
},
|
|
198
|
+
const isPasswordVisible = ref(false);
|
|
219
199
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
200
|
+
// FIXME: uncomment and test, because this code was copy-pasted from vue-storefront long ago
|
|
201
|
+
// watch: {
|
|
202
|
+
// type: {
|
|
203
|
+
// immediate: true,
|
|
204
|
+
// handler(type) {
|
|
205
|
+
// let inputType = type;
|
|
206
|
+
// // Safari has bug for number input
|
|
207
|
+
// if (typeof window !== 'undefined' || typeof document !== 'undefined') {
|
|
208
|
+
// const ua = navigator.userAgent.toLocaleLowerCase();
|
|
209
|
+
// if (
|
|
210
|
+
// ua.indexOf('safari') !== -1
|
|
211
|
+
// && ua.indexOf('chrome') === -1
|
|
212
|
+
// && type === 'number'
|
|
213
|
+
// ) {
|
|
214
|
+
// inputType = 'text';
|
|
215
|
+
// }
|
|
216
|
+
// }
|
|
217
|
+
// this.inputType = inputType;
|
|
218
|
+
// },
|
|
219
|
+
// },
|
|
220
|
+
// },
|
|
230
221
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
},
|
|
222
|
+
const inputValue = computed(() => {
|
|
223
|
+
return props.value !== undefined ? props.value : props.modelValue;
|
|
224
|
+
});
|
|
235
225
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
226
|
+
const hasLabel = computed(() => {
|
|
227
|
+
return !!(props.label || slots.label);
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
const requiredLabel = computed(() => {
|
|
231
|
+
return props.required ? `${props.label}*` : props.label;
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
const isPassword = computed(() => {
|
|
235
|
+
return props.type === 'password' && props.hasShowPassword;
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
const showPasswordIcon = computed(() => {
|
|
239
|
+
return isPasswordVisible.value ? 'eye--closed' : 'eye--opened';
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
function inputHandler(event) {
|
|
243
|
+
const value = props.preventTrim ? event.target.value : event.target.value.trim();
|
|
244
|
+
emit('update:modelValue', value);
|
|
245
|
+
emit('input', value);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function switchVisibilityPassword() {
|
|
249
|
+
isPasswordVisible.value = !isPasswordVisible.value;
|
|
250
|
+
inputType.value = isPasswordVisible.value ? 'text' : 'password';
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function updateInputPaddings() {
|
|
254
|
+
// cant test this thing cause vue test utils doesnt render elements width :/
|
|
255
|
+
const afterWrapperWidth = AfterWrapper.value.offsetWidth;
|
|
256
|
+
const inputEl = WtInput.value;
|
|
257
|
+
const defaultInputPadding = getComputedStyle(document.documentElement)
|
|
258
|
+
.getPropertyValue('--input-padding');
|
|
259
|
+
if (afterWrapperWidth >= inputEl.offsetWidth) return; // fixes https://my.webitel.com/browse/WTEL-2635
|
|
260
|
+
inputEl.style.paddingRight = `calc(${defaultInputPadding} * 2 + ${afterWrapperWidth}px)`;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
onMounted(() => {
|
|
264
|
+
updateInputPaddings();
|
|
265
|
+
});
|
|
250
266
|
</script>
|
|
251
267
|
|
|
252
268
|
<style lang="scss">
|
|
@@ -267,18 +283,6 @@ export default {
|
|
|
267
283
|
position: relative;
|
|
268
284
|
}
|
|
269
285
|
|
|
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
|
-
|
|
282
286
|
.wt-input__input {
|
|
283
287
|
@extend %typo-body-1;
|
|
284
288
|
@include wt-placeholder;
|
|
@@ -288,34 +292,21 @@ export default {
|
|
|
288
292
|
width: 100%;
|
|
289
293
|
padding: var(--input-padding);
|
|
290
294
|
transition: var(--transition);
|
|
291
|
-
color: var(--form-input-color);
|
|
292
295
|
border: var(--input-border);
|
|
293
|
-
border-color: var(--
|
|
296
|
+
border-color: var(--wt-text-field-input-border-color);
|
|
294
297
|
border-radius: var(--border-radius);
|
|
295
298
|
|
|
296
|
-
&:focus {
|
|
297
|
-
@include wt-placeholder('focus');
|
|
298
|
-
border-color: var(--form-border--hover-color);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.wt-input--outline & {
|
|
302
|
-
border-color: var(--form-outline-border-color);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.wt-input--outline:hover &,
|
|
306
|
-
.wt-input--outline &:focus {
|
|
307
|
-
border-color: var(--form-outline-border--hover-color);
|
|
308
|
-
}
|
|
309
|
-
|
|
310
299
|
.wt-input--invalid &,
|
|
311
300
|
.wt-input--invalid:hover & {
|
|
312
|
-
|
|
301
|
+
@include wt-placeholder('error');
|
|
302
|
+
color: var(--wt-text-field-error-text-color);
|
|
303
|
+
border-color: var(--wt-text-field-input-border-error-color);
|
|
313
304
|
outline: none; // prevent outline overlapping false color
|
|
314
305
|
}
|
|
315
306
|
|
|
316
307
|
.wt-input--disabled & {
|
|
317
308
|
@include wt-placeholder('disabled');
|
|
318
|
-
border-color: var(--
|
|
309
|
+
border-color: var(--wt-text-field-input-border-disabled-color);
|
|
319
310
|
background: var(--form-border--disabled-color);
|
|
320
311
|
}
|
|
321
312
|
}
|
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
<label
|
|
3
3
|
class="wt-label"
|
|
4
4
|
:class="{
|
|
5
|
-
'wt-label--outline': outline,
|
|
6
5
|
'wt-label--invalid': invalid,
|
|
7
6
|
'wt-label--disabled': disabled,
|
|
8
7
|
}"
|
|
9
|
-
:for="this.for"
|
|
10
8
|
>
|
|
11
|
-
<slot
|
|
9
|
+
<slot />
|
|
12
10
|
<wt-hint
|
|
13
11
|
v-if="hint"
|
|
14
12
|
>{{ hint }}
|
|
@@ -18,19 +16,12 @@
|
|
|
18
16
|
|
|
19
17
|
<script>
|
|
20
18
|
export default {
|
|
21
|
-
name: '
|
|
19
|
+
name: 'WtLabel',
|
|
22
20
|
props: {
|
|
23
|
-
for: {
|
|
24
|
-
type: String,
|
|
25
|
-
},
|
|
26
21
|
disabled: {
|
|
27
22
|
type: Boolean,
|
|
28
23
|
default: false,
|
|
29
24
|
},
|
|
30
|
-
outline: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: false,
|
|
33
|
-
},
|
|
34
25
|
invalid: {
|
|
35
26
|
type: Boolean,
|
|
36
27
|
default: false,
|
|
@@ -54,20 +45,16 @@ export default {
|
|
|
54
45
|
|
|
55
46
|
display: flex;
|
|
56
47
|
align-items: center;
|
|
57
|
-
color: var(--
|
|
48
|
+
color: var(--wt-label-color);
|
|
58
49
|
transition: var(--transition);
|
|
59
50
|
cursor: text;
|
|
60
51
|
|
|
61
|
-
&--outline {
|
|
62
|
-
color: var(--form-outline-label-color);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
52
|
&--invalid {
|
|
66
|
-
color: var(--label
|
|
53
|
+
color: var(--wt-label-error-color);
|
|
67
54
|
}
|
|
68
55
|
|
|
69
56
|
&--disabled {
|
|
70
|
-
color: var(--
|
|
57
|
+
color: var(--wt-label-disabled-color);
|
|
71
58
|
}
|
|
72
59
|
}
|
|
73
60
|
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="wt-load-bar">
|
|
3
|
-
<span
|
|
3
|
+
<span
|
|
4
|
+
:style="`width: ${progressWidth}%;`"
|
|
5
|
+
class="wt-load-bar__progress"
|
|
6
|
+
/>
|
|
4
7
|
</div>
|
|
5
8
|
</template>
|
|
6
9
|
|
|
7
10
|
<script>
|
|
8
11
|
export default {
|
|
9
|
-
name: '
|
|
12
|
+
name: 'WtLoadBar',
|
|
10
13
|
props: {
|
|
11
14
|
max: {
|
|
12
15
|
type: [Number, String],
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="wt-loader wt-loader--md">
|
|
3
|
-
<svg
|
|
4
|
-
|
|
3
|
+
<svg
|
|
4
|
+
class="wt-loader--md__svg"
|
|
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
|
+
/>
|
|
5
14
|
</svg>
|
|
6
15
|
</div>
|
|
7
16
|
</template>
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
<!--https://codepen.io/zapdev/pen/MYJRaj-->
|
|
2
2
|
|
|
3
3
|
<template>
|
|
4
|
-
<div
|
|
4
|
+
<div
|
|
5
|
+
class="wt-loader--sm"
|
|
6
|
+
:class="`wt-loader--sm--${color}`"
|
|
7
|
+
>
|
|
5
8
|
<svg viewBox="0 0 24 24">
|
|
6
|
-
<circle
|
|
9
|
+
<circle
|
|
10
|
+
cx="12"
|
|
11
|
+
cy="12"
|
|
12
|
+
r="8"
|
|
13
|
+
/>
|
|
7
14
|
</svg>
|
|
8
15
|
</div>
|
|
9
16
|
</template>
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<wt-loader-sm
|
|
3
|
-
|
|
2
|
+
<wt-loader-sm
|
|
3
|
+
v-if="size === 'sm'"
|
|
4
|
+
class="wt-loader"
|
|
5
|
+
:color="color"
|
|
6
|
+
/>
|
|
7
|
+
<wt-loader-md
|
|
8
|
+
v-else-if="size === 'md'"
|
|
9
|
+
class="wt-loader"
|
|
10
|
+
/>
|
|
4
11
|
</template>
|
|
5
12
|
|
|
6
13
|
<script>
|
|
@@ -8,7 +15,7 @@ import WtLoaderSm from './_internals/wt-loader--sm.vue';
|
|
|
8
15
|
import WtLoaderMd from './_internals/wt-loader--md.vue';
|
|
9
16
|
|
|
10
17
|
export default {
|
|
11
|
-
name: '
|
|
18
|
+
name: 'WtLoader',
|
|
12
19
|
components: {
|
|
13
20
|
WtLoaderSm,
|
|
14
21
|
WtLoaderMd,
|