bi-eleme 1.0.8 → 1.0.9

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.
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 60);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 61);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -255,7 +255,7 @@ module.exports = require("bi-eleme/lib/mixins/locale");
255
255
 
256
256
  /***/ }),
257
257
 
258
- /***/ 60:
258
+ /***/ 61:
259
259
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
260
260
 
261
261
  "use strict";
@@ -7402,8 +7402,8 @@ switch_src_component.install = function (Vue) {
7402
7402
  };
7403
7403
 
7404
7404
  /* harmony default export */ var packages_switch = (switch_src_component);
7405
- // CONCATENATED MODULE: ./node_modules/_vue-loader@15.10.0@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.10.0@vue-loader/lib??vue-loader-options!./packages/select/src/select.vue?vue&type=template&id=def15b8e&
7406
- var selectvue_type_template_id_def15b8e_render = function () {
7405
+ // CONCATENATED MODULE: ./node_modules/_vue-loader@15.10.0@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.10.0@vue-loader/lib??vue-loader-options!./packages/select/src/select.vue?vue&type=template&id=1a400819&
7406
+ var selectvue_type_template_id_1a400819_render = function () {
7407
7407
  var _vm = this
7408
7408
  var _h = _vm.$createElement
7409
7409
  var _c = _vm._self._c || _h
@@ -7845,6 +7845,9 @@ var selectvue_type_template_id_def15b8e_render = function () {
7845
7845
  attrs: { "append-to-body": _vm.popperAppendToBody },
7846
7846
  },
7847
7847
  [
7848
+ _vm.multiple && _vm.multipleAll
7849
+ ? _c("el-all-option", [_vm._v("全选")])
7850
+ : _vm._e(),
7848
7851
  _c(
7849
7852
  "el-scrollbar",
7850
7853
  {
@@ -7905,11 +7908,11 @@ var selectvue_type_template_id_def15b8e_render = function () {
7905
7908
  1
7906
7909
  )
7907
7910
  }
7908
- var selectvue_type_template_id_def15b8e_staticRenderFns = []
7909
- selectvue_type_template_id_def15b8e_render._withStripped = true
7911
+ var selectvue_type_template_id_1a400819_staticRenderFns = []
7912
+ selectvue_type_template_id_1a400819_render._withStripped = true
7910
7913
 
7911
7914
 
7912
- // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=template&id=def15b8e&
7915
+ // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=template&id=1a400819&
7913
7916
 
7914
7917
  // CONCATENATED MODULE: ./node_modules/_vue-loader@15.10.0@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.10.0@vue-loader/lib??vue-loader-options!./packages/select/src/select-dropdown.vue?vue&type=template&id=7334b3e4&
7915
7918
  var select_dropdownvue_type_template_id_7334b3e4_render = function () {
@@ -8264,6 +8267,159 @@ var option_component = normalizeComponent(
8264
8267
  )
8265
8268
 
8266
8269
  /* harmony default export */ var src_option = (option_component.exports);
8270
+ // CONCATENATED MODULE: ./node_modules/_vue-loader@15.10.0@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/_vue-loader@15.10.0@vue-loader/lib??vue-loader-options!./packages/select/src/all-option.vue?vue&type=template&id=a5d8f44a&
8271
+ var all_optionvue_type_template_id_a5d8f44a_render = function () {
8272
+ var _vm = this
8273
+ var _h = _vm.$createElement
8274
+ var _c = _vm._self._c || _h
8275
+ return _c(
8276
+ "li",
8277
+ {
8278
+ directives: [
8279
+ {
8280
+ name: "show",
8281
+ rawName: "v-show",
8282
+ value: _vm.visible,
8283
+ expression: "visible",
8284
+ },
8285
+ ],
8286
+ staticClass: "el-select-dropdown__item select-all",
8287
+ class: {
8288
+ selected: _vm.itemSelected,
8289
+ "is-disabled": _vm.disabled || _vm.groupDisabled || _vm.limitReached,
8290
+ hover: _vm.hover,
8291
+ },
8292
+ on: {
8293
+ mouseenter: _vm.hoverItem,
8294
+ click: function ($event) {
8295
+ $event.stopPropagation()
8296
+ return _vm.selectOptionClick($event)
8297
+ },
8298
+ },
8299
+ },
8300
+ [_vm._t("default")],
8301
+ 2
8302
+ )
8303
+ }
8304
+ var all_optionvue_type_template_id_a5d8f44a_staticRenderFns = []
8305
+ all_optionvue_type_template_id_a5d8f44a_render._withStripped = true
8306
+
8307
+
8308
+ // CONCATENATED MODULE: ./packages/select/src/all-option.vue?vue&type=template&id=a5d8f44a&
8309
+
8310
+ // CONCATENATED MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@15.10.0@vue-loader/lib??vue-loader-options!./packages/select/src/all-option.vue?vue&type=script&lang=js&
8311
+ //
8312
+ //
8313
+ //
8314
+ //
8315
+ //
8316
+ //
8317
+ //
8318
+ //
8319
+ //
8320
+ //
8321
+ //
8322
+ //
8323
+ //
8324
+ //
8325
+ //
8326
+ //
8327
+ //
8328
+
8329
+
8330
+
8331
+
8332
+ /* harmony default export */ var all_optionvue_type_script_lang_js_ = ({
8333
+ mixins: [emitter_default.a],
8334
+
8335
+ name: 'ElAllOption',
8336
+
8337
+ componentName: 'ElOption',
8338
+
8339
+ inject: ['select'],
8340
+
8341
+ props: {
8342
+ label: [String, Number],
8343
+ created: Boolean,
8344
+ disabled: {
8345
+ type: Boolean,
8346
+ default: false
8347
+ }
8348
+ },
8349
+
8350
+ data: function data() {
8351
+ return {
8352
+ index: -1,
8353
+ groupDisabled: false,
8354
+ visible: true,
8355
+ hitState: false,
8356
+ hover: false
8357
+ };
8358
+ },
8359
+
8360
+
8361
+ computed: {
8362
+ itemSelected: function itemSelected() {
8363
+ return this.select.selectAll;
8364
+ },
8365
+ limitReached: function limitReached() {
8366
+ if (this.select.multiple) {
8367
+ return !this.itemSelected && (this.select.value || []).length >= this.select.multipleLimit && this.select.multipleLimit > 0;
8368
+ } else {
8369
+ return false;
8370
+ }
8371
+ }
8372
+ },
8373
+
8374
+ watch: {},
8375
+
8376
+ methods: {
8377
+ selectOptionClick: function selectOptionClick() {
8378
+ this.dispatch('ElSelect', 'handleMultipleAll', [!this.select.selectAll]);
8379
+ },
8380
+ hoverItem: function hoverItem() {
8381
+ this.select.hoverIndex = -1;
8382
+ },
8383
+ queryChange: function queryChange(query) {
8384
+ // this.visible = new RegExp(escapeRegexpString(query), 'i').test(this.currentLabel) || this.created
8385
+ // if (!this.visible) {
8386
+ // this.select.filteredOptionsCount--
8387
+ // }
8388
+ }
8389
+ },
8390
+
8391
+ created: function created() {
8392
+ // this.select.options.push(this)
8393
+ // this.select.cachedOptions.push(this)
8394
+ // this.select.optionsCount++
8395
+ // this.select.filteredOptionsCount++
8396
+ // this.$on('queryChange', this.queryChange)
8397
+ // this.$on('handleGroupDisabled', this.handleGroupDisabled)
8398
+ },
8399
+ beforeDestroy: function beforeDestroy() {}
8400
+ });
8401
+ // CONCATENATED MODULE: ./packages/select/src/all-option.vue?vue&type=script&lang=js&
8402
+ /* harmony default export */ var src_all_optionvue_type_script_lang_js_ = (all_optionvue_type_script_lang_js_);
8403
+ // CONCATENATED MODULE: ./packages/select/src/all-option.vue
8404
+
8405
+
8406
+
8407
+
8408
+
8409
+ /* normalize component */
8410
+
8411
+ var all_option_component = normalizeComponent(
8412
+ src_all_optionvue_type_script_lang_js_,
8413
+ all_optionvue_type_template_id_a5d8f44a_render,
8414
+ all_optionvue_type_template_id_a5d8f44a_staticRenderFns,
8415
+ false,
8416
+ null,
8417
+ null,
8418
+ null
8419
+
8420
+ )
8421
+
8422
+ /* harmony default export */ var all_option = (all_option_component.exports);
8267
8423
  // EXTERNAL MODULE: external "bi-eleme/lib/tag"
8268
8424
  var tag_ = __webpack_require__(29);
8269
8425
  var tag_default = /*#__PURE__*/__webpack_require__.n(tag_);
@@ -8517,6 +8673,8 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
8517
8673
  //
8518
8674
  //
8519
8675
  //
8676
+ //
8677
+
8520
8678
 
8521
8679
 
8522
8680
 
@@ -8611,6 +8769,11 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
8611
8769
  },
8612
8770
  propPlaceholder: function propPlaceholder() {
8613
8771
  return typeof this.placeholder !== 'undefined' ? this.placeholder : this.t('el.select.placeholder');
8772
+ },
8773
+ selectAll: function selectAll() {
8774
+ return this.cachedOptions.filter(function (option) {
8775
+ return option.itemSelected === true;
8776
+ }).length === this.optionsCount;
8614
8777
  }
8615
8778
  },
8616
8779
 
@@ -8618,6 +8781,7 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
8618
8781
  ElInput: input_default.a,
8619
8782
  ElSelectMenu: select_dropdown,
8620
8783
  ElOption: src_option,
8784
+ ElAllOption: all_option,
8621
8785
  ElTag: tag_default.a,
8622
8786
  ElScrollbar: scrollbar_default.a
8623
8787
  },
@@ -8657,6 +8821,7 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
8657
8821
  remoteMethod: Function,
8658
8822
  filterMethod: Function,
8659
8823
  multiple: Boolean,
8824
+ multipleAll: Boolean,
8660
8825
  multipleLimit: {
8661
8826
  type: Number,
8662
8827
  default: 0
@@ -8898,8 +9063,14 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
8898
9063
  });
8899
9064
  },
