@credithub/harlan-components 1.99.0 → 1.100.0

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.
@@ -3,5 +3,6 @@ import { SectionProps } from '../interface/section';
3
3
  declare const ConsultaSimplesSection: React.FC<SectionProps & {
4
4
  documento: string;
5
5
  isFinancial: boolean;
6
+ ctime?: string;
6
7
  }>;
7
8
  export default ConsultaSimplesSection;
@@ -25,7 +25,6 @@ var __rest = (this && this.__rest) || function (s, e) {
25
25
  return t;
26
26
  };
27
27
  import ConsultaSimplesIcon from '../../assets/icones/consultaSimples';
28
- import Tooltip from '../../components/common/tooltip';
29
28
  import { useGlobalData } from '../../contexts/globalDataContext';
30
29
  import { usePostHog } from '../../contexts/PostHogContext';
31
30
  import theme from '../../styles/theme';
@@ -44,7 +43,7 @@ var spin = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObjec
44
43
  var Spinner = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-left-color: #222;\n border-radius: 50%;\n width: 9px;\n height: 9px;\n animation: ", " 1s linear infinite;\n margin-right: 8px;\n display: inline-block;\n vertical-align: middle;\n"], ["\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-left-color: #222;\n border-radius: 50%;\n width: 9px;\n height: 9px;\n animation: ", " 1s linear infinite;\n margin-right: 8px;\n display: inline-block;\n vertical-align: middle;\n"])), spin);
