iov-design 2.15.24 → 2.15.25
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/lib/cascader.js +20 -7
- package/lib/index.js +1 -1
- package/lib/iov-design.common.js +33 -28
- package/lib/select.js +12 -20
- package/lib/theme-chalk/autocomplete.css +1 -1
- package/lib/theme-chalk/cascader.css +1 -1
- package/lib/theme-chalk/date-picker.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/input-number.css +1 -1
- package/lib/theme-chalk/input.css +1 -1
- package/lib/theme-chalk/message-box.css +1 -1
- package/lib/theme-chalk/pagination.css +1 -1
- package/lib/theme-chalk/select.css +1 -1
- package/lib/theme-chalk/slider.css +1 -1
- package/lib/theme-chalk/time-picker.css +1 -1
- package/lib/theme-chalk/transfer.css +1 -1
- package/package.json +1 -1
- package/packages/cascader/src/cascader.vue +20 -9
- package/packages/select/src/select.vue +12 -20
- package/packages/theme-chalk/src/cascader.scss +20 -0
- package/packages/theme-chalk/src/input.scss +7 -4
- package/packages/theme-chalk/src/select.scss +20 -19
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -175,9 +175,9 @@ const PopperMixin = {
|
|
|
175
175
|
};
|
|
176
176
|
|
|
177
177
|
const InputSizeMap = {
|
|
178
|
-
medium:
|
|
179
|
-
small:
|
|
180
|
-
mini:
|
|
178
|
+
medium: 32,
|
|
179
|
+
small: 30,
|
|
180
|
+
mini: 26
|
|
181
181
|
};
|
|
182
182
|
|
|
183
183
|
export default {
|
|
@@ -258,9 +258,10 @@ export default {
|
|
|
258
258
|
return this.size || _elFormItemSize || (this.$ELEMENT || {}).size;
|
|
259
259
|
},
|
|
260
260
|
tagSize() {
|
|
261
|
-
return
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
return this.realSize;
|
|
262
|
+
// return ['small', 'mini'].indexOf(this.realSize) > -1
|
|
263
|
+
// ? 'mini'
|
|
264
|
+
// : 'small';
|
|
264
265
|
},
|
|
265
266
|
isDisabled() {
|
|
266
267
|
return this.disabled || (this.elForm || {}).disabled;
|
|
@@ -355,7 +356,7 @@ export default {
|
|
|
355
356
|
mounted() {
|
|
356
357
|
const { input } = this.$refs;
|
|
357
358
|
if (input && input.$el) {
|
|
358
|
-
this.inputInitialHeight = input.$el.offsetHeight
|
|
359
|
+
this.inputInitialHeight = Math.max(input.$el.offsetHeight, InputSizeMap[this.realSize]) || 36;
|
|
359
360
|
}
|
|
360
361
|
|
|
361
362
|
if (!this.isEmptyValue(this.value)) {
|
|
@@ -641,6 +642,9 @@ export default {
|
|
|
641
642
|
if (!inputInner) return;
|
|
642
643
|
|
|
643
644
|
const tags = $el.querySelector('.el-cascader__tags');
|
|
645
|
+
const groupPrefix = $el.querySelector('.el-input-group--prefix');
|
|
646
|
+
const prefix = $el.querySelector('.el-input__prefix');
|
|
647
|
+
const prefixLabel = $el.querySelector('.el-input-group__prefix-label');
|
|
644
648
|
let suggestionPanelEl = null;
|
|
645
649
|
|
|
646
650
|
if (suggestionPanel && (suggestionPanelEl = suggestionPanel.$el)) {
|
|
@@ -650,8 +654,15 @@ export default {
|
|
|
650
654
|
|
|
651
655
|
if (tags) {
|
|
652
656
|
const offsetHeight = Math.round(tags.getBoundingClientRect().height);
|
|
653
|
-
const height = Math.max(offsetHeight +
|
|
654
|
-
inputInner.
|
|
657
|
+
const height = Math.max(offsetHeight + 4, inputInitialHeight) + 'px';
|
|
658
|
+
const inputPaddingLeft = groupPrefix || prefix ? Math.round(window.getComputedStyle(inputInner).paddingLeft.replace(/px/, '')) : 0;
|
|
659
|
+
const prefixLabelWidth = prefixLabel && Math.round(prefixLabel.getBoundingClientRect().width) || 0;
|
|
660
|
+
if (groupPrefix) {
|
|
661
|
+
groupPrefix.style.height = height;
|
|
662
|
+
} else {
|
|
663
|
+
inputInner.style.height = height;
|
|
664
|
+
}
|
|
665
|
+
tags.style.left = (prefixLabelWidth + inputPaddingLeft) + 'px';
|
|
655
666
|
if (this.dropDownVisible) {
|
|
656
667
|
this.updatePopper();
|
|
657
668
|
}
|
|
@@ -237,10 +237,9 @@
|
|
|
237
237
|
|
|
238
238
|
collapseTagSize() {
|
|
239
239
|
const sizeMap = {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
small: 'mini',
|
|
240
|
+
large: '',
|
|
241
|
+
medium: 'medium',
|
|
242
|
+
small: 'small',
|
|
244
243
|
mini: 'mini'
|
|
245
244
|
};
|
|
246
245
|
return sizeMap[this.selectSize];
|
|
@@ -653,13 +652,11 @@
|
|
|
653
652
|
resetTagsLeft() {
|
|
654
653
|
this.$nextTick(() => {
|
|
655
654
|
const prefixLabel = this.$el.querySelector('.el-input-group__prefix-label');
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
this.tagsLeft = (width + paddingLeft + paddingRight) + 'px';
|
|
662
|
-
}
|
|
655
|
+
const prefix = this.$el.querySelector('.el-input__prefix');
|
|
656
|
+
const inputInner = this.$el.querySelector('.el-input__inner');
|
|
657
|
+
const prefixLabelWidth = prefixLabel && Math.round(prefixLabel.getBoundingClientRect().width) || 0;
|
|
658
|
+
const inputPaddingLeft = prefixLabel || prefix ? Math.round(window.getComputedStyle(inputInner).paddingLeft.replace(/px/, '')) : 0;
|
|
659
|
+
this.tagsLeft = (prefixLabelWidth + inputPaddingLeft) + 'px';
|
|
663
660
|
});
|
|
664
661
|
},
|
|
665
662
|
|
|
@@ -673,18 +670,13 @@
|
|
|
673
670
|
if (this.collapseTags && !this.filterable) return;
|
|
674
671
|
this.$nextTick(() => {
|
|
675
672
|
if (!this.$refs.reference) return;
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
if (child && child.classList && child.classList.contains('el-input-group__inner')) {
|
|
680
|
-
inputChildNodes = child;
|
|
681
|
-
}
|
|
682
|
-
});
|
|
683
|
-
// let input = [].filter.call(inputChildNodes, item => item.tagName === 'INPUT')[0];
|
|
673
|
+
const inputInner = this.$el.querySelector('.el-input__inner');
|
|
674
|
+
const groupPrefix = this.$el.querySelector('.el-input-group--prefix');
|
|
675
|
+
const input = groupPrefix || inputInner;
|
|
684
676
|
const tags = this.$refs.tags;
|
|
685
677
|
const tagsHeight = tags ? Math.round(tags.getBoundingClientRect().height) : 0;
|
|
686
678
|
const sizeInMap = this.initialInputHeight || 36;
|
|
687
|
-
|
|
679
|
+
input.style.height = this.selected.length === 0
|
|
688
680
|
? sizeInMap + 'px'
|
|
689
681
|
: Math.max(
|
|
690
682
|
tags ? (tagsHeight + (tagsHeight > sizeInMap ? 6 : 0)) : 0,
|
|
@@ -55,19 +55,36 @@
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
.el-tag {
|
|
59
|
+
height: $--input-height - 8px;
|
|
60
|
+
line-height: $--input-height - 8px;
|
|
61
|
+
}
|
|
62
|
+
|
|
58
63
|
@include m(medium) {
|
|
59
64
|
font-size: $--input-medium-font-size;
|
|
60
65
|
line-height: $--input-medium-height;
|
|
66
|
+
.el-tag--medium {
|
|
67
|
+
height: $--input-medium-height - 8px;
|
|
68
|
+
line-height: $--input-medium-height - 8px;
|
|
69
|
+
}
|
|
61
70
|
}
|
|
62
71
|
|
|
63
72
|
@include m(small) {
|
|
64
73
|
font-size: $--input-small-font-size;
|
|
65
74
|
line-height: $--input-small-height;
|
|
75
|
+
.el-tag--small {
|
|
76
|
+
height: $--input-small-height - 8px;
|
|
77
|
+
line-height: $--input-small-height - 8px;
|
|
78
|
+
}
|
|
66
79
|
}
|
|
67
80
|
|
|
68
81
|
@include m(mini) {
|
|
69
82
|
font-size: $--input-mini-font-size;
|
|
70
83
|
line-height: $--input-mini-height;
|
|
84
|
+
.el-tag--mini {
|
|
85
|
+
height: $--input-mini-height - 8px;
|
|
86
|
+
line-height: $--input-mini-height - 8px;
|
|
87
|
+
}
|
|
71
88
|
}
|
|
72
89
|
|
|
73
90
|
@include when(disabled) {
|
|
@@ -100,6 +117,8 @@
|
|
|
100
117
|
line-height: normal;
|
|
101
118
|
text-align: left;
|
|
102
119
|
box-sizing: border-box;
|
|
120
|
+
z-index: 3;
|
|
121
|
+
pointer-events: none;
|
|
103
122
|
|
|
104
123
|
.el-tag {
|
|
105
124
|
display: inline-flex;
|
|
@@ -108,6 +127,7 @@
|
|
|
108
127
|
margin: 2px 0 2px 6px;
|
|
109
128
|
text-overflow: ellipsis;
|
|
110
129
|
color: $--color-text-6;
|
|
130
|
+
pointer-events: auto;
|
|
111
131
|
|
|
112
132
|
&.is-disabled {
|
|
113
133
|
color: $--color-text-3;
|
|
@@ -157,7 +157,13 @@
|
|
|
157
157
|
box-shadow: $--input-box-shadow;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
|
|
160
|
+
@include e((prefix, suffix)) {
|
|
161
|
+
.el-input__icon {
|
|
162
|
+
line-height: $--input-height - 2px;
|
|
163
|
+
display: flex;
|
|
164
|
+
align-items: center;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
161
167
|
@include e(suffix) {
|
|
162
168
|
padding-left: 8px;
|
|
163
169
|
position: absolute;
|
|
@@ -434,9 +440,6 @@
|
|
|
434
440
|
&.is-disabled {
|
|
435
441
|
background-color: $--input-disabled-fill;
|
|
436
442
|
}
|
|
437
|
-
.el-input__icon {
|
|
438
|
-
line-height: $--input-height - 2px;
|
|
439
|
-
}
|
|
440
443
|
.el-input__inner,
|
|
441
444
|
&:focus {
|
|
442
445
|
margin: 0 auto;
|
|
@@ -144,23 +144,6 @@
|
|
|
144
144
|
text-overflow: ellipsis;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
@include m(large) {
|
|
148
|
-
.el-tag--medium {
|
|
149
|
-
height: 28px;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
@include m(medium) {
|
|
153
|
-
.el-tag--small {
|
|
154
|
-
height: 24px;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
@include m(mini) {
|
|
158
|
-
.el-tag--mini {
|
|
159
|
-
height: 18px;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
147
|
&.is-disabled {
|
|
165
148
|
.el-tag {
|
|
166
149
|
&.el-tag--info {
|
|
@@ -178,13 +161,31 @@
|
|
|
178
161
|
max-width: 100%;
|
|
179
162
|
align-items: center;
|
|
180
163
|
pointer-events: auto;
|
|
164
|
+
height: $--input-height - 8px;
|
|
165
|
+
line-height: $--input-height - 8px;
|
|
181
166
|
&.el-tag--info {
|
|
182
167
|
background: $--color-fill-2;
|
|
183
168
|
color: $--color-text-6;
|
|
184
169
|
border: 0 none;
|
|
185
170
|
}
|
|
186
|
-
|
|
187
|
-
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@include m(medium) {
|
|
174
|
+
.el-tag--medium {
|
|
175
|
+
height: $--input-medium-height - 8px;
|
|
176
|
+
line-height: $--input-medium-height - 8px;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
@include m(small) {
|
|
180
|
+
.el-tag--small {
|
|
181
|
+
height: $--input-small-height - 8px;
|
|
182
|
+
line-height: $--input-small-height - 8px;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
@include m(mini) {
|
|
186
|
+
.el-tag--mini {
|
|
187
|
+
height: $--input-mini-height - 8px;
|
|
188
|
+
line-height: $--input-mini-height - 8px;
|
|
188
189
|
}
|
|
189
190
|
}
|
|
190
191
|
}
|