@gustavo-valsechi/client 1.4.202 → 1.4.203

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.
@@ -45,8 +45,7 @@ function CreditCardComponent(props) {
45
45
  const flagRef = (0, import_react.useRef)({});
46
46
  (0, import_react.useEffect)(() => {
47
47
  const content = (0, import_tools.getCardContent)(props.number);
48
- console.log(content);
49
- if (props.onSetFlag) props.onSetFlag(content || { flag: props.flag, logo: props.flagIcon });
48
+ if (props.onSetFlag) props.onSetFlag(content.flag ? content : { flag: props.flag || "", logo: props.flagIcon || "" });
50
49
  if (!flagRef.current) return;
51
50
  if (!content.logo && !props.flagIcon) {
52
51
  flagRef.current.style.backgroundImage = "";
@@ -58,7 +57,7 @@ function CreditCardComponent(props) {
58
57
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "credit-card-left", children: [
59
58
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "credit-card-top", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { id: "credit-card-chip", style: { backgroundImage: `url(${import_assets.default.Chip})` } }) }),
60
59
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "credit-card-bottom", children: [
61
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "credit-card-number", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "credit-card-elipse", children: import_utils.default.mask.loop(props.number || `\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 ${props.lastNumber}`, { sequencyNumber: 4, maxSequency: 4, placeholder: "\u2022" }) }) }),
60
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "credit-card-number", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "credit-card-elipse", children: import_utils.default.mask.loop(props.number, { sequencyNumber: 4, maxSequency: 4, placeholder: "\u2022" }) || `\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 ${props.lastNumber}` }) }),
62
61
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "credit-card-name", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "credit-card-elipse", children: import_lodash.default.deburr((_a = props.cardholder) == null ? void 0 : _a.replace(/[^A-Za-zÀ-ÿ\s]/g, "").toUpperCase()) || "Nome do Titular" }) })
63
62
  ] })
64
63
  ] }),
@@ -12,8 +12,7 @@ function CreditCardComponent(props) {
12
12
  const flagRef = useRef({});
13
13
  useEffect(() => {
14
14
  const content = getCardContent(props.number);
15
- console.log(content);
16
- if (props.onSetFlag) props.onSetFlag(content || { flag: props.flag, logo: props.flagIcon });
15
+ if (props.onSetFlag) props.onSetFlag(content.flag ? content : { flag: props.flag || "", logo: props.flagIcon || "" });
17
16
  if (!flagRef.current) return;
18
17
  if (!content.logo && !props.flagIcon) {
19
18
  flagRef.current.style.backgroundImage = "";
@@ -25,7 +24,7 @@ function CreditCardComponent(props) {
25
24
  /* @__PURE__ */ jsxs("div", { className: "credit-card-left", children: [
26
25
  /* @__PURE__ */ jsx("div", { className: "credit-card-top", children: /* @__PURE__ */ jsx("div", { id: "credit-card-chip", style: { backgroundImage: `url(${assets.Chip})` } }) }),
27
26
  /* @__PURE__ */ jsxs("div", { className: "credit-card-bottom", children: [
28
- /* @__PURE__ */ jsx("div", { className: "credit-card-number", children: /* @__PURE__ */ jsx("div", { className: "credit-card-elipse", children: Utils.mask.loop(props.number || `\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 ${props.lastNumber}`, { sequencyNumber: 4, maxSequency: 4, placeholder: "\u2022" }) }) }),
27
+ /* @__PURE__ */ jsx("div", { className: "credit-card-number", children: /* @__PURE__ */ jsx("div", { className: "credit-card-elipse", children: Utils.mask.loop(props.number, { sequencyNumber: 4, maxSequency: 4, placeholder: "\u2022" }) || `\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 ${props.lastNumber}` }) }),
29
28
  /* @__PURE__ */ jsx("div", { className: "credit-card-name", children: /* @__PURE__ */ jsx("div", { className: "credit-card-elipse", children: _.deburr((_a = props.cardholder) == null ? void 0 : _a.replace(/[^A-Za-zÀ-ÿ\s]/g, "").toUpperCase()) || "Nome do Titular" }) })
30
29
  ] })
31
30
  ] }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.202",
3
+ "version": "1.4.203",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",