@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.
Files changed (34) hide show
  1. package/README.md +138 -11
  2. package/dist/style.css +1 -1
  3. package/dist/timeline-vue.es.js +293 -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 -2
  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 +2 -2
  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 -3
  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 +97 -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 I, toDisplayString as g, resolveComponent as p, createVNode as m, createBlock as E, createCommentVNode as T, ref as q, 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 n, createElementBlock as c, createElementVNode as T, normalizeClass as q, normalizeStyle as A, toDisplayString as v, resolveComponent as p, createVNode as g, ref as I, createBlock as b, createCommentVNode as P, onMounted as M, onUnmounted as O, Fragment as w, renderList as B } from "vue";
2
+ const F = 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: I(e.style),
40
+ const _ = (e, t) => {
41
+ const a = e.__vccOpts || e;
42
+ for (const [r, i] of t)
43
+ a[r] = i;
44
+ return a;
45
+ }, H = { class: "areaCategoria" }, L = ["alt"], N = { class: "material-symbols-outlined" };
46
+ function R(e, t, a, r, i, u) {
47
+ return n(), c("div", H, [
48
+ T("div", {
49
+ class: q(["iconeCategoria", e.classes]),
50
+ style: A(e.style),
51
51
  alt: e.categoria
52
52
  }, [
53
- h("span", M, g(e.iconeCategoria), 1)
54
- ], 14, F)
53
+ T("span", N, v(e.iconeCategoria), 1)
54
+ ], 14, L)
55
55
  ]);
56
56
  }
