@devix-tecnologia/timeline-vue 1.1.1 → 1.1.2
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/README.md +41 -36
- package/dist/style.css +1 -1
- package/dist/timeline-vue.es.js +47 -47
- package/dist/types/components/timeline/organismos/Timeline.vue.d.ts +1 -0
- package/package.json +2 -2
- package/src/assets/vue.svg +0 -1
- package/src/components/timeline/atomos/AvatarTimeline.stories.ts +0 -32
- package/src/components/timeline/atomos/AvatarTimeline.vue +0 -51
- package/src/components/timeline/atomos/BoxData.stories.ts +0 -41
- package/src/components/timeline/atomos/BoxData.vue +0 -57
- package/src/components/timeline/atomos/Destaque.stories.ts +0 -24
- package/src/components/timeline/atomos/Destaque.vue +0 -39
- package/src/components/timeline/atomos/Hora.stories.ts +0 -36
- package/src/components/timeline/atomos/Hora.vue +0 -50
- package/src/components/timeline/atomos/IconeCategoria.stories.ts +0 -60
- package/src/components/timeline/atomos/IconeCategoria.vue +0 -110
- package/src/components/timeline/atomos/IconeStatus.stories.ts +0 -38
- package/src/components/timeline/atomos/IconeStatus.vue +0 -73
- package/src/components/timeline/atomos/SubtituloEvento.stories.ts +0 -24
- package/src/components/timeline/atomos/SubtituloEvento.vue +0 -33
- package/src/components/timeline/atomos/TituloEvento.stories.ts +0 -24
- package/src/components/timeline/atomos/TituloEvento.vue +0 -32
- package/src/components/timeline/index.ts +0 -7
- package/src/components/timeline/moleculas/DescricaoEvento.stories.ts +0 -31
- package/src/components/timeline/moleculas/DescricaoEvento.vue +0 -59
- package/src/components/timeline/moleculas/EventoTimeline.stories.ts +0 -94
- package/src/components/timeline/moleculas/EventoTimeline.vue +0 -158
- package/src/components/timeline/moleculas/HoraEvento.stories.ts +0 -37
- package/src/components/timeline/moleculas/HoraEvento.vue +0 -74
- package/src/components/timeline/moleculas/PerfilTimeline.stories.ts +0 -40
- package/src/components/timeline/moleculas/PerfilTimeline.vue +0 -76
- package/src/components/timeline/moleculas/SeparadorPeriodo.stories.ts +0 -42
- package/src/components/timeline/moleculas/SeparadorPeriodo.vue +0 -100
- package/src/components/timeline/moleculas/Topo.vue +0 -38
- package/src/components/timeline/organismos/Timeline.mock.ts +0 -311
- package/src/components/timeline/organismos/Timeline.stories.ts +0 -48
- package/src/components/timeline/organismos/Timeline.vue +0 -217
- package/src/components/timeline/type.ts +0 -34
- package/src/global.css +0 -98
- package/src/index.ts +0 -16
- package/src/vite-env.d.ts +0 -1
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
import { Evento, Perfil } from "../type";
|
|
2
|
-
|
|
3
|
-
export const dadosPerfil: Perfil = {
|
|
4
|
-
nome: "Maria do Socorro",
|
|
5
|
-
imagem:
|
|
6
|
-
"https://this-person-does-not-exist.com/img/avatar-gen11071f8e0802a35d66684ee9376722b2.jpg",
|
|
7
|
-
icone: "person",
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const dadosEventos: Evento[] = [
|
|
11
|
-
{
|
|
12
|
-
id: "15ea7863-2402-4b84-8a8d-10a00ba07e2f1",
|
|
13
|
-
data: new Date("2023-04-26T19:00Z"),
|
|
14
|
-
previsto: new Date("2023-04-26T19:00Z"),
|
|
15
|
-
realizado: new Date("2023-04-26T19:30Z"),
|
|
16
|
-
duracao: null,
|
|
17
|
-
tolerancia: 10,
|
|
18
|
-
titulo: "Vacina da Covid",
|
|
19
|
-
subtitulo: "Posto de saúde do bairro",
|
|
20
|
-
destaque: "",
|
|
21
|
-
categoria: {
|
|
22
|
-
nome: "Vacina",
|
|
23
|
-
icone: "vaccines",
|
|
24
|
-
},
|
|
25
|
-
status: "realizado",
|
|
26
|
-
criticidade: "media",
|
|
27
|
-
|
|
28
|
-
atual: false,
|
|
29
|
-
scroll: false,
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: "15ea7863-2402-4b84-8a8d-10a00ba07e2f2",
|
|
33
|
-
data: new Date("2023-04-26T18:10Z"),
|
|
34
|
-
previsto: new Date("2023-04-26T18:10Z"),
|
|
35
|
-
realizado: new Date("2023-04-26T18:15Z"),
|
|
36
|
-
duracao: null,
|
|
37
|
-
tolerancia: 10,
|
|
38
|
-
titulo: "Vacina da gripe",
|
|
39
|
-
subtitulo: "Posto de saúde do bairro",
|
|
40
|
-
destaque: "",
|
|
41
|
-
categoria: {
|
|
42
|
-
nome: "Vacina",
|
|
43
|
-
icone: "vaccines",
|
|
44
|
-
},
|
|
45
|
-
status: "cancelado",
|
|
46
|
-
criticidade: "baixa",
|
|
47
|
-
|
|
48
|
-
atual: false,
|
|
49
|
-
scroll: false,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
id: "15ea7863-2402-4b84-8a8d-10a00ba07e2f3",
|
|
53
|
-
data: new Date("2023-05-03T11:00Z"),
|
|
54
|
-
previsto: new Date("2023-05-03T11:00Z"),
|
|
55
|
-
realizado: null,
|
|
56
|
-
duracao: null,
|
|
57
|
-
tolerancia: 10,
|
|
58
|
-
titulo: "Ligar para médica",
|
|
59
|
-
subtitulo: "",
|
|
60
|
-
destaque: "",
|
|
61
|
-
categoria: {
|
|
62
|
-
nome: "Ligação",
|
|
63
|
-
icone: "call",
|
|
64
|
-
},
|
|
65
|
-
status: "planejado",
|
|
66
|
-
criticidade: "baixa",
|
|
67
|
-
|
|
68
|
-
atual: false,
|
|
69
|
-
scroll: false,
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
id: "15ea7863-2402-4b84-8a8d-10a00ba07e2f4",
|
|
73
|
-
data: new Date("2023-05-03T15:00Z"),
|
|
74
|
-
previsto: new Date("2023-05-03T15:00Z"),
|
|
75
|
-
realizado: null,
|
|
76
|
-
duracao: null,
|
|
77
|
-
tolerancia: 10,
|
|
78
|
-
titulo: "Passeio no parque",
|
|
79
|
-
subtitulo: "",
|
|
80
|
-
destaque: "",
|
|
81
|
-
categoria: {
|
|
82
|
-
nome: "Passeio",
|
|
83
|
-
icone: "tour",
|
|
84
|
-
},
|
|
85
|
-
status: "planejado",
|
|
86
|
-
criticidade: "baixa",
|
|
87
|
-
|
|
88
|
-
atual: false,
|
|
89
|
-
scroll: false,
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
id: "15ea7863-2402-4b84-8a8d-10a00ba07e2f5",
|
|
93
|
-
data: new Date("2023-05-03T20:00Z"),
|
|
94
|
-
previsto: new Date("2023-05-03T20:00Z"),
|
|
95
|
-
realizado: null,
|
|
96
|
-
duracao: null,
|
|
97
|
-
tolerancia: 10,
|
|
98
|
-
titulo: "Exames do coração",
|
|
99
|
-
subtitulo: "Hospital do Coração",
|
|
100
|
-
destaque: "",
|
|
101
|
-
categoria: {
|
|
102
|
-
nome: "Cardiologista",
|
|
103
|
-
icone: "cardiology",
|
|
104
|
-
},
|
|
105
|
-
status: "planejado",
|
|
106
|
-
criticidade: "media",
|
|
107
|
-
|
|
108
|
-
atual: false,
|
|
109
|
-
scroll: false,
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
id: "15ea7863-2402-4b84-8a8d-10a00ba07e2f6",
|
|
113
|
-
data: new Date("2023-04-01T12:00Z"),
|
|
114
|
-
previsto: new Date("2023-04-01T12:00Z"),
|
|
115
|
-
realizado: null,
|
|
116
|
-
duracao: null,
|
|
117
|
-
tolerancia: 10,
|
|
118
|
-
titulo: "Consulta",
|
|
119
|
-
subtitulo: "Posto de saúde",
|
|
120
|
-
destaque: "Remarcado",
|
|
121
|
-
categoria: {
|
|
122
|
-
nome: "Tele consulta",
|
|
123
|
-
icone: "call",
|
|
124
|
-
},
|
|
125
|
-
status: "adiado",
|
|
126
|
-
criticidade: "baixa",
|
|
127
|
-
|
|
128
|
-
atual: false,
|
|
129
|
-
scroll: false,
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
id: "15ea7863-2402-4b84-8a8d-10a00ba07e2f7",
|
|
133
|
-
data: new Date("2023-04-01T13:00Z"),
|
|
134
|
-
previsto: new Date("2023-04-01T13:00Z"),
|
|
135
|
-
realizado: null,
|
|
136
|
-
duracao: null,
|
|
137
|
-
tolerancia: 10,
|
|
138
|
-
titulo: "Consulta cardiologista",
|
|
139
|
-
subtitulo: "Posto de saúde do bairro",
|
|
140
|
-
destaque: "",
|
|
141
|
-
categoria: {
|
|
142
|
-
nome: "Cardiologista",
|
|
143
|
-
icone: "cardiology",
|
|
144
|
-
},
|
|
145
|
-
status: "realizado",
|
|
146
|
-
criticidade: "alta",
|
|
147
|
-
|
|
148
|
-
atual: false,
|
|
149
|
-
scroll: false,
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
id: "15ea7863-2402-4b84-8a8d-10a00ba07e2f8",
|
|
153
|
-
data: new Date("2023-05-03T12:00Z"),
|
|
154
|
-
previsto: new Date("2023-05-03T12:00Z"),
|
|
155
|
-
realizado: null,
|
|
156
|
-
duracao: null,
|
|
157
|
-
tolerancia: 10,
|
|
158
|
-
titulo: "Dentista",
|
|
159
|
-
subtitulo: "Reta da Penha",
|
|
160
|
-
destaque: "",
|
|
161
|
-
categoria: {
|
|
162
|
-
nome: "Dentista",
|
|
163
|
-
icone: "dentistry",
|
|
164
|
-
},
|
|
165
|
-
status: "planejado",
|
|
166
|
-
criticidade: "baixa",
|
|
167
|
-
|
|
168
|
-
atual: false,
|
|
169
|
-
scroll: false,
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
id: "15ea7863-2402-4b84-8a8d-10a00ba07e2f9",
|
|
173
|
-
data: new Date("2023-05-03T13:00Z"),
|
|
174
|
-
previsto: new Date("2023-05-03T13:00Z"),
|
|
175
|
-
realizado: null,
|
|
176
|
-
duracao: null,
|
|
177
|
-
tolerancia: 10,
|
|
178
|
-
titulo: "Consulta",
|
|
179
|
-
subtitulo: "Hospital central",
|
|
180
|
-
destaque: "",
|
|
181
|
-
categoria: {
|
|
182
|
-
nome: "Consulta",
|
|
183
|
-
icone: "health_and_safety",
|
|
184
|
-
},
|
|
185
|
-
status: "planejado",
|
|
186
|
-
criticidade: "alta",
|
|
187
|
-
|
|
188
|
-
atual: false,
|
|
189
|
-
scroll: false,
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
id: "15ea7863-2402-4b84-8a8d-10a00ba07e2f10",
|
|
193
|
-
data: new Date("2023-05-03T14:27Z"),
|
|
194
|
-
previsto: new Date("2023-05-03T14:27Z"),
|
|
195
|
-
realizado: null,
|
|
196
|
-
duracao: null,
|
|
197
|
-
tolerancia: 10,
|
|
198
|
-
titulo: "Remédio de pressão",
|
|
199
|
-
subtitulo: "Aferir a pressão",
|
|
200
|
-
destaque: "",
|
|
201
|
-
categoria: {
|
|
202
|
-
nome: "Remédio",
|
|
203
|
-
icone: "pill",
|
|
204
|
-
},
|
|
205
|
-
status: "planejado",
|
|
206
|
-
criticidade: "alta",
|
|
207
|
-
|
|
208
|
-
atual: false,
|
|
209
|
-
scroll: false,
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
id: "15ea7863-2402-4b84-8a8d-10a00ba07e2f11",
|
|
213
|
-
data: new Date("2023-05-03T15:00Z"),
|
|
214
|
-
previsto: new Date("2023-05-03T15:00Z"),
|
|
215
|
-
realizado: null,
|
|
216
|
-
duracao: null,
|
|
217
|
-
tolerancia: 10,
|
|
218
|
-
titulo: "Checar temperatura",
|
|
219
|
-
subtitulo: "",
|
|
220
|
-
destaque: "",
|
|
221
|
-
categoria: {
|
|
222
|
-
nome: "Termometro",
|
|
223
|
-
icone: "thermometer_gain",
|
|
224
|
-
},
|
|
225
|
-
status: "planejado",
|
|
226
|
-
criticidade: "baixa",
|
|
227
|
-
|
|
228
|
-
atual: false,
|
|
229
|
-
scroll: false,
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
id: "15ea7863-2402-4b84-8a8d-10a00ba07e2f12",
|
|
233
|
-
data: new Date("2023-05-08T16:00Z"),
|
|
234
|
-
previsto: new Date("2023-05-08T16:00Z"),
|
|
235
|
-
realizado: null,
|
|
236
|
-
duracao: null,
|
|
237
|
-
tolerancia: 10,
|
|
238
|
-
titulo: "Avaliação Física",
|
|
239
|
-
subtitulo: "",
|
|
240
|
-
destaque: "IMC: 28,4",
|
|
241
|
-
categoria: {
|
|
242
|
-
nome: "Avaliação Física",
|
|
243
|
-
icone: "conditions",
|
|
244
|
-
},
|
|
245
|
-
status: "planejado",
|
|
246
|
-
criticidade: "baixa",
|
|
247
|
-
|
|
248
|
-
atual: false,
|
|
249
|
-
scroll: false,
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
id: "15ea7863-2402-4b84-8a8d-10a00ba07e2f13",
|
|
253
|
-
data: new Date("2023-05-09T19:00Z"),
|
|
254
|
-
previsto: new Date("2023-05-09T19:00Z"),
|
|
255
|
-
realizado: null,
|
|
256
|
-
duracao: null,
|
|
257
|
-
tolerancia: 10,
|
|
258
|
-
titulo: "Vacina da gripe",
|
|
259
|
-
subtitulo: "Posto de saúde do bairro",
|
|
260
|
-
destaque: "",
|
|
261
|
-
categoria: {
|
|
262
|
-
nome: "Vacina",
|
|
263
|
-
icone: "vaccines",
|
|
264
|
-
},
|
|
265
|
-
status: "planejado",
|
|
266
|
-
criticidade: "baixa",
|
|
267
|
-
|
|
268
|
-
atual: false,
|
|
269
|
-
scroll: false,
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
id: "15ea7863-2402-4b84-8a8d-10a00ba07e2f14",
|
|
273
|
-
data: new Date("2023-05-09T17:00Z"),
|
|
274
|
-
previsto: new Date("2023-05-09T17:00Z"),
|
|
275
|
-
realizado: null,
|
|
276
|
-
duracao: null,
|
|
277
|
-
tolerancia: 10,
|
|
278
|
-
titulo: "Vitamina D",
|
|
279
|
-
subtitulo: "2 comprimidos",
|
|
280
|
-
destaque: "",
|
|
281
|
-
categoria: {
|
|
282
|
-
nome: "Remédio",
|
|
283
|
-
icone: "pill",
|
|
284
|
-
},
|
|
285
|
-
status: "planejado",
|
|
286
|
-
criticidade: "baixa",
|
|
287
|
-
aoCLicar: () => alert("Olá, mundo!"),
|
|
288
|
-
atual: false,
|
|
289
|
-
scroll: false,
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
id: "15ea7863-2402-4b84-8a8d-10a00ba07e2f15",
|
|
293
|
-
data: new Date("2023-05-09T18:01Z"),
|
|
294
|
-
previsto: new Date("2023-05-09T18:00Z"),
|
|
295
|
-
realizado: null,
|
|
296
|
-
duracao: null,
|
|
297
|
-
tolerancia: 10,
|
|
298
|
-
titulo: "Fisioterapia",
|
|
299
|
-
subtitulo: "",
|
|
300
|
-
destaque: "",
|
|
301
|
-
categoria: {
|
|
302
|
-
nome: "Fisioterapia",
|
|
303
|
-
icone: "physical_therapy",
|
|
304
|
-
},
|
|
305
|
-
status: "planejado",
|
|
306
|
-
criticidade: "baixa",
|
|
307
|
-
|
|
308
|
-
atual: false,
|
|
309
|
-
scroll: false,
|
|
310
|
-
},
|
|
311
|
-
];
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import Timeline from "./Timeline.vue";
|
|
2
|
-
import { Meta, StoryFn } from "@storybook/vue3";
|
|
3
|
-
import { dadosEventos, dadosPerfil } from "./Timeline.mock";
|
|
4
|
-
import { Evento } from "../type";
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: "Devix/Timeline/Organismos/Timeline",
|
|
8
|
-
component: Timeline,
|
|
9
|
-
parameters: {
|
|
10
|
-
componentSubtitle: "Linha do tempo padrão com identidade da Devix",
|
|
11
|
-
},
|
|
12
|
-
argTypes: {},
|
|
13
|
-
} as Meta<typeof Timeline>;
|
|
14
|
-
|
|
15
|
-
const perfilMock = dadosPerfil;
|
|
16
|
-
|
|
17
|
-
const eventosPorDataMock = dadosEventos;
|
|
18
|
-
|
|
19
|
-
function atualizarDatas(eventos: Evento[]) {
|
|
20
|
-
const agora = new Date();
|
|
21
|
-
const mesAtual = agora.getMonth() + 1;
|
|
22
|
-
|
|
23
|
-
for (let i = 0; i < eventos.length; i++) {
|
|
24
|
-
const evento = eventos[i];
|
|
25
|
-
const mesEvento = evento.data.getMonth() + 1;
|
|
26
|
-
|
|
27
|
-
if (mesEvento >= mesAtual) {
|
|
28
|
-
evento.data.setMonth(agora.getMonth(), agora.getDate());
|
|
29
|
-
evento.previsto.setMonth(agora.getMonth(), agora.getDate());
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
atualizarDatas(dadosEventos);
|
|
34
|
-
|
|
35
|
-
const Template: StoryFn<typeof Timeline> = (args) => ({
|
|
36
|
-
components: { Timeline: Timeline },
|
|
37
|
-
setup() {
|
|
38
|
-
return { args };
|
|
39
|
-
},
|
|
40
|
-
template:
|
|
41
|
-
'<Timeline :perfilTimeline="args.perfilTimeline" :eventosTimeline="args.eventosTimeline" style="position: relative" />',
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
export const Padrao = Template.bind({});
|
|
45
|
-
Padrao.args = {
|
|
46
|
-
perfilTimeline: perfilMock,
|
|
47
|
-
eventosTimeline: eventosPorDataMock,
|
|
48
|
-
};
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="areaTimeline">
|
|
3
|
-
<PerfilTimeline
|
|
4
|
-
v-if="perfilTimeline !== null"
|
|
5
|
-
:nomePerfil="perfilTimeline.nome"
|
|
6
|
-
:imagemPerfil="perfilTimeline.imagem"
|
|
7
|
-
:iconePerfil="perfilTimeline.icone"
|
|
8
|
-
/>
|
|
9
|
-
|
|
10
|
-
<section class="timeline" :class="{ marginTop: perfilTimeline !== null }">
|
|
11
|
-
<!-- SEPARADOR -->
|
|
12
|
-
<div v-for="evento in eventosPorTipo" :key="evento.key">
|
|
13
|
-
<SeparadorPeriodo
|
|
14
|
-
v-if="evento.tipo === 'dia'"
|
|
15
|
-
:dataSeparador="evento.valor"
|
|
16
|
-
/>
|
|
17
|
-
<!--loop-->
|
|
18
|
-
<EventoTimeline
|
|
19
|
-
v-if="evento.tipo === 'evento'"
|
|
20
|
-
:status="evento.valor.status"
|
|
21
|
-
:criticidade="evento.valor.criticidade"
|
|
22
|
-
:previsto="evento.valor.previsto"
|
|
23
|
-
:realizado="evento.valor.realizado"
|
|
24
|
-
:categoria="evento.valor.categoria"
|
|
25
|
-
:titulo="evento.valor.titulo"
|
|
26
|
-
:subtitulo="evento.valor.subtitulo"
|
|
27
|
-
:destaque="evento.valor.destaque"
|
|
28
|
-
:ehAtual="evento.valor.atual"
|
|
29
|
-
:aoCLicar="evento.valor.aoCLicar"
|
|
30
|
-
/>
|
|
31
|
-
</div>
|
|
32
|
-
</section>
|
|
33
|
-
</div>
|
|
34
|
-
</template>
|
|
35
|
-
|
|
36
|
-
<script lang="ts">
|
|
37
|
-
import { defineComponent, computed, reactive } from "vue";
|
|
38
|
-
import EventoTimeline from "../moleculas/EventoTimeline.vue";
|
|
39
|
-
import SeparadorPeriodo from "../moleculas/SeparadorPeriodo.vue";
|
|
40
|
-
import PerfilTimeline from "../moleculas/PerfilTimeline.vue";
|
|
41
|
-
import { Evento } from "../type";
|
|
42
|
-
|
|
43
|
-
type TipoEventoTimeline =
|
|
44
|
-
| { tipo: "dia"; valor: Date; key: number }
|
|
45
|
-
| { tipo: "evento"; valor: Evento; key: number }
|
|
46
|
-
| { tipo: "eventos"; valor: Evento[]; key: number };
|
|
47
|
-
|
|
48
|
-
export default defineComponent({
|
|
49
|
-
props: {
|
|
50
|
-
perfilTimeline: {
|
|
51
|
-
required: true,
|
|
52
|
-
type: Object,
|
|
53
|
-
},
|
|
54
|
-
eventosTimeline: {
|
|
55
|
-
required: true,
|
|
56
|
-
type: Object,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
components: {
|
|
60
|
-
PerfilTimeline,
|
|
61
|
-
SeparadorPeriodo,
|
|
62
|
-
EventoTimeline,
|
|
63
|
-
},
|
|
64
|
-
setup(props) {
|
|
65
|
-
const dadosEventosTimeline: Evento[] = reactive(
|
|
66
|
-
props.eventosTimeline as Array<Evento>
|
|
67
|
-
);
|
|
68
|
-
let dadosEventosTimelineClone: Evento[] = reactive(dadosEventosTimeline);
|
|
69
|
-
|
|
70
|
-
function carregarListaEventos() {
|
|
71
|
-
dadosEventosTimelineClone = dadosEventosTimeline;
|
|
72
|
-
const resultado: Evento[] = filtraEventoAtual(dadosEventosTimelineClone);
|
|
73
|
-
dadosEventosTimelineClone.map((resp) => {
|
|
74
|
-
if (resultado[0].id === resp.id) {
|
|
75
|
-
resp.atual = true;
|
|
76
|
-
resp.scroll = true;
|
|
77
|
-
void scrollParaItemAtual();
|
|
78
|
-
} else {
|
|
79
|
-
resp.atual = false;
|
|
80
|
-
resp.scroll = false;
|
|
81
|
-
}
|
|
82
|
-
return {
|
|
83
|
-
evento: resp,
|
|
84
|
-
};
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const atualizarEventoAtual = () => {
|
|
89
|
-
setInterval(carregarListaEventos, 60000);
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const verifica_mesmo_dia = (a: Date, b: Date) => {
|
|
93
|
-
const mesmo_dia = a.getDay() === b.getDay();
|
|
94
|
-
const mesmo_mes = a.getMonth() === b.getMonth();
|
|
95
|
-
const mesmo_ano = a.getFullYear() === b.getFullYear();
|
|
96
|
-
return mesmo_dia && mesmo_mes && mesmo_ano;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
//verifica qual evento está mais próximo da hora atual e coloca ele numa nova lista na primeira posição
|
|
100
|
-
const filtraEventoAtual = (eventos: Evento[]) => {
|
|
101
|
-
if (eventos) {
|
|
102
|
-
const agora = Date.now();
|
|
103
|
-
let minDiff: number | null = null;
|
|
104
|
-
let listaEventos = [];
|
|
105
|
-
for (const e of eventos) {
|
|
106
|
-
const t = e.data.getTime();
|
|
107
|
-
if (e.status === "planejado" || e.status === "atrasado") {
|
|
108
|
-
const diff: number = Math.abs(agora - e.data.getTime());
|
|
109
|
-
if (minDiff === null || (diff < minDiff && t <= agora)) {
|
|
110
|
-
minDiff = diff;
|
|
111
|
-
listaEventos.length = 0;
|
|
112
|
-
} else if (diff > minDiff) {
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
listaEventos.push(e);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return listaEventos;
|
|
119
|
-
} else {
|
|
120
|
-
return [];
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
// lista de eventos por tipo
|
|
125
|
-
const eventosTimeline = computed(() => {
|
|
126
|
-
void atualizarEventoAtual();
|
|
127
|
-
|
|
128
|
-
const eventosOrdenados = dadosEventosTimelineClone.sort(
|
|
129
|
-
(a: Evento, b: Evento) => {
|
|
130
|
-
return a.data.getTime() - b.data.getTime();
|
|
131
|
-
}
|
|
132
|
-
);
|
|
133
|
-
if (eventosOrdenados) {
|
|
134
|
-
let resultado: Array<TipoEventoTimeline> = [];
|
|
135
|
-
let dataAtual: Date | null = null;
|
|
136
|
-
let idx = 0;
|
|
137
|
-
let statusEvento;
|
|
138
|
-
|
|
139
|
-
for (const evento of eventosOrdenados) {
|
|
140
|
-
const agora = new Date();
|
|
141
|
-
const dataEvento = evento.data;
|
|
142
|
-
statusEvento = evento.status;
|
|
143
|
-
const toleranciaEvento = evento.tolerancia * 60 * 1000;
|
|
144
|
-
|
|
145
|
-
//altera status para atrasado
|
|
146
|
-
if (
|
|
147
|
-
statusEvento === "planejado" &&
|
|
148
|
-
dataEvento.getTime() + toleranciaEvento < agora.getTime()
|
|
149
|
-
) {
|
|
150
|
-
evento.status = "atrasado";
|
|
151
|
-
}
|
|
152
|
-
if (!dataAtual || !verifica_mesmo_dia(dataAtual, dataEvento)) {
|
|
153
|
-
dataAtual = dataEvento;
|
|
154
|
-
resultado.push({
|
|
155
|
-
tipo: "dia",
|
|
156
|
-
valor: evento.data,
|
|
157
|
-
key: ++idx,
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
resultado.push({
|
|
161
|
-
tipo: "evento",
|
|
162
|
-
valor: evento,
|
|
163
|
-
key: ++idx,
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
return resultado;
|
|
167
|
-
} else {
|
|
168
|
-
return [];
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
const scrollParaItemAtual = () => {
|
|
173
|
-
const itemAtual = document.querySelector(".atual");
|
|
174
|
-
itemAtual?.scrollIntoView({
|
|
175
|
-
behavior: "smooth",
|
|
176
|
-
block: "center",
|
|
177
|
-
});
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
carregarListaEventos();
|
|
181
|
-
return {
|
|
182
|
-
eventosPorTipo: eventosTimeline,
|
|
183
|
-
scrollParaItemAtual,
|
|
184
|
-
};
|
|
185
|
-
},
|
|
186
|
-
mounted() {
|
|
187
|
-
// Aguardando a renderização para fazer scroll
|
|
188
|
-
this.scrollParaItemAtual();
|
|
189
|
-
},
|
|
190
|
-
});
|
|
191
|
-
</script>
|
|
192
|
-
|
|
193
|
-
<style scoped>
|
|
194
|
-
/* TIMELINE */
|
|
195
|
-
|
|
196
|
-
/* .areaTimeline {
|
|
197
|
-
max-width: 850px;
|
|
198
|
-
margin: 0 auto;
|
|
199
|
-
} */
|
|
200
|
-
|
|
201
|
-
.areaEvento {
|
|
202
|
-
display: table-row;
|
|
203
|
-
min-height: 8rem;
|
|
204
|
-
position: relative !important;
|
|
205
|
-
width: 100%;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.timeline {
|
|
209
|
-
display: table;
|
|
210
|
-
width: 100%;
|
|
211
|
-
position: relative;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.marginTop {
|
|
215
|
-
margin-top: 8rem;
|
|
216
|
-
}
|
|
217
|
-
</style>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export type Perfil = {
|
|
2
|
-
nome: string;
|
|
3
|
-
imagem: string | null;
|
|
4
|
-
icone: string | null;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export type Categoria = {
|
|
8
|
-
nome: string;
|
|
9
|
-
icone: string;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export type Evento = {
|
|
13
|
-
id: string;
|
|
14
|
-
data: Date;
|
|
15
|
-
previsto: Date;
|
|
16
|
-
duracao: number | null;
|
|
17
|
-
realizado: Date | null;
|
|
18
|
-
tolerancia: number;
|
|
19
|
-
titulo: string;
|
|
20
|
-
subtitulo: string;
|
|
21
|
-
destaque: string;
|
|
22
|
-
categoria: Categoria;
|
|
23
|
-
status:
|
|
24
|
-
| "atrasado"
|
|
25
|
-
| "adiantado"
|
|
26
|
-
| "adiado"
|
|
27
|
-
| "realizado"
|
|
28
|
-
| "planejado"
|
|
29
|
-
| "cancelado";
|
|
30
|
-
criticidade: "baixa" | "media" | "alta";
|
|
31
|
-
aoCLicar?: VoidFunction;
|
|
32
|
-
atual: boolean;
|
|
33
|
-
scroll: boolean;
|
|
34
|
-
};
|
package/src/global.css
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/* GERAIS */
|
|
2
|
-
* {
|
|
3
|
-
margin: 0;
|
|
4
|
-
padding: 0;
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
-webkit-font-smoothing: antialiased;
|
|
7
|
-
-moz-osx-font-smoothing: grayscale;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
*:focus {
|
|
11
|
-
outline: none;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
:root {
|
|
15
|
-
--fonte: 'Work Sans', sans-serif;
|
|
16
|
-
font-size: 62.5%;
|
|
17
|
-
|
|
18
|
-
--cor-primaria: #00e01d;
|
|
19
|
-
--cor-secundaria: #1b2f39;
|
|
20
|
-
--cor-terciaria: #ebf1f2;
|
|
21
|
-
|
|
22
|
-
--cor-fundo: #fff;
|
|
23
|
-
|
|
24
|
-
--cor-selecao: #ccf9d2;
|
|
25
|
-
--cor-texto-selecao: #1b2f39;
|
|
26
|
-
--cor-texto: #1b2f39;
|
|
27
|
-
|
|
28
|
-
--cor-apoio: #57676f;
|
|
29
|
-
--cor-linha: #e9eaeb;
|
|
30
|
-
|
|
31
|
-
--cor-importante: #bb0202;
|
|
32
|
-
--cor-alerta: #f0cc0d;
|
|
33
|
-
--cor-sucesso: #00a816;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
:root .tema-escuro {
|
|
38
|
-
--fonte: 'Work Sans', sans-serif;
|
|
39
|
-
font-size: 62.5%;
|
|
40
|
-
|
|
41
|
-
--cor-primaria: #00e01d;
|
|
42
|
-
--cor-secundaria: #ebf1f2;
|
|
43
|
-
--cor-terciaria: #1b2f39;
|
|
44
|
-
|
|
45
|
-
--cor-fundo: #1b2f39;
|
|
46
|
-
|
|
47
|
-
--cor-selecao: #ccf9d2;
|
|
48
|
-
--cor-texto-selecao: #1b2f39;
|
|
49
|
-
--cor-texto: #f9f9f9;
|
|
50
|
-
|
|
51
|
-
--cor-apoio: #57676f;
|
|
52
|
-
--cor-linha: #e9eaeb;
|
|
53
|
-
|
|
54
|
-
--cor-importante: #bb0202;
|
|
55
|
-
--cor-alerta: #f0cc0d;
|
|
56
|
-
--cor-sucesso: #00a816;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
body {
|
|
60
|
-
font-family: var(--fonte);
|
|
61
|
-
font-size: 1.6rem;
|
|
62
|
-
font-weight: 300;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
h1 {
|
|
66
|
-
font-size: 2.4rem;
|
|
67
|
-
font-weight: 600;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
h2 {
|
|
71
|
-
font-size: 1.8rem;
|
|
72
|
-
font-weight: 600;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
h3 {
|
|
76
|
-
font-size: 1.4rem;
|
|
77
|
-
font-weight: 600;
|
|
78
|
-
margin: 0;
|
|
79
|
-
padding: 0;
|
|
80
|
-
line-height: 1em;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
h4 {
|
|
84
|
-
font-size: 1.2rem;
|
|
85
|
-
font-weight: 300;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.texto-pequeno {
|
|
89
|
-
font-size: 1rem;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.texto-medio {
|
|
93
|
-
font-size: 1.2rem;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.texto-grande {
|
|
97
|
-
font-size: 1.4rem;
|
|
98
|
-
}
|