@webitel/ui-sdk 0.9.46 → 0.9.50
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/ui-sdk.common.js +152 -141
- package/dist/ui-sdk.common.js.map +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.umd.js +152 -141
- package/dist/ui-sdk.umd.js.map +1 -1
- package/dist/ui-sdk.umd.min.js +2 -2
- package/dist/ui-sdk.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/wt-button/wt-button.vue +2 -2
- package/src/components/molecules/wt-input/wt-input.vue +47 -21
- package/src/components/organisms/wt-table-column-select/wt-table-column-select.vue +4 -0
- package/src/css/components/atoms/wt-button/_variables.scss +1 -1
- package/src/css/components/molecules/wt-button-select/_variables.scss +1 -1
- package/src/css/components/molecules/wt-input/_variables.scss +2 -0
- package/src/mixins/validationMixin/validationMixin.js +14 -13
package/package.json
CHANGED
|
@@ -100,13 +100,13 @@
|
|
|
100
100
|
|
|
101
101
|
&:not(&--outline) {
|
|
102
102
|
&.secondary {
|
|
103
|
-
color: var(--btn-
|
|
103
|
+
color: var(--btn-dark-font-color);
|
|
104
104
|
border-color: var(--btn-secondary-color);
|
|
105
105
|
background: var(--btn-secondary-color);
|
|
106
106
|
|
|
107
107
|
&:hover,
|
|
108
108
|
&:active {
|
|
109
|
-
color: var(--btn-
|
|
109
|
+
color: var(--btn-dark-font-color);
|
|
110
110
|
border-color: var(--btn-secondary--hover-color);
|
|
111
111
|
background: var(--btn-secondary-color);
|
|
112
112
|
}
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
:class="{
|
|
26
26
|
'wt-input--is-password': isPassword,
|
|
27
27
|
}"
|
|
28
|
+
ref="wt-input"
|
|
28
29
|
:value="value"
|
|
29
30
|
:type="inputType"
|
|
30
31
|
:placeholder="placeholder || label"
|
|
@@ -33,20 +34,28 @@
|
|
|
33
34
|
:max="numberMax"
|
|
34
35
|
v-on="listeners"
|
|
35
36
|
>
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
<div
|
|
38
|
+
class="wt-input__after-wrapper"
|
|
39
|
+
ref="after-wrapper"
|
|
40
|
+
>
|
|
41
|
+
<slot
|
|
42
|
+
name="after-input"
|
|
43
|
+
></slot>
|
|
44
|
+
<slot
|
|
45
|
+
v-if="isPassword"
|
|
46
|
+
name="show-password"
|
|
47
|
+
v-bind="{
|
|
40
48
|
isPasswordVisible,
|
|
41
49
|
switchVisibilityPassword,
|
|
42
50
|
}"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
>
|
|
52
|
+
<wt-icon-btn
|
|
53
|
+
class="wt-input__password-button"
|
|
54
|
+
:icon="showPasswordIcon"
|
|
55
|
+
@click.native="switchVisibilityPassword"
|
|
56
|
+
></wt-icon-btn>
|
|
57
|
+
</slot>
|
|
58
|
+
</div>
|
|
50
59
|
</div>
|
|
51
60
|
<wt-input-info
|
|
52
61
|
v-if="isValidation"
|
|
@@ -57,9 +66,9 @@
|
|
|
57
66
|
</template>
|
|
58
67
|
|
|
59
68
|
<script>
|
|
60
|
-
|
|
69
|
+
import validationMixin from '../../../mixins/validationMixin/validationMixin';
|
|
61
70
|
|
|
62
|
-
|
|
71
|
+
export default {
|
|
63
72
|
name: 'wt-input',
|
|
64
73
|
mixins: [validationMixin],
|
|
65
74
|
props: {
|
|
@@ -207,8 +216,20 @@
|
|
|
207
216
|
this.isPasswordVisible = !this.isPasswordVisible;
|
|
208
217
|
this.inputType = this.isPasswordVisible ? 'text' : 'password';
|
|
209
218
|
},
|
|
219
|
+
|
|
220
|
+
updateInputPaddings() {
|
|
221
|
+
// cant test this thing cause vue test utils doesnt render elements width :/
|
|
222
|
+
const afterWrapperWidth = this.$refs['after-wrapper'].offsetWidth;
|
|
223
|
+
const inputEl = this.$refs['wt-input'];
|
|
224
|
+
const defaultInputPadding = parseInt(getComputedStyle(document.documentElement)
|
|
225
|
+
.getPropertyValue('--input-padding'), 10);
|
|
226
|
+
inputEl.style.paddingRight = `${defaultInputPadding + afterWrapperWidth + defaultInputPadding}px`;
|
|
227
|
+
},
|
|
210
228
|
},
|
|
211
|
-
|
|
229
|
+
mounted() {
|
|
230
|
+
this.updateInputPaddings();
|
|
231
|
+
},
|
|
232
|
+
};
|
|
212
233
|
</script>
|
|
213
234
|
|
|
214
235
|
<style lang="scss" scoped>
|
|
@@ -298,19 +319,24 @@
|
|
|
298
319
|
}
|
|
299
320
|
}
|
|
300
321
|
|
|
301
|
-
.wt-
|
|
322
|
+
.wt-input__after-wrapper {
|
|
323
|
+
display: flex;
|
|
324
|
+
gap: var(--input-after-wrapper-gap);
|
|
325
|
+
align-items: center;
|
|
302
326
|
position: absolute;
|
|
303
327
|
top: 50%;
|
|
304
328
|
right: var(--input-icon-margin);
|
|
305
329
|
transform: translateY(-50%);
|
|
306
330
|
|
|
307
|
-
.wt-
|
|
308
|
-
|
|
309
|
-
|
|
331
|
+
.wt-input__password-button {
|
|
332
|
+
.wt-input--disabled & ::v-deep .wt-icon__icon {
|
|
333
|
+
fill: var(--icon-color-disabled);
|
|
334
|
+
}
|
|
310
335
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
336
|
+
.wt-input:hover & ::v-deep .wt-icon__icon,
|
|
337
|
+
.wt-input:focus-within & ::v-deep .wt-icon__icon {
|
|
338
|
+
fill: var(--icon-color--hover);
|
|
339
|
+
}
|
|
314
340
|
}
|
|
315
341
|
}
|
|
316
342
|
</style>
|
|
@@ -100,6 +100,10 @@ export default {
|
|
|
100
100
|
</script>
|
|
101
101
|
|
|
102
102
|
<style lang="scss" scoped>
|
|
103
|
+
.wt-table-column-select {
|
|
104
|
+
line-height: 0; // prevent 24x28 icon heght :/
|
|
105
|
+
}
|
|
106
|
+
|
|
103
107
|
.wt-table-column-select__popup__list {
|
|
104
108
|
@extend %wt-scrollbar;
|
|
105
109
|
max-height: 35vh; // fixme popup fixed sizes
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
--btn-dark-font-color: #000;
|
|
24
24
|
--btn-light-font-color: #fff;
|
|
25
25
|
|
|
26
|
-
--btn-primary-color: var(--accent-color);
|
|
26
|
+
--btn-primary-color: var(--main-accent-color);
|
|
27
27
|
--btn-primary--hover-color: #EFB917;
|
|
28
28
|
|
|
29
29
|
--btn-secondary-color: hsla(var(--_secondary-color), var(--_opacity--default));
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
--button-select-buttons-gap: 1px;
|
|
10
10
|
|
|
11
11
|
--button-select-icon-color-primary: var(--btn-primary-color);
|
|
12
|
-
--button-select-icon-color-secondary: var(--btn-
|
|
12
|
+
--button-select-icon-color-secondary: var(--btn-dark-font-color);
|
|
13
13
|
--button-select-icon-color-dark: var(--btn-dark-font-color);
|
|
14
14
|
--button-select-icon-color-ligth: var(--main-color);
|
|
15
15
|
|
|
@@ -17,24 +17,25 @@ export default {
|
|
|
17
17
|
return this.isValidation && this.v.$error;
|
|
18
18
|
},
|
|
19
19
|
validationText() {
|
|
20
|
+
let validationText = '';
|
|
20
21
|
if (this.isValidation && this.invalid) {
|
|
21
|
-
if (this.v.required === false)
|
|
22
|
-
if (this.v.numeric === false)
|
|
23
|
-
if (this.v.email === false)
|
|
24
|
-
if (this.v.gatewayHostValidator === false)
|
|
25
|
-
if (this.v.ipValidator === false)
|
|
26
|
-
if (this.v.macValidator === false)
|
|
27
|
-
if (this.v.minValue === false)
|
|
28
|
-
if (this.v.maxValue === false)
|
|
29
|
-
if (this.v.sipAccountValidator === false)
|
|
30
|
-
if (this.v.minLength === false)
|
|
31
|
-
if (this.v.url === false)
|
|
22
|
+
if (this.v.required === false) validationText = this.$t('validation.required');
|
|
23
|
+
else if (this.v.numeric === false) validationText = this.$t('validation.numeric');
|
|
24
|
+
else if (this.v.email === false) validationText = this.$t('validation.email');
|
|
25
|
+
else if (this.v.gatewayHostValidator === false) validationText = this.$t('validation.gatewayHostValidator');
|
|
26
|
+
else if (this.v.ipValidator === false) validationText = this.$t('validation.ipValidator');
|
|
27
|
+
else if (this.v.macValidator === false) validationText = this.$t('validation.macValidator');
|
|
28
|
+
else if (this.v.minValue === false) validationText = `${this.$t('validation.minValue')} ${this.v.$params.minValue.min}`;
|
|
29
|
+
else if (this.v.maxValue === false) validationText = `${this.$t('validation.maxValue')} ${this.v.$params.maxValue.max}`;
|
|
30
|
+
else if (this.v.sipAccountValidator === false) validationText = this.$t('validation.sipAccountValidator');
|
|
31
|
+
else if (this.v.minLength === false) validationText = `${this.$t('validation.minLength')} ${this.v.$params.minLength.min}`;
|
|
32
|
+
else if (this.v.url === false) validationText = `${this.$t('validation.url')}`;
|
|
32
33
|
}
|
|
33
34
|
// eslint-disable-next-line no-restricted-syntax
|
|
34
35
|
for (const { name, text } of this.customValidators) {
|
|
35
|
-
if (this.v[name] === false)
|
|
36
|
+
if (this.v[name] === false) validationText = text;
|
|
36
37
|
}
|
|
37
|
-
return
|
|
38
|
+
return validationText;
|
|
38
39
|
},
|
|
39
40
|
},
|
|
40
41
|
};
|