@ttn-shared/ui 1.0.4 → 1.2.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.
- package/dist/index.cjs +410 -57
- package/dist/index.css +56 -0
- package/dist/index.d.cts +72 -6
- package/dist/index.d.ts +72 -6
- package/dist/index.js +406 -57
- package/package.json +9 -5
package/dist/index.cjs
CHANGED
|
@@ -30,11 +30,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
+
ChangeAccountModal: () => ChangeAccountModal,
|
|
34
|
+
Header: () => Header,
|
|
35
|
+
HelpModal: () => HelpModal,
|
|
33
36
|
PatientAdministrativeRisks: () => PatientAdministrativeRisks,
|
|
34
37
|
PatientAppointmentHistory: () => PatientAppointmentHistory,
|
|
35
38
|
PatientAssistanceRisks: () => PatientAssistanceRisks,
|
|
36
39
|
PatientForm: () => PatientForm,
|
|
37
40
|
PatientNotes: () => PatientNotes,
|
|
41
|
+
Sidebar: () => Sidebar,
|
|
38
42
|
TTNSharedProvider: () => TTNSharedProvider,
|
|
39
43
|
useTTNSharedContext: () => useTTNSharedContext
|
|
40
44
|
});
|
|
@@ -354,24 +358,24 @@ var PatientVoluntaryInsuranceForm = ({
|
|
|
354
358
|
mode,
|
|
355
359
|
form
|
|
356
360
|
}) => {
|
|
357
|
-
const {
|
|
361
|
+
const { userInfo } = useTTNSharedContext();
|
|
358
362
|
const insuranceInfo = form.values.voluntaryInsurance[index];
|
|
359
363
|
const { data: companyTypes } = useCompanyTypes({
|
|
360
364
|
filters: {
|
|
361
|
-
eaccount:
|
|
365
|
+
eaccount: userInfo.accountId,
|
|
362
366
|
status: "enabled"
|
|
363
367
|
}
|
|
364
368
|
});
|
|
365
369
|
const { data: companyClients } = useCompanyClients({
|
|
366
370
|
filters: {
|
|
367
|
-
eaccount:
|
|
371
|
+
eaccount: userInfo.accountId,
|
|
368
372
|
status: "enabled"
|
|
369
373
|
}
|
|
370
374
|
});
|
|
371
375
|
const { data: contracts } = useContracts({
|
|
372
376
|
enabled: Boolean(insuranceInfo.companyId),
|
|
373
377
|
filters: {
|
|
374
|
-
eaccount:
|
|
378
|
+
eaccount: userInfo.accountId,
|
|
375
379
|
cType: "particular",
|
|
376
380
|
client: Number(insuranceInfo.companyId) || void 0,
|
|
377
381
|
status: "enabled"
|
|
@@ -380,7 +384,7 @@ var PatientVoluntaryInsuranceForm = ({
|
|
|
380
384
|
const { data: contractPopulations } = useContractPopulations({
|
|
381
385
|
enabled: Boolean(insuranceInfo.plan),
|
|
382
386
|
filters: {
|
|
383
|
-
eaccount:
|
|
387
|
+
eaccount: userInfo.accountId,
|
|
384
388
|
contract: Number(insuranceInfo.plan) || void 0,
|
|
385
389
|
status: "enabled"
|
|
386
390
|
}
|
|
@@ -388,7 +392,7 @@ var PatientVoluntaryInsuranceForm = ({
|
|
|
388
392
|
const { data: incomeGroups } = useIncomeGroups({
|
|
389
393
|
enabled: Boolean(insuranceInfo.companyId),
|
|
390
394
|
filters: {
|
|
391
|
-
eaccount:
|
|
395
|
+
eaccount: userInfo.accountId,
|
|
392
396
|
corpclientId: Number(insuranceInfo.companyId) || void 0
|
|
393
397
|
}
|
|
394
398
|
});
|
|
@@ -625,7 +629,7 @@ var PatientNotes = ({
|
|
|
625
629
|
closeOnSave = true,
|
|
626
630
|
onAttemptRemoveNote
|
|
627
631
|
}) => {
|
|
628
|
-
const {
|
|
632
|
+
const { userInfo } = useTTNSharedContext();
|
|
629
633
|
const [comment, setComment] = (0, import_react3.useState)("");
|
|
630
634
|
const { data: notes } = useComments({
|
|
631
635
|
enabled: isOpen && Boolean(patientId),
|
|
@@ -636,7 +640,7 @@ var PatientNotes = ({
|
|
|
636
640
|
const handleAddNote = async () => {
|
|
637
641
|
await createComment2({
|
|
638
642
|
entity: "userClient",
|
|
639
|
-
userId:
|
|
643
|
+
userId: userInfo.id ?? 0,
|
|
640
644
|
comment,
|
|
641
645
|
id: patientId ?? 0
|
|
642
646
|
});
|
|
@@ -685,7 +689,7 @@ var PatientNotes = ({
|
|
|
685
689
|
!notes?.length && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core2.Text, { c: "dimmed", ta: "center", children: "No hay notas disponibles." })
|
|
686
690
|
] }),
|
|
687
691
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core2.Box, { p: "lg", style: { flexShrink: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_core2.Paper, { withBorder: true, p: "md", bg: "brand-color.0", shadow: "none", children: [
|
|
688
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core2.Text, { c: "brand-color", children:
|
|
692
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core2.Text, { c: "brand-color", children: userInfo.name }),
|
|
689
693
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
690
694
|
import_core2.Textarea,
|
|
691
695
|
{
|
|
@@ -779,13 +783,13 @@ var PatientAdministrativeRisks = ({
|
|
|
779
783
|
isOpen,
|
|
780
784
|
onClose
|
|
781
785
|
}) => {
|
|
782
|
-
const {
|
|
786
|
+
const { userInfo } = useTTNSharedContext();
|
|
783
787
|
const [riskValue, setRiskValue] = (0, import_react4.useState)(null);
|
|
784
788
|
const [selectedRisks, setSelectedRisks] = (0, import_react4.useState)([]);
|
|
785
789
|
const { data: patientInfo } = usePatientDetail({
|
|
786
790
|
enabled: Boolean(patientId) && isOpen,
|
|
787
791
|
filters: {
|
|
788
|
-
eaccount:
|
|
792
|
+
eaccount: userInfo.accountId,
|
|
789
793
|
id: patientId
|
|
790
794
|
}
|
|
791
795
|
});
|
|
@@ -798,7 +802,7 @@ var PatientAdministrativeRisks = ({
|
|
|
798
802
|
const { mutateAsync: updateRisks2 } = useUpdateRisks();
|
|
799
803
|
const handleSaveRisks = async () => {
|
|
800
804
|
await updateRisks2({
|
|
801
|
-
eaccount:
|
|
805
|
+
eaccount: userInfo.accountId ?? 0,
|
|
802
806
|
idPatient: patientId ?? 0,
|
|
803
807
|
riskList: {
|
|
804
808
|
administrative: selectedRisks
|
|
@@ -921,13 +925,13 @@ var PatientAssistanceRisks = ({
|
|
|
921
925
|
isOpen,
|
|
922
926
|
onClose
|
|
923
927
|
}) => {
|
|
924
|
-
const {
|
|
928
|
+
const { userInfo } = useTTNSharedContext();
|
|
925
929
|
const [riskValue, setRiskValue] = (0, import_react5.useState)(null);
|
|
926
930
|
const [selectedRisks, setSelectedRisks] = (0, import_react5.useState)([]);
|
|
927
931
|
const { data: patientInfo } = usePatientDetail({
|
|
928
932
|
enabled: Boolean(patientId) && isOpen,
|
|
929
933
|
filters: {
|
|
930
|
-
eaccount:
|
|
934
|
+
eaccount: userInfo.accountId,
|
|
931
935
|
id: patientId
|
|
932
936
|
}
|
|
933
937
|
});
|
|
@@ -951,7 +955,7 @@ var PatientAssistanceRisks = ({
|
|
|
951
955
|
};
|
|
952
956
|
const handleSaveRisks = async () => {
|
|
953
957
|
await updateRisks2({
|
|
954
|
-
eaccount:
|
|
958
|
+
eaccount: userInfo.accountId ?? 0,
|
|
955
959
|
idPatient: patientId ?? 0,
|
|
956
960
|
riskList: {
|
|
957
961
|
assistance: selectedRisks.map((risk) => ({ id: risk.clinicalDiseaseId }))
|
|
@@ -1182,7 +1186,7 @@ function AppPagination(props) {
|
|
|
1182
1186
|
// src/components/PatientAppointmentHistory.tsx
|
|
1183
1187
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1184
1188
|
var PatientAppointmentHistory = ({ patientId }) => {
|
|
1185
|
-
const {
|
|
1189
|
+
const { userInfo } = useTTNSharedContext();
|
|
1186
1190
|
const [currentPage, setCurrentPage] = (0, import_react6.useState)(1);
|
|
1187
1191
|
const [selectedAppointment, setSelectedAppointment] = (0, import_react6.useState)();
|
|
1188
1192
|
const { data: appointments, rowTotal } = useAppointments({
|
|
@@ -1191,7 +1195,7 @@ var PatientAppointmentHistory = ({ patientId }) => {
|
|
|
1191
1195
|
idPatient: patientId,
|
|
1192
1196
|
page: currentPage,
|
|
1193
1197
|
perpage: 10,
|
|
1194
|
-
idAccount:
|
|
1198
|
+
idAccount: userInfo.accountId ?? 0
|
|
1195
1199
|
}
|
|
1196
1200
|
});
|
|
1197
1201
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
@@ -1438,11 +1442,16 @@ var PatientForm = ({
|
|
|
1438
1442
|
defaultMode,
|
|
1439
1443
|
patientId,
|
|
1440
1444
|
policyContent,
|
|
1445
|
+
disabledFields,
|
|
1441
1446
|
onSavePatient,
|
|
1442
1447
|
onSaveError,
|
|
1443
1448
|
onBack
|
|
1444
1449
|
}) => {
|
|
1445
|
-
const {
|
|
1450
|
+
const { userInfo } = useTTNSharedContext();
|
|
1451
|
+
const disabledFieldSet = (0, import_react7.useMemo)(() => new Set(disabledFields ?? []), [disabledFields]);
|
|
1452
|
+
const isFieldDisabled = (field) => disabledFieldSet.has(field);
|
|
1453
|
+
const isMandatoryInsuranceDisabled = isFieldDisabled("mandatoryInsurance");
|
|
1454
|
+
const isVoluntaryInsuranceDisabled = isFieldDisabled("voluntaryInsurance");
|
|
1446
1455
|
const [mode, setMode] = (0, import_react7.useState)(defaultMode);
|
|
1447
1456
|
const [openPatientNotes, setOpenPatientNotes] = (0, import_react7.useState)(false);
|
|
1448
1457
|
const [openPatientAssistanceRisks, setOpenPatientAssistanceRisks] = (0, import_react7.useState)(false);
|
|
@@ -1502,16 +1511,16 @@ var PatientForm = ({
|
|
|
1502
1511
|
const { data: patientInfo, refetch: refetchPatientInfo } = usePatientDetail({
|
|
1503
1512
|
enabled: Boolean(patientId) && mode !== "create",
|
|
1504
1513
|
filters: {
|
|
1505
|
-
eaccount:
|
|
1514
|
+
eaccount: userInfo.accountId,
|
|
1506
1515
|
id: patientId
|
|
1507
1516
|
}
|
|
1508
1517
|
});
|
|
1509
1518
|
const { data: documentTypes } = useDocumentTypes({});
|
|
1510
1519
|
const { data: affiliationTypes } = useAffiliationTypes({
|
|
1511
|
-
filters: { eaccount:
|
|
1520
|
+
filters: { eaccount: userInfo.accountId }
|
|
1512
1521
|
});
|
|
1513
1522
|
const { data: provinces } = useProvinces({
|
|
1514
|
-
filters: { eaccount:
|
|
1523
|
+
filters: { eaccount: userInfo.accountId }
|
|
1515
1524
|
});
|
|
1516
1525
|
const { data: cities } = useCities({
|
|
1517
1526
|
enabled: Boolean(form.values.provinceId),
|
|
@@ -1519,32 +1528,32 @@ var PatientForm = ({
|
|
|
1519
1528
|
});
|
|
1520
1529
|
const { data: stratums } = useStratums({});
|
|
1521
1530
|
const { data: ethnicGroups } = useEthnicGroups({
|
|
1522
|
-
filters: { eaccount:
|
|
1531
|
+
filters: { eaccount: userInfo.accountId }
|
|
1523
1532
|
});
|
|
1524
1533
|
const { data: educationLevels } = useEducationLevels({
|
|
1525
|
-
filters: { eaccount:
|
|
1534
|
+
filters: { eaccount: userInfo.accountId }
|
|
1526
1535
|
});
|
|
1527
1536
|
const { data: companyClients } = useCompanyClients({
|
|
1528
|
-
filters: { eaccount:
|
|
1537
|
+
filters: { eaccount: userInfo.accountId }
|
|
1529
1538
|
});
|
|
1530
1539
|
const { data: contracts } = useContracts({
|
|
1531
1540
|
enabled: Boolean(form.values.mandatoryInsurance.companyId),
|
|
1532
1541
|
filters: {
|
|
1533
|
-
eaccount:
|
|
1542
|
+
eaccount: userInfo.accountId,
|
|
1534
1543
|
client: Number(form.values.mandatoryInsurance.companyId) || void 0
|
|
1535
1544
|
}
|
|
1536
1545
|
});
|
|
1537
1546
|
const { data: contractPopulations } = useContractPopulations({
|
|
1538
1547
|
enabled: Boolean(form.values.mandatoryInsurance.plan),
|
|
1539
1548
|
filters: {
|
|
1540
|
-
eaccount:
|
|
1549
|
+
eaccount: userInfo.accountId,
|
|
1541
1550
|
contract: Number(form.values.mandatoryInsurance.plan) || void 0
|
|
1542
1551
|
}
|
|
1543
1552
|
});
|
|
1544
1553
|
const { data: incomeGroups } = useIncomeGroups({
|
|
1545
1554
|
enabled: Boolean(form.values.mandatoryInsurance.companyId),
|
|
1546
1555
|
filters: {
|
|
1547
|
-
eaccount:
|
|
1556
|
+
eaccount: userInfo.accountId,
|
|
1548
1557
|
corpclientId: Number(form.values.mandatoryInsurance.companyId) || void 0
|
|
1549
1558
|
}
|
|
1550
1559
|
});
|
|
@@ -1582,10 +1591,6 @@ var PatientForm = ({
|
|
|
1582
1591
|
value: values.affiliationTypeId,
|
|
1583
1592
|
message: "El campo Tipo de afiliado es obligatorio."
|
|
1584
1593
|
},
|
|
1585
|
-
{
|
|
1586
|
-
value: values.maritalStatus,
|
|
1587
|
-
message: "El campo Estado civil es obligatorio."
|
|
1588
|
-
},
|
|
1589
1594
|
{
|
|
1590
1595
|
value: values.provinceId,
|
|
1591
1596
|
message: "El campo Departamento es obligatorio."
|
|
@@ -1826,7 +1831,7 @@ var PatientForm = ({
|
|
|
1826
1831
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1827
1832
|
import_core8.Select,
|
|
1828
1833
|
{
|
|
1829
|
-
readOnly: mode === "view",
|
|
1834
|
+
readOnly: mode === "view" || isFieldDisabled("documentTypeId"),
|
|
1830
1835
|
withAsterisk: mode !== "view",
|
|
1831
1836
|
label: "Tipo de Documento",
|
|
1832
1837
|
data: documentTypeOptions,
|
|
@@ -1837,7 +1842,7 @@ var PatientForm = ({
|
|
|
1837
1842
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1838
1843
|
import_core8.TextInput,
|
|
1839
1844
|
{
|
|
1840
|
-
readOnly: mode === "view",
|
|
1845
|
+
readOnly: mode === "view" || isFieldDisabled("documentNumber"),
|
|
1841
1846
|
withAsterisk: mode !== "view",
|
|
1842
1847
|
label: "N\xFAmero de Documento",
|
|
1843
1848
|
...form.getInputProps("documentNumber"),
|
|
@@ -1847,7 +1852,7 @@ var PatientForm = ({
|
|
|
1847
1852
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1848
1853
|
import_core8.TextInput,
|
|
1849
1854
|
{
|
|
1850
|
-
readOnly: mode === "view",
|
|
1855
|
+
readOnly: mode === "view" || isFieldDisabled("firstName"),
|
|
1851
1856
|
withAsterisk: mode !== "view",
|
|
1852
1857
|
label: "Primer Nombre",
|
|
1853
1858
|
...form.getInputProps("firstName"),
|
|
@@ -1857,7 +1862,7 @@ var PatientForm = ({
|
|
|
1857
1862
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1858
1863
|
import_core8.TextInput,
|
|
1859
1864
|
{
|
|
1860
|
-
readOnly: mode === "view",
|
|
1865
|
+
readOnly: mode === "view" || isFieldDisabled("middleName"),
|
|
1861
1866
|
label: "Segundo Nombre",
|
|
1862
1867
|
...form.getInputProps("middleName"),
|
|
1863
1868
|
"data-testid": "patient-form-middle-name-input"
|
|
@@ -1866,7 +1871,7 @@ var PatientForm = ({
|
|
|
1866
1871
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1867
1872
|
import_core8.TextInput,
|
|
1868
1873
|
{
|
|
1869
|
-
readOnly: mode === "view",
|
|
1874
|
+
readOnly: mode === "view" || isFieldDisabled("surname"),
|
|
1870
1875
|
withAsterisk: mode !== "view",
|
|
1871
1876
|
label: "Primer Apellido",
|
|
1872
1877
|
...form.getInputProps("surname"),
|
|
@@ -1876,7 +1881,7 @@ var PatientForm = ({
|
|
|
1876
1881
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1877
1882
|
import_core8.TextInput,
|
|
1878
1883
|
{
|
|
1879
|
-
readOnly: mode === "view",
|
|
1884
|
+
readOnly: mode === "view" || isFieldDisabled("secondSurname"),
|
|
1880
1885
|
label: "Segundo Apellido",
|
|
1881
1886
|
...form.getInputProps("secondSurname"),
|
|
1882
1887
|
"data-testid": "patient-form-second-surname-input"
|
|
@@ -1885,7 +1890,7 @@ var PatientForm = ({
|
|
|
1885
1890
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1886
1891
|
import_core8.TextInput,
|
|
1887
1892
|
{
|
|
1888
|
-
readOnly: mode === "view",
|
|
1893
|
+
readOnly: mode === "view" || isFieldDisabled("birthDate"),
|
|
1889
1894
|
withAsterisk: mode !== "view",
|
|
1890
1895
|
label: "Fecha de Nacimiento",
|
|
1891
1896
|
type: "date",
|
|
@@ -1896,7 +1901,8 @@ var PatientForm = ({
|
|
|
1896
1901
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1897
1902
|
import_core8.NumberInput,
|
|
1898
1903
|
{
|
|
1899
|
-
readOnly:
|
|
1904
|
+
readOnly: isFieldDisabled("age"),
|
|
1905
|
+
disabled: true,
|
|
1900
1906
|
label: "Edad",
|
|
1901
1907
|
suffix: !form.values.age ? "" : " a\xF1os",
|
|
1902
1908
|
...form.getInputProps("age"),
|
|
@@ -1906,7 +1912,7 @@ var PatientForm = ({
|
|
|
1906
1912
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1907
1913
|
import_core8.NumberInput,
|
|
1908
1914
|
{
|
|
1909
|
-
readOnly: mode === "view",
|
|
1915
|
+
readOnly: mode === "view" || isFieldDisabled("whatsapp"),
|
|
1910
1916
|
withAsterisk: mode !== "view",
|
|
1911
1917
|
label: "WhatsApp",
|
|
1912
1918
|
allowNegative: false,
|
|
@@ -1918,7 +1924,7 @@ var PatientForm = ({
|
|
|
1918
1924
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1919
1925
|
import_core8.Select,
|
|
1920
1926
|
{
|
|
1921
|
-
readOnly: mode === "view",
|
|
1927
|
+
readOnly: mode === "view" || isFieldDisabled("gender"),
|
|
1922
1928
|
withAsterisk: mode !== "view",
|
|
1923
1929
|
label: "G\xE9nero",
|
|
1924
1930
|
data: genderOptions,
|
|
@@ -1929,7 +1935,7 @@ var PatientForm = ({
|
|
|
1929
1935
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1930
1936
|
import_core8.Select,
|
|
1931
1937
|
{
|
|
1932
|
-
readOnly: mode === "view",
|
|
1938
|
+
readOnly: mode === "view" || isFieldDisabled("affiliationTypeId"),
|
|
1933
1939
|
withAsterisk: mode !== "view",
|
|
1934
1940
|
label: "Tipo de afiliaci\xF3n",
|
|
1935
1941
|
data: affiliationTypeOptions,
|
|
@@ -1940,7 +1946,7 @@ var PatientForm = ({
|
|
|
1940
1946
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1941
1947
|
import_core8.TextInput,
|
|
1942
1948
|
{
|
|
1943
|
-
readOnly: mode === "view",
|
|
1949
|
+
readOnly: mode === "view" || isFieldDisabled("email"),
|
|
1944
1950
|
label: "Correo electr\xF3nico",
|
|
1945
1951
|
...form.getInputProps("email"),
|
|
1946
1952
|
"data-testid": "patient-form-email-input"
|
|
@@ -1949,8 +1955,7 @@ var PatientForm = ({
|
|
|
1949
1955
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1950
1956
|
import_core8.Select,
|
|
1951
1957
|
{
|
|
1952
|
-
readOnly: mode === "view",
|
|
1953
|
-
withAsterisk: mode !== "view",
|
|
1958
|
+
readOnly: mode === "view" || isFieldDisabled("maritalStatus"),
|
|
1954
1959
|
label: "Estado civil",
|
|
1955
1960
|
data: maritalStatusOptions,
|
|
1956
1961
|
...form.getInputProps("maritalStatus"),
|
|
@@ -1960,7 +1965,7 @@ var PatientForm = ({
|
|
|
1960
1965
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 12, mt: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1961
1966
|
import_core8.Checkbox,
|
|
1962
1967
|
{
|
|
1963
|
-
|
|
1968
|
+
readOnly: mode === "view" || isFieldDisabled("isDataPolicyAccepted"),
|
|
1964
1969
|
label: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core8.Text, { fz: "sm", children: [
|
|
1965
1970
|
"Autorizo el tratamiento de mis datos personales conforme a la",
|
|
1966
1971
|
" ",
|
|
@@ -1989,7 +1994,7 @@ var PatientForm = ({
|
|
|
1989
1994
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1990
1995
|
import_core8.Select,
|
|
1991
1996
|
{
|
|
1992
|
-
readOnly: mode === "view",
|
|
1997
|
+
readOnly: mode === "view" || isFieldDisabled("provinceId"),
|
|
1993
1998
|
withAsterisk: mode !== "view",
|
|
1994
1999
|
label: "Departamento",
|
|
1995
2000
|
data: provinceOptions,
|
|
@@ -2004,7 +2009,7 @@ var PatientForm = ({
|
|
|
2004
2009
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2005
2010
|
import_core8.Select,
|
|
2006
2011
|
{
|
|
2007
|
-
readOnly: mode === "view",
|
|
2012
|
+
readOnly: mode === "view" || isFieldDisabled("cityId"),
|
|
2008
2013
|
withAsterisk: mode !== "view",
|
|
2009
2014
|
label: "Municipio",
|
|
2010
2015
|
data: cityOptions,
|
|
@@ -2015,7 +2020,7 @@ var PatientForm = ({
|
|
|
2015
2020
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2016
2021
|
import_core8.TextInput,
|
|
2017
2022
|
{
|
|
2018
|
-
readOnly: mode === "view",
|
|
2023
|
+
readOnly: mode === "view" || isFieldDisabled("homeAddress"),
|
|
2019
2024
|
label: "Direcci\xF3n",
|
|
2020
2025
|
...form.getInputProps("homeAddress"),
|
|
2021
2026
|
"data-testid": "patient-form-home-address-input"
|
|
@@ -2024,7 +2029,7 @@ var PatientForm = ({
|
|
|
2024
2029
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2025
2030
|
import_core8.Select,
|
|
2026
2031
|
{
|
|
2027
|
-
readOnly: mode === "view",
|
|
2032
|
+
readOnly: mode === "view" || isFieldDisabled("bloodType"),
|
|
2028
2033
|
label: "Grupo sangu\xEDneo",
|
|
2029
2034
|
data: bloodTypeOptions,
|
|
2030
2035
|
...form.getInputProps("bloodType"),
|
|
@@ -2034,7 +2039,7 @@ var PatientForm = ({
|
|
|
2034
2039
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2035
2040
|
import_core8.NumberInput,
|
|
2036
2041
|
{
|
|
2037
|
-
readOnly: mode === "view",
|
|
2042
|
+
readOnly: mode === "view" || isFieldDisabled("cellphone"),
|
|
2038
2043
|
withAsterisk: mode !== "view",
|
|
2039
2044
|
label: "Celular",
|
|
2040
2045
|
allowNegative: false,
|
|
@@ -2047,7 +2052,7 @@ var PatientForm = ({
|
|
|
2047
2052
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2048
2053
|
import_core8.NumberInput,
|
|
2049
2054
|
{
|
|
2050
|
-
readOnly: mode === "view",
|
|
2055
|
+
readOnly: mode === "view" || isFieldDisabled("homephone"),
|
|
2051
2056
|
label: "Tel\xE9fono fijo",
|
|
2052
2057
|
allowNegative: false,
|
|
2053
2058
|
allowDecimal: false,
|
|
@@ -2059,7 +2064,7 @@ var PatientForm = ({
|
|
|
2059
2064
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2060
2065
|
import_core8.Select,
|
|
2061
2066
|
{
|
|
2062
|
-
readOnly: mode === "view",
|
|
2067
|
+
readOnly: mode === "view" || isFieldDisabled("stratumId"),
|
|
2063
2068
|
withAsterisk: mode !== "view",
|
|
2064
2069
|
label: "Estrato",
|
|
2065
2070
|
data: stratumOptions,
|
|
@@ -2070,7 +2075,7 @@ var PatientForm = ({
|
|
|
2070
2075
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2071
2076
|
import_core8.Select,
|
|
2072
2077
|
{
|
|
2073
|
-
readOnly: mode === "view",
|
|
2078
|
+
readOnly: mode === "view" || isFieldDisabled("ethnicGroupId"),
|
|
2074
2079
|
withAsterisk: mode !== "view",
|
|
2075
2080
|
label: "Pertenencia \xE9tnica",
|
|
2076
2081
|
data: ethnicGroupOptions,
|
|
@@ -2081,7 +2086,7 @@ var PatientForm = ({
|
|
|
2081
2086
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2082
2087
|
import_core8.Select,
|
|
2083
2088
|
{
|
|
2084
|
-
readOnly: mode === "view",
|
|
2089
|
+
readOnly: mode === "view" || isFieldDisabled("educationLevelId"),
|
|
2085
2090
|
withAsterisk: mode !== "view",
|
|
2086
2091
|
label: "Nivel educativo",
|
|
2087
2092
|
data: educationLevelOptions,
|
|
@@ -2096,6 +2101,7 @@ var PatientForm = ({
|
|
|
2096
2101
|
import_core8.Select,
|
|
2097
2102
|
{
|
|
2098
2103
|
readOnly: mode === "view",
|
|
2104
|
+
disabled: isMandatoryInsuranceDisabled,
|
|
2099
2105
|
withAsterisk: mode !== "view",
|
|
2100
2106
|
label: "Seguro",
|
|
2101
2107
|
data: companyClientOptions,
|
|
@@ -2114,6 +2120,7 @@ var PatientForm = ({
|
|
|
2114
2120
|
import_core8.Select,
|
|
2115
2121
|
{
|
|
2116
2122
|
readOnly: mode === "view",
|
|
2123
|
+
disabled: isMandatoryInsuranceDisabled,
|
|
2117
2124
|
withAsterisk: mode !== "view",
|
|
2118
2125
|
label: "Plan",
|
|
2119
2126
|
data: contractOptions,
|
|
@@ -2131,6 +2138,7 @@ var PatientForm = ({
|
|
|
2131
2138
|
import_core8.Select,
|
|
2132
2139
|
{
|
|
2133
2140
|
readOnly: mode === "view",
|
|
2141
|
+
disabled: isMandatoryInsuranceDisabled,
|
|
2134
2142
|
withAsterisk: mode !== "view",
|
|
2135
2143
|
label: "Poblaci\xF3n",
|
|
2136
2144
|
data: contractPopulationOptions,
|
|
@@ -2142,6 +2150,7 @@ var PatientForm = ({
|
|
|
2142
2150
|
import_core8.Select,
|
|
2143
2151
|
{
|
|
2144
2152
|
readOnly: mode === "view",
|
|
2153
|
+
disabled: isMandatoryInsuranceDisabled,
|
|
2145
2154
|
withAsterisk: mode !== "view",
|
|
2146
2155
|
label: "Grupo de ingreso",
|
|
2147
2156
|
data: incomeGroupOptions,
|
|
@@ -2152,7 +2161,8 @@ var PatientForm = ({
|
|
|
2152
2161
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2153
2162
|
import_core8.TextInput,
|
|
2154
2163
|
{
|
|
2155
|
-
readOnly: mode === "view",
|
|
2164
|
+
readOnly: mode === "view" || isMandatoryInsuranceDisabled,
|
|
2165
|
+
disabled: isMandatoryInsuranceDisabled,
|
|
2156
2166
|
label: "N\xFAmero de p\xF3liza",
|
|
2157
2167
|
...form.getInputProps("mandatoryInsurance.policyNumber"),
|
|
2158
2168
|
"data-testid": "patient-form-mandatory-insurance-policy-number-input"
|
|
@@ -2165,7 +2175,7 @@ var PatientForm = ({
|
|
|
2165
2175
|
PatientVoluntaryInsuranceForm,
|
|
2166
2176
|
{
|
|
2167
2177
|
index,
|
|
2168
|
-
mode,
|
|
2178
|
+
mode: isVoluntaryInsuranceDisabled ? "view" : mode,
|
|
2169
2179
|
form
|
|
2170
2180
|
},
|
|
2171
2181
|
insurance.id ?? index
|
|
@@ -2176,6 +2186,7 @@ var PatientForm = ({
|
|
|
2176
2186
|
variant: "outline",
|
|
2177
2187
|
color: "secondary",
|
|
2178
2188
|
size: "xs",
|
|
2189
|
+
disabled: isVoluntaryInsuranceDisabled,
|
|
2179
2190
|
onClick: handleAddVoluntaryInsurance,
|
|
2180
2191
|
leftSection: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_icons_react6.IconPlus, { style: { width: 16, height: 16 } }),
|
|
2181
2192
|
"data-testid": "patient-form-add-voluntary-insurance-button",
|
|
@@ -2332,13 +2343,355 @@ var createPatientForm = (info) => {
|
|
|
2332
2343
|
}))
|
|
2333
2344
|
};
|
|
2334
2345
|
};
|
|
2346
|
+
|
|
2347
|
+
// src/components/header/Header.tsx
|
|
2348
|
+
var MC3 = __toESM(require("@mantine/core"), 1);
|
|
2349
|
+
var TI4 = __toESM(require("@tabler/icons-react"), 1);
|
|
2350
|
+
var import_react8 = require("react");
|
|
2351
|
+
|
|
2352
|
+
// src/components/header/HelpModal.tsx
|
|
2353
|
+
var MC = __toESM(require("@mantine/core"), 1);
|
|
2354
|
+
var TI2 = __toESM(require("@tabler/icons-react"), 1);
|
|
2355
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2356
|
+
var HelpModal = ({ opened, onClose, enterpriseLogo }) => {
|
|
2357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(MC.Modal, { title: "Ayuda", opened, onClose, "data-testid": "header-help-modal", children: [
|
|
2358
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(MC.Stack, { mb: "lg", align: "center", children: [
|
|
2359
|
+
enterpriseLogo,
|
|
2360
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MC.Text, { fz: "lg", fw: "bold", children: "Informaci\xF3n de contacto" }),
|
|
2361
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(MC.Stack, { children: [
|
|
2362
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(MC.Group, { children: [
|
|
2363
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MC.ThemeIcon, { variant: "transparent", c: "primary-color", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TI2.IconPhone, { style: { width: 24, height: 24 } }) }),
|
|
2364
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MC.Text, { fz: "xs", children: "+57 300 658 32 65" })
|
|
2365
|
+
] }),
|
|
2366
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(MC.Group, { children: [
|
|
2367
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MC.ThemeIcon, { variant: "transparent", c: "primary-color", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TI2.IconMail, { style: { width: 24, height: 24 } }) }),
|
|
2368
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MC.Text, { fz: "xs", children: "analistadesoporte@ttncompany.com" })
|
|
2369
|
+
] }),
|
|
2370
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(MC.Group, { children: [
|
|
2371
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MC.ThemeIcon, { variant: "transparent", c: "primary-color", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TI2.IconMapPin, { style: { width: 24, height: 24 } }) }),
|
|
2372
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MC.Text, { fz: "xs", children: "Carrera 51b # 87 - 50 Piso 3 Local 337" })
|
|
2373
|
+
] })
|
|
2374
|
+
] })
|
|
2375
|
+
] }),
|
|
2376
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MC.Group, { justify: "end", mt: "xl", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2377
|
+
MC.Button,
|
|
2378
|
+
{
|
|
2379
|
+
onClick: onClose,
|
|
2380
|
+
size: "sm",
|
|
2381
|
+
px: "xl",
|
|
2382
|
+
color: "brand-color",
|
|
2383
|
+
"data-testid": "header-help-accept-button",
|
|
2384
|
+
children: "Aceptar"
|
|
2385
|
+
}
|
|
2386
|
+
) })
|
|
2387
|
+
] });
|
|
2388
|
+
};
|
|
2389
|
+
|
|
2390
|
+
// src/components/header/ChangeAccountModal.tsx
|
|
2391
|
+
var MC2 = __toESM(require("@mantine/core"), 1);
|
|
2392
|
+
var TI3 = __toESM(require("@tabler/icons-react"), 1);
|
|
2393
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2394
|
+
var ChangeAccountModal = ({
|
|
2395
|
+
opened,
|
|
2396
|
+
onClose,
|
|
2397
|
+
accounts,
|
|
2398
|
+
onChangeAccount
|
|
2399
|
+
}) => {
|
|
2400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MC2.Modal, { opened, onClose, size: 1200, title: "Cambiar cuenta", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MC2.Grid, { px: "lg", children: accounts.map((account, accountIndex) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MC2.Grid.Col, { span: 6, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(MC2.Menu, { position: "right", width: 210, children: [
|
|
2401
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MC2.Menu.Target, { "data-testid": `change-account-account-option-${accountIndex}`, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2402
|
+
MC2.Group,
|
|
2403
|
+
{
|
|
2404
|
+
w: 216,
|
|
2405
|
+
h: 100,
|
|
2406
|
+
justify: "space-between",
|
|
2407
|
+
align: "center",
|
|
2408
|
+
style: (theme) => ({
|
|
2409
|
+
border: `1px solid ${theme.colors.gray[3]}`,
|
|
2410
|
+
borderRadius: theme.radius.md,
|
|
2411
|
+
padding: "8px",
|
|
2412
|
+
cursor: "pointer"
|
|
2413
|
+
}),
|
|
2414
|
+
children: [
|
|
2415
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", {}),
|
|
2416
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MC2.Text, { fw: "bold", tt: "uppercase", children: account.name }),
|
|
2417
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MC2.ThemeIcon, { variant: "transparent", c: "dimmed", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TI3.IconChevronRight, { style: { width: 32, height: 32 } }) })
|
|
2418
|
+
]
|
|
2419
|
+
}
|
|
2420
|
+
) }),
|
|
2421
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MC2.Menu.Dropdown, { p: 0, children: account.profiles.map((profile, profileIndex) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2422
|
+
MC2.Menu.Item,
|
|
2423
|
+
{
|
|
2424
|
+
ta: "center",
|
|
2425
|
+
tt: "uppercase",
|
|
2426
|
+
py: "xs",
|
|
2427
|
+
onClick: () => {
|
|
2428
|
+
onChangeAccount(account, profile);
|
|
2429
|
+
onClose();
|
|
2430
|
+
},
|
|
2431
|
+
style: (theme) => ({
|
|
2432
|
+
borderRadius: 0,
|
|
2433
|
+
borderBottom: profileIndex !== account.profiles.length - 1 ? `1px solid ${theme.colors.gray[3]}` : void 0
|
|
2434
|
+
}),
|
|
2435
|
+
"data-testid": `change-account-profile-option-${accountIndex}-${profileIndex}`,
|
|
2436
|
+
children: profile.name
|
|
2437
|
+
},
|
|
2438
|
+
profile.id
|
|
2439
|
+
)) })
|
|
2440
|
+
] }) }, account.id)) }) });
|
|
2441
|
+
};
|
|
2442
|
+
|
|
2443
|
+
// src/components/header/Header.tsx
|
|
2444
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2445
|
+
var Header = ({
|
|
2446
|
+
moduleName,
|
|
2447
|
+
logo,
|
|
2448
|
+
enterpriseLogo,
|
|
2449
|
+
accounts,
|
|
2450
|
+
currentSite,
|
|
2451
|
+
onBackHome,
|
|
2452
|
+
onChangeAccount,
|
|
2453
|
+
onClickMyPayroll,
|
|
2454
|
+
onClickSettings,
|
|
2455
|
+
onLogout
|
|
2456
|
+
}) => {
|
|
2457
|
+
const { userInfo } = useTTNSharedContext();
|
|
2458
|
+
const [changeAccountModalOpened, setChangeAccountModalOpened] = (0, import_react8.useState)(false);
|
|
2459
|
+
const [helpModalOpened, setHelpModalOpened] = (0, import_react8.useState)(false);
|
|
2460
|
+
const { currentAccount, currentProfile } = (0, import_react8.useMemo)(() => {
|
|
2461
|
+
if (!userInfo.accountId || !userInfo.profileId) {
|
|
2462
|
+
return { currentAccount: void 0, currentProfile: void 0 };
|
|
2463
|
+
}
|
|
2464
|
+
const currentAccount2 = accounts.find((account) => account.id === userInfo.accountId);
|
|
2465
|
+
const currentProfile2 = currentAccount2?.profiles.find(
|
|
2466
|
+
(profile) => profile.id === userInfo.profileId
|
|
2467
|
+
);
|
|
2468
|
+
return { currentAccount: currentAccount2, currentProfile: currentProfile2 };
|
|
2469
|
+
}, [accounts, userInfo]);
|
|
2470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
2471
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(MC3.Flex, { w: "100%", px: 16, py: 6, justify: "space-between", align: "center", children: [
|
|
2472
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(MC3.Group, { children: [
|
|
2473
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MC3.UnstyledButton, { onClick: onBackHome, "data-testid": "header-logo-button", children: logo }),
|
|
2474
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(MC3.Title, { order: 3, c: "gray.4", fw: "inherit", children: [
|
|
2475
|
+
"\u2022 ",
|
|
2476
|
+
moduleName
|
|
2477
|
+
] })
|
|
2478
|
+
] }),
|
|
2479
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(MC3.Flex, { gap: "sm", children: [
|
|
2480
|
+
Boolean(currentSite) && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(MC3.Flex, { align: "center", children: [
|
|
2481
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MC3.ThemeIcon, { variant: "transparent", c: "dimmed", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TI4.IconMapPinFilled, { style: { width: 24, height: 24 } }) }),
|
|
2482
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MC3.Text, { c: "gray.6", fz: "sm", children: currentSite?.name })
|
|
2483
|
+
] }),
|
|
2484
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(MC3.Menu, { width: 216, position: "bottom-end", children: [
|
|
2485
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MC3.Menu.Target, { "data-testid": "header-account-menu-button", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2486
|
+
MC3.Box,
|
|
2487
|
+
{
|
|
2488
|
+
w: 216,
|
|
2489
|
+
style: (theme) => ({
|
|
2490
|
+
display: "flex",
|
|
2491
|
+
alignItems: "center",
|
|
2492
|
+
border: `1px solid ${theme.colors.gray[3]}`,
|
|
2493
|
+
borderRadius: theme.radius.sm,
|
|
2494
|
+
padding: "4px 8px",
|
|
2495
|
+
cursor: "pointer"
|
|
2496
|
+
}),
|
|
2497
|
+
children: [
|
|
2498
|
+
Boolean(currentAccount) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MC3.ThemeIcon, { variant: "transparent", c: "primary-color", size: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TI4.IconBuilding, { style: { width: 24, height: 24 } }) }),
|
|
2499
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MC3.Text, { ml: 6, flex: 1, children: currentAccount?.name }),
|
|
2500
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MC3.Avatar, { src: userInfo?.imageUrl })
|
|
2501
|
+
]
|
|
2502
|
+
}
|
|
2503
|
+
) }),
|
|
2504
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(MC3.Menu.Dropdown, { children: [
|
|
2505
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(MC3.Stack, { px: "md", py: "sm", gap: "xs", align: "center", children: [
|
|
2506
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MC3.Avatar, { src: userInfo?.imageUrl, size: "lg" }),
|
|
2507
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MC3.Text, { fw: "bold", children: userInfo?.name }),
|
|
2508
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(MC3.Text, { fw: "bold", ta: "center", c: "gray.4", children: [
|
|
2509
|
+
currentAccount?.name,
|
|
2510
|
+
" - ",
|
|
2511
|
+
currentProfile?.name
|
|
2512
|
+
] })
|
|
2513
|
+
] }),
|
|
2514
|
+
Boolean(currentAccount) && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
2515
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2516
|
+
MC3.Menu.Item,
|
|
2517
|
+
{
|
|
2518
|
+
onClick: () => setChangeAccountModalOpened(true),
|
|
2519
|
+
"data-testid": "header-change-account-menu-item",
|
|
2520
|
+
children: "Cambiar rol y cuenta"
|
|
2521
|
+
}
|
|
2522
|
+
),
|
|
2523
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2524
|
+
MC3.Menu.Item,
|
|
2525
|
+
{
|
|
2526
|
+
onClick: onClickMyPayroll,
|
|
2527
|
+
"data-testid": "header-my-payroll-menu-item",
|
|
2528
|
+
children: "Mi n\xF3mina"
|
|
2529
|
+
}
|
|
2530
|
+
),
|
|
2531
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MC3.Menu.Item, { onClick: onClickSettings, "data-testid": "header-settings-menu-item", children: "Configuraci\xF3n" })
|
|
2532
|
+
] }),
|
|
2533
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2534
|
+
MC3.Menu.Item,
|
|
2535
|
+
{
|
|
2536
|
+
onClick: () => setHelpModalOpened(true),
|
|
2537
|
+
"data-testid": "header-help-menu-item",
|
|
2538
|
+
children: "Ayuda"
|
|
2539
|
+
}
|
|
2540
|
+
),
|
|
2541
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MC3.Menu.Divider, {}),
|
|
2542
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(MC3.Menu.Item, { onClick: onLogout, "data-testid": "header-logout-menu-item", children: "Cerrar sesi\xF3n" })
|
|
2543
|
+
] })
|
|
2544
|
+
] })
|
|
2545
|
+
] })
|
|
2546
|
+
] }),
|
|
2547
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2548
|
+
ChangeAccountModal,
|
|
2549
|
+
{
|
|
2550
|
+
opened: changeAccountModalOpened,
|
|
2551
|
+
onClose: () => setChangeAccountModalOpened(false),
|
|
2552
|
+
accounts,
|
|
2553
|
+
onChangeAccount
|
|
2554
|
+
}
|
|
2555
|
+
),
|
|
2556
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2557
|
+
HelpModal,
|
|
2558
|
+
{
|
|
2559
|
+
opened: helpModalOpened,
|
|
2560
|
+
onClose: () => setHelpModalOpened(false),
|
|
2561
|
+
enterpriseLogo
|
|
2562
|
+
}
|
|
2563
|
+
)
|
|
2564
|
+
] });
|
|
2565
|
+
};
|
|
2566
|
+
|
|
2567
|
+
// src/components/sidebar/Sidebar.tsx
|
|
2568
|
+
var import_react9 = require("react");
|
|
2569
|
+
var MC5 = __toESM(require("@mantine/core"), 1);
|
|
2570
|
+
var TI5 = __toESM(require("@tabler/icons-react"), 1);
|
|
2571
|
+
|
|
2572
|
+
// src/components/sidebar/SidebarMenu.tsx
|
|
2573
|
+
var MC4 = __toESM(require("@mantine/core"), 1);
|
|
2574
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2575
|
+
var import_react_router = require("react-router");
|
|
2576
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2577
|
+
var SidebarMenu = ({
|
|
2578
|
+
id,
|
|
2579
|
+
label,
|
|
2580
|
+
icon,
|
|
2581
|
+
active,
|
|
2582
|
+
screens,
|
|
2583
|
+
onClickMenu,
|
|
2584
|
+
onCloseSidebar,
|
|
2585
|
+
onClickExternalScreen
|
|
2586
|
+
}) => {
|
|
2587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
2588
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2589
|
+
MC4.UnstyledButton,
|
|
2590
|
+
{
|
|
2591
|
+
onClick: () => onClickMenu(id),
|
|
2592
|
+
className: "ttn-sidebar-menu",
|
|
2593
|
+
"data-testid": `sidebar-menu-${label}`,
|
|
2594
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(MC4.Flex, { align: "center", children: [
|
|
2595
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MC4.Center, { w: 40, h: 40, me: 10, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2596
|
+
MC4.Box,
|
|
2597
|
+
{
|
|
2598
|
+
className: "ttn-sidebar-menu-icon",
|
|
2599
|
+
style: { maskImage: `url(${icon})`, WebkitMaskImage: `url(${icon})` }
|
|
2600
|
+
}
|
|
2601
|
+
) }),
|
|
2602
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MC4.Text, { size: "sm", c: "gray.7", lineClamp: 1, children: label })
|
|
2603
|
+
] })
|
|
2604
|
+
}
|
|
2605
|
+
),
|
|
2606
|
+
Boolean(screens?.length) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MC4.Collapse, { in: active ?? false, children: screens?.map((screen) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
2607
|
+
screen.external && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MC4.Box, { onClick: () => onClickExternalScreen(screen), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MC4.Text, { size: "sm", c: "gray.7", lineClamp: 1, children: screen.label }) }),
|
|
2608
|
+
!screen.external && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2609
|
+
import_react_router.NavLink,
|
|
2610
|
+
{
|
|
2611
|
+
to: screen.url || "#",
|
|
2612
|
+
onClick: onCloseSidebar,
|
|
2613
|
+
className: ({ isActive }) => isActive ? "ttn-sidebar-menu-item active" : "ttn-sidebar-menu-item",
|
|
2614
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(MC4.Text, { size: "sm", c: "gray.7", lineClamp: 1, children: screen.label })
|
|
2615
|
+
}
|
|
2616
|
+
)
|
|
2617
|
+
] }, screen.id)) })
|
|
2618
|
+
] });
|
|
2619
|
+
};
|
|
2620
|
+
|
|
2621
|
+
// src/components/sidebar/Sidebar.tsx
|
|
2622
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2623
|
+
var Sidebar = ({ modules, onClickExternalScreen }) => {
|
|
2624
|
+
const [opened, setOpened] = (0, import_react9.useState)(false);
|
|
2625
|
+
const [activeModuleId, setActiveModuleId] = (0, import_react9.useState)(null);
|
|
2626
|
+
const handleClickMenu = (id) => {
|
|
2627
|
+
setActiveModuleId(id === activeModuleId ? null : id);
|
|
2628
|
+
if (!opened) {
|
|
2629
|
+
setOpened(true);
|
|
2630
|
+
}
|
|
2631
|
+
};
|
|
2632
|
+
const handleCloseSidebar = () => {
|
|
2633
|
+
setActiveModuleId(null);
|
|
2634
|
+
setOpened(false);
|
|
2635
|
+
};
|
|
2636
|
+
const handleClickExternalScreen = (item) => {
|
|
2637
|
+
setActiveModuleId(null);
|
|
2638
|
+
setOpened(false);
|
|
2639
|
+
onClickExternalScreen(item);
|
|
2640
|
+
};
|
|
2641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("aside", { className: opened ? "ttn-sidebar" : "ttn-sidebar closed", children: [
|
|
2642
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(MC5.Flex, { direction: "column", justify: "center", h: 56, children: [
|
|
2643
|
+
opened && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2644
|
+
MC5.ActionIcon,
|
|
2645
|
+
{
|
|
2646
|
+
variant: "white",
|
|
2647
|
+
c: "gray.6",
|
|
2648
|
+
onClick: handleCloseSidebar,
|
|
2649
|
+
style: { alignSelf: "flex-end" },
|
|
2650
|
+
"data-testid": "sidebar-close-button",
|
|
2651
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TI5.IconX, { style: { width: 20, height: 20 } })
|
|
2652
|
+
}
|
|
2653
|
+
),
|
|
2654
|
+
!opened && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MC5.Center, { w: 80, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2655
|
+
MC5.ActionIcon,
|
|
2656
|
+
{
|
|
2657
|
+
w: 32,
|
|
2658
|
+
h: 32,
|
|
2659
|
+
variant: "outline",
|
|
2660
|
+
radius: "xs",
|
|
2661
|
+
onClick: () => setOpened(true),
|
|
2662
|
+
style: { alignSelf: "flex-end", borderWidth: 2 },
|
|
2663
|
+
"data-testid": "sidebar-open-button",
|
|
2664
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TI5.IconMenu2, { style: { width: 20, height: 20, strokeWidth: 2 } })
|
|
2665
|
+
}
|
|
2666
|
+
) })
|
|
2667
|
+
] }),
|
|
2668
|
+
modules.map((module2) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2669
|
+
SidebarMenu,
|
|
2670
|
+
{
|
|
2671
|
+
id: module2.id,
|
|
2672
|
+
label: module2.label,
|
|
2673
|
+
icon: module2.icon,
|
|
2674
|
+
active: activeModuleId === module2.id,
|
|
2675
|
+
screens: module2.screens,
|
|
2676
|
+
onClickMenu: handleClickMenu,
|
|
2677
|
+
onCloseSidebar: handleCloseSidebar,
|
|
2678
|
+
onClickExternalScreen: handleClickExternalScreen
|
|
2679
|
+
},
|
|
2680
|
+
module2.id
|
|
2681
|
+
))
|
|
2682
|
+
] });
|
|
2683
|
+
};
|
|
2335
2684
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2336
2685
|
0 && (module.exports = {
|
|
2686
|
+
ChangeAccountModal,
|
|
2687
|
+
Header,
|
|
2688
|
+
HelpModal,
|
|
2337
2689
|
PatientAdministrativeRisks,
|
|
2338
2690
|
PatientAppointmentHistory,
|
|
2339
2691
|
PatientAssistanceRisks,
|
|
2340
2692
|
PatientForm,
|
|
2341
2693
|
PatientNotes,
|
|
2694
|
+
Sidebar,
|
|
2342
2695
|
TTNSharedProvider,
|
|
2343
2696
|
useTTNSharedContext
|
|
2344
2697
|
});
|