dfish-widget 1.0.128 → 1.0.130

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
@@ -1915,9 +1915,9 @@ const bindCache = {};
1915
1915
  }
1916
1916
  },
1917
1917
  ajax(cmd) {
1918
- this.ajaxLock && this.ajaxLock();
1918
+ this.setLoading && this.setLoading();
1919
1919
  return $$1.ajax(cmd).then((res) => {
1920
- this.ajaxLock && this.ajaxLock(false);
1920
+ this.setLoading && this.setLoading(false);
1921
1921
  return res
1922
1922
  })
1923
1923
  },
@@ -1935,14 +1935,14 @@ const bindCache = {};
1935
1935
  return new Promise(async (resolve) => {
1936
1936
  await nextTick();
1937
1937
  const vm = $$1.vm(this);
1938
- this.ajaxLock && this.ajaxLock();
1938
+ this.setLoading && this.setLoading();
1939
1939
  let isValid = await vm.valid(cmd.range, cmd.group);
1940
1940
  if (isValid) {
1941
1941
  let post = vm.getPostData(cmd.range);
1942
1942
  cmd.data = cmd.data && post ? $$1.extend({}, cmd.data, post) : (cmd.data || post);
1943
1943
  resolve(this.ajax(cmd));
1944
1944
  } else {
1945
- this.ajaxLock && this.ajaxLock(false);
1945
+ this.setLoading && this.setLoading(false);
1946
1946
  }
1947
1947
  })
1948
1948
  },
@@ -4556,7 +4556,7 @@ var script$14 = {
4556
4556
  }
4557
4557
  },
4558
4558
  methods: {
4559
- ajaxLock(a) {
4559
+ setLoading(a) {
4560
4560
  a = a == null ? true : a;
4561
4561
  this.x.loading = a;
4562
4562
  },
@@ -7232,8 +7232,12 @@ var script$C = {
7232
7232
  let hs = this.validHooks;
7233
7233
  for (let q of ques) {
7234
7234
  let rv = typeof q.rule !== 'object' ? q.rule : q.rule.value !== undefined ? q.rule.value : q.rule;
7235
- let e = hs[q.type](v, rv, q);
7236
- if (e) return e
7235
+ if (!q.rule || q.rule.trigger == trigger) {
7236
+ let e = hs[q.type](v, rv, q);
7237
+ if (e && !(e instanceof Promise)) {
7238
+ return e
7239
+ }
7240
+ }
7237
7241
  }
7238
7242
  }
7239
7243
  },
@@ -9858,27 +9862,40 @@ var script$o = {
9858
9862
  this.focus();
9859
9863
  this.$emit('clear', e);
9860
9864
  }
9861
- },
9862
- oninput(e) {
9865
+ },
9866
+ baseInput(e) {
9863
9867
  let v = e.target.value;
9864
9868
  this.val(v);
9865
9869
  this.baseValid('change');
9866
9870
  this.trigger(e, v);
9871
+ },
9872
+ oninput(e) {
9867
9873
  if (this.x.suggest) {
9868
9874
  clearTimeout(this.sug_timer);
9869
- if (v === '') {
9875
+ if (e.target.value === '') {
9876
+ this.baseInput(e);
9870
9877
  this.doSuggest(false);
9878
+ } else if (e.type !== 'input') {
9879
+ e.runType = 'input';
9880
+ this.baseInput(e);
9881
+ this.doSuggest(true);
9871
9882
  } else {
9883
+ let v = e.target.value;
9884
+ this.val(v);
9872
9885
  this.sug_timer = setTimeout(() => {
9886
+ this.trigger(e, v);
9887
+ this.baseValid('change');
9873
9888
  this.doSuggest(true);
9874
9889
  }, 500);
9875
9890
  }
9891
+ } else {
9892
+ this.baseInput(e);
9876
9893
  }
9877
9894
  },
9878
9895
  onfocus(e) {
9879
9896
  this.isFocus = true;
9880
9897
  if (this.x.suggest && !this.showSuggest && e.target.value && !this.sug_completed) {
9881
- this.doSuggest(e.target.value);
9898
+ this.oninput(e);
9882
9899
  }
9883
9900
  if (this.sug_completed) {
9884
9901
  this.sug_completed = false;
@@ -9887,7 +9904,7 @@ var script$o = {
9887
9904
  },
9888
9905
  onclick(e) {
9889
9906
  if (this.x.suggest && !this.showSuggest && e.target.value && !this.sug_completed) {
9890
- this.doSuggest(e.target.value);
9907
+ this.oninput(e);
9891
9908
  }
9892
9909
  },
9893
9910
  doSuggest(a) {