@appmax_npm/ds-prime 1.0.0-alpha.63 → 1.0.0-alpha.67
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/amdatefilter/index.js +42 -39
- package/css/index.css +1 -1
- package/package.json +1 -1
package/amdatefilter/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as F, ref as n, computed as B, watch as
|
|
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";
|
|
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:
|
|
18
|
-
const v = p,
|
|
17
|
+
setup(p, { emit: f }) {
|
|
18
|
+
const v = p, D = f, o = n(), r = n(), l = 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
|
-
},
|
|
38
|
+
}, k = {
|
|
39
39
|
dayCell: {
|
|
40
40
|
class: "!p-0"
|
|
41
41
|
},
|
|
@@ -45,21 +45,21 @@ const P = /* @__PURE__ */ F({
|
|
|
45
45
|
panel: {
|
|
46
46
|
class: "!p-0 !border-none"
|
|
47
47
|
}
|
|
48
|
-
},
|
|
48
|
+
}, y = B(() => [
|
|
49
49
|
{
|
|
50
50
|
label: "Customizar",
|
|
51
51
|
icon: "pi pi-calendar",
|
|
52
52
|
command: (e) => {
|
|
53
|
-
|
|
53
|
+
r.value.toggle(e.originalEvent), t("Customizar");
|
|
54
54
|
},
|
|
55
|
-
class: ["custom", o.value === "Customizar" ? "bg-[#EBE1FE]" : ""]
|
|
55
|
+
class: ["am-v3-date-filter-selector-item-customize", "custom", o.value === "Customizar" ? "bg-[#EBE1FE]" : ""]
|
|
56
56
|
},
|
|
57
|
-
{ label: "Hoje", command: () =>
|
|
58
|
-
{ label: "Ontem", command: () =>
|
|
59
|
-
{ label: "7D", command: () =>
|
|
60
|
-
{ label: "14D", command: () =>
|
|
61
|
-
{ label: "30D", command: () =>
|
|
62
|
-
]),
|
|
57
|
+
{ label: "Hoje", command: () => t("Hoje"), class: ["am-v3-date-filter-selector-item-today", o.value === "Hoje" ? "bg-[#EBE1FE]" : ""] },
|
|
58
|
+
{ label: "Ontem", command: () => t("Ontem"), class: ["am-v3-date-filter-selector-item-yesterday", o.value === "Ontem" ? "bg-[#EBE1FE]" : ""] },
|
|
59
|
+
{ label: "7D", command: () => t("7D"), class: ["am-v3-date-filter-selector-item-7d", o.value === "7D" ? "bg-[#EBE1FE]" : ""] },
|
|
60
|
+
{ label: "14D", command: () => t("14D"), class: ["am-v3-date-filter-selector-item-14d", o.value === "14D" ? "bg-[#EBE1FE]" : ""] },
|
|
61
|
+
{ label: "30D", command: () => t("30D"), class: ["am-v3-date-filter-selector-item-30d", o.value === "30D" ? "bg-[#EBE1FE]" : ""] }
|
|
62
|
+
]), t = (e) => {
|
|
63
63
|
switch (o.value = e, e) {
|
|
64
64
|
case "Hoje":
|
|
65
65
|
l.value = [s(), s()];
|
|
@@ -81,60 +81,63 @@ const P = /* @__PURE__ */ F({
|
|
|
81
81
|
const e = /* @__PURE__ */ new Date();
|
|
82
82
|
return e.setHours(0, 0, 0, 0), e;
|
|
83
83
|
}, m = (e) => {
|
|
84
|
-
const
|
|
85
|
-
return
|
|
86
|
-
},
|
|
84
|
+
const a = s();
|
|
85
|
+
return a.setDate(a.getDate() + e), a;
|
|
86
|
+
}, g = (e) => {
|
|
87
87
|
switch (e) {
|
|
88
88
|
case 0:
|
|
89
|
-
|
|
89
|
+
t("Hoje");
|
|
90
90
|
break;
|
|
91
91
|
case 1:
|
|
92
|
-
|
|
92
|
+
t("Ontem");
|
|
93
93
|
break;
|
|
94
94
|
case 7:
|
|
95
|
-
|
|
95
|
+
t("7D");
|
|
96
96
|
break;
|
|
97
97
|
case 14:
|
|
98
|
-
|
|
98
|
+
t("14D");
|
|
99
99
|
break;
|
|
100
100
|
case 30:
|
|
101
|
-
|
|
101
|
+
t("30D");
|
|
102
102
|
break;
|
|
103
103
|
default:
|
|
104
|
-
|
|
104
|
+
t("Customizar");
|
|
105
105
|
break;
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
|
-
return
|
|
109
|
-
var
|
|
108
|
+
return u(l, (e) => {
|
|
109
|
+
var a;
|
|
110
110
|
if (Array.isArray(e) && e.length === 2 && e[0] && e[1]) {
|
|
111
|
-
(
|
|
112
|
-
const
|
|
113
|
-
|
|
111
|
+
(a = r.value) == null || a.hide();
|
|
112
|
+
const c = e.map((x) => x.toISOString());
|
|
113
|
+
D("update:modelValue", c);
|
|
114
114
|
}
|
|
115
|
-
}),
|
|
115
|
+
}), u(
|
|
116
116
|
() => v.defaultSelected,
|
|
117
117
|
(e) => {
|
|
118
|
-
|
|
118
|
+
g(e);
|
|
119
119
|
},
|
|
120
120
|
{ immediate: !0 }
|
|
121
|
-
), (e,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
), (e, a) => (_(), h("div", null, [
|
|
122
|
+
i(d(V), {
|
|
123
|
+
"data-test": "amdatefilter-toolbar",
|
|
124
|
+
model: y.value,
|
|
125
|
+
pt: b
|
|
125
126
|
}, null, 8, ["model"]),
|
|
126
|
-
|
|
127
|
+
i(d(H), {
|
|
128
|
+
"data-test": "amdatefilter-popover",
|
|
127
129
|
ref_key: "popover",
|
|
128
|
-
ref:
|
|
130
|
+
ref: r,
|
|
129
131
|
pt: E
|
|
130
132
|
}, {
|
|
131
133
|
default: C(() => [
|
|
132
|
-
|
|
134
|
+
i(d(O), {
|
|
135
|
+
"data-test": "amdatefilter-datepicker",
|
|
133
136
|
modelValue: l.value,
|
|
134
|
-
"onUpdate:modelValue":
|
|
137
|
+
"onUpdate:modelValue": a[0] || (a[0] = (c) => l.value = c),
|
|
135
138
|
selectionMode: "range",
|
|
136
139
|
inline: "",
|
|
137
|
-
pt:
|
|
140
|
+
pt: k,
|
|
138
141
|
dateFormat: "yyyy-mm-dd",
|
|
139
142
|
minDate: e.minDate,
|
|
140
143
|
maxDate: e.maxDate
|
|
@@ -144,7 +147,7 @@ const P = /* @__PURE__ */ F({
|
|
|
144
147
|
}, 512)
|
|
145
148
|
]));
|
|
146
149
|
}
|
|
147
|
-
}), M = /* @__PURE__ */ j(P, [["__scopeId", "data-v-
|
|
150
|
+
}), M = /* @__PURE__ */ j(P, [["__scopeId", "data-v-1cf63367"]]);
|
|
148
151
|
export {
|
|
149
152
|
M as default
|
|
150
153
|
};
|