dfish-widget 1.0.39 → 1.0.40

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.esm.js CHANGED
@@ -6034,6 +6034,7 @@ var script$A = {
6034
6034
  isFocus: false,
6035
6035
  hasBorder: false,
6036
6036
  isPlural: false,
6037
+ isEdit: false,
6037
6038
  loading: false,
6038
6039
  warnClass: '',
6039
6040
  labelVertical: false,
@@ -6043,6 +6044,18 @@ var script$A = {
6043
6044
  validIndex: 0,
6044
6045
  }
6045
6046
  },
6047
+ watch: {
6048
+ modelValue(v, ov) {
6049
+ if (this.isEdit) {
6050
+ this.isEdit = false;
6051
+ } else {
6052
+ if (v == null) v = '';
6053
+ if (ov == null) ov = '';
6054
+ this.watchModelValue(v, ov);
6055
+ }
6056
+ }
6057
+ },
6058
+
6046
6059
  methods: {
6047
6060
  val(v) {
6048
6061
  if (arguments.length == 0)
@@ -6062,6 +6075,7 @@ var script$A = {
6062
6075
  if (changed) {
6063
6076
  this.warnClass && this.warn(false);
6064
6077
  if (this.isUsableVal(v)) {
6078
+ this.isEdit = true;
6065
6079
  this.$emit('update:modelValue', v);
6066
6080
  this.trigger('change', v);
6067
6081
  }
@@ -6083,6 +6097,11 @@ var script$A = {
6083
6097
  return r && r.value ? r.value : r
6084
6098
  }
6085
6099
  },
6100
+ watchModelValue(v, ov) {
6101
+ if (ov != v) {
6102
+ this.trigger('change', v);
6103
+ }
6104
+ },
6086
6105
  async valid(trigger) {
6087
6106
  let error = await this.getValidError(trigger);
6088
6107
  if (error) {
@@ -6496,6 +6515,15 @@ var script$z = {
6496
6515
  }
6497
6516
  $$1.lodash.each(this.siblings(), f => f.val($$1.idsAny(a, f.checkValue)));
6498
6517
  },
6518
+ watchModelValue(v, ov) {
6519
+ if (ov != v) {
6520
+ this.trigger('change', v);
6521
+ if (this.pubParent && this.pubParent.watchValue != v) {
6522
+ this.pubParent.watchValue = v;
6523
+ this.pubParent.trigger('change', v);
6524
+ }
6525
+ }
6526
+ },
6499
6527
  check(a) {
6500
6528
  if (!this.isNormal) return
6501
6529
  this.val(a);
@@ -6521,8 +6549,8 @@ var script$z = {
6521
6549
  e.stopPropagation();
6522
6550
  },
6523
6551
  onbasechange(e) {
6524
- if (this.warnClass && this.x.name) {
6525
- this.ownerView.fAll(this.x.name).forEach(v => v.warn && v.warn(false));
6552
+ if (this.warnClass) {
6553
+ this.siblings().forEach(v => v.warn && v.warn(false));
6526
6554
  }
6527
6555
  this.setVal(e.target.checked, e);
6528
6556
  },
@@ -8632,6 +8660,11 @@ var script$k = {
8632
8660
  providePubParent: this
8633
8661
  }
8634
8662
  },
8663
+ data() {
8664
+ return {
8665
+ watchValue: ''
8666
+ }
8667
+ },
8635
8668
  methods: {
8636
8669
  x_default() {
8637
8670
  return {
@@ -10627,14 +10660,19 @@ var script$5 = {
10627
10660
  }
10628
10661
  },
10629
10662
  watch: {
10630
- modelValue(v) {
10631
- this.clear();
10632
- },
10633
10663
  inputValue(v) {
10634
10664
  this.sensor_text = v;
10635
10665
  }
10636
10666
  },
10637
10667
  methods: {
10668
+ watchModelValue(v, ov) {
10669
+ this.clear();
10670
+ const or = ov && ov.map ? ov.map(n => n.value).join(',') : '';
10671
+ const r = v && v.map ? v.map(n => n.value).join(',') : '';
10672
+ if (or != r) {
10673
+ this.trigger('change', v);
10674
+ }
10675
+ },
10638
10676
  addVal(v) {
10639
10677
  let mv;
10640
10678
  if (this.x.multiple) {