@credithub/harlan-components 1.66.0 → 1.67.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.
@@ -24,8 +24,10 @@ var __rest = (this && this.__rest) || function (s, e) {
24
24
  }
25
25
  return t;
26
26
  };
27
+ import { useGlobalData } from '../../contexts/globalDataContext';
27
28
  import { sortProcessosByDate } from '../../utils/sortProcessosByDate';
28
- import React, { memo } from 'react';
29
+ import { WarningCircle } from 'phosphor-react';
30
+ import React, { memo, useEffect, useState } from 'react';
29
31
  import styled from 'styled-components';
30
32
  import AddItem from '../common/addItem';
31
33
  import Button from '../common/button';
@@ -35,15 +37,22 @@ var AddProcessoJuridicoField = function (_a) {
35
37
  var value = _a.value, props = __rest(_a, ["value"]);
36
38
  return (React.createElement(AddItem, __assign({}, props, { value: value || 'Não Informado' })));
37
39
  };
38
- var ProcessoJuridicoWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n @media (min-width: 1000px) {\n flex-direction: row;\n }\n"], ["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n @media (min-width: 1000px) {\n flex-direction: row;\n }\n"])));
40
+ var ProcessoJuridicoWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n scroll-margin-top: 100px;\n\n @media (min-width: 1000px) {\n flex-direction: row;\n }\n"], ["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n scroll-margin-top: 100px;\n\n @media (min-width: 1000px) {\n flex-direction: row;\n }\n"])));
39
41
  var ConsultarProcessoBtn = styled(Button)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n @media (min-width: 1000px) {\n width: 100%;\n max-width: 150px;\n height: max-content;\n }\n"], ["\n @media (min-width: 1000px) {\n width: 100%;\n max-width: 150px;\n height: max-content;\n }\n"])));
40
42
  var ResultWrapper = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 100%;\n"], ["\n width: 100%;\n"])));
