@appmax_npm/ds-prime 1.0.0-alpha.55 → 1.0.0-alpha.57

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.
@@ -0,0 +1,14 @@
1
+ import { AllowedComponentProps, AnchorHTMLAttributes, DefineComponent, VNode } from 'vue';
2
+
3
+ export interface AmDateFilterProps extends AllowedComponentProps {
4
+ defaultSelected?: 0 | 1 | 7 | 14 | 30;
5
+ modelValue: string;
6
+ minDate?: Date;
7
+ maxDate?: Date;
8
+ }
9
+
10
+ export interface AmDateFilterEmits {}
11
+
12
+ declare const AmDateFilter: DefineComponent<AmDateFilterProps, AmDateFilterEmits>;
13
+
14
+ export default AmDateFilter;
@@ -0,0 +1,150 @@
1
+ import { defineComponent as F, ref as n, computed as B, watch as d, openBlock as _, createElementBlock as h, createVNode as u, unref as i, withCtx as C } from "vue";
2
+ import V from "primevue/menu";
3
+ import H from "primevue/popover";
4
+ import O from "primevue/datepicker";
5
+ import { _ as j } from "../_plugin-vue_export-helper-CHgC5LLL.js";
6
+ const P = /* @__PURE__ */ F({
7
+ __name: "AmDateFilter",
8
+ props: {
9
+ defaultSelected: {},
10
+ modelValue: {},
11
+ minDate: {},
12
+ maxDate: {},
13
+ class: {},
14
+ style: {}
15
+ },
16
+ emits: ["update:modelValue"],
17
+ setup(p, { emit: D }) {
18
+ const v = p, b = D, o = n(), c = n(), l = n(null), f = {
19
+ root: {
20
+ class: "!min-w-0 am-date-filter"
21
+ },
22
+ list: {
23
+ class: "!flex-row !p-0"
24
+ },
25
+ item: {
26
+ class: "w-full"
27
+ },
28
+ itemLink: {
29
+ class: "!px-[7px] !py-[5px] hover:bg-[#EBE1FE] !text-[#858585] !text-sm !min-h-[34px] justify-center"
30
+ },
31
+ itemIcon: {
32
+ class: "!text-[#858585] !text-sm"
33
+ }
34
+ }, E = {
35
+ content: {
36
+ class: "!p-0"
37
+ }
38
+ }, g = {
39
+ dayCell: {
40
+ class: "!p-0"
41
+ },
42
+ tableHeaderCell: {
43
+ class: "!p-0"
44
+ },
45
+ panel: {
46
+ class: "!p-0 !border-none"
47
+ }
48
+ }, k = B(() => [
49
+ {
50
+ label: "Customizar",
51
+ icon: "pi pi-calendar",
52
+ command: (e) => {
53
+ c.value.toggle(e.originalEvent), a("Customizar");
54
+ },
55
+ class: ["custom", o.value === "Customizar" ? "bg-[#EBE1FE]" : ""]
56
+ },
57
+ { label: "Hoje", command: () => a("Hoje"), class: o.value === "Hoje" ? "bg-[#EBE1FE]" : "" },
58
+ { label: "Ontem", command: () => a("Ontem"), class: o.value === "Ontem" ? "bg-[#EBE1FE]" : "" },
59
+ { label: "7D", command: () => a("7D"), class: o.value === "7D" ? "bg-[#EBE1FE]" : "" },
60
+ { label: "14D", command: () => a("14D"), class: o.value === "14D" ? "bg-[#EBE1FE]" : "" },
61
+ { label: "30D", command: () => a("30D"), class: o.value === "30D" ? "bg-[#EBE1FE]" : "" }
62
+ ]), a = (e) => {
63
+ switch (o.value = e, e) {
64
+ case "Hoje":
65
+ l.value = [s(), s()];
66
+ break;
67
+ case "Ontem":
68
+ l.value = [m(-1), m(-1)];
69
+ break;
70
+ case "7D":
71
+ l.value = [m(-7), s()];
72
+ break;
73
+ case "14D":
74
+ l.value = [m(-14), s()];
75
+ break;
76
+ case "30D":
77
+ l.value = [m(-30), s()];
78
+ break;
79
+ }
80
+ }, s = () => {
81
+ const e = /* @__PURE__ */ new Date();
82
+ return e.setHours(0, 0, 0, 0), e;
83
+ }, m = (e) => {
84
+ const t = s();
85
+ return t.setDate(t.getDate() + e), t;
86
+ }, x = (e) => {
87
+ switch (e) {
88
+ case 0:
89
+ a("Hoje");
90
+ break;
91
+ case 1:
92
+ a("Ontem");
93
+ break;
94
+ case 7:
95
+ a("7D");
96
+ break;
97
+ case 14:
98
+ a("14D");
99
+ break;
100
+ case 30:
101
+ a("30D");
102
+ break;
103
+ default:
104
+ a("Customizar");
105
+ break;
106
+ }
107
+ };
108
+ return d(l, (e) => {
109
+ var t;
110
+ if (Array.isArray(e) && e.length === 2 && e[0] && e[1]) {
111
+ (t = c.value) == null || t.hide();
112
+ const r = e.map((y) => y.toISOString());
113
+ b("update:modelValue", r);
114
+ }
115
+ }), d(
116
+ () => v.defaultSelected,
117
+ (e) => {
118
+ x(e);
119
+ },
120
+ { immediate: !0 }
121
+ ), (e, t) => (_(), h("div", null, [
122
+ u(i(V), {
123
+ model: k.value,
124
+ pt: f
125
+ }, null, 8, ["model"]),
126
+ u(i(H), {
127
+ ref_key: "popover",
128
+ ref: c,
129
+ pt: E
130
+ }, {
131
+ default: C(() => [
132
+ u(i(O), {
133
+ modelValue: l.value,
134
+ "onUpdate:modelValue": t[0] || (t[0] = (r) => l.value = r),
135
+ selectionMode: "range",
136
+ inline: "",
137
+ pt: g,
138
+ dateFormat: "yyyy-mm-dd",
139
+ minDate: e.minDate,
140
+ maxDate: e.maxDate
141
+ }, null, 8, ["modelValue", "minDate", "maxDate"])
142
+ ]),
143
+ _: 1
144
+ }, 512)
145
+ ]));
146
+ }
147
+ }), M = /* @__PURE__ */ j(P, [["__scopeId", "data-v-1990f91c"]]);
148
+ export {
149
+ M as default
150
+ };
package/config/theme.js CHANGED
@@ -1,5 +1,14 @@
1
1
  import { AmPreset } from './preset';
2
2
  export const AmDSPrimeConfig = {
3
+ locale: {
4
+ emptyMessage: 'Vazio',
5
+ fileSizeTypes: ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
6
+ dayNames: ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sabado'],
7
+ dayNamesShort: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'],
8
+ dayNamesMin: ['Do', 'Se', 'Te', 'Qua', 'Qui', 'Sex', 'Sab'],
9
+ monthNames: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
10
+ monthNamesShort: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
11
+ },
3
12
  theme: {
4
13
  preset: AmPreset,
5
14
  options: {