@weareconceptstudio/form 0.4.8 → 0.4.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/error-message/index.js"],"names":[],"mappings":";AAGA,+CAuBC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/error-message/index.js"],"names":[],"mappings":";AAGA,+CAwBC"}
@@ -4,10 +4,11 @@ const ErrorMessage = (props) => {
4
4
  const { as, errors, name, message, render, ...rest } = props;
5
5
  const methods = useFormContext();
6
6
  const error = get(errors || methods.formState.errors, name);
7
- if (!error) {
7
+ // If there's no form error but we have an external message, still display it
8
+ if (!error && !message) {
8
9
  return null;
9
10
  }
10
- const { message: messageFromRegister, types } = error;
11
+ const { message: messageFromRegister, types } = error || {};
11
12
  const inlineProps = Object.assign({}, rest, {
12
13
  children: messageFromRegister || message,
13
14
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/error-message/index.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,EAAE;IAC9B,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAC7D,MAAM,OAAO,GAAG,cAAc,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,IAAI,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAE5D,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;I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AC7E,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;IAE5D,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE;QAC3C,QAAQ,EAAE,mBAAmB,IAAI,OAAO;KACxC,CAAC,CAAC;IAEH,OAAO,cAAc,CAAC,EAAE,CAAC;QACxB,CAAC,CAAC,YAAY,CAAC,EAAE,EAAE,WAAW,CAAC;QAC/B,CAAC,CAAC,MAAM;YACP,CAAC,CAAC,MAAM,CAAC;gBACP,OAAO,EAAE,mBAAmB,IAAI,OAAO;gBACvC,QAAQ,EAAE,KAAK;aACf,CAAC;YACH,CAAC,CAAC,aAAa,CAAC,EAAE,IAAI,QAAQ,EAAE,WAAW,CAAC,CAAC;AAChD,CAAC,CAAC;AAEF,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;IAC3C,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAC3C,CAAC;AAED,eAAe,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weareconceptstudio/form",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "description": "Concept Studio Form",
5
5
  "author": "Concept Studio",
6
6
  "license": "ISC",