@wgalleti/primevue-components 0.3.6 → 0.3.7
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/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1322 -1317
- package/dist/index.js.map +1 -1
- package/dist/types/crud.d.ts +5 -0
- package/dist/types/types/crud.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { inject as Ie, defineComponent as
|
|
1
|
+
import { inject as Ie, defineComponent as de, openBlock as s, createElementBlock as m, createBlock as A, unref as v, toDisplayString as T, ref as q, watch as nt, computed as H, reactive as ge, resolveDirective as kt, Fragment as le, createElementVNode as h, createVNode as N, withDirectives as fe, withCtx as ne, createCommentVNode as $, renderList as ie, normalizeStyle as je, createTextVNode as Pe, normalizeClass as re, renderSlot as O, isRef as Ut, withModifiers as qt, createSlots as ot, normalizeProps as lt, guardReactiveProps as st, useSlots as Ht, onMounted as Kt, createStaticVNode as Gt } from "vue";
|
|
2
2
|
import $t from "primevue/datatable";
|
|
3
3
|
import ze from "primevue/column";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import ee from "primevue/button";
|
|
5
|
+
import me from "primevue/inputtext";
|
|
6
6
|
import qe from "primevue/iconfield";
|
|
7
7
|
import He from "primevue/inputicon";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import Jt from "primevue/paginator";
|
|
9
|
+
import Zt from "primevue/contextmenu";
|
|
10
10
|
import Ct from "primevue/tag";
|
|
11
11
|
import Te from "dayjs";
|
|
12
12
|
import Dt from "primevue/dialog";
|
|
13
13
|
import ct from "primevue/inputnumber";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
14
|
+
import Xt from "primevue/textarea";
|
|
15
|
+
import Qt from "primevue/select";
|
|
16
16
|
import xt from "primevue/autocomplete";
|
|
17
17
|
import ft from "primevue/datepicker";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { useToast as
|
|
22
|
-
import { useConfirm as
|
|
23
|
-
import
|
|
18
|
+
import _t from "primevue/toggleswitch";
|
|
19
|
+
import ea from "primevue/colorpicker";
|
|
20
|
+
import ta from "primevue/password";
|
|
21
|
+
import { useToast as aa } from "primevue/usetoast";
|
|
22
|
+
import { useConfirm as na } from "primevue/useconfirm";
|
|
23
|
+
import oa from "primevue/inputgroup";
|
|
24
24
|
import mt from "primevue/inputgroupaddon";
|
|
25
25
|
import Ge from "primevue/skeleton";
|
|
26
|
-
const
|
|
27
|
-
function
|
|
26
|
+
const la = Symbol("w-axios"), _e = Symbol("w-data-provider"), et = Symbol("w-config");
|
|
27
|
+
function sa(e) {
|
|
28
28
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
29
29
|
}
|
|
30
|
-
var Ze = { exports: {} },
|
|
31
|
-
function
|
|
30
|
+
var Ze = { exports: {} }, ia = Ze.exports, pt;
|
|
31
|
+
function ra() {
|
|
32
32
|
return pt || (pt = 1, (function(e, t) {
|
|
33
33
|
(function(a, o) {
|
|
34
34
|
e.exports = o();
|
|
35
|
-
})(
|
|
36
|
-
var a = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, o = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, l = /\d/, i = /\d\d/, r = /\d\d?/, y = /\d*[^-_:/,()\s\d]+/,
|
|
35
|
+
})(ia, (function() {
|
|
36
|
+
var a = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, o = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, l = /\d/, i = /\d\d/, r = /\d\d?/, y = /\d*[^-_:/,()\s\d]+/, c = {}, w = function(g) {
|
|
37
37
|
return (g = +g) + (g > 68 ? 1900 : 2e3);
|
|
38
|
-
},
|
|
38
|
+
}, F = function(g) {
|
|
39
39
|
return function(b) {
|
|
40
40
|
this[g] = +b;
|
|
41
41
|
};
|
|
42
|
-
},
|
|
42
|
+
}, V = [/[+-]\d\d:?(\d\d)?|Z/, function(g) {
|
|
43
43
|
(this.zone || (this.zone = {})).offset = (function(b) {
|
|
44
44
|
if (!b || b === "Z") return 0;
|
|
45
|
-
var
|
|
46
|
-
return
|
|
45
|
+
var k = b.match(/([+-]|\d\d)/g), x = 60 * k[1] + (+k[2] || 0);
|
|
46
|
+
return x === 0 ? 0 : k[0] === "+" ? -x : x;
|
|
47
47
|
})(g);
|
|
48
|
-
}],
|
|
49
|
-
var b =
|
|
48
|
+
}], W = function(g) {
|
|
49
|
+
var b = c[g];
|
|
50
50
|
return b && (b.indexOf ? b : b.s.concat(b.f));
|
|
51
|
-
},
|
|
52
|
-
var
|
|
53
|
-
if (
|
|
54
|
-
for (var
|
|
55
|
-
|
|
51
|
+
}, L = function(g, b) {
|
|
52
|
+
var k, x = c.meridiem;
|
|
53
|
+
if (x) {
|
|
54
|
+
for (var j = 1; j <= 24; j += 1) if (g.indexOf(x(j, 0, b)) > -1) {
|
|
55
|
+
k = j > 12;
|
|
56
56
|
break;
|
|
57
57
|
}
|
|
58
|
-
} else
|
|
59
|
-
return
|
|
60
|
-
},
|
|
61
|
-
this.afternoon =
|
|
58
|
+
} else k = g === (b ? "pm" : "PM");
|
|
59
|
+
return k;
|
|
60
|
+
}, J = { A: [y, function(g) {
|
|
61
|
+
this.afternoon = L(g, !1);
|
|
62
62
|
}], a: [y, function(g) {
|
|
63
|
-
this.afternoon =
|
|
63
|
+
this.afternoon = L(g, !0);
|
|
64
64
|
}], Q: [l, function(g) {
|
|
65
65
|
this.month = 3 * (g - 1) + 1;
|
|
66
66
|
}], S: [l, function(g) {
|
|
@@ -69,90 +69,90 @@ function ia() {
|
|
|
69
69
|
this.milliseconds = 10 * +g;
|
|
70
70
|
}], SSS: [/\d{3}/, function(g) {
|
|
71
71
|
this.milliseconds = +g;
|
|
72
|
-
}], s: [r,
|
|
73
|
-
var b =
|
|
74
|
-
if (this.day =
|
|
75
|
-
}], w: [r,
|
|
76
|
-
var b =
|
|
77
|
-
return
|
|
72
|
+
}], s: [r, F("seconds")], ss: [r, F("seconds")], m: [r, F("minutes")], mm: [r, F("minutes")], H: [r, F("hours")], h: [r, F("hours")], HH: [r, F("hours")], hh: [r, F("hours")], D: [r, F("day")], DD: [i, F("day")], Do: [y, function(g) {
|
|
73
|
+
var b = c.ordinal, k = g.match(/\d+/);
|
|
74
|
+
if (this.day = k[0], b) for (var x = 1; x <= 31; x += 1) b(x).replace(/\[|\]/g, "") === g && (this.day = x);
|
|
75
|
+
}], w: [r, F("week")], ww: [i, F("week")], M: [r, F("month")], MM: [i, F("month")], MMM: [y, function(g) {
|
|
76
|
+
var b = W("months"), k = (W("monthsShort") || b.map((function(x) {
|
|
77
|
+
return x.slice(0, 3);
|
|
78
78
|
}))).indexOf(g) + 1;
|
|
79
|
-
if (
|
|
80
|
-
this.month =
|
|
79
|
+
if (k < 1) throw new Error();
|
|
80
|
+
this.month = k % 12 || k;
|
|
81
81
|
}], MMMM: [y, function(g) {
|
|
82
|
-
var b =
|
|
82
|
+
var b = W("months").indexOf(g) + 1;
|
|
83
83
|
if (b < 1) throw new Error();
|
|
84
84
|
this.month = b % 12 || b;
|
|
85
|
-
}], Y: [/[+-]?\d+/,
|
|
85
|
+
}], Y: [/[+-]?\d+/, F("year")], YY: [i, function(g) {
|
|
86
86
|
this.year = w(g);
|
|
87
|
-
}], YYYY: [/\d{4}/,
|
|
88
|
-
function
|
|
89
|
-
var b,
|
|
90
|
-
b = g,
|
|
91
|
-
for (var
|
|
92
|
-
var f =
|
|
93
|
-
return
|
|
87
|
+
}], YYYY: [/\d{4}/, F("year")], Z: V, ZZ: V };
|
|
88
|
+
function Z(g) {
|
|
89
|
+
var b, k;
|
|
90
|
+
b = g, k = c && c.formats;
|
|
91
|
+
for (var x = (g = b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(oe, ae, _) {
|
|
92
|
+
var f = _ && _.toUpperCase();
|
|
93
|
+
return ae || k[_] || a[_] || k[f].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(P, u, n) {
|
|
94
94
|
return u || n.slice(1);
|
|
95
95
|
}));
|
|
96
|
-
}))).match(o),
|
|
97
|
-
var
|
|
98
|
-
|
|
96
|
+
}))).match(o), j = x.length, U = 0; U < j; U += 1) {
|
|
97
|
+
var Y = x[U], K = J[Y], B = K && K[0], X = K && K[1];
|
|
98
|
+
x[U] = X ? { regex: B, parser: X } : Y.replace(/^\[|\]$/g, "");
|
|
99
99
|
}
|
|
100
100
|
return function(oe) {
|
|
101
|
-
for (var
|
|
102
|
-
var
|
|
103
|
-
if (typeof
|
|
101
|
+
for (var ae = {}, _ = 0, f = 0; _ < j; _ += 1) {
|
|
102
|
+
var P = x[_];
|
|
103
|
+
if (typeof P == "string") f += P.length;
|
|
104
104
|
else {
|
|
105
|
-
var u =
|
|
106
|
-
n.call(
|
|
105
|
+
var u = P.regex, n = P.parser, p = oe.slice(f), d = u.exec(p)[0];
|
|
106
|
+
n.call(ae, d), oe = oe.replace(d, "");
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
return (function(
|
|
110
|
-
var
|
|
111
|
-
if (
|
|
112
|
-
var
|
|
113
|
-
|
|
109
|
+
return (function(E) {
|
|
110
|
+
var R = E.afternoon;
|
|
111
|
+
if (R !== void 0) {
|
|
112
|
+
var G = E.hours;
|
|
113
|
+
R ? G < 12 && (E.hours += 12) : G === 12 && (E.hours = 0), delete E.afternoon;
|
|
114
114
|
}
|
|
115
|
-
})(
|
|
115
|
+
})(ae), ae;
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
return function(g, b,
|
|
119
|
-
|
|
120
|
-
var
|
|
121
|
-
|
|
122
|
-
var
|
|
123
|
-
this.$u =
|
|
124
|
-
var X =
|
|
118
|
+
return function(g, b, k) {
|
|
119
|
+
k.p.customParseFormat = !0, g && g.parseTwoDigitYear && (w = g.parseTwoDigitYear);
|
|
120
|
+
var x = b.prototype, j = x.parse;
|
|
121
|
+
x.parse = function(U) {
|
|
122
|
+
var Y = U.date, K = U.utc, B = U.args;
|
|
123
|
+
this.$u = K;
|
|
124
|
+
var X = B[1];
|
|
125
125
|
if (typeof X == "string") {
|
|
126
|
-
var oe =
|
|
127
|
-
|
|
126
|
+
var oe = B[2] === !0, ae = B[3] === !0, _ = oe || ae, f = B[2];
|
|
127
|
+
ae && (f = B[2]), c = this.$locale(), !oe && f && (c = k.Ls[f]), this.$d = (function(p, d, E, R) {
|
|
128
128
|
try {
|
|
129
|
-
if (["x", "X"].indexOf(
|
|
130
|
-
var
|
|
131
|
-
|
|
132
|
-
var
|
|
133
|
-
return ve ? new Date(Date.UTC(
|
|
129
|
+
if (["x", "X"].indexOf(d) > -1) return new Date((d === "X" ? 1e3 : 1) * p);
|
|
130
|
+
var G = Z(d)(p), se = G.year, pe = G.month, Ne = G.day, Ye = G.hours, we = G.minutes, ke = G.seconds, ue = G.milliseconds, ve = G.zone, Ce = G.week, Ee = /* @__PURE__ */ new Date(), De = Ne || (se || pe ? 1 : Ee.getDate()), Me = se || Ee.getFullYear(), ye = 0;
|
|
131
|
+
se && !pe || (ye = pe > 0 ? pe - 1 : Ee.getMonth());
|
|
132
|
+
var xe, Fe = Ye || 0, Ae = we || 0, Re = ke || 0, C = ue || 0;
|
|
133
|
+
return ve ? new Date(Date.UTC(Me, ye, De, Fe, Ae, Re, C + 60 * ve.offset * 1e3)) : E ? new Date(Date.UTC(Me, ye, De, Fe, Ae, Re, C)) : (xe = new Date(Me, ye, De, Fe, Ae, Re, C), Ce && (xe = R(xe).week(Ce).toDate()), xe);
|
|
134
134
|
} catch {
|
|
135
135
|
return /* @__PURE__ */ new Date("");
|
|
136
136
|
}
|
|
137
|
-
})(
|
|
138
|
-
} else if (X instanceof Array) for (var
|
|
139
|
-
|
|
140
|
-
var n =
|
|
137
|
+
})(Y, X, K, k), this.init(), f && f !== !0 && (this.$L = this.locale(f).$L), _ && Y != this.format(X) && (this.$d = /* @__PURE__ */ new Date("")), c = {};
|
|
138
|
+
} else if (X instanceof Array) for (var P = X.length, u = 1; u <= P; u += 1) {
|
|
139
|
+
B[1] = X[u - 1];
|
|
140
|
+
var n = k.apply(this, B);
|
|
141
141
|
if (n.isValid()) {
|
|
142
142
|
this.$d = n.$d, this.$L = n.$L, this.init();
|
|
143
143
|
break;
|
|
144
144
|
}
|
|
145
|
-
u ===
|
|
145
|
+
u === P && (this.$d = /* @__PURE__ */ new Date(""));
|
|
146
146
|
}
|
|
147
|
-
else
|
|
147
|
+
else j.call(this, U);
|
|
148
148
|
};
|
|
149
149
|
};
|
|
150
150
|
}));
|
|
151
151
|
})(Ze)), Ze.exports;
|
|
152
152
|
}
|
|
153
|
-
var
|
|
154
|
-
const
|
|
155
|
-
Te.extend(
|
|
153
|
+
var ua = ra();
|
|
154
|
+
const da = /* @__PURE__ */ sa(ua);
|
|
155
|
+
Te.extend(da);
|
|
156
156
|
function it(e) {
|
|
157
157
|
if (!e) return null;
|
|
158
158
|
if (e instanceof Date) return e;
|
|
@@ -165,41 +165,41 @@ function St(e) {
|
|
|
165
165
|
function Pt(e) {
|
|
166
166
|
return e ? typeof e == "string" ? e : Te(e).toISOString() : null;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function ca(e, t = "DD/MM/YYYY") {
|
|
169
169
|
return e ? Te(e).format(t) : "—";
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function fa(e) {
|
|
172
172
|
return e ? Te(e).format("DD/MM/YYYY HH:mm") : "—";
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function Ve(e) {
|
|
175
175
|
return e.replace(/\D/g, "");
|
|
176
176
|
}
|
|
177
177
|
function Vt(e) {
|
|
178
178
|
if (!e) return "—";
|
|
179
|
-
const t =
|
|
179
|
+
const t = Ve(e);
|
|
180
180
|
return t.length !== 11 ? e : t.replace(/^(\d{3})(\d{3})(\d{3})(\d{2})$/, "$1.$2.$3-$4");
|
|
181
181
|
}
|
|
182
182
|
function Et(e) {
|
|
183
183
|
if (!e) return "—";
|
|
184
|
-
const t =
|
|
184
|
+
const t = Ve(e);
|
|
185
185
|
return t.length !== 14 ? e : t.replace(
|
|
186
186
|
/^(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})$/,
|
|
187
187
|
"$1.$2.$3/$4-$5"
|
|
188
188
|
);
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function ma(e) {
|
|
191
191
|
if (!e) return "—";
|
|
192
|
-
const t =
|
|
192
|
+
const t = Ve(e);
|
|
193
193
|
return t.length === 11 ? Vt(e) : t.length === 14 ? Et(e) : e;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function pa(e) {
|
|
196
196
|
if (!e) return "—";
|
|
197
|
-
const t =
|
|
197
|
+
const t = Ve(e);
|
|
198
198
|
return t.length === 11 ? t.replace(/^(\d{2})(\d{5})(\d{4})$/, "($1) $2-$3") : t.length === 10 ? t.replace(/^(\d{2})(\d{4})(\d{4})$/, "($1) $2-$3") : e;
|
|
199
199
|
}
|
|
200
200
|
function Mt(e) {
|
|
201
201
|
if (!e) return null;
|
|
202
|
-
const t =
|
|
202
|
+
const t = Ve(e);
|
|
203
203
|
if (t.length !== 11) return "CPF deve ter 11 dígitos.";
|
|
204
204
|
if (/^(\d)\1{10}$/.test(t)) return "CPF inválido.";
|
|
205
205
|
let a = 0;
|
|
@@ -215,25 +215,25 @@ function Mt(e) {
|
|
|
215
215
|
}
|
|
216
216
|
function Ft(e) {
|
|
217
217
|
if (!e) return null;
|
|
218
|
-
const t =
|
|
218
|
+
const t = Ve(e);
|
|
219
219
|
if (t.length !== 14) return "CNPJ deve ter 14 dígitos.";
|
|
220
220
|
if (/^(\d)\1{13}$/.test(t)) return "CNPJ inválido.";
|
|
221
221
|
const a = [5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2];
|
|
222
222
|
let o = 0;
|
|
223
|
-
for (let
|
|
223
|
+
for (let c = 0; c < 12; c++) o += parseInt(t[c]) * a[c];
|
|
224
224
|
let l = o % 11;
|
|
225
225
|
const i = l < 2 ? 0 : 11 - l;
|
|
226
226
|
if (parseInt(t[12]) !== i) return "CNPJ inválido.";
|
|
227
227
|
const r = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2];
|
|
228
228
|
o = 0;
|
|
229
|
-
for (let
|
|
229
|
+
for (let c = 0; c < 13; c++) o += parseInt(t[c]) * r[c];
|
|
230
230
|
l = o % 11;
|
|
231
231
|
const y = l < 2 ? 0 : 11 - l;
|
|
232
232
|
return parseInt(t[13]) !== y ? "CNPJ inválido." : null;
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function va(e) {
|
|
235
235
|
if (!e) return null;
|
|
236
|
-
const t =
|
|
236
|
+
const t = Ve(e);
|
|
237
237
|
return t.length === 11 ? Mt(e) : t.length === 14 ? Ft(e) : "CPF deve ter 11 dígitos ou CNPJ deve ter 14 dígitos.";
|
|
238
238
|
}
|
|
239
239
|
const Xe = /* @__PURE__ */ new Map();
|
|
@@ -245,7 +245,7 @@ function vt(e, t) {
|
|
|
245
245
|
maximumFractionDigits: t
|
|
246
246
|
}), Xe.set(a, o)), o;
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function ga(e, t) {
|
|
249
249
|
const a = `${e}-${t}`;
|
|
250
250
|
let o = Xe.get(a);
|
|
251
251
|
return o || (o = new Intl.NumberFormat(e, {
|
|
@@ -261,20 +261,20 @@ function rt() {
|
|
|
261
261
|
locale: "pt-BR",
|
|
262
262
|
currency: "BRL"
|
|
263
263
|
}), t = (e == null ? void 0 : e.locale) ?? "pt-BR", a = (e == null ? void 0 : e.currency) ?? "BRL";
|
|
264
|
-
function o(
|
|
265
|
-
return
|
|
264
|
+
function o(c) {
|
|
265
|
+
return c == null ? "—" : ga(t, a).format(c);
|
|
266
266
|
}
|
|
267
|
-
function l(
|
|
268
|
-
return
|
|
267
|
+
function l(c, w = 2) {
|
|
268
|
+
return c == null ? "—" : vt(t, w).format(c);
|
|
269
269
|
}
|
|
270
|
-
function i(
|
|
271
|
-
return
|
|
270
|
+
function i(c, w) {
|
|
271
|
+
return ca(c, w ?? (e == null ? void 0 : e.dateFormat) ?? "DD/MM/YYYY");
|
|
272
272
|
}
|
|
273
|
-
function r(
|
|
274
|
-
return
|
|
273
|
+
function r(c) {
|
|
274
|
+
return fa(c);
|
|
275
275
|
}
|
|
276
|
-
function y(
|
|
277
|
-
return
|
|
276
|
+
function y(c) {
|
|
277
|
+
return c == null ? "—" : `${vt(t, 2).format(c)}%`;
|
|
278
278
|
}
|
|
279
279
|
return {
|
|
280
280
|
formatCurrency: o,
|
|
@@ -284,35 +284,35 @@ function rt() {
|
|
|
284
284
|
formatPercent: y,
|
|
285
285
|
formatCpf: Vt,
|
|
286
286
|
formatCnpj: Et,
|
|
287
|
-
formatCpfCnpj:
|
|
288
|
-
formatTelefone:
|
|
287
|
+
formatCpfCnpj: ma,
|
|
288
|
+
formatTelefone: pa,
|
|
289
289
|
validateCpf: Mt,
|
|
290
290
|
validateCnpj: Ft,
|
|
291
|
-
validateCpfCnpj:
|
|
291
|
+
validateCpfCnpj: va,
|
|
292
292
|
parseDate: it,
|
|
293
293
|
toDateString: St,
|
|
294
294
|
toDateTimeString: Pt
|
|
295
295
|
};
|
|
296
296
|
}
|
|
297
|
-
const
|
|
297
|
+
const ha = {
|
|
298
298
|
key: 0,
|
|
299
299
|
class: "text-muted-color text-xs"
|
|
300
|
-
},
|
|
300
|
+
}, ya = ["src", "alt"], ba = {
|
|
301
301
|
key: 3,
|
|
302
302
|
class: "text-muted-color tabular-nums text-[0.8125rem]"
|
|
303
|
-
},
|
|
303
|
+
}, wa = {
|
|
304
304
|
key: 4,
|
|
305
305
|
class: "text-muted-color tabular-nums text-[0.8125rem]"
|
|
306
|
-
},
|
|
306
|
+
}, ka = {
|
|
307
307
|
key: 5,
|
|
308
308
|
class: "font-semibold tabular-nums text-[0.8125rem]"
|
|
309
|
-
},
|
|
309
|
+
}, $a = {
|
|
310
310
|
key: 6,
|
|
311
311
|
class: "font-semibold tabular-nums text-[0.8125rem]"
|
|
312
|
-
},
|
|
312
|
+
}, Ca = {
|
|
313
313
|
key: 7,
|
|
314
314
|
class: "text-[0.8125rem]"
|
|
315
|
-
}, Qe = /* @__PURE__ */
|
|
315
|
+
}, Qe = /* @__PURE__ */ de({
|
|
316
316
|
__name: "WCrudColumnRenderer",
|
|
317
317
|
props: {
|
|
318
318
|
column: {},
|
|
@@ -321,20 +321,20 @@ const ga = {
|
|
|
321
321
|
},
|
|
322
322
|
setup(e) {
|
|
323
323
|
const { formatDate: t, formatDateTime: a, formatCurrency: o, formatNumber: l } = rt();
|
|
324
|
-
return (i, r) => e.value == null ? (s(),
|
|
324
|
+
return (i, r) => e.value == null ? (s(), m("span", ha, "—")) : e.column.type === "image" ? (s(), m("img", {
|
|
325
325
|
key: 1,
|
|
326
326
|
src: String(e.value),
|
|
327
327
|
alt: e.column.header,
|
|
328
328
|
class: "size-9 rounded-lg object-cover ring-1 ring-surface-200 dark:ring-surface-700"
|
|
329
|
-
}, null, 8,
|
|
329
|
+
}, null, 8, ya)) : e.column.type === "boolean" ? (s(), A(v(Ct), {
|
|
330
330
|
key: 2,
|
|
331
331
|
value: e.column.tagValue ? e.column.tagValue(e.value, e.rowData) : e.value ? "Ativo" : "Inativo",
|
|
332
332
|
severity: e.column.tagSeverity ? e.column.tagSeverity(e.value, e.rowData) : e.value ? "success" : "danger",
|
|
333
333
|
class: "text-xs"
|
|
334
|
-
}, null, 8, ["value", "severity"])) : e.column.type === "date" ? (s(),
|
|
334
|
+
}, null, 8, ["value", "severity"])) : e.column.type === "date" ? (s(), m("span", ba, T(v(t)(e.value)), 1)) : e.column.type === "datetime" ? (s(), m("span", wa, T(v(a)(e.value)), 1)) : e.column.type === "currency" ? (s(), m("span", ka, T(v(o)(e.value)), 1)) : e.column.type === "number" ? (s(), m("span", $a, T(e.column.format ? e.column.format(e.value, e.rowData) : v(l)(e.value, e.column.decimals ?? 0)), 1)) : (s(), m("span", Ca, T(e.column.format ? e.column.format(e.value, e.rowData) : e.value), 1));
|
|
335
335
|
}
|
|
336
336
|
});
|
|
337
|
-
var
|
|
337
|
+
var Da = Object.defineProperty, xa = (e, t, a) => t in e ? Da(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a, Ue = (e, t, a) => xa(e, typeof t != "symbol" ? t + "" : t, a);
|
|
338
338
|
const gt = {
|
|
339
339
|
"#": { pattern: /[0-9]/ },
|
|
340
340
|
"@": { pattern: /[a-zA-Z]/ },
|
|
@@ -346,25 +346,25 @@ const gt = {
|
|
|
346
346
|
maximumFractionDigits: t,
|
|
347
347
|
roundingMode: "trunc"
|
|
348
348
|
});
|
|
349
|
-
},
|
|
349
|
+
}, Sa = (e, t = !0, a) => {
|
|
350
350
|
var o, l, i, r;
|
|
351
|
-
const y = ((o = a.number) == null ? void 0 : o.unsigned) !== !0 && e.startsWith("-") ? "-" : "",
|
|
352
|
-
let w = yt(0,
|
|
353
|
-
const
|
|
354
|
-
if (Number.isNaN(parseFloat(
|
|
355
|
-
const
|
|
356
|
-
if (
|
|
357
|
-
const g =
|
|
358
|
-
w = yt(g,
|
|
359
|
-
}
|
|
360
|
-
let
|
|
361
|
-
return t ?
|
|
362
|
-
}, At = (e) => JSON.parse(e.replaceAll("'", '"')),
|
|
351
|
+
const y = ((o = a.number) == null ? void 0 : o.unsigned) !== !0 && e.startsWith("-") ? "-" : "", c = ((l = a.number) == null ? void 0 : l.fraction) ?? 0;
|
|
352
|
+
let w = yt(0, c, a);
|
|
353
|
+
const F = w.formatToParts(1000.12), V = ((i = F.find((g) => g.type === "group")) == null ? void 0 : i.value) ?? " ", W = ((r = F.find((g) => g.type === "decimal")) == null ? void 0 : r.value) ?? ".", L = ht(e, V, W);
|
|
354
|
+
if (Number.isNaN(parseFloat(L))) return y;
|
|
355
|
+
const J = L.split(".");
|
|
356
|
+
if (J[1] != null && J[1].length >= 1) {
|
|
357
|
+
const g = J[1].length <= c ? J[1].length : c;
|
|
358
|
+
w = yt(g, c, a);
|
|
359
|
+
}
|
|
360
|
+
let Z = w.format(parseFloat(L));
|
|
361
|
+
return t ? c > 0 && L.endsWith(".") && !L.slice(0, -1).includes(".") && (Z += W) : Z = ht(Z, V, W), y + Z;
|
|
362
|
+
}, At = (e) => JSON.parse(e.replaceAll("'", '"')), Pa = (e, t = {}) => {
|
|
363
363
|
const a = { ...t };
|
|
364
|
-
e.dataset.maska != null && e.dataset.maska !== "" && (a.mask =
|
|
364
|
+
e.dataset.maska != null && e.dataset.maska !== "" && (a.mask = Va(e.dataset.maska)), e.dataset.maskaEager != null && (a.eager = Je(e.dataset.maskaEager)), e.dataset.maskaReversed != null && (a.reversed = Je(e.dataset.maskaReversed)), e.dataset.maskaTokensReplace != null && (a.tokensReplace = Je(e.dataset.maskaTokensReplace)), e.dataset.maskaTokens != null && (a.tokens = Ea(e.dataset.maskaTokens));
|
|
365
365
|
const o = {};
|
|
366
366
|
return e.dataset.maskaNumberLocale != null && (o.locale = e.dataset.maskaNumberLocale), e.dataset.maskaNumberFraction != null && (o.fraction = parseInt(e.dataset.maskaNumberFraction)), e.dataset.maskaNumberUnsigned != null && (o.unsigned = Je(e.dataset.maskaNumberUnsigned)), (e.dataset.maskaNumber != null || Object.values(o).length > 0) && (a.number = o), a;
|
|
367
|
-
}, Je = (e) => e !== "" ? !!JSON.parse(e) : !0,
|
|
367
|
+
}, Je = (e) => e !== "" ? !!JSON.parse(e) : !0, Va = (e) => e.startsWith("[") && e.endsWith("]") ? At(e) : e, Ea = (e) => {
|
|
368
368
|
if (e.startsWith("{") && e.endsWith("}"))
|
|
369
369
|
return At(e);
|
|
370
370
|
const t = {};
|
|
@@ -384,7 +384,7 @@ const gt = {
|
|
|
384
384
|
return !1;
|
|
385
385
|
}
|
|
386
386
|
};
|
|
387
|
-
class
|
|
387
|
+
class Ma {
|
|
388
388
|
constructor(t = {}) {
|
|
389
389
|
Ue(this, "opts", {}), Ue(this, "memo", /* @__PURE__ */ new Map());
|
|
390
390
|
const a = { ...t };
|
|
@@ -432,18 +432,18 @@ class Ea {
|
|
|
432
432
|
}), { mask: a.join(""), escaped: o };
|
|
433
433
|
}
|
|
434
434
|
process(t, a, o = !0) {
|
|
435
|
-
if (this.opts.number != null) return
|
|
435
|
+
if (this.opts.number != null) return Sa(t, o, this.opts);
|
|
436
436
|
if (a == null) return t;
|
|
437
437
|
const l = `v=${t},mr=${a},m=${o ? 1 : 0}`;
|
|
438
438
|
if (this.memo.has(l)) return this.memo.get(l);
|
|
439
|
-
const { mask: i, escaped: r } = this.escapeMask(a), y = [],
|
|
440
|
-
let
|
|
441
|
-
for (;
|
|
442
|
-
const
|
|
443
|
-
if (!r.includes(g) &&
|
|
444
|
-
for (;
|
|
439
|
+
const { mask: i, escaped: r } = this.escapeMask(a), y = [], c = this.opts.tokens != null ? this.opts.tokens : {}, w = this.isReversed() ? -1 : 1, F = this.isReversed() ? "unshift" : "push", V = this.isReversed() ? 0 : i.length - 1, W = this.isReversed() ? () => g > -1 && b > -1 : () => g < i.length && b < t.length, L = (x) => !this.isReversed() && x <= V || this.isReversed() && x >= V;
|
|
440
|
+
let J, Z = -1, g = this.isReversed() ? i.length - 1 : 0, b = this.isReversed() ? t.length - 1 : 0, k = !1;
|
|
441
|
+
for (; W(); ) {
|
|
442
|
+
const x = i.charAt(g), j = c[x], U = (j == null ? void 0 : j.transform) != null ? j.transform(t.charAt(b)) : t.charAt(b);
|
|
443
|
+
if (!r.includes(g) && j != null ? (U.match(j.pattern) != null ? (y[F](U), j.repeated ? (Z === -1 ? Z = g : g === V && g !== Z && (g = Z - w), V === Z && (g -= w)) : j.multiple && (k = !0, g -= w), g += w) : j.multiple ? k && (g += w, b -= w, k = !1) : U === J ? J = void 0 : j.optional && (g += w, b -= w), b += w) : (o && !this.isEager() && y[F](x), U === x && !this.isEager() ? b += w : J = x, this.isEager() || (g += w)), this.isEager())
|
|
444
|
+
for (; L(g) && (c[i.charAt(g)] == null || r.includes(g)); ) {
|
|
445
445
|
if (o) {
|
|
446
|
-
if (y[
|
|
446
|
+
if (y[F](i.charAt(g)), t.charAt(b) === i.charAt(g)) {
|
|
447
447
|
g += w, b += w;
|
|
448
448
|
continue;
|
|
449
449
|
}
|
|
@@ -454,15 +454,15 @@ class Ea {
|
|
|
454
454
|
return this.memo.set(l, y.join("")), this.memo.get(l);
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
|
-
class
|
|
457
|
+
class Fa {
|
|
458
458
|
constructor(t, a = {}) {
|
|
459
459
|
Ue(this, "items", /* @__PURE__ */ new Map()), Ue(this, "eventAbortController"), Ue(this, "onInput", (o) => {
|
|
460
460
|
if (o instanceof CustomEvent && o.type === "input" && !o.isTrusted && !o.bubbles)
|
|
461
461
|
return;
|
|
462
462
|
const l = o.target, i = this.items.get(l);
|
|
463
463
|
if (i === void 0) return;
|
|
464
|
-
const r = "inputType" in o && o.inputType.startsWith("delete"), y = i.isEager(),
|
|
465
|
-
this.fixCursor(l, r, () => this.setValue(l,
|
|
464
|
+
const r = "inputType" in o && o.inputType.startsWith("delete"), y = i.isEager(), c = r && y && i.unmasked(l.value) === "" ? "" : l.value;
|
|
465
|
+
this.fixCursor(l, r, () => this.setValue(l, c));
|
|
466
466
|
}), this.options = a, this.eventAbortController = new AbortController(), this.init(this.getInputs(t));
|
|
467
467
|
}
|
|
468
468
|
update(t = {}) {
|
|
@@ -482,7 +482,7 @@ class Ma {
|
|
|
482
482
|
const { signal: i } = this.eventAbortController;
|
|
483
483
|
o.addEventListener("input", this.onInput, { capture: !0, signal: i });
|
|
484
484
|
}
|
|
485
|
-
const l = new
|
|
485
|
+
const l = new Ma(Pa(o, a));
|
|
486
486
|
this.items.set(o, l), queueMicrotask(() => this.updateValue(o)), o.selectionStart === null && l.isEager() && console.warn("Maska: input of `%s` type is not supported", o.type);
|
|
487
487
|
}
|
|
488
488
|
}
|
|
@@ -497,10 +497,10 @@ class Ma {
|
|
|
497
497
|
var l, i;
|
|
498
498
|
const r = t.selectionStart, y = t.value;
|
|
499
499
|
if (o(), r === null || r === y.length && !a) return;
|
|
500
|
-
const
|
|
501
|
-
if (
|
|
502
|
-
let
|
|
503
|
-
w !==
|
|
500
|
+
const c = t.value, w = y.slice(0, r), F = c.slice(0, r), V = (l = this.processInput(t, w)) == null ? void 0 : l.unmasked, W = (i = this.processInput(t, F)) == null ? void 0 : i.unmasked;
|
|
501
|
+
if (V === void 0 || W === void 0) return;
|
|
502
|
+
let L = r;
|
|
503
|
+
w !== F && (L += a ? c.length - y.length : V.length - W.length), t.setSelectionRange(L, L);
|
|
504
504
|
}
|
|
505
505
|
setValue(t, a) {
|
|
506
506
|
const o = this.processInput(t, a);
|
|
@@ -519,7 +519,7 @@ class Ma {
|
|
|
519
519
|
};
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
|
-
const tt = /* @__PURE__ */ new WeakMap(),
|
|
522
|
+
const tt = /* @__PURE__ */ new WeakMap(), Aa = (e, t) => {
|
|
523
523
|
if (e.arg == null || e.instance == null) return;
|
|
524
524
|
const a = "setup" in e.instance.$.type;
|
|
525
525
|
e.arg in e.instance ? e.instance[e.arg] = t : a && console.warn("Maska: please expose `%s` using defineExpose", e.arg);
|
|
@@ -531,12 +531,12 @@ const tt = /* @__PURE__ */ new WeakMap(), Fa = (e, t) => {
|
|
|
531
531
|
if (t.value != null && (l = typeof t.value == "string" ? { mask: t.value } : { ...t.value }), t.arg != null) {
|
|
532
532
|
const i = (r) => {
|
|
533
533
|
const y = t.modifiers.unmasked ? r.unmasked : t.modifiers.completed ? r.completed : r.masked;
|
|
534
|
-
|
|
534
|
+
Aa(t, y);
|
|
535
535
|
};
|
|
536
536
|
l.onMaska = l.onMaska == null ? i : Array.isArray(l.onMaska) ? [...l.onMaska, i] : [l.onMaska, i];
|
|
537
537
|
}
|
|
538
|
-
tt.has(o) ? (a = tt.get(o)) == null || a.update(l) : tt.set(o, new
|
|
539
|
-
},
|
|
538
|
+
tt.has(o) ? (a = tt.get(o)) == null || a.update(l) : tt.set(o, new Fa(o, l));
|
|
539
|
+
}, Ra = {
|
|
540
540
|
string: "text",
|
|
541
541
|
integer: "number",
|
|
542
542
|
decimal: "number",
|
|
@@ -551,9 +551,9 @@ const tt = /* @__PURE__ */ new WeakMap(), Fa = (e, t) => {
|
|
|
551
551
|
slug: "text",
|
|
552
552
|
text: "textarea"
|
|
553
553
|
};
|
|
554
|
-
function
|
|
554
|
+
function Ia(e) {
|
|
555
555
|
var o;
|
|
556
|
-
const t =
|
|
556
|
+
const t = Ra[e.type] ?? "text", a = {
|
|
557
557
|
field: e.name,
|
|
558
558
|
label: e.label,
|
|
559
559
|
type: t,
|
|
@@ -564,10 +564,10 @@ function Ra(e) {
|
|
|
564
564
|
value: l.value
|
|
565
565
|
}))), e.type === "fk" && (a.endpoint = e.endpoint, e.option_label && (a.optionLabel = e.option_label), e.option_value && (a.optionValue = e.option_value)), a;
|
|
566
566
|
}
|
|
567
|
-
function
|
|
568
|
-
return e.filter((t) => !t.read_only && t.name !== "id").map(
|
|
567
|
+
function Ta(e) {
|
|
568
|
+
return e.filter((t) => !t.read_only && t.name !== "id").map(Ia);
|
|
569
569
|
}
|
|
570
|
-
const
|
|
570
|
+
const La = {
|
|
571
571
|
boolean: "boolean",
|
|
572
572
|
date: "date",
|
|
573
573
|
datetime: "datetime",
|
|
@@ -575,19 +575,19 @@ const Ta = {
|
|
|
575
575
|
float: "number",
|
|
576
576
|
integer: "number"
|
|
577
577
|
};
|
|
578
|
-
function
|
|
578
|
+
function za(e) {
|
|
579
579
|
return {
|
|
580
580
|
field: e.type === "fk" ? `${e.name}_nome` : e.name,
|
|
581
581
|
header: e.label,
|
|
582
|
-
type:
|
|
582
|
+
type: La[e.type],
|
|
583
583
|
sortable: !0
|
|
584
584
|
};
|
|
585
585
|
}
|
|
586
|
-
function
|
|
587
|
-
return e.filter((a) => !a.read_only && a.name !== "id").slice(0, t).map(
|
|
586
|
+
function Na(e, t = 6) {
|
|
587
|
+
return e.filter((a) => !a.read_only && a.name !== "id").slice(0, t).map(za);
|
|
588
588
|
}
|
|
589
589
|
function It() {
|
|
590
|
-
const e =
|
|
590
|
+
const e = aa();
|
|
591
591
|
function t(i, r = "Sucesso") {
|
|
592
592
|
e.add({ severity: "success", summary: r, detail: i, life: 3e3 });
|
|
593
593
|
}
|
|
@@ -603,7 +603,7 @@ function It() {
|
|
|
603
603
|
return { success: t, error: a, warn: o, info: l };
|
|
604
604
|
}
|
|
605
605
|
function Tt() {
|
|
606
|
-
const e =
|
|
606
|
+
const e = na();
|
|
607
607
|
function t(o, l = "Deseja realmente excluir este registro?") {
|
|
608
608
|
e.require({
|
|
609
609
|
message: l,
|
|
@@ -637,10 +637,10 @@ function Tt() {
|
|
|
637
637
|
}
|
|
638
638
|
return { confirmDelete: t, confirmAction: a };
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function Ya(e) {
|
|
641
641
|
return e.replace(/_/g, " ").replace(/^\w/, (t) => t.toUpperCase());
|
|
642
642
|
}
|
|
643
|
-
function
|
|
643
|
+
function Oa(e) {
|
|
644
644
|
if (typeof e == "string")
|
|
645
645
|
return e;
|
|
646
646
|
if (Array.isArray(e)) {
|
|
@@ -654,7 +654,7 @@ function Ya(e) {
|
|
|
654
654
|
const a = [];
|
|
655
655
|
for (const [o, l] of Object.entries(t)) {
|
|
656
656
|
if (o === "non_field_errors") continue;
|
|
657
|
-
const i =
|
|
657
|
+
const i = Ya(o);
|
|
658
658
|
if (Array.isArray(l)) {
|
|
659
659
|
const r = l.filter((y) => typeof y == "string");
|
|
660
660
|
r.length > 0 && a.push(`${i}: ${r.join(" ")}`);
|
|
@@ -672,12 +672,12 @@ function Ke(e, t = "Erro inesperado") {
|
|
|
672
672
|
if (!o || typeof o != "object")
|
|
673
673
|
return a.message || t;
|
|
674
674
|
const l = o.detail ?? o;
|
|
675
|
-
return
|
|
675
|
+
return Oa(l) || t;
|
|
676
676
|
}
|
|
677
|
-
function
|
|
677
|
+
function Jl() {
|
|
678
678
|
return { extractApiError: Ke };
|
|
679
679
|
}
|
|
680
|
-
const
|
|
680
|
+
const Ba = { class: "w-autocompletefk" }, Wa = ["disabled"], ja = { class: "w-autocompletefk-toolbar" }, Ua = { class: "w-autocompletefk-toolbar-actions" }, qa = { class: "flex items-center justify-end gap-1" }, Ha = { class: "w-autocompletefk-footer" }, Lt = /* @__PURE__ */ de({
|
|
681
681
|
__name: "WAutoCompleteFK",
|
|
682
682
|
props: {
|
|
683
683
|
modelValue: {},
|
|
@@ -706,211 +706,211 @@ const Oa = { class: "w-autocompletefk" }, Ba = ["disabled"], Wa = { class: "w-au
|
|
|
706
706
|
throw new Error(
|
|
707
707
|
"[wPrimeVueComponents] dataProvider não encontrado. Registre o WPrimeVuePlugin."
|
|
708
708
|
);
|
|
709
|
-
const i = l, r = It(), { confirmDelete: y } = Tt(),
|
|
710
|
-
let
|
|
711
|
-
async function
|
|
709
|
+
const i = l, r = It(), { confirmDelete: y } = Tt(), c = q(null), w = q([]), F = q(!1);
|
|
710
|
+
let V = null;
|
|
711
|
+
async function W(C) {
|
|
712
712
|
try {
|
|
713
|
-
const
|
|
714
|
-
|
|
713
|
+
const S = await i.get(a.endpoint, C);
|
|
714
|
+
c.value = S.data;
|
|
715
715
|
} catch {
|
|
716
|
-
|
|
716
|
+
c.value = null;
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
|
-
async function
|
|
720
|
-
|
|
719
|
+
async function L(C) {
|
|
720
|
+
F.value = !0;
|
|
721
721
|
try {
|
|
722
|
-
const
|
|
722
|
+
const S = {
|
|
723
723
|
page_size: 20,
|
|
724
724
|
...a.endpointParams
|
|
725
725
|
};
|
|
726
|
-
C && (
|
|
727
|
-
const te = await i.list(a.endpoint,
|
|
726
|
+
C && (S.search = C);
|
|
727
|
+
const te = await i.list(a.endpoint, S);
|
|
728
728
|
w.value = te.data;
|
|
729
729
|
} catch {
|
|
730
730
|
w.value = [];
|
|
731
731
|
} finally {
|
|
732
|
-
|
|
732
|
+
F.value = !1;
|
|
733
733
|
}
|
|
734
734
|
}
|
|
735
|
-
function
|
|
736
|
-
const
|
|
737
|
-
if (
|
|
735
|
+
function J(C) {
|
|
736
|
+
const S = C.query || "";
|
|
737
|
+
if (S.length < a.minLength) {
|
|
738
738
|
w.value = [];
|
|
739
739
|
return;
|
|
740
740
|
}
|
|
741
|
-
|
|
741
|
+
V && clearTimeout(V), V = setTimeout(() => L(S), 300);
|
|
742
742
|
}
|
|
743
|
-
function
|
|
744
|
-
|
|
743
|
+
function Z(C) {
|
|
744
|
+
c.value = C.value, o("update:modelValue", C.value);
|
|
745
745
|
}
|
|
746
746
|
function g() {
|
|
747
|
-
|
|
747
|
+
c.value = null, o("update:modelValue", null);
|
|
748
748
|
}
|
|
749
749
|
nt(
|
|
750
750
|
() => a.modelValue,
|
|
751
751
|
async (C) => {
|
|
752
752
|
if (C != null) {
|
|
753
753
|
if (typeof C == "object" && C !== null && a.optionLabel in C) {
|
|
754
|
-
|
|
754
|
+
c.value = C;
|
|
755
755
|
return;
|
|
756
756
|
}
|
|
757
|
-
(!
|
|
757
|
+
(!c.value || c.value[a.optionValue] !== C) && await W(C);
|
|
758
758
|
} else
|
|
759
|
-
|
|
759
|
+
c.value = null;
|
|
760
760
|
},
|
|
761
761
|
{ immediate: !0 }
|
|
762
762
|
);
|
|
763
|
-
const b = q(!1),
|
|
764
|
-
let
|
|
765
|
-
const
|
|
763
|
+
const b = q(!1), k = q([]), x = q(!1), j = q(""), U = q(1), Y = q(15), K = q(0), B = q(null), X = q(null), oe = q(0);
|
|
764
|
+
let ae = null;
|
|
765
|
+
const _ = q([]), f = H(() => {
|
|
766
766
|
var C;
|
|
767
|
-
return (C = a.crudFields) != null && C.length ? !0 :
|
|
768
|
-
}),
|
|
767
|
+
return (C = a.crudFields) != null && C.length ? !0 : _.value.length > 0;
|
|
768
|
+
}), P = H(() => a.canCreate ?? f.value), u = H(() => a.canEdit ?? f.value), n = H(() => a.canDelete ?? f.value), p = H(() => u.value || n.value), d = H(() => {
|
|
769
769
|
var C;
|
|
770
|
-
return (C = a.crudFields) != null && C.length ? a.crudFields :
|
|
771
|
-
}),
|
|
772
|
-
var C,
|
|
773
|
-
return (C = a.crudColumns) != null && C.length ? a.crudColumns : (
|
|
770
|
+
return (C = a.crudFields) != null && C.length ? a.crudFields : Ta(_.value);
|
|
771
|
+
}), E = H(() => {
|
|
772
|
+
var C, S;
|
|
773
|
+
return (C = a.crudColumns) != null && C.length ? a.crudColumns : (S = a.columns) != null && S.length ? a.columns.map((te) => ({
|
|
774
774
|
field: te.field,
|
|
775
775
|
header: te.header,
|
|
776
776
|
sortable: !0
|
|
777
|
-
})) :
|
|
777
|
+
})) : _.value.length ? Na(_.value) : [
|
|
778
778
|
{ field: a.optionLabel, header: a.optionLabel, sortable: !0 }
|
|
779
779
|
];
|
|
780
780
|
});
|
|
781
|
-
async function
|
|
782
|
-
var C,
|
|
783
|
-
|
|
781
|
+
async function R() {
|
|
782
|
+
var C, S, te;
|
|
783
|
+
x.value = !0;
|
|
784
784
|
try {
|
|
785
|
-
const
|
|
785
|
+
const z = {
|
|
786
786
|
page: U.value,
|
|
787
|
-
page_size:
|
|
787
|
+
page_size: Y.value,
|
|
788
788
|
...a.endpointParams
|
|
789
789
|
};
|
|
790
|
-
|
|
791
|
-
const
|
|
792
|
-
|
|
790
|
+
j.value && (z.search = j.value), X.value && oe.value !== 0 && (z.ordering = oe.value === -1 ? `-${X.value}` : X.value);
|
|
791
|
+
const ce = await i.list(a.endpoint, z);
|
|
792
|
+
k.value = ce.data, K.value = ce.rows, (C = ce.extras) != null && C.fields && !((S = a.columns) != null && S.length) && !((te = a.crudFields) != null && te.length) && (_.value = ce.extras.fields);
|
|
793
793
|
} catch {
|
|
794
|
-
|
|
794
|
+
k.value = [], K.value = 0;
|
|
795
795
|
} finally {
|
|
796
|
-
|
|
796
|
+
x.value = !1;
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
|
-
function
|
|
800
|
-
a.disabled || (
|
|
799
|
+
function G() {
|
|
800
|
+
a.disabled || (j.value = "", U.value = 1, X.value = null, oe.value = 0, B.value = null, b.value = !0, R());
|
|
801
801
|
}
|
|
802
|
-
function
|
|
803
|
-
U.value = C.page + 1,
|
|
802
|
+
function se(C) {
|
|
803
|
+
U.value = C.page + 1, Y.value = C.rows, R();
|
|
804
804
|
}
|
|
805
805
|
function pe(C) {
|
|
806
|
-
X.value = C.sortField ?? null, oe.value = C.sortOrder ?? 0, U.value = 1,
|
|
806
|
+
X.value = C.sortField ?? null, oe.value = C.sortOrder ?? 0, U.value = 1, R();
|
|
807
807
|
}
|
|
808
808
|
function Ne() {
|
|
809
|
-
|
|
809
|
+
B.value && (c.value = B.value, o("update:modelValue", B.value), b.value = !1);
|
|
810
810
|
}
|
|
811
811
|
function Ye(C) {
|
|
812
|
-
|
|
812
|
+
c.value = C.data, o("update:modelValue", C.data), b.value = !1;
|
|
813
813
|
}
|
|
814
|
-
nt(
|
|
815
|
-
|
|
816
|
-
U.value = 1,
|
|
814
|
+
nt(j, () => {
|
|
815
|
+
ae && clearTimeout(ae), ae = setTimeout(() => {
|
|
816
|
+
U.value = 1, R();
|
|
817
817
|
}, 300);
|
|
818
818
|
});
|
|
819
|
-
const
|
|
820
|
-
() =>
|
|
819
|
+
const we = q(!1), ke = q(!1), ue = q(null), ve = ge({}), Ce = H(() => ue.value !== null), Ee = H(
|
|
820
|
+
() => Ce.value ? "Editar Registro" : "Novo Registro"
|
|
821
821
|
);
|
|
822
|
-
function
|
|
822
|
+
function De() {
|
|
823
823
|
const C = {};
|
|
824
|
-
for (const
|
|
825
|
-
C[
|
|
824
|
+
for (const S of d.value)
|
|
825
|
+
C[S.field] = S.defaultValue !== void 0 ? typeof S.defaultValue == "function" ? S.defaultValue() : S.defaultValue : null;
|
|
826
826
|
return C;
|
|
827
827
|
}
|
|
828
|
-
function
|
|
829
|
-
const C =
|
|
830
|
-
for (const
|
|
831
|
-
delete ve[
|
|
832
|
-
for (const [
|
|
833
|
-
ve[
|
|
828
|
+
function Me() {
|
|
829
|
+
const C = De();
|
|
830
|
+
for (const S of Object.keys(ve))
|
|
831
|
+
delete ve[S];
|
|
832
|
+
for (const [S, te] of Object.entries(C))
|
|
833
|
+
ve[S] = te;
|
|
834
834
|
}
|
|
835
|
-
function
|
|
836
|
-
|
|
835
|
+
function ye() {
|
|
836
|
+
ue.value = null, Me(), we.value = !0;
|
|
837
837
|
}
|
|
838
|
-
function
|
|
839
|
-
|
|
840
|
-
for (const
|
|
841
|
-
ve[
|
|
842
|
-
|
|
838
|
+
function xe(C) {
|
|
839
|
+
ue.value = C;
|
|
840
|
+
for (const S of d.value)
|
|
841
|
+
ve[S.field] = C[S.field] !== void 0 ? C[S.field] : null;
|
|
842
|
+
we.value = !0;
|
|
843
843
|
}
|
|
844
|
-
function
|
|
845
|
-
ve[C] =
|
|
844
|
+
function Fe(C, S) {
|
|
845
|
+
ve[C] = S;
|
|
846
846
|
}
|
|
847
|
-
async function
|
|
848
|
-
|
|
847
|
+
async function Ae() {
|
|
848
|
+
ke.value = !0;
|
|
849
849
|
try {
|
|
850
850
|
const C = { ...ve };
|
|
851
|
-
for (const te of
|
|
852
|
-
const
|
|
853
|
-
if (te.type === "fk" &&
|
|
854
|
-
const
|
|
855
|
-
C[te.field] =
|
|
851
|
+
for (const te of d.value) {
|
|
852
|
+
const z = C[te.field];
|
|
853
|
+
if (te.type === "fk" && z !== null && typeof z == "object") {
|
|
854
|
+
const ce = te.optionValue || "id";
|
|
855
|
+
C[te.field] = z[ce] ?? z;
|
|
856
856
|
}
|
|
857
857
|
}
|
|
858
|
-
let
|
|
859
|
-
if (
|
|
860
|
-
const te =
|
|
861
|
-
|
|
858
|
+
let S;
|
|
859
|
+
if (Ce.value && ue.value) {
|
|
860
|
+
const te = ue.value[a.optionValue];
|
|
861
|
+
S = await i.update(
|
|
862
862
|
a.endpoint,
|
|
863
863
|
te,
|
|
864
864
|
C
|
|
865
865
|
);
|
|
866
|
-
const
|
|
867
|
-
|
|
866
|
+
const z = k.value.findIndex((ce) => ce[a.optionValue] === te);
|
|
867
|
+
z !== -1 && (k.value[z] = S.data), r.success("Registro atualizado com sucesso");
|
|
868
868
|
} else
|
|
869
|
-
|
|
870
|
-
|
|
869
|
+
S = await i.create(a.endpoint, C), k.value.unshift(S.data), K.value++, r.success("Registro criado com sucesso");
|
|
870
|
+
we.value = !1, ue.value = null, B.value = S.data;
|
|
871
871
|
} catch (C) {
|
|
872
872
|
r.error(Ke(C, "Erro ao salvar registro"));
|
|
873
873
|
} finally {
|
|
874
|
-
|
|
874
|
+
ke.value = !1;
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function Re(C) {
|
|
878
878
|
y(async () => {
|
|
879
879
|
try {
|
|
880
|
-
const
|
|
881
|
-
await i.delete(a.endpoint,
|
|
882
|
-
const te =
|
|
883
|
-
te !== -1 && (
|
|
884
|
-
} catch (
|
|
885
|
-
r.error(Ke(
|
|
880
|
+
const S = C[a.optionValue];
|
|
881
|
+
await i.delete(a.endpoint, S);
|
|
882
|
+
const te = k.value.findIndex((z) => z[a.optionValue] === S);
|
|
883
|
+
te !== -1 && (k.value.splice(te, 1), K.value--), c.value && c.value[a.optionValue] === S && (c.value = null, o("update:modelValue", null)), B.value && B.value[a.optionValue] === S && (B.value = null), r.success("Registro excluído com sucesso");
|
|
884
|
+
} catch (S) {
|
|
885
|
+
r.error(Ke(S, "Erro ao excluir registro"));
|
|
886
886
|
}
|
|
887
887
|
});
|
|
888
888
|
}
|
|
889
|
-
return (C,
|
|
889
|
+
return (C, S) => {
|
|
890
890
|
const te = kt("tooltip");
|
|
891
|
-
return s(),
|
|
892
|
-
h("div",
|
|
891
|
+
return s(), m(le, null, [
|
|
892
|
+
h("div", Ba, [
|
|
893
893
|
N(v(xt), {
|
|
894
|
-
"model-value":
|
|
894
|
+
"model-value": c.value,
|
|
895
895
|
suggestions: w.value,
|
|
896
896
|
"option-label": e.optionLabel,
|
|
897
897
|
placeholder: e.placeholder,
|
|
898
898
|
disabled: e.disabled,
|
|
899
899
|
"force-selection": e.forceSelection,
|
|
900
|
-
loading:
|
|
900
|
+
loading: F.value,
|
|
901
901
|
fluid: "",
|
|
902
|
-
onComplete:
|
|
903
|
-
onItemSelect:
|
|
902
|
+
onComplete: J,
|
|
903
|
+
onItemSelect: Z,
|
|
904
904
|
onClear: g
|
|
905
905
|
}, null, 8, ["model-value", "suggestions", "option-label", "placeholder", "disabled", "force-selection", "loading"]),
|
|
906
|
-
|
|
906
|
+
fe((s(), m("button", {
|
|
907
907
|
type: "button",
|
|
908
908
|
disabled: e.disabled,
|
|
909
909
|
class: "w-autocompletefk-trigger",
|
|
910
|
-
onClick:
|
|
911
|
-
}, [...
|
|
910
|
+
onClick: G
|
|
911
|
+
}, [...S[6] || (S[6] = [
|
|
912
912
|
h("i", { class: "pi pi-search" }, null, -1)
|
|
913
|
-
])], 8,
|
|
913
|
+
])], 8, Wa)), [
|
|
914
914
|
[
|
|
915
915
|
te,
|
|
916
916
|
"Pesquisar",
|
|
@@ -921,7 +921,7 @@ const Oa = { class: "w-autocompletefk" }, Ba = ["disabled"], Wa = { class: "w-au
|
|
|
921
921
|
]),
|
|
922
922
|
N(v(Dt), {
|
|
923
923
|
visible: b.value,
|
|
924
|
-
"onUpdate:visible":
|
|
924
|
+
"onUpdate:visible": S[4] || (S[4] = (z) => b.value = z),
|
|
925
925
|
header: e.dialogHeader || "Pesquisar",
|
|
926
926
|
style: { width: "80vw" },
|
|
927
927
|
modal: "",
|
|
@@ -929,66 +929,66 @@ const Oa = { class: "w-autocompletefk" }, Ba = ["disabled"], Wa = { class: "w-au
|
|
|
929
929
|
class: "w-autocompletefk-dialog"
|
|
930
930
|
}, {
|
|
931
931
|
footer: ne(() => [
|
|
932
|
-
h("div",
|
|
933
|
-
N(v(
|
|
932
|
+
h("div", Ha, [
|
|
933
|
+
N(v(ee), {
|
|
934
934
|
label: "Cancelar",
|
|
935
935
|
severity: "secondary",
|
|
936
936
|
text: "",
|
|
937
|
-
onClick:
|
|
937
|
+
onClick: S[3] || (S[3] = (z) => b.value = !1)
|
|
938
938
|
}),
|
|
939
|
-
N(v(
|
|
939
|
+
N(v(ee), {
|
|
940
940
|
label: "Selecionar",
|
|
941
941
|
icon: "pi pi-check",
|
|
942
|
-
disabled: !
|
|
942
|
+
disabled: !B.value,
|
|
943
943
|
onClick: Ne
|
|
944
944
|
}, null, 8, ["disabled"])
|
|
945
945
|
])
|
|
946
946
|
]),
|
|
947
947
|
default: ne(() => [
|
|
948
|
-
h("div",
|
|
948
|
+
h("div", ja, [
|
|
949
949
|
N(v(qe), { class: "w-autocompletefk-toolbar-search" }, {
|
|
950
950
|
default: ne(() => [
|
|
951
951
|
N(v(He), { class: "pi pi-search" }),
|
|
952
|
-
N(v(
|
|
953
|
-
modelValue:
|
|
954
|
-
"onUpdate:modelValue":
|
|
952
|
+
N(v(me), {
|
|
953
|
+
modelValue: j.value,
|
|
954
|
+
"onUpdate:modelValue": S[0] || (S[0] = (z) => j.value = z),
|
|
955
955
|
placeholder: "Pesquisar...",
|
|
956
956
|
class: "w-full"
|
|
957
957
|
}, null, 8, ["modelValue"])
|
|
958
958
|
]),
|
|
959
959
|
_: 1
|
|
960
960
|
}),
|
|
961
|
-
h("div",
|
|
962
|
-
|
|
961
|
+
h("div", Ua, [
|
|
962
|
+
P.value ? (s(), A(v(ee), {
|
|
963
963
|
key: 0,
|
|
964
964
|
label: "Novo",
|
|
965
965
|
icon: "pi pi-plus",
|
|
966
966
|
size: "small",
|
|
967
|
-
onClick:
|
|
968
|
-
})) :
|
|
967
|
+
onClick: ye
|
|
968
|
+
})) : $("", !0)
|
|
969
969
|
])
|
|
970
970
|
]),
|
|
971
971
|
N(v($t), {
|
|
972
|
-
selection:
|
|
973
|
-
"onUpdate:selection":
|
|
974
|
-
value:
|
|
975
|
-
loading:
|
|
972
|
+
selection: B.value,
|
|
973
|
+
"onUpdate:selection": S[1] || (S[1] = (z) => B.value = z),
|
|
974
|
+
value: k.value,
|
|
975
|
+
loading: x.value,
|
|
976
976
|
paginator: "",
|
|
977
977
|
lazy: "",
|
|
978
978
|
"striped-rows": "",
|
|
979
979
|
"removable-sort": "",
|
|
980
980
|
size: "small",
|
|
981
|
-
rows:
|
|
982
|
-
"total-records":
|
|
981
|
+
rows: Y.value,
|
|
982
|
+
"total-records": K.value,
|
|
983
983
|
"sort-field": X.value ?? void 0,
|
|
984
984
|
"sort-order": oe.value,
|
|
985
985
|
"selection-mode": "single",
|
|
986
986
|
"data-key": e.optionValue,
|
|
987
|
-
onPage:
|
|
988
|
-
onSort:
|
|
987
|
+
onPage: se,
|
|
988
|
+
onSort: S[2] || (S[2] = (z) => pe({ sortField: z.sortField, sortOrder: z.sortOrder })),
|
|
989
989
|
onRowDblclick: Ye
|
|
990
990
|
}, {
|
|
991
|
-
empty: ne(() => [...
|
|
991
|
+
empty: ne(() => [...S[7] || (S[7] = [
|
|
992
992
|
h("div", { class: "w-autocompletefk-empty" }, "Nenhum registro encontrado", -1)
|
|
993
993
|
])]),
|
|
994
994
|
default: ne(() => [
|
|
@@ -996,39 +996,39 @@ const Oa = { class: "w-autocompletefk" }, Ba = ["disabled"], Wa = { class: "w-au
|
|
|
996
996
|
"selection-mode": "single",
|
|
997
997
|
"header-style": "width: 3rem"
|
|
998
998
|
}),
|
|
999
|
-
(s(!0),
|
|
1000
|
-
key:
|
|
1001
|
-
field:
|
|
1002
|
-
header:
|
|
1003
|
-
sortable:
|
|
1004
|
-
style: je(
|
|
999
|
+
(s(!0), m(le, null, ie(E.value, (z) => (s(), A(v(ze), {
|
|
1000
|
+
key: z.field,
|
|
1001
|
+
field: z.field,
|
|
1002
|
+
header: z.header,
|
|
1003
|
+
sortable: z.sortable ?? !0,
|
|
1004
|
+
style: je(z.style)
|
|
1005
1005
|
}, {
|
|
1006
|
-
body: ne(({ data:
|
|
1007
|
-
|
|
1006
|
+
body: ne(({ data: ce }) => [
|
|
1007
|
+
z.type ? (s(), A(Qe, {
|
|
1008
1008
|
key: 0,
|
|
1009
|
-
column:
|
|
1010
|
-
value:
|
|
1011
|
-
"row-data":
|
|
1012
|
-
}, null, 8, ["column", "value", "row-data"])) : (s(),
|
|
1013
|
-
|
|
1009
|
+
column: z,
|
|
1010
|
+
value: ce[z.field],
|
|
1011
|
+
"row-data": ce
|
|
1012
|
+
}, null, 8, ["column", "value", "row-data"])) : (s(), m(le, { key: 1 }, [
|
|
1013
|
+
Pe(T(ce[z.field]), 1)
|
|
1014
1014
|
], 64))
|
|
1015
1015
|
]),
|
|
1016
1016
|
_: 2
|
|
1017
1017
|
}, 1032, ["field", "header", "sortable", "style"]))), 128)),
|
|
1018
|
-
|
|
1018
|
+
p.value ? (s(), A(v(ze), {
|
|
1019
1019
|
key: 0,
|
|
1020
1020
|
header: "",
|
|
1021
1021
|
style: { width: "6rem" }
|
|
1022
1022
|
}, {
|
|
1023
|
-
body: ne(({ data:
|
|
1024
|
-
h("div",
|
|
1025
|
-
u.value ?
|
|
1023
|
+
body: ne(({ data: z }) => [
|
|
1024
|
+
h("div", qa, [
|
|
1025
|
+
u.value ? fe((s(), A(v(ee), {
|
|
1026
1026
|
key: 0,
|
|
1027
1027
|
icon: "pi pi-pencil",
|
|
1028
1028
|
text: "",
|
|
1029
1029
|
rounded: "",
|
|
1030
1030
|
size: "small",
|
|
1031
|
-
onClick: (
|
|
1031
|
+
onClick: (ce) => xe(z)
|
|
1032
1032
|
}, null, 8, ["onClick"])), [
|
|
1033
1033
|
[
|
|
1034
1034
|
te,
|
|
@@ -1036,15 +1036,15 @@ const Oa = { class: "w-autocompletefk" }, Ba = ["disabled"], Wa = { class: "w-au
|
|
|
1036
1036
|
void 0,
|
|
1037
1037
|
{ top: !0 }
|
|
1038
1038
|
]
|
|
1039
|
-
]) :
|
|
1040
|
-
n.value ?
|
|
1039
|
+
]) : $("", !0),
|
|
1040
|
+
n.value ? fe((s(), A(v(ee), {
|
|
1041
1041
|
key: 1,
|
|
1042
1042
|
icon: "pi pi-trash",
|
|
1043
1043
|
text: "",
|
|
1044
1044
|
rounded: "",
|
|
1045
1045
|
size: "small",
|
|
1046
1046
|
severity: "danger",
|
|
1047
|
-
onClick: (
|
|
1047
|
+
onClick: (ce) => Re(z)
|
|
1048
1048
|
}, null, 8, ["onClick"])), [
|
|
1049
1049
|
[
|
|
1050
1050
|
te,
|
|
@@ -1052,36 +1052,36 @@ const Oa = { class: "w-autocompletefk" }, Ba = ["disabled"], Wa = { class: "w-au
|
|
|
1052
1052
|
void 0,
|
|
1053
1053
|
{ top: !0 }
|
|
1054
1054
|
]
|
|
1055
|
-
]) :
|
|
1055
|
+
]) : $("", !0)
|
|
1056
1056
|
])
|
|
1057
1057
|
]),
|
|
1058
1058
|
_: 1
|
|
1059
|
-
})) :
|
|
1059
|
+
})) : $("", !0)
|
|
1060
1060
|
]),
|
|
1061
1061
|
_: 1
|
|
1062
1062
|
}, 8, ["selection", "value", "loading", "rows", "total-records", "sort-field", "sort-order", "data-key"])
|
|
1063
1063
|
]),
|
|
1064
1064
|
_: 1
|
|
1065
1065
|
}, 8, ["visible", "header"]),
|
|
1066
|
-
f.value ? (s(),
|
|
1066
|
+
f.value ? (s(), A(ut, {
|
|
1067
1067
|
key: 0,
|
|
1068
|
-
visible:
|
|
1069
|
-
title:
|
|
1070
|
-
fields:
|
|
1068
|
+
visible: we.value,
|
|
1069
|
+
title: Ee.value,
|
|
1070
|
+
fields: d.value,
|
|
1071
1071
|
"form-data": ve,
|
|
1072
|
-
"is-editing":
|
|
1073
|
-
saving:
|
|
1072
|
+
"is-editing": Ce.value,
|
|
1073
|
+
saving: ke.value,
|
|
1074
1074
|
width: e.dialogWidth,
|
|
1075
|
-
"onUpdate:visible":
|
|
1076
|
-
|
|
1075
|
+
"onUpdate:visible": S[5] || (S[5] = (z) => {
|
|
1076
|
+
we.value = z, z || (ue.value = null);
|
|
1077
1077
|
}),
|
|
1078
|
-
"onUpdate:field":
|
|
1079
|
-
onSave:
|
|
1080
|
-
}, null, 8, ["visible", "title", "fields", "form-data", "is-editing", "saving", "width"])) :
|
|
1078
|
+
"onUpdate:field": Fe,
|
|
1079
|
+
onSave: Ae
|
|
1080
|
+
}, null, 8, ["visible", "title", "fields", "form-data", "is-editing", "saving", "width"])) : $("", !0)
|
|
1081
1081
|
], 64);
|
|
1082
1082
|
};
|
|
1083
1083
|
}
|
|
1084
|
-
}), zt = /* @__PURE__ */
|
|
1084
|
+
}), zt = /* @__PURE__ */ de({
|
|
1085
1085
|
__name: "WMoneyInput",
|
|
1086
1086
|
props: {
|
|
1087
1087
|
modelValue: {},
|
|
@@ -1099,33 +1099,33 @@ const Oa = { class: "w-autocompletefk" }, Ba = ["disabled"], Wa = { class: "w-au
|
|
|
1099
1099
|
const a = e, o = t, l = H(
|
|
1100
1100
|
() => a.prefix ?? (a.currency ? "R$" : void 0)
|
|
1101
1101
|
), i = H(() => !!l.value || !!a.suffix), r = H(() => {
|
|
1102
|
-
const
|
|
1103
|
-
return
|
|
1102
|
+
const c = a.modelValue;
|
|
1103
|
+
return c == null || Number.isNaN(c) ? "" : new Intl.NumberFormat(a.locale, {
|
|
1104
1104
|
minimumFractionDigits: a.decimals,
|
|
1105
1105
|
maximumFractionDigits: a.decimals
|
|
1106
|
-
}).format(
|
|
1106
|
+
}).format(c);
|
|
1107
1107
|
});
|
|
1108
|
-
function y(
|
|
1109
|
-
const w =
|
|
1108
|
+
function y(c) {
|
|
1109
|
+
const w = c.target.value.replace(/\D/g, "");
|
|
1110
1110
|
if (!w) {
|
|
1111
1111
|
o("update:modelValue", null);
|
|
1112
1112
|
return;
|
|
1113
1113
|
}
|
|
1114
|
-
const
|
|
1115
|
-
o("update:modelValue",
|
|
1114
|
+
const F = Number(w) / Math.pow(10, a.decimals);
|
|
1115
|
+
o("update:modelValue", F);
|
|
1116
1116
|
}
|
|
1117
|
-
return (
|
|
1117
|
+
return (c, w) => i.value ? (s(), A(v(oa), {
|
|
1118
1118
|
key: 0,
|
|
1119
1119
|
class: "w-money-input"
|
|
1120
1120
|
}, {
|
|
1121
1121
|
default: ne(() => [
|
|
1122
|
-
l.value ? (s(),
|
|
1122
|
+
l.value ? (s(), A(v(mt), { key: 0 }, {
|
|
1123
1123
|
default: ne(() => [
|
|
1124
|
-
|
|
1124
|
+
Pe(T(l.value), 1)
|
|
1125
1125
|
]),
|
|
1126
1126
|
_: 1
|
|
1127
|
-
})) :
|
|
1128
|
-
N(v(
|
|
1127
|
+
})) : $("", !0),
|
|
1128
|
+
N(v(me), {
|
|
1129
1129
|
"model-value": r.value,
|
|
1130
1130
|
inputmode: "numeric",
|
|
1131
1131
|
class: "w-money-input__field",
|
|
@@ -1134,15 +1134,15 @@ const Oa = { class: "w-autocompletefk" }, Ba = ["disabled"], Wa = { class: "w-au
|
|
|
1134
1134
|
invalid: e.invalid,
|
|
1135
1135
|
onInput: y
|
|
1136
1136
|
}, null, 8, ["model-value", "placeholder", "disabled", "invalid"]),
|
|
1137
|
-
e.suffix ? (s(),
|
|
1137
|
+
e.suffix ? (s(), A(v(mt), { key: 1 }, {
|
|
1138
1138
|
default: ne(() => [
|
|
1139
|
-
|
|
1139
|
+
Pe(T(e.suffix), 1)
|
|
1140
1140
|
]),
|
|
1141
1141
|
_: 1
|
|
1142
|
-
})) :
|
|
1142
|
+
})) : $("", !0)
|
|
1143
1143
|
]),
|
|
1144
1144
|
_: 1
|
|
1145
|
-
})) : (s(),
|
|
1145
|
+
})) : (s(), A(v(me), {
|
|
1146
1146
|
key: 1,
|
|
1147
1147
|
"model-value": r.value,
|
|
1148
1148
|
inputmode: "numeric",
|
|
@@ -1154,13 +1154,13 @@ const Oa = { class: "w-autocompletefk" }, Ba = ["disabled"], Wa = { class: "w-au
|
|
|
1154
1154
|
onInput: y
|
|
1155
1155
|
}, null, 8, ["model-value", "placeholder", "disabled", "invalid"]));
|
|
1156
1156
|
}
|
|
1157
|
-
}),
|
|
1157
|
+
}), Ka = { class: "w-transfer__pane" }, Ga = { class: "w-transfer__head" }, Ja = { class: "w-transfer__count" }, Za = { class: "w-transfer__list" }, Xa = ["onClick"], Qa = {
|
|
1158
1158
|
key: 0,
|
|
1159
1159
|
class: "w-transfer__empty"
|
|
1160
|
-
},
|
|
1160
|
+
}, _a = { class: "w-transfer__controls" }, en = { class: "w-transfer__pane" }, tn = { class: "w-transfer__head" }, an = { class: "w-transfer__count" }, nn = { class: "w-transfer__list" }, on = ["onClick"], ln = {
|
|
1161
1161
|
key: 0,
|
|
1162
1162
|
class: "w-transfer__empty"
|
|
1163
|
-
}, Nt = /* @__PURE__ */
|
|
1163
|
+
}, Nt = /* @__PURE__ */ de({
|
|
1164
1164
|
__name: "WTransferList",
|
|
1165
1165
|
props: {
|
|
1166
1166
|
source: {},
|
|
@@ -1173,84 +1173,84 @@ const Oa = { class: "w-autocompletefk" }, Ba = ["disabled"], Wa = { class: "w-au
|
|
|
1173
1173
|
emits: ["update:selected"],
|
|
1174
1174
|
setup(e, { emit: t }) {
|
|
1175
1175
|
const a = e, o = t, l = q(""), i = q(""), r = H(() => new Set(a.selected)), y = H(() => a.searchFields ?? [a.optionLabel]);
|
|
1176
|
-
function
|
|
1176
|
+
function c(b) {
|
|
1177
1177
|
return b[a.trackBy];
|
|
1178
1178
|
}
|
|
1179
1179
|
function w(b) {
|
|
1180
1180
|
return String(b[a.optionLabel] ?? "");
|
|
1181
1181
|
}
|
|
1182
|
-
function
|
|
1183
|
-
if (
|
|
1184
|
-
const
|
|
1182
|
+
function F(b, k) {
|
|
1183
|
+
if (!k) return !0;
|
|
1184
|
+
const x = k.toLowerCase();
|
|
1185
1185
|
return y.value.some(
|
|
1186
|
-
(
|
|
1186
|
+
(j) => String(b[j] ?? "").toLowerCase().includes(x)
|
|
1187
1187
|
);
|
|
1188
1188
|
}
|
|
1189
|
-
const
|
|
1189
|
+
const V = H(
|
|
1190
1190
|
() => a.source.filter(
|
|
1191
|
-
(b) => !r.value.has(
|
|
1191
|
+
(b) => !r.value.has(c(b)) && F(b, l.value)
|
|
1192
1192
|
)
|
|
1193
|
-
),
|
|
1193
|
+
), W = H(
|
|
1194
1194
|
() => a.source.filter(
|
|
1195
|
-
(b) => r.value.has(
|
|
1195
|
+
(b) => r.value.has(c(b)) && F(b, i.value)
|
|
1196
1196
|
)
|
|
1197
1197
|
);
|
|
1198
|
-
function
|
|
1199
|
-
a.disabled || o("update:selected", [...a.selected,
|
|
1198
|
+
function L(b) {
|
|
1199
|
+
a.disabled || o("update:selected", [...a.selected, c(b)]);
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1201
|
+
function J(b) {
|
|
1202
1202
|
if (a.disabled) return;
|
|
1203
|
-
const
|
|
1204
|
-
o("update:selected", a.selected.filter((
|
|
1203
|
+
const k = c(b);
|
|
1204
|
+
o("update:selected", a.selected.filter((x) => x !== k));
|
|
1205
1205
|
}
|
|
1206
|
-
function
|
|
1207
|
-
a.disabled || o("update:selected", a.source.map(
|
|
1206
|
+
function Z() {
|
|
1207
|
+
a.disabled || o("update:selected", a.source.map(c));
|
|
1208
1208
|
}
|
|
1209
1209
|
function g() {
|
|
1210
1210
|
a.disabled || o("update:selected", []);
|
|
1211
1211
|
}
|
|
1212
|
-
return (b,
|
|
1213
|
-
class:
|
|
1212
|
+
return (b, k) => (s(), m("div", {
|
|
1213
|
+
class: re(["w-transfer", { "w-transfer--disabled": e.disabled }])
|
|
1214
1214
|
}, [
|
|
1215
|
-
h("div",
|
|
1216
|
-
h("div",
|
|
1217
|
-
|
|
1218
|
-
h("span",
|
|
1215
|
+
h("div", Ka, [
|
|
1216
|
+
h("div", Ga, [
|
|
1217
|
+
k[2] || (k[2] = h("span", { class: "w-transfer__title" }, "Disponíveis", -1)),
|
|
1218
|
+
h("span", Ja, T(V.value.length), 1)
|
|
1219
1219
|
]),
|
|
1220
1220
|
N(v(qe), { class: "w-transfer__search" }, {
|
|
1221
1221
|
default: ne(() => [
|
|
1222
1222
|
N(v(He), { class: "pi pi-search" }),
|
|
1223
|
-
N(v(
|
|
1223
|
+
N(v(me), {
|
|
1224
1224
|
modelValue: l.value,
|
|
1225
|
-
"onUpdate:modelValue":
|
|
1225
|
+
"onUpdate:modelValue": k[0] || (k[0] = (x) => l.value = x),
|
|
1226
1226
|
placeholder: "Buscar...",
|
|
1227
1227
|
fluid: ""
|
|
1228
1228
|
}, null, 8, ["modelValue"])
|
|
1229
1229
|
]),
|
|
1230
1230
|
_: 1
|
|
1231
1231
|
}),
|
|
1232
|
-
h("ul",
|
|
1233
|
-
(s(!0),
|
|
1234
|
-
key: `a-${
|
|
1232
|
+
h("ul", Za, [
|
|
1233
|
+
(s(!0), m(le, null, ie(V.value, (x) => (s(), m("li", {
|
|
1234
|
+
key: `a-${c(x)}`,
|
|
1235
1235
|
class: "w-transfer__item",
|
|
1236
|
-
onClick: (
|
|
1236
|
+
onClick: (j) => L(x)
|
|
1237
1237
|
}, [
|
|
1238
|
-
h("span", null, T(w(
|
|
1239
|
-
|
|
1240
|
-
], 8,
|
|
1241
|
-
|
|
1238
|
+
h("span", null, T(w(x)), 1),
|
|
1239
|
+
k[3] || (k[3] = h("i", { class: "pi pi-angle-right" }, null, -1))
|
|
1240
|
+
], 8, Xa))), 128)),
|
|
1241
|
+
V.value.length ? $("", !0) : (s(), m("li", Qa, "Nenhum item"))
|
|
1242
1242
|
])
|
|
1243
1243
|
]),
|
|
1244
|
-
h("div",
|
|
1245
|
-
N(v(
|
|
1244
|
+
h("div", _a, [
|
|
1245
|
+
N(v(ee), {
|
|
1246
1246
|
type: "button",
|
|
1247
1247
|
icon: "pi pi-angle-double-right",
|
|
1248
1248
|
text: "",
|
|
1249
1249
|
rounded: "",
|
|
1250
|
-
disabled: e.disabled || !
|
|
1251
|
-
onClick:
|
|
1250
|
+
disabled: e.disabled || !V.value.length,
|
|
1251
|
+
onClick: Z
|
|
1252
1252
|
}, null, 8, ["disabled"]),
|
|
1253
|
-
N(v(
|
|
1253
|
+
N(v(ee), {
|
|
1254
1254
|
type: "button",
|
|
1255
1255
|
icon: "pi pi-angle-double-left",
|
|
1256
1256
|
text: "",
|
|
@@ -1259,39 +1259,39 @@ const Oa = { class: "w-autocompletefk" }, Ba = ["disabled"], Wa = { class: "w-au
|
|
|
1259
1259
|
onClick: g
|
|
1260
1260
|
}, null, 8, ["disabled"])
|
|
1261
1261
|
]),
|
|
1262
|
-
h("div",
|
|
1263
|
-
h("div",
|
|
1264
|
-
|
|
1265
|
-
h("span",
|
|
1262
|
+
h("div", en, [
|
|
1263
|
+
h("div", tn, [
|
|
1264
|
+
k[4] || (k[4] = h("span", { class: "w-transfer__title" }, "Selecionados", -1)),
|
|
1265
|
+
h("span", an, T(W.value.length), 1)
|
|
1266
1266
|
]),
|
|
1267
1267
|
N(v(qe), { class: "w-transfer__search" }, {
|
|
1268
1268
|
default: ne(() => [
|
|
1269
1269
|
N(v(He), { class: "pi pi-search" }),
|
|
1270
|
-
N(v(
|
|
1270
|
+
N(v(me), {
|
|
1271
1271
|
modelValue: i.value,
|
|
1272
|
-
"onUpdate:modelValue":
|
|
1272
|
+
"onUpdate:modelValue": k[1] || (k[1] = (x) => i.value = x),
|
|
1273
1273
|
placeholder: "Buscar...",
|
|
1274
1274
|
fluid: ""
|
|
1275
1275
|
}, null, 8, ["modelValue"])
|
|
1276
1276
|
]),
|
|
1277
1277
|
_: 1
|
|
1278
1278
|
}),
|
|
1279
|
-
h("ul",
|
|
1280
|
-
(s(!0),
|
|
1281
|
-
key: `s-${
|
|
1279
|
+
h("ul", nn, [
|
|
1280
|
+
(s(!0), m(le, null, ie(W.value, (x) => (s(), m("li", {
|
|
1281
|
+
key: `s-${c(x)}`,
|
|
1282
1282
|
class: "w-transfer__item",
|
|
1283
|
-
onClick: (
|
|
1283
|
+
onClick: (j) => J(x)
|
|
1284
1284
|
}, [
|
|
1285
|
-
|
|
1286
|
-
h("span", null, T(w(
|
|
1287
|
-
], 8,
|
|
1288
|
-
|
|
1285
|
+
k[5] || (k[5] = h("i", { class: "pi pi-angle-left" }, null, -1)),
|
|
1286
|
+
h("span", null, T(w(x)), 1)
|
|
1287
|
+
], 8, on))), 128)),
|
|
1288
|
+
W.value.length ? $("", !0) : (s(), m("li", ln, "Nenhum item"))
|
|
1289
1289
|
])
|
|
1290
1290
|
])
|
|
1291
1291
|
], 2));
|
|
1292
1292
|
}
|
|
1293
1293
|
});
|
|
1294
|
-
async function
|
|
1294
|
+
async function sn(e) {
|
|
1295
1295
|
const t = e.replace(/\D/g, "");
|
|
1296
1296
|
if (t.length !== 8) return null;
|
|
1297
1297
|
try {
|
|
@@ -1303,43 +1303,43 @@ async function ln(e) {
|
|
|
1303
1303
|
return null;
|
|
1304
1304
|
}
|
|
1305
1305
|
}
|
|
1306
|
-
const
|
|
1306
|
+
const rn = { class: "w-crud-form" }, un = {
|
|
1307
1307
|
key: 0,
|
|
1308
1308
|
class: "w-crud-form-group-header"
|
|
1309
|
-
},
|
|
1309
|
+
}, dn = { class: "w-crud-form-group-title" }, cn = {
|
|
1310
1310
|
key: 0,
|
|
1311
1311
|
class: "w-crud-form-group-desc"
|
|
1312
|
-
},
|
|
1312
|
+
}, fn = { class: "w-crud-form-fields" }, mn = {
|
|
1313
1313
|
key: 0,
|
|
1314
1314
|
class: "w-crud-form-switch"
|
|
1315
|
-
},
|
|
1315
|
+
}, pn = { class: "w-crud-form-switch-label" }, vn = {
|
|
1316
1316
|
key: 1,
|
|
1317
1317
|
class: "w-crud-form-col-full"
|
|
1318
|
-
},
|
|
1318
|
+
}, gn = { class: "w-crud-form-label" }, hn = {
|
|
1319
1319
|
key: 0,
|
|
1320
1320
|
class: "w-crud-form-required"
|
|
1321
|
-
},
|
|
1321
|
+
}, yn = { class: "w-crud-form-color-row" }, bn = {
|
|
1322
1322
|
key: 2,
|
|
1323
1323
|
class: "w-crud-form-col-full"
|
|
1324
|
-
},
|
|
1324
|
+
}, wn = { class: "w-crud-form-label" }, kn = ["accept", "disabled", "onChange"], $n = {
|
|
1325
1325
|
key: 3,
|
|
1326
1326
|
class: "w-crud-form-col-full"
|
|
1327
|
-
},
|
|
1327
|
+
}, Cn = { class: "w-crud-form-label" }, Dn = {
|
|
1328
1328
|
key: 0,
|
|
1329
1329
|
class: "w-crud-form-required"
|
|
1330
|
-
},
|
|
1330
|
+
}, xn = { class: "w-crud-form-label" }, Sn = {
|
|
1331
1331
|
key: 0,
|
|
1332
1332
|
class: "w-crud-form-required"
|
|
1333
|
-
},
|
|
1333
|
+
}, Pn = {
|
|
1334
1334
|
key: 1,
|
|
1335
1335
|
class: "pi pi-spin pi-spinner w-crud-form-cep-spinner"
|
|
1336
|
-
},
|
|
1336
|
+
}, Vn = {
|
|
1337
1337
|
key: 16,
|
|
1338
1338
|
class: "w-crud-form-cep-error"
|
|
1339
|
-
},
|
|
1339
|
+
}, En = {
|
|
1340
1340
|
key: 17,
|
|
1341
1341
|
class: "w-crud-form-error"
|
|
1342
|
-
},
|
|
1342
|
+
}, Mn = /* @__PURE__ */ de({
|
|
1343
1343
|
__name: "WFormRenderer",
|
|
1344
1344
|
props: {
|
|
1345
1345
|
fields: {},
|
|
@@ -1349,22 +1349,22 @@ const sn = { class: "w-crud-form" }, rn = {
|
|
|
1349
1349
|
},
|
|
1350
1350
|
emits: ["update:field"],
|
|
1351
1351
|
setup(e, { expose: t, emit: a }) {
|
|
1352
|
-
const o = e, l = a, i = ge({}), r = ge({}), y = ge({}),
|
|
1353
|
-
function w(f,
|
|
1354
|
-
const u =
|
|
1355
|
-
l("update:field", f.field, u), y[f.field] = null,
|
|
1352
|
+
const o = e, l = a, i = ge({}), r = ge({}), y = ge({}), c = ge({});
|
|
1353
|
+
function w(f, P) {
|
|
1354
|
+
const u = P.target.value, n = u.replace(/\D/g, "");
|
|
1355
|
+
l("update:field", f.field, u), y[f.field] = null, c[f.field] && (clearTimeout(c[f.field]), c[f.field] = null), n.length === 8 && (c[f.field] = setTimeout(async () => {
|
|
1356
1356
|
r[f.field] = !0, y[f.field] = null;
|
|
1357
1357
|
try {
|
|
1358
|
-
const
|
|
1359
|
-
if (!
|
|
1358
|
+
const p = await sn(n);
|
|
1359
|
+
if (!p)
|
|
1360
1360
|
y[f.field] = "CEP não encontrado. Preencha os campos manualmente.";
|
|
1361
1361
|
else {
|
|
1362
|
-
const
|
|
1363
|
-
for (const
|
|
1364
|
-
const
|
|
1365
|
-
if (!
|
|
1366
|
-
const
|
|
1367
|
-
(
|
|
1362
|
+
const d = f.cepFields || {}, E = Object.keys(d);
|
|
1363
|
+
for (const R of E) {
|
|
1364
|
+
const G = d[R];
|
|
1365
|
+
if (!G) continue;
|
|
1366
|
+
const se = o.formData[G];
|
|
1367
|
+
(se == null || se === "") && l("update:field", G, p[R] ?? "");
|
|
1368
1368
|
}
|
|
1369
1369
|
}
|
|
1370
1370
|
} finally {
|
|
@@ -1372,224 +1372,224 @@ const sn = { class: "w-crud-form" }, rn = {
|
|
|
1372
1372
|
}
|
|
1373
1373
|
}, 400));
|
|
1374
1374
|
}
|
|
1375
|
-
const
|
|
1375
|
+
const F = H(
|
|
1376
1376
|
() => o.fields.filter((f) => f.visible === void 0 || f.visible === !0 ? !0 : typeof f.visible == "function" ? f.visible(o.formData, o.isEditing) : f.visible)
|
|
1377
1377
|
);
|
|
1378
|
-
function
|
|
1378
|
+
function V(f) {
|
|
1379
1379
|
return o.disabled || f.disabledOnEdit && o.isEditing ? !0 : typeof f.disabled == "function" ? f.disabled(o.formData, o.isEditing) : !!f.disabled;
|
|
1380
1380
|
}
|
|
1381
|
-
function
|
|
1382
|
-
return
|
|
1381
|
+
function W(f) {
|
|
1382
|
+
return Ut(f) ? f.value : f;
|
|
1383
1383
|
}
|
|
1384
|
-
const
|
|
1385
|
-
const f = o.isEditing ? "edit" : "create",
|
|
1384
|
+
const L = H(() => {
|
|
1385
|
+
const f = o.isEditing ? "edit" : "create", P = o.fields.find(
|
|
1386
1386
|
(n) => n.autofocus === !0 || n.autofocus === f
|
|
1387
1387
|
);
|
|
1388
|
-
if (
|
|
1389
|
-
const u =
|
|
1388
|
+
if (P) return P.field;
|
|
1389
|
+
const u = F.value.find((n) => !(n.type === "switch" || n.type === "fk" || n.type === "select" || n.type === "image" || n.disabled === !0 || n.disabledOnEdit && o.isEditing));
|
|
1390
1390
|
return (u == null ? void 0 : u.field) ?? null;
|
|
1391
1391
|
});
|
|
1392
|
-
function Z(f) {
|
|
1393
|
-
return f.field === z.value;
|
|
1394
|
-
}
|
|
1395
1392
|
function J(f) {
|
|
1393
|
+
return f.field === L.value;
|
|
1394
|
+
}
|
|
1395
|
+
function Z(f) {
|
|
1396
1396
|
if (f)
|
|
1397
1397
|
return f.replace(/9/g, "#").replace(/a/g, "S").replace(/\*/g, "X");
|
|
1398
1398
|
}
|
|
1399
1399
|
function g(f) {
|
|
1400
1400
|
if (!f) return "";
|
|
1401
|
-
const
|
|
1402
|
-
return
|
|
1401
|
+
const P = String(f).replace(/\D/g, "").slice(0, 14);
|
|
1402
|
+
return P.length <= 11 ? P.replace(/(\d{3})(\d)/, "$1.$2").replace(/(\d{3})(\d)/, "$1.$2").replace(/(\d{3})(\d{1,2})$/, "$1-$2") : P.replace(/(\d{2})(\d)/, "$1.$2").replace(/(\d{3})(\d)/, "$1.$2").replace(/(\d{3})(\d)/, "$1/$2").replace(/(\d{4})(\d{1,2})$/, "$1-$2");
|
|
1403
1403
|
}
|
|
1404
|
-
function b(f,
|
|
1405
|
-
const u =
|
|
1404
|
+
function b(f, P) {
|
|
1405
|
+
const u = P.target.value.replace(/\D/g, "").slice(0, 14);
|
|
1406
1406
|
l("update:field", f, u);
|
|
1407
1407
|
}
|
|
1408
|
-
const
|
|
1409
|
-
function
|
|
1410
|
-
const
|
|
1411
|
-
if (
|
|
1408
|
+
const k = ge({});
|
|
1409
|
+
function x(f) {
|
|
1410
|
+
const P = o.formData[f.field];
|
|
1411
|
+
if (P == null) return null;
|
|
1412
1412
|
const u = f.optionValue || "value";
|
|
1413
|
-
return (
|
|
1414
|
-
(
|
|
1413
|
+
return (W(f.options) || []).find(
|
|
1414
|
+
(p) => p[u] === P
|
|
1415
1415
|
) ?? null;
|
|
1416
1416
|
}
|
|
1417
|
-
function
|
|
1418
|
-
return
|
|
1417
|
+
function j(f) {
|
|
1418
|
+
return k[f.field] || [];
|
|
1419
1419
|
}
|
|
1420
|
-
function U(f,
|
|
1421
|
-
const u = (
|
|
1422
|
-
|
|
1423
|
-
(
|
|
1420
|
+
function U(f, P) {
|
|
1421
|
+
const u = (P.query || "").toLowerCase(), n = W(f.options) || [], p = f.optionLabel || "label";
|
|
1422
|
+
k[f.field] = n.filter(
|
|
1423
|
+
(d) => String(d[p] || "").toLowerCase().includes(u)
|
|
1424
1424
|
);
|
|
1425
1425
|
}
|
|
1426
|
-
function
|
|
1426
|
+
function Y(f, P) {
|
|
1427
1427
|
const u = f.optionValue || "value";
|
|
1428
|
-
l("update:field", f.field,
|
|
1428
|
+
l("update:field", f.field, P.value[u]);
|
|
1429
1429
|
}
|
|
1430
|
-
function
|
|
1431
|
-
const
|
|
1432
|
-
return
|
|
1430
|
+
function K(f) {
|
|
1431
|
+
const P = o.formData[f.field];
|
|
1432
|
+
return P ? String(P).replace("#", "") : "FFFFFF";
|
|
1433
1433
|
}
|
|
1434
|
-
function
|
|
1435
|
-
l("update:field", f.field, `#${
|
|
1434
|
+
function B(f, P) {
|
|
1435
|
+
l("update:field", f.field, `#${P}`);
|
|
1436
1436
|
}
|
|
1437
1437
|
function X(f) {
|
|
1438
1438
|
if (typeof f.validate == "function") {
|
|
1439
|
-
const
|
|
1440
|
-
i[f.field] =
|
|
1439
|
+
const P = f.validate(o.formData[f.field]);
|
|
1440
|
+
i[f.field] = P || null;
|
|
1441
1441
|
}
|
|
1442
1442
|
}
|
|
1443
1443
|
function oe() {
|
|
1444
1444
|
const f = [];
|
|
1445
|
-
for (const
|
|
1446
|
-
if (typeof
|
|
1447
|
-
const u =
|
|
1448
|
-
i[
|
|
1445
|
+
for (const P of o.fields)
|
|
1446
|
+
if (typeof P.validate == "function") {
|
|
1447
|
+
const u = P.validate(o.formData[P.field]);
|
|
1448
|
+
i[P.field] = u || null, u && f.push(u);
|
|
1449
1449
|
}
|
|
1450
1450
|
return f;
|
|
1451
1451
|
}
|
|
1452
|
-
function
|
|
1452
|
+
function ae() {
|
|
1453
1453
|
Object.keys(i).forEach((f) => delete i[f]);
|
|
1454
1454
|
}
|
|
1455
|
-
const
|
|
1456
|
-
var n,
|
|
1457
|
-
const f = /* @__PURE__ */ new Map(),
|
|
1458
|
-
for (const
|
|
1459
|
-
const
|
|
1460
|
-
f.has(
|
|
1461
|
-
id:
|
|
1462
|
-
title: (
|
|
1463
|
-
description: (
|
|
1455
|
+
const _ = H(() => {
|
|
1456
|
+
var n, p, d, E;
|
|
1457
|
+
const f = /* @__PURE__ */ new Map(), P = [], u = /* @__PURE__ */ new Map();
|
|
1458
|
+
for (const R of F.value) {
|
|
1459
|
+
const G = ((n = R.fieldGroup) == null ? void 0 : n.id) ?? "__default__";
|
|
1460
|
+
f.has(G) || (f.set(G, {
|
|
1461
|
+
id: G,
|
|
1462
|
+
title: (p = R.fieldGroup) == null ? void 0 : p.title,
|
|
1463
|
+
description: (d = R.fieldGroup) == null ? void 0 : d.description,
|
|
1464
1464
|
fields: []
|
|
1465
|
-
}),
|
|
1465
|
+
}), P.push(G), ((E = R.fieldGroup) == null ? void 0 : E.order) != null && u.set(G, R.fieldGroup.order)), f.get(G).fields.push(R);
|
|
1466
1466
|
}
|
|
1467
|
-
return
|
|
1468
|
-
const
|
|
1469
|
-
return
|
|
1470
|
-
}).map((
|
|
1467
|
+
return P.slice().sort((R, G) => {
|
|
1468
|
+
const se = u.get(R), pe = u.get(G);
|
|
1469
|
+
return se != null && pe != null ? se - pe : se != null ? -1 : pe != null ? 1 : P.indexOf(R) - P.indexOf(G);
|
|
1470
|
+
}).map((R) => f.get(R));
|
|
1471
1471
|
});
|
|
1472
|
-
return t({ validateAll: oe, clearErrors:
|
|
1473
|
-
(s(!0),
|
|
1472
|
+
return t({ validateAll: oe, clearErrors: ae }), (f, P) => (s(), m("div", rn, [
|
|
1473
|
+
(s(!0), m(le, null, ie(_.value, (u) => (s(), m("div", {
|
|
1474
1474
|
key: u.id,
|
|
1475
1475
|
class: "w-crud-form-group"
|
|
1476
1476
|
}, [
|
|
1477
|
-
u.title ? (s(),
|
|
1478
|
-
h("h3",
|
|
1479
|
-
u.description ? (s(),
|
|
1480
|
-
])) :
|
|
1481
|
-
h("div",
|
|
1482
|
-
(s(!0),
|
|
1477
|
+
u.title ? (s(), m("div", un, [
|
|
1478
|
+
h("h3", dn, T(u.title), 1),
|
|
1479
|
+
u.description ? (s(), m("p", cn, T(u.description), 1)) : $("", !0)
|
|
1480
|
+
])) : $("", !0),
|
|
1481
|
+
h("div", fn, [
|
|
1482
|
+
(s(!0), m(le, null, ie(u.fields, (n) => O(f.$slots, `field-${n.field}`, {
|
|
1483
1483
|
key: n.field,
|
|
1484
1484
|
field: n,
|
|
1485
1485
|
formData: e.formData,
|
|
1486
1486
|
isEditing: e.isEditing,
|
|
1487
|
-
setFormField: (
|
|
1487
|
+
setFormField: (p, d) => l("update:field", p, d)
|
|
1488
1488
|
}, () => [
|
|
1489
|
-
n.type === "switch" ? (s(),
|
|
1490
|
-
N(v(
|
|
1489
|
+
n.type === "switch" ? (s(), m("div", mn, [
|
|
1490
|
+
N(v(_t), {
|
|
1491
1491
|
"model-value": e.formData[n.field],
|
|
1492
|
-
disabled:
|
|
1493
|
-
"onUpdate:modelValue": (
|
|
1492
|
+
disabled: V(n),
|
|
1493
|
+
"onUpdate:modelValue": (p) => l("update:field", n.field, p)
|
|
1494
1494
|
}, null, 8, ["model-value", "disabled", "onUpdate:modelValue"]),
|
|
1495
|
-
h("label",
|
|
1496
|
-
])) : n.type === "color" ? (s(),
|
|
1497
|
-
h("label",
|
|
1498
|
-
|
|
1499
|
-
n.required ? (s(),
|
|
1495
|
+
h("label", pn, T(n.switchLabel || n.label), 1)
|
|
1496
|
+
])) : n.type === "color" ? (s(), m("div", vn, [
|
|
1497
|
+
h("label", gn, [
|
|
1498
|
+
Pe(T(n.label) + " ", 1),
|
|
1499
|
+
n.required ? (s(), m("span", hn, "*")) : $("", !0)
|
|
1500
1500
|
]),
|
|
1501
|
-
h("div",
|
|
1502
|
-
N(v(
|
|
1503
|
-
"model-value":
|
|
1504
|
-
disabled:
|
|
1505
|
-
"onUpdate:modelValue": (
|
|
1501
|
+
h("div", yn, [
|
|
1502
|
+
N(v(ea), {
|
|
1503
|
+
"model-value": K(n),
|
|
1504
|
+
disabled: V(n),
|
|
1505
|
+
"onUpdate:modelValue": (p) => B(n, p)
|
|
1506
1506
|
}, null, 8, ["model-value", "disabled", "onUpdate:modelValue"]),
|
|
1507
|
-
N(v(
|
|
1507
|
+
N(v(me), {
|
|
1508
1508
|
"model-value": e.formData[n.field],
|
|
1509
1509
|
class: "w-28",
|
|
1510
1510
|
maxlength: "7",
|
|
1511
1511
|
placeholder: "#000000",
|
|
1512
|
-
disabled:
|
|
1513
|
-
"onUpdate:modelValue": (
|
|
1512
|
+
disabled: V(n),
|
|
1513
|
+
"onUpdate:modelValue": (p) => l("update:field", n.field, p)
|
|
1514
1514
|
}, null, 8, ["model-value", "disabled", "onUpdate:modelValue"])
|
|
1515
1515
|
])
|
|
1516
|
-
])) : n.type === "image" ? (s(),
|
|
1517
|
-
h("label",
|
|
1518
|
-
|
|
1516
|
+
])) : n.type === "image" ? (s(), m("div", bn, [
|
|
1517
|
+
h("label", wn, T(n.label), 1),
|
|
1518
|
+
O(f.$slots, `image-${n.field}`, {
|
|
1519
1519
|
field: n,
|
|
1520
1520
|
formData: e.formData
|
|
1521
1521
|
}, () => [
|
|
1522
1522
|
h("input", {
|
|
1523
1523
|
type: "file",
|
|
1524
1524
|
accept: n.accept || "image/*",
|
|
1525
|
-
disabled:
|
|
1526
|
-
onChange: (
|
|
1527
|
-
var
|
|
1528
|
-
const
|
|
1529
|
-
l("update:field", n.field,
|
|
1525
|
+
disabled: V(n),
|
|
1526
|
+
onChange: (p) => {
|
|
1527
|
+
var E;
|
|
1528
|
+
const d = ((E = p.target.files) == null ? void 0 : E[0]) ?? null;
|
|
1529
|
+
l("update:field", n.field, d);
|
|
1530
1530
|
}
|
|
1531
|
-
}, null, 40,
|
|
1531
|
+
}, null, 40, kn)
|
|
1532
1532
|
])
|
|
1533
|
-
])) : n.type === "transfer" ? (s(),
|
|
1534
|
-
h("label",
|
|
1535
|
-
|
|
1536
|
-
n.required ? (s(),
|
|
1533
|
+
])) : n.type === "transfer" ? (s(), m("div", $n, [
|
|
1534
|
+
h("label", Cn, [
|
|
1535
|
+
Pe(T(n.label) + " ", 1),
|
|
1536
|
+
n.required ? (s(), m("span", Dn, "*")) : $("", !0)
|
|
1537
1537
|
]),
|
|
1538
1538
|
N(Nt, {
|
|
1539
|
-
source:
|
|
1539
|
+
source: W(n.options) || [],
|
|
1540
1540
|
selected: e.formData[n.field] || [],
|
|
1541
1541
|
"track-by": n.optionValue || "id",
|
|
1542
1542
|
"option-label": n.optionLabel || "nome",
|
|
1543
1543
|
"search-fields": n.searchFields,
|
|
1544
|
-
disabled:
|
|
1545
|
-
"onUpdate:selected": (
|
|
1544
|
+
disabled: V(n),
|
|
1545
|
+
"onUpdate:selected": (p) => l("update:field", n.field, p)
|
|
1546
1546
|
}, null, 8, ["source", "selected", "track-by", "option-label", "search-fields", "disabled", "onUpdate:selected"])
|
|
1547
|
-
])) : (s(),
|
|
1547
|
+
])) : (s(), m("div", {
|
|
1548
1548
|
key: 4,
|
|
1549
|
-
class:
|
|
1549
|
+
class: re(n.colSpan === 0.5 ? "w-crud-form-col-half" : "w-crud-form-col-full")
|
|
1550
1550
|
}, [
|
|
1551
|
-
h("label",
|
|
1552
|
-
|
|
1553
|
-
n.required ? (s(),
|
|
1554
|
-
r[n.field] ? (s(),
|
|
1551
|
+
h("label", xn, [
|
|
1552
|
+
Pe(T(n.label) + " ", 1),
|
|
1553
|
+
n.required ? (s(), m("span", Sn, "*")) : $("", !0),
|
|
1554
|
+
r[n.field] ? (s(), m("i", Pn)) : $("", !0)
|
|
1555
1555
|
]),
|
|
1556
|
-
(!n.type || n.type === "text") && n.mask ?
|
|
1556
|
+
(!n.type || n.type === "text") && n.mask ? fe((s(), A(v(me), {
|
|
1557
1557
|
key: 0,
|
|
1558
1558
|
"model-value": e.formData[n.field],
|
|
1559
1559
|
fluid: "",
|
|
1560
|
-
autofocus:
|
|
1560
|
+
autofocus: J(n) || void 0,
|
|
1561
1561
|
placeholder: n.placeholder,
|
|
1562
|
-
disabled:
|
|
1563
|
-
"onUpdate:modelValue": (
|
|
1562
|
+
disabled: V(n),
|
|
1563
|
+
"onUpdate:modelValue": (p) => l("update:field", n.field, p)
|
|
1564
1564
|
}, null, 8, ["model-value", "autofocus", "placeholder", "disabled", "onUpdate:modelValue"])), [
|
|
1565
|
-
[v(at), { mask:
|
|
1566
|
-
]) : !n.type || n.type === "text" ? (s(),
|
|
1565
|
+
[v(at), { mask: Z(n.mask) }]
|
|
1566
|
+
]) : !n.type || n.type === "text" ? (s(), A(v(me), {
|
|
1567
1567
|
key: 1,
|
|
1568
1568
|
"model-value": e.formData[n.field],
|
|
1569
1569
|
fluid: "",
|
|
1570
|
-
autofocus:
|
|
1570
|
+
autofocus: J(n) || void 0,
|
|
1571
1571
|
placeholder: n.placeholder,
|
|
1572
|
-
disabled:
|
|
1573
|
-
"onUpdate:modelValue": (
|
|
1574
|
-
}, null, 8, ["model-value", "autofocus", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "email" ? (s(),
|
|
1572
|
+
disabled: V(n),
|
|
1573
|
+
"onUpdate:modelValue": (p) => l("update:field", n.field, p)
|
|
1574
|
+
}, null, 8, ["model-value", "autofocus", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "email" ? (s(), A(v(me), {
|
|
1575
1575
|
key: 2,
|
|
1576
1576
|
"model-value": e.formData[n.field],
|
|
1577
1577
|
type: "email",
|
|
1578
1578
|
fluid: "",
|
|
1579
|
-
autofocus:
|
|
1579
|
+
autofocus: J(n) || void 0,
|
|
1580
1580
|
placeholder: n.placeholder,
|
|
1581
|
-
disabled:
|
|
1582
|
-
"onUpdate:modelValue": (
|
|
1583
|
-
}, null, 8, ["model-value", "autofocus", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "password" ? (s(),
|
|
1581
|
+
disabled: V(n),
|
|
1582
|
+
"onUpdate:modelValue": (p) => l("update:field", n.field, p)
|
|
1583
|
+
}, null, 8, ["model-value", "autofocus", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "password" ? (s(), A(v(ta), {
|
|
1584
1584
|
key: 3,
|
|
1585
1585
|
"model-value": e.formData[n.field],
|
|
1586
1586
|
fluid: "",
|
|
1587
1587
|
"toggle-mask": "",
|
|
1588
1588
|
feedback: n.feedback !== !1,
|
|
1589
1589
|
placeholder: n.placeholder,
|
|
1590
|
-
disabled:
|
|
1591
|
-
"onUpdate:modelValue": (
|
|
1592
|
-
}, null, 8, ["model-value", "feedback", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "number" ? (s(),
|
|
1590
|
+
disabled: V(n),
|
|
1591
|
+
"onUpdate:modelValue": (p) => l("update:field", n.field, p)
|
|
1592
|
+
}, null, 8, ["model-value", "feedback", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "number" ? (s(), A(v(ct), {
|
|
1593
1593
|
key: 4,
|
|
1594
1594
|
"model-value": e.formData[n.field],
|
|
1595
1595
|
fluid: "",
|
|
@@ -1601,9 +1601,9 @@ const sn = { class: "w-crud-form" }, rn = {
|
|
|
1601
1601
|
suffix: n.suffix,
|
|
1602
1602
|
prefix: n.prefix,
|
|
1603
1603
|
placeholder: n.placeholder,
|
|
1604
|
-
disabled:
|
|
1605
|
-
"onUpdate:modelValue": (
|
|
1606
|
-
}, null, 8, ["model-value", "min", "max", "min-fraction-digits", "max-fraction-digits", "suffix", "prefix", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "currency" && n.fillFromRight ? (s(),
|
|
1604
|
+
disabled: V(n),
|
|
1605
|
+
"onUpdate:modelValue": (p) => l("update:field", n.field, p)
|
|
1606
|
+
}, null, 8, ["model-value", "min", "max", "min-fraction-digits", "max-fraction-digits", "suffix", "prefix", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "currency" && n.fillFromRight ? (s(), A(zt, {
|
|
1607
1607
|
key: 5,
|
|
1608
1608
|
"model-value": e.formData[n.field],
|
|
1609
1609
|
decimals: n.decimals ?? 2,
|
|
@@ -1611,9 +1611,9 @@ const sn = { class: "w-crud-form" }, rn = {
|
|
|
1611
1611
|
prefix: n.prefix,
|
|
1612
1612
|
suffix: n.suffix,
|
|
1613
1613
|
placeholder: n.placeholder,
|
|
1614
|
-
disabled:
|
|
1615
|
-
"onUpdate:modelValue": (
|
|
1616
|
-
}, null, 8, ["model-value", "decimals", "prefix", "suffix", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "currency" ? (s(),
|
|
1614
|
+
disabled: V(n),
|
|
1615
|
+
"onUpdate:modelValue": (p) => l("update:field", n.field, p)
|
|
1616
|
+
}, null, 8, ["model-value", "decimals", "prefix", "suffix", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "currency" ? (s(), A(v(ct), {
|
|
1617
1617
|
key: 6,
|
|
1618
1618
|
"model-value": e.formData[n.field],
|
|
1619
1619
|
fluid: "",
|
|
@@ -1623,52 +1623,52 @@ const sn = { class: "w-crud-form" }, rn = {
|
|
|
1623
1623
|
min: n.min,
|
|
1624
1624
|
max: n.max,
|
|
1625
1625
|
placeholder: n.placeholder,
|
|
1626
|
-
disabled:
|
|
1627
|
-
"onUpdate:modelValue": (
|
|
1628
|
-
}, null, 8, ["model-value", "min", "max", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "select" ? (s(),
|
|
1626
|
+
disabled: V(n),
|
|
1627
|
+
"onUpdate:modelValue": (p) => l("update:field", n.field, p)
|
|
1628
|
+
}, null, 8, ["model-value", "min", "max", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "select" ? (s(), A(v(Qt), {
|
|
1629
1629
|
key: 7,
|
|
1630
1630
|
"model-value": e.formData[n.field],
|
|
1631
1631
|
fluid: "",
|
|
1632
|
-
options:
|
|
1632
|
+
options: W(n.options),
|
|
1633
1633
|
"option-label": n.optionLabel || "label",
|
|
1634
1634
|
"option-value": n.optionValue || "value",
|
|
1635
1635
|
"show-clear": n.showClear !== !1,
|
|
1636
1636
|
placeholder: n.placeholder,
|
|
1637
|
-
disabled:
|
|
1638
|
-
"onUpdate:modelValue": (
|
|
1639
|
-
}, null, 8, ["model-value", "options", "option-label", "option-value", "show-clear", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "autocomplete" ? (s(),
|
|
1637
|
+
disabled: V(n),
|
|
1638
|
+
"onUpdate:modelValue": (p) => l("update:field", n.field, p)
|
|
1639
|
+
}, null, 8, ["model-value", "options", "option-label", "option-value", "show-clear", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "autocomplete" ? (s(), A(v(xt), {
|
|
1640
1640
|
key: 8,
|
|
1641
|
-
"model-value":
|
|
1641
|
+
"model-value": x(n),
|
|
1642
1642
|
fluid: "",
|
|
1643
|
-
suggestions:
|
|
1643
|
+
suggestions: j(n),
|
|
1644
1644
|
"option-label": n.optionLabel || "label",
|
|
1645
1645
|
placeholder: n.placeholder,
|
|
1646
|
-
disabled:
|
|
1647
|
-
onComplete: (
|
|
1648
|
-
onItemSelect: (
|
|
1649
|
-
onClear: (
|
|
1650
|
-
}, null, 8, ["model-value", "suggestions", "option-label", "placeholder", "disabled", "onComplete", "onItemSelect", "onClear"])) : n.type === "fk" ? (s(),
|
|
1646
|
+
disabled: V(n),
|
|
1647
|
+
onComplete: (p) => U(n, p),
|
|
1648
|
+
onItemSelect: (p) => Y(n, p),
|
|
1649
|
+
onClear: (p) => l("update:field", n.field, null)
|
|
1650
|
+
}, null, 8, ["model-value", "suggestions", "option-label", "placeholder", "disabled", "onComplete", "onItemSelect", "onClear"])) : n.type === "fk" ? (s(), A(Lt, {
|
|
1651
1651
|
key: 9,
|
|
1652
1652
|
"model-value": e.formData[n.field],
|
|
1653
1653
|
endpoint: n.endpoint,
|
|
1654
1654
|
"endpoint-params": n.endpointParams,
|
|
1655
1655
|
"option-label": n.optionLabel || "nome",
|
|
1656
1656
|
placeholder: n.placeholder,
|
|
1657
|
-
disabled:
|
|
1657
|
+
disabled: V(n),
|
|
1658
1658
|
"show-clear": n.showClear !== !1,
|
|
1659
1659
|
"dialog-header": n.label,
|
|
1660
1660
|
"crud-fields": n.crudFields,
|
|
1661
1661
|
"crud-columns": n.crudColumns,
|
|
1662
|
-
"onUpdate:modelValue": (
|
|
1663
|
-
}, null, 8, ["model-value", "endpoint", "endpoint-params", "option-label", "placeholder", "disabled", "show-clear", "dialog-header", "crud-fields", "crud-columns", "onUpdate:modelValue"])) : n.type === "date" ? (s(),
|
|
1662
|
+
"onUpdate:modelValue": (p) => l("update:field", n.field, p)
|
|
1663
|
+
}, null, 8, ["model-value", "endpoint", "endpoint-params", "option-label", "placeholder", "disabled", "show-clear", "dialog-header", "crud-fields", "crud-columns", "onUpdate:modelValue"])) : n.type === "date" ? (s(), A(v(ft), {
|
|
1664
1664
|
key: 10,
|
|
1665
1665
|
"model-value": e.formData[n.field],
|
|
1666
1666
|
fluid: "",
|
|
1667
1667
|
"date-format": n.dateFormat || "dd/mm/yy",
|
|
1668
1668
|
placeholder: n.placeholder,
|
|
1669
|
-
disabled:
|
|
1670
|
-
"onUpdate:modelValue": (
|
|
1671
|
-
}, null, 8, ["model-value", "date-format", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "datetime" ? (s(),
|
|
1669
|
+
disabled: V(n),
|
|
1670
|
+
"onUpdate:modelValue": (p) => l("update:field", n.field, p)
|
|
1671
|
+
}, null, 8, ["model-value", "date-format", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "datetime" ? (s(), A(v(ft), {
|
|
1672
1672
|
key: 11,
|
|
1673
1673
|
"model-value": e.formData[n.field],
|
|
1674
1674
|
fluid: "",
|
|
@@ -1676,57 +1676,57 @@ const sn = { class: "w-crud-form" }, rn = {
|
|
|
1676
1676
|
"hour-format": n.hourFormat || "24",
|
|
1677
1677
|
"date-format": n.dateFormat || "dd/mm/yy",
|
|
1678
1678
|
placeholder: n.placeholder,
|
|
1679
|
-
disabled:
|
|
1680
|
-
"onUpdate:modelValue": (
|
|
1681
|
-
}, null, 8, ["model-value", "hour-format", "date-format", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "cpf_cnpj" ? (s(),
|
|
1679
|
+
disabled: V(n),
|
|
1680
|
+
"onUpdate:modelValue": (p) => l("update:field", n.field, p)
|
|
1681
|
+
}, null, 8, ["model-value", "hour-format", "date-format", "placeholder", "disabled", "onUpdate:modelValue"])) : n.type === "cpf_cnpj" ? (s(), A(v(me), {
|
|
1682
1682
|
key: 12,
|
|
1683
1683
|
"model-value": g(e.formData[n.field]),
|
|
1684
1684
|
fluid: "",
|
|
1685
1685
|
maxlength: "18",
|
|
1686
1686
|
placeholder: n.placeholder || "000.000.000-00",
|
|
1687
|
-
disabled:
|
|
1687
|
+
disabled: V(n),
|
|
1688
1688
|
invalid: !!i[n.field],
|
|
1689
|
-
onInput: (
|
|
1690
|
-
onBlur: (
|
|
1691
|
-
}, null, 8, ["model-value", "placeholder", "disabled", "invalid", "onInput", "onBlur"])) : n.type === "mask" ?
|
|
1689
|
+
onInput: (p) => b(n.field, p),
|
|
1690
|
+
onBlur: (p) => X(n)
|
|
1691
|
+
}, null, 8, ["model-value", "placeholder", "disabled", "invalid", "onInput", "onBlur"])) : n.type === "mask" ? fe((s(), A(v(me), {
|
|
1692
1692
|
key: 13,
|
|
1693
1693
|
"model-value": e.formData[n.field],
|
|
1694
1694
|
fluid: "",
|
|
1695
1695
|
placeholder: n.placeholder,
|
|
1696
|
-
disabled:
|
|
1696
|
+
disabled: V(n),
|
|
1697
1697
|
invalid: !!i[n.field],
|
|
1698
|
-
"onUpdate:modelValue": (
|
|
1699
|
-
onBlur: (
|
|
1698
|
+
"onUpdate:modelValue": (p) => l("update:field", n.field, p),
|
|
1699
|
+
onBlur: (p) => X(n)
|
|
1700
1700
|
}, null, 8, ["model-value", "placeholder", "disabled", "invalid", "onUpdate:modelValue", "onBlur"])), [
|
|
1701
|
-
[v(at), { mask:
|
|
1702
|
-
]) : n.type === "cep" ?
|
|
1701
|
+
[v(at), { mask: Z(n.mask) }]
|
|
1702
|
+
]) : n.type === "cep" ? fe((s(), A(v(me), {
|
|
1703
1703
|
key: 14,
|
|
1704
1704
|
"model-value": e.formData[n.field],
|
|
1705
1705
|
fluid: "",
|
|
1706
1706
|
placeholder: n.placeholder || "00000-000",
|
|
1707
|
-
disabled:
|
|
1707
|
+
disabled: V(n),
|
|
1708
1708
|
invalid: !!y[n.field],
|
|
1709
|
-
onInput: (
|
|
1709
|
+
onInput: (p) => w(n, p)
|
|
1710
1710
|
}, null, 8, ["model-value", "placeholder", "disabled", "invalid", "onInput"])), [
|
|
1711
1711
|
[v(at), { mask: "#####-###" }]
|
|
1712
|
-
]) : n.type === "textarea" ? (s(),
|
|
1712
|
+
]) : n.type === "textarea" ? (s(), A(v(Xt), {
|
|
1713
1713
|
key: 15,
|
|
1714
1714
|
"model-value": e.formData[n.field],
|
|
1715
1715
|
fluid: "",
|
|
1716
|
-
autofocus:
|
|
1716
|
+
autofocus: J(n) || void 0,
|
|
1717
1717
|
rows: n.rows || 3,
|
|
1718
1718
|
placeholder: n.placeholder,
|
|
1719
|
-
disabled:
|
|
1720
|
-
"onUpdate:modelValue": (
|
|
1721
|
-
}, null, 8, ["model-value", "autofocus", "rows", "placeholder", "disabled", "onUpdate:modelValue"])) :
|
|
1722
|
-
y[n.field] ? (s(),
|
|
1719
|
+
disabled: V(n),
|
|
1720
|
+
"onUpdate:modelValue": (p) => l("update:field", n.field, p)
|
|
1721
|
+
}, null, 8, ["model-value", "autofocus", "rows", "placeholder", "disabled", "onUpdate:modelValue"])) : $("", !0),
|
|
1722
|
+
y[n.field] ? (s(), m("small", Vn, T(y[n.field]), 1)) : i[n.field] ? (s(), m("small", En, T(i[n.field]), 1)) : $("", !0)
|
|
1723
1723
|
], 2))
|
|
1724
1724
|
])), 128))
|
|
1725
1725
|
])
|
|
1726
1726
|
]))), 128))
|
|
1727
1727
|
]));
|
|
1728
1728
|
}
|
|
1729
|
-
}),
|
|
1729
|
+
}), Fn = { class: "w-crud-form-footer" }, ut = /* @__PURE__ */ de({
|
|
1730
1730
|
__name: "WCrudFormDialog",
|
|
1731
1731
|
props: {
|
|
1732
1732
|
visible: { type: Boolean },
|
|
@@ -1749,56 +1749,56 @@ const sn = { class: "w-crud-form" }, rn = {
|
|
|
1749
1749
|
(r) => {
|
|
1750
1750
|
r && l.value && l.value.clearErrors();
|
|
1751
1751
|
}
|
|
1752
|
-
), (r, y) => (s(),
|
|
1752
|
+
), (r, y) => (s(), A(v(Dt), {
|
|
1753
1753
|
visible: e.visible,
|
|
1754
1754
|
header: e.title,
|
|
1755
1755
|
style: je({ width: e.width }),
|
|
1756
1756
|
modal: "",
|
|
1757
1757
|
draggable: !1,
|
|
1758
1758
|
class: "w-crud-form-dialog",
|
|
1759
|
-
"onUpdate:visible": y[2] || (y[2] = (
|
|
1759
|
+
"onUpdate:visible": y[2] || (y[2] = (c) => o("update:visible", c))
|
|
1760
1760
|
}, {
|
|
1761
1761
|
default: ne(() => [
|
|
1762
1762
|
h("form", {
|
|
1763
1763
|
class: "w-crud-form",
|
|
1764
|
-
onSubmit:
|
|
1764
|
+
onSubmit: qt(i, ["prevent"])
|
|
1765
1765
|
}, [
|
|
1766
|
-
N(
|
|
1766
|
+
N(Mn, {
|
|
1767
1767
|
ref_key: "rendererRef",
|
|
1768
1768
|
ref: l,
|
|
1769
1769
|
fields: e.fields,
|
|
1770
1770
|
"form-data": e.formData,
|
|
1771
1771
|
"is-editing": e.isEditing,
|
|
1772
1772
|
disabled: e.disabled,
|
|
1773
|
-
"onUpdate:field": y[0] || (y[0] = (
|
|
1773
|
+
"onUpdate:field": y[0] || (y[0] = (c, w) => o("update:field", c, w))
|
|
1774
1774
|
}, ot({ _: 2 }, [
|
|
1775
|
-
|
|
1776
|
-
name: `field-${
|
|
1775
|
+
ie(e.fields, (c) => ({
|
|
1776
|
+
name: `field-${c.field}`,
|
|
1777
1777
|
fn: ne((w) => [
|
|
1778
|
-
|
|
1778
|
+
O(r.$slots, `field-${c.field}`, lt(st(w)))
|
|
1779
1779
|
])
|
|
1780
1780
|
})),
|
|
1781
|
-
|
|
1782
|
-
name: `image-${
|
|
1781
|
+
ie(e.fields.filter((c) => c.type === "image"), (c) => ({
|
|
1782
|
+
name: `image-${c.field}`,
|
|
1783
1783
|
fn: ne((w) => [
|
|
1784
|
-
|
|
1784
|
+
O(r.$slots, `image-${c.field}`, lt(st(w)))
|
|
1785
1785
|
])
|
|
1786
1786
|
}))
|
|
1787
1787
|
]), 1032, ["fields", "form-data", "is-editing", "disabled"]),
|
|
1788
|
-
h("div",
|
|
1789
|
-
|
|
1788
|
+
h("div", Fn, [
|
|
1789
|
+
O(r.$slots, "footer", {
|
|
1790
1790
|
saving: e.saving,
|
|
1791
1791
|
disabled: e.disabled
|
|
1792
1792
|
}, () => [
|
|
1793
|
-
N(v(
|
|
1793
|
+
N(v(ee), {
|
|
1794
1794
|
type: "button",
|
|
1795
1795
|
label: e.disabled ? "Fechar" : "Cancelar",
|
|
1796
1796
|
severity: "secondary",
|
|
1797
1797
|
text: "",
|
|
1798
1798
|
disabled: e.saving,
|
|
1799
|
-
onClick: y[1] || (y[1] = (
|
|
1799
|
+
onClick: y[1] || (y[1] = (c) => o("update:visible", !1))
|
|
1800
1800
|
}, null, 8, ["label", "disabled"]),
|
|
1801
|
-
e.disabled ?
|
|
1801
|
+
e.disabled ? $("", !0) : (s(), A(v(ee), {
|
|
1802
1802
|
key: 0,
|
|
1803
1803
|
type: "submit",
|
|
1804
1804
|
label: e.isEditing ? "Atualizar" : "Salvar",
|
|
@@ -1813,7 +1813,7 @@ const sn = { class: "w-crud-form" }, rn = {
|
|
|
1813
1813
|
}, 8, ["visible", "header", "style"]));
|
|
1814
1814
|
}
|
|
1815
1815
|
});
|
|
1816
|
-
function
|
|
1816
|
+
function An(e, t) {
|
|
1817
1817
|
const a = t[e.field];
|
|
1818
1818
|
return e.format ? e.format(a, t) : a == null ? "" : typeof a == "boolean" ? a ? "Sim" : "Não" : String(a);
|
|
1819
1819
|
}
|
|
@@ -1821,57 +1821,57 @@ function bt(e, t) {
|
|
|
1821
1821
|
return e.includes('"') || e.includes(t) || e.includes(`
|
|
1822
1822
|
`) || e.includes("\r") ? `"${e.replace(/"/g, '""')}"` : e;
|
|
1823
1823
|
}
|
|
1824
|
-
function
|
|
1824
|
+
function Rn(e, t, a = {}) {
|
|
1825
1825
|
const o = a.separator ?? ";", l = t.map((r) => bt(r.header, o)).join(o), i = e.map(
|
|
1826
|
-
(r) => t.map((y) => bt(
|
|
1826
|
+
(r) => t.map((y) => bt(An(y, r), o)).join(o)
|
|
1827
1827
|
);
|
|
1828
1828
|
return "\uFEFF" + [l, ...i].join(`\r
|
|
1829
1829
|
`);
|
|
1830
1830
|
}
|
|
1831
|
-
function
|
|
1831
|
+
function In(e, t = "export.csv") {
|
|
1832
1832
|
const a = new Blob([e], { type: "text/csv;charset=utf-8;" }), o = URL.createObjectURL(a), l = document.createElement("a");
|
|
1833
1833
|
l.href = o, l.download = t, document.body.appendChild(l), l.click(), document.body.removeChild(l), URL.revokeObjectURL(o);
|
|
1834
1834
|
}
|
|
1835
|
-
const
|
|
1835
|
+
const Tn = { class: "w-crud" }, Ln = {
|
|
1836
1836
|
key: 0,
|
|
1837
1837
|
class: "w-crud-header"
|
|
1838
|
-
},
|
|
1838
|
+
}, zn = { class: "w-crud-header-content" }, Nn = { class: "w-crud-title" }, Yn = {
|
|
1839
1839
|
key: 0,
|
|
1840
1840
|
class: "w-crud-subtitle"
|
|
1841
|
-
},
|
|
1841
|
+
}, On = { class: "w-crud-header-actions" }, Bn = {
|
|
1842
1842
|
key: 0,
|
|
1843
1843
|
class: "w-crud-kpis"
|
|
1844
|
-
},
|
|
1844
|
+
}, Wn = { class: "w-crud-kpi-content" }, jn = { class: "w-crud-kpi-label" }, Un = { class: "w-crud-kpi-value" }, qn = { class: "w-crud-content-main" }, Hn = {
|
|
1845
1845
|
key: 0,
|
|
1846
1846
|
class: "w-crud-table"
|
|
1847
|
-
},
|
|
1847
|
+
}, Kn = { class: "w-crud-toolbar" }, Gn = { class: "w-crud-toolbar-start" }, Jn = { class: "w-crud-toolbar-end" }, Zn = {
|
|
1848
1848
|
key: 1,
|
|
1849
1849
|
class: "w-crud-view-toggle"
|
|
1850
|
-
},
|
|
1850
|
+
}, Xn = { class: "w-crud-actions" }, Qn = {
|
|
1851
1851
|
key: 1,
|
|
1852
1852
|
class: "w-crud-cards-wrap"
|
|
1853
|
-
},
|
|
1853
|
+
}, _n = { class: "w-crud-toolbar w-crud-toolbar--standalone" }, eo = { class: "w-crud-toolbar-start" }, to = { class: "w-crud-toolbar-end" }, ao = {
|
|
1854
1854
|
key: 1,
|
|
1855
1855
|
class: "w-crud-view-toggle"
|
|
1856
|
-
},
|
|
1856
|
+
}, no = {
|
|
1857
1857
|
key: 0,
|
|
1858
1858
|
class: "w-crud-cards-loading"
|
|
1859
|
-
},
|
|
1859
|
+
}, oo = {
|
|
1860
1860
|
key: 2,
|
|
1861
1861
|
class: "w-crud-cards"
|
|
1862
|
-
},
|
|
1862
|
+
}, lo = ["onClick", "onDblclick", "onContextmenu"], so = { class: "w-crud-card-body" }, io = {
|
|
1863
1863
|
key: 0,
|
|
1864
1864
|
class: "w-crud-card-label"
|
|
1865
|
-
},
|
|
1865
|
+
}, ro = { class: "w-crud-card-value" }, uo = {
|
|
1866
1866
|
key: 0,
|
|
1867
1867
|
class: "w-crud-card-actions"
|
|
1868
|
-
},
|
|
1868
|
+
}, co = {
|
|
1869
1869
|
key: 0,
|
|
1870
1870
|
class: "w-crud-rail"
|
|
1871
|
-
},
|
|
1871
|
+
}, fo = {
|
|
1872
1872
|
key: 1,
|
|
1873
1873
|
class: "w-crud-rail-sep"
|
|
1874
|
-
},
|
|
1874
|
+
}, mo = /* @__PURE__ */ de({
|
|
1875
1875
|
__name: "WCrudView",
|
|
1876
1876
|
props: {
|
|
1877
1877
|
crud: {},
|
|
@@ -1898,23 +1898,23 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
1898
1898
|
},
|
|
1899
1899
|
emits: ["row-expand", "row-collapse", "print"],
|
|
1900
1900
|
setup(e, { emit: t }) {
|
|
1901
|
-
const a = e, o = t, l =
|
|
1902
|
-
function
|
|
1901
|
+
const a = e, o = t, l = Ht(), { formatNumber: i } = rt(), r = q({}), y = q(a.defaultView);
|
|
1902
|
+
function c(u) {
|
|
1903
1903
|
return y.value === u;
|
|
1904
1904
|
}
|
|
1905
1905
|
function w(u) {
|
|
1906
1906
|
y.value = u;
|
|
1907
1907
|
}
|
|
1908
|
-
const
|
|
1908
|
+
const F = H(
|
|
1909
1909
|
() => (a.crud.pagination.page - 1) * a.crud.pagination.pageSize
|
|
1910
|
-
),
|
|
1910
|
+
), V = H(
|
|
1911
1911
|
() => a.crud.config.columns.filter((u) => u.visible !== !1).map((u) => u.type === "number" && !u.align ? { ...u, align: "right" } : u.type === "currency" && !u.align ? { ...u, align: "right" } : u)
|
|
1912
1912
|
);
|
|
1913
|
-
function
|
|
1913
|
+
function W(u) {
|
|
1914
1914
|
if (u.align === "right") return "text-right";
|
|
1915
1915
|
if (u.align === "center") return "text-center";
|
|
1916
1916
|
}
|
|
1917
|
-
const
|
|
1917
|
+
const L = H(() => V.value.slice(0, a.cardFields)), J = H(() => {
|
|
1918
1918
|
const u = [];
|
|
1919
1919
|
return a.crud.config.canEdit !== !1 && u.push({ action: "edit", icon: "pi pi-pencil", tooltip: "Editar" }), a.crud.config.canCreate !== !1 && u.push({
|
|
1920
1920
|
action: "duplicate",
|
|
@@ -1927,9 +1927,9 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
1927
1927
|
tooltip: "Excluir",
|
|
1928
1928
|
severity: "danger"
|
|
1929
1929
|
}), u;
|
|
1930
|
-
}),
|
|
1931
|
-
() => a.crud.config.rowActions ??
|
|
1932
|
-
), g = H(() =>
|
|
1930
|
+
}), Z = H(
|
|
1931
|
+
() => a.crud.config.rowActions ?? J.value
|
|
1932
|
+
), g = H(() => Z.value.length > 0 || !!l["row-actions"]);
|
|
1933
1933
|
function b(u, n) {
|
|
1934
1934
|
if (u.handler) {
|
|
1935
1935
|
u.handler(n);
|
|
@@ -1937,13 +1937,13 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
1937
1937
|
}
|
|
1938
1938
|
u.action === "edit" ? a.crud.openEditDialog(n) : u.action === "view" ? a.crud.openViewDialog(n) : u.action === "duplicate" ? a.crud.openDuplicateDialog(n) : u.action === "delete" && a.crud.confirmDelete(n);
|
|
1939
1939
|
}
|
|
1940
|
-
function
|
|
1940
|
+
function k(u, n) {
|
|
1941
1941
|
return u.visible ? u.visible(n) : !0;
|
|
1942
1942
|
}
|
|
1943
|
-
function
|
|
1943
|
+
function x(u, n) {
|
|
1944
1944
|
return u.disabled ? u.disabled(n) : !1;
|
|
1945
1945
|
}
|
|
1946
|
-
const
|
|
1946
|
+
const j = H(() => {
|
|
1947
1947
|
const u = [];
|
|
1948
1948
|
return a.showKpi && u.push({
|
|
1949
1949
|
icon: a.kpiIcon,
|
|
@@ -1952,20 +1952,20 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
1952
1952
|
}), u.push(...a.extraKpis), u;
|
|
1953
1953
|
});
|
|
1954
1954
|
H(() => a.crud.config.labels ?? {});
|
|
1955
|
-
const U = H(() => a.crud.config.canCreate !== !1),
|
|
1956
|
-
function
|
|
1957
|
-
|
|
1955
|
+
const U = H(() => a.crud.config.canCreate !== !1), Y = q(null), K = q(null);
|
|
1956
|
+
function B(u) {
|
|
1957
|
+
Y.value = u;
|
|
1958
1958
|
}
|
|
1959
1959
|
function X(u) {
|
|
1960
1960
|
var n;
|
|
1961
|
-
a.contextMenu && (
|
|
1961
|
+
a.contextMenu && (Y.value = u.data, (n = K.value) == null || n.show(u.originalEvent));
|
|
1962
1962
|
}
|
|
1963
1963
|
function oe(u, n) {
|
|
1964
|
-
var
|
|
1965
|
-
a.contextMenu && (u.preventDefault(),
|
|
1964
|
+
var p;
|
|
1965
|
+
a.contextMenu && (u.preventDefault(), Y.value = n, (p = K.value) == null || p.show(u));
|
|
1966
1966
|
}
|
|
1967
|
-
const
|
|
1968
|
-
const u =
|
|
1967
|
+
const ae = H(() => {
|
|
1968
|
+
const u = Y.value;
|
|
1969
1969
|
if (!u) return [];
|
|
1970
1970
|
const n = [
|
|
1971
1971
|
{
|
|
@@ -1974,13 +1974,13 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
1974
1974
|
command: () => a.crud.openViewDialog(u)
|
|
1975
1975
|
}
|
|
1976
1976
|
];
|
|
1977
|
-
for (const
|
|
1978
|
-
|
|
1979
|
-
label:
|
|
1980
|
-
icon:
|
|
1981
|
-
class:
|
|
1982
|
-
disabled:
|
|
1983
|
-
command: () => b(
|
|
1977
|
+
for (const p of Z.value)
|
|
1978
|
+
k(p, u) && n.push({
|
|
1979
|
+
label: p.tooltip ?? p.action,
|
|
1980
|
+
icon: p.icon,
|
|
1981
|
+
class: p.severity === "danger" ? "w-crud-ctx-danger" : void 0,
|
|
1982
|
+
disabled: x(p, u),
|
|
1983
|
+
command: () => b(p, u)
|
|
1984
1984
|
});
|
|
1985
1985
|
return n.push({
|
|
1986
1986
|
label: "Imprimir",
|
|
@@ -1989,75 +1989,75 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
1989
1989
|
}), a.exportCsv && (n.push({ separator: !0 }), n.push({
|
|
1990
1990
|
label: a.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)",
|
|
1991
1991
|
icon: "pi pi-download",
|
|
1992
|
-
command: () =>
|
|
1992
|
+
command: () => P()
|
|
1993
1993
|
})), n;
|
|
1994
1994
|
});
|
|
1995
|
-
function
|
|
1996
|
-
|
|
1995
|
+
function _() {
|
|
1996
|
+
Y.value && o("print", Y.value);
|
|
1997
1997
|
}
|
|
1998
1998
|
const f = q(!1);
|
|
1999
|
-
async function
|
|
1999
|
+
async function P() {
|
|
2000
2000
|
if (!f.value) {
|
|
2001
2001
|
f.value = !0;
|
|
2002
2002
|
try {
|
|
2003
|
-
const u = a.csvScope === "page" ? a.crud.items.value : await a.crud.fetchAll(a.csvPageSize), n =
|
|
2004
|
-
|
|
2003
|
+
const u = a.csvScope === "page" ? a.crud.items.value : await a.crud.fetchAll(a.csvPageSize), n = Rn(u, V.value);
|
|
2004
|
+
In(n, a.csvFilename);
|
|
2005
2005
|
} finally {
|
|
2006
2006
|
f.value = !1;
|
|
2007
2007
|
}
|
|
2008
2008
|
}
|
|
2009
2009
|
}
|
|
2010
|
-
return
|
|
2010
|
+
return Kt(() => {
|
|
2011
2011
|
a.autoInit && a.crud.init();
|
|
2012
2012
|
}), (u, n) => {
|
|
2013
|
-
const
|
|
2014
|
-
return s(),
|
|
2015
|
-
e.showHeader ? (s(),
|
|
2016
|
-
h("div",
|
|
2017
|
-
h("h1",
|
|
2018
|
-
e.subtitle ? (s(),
|
|
2013
|
+
const p = kt("tooltip");
|
|
2014
|
+
return s(), m("div", Tn, [
|
|
2015
|
+
e.showHeader ? (s(), m("div", Ln, [
|
|
2016
|
+
h("div", zn, [
|
|
2017
|
+
h("h1", Nn, T(e.title), 1),
|
|
2018
|
+
e.subtitle ? (s(), m("p", Yn, T(e.subtitle), 1)) : $("", !0)
|
|
2019
2019
|
]),
|
|
2020
|
-
h("div",
|
|
2021
|
-
|
|
2022
|
-
U.value ? (s(),
|
|
2020
|
+
h("div", On, [
|
|
2021
|
+
O(u.$slots, "header-actions"),
|
|
2022
|
+
U.value ? (s(), A(v(ee), {
|
|
2023
2023
|
key: 0,
|
|
2024
2024
|
label: "Novo",
|
|
2025
2025
|
icon: "pi pi-plus",
|
|
2026
|
-
onClick: n[0] || (n[0] = (
|
|
2027
|
-
})) :
|
|
2026
|
+
onClick: n[0] || (n[0] = (d) => e.crud.openCreateDialog())
|
|
2027
|
+
})) : $("", !0)
|
|
2028
2028
|
])
|
|
2029
|
-
])) :
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
(s(!0),
|
|
2033
|
-
key:
|
|
2029
|
+
])) : $("", !0),
|
|
2030
|
+
O(u.$slots, "before-table", {}, () => [
|
|
2031
|
+
j.value.length ? (s(), m("div", Bn, [
|
|
2032
|
+
(s(!0), m(le, null, ie(j.value, (d, E) => (s(), m("div", {
|
|
2033
|
+
key: E,
|
|
2034
2034
|
class: "w-crud-kpi"
|
|
2035
2035
|
}, [
|
|
2036
2036
|
h("div", {
|
|
2037
|
-
class:
|
|
2037
|
+
class: re(["w-crud-kpi-icon", d.severity ? `w-crud-kpi-icon--${d.severity}` : ""])
|
|
2038
2038
|
}, [
|
|
2039
2039
|
h("i", {
|
|
2040
|
-
class:
|
|
2041
|
-
style: je(
|
|
2040
|
+
class: re([d.icon]),
|
|
2041
|
+
style: je(d.color ? `color: ${d.color}` : "")
|
|
2042
2042
|
}, null, 6)
|
|
2043
2043
|
], 2),
|
|
2044
|
-
h("div",
|
|
2045
|
-
h("div",
|
|
2046
|
-
h("div",
|
|
2044
|
+
h("div", Wn, [
|
|
2045
|
+
h("div", jn, T(d.label), 1),
|
|
2046
|
+
h("div", Un, T(d.value), 1)
|
|
2047
2047
|
])
|
|
2048
2048
|
]))), 128))
|
|
2049
|
-
])) :
|
|
2049
|
+
])) : $("", !0)
|
|
2050
2050
|
]),
|
|
2051
2051
|
h("div", {
|
|
2052
|
-
class:
|
|
2052
|
+
class: re(["w-crud-content", { "w-crud-content--rail": e.actionRail }])
|
|
2053
2053
|
}, [
|
|
2054
|
-
h("div",
|
|
2055
|
-
y.value === "table" ? (s(),
|
|
2054
|
+
h("div", qn, [
|
|
2055
|
+
y.value === "table" ? (s(), m("div", Hn, [
|
|
2056
2056
|
N(v($t), {
|
|
2057
2057
|
value: e.crud.items.value,
|
|
2058
2058
|
loading: e.crud.loading.value,
|
|
2059
2059
|
"expanded-rows": r.value,
|
|
2060
|
-
"onUpdate:expandedRows": n[4] || (n[4] = (
|
|
2060
|
+
"onUpdate:expandedRows": n[4] || (n[4] = (d) => r.value = d),
|
|
2061
2061
|
paginator: "",
|
|
2062
2062
|
rows: e.crud.pagination.pageSize,
|
|
2063
2063
|
"total-records": e.crud.pagination.rows,
|
|
@@ -2072,25 +2072,25 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2072
2072
|
"sort-field": e.crud.sort.field ?? void 0,
|
|
2073
2073
|
"sort-order": e.crud.sort.order,
|
|
2074
2074
|
"data-key": e.crud.config.pk || "id",
|
|
2075
|
-
selection: e.actionRail || e.contextMenu ?
|
|
2075
|
+
selection: e.actionRail || e.contextMenu ? Y.value : void 0,
|
|
2076
2076
|
"selection-mode": e.actionRail || e.contextMenu ? "single" : void 0,
|
|
2077
2077
|
"context-menu": e.contextMenu,
|
|
2078
|
-
"context-menu-selection": e.contextMenu ?
|
|
2079
|
-
"onUpdate:selection": n[5] || (n[5] = (
|
|
2080
|
-
"onUpdate:contextMenuSelection": n[6] || (n[6] = (
|
|
2078
|
+
"context-menu-selection": e.contextMenu ? Y.value : void 0,
|
|
2079
|
+
"onUpdate:selection": n[5] || (n[5] = (d) => Y.value = d),
|
|
2080
|
+
"onUpdate:contextMenuSelection": n[6] || (n[6] = (d) => Y.value = d),
|
|
2081
2081
|
onRowContextmenu: X,
|
|
2082
2082
|
onPage: e.crud.onPage,
|
|
2083
|
-
onSort: n[7] || (n[7] = (
|
|
2084
|
-
onRowExpand: n[8] || (n[8] = (
|
|
2085
|
-
onRowCollapse: n[9] || (n[9] = (
|
|
2083
|
+
onSort: n[7] || (n[7] = (d) => e.crud.onSort({ sortField: d.sortField, sortOrder: d.sortOrder })),
|
|
2084
|
+
onRowExpand: n[8] || (n[8] = (d) => o("row-expand", d.data)),
|
|
2085
|
+
onRowCollapse: n[9] || (n[9] = (d) => o("row-collapse", d.data))
|
|
2086
2086
|
}, ot({
|
|
2087
2087
|
header: ne(() => [
|
|
2088
|
-
h("div",
|
|
2089
|
-
h("div",
|
|
2090
|
-
e.showSearch ? (s(),
|
|
2088
|
+
h("div", Kn, [
|
|
2089
|
+
h("div", Gn, [
|
|
2090
|
+
e.showSearch ? (s(), A(v(qe), { key: 0 }, {
|
|
2091
2091
|
default: ne(() => [
|
|
2092
2092
|
N(v(He), { class: "pi pi-search" }),
|
|
2093
|
-
N(v(
|
|
2093
|
+
N(v(me), {
|
|
2094
2094
|
"model-value": e.crud.search.value,
|
|
2095
2095
|
placeholder: "Buscar...",
|
|
2096
2096
|
class: "w-72",
|
|
@@ -2098,54 +2098,54 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2098
2098
|
}, null, 8, ["model-value", "onInput"])
|
|
2099
2099
|
]),
|
|
2100
2100
|
_: 1
|
|
2101
|
-
})) :
|
|
2102
|
-
|
|
2103
|
-
|
|
2101
|
+
})) : $("", !0),
|
|
2102
|
+
O(u.$slots, "toolbar-start"),
|
|
2103
|
+
O(u.$slots, "toolbar-filters")
|
|
2104
2104
|
]),
|
|
2105
|
-
h("div",
|
|
2106
|
-
|
|
2107
|
-
e.exportCsv ?
|
|
2105
|
+
h("div", Jn, [
|
|
2106
|
+
O(u.$slots, "toolbar-actions"),
|
|
2107
|
+
e.exportCsv ? fe((s(), A(v(ee), {
|
|
2108
2108
|
key: 0,
|
|
2109
2109
|
icon: "pi pi-download",
|
|
2110
2110
|
text: "",
|
|
2111
2111
|
size: "small",
|
|
2112
2112
|
loading: f.value,
|
|
2113
|
-
onClick:
|
|
2113
|
+
onClick: P
|
|
2114
2114
|
}, null, 8, ["loading"])), [
|
|
2115
2115
|
[
|
|
2116
|
-
|
|
2116
|
+
p,
|
|
2117
2117
|
e.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)",
|
|
2118
2118
|
void 0,
|
|
2119
2119
|
{ top: !0 }
|
|
2120
2120
|
]
|
|
2121
|
-
]) :
|
|
2122
|
-
e.viewToggle ? (s(),
|
|
2123
|
-
N(v(
|
|
2121
|
+
]) : $("", !0),
|
|
2122
|
+
e.viewToggle ? (s(), m("div", Zn, [
|
|
2123
|
+
N(v(ee), {
|
|
2124
2124
|
icon: "pi pi-table",
|
|
2125
2125
|
size: "small",
|
|
2126
|
-
text: !
|
|
2127
|
-
outlined:
|
|
2128
|
-
onClick: n[1] || (n[1] = (
|
|
2126
|
+
text: !c("table"),
|
|
2127
|
+
outlined: c("table"),
|
|
2128
|
+
onClick: n[1] || (n[1] = (d) => w("table"))
|
|
2129
2129
|
}, null, 8, ["text", "outlined"]),
|
|
2130
|
-
N(v(
|
|
2130
|
+
N(v(ee), {
|
|
2131
2131
|
icon: "pi pi-th-large",
|
|
2132
2132
|
size: "small",
|
|
2133
|
-
text: !
|
|
2134
|
-
outlined:
|
|
2135
|
-
onClick: n[2] || (n[2] = (
|
|
2133
|
+
text: !c("cards"),
|
|
2134
|
+
outlined: c("cards"),
|
|
2135
|
+
onClick: n[2] || (n[2] = (d) => w("cards"))
|
|
2136
2136
|
}, null, 8, ["text", "outlined"])
|
|
2137
|
-
])) :
|
|
2138
|
-
!e.showHeader && U.value ? (s(),
|
|
2137
|
+
])) : $("", !0),
|
|
2138
|
+
!e.showHeader && U.value ? (s(), A(v(ee), {
|
|
2139
2139
|
key: 2,
|
|
2140
2140
|
label: "Novo",
|
|
2141
2141
|
icon: "pi pi-plus",
|
|
2142
|
-
onClick: n[3] || (n[3] = (
|
|
2143
|
-
})) :
|
|
2142
|
+
onClick: n[3] || (n[3] = (d) => e.crud.openCreateDialog())
|
|
2143
|
+
})) : $("", !0)
|
|
2144
2144
|
])
|
|
2145
2145
|
])
|
|
2146
2146
|
]),
|
|
2147
2147
|
empty: ne(() => [
|
|
2148
|
-
|
|
2148
|
+
O(u.$slots, "empty", {}, () => [
|
|
2149
2149
|
n[17] || (n[17] = h("div", { class: "w-crud-empty" }, [
|
|
2150
2150
|
h("div", { class: "w-crud-empty-icon" }, [
|
|
2151
2151
|
h("i", { class: "pi pi-inbox" })
|
|
@@ -2156,90 +2156,90 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2156
2156
|
])
|
|
2157
2157
|
]),
|
|
2158
2158
|
default: ne(() => [
|
|
2159
|
-
e.expandable ? (s(),
|
|
2159
|
+
e.expandable ? (s(), A(v(ze), {
|
|
2160
2160
|
key: 0,
|
|
2161
2161
|
expander: "",
|
|
2162
2162
|
style: { width: "3rem" }
|
|
2163
|
-
})) :
|
|
2164
|
-
(s(!0),
|
|
2165
|
-
key:
|
|
2166
|
-
field:
|
|
2167
|
-
header:
|
|
2168
|
-
sortable:
|
|
2169
|
-
style: je(
|
|
2170
|
-
"header-class":
|
|
2171
|
-
"body-class":
|
|
2163
|
+
})) : $("", !0),
|
|
2164
|
+
(s(!0), m(le, null, ie(V.value, (d) => (s(), A(v(ze), {
|
|
2165
|
+
key: d.field,
|
|
2166
|
+
field: d.field,
|
|
2167
|
+
header: d.header,
|
|
2168
|
+
sortable: d.sortable,
|
|
2169
|
+
style: je(d.style),
|
|
2170
|
+
"header-class": W(d),
|
|
2171
|
+
"body-class": W(d)
|
|
2172
2172
|
}, {
|
|
2173
|
-
body: ne(({ data:
|
|
2174
|
-
|
|
2175
|
-
data:
|
|
2176
|
-
value:
|
|
2173
|
+
body: ne(({ data: E }) => [
|
|
2174
|
+
O(u.$slots, `column-${d.field}`, {
|
|
2175
|
+
data: E,
|
|
2176
|
+
value: E[d.field]
|
|
2177
2177
|
}, () => [
|
|
2178
2178
|
N(Qe, {
|
|
2179
|
-
column:
|
|
2180
|
-
value:
|
|
2181
|
-
"row-data":
|
|
2179
|
+
column: d,
|
|
2180
|
+
value: E[d.field],
|
|
2181
|
+
"row-data": E
|
|
2182
2182
|
}, null, 8, ["column", "value", "row-data"])
|
|
2183
2183
|
])
|
|
2184
2184
|
]),
|
|
2185
2185
|
_: 2
|
|
2186
2186
|
}, 1032, ["field", "header", "sortable", "style", "header-class", "body-class"]))), 128)),
|
|
2187
|
-
g.value && !e.actionRail ? (s(),
|
|
2187
|
+
g.value && !e.actionRail ? (s(), A(v(ze), {
|
|
2188
2188
|
key: 1,
|
|
2189
2189
|
"header-class": "w-crud-actions-header",
|
|
2190
|
-
style: je({ width: `${(
|
|
2190
|
+
style: je({ width: `${(Z.value.length + (v(l)["row-actions"] ? 1 : 0)) * 2.5 + 1}rem` })
|
|
2191
2191
|
}, {
|
|
2192
|
-
body: ne(({ data:
|
|
2193
|
-
h("div",
|
|
2194
|
-
(s(!0),
|
|
2195
|
-
key:
|
|
2192
|
+
body: ne(({ data: d }) => [
|
|
2193
|
+
h("div", Xn, [
|
|
2194
|
+
(s(!0), m(le, null, ie(Z.value, (E) => (s(), m(le, {
|
|
2195
|
+
key: E.action
|
|
2196
2196
|
}, [
|
|
2197
|
-
|
|
2197
|
+
k(E, d) ? fe((s(), A(v(ee), {
|
|
2198
2198
|
key: 0,
|
|
2199
|
-
icon:
|
|
2199
|
+
icon: E.icon,
|
|
2200
2200
|
text: "",
|
|
2201
2201
|
rounded: "",
|
|
2202
2202
|
size: "small",
|
|
2203
|
-
severity:
|
|
2204
|
-
disabled:
|
|
2205
|
-
onClick: (
|
|
2203
|
+
severity: E.severity,
|
|
2204
|
+
disabled: x(E, d),
|
|
2205
|
+
onClick: (R) => b(E, d)
|
|
2206
2206
|
}, null, 8, ["icon", "severity", "disabled", "onClick"])), [
|
|
2207
2207
|
[
|
|
2208
|
-
|
|
2209
|
-
|
|
2208
|
+
p,
|
|
2209
|
+
E.tooltip,
|
|
2210
2210
|
void 0,
|
|
2211
2211
|
{ top: !0 }
|
|
2212
2212
|
]
|
|
2213
|
-
]) :
|
|
2213
|
+
]) : $("", !0)
|
|
2214
2214
|
], 64))), 128)),
|
|
2215
|
-
|
|
2216
|
-
data:
|
|
2215
|
+
O(u.$slots, "row-actions", {
|
|
2216
|
+
data: d,
|
|
2217
2217
|
crud: e.crud
|
|
2218
2218
|
})
|
|
2219
2219
|
])
|
|
2220
2220
|
]),
|
|
2221
2221
|
_: 3
|
|
2222
|
-
}, 8, ["style"])) :
|
|
2222
|
+
}, 8, ["style"])) : $("", !0)
|
|
2223
2223
|
]),
|
|
2224
2224
|
_: 2
|
|
2225
2225
|
}, [
|
|
2226
2226
|
e.expandable ? {
|
|
2227
2227
|
name: "expansion",
|
|
2228
|
-
fn: ne((
|
|
2229
|
-
|
|
2230
|
-
data:
|
|
2228
|
+
fn: ne((d) => [
|
|
2229
|
+
O(u.$slots, "expansion", {
|
|
2230
|
+
data: d.data
|
|
2231
2231
|
})
|
|
2232
2232
|
]),
|
|
2233
2233
|
key: "0"
|
|
2234
2234
|
} : void 0
|
|
2235
2235
|
]), 1032, ["value", "loading", "expanded-rows", "rows", "total-records", "sort-field", "sort-order", "data-key", "selection", "selection-mode", "context-menu", "context-menu-selection", "onPage"])
|
|
2236
|
-
])) : (s(),
|
|
2237
|
-
h("div",
|
|
2238
|
-
h("div",
|
|
2239
|
-
e.showSearch ? (s(),
|
|
2236
|
+
])) : (s(), m("div", Qn, [
|
|
2237
|
+
h("div", _n, [
|
|
2238
|
+
h("div", eo, [
|
|
2239
|
+
e.showSearch ? (s(), A(v(qe), { key: 0 }, {
|
|
2240
2240
|
default: ne(() => [
|
|
2241
2241
|
N(v(He), { class: "pi pi-search" }),
|
|
2242
|
-
N(v(
|
|
2242
|
+
N(v(me), {
|
|
2243
2243
|
"model-value": e.crud.search.value,
|
|
2244
2244
|
placeholder: "Buscar...",
|
|
2245
2245
|
class: "w-72",
|
|
@@ -2247,207 +2247,207 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2247
2247
|
}, null, 8, ["model-value", "onInput"])
|
|
2248
2248
|
]),
|
|
2249
2249
|
_: 1
|
|
2250
|
-
})) :
|
|
2251
|
-
|
|
2252
|
-
|
|
2250
|
+
})) : $("", !0),
|
|
2251
|
+
O(u.$slots, "toolbar-start"),
|
|
2252
|
+
O(u.$slots, "toolbar-filters")
|
|
2253
2253
|
]),
|
|
2254
|
-
h("div",
|
|
2255
|
-
|
|
2256
|
-
e.exportCsv ?
|
|
2254
|
+
h("div", to, [
|
|
2255
|
+
O(u.$slots, "toolbar-actions"),
|
|
2256
|
+
e.exportCsv ? fe((s(), A(v(ee), {
|
|
2257
2257
|
key: 0,
|
|
2258
2258
|
icon: "pi pi-download",
|
|
2259
2259
|
text: "",
|
|
2260
2260
|
size: "small",
|
|
2261
2261
|
loading: f.value,
|
|
2262
|
-
onClick:
|
|
2262
|
+
onClick: P
|
|
2263
2263
|
}, null, 8, ["loading"])), [
|
|
2264
2264
|
[
|
|
2265
|
-
|
|
2265
|
+
p,
|
|
2266
2266
|
e.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)",
|
|
2267
2267
|
void 0,
|
|
2268
2268
|
{ top: !0 }
|
|
2269
2269
|
]
|
|
2270
|
-
]) :
|
|
2271
|
-
e.viewToggle ? (s(),
|
|
2272
|
-
N(v(
|
|
2270
|
+
]) : $("", !0),
|
|
2271
|
+
e.viewToggle ? (s(), m("div", ao, [
|
|
2272
|
+
N(v(ee), {
|
|
2273
2273
|
icon: "pi pi-table",
|
|
2274
2274
|
size: "small",
|
|
2275
|
-
text: !
|
|
2276
|
-
outlined:
|
|
2277
|
-
onClick: n[10] || (n[10] = (
|
|
2275
|
+
text: !c("table"),
|
|
2276
|
+
outlined: c("table"),
|
|
2277
|
+
onClick: n[10] || (n[10] = (d) => w("table"))
|
|
2278
2278
|
}, null, 8, ["text", "outlined"]),
|
|
2279
|
-
N(v(
|
|
2279
|
+
N(v(ee), {
|
|
2280
2280
|
icon: "pi pi-th-large",
|
|
2281
2281
|
size: "small",
|
|
2282
|
-
text: !
|
|
2283
|
-
outlined:
|
|
2284
|
-
onClick: n[11] || (n[11] = (
|
|
2282
|
+
text: !c("cards"),
|
|
2283
|
+
outlined: c("cards"),
|
|
2284
|
+
onClick: n[11] || (n[11] = (d) => w("cards"))
|
|
2285
2285
|
}, null, 8, ["text", "outlined"])
|
|
2286
|
-
])) :
|
|
2287
|
-
!e.showHeader && U.value ? (s(),
|
|
2286
|
+
])) : $("", !0),
|
|
2287
|
+
!e.showHeader && U.value ? (s(), A(v(ee), {
|
|
2288
2288
|
key: 2,
|
|
2289
2289
|
label: "Novo",
|
|
2290
2290
|
icon: "pi pi-plus",
|
|
2291
|
-
onClick: n[12] || (n[12] = (
|
|
2292
|
-
})) :
|
|
2291
|
+
onClick: n[12] || (n[12] = (d) => e.crud.openCreateDialog())
|
|
2292
|
+
})) : $("", !0)
|
|
2293
2293
|
])
|
|
2294
2294
|
]),
|
|
2295
|
-
e.crud.loading.value ? (s(),
|
|
2295
|
+
e.crud.loading.value ? (s(), m("div", no, [...n[18] || (n[18] = [
|
|
2296
2296
|
h("i", { class: "pi pi-spin pi-spinner" }, null, -1)
|
|
2297
|
-
])])) : e.crud.items.value.length ? (s(),
|
|
2298
|
-
(s(!0),
|
|
2299
|
-
key:
|
|
2300
|
-
class:
|
|
2301
|
-
onClick: (
|
|
2302
|
-
onDblclick: (
|
|
2303
|
-
onContextmenu: (
|
|
2297
|
+
])])) : e.crud.items.value.length ? (s(), m("div", oo, [
|
|
2298
|
+
(s(!0), m(le, null, ie(e.crud.items.value, (d, E) => (s(), m("div", {
|
|
2299
|
+
key: d[e.crud.config.pk || "id"] ?? E,
|
|
2300
|
+
class: re(["w-crud-card", { "w-crud-card--selected": Y.value === d }]),
|
|
2301
|
+
onClick: (R) => B(d),
|
|
2302
|
+
onDblclick: (R) => e.crud.config.canEdit !== !1 && e.crud.openEditDialog(d),
|
|
2303
|
+
onContextmenu: (R) => oe(R, d)
|
|
2304
2304
|
}, [
|
|
2305
|
-
h("div",
|
|
2306
|
-
(s(!0),
|
|
2307
|
-
key:
|
|
2308
|
-
class:
|
|
2305
|
+
h("div", so, [
|
|
2306
|
+
(s(!0), m(le, null, ie(L.value, (R, G) => (s(), m("div", {
|
|
2307
|
+
key: R.field,
|
|
2308
|
+
class: re(["w-crud-card-row", { "w-crud-card-row--title": G === 0 }])
|
|
2309
2309
|
}, [
|
|
2310
|
-
|
|
2311
|
-
h("span",
|
|
2312
|
-
|
|
2313
|
-
data:
|
|
2314
|
-
value:
|
|
2310
|
+
G !== 0 ? (s(), m("span", io, T(R.header), 1)) : $("", !0),
|
|
2311
|
+
h("span", ro, [
|
|
2312
|
+
O(u.$slots, `column-${R.field}`, {
|
|
2313
|
+
data: d,
|
|
2314
|
+
value: d[R.field]
|
|
2315
2315
|
}, () => [
|
|
2316
2316
|
N(Qe, {
|
|
2317
|
-
column:
|
|
2318
|
-
value:
|
|
2319
|
-
"row-data":
|
|
2317
|
+
column: R,
|
|
2318
|
+
value: d[R.field],
|
|
2319
|
+
"row-data": d
|
|
2320
2320
|
}, null, 8, ["column", "value", "row-data"])
|
|
2321
2321
|
])
|
|
2322
2322
|
])
|
|
2323
2323
|
], 2))), 128))
|
|
2324
2324
|
]),
|
|
2325
|
-
g.value && !e.actionRail ? (s(),
|
|
2326
|
-
(s(!0),
|
|
2327
|
-
key:
|
|
2325
|
+
g.value && !e.actionRail ? (s(), m("div", uo, [
|
|
2326
|
+
(s(!0), m(le, null, ie(Z.value, (R) => (s(), m(le, {
|
|
2327
|
+
key: R.action
|
|
2328
2328
|
}, [
|
|
2329
|
-
|
|
2329
|
+
k(R, d) ? fe((s(), A(v(ee), {
|
|
2330
2330
|
key: 0,
|
|
2331
|
-
icon:
|
|
2331
|
+
icon: R.icon,
|
|
2332
2332
|
text: "",
|
|
2333
2333
|
rounded: "",
|
|
2334
2334
|
size: "small",
|
|
2335
|
-
severity:
|
|
2336
|
-
disabled:
|
|
2337
|
-
onClick: (
|
|
2335
|
+
severity: R.severity,
|
|
2336
|
+
disabled: x(R, d),
|
|
2337
|
+
onClick: (G) => b(R, d)
|
|
2338
2338
|
}, null, 8, ["icon", "severity", "disabled", "onClick"])), [
|
|
2339
2339
|
[
|
|
2340
|
-
|
|
2341
|
-
|
|
2340
|
+
p,
|
|
2341
|
+
R.tooltip,
|
|
2342
2342
|
void 0,
|
|
2343
2343
|
{ top: !0 }
|
|
2344
2344
|
]
|
|
2345
|
-
]) :
|
|
2345
|
+
]) : $("", !0)
|
|
2346
2346
|
], 64))), 128)),
|
|
2347
|
-
|
|
2348
|
-
data:
|
|
2347
|
+
O(u.$slots, "row-actions", {
|
|
2348
|
+
data: d,
|
|
2349
2349
|
crud: e.crud
|
|
2350
2350
|
})
|
|
2351
|
-
])) :
|
|
2352
|
-
], 42,
|
|
2353
|
-
])) :
|
|
2354
|
-
n[19] || (n[19] =
|
|
2351
|
+
])) : $("", !0)
|
|
2352
|
+
], 42, lo))), 128))
|
|
2353
|
+
])) : O(u.$slots, "empty", { key: 1 }, () => [
|
|
2354
|
+
n[19] || (n[19] = Gt('<div class="w-crud-empty"><div class="w-crud-empty-icon"><i class="pi pi-inbox"></i></div><p class="w-crud-empty-title">Nenhum registro encontrado</p><p class="w-crud-empty-text">Tente ajustar sua busca ou crie um novo registro</p></div>', 1))
|
|
2355
2355
|
]),
|
|
2356
|
-
e.crud.items.value.length ? (s(),
|
|
2356
|
+
e.crud.items.value.length ? (s(), A(v(Jt), {
|
|
2357
2357
|
key: 3,
|
|
2358
2358
|
rows: e.crud.pagination.pageSize,
|
|
2359
2359
|
"total-records": e.crud.pagination.rows,
|
|
2360
|
-
first:
|
|
2360
|
+
first: F.value,
|
|
2361
2361
|
"rows-per-page-options": [10, 20, 50],
|
|
2362
2362
|
template: "CurrentPageReport PrevPageLink NextPageLink",
|
|
2363
2363
|
"current-page-report-template": "Página {currentPage} de {totalPages}",
|
|
2364
2364
|
class: "w-crud-paginator",
|
|
2365
2365
|
onPage: e.crud.onPage
|
|
2366
|
-
}, null, 8, ["rows", "total-records", "first", "onPage"])) :
|
|
2366
|
+
}, null, 8, ["rows", "total-records", "first", "onPage"])) : $("", !0)
|
|
2367
2367
|
]))
|
|
2368
2368
|
]),
|
|
2369
|
-
e.actionRail ? (s(),
|
|
2370
|
-
U.value ?
|
|
2369
|
+
e.actionRail ? (s(), m("aside", co, [
|
|
2370
|
+
U.value ? fe((s(), A(v(ee), {
|
|
2371
2371
|
key: 0,
|
|
2372
2372
|
icon: "pi pi-plus",
|
|
2373
2373
|
rounded: "",
|
|
2374
|
-
onClick: n[13] || (n[13] = (
|
|
2374
|
+
onClick: n[13] || (n[13] = (d) => e.crud.openCreateDialog())
|
|
2375
2375
|
}, null, 512)), [
|
|
2376
2376
|
[
|
|
2377
|
-
|
|
2377
|
+
p,
|
|
2378
2378
|
"Novo",
|
|
2379
2379
|
void 0,
|
|
2380
2380
|
{ left: !0 }
|
|
2381
2381
|
]
|
|
2382
|
-
]) :
|
|
2383
|
-
U.value &&
|
|
2384
|
-
(s(!0),
|
|
2385
|
-
key:
|
|
2382
|
+
]) : $("", !0),
|
|
2383
|
+
U.value && Z.value.length ? (s(), m("div", fo)) : $("", !0),
|
|
2384
|
+
(s(!0), m(le, null, ie(Z.value, (d) => (s(), m(le, {
|
|
2385
|
+
key: d.action
|
|
2386
2386
|
}, [
|
|
2387
|
-
!
|
|
2387
|
+
!Y.value || k(d, Y.value) ? fe((s(), A(v(ee), {
|
|
2388
2388
|
key: 0,
|
|
2389
|
-
icon:
|
|
2389
|
+
icon: d.icon,
|
|
2390
2390
|
text: "",
|
|
2391
2391
|
rounded: "",
|
|
2392
|
-
severity:
|
|
2393
|
-
disabled: !
|
|
2394
|
-
onClick: (
|
|
2392
|
+
severity: d.severity,
|
|
2393
|
+
disabled: !Y.value || x(d, Y.value),
|
|
2394
|
+
onClick: (E) => Y.value && b(d, Y.value)
|
|
2395
2395
|
}, null, 8, ["icon", "severity", "disabled", "onClick"])), [
|
|
2396
2396
|
[
|
|
2397
|
-
|
|
2398
|
-
|
|
2397
|
+
p,
|
|
2398
|
+
d.tooltip,
|
|
2399
2399
|
void 0,
|
|
2400
2400
|
{ left: !0 }
|
|
2401
2401
|
]
|
|
2402
|
-
]) :
|
|
2402
|
+
]) : $("", !0)
|
|
2403
2403
|
], 64))), 128)),
|
|
2404
|
-
|
|
2405
|
-
selected:
|
|
2404
|
+
O(u.$slots, "rail-actions", {
|
|
2405
|
+
selected: Y.value,
|
|
2406
2406
|
crud: e.crud
|
|
2407
2407
|
}),
|
|
2408
2408
|
n[20] || (n[20] = h("div", { class: "w-crud-rail-sep" }, null, -1)),
|
|
2409
|
-
|
|
2409
|
+
fe(N(v(ee), {
|
|
2410
2410
|
icon: "pi pi-print",
|
|
2411
2411
|
text: "",
|
|
2412
2412
|
rounded: "",
|
|
2413
|
-
disabled: !
|
|
2414
|
-
onClick:
|
|
2413
|
+
disabled: !Y.value,
|
|
2414
|
+
onClick: _
|
|
2415
2415
|
}, null, 8, ["disabled"]), [
|
|
2416
2416
|
[
|
|
2417
|
-
|
|
2417
|
+
p,
|
|
2418
2418
|
"Imprimir",
|
|
2419
2419
|
void 0,
|
|
2420
2420
|
{ left: !0 }
|
|
2421
2421
|
]
|
|
2422
2422
|
]),
|
|
2423
|
-
e.exportCsv ?
|
|
2423
|
+
e.exportCsv ? fe((s(), A(v(ee), {
|
|
2424
2424
|
key: 2,
|
|
2425
2425
|
icon: "pi pi-download",
|
|
2426
2426
|
text: "",
|
|
2427
2427
|
rounded: "",
|
|
2428
2428
|
loading: f.value,
|
|
2429
|
-
onClick:
|
|
2429
|
+
onClick: P
|
|
2430
2430
|
}, null, 8, ["loading"])), [
|
|
2431
2431
|
[
|
|
2432
|
-
|
|
2432
|
+
p,
|
|
2433
2433
|
e.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)",
|
|
2434
2434
|
void 0,
|
|
2435
2435
|
{ left: !0 }
|
|
2436
2436
|
]
|
|
2437
|
-
]) :
|
|
2438
|
-
])) :
|
|
2437
|
+
]) : $("", !0)
|
|
2438
|
+
])) : $("", !0)
|
|
2439
2439
|
], 2),
|
|
2440
|
-
e.contextMenu ? (s(),
|
|
2440
|
+
e.contextMenu ? (s(), A(v(Zt), {
|
|
2441
2441
|
key: 1,
|
|
2442
2442
|
ref_key: "cm",
|
|
2443
|
-
ref:
|
|
2444
|
-
model:
|
|
2445
|
-
}, null, 8, ["model"])) :
|
|
2446
|
-
|
|
2443
|
+
ref: K,
|
|
2444
|
+
model: ae.value
|
|
2445
|
+
}, null, 8, ["model"])) : $("", !0),
|
|
2446
|
+
O(u.$slots, "form-dialog", {
|
|
2447
2447
|
crud: e.crud,
|
|
2448
2448
|
dialogWidth: e.dialogWidth
|
|
2449
2449
|
}, () => {
|
|
2450
|
-
var
|
|
2450
|
+
var d;
|
|
2451
2451
|
return [
|
|
2452
2452
|
N(ut, {
|
|
2453
2453
|
visible: e.crud.dialogVisible.value,
|
|
@@ -2456,18 +2456,18 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2456
2456
|
"form-data": e.crud.formData,
|
|
2457
2457
|
"is-editing": e.crud.isEditing.value,
|
|
2458
2458
|
saving: e.crud.saving.value,
|
|
2459
|
-
disabled: ((
|
|
2459
|
+
disabled: ((d = e.crud.viewMode) == null ? void 0 : d.value) ?? !1,
|
|
2460
2460
|
width: e.dialogWidth,
|
|
2461
|
-
"onUpdate:visible": n[14] || (n[14] = (
|
|
2462
|
-
e.crud.dialogVisible.value =
|
|
2461
|
+
"onUpdate:visible": n[14] || (n[14] = (E) => {
|
|
2462
|
+
e.crud.dialogVisible.value = E, E || (e.crud.editingItem.value = null);
|
|
2463
2463
|
}),
|
|
2464
|
-
"onUpdate:field": n[15] || (n[15] = (
|
|
2465
|
-
onSave: n[16] || (n[16] = (
|
|
2464
|
+
"onUpdate:field": n[15] || (n[15] = (E, R) => e.crud.setFormField(E, R)),
|
|
2465
|
+
onSave: n[16] || (n[16] = (E) => e.crud.save())
|
|
2466
2466
|
}, ot({ _: 2 }, [
|
|
2467
|
-
|
|
2468
|
-
name: `field-${
|
|
2469
|
-
fn: ne((
|
|
2470
|
-
|
|
2467
|
+
ie(e.crud.config.form, (E) => ({
|
|
2468
|
+
name: `field-${E.field}`,
|
|
2469
|
+
fn: ne((R) => [
|
|
2470
|
+
O(u.$slots, `field-${E.field}`, lt(st(R)))
|
|
2471
2471
|
])
|
|
2472
2472
|
}))
|
|
2473
2473
|
]), 1032, ["visible", "title", "fields", "form-data", "is-editing", "saving", "disabled", "width"])
|
|
@@ -2476,7 +2476,7 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2476
2476
|
]);
|
|
2477
2477
|
};
|
|
2478
2478
|
}
|
|
2479
|
-
}),
|
|
2479
|
+
}), po = /* @__PURE__ */ de({
|
|
2480
2480
|
__name: "WStatusTag",
|
|
2481
2481
|
props: {
|
|
2482
2482
|
value: {},
|
|
@@ -2511,15 +2511,15 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2511
2511
|
paga: { label: "Paga", severity: "success" },
|
|
2512
2512
|
inadimplente: { label: "Inadimplente", severity: "danger" }
|
|
2513
2513
|
}, o = H(() => (t.map ?? a)[t.value] ?? { label: t.value, severity: "secondary" });
|
|
2514
|
-
return (l, i) => (s(),
|
|
2514
|
+
return (l, i) => (s(), A(v(Ct), {
|
|
2515
2515
|
value: o.value.label,
|
|
2516
2516
|
severity: o.value.severity
|
|
2517
2517
|
}, null, 8, ["value", "severity"]));
|
|
2518
2518
|
}
|
|
2519
|
-
}),
|
|
2519
|
+
}), vo = { class: "w-page-header" }, go = { class: "w-page-header-content" }, ho = { class: "w-page-header-title" }, yo = {
|
|
2520
2520
|
key: 0,
|
|
2521
2521
|
class: "w-page-header-subtitle"
|
|
2522
|
-
},
|
|
2522
|
+
}, bo = { class: "w-page-header-actions" }, Zl = /* @__PURE__ */ de({
|
|
2523
2523
|
__name: "WPageHeader",
|
|
2524
2524
|
props: {
|
|
2525
2525
|
title: {},
|
|
@@ -2530,26 +2530,26 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2530
2530
|
emits: ["action"],
|
|
2531
2531
|
setup(e, { emit: t }) {
|
|
2532
2532
|
const a = t;
|
|
2533
|
-
return (o, l) => (s(),
|
|
2534
|
-
h("div",
|
|
2535
|
-
h("h2",
|
|
2536
|
-
e.subtitle ? (s(),
|
|
2533
|
+
return (o, l) => (s(), m("div", vo, [
|
|
2534
|
+
h("div", go, [
|
|
2535
|
+
h("h2", ho, T(e.title), 1),
|
|
2536
|
+
e.subtitle ? (s(), m("p", yo, T(e.subtitle), 1)) : $("", !0)
|
|
2537
2537
|
]),
|
|
2538
|
-
h("div",
|
|
2539
|
-
|
|
2540
|
-
e.actionLabel ? (s(),
|
|
2538
|
+
h("div", bo, [
|
|
2539
|
+
O(o.$slots, "actions"),
|
|
2540
|
+
e.actionLabel ? (s(), A(v(ee), {
|
|
2541
2541
|
key: 0,
|
|
2542
2542
|
label: e.actionLabel,
|
|
2543
2543
|
icon: e.actionIcon,
|
|
2544
2544
|
onClick: l[0] || (l[0] = (i) => a("action"))
|
|
2545
|
-
}, null, 8, ["label", "icon"])) :
|
|
2545
|
+
}, null, 8, ["label", "icon"])) : $("", !0)
|
|
2546
2546
|
])
|
|
2547
2547
|
]));
|
|
2548
2548
|
}
|
|
2549
|
-
}),
|
|
2549
|
+
}), wo = { class: "w-empty-state" }, ko = { class: "w-empty-state-icon" }, $o = { class: "w-empty-state-title" }, Co = {
|
|
2550
2550
|
key: 0,
|
|
2551
2551
|
class: "w-empty-state-description"
|
|
2552
|
-
},
|
|
2552
|
+
}, Xl = /* @__PURE__ */ de({
|
|
2553
2553
|
__name: "WEmptyState",
|
|
2554
2554
|
props: {
|
|
2555
2555
|
icon: {},
|
|
@@ -2561,22 +2561,22 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2561
2561
|
emits: ["action"],
|
|
2562
2562
|
setup(e, { emit: t }) {
|
|
2563
2563
|
const a = t;
|
|
2564
|
-
return (o, l) => (s(),
|
|
2565
|
-
h("div",
|
|
2564
|
+
return (o, l) => (s(), m("div", wo, [
|
|
2565
|
+
h("div", ko, [
|
|
2566
2566
|
h("i", {
|
|
2567
|
-
class:
|
|
2567
|
+
class: re(e.icon)
|
|
2568
2568
|
}, null, 2)
|
|
2569
2569
|
]),
|
|
2570
|
-
h("p",
|
|
2571
|
-
e.description ? (s(),
|
|
2572
|
-
e.actionLabel ? (s(),
|
|
2570
|
+
h("p", $o, T(e.title), 1),
|
|
2571
|
+
e.description ? (s(), m("p", Co, T(e.description), 1)) : $("", !0),
|
|
2572
|
+
e.actionLabel ? (s(), A(v(ee), {
|
|
2573
2573
|
key: 1,
|
|
2574
2574
|
label: e.actionLabel,
|
|
2575
2575
|
icon: e.actionIcon,
|
|
2576
2576
|
size: "small",
|
|
2577
2577
|
class: "mt-3",
|
|
2578
2578
|
onClick: l[0] || (l[0] = (i) => a("action"))
|
|
2579
|
-
}, null, 8, ["label", "icon"])) :
|
|
2579
|
+
}, null, 8, ["label", "icon"])) : $("", !0)
|
|
2580
2580
|
]));
|
|
2581
2581
|
}
|
|
2582
2582
|
});
|
|
@@ -2588,7 +2588,7 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2588
2588
|
Symbol(process.env.NODE_ENV !== "production" ? "navigation failure" : "");
|
|
2589
2589
|
Symbol(process.env.NODE_ENV !== "production" ? "router view location matched" : "");
|
|
2590
2590
|
Symbol(process.env.NODE_ENV !== "production" ? "router view depth" : "");
|
|
2591
|
-
const
|
|
2591
|
+
const Do = Symbol(process.env.NODE_ENV !== "production" ? "router" : "");
|
|
2592
2592
|
Symbol(process.env.NODE_ENV !== "production" ? "route location" : "");
|
|
2593
2593
|
Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
|
|
2594
2594
|
/*!
|
|
@@ -2596,13 +2596,13 @@ Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
|
|
|
2596
2596
|
* (c) 2025 Eduardo San Martin Morote
|
|
2597
2597
|
* @license MIT
|
|
2598
2598
|
*/
|
|
2599
|
-
function
|
|
2600
|
-
return Ie(
|
|
2599
|
+
function xo() {
|
|
2600
|
+
return Ie(Do);
|
|
2601
2601
|
}
|
|
2602
|
-
const
|
|
2602
|
+
const So = { class: "w-detail-header" }, Po = { class: "w-detail-header-left" }, Vo = { class: "w-detail-header-content" }, Eo = { class: "w-detail-header-title" }, Mo = {
|
|
2603
2603
|
key: 0,
|
|
2604
2604
|
class: "w-detail-header-subtitle"
|
|
2605
|
-
},
|
|
2605
|
+
}, Fo = { class: "w-detail-header-actions" }, Ql = /* @__PURE__ */ de({
|
|
2606
2606
|
__name: "WDetailHeader",
|
|
2607
2607
|
props: {
|
|
2608
2608
|
title: {},
|
|
@@ -2614,41 +2614,41 @@ const xo = { class: "w-detail-header" }, So = { class: "w-detail-header-left" },
|
|
|
2614
2614
|
statusMap: {}
|
|
2615
2615
|
},
|
|
2616
2616
|
setup(e) {
|
|
2617
|
-
const t = e, a =
|
|
2617
|
+
const t = e, a = xo();
|
|
2618
2618
|
function o() {
|
|
2619
2619
|
t.backTo ? a.push(typeof t.backTo == "string" ? { name: t.backTo } : t.backTo) : t.backRoute ? a.push({ name: t.backRoute }) : a.back();
|
|
2620
2620
|
}
|
|
2621
|
-
return (l, i) => (s(),
|
|
2622
|
-
h("div",
|
|
2623
|
-
N(v(
|
|
2621
|
+
return (l, i) => (s(), m("div", So, [
|
|
2622
|
+
h("div", Po, [
|
|
2623
|
+
N(v(ee), {
|
|
2624
2624
|
icon: "pi pi-arrow-left",
|
|
2625
2625
|
text: "",
|
|
2626
2626
|
rounded: "",
|
|
2627
2627
|
onClick: o
|
|
2628
2628
|
}),
|
|
2629
|
-
e.icon ? (s(),
|
|
2629
|
+
e.icon ? (s(), m("i", {
|
|
2630
2630
|
key: 0,
|
|
2631
|
-
class:
|
|
2632
|
-
}, null, 2)) :
|
|
2633
|
-
h("div",
|
|
2634
|
-
h("h2",
|
|
2635
|
-
e.subtitle ? (s(),
|
|
2631
|
+
class: re([e.icon, "w-detail-header-icon"])
|
|
2632
|
+
}, null, 2)) : $("", !0),
|
|
2633
|
+
h("div", Vo, [
|
|
2634
|
+
h("h2", Eo, T(e.title), 1),
|
|
2635
|
+
e.subtitle ? (s(), m("p", Mo, T(e.subtitle), 1)) : $("", !0)
|
|
2636
2636
|
]),
|
|
2637
|
-
e.status ? (s(),
|
|
2637
|
+
e.status ? (s(), A(po, {
|
|
2638
2638
|
key: 1,
|
|
2639
2639
|
value: e.status,
|
|
2640
2640
|
map: e.statusMap
|
|
2641
|
-
}, null, 8, ["value", "map"])) :
|
|
2641
|
+
}, null, 8, ["value", "map"])) : $("", !0)
|
|
2642
2642
|
]),
|
|
2643
|
-
h("div",
|
|
2644
|
-
|
|
2643
|
+
h("div", Fo, [
|
|
2644
|
+
O(l.$slots, "actions")
|
|
2645
2645
|
])
|
|
2646
2646
|
]));
|
|
2647
2647
|
}
|
|
2648
|
-
}),
|
|
2648
|
+
}), Ao = { class: "w-info-card" }, Ro = {
|
|
2649
2649
|
key: 0,
|
|
2650
2650
|
class: "w-info-card-title"
|
|
2651
|
-
},
|
|
2651
|
+
}, Io = { class: "w-info-card-grid" }, To = { class: "w-info-card-label" }, Lo = { class: "w-info-card-value" }, _l = /* @__PURE__ */ de({
|
|
2652
2652
|
__name: "WInfoCard",
|
|
2653
2653
|
props: {
|
|
2654
2654
|
title: {},
|
|
@@ -2660,35 +2660,35 @@ const xo = { class: "w-detail-header" }, So = { class: "w-detail-header-left" },
|
|
|
2660
2660
|
const r = i.value;
|
|
2661
2661
|
return r == null || r === "" ? "-" : i.format === "currency" ? t(Number(r)) : i.format === "date" ? a(String(r)) : i.format === "datetime" ? a(String(r), "DD/MM/YYYY HH:mm") : i.format === "number" ? o(Number(r)) : String(r);
|
|
2662
2662
|
}
|
|
2663
|
-
return (i, r) => (s(),
|
|
2664
|
-
e.title ? (s(),
|
|
2665
|
-
h("div",
|
|
2666
|
-
(s(!0),
|
|
2663
|
+
return (i, r) => (s(), m("div", Ao, [
|
|
2664
|
+
e.title ? (s(), m("h3", Ro, T(e.title), 1)) : $("", !0),
|
|
2665
|
+
h("div", Io, [
|
|
2666
|
+
(s(!0), m(le, null, ie(e.fields, (y) => (s(), m("div", {
|
|
2667
2667
|
key: y.label,
|
|
2668
2668
|
class: "w-info-card-field"
|
|
2669
2669
|
}, [
|
|
2670
|
-
h("span",
|
|
2671
|
-
h("span",
|
|
2670
|
+
h("span", To, T(y.label), 1),
|
|
2671
|
+
h("span", Lo, T(l(y)), 1)
|
|
2672
2672
|
]))), 128))
|
|
2673
2673
|
])
|
|
2674
2674
|
]));
|
|
2675
2675
|
}
|
|
2676
|
-
}),
|
|
2676
|
+
}), zo = {
|
|
2677
2677
|
key: 0,
|
|
2678
2678
|
class: "w-kpi-card__loading"
|
|
2679
|
-
},
|
|
2679
|
+
}, No = { class: "w-kpi-card__loading-content" }, Yo = { class: "w-kpi-card__header" }, Oo = {
|
|
2680
2680
|
key: 0,
|
|
2681
2681
|
class: "w-kpi-card__icon"
|
|
2682
|
-
},
|
|
2682
|
+
}, Bo = {
|
|
2683
2683
|
key: 1,
|
|
2684
2684
|
class: "w-kpi-card__trend"
|
|
2685
|
-
},
|
|
2685
|
+
}, Wo = { class: "w-kpi-card__content" }, jo = { class: "w-kpi-card__label" }, Uo = { class: "w-kpi-card__value" }, qo = {
|
|
2686
2686
|
key: 0,
|
|
2687
2687
|
class: "w-kpi-card__hint"
|
|
2688
|
-
},
|
|
2688
|
+
}, Ho = {
|
|
2689
2689
|
key: 0,
|
|
2690
2690
|
class: "w-kpi-card__footer"
|
|
2691
|
-
},
|
|
2691
|
+
}, Ko = /* @__PURE__ */ de({
|
|
2692
2692
|
__name: "WKpiCard",
|
|
2693
2693
|
props: {
|
|
2694
2694
|
label: {},
|
|
@@ -2700,15 +2700,15 @@ const xo = { class: "w-detail-header" }, So = { class: "w-detail-header-left" },
|
|
|
2700
2700
|
loading: { type: Boolean }
|
|
2701
2701
|
},
|
|
2702
2702
|
setup(e) {
|
|
2703
|
-
return (t, a) => (s(),
|
|
2704
|
-
class:
|
|
2703
|
+
return (t, a) => (s(), m("article", {
|
|
2704
|
+
class: re(["w-kpi-card", e.severity ? `w-kpi-card--${e.severity}` : ""])
|
|
2705
2705
|
}, [
|
|
2706
|
-
e.loading ? (s(),
|
|
2706
|
+
e.loading ? (s(), m("div", zo, [
|
|
2707
2707
|
N(v(Ge), {
|
|
2708
2708
|
shape: "circle",
|
|
2709
2709
|
size: "2.75rem"
|
|
2710
2710
|
}),
|
|
2711
|
-
h("div",
|
|
2711
|
+
h("div", No, [
|
|
2712
2712
|
N(v(Ge), {
|
|
2713
2713
|
width: "6rem",
|
|
2714
2714
|
height: "0.75rem"
|
|
@@ -2722,45 +2722,45 @@ const xo = { class: "w-detail-header" }, So = { class: "w-detail-header-left" },
|
|
|
2722
2722
|
height: "0.75rem"
|
|
2723
2723
|
})
|
|
2724
2724
|
])
|
|
2725
|
-
])) : (s(),
|
|
2726
|
-
h("div",
|
|
2727
|
-
e.icon || t.$slots.icon ? (s(),
|
|
2728
|
-
|
|
2729
|
-
e.icon ? (s(),
|
|
2725
|
+
])) : (s(), m(le, { key: 1 }, [
|
|
2726
|
+
h("div", Yo, [
|
|
2727
|
+
e.icon || t.$slots.icon ? (s(), m("div", Oo, [
|
|
2728
|
+
O(t.$slots, "icon", {}, () => [
|
|
2729
|
+
e.icon ? (s(), m("i", {
|
|
2730
2730
|
key: 0,
|
|
2731
|
-
class:
|
|
2732
|
-
}, null, 2)) :
|
|
2731
|
+
class: re(e.icon)
|
|
2732
|
+
}, null, 2)) : $("", !0)
|
|
2733
2733
|
])
|
|
2734
|
-
])) :
|
|
2735
|
-
e.trend || t.$slots.trend ? (s(),
|
|
2736
|
-
|
|
2737
|
-
e.trend ? (s(),
|
|
2734
|
+
])) : $("", !0),
|
|
2735
|
+
e.trend || t.$slots.trend ? (s(), m("div", Bo, [
|
|
2736
|
+
O(t.$slots, "trend", {}, () => [
|
|
2737
|
+
e.trend ? (s(), m("span", {
|
|
2738
2738
|
key: 0,
|
|
2739
|
-
class:
|
|
2740
|
-
}, T(e.trend.value), 3)) :
|
|
2739
|
+
class: re(["w-kpi-card__trend-badge", e.trend.direction ? `w-kpi-card__trend-badge--${e.trend.direction}` : ""])
|
|
2740
|
+
}, T(e.trend.value), 3)) : $("", !0)
|
|
2741
2741
|
])
|
|
2742
|
-
])) :
|
|
2742
|
+
])) : $("", !0)
|
|
2743
2743
|
]),
|
|
2744
|
-
h("div",
|
|
2745
|
-
h("p",
|
|
2746
|
-
h("div",
|
|
2747
|
-
|
|
2748
|
-
|
|
2744
|
+
h("div", Wo, [
|
|
2745
|
+
h("p", jo, T(e.label), 1),
|
|
2746
|
+
h("div", Uo, [
|
|
2747
|
+
O(t.$slots, "value", {}, () => [
|
|
2748
|
+
Pe(T(e.value), 1)
|
|
2749
2749
|
])
|
|
2750
2750
|
]),
|
|
2751
|
-
e.hint || t.$slots.hint ? (s(),
|
|
2752
|
-
|
|
2753
|
-
|
|
2751
|
+
e.hint || t.$slots.hint ? (s(), m("p", qo, [
|
|
2752
|
+
O(t.$slots, "hint", {}, () => [
|
|
2753
|
+
Pe(T(e.hint), 1)
|
|
2754
2754
|
])
|
|
2755
|
-
])) :
|
|
2755
|
+
])) : $("", !0)
|
|
2756
2756
|
]),
|
|
2757
|
-
t.$slots.footer ? (s(),
|
|
2758
|
-
|
|
2759
|
-
])) :
|
|
2757
|
+
t.$slots.footer ? (s(), m("footer", Ho, [
|
|
2758
|
+
O(t.$slots, "footer")
|
|
2759
|
+
])) : $("", !0)
|
|
2760
2760
|
], 64))
|
|
2761
2761
|
], 2));
|
|
2762
2762
|
}
|
|
2763
|
-
}),
|
|
2763
|
+
}), es = /* @__PURE__ */ de({
|
|
2764
2764
|
__name: "WKpiGrid",
|
|
2765
2765
|
props: {
|
|
2766
2766
|
items: { default: () => [] },
|
|
@@ -2772,14 +2772,14 @@ const xo = { class: "w-detail-header" }, So = { class: "w-detail-header-left" },
|
|
|
2772
2772
|
`w-kpi-grid--cols-${t.columns}`,
|
|
2773
2773
|
{ "w-kpi-grid--dense": t.dense }
|
|
2774
2774
|
]);
|
|
2775
|
-
return (o, l) => (s(),
|
|
2776
|
-
class:
|
|
2775
|
+
return (o, l) => (s(), m("div", {
|
|
2776
|
+
class: re(["w-kpi-grid", a.value])
|
|
2777
2777
|
}, [
|
|
2778
|
-
o.$slots.item ? (s(!0),
|
|
2778
|
+
o.$slots.item ? (s(!0), m(le, { key: 0 }, ie(e.items, (i, r) => O(o.$slots, "item", {
|
|
2779
2779
|
key: r,
|
|
2780
2780
|
item: i,
|
|
2781
2781
|
index: r
|
|
2782
|
-
})), 128)) : (s(!0),
|
|
2782
|
+
})), 128)) : (s(!0), m(le, { key: 1 }, ie(e.items, (i, r) => (s(), A(Ko, {
|
|
2783
2783
|
key: r,
|
|
2784
2784
|
label: i.label,
|
|
2785
2785
|
value: i.value,
|
|
@@ -2791,16 +2791,16 @@ const xo = { class: "w-detail-header" }, So = { class: "w-detail-header-left" },
|
|
|
2791
2791
|
}, null, 8, ["label", "value", "icon", "severity", "hint", "trend", "loading"]))), 128))
|
|
2792
2792
|
], 2));
|
|
2793
2793
|
}
|
|
2794
|
-
}),
|
|
2794
|
+
}), Go = { class: "w-section-header__main" }, Jo = {
|
|
2795
2795
|
key: 0,
|
|
2796
2796
|
class: "w-section-header__icon"
|
|
2797
|
-
},
|
|
2797
|
+
}, Zo = { class: "w-section-header__content" }, Xo = { class: "w-section-header__title-row" }, Qo = { class: "w-section-header__title" }, _o = {
|
|
2798
2798
|
key: 0,
|
|
2799
2799
|
class: "w-section-header__subtitle"
|
|
2800
|
-
},
|
|
2800
|
+
}, el = {
|
|
2801
2801
|
key: 0,
|
|
2802
2802
|
class: "w-section-header__actions"
|
|
2803
|
-
},
|
|
2803
|
+
}, ts = /* @__PURE__ */ de({
|
|
2804
2804
|
__name: "WSectionHeader",
|
|
2805
2805
|
props: {
|
|
2806
2806
|
title: {},
|
|
@@ -2809,41 +2809,41 @@ const xo = { class: "w-detail-header" }, So = { class: "w-detail-header-left" },
|
|
|
2809
2809
|
compact: { type: Boolean }
|
|
2810
2810
|
},
|
|
2811
2811
|
setup(e) {
|
|
2812
|
-
return (t, a) => (s(),
|
|
2813
|
-
class:
|
|
2812
|
+
return (t, a) => (s(), m("div", {
|
|
2813
|
+
class: re(["w-section-header", { "w-section-header--compact": e.compact }])
|
|
2814
2814
|
}, [
|
|
2815
|
-
h("div",
|
|
2816
|
-
e.icon || t.$slots.icon ? (s(),
|
|
2817
|
-
|
|
2818
|
-
e.icon ? (s(),
|
|
2815
|
+
h("div", Go, [
|
|
2816
|
+
e.icon || t.$slots.icon ? (s(), m("div", Jo, [
|
|
2817
|
+
O(t.$slots, "icon", {}, () => [
|
|
2818
|
+
e.icon ? (s(), m("i", {
|
|
2819
2819
|
key: 0,
|
|
2820
|
-
class:
|
|
2821
|
-
}, null, 2)) :
|
|
2820
|
+
class: re(e.icon)
|
|
2821
|
+
}, null, 2)) : $("", !0)
|
|
2822
2822
|
])
|
|
2823
|
-
])) :
|
|
2824
|
-
h("div",
|
|
2825
|
-
h("div",
|
|
2826
|
-
h("h3",
|
|
2827
|
-
|
|
2823
|
+
])) : $("", !0),
|
|
2824
|
+
h("div", Zo, [
|
|
2825
|
+
h("div", Xo, [
|
|
2826
|
+
h("h3", Qo, T(e.title), 1),
|
|
2827
|
+
O(t.$slots, "meta")
|
|
2828
2828
|
]),
|
|
2829
|
-
e.subtitle ? (s(),
|
|
2829
|
+
e.subtitle ? (s(), m("p", _o, T(e.subtitle), 1)) : $("", !0)
|
|
2830
2830
|
])
|
|
2831
2831
|
]),
|
|
2832
|
-
t.$slots.actions ? (s(),
|
|
2833
|
-
|
|
2834
|
-
])) :
|
|
2832
|
+
t.$slots.actions ? (s(), m("div", el, [
|
|
2833
|
+
O(t.$slots, "actions")
|
|
2834
|
+
])) : $("", !0)
|
|
2835
2835
|
], 2));
|
|
2836
2836
|
}
|
|
2837
|
-
}),
|
|
2837
|
+
}), tl = {
|
|
2838
2838
|
key: 0,
|
|
2839
2839
|
class: "w-form-section__header"
|
|
2840
|
-
},
|
|
2840
|
+
}, al = { class: "w-form-section__content" }, nl = { class: "w-form-section__title" }, ol = {
|
|
2841
2841
|
key: 0,
|
|
2842
2842
|
class: "w-form-section__description"
|
|
2843
|
-
},
|
|
2843
|
+
}, ll = {
|
|
2844
2844
|
key: 0,
|
|
2845
2845
|
class: "w-form-section__actions"
|
|
2846
|
-
},
|
|
2846
|
+
}, sl = { class: "w-form-section__body" }, as = /* @__PURE__ */ de({
|
|
2847
2847
|
__name: "WFormSection",
|
|
2848
2848
|
props: {
|
|
2849
2849
|
title: {},
|
|
@@ -2851,62 +2851,62 @@ const xo = { class: "w-detail-header" }, So = { class: "w-detail-header-left" },
|
|
|
2851
2851
|
variant: {}
|
|
2852
2852
|
},
|
|
2853
2853
|
setup(e) {
|
|
2854
|
-
return (t, a) => (s(),
|
|
2855
|
-
class:
|
|
2854
|
+
return (t, a) => (s(), m("section", {
|
|
2855
|
+
class: re(["w-form-section", e.variant ? `w-form-section--${e.variant}` : ""])
|
|
2856
2856
|
}, [
|
|
2857
|
-
e.title || e.description || t.$slots.actions ? (s(),
|
|
2858
|
-
h("div",
|
|
2859
|
-
h("h3",
|
|
2860
|
-
e.description ? (s(),
|
|
2857
|
+
e.title || e.description || t.$slots.actions ? (s(), m("div", tl, [
|
|
2858
|
+
h("div", al, [
|
|
2859
|
+
h("h3", nl, T(e.title), 1),
|
|
2860
|
+
e.description ? (s(), m("p", ol, T(e.description), 1)) : $("", !0)
|
|
2861
2861
|
]),
|
|
2862
|
-
t.$slots.actions ? (s(),
|
|
2863
|
-
|
|
2864
|
-
])) :
|
|
2865
|
-
])) :
|
|
2866
|
-
h("div",
|
|
2867
|
-
|
|
2862
|
+
t.$slots.actions ? (s(), m("div", ll, [
|
|
2863
|
+
O(t.$slots, "actions")
|
|
2864
|
+
])) : $("", !0)
|
|
2865
|
+
])) : $("", !0),
|
|
2866
|
+
h("div", sl, [
|
|
2867
|
+
O(t.$slots, "default")
|
|
2868
2868
|
])
|
|
2869
2869
|
], 2));
|
|
2870
2870
|
}
|
|
2871
|
-
}),
|
|
2871
|
+
}), il = {
|
|
2872
2872
|
key: 0,
|
|
2873
2873
|
class: "w-action-bar__primary"
|
|
2874
|
-
},
|
|
2874
|
+
}, rl = {
|
|
2875
2875
|
key: 1,
|
|
2876
2876
|
class: "w-action-bar__filters"
|
|
2877
|
-
},
|
|
2877
|
+
}, ul = {
|
|
2878
2878
|
key: 2,
|
|
2879
2879
|
class: "w-action-bar__secondary"
|
|
2880
|
-
},
|
|
2880
|
+
}, ns = /* @__PURE__ */ de({
|
|
2881
2881
|
__name: "WActionBar",
|
|
2882
2882
|
props: {
|
|
2883
2883
|
align: { default: "between" },
|
|
2884
2884
|
stackOnMobile: { type: Boolean, default: !0 }
|
|
2885
2885
|
},
|
|
2886
2886
|
setup(e) {
|
|
2887
|
-
return (t, a) => (s(),
|
|
2888
|
-
class:
|
|
2887
|
+
return (t, a) => (s(), m("div", {
|
|
2888
|
+
class: re(["w-action-bar", [
|
|
2889
2889
|
`w-action-bar--${e.align}`,
|
|
2890
2890
|
{ "w-action-bar--stack": e.stackOnMobile }
|
|
2891
2891
|
]])
|
|
2892
2892
|
}, [
|
|
2893
|
-
t.$slots.primary || t.$slots.default ? (s(),
|
|
2894
|
-
|
|
2895
|
-
|
|
2893
|
+
t.$slots.primary || t.$slots.default ? (s(), m("div", il, [
|
|
2894
|
+
O(t.$slots, "primary", {}, () => [
|
|
2895
|
+
O(t.$slots, "default")
|
|
2896
2896
|
])
|
|
2897
|
-
])) :
|
|
2898
|
-
t.$slots.filters ? (s(),
|
|
2899
|
-
|
|
2900
|
-
])) :
|
|
2901
|
-
t.$slots.secondary ? (s(),
|
|
2902
|
-
|
|
2903
|
-
])) :
|
|
2897
|
+
])) : $("", !0),
|
|
2898
|
+
t.$slots.filters ? (s(), m("div", rl, [
|
|
2899
|
+
O(t.$slots, "filters")
|
|
2900
|
+
])) : $("", !0),
|
|
2901
|
+
t.$slots.secondary ? (s(), m("div", ul, [
|
|
2902
|
+
O(t.$slots, "secondary")
|
|
2903
|
+
])) : $("", !0)
|
|
2904
2904
|
], 2));
|
|
2905
2905
|
}
|
|
2906
|
-
}),
|
|
2906
|
+
}), dl = { class: "w-progress-flow__marker" }, cl = { class: "w-progress-flow__content" }, fl = { class: "w-progress-flow__label" }, ml = {
|
|
2907
2907
|
key: 0,
|
|
2908
2908
|
class: "w-progress-flow__description"
|
|
2909
|
-
},
|
|
2909
|
+
}, os = /* @__PURE__ */ de({
|
|
2910
2910
|
__name: "WProgressFlow",
|
|
2911
2911
|
props: {
|
|
2912
2912
|
steps: {},
|
|
@@ -2920,31 +2920,31 @@ const xo = { class: "w-detail-header" }, So = { class: "w-detail-header-left" },
|
|
|
2920
2920
|
function o(l) {
|
|
2921
2921
|
return l < a.value ? "done" : l === a.value ? "current" : "pending";
|
|
2922
2922
|
}
|
|
2923
|
-
return (l, i) => (s(),
|
|
2924
|
-
class:
|
|
2923
|
+
return (l, i) => (s(), m("div", {
|
|
2924
|
+
class: re(["w-progress-flow", `w-progress-flow--${e.orientation}`])
|
|
2925
2925
|
}, [
|
|
2926
|
-
(s(!0),
|
|
2926
|
+
(s(!0), m(le, null, ie(e.steps, (r, y) => (s(), m("div", {
|
|
2927
2927
|
key: r.key,
|
|
2928
|
-
class:
|
|
2928
|
+
class: re(["w-progress-flow__step", `w-progress-flow__step--${o(y)}`])
|
|
2929
2929
|
}, [
|
|
2930
|
-
|
|
2930
|
+
O(l.$slots, "step", {
|
|
2931
2931
|
step: r,
|
|
2932
2932
|
index: y,
|
|
2933
2933
|
state: o(y)
|
|
2934
2934
|
}, () => [
|
|
2935
|
-
h("div",
|
|
2935
|
+
h("div", dl, [
|
|
2936
2936
|
h("span", null, T(y + 1), 1)
|
|
2937
2937
|
]),
|
|
2938
|
-
h("div",
|
|
2939
|
-
h("p",
|
|
2940
|
-
r.description ? (s(),
|
|
2938
|
+
h("div", cl, [
|
|
2939
|
+
h("p", fl, T(r.label), 1),
|
|
2940
|
+
r.description ? (s(), m("p", ml, T(r.description), 1)) : $("", !0)
|
|
2941
2941
|
])
|
|
2942
2942
|
])
|
|
2943
2943
|
], 2))), 128))
|
|
2944
2944
|
], 2));
|
|
2945
2945
|
}
|
|
2946
2946
|
});
|
|
2947
|
-
function
|
|
2947
|
+
function pl(e, t, a) {
|
|
2948
2948
|
const o = e;
|
|
2949
2949
|
return Array.isArray(o.results) ? {
|
|
2950
2950
|
data: o.results,
|
|
@@ -2966,11 +2966,11 @@ function ml(e, t, a) {
|
|
|
2966
2966
|
extras: {}
|
|
2967
2967
|
};
|
|
2968
2968
|
}
|
|
2969
|
-
function
|
|
2969
|
+
function vl(e) {
|
|
2970
2970
|
return {
|
|
2971
2971
|
async list(t, a = {}) {
|
|
2972
2972
|
const o = await e.get(t, { params: a });
|
|
2973
|
-
return
|
|
2973
|
+
return pl(
|
|
2974
2974
|
o.data,
|
|
2975
2975
|
Number(a.page ?? 1),
|
|
2976
2976
|
Number(a.page_size ?? 20)
|
|
@@ -2994,13 +2994,13 @@ function pl(e) {
|
|
|
2994
2994
|
}
|
|
2995
2995
|
};
|
|
2996
2996
|
}
|
|
2997
|
-
const
|
|
2997
|
+
const ls = {
|
|
2998
2998
|
install(e, t) {
|
|
2999
2999
|
if (!(t != null && t.axios) && !(t != null && t.dataProvider))
|
|
3000
3000
|
throw new Error(
|
|
3001
3001
|
'[wPrimeVueComponents] Informe "axios" ou "dataProvider" ao registrar o WPrimeVuePlugin.'
|
|
3002
3002
|
);
|
|
3003
|
-
const a = t.dataProvider ??
|
|
3003
|
+
const a = t.dataProvider ?? vl(t.axios), o = {
|
|
3004
3004
|
axios: t.axios,
|
|
3005
3005
|
dataProvider: a,
|
|
3006
3006
|
defaultPageSize: t.defaultPageSize ?? 20,
|
|
@@ -3009,9 +3009,9 @@ const os = {
|
|
|
3009
3009
|
locale: t.locale ?? "pt-BR",
|
|
3010
3010
|
currency: t.currency ?? "BRL"
|
|
3011
3011
|
};
|
|
3012
|
-
t.axios && e.provide(
|
|
3012
|
+
t.axios && e.provide(la, t.axios), e.provide(_e, a), e.provide(et, o), t.registerComponents !== !1 && (e.component("WCrudView", mo), e.component("WCrudFormDialog", ut), e.component("WCrudColumnRenderer", Qe), e.component("WAutoCompleteFK", Lt), e.component("WMoneyInput", zt), e.component("WTransferList", Nt));
|
|
3013
3013
|
}
|
|
3014
|
-
},
|
|
3014
|
+
}, gl = {
|
|
3015
3015
|
createTitle: "Novo Registro",
|
|
3016
3016
|
editTitle: "Editar Registro",
|
|
3017
3017
|
createButton: "Novo",
|
|
@@ -3026,13 +3026,13 @@ const os = {
|
|
|
3026
3026
|
successUpdate: "Registro atualizado com sucesso",
|
|
3027
3027
|
successDelete: "Registro excluído com sucesso"
|
|
3028
3028
|
};
|
|
3029
|
-
function
|
|
3029
|
+
function hl(e, t) {
|
|
3030
3030
|
const a = {};
|
|
3031
3031
|
for (const o of Object.keys(t))
|
|
3032
3032
|
JSON.stringify(e[o]) !== JSON.stringify(t[o]) && (a[o] = t[o]);
|
|
3033
3033
|
return a;
|
|
3034
3034
|
}
|
|
3035
|
-
function
|
|
3035
|
+
function ss(e) {
|
|
3036
3036
|
const {
|
|
3037
3037
|
endpoint: t,
|
|
3038
3038
|
columns: a,
|
|
@@ -3040,311 +3040,316 @@ function ls(e) {
|
|
|
3040
3040
|
pk: l = "id",
|
|
3041
3041
|
searchDebounce: i = 300,
|
|
3042
3042
|
partialUpdate: r = !0,
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3043
|
+
refetchOnSave: y = !0,
|
|
3044
|
+
canCreate: c = !0,
|
|
3045
|
+
canEdit: w = !0,
|
|
3046
|
+
canDelete: F = !0,
|
|
3047
|
+
rowActions: V = void 0,
|
|
3048
|
+
filterParams: W = void 0,
|
|
3049
|
+
createDefaults: L = void 0,
|
|
3050
|
+
transformPayload: J = void 0,
|
|
3050
3051
|
onAfterSave: Z = void 0,
|
|
3051
|
-
onAfterDelete:
|
|
3052
|
-
} = e,
|
|
3053
|
-
if (!
|
|
3052
|
+
onAfterDelete: g = void 0
|
|
3053
|
+
} = e, b = Ie(_e);
|
|
3054
|
+
if (!b)
|
|
3054
3055
|
throw new Error(
|
|
3055
3056
|
"[wPrimeVueComponents] dataProvider não encontrado. Registre o WPrimeVuePlugin antes de usar useCrudManager."
|
|
3056
3057
|
);
|
|
3057
|
-
const
|
|
3058
|
-
let
|
|
3059
|
-
const
|
|
3058
|
+
const k = b, x = Ie(et), j = e.pageSize ?? (x == null ? void 0 : x.defaultPageSize) ?? 20, U = { ...gl, ...e.labels }, Y = It(), { confirmDelete: K } = Tt(), B = q([]), X = q({}), oe = q(!1), ae = q(!1), _ = q(""), f = q(!1), P = q(!1), u = q(null), n = ge({});
|
|
3059
|
+
let p = null;
|
|
3060
|
+
const d = ge({
|
|
3060
3061
|
page: 1,
|
|
3061
|
-
pageSize:
|
|
3062
|
+
pageSize: j,
|
|
3062
3063
|
rows: 0,
|
|
3063
3064
|
totalPages: 0
|
|
3064
|
-
}),
|
|
3065
|
+
}), E = ge({
|
|
3065
3066
|
field: null,
|
|
3066
3067
|
order: 0
|
|
3067
3068
|
});
|
|
3068
|
-
function
|
|
3069
|
+
function R() {
|
|
3069
3070
|
const D = {};
|
|
3070
|
-
for (const
|
|
3071
|
-
D[
|
|
3071
|
+
for (const M of o)
|
|
3072
|
+
D[M.field] = M.defaultValue !== void 0 ? typeof M.defaultValue == "function" ? M.defaultValue() : M.defaultValue : null;
|
|
3072
3073
|
return D;
|
|
3073
3074
|
}
|
|
3074
|
-
const
|
|
3075
|
-
for (const D of Object.keys(
|
|
3076
|
-
|
|
3077
|
-
const
|
|
3078
|
-
() =>
|
|
3079
|
-
),
|
|
3080
|
-
() =>
|
|
3081
|
-
),
|
|
3082
|
-
let
|
|
3083
|
-
async function
|
|
3084
|
-
|
|
3075
|
+
const G = R();
|
|
3076
|
+
for (const D of Object.keys(G))
|
|
3077
|
+
n[D] = G[D];
|
|
3078
|
+
const se = H(
|
|
3079
|
+
() => u.value !== null && !P.value
|
|
3080
|
+
), pe = H(() => P.value), Ne = H(
|
|
3081
|
+
() => P.value ? U.viewTitle ?? "Visualizar Registro" : se.value ? U.editTitle : U.createTitle
|
|
3082
|
+
), Ye = H(() => d.page <= 1), we = H(() => d.page >= d.totalPages);
|
|
3083
|
+
let ke = null;
|
|
3084
|
+
async function ue(D = {}) {
|
|
3085
|
+
oe.value = !0;
|
|
3085
3086
|
try {
|
|
3086
|
-
const
|
|
3087
|
-
page:
|
|
3088
|
-
page_size:
|
|
3087
|
+
const M = {
|
|
3088
|
+
page: d.page,
|
|
3089
|
+
page_size: d.pageSize,
|
|
3089
3090
|
...D
|
|
3090
3091
|
};
|
|
3091
|
-
_.value && (
|
|
3092
|
-
const
|
|
3093
|
-
|
|
3092
|
+
_.value && (M.search = _.value), E.field && E.order !== 0 && (M.ordering = E.order === -1 ? `-${E.field}` : E.field), W && Object.assign(M, W());
|
|
3093
|
+
const I = await k.list(t, M);
|
|
3094
|
+
B.value = I.data, d.rows = I.rows, X.value = I.extras ?? {}, I.page && (d.page = I.page), I.page_size && (d.pageSize = I.page_size), d.totalPages = Math.ceil(d.rows / d.pageSize) || 0;
|
|
3094
3095
|
} finally {
|
|
3095
|
-
|
|
3096
|
+
oe.value = !1;
|
|
3096
3097
|
}
|
|
3097
3098
|
}
|
|
3098
|
-
async function ye() {
|
|
3099
|
-
await me();
|
|
3100
|
-
}
|
|
3101
3099
|
async function ve() {
|
|
3102
|
-
await
|
|
3100
|
+
await ue();
|
|
3101
|
+
}
|
|
3102
|
+
async function Ce() {
|
|
3103
|
+
await ue();
|
|
3103
3104
|
}
|
|
3104
|
-
async function
|
|
3105
|
-
const
|
|
3106
|
-
_.value && (
|
|
3107
|
-
const
|
|
3105
|
+
async function Ee(D = 200) {
|
|
3106
|
+
const M = {};
|
|
3107
|
+
_.value && (M.search = _.value), E.field && E.order !== 0 && (M.ordering = E.order === -1 ? `-${E.field}` : E.field), W && Object.assign(M, W());
|
|
3108
|
+
const I = [];
|
|
3108
3109
|
let Q = 1;
|
|
3109
3110
|
const Le = 1e4;
|
|
3110
3111
|
for (; Q <= Le; ) {
|
|
3111
|
-
const
|
|
3112
|
-
...
|
|
3112
|
+
const be = await k.list(t, {
|
|
3113
|
+
...M,
|
|
3113
3114
|
page: Q,
|
|
3114
3115
|
page_size: D
|
|
3115
3116
|
});
|
|
3116
|
-
|
|
3117
|
-
const
|
|
3118
|
-
if (
|
|
3117
|
+
I.push(...be.data);
|
|
3118
|
+
const he = be.rows ?? I.length;
|
|
3119
|
+
if (be.data.length === 0 || I.length >= he) break;
|
|
3119
3120
|
Q++;
|
|
3120
3121
|
}
|
|
3121
|
-
return
|
|
3122
|
+
return I;
|
|
3122
3123
|
}
|
|
3123
|
-
function
|
|
3124
|
-
_.value = D,
|
|
3125
|
-
|
|
3124
|
+
function De(D) {
|
|
3125
|
+
_.value = D, ke && clearTimeout(ke), ke = setTimeout(() => {
|
|
3126
|
+
d.page = 1, ue();
|
|
3126
3127
|
}, i);
|
|
3127
3128
|
}
|
|
3128
|
-
function
|
|
3129
|
-
const
|
|
3130
|
-
|
|
3129
|
+
function Me(D) {
|
|
3130
|
+
const M = D.target;
|
|
3131
|
+
De(M.value);
|
|
3131
3132
|
}
|
|
3132
|
-
function
|
|
3133
|
-
|
|
3133
|
+
function ye(D) {
|
|
3134
|
+
d.page = D, ue();
|
|
3134
3135
|
}
|
|
3135
|
-
function
|
|
3136
|
-
|
|
3136
|
+
function xe() {
|
|
3137
|
+
ye(1);
|
|
3137
3138
|
}
|
|
3138
|
-
function
|
|
3139
|
-
|
|
3139
|
+
function Fe() {
|
|
3140
|
+
ye(d.totalPages);
|
|
3140
3141
|
}
|
|
3141
3142
|
function Ae(D) {
|
|
3142
|
-
|
|
3143
|
+
d.page = D.page + 1, d.pageSize = D.rows, ue();
|
|
3143
3144
|
}
|
|
3144
3145
|
function Re(D) {
|
|
3145
|
-
|
|
3146
|
+
E.field = D.sortField ?? null, E.order = D.sortOrder ?? 0, d.page = 1, ue();
|
|
3146
3147
|
}
|
|
3147
|
-
function
|
|
3148
|
-
const D =
|
|
3149
|
-
for (const
|
|
3150
|
-
|
|
3148
|
+
function C() {
|
|
3149
|
+
const D = R();
|
|
3150
|
+
for (const M of Object.keys(D))
|
|
3151
|
+
n[M] = D[M];
|
|
3151
3152
|
}
|
|
3152
|
-
function
|
|
3153
|
-
|
|
3153
|
+
function S(D, M) {
|
|
3154
|
+
n[D] = M;
|
|
3154
3155
|
}
|
|
3155
|
-
function
|
|
3156
|
-
if (
|
|
3157
|
-
const D =
|
|
3158
|
-
for (const [
|
|
3159
|
-
|
|
3156
|
+
function te() {
|
|
3157
|
+
if (P.value = !1, u.value = null, p = null, C(), L) {
|
|
3158
|
+
const D = L();
|
|
3159
|
+
for (const [M, I] of Object.entries(D))
|
|
3160
|
+
n[M] = I;
|
|
3160
3161
|
}
|
|
3161
|
-
|
|
3162
|
+
f.value = !0;
|
|
3162
3163
|
}
|
|
3163
|
-
function
|
|
3164
|
-
const
|
|
3165
|
-
for (const
|
|
3166
|
-
let Q = D[
|
|
3167
|
-
Q && (
|
|
3164
|
+
function z(D) {
|
|
3165
|
+
const M = {};
|
|
3166
|
+
for (const I of o) {
|
|
3167
|
+
let Q = D[I.field] !== void 0 ? D[I.field] : null;
|
|
3168
|
+
Q && (I.type === "date" || I.type === "datetime") && typeof Q == "string" && (Q = it(Q)), n[I.field] = Q, M[I.field] = Q;
|
|
3168
3169
|
}
|
|
3169
|
-
|
|
3170
|
+
p = M;
|
|
3170
3171
|
}
|
|
3171
|
-
function
|
|
3172
|
-
|
|
3173
|
-
}
|
|
3174
|
-
function ue(D) {
|
|
3175
|
-
f.value = !0, x.value = D, te(D), ee.value = !0;
|
|
3172
|
+
function ce(D) {
|
|
3173
|
+
P.value = !1, u.value = D, z(D), f.value = !0;
|
|
3176
3174
|
}
|
|
3177
3175
|
function Ot(D) {
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3176
|
+
P.value = !0, u.value = D, z(D), f.value = !0;
|
|
3177
|
+
}
|
|
3178
|
+
function Bt(D) {
|
|
3179
|
+
P.value = !1, u.value = null, p = null, C();
|
|
3180
|
+
for (const M of o) {
|
|
3181
|
+
if (M.field === l) continue;
|
|
3182
|
+
let I = D[M.field] !== void 0 ? D[M.field] : n[M.field];
|
|
3183
|
+
I && (M.type === "date" || M.type === "datetime") && typeof I == "string" && (I = it(I)), n[M.field] = I;
|
|
3183
3184
|
}
|
|
3184
|
-
if (
|
|
3185
|
-
const
|
|
3186
|
-
for (const [
|
|
3187
|
-
|
|
3185
|
+
if (L) {
|
|
3186
|
+
const M = L();
|
|
3187
|
+
for (const [I, Q] of Object.entries(M))
|
|
3188
|
+
n[I] = Q;
|
|
3188
3189
|
}
|
|
3189
|
-
|
|
3190
|
+
f.value = !0;
|
|
3190
3191
|
}
|
|
3191
3192
|
function dt(D) {
|
|
3192
|
-
const
|
|
3193
|
-
for (const
|
|
3194
|
-
const Q =
|
|
3195
|
-
if (
|
|
3196
|
-
const Le =
|
|
3197
|
-
|
|
3193
|
+
const M = { ...D };
|
|
3194
|
+
for (const I of o) {
|
|
3195
|
+
const Q = M[I.field];
|
|
3196
|
+
if (I.type === "date" && Q instanceof Date ? M[I.field] = St(Q) : I.type === "datetime" && Q instanceof Date && (M[I.field] = Pt(Q)), I.type === "fk" && Q !== null && typeof Q == "object") {
|
|
3197
|
+
const Le = I.optionValue || "id";
|
|
3198
|
+
M[I.field] = Q[Le] ?? Q;
|
|
3198
3199
|
}
|
|
3199
|
-
(
|
|
3200
|
+
(I.type === "mask" || I.type === "cpf_cnpj") && typeof Q == "string" && (M[I.field] = Ve(Q));
|
|
3200
3201
|
}
|
|
3201
|
-
return
|
|
3202
|
+
return M;
|
|
3202
3203
|
}
|
|
3203
|
-
async function
|
|
3204
|
+
async function Wt() {
|
|
3204
3205
|
for (const D of o) {
|
|
3205
3206
|
if (D.validate) {
|
|
3206
|
-
const
|
|
3207
|
-
if (
|
|
3208
|
-
return
|
|
3207
|
+
const M = D.validate(n[D.field]);
|
|
3208
|
+
if (M)
|
|
3209
|
+
return Y.error(M), null;
|
|
3209
3210
|
}
|
|
3210
3211
|
if (D.required) {
|
|
3211
|
-
const
|
|
3212
|
-
if (
|
|
3213
|
-
return
|
|
3212
|
+
const M = n[D.field];
|
|
3213
|
+
if (M == null || M === "")
|
|
3214
|
+
return Y.error(`${D.label} é obrigatório`), null;
|
|
3214
3215
|
}
|
|
3215
3216
|
}
|
|
3216
|
-
|
|
3217
|
+
ae.value = !0;
|
|
3217
3218
|
try {
|
|
3218
|
-
let D = dt(
|
|
3219
|
-
if (!
|
|
3220
|
-
const
|
|
3221
|
-
if (D =
|
|
3222
|
-
|
|
3223
|
-
const
|
|
3224
|
-
return
|
|
3219
|
+
let D = dt(n);
|
|
3220
|
+
if (!se.value && L && Object.assign(D, L()), se.value && r && p) {
|
|
3221
|
+
const he = dt(p);
|
|
3222
|
+
if (D = hl(he, D), Object.keys(D).length === 0 && !J) {
|
|
3223
|
+
f.value = !1;
|
|
3224
|
+
const Se = u.value;
|
|
3225
|
+
return u.value = null, p = null, Se;
|
|
3225
3226
|
}
|
|
3226
3227
|
}
|
|
3227
|
-
|
|
3228
|
-
const
|
|
3229
|
-
(
|
|
3228
|
+
J && (D = J(D, se.value));
|
|
3229
|
+
const M = o.some(
|
|
3230
|
+
(he) => he.type === "image" && D[he.field] instanceof File
|
|
3230
3231
|
);
|
|
3231
|
-
let
|
|
3232
|
-
if (
|
|
3233
|
-
const
|
|
3234
|
-
o.filter((
|
|
3235
|
-
),
|
|
3236
|
-
for (const [
|
|
3232
|
+
let I = D, Q;
|
|
3233
|
+
if (M) {
|
|
3234
|
+
const he = new Set(
|
|
3235
|
+
o.filter(($e) => $e.type === "image").map(($e) => $e.field)
|
|
3236
|
+
), Se = new FormData();
|
|
3237
|
+
for (const [$e, Oe] of Object.entries(D))
|
|
3237
3238
|
if (Oe != null)
|
|
3238
3239
|
if (Oe instanceof File)
|
|
3239
|
-
|
|
3240
|
+
Se.append($e, Oe);
|
|
3240
3241
|
else {
|
|
3241
|
-
if (
|
|
3242
|
+
if (he.has($e))
|
|
3242
3243
|
continue;
|
|
3243
|
-
|
|
3244
|
+
Se.append($e, String(Oe));
|
|
3244
3245
|
}
|
|
3245
|
-
|
|
3246
|
+
I = Se, Q = { "Content-Type": "multipart/form-data" };
|
|
3246
3247
|
}
|
|
3247
3248
|
const Le = Q ? { headers: Q } : void 0;
|
|
3248
|
-
let
|
|
3249
|
-
if (
|
|
3250
|
-
const
|
|
3251
|
-
|
|
3249
|
+
let be;
|
|
3250
|
+
if (se.value && u.value) {
|
|
3251
|
+
const he = u.value[l];
|
|
3252
|
+
if (be = await k.update(
|
|
3252
3253
|
t,
|
|
3253
|
-
|
|
3254
|
-
|
|
3254
|
+
he,
|
|
3255
|
+
I,
|
|
3255
3256
|
Le
|
|
3256
|
-
)
|
|
3257
|
-
|
|
3258
|
-
|
|
3257
|
+
), !y) {
|
|
3258
|
+
const Se = B.value.findIndex(
|
|
3259
|
+
($e) => $e[l] === he
|
|
3260
|
+
);
|
|
3261
|
+
Se !== -1 && (B.value[Se] = be.data);
|
|
3262
|
+
}
|
|
3263
|
+
Y.success(U.successUpdate);
|
|
3259
3264
|
} else
|
|
3260
|
-
|
|
3261
|
-
return
|
|
3265
|
+
be = await k.create(t, I, Le), y || (B.value.unshift(be.data), d.rows++), Y.success(U.successCreate);
|
|
3266
|
+
return f.value = !1, u.value = null, p = null, y && await ue(), Z && Z(be.data, se.value), be.data;
|
|
3262
3267
|
} catch (D) {
|
|
3263
|
-
return
|
|
3268
|
+
return Y.error(Ke(D, "Erro ao salvar registro")), null;
|
|
3264
3269
|
} finally {
|
|
3265
|
-
|
|
3270
|
+
ae.value = !1;
|
|
3266
3271
|
}
|
|
3267
3272
|
}
|
|
3268
|
-
function
|
|
3273
|
+
function jt(D) {
|
|
3269
3274
|
K(async () => {
|
|
3270
3275
|
try {
|
|
3271
|
-
const
|
|
3272
|
-
await
|
|
3273
|
-
const
|
|
3274
|
-
|
|
3275
|
-
} catch (
|
|
3276
|
-
|
|
3276
|
+
const M = D[l];
|
|
3277
|
+
await k.delete(t, M);
|
|
3278
|
+
const I = B.value.findIndex((Q) => Q[l] === M);
|
|
3279
|
+
I !== -1 && (B.value.splice(I, 1), d.rows--), Y.success(U.successDelete), g && g(D);
|
|
3280
|
+
} catch (M) {
|
|
3281
|
+
Y.error(Ke(M, "Erro ao excluir registro"));
|
|
3277
3282
|
}
|
|
3278
|
-
},
|
|
3283
|
+
}, U.deleteConfirmMessage);
|
|
3279
3284
|
}
|
|
3280
3285
|
return {
|
|
3281
|
-
items:
|
|
3282
|
-
extras:
|
|
3283
|
-
loading:
|
|
3284
|
-
saving:
|
|
3286
|
+
items: B,
|
|
3287
|
+
extras: X,
|
|
3288
|
+
loading: oe,
|
|
3289
|
+
saving: ae,
|
|
3285
3290
|
search: _,
|
|
3286
|
-
dialogVisible:
|
|
3287
|
-
editingItem:
|
|
3288
|
-
formData:
|
|
3289
|
-
pagination:
|
|
3290
|
-
sort:
|
|
3291
|
-
isEditing:
|
|
3292
|
-
isViewing:
|
|
3293
|
-
viewMode:
|
|
3294
|
-
dialogTitle:
|
|
3295
|
-
isFirstPage:
|
|
3296
|
-
isLastPage:
|
|
3297
|
-
init:
|
|
3298
|
-
fetchItems:
|
|
3299
|
-
fetchAll:
|
|
3300
|
-
refresh:
|
|
3301
|
-
setSearch:
|
|
3302
|
-
onSearch:
|
|
3291
|
+
dialogVisible: f,
|
|
3292
|
+
editingItem: u,
|
|
3293
|
+
formData: n,
|
|
3294
|
+
pagination: d,
|
|
3295
|
+
sort: E,
|
|
3296
|
+
isEditing: se,
|
|
3297
|
+
isViewing: pe,
|
|
3298
|
+
viewMode: P,
|
|
3299
|
+
dialogTitle: Ne,
|
|
3300
|
+
isFirstPage: Ye,
|
|
3301
|
+
isLastPage: we,
|
|
3302
|
+
init: ve,
|
|
3303
|
+
fetchItems: ue,
|
|
3304
|
+
fetchAll: Ee,
|
|
3305
|
+
refresh: Ce,
|
|
3306
|
+
setSearch: De,
|
|
3307
|
+
onSearch: Me,
|
|
3303
3308
|
onPage: Ae,
|
|
3304
3309
|
onSort: Re,
|
|
3305
|
-
openCreateDialog:
|
|
3306
|
-
openEditDialog:
|
|
3307
|
-
openViewDialog:
|
|
3308
|
-
openDuplicateDialog:
|
|
3309
|
-
save:
|
|
3310
|
-
confirmDelete:
|
|
3311
|
-
setFormField:
|
|
3312
|
-
resetForm:
|
|
3313
|
-
goToPage:
|
|
3314
|
-
firstPage:
|
|
3315
|
-
lastPage:
|
|
3310
|
+
openCreateDialog: te,
|
|
3311
|
+
openEditDialog: ce,
|
|
3312
|
+
openViewDialog: Ot,
|
|
3313
|
+
openDuplicateDialog: Bt,
|
|
3314
|
+
save: Wt,
|
|
3315
|
+
confirmDelete: jt,
|
|
3316
|
+
setFormField: S,
|
|
3317
|
+
resetForm: C,
|
|
3318
|
+
goToPage: ye,
|
|
3319
|
+
firstPage: xe,
|
|
3320
|
+
lastPage: Fe,
|
|
3316
3321
|
config: e
|
|
3317
3322
|
};
|
|
3318
3323
|
}
|
|
3319
|
-
function
|
|
3324
|
+
function is(e) {
|
|
3320
3325
|
const { endpoint: t, searchDebounce: a = 300, immediate: o = !1 } = e, l = Ie(_e);
|
|
3321
3326
|
if (!l)
|
|
3322
3327
|
throw new Error(
|
|
3323
3328
|
"[wPrimeVueComponents] dataProvider não encontrado. Registre o WPrimeVuePlugin antes de usar useApi."
|
|
3324
3329
|
);
|
|
3325
|
-
const i = l, r = Ie(et), y = e.pageSize ?? (r == null ? void 0 : r.defaultPageSize) ?? 20,
|
|
3330
|
+
const i = l, r = Ie(et), y = e.pageSize ?? (r == null ? void 0 : r.defaultPageSize) ?? 20, c = q([]), w = q(!1), F = q(""), V = q({}), W = ge({}), L = ge({
|
|
3326
3331
|
page: 1,
|
|
3327
3332
|
pageSize: y,
|
|
3328
3333
|
rows: 0,
|
|
3329
3334
|
totalPages: 0
|
|
3330
|
-
}),
|
|
3335
|
+
}), J = ge({
|
|
3331
3336
|
field: null,
|
|
3332
3337
|
order: 0
|
|
3333
3338
|
});
|
|
3334
|
-
let
|
|
3335
|
-
async function g(
|
|
3339
|
+
let Z = null;
|
|
3340
|
+
async function g(K = {}) {
|
|
3336
3341
|
w.value = !0;
|
|
3337
3342
|
try {
|
|
3338
|
-
const
|
|
3339
|
-
page:
|
|
3340
|
-
page_size:
|
|
3341
|
-
...
|
|
3343
|
+
const B = {
|
|
3344
|
+
page: L.page,
|
|
3345
|
+
page_size: L.pageSize,
|
|
3346
|
+
...K
|
|
3342
3347
|
};
|
|
3343
|
-
|
|
3344
|
-
for (const [oe,
|
|
3345
|
-
|
|
3346
|
-
const X = await i.list(t,
|
|
3347
|
-
|
|
3348
|
+
F.value && (B.search = F.value), J.field && J.order !== 0 && (B.ordering = J.order === -1 ? `-${J.field}` : J.field);
|
|
3349
|
+
for (const [oe, ae] of Object.entries(W))
|
|
3350
|
+
ae != null && ae !== "" && (B[oe] = ae);
|
|
3351
|
+
const X = await i.list(t, B);
|
|
3352
|
+
c.value = X.data, L.rows = X.rows, X.page && (L.page = X.page), X.page_size && (L.pageSize = X.page_size), L.totalPages = Math.ceil(L.rows / L.pageSize) || 0, V.value = X.extras ?? {};
|
|
3348
3353
|
} finally {
|
|
3349
3354
|
w.value = !1;
|
|
3350
3355
|
}
|
|
@@ -3352,45 +3357,45 @@ function ss(e) {
|
|
|
3352
3357
|
async function b() {
|
|
3353
3358
|
await g();
|
|
3354
3359
|
}
|
|
3355
|
-
function
|
|
3356
|
-
|
|
3357
|
-
|
|
3360
|
+
function k(K) {
|
|
3361
|
+
F.value = K, Z && clearTimeout(Z), Z = setTimeout(() => {
|
|
3362
|
+
L.page = 1, g();
|
|
3358
3363
|
}, a);
|
|
3359
3364
|
}
|
|
3360
|
-
function
|
|
3361
|
-
|
|
3365
|
+
function x(K, B) {
|
|
3366
|
+
W[K] = B, L.page = 1, g();
|
|
3362
3367
|
}
|
|
3363
|
-
function
|
|
3364
|
-
for (const
|
|
3365
|
-
delete
|
|
3366
|
-
|
|
3368
|
+
function j() {
|
|
3369
|
+
for (const K of Object.keys(W))
|
|
3370
|
+
delete W[K];
|
|
3371
|
+
L.page = 1, g();
|
|
3367
3372
|
}
|
|
3368
|
-
function U(
|
|
3369
|
-
|
|
3373
|
+
function U(K) {
|
|
3374
|
+
L.page = K.page + 1, L.pageSize = K.rows, g();
|
|
3370
3375
|
}
|
|
3371
|
-
function K
|
|
3372
|
-
|
|
3376
|
+
function Y(K) {
|
|
3377
|
+
J.field = K.sortField ?? null, J.order = K.sortOrder ?? 0, L.page = 1, g();
|
|
3373
3378
|
}
|
|
3374
3379
|
return o && g(), {
|
|
3375
|
-
items:
|
|
3380
|
+
items: c,
|
|
3376
3381
|
loading: w,
|
|
3377
|
-
search:
|
|
3378
|
-
pagination:
|
|
3379
|
-
sort:
|
|
3380
|
-
extras:
|
|
3382
|
+
search: F,
|
|
3383
|
+
pagination: L,
|
|
3384
|
+
sort: J,
|
|
3385
|
+
extras: V,
|
|
3381
3386
|
fetchItems: g,
|
|
3382
3387
|
refresh: b,
|
|
3383
|
-
setSearch:
|
|
3384
|
-
setFilter:
|
|
3385
|
-
clearFilters:
|
|
3388
|
+
setSearch: k,
|
|
3389
|
+
setFilter: x,
|
|
3390
|
+
clearFilters: j,
|
|
3386
3391
|
onPage: U,
|
|
3387
|
-
onSort:
|
|
3392
|
+
onSort: Y
|
|
3388
3393
|
};
|
|
3389
3394
|
}
|
|
3390
|
-
function
|
|
3395
|
+
function yl(e) {
|
|
3391
3396
|
return e.split("?")[0].replace(/^\/+|\/+$/g, "").replace(/^api\/v\d+\//, "");
|
|
3392
3397
|
}
|
|
3393
|
-
function
|
|
3398
|
+
function bl(e) {
|
|
3394
3399
|
return typeof e == "string" ? { table: e } : e;
|
|
3395
3400
|
}
|
|
3396
3401
|
function Yt(e, t = 400) {
|
|
@@ -3424,9 +3429,9 @@ function Be(e) {
|
|
|
3424
3429
|
}
|
|
3425
3430
|
function We(e, t) {
|
|
3426
3431
|
var l, i;
|
|
3427
|
-
const a =
|
|
3432
|
+
const a = yl(e), o = (l = t.resources) == null ? void 0 : l[a];
|
|
3428
3433
|
if (o)
|
|
3429
|
-
return
|
|
3434
|
+
return bl(o);
|
|
3430
3435
|
if ((i = t.allowedTables) != null && i.includes(a))
|
|
3431
3436
|
return { table: a };
|
|
3432
3437
|
throw Yt(
|
|
@@ -3434,26 +3439,26 @@ function We(e, t) {
|
|
|
3434
3439
|
404
|
|
3435
3440
|
);
|
|
3436
3441
|
}
|
|
3437
|
-
function
|
|
3442
|
+
function wl(e, t, a) {
|
|
3438
3443
|
const o = /* @__PURE__ */ new Set(["page", "page_size", "search", "ordering"]), l = { ...a.defaultFilters, ...t };
|
|
3439
3444
|
for (const [i, r] of Object.entries(l))
|
|
3440
3445
|
o.has(i) || r === null || r === void 0 || r === "" || (e = e.eq(i, r));
|
|
3441
3446
|
return e;
|
|
3442
3447
|
}
|
|
3443
|
-
function
|
|
3448
|
+
function kl(e, t, a) {
|
|
3444
3449
|
if (typeof t != "string" || !t.trim() || !(a != null && a.length))
|
|
3445
3450
|
return e;
|
|
3446
3451
|
const o = t.trim().replace(/,/g, "\\,"), l = a.map((i) => `${i}.ilike.%${o}%`).join(",");
|
|
3447
3452
|
return e.or(l);
|
|
3448
3453
|
}
|
|
3449
|
-
function
|
|
3454
|
+
function $l(e, t) {
|
|
3450
3455
|
const a = typeof e == "string" && e ? e : t;
|
|
3451
3456
|
return a ? {
|
|
3452
3457
|
field: a.startsWith("-") ? a.slice(1) : a,
|
|
3453
3458
|
ascending: !a.startsWith("-")
|
|
3454
3459
|
} : null;
|
|
3455
3460
|
}
|
|
3456
|
-
function
|
|
3461
|
+
function Cl(e, t) {
|
|
3457
3462
|
return e ? t.mapListItem ? e.map(
|
|
3458
3463
|
(a) => {
|
|
3459
3464
|
var o;
|
|
@@ -3461,22 +3466,22 @@ function $l(e, t) {
|
|
|
3461
3466
|
}
|
|
3462
3467
|
) : e : [];
|
|
3463
3468
|
}
|
|
3464
|
-
function
|
|
3469
|
+
function rs(e) {
|
|
3465
3470
|
const t = e.defaultSelect ?? "*";
|
|
3466
3471
|
return {
|
|
3467
3472
|
async list(a, o = {}) {
|
|
3468
|
-
var
|
|
3469
|
-
const l = We(a, e), i = Math.max(Number(o.page ?? 1), 1), r = Math.max(Number(o.page_size ?? 20), 1), y = (i - 1) * r,
|
|
3473
|
+
var W;
|
|
3474
|
+
const l = We(a, e), i = Math.max(Number(o.page ?? 1), 1), r = Math.max(Number(o.page_size ?? 20), 1), y = (i - 1) * r, c = y + r - 1;
|
|
3470
3475
|
let w = e.client.from(l.table).select(l.select ?? t, { count: "exact" });
|
|
3471
|
-
w =
|
|
3472
|
-
const
|
|
3473
|
-
|
|
3474
|
-
const
|
|
3475
|
-
return
|
|
3476
|
-
data:
|
|
3476
|
+
w = wl(w, o, l), w = kl(w, o.search, l.searchFields);
|
|
3477
|
+
const F = $l(o.ordering, l.defaultOrdering);
|
|
3478
|
+
F && (w = w.order(F.field, { ascending: F.ascending }));
|
|
3479
|
+
const V = await w.range(y, c);
|
|
3480
|
+
return V.error && Be(V.error), {
|
|
3481
|
+
data: Cl(V.data, l),
|
|
3477
3482
|
page: i,
|
|
3478
3483
|
page_size: r,
|
|
3479
|
-
rows:
|
|
3484
|
+
rows: V.count ?? ((W = V.data) == null ? void 0 : W.length) ?? 0,
|
|
3480
3485
|
extras: {}
|
|
3481
3486
|
};
|
|
3482
3487
|
},
|
|
@@ -3485,12 +3490,12 @@ function is(e) {
|
|
|
3485
3490
|
return y.error && Be(y.error), { data: y.data };
|
|
3486
3491
|
},
|
|
3487
3492
|
async create(a, o, l) {
|
|
3488
|
-
const i = We(a, e), r = wt(o), y = i.mapPayload ? i.mapPayload(r, "create") : r,
|
|
3489
|
-
return
|
|
3493
|
+
const i = We(a, e), r = wt(o), y = i.mapPayload ? i.mapPayload(r, "create") : r, c = await e.client.from(i.table).insert(y).select(i.select ?? t).single();
|
|
3494
|
+
return c.error && Be(c.error), { data: c.data };
|
|
3490
3495
|
},
|
|
3491
3496
|
async update(a, o, l, i) {
|
|
3492
|
-
const r = We(a, e), y = r.pk ?? "id",
|
|
3493
|
-
return
|
|
3497
|
+
const r = We(a, e), y = r.pk ?? "id", c = wt(l), w = r.mapPayload ? r.mapPayload(c, "update") : c, F = await e.client.from(r.table).update(w).eq(y, o).select(r.select ?? t).single();
|
|
3498
|
+
return F.error && Be(F.error), { data: F.data };
|
|
3494
3499
|
},
|
|
3495
3500
|
async delete(a, o) {
|
|
3496
3501
|
const l = We(a, e), i = l.pk ?? "id", r = l.softDelete === !0 ? { is_active: !1 } : typeof l.softDelete == "object" ? l.softDelete : null, y = r ? await e.client.from(l.table).update(r).eq(i, o) : await e.client.from(l.table).delete().eq(i, o);
|
|
@@ -3499,43 +3504,43 @@ function is(e) {
|
|
|
3499
3504
|
};
|
|
3500
3505
|
}
|
|
3501
3506
|
export {
|
|
3502
|
-
|
|
3503
|
-
|
|
3507
|
+
gl as DEFAULT_CRUD_LABELS,
|
|
3508
|
+
ns as WActionBar,
|
|
3504
3509
|
Lt as WAutoCompleteFK,
|
|
3505
3510
|
Qe as WCrudColumnRenderer,
|
|
3506
3511
|
ut as WCrudFormDialog,
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3512
|
+
mo as WCrudView,
|
|
3513
|
+
Ql as WDetailHeader,
|
|
3514
|
+
Xl as WEmptyState,
|
|
3515
|
+
Mn as WFormRenderer,
|
|
3516
|
+
as as WFormSection,
|
|
3517
|
+
_l as WInfoCard,
|
|
3518
|
+
Ko as WKpiCard,
|
|
3519
|
+
es as WKpiGrid,
|
|
3515
3520
|
zt as WMoneyInput,
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
+
Zl as WPageHeader,
|
|
3522
|
+
ls as WPrimeVuePlugin,
|
|
3523
|
+
os as WProgressFlow,
|
|
3524
|
+
ts as WSectionHeader,
|
|
3525
|
+
po as WStatusTag,
|
|
3521
3526
|
Nt as WTransferList,
|
|
3522
|
-
|
|
3527
|
+
la as W_AXIOS_KEY,
|
|
3523
3528
|
et as W_CONFIG_KEY,
|
|
3524
3529
|
_e as W_DATA_PROVIDER_KEY,
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3530
|
+
vl as createAxiosDataProvider,
|
|
3531
|
+
rs as createSupabaseDataProvider,
|
|
3532
|
+
In as downloadCsv,
|
|
3528
3533
|
Ke as extractApiError,
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3534
|
+
za as mapApiFieldToColumnDef,
|
|
3535
|
+
Ia as mapApiFieldToFieldDef,
|
|
3536
|
+
Na as mapApiFieldsToColumnDefs,
|
|
3537
|
+
Ta as mapApiFieldsToFieldDefs,
|
|
3538
|
+
Rn as toCsv,
|
|
3539
|
+
is as useApi,
|
|
3540
|
+
Jl as useApiError,
|
|
3536
3541
|
Tt as useAppConfirm,
|
|
3537
3542
|
It as useAppToast,
|
|
3538
|
-
|
|
3543
|
+
ss as useCrudManager,
|
|
3539
3544
|
rt as useFormatters
|
|
3540
3545
|
};
|
|
3541
3546
|
//# sourceMappingURL=index.js.map
|