@circle-vibe/shared 1.1.15 → 1.1.16

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.
@@ -27,9 +27,10 @@ exports.FormControlError = void 0;
27
27
  const react_1 = __importStar(require("react"));
28
28
  const form_error_1 = require("../form-error/form-error");
29
29
  const field_context_1 = require("../field-context/field-context");
30
- const FormControlError = ({ children }) => {
30
+ const utils_1 = require("src/utils");
31
+ const FormControlError = () => {
31
32
  const { errors } = (0, react_1.useContext)(field_context_1.FieldContext);
32
- return react_1.default.createElement(form_error_1.FormError, null, errors ? children : null);
33
+ return react_1.default.createElement(form_error_1.FormError, null, errors ? (0, utils_1.getFormikFormControlError)(errors) : null);
33
34
  };
34
35
  exports.FormControlError = FormControlError;
35
36
  //# sourceMappingURL=form-control-error.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-control-error.js","sourceRoot":"","sources":["../../../../../src/components/form/form-control-error/form-control-error.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAA0C;AAG1C,yDAAqD;AACrD,kEAA8D;AAEvD,MAAM,gBAAgB,GAAqC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACjF,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kBAAU,EAAC,4BAAY,CAAC,CAAC;IAE5C,OAAO,8BAAC,sBAAS,QAAG,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAc,CAAA;AAC5D,CAAC,CAAA;AAJY,QAAA,gBAAgB,oBAI5B"}
1
+ {"version":3,"file":"form-control-error.js","sourceRoot":"","sources":["../../../../../src/components/form/form-control-error/form-control-error.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAA0C;AAG1C,yDAAqD;AACrD,kEAA8D;AAC9D,qCAAsD;AAE/C,MAAM,gBAAgB,GAAqC,GAAG,EAAE;IACrE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kBAAU,EAAC,4BAAY,CAAC,CAAC;IAE5C,OAAO,8BAAC,sBAAS,QAAG,MAAM,CAAC,CAAC,CAAC,IAAA,iCAAyB,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAc,CAAA;AACrF,CAAC,CAAA;AAJY,QAAA,gBAAgB,oBAI5B"}
@@ -0,0 +1,7 @@
1
+ type Message = [string, any];
2
+ interface Validation {
3
+ key: string;
4
+ values?: Record<string, unknown>;
5
+ }
6
+ export declare const getFormikFormControlError: (validation?: Validation | string | null) => Message;
7
+ export {};
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFormikFormControlError = void 0;
4
+ const getFormikFormControlError = (validation) => {
5
+ if (typeof validation === 'string' || !validation) {
6
+ return [validation ?? '', undefined];
7
+ }
8
+ if (validation.key && validation.values) {
9
+ return [validation.key, validation.values];
10
+ }
11
+ return Object.values(validation).map(exports.getFormikFormControlError)[0] || ['', undefined];
12
+ };
13
+ exports.getFormikFormControlError = getFormikFormControlError;
14
+ //# sourceMappingURL=get-formik-form-control-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-formik-form-control-error.js","sourceRoot":"","sources":["../../../../src/utils/get-formik-form-control-error/get-formik-form-control-error.ts"],"names":[],"mappings":";;;AAQO,MAAM,yBAAyB,GAAG,CAAC,UAAuC,EAAW,EAAE;IAC5F,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,UAAU,EAAE;QACjD,OAAO,CAAC,UAAU,IAAI,EAAE,EAAE,SAAS,CAAC,CAAC;KACtC;IAED,IAAI,UAAU,CAAC,GAAG,IAAI,UAAU,CAAC,MAAM,EAAE;QACvC,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;KAC5C;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,iCAAyB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;AACxF,CAAC,CAAC;AAVW,QAAA,yBAAyB,6BAUpC"}
@@ -0,0 +1 @@
1
+ export * from './get-formik-form-control-error';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./get-formik-form-control-error"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/get-formik-form-control-error/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD"}
@@ -1,2 +1,3 @@
1
1
  export * from './get-formik-form-control-value';
2
2
  export * from './is-formik-field-required';
3
+ export * from './get-formik-form-control-error';
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./get-formik-form-control-value"), exports);
18
18
  __exportStar(require("./is-formik-field-required"), exports);
19
+ __exportStar(require("./get-formik-form-control-error"), exports);
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD;AAChD,6DAA2C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAgD;AAChD,6DAA2C;AAC3C,kEAAgD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@circle-vibe/shared",
3
- "version": "1.1.15",
3
+ "version": "1.1.16",
4
4
  "types": "./build/index.d.ts",
5
5
  "description": "Shared componenets, utils, hooks",
6
6
  "scripts": {