@appmax_npm/ds-prime 1.0.0-alpha.67 → 1.0.0-alpha.68

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.
@@ -1,4 +1,4 @@
1
- import { defineComponent as F, ref as n, computed as B, watch as u, openBlock as _, createElementBlock as h, createVNode as i, unref as d, withCtx as C } from "vue";
1
+ import { defineComponent as F, ref as n, computed as B, watch as u, openBlock as _, createElementBlock as h, createVNode as d, unref as i, withCtx as C } from "vue";
2
2
  import V from "primevue/menu";
3
3
  import H from "primevue/popover";
4
4
  import O from "primevue/datepicker";
@@ -14,8 +14,8 @@ const P = /* @__PURE__ */ F({
14
14
  style: {}
15
15
  },
16
16
  emits: ["update:modelValue"],
17
- setup(p, { emit: f }) {
18
- const v = p, D = f, o = n(), r = n(), l = n(null), b = {
17
+ setup(p, { emit: v }) {
18
+ const f = p, D = v, o = n(), r = n(), a = n(null), b = {
19
19
  root: {
20
20
  class: "!min-w-0 am-date-filter"
21
21
  },
@@ -35,7 +35,7 @@ const P = /* @__PURE__ */ F({
35
35
  content: {
36
36
  class: "!p-0"
37
37
  }
38
- }, k = {
38
+ }, g = {
39
39
  dayCell: {
40
40
  class: "!p-0"
41
41
  },
@@ -45,7 +45,7 @@ const P = /* @__PURE__ */ F({
45
45
  panel: {
46
46
  class: "!p-0 !border-none"
47
47
  }
48
- }, y = B(() => [
48
+ }, k = B(() => [
49
49
  {
50
50
  label: "Customizar",
51
51
  icon: "pi pi-calendar",
@@ -62,28 +62,29 @@ const P = /* @__PURE__ */ F({
62
62
  ]), t = (e) => {
63
63
  switch (o.value = e, e) {
64
64
  case "Hoje":
65
- l.value = [s(), s()];
65
+ a.value = [s(), s()];
66
66
  break;
67
67
  case "Ontem":
68
- l.value = [m(-1), m(-1)];
68
+ a.value = [m(-1), m(-1)];
69
69
  break;
70
70
  case "7D":
71
- l.value = [m(-7), s()];
71
+ a.value = [m(-6), s()];
72
72
  break;
73
73
  case "14D":
74
- l.value = [m(-14), s()];
74
+ a.value = [m(-13), s()];
75
75
  break;
76
76
  case "30D":
77
- l.value = [m(-30), s()];
77
+ a.value = [m(-29), s()];
78
78
  break;
79
79
  }
80
+ console.log(a.value);
80
81
  }, s = () => {
81
82
  const e = /* @__PURE__ */ new Date();
82
83
  return e.setHours(0, 0, 0, 0), e;
83
84
  }, m = (e) => {
84
- const a = s();
85
- return a.setDate(a.getDate() + e), a;
86
- }, g = (e) => {
85
+ const l = s();
86
+ return l.setDate(l.getDate() + e), l;
87
+ }, y = (e) => {
87
88
  switch (e) {
88
89
  case 0:
89
90
  t("Hoje");
@@ -105,39 +106,39 @@ const P = /* @__PURE__ */ F({
105
106
  break;
106
107
  }
107
108
  };
108
- return u(l, (e) => {
109
- var a;
109
+ return u(a, (e) => {
110
+ var l;
110
111
  if (Array.isArray(e) && e.length === 2 && e[0] && e[1]) {
111
- (a = r.value) == null || a.hide();
112
+ (l = r.value) == null || l.hide();
112
113
  const c = e.map((x) => x.toISOString());
113
114
  D("update:modelValue", c);
114
115
  }
115
116
  }), u(
116
- () => v.defaultSelected,
117
+ () => f.defaultSelected,
117
118
  (e) => {
118
- g(e);
119
+ y(e);
119
120
  },
120
121
  { immediate: !0 }
121
- ), (e, a) => (_(), h("div", null, [
122
- i(d(V), {
122
+ ), (e, l) => (_(), h("div", null, [
123
+ d(i(V), {
123
124
  "data-test": "amdatefilter-toolbar",
124
- model: y.value,
125
+ model: k.value,
125
126
  pt: b
126
127
  }, null, 8, ["model"]),
127
- i(d(H), {
128
+ d(i(H), {
128
129
  "data-test": "amdatefilter-popover",
129
130
  ref_key: "popover",
130
131
  ref: r,
131
132
  pt: E
132
133
  }, {
133
134
  default: C(() => [
134
- i(d(O), {
135
+ d(i(O), {
135
136
  "data-test": "amdatefilter-datepicker",
136
- modelValue: l.value,
137
- "onUpdate:modelValue": a[0] || (a[0] = (c) => l.value = c),
137
+ modelValue: a.value,
138
+ "onUpdate:modelValue": l[0] || (l[0] = (c) => a.value = c),
138
139
  selectionMode: "range",
139
140
  inline: "",
140
- pt: k,
141
+ pt: g,
141
142
  dateFormat: "yyyy-mm-dd",
142
143
  minDate: e.minDate,
143
144
  maxDate: e.maxDate
@@ -147,7 +148,7 @@ const P = /* @__PURE__ */ F({
147
148
  }, 512)
148
149
  ]));
149
150
  }
150
- }), M = /* @__PURE__ */ j(P, [["__scopeId", "data-v-1cf63367"]]);
151
+ }), M = /* @__PURE__ */ j(P, [["__scopeId", "data-v-d2d16bde"]]);
151
152
  export {
152
153
  M as default
153
154
  };