iov-design 2.15.17 → 2.15.18

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.
@@ -8,7 +8,7 @@
8
8
  class="el-select__tags"
9
9
  v-if="multiple"
10
10
  ref="tags"
11
- :style="{ 'max-width': inputWidth - 32 + 'px', width: '100%' }">
11
+ :style="{ 'max-width': inputWidth - 32 + 'px', width: '100%', left: tagsLeft }">
12
12
  <span class="el-tag__group" v-if="collapseTags && selected.length">
13
13
  <el-tag
14
14
  :closable="!selectDisabled"
@@ -338,7 +338,8 @@
338
338
  currentPlaceholder: '',
339
339
  menuVisibleOnFocus: false,
340
340
  isOnComposition: false,
341
- isSilentBlur: false
341
+ isSilentBlur: false,
342
+ tagsLeft: 0
342
343
  };
343
344
  },
344
345
 
@@ -649,6 +650,19 @@
649
650
  }
650
651
  },
651
652
 
653
+ resetTagsLeft() {
654
+ this.$nextTick(() => {
655
+ const prefixLabel = this.$el.querySelector('.el-input-group__prefix-label');
656
+ if (prefixLabel) {
657
+ const style = prefixLabel && window.getComputedStyle(prefixLabel);
658
+ const width = +(style.width.replace(/px/, ''));
659
+ const paddingLeft = +(style.paddingLeft.replace(/px/, ''));
660
+ const paddingRight = +(style.paddingRight.replace(/px/, ''));
661
+ this.tagsLeft = (width + paddingLeft + paddingRight) + 'px';
662
+ }
663
+ });
664
+ },
665
+
652
666
  resetInputState(e) {
653
667
  if (e.keyCode !== 8) this.toggleLastOptionHitState(false);
654
668
  this.inputLength = this.$refs.input.value.length * 15 + 20;
@@ -660,6 +674,12 @@
660
674
  this.$nextTick(() => {
661
675
  if (!this.$refs.reference) return;
662
676
  let inputChildNodes = this.$refs.reference.$el.childNodes;
677
+ // 兼容input组件多加了一层el-input-group__inner
678
+ Array.from(inputChildNodes).find(child => {
679
+ if (child && child.classList && child.classList.contains('el-input-group__inner')) {
680
+ inputChildNodes = child.childNodes;
681
+ }
682
+ });
663
683
  let input = [].filter.call(inputChildNodes, item => item.tagName === 'INPUT')[0];
664
684
  const tags = this.$refs.tags;
665
685
  const tagsHeight = tags ? Math.round(tags.getBoundingClientRect().height) : 0;
@@ -812,7 +832,10 @@
812
832
 
813
833
  handleResize() {
814
834
  this.resetInputWidth();
815
- if (this.multiple) this.resetInputHeight();
835
+ if (this.multiple) {
836
+ this.resetInputHeight();
837
+ this.resetTagsLeft();
838
+ }
816
839
  },
817
840
 
818
841
  checkDefaultFirstOption() {
@@ -465,6 +465,7 @@
465
465
  border-radius: $--input-border-radius;
466
466
  height: $--input-height - 2px;
467
467
  line-height: $--input-height - 2px;
468
+ box-sizing: border-box;
468
469
 
469
470
  &:focus {
470
471
  outline: none;
@@ -130,7 +130,7 @@
130
130
  position: absolute;
131
131
  line-height: normal;
132
132
  white-space: normal;
133
- z-index: $--index-normal;
133
+ z-index: 3;
134
134
  top: 50%;
135
135
  transform: translateY(-50%);
136
136
  display: flex;
package/src/index.js CHANGED
@@ -212,7 +212,7 @@ if (typeof window !== 'undefined' && window.Vue) {
212
212
  }
213
213
 
214
214
  export default {
215
- version: '2.15.17',
215
+ version: '2.15.18',
216
216
  locale: locale.use,
217
217
  i18n: locale.i18n,
218
218
  install,