iov-design 2.15.56 → 2.15.57
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/index.js +1 -1
- package/lib/input.js +4 -0
- package/lib/iov-design.common.js +94 -51
- package/lib/select.js +89 -50
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/table.css +1 -1
- package/package.json +1 -1
- package/packages/input/src/input.vue +5 -1
- package/packages/select/src/select.vue +34 -5
- package/packages/theme-chalk/src/cascader.scss +213 -213
- package/packages/theme-chalk/src/table.scss +1 -0
- package/src/index.js +1 -1
package/lib/input.js
CHANGED
|
@@ -951,9 +951,13 @@ var shared_ = __webpack_require__(21);
|
|
|
951
951
|
var isButton = pendantEl.querySelector('.el-button');
|
|
952
952
|
if (isSelect) {
|
|
953
953
|
Object(dom_["addClass"])(pendantEl, 'is-select');
|
|
954
|
+
} else {
|
|
955
|
+
Object(dom_["removeClass"])(pendantEl, 'is-select');
|
|
954
956
|
}
|
|
955
957
|
if (isButton) {
|
|
956
958
|
Object(dom_["addClass"])(pendantEl, 'is-button');
|
|
959
|
+
} else {
|
|
960
|
+
Object(dom_["removeClass"])(pendantEl, 'is-button');
|
|
957
961
|
}
|
|
958
962
|
},
|
|
959
963
|
calcIconOffset: function calcIconOffset(place) {
|
package/lib/iov-design.common.js
CHANGED
|
@@ -5034,9 +5034,13 @@ var shared_ = __webpack_require__(19);
|
|
|
5034
5034
|
var isButton = pendantEl.querySelector('.el-button');
|
|
5035
5035
|
if (isSelect) {
|
|
5036
5036
|
Object(dom_["addClass"])(pendantEl, 'is-select');
|
|
5037
|
+
} else {
|
|
5038
|
+
Object(dom_["removeClass"])(pendantEl, 'is-select');
|
|
5037
5039
|
}
|
|
5038
5040
|
if (isButton) {
|
|
5039
5041
|
Object(dom_["addClass"])(pendantEl, 'is-button');
|
|
5042
|
+
} else {
|
|
5043
|
+
Object(dom_["removeClass"])(pendantEl, 'is-button');
|
|
5040
5044
|
}
|
|
5041
5045
|
},
|
|
5042
5046
|
calcIconOffset: function calcIconOffset(place) {
|
|
@@ -7664,7 +7668,7 @@ var selectvue_type_template_id_0e4aade6_render = function() {
|
|
|
7664
7668
|
closable: !_vm.selectDisabled,
|
|
7665
7669
|
size: _vm.collapseTagSize,
|
|
7666
7670
|
hit: item.hitState,
|
|
7667
|
-
maxWidth: _vm.
|
|
7671
|
+
maxWidth: _vm.maxWidth,
|
|
7668
7672
|
type: "info",
|
|
7669
7673
|
"disable-transitions": ""
|
|
7670
7674
|
},
|
|
@@ -7685,10 +7689,13 @@ var selectvue_type_template_id_0e4aade6_render = function() {
|
|
|
7685
7689
|
: _vm._e()
|
|
7686
7690
|
]
|
|
7687
7691
|
}),
|
|
7688
|
-
_vm.selected.length > 1
|
|
7692
|
+
(_vm.selected.length > 1 &&
|
|
7693
|
+
_vm.selected.length > _vm.multipleLimitShow) ||
|
|
7694
|
+
(_vm.selected.length > 0 && _vm.collapseTagsFixed)
|
|
7689
7695
|
? _c(
|
|
7690
7696
|
"el-tag",
|
|
7691
7697
|
{
|
|
7698
|
+
ref: "tagsCount",
|
|
7692
7699
|
staticClass: "el-select__tags-count",
|
|
7693
7700
|
class: {
|
|
7694
7701
|
"el-select__tags-count-fixed":
|
|
@@ -7708,7 +7715,12 @@ var selectvue_type_template_id_0e4aade6_render = function() {
|
|
|
7708
7715
|
[
|
|
7709
7716
|
_vm._v(
|
|
7710
7717
|
_vm._s(_vm.collapseTagsFixed ? "" : "+") +
|
|
7711
|
-
_vm._s(
|
|
7718
|
+
_vm._s(
|
|
7719
|
+
_vm.collapseTagsFixed
|
|
7720
|
+
? _vm.selected.length
|
|
7721
|
+
: _vm.selected.length -
|
|
7722
|
+
_vm.multipleLimitShow
|
|
7723
|
+
) +
|
|
7712
7724
|
_vm._s(_vm.collapseTagsSuffix)
|
|
7713
7725
|
)
|
|
7714
7726
|
]
|
|
@@ -7736,7 +7748,7 @@ var selectvue_type_template_id_0e4aade6_render = function() {
|
|
|
7736
7748
|
closable: !item.disabled && !_vm.selectDisabled,
|
|
7737
7749
|
size: _vm.collapseTagSize,
|
|
7738
7750
|
hit: item.hitState,
|
|
7739
|
-
maxWidth: _vm.
|
|
7751
|
+
maxWidth: _vm.maxWidth,
|
|
7740
7752
|
type: "info",
|
|
7741
7753
|
"disable-transitions": ""
|
|
7742
7754
|
},
|
|
@@ -8729,6 +8741,7 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
|
|
|
8729
8741
|
//
|
|
8730
8742
|
//
|
|
8731
8743
|
//
|
|
8744
|
+
//
|
|
8732
8745
|
|
|
8733
8746
|
|
|
8734
8747
|
|
|
@@ -8772,6 +8785,18 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
|
|
|
8772
8785
|
|
|
8773
8786
|
|
|
8774
8787
|
computed: {
|
|
8788
|
+
// maxWidth() {
|
|
8789
|
+
// if (this.collapseTags) {
|
|
8790
|
+
// if (this.multipleTagMaxWidth && this.multipleTagMaxWidth !== 'none') {
|
|
8791
|
+
// return this.multipleTagMaxWidth;
|
|
8792
|
+
// }
|
|
8793
|
+
// const tagsCountWidth = this.$refs.tagsCount && this.$refs.tagsCount.$el.clientWidth || 0;
|
|
8794
|
+
// const count = this.selected.length <= this.multipleLimitShow ? this.selected.length : this.multipleLimitShow;
|
|
8795
|
+
// return Math.floor((this.inputWidth - this.tagsLeft - 32 - tagsCountWidth - 20 - count * 16) / count) + 'px';
|
|
8796
|
+
// } else {
|
|
8797
|
+
// return this.multipleTagMaxWidth || 'none';
|
|
8798
|
+
// }
|
|
8799
|
+
// },
|
|
8775
8800
|
_elFormItemSize: function _elFormItemSize() {
|
|
8776
8801
|
return (this.elFormItem || {}).elFormItemSize;
|
|
8777
8802
|
},
|
|
@@ -8938,7 +8963,8 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
|
|
|
8938
8963
|
menuVisibleOnFocus: false,
|
|
8939
8964
|
isOnComposition: false,
|
|
8940
8965
|
isSilentBlur: false,
|
|
8941
|
-
tagsLeft: 0
|
|
8966
|
+
tagsLeft: 0,
|
|
8967
|
+
maxWidth: 'none'
|
|
8942
8968
|
};
|
|
8943
8969
|
},
|
|
8944
8970
|
|
|
@@ -8966,6 +8992,7 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
|
|
|
8966
8992
|
this.query = '';
|
|
8967
8993
|
this.handleQueryChange(this.query);
|
|
8968
8994
|
}
|
|
8995
|
+
this.getMaxWidth();
|
|
8969
8996
|
}
|
|
8970
8997
|
this.setSelected();
|
|
8971
8998
|
if (this.filterable && !this.multiple) {
|
|
@@ -9051,19 +9078,35 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
|
|
|
9051
9078
|
},
|
|
9052
9079
|
|
|
9053
9080
|
methods: {
|
|
9081
|
+
getMaxWidth: function getMaxWidth() {
|
|
9082
|
+
var _this5 = this;
|
|
9083
|
+
|
|
9084
|
+
this.$nextTick(function () {
|
|
9085
|
+
if (_this5.collapseTags) {
|
|
9086
|
+
if (_this5.multipleTagMaxWidth && _this5.multipleTagMaxWidth !== 'none') {
|
|
9087
|
+
_this5.maxWidth = _this5.multipleTagMaxWidth;
|
|
9088
|
+
}
|
|
9089
|
+
var tagsCountWidth = _this5.$refs.tagsCount && _this5.$refs.tagsCount.$el.clientWidth || 0;
|
|
9090
|
+
var count = _this5.selected.length <= _this5.multipleLimitShow ? _this5.selected.length : _this5.multipleLimitShow;
|
|
9091
|
+
_this5.maxWidth = Math.floor((_this5.inputWidth - _this5.tagsLeft - 32 - tagsCountWidth - 20 - count * 16) / count) + 'px';
|
|
9092
|
+
} else {
|
|
9093
|
+
_this5.maxWidth = _this5.multipleTagMaxWidth || 'none';
|
|
9094
|
+
}
|
|
9095
|
+
});
|
|
9096
|
+
},
|
|
9054
9097
|
handleNavigate: function handleNavigate(direction) {
|
|
9055
9098
|
if (this.isOnComposition) return;
|
|
9056
9099
|
|
|
9057
9100
|
this.navigateOptions(direction);
|
|
9058
9101
|
},
|
|
9059
9102
|
handleComposition: function handleComposition(event) {
|
|
9060
|
-
var
|
|
9103
|
+
var _this6 = this;
|
|
9061
9104
|
|
|
9062
9105
|
var text = event.target.value;
|
|
9063
9106
|
if (event.type === 'compositionend') {
|
|
9064
9107
|
this.isOnComposition = false;
|
|
9065
9108
|
this.$nextTick(function (_) {
|
|
9066
|
-
return
|
|
9109
|
+
return _this6.handleQueryChange(text);
|
|
9067
9110
|
});
|
|
9068
9111
|
} else {
|
|
9069
9112
|
var lastCharacter = text[text.length - 1] || '';
|
|
@@ -9071,7 +9114,7 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
|
|
|
9071
9114
|
}
|
|
9072
9115
|
},
|
|
9073
9116
|
handleQueryChange: function handleQueryChange(val) {
|
|
9074
|
-
var
|
|
9117
|
+
var _this7 = this;
|
|
9075
9118
|
|
|
9076
9119
|
if (this.previousQuery === val || this.isOnComposition) return;
|
|
9077
9120
|
if (this.previousQuery === null && (typeof this.filterMethod === 'function' || typeof this.remoteMethod === 'function')) {
|
|
@@ -9080,15 +9123,15 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
|
|
|
9080
9123
|
}
|
|
9081
9124
|
this.previousQuery = val;
|
|
9082
9125
|
this.$nextTick(function () {
|
|
9083
|
-
if (
|
|
9126
|
+
if (_this7.visible) _this7.broadcast('ElSelectDropdown', 'updatePopper');
|
|
9084
9127
|
});
|
|
9085
9128
|
this.hoverIndex = -1;
|
|
9086
9129
|
if (this.multiple && this.filterable) {
|
|
9087
9130
|
this.$nextTick(function () {
|
|
9088
|
-
var length =
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
|
|
9131
|
+
var length = _this7.$refs.input.value.length * 15 + 20;
|
|
9132
|
+
_this7.inputLength = _this7.collapseTags ? Math.min(50, length) : length;
|
|
9133
|
+
_this7.managePlaceholder();
|
|
9134
|
+
_this7.resetInputHeight();
|
|
9092
9135
|
});
|
|
9093
9136
|
}
|
|
9094
9137
|
if (this.remote && typeof this.remoteMethod === 'function') {
|
|
@@ -9115,10 +9158,10 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
|
|
|
9115
9158
|
this.$refs.scrollbar && this.$refs.scrollbar.handleScroll();
|
|
9116
9159
|
},
|
|
9117
9160
|
handleMenuEnter: function handleMenuEnter() {
|
|
9118
|
-
var
|
|
9161
|
+
var _this8 = this;
|
|
9119
9162
|
|
|
9120
9163
|
this.$nextTick(function () {
|
|
9121
|
-
return
|
|
9164
|
+
return _this8.scrollToOption(_this8.selected);
|
|
9122
9165
|
});
|
|
9123
9166
|
},
|
|
9124
9167
|
emitChange: function emitChange(val) {
|
|
@@ -9152,7 +9195,7 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
|
|
|
9152
9195
|
return newOption;
|
|
9153
9196
|
},
|
|
9154
9197
|
setSelected: function setSelected() {
|
|
9155
|
-
var
|
|
9198
|
+
var _this9 = this;
|
|
9156
9199
|
|
|
9157
9200
|
if (!this.multiple) {
|
|
9158
9201
|
var option = this.getOption(this.value);
|
|
@@ -9170,12 +9213,12 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
|
|
|
9170
9213
|
var result = [];
|
|
9171
9214
|
if (Array.isArray(this.value)) {
|
|
9172
9215
|
this.value.forEach(function (value) {
|
|
9173
|
-
result.push(
|
|
9216
|
+
result.push(_this9.getOption(value));
|
|
9174
9217
|
});
|
|
9175
9218
|
}
|
|
9176
9219
|
this.selected = result;
|
|
9177
9220
|
this.$nextTick(function () {
|
|
9178
|
-
|
|
9221
|
+
_this9.resetInputHeight();
|
|
9179
9222
|
});
|
|
9180
9223
|
},
|
|
9181
9224
|
handleFocus: function handleFocus(event) {
|
|
@@ -9196,13 +9239,13 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
|
|
|
9196
9239
|
this.$refs.reference.blur();
|
|
9197
9240
|
},
|
|
9198
9241
|
handleBlur: function handleBlur(event) {
|
|
9199
|
-
var
|
|
9242
|
+
var _this10 = this;
|
|
9200
9243
|
|
|
9201
9244
|
setTimeout(function () {
|
|
9202
|
-
if (
|
|
9203
|
-
|
|
9245
|
+
if (_this10.isSilentBlur) {
|
|
9246
|
+
_this10.isSilentBlur = false;
|
|
9204
9247
|
} else {
|
|
9205
|
-
|
|
9248
|
+
_this10.$emit('blur', event);
|
|
9206
9249
|
}
|
|
9207
9250
|
}, 50);
|
|
9208
9251
|
this.softFocus = false;
|
|
@@ -9243,15 +9286,15 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
|
|
|
9243
9286
|
}
|
|
9244
9287
|
},
|
|
9245
9288
|
resetTagsLeft: function resetTagsLeft() {
|
|
9246
|
-
var
|
|
9289
|
+
var _this11 = this;
|
|
9247
9290
|
|
|
9248
9291
|
this.$nextTick(function () {
|
|
9249
|
-
var prefixLabel =
|
|
9250
|
-
var prefix =
|
|
9251
|
-
var inputInner =
|
|
9292
|
+
var prefixLabel = _this11.$el.querySelector('.el-input-group__prefix-label');
|
|
9293
|
+
var prefix = _this11.$el.querySelector('.el-input__prefix');
|
|
9294
|
+
var inputInner = _this11.$el.querySelector('.el-input__inner');
|
|
9252
9295
|
var prefixLabelWidth = prefixLabel && Math.round(prefixLabel.getBoundingClientRect().width) || 0;
|
|
9253
9296
|
var inputPaddingLeft = prefixLabel || prefix ? Math.round(window.getComputedStyle(inputInner).paddingLeft.replace(/px/, '')) : 0;
|
|
9254
|
-
|
|
9297
|
+
_this11.tagsLeft = prefixLabelWidth + inputPaddingLeft;
|
|
9255
9298
|
});
|
|
9256
9299
|
},
|
|
9257
9300
|
resetInputState: function resetInputState(e) {
|
|
@@ -9260,42 +9303,42 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
|
|
|
9260
9303
|
this.resetInputHeight();
|
|
9261
9304
|
},
|
|
9262
9305
|
resetInputHeight: function resetInputHeight() {
|
|
9263
|
-
var
|
|
9306
|
+
var _this12 = this;
|
|
9264
9307
|
|
|
9265
9308
|
if (this.collapseTags && !this.filterable) return;
|
|
9266
9309
|
this.$nextTick(function () {
|
|
9267
|
-
if (!
|
|
9268
|
-
var inputInner =
|
|
9269
|
-
var groupPrefix =
|
|
9310
|
+
if (!_this12.$refs.reference) return;
|
|
9311
|
+
var inputInner = _this12.$el.querySelector('.el-input__inner');
|
|
9312
|
+
var groupPrefix = _this12.$el.querySelector('.el-input-group--prefix');
|
|
9270
9313
|
var input = groupPrefix || inputInner;
|
|
9271
|
-
var tags =
|
|
9314
|
+
var tags = _this12.$refs.tags;
|
|
9272
9315
|
var tagsHeight = tags ? Math.round(tags.getBoundingClientRect().height) : 0;
|
|
9273
|
-
var sizeInMap =
|
|
9274
|
-
input.style.height =
|
|
9275
|
-
if (
|
|
9276
|
-
|
|
9316
|
+
var sizeInMap = _this12.initialInputHeight || 36;
|
|
9317
|
+
input.style.height = _this12.selected.length === 0 ? sizeInMap + 'px' : Math.max(tags ? tagsHeight + (tagsHeight > sizeInMap ? 6 : 0) : 0, sizeInMap) + 'px';
|
|
9318
|
+
if (_this12.visible && _this12.emptyText !== false) {
|
|
9319
|
+
_this12.broadcast('ElSelectDropdown', 'updatePopper');
|
|
9277
9320
|
}
|
|
9278
9321
|
});
|
|
9279
9322
|
},
|
|
9280
9323
|
resetHoverIndex: function resetHoverIndex() {
|
|
9281
|
-
var
|
|
9324
|
+
var _this13 = this;
|
|
9282
9325
|
|
|
9283
9326
|
setTimeout(function () {
|
|
9284
|
-
if (!
|
|
9285
|
-
|
|
9327
|
+
if (!_this13.multiple) {
|
|
9328
|
+
_this13.hoverIndex = _this13.options.indexOf(_this13.selected);
|
|
9286
9329
|
} else {
|
|
9287
|
-
if (
|
|
9288
|
-
|
|
9289
|
-
return
|
|
9330
|
+
if (_this13.selected.length > 0) {
|
|
9331
|
+
_this13.hoverIndex = Math.min.apply(null, _this13.selected.map(function (item) {
|
|
9332
|
+
return _this13.options.indexOf(item);
|
|
9290
9333
|
}));
|
|
9291
9334
|
} else {
|
|
9292
|
-
|
|
9335
|
+
_this13.hoverIndex = -1;
|
|
9293
9336
|
}
|
|
9294
9337
|
}
|
|
9295
9338
|
}, 300);
|
|
9296
9339
|
},
|
|
9297
9340
|
handleOptionSelect: function handleOptionSelect(option, byClick) {
|
|
9298
|
-
var
|
|
9341
|
+
var _this14 = this;
|
|
9299
9342
|
|
|
9300
9343
|
if (this.multiple) {
|
|
9301
9344
|
var value = (this.value || []).slice();
|
|
@@ -9322,7 +9365,7 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
|
|
|
9322
9365
|
// this.setSoftFocus();
|
|
9323
9366
|
if (this.visible) return;
|
|
9324
9367
|
this.$nextTick(function () {
|
|
9325
|
-
|
|
9368
|
+
_this14.scrollToOption(option);
|
|
9326
9369
|
});
|
|
9327
9370
|
},
|
|
9328
9371
|
setSoftFocus: function setSoftFocus() {
|
|
@@ -9455,7 +9498,7 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
|
|
|
9455
9498
|
},
|
|
9456
9499
|
|
|
9457
9500
|
created: function created() {
|
|
9458
|
-
var
|
|
9501
|
+
var _this15 = this;
|
|
9459
9502
|
|
|
9460
9503
|
this.cachedPlaceHolder = this.currentPlaceholder = this.propPlaceholder;
|
|
9461
9504
|
if (this.multiple && !Array.isArray(this.value)) {
|
|
@@ -9466,18 +9509,18 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
|
|
|
9466
9509
|
}
|
|
9467
9510
|
|
|
9468
9511
|
this.debouncedOnInputChange = debounce_default()(this.debounce, function () {
|
|
9469
|
-
|
|
9512
|
+
_this15.onInputChange();
|
|
9470
9513
|
});
|
|
9471
9514
|
|
|
9472
9515
|
this.debouncedQueryChange = debounce_default()(this.debounce, function (e) {
|
|
9473
|
-
|
|
9516
|
+
_this15.handleQueryChange(e.target.value);
|
|
9474
9517
|
});
|
|
9475
9518
|
|
|
9476
9519
|
this.$on('handleOptionClick', this.handleOptionSelect);
|
|
9477
9520
|
this.$on('setSelected', this.setSelected);
|
|
9478
9521
|
},
|
|
9479
9522
|
mounted: function mounted() {
|
|
9480
|
-
var
|
|
9523
|
+
var _this16 = this;
|
|
9481
9524
|
|
|
9482
9525
|
if (this.multiple && Array.isArray(this.value) && this.value.length > 0) {
|
|
9483
9526
|
this.currentPlaceholder = '';
|
|
@@ -9499,7 +9542,7 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
|
|
|
9499
9542
|
}
|
|
9500
9543
|
this.$nextTick(function () {
|
|
9501
9544
|
if (reference && reference.$el) {
|
|
9502
|
-
|
|
9545
|
+
_this16.inputWidth = reference.$el.getBoundingClientRect().width;
|
|
9503
9546
|
}
|
|
9504
9547
|
});
|
|
9505
9548
|
this.setSelected();
|
|
@@ -45032,7 +45075,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
45032
45075
|
}
|
|
45033
45076
|
|
|
45034
45077
|
/* harmony default export */ var src_0 = __webpack_exports__["default"] = ({
|
|
45035
|
-
version: '2.15.
|
|
45078
|
+
version: '2.15.57',
|
|
45036
45079
|
locale: lib_locale_default.a.use,
|
|
45037
45080
|
i18n: lib_locale_default.a.i18n,
|
|
45038
45081
|
install: src_install,
|