@opencitylabs/formio-custom-components 0.7.2 → 0.7.4

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/dist/index.js CHANGED
@@ -7902,10 +7902,11 @@ var cr = t.Components.components.field, lr = ({ component: e, current: t, onChan
7902
7902
  }, dr = {
7903
7903
  type: "select",
7904
7904
  input: !0,
7905
+ multiple: !0,
7905
7906
  key: "resetValueOn",
7906
7907
  label: "Reset Value On",
7907
7908
  weight: 25,
7908
- tooltip: "Reset the value of this field when the selected field changes.",
7909
+ tooltip: "Reset the value of this field when any of the selected fields changes.",
7909
7910
  dataSrc: "custom",
7910
7911
  valueProperty: "value",
7911
7912
  data: { custom(e) {
@@ -7924,19 +7925,14 @@ var cr = t.Components.components.field, lr = ({ component: e, current: t, onChan
7924
7925
  function fr(e) {
7925
7926
  return class extends e {
7926
7927
  static schema(...t) {
7927
- return e.schema({ resetValueOn: "" }, ...t);
7928
- }
7929
- attach(e) {
7930
- this._resetValueOnReady = !1;
7931
- let t = super.attach(e);
7932
- return setTimeout(() => {
7933
- this._resetValueOnReady = !0;
7934
- }, 0), t;
7928
+ return e.schema({ resetValueOn: [] }, ...t);
7935
7929
  }
7936
7930
  checkRefreshOn(e, t = {}) {
7937
7931
  super.checkRefreshOn(e, t);
7938
7932
  let { resetValueOn: n } = this.component;
7939
- !n || !e?.length || this._resetValueOnReady && e.some((e) => n === "data" ? !0 : e.instance?.path === n || e.path === n) && this.setValue(this.emptyValue);
7933
+ if (!n || !e?.length || this.root?.pristine !== !1) return;
7934
+ let r = Array.isArray(n) ? n : [n];
7935
+ r.length && e.some((e) => r.some((t) => t === "data" ? !0 : e.instance?.path === t || e.path === t)) && this.setValue(this.emptyValue);
7940
7936
  }
7941
7937
  };
7942
7938
  }