vxe-table 3.4.11 → 3.4.12-beta.0

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.umd.js CHANGED
@@ -8683,7 +8683,17 @@ var iconPrefix = 'vxe-icon--';
8683
8683
  button: {// size: null,
8684
8684
  // transfer: false
8685
8685
  },
8686
- radio: {// size: null
8686
+ radio: {
8687
+ // size: null,
8688
+ strict: true
8689
+ },
8690
+ radioButton: {
8691
+ // size: null,
8692
+ strict: true
8693
+ },
8694
+ radioGroup: {
8695
+ // size: null,
8696
+ strict: true
8687
8697
  },
8688
8698
  checkbox: {// size: null
8689
8699
  },
@@ -27626,6 +27636,12 @@ Object.keys(option_props).forEach(function (name) {
27626
27636
  content: [String, Number],
27627
27637
  disabled: Boolean,
27628
27638
  name: String,
27639
+ strict: {
27640
+ type: Boolean,
27641
+ default: function _default() {
27642
+ return conf.radio.strict;
27643
+ }
27644
+ },
27629
27645
  size: {
27630
27646
  type: String,
27631
27647
  default: function _default() {
@@ -27642,11 +27658,14 @@ Object.keys(option_props).forEach(function (name) {
27642
27658
  isDisabled: function isDisabled() {
27643
27659
  var $xeradiogroup = this.$xeradiogroup;
27644
27660
  return this.disabled || $xeradiogroup && $xeradiogroup.disabled;
27661
+ },
27662
+ isStrict: function isStrict() {
27663
+ var $xeradiogroup = this.$xeradiogroup;
27664
+ return $xeradiogroup ? $xeradiogroup.strict : this.strict;
27645
27665
  }
27646
27666
  },
27647
27667
  render: function render(h) {
27648
- var _ref,
27649
- _this = this;
27668
+ var _ref;
27650
27669
 
27651
27670
  var $scopedSlots = this.$scopedSlots,
27652
27671
  $xeradiogroup = this.$xeradiogroup,
@@ -27677,22 +27696,8 @@ Object.keys(option_props).forEach(function (name) {
27677
27696
  checked: $xeradiogroup ? $xeradiogroup.value === label : value === label
27678
27697
  },
27679
27698
  on: {
27680
- change: function change(evnt) {
27681
- if (!isDisabled) {
27682
- var params = {
27683
- label: label,
27684
- $event: evnt
27685
- };
27686
-
27687
- if ($xeradiogroup) {
27688
- $xeradiogroup.handleChecked(params);
27689
- } else {
27690
- _this.$emit('input', label);
27691
-
27692
- _this.$emit('change', params);
27693
- }
27694
- }
27695
- }
27699
+ change: this.changeEvent,
27700
+ click: this.clickEvent
27696
27701
  }
27697
27702
  }), h('span', {
27698
27703
  class: 'vxe-radio--icon'
@@ -27701,22 +27706,35 @@ Object.keys(option_props).forEach(function (name) {
27701
27706
  }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [UtilTools.getFuncText(content)])]);
27702
27707
  },
27703
27708
  methods: {
27709
+ handleValue: function handleValue(label, evnt) {
27710
+ var $xeradiogroup = this.$xeradiogroup;
27711
+ var params = {
27712
+ label: label,
27713
+ $event: evnt
27714
+ };
27715
+
27716
+ if ($xeradiogroup) {
27717
+ $xeradiogroup.handleChecked(params);
27718
+ } else {
27719
+ this.$emit('input', label);
27720
+ this.$emit('change', params);
27721
+ }
27722
+ },
27704
27723
  changeEvent: function changeEvent(evnt) {
27705
- var $xeradiogroup = this.$xeradiogroup,
27706
- isDisabled = this.isDisabled,
27707
- label = this.label;
27724
+ var isDisabled = this.isDisabled;
27708
27725
 
27709
27726
  if (!isDisabled) {
27710
- var params = {
27711
- label: label,
27712
- $event: evnt
27713
- };
27727
+ this.handleValue(this.label, evnt);
27728
+ }
27729
+ },
27730
+ clickEvent: function clickEvent(evnt) {
27731
+ var $xeradiogroup = this.$xeradiogroup,
27732
+ isDisabled = this.isDisabled,
27733
+ isStrict = this.isStrict;
27714
27734
 
27715
- if ($xeradiogroup) {
27716
- $xeradiogroup.handleChecked(params);
27717
- } else {
27718
- this.$emit('input', label);
27719
- this.$emit('change', params);
27735
+ if (!isDisabled && !isStrict) {
27736
+ if (this.label === ($xeradiogroup ? $xeradiogroup.value : this.value)) {
27737
+ this.handleValue(null, evnt);
27720
27738
  }
27721
27739
  }
27722
27740
  }
@@ -34402,10 +34420,16 @@ var Radio = Object.assign(src_radio, {
34402
34420
  props: {
34403
34421
  value: [String, Number, Boolean],
34404
34422
  disabled: Boolean,
34423
+ strict: {
34424
+ type: Boolean,
34425
+ default: function _default() {
34426
+ return conf.radioGroup.strict;
34427
+ }
34428
+ },
34405
34429
  size: {
34406
34430
  type: String,
34407
34431
  default: function _default() {
34408
- return conf.radio.size || conf.size;
34432
+ return conf.radioGroup.size || conf.size;
34409
34433
  }
34410
34434
  }
34411
34435
  },
@@ -34461,10 +34485,16 @@ var RadioGroup = Object.assign(radio_src_group, {
34461
34485
  title: [String, Number],
34462
34486
  content: [String, Number],
34463
34487
  disabled: Boolean,
34488
+ strict: {
34489
+ type: Boolean,
34490
+ default: function _default() {
34491
+ return conf.radioButton.strict;
34492
+ }
34493
+ },
34464
34494
  size: {
34465
34495
  type: String,
34466
34496
  default: function _default() {
34467
- return conf.radio.size || conf.size;
34497
+ return conf.radioButton.size || conf.size;
34468
34498
  }
34469
34499
  }
34470
34500
  },
@@ -34480,6 +34510,10 @@ var RadioGroup = Object.assign(radio_src_group, {
34480
34510
  isDisabled: function isDisabled() {
34481
34511
  var $xeradiogroup = this.$xeradiogroup;
34482
34512
  return this.disabled || $xeradiogroup && $xeradiogroup.disabled;
34513
+ },
34514
+ isStrict: function isStrict() {
34515
+ var $xeradiogroup = this.$xeradiogroup;
34516
+ return $xeradiogroup ? $xeradiogroup.strict : this.strict;
34483
34517
  }
34484
34518
  },
34485
34519
  render: function render(h) {
@@ -34513,29 +34547,43 @@ var RadioGroup = Object.assign(radio_src_group, {
34513
34547
  checked: $xeradiogroup ? $xeradiogroup.value === label : value === label
34514
34548
  },
34515
34549
  on: {
34516
- change: this.changeEvent
34550
+ change: this.changeEvent,
34551
+ click: this.clickEvent
34517
34552
  }
34518
34553
  }), h('span', {
34519
34554
  class: 'vxe-radio--label'
34520
34555
  }, $scopedSlots.default ? $scopedSlots.default.call(this, {}) : [UtilTools.getFuncText(content)])]);
34521
34556
  },
34522
34557
  methods: {
34558
+ handleValue: function handleValue(label, evnt) {
34559
+ var $xeradiogroup = this.$xeradiogroup;
34560
+ var params = {
34561
+ label: label,
34562
+ $event: evnt
34563
+ };
34564
+
34565
+ if ($xeradiogroup) {
34566
+ $xeradiogroup.handleChecked(params);
34567
+ } else {
34568
+ this.$emit('input', label);
34569
+ this.$emit('change', params);
34570
+ }
34571
+ },
34523
34572
  changeEvent: function changeEvent(evnt) {
34524
- var $xeradiogroup = this.$xeradiogroup,
34525
- isDisabled = this.isDisabled,
34526
- label = this.label;
34573
+ var isDisabled = this.isDisabled;
34527
34574
 
34528
34575
  if (!isDisabled) {
34529
- var params = {
34530
- label: label,
34531
- $event: evnt
34532
- };
34576
+ this.handleValue(this.label, evnt);
34577
+ }
34578
+ },
34579
+ clickEvent: function clickEvent(evnt) {
34580
+ var $xeradiogroup = this.$xeradiogroup,
34581
+ isDisabled = this.isDisabled,
34582
+ isStrict = this.isStrict;
34533
34583
 
34534
- if ($xeradiogroup) {
34535
- $xeradiogroup.handleChecked(params);
34536
- } else {
34537
- this.$emit('input', label);
34538
- this.$emit('change', params);
34584
+ if (!isDisabled && !isStrict) {
34585
+ if (this.label === ($xeradiogroup ? $xeradiogroup.value : this.value)) {
34586
+ this.handleValue(null, evnt);
34539
34587
  }
34540
34588
  }
34541
34589
  }