@devix-tecnologia/timeline-vue 1.0.1 → 1.1.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/README.md +138 -11
- package/dist/style.css +1 -1
- package/dist/timeline-vue.es.js +293 -256
- package/dist/types/components/timeline/atomos/AvatarTimeline.vue.d.ts +0 -1
- package/dist/types/components/timeline/atomos/BoxData.vue.d.ts +0 -1
- package/dist/types/components/timeline/atomos/Destaque.vue.d.ts +0 -1
- package/dist/types/components/timeline/atomos/Hora.vue.d.ts +0 -2
- package/dist/types/components/timeline/atomos/IconeCategoria.vue.d.ts +2 -3
- package/dist/types/components/timeline/atomos/IconeStatus.vue.d.ts +0 -1
- package/dist/types/components/timeline/atomos/SubtituloEvento.vue.d.ts +0 -1
- package/dist/types/components/timeline/atomos/TituloEvento.vue.d.ts +0 -1
- package/dist/types/components/timeline/moleculas/DescricaoEvento.vue.d.ts +0 -1
- package/dist/types/components/timeline/moleculas/EventoTimeline.vue.d.ts +84 -5
- package/dist/types/components/timeline/moleculas/HoraEvento.vue.d.ts +5 -3
- package/dist/types/components/timeline/moleculas/PerfilTimeline.vue.d.ts +0 -2
- package/dist/types/components/timeline/moleculas/SeparadorPeriodo.vue.d.ts +3 -7
- package/dist/types/components/timeline/moleculas/Topo.vue.d.ts +0 -1
- package/dist/types/components/timeline/organismos/Timeline.vue.d.ts +2 -5
- package/dist/types/components/timeline/type.d.ts +10 -7
- package/package.json +2 -2
- package/src/components/timeline/atomos/Destaque.vue +3 -3
- package/src/components/timeline/atomos/Hora.vue +7 -10
- package/src/components/timeline/atomos/IconeCategoria.vue +6 -6
- package/src/components/timeline/atomos/IconeStatus.vue +17 -16
- package/src/components/timeline/moleculas/DescricaoEvento.vue +5 -5
- package/src/components/timeline/moleculas/EventoTimeline.stories.ts +49 -49
- package/src/components/timeline/moleculas/EventoTimeline.vue +82 -26
- package/src/components/timeline/moleculas/HoraEvento.vue +5 -4
- package/src/components/timeline/moleculas/PerfilTimeline.vue +2 -3
- package/src/components/timeline/moleculas/SeparadorPeriodo.vue +26 -27
- package/src/components/timeline/organismos/Timeline.mock.ts +87 -57
- package/src/components/timeline/organismos/Timeline.stories.ts +22 -5
- package/src/components/timeline/organismos/Timeline.vue +97 -73
- package/src/components/timeline/type.ts +11 -7
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import EventoTimeline from
|
|
2
|
-
import { Meta, StoryFn } from
|
|
1
|
+
import EventoTimeline from "./EventoTimeline.vue";
|
|
2
|
+
import { Meta, StoryFn } from "@storybook/vue3";
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
title:
|
|
5
|
+
title: "Devix/Timeline/Moleculas/EventoTimeline",
|
|
6
6
|
component: EventoTimeline,
|
|
7
7
|
argTypes: {
|
|
8
8
|
status: {
|
|
9
|
-
control: { type:
|
|
10
|
-
options: [
|
|
9
|
+
control: { type: "select" },
|
|
10
|
+
options: ["planejado", "realizado", "cancelado", "adiado", "atrasado"],
|
|
11
11
|
},
|
|
12
12
|
criticidade: {
|
|
13
|
-
control: { type:
|
|
14
|
-
options: [
|
|
13
|
+
control: { type: "select" },
|
|
14
|
+
options: ["normal", "media", "alta"],
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
} as Meta<typeof EventoTimeline>;
|
|
@@ -21,74 +21,74 @@ const Template: StoryFn<typeof EventoTimeline> = (args) => ({
|
|
|
21
21
|
setup() {
|
|
22
22
|
return { args };
|
|
23
23
|
},
|
|
24
|
-
template:
|
|
24
|
+
template:
|
|
25
|
+
'<EventoTimeline :status="args.status" :criticidade="args.criticidade" :ehAtual="args.ehAtual" :previsto="args.previsto" :realizado="args.realizado" :categoria="args.categoria" :titulo="args.titulo" :subtitulo="args.subtitulo" :destaque="args.destaque" />',
|
|
25
26
|
});
|
|
26
27
|
|
|
27
28
|
export const Padrao = Template.bind({});
|
|
28
29
|
Padrao.args = {
|
|
29
|
-
previsto:
|
|
30
|
-
realizado:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
destaque: 'Estava passando mal',
|
|
30
|
+
previsto: new Date("2023-04-19T11:00Z"),
|
|
31
|
+
realizado: "",
|
|
32
|
+
titulo: "Consulta Clinico geral",
|
|
33
|
+
subtitulo: "Posto de saúde do bairro",
|
|
34
|
+
destaque: "Estava passando mal",
|
|
35
35
|
categoria: {
|
|
36
|
-
nome:
|
|
37
|
-
icone:
|
|
36
|
+
nome: "Cardiologista",
|
|
37
|
+
icone: "cardiology",
|
|
38
38
|
},
|
|
39
|
-
status:
|
|
40
|
-
criticidade:
|
|
39
|
+
status: "planejado",
|
|
40
|
+
criticidade: "media",
|
|
41
41
|
acao: false,
|
|
42
|
+
ehAtual: false,
|
|
42
43
|
};
|
|
43
44
|
|
|
44
45
|
export const Atual = Template.bind({});
|
|
45
46
|
Atual.args = {
|
|
46
|
-
previsto:
|
|
47
|
-
realizado:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
destaque: '',
|
|
47
|
+
previsto: new Date("2023-04-19T10:00Z"),
|
|
48
|
+
realizado: "",
|
|
49
|
+
titulo: "Consulta",
|
|
50
|
+
subtitulo: "Posto de saúde",
|
|
51
|
+
destaque: "",
|
|
52
52
|
categoria: {
|
|
53
|
-
nome:
|
|
54
|
-
icone:
|
|
53
|
+
nome: "Tele consulta",
|
|
54
|
+
icone: "call",
|
|
55
55
|
},
|
|
56
|
-
status:
|
|
57
|
-
criticidade:
|
|
56
|
+
status: "realizado",
|
|
57
|
+
criticidade: "alta",
|
|
58
58
|
acao: false,
|
|
59
|
-
|
|
59
|
+
ehAtual: true,
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
export const Importante = Template.bind({});
|
|
63
63
|
Importante.args = {
|
|
64
|
-
previsto:
|
|
65
|
-
realizado:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
destaque: '',
|
|
64
|
+
previsto: new Date("2023-04-19T18:00Z"),
|
|
65
|
+
realizado: "",
|
|
66
|
+
titulo: "Consulta cardiologista",
|
|
67
|
+
subtitulo: "Posto de saúde do bairro",
|
|
68
|
+
destaque: "",
|
|
70
69
|
categoria: {
|
|
71
|
-
nome:
|
|
72
|
-
icone:
|
|
70
|
+
nome: "Cardiologista",
|
|
71
|
+
icone: "cardiology",
|
|
73
72
|
},
|
|
74
|
-
status:
|
|
75
|
-
criticidade:
|
|
73
|
+
status: "planejado",
|
|
74
|
+
criticidade: "alta",
|
|
76
75
|
acao: false,
|
|
76
|
+
ehAtual: false,
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
export const Realizado = Template.bind({});
|
|
80
80
|
Realizado.args = {
|
|
81
|
-
previsto:
|
|
82
|
-
realizado:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
destaque: '',
|
|
81
|
+
previsto: new Date("2023-04-20T12:30Z"),
|
|
82
|
+
realizado: "",
|
|
83
|
+
titulo: "Vacina da gripe",
|
|
84
|
+
subtitulo: "Posto de saúde do bairro",
|
|
85
|
+
destaque: "",
|
|
87
86
|
categoria: {
|
|
88
|
-
nome:
|
|
89
|
-
icone:
|
|
87
|
+
nome: "Vacina",
|
|
88
|
+
icone: "vaccines",
|
|
90
89
|
},
|
|
91
|
-
status:
|
|
92
|
-
criticidade:
|
|
90
|
+
status: "realizado",
|
|
91
|
+
criticidade: "media",
|
|
93
92
|
acao: true,
|
|
93
|
+
ehAtual: false,
|
|
94
94
|
};
|
|
@@ -1,41 +1,74 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<article
|
|
3
3
|
class="eventoTimeline"
|
|
4
|
-
:class="[
|
|
5
|
-
|
|
6
|
-
'criticidade-' + dadosEvento.valor.criticidade,
|
|
7
|
-
eventoSelecionado,
|
|
8
|
-
]"
|
|
4
|
+
:class="[status, 'criticidade-' + criticidade, eventoSelecionado, clicavel]"
|
|
5
|
+
:onclick="aoCLicar"
|
|
9
6
|
>
|
|
10
|
-
<IconeStatus :status="
|
|
11
|
-
<HoraEvento
|
|
12
|
-
:horaPrevista="dadosEvento.valor.previsto"
|
|
13
|
-
:horaRealizada="dadosEvento.valor.realizado"
|
|
14
|
-
/>
|
|
7
|
+
<IconeStatus :status="status" />
|
|
8
|
+
<HoraEvento :horaPrevista="previsto" :horaRealizada="realizado" />
|
|
15
9
|
<IconeCategoria
|
|
16
|
-
:iconeCategoria="
|
|
17
|
-
:categoria="
|
|
18
|
-
/>
|
|
19
|
-
<DescricaoEvento
|
|
20
|
-
:titulo="dadosEvento.valor.titulo"
|
|
21
|
-
:subtitulo="dadosEvento.valor.subtitulo"
|
|
10
|
+
:iconeCategoria="categoria.icone"
|
|
11
|
+
:categoria="categoria.nome"
|
|
22
12
|
/>
|
|
23
|
-
<
|
|
13
|
+
<DescricaoEvento :titulo="titulo" :subtitulo="subtitulo" />
|
|
14
|
+
<Destaque :destaque="destaque" />
|
|
24
15
|
</article>
|
|
25
16
|
</template>
|
|
26
17
|
<script lang="ts">
|
|
27
|
-
import { defineComponent, computed } from "vue";
|
|
18
|
+
import { defineComponent, computed, PropType } from "vue";
|
|
28
19
|
import IconeCategoria from "../atomos/IconeCategoria.vue";
|
|
29
20
|
import IconeStatus from "../atomos/IconeStatus.vue";
|
|
30
21
|
import DescricaoEvento from "./DescricaoEvento.vue";
|
|
31
22
|
import HoraEvento from "./HoraEvento.vue";
|
|
32
23
|
import Destaque from "../atomos/Destaque.vue";
|
|
24
|
+
// import { Evento, Categoria } from "../type";
|
|
25
|
+
|
|
26
|
+
interface Categoria {
|
|
27
|
+
nome: string;
|
|
28
|
+
icone: string;
|
|
29
|
+
}
|
|
33
30
|
|
|
34
31
|
export default defineComponent({
|
|
35
32
|
props: {
|
|
36
|
-
|
|
33
|
+
status: {
|
|
34
|
+
required: true,
|
|
35
|
+
type: String,
|
|
36
|
+
},
|
|
37
|
+
criticidade: {
|
|
38
|
+
required: true,
|
|
39
|
+
type: String,
|
|
40
|
+
},
|
|
41
|
+
ehAtual: {
|
|
37
42
|
required: true,
|
|
38
|
-
type:
|
|
43
|
+
type: Boolean,
|
|
44
|
+
},
|
|
45
|
+
previsto: {
|
|
46
|
+
required: true,
|
|
47
|
+
type: Date,
|
|
48
|
+
},
|
|
49
|
+
realizado: {
|
|
50
|
+
required: false,
|
|
51
|
+
type: Date as PropType<Date | null>,
|
|
52
|
+
},
|
|
53
|
+
categoria: {
|
|
54
|
+
required: true,
|
|
55
|
+
type: Object as () => Categoria,
|
|
56
|
+
},
|
|
57
|
+
titulo: {
|
|
58
|
+
required: true,
|
|
59
|
+
type: String,
|
|
60
|
+
},
|
|
61
|
+
subtitulo: {
|
|
62
|
+
required: true,
|
|
63
|
+
type: String,
|
|
64
|
+
},
|
|
65
|
+
destaque: {
|
|
66
|
+
required: true,
|
|
67
|
+
type: String,
|
|
68
|
+
},
|
|
69
|
+
aoCLicar: {
|
|
70
|
+
required: false,
|
|
71
|
+
type: Function as PropType<VoidFunction>,
|
|
39
72
|
},
|
|
40
73
|
},
|
|
41
74
|
components: {
|
|
@@ -48,8 +81,11 @@ export default defineComponent({
|
|
|
48
81
|
setup(props) {
|
|
49
82
|
return {
|
|
50
83
|
eventoSelecionado: computed(() => ({
|
|
51
|
-
atual: props.
|
|
52
|
-
padrao: props.
|
|
84
|
+
atual: props.ehAtual,
|
|
85
|
+
padrao: props.ehAtual,
|
|
86
|
+
})),
|
|
87
|
+
clicavel: computed(() => ({
|
|
88
|
+
clicavel: props.aoCLicar !== undefined,
|
|
53
89
|
})),
|
|
54
90
|
};
|
|
55
91
|
},
|
|
@@ -64,6 +100,10 @@ export default defineComponent({
|
|
|
64
100
|
border-radius: 1rem;
|
|
65
101
|
}
|
|
66
102
|
|
|
103
|
+
.clicavel {
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
}
|
|
106
|
+
|
|
67
107
|
.eventoTimeline:hover {
|
|
68
108
|
background: #f9f9f9;
|
|
69
109
|
}
|
|
@@ -85,8 +125,8 @@ export default defineComponent({
|
|
|
85
125
|
position: absolute;
|
|
86
126
|
width: 2px;
|
|
87
127
|
top: 0;
|
|
88
|
-
height:
|
|
89
|
-
left: 11.
|
|
128
|
+
height: 2.5rem;
|
|
129
|
+
left: 11.9rem;
|
|
90
130
|
}
|
|
91
131
|
|
|
92
132
|
.eventoTimeline:after {
|
|
@@ -95,8 +135,24 @@ export default defineComponent({
|
|
|
95
135
|
display: block;
|
|
96
136
|
position: absolute;
|
|
97
137
|
width: 2px;
|
|
98
|
-
top:
|
|
138
|
+
top: 6.1rem;
|
|
99
139
|
bottom: 0;
|
|
100
|
-
left: 11.
|
|
140
|
+
left: 11.9rem;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.eventoTimeline.atrasado:before {
|
|
144
|
+
background: var(--cor-alerta);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.eventoTimeline.atrasado:after {
|
|
148
|
+
background: var(--cor-alerta);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.eventoTimeline.atrasado:before {
|
|
152
|
+
background: var(--cor-alerta);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.eventoTimeline.atrasado:after {
|
|
156
|
+
background: var(--cor-alerta);
|
|
101
157
|
}
|
|
102
158
|
</style>
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
</div>
|
|
24
24
|
</template>
|
|
25
25
|
<script lang="ts">
|
|
26
|
-
import { defineComponent } from
|
|
27
|
-
import Hora from
|
|
26
|
+
import { defineComponent, PropType } from "vue";
|
|
27
|
+
import Hora from "../atomos/Hora.vue";
|
|
28
28
|
|
|
29
29
|
export default defineComponent({
|
|
30
30
|
props: {
|
|
@@ -33,7 +33,8 @@ export default defineComponent({
|
|
|
33
33
|
required: true,
|
|
34
34
|
},
|
|
35
35
|
horaRealizada: {
|
|
36
|
-
|
|
36
|
+
required: false,
|
|
37
|
+
type: Date as PropType<Date | null>,
|
|
37
38
|
},
|
|
38
39
|
// aparencia: {
|
|
39
40
|
// type: String,
|
|
@@ -56,7 +57,7 @@ export default defineComponent({
|
|
|
56
57
|
display: table-cell;
|
|
57
58
|
vertical-align: top;
|
|
58
59
|
text-align: right;
|
|
59
|
-
padding:
|
|
60
|
+
padding: 2.4rem 0;
|
|
60
61
|
}
|
|
61
62
|
.horaEvento {
|
|
62
63
|
line-height: 1.4rem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<section
|
|
3
3
|
class="perfilTimeline"
|
|
4
4
|
ref="elementoFixo"
|
|
5
5
|
:style="style"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<AvatarTimeline v-if="imagemPerfil" :imagem="imagemPerfil" />
|
|
10
10
|
<AvatarTimeline v-else-if="iconePerfil" :icone="iconePerfil" />
|
|
11
11
|
<h2 class="nome">{{ nomePerfil }}</h2>
|
|
12
|
-
</
|
|
12
|
+
</section>
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
15
|
<script lang="ts">
|
|
@@ -68,7 +68,6 @@ export default defineComponent({
|
|
|
68
68
|
|
|
69
69
|
return {
|
|
70
70
|
style,
|
|
71
|
-
elementoFixo,
|
|
72
71
|
isFixed,
|
|
73
72
|
};
|
|
74
73
|
},
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="separadorPeriodo">
|
|
3
3
|
<div class="areaData">
|
|
4
|
-
<BoxData :dataNumero="
|
|
4
|
+
<BoxData :dataNumero="dataSeparador.getDate()" :aparencia="aparencia" />
|
|
5
5
|
</div>
|
|
6
|
-
<h3 class="titulo" :class="aparencia">
|
|
6
|
+
<h3 class="titulo" :class="aparencia">
|
|
7
|
+
{{ mesCorrente(dataSeparador.getMonth()) }} de
|
|
8
|
+
{{ dataSeparador.getFullYear() }}
|
|
9
|
+
</h3>
|
|
7
10
|
</div>
|
|
8
11
|
</template>
|
|
9
12
|
|
|
10
13
|
<script lang="ts">
|
|
11
|
-
import { defineComponent } from "vue";
|
|
14
|
+
import { defineComponent, ref } from "vue";
|
|
12
15
|
import BoxData from "../atomos/BoxData.vue";
|
|
13
16
|
|
|
14
17
|
export default defineComponent({
|
|
@@ -16,7 +19,7 @@ export default defineComponent({
|
|
|
16
19
|
props: {
|
|
17
20
|
dataSeparador: {
|
|
18
21
|
required: true,
|
|
19
|
-
type:
|
|
22
|
+
type: Date,
|
|
20
23
|
},
|
|
21
24
|
aparencia: {
|
|
22
25
|
type: String,
|
|
@@ -24,28 +27,24 @@ export default defineComponent({
|
|
|
24
27
|
},
|
|
25
28
|
components: { BoxData },
|
|
26
29
|
setup(props) {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
];
|
|
30
|
+
const arrayMes = new Array(12);
|
|
31
|
+
arrayMes[0] = "Janeiro";
|
|
32
|
+
arrayMes[1] = "Fevereiro";
|
|
33
|
+
arrayMes[2] = "Março";
|
|
34
|
+
arrayMes[3] = "Abril";
|
|
35
|
+
arrayMes[4] = "Maio";
|
|
36
|
+
arrayMes[5] = "Junho";
|
|
37
|
+
arrayMes[6] = "Julho";
|
|
38
|
+
arrayMes[7] = "Agosto";
|
|
39
|
+
arrayMes[8] = "Setembro";
|
|
40
|
+
arrayMes[9] = "Outubro";
|
|
41
|
+
arrayMes[10] = "Novembro";
|
|
42
|
+
arrayMes[11] = "Dezembro";
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const mes = numeroMes[data.getMonth()];
|
|
47
|
-
const dia = data.getDate();
|
|
48
|
-
return { dataRecebida, ano, mes, dia };
|
|
44
|
+
const mesCorrente = (mes: number) => {
|
|
45
|
+
return arrayMes[mes];
|
|
46
|
+
};
|
|
47
|
+
return { mesCorrente };
|
|
49
48
|
},
|
|
50
49
|
});
|
|
51
50
|
</script>
|
|
@@ -75,7 +74,7 @@ export default defineComponent({
|
|
|
75
74
|
width: 2px;
|
|
76
75
|
height: 2.5rem;
|
|
77
76
|
top: 0;
|
|
78
|
-
left: 11.
|
|
77
|
+
left: 11.9rem;
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
.areaData:after {
|
|
@@ -86,7 +85,7 @@ export default defineComponent({
|
|
|
86
85
|
width: 2px;
|
|
87
86
|
height: 2.5rem;
|
|
88
87
|
bottom: 0;
|
|
89
|
-
left: 11.
|
|
88
|
+
left: 11.9rem;
|
|
90
89
|
}
|
|
91
90
|
|
|
92
91
|
.separadorPeriodo .titulo {
|