@ttn-shared/ui 1.0.3 → 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 +455 -101
- package/dist/index.css +56 -0
- package/dist/index.d.cts +90 -24
- package/dist/index.d.ts +90 -24
- package/dist/index.js +451 -101
- package/package.json +13 -9
package/dist/index.css
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* src/components/sidebar/sidebar.css */
|
|
2
|
+
.ttn-sidebar {
|
|
3
|
+
width: 335px;
|
|
4
|
+
height: 100%;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
padding-right: 20px;
|
|
8
|
+
box-shadow: 10px 0px 20px rgba(0, 0, 0, 0.06);
|
|
9
|
+
overflow-x: hidden;
|
|
10
|
+
overflow-y: auto;
|
|
11
|
+
transition: width 0.3s ease;
|
|
12
|
+
&.closed {
|
|
13
|
+
width: 80px;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
.ttn-sidebar-menu {
|
|
18
|
+
width: 100%;
|
|
19
|
+
min-height: 56px;
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
padding: 8px 10px 8px 20px !important;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
}
|
|
25
|
+
.ttn-sidebar-menu-icon {
|
|
26
|
+
width: 24px;
|
|
27
|
+
height: 24px;
|
|
28
|
+
background-color: var(--mantine-color-gray-6);
|
|
29
|
+
mask-repeat: no-repeat;
|
|
30
|
+
mask-size: contain;
|
|
31
|
+
mask-position: center;
|
|
32
|
+
-webkit-mask-repeat: no-repeat;
|
|
33
|
+
-webkit-mask-size: contain;
|
|
34
|
+
-webkit-mask-position: center;
|
|
35
|
+
&.active,
|
|
36
|
+
&:hover {
|
|
37
|
+
background-color: var(--mantine-primary-color-9);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
.ttn-sidebar-menu-item {
|
|
41
|
+
display: block;
|
|
42
|
+
font-size: 16px;
|
|
43
|
+
color: inherit;
|
|
44
|
+
text-decoration: none;
|
|
45
|
+
text-transform: uppercase;
|
|
46
|
+
padding: 5px 0 5px 10px;
|
|
47
|
+
margin-left: 70px;
|
|
48
|
+
border-left: 3px solid transparent;
|
|
49
|
+
white-space: nowrap;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
&.active,
|
|
52
|
+
&:hover {
|
|
53
|
+
border-color: var(--mantine-primary-color-9);
|
|
54
|
+
color: var(--mantine-primary-color-9);
|
|
55
|
+
}
|
|
56
|
+
}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { ReactNode, FC, PropsWithChildren } from 'react';
|
|
3
3
|
|
|
4
4
|
interface SelectOption {
|
|
5
5
|
id: number;
|
|
@@ -8,7 +8,7 @@ interface SelectOption {
|
|
|
8
8
|
|
|
9
9
|
type PatientFormMode = "create" | "edit" | "view";
|
|
10
10
|
interface PatientFormValues {
|
|
11
|
-
documentTypeId: string;
|
|
11
|
+
documentTypeId: string | null;
|
|
12
12
|
documentNumber: string;
|
|
13
13
|
firstName: string;
|
|
14
14
|
middleName: string;
|
|
@@ -17,14 +17,14 @@ interface PatientFormValues {
|
|
|
17
17
|
birthDate: string;
|
|
18
18
|
age: string;
|
|
19
19
|
whatsapp: number | string;
|
|
20
|
-
gender: string;
|
|
21
|
-
affiliationTypeId: string;
|
|
20
|
+
gender: string | null;
|
|
21
|
+
affiliationTypeId: string | null;
|
|
22
22
|
email: string;
|
|
23
|
-
maritalStatus: string;
|
|
24
|
-
provinceId: string;
|
|
25
|
-
cityId: string;
|
|
23
|
+
maritalStatus: string | null;
|
|
24
|
+
provinceId: string | null;
|
|
25
|
+
cityId: string | null;
|
|
26
26
|
homeAddress: string;
|
|
27
|
-
bloodType: string;
|
|
27
|
+
bloodType: string | null;
|
|
28
28
|
neighborhood: string;
|
|
29
29
|
cellphone: number | string;
|
|
30
30
|
homephone: number | string;
|
|
@@ -33,24 +33,24 @@ interface PatientFormValues {
|
|
|
33
33
|
use_glasses: string;
|
|
34
34
|
use_contact_lens: string;
|
|
35
35
|
isDataPolicyAccepted: boolean;
|
|
36
|
-
stratumId: string;
|
|
37
|
-
educationLevelId: string;
|
|
38
|
-
ethnicGroupId: string;
|
|
36
|
+
stratumId: string | null;
|
|
37
|
+
educationLevelId: string | null;
|
|
38
|
+
ethnicGroupId: string | null;
|
|
39
39
|
mandatoryInsurance: {
|
|
40
|
-
companyId: string;
|
|
41
|
-
plan: string;
|
|
42
|
-
population: string;
|
|
43
|
-
groupId: string;
|
|
40
|
+
companyId: string | null;
|
|
41
|
+
plan: string | null;
|
|
42
|
+
population: string | null;
|
|
43
|
+
groupId: string | null;
|
|
44
44
|
policyNumber: string;
|
|
45
45
|
};
|
|
46
46
|
voluntaryInsurance: {
|
|
47
47
|
id: string;
|
|
48
48
|
companyTypeTag: string;
|
|
49
49
|
companyType: string;
|
|
50
|
-
companyId: string;
|
|
51
|
-
plan: string;
|
|
52
|
-
population: string;
|
|
53
|
-
groupId: string;
|
|
50
|
+
companyId: string | null;
|
|
51
|
+
plan: string | null;
|
|
52
|
+
population: string | null;
|
|
53
|
+
groupId: string | null;
|
|
54
54
|
policyNumber: string;
|
|
55
55
|
}[];
|
|
56
56
|
}
|
|
@@ -188,11 +188,12 @@ interface PatientFormProps {
|
|
|
188
188
|
defaultMode: PatientFormMode;
|
|
189
189
|
patientId?: number;
|
|
190
190
|
policyContent?: string;
|
|
191
|
+
disabledFields?: (keyof PatientFormValues)[];
|
|
191
192
|
onSavePatient?: (payload: PatientPayload, mode: PatientFormMode) => void;
|
|
192
193
|
onSaveError?: (error: string) => void;
|
|
193
194
|
onBack?: () => void;
|
|
194
195
|
}
|
|
195
|
-
declare const PatientForm: ({ defaultMode, patientId, policyContent, onSavePatient, onSaveError, onBack, }: PatientFormProps) => react_jsx_runtime.JSX.Element;
|
|
196
|
+
declare const PatientForm: ({ defaultMode, patientId, policyContent, disabledFields, onSavePatient, onSaveError, onBack, }: PatientFormProps) => react_jsx_runtime.JSX.Element;
|
|
196
197
|
|
|
197
198
|
interface Comment {
|
|
198
199
|
id: number;
|
|
@@ -236,12 +237,77 @@ interface PatientAppointmentHistoryProps {
|
|
|
236
237
|
}
|
|
237
238
|
declare const PatientAppointmentHistory: ({ patientId }: PatientAppointmentHistoryProps) => react_jsx_runtime.JSX.Element;
|
|
238
239
|
|
|
240
|
+
interface UserAccountProfile {
|
|
241
|
+
id: number;
|
|
242
|
+
name: string;
|
|
243
|
+
}
|
|
244
|
+
interface UserAccount {
|
|
245
|
+
id: number;
|
|
246
|
+
name: string;
|
|
247
|
+
profiles: UserAccountProfile[];
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
interface HeaderProps {
|
|
251
|
+
moduleName: string;
|
|
252
|
+
logo?: ReactNode;
|
|
253
|
+
enterpriseLogo?: ReactNode;
|
|
254
|
+
accounts: UserAccount[];
|
|
255
|
+
currentSite?: {
|
|
256
|
+
id: string;
|
|
257
|
+
name: string;
|
|
258
|
+
};
|
|
259
|
+
onBackHome: () => void;
|
|
260
|
+
onChangeAccount: (account: UserAccount, profile: UserAccountProfile) => void;
|
|
261
|
+
onClickMyPayroll: () => void;
|
|
262
|
+
onClickSettings: () => void;
|
|
263
|
+
onLogout: () => void;
|
|
264
|
+
}
|
|
265
|
+
declare const Header: ({ moduleName, logo, enterpriseLogo, accounts, currentSite, onBackHome, onChangeAccount, onClickMyPayroll, onClickSettings, onLogout, }: HeaderProps) => react_jsx_runtime.JSX.Element;
|
|
266
|
+
|
|
267
|
+
interface ChangeAccountModalProps {
|
|
268
|
+
opened: boolean;
|
|
269
|
+
onClose: () => void;
|
|
270
|
+
accounts: UserAccount[];
|
|
271
|
+
onChangeAccount: (account: UserAccount, profile: UserAccountProfile) => void;
|
|
272
|
+
}
|
|
273
|
+
declare const ChangeAccountModal: ({ opened, onClose, accounts, onChangeAccount, }: ChangeAccountModalProps) => react_jsx_runtime.JSX.Element;
|
|
274
|
+
|
|
275
|
+
interface HelpModalProps {
|
|
276
|
+
opened: boolean;
|
|
277
|
+
onClose: () => void;
|
|
278
|
+
enterpriseLogo?: ReactNode;
|
|
279
|
+
}
|
|
280
|
+
declare const HelpModal: ({ opened, onClose, enterpriseLogo }: HelpModalProps) => react_jsx_runtime.JSX.Element;
|
|
281
|
+
|
|
282
|
+
interface SidebarModuleScreen {
|
|
283
|
+
id: number;
|
|
284
|
+
label: string;
|
|
285
|
+
external: boolean;
|
|
286
|
+
url: string;
|
|
287
|
+
}
|
|
288
|
+
interface SidebarModule {
|
|
289
|
+
id: number;
|
|
290
|
+
label: string;
|
|
291
|
+
icon?: string;
|
|
292
|
+
screens: SidebarModuleScreen[];
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
interface SidebarProps {
|
|
296
|
+
modules: SidebarModule[];
|
|
297
|
+
onClickExternalScreen: (item: SidebarModuleScreen) => void;
|
|
298
|
+
}
|
|
299
|
+
declare const Sidebar: ({ modules, onClickExternalScreen }: SidebarProps) => react_jsx_runtime.JSX.Element;
|
|
300
|
+
|
|
239
301
|
interface TTNSharedProviderProps {
|
|
240
302
|
token: string;
|
|
241
303
|
baseUrl: string;
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
304
|
+
userInfo: {
|
|
305
|
+
id?: number;
|
|
306
|
+
name?: string;
|
|
307
|
+
imageUrl?: string;
|
|
308
|
+
accountId?: number;
|
|
309
|
+
profileId?: number;
|
|
310
|
+
};
|
|
245
311
|
}
|
|
246
312
|
declare const TTNSharedProvider: FC<PropsWithChildren<TTNSharedProviderProps>>;
|
|
247
313
|
declare const useTTNSharedContext: () => TTNSharedProviderProps;
|
|
@@ -342,4 +408,4 @@ interface Appointment {
|
|
|
342
408
|
usClientPrice: number;
|
|
343
409
|
}
|
|
344
410
|
|
|
345
|
-
export { type AdministrativeRisk, type Appointment, type AssistanceRisk, type Comment, type CommentPayload, PatientAdministrativeRisks, PatientAppointmentHistory, PatientAssistanceRisks, type PatientDetail, PatientForm, type PatientFormMode, type PatientFormValues, PatientNotes, type PatientPayload, type RiskPayload, TTNSharedProvider, type TTNSharedProviderProps, useTTNSharedContext };
|
|
411
|
+
export { type AdministrativeRisk, type Appointment, type AssistanceRisk, ChangeAccountModal, type ChangeAccountModalProps, type Comment, type CommentPayload, Header, type HeaderProps, HelpModal, type HelpModalProps, PatientAdministrativeRisks, PatientAppointmentHistory, PatientAssistanceRisks, type PatientDetail, PatientForm, type PatientFormMode, type PatientFormValues, PatientNotes, type PatientPayload, type RiskPayload, Sidebar, type SidebarModule, type SidebarModuleScreen, type SidebarProps, TTNSharedProvider, type TTNSharedProviderProps, type UserAccount, type UserAccountProfile, useTTNSharedContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { ReactNode, FC, PropsWithChildren } from 'react';
|
|
3
3
|
|
|
4
4
|
interface SelectOption {
|
|
5
5
|
id: number;
|
|
@@ -8,7 +8,7 @@ interface SelectOption {
|
|
|
8
8
|
|
|
9
9
|
type PatientFormMode = "create" | "edit" | "view";
|
|
10
10
|
interface PatientFormValues {
|
|
11
|
-
documentTypeId: string;
|
|
11
|
+
documentTypeId: string | null;
|
|
12
12
|
documentNumber: string;
|
|
13
13
|
firstName: string;
|
|
14
14
|
middleName: string;
|
|
@@ -17,14 +17,14 @@ interface PatientFormValues {
|
|
|
17
17
|
birthDate: string;
|
|
18
18
|
age: string;
|
|
19
19
|
whatsapp: number | string;
|
|
20
|
-
gender: string;
|
|
21
|
-
affiliationTypeId: string;
|
|
20
|
+
gender: string | null;
|
|
21
|
+
affiliationTypeId: string | null;
|
|
22
22
|
email: string;
|
|
23
|
-
maritalStatus: string;
|
|
24
|
-
provinceId: string;
|
|
25
|
-
cityId: string;
|
|
23
|
+
maritalStatus: string | null;
|
|
24
|
+
provinceId: string | null;
|
|
25
|
+
cityId: string | null;
|
|
26
26
|
homeAddress: string;
|
|
27
|
-
bloodType: string;
|
|
27
|
+
bloodType: string | null;
|
|
28
28
|
neighborhood: string;
|
|
29
29
|
cellphone: number | string;
|
|
30
30
|
homephone: number | string;
|
|
@@ -33,24 +33,24 @@ interface PatientFormValues {
|
|
|
33
33
|
use_glasses: string;
|
|
34
34
|
use_contact_lens: string;
|
|
35
35
|
isDataPolicyAccepted: boolean;
|
|
36
|
-
stratumId: string;
|
|
37
|
-
educationLevelId: string;
|
|
38
|
-
ethnicGroupId: string;
|
|
36
|
+
stratumId: string | null;
|
|
37
|
+
educationLevelId: string | null;
|
|
38
|
+
ethnicGroupId: string | null;
|
|
39
39
|
mandatoryInsurance: {
|
|
40
|
-
companyId: string;
|
|
41
|
-
plan: string;
|
|
42
|
-
population: string;
|
|
43
|
-
groupId: string;
|
|
40
|
+
companyId: string | null;
|
|
41
|
+
plan: string | null;
|
|
42
|
+
population: string | null;
|
|
43
|
+
groupId: string | null;
|
|
44
44
|
policyNumber: string;
|
|
45
45
|
};
|
|
46
46
|
voluntaryInsurance: {
|
|
47
47
|
id: string;
|
|
48
48
|
companyTypeTag: string;
|
|
49
49
|
companyType: string;
|
|
50
|
-
companyId: string;
|
|
51
|
-
plan: string;
|
|
52
|
-
population: string;
|
|
53
|
-
groupId: string;
|
|
50
|
+
companyId: string | null;
|
|
51
|
+
plan: string | null;
|
|
52
|
+
population: string | null;
|
|
53
|
+
groupId: string | null;
|
|
54
54
|
policyNumber: string;
|
|
55
55
|
}[];
|
|
56
56
|
}
|
|
@@ -188,11 +188,12 @@ interface PatientFormProps {
|
|
|
188
188
|
defaultMode: PatientFormMode;
|
|
189
189
|
patientId?: number;
|
|
190
190
|
policyContent?: string;
|
|
191
|
+
disabledFields?: (keyof PatientFormValues)[];
|
|
191
192
|
onSavePatient?: (payload: PatientPayload, mode: PatientFormMode) => void;
|
|
192
193
|
onSaveError?: (error: string) => void;
|
|
193
194
|
onBack?: () => void;
|
|
194
195
|
}
|
|
195
|
-
declare const PatientForm: ({ defaultMode, patientId, policyContent, onSavePatient, onSaveError, onBack, }: PatientFormProps) => react_jsx_runtime.JSX.Element;
|
|
196
|
+
declare const PatientForm: ({ defaultMode, patientId, policyContent, disabledFields, onSavePatient, onSaveError, onBack, }: PatientFormProps) => react_jsx_runtime.JSX.Element;
|
|
196
197
|
|
|
197
198
|
interface Comment {
|
|
198
199
|
id: number;
|
|
@@ -236,12 +237,77 @@ interface PatientAppointmentHistoryProps {
|
|
|
236
237
|
}
|
|
237
238
|
declare const PatientAppointmentHistory: ({ patientId }: PatientAppointmentHistoryProps) => react_jsx_runtime.JSX.Element;
|
|
238
239
|
|
|
240
|
+
interface UserAccountProfile {
|
|
241
|
+
id: number;
|
|
242
|
+
name: string;
|
|
243
|
+
}
|
|
244
|
+
interface UserAccount {
|
|
245
|
+
id: number;
|
|
246
|
+
name: string;
|
|
247
|
+
profiles: UserAccountProfile[];
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
interface HeaderProps {
|
|
251
|
+
moduleName: string;
|
|
252
|
+
logo?: ReactNode;
|
|
253
|
+
enterpriseLogo?: ReactNode;
|
|
254
|
+
accounts: UserAccount[];
|
|
255
|
+
currentSite?: {
|
|
256
|
+
id: string;
|
|
257
|
+
name: string;
|
|
258
|
+
};
|
|
259
|
+
onBackHome: () => void;
|
|
260
|
+
onChangeAccount: (account: UserAccount, profile: UserAccountProfile) => void;
|
|
261
|
+
onClickMyPayroll: () => void;
|
|
262
|
+
onClickSettings: () => void;
|
|
263
|
+
onLogout: () => void;
|
|
264
|
+
}
|
|
265
|
+
declare const Header: ({ moduleName, logo, enterpriseLogo, accounts, currentSite, onBackHome, onChangeAccount, onClickMyPayroll, onClickSettings, onLogout, }: HeaderProps) => react_jsx_runtime.JSX.Element;
|
|
266
|
+
|
|
267
|
+
interface ChangeAccountModalProps {
|
|
268
|
+
opened: boolean;
|
|
269
|
+
onClose: () => void;
|
|
270
|
+
accounts: UserAccount[];
|
|
271
|
+
onChangeAccount: (account: UserAccount, profile: UserAccountProfile) => void;
|
|
272
|
+
}
|
|
273
|
+
declare const ChangeAccountModal: ({ opened, onClose, accounts, onChangeAccount, }: ChangeAccountModalProps) => react_jsx_runtime.JSX.Element;
|
|
274
|
+
|
|
275
|
+
interface HelpModalProps {
|
|
276
|
+
opened: boolean;
|
|
277
|
+
onClose: () => void;
|
|
278
|
+
enterpriseLogo?: ReactNode;
|
|
279
|
+
}
|
|
280
|
+
declare const HelpModal: ({ opened, onClose, enterpriseLogo }: HelpModalProps) => react_jsx_runtime.JSX.Element;
|
|
281
|
+
|
|
282
|
+
interface SidebarModuleScreen {
|
|
283
|
+
id: number;
|
|
284
|
+
label: string;
|
|
285
|
+
external: boolean;
|
|
286
|
+
url: string;
|
|
287
|
+
}
|
|
288
|
+
interface SidebarModule {
|
|
289
|
+
id: number;
|
|
290
|
+
label: string;
|
|
291
|
+
icon?: string;
|
|
292
|
+
screens: SidebarModuleScreen[];
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
interface SidebarProps {
|
|
296
|
+
modules: SidebarModule[];
|
|
297
|
+
onClickExternalScreen: (item: SidebarModuleScreen) => void;
|
|
298
|
+
}
|
|
299
|
+
declare const Sidebar: ({ modules, onClickExternalScreen }: SidebarProps) => react_jsx_runtime.JSX.Element;
|
|
300
|
+
|
|
239
301
|
interface TTNSharedProviderProps {
|
|
240
302
|
token: string;
|
|
241
303
|
baseUrl: string;
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
304
|
+
userInfo: {
|
|
305
|
+
id?: number;
|
|
306
|
+
name?: string;
|
|
307
|
+
imageUrl?: string;
|
|
308
|
+
accountId?: number;
|
|
309
|
+
profileId?: number;
|
|
310
|
+
};
|
|
245
311
|
}
|
|
246
312
|
declare const TTNSharedProvider: FC<PropsWithChildren<TTNSharedProviderProps>>;
|
|
247
313
|
declare const useTTNSharedContext: () => TTNSharedProviderProps;
|
|
@@ -342,4 +408,4 @@ interface Appointment {
|
|
|
342
408
|
usClientPrice: number;
|
|
343
409
|
}
|
|
344
410
|
|
|
345
|
-
export { type AdministrativeRisk, type Appointment, type AssistanceRisk, type Comment, type CommentPayload, PatientAdministrativeRisks, PatientAppointmentHistory, PatientAssistanceRisks, type PatientDetail, PatientForm, type PatientFormMode, type PatientFormValues, PatientNotes, type PatientPayload, type RiskPayload, TTNSharedProvider, type TTNSharedProviderProps, useTTNSharedContext };
|
|
411
|
+
export { type AdministrativeRisk, type Appointment, type AssistanceRisk, ChangeAccountModal, type ChangeAccountModalProps, type Comment, type CommentPayload, Header, type HeaderProps, HelpModal, type HelpModalProps, PatientAdministrativeRisks, PatientAppointmentHistory, PatientAssistanceRisks, type PatientDetail, PatientForm, type PatientFormMode, type PatientFormValues, PatientNotes, type PatientPayload, type RiskPayload, Sidebar, type SidebarModule, type SidebarModuleScreen, type SidebarProps, TTNSharedProvider, type TTNSharedProviderProps, type UserAccount, type UserAccountProfile, useTTNSharedContext };
|