eoss-ui 0.5.25 → 0.5.26

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/button.js CHANGED
@@ -3516,7 +3516,8 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
3516
3516
  stop: Boolean,
3517
3517
  syncKeys: Object,
3518
3518
  text: String,
3519
- onClick: Function
3519
+ onClick: Function,
3520
+ badge: [Object, Number]
3520
3521
  },
3521
3522
  computed: {
3522
3523
  _type: function _type() {
@@ -3708,6 +3709,34 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
3708
3709
  tag = 'a';
3709
3710
  clas = clas.concat(['el-button', this._type ? 'el-button--' + this._type : 'el-button--default', this.size ? 'el-button--' + this.size : '']);
3710
3711
  }
3712
+ if (this.badge) {
3713
+ var config = {};
3714
+ if (typeof this.badge === 'number') {
3715
+ config = { class: 'es-button-badge', props: { value: this.badge } };
3716
+ } else {
3717
+ var _badge = this.badge,
3718
+ value = _badge.value,
3719
+ max = _badge.max,
3720
+ isDot = _badge.isDot,
3721
+ hidden = _badge.hidden,
3722
+ type = _badge.type;
3723
+
3724
+ config = {
3725
+ class: this.badge.class ? this.badge.class + ' es-button-badge' : 'es-button-badge',
3726
+ props: { value: value, max: max, isDot: isDot, hidden: hidden, type: type }
3727
+ };
3728
+ }
3729
+ return h('el-badge', config, [h(tag, {
3730
+ class: clas,
3731
+ props: _extends({}, this.$attrs, props),
3732
+ attrs: attrs,
3733
+ on: _extends({}, this.$listeners, { click: this.handleClick }),
3734
+ directives: [{
3735
+ name: 'show',
3736
+ value: !this.hide
3737
+ }]
3738
+ }, this.iconPlacement === 'start' ? [this.icon ? h('i', { class: this.icon }) : '', this.$slots.default || this.text] : [this.$slots.default || this.text, this.icon ? h('i', { class: this.icon }) : ''])]);
3739
+ }
3711
3740
  return h(tag, {
3712
3741
  class: clas,
3713
3742
  props: _extends({}, this.$attrs, props),
@@ -3664,7 +3664,7 @@ module.exports = require("vue");
3664
3664
  // ESM COMPAT FLAG
3665
3665
  __webpack_require__.r(__webpack_exports__);
3666
3666
 
3667
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox-group/src/main.vue?vue&type=template&id=103e1959&
3667
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox-group/src/main.vue?vue&type=template&id=796a733a&
3668
3668
  var render = function () {
3669
3669
  var _vm = this
3670
3670
  var _h = _vm.$createElement
@@ -3797,7 +3797,7 @@ var staticRenderFns = []
3797
3797
  render._withStripped = true
3798
3798
 
3799
3799
 
3800
- // CONCATENATED MODULE: ./packages/checkbox-group/src/main.vue?vue&type=template&id=103e1959&
3800
+ // CONCATENATED MODULE: ./packages/checkbox-group/src/main.vue?vue&type=template&id=796a733a&
3801
3801
 
3802
3802
  // EXTERNAL MODULE: ./src/config/api.js
3803
3803
  var api = __webpack_require__(1);
@@ -3992,7 +3992,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
3992
3992
  labelVal: function labelVal() {
3993
3993
  var _this = this;
3994
3994
 
3995
- var model = typeof this.model === 'string' ? this.model.split(',') : this.model;
3995
+ var model = typeof this.model === 'string' ? this.model.split(',') : this.model || [];
3996
3996
  var label = model.map(function (item) {
3997
3997
  if (util["a" /* default */].isObject(item)) {
3998
3998
  return item[_this.label];
package/lib/data-table.js CHANGED
@@ -3857,8 +3857,8 @@ var component = Object(componentNormalizer["a" /* default */])(
3857
3857
  // ESM COMPAT FLAG
3858
3858
  __webpack_require__.r(__webpack_exports__);
3859
3859
 
3860
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/data-table/src/main.vue?vue&type=template&id=55ef7929&
3861
- var mainvue_type_template_id_55ef7929_render = function () {
3860
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/data-table/src/main.vue?vue&type=template&id=1931d6be&
3861
+ var mainvue_type_template_id_1931d6be_render = function () {
3862
3862
  var _vm = this
3863
3863
  var _h = _vm.$createElement
3864
3864
  var _c = _vm._self._c || _h
@@ -3988,6 +3988,7 @@ var mainvue_type_template_id_55ef7929_render = function () {
3988
3988
  name: _vm.name,
3989
3989
  indexs: index,
3990
3990
  form: _vm.form,
3991
+ readonly: _vm.readonly,
3991
3992
  optionData: _vm.optionDatas,
3992
3993
  },
3993
3994
  item
@@ -4105,10 +4106,10 @@ var mainvue_type_template_id_55ef7929_render = function () {
4105
4106
  )
4106
4107
  }
4107
4108
  var staticRenderFns = []
4108
- mainvue_type_template_id_55ef7929_render._withStripped = true
4109
+ mainvue_type_template_id_1931d6be_render._withStripped = true
4109
4110
 
4110
4111
 
4111
- // CONCATENATED MODULE: ./packages/data-table/src/main.vue?vue&type=template&id=55ef7929&
4112
+ // CONCATENATED MODULE: ./packages/data-table/src/main.vue?vue&type=template&id=1931d6be&
4112
4113
 
4113
4114
  // EXTERNAL MODULE: ./src/config/api.js
4114
4115
  var api = __webpack_require__(1);
@@ -4156,8 +4157,8 @@ childrenvue_type_template_id_29bcbc72_render._withStripped = true
4156
4157
 
4157
4158
  // CONCATENATED MODULE: ./packages/data-table/src/children.vue?vue&type=template&id=29bcbc72&
4158
4159
 
4159
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/data-table/src/column.vue?vue&type=template&id=5798afd2&
4160
- var columnvue_type_template_id_5798afd2_render = function () {
4160
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/data-table/src/column.vue?vue&type=template&id=04b841ca&
4161
+ var columnvue_type_template_id_04b841ca_render = function () {
4161
4162
  var _vm = this
4162
4163
  var _h = _vm.$createElement
4163
4164
  var _c = _vm._self._c || _h
@@ -4587,11 +4588,14 @@ var columnvue_type_template_id_5798afd2_render = function () {
4587
4588
  })
4588
4589
  )
4589
4590
  )
4590
- : _vm.type === "text" || _vm.type === "textarea"
4591
+ : _vm.type === "text" ||
4592
+ _vm.type === "input" ||
4593
+ _vm.type === "textarea"
4591
4594
  ? [
4592
4595
  _vm.config.lazy
4593
4596
  ? [
4594
- _vm.type === "text"
4597
+ _vm.type === "text" ||
4598
+ _vm.type === "input"
4595
4599
  ? _c(
4596
4600
  "input",
4597
4601
  _vm._b(
@@ -4731,7 +4735,10 @@ var columnvue_type_template_id_5798afd2_render = function () {
4731
4735
  "es-input",
4732
4736
  _vm._b(
4733
4737
  {
4734
- attrs: { scope: scope },
4738
+ attrs: {
4739
+ type: _vm.type,
4740
+ scope: scope,
4741
+ },
4735
4742
  on: {
4736
4743
  blur: function (event) {
4737
4744
  _vm.handleBlur({
@@ -4809,6 +4816,13 @@ var columnvue_type_template_id_5798afd2_render = function () {
4809
4816
  "\n "
4810
4817
  ),
4811
4818
  ]
4819
+ : _vm.type === "textarea"
4820
+ ? _c("span", {
4821
+ style: _vm.styles ? _vm.styles[scope.row[_vm.prop]] : {},
4822
+ domProps: {
4823
+ innerHTML: _vm._s(_vm.format(scope.row, true)),
4824
+ },
4825
+ })
4812
4826
  : _c(
4813
4827
  "span",
4814
4828
  {
@@ -4866,11 +4880,11 @@ var columnvue_type_template_id_5798afd2_render = function () {
4866
4880
  2
4867
4881
  )
4868
4882
  }
4869
- var columnvue_type_template_id_5798afd2_staticRenderFns = []
4870
- columnvue_type_template_id_5798afd2_render._withStripped = true
4883
+ var columnvue_type_template_id_04b841ca_staticRenderFns = []
4884
+ columnvue_type_template_id_04b841ca_render._withStripped = true
4871
4885
 
4872
4886
 
4873
- // CONCATENATED MODULE: ./packages/data-table/src/column.vue?vue&type=template&id=5798afd2&
4887
+ // CONCATENATED MODULE: ./packages/data-table/src/column.vue?vue&type=template&id=04b841ca&
4874
4888
 
4875
4889
  // EXTERNAL MODULE: external "babel-runtime/regenerator"
4876
4890
  var regenerator_ = __webpack_require__(12);
@@ -5295,6 +5309,16 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
5295
5309
  //
5296
5310
  //
5297
5311
  //
5312
+ //
5313
+ //
5314
+ //
5315
+ //
5316
+ //
5317
+ //
5318
+ //
5319
+ //
5320
+ //
5321
+ //
5298
5322
 
5299
5323
 
5300
5324
 
@@ -5412,13 +5436,25 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
5412
5436
  config = _extends({ type: this.type }, config, this.$attrs);
5413
5437
  return config;
5414
5438
  }
5439
+ var required = this.required;
5440
+ if (this.rules && !required) {
5441
+ if (Array.isArray(this.rules)) {
5442
+ this.rules.map(function (item) {
5443
+ if (item.required) {
5444
+ required = item.required;
5445
+ }
5446
+ });
5447
+ } else if (this.rules.required) {
5448
+ required = this.rules.required;
5449
+ }
5450
+ }
5415
5451
  var minWidth = this.label || this.title ? (this.label || this.title).length * 14 + 20 : this.width ? '' : '180px';
5416
5452
  config = _extends({}, config, {
5417
5453
  filterIcon: this.icon,
5418
5454
  sortable: this.sortable || this.sort,
5419
5455
  minWidth: this.minWidth || this.table.minWidth || minWidth,
5420
5456
  className: [this.className ? this.className : '', this.type ? ' es-table-' + this.type + '-box' : '', this.showOverflowTooltip ? ' es-text-ellipsis' : ''].join(' '),
5421
- labelClassName: [this.labelClassName ? this.labelClassName : '', this.required ? 'es-required' : ''].join(' '),
5457
+ labelClassName: [this.labelClassName ? this.labelClassName : '', required ? 'es-required' : ''].join(' '),
5422
5458
  showOverflowTooltip: this.showOverflowTooltip,
5423
5459
  prop: this.field || this.prop,
5424
5460
  field: this.field
@@ -5434,9 +5470,6 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
5434
5470
  }, this.$attrs, {
5435
5471
  data: this.option
5436
5472
  });
5437
- if (this.type === 'textarea') {
5438
- config.type = 'textarea';
5439
- }
5440
5473
  return config;
5441
5474
  },
5442
5475
  icon: function icon() {
@@ -5447,7 +5480,7 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
5447
5480
  },
5448
5481
  isForm: function isForm() {
5449
5482
  var type = this.type ? this.type.toLowerCase() : '';
5450
- var flag = this.form && ['text', 'textarea', 'checkbox', 'radio', 'select', 'handle', 'date', 'year', 'month', 'date', 'dates', 'week', 'datetime', 'datetimerange', 'daterange', 'monthrange', 'quarter', 'halfyear', 'switch', 'selector', 'ganged', 'number'].indexOf(type) > -1 || ['space', 'slot'].indexOf(type) > -1;
5483
+ var flag = this.form && ['input', 'text', 'textarea', 'checkbox', 'radio', 'select', 'handle', 'date', 'year', 'month', 'date', 'dates', 'week', 'datetime', 'datetimerange', 'daterange', 'monthrange', 'quarter', 'halfyear', 'switch', 'selector', 'ganged', 'number'].indexOf(type) > -1 || ['space', 'slot'].indexOf(type) > -1;
5451
5484
  return flag;
5452
5485
  },
5453
5486
  option: function option() {
@@ -5565,41 +5598,47 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, a
5565
5598
 
5566
5599
  return util["a" /* default */].exclAttribute({ data: data, attrs: attrs });
5567
5600
  },
5568
- format: function format(rows) {
5601
+ format: function format(rows, flag) {
5569
5602
  var _this2 = this;
5570
5603
 
5571
5604
  var field = this.field || this.prop;
5572
5605
  var data = this.option;
5606
+ var str = '';
5573
5607
  if (util["a" /* default */].isObject(rows[field])) {
5574
- return rows[field][this.labelKey] || rows[field]['name'] || rows[field]['label'] || rows[field]['shortName'];
5608
+ str = rows[field][this.labelKey] || rows[field]['name'] || rows[field]['label'] || rows[field]['shortName'];
5575
5609
  } else if (Array.isArray(rows[field])) {
5576
5610
  var vals = rows[field].map(function (item) {
5577
5611
  if (util["a" /* default */].isObject(item)) {
5578
- return item[_this2.labelKey] || item['name'] || item['label'] || item['shortName'];
5612
+ str = item[_this2.labelKey] || item['name'] || item['label'] || item['shortName'];
5579
5613
  } else {
5580
5614
  if (data && data.length && util["a" /* default */].isObject(data[0])) {
5581
- return _this2.getLabel(data, item);
5615
+ str = _this2.getLabel(data, item);
5582
5616
  }
5583
- return item;
5617
+ str = item;
5584
5618
  }
5585
5619
  });
5586
- return vals.join(this.symbol ? this.symbol : '-');
5620
+ str = vals.join(this.symbol ? this.symbol : '-');
5587
5621
  } else {
5588
5622
  if (this.valueToString) {
5589
5623
  var _vals = rows[field].split(',').map(function (item) {
5590
5624
  if (data && data.length && util["a" /* default */].isObject(data[0])) {
5591
- return _this2.getLabel(data, item);
5625
+ str = _this2.getLabel(data, item);
5592
5626
  }
5593
- return item;
5627
+ str = item;
5594
5628
  });
5595
- return _vals.join(this.symbol ? this.symbol : '-');
5629
+ str = _vals.join(this.symbol ? this.symbol : '-');
5596
5630
  } else {
5597
5631
  if (data && data.length && util["a" /* default */].isObject(data[0])) {
5598
- return this.getLabel(data, rows[field]);
5632
+ str = this.getLabel(data, rows[field]);
5599
5633
  }
5600
- return rows[field];
5634
+ str = rows[field];
5601
5635
  }
5602
5636
  }
5637
+ if (str && flag) {
5638
+ str = str.replace(RegExp('\\n', 'g'), '<br/>');
5639
+ str = str.replace(RegExp(' ', 'g'), '&nbsp;');
5640
+ }
5641
+ return str;
5603
5642
  },
5604
5643
  getLabel: function getLabel(obj, val) {
5605
5644
  for (var i = 0; i < obj.length; i++) {
@@ -5709,8 +5748,8 @@ var componentNormalizer = __webpack_require__(3);
5709
5748
 
5710
5749
  var component = Object(componentNormalizer["a" /* default */])(
5711
5750
  src_columnvue_type_script_lang_js_,
5712
- columnvue_type_template_id_5798afd2_render,
5713
- columnvue_type_template_id_5798afd2_staticRenderFns,
5751
+ columnvue_type_template_id_04b841ca_render,
5752
+ columnvue_type_template_id_04b841ca_staticRenderFns,
5714
5753
  false,
5715
5754
  null,
5716
5755
  null,
@@ -6165,6 +6204,7 @@ var mainvue_type_script_lang_js_components, _watch;
6165
6204
  //
6166
6205
  //
6167
6206
  //
6207
+ //
6168
6208
 
6169
6209
 
6170
6210
 
@@ -7308,7 +7348,7 @@ var mainvue_type_script_lang_js_components, _watch;
7308
7348
 
7309
7349
  var main_component = Object(componentNormalizer["a" /* default */])(
7310
7350
  src_mainvue_type_script_lang_js_,
7311
- mainvue_type_template_id_55ef7929_render,
7351
+ mainvue_type_template_id_1931d6be_render,
7312
7352
  staticRenderFns,
7313
7353
  false,
7314
7354
  null,