dfish-widget 1.0.35 → 1.0.36

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
@@ -6048,6 +6048,21 @@ var script$A = {
6048
6048
  }
6049
6049
  }
6050
6050
  },
6051
+ getValidErrorSync(trigger, val) {
6052
+ let ques = trigger ? this.validTriggers[trigger] : this.validQueues;
6053
+ if (ques && (this.isNormal || (this.isReadonly && this.x.readonlyValidate))) {
6054
+ let v = val !== undefined ? val : this.isPlural ? this.groupFormVal() : this.formVal();
6055
+ if (typeof v !== 'string')
6056
+ v = Array.isArray(v) ? v.join(',') : v == null ? '' : ('' + v);
6057
+ v = v.trim();
6058
+ let hs = this.validHooks;
6059
+ for (let q of ques) {
6060
+ let rv = typeof q.rule !== 'object' ? q.rule : q.rule.value !== undefined ? q.rule.value : q.rule;
6061
+ let e = hs[q.type](v, rv, q);
6062
+ if (e) return e
6063
+ }
6064
+ }
6065
+ },
6051
6066
  formErr(que, arg) {
6052
6067
  let label = this.getLabelText();
6053
6068
  let type = que.type;
@@ -9871,8 +9886,9 @@ var script$b = {
9871
9886
  }
9872
9887
  this.x.format && this.doFormat();
9873
9888
  },
9889
+ // #fixme: 暂时用getValidErrorSync
9874
9890
  isUsableVal(v) {
9875
- return !this.getValidError(null, v)
9891
+ return !this.getValidErrorSync(null, v)
9876
9892
  },
9877
9893
  isFocusTarget(el) { // implement
9878
9894
  return (this.$refs.buttonMinus && this.$refs.buttonMinus.contains(el)) || (this.$refs.buttonPlus && this.$refs.buttonPlus.contains(el))