45
44
  var ConsultaSimplesSection = function (_a) {
46
45
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
47
- var documento = _a.documento, children = _a.children, onClose = _a.onClose, isFinancial = _a.isFinancial, rest = __rest(_a, ["documento", "children", "onClose", "isFinancial"]);
46
+ var documento = _a.documento, children = _a.children, onClose = _a.onClose, isFinancial = _a.isFinancial, ctime = _a.ctime, rest = __rest(_a, ["documento", "children", "onClose", "isFinancial", "ctime"]);
48
47
  var ctx = useContext(Queries.Finder);
49
48
  var data = useGlobalData().data;
50
49
  var posthog = usePostHog().posthog;
@@ -60,7 +59,8 @@ var ConsultaSimplesSection = function (_a) {
60
59
  var found = Object.keys(obj).find(function (k) { return k.toLowerCase() === key.toLowerCase(); });
61
60
  return found ? String(obj[found]).trim() : undefined;
62
61
  };
63
- var ctimeStr = getCI(ctx === null || ctx === void 0 ? void 0 : ctx.urlData, 'CTIME');
62
+ // prioriza CTIME vindo por prop; fallback para o urlData do Finder
63
+ var ctimeStr = ctime !== null && ctime !== void 0 ? ctime : getCI(ctx === null || ctx === void 0 ? void 0 : ctx.urlData, 'CTIME');
64
64
  // Parser simples para ISO e epoch (s/ms)
65
65
  var parseCTIME = function (v) {
66
66
  if (!v)
@@ -83,14 +83,6 @@ var ConsultaSimplesSection = function (_a) {
83
83
  : dataSource === 'cache'
84
84
  ? 'cache'
85
85
  : '';
86
- // Conteúdos dos tooltips: linguagem clara para usuário final
87
- var referenceTooltip = (React.createElement(React.Fragment, null,
88
- React.createElement("strong", null, "Data de refer\u00EAncia"),
89
- ":",
90
- ' ',
91
- format(displayDate, "dd/MM/yyyy 'às' HH:mm"),
92
- React.createElement("br", null),
93
- "Este \u00E9 o retrato da situa\u00E7\u00E3o nesse momento. Para ver a posi\u00E7\u00E3o mais recente, refa\u00E7a a consulta sem data fixa."));
94
86
  // Cria um array com cada tag de pendência, seu texto e sua flag de carregamento
95
87
  var makeItem = function (label, loaded, text, error) { return ({
96
88
  label: label,
@@ -142,13 +134,11 @@ var ConsultaSimplesSection = function (_a) {
142
134
  });
143
135
  }, [posthog, pendencias]);
144
136
  return (React.createElement(Section, __assign({ title: "Consulta Simples", subtitle: "Consulta de informa\u00E7\u00F5es do documento.", description: React.createElement(React.Fragment, null,
145
- React.createElement(StatusMessage, null,
146
- format(displayDate, "dd/MM/yyyy 'às' HH:mm"),
147
- ctimeDate ? (React.createElement(React.Fragment, null,
148
- ' ',
149
- React.createElement(Tooltip, { content: referenceTooltip, placement: "left", float: true, icon: React.createElement(WarningCircle, { weight: "fill", size: 20, color: ctimeDate
150
- ? theme.colors.cinzaEscuro
151
- : theme.colors.cinzaEscuro, "aria-label": "Data de refer\u00EAncia" }) }))) : null),
137
+ ctimeDate ? (React.createElement(StatusMessage, { type: "warning" },
138
+ React.createElement(WarningCircle, { weight: "fill", size: 18, color: theme.colors.cinzaEscuro, style: { marginRight: 6, verticalAlign: 'text-bottom' } }),
139
+ "Informa\u00E7\u00F5es referem-se a",
140
+ ' ',
141
+ format(displayDate, "dd/MM/yyyy 'às' HH:mm"))) : (React.createElement(StatusMessage, null, format(displayDate, "dd/MM/yyyy 'às' HH:mm"))),
152
142
  React.createElement(StatusMessage, { type: "found" }, formatDocument(documento)),
153
143
  isError && (ctx === null || ctx === void 0 ? void 0 : ctx.error) && (React.createElement(StatusMessage, { type: statusType }, ctx.error.message)),
154
144
  pendencias.map(function (item) {
@@ -59,8 +59,11 @@ var HasCreditsVerification = function (_a) {
59
59
  ".")));
60
60
  };
61
61
  var ConsultaSimples = function (_a) {
62
- var _documento = _a.documento, onClickConsultarProcessoJuridico = _a.onClickConsultarProcessoJuridico, onClickQSA = _a.onClickQSA, onClickPrint = _a.onClickPrint, apiKey = _a.apiKey, queryParams = _a.queryParams, onClose = _a.onClose, hasCredits = _a.hasCredits, _b = _a.initRefinBoaVista, initRefinBoaVista = _b === void 0 ? false : _b, _c = _a.initRefinSerasa, initRefinSerasa = _c === void 0 ? false : _c, _d = _a.initVeiculos, initVeiculos = _d === void 0 ? false : _d, _e = _a.printMode, printMode = _e === void 0 ? false : _e, _f = _a.isFinancial, isFinancial = _f === void 0 ? false : _f, _g = _a.tags, tags = _g === void 0 ? [] : _g, posthog = _a.posthog;
62
+ var _b, _c, _d;
63
+ var _documento = _a.documento, onClickConsultarProcessoJuridico = _a.onClickConsultarProcessoJuridico, onClickQSA = _a.onClickQSA, onClickPrint = _a.onClickPrint, apiKey = _a.apiKey, queryParams = _a.queryParams, onClose = _a.onClose, hasCredits = _a.hasCredits, _e = _a.initRefinBoaVista, initRefinBoaVista = _e === void 0 ? false : _e, _f = _a.initRefinSerasa, initRefinSerasa = _f === void 0 ? false : _f, _g = _a.initVeiculos, initVeiculos = _g === void 0 ? false : _g, _h = _a.printMode, printMode = _h === void 0 ? false : _h, _j = _a.isFinancial, isFinancial = _j === void 0 ? false : _j, _k = _a.tags, tags = _k === void 0 ? [] : _k, posthog = _a.posthog;
63
64
  var documento = _documento.replace(/\D+/g, '');
65
+ // extrai CTIME (case-insensitive) dos urlData para repassar como prop
66
+ var ctimeProp = (_c = (_b = queryParams === null || queryParams === void 0 ? void 0 : queryParams.urlData) === null || _b === void 0 ? void 0 : _b.CTIME) !== null && _c !== void 0 ? _c : (_d = queryParams === null || queryParams === void 0 ? void 0 : queryParams.urlData) === null || _d === void 0 ? void 0 : _d.ctime;
64
67
  return (React.createElement(ThemeProvider, { theme: theme },
65
68
  React.createElement(ErrorModalProvider, null,
66
69
  React.createElement(PostHogProvider, { posthog: posthog },
@@ -75,7 +78,7 @@ var ConsultaSimples = function (_a) {
75
78
  React.createElement(Queries.LiminarCenprot.Request, { data: { documento: documento } },
76
79
  React.createElement(Wrapper, null,
77
80
  React.createElement(GlobalDataProvider, null,
78
- React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose, onClickPrint: onClickPrint, isFinancial: isFinancial },
81
+ React.createElement(ConsultaSimplesSection, { documento: documento, onClose: onClose, onClickPrint: onClickPrint, isFinancial: isFinancial, ctime: ctimeProp },
79
82
  React.createElement(ConsultaRfbProvider, { documento: documento },
80
83
  React.createElement(Dossie, { documento: documento, printMode: printMode, isFinancial: isFinancial }),
81
84
  React.createElement(Liminar, { isFinancial: isFinancial, hasCredits: hasCredits, tags: tags }),