componenteshospitais 1.2.4 → 1.2.5
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/cjs/index.js +4 -4
- package/dist/esm/index.js +4 -4
- package/package.json +1 -1
- package/src/components/Card.tsx +6 -4
package/dist/cjs/index.js
CHANGED
|
@@ -50,10 +50,10 @@ var styles$6 = {"icone":"card-module_icone__8F-jV","item":"card-module_item__YYE
|
|
|
50
50
|
styleInject(css_248z$6);
|
|
51
51
|
|
|
52
52
|
var Card = function (_a) {
|
|
53
|
-
var img = _a.img, imgLateral = _a.imgLateral, text = _a.text, link = _a.link, empresa = _a.empresa, largura = _a.largura, funcao = _a.funcao;
|
|
53
|
+
var img = _a.img, imgLateral = _a.imgLateral, text = _a.text, link = _a.link, empresa = _a.empresa, largura = _a.largura, funcao = _a.funcao, parametro = _a.parametro;
|
|
54
54
|
var empresaClass = styles$6["empresa".concat(empresa)];
|
|
55
|
-
var handleActionClick = function (
|
|
56
|
-
if (funcao) {
|
|
55
|
+
var handleActionClick = function () {
|
|
56
|
+
if (funcao && parametro) {
|
|
57
57
|
funcao(parametro);
|
|
58
58
|
}
|
|
59
59
|
};
|
|
@@ -62,7 +62,7 @@ var Card = function (_a) {
|
|
|
62
62
|
window.location.href = link;
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
|
-
return (React.createElement("div", { className: "".concat(empresaClass), onClick:
|
|
65
|
+
return (React.createElement("div", { className: "".concat(empresaClass), onClick: link ? handleClick : handleActionClick, style: { cursor: link || (funcao && parametro) ? 'pointer' : 'default' } },
|
|
66
66
|
React.createElement("div", { className: "".concat(styles$6.item, " empresa").concat(empresa), style: { width: largura ? "".concat(largura) : '' } },
|
|
67
67
|
img && (React.createElement("img", { src: img, alt: text, className: styles$6.icone })),
|
|
68
68
|
React.createElement("span", { className: styles$6.texto, dangerouslySetInnerHTML: { __html: text } }),
|
package/dist/esm/index.js
CHANGED
|
@@ -48,10 +48,10 @@ var styles$6 = {"icone":"card-module_icone__8F-jV","item":"card-module_item__YYE
|
|
|
48
48
|
styleInject(css_248z$6);
|
|
49
49
|
|
|
50
50
|
var Card = function (_a) {
|
|
51
|
-
var img = _a.img, imgLateral = _a.imgLateral, text = _a.text, link = _a.link, empresa = _a.empresa, largura = _a.largura, funcao = _a.funcao;
|
|
51
|
+
var img = _a.img, imgLateral = _a.imgLateral, text = _a.text, link = _a.link, empresa = _a.empresa, largura = _a.largura, funcao = _a.funcao, parametro = _a.parametro;
|
|
52
52
|
var empresaClass = styles$6["empresa".concat(empresa)];
|
|
53
|
-
var handleActionClick = function (
|
|
54
|
-
if (funcao) {
|
|
53
|
+
var handleActionClick = function () {
|
|
54
|
+
if (funcao && parametro) {
|
|
55
55
|
funcao(parametro);
|
|
56
56
|
}
|
|
57
57
|
};
|
|
@@ -60,7 +60,7 @@ var Card = function (_a) {
|
|
|
60
60
|
window.location.href = link;
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
return (React.createElement("div", { className: "".concat(empresaClass), onClick:
|
|
63
|
+
return (React.createElement("div", { className: "".concat(empresaClass), onClick: link ? handleClick : handleActionClick, style: { cursor: link || (funcao && parametro) ? 'pointer' : 'default' } },
|
|
64
64
|
React.createElement("div", { className: "".concat(styles$6.item, " empresa").concat(empresa), style: { width: largura ? "".concat(largura) : '' } },
|
|
65
65
|
img && (React.createElement("img", { src: img, alt: text, className: styles$6.icone })),
|
|
66
66
|
React.createElement("span", { className: styles$6.texto, dangerouslySetInnerHTML: { __html: text } }),
|
package/package.json
CHANGED
package/src/components/Card.tsx
CHANGED
|
@@ -12,11 +12,11 @@ interface CardProps {
|
|
|
12
12
|
parametro?: string;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const Card: React.FC<CardProps> = ({ img, imgLateral, text, link, empresa, largura, funcao }) => {
|
|
15
|
+
const Card: React.FC<CardProps> = ({ img, imgLateral, text, link, empresa, largura, funcao, parametro }) => {
|
|
16
16
|
const empresaClass = styles[`empresa${empresa}`];
|
|
17
17
|
|
|
18
|
-
const handleActionClick = (
|
|
19
|
-
if (funcao) {
|
|
18
|
+
const handleActionClick = () => {
|
|
19
|
+
if (funcao && parametro) {
|
|
20
20
|
funcao(parametro);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -28,7 +28,9 @@ const Card: React.FC<CardProps> = ({ img, imgLateral, text, link, empresa, largu
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
|
-
<div className={`${empresaClass}`}
|
|
31
|
+
<div className={`${empresaClass}`}
|
|
32
|
+
onClick={link ? handleClick : handleActionClick}
|
|
33
|
+
style={{ cursor: link || (funcao && parametro) ? 'pointer' : 'default' }}>
|
|
32
34
|
<div className={`${styles.item} empresa${empresa}`} style={{width: largura ? `${largura}` : ''}}>
|
|
33
35
|
{ img && (
|
|
34
36
|
<img src={img} alt={text} className={styles.icone} />
|