@credithub/harlan-components 1.57.0 → 1.58.1
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/components/dossie/generativeAi/generativeAi.js +0 -3
- package/dist/components/processos-juridicos/processosJuridicos.js +8 -1
- package/dist/components/protestos/protestosList.js +36 -8
- package/dist/consultaSimples.js +0 -2
- package/lib/cjs/index.js +45 -72
- package/lib/esm/index.js +45 -72
- package/package.json +1 -1
|
@@ -150,8 +150,6 @@ var GenerativeAI = function (_a) {
|
|
|
150
150
|
if (newChatQueryData &&
|
|
151
151
|
newChatQueryData.messages !== lastQueryRef.current) {
|
|
152
152
|
lastQueryRef.current = newChatQueryData.messages;
|
|
153
|
-
console.log('Contexto atualizado enviado para a API:', messageHistory);
|
|
154
|
-
console.log('Nova query gerada:', newChatQueryData);
|
|
155
153
|
abortChat();
|
|
156
154
|
setChatQueryData(newChatQueryData);
|
|
157
155
|
setPendingRefetch(true);
|
|
@@ -163,7 +161,6 @@ var GenerativeAI = function (_a) {
|
|
|
163
161
|
chatQueryData &&
|
|
164
162
|
streamMode === 'chat' &&
|
|
165
163
|
!chatLoading) {
|
|
166
|
-
console.log('Disparando refetchChat com payload', chatQueryData);
|
|
167
164
|
refetchChat();
|
|
168
165
|
setPendingRefetch(false);
|
|
169
166
|
}
|
|
@@ -23,7 +23,14 @@ var ProcessosJuridicos = function (_a) {
|
|
|
23
23
|
var _b = useState(false), dataUpdated = _b[0], setDataUpdated = _b[1];
|
|
24
24
|
useEffect(function () {
|
|
25
25
|
var _a;
|
|
26
|
-
if (ctx.type
|
|
26
|
+
if ((ctx.type == RequestStatus.Error || ctx.type == RequestStatus.Empty) && !dataUpdated) {
|
|
27
|
+
setData(function (prevState) { return (__assign(__assign({}, prevState), { processosJuridicosData: {
|
|
28
|
+
empresa: [],
|
|
29
|
+
isLoaded: true
|
|
30
|
+
} })); });
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (ctx.type == RequestStatus.Success && !dataUpdated && ctx.document) {
|
|
27
34
|
var qtyProcessos_1 = (_a = ctx.document.empresa) === null || _a === void 0 ? void 0 : _a.length;
|
|
28
35
|
if (qtyProcessos_1) {
|
|
29
36
|
var processosJuridicosData_1 = {
|
|
@@ -85,12 +85,20 @@ var ThreeDotsLoader = function () {
|
|
|
85
85
|
React.createElement("span", { style: dotStyle(0.2) }),
|
|
86
86
|
React.createElement("span", { style: dotStyle(0.4) })));
|
|
87
87
|
};
|
|
88
|
+
// AI Indicator component with tooltip
|
|
89
|
+
var AIIndicator = function () { return (React.createElement("span", { title: "Informa\u00E7\u00E3o obtida utilizando IA", style: {
|
|
90
|
+
color: '#0066cc',
|
|
91
|
+
marginLeft: '3px',
|
|
92
|
+
fontSize: '0.8em',
|
|
93
|
+
cursor: 'help'
|
|
94
|
+
} }, "*")); };
|
|
88
95
|
export var ProtestoItem = memo(function (_a) {
|
|
89
96
|
var protesto = _a.protesto;
|
|
90
97
|
var client = useContext(WebService);
|
|
91
98
|
var _b = useState(null), quemApresentou = _b[0], setQuemApresentou = _b[1];
|
|
92
99
|
var _c = useState(false), loading = _c[0], setLoading = _c[1];
|
|
93
100
|
var _d = useState(false), queued = _d[0], setQueued = _d[1];
|
|
101
|
+
var _e = useState(false), isAIData = _e[0], setIsAIData = _e[1];
|
|
94
102
|
var getField = function (path, formatter) {
|
|
95
103
|
var value = XPathUtils.select("string(".concat(path, ")"), protesto);
|
|
96
104
|
return formatter ? formatter(value) : value;
|
|
@@ -98,7 +106,7 @@ export var ProtestoItem = memo(function (_a) {
|
|
|
98
106
|
var formatBooleanField = function (value) {
|
|
99
107
|
return value === 'true' ? 'Sim' : 'Não';
|
|
100
108
|
};
|
|
101
|
-
// Function to fetch Quem Apresentou data
|
|
109
|
+
// Function to fetch Quem Apresentou/Protestou data
|
|
102
110
|
var fetchQuemApresentou = function (nm_chave) { return __awaiter(void 0, void 0, void 0, function () {
|
|
103
111
|
var response, error_1;
|
|
104
112
|
return __generator(this, function (_a) {
|
|
@@ -114,13 +122,21 @@ export var ProtestoItem = memo(function (_a) {
|
|
|
114
122
|
case 2: return [4 /*yield*/, (_a.sent()).json()];
|
|
115
123
|
case 3:
|
|
116
124
|
response = _a.sent();
|
|
117
|
-
|
|
118
|
-
|
|
125
|
+
// Check for "Quem Protestou" first, fallback to "Quem Apresentou"
|
|
126
|
+
if (response) {
|
|
127
|
+
if (response['Quem Protestou']) {
|
|
128
|
+
setQuemApresentou(response['Quem Protestou']);
|
|
129
|
+
setIsAIData(true); // Mark that data came from AI
|
|
130
|
+
}
|
|
131
|
+
else if (response['Quem Apresentou']) {
|
|
132
|
+
setQuemApresentou(response['Quem Apresentou']);
|
|
133
|
+
setIsAIData(true); // Mark that data came from AI
|
|
134
|
+
}
|
|
119
135
|
}
|
|
120
136
|
return [3 /*break*/, 6];
|
|
121
137
|
case 4:
|
|
122
138
|
error_1 = _a.sent();
|
|
123
|
-
console.error('Error fetching
|
|
139
|
+
console.error('Error fetching protesto data:', error_1);
|
|
124
140
|
return [3 /*break*/, 6];
|
|
125
141
|
case 5:
|
|
126
142
|
setLoading(false);
|
|
@@ -173,14 +189,26 @@ export var ProtestoItem = memo(function (_a) {
|
|
|
173
189
|
}, []);
|
|
174
190
|
// Get the display value for Quem Protestou field
|
|
175
191
|
var getQuemProtestouDisplay = function () {
|
|
176
|
-
|
|
177
|
-
|
|
192
|
+
// First check if we have original data from the XML
|
|
193
|
+
var originalValue = getField('./nomeCedente');
|
|
194
|
+
// If we have original data, don't show the loader
|
|
195
|
+
if (originalValue && originalValue.trim() !== '') {
|
|
196
|
+
return originalValue;
|
|
197
|
+
}
|
|
198
|
+
// If we have AI data, show it with the indicator
|
|
199
|
+
if (isAIData && quemApresentou) {
|
|
200
|
+
return React.createElement(React.Fragment, null,
|
|
201
|
+
quemApresentou,
|
|
202
|
+
React.createElement(AIIndicator, null));
|
|
203
|
+
}
|
|
204
|
+
// If we're loading or queued and don't have data yet, show loader
|
|
205
|
+
if ((loading || queued) && (!quemApresentou || quemApresentou.trim() === '')) {
|
|
178
206
|
return React.createElement(React.Fragment, null,
|
|
179
|
-
baseValue || '',
|
|
180
207
|
" ",
|
|
181
208
|
React.createElement(ThreeDotsLoader, null));
|
|
182
209
|
}
|
|
183
|
-
|
|
210
|
+
// Fallback to empty string if nothing else applies
|
|
211
|
+
return quemApresentou || '';
|
|
184
212
|
};
|
|
185
213
|
return (React.createElement(ResultContent, { print: "repeat(7, 1fr)", desktop: "repeat(8, 1fr)", tablet: "repeat(4, 1fr)", mobile: "repeat(2, 1fr)" },
|
|
186
214
|
React.createElement(AddItemField, { name: "Quem Protestou", value: getQuemProtestouDisplay() }),
|
package/dist/consultaSimples.js
CHANGED
|
@@ -12,7 +12,6 @@ import { ConsultasComplementaresProvider } from './components/consultasComplemen
|
|
|
12
12
|
import Dominios from './components/dominios/dominios';
|
|
13
13
|
import ConsultaImoveis from './components/imoveis/imoveisService';
|
|
14
14
|
import Liminar from './components/liminar/liminar';
|
|
15
|
-
import ProtestosSP from './components/protestos/protestosSp';
|
|
16
15
|
import ConsultaScore from './components/score/scoreService';
|
|
17
16
|
import ConsultaSCR from './components/scr/scr';
|
|
18
17
|
import { GlobalDataProvider } from './contexts/globalDataContext';
|
|
@@ -57,7 +56,6 @@ var ConsultaSimples = function (_a) {
|
|
|
57
56
|
React.createElement(ConsultaScore, { documento: documento }),
|
|
58
57
|
React.createElement(ConsultaImoveis, { documento: documento }),
|
|
59
58
|
React.createElement(Veiculos, { documento: documento })),
|
|
60
|
-
React.createElement(ProtestosSP, null),
|
|
61
59
|
React.createElement(Protestos, null),
|
|
62
60
|
React.createElement(CCF, null),
|
|
63
61
|
React.createElement(DividasPublicas, null),
|