@devix-tecnologia/timeline-vue 1.0.2 → 1.1.1

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.
Files changed (34) hide show
  1. package/README.md +148 -11
  2. package/dist/style.css +1 -1
  3. package/dist/timeline-vue.es.js +283 -256
  4. package/dist/types/components/timeline/atomos/AvatarTimeline.vue.d.ts +0 -1
  5. package/dist/types/components/timeline/atomos/BoxData.vue.d.ts +0 -1
  6. package/dist/types/components/timeline/atomos/Destaque.vue.d.ts +0 -1
  7. package/dist/types/components/timeline/atomos/Hora.vue.d.ts +0 -2
  8. package/dist/types/components/timeline/atomos/IconeCategoria.vue.d.ts +2 -3
  9. package/dist/types/components/timeline/atomos/IconeStatus.vue.d.ts +0 -1
  10. package/dist/types/components/timeline/atomos/SubtituloEvento.vue.d.ts +0 -1
  11. package/dist/types/components/timeline/atomos/TituloEvento.vue.d.ts +0 -1
  12. package/dist/types/components/timeline/moleculas/DescricaoEvento.vue.d.ts +0 -1
  13. package/dist/types/components/timeline/moleculas/EventoTimeline.vue.d.ts +84 -5
  14. package/dist/types/components/timeline/moleculas/HoraEvento.vue.d.ts +5 -3
  15. package/dist/types/components/timeline/moleculas/PerfilTimeline.vue.d.ts +0 -3
  16. package/dist/types/components/timeline/moleculas/SeparadorPeriodo.vue.d.ts +3 -7
  17. package/dist/types/components/timeline/moleculas/Topo.vue.d.ts +0 -1
  18. package/dist/types/components/timeline/organismos/Timeline.vue.d.ts +2 -5
  19. package/dist/types/components/timeline/type.d.ts +10 -7
  20. package/package.json +1 -1
  21. package/src/components/timeline/atomos/Destaque.vue +3 -3
  22. package/src/components/timeline/atomos/Hora.vue +7 -10
  23. package/src/components/timeline/atomos/IconeCategoria.vue +6 -6
  24. package/src/components/timeline/atomos/IconeStatus.vue +17 -16
  25. package/src/components/timeline/moleculas/DescricaoEvento.vue +5 -5
  26. package/src/components/timeline/moleculas/EventoTimeline.stories.ts +49 -49
  27. package/src/components/timeline/moleculas/EventoTimeline.vue +82 -26
  28. package/src/components/timeline/moleculas/HoraEvento.vue +5 -4
  29. package/src/components/timeline/moleculas/PerfilTimeline.vue +2 -29
  30. package/src/components/timeline/moleculas/SeparadorPeriodo.vue +26 -27
  31. package/src/components/timeline/organismos/Timeline.mock.ts +87 -57
  32. package/src/components/timeline/organismos/Timeline.stories.ts +22 -5
  33. package/src/components/timeline/organismos/Timeline.vue +102 -73
  34. package/src/components/timeline/type.ts +11 -7