57
- const A = /* @__PURE__ */ _(w, [["render", R], ["__scopeId", "data-v-596712b7"]]), N = u({
57
+ const V = /* @__PURE__ */ _(F, [["render", R], ["__scopeId", "data-v-01127706"]]), Y = 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 J(e, t, a, r, i, u) {
75
+ return n(), c("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 U = /* @__PURE__ */ _(Y, [["render", J], ["__scopeId", "data-v-22a8820e"]]), G = 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 K = { class: "subtitulo" };
92
+ function Q(e, t, a, r, i, u) {
93
+ return n(), c("h4", K, v(e.subtitulo), 1);
94
94
  }
95
- const J = /* @__PURE__ */ _(L, [["render", G], ["__scopeId", "data-v-f5319628"]]), K = u({
95
+ const W = /* @__PURE__ */ _(G, [["render", Q], ["__scopeId", "data-v-f5319628"]]), X = 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 Z = { class: "titulo" };
108
+ function x(e, t, a, r, i, u) {
109
+ return n(), c("h3", Z, v(e.titulo), 1);
110
110
  }
111
- const X = /* @__PURE__ */ _(K, [["render", W], ["__scopeId", "data-v-fce23b0e"]]), Z = u({
111
+ const ee = /* @__PURE__ */ _(X, [["render", x], ["__scopeId", "data-v-fce23b0e"]]), te = 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: ee, SubtituloEvento: W },
123
123
  setup() {
124
124
  return {};
125
125
  }
126
126
  });
127
- const x = {
127
+ const oe = {
128
128
  key: 0,
129
129
  class: "descricaoEvento"
130
- }, ee = {
130
+ }, ae = {
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 ne(e, t, a, r, i, u) {
136
+ const l = p("TituloEvento"), S = p("SubtituloEvento");
137
+ return e.subtitulo ? (n(), c("div", oe, [
138
+ g(l, { titulo: e.titulo }, null, 8, ["titulo"]),
139
+ g(S, { subtitulo: e.subtitulo }, null, 8, ["subtitulo"])
140
+ ])) : (n(), c("div", ae, [
141
+ g(l, { 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 re = /* @__PURE__ */ _(te, [["render", ne], ["__scopeId", "data-v-bb6e1ced"]]), se = d({
145
145
  name: "hora",
146
146
  props: {
147
147
  hora: {
@@ -154,55 +154,54 @@ 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 = I(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 ie(e, t, a, r, i, u) {
166
+ return n(), c("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 le = /* @__PURE__ */ _(se, [["render", ie], ["__scopeId", "data-v-071a9ea4"]]), ce = 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: {
182
181
  // type: String,
183
182
  // },
184
183
  },
185
- components: { Hora: se },
184
+ components: { Hora: le },
186
185
  setup() {
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 ue = { class: "areaHora" }, de = { class: "horaEvento" };
190
+ function _e(e, t, a, r, i, u) {
191
+ const l = p("Hora");
192
+ return n(), c("div", ue, [
193
+ T("div", de, [
194
+ e.horaRealizada ? (n(), b(l, {
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"])) : P("", !0),
200
+ e.horaRealizada ? (n(), b(l, {
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"])) : (n(), b(l, {
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 pe = /* @__PURE__ */ _(ce, [["render", _e], ["__scopeId", "data-v-04f44efd"]]), me = 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 ve = { class: "destaqueEvento texto-pequeno" };
226
+ function fe(e, t, a, r, i, u) {
227
+ return n(), c("div", ve, v(e.destaque), 1);
229
228
  }
230
- const me = /* @__PURE__ */ _(ue, [["render", pe], ["__scopeId", "data-v-c2b8e419"]]), ve = u({
229
+ const ge = /* @__PURE__ */ _(me, [["render", fe], ["__scopeId", "data-v-b0b0beb7"]]), ye = 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,
240
- HoraEvento: de,
241
- DescricaoEvento: oe,
242
- Destaque: me
273
+ IconeStatus: U,
274
+ IconeCategoria: V,
275
+ HoraEvento: pe,
276
+ DescricaoEvento: re,
277
+ Destaque: ge
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 $e = ["onclick"];
292
+ function he(e, t, a, r, i, u) {
293
+ const l = p("IconeStatus"), S = p("HoraEvento"), E = p("IconeCategoria"), o = p("DescricaoEvento"), s = p("Destaque");
294
+ return n(), c("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(l, { 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(E, {
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(s, { destaque: e.destaque }, null, 8, ["destaque"])
312
+ ], 10, $e);
281
313
  }
282
- const ge = /* @__PURE__ */ _(ve, [["render", fe], ["__scopeId", "data-v-54059adf"]]), $e = u({
314
+ const be = /* @__PURE__ */ _(ye, [["render", he], ["__scopeId", "data-v-1d1f6a39"]]), Se = 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 Te(e, t, a, r, i, u) {
335
+ return n(), c("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 qe = /* @__PURE__ */ _(Se, [["render", Te], ["__scopeId", "data-v-5e2b8273"]]), Ee = 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: qe },
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: (r) => t[r] };
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 Pe = { class: "separadorPeriodo" }, Ce = { class: "areaData" };
357
+ function ke(e, t, a, r, i, u) {
358
+ const l = p("BoxData");
359
+ return n(), c("div", Pe, [
360
+ T("div", Ce, [
361
+ g(l, {
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 De = /* @__PURE__ */ _(Ee, [["render", ke], ["__scopeId", "data-v-de9ead2d"]]), Ie = 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 ze = { class: "avatar" }, Ae = ["src"], je = {
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 Me(e, t, a, r, i, u) {
389
+ return n(), c("div", ze, [
390
+ e.imagem ? (n(), c("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, Ae)) : e.icone ? (n(), c("span", je, v(e.icone), 1)) : P("", !0)
375
394
  ]);
376
395
  }
377
- const ze = /* @__PURE__ */ _(ke, [["render", Ce], ["__scopeId", "data-v-a913d26b"]]), je = u({
378
- components: { AvatarTimeline: ze },
396
+ const Oe = /* @__PURE__ */ _(Ie, [["render", Me], ["__scopeId", "data-v-a913d26b"]]), we = d({
397
+ components: { AvatarTimeline: Oe },
379
398
  props: {
380
399
  imagemPerfil: {
381
400
  type: String
@@ -392,45 +411,44 @@ 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(() => ({
414
+ e = C(e);
415
+ const t = y(() => ({
397
416
  backgroundColor: e.backgroundColor
398
- })), t = q(null), a = q(!1), s = () => {
399
- if (t.value) {
400
- const c = window.pageYOffset || document.documentElement.scrollTop, r = t.value.offsetTop;
401
- a.value = c > r;
417
+ })), a = I(null), r = I(!1), i = () => {
418
+ if (a.value) {
419
+ const u = window.pageYOffset || document.documentElement.scrollTop, l = a.value.offsetTop;
420
+ r.value = u > l;
402
421
  }
403
422
  };
404
- return z(() => {
405
- window.addEventListener("scroll", s);
406
- }), j(() => {
407
- window.removeEventListener("scroll", s);
423
+ return M(() => {
424
+ window.addEventListener("scroll", i);
425
+ }), O(() => {
426
+ window.removeEventListener("scroll", i);
408
427
  }), {
409
- style: n,
410
- elementoFixo: t,
411
- isFixed: a
428
+ style: t,
429
+ isFixed: r
412
430
  };
413
431
  }
414
432
  });
415
- 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 }]),
433
+ const Be = { class: "nome" };
434
+ function Fe(e, t, a, r, i, u) {
435
+ const l = p("AvatarTimeline");
436
+ return n(), c("section", {
437
+ class: q(["perfilTimeline", { fixed: e.isFixed }]),
420
438
  ref: "elementoFixo",
421
- style: I(e.style)
439
+ style: A(e.style)
422
440
  }, [
423
- e.imagemPerfil ? (o(), E(r, {
441
+ e.imagemPerfil ? (n(), b(l, {
424
442
  key: 0,
425
443
  imagem: e.imagemPerfil
426
- }, null, 8, ["imagem"])) : e.iconePerfil ? (o(), E(r, {
444
+ }, null, 8, ["imagem"])) : e.iconePerfil ? (n(), b(l, {
427
445
  key: 1,
428
446
  icone: e.iconePerfil
429
- }, null, 8, ["icone"])) : T("", !0),
430
- h("h2", He, g(e.nomePerfil), 1)
447
+ }, null, 8, ["icone"])) : P("", !0),
448
+ T("h2", Be, v(e.nomePerfil), 1)
431
449
  ], 6);
432
450
  }
433
- const we = /* @__PURE__ */ _(je, [["render", Oe], ["__scopeId", "data-v-de2da009"]]), Be = u({
451
+ const He = /* @__PURE__ */ _(we, [["render", Fe], ["__scopeId", "data-v-804ffe54"]]), Le = d({
434
452
  props: {
435
453
  perfilTimeline: {
436
454
  required: !0,
@@ -440,118 +458,137 @@ const we = /* @__PURE__ */ _(je, [["render", Oe], ["__scopeId", "data-v-de2da009
440
458
  required: !0,
441
459
  type: Object
442
460
  }
443
- // ordem: {
444
- // required: false,
445
- // type: Ordem,
446
- // },
447
461
  },
448
462
  components: {
449
- PerfilTimeline: we,
450
- SeparadorPeriodo: Pe,
451
- EventoTimeline: ge
463
+ PerfilTimeline: He,
464
+ SeparadorPeriodo: De,
465
+ EventoTimeline: be
452
466
  },
453
467
  setup(e) {
454
- const n = P(
468
+ const t = C(
455
469
  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 C = $.data.getTime(), k = Math.abs(l - C);
468
- (v === null || k < v) && (v = k, f.length = 0), ($.status === "planejado" || $.status === "atrasado") && f.push($);
469
- }
470
- return f;
471
- } else
472
- return console.log("vazio.. ", []), [];
470
+ );
471
+ let a = C(t);
472
+ function r() {
473
+ a = t;
474
+ const o = l(a);
475
+ a.map((s) => (o[0].id === s.id ? (s.atual = !0, s.scroll = !0, E()) : (s.atual = !1, s.scroll = !1), {
476
+ evento: s
477
+ }));
473
478
  }
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
- });
479
+ const i = () => {
480
+ setInterval(r, 6e4);
481
+ }, u = (o, s) => {
482
+ const m = o.getDay() === s.getDay(), $ = o.getMonth() === s.getMonth(), f = o.getFullYear() === s.getFullYear();
483
+ return m && $ && f;
484
+ }, l = (o) => {
485
+ if (o) {
486
+ const s = Date.now();
487
+ let m = null, $ = [];
488
+ for (const f of o) {
489
+ const h = f.data.getTime();
490
+ if (f.status === "planejado" || f.status === "atrasado") {
491
+ const k = Math.abs(s - f.data.getTime());
492
+ if (m === null || k < m && h <= s)
493
+ m = k, $.length = 0;
494
+ else if (k > m)
495
+ continue;
496
+ $.push(f);
491
497
  }
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({
498
+ }
499
+ return $;
500
+ } else
501
+ return [];
502
+ }, S = y(() => {
503
+ i();
504
+ const o = a.sort(
505
+ (s, m) => s.data.getTime() - m.data.getTime()
506
+ );
507
+ if (o) {
508
+ let s = [], m = null, $ = 0, f;
509
+ for (const h of o) {
510
+ const k = /* @__PURE__ */ new Date(), D = h.data;
511
+ f = h.status;
512
+ const j = h.tolerancia * 60 * 1e3;
513
+ f === "planejado" && D.getTime() + j < k.getTime() && (h.status = "atrasado"), (!m || !u(m, D)) && (m = D, s.push({
514
+ tipo: "dia",
515
+ valor: h.data,
516
+ key: ++$
517
+ })), s.push({
518
+ tipo: "evento",
519
+ valor: h,
520
+ key: ++$
521
+ });
522
+ }
523
+ return s;
524
+ } else
525
+ return [];
526
+ }), E = () => {
527
+ const o = document.querySelector(".atual");
528
+ o == null || o.scrollIntoView({
502
529
  behavior: "smooth",
503
530
  block: "center"
504
531
  });
505
- }
532
+ };
533
+ return r(), {
534
+ eventosPorTipo: S,
535
+ scrollParaItemAtual: E
536
+ };
506
537
  },
507
538
  mounted() {
508
539
  this.scrollParaItemAtual();
509
540
  }
510
541
  });
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"
526
- }, [
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))
542
+ const Ne = { class: "areaTimeline" }, Re = { class: "timeline" };
543
+ function Ve(e, t, a, r, i, u) {
544
+ const l = p("PerfilTimeline"), S = p("SeparadorPeriodo"), E = p("EventoTimeline");
545
+ return n(), c("div", Ne, [
546
+ e.perfilTimeline !== null ? (n(), b(l, {
547
+ key: 0,
548
+ nomePerfil: e.perfilTimeline.nome,
549
+ imagemPerfil: e.perfilTimeline.imagem,
550
+ iconePerfil: e.perfilTimeline.icone
551
+ }, null, 8, ["nomePerfil", "imagemPerfil", "iconePerfil"])) : P("", !0),
552
+ T("section", Re, [
553
+ (n(!0), c(w, null, B(e.eventosPorTipo, (o) => (n(), c("div", {
554
+ key: o.key
555
+ }, [
556
+ o.tipo === "dia" ? (n(), b(S, {
557
+ key: 0,
558
+ dataSeparador: o.valor
559
+ }, null, 8, ["dataSeparador"])) : P("", !0),
560
+ o.tipo === "evento" ? (n(), b(E, {
561
+ key: 1,
562
+ status: o.valor.status,
563
+ criticidade: o.valor.criticidade,
564
+ previsto: o.valor.previsto,
565
+ realizado: o.valor.realizado,
566
+ categoria: o.valor.categoria,
567
+ titulo: o.valor.titulo,
568
+ subtitulo: o.valor.subtitulo,
569
+ destaque: o.valor.destaque,
570
+ ehAtual: o.valor.atual,
571
+ aoCLicar: o.valor.aoCLicar
572
+ }, null, 8, ["status", "criticidade", "previsto", "realizado", "categoria", "titulo", "subtitulo", "destaque", "ehAtual", "aoCLicar"])) : P("", !0)
573
+ ]))), 128))
574
+ ])
538
575
  ]);
539
576
  }
540
- const Ne = /* @__PURE__ */ _(Be, [["render", Ae], ["__scopeId", "data-v-97897a02"]]), Ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
577
+ const Ye = /* @__PURE__ */ _(Le, [["render", Ve], ["__scopeId", "data-v-c833bd5f"]]), Je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
541
578
  __proto__: null
542
- }, Symbol.toStringTag, { value: "Module" })), D = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
579
+ }, Symbol.toStringTag, { value: "Module" })), z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
543
580
  __proto__: null,
544
- Timeline: Ne,
545
- Tipos: Ve
581
+ Timeline: Ye,
582
+ Tipos: Je
546
583
  }, Symbol.toStringTag, { value: "Module" }));
547
- const Le = {
548
- install(e, ...n) {
549
- for (const t in D)
550
- e.component(t, D[t]);
584
+ const Ge = {
585
+ install(e, ...t) {
586
+ for (const a in z)
587
+ e.component(a, z[a]);
551
588
  }
552
589
  };
553
590
  export {
554
- Ne as Timeline,
555
- Ve as Tipos,
556
- Le as default
591
+ Ye as Timeline,
592
+ Je as Tipos,
593
+ Ge as default
557
594
  };