@webitel/ui-sdk 0.9.41 → 0.9.45

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": "0.9.41",
3
+ "version": "0.9.45",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -39,7 +39,7 @@ export default {
39
39
 
40
40
  <style lang="scss" scoped>
41
41
  .wt-context-menu {
42
- @extend %typo-body-sm;
42
+ @extend %typo-body-md;
43
43
  min-width: var(--context-menu-min-width);
44
44
  max-width: var(--context-menu-max-width);
45
45
  background-color: var(--context-menu-background-color);
@@ -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
- <slot
37
- v-if="isPassword"
38
- name="show-password"
39
- v-bind="{
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
- <wt-icon-btn
45
- class="wt-input__password-button"
46
- :icon="showPasswordIcon"
47
- @click.native="switchVisibilityPassword"
48
- ></wt-icon-btn>
49
- </slot>
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
- import validationMixin from '../../../mixins/validationMixin/validationMixin';
69
+ import validationMixin from '../../../mixins/validationMixin/validationMixin';
61
70
 
62
- export default {
71
+ export default {
63
72
  name: 'wt-input',
64
73
  mixins: [validationMixin],
65
74
  props: {
@@ -207,8 +216,19 @@
207
216
  this.isPasswordVisible = !this.isPasswordVisible;
208
217
  this.inputType = this.isPasswordVisible ? 'text' : 'password';
209
218
  },
219
+
220
+ updateInputPaddings() {
221
+ const afterWrapperWidth = this.$refs['after-wrapper'].offsetWidth;
222
+ const inputEl = this.$refs['wt-input'];
223
+ const defaultInputPadding = parseInt(getComputedStyle(document.documentElement)
224
+ .getPropertyValue('--input-padding'), 10);
225
+ inputEl.style.paddingRight = `${defaultInputPadding + afterWrapperWidth + defaultInputPadding}px`;
226
+ },
210
227
  },
211
- };
228
+ mounted() {
229
+ this.updateInputPaddings();
230
+ },
231
+ };
212
232
  </script>
213
233
 
214
234
  <style lang="scss" scoped>
@@ -298,19 +318,24 @@
298
318
  }
299
319
  }
300
320
 
301
- .wt-input__password-button {
321
+ .wt-input__after-wrapper {
322
+ display: flex;
323
+ gap: var(--input-after-wrapper-gap);
324
+ align-items: center;
302
325
  position: absolute;
303
326
  top: 50%;
304
327
  right: var(--input-icon-margin);
305
328
  transform: translateY(-50%);
306
329
 
307
- .wt-input--disabled & ::v-deep .wt-icon__icon {
308
- fill: var(--icon-color-disabled);
309
- }
330
+ .wt-input__password-button {
331
+ .wt-input--disabled & ::v-deep .wt-icon__icon {
332
+ fill: var(--icon-color-disabled);
333
+ }
310
334
 
311
- .wt-input:hover & ::v-deep .wt-icon__icon,
312
- .wt-input:focus-within & ::v-deep .wt-icon__icon {
313
- fill: var(--icon-color--hover);
335
+ .wt-input:hover & ::v-deep .wt-icon__icon,
336
+ .wt-input:focus-within & ::v-deep .wt-icon__icon {
337
+ fill: var(--icon-color--hover);
338
+ }
314
339
  }
315
340
  }
316
341
  </style>
@@ -3,4 +3,6 @@
3
3
  --input-padding: 9px;
4
4
  --input-border: 1px solid;
5
5
  --input-icon-margin: 10px;
6
+
7
+ --input-after-wrapper-gap: var(--spacing--xs);
6
8
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <wt-select
3
- :value="filterSchema.value"
3
+ :value="value"
4
4
  :options="localizedOptions"
5
5
  :label="$t(filterSchema.locale.label)"
6
6
  :track-by="filterSchema.storedProp"
@@ -33,11 +33,11 @@ export default {
33
33
  restoreValue(value) {
34
34
  let newValue;
35
35
  if (Array.isArray(value)) {
36
- newValue = this.options
36
+ newValue = this.localizedOptions
37
37
  .filter((option) => value
38
38
  .some((value) => value === option[this.storedProp]));
39
39
  } else {
40
- newValue = this.options
40
+ newValue = this.localizedOptions
41
41
  .find((option) => value === option[this.storedProp]);
42
42
  }
43
43
  this.setValue({ filter: this.filterQuery, value: newValue });