8900
9065
  emitChange: function emitChange(val) {
9066
+ var _this8 = this;
9067
+
8901
9068
  if (!Object(util_["valueEquals"])(this.value, val)) {
8902
- this.$emit('change', val);
9069
+ this.$nextTick(function () {
9070
+ console.log('this.selected:', _this8.selected);
9071
+
9072
+ _this8.$emit('change', val, _this8.multiple ? '' : _this8.selected.currentLabel);
9073
+ });
8903
9074
  }
8904
9075
  },
8905
9076
  getOption: function getOption(value) {
@@ -8928,7 +9099,7 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
8928
9099
  return newOption;
8929
9100
  },
8930
9101
  setSelected: function setSelected() {
8931
- var _this8 = this;
9102
+ var _this9 = this;
8932
9103
 
8933
9104
  if (!this.multiple) {
8934
9105
  var option = this.getOption(this.value);
@@ -8946,12 +9117,12 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
8946
9117
  var result = [];
8947
9118
  if (Array.isArray(this.value)) {
8948
9119
  this.value.forEach(function (value) {
8949
- result.push(_this8.getOption(value));
9120
+ result.push(_this9.getOption(value));
8950
9121
  });
8951
9122
  }
8952
9123
  this.selected = result;
8953
9124
  this.$nextTick(function () {
8954
- _this8.resetInputHeight();
9125
+ _this9.resetInputHeight();
8955
9126
  });
8956
9127
  },
8957
9128
  handleFocus: function handleFocus(event) {
@@ -8972,13 +9143,13 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
8972
9143
  this.$refs.reference.blur();
8973
9144
  },
8974
9145
  handleBlur: function handleBlur(event) {
8975
- var _this9 = this;
9146
+ var _this10 = this;
8976
9147
 
8977
9148
  setTimeout(function () {
8978
- if (_this9.isSilentBlur) {
8979
- _this9.isSilentBlur = false;
9149
+ if (_this10.isSilentBlur) {
9150
+ _this10.isSilentBlur = false;
8980
9151
  } else {
8981
- _this9.$emit('blur', event);
9152
+ _this10.$emit('blur', event);
8982
9153
  }
8983
9154
  }, 50);
8984
9155
  this.softFocus = false;
@@ -9024,43 +9195,56 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
9024
9195
  this.resetInputHeight();
9025
9196
  },
9026
9197
  resetInputHeight: function resetInputHeight() {
9027
- var _this10 = this;
9198
+ var _this11 = this;
9028
9199
 
9029
9200
  if (this.collapseTags && !this.filterable) return;
9030
9201
  this.$nextTick(function () {
9031
- if (!_this10.$refs.reference) return;
9032
- var inputChildNodes = _this10.$refs.reference.$el.childNodes;
9202
+ if (!_this11.$refs.reference) return;
9203
+ var inputChildNodes = _this11.$refs.reference.$el.childNodes;
9033
9204
  var input = [].filter.call(inputChildNodes, function (item) {
9034
9205
  return item.tagName === 'INPUT';
9035
9206
  })[0];
9036
- var tags = _this10.$refs.tags;
9207
+ var tags = _this11.$refs.tags;
9037
9208
  var tagsHeight = tags ? Math.round(tags.getBoundingClientRect().height) : 0;
9038
- var sizeInMap = _this10.initialInputHeight || 40;
9039
- input.style.height = _this10.selected.length === 0 ? sizeInMap + 'px' : Math.max(tags ? tagsHeight + (tagsHeight > sizeInMap ? 6 : 0) : 0, sizeInMap) + 'px';
9040
- if (_this10.visible && _this10.emptyText !== false) {
9041
- _this10.broadcast('ElSelectDropdown', 'updatePopper');
9209
+ var sizeInMap = _this11.initialInputHeight || 40;
9210
+ input.style.height = _this11.selected.length === 0 ? sizeInMap + 'px' : Math.max(tags ? tagsHeight + (tagsHeight > sizeInMap ? 6 : 0) : 0, sizeInMap) + 'px';
9211
+ if (_this11.visible && _this11.emptyText !== false) {
9212
+ _this11.broadcast('ElSelectDropdown', 'updatePopper');
9042
9213
  }
9043
9214
  });
9044
9215
  },
9045
9216
  resetHoverIndex: function resetHoverIndex() {
9046
- var _this11 = this;
9217
+ var _this12 = this;
9047
9218
 
9048
9219
  setTimeout(function () {
9049
- if (!_this11.multiple) {
9050
- _this11.hoverIndex = _this11.options.indexOf(_this11.selected);
9220
+ if (!_this12.multiple) {
9221
+ _this12.hoverIndex = _this12.options.indexOf(_this12.selected);
9051
9222
  } else {
9052
- if (_this11.selected.length > 0) {
9053
- _this11.hoverIndex = Math.min.apply(null, _this11.selected.map(function (item) {
9054
- return _this11.options.indexOf(item);
9223
+ if (_this12.selected.length > 0) {
9224
+ _this12.hoverIndex = Math.min.apply(null, _this12.selected.map(function (item) {
9225
+ return _this12.options.indexOf(item);
9055
9226
  }));
9056
9227
  } else {
9057
- _this11.hoverIndex = -1;
9228
+ _this12.hoverIndex = -1;
9058
9229
  }
9059
9230
  }
9060
9231
  }, 300);
9061
9232
  },
9233
+ handleMultipleAll: function handleMultipleAll(checkStatus) {
9234
+ if (checkStatus) {
9235
+ var value = this.cachedOptions.map(function (option) {
9236
+ return option.value;
9237
+ });
9238
+
9239
+ this.$emit('input', value);
9240
+ this.emitChange(value);
9241
+ } else {
9242
+ this.$emit('input', []);
9243
+ this.emitChange([]);
9244
+ }
9245
+ },
9062
9246
  handleOptionSelect: function handleOptionSelect(option, byClick) {
9063
- var _this12 = this;
9247
+ var _this13 = this;
9064
9248
 
9065
9249
  if (this.multiple) {
9066
9250
  var value = (this.value || []).slice();
@@ -9087,7 +9271,7 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
9087
9271
  this.setSoftFocus();
9088
9272
  if (this.visible) return;
9089
9273
  this.$nextTick(function () {
9090
- _this12.scrollToOption(option);
9274
+ _this13.scrollToOption(option);
9091
9275
  });
9092
9276
  },
9093
9277
  setSoftFocus: function setSoftFocus() {
@@ -9216,7 +9400,7 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
9216
9400
  },
9217
9401
 
9218
9402
  created: function created() {
9219
- var _this13 = this;
9403
+ var _this14 = this;
9220
9404
 
9221
9405
  this.cachedPlaceHolder = this.currentPlaceholder = this.propPlaceholder;
9222
9406
  if (this.multiple && !Array.isArray(this.value)) {
@@ -9227,18 +9411,19 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
9227
9411
  }
9228
9412
 
9229
9413
  this.debouncedOnInputChange = debounce_default()(this.debounce, function () {
9230
- _this13.onInputChange();
9414
+ _this14.onInputChange();
9231
9415
  });
9232
9416
 
9233
9417
  this.debouncedQueryChange = debounce_default()(this.debounce, function (e) {
9234
- _this13.handleQueryChange(e.target.value);
9418
+ _this14.handleQueryChange(e.target.value);
9235
9419
  });
9236
9420
 
9237
9421
  this.$on('handleOptionClick', this.handleOptionSelect);
9422
+ this.$on('handleMultipleAll', this.handleMultipleAll);
9238
9423
  this.$on('setSelected', this.setSelected);
9239
9424
  },
9240
9425
  mounted: function mounted() {
9241
- var _this14 = this;
9426
+ var _this15 = this;
9242
9427
 
9243
9428
  if (this.multiple && Array.isArray(this.value) && this.value.length > 0) {
9244
9429
  this.currentPlaceholder = '';
@@ -9260,7 +9445,7 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
9260
9445
  }
9261
9446
  this.$nextTick(function () {
9262
9447
  if (reference && reference.$el) {
9263
- _this14.inputWidth = reference.$el.getBoundingClientRect().width;
9448
+ _this15.inputWidth = reference.$el.getBoundingClientRect().width;
9264
9449
  }
9265
9450
  });
9266
9451
  this.setSelected();
@@ -9281,8 +9466,8 @@ var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_vi
9281
9466
 
9282
9467
  var select_component = normalizeComponent(
9283
9468
  src_selectvue_type_script_lang_js_,
9284
- selectvue_type_template_id_def15b8e_render,
9285
- selectvue_type_template_id_def15b8e_staticRenderFns,
9469
+ selectvue_type_template_id_1a400819_render,
9470
+ selectvue_type_template_id_1a400819_staticRenderFns,
9286
9471
  false,
9287
9472
  null,
9288
9473
  null,
@@ -43897,7 +44082,7 @@ if (typeof window !== 'undefined' && window.Vue) {
43897
44082
  }
43898
44083
 
43899
44084
  /* harmony default export */ var src_0 = __webpack_exports__["default"] = ({
43900
- version: '1.0.8',
44085
+ version: '1.0.9',
43901
44086
  locale: lib_locale_default.a.use,
43902
44087
  i18n: lib_locale_default.a.i18n,
43903
44088
  install: src_install,