dfish-widget 1.0.127 → 1.0.129

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
@@ -9858,33 +9858,48 @@ var script$o = {
9858
9858
  this.focus();
9859
9859
  this.$emit('clear', e);
9860
9860
  }
9861
- },
9862
- oninput(e) {
9861
+ },
9862
+ baseInput(e) {
9863
9863
  let v = e.target.value;
9864
9864
  this.val(v);
9865
9865
  this.baseValid('change');
9866
9866
  this.trigger(e, v);
9867
+ },
9868
+ oninput(e) {
9867
9869
  if (this.x.suggest) {
9868
9870
  clearTimeout(this.sug_timer);
9869
- if (v === '') {
9871
+ if (e.target.value === '') {
9872
+ this.baseInput(e);
9870
9873
  this.doSuggest(false);
9874
+ } else if (e.type !== 'input') {
9875
+ e.runType = 'input';
9876
+ this.baseInput(e);
9877
+ this.doSuggest(true);
9871
9878
  } else {
9872
9879
  this.sug_timer = setTimeout(() => {
9880
+ this.baseInput(e);
9873
9881
  this.doSuggest(true);
9874
9882
  }, 500);
9875
9883
  }
9884
+ } else {
9885
+ this.baseInput(e);
9876
9886
  }
9877
9887
  },
9878
9888
  onfocus(e) {
9879
9889
  this.isFocus = true;
9880
- if (!this.showSuggest && e.target.value && !this.sug_completed) {
9881
- e.target.dispatchEvent(new Event('input'));
9890
+ if (this.x.suggest && !this.showSuggest && e.target.value && !this.sug_completed) {
9891
+ this.oninput(e);
9882
9892
  }
9883
9893
  if (this.sug_completed) {
9884
9894
  this.sug_completed = false;
9885
9895
  }
9886
9896
  this.trigger('focus');
9887
9897
  },
9898
+ onclick(e) {
9899
+ if (this.x.suggest && !this.showSuggest && e.target.value && !this.sug_completed) {
9900
+ this.oninput(e);
9901
+ }
9902
+ },
9888
9903
  doSuggest(a) {
9889
9904
  a = a == null ? true : a;
9890
9905
  if (a === false) {
@@ -9951,6 +9966,7 @@ var script$o = {
9951
9966
  let r = {
9952
9967
  oninput: this.oninput,
9953
9968
  onfocus: this.onfocus,
9969
+ onclick: this.onclick,
9954
9970
  };
9955
9971
  if (this.x.maxLength) {
9956
9972
  r.maxlength = this.x.maxLength;