@credithub/harlan-components 1.11.1 → 1.11.3

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.
@@ -41,7 +41,6 @@ var react_1 = __importStar(require("react"));
41
41
  var addItem_1 = __importDefault(require("../common/addItem"));
42
42
  var contactsLikeDislike_1 = __importDefault(require("./contactsLikeDislike"));
43
43
  var webservice_1 = require("../webservice");
44
- var loading_1 = __importDefault(require("../interface/loading"));
45
44
  var ContactLikeDislikeSection = function (props) {
46
45
  var _a, _b, _c;
47
46
  var _d = (0, react_1.useState)({
@@ -51,10 +50,10 @@ var ContactLikeDislikeSection = function (props) {
51
50
  dislikePressed: false,
52
51
  }), likesDislikes = _d[0], setLikesDislikes = _d[1];
53
52
  var isTelefone = props.type === "Telefone";
54
- var _e = (0, webservice_1.useQuery)("SELECT FROM 'ContactsLikesDislikes'.'".concat(isTelefone ? "Phone" : "Email", "'"), (_a = {},
53
+ var response = (0, webservice_1.useQuery)("SELECT FROM 'ContactsLikesDislikes'.'".concat(isTelefone ? "Phone" : "Email", "'"), (_a = {},
55
54
  _a[isTelefone ? "phone" : "email"] = props.value,
56
55
  _a.document = props.document,
57
- _a)), isLoading = _e.isLoading, response = _e.response;
56
+ _a)).response;
58
57
  var mutateLike = (0, webservice_1.useMutation)("SELECT FROM 'ContactsLikesDislikes'.'Like".concat(isTelefone ? "Phone" : "Email", "'"), (_b = {},
59
58
  _b[isTelefone ? "phone" : "email"] = props.value,
60
59
  _b.document = props.document,
@@ -80,7 +79,7 @@ var ContactLikeDislikeSection = function (props) {
80
79
  });
81
80
  }
82
81
  };
83
- return isLoading ? (react_1.default.createElement(loading_1.default, null)) : (react_1.default.createElement(ContactField, __assign({}, props, { likes: likesDislikes === null || likesDislikes === void 0 ? void 0 : likesDislikes.likes, dislikes: likesDislikes === null || likesDislikes === void 0 ? void 0 : likesDislikes.dislikes, onClickLike: function () { return handleLikeDislike(mutateLike, "likes"); }, onClickDislike: function () { return handleLikeDislike(mutateDislike, "dislikes"); } })));
82
+ return react_1.default.createElement(ContactField, __assign({}, props, { likes: likesDislikes === null || likesDislikes === void 0 ? void 0 : likesDislikes.likes, dislikes: likesDislikes === null || likesDislikes === void 0 ? void 0 : likesDislikes.dislikes, onClickLike: function () { return handleLikeDislike(mutateLike, "likes"); }, onClickDislike: function () { return handleLikeDislike(mutateDislike, "dislikes"); } }));
84
83
  };
