componenteshospitais 1.2.4 → 1.2.6

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 CHANGED
@@ -50,19 +50,19 @@ 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, externo = _a.externo;
54
54
  var empresaClass = styles$6["empresa".concat(empresa)];
55
- var handleActionClick = function (parametro) {
56
- if (funcao) {
57
- funcao(parametro);
58
- }
59
- };
60
55
  var handleClick = function () {
61
56
  if (link) {
62
- window.location.href = link;
57
+ if (externo) {
58
+ window.open(link, '_blank');
59
+ }
60
+ else {
61
+ window.location.href = link;
62
+ }
63
63
  }
64
64
  };
65
- return (React.createElement("div", { className: "".concat(empresaClass), onClick: funcao ? function () { return handleActionClick; } : handleClick, style: { cursor: link ? 'pointer' : 'default' } },
65
+ return (React.createElement("div", { className: "".concat(empresaClass), onClick: handleClick, style: { cursor: link ? '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 } }),
@@ -74,12 +74,12 @@ var styles$5 = {"botaoCert":"cardImage-module_botaoCert__Rs0fg","iconeOna":"card
74
74
  styleInject(css_248z$5);
75
75
 
76
76
  var CardImage = function (_a) {
77
- var img = _a.img, href = _a.href, texto = _a.texto, empresa = _a.empresa, largura = _a.largura, altura = _a.altura;
77
+ var img = _a.img, href = _a.href, texto = _a.texto, empresa = _a.empresa, largura = _a.largura, altura = _a.altura, externo = _a.externo;
78
78
  var empresaClass = styles$5["empresa".concat(empresa)];
79
79
  var content = (React.createElement(React.Fragment, null,
80
80
  React.createElement("img", { src: img, alt: img, className: styles$5.iconeOna }),
81
81
  texto && (React.createElement("span", { className: styles$5.cardText, dangerouslySetInnerHTML: { __html: texto } }))));
82
- return (React.createElement("div", { className: "".concat(empresaClass) }, href ? (React.createElement("a", { href: href, target: "_blank", rel: "noopener noreferrer", className: "".concat(styles$5.botaoCert, " empresa").concat(empresa), title: href, style: { width: largura ? "".concat(largura) : '', height: altura ? "".concat(altura) : '' } }, content)) : (React.createElement("div", { className: "".concat(styles$5.botaoCert, " empresa").concat(empresa), style: { width: largura ? "".concat(largura) : '', height: altura ? "".concat(altura) : '' } }, content))));
82
+ return (React.createElement("div", { className: "".concat(empresaClass) }, href ? (React.createElement("a", { href: href, target: externo ? "_blank" : "_self", rel: externo ? "noopener noreferrer" : undefined, className: "".concat(styles$5.botaoCert, " empresa").concat(empresa), title: href, style: { width: largura ? "".concat(largura) : '', height: altura ? "".concat(altura) : '' } }, content)) : (React.createElement("div", { className: "".concat(styles$5.botaoCert, " empresa").concat(empresa), style: { width: largura ? "".concat(largura) : '', height: altura ? "".concat(altura) : '' } }, content))));
83
83
  };
84
84
 
85
85
  var css_248z$4 = ".input-module_inputSubmit__21-Pj{align-self:center;border:none;border-radius:20px;color:#fff;cursor:pointer;font-size:15px;padding:10px;width:10rem}.input-module_inputPadrao__jypjY{border:1px solid #ccc;border-radius:.5rem;font-style:italic;padding:.8rem 0 .8rem 1rem;width:100%}.input-module_inputPadrao__jypjY:focus{outline:none}.input-module_empresa1__bxBov .input-module_inputSubmit__21-Pj{background-color:var(--blue)}.input-module_empresa1__bxBov .input-module_inputSubmit__21-Pj:hover{background-color:var(--red)}.input-module_empresa3__RU89A .input-module_inputSubmit__21-Pj{background-color:var(--green)}.input-module_empresa3__RU89A .input-module_inputSubmit__21-Pj:hover{background-color:var(--lightblue)}";
package/dist/esm/index.js CHANGED
@@ -48,19 +48,19 @@ 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, externo = _a.externo;
52
52
  var empresaClass = styles$6["empresa".concat(empresa)];
53
- var handleActionClick = function (parametro) {
54
- if (funcao) {
55
- funcao(parametro);
56
- }
57
- };
58
53
  var handleClick = function () {
59
54
  if (link) {
60
- window.location.href = link;
55
+ if (externo) {
56
+ window.open(link, '_blank');
57
+ }
58
+ else {
59
+ window.location.href = link;
60
+ }
61
61
  }
62
62
  };
63
- return (React.createElement("div", { className: "".concat(empresaClass), onClick: funcao ? function () { return handleActionClick; } : handleClick, style: { cursor: link ? 'pointer' : 'default' } },
63
+ return (React.createElement("div", { className: "".concat(empresaClass), onClick: handleClick, style: { cursor: link ? '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 } }),
@@ -72,12 +72,12 @@ var styles$5 = {"botaoCert":"cardImage-module_botaoCert__Rs0fg","iconeOna":"card
72
72
  styleInject(css_248z$5);
73
73
 
74
74
  var CardImage = function (_a) {
75
- var img = _a.img, href = _a.href, texto = _a.texto, empresa = _a.empresa, largura = _a.largura, altura = _a.altura;
75
+ var img = _a.img, href = _a.href, texto = _a.texto, empresa = _a.empresa, largura = _a.largura, altura = _a.altura, externo = _a.externo;
76
76
  var empresaClass = styles$5["empresa".concat(empresa)];
77
77
  var content = (React.createElement(React.Fragment, null,
78
78
  React.createElement("img", { src: img, alt: img, className: styles$5.iconeOna }),
79
79
  texto && (React.createElement("span", { className: styles$5.cardText, dangerouslySetInnerHTML: { __html: texto } }))));
80
- return (React.createElement("div", { className: "".concat(empresaClass) }, href ? (React.createElement("a", { href: href, target: "_blank", rel: "noopener noreferrer", className: "".concat(styles$5.botaoCert, " empresa").concat(empresa), title: href, style: { width: largura ? "".concat(largura) : '', height: altura ? "".concat(altura) : '' } }, content)) : (React.createElement("div", { className: "".concat(styles$5.botaoCert, " empresa").concat(empresa), style: { width: largura ? "".concat(largura) : '', height: altura ? "".concat(altura) : '' } }, content))));
80
+ return (React.createElement("div", { className: "".concat(empresaClass) }, href ? (React.createElement("a", { href: href, target: externo ? "_blank" : "_self", rel: externo ? "noopener noreferrer" : undefined, className: "".concat(styles$5.botaoCert, " empresa").concat(empresa), title: href, style: { width: largura ? "".concat(largura) : '', height: altura ? "".concat(altura) : '' } }, content)) : (React.createElement("div", { className: "".concat(styles$5.botaoCert, " empresa").concat(empresa), style: { width: largura ? "".concat(largura) : '', height: altura ? "".concat(altura) : '' } }, content))));
81
81
  };
82
82
 
83
83
  var css_248z$4 = ".input-module_inputSubmit__21-Pj{align-self:center;border:none;border-radius:20px;color:#fff;cursor:pointer;font-size:15px;padding:10px;width:10rem}.input-module_inputPadrao__jypjY{border:1px solid #ccc;border-radius:.5rem;font-style:italic;padding:.8rem 0 .8rem 1rem;width:100%}.input-module_inputPadrao__jypjY:focus{outline:none}.input-module_empresa1__bxBov .input-module_inputSubmit__21-Pj{background-color:var(--blue)}.input-module_empresa1__bxBov .input-module_inputSubmit__21-Pj:hover{background-color:var(--red)}.input-module_empresa3__RU89A .input-module_inputSubmit__21-Pj{background-color:var(--green)}.input-module_empresa3__RU89A .input-module_inputSubmit__21-Pj:hover{background-color:var(--lightblue)}";
@@ -6,8 +6,7 @@ interface CardProps {
6
6
  link?: string;
7
7
  empresa: '1' | '2' | '3';
8
8
  largura?: string;
9
- funcao?: (parametro: string) => void;
10
- parametro?: string;
9
+ externo?: boolean;
11
10
  }
12
11
  declare const Card: React.FC<CardProps>;
13
12
  export default Card;
@@ -6,6 +6,7 @@ interface CardImageProps {
6
6
  empresa: '1' | '2' | '3';
7
7
  largura?: string;
8
8
  altura?: string;
9
+ externo?: boolean;
9
10
  }
10
11
  declare const CardImage: React.FC<CardImageProps>;
11
12
  export default CardImage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "componenteshospitais",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -8,27 +8,24 @@ interface CardProps {
8
8
  link?: string;
9
9
  empresa: '1' | '2' | '3';
10
10
  largura?: string;
11
- funcao?: (parametro: string) => void;
12
- parametro?: string;
11
+ externo?: boolean
13
12
  }
14
13
 
15
- const Card: React.FC<CardProps> = ({ img, imgLateral, text, link, empresa, largura, funcao }) => {
14
+ const Card: React.FC<CardProps> = ({ img, imgLateral, text, link, empresa, largura, externo }) => {
16
15
  const empresaClass = styles[`empresa${empresa}`];
17
16
 
18
- const handleActionClick = (parametro: string) => {
19
- if (funcao) {
20
- funcao(parametro);
21
- }
22
- }
23
-
24
17
  const handleClick = () => {
25
18
  if (link) {
26
- window.location.href = link;
19
+ if (externo) {
20
+ window.open(link, '_blank');
21
+ } else {
22
+ window.location.href = link;
23
+ }
27
24
  }
28
25
  };
29
26
 
30
27
  return (
31
- <div className={`${empresaClass}`} onClick={funcao ? () => handleActionClick : handleClick} style={{ cursor: link ? 'pointer' : 'default' }}>
28
+ <div className={`${empresaClass}`} onClick={handleClick} style={{ cursor: link ? 'pointer' : 'default' }}>
32
29
  <div className={`${styles.item} empresa${empresa}`} style={{width: largura ? `${largura}` : ''}}>
33
30
  { img && (
34
31
  <img src={img} alt={text} className={styles.icone} />
@@ -8,9 +8,10 @@ interface CardImageProps {
8
8
  empresa: '1' | '2' | '3';
9
9
  largura?: string;
10
10
  altura?: string;
11
+ externo?: boolean;
11
12
  }
12
13
 
13
- const CardImage: React.FC<CardImageProps> = ({ img, href, texto, empresa, largura, altura }) => {
14
+ const CardImage: React.FC<CardImageProps> = ({ img, href, texto, empresa, largura, altura, externo }) => {
14
15
  const empresaClass = styles[`empresa${empresa}`];
15
16
 
16
17
  const content = (
@@ -27,8 +28,8 @@ const CardImage: React.FC<CardImageProps> = ({ img, href, texto, empresa, largur
27
28
  {href ? (
28
29
  <a
29
30
  href={href}
30
- target="_blank"
31
- rel="noopener noreferrer"
31
+ target={externo ? "_blank" : "_self"}
32
+ rel={externo ? "noopener noreferrer" : undefined}
32
33
  className={`${styles.botaoCert} empresa${empresa}`}
33
34
  title={href}
34
35
  style={{ width: largura ? `${largura}` : '', height: altura ? `${altura}` : '' }}