43
+ var CNJWithIcon = styled.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 8px;\n"], ["\n display: flex;\n align-items: center;\n gap: 8px;\n"])));
41
44
  var ProcessoJuridicoItem = memo(function (_a) {
42
- var processo = _a.processo, children = _a.children;
43
- return (React.createElement(ProcessoJuridicoWrapper, { id: processo.id },
45
+ var _b, _c, _d;
46
+ var processo = _a.processo, children = _a.children, highlighted = _a.highlighted;
47
+ var global = useGlobalData().data;
48
+ var hasLiminar = ((_b = global === null || global === void 0 ? void 0 : global.liminar) === null || _b === void 0 ? void 0 : _b.message) === 'Encontrado' &&
49
+ ((_d = (_c = global === null || global === void 0 ? void 0 : global.processosJuridicosData) === null || _c === void 0 ? void 0 : _c.empresa) === null || _d === void 0 ? void 0 : _d.some(function (p) { return p.id === processo.id; }));
50
+ return (React.createElement(ProcessoJuridicoWrapper, { id: processo.id, className: highlighted ? 'highlighted-process' : '' },
44
51
  React.createElement(ResultWrapper, null,
45
52
  React.createElement(ResultContent, { fullWidth: true, desktop: "1.5fr 1.5fr repeat(3, 1fr)", tablet: "repeat(3, 1fr)" },
46
- React.createElement(AddProcessoJuridicoField, { name: "N\u00FAmero CNJ", value: processo.numero_novo }),
53
+ React.createElement(AddProcessoJuridicoField, { name: "N\u00FAmero CNJ", value: hasLiminar ? (React.createElement(CNJWithIcon, null,
54
+ React.createElement(WarningCircle, { size: 18, weight: "fill", style: { color: '#FFA500' } }),
55
+ React.createElement("span", null, processo.numero_novo))) : (processo.numero_novo) }),
47
56
  React.createElement(AddProcessoJuridicoField, { name: "Assunto(s)", value: processo.assuntos }),
48
57
  React.createElement(AddProcessoJuridicoField, { name: "Classe Processual", value: processo.classe_processual }),
49
58
  React.createElement(AddProcessoJuridicoField, { name: "Sigla do Di\u00E1rio", value: processo.diario_sigla }),
@@ -51,18 +60,31 @@ var ProcessoJuridicoItem = memo(function (_a) {
51
60
  React.createElement(EnvolvidosList, { envolvidos: processo === null || processo === void 0 ? void 0 : processo.envolvidos_ultima_movimentacao })),
52
61
  children));
53
62
  });
54
- var ResultList = styled(Result)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n > div {\n padding: 16px 0px;\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n }\n"], ["\n > div {\n padding: 16px 0px;\n :not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n }\n"])), function (_a) {
63
+ var ResultList = styled(Result)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n > div {\n padding: 16px 0px;\n\n &:not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n }\n"], ["\n > div {\n padding: 16px 0px;\n\n &:not(:last-child) {\n border-bottom: 1px solid ", ";\n }\n }\n"])), function (_a) {
55
64
  var theme = _a.theme;
56
65
  return theme.colors.cinzaClaro;
57
66
  });
58
67
  var ProcessosJuridicosList = function (_a) {
59
68
  var processos = _a.processos, onClickConsultarProcessoJuridico = _a.onClickConsultarProcessoJuridico;
60
69
  var sortedProcessos = sortProcessosByDate(processos);
70
+ var _b = useState(null), highlightedId = _b[0], setHighlightedId = _b[1];
71
+ useEffect(function () {
72
+ var _a;
73
+ var hash = (_a = window.location.hash) === null || _a === void 0 ? void 0 : _a.replace('#', '');
74
+ if (hash) {
75
+ var el = document.getElementById(hash);
76
+ if (el) {
77
+ el.scrollIntoView({ behavior: 'smooth', block: 'start' });
78
+ setHighlightedId(hash);
79
+ setTimeout(function () { return setHighlightedId(null); }, 3000);
80
+ }
81
+ }
82
+ }, []);
61
83
  return (React.createElement(ResultList, { resultContentStriped: false }, sortedProcessos.map(function (processo, i) { return (React.createElement("div", { key: i },
62
- React.createElement(ProcessoJuridicoItem, { processo: processo },
84
+ React.createElement(ProcessoJuridicoItem, { processo: processo, highlighted: highlightedId === processo.id },
63
85
  React.createElement(ConsultarProcessoBtn, { onClick: onClickConsultarProcessoJuridico
64
86
  ? function () { return onClickConsultarProcessoJuridico(processo.id); }
65
87
  : undefined, smallContent: "R$ 1" }, "Consultar Processo")))); })));
66
88
  };
67
89
  export default ProcessosJuridicosList;
68
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
90
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
@@ -4,6 +4,6 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
4
4
  };
5
5
  import { createGlobalStyle, css } from 'styled-components';
6
6
  var OpenSansFont = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n @import url('https://fonts.googleapis.com/css?family=Open%20Sans%20Condensed:300,400,500,600,700');\n"], ["\n @import url('https://fonts.googleapis.com/css?family=Open%20Sans%20Condensed:300,400,500,600,700');\n"])));
7
- var GlobalStyle = createGlobalStyle(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n * {\n ", "\n font-family: 'Open Sans Condensed';\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n\n body {\n -webkit-font-smoothing: antialiased;\n }\n\n @media print {\n button,\n [class*=\"Button\"],\n [class^=\"Button\"],\n [class*=\"btn\"],\n [class^=\"btn\"],\n .button,\n .btn {\n display: none !important;\n }\n }\n"], ["\n * {\n ", "\n font-family: 'Open Sans Condensed';\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n\n body {\n -webkit-font-smoothing: antialiased;\n }\n\n @media print {\n button,\n [class*=\"Button\"],\n [class^=\"Button\"],\n [class*=\"btn\"],\n [class^=\"btn\"],\n .button,\n .btn {\n display: none !important;\n }\n }\n"])), OpenSansFont);
7
+ var GlobalStyle = createGlobalStyle(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n * {\n ", "\n font-family: 'Open Sans Condensed';\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n\n body {\n -webkit-font-smoothing: antialiased;\n }\n\n @media print {\n button,\n [class*=\"Button\"],\n [class^=\"Button\"],\n [class*=\"btn\"],\n [class^=\"btn\"],\n .button,\n .btn {\n display: none !important;\n }\n }\n\n @keyframes highlight {\n from {\n background-color: rgba(255, 215, 0, 0.35);\n }\n to {\n background-color: transparent;\n }\n }\n\n .highlighted-process {\n animation: highlight 3s ease-out forwards !important;\n }\n"], ["\n * {\n ", "\n font-family: 'Open Sans Condensed';\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n\n body {\n -webkit-font-smoothing: antialiased;\n }\n\n @media print {\n button,\n [class*=\"Button\"],\n [class^=\"Button\"],\n [class*=\"btn\"],\n [class^=\"btn\"],\n .button,\n .btn {\n display: none !important;\n }\n }\n\n @keyframes highlight {\n from {\n background-color: rgba(255, 215, 0, 0.35);\n }\n to {\n background-color: transparent;\n }\n }\n\n .highlighted-process {\n animation: highlight 3s ease-out forwards !important;\n }\n"])), OpenSansFont);
8
8
  export default GlobalStyle;
9
9
  var templateObject_1, templateObject_2;