85
84
  var ContactField = (0, react_1.memo)(function (contact) {
86
85
  return (react_1.default.createElement(addItem_1.default, { name: contact.type, value: contact.value },
@@ -9,14 +9,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.Result = exports.ResultContent = void 0;
11
11
  var styled_components_1 = __importDefault(require("styled-components"));
12
- var theme_1 = __importDefault(require("./theme"));
13
12
  var responsiveGrid_1 = __importDefault(require("./responsiveGrid"));
14
13
  exports.ResultContent = (0, styled_components_1.default)(responsiveGrid_1.default)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 18px 30px;\n box-sizing: border-box;\n justify-content: space-between;\n flex-wrap: wrap;\n gap: 8px;\n\n > * {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n }\n"], ["\n padding: 18px 30px;\n box-sizing: border-box;\n justify-content: space-between;\n flex-wrap: wrap;\n gap: 8px;\n\n > * {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n }\n"])));
15
- exports.Result = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: ", ";\n flex-direction: column;\n padding: 44px 20px;\n background-color: ", ";\n \n ", " {\n :nth-child(", ") {\n background: ", ";\n border-radius: 30px;\n }\n }\n"], ["\n display: ", ";\n flex-direction: column;\n padding: 44px 20px;\n background-color: ", ";\n \n ", " {\n :nth-child(", ") {\n background: ", ";\n border-radius: 30px;\n }\n }\n"])), function (props) {
14
+ exports.Result = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: ", ";\n flex-direction: column;\n padding: 44px 20px;\n \n ", " {\n :nth-child(", ") {\n background: ", ";\n border-radius: 30px;\n }\n }\n"], ["\n display: ", ";\n flex-direction: column;\n padding: 44px 20px;\n \n ", " {\n :nth-child(", ") {\n background: ", ";\n border-radius: 30px;\n }\n }\n"])), function (props) {
16
15
  var _a;
17
16
  var haveChildren = Array.isArray(props.children) ? (_a = props.children) === null || _a === void 0 ? void 0 : _a.length : props.children;
18
17
  return haveChildren ? 'flex' : 'none';
19
- }, theme_1.default.colors.cinzaBase, exports.ResultContent, function (props) { var _a; return Array.isArray(props.children) && ((_a = props.children) === null || _a === void 0 ? void 0 : _a.length) > 1 ? 'odd' : 'even'; }, function (_a) {
18
+ }, exports.ResultContent, function (props) { var _a; return Array.isArray(props.children) && ((_a = props.children) === null || _a === void 0 ? void 0 : _a.length) > 1 ? 'odd' : 'even'; }, function (_a) {
20
19
  var _b = _a.resultContentStriped, resultContentStriped = _b === void 0 ? true : _b;
21
20
  return resultContentStriped ? '#FFFFFF' : 'transparent';
22
21
  });
@@ -13,7 +13,6 @@ import React, { memo, useEffect, useState } from "react";
13
13
  import AddItemField from "../common/addItem";
14
14
  import ContactsLikeDislike from "./contactsLikeDislike";
15
15
  import { useMutation, useQuery } from "../webservice";
16
- import Loading from "../interface/loading";
17
16
  var ContactLikeDislikeSection = function (props) {
18
17
  var _a, _b, _c;
19
18
  var _d = useState({
@@ -23,10 +22,10 @@ var ContactLikeDislikeSection = function (props) {
23
22
  dislikePressed: false,
24
23
  }), likesDislikes = _d[0], setLikesDislikes = _d[1];
25
24
  var isTelefone = props.type === "Telefone";
26
- var _e = useQuery("SELECT FROM 'ContactsLikesDislikes'.'".concat(isTelefone ? "Phone" : "Email", "'"), (_a = {},
25
+ var response = useQuery("SELECT FROM 'ContactsLikesDislikes'.'".concat(isTelefone ? "Phone" : "Email", "'"), (_a = {},
27
26
  _a[isTelefone ? "phone" : "email"] = props.value,
28
27
  _a.document = props.document,
29
- _a)), isLoading = _e.isLoading, response = _e.response;
28
+ _a)).response;
30
29
  var mutateLike = useMutation("SELECT FROM 'ContactsLikesDislikes'.'Like".concat(isTelefone ? "Phone" : "Email", "'"), (_b = {},
31
30
  _b[isTelefone ? "phone" : "email"] = props.value,
32
31
  _b.document = props.document,
@@ -52,7 +51,7 @@ var ContactLikeDislikeSection = function (props) {
52
51
  });
53
52
  }
54
53
  };
55
- return isLoading ? (React.createElement(Loading, null)) : (React.createElement(ContactField, __assign({}, props, { likes: likesDislikes === null || likesDislikes === void 0 ? void 0 : likesDislikes.likes, dislikes: likesDislikes === null || likesDislikes === void 0 ? void 0 : likesDislikes.dislikes, onClickLike: function () { return handleLikeDislike(mutateLike, "likes"); }, onClickDislike: function () { return handleLikeDislike(mutateDislike, "dislikes"); } })));
54
+ return React.createElement(ContactField, __assign({}, props, { likes: likesDislikes === null || likesDislikes === void 0 ? void 0 : likesDislikes.likes, dislikes: likesDislikes === null || likesDislikes === void 0 ? void 0 : likesDislikes.dislikes, onClickLike: function () { return handleLikeDislike(mutateLike, "likes"); }, onClickDislike: function () { return handleLikeDislike(mutateDislike, "dislikes"); } }));
56
55
  };
57
56
  var ContactField = memo(function (contact) {
58
57
  return (React.createElement(AddItemField, { name: contact.type, value: contact.value },
@@ -3,14 +3,13 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  return cooked;
4
4
  };
5
5
  import styled from "styled-components";
6
- import theme from "./theme";
7
6
  import ResponsiveGrid from "./responsiveGrid";
8
7
  export var ResultContent = styled(ResponsiveGrid)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 18px 30px;\n box-sizing: border-box;\n justify-content: space-between;\n flex-wrap: wrap;\n gap: 8px;\n\n > * {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n }\n"], ["\n padding: 18px 30px;\n box-sizing: border-box;\n justify-content: space-between;\n flex-wrap: wrap;\n gap: 8px;\n\n > * {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n }\n"])));
9
- export var Result = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: ", ";\n flex-direction: column;\n padding: 44px 20px;\n background-color: ", ";\n \n ", " {\n :nth-child(", ") {\n background: ", ";\n border-radius: 30px;\n }\n }\n"], ["\n display: ", ";\n flex-direction: column;\n padding: 44px 20px;\n background-color: ", ";\n \n ", " {\n :nth-child(", ") {\n background: ", ";\n border-radius: 30px;\n }\n }\n"])), function (props) {
8
+ export var Result = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: ", ";\n flex-direction: column;\n padding: 44px 20px;\n \n ", " {\n :nth-child(", ") {\n background: ", ";\n border-radius: 30px;\n }\n }\n"], ["\n display: ", ";\n flex-direction: column;\n padding: 44px 20px;\n \n ", " {\n :nth-child(", ") {\n background: ", ";\n border-radius: 30px;\n }\n }\n"])), function (props) {
10
9
  var _a;
11
10
  var haveChildren = Array.isArray(props.children) ? (_a = props.children) === null || _a === void 0 ? void 0 : _a.length : props.children;
12
11
  return haveChildren ? 'flex' : 'none';
13
- }, theme.colors.cinzaBase, ResultContent, function (props) { var _a; return Array.isArray(props.children) && ((_a = props.children) === null || _a === void 0 ? void 0 : _a.length) > 1 ? 'odd' : 'even'; }, function (_a) {
12
+ }, ResultContent, function (props) { var _a; return Array.isArray(props.children) && ((_a = props.children) === null || _a === void 0 ? void 0 : _a.length) > 1 ? 'odd' : 'even'; }, function (_a) {
14
13
  var _b = _a.resultContentStriped, resultContentStriped = _b === void 0 ? true : _b;
15
14
  return resultContentStriped ? '#FFFFFF' : 'transparent';
16
15
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credithub/harlan-components",
3
- "version": "1.11.1",
3
+ "version": "1.11.3",
4
4
  "description": "Provide a set of web components to be used in Harlan and other projects",
5
5
  "keywords": [
6
6
  "harlan",