@webitel/ui-sdk 1.0.30 → 1.0.31

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.30",
3
+ "version": "1.0.31",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -16,20 +16,24 @@
16
16
  <div class="wt-textarea__wrapper">
17
17
  <textarea
18
18
  :id="name"
19
+ ref="wt-textarea"
19
20
  class="wt-textarea__textarea"
20
21
  :value="value"
21
22
  :placeholder="placeholder || label"
22
23
  :disabled="disabled"
23
24
  v-on="listeners"
24
25
  ></textarea>
25
- <wt-icon-btn
26
- class="wt-textarea__reset-icon-btn"
27
- :class="{ 'hidden': !value }"
28
- icon="close--filled"
29
- size="sm"
30
- :disabled="disabled"
31
- @click="$emit('input', '')"
32
- ></wt-icon-btn>
26
+ <div class="wt-textarea__after-wrapper" ref="after-wrapper">
27
+ <slot name="after-input"></slot>
28
+ <wt-icon-btn
29
+ class="wt-textarea__reset-icon-btn"
30
+ :class="{ 'hidden': !value }"
31
+ icon="close--filled"
32
+ size="sm"
33
+ :disabled="disabled"
34
+ @click="$emit('input', '')"
35
+ ></wt-icon-btn>
36
+ </div>
33
37
  </div>
34
38
  </div>
35
39
  </template>
@@ -101,6 +105,19 @@
101
105
  event.preventDefault();
102
106
  }
103
107
  },
108
+
109
+ updateInputPaddings() {
110
+ // cant test this thing cause vue test utils doesnt render elements width :/
111
+ const afterWrapperWidth = this.$refs['after-wrapper'].offsetWidth;
112
+ const inputEl = this.$refs['wt-textarea'];
113
+ const defaultInputPadding = getComputedStyle(document.documentElement)
114
+ .getPropertyValue('--textarea-padding');
115
+ console.info(defaultInputPadding, afterWrapperWidth);
116
+ inputEl.style.paddingRight = `calc(${defaultInputPadding} * 2 + ${afterWrapperWidth}px)`;
117
+ },
118
+ },
119
+ mounted() {
120
+ this.updateInputPaddings();
104
121
  },
105
122
  };
106
123
  </script>
@@ -125,17 +142,6 @@
125
142
  }
126
143
  }
127
144
 
128
- .wt-textarea__reset-icon-btn {
129
- position: absolute;
130
- top: var(--input-icon-margin);
131
- right: var(--input-icon-margin);
132
-
133
- .wt-textarea:not(:focus-within) & {
134
- opacity: 0;
135
- pointer-events: none;
136
- }
137
- }
138
-
139
145
  .wt-textarea__textarea {
140
146
  @extend %typo-body-1;
141
147
  @include wt-placeholder;
@@ -167,8 +173,18 @@
167
173
  }
168
174
 
169
175
  /* make icons black */
170
- .wt-textarea:hover ::v-deep .wt-icon__icon,
171
- .wt-textarea:focus-within ::v-deep .wt-icon__icon {
176
+ .wt-textarea:hover ::v-deep .wt-icon-btn:not(.wt-textarea__reset-icon-btn) .wt-icon__icon,
177
+ .wt-textarea:focus-within ::v-deep .wt-icon-btn:not(.wt-textarea__reset-icon-btn) .wt-icon__icon {
172
178
  fill: var(--icon-color--hover);
173
179
  }
180
+
181
+ .wt-textarea__after-wrapper {
182
+ display: flex;
183
+ gap: var(--input-after-wrapper-gap);
184
+ align-items: center;
185
+ position: absolute;
186
+ top: var(--input-icon-margin);
187
+ right: var(--input-icon-margin);
188
+ pointer-events: auto; // override --disabled p-events none
189
+ }
174
190
  </style>
@@ -1,13 +1,5 @@
1
1
 
2
2
  :root {
3
3
  --textarea-min-height: 100px;
4
- --textarea-padding:
5
- var(--input-padding)
6
- calc(
7
- var(--input-padding)
8
- + var(--icon-sm-size)
9
- + var(--spacing-xs)
10
- )
11
- var(--input-padding)
12
- var(--input-padding); // right reset icon 16px
13
- }
4
+ --textarea-padding: var(--input-padding);
5
+ }