@@ -1,5 +1,5 @@
1
- import { defineComponent as u, reactive as P, computed as y, openBlock as o, createElementBlock as i, createElementVNode as h, normalizeClass as b, normalizeStyle as C, toDisplayString as g, resolveComponent as p, createVNode as m, createBlock as E, createCommentVNode as T, ref as D, onMounted as z, onUnmounted as j, Fragment as H, renderList as O } from "vue";
2
- const w = u({
1
+ import { defineComponent as d, reactive as C, computed as y, openBlock as a, createElementBlock as i, createElementVNode as T, normalizeClass as q, normalizeStyle as z, toDisplayString as v, resolveComponent as p, createVNode as g, ref as j, createBlock as b, createCommentVNode as E, Fragment as B, renderList as H } from "vue";
2
+ const M = d({
3
3
  name: "categoria",
4
4
  props: {
5
5
  iconeCategoria: {
@@ -24,7 +24,7 @@ const w = u({
24
24
  }
25
25
  },
26
26
  setup(e) {
27
- return e = P(e), {
27
+ return e = C(e), {
28
28
  classes: y(() => ({
29
29
  "bg-escuro": e.escuro,
30
30
  "bg-claro": !e.escuro,
@@ -37,24 +37,24 @@ const w = u({
37
37
  };
38
38
  }
39
39
  });
40
- const _ = (e, n) => {
41
- const t = e.__vccOpts || e;
42
- for (const [a, s] of n)
43
- t[a] = s;
44
- return t;
45
- }, B = { class: "areaCategoria" }, F = ["alt"], M = { class: "material-symbols-outlined" };
46
- function R(e, n, t, a, s, c) {
47
- return o(), i("div", B, [
48
- h("div", {
49
- class: b(["iconeCategoria", e.classes]),
50
- style: C(e.style),
40
+ const _ = (e, t) => {
41
+ const r = e.__vccOpts || e;
42
+ for (const [s, l] of t)
43
+ r[s] = l;
44
+ return r;
45
+ }, O = { class: "areaCategoria" }, N = ["alt"], L = { class: "material-symbols-outlined" };
46
+ function R(e, t, r, s, l, u) {
47
+ return a(), i("div", O, [
48
+ T("div", {
49
+ class: q(["iconeCategoria", e.classes]),
50
+ style: z(e.style),
51
51
  alt: e.categoria
52
52
  }, [
53
- h("span", M, g(e.iconeCategoria), 1)
54
- ], 14, F)
53
+ T("span", L, v(e.iconeCategoria), 1)
54
+ ], 14, N)
55
55
  ]);
56
56
  }
57
- const A = /* @__PURE__ */ _(w, [["render", R], ["__scopeId", "data-v-596712b7"]]), N = u({
57
+ const F = /* @__PURE__ */ _(M, [["render", R], ["__scopeId", "data-v-01127706"]]), w = d({
58
58
  name: "status",
59
59
  props: {
60
60
  status: {
@@ -64,19 +64,19 @@ const A = /* @__PURE__ */ _(w, [["render", R], ["__scopeId", "data-v-596712b7"]]
64
64
  },
65
65
  components: {},
66
66
  setup(e) {
67
- return e = P(e), {
67
+ return e = C(e), {
68
68
  classes: y(() => ({
69
69
  [`${e.status || "planejado"}`]: !0
70
70
  }))
71
71
  };
72
72
  }
73
73
  });
74
- function V(e, n, t, a, s, c) {
75
- return o(), i("div", {
76
- class: b([e.classes, "iconeStatus"])
74
+ function V(e, t, r, s, l, u) {
75
+ return a(), i("div", {
76
+ class: q([e.classes, "iconeStatus"])
77
77
  }, null, 2);
78
78
  }
79
- const Y = /* @__PURE__ */ _(N, [["render", V], ["__scopeId", "data-v-f9b2f36c"]]), L = u({
79
+ const J = /* @__PURE__ */ _(w, [["render", V], ["__scopeId", "data-v-22a8820e"]]), Y = d({
80
80
  props: {
81
81
  subtitulo: {
82
82
  required: !0,
@@ -88,11 +88,11 @@ const Y = /* @__PURE__ */ _(N, [["render", V], ["__scopeId", "data-v-f9b2f36c"]]
88
88
  return {};
89
89
  }
90
90
  });
91
- const U = { class: "subtitulo" };
92
- function G(e, n, t, a, s, c) {
93
- return o(), i("h4", U, g(e.subtitulo), 1);
91
+ const G = { class: "subtitulo" };
92
+ function K(e, t, r, s, l, u) {
93
+ return a(), i("h4", G, v(e.subtitulo), 1);
94
94
  }
95
- const J = /* @__PURE__ */ _(L, [["render", G], ["__scopeId", "data-v-f5319628"]]), K = u({
95
+ const Q = /* @__PURE__ */ _(Y, [["render", K], ["__scopeId", "data-v-f5319628"]]), U = d({
96
96
  props: {
97
97
  titulo: {
98
98
  required: !0,
@@ -104,11 +104,11 @@ const J = /* @__PURE__ */ _(L, [["render", G], ["__scopeId", "data-v-f5319628"]]
104
104
  return {};
105
105
  }
106
106
  });
107
- const Q = { class: "titulo" };
108
- function W(e, n, t, a, s, c) {
109
- return o(), i("h3", Q, g(e.titulo), 1);
107
+ const W = { class: "titulo" };
108
+ function X(e, t, r, s, l, u) {
109
+ return a(), i("h3", W, v(e.titulo), 1);
110
110
  }
111
- const X = /* @__PURE__ */ _(K, [["render", W], ["__scopeId", "data-v-fce23b0e"]]), Z = u({
111
+ const Z = /* @__PURE__ */ _(U, [["render", X], ["__scopeId", "data-v-fce23b0e"]]), x = d({
112
112
  props: {
113
113
  titulo: {
114
114
  required: !0,
@@ -119,29 +119,29 @@ const X = /* @__PURE__ */ _(K, [["render", W], ["__scopeId", "data-v-fce23b0e"]]
119
119
  type: String
120
120
  }
121
121
  },
122
- components: { TituloEvento: X, SubtituloEvento: J },
122
+ components: { TituloEvento: Z, SubtituloEvento: Q },
123
123
  setup() {
124
124
  return {};
125
125
  }
126
126
  });
127
- const x = {
127
+ const ee = {
128
128
  key: 0,
129
129
  class: "descricaoEvento"
130
- }, ee = {
130
+ }, te = {
131
131
  key: 1,
132
132
  class: "descricaoEvento",
133
- style: { "padding-top": "2.3rem" }
133
+ style: { "padding-top": "3.3rem" }
134
134
  };
135
- function te(e, n, t, a, s, c) {
136
- const r = p("TituloEvento"), S = p("SubtituloEvento");
137
- return e.subtitulo ? (o(), i("div", x, [
138
- m(r, { titulo: e.titulo }, null, 8, ["titulo"]),
139
- m(S, { subtitulo: e.subtitulo }, null, 8, ["subtitulo"])
140
- ])) : (o(), i("div", ee, [
141
- m(r, { titulo: e.titulo }, null, 8, ["titulo"])
135
+ function oe(e, t, r, s, l, u) {
136
+ const c = p("TituloEvento"), S = p("SubtituloEvento");
137
+ return e.subtitulo ? (a(), i("div", ee, [
138
+ g(c, { titulo: e.titulo }, null, 8, ["titulo"]),
139
+ g(S, { subtitulo: e.subtitulo }, null, 8, ["subtitulo"])
140
+ ])) : (a(), i("div", te, [
141
+ g(c, { titulo: e.titulo }, null, 8, ["titulo"])
142
142
  ]));
143
143
  }
144
- const oe = /* @__PURE__ */ _(Z, [["render", te], ["__scopeId", "data-v-57ec4748"]]), ne = u({
144
+ const ae = /* @__PURE__ */ _(x, [["render", oe], ["__scopeId", "data-v-bb6e1ced"]]), re = d({
145
145
  name: "hora",
146
146
  props: {
147
147
  hora: {
@@ -154,28 +154,27 @@ const oe = /* @__PURE__ */ _(Z, [["render", te], ["__scopeId", "data-v-57ec4748"
154
154
  },
155
155
  components: {},
156
156
  setup(e) {
157
- e = P(e);
158
- const n = e.hora, t = n.getHours(), a = n.getMinutes(), s = `${t}:${a.toString().padStart(2, "0")}`;
157
+ const t = j(e.aparencia);
159
158
  return {
160
159
  classes: y(() => ({
161
- [`hora-${e.aparencia || ""}`]: !0
162
- })),
163
- horaString: s
160
+ [`hora-${t || ""}`]: !0
161
+ }))
164
162
  };
165
163
  }
166
164
  });
167
- function ae(e, n, t, a, s, c) {
168
- return o(), i("div", {
169
- class: b(["hora", e.classes])
170
- }, g(e.horaString), 3);
165
+ function ne(e, t, r, s, l, u) {
166
+ return a(), i("div", {
167
+ class: q(["hora", e.classes])
168
+ }, v(e.hora.getHours()) + ":" + v(e.hora.getMinutes().toString().padStart(2, "0")), 3);
171
169
  }
172
- const se = /* @__PURE__ */ _(ne, [["render", ae], ["__scopeId", "data-v-c83864af"]]), re = u({
170
+ const se = /* @__PURE__ */ _(re, [["render", ne], ["__scopeId", "data-v-071a9ea4"]]), ie = d({
173
171
  props: {
174
172
  horaPrevista: {
175
173
  type: Date,
176
174
  required: !0
177
175
  },
178
176
  horaRealizada: {
177
+ required: !1,
179
178
  type: Date
180
179
  }
181
180
  // aparencia: {
@@ -187,22 +186,22 @@ const se = /* @__PURE__ */ _(ne, [["render", ae], ["__scopeId", "data-v-c83864af
187
186
  return {};
188
187
  }
189
188
  });
190
- const ie = { class: "areaHora" }, ce = { class: "horaEvento" };
191
- function le(e, n, t, a, s, c) {
192
- const r = p("Hora");
193
- return o(), i("div", ie, [
194
- h("div", ce, [
195
- e.horaRealizada ? (o(), E(r, {
189
+ const le = { class: "areaHora" }, ce = { class: "horaEvento" };
190
+ function ue(e, t, r, s, l, u) {
191
+ const c = p("Hora");
192
+ return a(), i("div", le, [
193
+ T("div", ce, [
194
+ e.horaRealizada ? (a(), b(c, {
196
195
  key: 0,
197
196
  class: "horaRealizada texto-grande",
198
197
  hora: e.horaRealizada,
199
198
  style: { "padding-top": "0.3rem" }
200
- }, null, 8, ["hora"])) : T("", !0),
201
- e.horaRealizada ? (o(), E(r, {
199
+ }, null, 8, ["hora"])) : E("", !0),
200
+ e.horaRealizada ? (a(), b(c, {
202
201
  key: 1,
203
202
  class: "horaPlanejada texto-pequeno",
204
203
  hora: e.horaPrevista
205
- }, null, 8, ["hora"])) : (o(), E(r, {
204
+ }, null, 8, ["hora"])) : (a(), b(c, {
206
205
  key: 2,
207
206
  class: "horaRealizada texto-grande",
208
207
  hora: e.horaPrevista,
@@ -211,7 +210,7 @@ function le(e, n, t, a, s, c) {
211
210
  ])
212
211
  ]);
213
212
  }
214
- const de = /* @__PURE__ */ _(re, [["render", le], ["__scopeId", "data-v-22e53379"]]), ue = u({
213
+ const de = /* @__PURE__ */ _(ie, [["render", ue], ["__scopeId", "data-v-04f44efd"]]), _e = d({
215
214
  name: "destaque",
216
215
  props: {
217
216
  destaque: {
@@ -223,63 +222,96 @@ const de = /* @__PURE__ */ _(re, [["render", le], ["__scopeId", "data-v-22e53379
223
222
  return {};
224
223
  }
225
224
  });
226
- const _e = { class: "destaqueEvento texto-pequeno" };
227
- function pe(e, n, t, a, s, c) {
228
- return o(), i("div", _e, g(e.destaque), 1);
225
+ const pe = { class: "destaqueEvento texto-pequeno" };
226
+ function me(e, t, r, s, l, u) {
227
+ return a(), i("div", pe, v(e.destaque), 1);
229
228
  }
230
- const me = /* @__PURE__ */ _(ue, [["render", pe], ["__scopeId", "data-v-c2b8e419"]]), ve = u({
229
+ const ve = /* @__PURE__ */ _(_e, [["render", me], ["__scopeId", "data-v-b0b0beb7"]]), fe = d({
231
230
  props: {
232
- dadosEvento: {
231
+ status: {
232
+ required: !0,
233
+ type: String
234
+ },
235
+ criticidade: {
236
+ required: !0,
237
+ type: String
238
+ },
239
+ ehAtual: {
240
+ required: !0,
241
+ type: Boolean
242
+ },
243
+ previsto: {
244
+ required: !0,
245
+ type: Date
246
+ },
247
+ realizado: {
248
+ required: !1,
249
+ type: Date
250
+ },
251
+ categoria: {
233
252
  required: !0,
234
253
  type: Object
254
+ },
255
+ titulo: {
256
+ required: !0,
257
+ type: String
258
+ },
259
+ subtitulo: {
260
+ required: !0,
261
+ type: String
262
+ },
263
+ destaque: {
264
+ required: !0,
265
+ type: String
266
+ },
267
+ aoCLicar: {
268
+ required: !1,
269
+ type: Function
235
270
  }
236
271
  },
237
272
  components: {
238
- IconeStatus: Y,
239
- IconeCategoria: A,
273
+ IconeStatus: J,
274
+ IconeCategoria: F,
240
275
  HoraEvento: de,
241
- DescricaoEvento: oe,
242
- Destaque: me
276
+ DescricaoEvento: ae,
277
+ Destaque: ve
243
278
  },
244
279
  setup(e) {
245
280
  return {
246
281
  eventoSelecionado: y(() => ({
247
- atual: e.dadosEvento.atual == !0,
248
- padrao: e.dadosEvento.atual == !1
282
+ atual: e.ehAtual,
283
+ padrao: e.ehAtual
284
+ })),
285
+ clicavel: y(() => ({
286
+ clicavel: e.aoCLicar !== void 0
249
287
  }))
250
288
  };
251
289
  }
252
290
  });
253
- function fe(e, n, t, a, s, c) {
254
- const r = p("IconeStatus"), S = p("HoraEvento"), d = p("IconeCategoria"), l = p("DescricaoEvento"), v = p("Destaque");
255
- return o(), i("article", {
256
- class: b(["eventoTimeline", [
257
- e.dadosEvento.valor.status,
258
- "criticidade-" + e.dadosEvento.valor.criticidade,
259
- e.eventoSelecionado
260
- ]])
291
+ const ge = ["onclick"];
292
+ function ye(e, t, r, s, l, u) {
293
+ const c = p("IconeStatus"), S = p("HoraEvento"), P = p("IconeCategoria"), o = p("DescricaoEvento"), n = p("Destaque");
294
+ return a(), i("article", {
295
+ class: q(["eventoTimeline", [e.status, "criticidade-" + e.criticidade, e.eventoSelecionado, e.clicavel]]),
296
+ onclick: e.aoCLicar
261
297
  }, [
262
- m(r, {
263
- status: e.dadosEvento.valor.status
264
- }, null, 8, ["status"]),
265
- m(S, {
266
- horaPrevista: e.dadosEvento.valor.previsto,
267
- horaRealizada: e.dadosEvento.valor.realizado
298
+ g(c, { status: e.status }, null, 8, ["status"]),
299
+ g(S, {
300
+ horaPrevista: e.previsto,
301
+ horaRealizada: e.realizado
268
302
  }, null, 8, ["horaPrevista", "horaRealizada"]),
269
- m(d, {
270
- iconeCategoria: e.dadosEvento.valor.categoria.icone,
271
- categoria: e.dadosEvento.valor.categoria.nome
303
+ g(P, {
304
+ iconeCategoria: e.categoria.icone,
305
+ categoria: e.categoria.nome
272
306
  }, null, 8, ["iconeCategoria", "categoria"]),
273
- m(l, {
274
- titulo: e.dadosEvento.valor.titulo,
275
- subtitulo: e.dadosEvento.valor.subtitulo
307
+ g(o, {
308
+ titulo: e.titulo,
309
+ subtitulo: e.subtitulo
276
310
  }, null, 8, ["titulo", "subtitulo"]),
277
- m(v, {
278
- destaque: e.dadosEvento.valor.destaque
279
- }, null, 8, ["destaque"])
280
- ], 2);
311
+ g(n, { destaque: e.destaque }, null, 8, ["destaque"])
312
+ ], 10, ge);
281
313
  }
282
- const ge = /* @__PURE__ */ _(ve, [["render", fe], ["__scopeId", "data-v-54059adf"]]), $e = u({
314
+ const $e = /* @__PURE__ */ _(fe, [["render", ye], ["__scopeId", "data-v-1d1f6a39"]]), he = d({
283
315
  name: "BoxData",
284
316
  props: {
285
317
  dataNumero: {
@@ -292,64 +324,51 @@ const ge = /* @__PURE__ */ _(ve, [["render", fe], ["__scopeId", "data-v-54059adf
292
324
  },
293
325
  components: {},
294
326
  setup(e) {
295
- return e = P(e), {
327
+ return e = C(e), {
296
328
  classes: y(() => ({
297
329
  [`${e.aparencia || "padrao"}`]: !0
298
330
  }))
299
331
  };
300
332
  }
301
333
  });
302
- function ye(e, n, t, a, s, c) {
303
- return o(), i("h3", {
304
- class: b(["boxData padrao", e.classes])
305
- }, g(e.dataNumero), 3);
334
+ function be(e, t, r, s, l, u) {
335
+ return a(), i("h3", {
336
+ class: q(["boxData padrao", e.classes])
337
+ }, v(e.dataNumero), 3);
306
338
  }
307
- const he = /* @__PURE__ */ _($e, [["render", ye], ["__scopeId", "data-v-5e2b8273"]]), be = u({
339
+ const Se = /* @__PURE__ */ _(he, [["render", be], ["__scopeId", "data-v-5e2b8273"]]), Te = d({
308
340
  name: "SeparadorPeriodo",
309
341
  props: {
310
342
  dataSeparador: {
311
343
  required: !0,
312
- type: String
344
+ type: Date
313
345
  },
314
346
  aparencia: {
315
347
  type: String
316
348
  }
317
349
  },
318
- components: { BoxData: he },
350
+ components: { BoxData: Se },
319
351
  setup(e) {
320
- const n = [
321
- "janeiro",
322
- "fevereiro",
323
- "março",
324
- "abril",
325
- "maio",
326
- "junho",
327
- "julho",
328
- "agosto",
329
- "setembro",
330
- "outubro",
331
- "novembro",
332
- "dezembro"
333
- ], t = e.dataSeparador, a = new Date(t), s = a.getFullYear(), c = n[a.getMonth()], r = a.getDate();
334
- return { dataRecebida: t, ano: s, mes: c, dia: r };
352
+ const t = new Array(12);
353
+ return t[0] = "Janeiro", t[1] = "Fevereiro", t[2] = "Março", t[3] = "Abril", t[4] = "Maio", t[5] = "Junho", t[6] = "Julho", t[7] = "Agosto", t[8] = "Setembro", t[9] = "Outubro", t[10] = "Novembro", t[11] = "Dezembro", { mesCorrente: (s) => t[s] };
335
354
  }
336
355
  });
337
- const Se = { class: "separadorPeriodo" }, Ee = { class: "areaData" };
338
- function Te(e, n, t, a, s, c) {
339
- const r = p("BoxData");
340
- return o(), i("div", Se, [
341
- h("div", Ee, [
342
- m(r, {
343
- dataNumero: e.dia,
356
+ const qe = { class: "separadorPeriodo" }, Pe = { class: "areaData" };
357
+ function Ee(e, t, r, s, l, u) {
358
+ const c = p("BoxData");
359
+ return a(), i("div", qe, [
360
+ T("div", Pe, [
361
+ g(c, {
362
+ dataNumero: e.dataSeparador.getDate(),
344
363
  aparencia: e.aparencia
345
364
  }, null, 8, ["dataNumero", "aparencia"])
346
365
  ]),
347
- h("h3", {
348
- class: b(["titulo", e.aparencia])
349
- }, g(e.mes) + " de " + g(e.ano), 3)
366
+ T("h3", {
367
+ class: q(["titulo", e.aparencia])
368
+ }, v(e.mesCorrente(e.dataSeparador.getMonth())) + " de " + v(e.dataSeparador.getFullYear()), 3)
350
369
  ]);
351
370
  }
352
- const Pe = /* @__PURE__ */ _(be, [["render", Te], ["__scopeId", "data-v-35229a33"]]), ke = u({
371
+ const Ce = /* @__PURE__ */ _(Te, [["render", Ee], ["__scopeId", "data-v-de9ead2d"]]), ke = d({
353
372
  props: {
354
373
  imagem: {
355
374
  type: String
@@ -362,20 +381,20 @@ const Pe = /* @__PURE__ */ _(be, [["render", Te], ["__scopeId", "data-v-35229a33
362
381
  return {};
363
382
  }
364
383
  });
365
- const qe = { class: "avatar" }, De = ["src"], Ie = {
384
+ const De = { class: "avatar" }, Ie = ["src"], ze = {
366
385
  key: 1,
367
386
  class: "material-symbols-outlined"
368
387
  };
369
- function Ce(e, n, t, a, s, c) {
370
- return o(), i("div", qe, [
371
- e.imagem ? (o(), i("img", {
388
+ function Ae(e, t, r, s, l, u) {
389
+ return a(), i("div", De, [
390
+ e.imagem ? (a(), i("img", {
372
391
  key: 0,
373
392
  src: e.imagem
374
- }, null, 8, De)) : e.icone ? (o(), i("span", Ie, g(e.icone), 1)) : T("", !0)
393
+ }, null, 8, Ie)) : e.icone ? (a(), i("span", ze, v(e.icone), 1)) : E("", !0)
375
394
  ]);
376
395
  }
377
- const ze = /* @__PURE__ */ _(ke, [["render", Ce], ["__scopeId", "data-v-a913d26b"]]), je = u({
378
- components: { AvatarTimeline: ze },
396
+ const je = /* @__PURE__ */ _(ke, [["render", Ae], ["__scopeId", "data-v-a913d26b"]]), Be = d({
397
+ components: { AvatarTimeline: je },
379
398
  props: {
380
399
  imagemPerfil: {
381
400
  type: String
@@ -392,45 +411,32 @@ const ze = /* @__PURE__ */ _(ke, [["render", Ce], ["__scopeId", "data-v-a913d26b
392
411
  }
393
412
  },
394
413
  setup(e) {
395
- e = P(e);
396
- const n = y(() => ({
397
- backgroundColor: e.backgroundColor
398
- })), t = D(null), a = D(!1), s = () => {
399
- if (t.value) {
400
- const c = window.pageYOffset || document.documentElement.scrollTop, r = t.value.offsetTop;
401
- a.value = c > r;
402
- }
403
- };
404
- return z(() => {
405
- window.addEventListener("scroll", s);
406
- }), j(() => {
407
- window.removeEventListener("scroll", s);
408
- }), {
409
- style: n,
410
- elementoFixo: t,
411
- isFixed: a
414
+ return e = C(e), {
415
+ style: y(() => ({
416
+ backgroundColor: e.backgroundColor
417
+ }))
412
418
  };
413
419
  }
414
420
  });
415
421
  const He = { class: "nome" };
416
- function Oe(e, n, t, a, s, c) {
417
- const r = p("AvatarTimeline");
418
- return o(), i("div", {
419
- class: b(["perfilTimeline", { fixed: e.isFixed }]),
422
+ function Me(e, t, r, s, l, u) {
423
+ const c = p("AvatarTimeline");
424
+ return a(), i("section", {
425
+ class: "perfilTimeline fixed",
420
426
  ref: "elementoFixo",
421
- style: C(e.style)
427
+ style: z(e.style)
422
428
  }, [
423
- e.imagemPerfil ? (o(), E(r, {
429
+ e.imagemPerfil ? (a(), b(c, {
424
430
  key: 0,
425
431
  imagem: e.imagemPerfil
426
- }, null, 8, ["imagem"])) : e.iconePerfil ? (o(), E(r, {
432
+ }, null, 8, ["imagem"])) : e.iconePerfil ? (a(), b(c, {
427
433
  key: 1,
428
434
  icone: e.iconePerfil
429
- }, null, 8, ["icone"])) : T("", !0),
430
- h("h2", He, g(e.nomePerfil), 1)
431
- ], 6);
435
+ }, null, 8, ["icone"])) : E("", !0),
436
+ T("h2", He, v(e.nomePerfil), 1)
437
+ ], 4);
432
438
  }
433
- const we = /* @__PURE__ */ _(je, [["render", Oe], ["__scopeId", "data-v-de2da009"]]), Be = u({
439
+ const Oe = /* @__PURE__ */ _(Be, [["render", Me], ["__scopeId", "data-v-9f148523"]]), Ne = d({
434
440
  props: {
435
441
  perfilTimeline: {
436
442
  required: !0,
@@ -440,118 +446,139 @@ const we = /* @__PURE__ */ _(je, [["render", Oe], ["__scopeId", "data-v-de2da009
440
446
  required: !0,
441
447
  type: Object
442
448
  }
443
- // ordem: {
444
- // required: false,
445
- // type: Ordem,
446
- // },
447
449
  },
448
450
  components: {
449
- PerfilTimeline: we,
450
- SeparadorPeriodo: Pe,
451
- EventoTimeline: ge
451
+ PerfilTimeline: Oe,
452
+ SeparadorPeriodo: Ce,
453
+ EventoTimeline: $e
452
454
  },
453
455
  setup(e) {
454
- const n = P(
456
+ const t = C(
455
457
  e.eventosTimeline
456
- ), t = n.sort(
457
- (d, l) => d.data.getTime() - l.data.getTime()
458
- ), a = (d, l) => {
459
- const v = d.getDay() === l.getDay(), f = d.getMonth() === l.getMonth(), $ = d.getFullYear() === l.getFullYear();
460
- return v && f && $;
461
- };
462
- function s(d) {
463
- if (d) {
464
- const l = Date.now();
465
- let v = null, f = [];
466
- for (const $ of d) {
467
- const k = $.data.getTime(), q = Math.abs(l - k);
468
- (v === null || q < v && k <= l) && (v = q, f.length = 0), ($.status === "planejado" || $.status === "atrasado") && f.push($);
469
- }
470
- return f;
471
- } else
472
- return console.log("vazio.. ", []), [];
458
+ );
459
+ let r = C(t);
460
+ function s() {
461
+ r = t;
462
+ const o = c(r);
463
+ r.map((n) => (o[0].id === n.id ? (n.atual = !0, n.scroll = !0, P()) : (n.atual = !1, n.scroll = !1), {
464
+ evento: n
465
+ }));
473
466
  }
474
- const c = s(t), r = c[0] ? c[0] : null;
475
- return {
476
- eventosPorTipo: y(() => {
477
- if (n) {
478
- let d = [], l = null, v = 0;
479
- for (const f of t) {
480
- const $ = f.data;
481
- (!l || !a(l, $)) && (l = $, d.push({
482
- tipo: "dia",
483
- valor: f.data,
484
- key: ++v
485
- })), d.push({
486
- tipo: "evento",
487
- valor: f,
488
- key: ++v,
489
- atual: r === null ? !1 : f.id === r.id
490
- });
467
+ const l = () => {
468
+ setInterval(s, 6e4);
469
+ }, u = (o, n) => {
470
+ const m = o.getDay() === n.getDay(), $ = o.getMonth() === n.getMonth(), f = o.getFullYear() === n.getFullYear();
471
+ return m && $ && f;
472
+ }, c = (o) => {
473
+ if (o) {
474
+ const n = Date.now();
475
+ let m = null, $ = [];
476
+ for (const f of o) {
477
+ const h = f.data.getTime();
478
+ if (f.status === "planejado" || f.status === "atrasado") {
479
+ const k = Math.abs(n - f.data.getTime());
480
+ if (m === null || k < m && h <= n)
481
+ m = k, $.length = 0;
482
+ else if (k > m)
483
+ continue;
484
+ $.push(f);
491
485
  }
492
- return d;
493
- } else
494
- return [];
495
- })
496
- };
497
- },
498
- methods: {
499
- scrollParaItemAtual() {
500
- const e = document.querySelector(".atual");
501
- e == null || e.scrollIntoView({
486
+ }
487
+ return $;
488
+ } else
489
+ return [];
490
+ }, S = y(() => {
491
+ l();
492
+ const o = r.sort(
493
+ (n, m) => n.data.getTime() - m.data.getTime()
494
+ );
495
+ if (o) {
496
+ let n = [], m = null, $ = 0, f;
497
+ for (const h of o) {
498
+ const k = /* @__PURE__ */ new Date(), D = h.data;
499
+ f = h.status;
500
+ const A = h.tolerancia * 60 * 1e3;
501
+ f === "planejado" && D.getTime() + A < k.getTime() && (h.status = "atrasado"), (!m || !u(m, D)) && (m = D, n.push({
502
+ tipo: "dia",
503
+ valor: h.data,
504
+ key: ++$
505
+ })), n.push({
506
+ tipo: "evento",
507
+ valor: h,
508
+ key: ++$
509
+ });
510
+ }
511
+ return n;
512
+ } else
513
+ return [];
514
+ }), P = () => {
515
+ const o = document.querySelector(".atual");
516
+ o == null || o.scrollIntoView({
502
517
  behavior: "smooth",
503
518
  block: "center"
504
519
  });
505
- }
520
+ };
521
+ return s(), {
522
+ eventosPorTipo: S,
523
+ scrollParaItemAtual: P
524
+ };
506
525
  },
507
526
  mounted() {
508
527
  this.scrollParaItemAtual();
509
528
  }
510
529
  });
511
- const Fe = { key: 0 }, Me = { key: 1 }, Re = { class: "timeline" };
512
- function Ae(e, n, t, a, s, c) {
513
- const r = p("PerfilTimeline"), S = p("SeparadorPeriodo"), d = p("EventoTimeline");
514
- return o(), i("div", null, [
515
- h("div", null, [
516
- e.perfilTimeline !== null ? (o(), E(r, {
517
- key: 0,
518
- nomePerfil: e.perfilTimeline.nome,
519
- imagemPerfil: e.perfilTimeline.imagem,
520
- iconePerfil: e.perfilTimeline.icone
521
- }, null, 8, ["nomePerfil", "imagemPerfil", "iconePerfil"])) : T("", !0)
522
- ]),
523
- (o(!0), i(H, null, O(e.eventosPorTipo, (l) => (o(), i("div", {
524
- key: l.key,
525
- class: "areaTimeline"
530
+ const Le = { class: "areaTimeline" };
531
+ function Re(e, t, r, s, l, u) {
532
+ const c = p("PerfilTimeline"), S = p("SeparadorPeriodo"), P = p("EventoTimeline");
533
+ return a(), i("div", Le, [
534
+ e.perfilTimeline !== null ? (a(), b(c, {
535
+ key: 0,
536
+ nomePerfil: e.perfilTimeline.nome,
537
+ imagemPerfil: e.perfilTimeline.imagem,
538
+ iconePerfil: e.perfilTimeline.icone
539
+ }, null, 8, ["nomePerfil", "imagemPerfil", "iconePerfil"])) : E("", !0),
540
+ T("section", {
541
+ class: q(["timeline", { marginTop: e.perfilTimeline !== null }])
526
542
  }, [
527
- l.tipo === "dia" ? (o(), i("div", Fe, [
528
- m(S, {
529
- dataSeparador: l.valor.toDateString()
530
- }, null, 8, ["dataSeparador"])
531
- ])) : T("", !0),
532
- l.tipo === "evento" ? (o(), i("div", Me, [
533
- h("section", Re, [
534
- m(d, { dadosEvento: l }, null, 8, ["dadosEvento"])
535
- ])
536
- ])) : T("", !0)
537
- ]))), 128))
543
+ (a(!0), i(B, null, H(e.eventosPorTipo, (o) => (a(), i("div", {
544
+ key: o.key
545
+ }, [
546
+ o.tipo === "dia" ? (a(), b(S, {
547
+ key: 0,
548
+ dataSeparador: o.valor
549
+ }, null, 8, ["dataSeparador"])) : E("", !0),
550
+ o.tipo === "evento" ? (a(), b(P, {
551
+ key: 1,
552
+ status: o.valor.status,
553
+ criticidade: o.valor.criticidade,
554
+ previsto: o.valor.previsto,
555
+ realizado: o.valor.realizado,
556
+ categoria: o.valor.categoria,
557
+ titulo: o.valor.titulo,
558
+ subtitulo: o.valor.subtitulo,
559
+ destaque: o.valor.destaque,
560
+ ehAtual: o.valor.atual,
561
+ aoCLicar: o.valor.aoCLicar
562
+ }, null, 8, ["status", "criticidade", "previsto", "realizado", "categoria", "titulo", "subtitulo", "destaque", "ehAtual", "aoCLicar"])) : E("", !0)
563
+ ]))), 128))
564
+ ], 2)
538
565
  ]);
539
566
  }
540
- const Ne = /* @__PURE__ */ _(Be, [["render", Ae], ["__scopeId", "data-v-53e26b04"]]), Ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
567
+ const Fe = /* @__PURE__ */ _(Ne, [["render", Re], ["__scopeId", "data-v-4245f5f5"]]), we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
541
568
  __proto__: null
542
569
  }, Symbol.toStringTag, { value: "Module" })), I = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
543
570
  __proto__: null,
544
- Timeline: Ne,
545
- Tipos: Ve
571
+ Timeline: Fe,
572
+ Tipos: we
546
573
  }, Symbol.toStringTag, { value: "Module" }));
547
- const Le = {
548
- install(e, ...n) {
549
- for (const t in I)
550
- e.component(t, I[t]);
574
+ const Je = {
575
+ install(e, ...t) {
576
+ for (const r in I)
577
+ e.component(r, I[r]);
551
578
  }
552
579
  };
553
580
  export {
554
- Ne as Timeline,
555
- Ve as Tipos,
556
- Le as default
581
+ Fe as Timeline,
582
+ we as Tipos,
583
+ Je as default
557
584
  };