@credithub/harlan-components 1.103.0 → 1.103.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.
|
@@ -48,7 +48,7 @@ var ConsultaSimplesSection = function (_a) {
|
|
|
48
48
|
var ctx = useContext(Queries.Finder);
|
|
49
49
|
var data = useGlobalData().data;
|
|
50
50
|
var posthog = usePostHog().posthog;
|
|
51
|
-
// Hook para observar mutações no DOM e
|
|
51
|
+
// Hook para observar mutações no DOM e chamar callback quando estável
|
|
52
52
|
var _s = usePrintWhenStable({
|
|
53
53
|
debounceTime: 500,
|
|
54
54
|
maxWaitTime: 30000,
|
|
@@ -56,7 +56,8 @@ var ConsultaSimplesSection = function (_a) {
|
|
|
56
56
|
console.log('ConsultaSimples: Aguardando DOM estabilizar para impressão...');
|
|
57
57
|
},
|
|
58
58
|
onStable: function () {
|
|
59
|
-
console.log('ConsultaSimples: DOM estável,
|
|
59
|
+
console.log('ConsultaSimples: DOM estável, pronto para imprimir');
|
|
60
|
+
// Chama o callback externo (Harlan decide como imprimir)
|
|
60
61
|
onClickPrint === null || onClickPrint === void 0 ? void 0 : onClickPrint();
|
|
61
62
|
}
|
|
62
63
|
}), printWhenStable = _s.printWhenStable, isWaiting = _s.isWaiting;
|
|
@@ -28,8 +28,9 @@ export var usePrintWhenStable = function (options) {
|
|
|
28
28
|
}, []);
|
|
29
29
|
var triggerPrint = useCallback(function () {
|
|
30
30
|
cleanup();
|
|
31
|
+
// Chama o callback informando que o DOM está estável
|
|
32
|
+
// O consumidor (ex: Harlan) decide como imprimir
|
|
31
33
|
onStable === null || onStable === void 0 ? void 0 : onStable();
|
|
32
|
-
window.print();
|
|
33
34
|
}, [cleanup, onStable]);
|
|
34
35
|
var startObserving = useCallback(function () {
|
|
35
36
|
// Limpa observadores anteriores
|