vxe-table 4.1.16 → 4.1.17-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.
@@ -11,7 +11,8 @@ export default defineComponent({
11
11
  title: [String, Number],
12
12
  content: [String, Number],
13
13
  disabled: Boolean,
14
- size: { type: String, default: function () { return GlobalConfig.radio.size || GlobalConfig.size; } }
14
+ strict: { type: Boolean, default: function () { return GlobalConfig.radioButton.strict; } },
15
+ size: { type: String, default: function () { return GlobalConfig.radioButton.size || GlobalConfig.size; } }
15
16
  },
16
17
  emits: [
17
18
  'update:modelValue',
@@ -34,6 +35,9 @@ export default defineComponent({
34
35
  var computeName = computed(function () {
35
36
  return $xeradiogroup ? $xeradiogroup.name : null;
36
37
  });
38
+ var computeStrict = computed(function () {
39
+ return $xeradiogroup ? $xeradiogroup.props.strict : props.strict;
40
+ });
37
41
  var computeChecked = computed(function () {
38
42
  var modelValue = props.modelValue, label = props.label;
39
43
  return $xeradiogroup ? $xeradiogroup.props.modelValue === label : modelValue === label;
@@ -44,16 +48,27 @@ export default defineComponent({
44
48
  }
45
49
  };
46
50
  Object.assign($xeradiobutton, radioButtonMethods);
51
+ var handleValue = function (label, evnt) {
52
+ if ($xeradiogroup) {
53
+ $xeradiogroup.handleChecked({ label: label }, evnt);
54
+ }
55
+ else {
56
+ emit('update:modelValue', label);
57
+ radioButtonMethods.dispatchEvent('change', { label: label }, evnt);
58
+ }
59
+ };
47
60
  var changeEvent = function (evnt) {
48
- var label = props.label;
49
61
  var isDisabled = computeDisabled.value;
50
62
  if (!isDisabled) {
51
- if ($xeradiogroup) {
52
- $xeradiogroup.handleChecked({ label: label }, evnt);
53
- }
54
- else {
55
- emit('update:modelValue', label);
56
- radioButtonMethods.dispatchEvent('change', { label: label }, evnt);
63
+ handleValue(props.label, evnt);
64
+ }
65
+ };
66
+ var clickEvent = function (evnt) {
67
+ var isDisabled = computeDisabled.value;
68
+ var isStrict = computeStrict.value;
69
+ if (!isDisabled && !isStrict) {
70
+ if (props.label === ($xeradiogroup ? $xeradiogroup.props.modelValue : props.modelValue)) {
71
+ handleValue(null, evnt);
57
72
  }
58
73
  }
59
74
  };
@@ -76,7 +91,8 @@ export default defineComponent({
76
91
  name: name,
77
92
  checked: checked,
78
93
  disabled: isDisabled,
79
- onChange: changeEvent
94
+ onChange: changeEvent,
95
+ onClick: clickEvent
80
96
  }),
81
97
  h('span', {
82
98
  class: 'vxe-radio--label'
@@ -7,6 +7,7 @@ export default defineComponent({
7
7
  props: {
8
8
  modelValue: [String, Number, Boolean],
9
9
  disabled: Boolean,
10
+ strict: { type: Boolean, default: function () { return GlobalConfig.radio.strict; } },
10
11
  size: { type: String, default: function () { return GlobalConfig.radio.size || GlobalConfig.size; } }
11
12
  },
12
13
  emits: [
@@ -12,6 +12,7 @@ export default defineComponent({
12
12
  content: [String, Number],
13
13
  disabled: Boolean,
14
14
  name: String,
15
+ strict: { type: Boolean, default: function () { return GlobalConfig.radio.strict; } },
15
16
  size: { type: String, default: function () { return GlobalConfig.radio.size || GlobalConfig.size; } }
16
17
  },
17
18
  emits: [
@@ -35,20 +36,34 @@ export default defineComponent({
35
36
  var computeName = computed(function () {
36
37
  return $xeradiogroup ? $xeradiogroup.name : props.name;
37
38
  });
39
+ var computeStrict = computed(function () {
40
+ return $xeradiogroup ? $xeradiogroup.props.strict : props.strict;
41
+ });
38
42
  var computeChecked = computed(function () {
39
43
  var modelValue = props.modelValue, label = props.label;
40
44
  return $xeradiogroup ? $xeradiogroup.props.modelValue === label : modelValue === label;
41
45
  });
46
+ var handleValue = function (label, evnt) {
47
+ if ($xeradiogroup) {
48
+ $xeradiogroup.handleChecked({ label: label }, evnt);
49
+ }
50
+ else {
51
+ emit('update:modelValue', label);
52
+ radioMethods.dispatchEvent('change', { label: label }, evnt);
53
+ }
54
+ };
42
55
  var changeEvent = function (evnt) {
43
- var label = props.label;
44
56
  var isDisabled = computeDisabled.value;
45
57
  if (!isDisabled) {
46
- if ($xeradiogroup) {
47
- $xeradiogroup.handleChecked({ label: label }, evnt);
48
- }
49
- else {
50
- emit('update:modelValue', label);
51
- radioMethods.dispatchEvent('change', { label: label }, evnt);
58
+ handleValue(props.label, evnt);
59
+ }
60
+ };
61
+ var clickEvent = function (evnt) {
62
+ var isDisabled = computeDisabled.value;
63
+ var isStrict = computeStrict.value;
64
+ if (!isDisabled && !isStrict) {
65
+ if (props.label === ($xeradiogroup ? $xeradiogroup.props.modelValue : props.modelValue)) {
66
+ handleValue(null, evnt);
52
67
  }
53
68
  }
54
69
  };
@@ -77,7 +92,8 @@ export default defineComponent({
77
92
  name: name,
78
93
  checked: checked,
79
94
  disabled: isDisabled,
80
- onChange: changeEvent
95
+ onChange: changeEvent,
96
+ onClick: clickEvent
81
97
  }),
82
98
  h('span', {
83
99
  class: 'vxe-radio--icon'
@@ -284,7 +284,16 @@ var GlobalConfig = {
284
284
  // transfer: false
285
285
  },
286
286
  radio: {
287
- // size: null
287
+ // size: null,
288
+ strict: true
289
+ },
290
+ radioButton: {
291
+ // size: null,
292
+ strict: true
293
+ },
294
+ radioGroup: {
295
+ // size: null,
296
+ strict: true
288
297
  },
289
298
  checkbox: {
290
299
  // size: null
package/lib/index.umd.js CHANGED
@@ -8689,7 +8689,17 @@ var GlobalConfig = {
8689
8689
  button: {// size: null,
8690
8690
  // transfer: false
8691
8691
  },
8692
- radio: {// size: null
8692
+ radio: {
8693
+ // size: null,
8694
+ strict: true
8695
+ },
8696
+ radioButton: {
8697
+ // size: null,
8698
+ strict: true
8699
+ },
8700
+ radioGroup: {
8701
+ // size: null,
8702
+ strict: true
8693
8703
  },
8694
8704
  checkbox: {// size: null
8695
8705
  },
@@ -18707,6 +18717,12 @@ function getOptUniqueId() {
18707
18717
  props: {
18708
18718
  modelValue: [String, Number, Boolean],
18709
18719
  disabled: Boolean,
18720
+ strict: {
18721
+ type: Boolean,
18722
+ default: function _default() {
18723
+ return conf.radio.strict;
18724
+ }
18725
+ },
18710
18726
  size: {
18711
18727
  type: String,
18712
18728
  default: function _default() {
@@ -18778,6 +18794,12 @@ function getOptUniqueId() {
18778
18794
  content: [String, Number],
18779
18795
  disabled: Boolean,
18780
18796
  name: String,
18797
+ strict: {
18798
+ type: Boolean,
18799
+ default: function _default() {
18800
+ return conf.radio.strict;
18801
+ }
18802
+ },
18781
18803
  size: {
18782
18804
  type: String,
18783
18805
  default: function _default() {
@@ -18804,26 +18826,43 @@ function getOptUniqueId() {
18804
18826
  var computeName = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
18805
18827
  return $xeradiogroup ? $xeradiogroup.name : props.name;
18806
18828
  });
18829
+ var computeStrict = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
18830
+ return $xeradiogroup ? $xeradiogroup.props.strict : props.strict;
18831
+ });
18807
18832
  var computeChecked = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
18808
18833
  var modelValue = props.modelValue,
18809
18834
  label = props.label;
18810
18835
  return $xeradiogroup ? $xeradiogroup.props.modelValue === label : modelValue === label;
18811
18836
  });
18812
18837
 
18838
+ var handleValue = function handleValue(label, evnt) {
18839
+ if ($xeradiogroup) {
18840
+ $xeradiogroup.handleChecked({
18841
+ label: label
18842
+ }, evnt);
18843
+ } else {
18844
+ emit('update:modelValue', label);
18845
+ radioMethods.dispatchEvent('change', {
18846
+ label: label
18847
+ }, evnt);
18848
+ }
18849
+ };
18850
+
18813
18851
  var changeEvent = function changeEvent(evnt) {
18814
- var label = props.label;
18815
18852
  var isDisabled = computeDisabled.value;
18816
18853
 
18817
18854
  if (!isDisabled) {
18818
- if ($xeradiogroup) {
18819
- $xeradiogroup.handleChecked({
18820
- label: label
18821
- }, evnt);
18822
- } else {
18823
- emit('update:modelValue', label);
18824
- radioMethods.dispatchEvent('change', {
18825
- label: label
18826
- }, evnt);
18855
+ handleValue(props.label, evnt);
18856
+ }
18857
+ };
18858
+
18859
+ var clickEvent = function clickEvent(evnt) {
18860
+ var isDisabled = computeDisabled.value;
18861
+ var isStrict = computeStrict.value;
18862
+
18863
+ if (!isDisabled && !isStrict) {
18864
+ if (props.label === ($xeradiogroup ? $xeradiogroup.props.modelValue : props.modelValue)) {
18865
+ handleValue(null, evnt);
18827
18866
  }
18828
18867
  }
18829
18868
  };
@@ -18854,7 +18893,8 @@ function getOptUniqueId() {
18854
18893
  name: name,
18855
18894
  checked: checked,
18856
18895
  disabled: isDisabled,
18857
- onChange: changeEvent
18896
+ onChange: changeEvent,
18897
+ onClick: clickEvent
18858
18898
  }), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["h"])('span', {
18859
18899
  class: 'vxe-radio--icon'
18860
18900
  }), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["h"])('span', {
@@ -27283,10 +27323,16 @@ var RadioGroup = Object.assign(src_group, {
27283
27323
  title: [String, Number],
27284
27324
  content: [String, Number],
27285
27325
  disabled: Boolean,
27326
+ strict: {
27327
+ type: Boolean,
27328
+ default: function _default() {
27329
+ return conf.radioButton.strict;
27330
+ }
27331
+ },
27286
27332
  size: {
27287
27333
  type: String,
27288
27334
  default: function _default() {
27289
- return conf.radio.size || conf.size;
27335
+ return conf.radioButton.size || conf.size;
27290
27336
  }
27291
27337
  }
27292
27338
  },
@@ -27309,6 +27355,9 @@ var RadioGroup = Object.assign(src_group, {
27309
27355
  var computeName = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
27310
27356
  return $xeradiogroup ? $xeradiogroup.name : null;
27311
27357
  });
27358
+ var computeStrict = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
27359
+ return $xeradiogroup ? $xeradiogroup.props.strict : props.strict;
27360
+ });
27312
27361
  var computeChecked = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
27313
27362
  var modelValue = props.modelValue,
27314
27363
  label = props.label;
@@ -27324,20 +27373,34 @@ var RadioGroup = Object.assign(src_group, {
27324
27373
  };
27325
27374
  Object.assign($xeradiobutton, radioButtonMethods);
27326
27375
 
27376
+ var handleValue = function handleValue(label, evnt) {
27377
+ if ($xeradiogroup) {
27378
+ $xeradiogroup.handleChecked({
27379
+ label: label
27380
+ }, evnt);
27381
+ } else {
27382
+ emit('update:modelValue', label);
27383
+ radioButtonMethods.dispatchEvent('change', {
27384
+ label: label
27385
+ }, evnt);
27386
+ }
27387
+ };
27388
+
27327
27389
  var changeEvent = function changeEvent(evnt) {
27328
- var label = props.label;
27329
27390
  var isDisabled = computeDisabled.value;
27330
27391
 
27331
27392
  if (!isDisabled) {
27332
- if ($xeradiogroup) {
27333
- $xeradiogroup.handleChecked({
27334
- label: label
27335
- }, evnt);
27336
- } else {
27337
- emit('update:modelValue', label);
27338
- radioButtonMethods.dispatchEvent('change', {
27339
- label: label
27340
- }, evnt);
27393
+ handleValue(props.label, evnt);
27394
+ }
27395
+ };
27396
+
27397
+ var clickEvent = function clickEvent(evnt) {
27398
+ var isDisabled = computeDisabled.value;
27399
+ var isStrict = computeStrict.value;
27400
+
27401
+ if (!isDisabled && !isStrict) {
27402
+ if (props.label === ($xeradiogroup ? $xeradiogroup.props.modelValue : props.modelValue)) {
27403
+ handleValue(null, evnt);
27341
27404
  }
27342
27405
  }
27343
27406
  };
@@ -27358,7 +27421,8 @@ var RadioGroup = Object.assign(src_group, {
27358
27421
  name: name,
27359
27422
  checked: checked,
27360
27423
  disabled: isDisabled,
27361
- onChange: changeEvent
27424
+ onChange: changeEvent,
27425
+ onClick: clickEvent
27362
27426
  }), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["h"])('span', {
27363
27427
  class: 'vxe-radio--label'
27364
27428
  }, slots.default ? slots.default({}) : getFuncText(props.content))]);