tycho-components 0.0.9-SNAPSHOT-2 → 0.0.9
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/Participants/Participants.d.ts +2 -1
- package/dist/Participants/Participants.js +5 -7
- package/dist/Participants/types/Participant.d.ts +1 -0
- package/dist/Participants/types/Participant.js +10 -0
- package/dist/configs/Localization.d.ts +16 -0
- package/dist/configs/localization/ParticipantsTexts.d.ts +16 -0
- package/dist/configs/localization/ParticipantsTexts.js +16 -0
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ type Props = {
|
|
|
4
4
|
document: string;
|
|
5
5
|
onChange: (p: Participant[]) => void;
|
|
6
6
|
participants: Participant[];
|
|
7
|
+
useChat?: boolean;
|
|
7
8
|
};
|
|
8
|
-
export default function Participants({ document, participants, onChange, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default function Participants({ document, participants, onChange, useChat, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { faPlus, faTrash } from '@fortawesome/free-solid-svg-icons';
|
|
3
3
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
-
import {
|
|
4
|
+
import { useEffect, useState } from 'react';
|
|
5
5
|
import { Button, Form } from 'react-bootstrap';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import AppEditable from '../AppEditable';
|
|
8
|
-
import
|
|
8
|
+
import { useMessageUtils } from '../configs/useMessageUtils';
|
|
9
9
|
import ParticipantCreate from './ParticipantCreate';
|
|
10
10
|
import ParticipantRemove from './ParticipantRemove';
|
|
11
11
|
import './style.scss';
|
|
12
|
-
import { PARTICIPANT_FIELDS } from './types/Participant';
|
|
12
|
+
import { CHAT_FIELDS, PARTICIPANT_FIELDS, } from './types/Participant';
|
|
13
13
|
import ParticipantService from './types/ParticipantService';
|
|
14
|
-
|
|
15
|
-
export default function Participants({ document, participants, onChange, }) {
|
|
14
|
+
export default function Participants({ document, participants, onChange, useChat, }) {
|
|
16
15
|
const { t } = useTranslation('participants');
|
|
17
|
-
const { dispatch } = useContext(CommonContext);
|
|
18
16
|
const { dispatchMessage } = useMessageUtils();
|
|
19
17
|
const [participant, setParticipant] = useState();
|
|
20
18
|
const [openRemove, setOpenRemove] = useState(false);
|
|
@@ -44,7 +42,7 @@ export default function Participants({ document, participants, onChange, }) {
|
|
|
44
42
|
}, []);
|
|
45
43
|
return (_jsxs("div", { className: "participants-container", children: [_jsxs("div", { className: "header", children: [_jsx("h3", { children: t('label.title') }), _jsx("div", { className: "actions", children: _jsxs("button", { type: "button", className: "action", onClick: () => setOpenCreate(true), children: [_jsx(FontAwesomeIcon, { icon: faPlus, title: t('button.label.add') }), _jsx("span", { className: "ms-2", children: t('button.label.add') })] }) })] }), _jsx("div", { className: "body", children: participant && (_jsxs(_Fragment, { children: [_jsx(Form.Select, { onChange: (e) => setParticipant(participants[Number(e.target.value)]), value: participant
|
|
46
44
|
? participants.findIndex((p) => p.code === participant.code)
|
|
47
|
-
: 0, children: participants.map((el, idx) => (_jsx("option", { value: idx, children: `${el.code} - ${el.name}` }, idx))) }), _jsx(AppEditable, { translation: "participants", group: "participant", save: handleSave, item: { ...participant, uid: document }, fields: PARTICIPANT_FIELDS, className: "fields", reference: "code" }), _jsx("div", { className: "footer", children: _jsxs(Button, { variant: "danger", onClick: () => {
|
|
45
|
+
: 0, children: participants.map((el, idx) => (_jsx("option", { value: idx, children: `${el.code} - ${el.name}` }, idx))) }), _jsx(AppEditable, { translation: "participants", group: "participant", save: handleSave, item: { ...participant, uid: document }, fields: PARTICIPANT_FIELDS, className: "fields", reference: "code" }), useChat && (_jsx(AppEditable, { translation: "participants", group: "participant", save: handleSave, item: { ...participant, uid: document }, fields: CHAT_FIELDS, className: "fields", reference: "code" })), _jsx("div", { className: "footer", children: _jsxs(Button, { variant: "danger", onClick: () => {
|
|
48
46
|
setParticipant(participant);
|
|
49
47
|
setOpenRemove(true);
|
|
50
48
|
}, children: [_jsx(FontAwesomeIcon, { icon: faTrash }), _jsx("span", { className: "ms-1", children: t('common:button.remove') })] }) })] })) }), participant && openRemove && (_jsx(ParticipantRemove, { document: document, onChange: (list) => {
|
|
@@ -15,3 +15,13 @@ export const PARTICIPANT_FIELDS = [
|
|
|
15
15
|
tooltip: 'field.color.tooltip',
|
|
16
16
|
},
|
|
17
17
|
];
|
|
18
|
+
export const CHAT_FIELDS = [
|
|
19
|
+
{ name: 'language', type: 'text', required: false },
|
|
20
|
+
{ name: 'age', type: 'text', required: false },
|
|
21
|
+
{ name: 'sex', type: 'text', required: false },
|
|
22
|
+
{ name: 'group', type: 'text', required: false },
|
|
23
|
+
{ name: 'ses', type: 'text', required: false },
|
|
24
|
+
{ name: 'role', type: 'text', required: false },
|
|
25
|
+
{ name: 'education', type: 'text', required: false },
|
|
26
|
+
{ name: 'custom', type: 'text', required: false },
|
|
27
|
+
];
|
|
@@ -22,6 +22,14 @@ export declare const commonResources: {
|
|
|
22
22
|
'participant.field.color': string;
|
|
23
23
|
'participant.field.separator': string;
|
|
24
24
|
'participant.field.color.tooltip': string;
|
|
25
|
+
'participant.field.language': string;
|
|
26
|
+
'participant.field.age': string;
|
|
27
|
+
'participant.field.sex': string;
|
|
28
|
+
'participant.field.group': string;
|
|
29
|
+
'participant.field.ses': string;
|
|
30
|
+
'participant.field.role': string;
|
|
31
|
+
'participant.field.education': string;
|
|
32
|
+
'participant.field.custom': string;
|
|
25
33
|
'modal.remove.title': string;
|
|
26
34
|
'modal.remove.description': string;
|
|
27
35
|
'modal.remove.participant': string;
|
|
@@ -53,6 +61,14 @@ export declare const commonResources: {
|
|
|
53
61
|
'participant.field.color': string;
|
|
54
62
|
'participant.field.separator': string;
|
|
55
63
|
'participant.field.color.tooltip': string;
|
|
64
|
+
'participant.field.language': string;
|
|
65
|
+
'participant.field.age': string;
|
|
66
|
+
'participant.field.sex': string;
|
|
67
|
+
'participant.field.group': string;
|
|
68
|
+
'participant.field.ses': string;
|
|
69
|
+
'participant.field.role': string;
|
|
70
|
+
'participant.field.education': string;
|
|
71
|
+
'participant.field.custom': string;
|
|
56
72
|
'modal.remove.title': string;
|
|
57
73
|
'modal.remove.description': string;
|
|
58
74
|
'modal.remove.participant': string;
|
|
@@ -8,6 +8,14 @@ export declare const ParticipantsTexts: {
|
|
|
8
8
|
'participant.field.color': string;
|
|
9
9
|
'participant.field.separator': string;
|
|
10
10
|
'participant.field.color.tooltip': string;
|
|
11
|
+
'participant.field.language': string;
|
|
12
|
+
'participant.field.age': string;
|
|
13
|
+
'participant.field.sex': string;
|
|
14
|
+
'participant.field.group': string;
|
|
15
|
+
'participant.field.ses': string;
|
|
16
|
+
'participant.field.role': string;
|
|
17
|
+
'participant.field.education': string;
|
|
18
|
+
'participant.field.custom': string;
|
|
11
19
|
'modal.remove.title': string;
|
|
12
20
|
'modal.remove.description': string;
|
|
13
21
|
'modal.remove.participant': string;
|
|
@@ -25,6 +33,14 @@ export declare const ParticipantsTexts: {
|
|
|
25
33
|
'participant.field.color': string;
|
|
26
34
|
'participant.field.separator': string;
|
|
27
35
|
'participant.field.color.tooltip': string;
|
|
36
|
+
'participant.field.language': string;
|
|
37
|
+
'participant.field.age': string;
|
|
38
|
+
'participant.field.sex': string;
|
|
39
|
+
'participant.field.group': string;
|
|
40
|
+
'participant.field.ses': string;
|
|
41
|
+
'participant.field.role': string;
|
|
42
|
+
'participant.field.education': string;
|
|
43
|
+
'participant.field.custom': string;
|
|
28
44
|
'modal.remove.title': string;
|
|
29
45
|
'modal.remove.description': string;
|
|
30
46
|
'modal.remove.participant': string;
|
|
@@ -8,6 +8,14 @@ export const ParticipantsTexts = {
|
|
|
8
8
|
'participant.field.color': 'Color',
|
|
9
9
|
'participant.field.separator': 'Separator',
|
|
10
10
|
'participant.field.color.tooltip': 'A color for transcription visual identifier',
|
|
11
|
+
'participant.field.language': 'Language',
|
|
12
|
+
'participant.field.age': 'Age',
|
|
13
|
+
'participant.field.sex': 'Sex',
|
|
14
|
+
'participant.field.group': 'Group',
|
|
15
|
+
'participant.field.ses': 'SES',
|
|
16
|
+
'participant.field.role': 'Role',
|
|
17
|
+
'participant.field.education': 'Education',
|
|
18
|
+
'participant.field.custom': 'Custom',
|
|
11
19
|
'modal.remove.title': 'Remove participant',
|
|
12
20
|
'modal.remove.description': 'Are you sure you want to delete this participant? This action is irreversible, but the sentences are not deleted.',
|
|
13
21
|
'modal.remove.participant': 'You can choose a participant to transfer sentences related to ',
|
|
@@ -25,6 +33,14 @@ export const ParticipantsTexts = {
|
|
|
25
33
|
'participant.field.color': 'Cor',
|
|
26
34
|
'participant.field.separator': 'Separador',
|
|
27
35
|
'participant.field.color.tooltip': 'Cor para identificação visual da sentença na transcrição',
|
|
36
|
+
'participant.field.language': 'Língua',
|
|
37
|
+
'participant.field.age': 'Idade',
|
|
38
|
+
'participant.field.sex': 'Gênero',
|
|
39
|
+
'participant.field.group': 'Grupo',
|
|
40
|
+
'participant.field.ses': 'SES',
|
|
41
|
+
'participant.field.role': 'Papel',
|
|
42
|
+
'participant.field.education': 'Educação',
|
|
43
|
+
'participant.field.custom': 'Outros',
|
|
28
44
|
'modal.remove.title': 'Remover participante',
|
|
29
45
|
'modal.remove.description': 'Você tem certeza que deseja remover este participante? Esta ação é irreversível, porém as sentenças não serão excluídas.',
|
|
30
46
|
'modal.remove.participant': 'Você pode escolher um participante para transferir frases relacionadas a ',
|