@webitel/ui-sdk 2.0.4-2 → 2.0.5-3

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": "2.0.4-2",
3
+ "version": "2.0.5-3",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -6,7 +6,7 @@
6
6
  placement="bottom-end"
7
7
  >
8
8
  <slot name="activator"></slot>
9
- <template #popper>
9
+ <template #popper="{ hide }">
10
10
  <ul class="wt-context-menu__menu">
11
11
  <li
12
12
  class="wt-context-menu__option-wrapper"
@@ -17,7 +17,7 @@
17
17
  <a
18
18
  class="wt-context-menu__option"
19
19
  href="#"
20
- @click.prevent="$emit('click', { option, index })"
20
+ @click.prevent="handleOptionClick({ option, index, hide })"
21
21
  >
22
22
  {{ option.text || option }}
23
23
  </a>
@@ -41,6 +41,12 @@ export default {
41
41
  default: false,
42
42
  },
43
43
  },
44
+ methods: {
45
+ handleOptionClick({ option, index, hide }) {
46
+ this.$emit('click', { option, index });
47
+ hide();
48
+ },
49
+ },
44
50
  };
45
51
  </script>
46
52
 
@@ -217,12 +217,14 @@ export default {
217
217
  this.inputType = this.isPasswordVisible ? 'text' : 'password';
218
218
  },
219
219
 
220
- updateInputPaddings() {
220
+ async updateInputPaddings() {
221
+ await this.$nextTick();
221
222
  // cant test this thing cause vue test utils doesnt render elements width :/
222
223
  const afterWrapperWidth = this.$refs['after-wrapper'].offsetWidth;
223
224
  const inputEl = this.$refs['wt-input'];
224
225
  const defaultInputPadding = getComputedStyle(document.documentElement)
225
226
  .getPropertyValue('--input-padding');
227
+ console.info('ipnut:', defaultInputPadding, afterWrapperWidth, defaultInputPadding*2+afterWrapperWidth);
226
228
  inputEl.style.paddingRight = `calc(${defaultInputPadding} * 2 + ${afterWrapperWidth}px)`;
227
229
  },
228
230
  },