@ssplib/react-components 0.0.68 → 0.0.69

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.
@@ -4,8 +4,9 @@ export declare function ToggleVisibility({ invert, ...props }: {
4
4
  unregisterNameList: string[];
5
5
  invert?: boolean;
6
6
  }): JSX.Element;
7
- export declare function SwitchWatch(props: {
7
+ export declare function SwitchWatch({ invert, ...props }: {
8
8
  children: JSX.Element | JSX.Element[];
9
9
  switchId: string;
10
10
  unregisterNameList: string[];
11
+ invert?: boolean;
11
12
  }): JSX.Element;
@@ -37,7 +37,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.SwitchWatch = exports.ToggleVisibility = void 0;
38
38
  const react_1 = __importStar(require("react"));
39
39
  const form_1 = require("../../../context/form");
40
- const lodash_1 = require("lodash");
41
40
  // Coloque esse componente dentro de um bloco que é retirado com o valor do input
42
41
  function ToggleVisibility(_a) {
43
42
  var { invert = false } = _a, props = __rest(_a, ["invert"]);
@@ -52,10 +51,11 @@ function ToggleVisibility(_a) {
52
51
  return react_1.default.createElement(react_1.default.Fragment, null);
53
52
  }
54
53
  exports.ToggleVisibility = ToggleVisibility;
55
- function SwitchWatch(props) {
54
+ function SwitchWatch(_a) {
55
+ var { invert = false } = _a, props = __rest(_a, ["invert"]);
56
56
  const context = (0, react_1.useContext)(form_1.FormContext);
57
- return (react_1.default.createElement(react_1.default.Fragment, null, (context === null || context === void 0 ? void 0 : context.formWatch(props.switchId)) !== lodash_1.invert && (react_1.default.createElement(react_1.default.Fragment, null,
58
- react_1.default.createElement(ToggleVisibility, { switchId: props.switchId, unregisterNameList: props.unregisterNameList }),
57
+ return (react_1.default.createElement(react_1.default.Fragment, null, (context === null || context === void 0 ? void 0 : context.formWatch(props.switchId)) !== invert && (react_1.default.createElement(react_1.default.Fragment, null,
58
+ react_1.default.createElement(ToggleVisibility, { switchId: props.switchId, unregisterNameList: props.unregisterNameList, invert: invert }),
59
59
  props.children))));
60
60
  }
61
61
  exports.SwitchWatch = SwitchWatch;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssplib/react-components",
3
- "version": "0.0.68",
3
+ "version": "0.0.69",
4
4
  "description": "SSP React Components",
5
5
  "main": "index.js",
6
6
  "author": "Pedro Henrique <sr.hudrick@gmail.com>",