@wgalleti/primevue-components 0.3.6 → 0.3.8
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/components/crud/WCrudView.vue.d.ts +2 -0
- package/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1353 -1343
- package/dist/index.js.map +1 -1
- package/dist/types/components/crud/WCrudView.vue.d.ts +2 -0
- 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 O, withDirectives as fe, withCtx as ne, createCommentVNode as w, renderList as ie, normalizeStyle as je, createTextVNode as Pe, normalizeClass as re, renderSlot as Y, 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 = {}, k = 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 $ = b.match(/([+-]|\d\d)/g),
|
|
46
|
-
return
|
|
45
|
+
var $ = b.match(/([+-]|\d\d)/g), x = 60 * $[1] + (+$[2] || 0);
|
|
46
|
+
return x === 0 ? 0 : $[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 $, x = c.meridiem;
|
|
53
|
+
if (x) {
|
|
54
|
+
for (var j = 1; j <= 24; j += 1) if (g.indexOf(x(j, 0, b)) > -1) {
|
|
55
|
+
$ = j > 12;
|
|
56
56
|
break;
|
|
57
57
|
}
|
|
58
58
|
} else $ = g === (b ? "pm" : "PM");
|
|
59
59
|
return $;
|
|
60
|
-
},
|
|
61
|
-
this.afternoon =
|
|
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 = $[0], b) for (var
|
|
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, $ = g.match(/\d+/);
|
|
74
|
+
if (this.day = $[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"), $ = (W("monthsShort") || b.map((function(x) {
|
|
77
|
+
return x.slice(0, 3);
|
|
78
78
|
}))).indexOf(g) + 1;
|
|
79
79
|
if ($ < 1) throw new Error();
|
|
80
80
|
this.month = $ % 12 || $;
|
|
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+/,
|
|
86
|
-
this.year =
|
|
87
|
-
}], YYYY: [/\d{4}/,
|
|
88
|
-
function
|
|
85
|
+
}], Y: [/[+-]?\d+/, F("year")], YY: [i, function(g) {
|
|
86
|
+
this.year = k(g);
|
|
87
|
+
}], YYYY: [/\d{4}/, F("year")], Z: V, ZZ: V };
|
|
88
|
+
function Z(g) {
|
|
89
89
|
var b, $;
|
|
90
|
-
b = g, $ =
|
|
91
|
-
for (var
|
|
92
|
-
var f =
|
|
93
|
-
return
|
|
90
|
+
b = g, $ = 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 || $[_] || a[_] || $[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 N = x[U], K = J[N], B = K && K[0], X = K && K[1];
|
|
98
|
+
x[U] = X ? { regex: B, parser: X } : N.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
118
|
return function(g, b, $) {
|
|
119
|
-
$.p.customParseFormat = !0, g && g.parseTwoDigitYear && (
|
|
120
|
-
var
|
|
121
|
-
|
|
122
|
-
var
|
|
123
|
-
this.$u =
|
|
124
|
-
var X =
|
|
119
|
+
$.p.customParseFormat = !0, g && g.parseTwoDigitYear && (k = g.parseTwoDigitYear);
|
|
120
|
+
var x = b.prototype, j = x.parse;
|
|
121
|
+
x.parse = function(U) {
|
|
122
|
+
var N = 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 = $.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 = $.apply(this,
|
|
137
|
+
})(N, X, K, $), this.init(), f && f !== !0 && (this.$L = this.locale(f).$L), _ && N != 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 = $.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, k = 2) {
|
|
268
|
+
return c == null ? "—" : vt(t, k).format(c);
|
|
269
269
|
}
|
|
270
|
-
function i(
|
|
271
|
-
return
|
|
270
|
+
function i(c, k) {
|
|
271
|
+
return ca(c, k ?? (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
|
|
353
|
-
const
|
|
354
|
-
if (Number.isNaN(parseFloat(
|
|
355
|
-
const
|
|
356
|
-
if (
|
|
357
|
-
const g =
|
|
358
|
-
|
|
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 k = yt(0, c, a);
|
|
353
|
+
const F = k.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
|
+
k = yt(g, c, a);
|
|
359
|
+
}
|
|
360
|
+
let Z = k.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,37 +432,37 @@ 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 : {}, k = 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, $ = !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 - k), V === Z && (g -= k)) : j.multiple && ($ = !0, g -= k), g += k) : j.multiple ? $ && (g += k, b -= k, $ = !1) : U === J ? J = void 0 : j.optional && (g += k, b -= k), b += k) : (o && !this.isEager() && y[F](x), U === x && !this.isEager() ? b += k : J = x, this.isEager() || (g += k)), this.isEager())
|
|
444
|
+
for (; L(g) && (c[i.charAt(g)] == null || r.includes(g)); ) {
|
|
445
445
|
if (o) {
|
|
446
|
-
if (y[
|
|
447
|
-
g +=
|
|
446
|
+
if (y[F](i.charAt(g)), t.charAt(b) === i.charAt(g)) {
|
|
447
|
+
g += k, b += k;
|
|
448
448
|
continue;
|
|
449
449
|
}
|
|
450
|
-
} else i.charAt(g) === t.charAt(b) && (b +=
|
|
451
|
-
g +=
|
|
450
|
+
} else i.charAt(g) === t.charAt(b) && (b += k);
|
|
451
|
+
g += k;
|
|
452
452
|
}
|
|
453
453
|
}
|
|
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
|
-
|
|
500
|
+
const c = t.value, k = y.slice(0, r), F = c.slice(0, r), V = (l = this.processInput(t, k)) == 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
|
+
k !== 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 Zl() {
|
|
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), k = 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,
|
|
728
|
-
|
|
726
|
+
C && (S.search = C);
|
|
727
|
+
const te = await i.list(a.endpoint, S);
|
|
728
|
+
k.value = te.data;
|
|
729
729
|
} catch {
|
|
730
|
-
|
|
730
|
+
k.value = [];
|
|
731
731
|
} finally {
|
|
732
|
-
|
|
732
|
+
F.value = !1;
|
|
733
733
|
}
|
|
734
734
|
}
|
|
735
|
-
function
|
|
736
|
-
const
|
|
737
|
-
if (
|
|
738
|
-
|
|
735
|
+
function J(C) {
|
|
736
|
+
const S = C.query || "";
|
|
737
|
+
if (S.length < a.minLength) {
|
|
738
|
+
k.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), $ = q([]),
|
|
764
|
-
let
|
|
765
|
-
const
|
|
763
|
+
const b = q(!1), $ = q([]), x = q(!1), j = q(""), U = q(1), N = 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: N.value,
|
|
788
788
|
...a.endpointParams
|
|
789
789
|
};
|
|
790
|
-
|
|
791
|
-
const
|
|
792
|
-
$.value =
|
|
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
|
+
$.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
|
-
$.value = [],
|
|
794
|
+
$.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, N.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 = $.value.findIndex((ce) => ce[a.optionValue] === te);
|
|
867
|
+
z !== -1 && ($.value[z] = S.data), r.success("Registro atualizado com sucesso");
|
|
868
868
|
} else
|
|
869
|
-
|
|
870
|
-
|
|
869
|
+
S = await i.create(a.endpoint, C), $.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 = $.value.findIndex((
|
|
883
|
-
te !== -1 && ($.value.splice(te, 1),
|
|
884
|
-
} catch (
|
|
885
|
-
r.error(Ke(
|
|
880
|
+
const S = C[a.optionValue];
|
|
881
|
+
await i.delete(a.endpoint, S);
|
|
882
|
+
const te = $.value.findIndex((z) => z[a.optionValue] === S);
|
|
883
|
+
te !== -1 && ($.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",
|
|
893
|
-
|
|
894
|
-
"model-value":
|
|
895
|
-
suggestions:
|
|
891
|
+
return s(), m(le, null, [
|
|
892
|
+
h("div", Ba, [
|
|
893
|
+
O(v(xt), {
|
|
894
|
+
"model-value": c.value,
|
|
895
|
+
suggestions: k.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",
|
|
@@ -919,9 +919,9 @@ const Oa = { class: "w-autocompletefk" }, Ba = ["disabled"], Wa = { class: "w-au
|
|
|
919
919
|
]
|
|
920
920
|
])
|
|
921
921
|
]),
|
|
922
|
-
|
|
922
|
+
O(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,106 +929,106 @@ 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
|
-
|
|
932
|
+
h("div", Ha, [
|
|
933
|
+
O(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
|
-
|
|
939
|
+
O(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",
|
|
949
|
-
|
|
948
|
+
h("div", ja, [
|
|
949
|
+
O(v(qe), { class: "w-autocompletefk-toolbar-search" }, {
|
|
950
950
|
default: ne(() => [
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
modelValue:
|
|
954
|
-
"onUpdate:modelValue":
|
|
951
|
+
O(v(He), { class: "pi pi-search" }),
|
|
952
|
+
O(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
|
+
})) : w("", !0)
|
|
969
969
|
])
|
|
970
970
|
]),
|
|
971
|
-
|
|
972
|
-
selection:
|
|
973
|
-
"onUpdate:selection":
|
|
971
|
+
O(v($t), {
|
|
972
|
+
selection: B.value,
|
|
973
|
+
"onUpdate:selection": S[1] || (S[1] = (z) => B.value = z),
|
|
974
974
|
value: $.value,
|
|
975
|
-
loading:
|
|
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: N.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(() => [
|
|
995
|
-
|
|
995
|
+
O(v(ze), {
|
|
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
|
+
]) : w("", !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
|
+
]) : w("", !0)
|
|
1056
1056
|
])
|
|
1057
1057
|
]),
|
|
1058
1058
|
_: 1
|
|
1059
|
-
})) :
|
|
1059
|
+
})) : w("", !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"])) : w("", !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
|
|
1110
|
-
if (!
|
|
1108
|
+
function y(c) {
|
|
1109
|
+
const k = c.target.value.replace(/\D/g, "");
|
|
1110
|
+
if (!k) {
|
|
1111
1111
|
o("update:modelValue", null);
|
|
1112
1112
|
return;
|
|
1113
1113
|
}
|
|
1114
|
-
const
|
|
1115
|
-
o("update:modelValue",
|
|
1114
|
+
const F = Number(k) / Math.pow(10, a.decimals);
|
|
1115
|
+
o("update:modelValue", F);
|
|
1116
1116
|
}
|
|
1117
|
-
return (
|
|
1117
|
+
return (c, k) => 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
|
-
|
|
1127
|
+
})) : w("", !0),
|
|
1128
|
+
O(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
|
+
})) : w("", !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
|
-
function
|
|
1179
|
+
function k(b) {
|
|
1180
1180
|
return String(b[a.optionLabel] ?? "");
|
|
1181
1181
|
}
|
|
1182
|
-
function
|
|
1182
|
+
function F(b, $) {
|
|
1183
1183
|
if (!$) return !0;
|
|
1184
|
-
const
|
|
1184
|
+
const x = $.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 $ = c(b);
|
|
1204
|
+
o("update:selected", a.selected.filter((x) => x !== $));
|
|
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, $) => (s(),
|
|
1213
|
-
class:
|
|
1212
|
+
return (b, $) => (s(), m("div", {
|
|
1213
|
+
class: re(["w-transfer", { "w-transfer--disabled": e.disabled }])
|
|
1214
1214
|
}, [
|
|
1215
|
-
h("div",
|
|
1216
|
-
h("div",
|
|
1215
|
+
h("div", Ka, [
|
|
1216
|
+
h("div", Ga, [
|
|
1217
1217
|
$[2] || ($[2] = h("span", { class: "w-transfer__title" }, "Disponíveis", -1)),
|
|
1218
|
-
h("span",
|
|
1218
|
+
h("span", Ja, T(V.value.length), 1)
|
|
1219
1219
|
]),
|
|
1220
|
-
|
|
1220
|
+
O(v(qe), { class: "w-transfer__search" }, {
|
|
1221
1221
|
default: ne(() => [
|
|
1222
|
-
|
|
1223
|
-
|
|
1222
|
+
O(v(He), { class: "pi pi-search" }),
|
|
1223
|
+
O(v(me), {
|
|
1224
1224
|
modelValue: l.value,
|
|
1225
|
-
"onUpdate:modelValue": $[0] || ($[0] = (
|
|
1225
|
+
"onUpdate:modelValue": $[0] || ($[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(
|
|
1238
|
+
h("span", null, T(k(x)), 1),
|
|
1239
1239
|
$[3] || ($[3] = h("i", { class: "pi pi-angle-right" }, null, -1))
|
|
1240
|
-
], 8,
|
|
1241
|
-
|
|
1240
|
+
], 8, Xa))), 128)),
|
|
1241
|
+
V.value.length ? w("", !0) : (s(), m("li", Qa, "Nenhum item"))
|
|
1242
1242
|
])
|
|
1243
1243
|
]),
|
|
1244
|
-
h("div",
|
|
1245
|
-
|
|
1244
|
+
h("div", _a, [
|
|
1245
|
+
O(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
|
-
|
|
1253
|
+
O(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",
|
|
1262
|
+
h("div", en, [
|
|
1263
|
+
h("div", tn, [
|
|
1264
1264
|
$[4] || ($[4] = h("span", { class: "w-transfer__title" }, "Selecionados", -1)),
|
|
1265
|
-
h("span",
|
|
1265
|
+
h("span", an, T(W.value.length), 1)
|
|
1266
1266
|
]),
|
|
1267
|
-
|
|
1267
|
+
O(v(qe), { class: "w-transfer__search" }, {
|
|
1268
1268
|
default: ne(() => [
|
|
1269
|
-
|
|
1270
|
-
|
|
1269
|
+
O(v(He), { class: "pi pi-search" }),
|
|
1270
|
+
O(v(me), {
|
|
1271
1271
|
modelValue: i.value,
|
|
1272
|
-
"onUpdate:modelValue": $[1] || ($[1] = (
|
|
1272
|
+
"onUpdate:modelValue": $[1] || ($[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
1285
|
$[5] || ($[5] = h("i", { class: "pi pi-angle-left" }, null, -1)),
|
|
1286
|
-
h("span", null, T(
|
|
1287
|
-
], 8,
|
|
1288
|
-
|
|
1286
|
+
h("span", null, T(k(x)), 1)
|
|
1287
|
+
], 8, on))), 128)),
|
|
1288
|
+
W.value.length ? w("", !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
|
|
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 k(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
1408
|
const $ = ge({});
|
|
1409
|
-
function
|
|
1410
|
-
const
|
|
1411
|
-
if (
|
|
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
|
|
1417
|
+
function j(f) {
|
|
1418
1418
|
return $[f.field] || [];
|
|
1419
1419
|
}
|
|
1420
|
-
function U(f,
|
|
1421
|
-
const u = (
|
|
1420
|
+
function U(f, P) {
|
|
1421
|
+
const u = (P.query || "").toLowerCase(), n = W(f.options) || [], p = f.optionLabel || "label";
|
|
1422
1422
|
$[f.field] = n.filter(
|
|
1423
|
-
(
|
|
1423
|
+
(d) => String(d[p] || "").toLowerCase().includes(u)
|
|
1424
1424
|
);
|
|
1425
1425
|
}
|
|
1426
|
-
function
|
|
1426
|
+
function N(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)) : w("", !0)
|
|
1480
|
+
])) : w("", !0),
|
|
1481
|
+
h("div", fn, [
|
|
1482
|
+
(s(!0), m(le, null, ie(u.fields, (n) => Y(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
|
-
|
|
1489
|
+
n.type === "switch" ? (s(), m("div", mn, [
|
|
1490
|
+
O(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, "*")) : w("", !0)
|
|
1500
1500
|
]),
|
|
1501
|
-
h("div",
|
|
1502
|
-
|
|
1503
|
-
"model-value":
|
|
1504
|
-
disabled:
|
|
1505
|
-
"onUpdate:modelValue": (
|
|
1501
|
+
h("div", yn, [
|
|
1502
|
+
O(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
|
-
|
|
1507
|
+
O(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
|
+
Y(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, "*")) : w("", !0)
|
|
1537
1537
|
]),
|
|
1538
|
-
|
|
1539
|
-
source:
|
|
1538
|
+
O(Nt, {
|
|
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, "*")) : w("", !0),
|
|
1554
|
+
r[n.field] ? (s(), m("i", Pn)) : w("", !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) => N(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) => k(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"])) : w("", !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)) : w("", !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
|
-
|
|
1766
|
+
O(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, k) => o("update:field", c, k))
|
|
1774
1774
|
}, ot({ _: 2 }, [
|
|
1775
|
-
|
|
1776
|
-
name: `field-${
|
|
1777
|
-
fn: ne((
|
|
1778
|
-
|
|
1775
|
+
ie(e.fields, (c) => ({
|
|
1776
|
+
name: `field-${c.field}`,
|
|
1777
|
+
fn: ne((k) => [
|
|
1778
|
+
Y(r.$slots, `field-${c.field}`, lt(st(k)))
|
|
1779
1779
|
])
|
|
1780
1780
|
})),
|
|
1781
|
-
|
|
1782
|
-
name: `image-${
|
|
1783
|
-
fn: ne((
|
|
1784
|
-
|
|
1781
|
+
ie(e.fields.filter((c) => c.type === "image"), (c) => ({
|
|
1782
|
+
name: `image-${c.field}`,
|
|
1783
|
+
fn: ne((k) => [
|
|
1784
|
+
Y(r.$slots, `image-${c.field}`, lt(st(k)))
|
|
1785
1785
|
])
|
|
1786
1786
|
}))
|
|
1787
1787
|
]), 1032, ["fields", "form-data", "is-editing", "disabled"]),
|
|
1788
|
-
h("div",
|
|
1789
|
-
|
|
1788
|
+
h("div", Fn, [
|
|
1789
|
+
Y(r.$slots, "footer", {
|
|
1790
1790
|
saving: e.saving,
|
|
1791
1791
|
disabled: e.disabled
|
|
1792
1792
|
}, () => [
|
|
1793
|
-
|
|
1793
|
+
O(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 ? w("", !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,60 @@ 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 = {
|
|
1875
|
+
key: 2,
|
|
1876
|
+
class: "w-crud-rail-sep"
|
|
1877
|
+
}, po = /* @__PURE__ */ de({
|
|
1875
1878
|
__name: "WCrudView",
|
|
1876
1879
|
props: {
|
|
1877
1880
|
crud: {},
|
|
@@ -1891,6 +1894,7 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
1891
1894
|
cardFields: { default: 4 },
|
|
1892
1895
|
actionRail: { type: Boolean, default: !0 },
|
|
1893
1896
|
contextMenu: { type: Boolean, default: !0 },
|
|
1897
|
+
showPrint: { type: Boolean, default: !1 },
|
|
1894
1898
|
exportCsv: { type: Boolean, default: !0 },
|
|
1895
1899
|
csvFilename: { default: "export.csv" },
|
|
1896
1900
|
csvScope: { default: "all" },
|
|
@@ -1898,23 +1902,23 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
1898
1902
|
},
|
|
1899
1903
|
emits: ["row-expand", "row-collapse", "print"],
|
|
1900
1904
|
setup(e, { emit: t }) {
|
|
1901
|
-
const a = e, o = t, l =
|
|
1902
|
-
function
|
|
1905
|
+
const a = e, o = t, l = Ht(), { formatNumber: i } = rt(), r = q({}), y = q(a.defaultView);
|
|
1906
|
+
function c(u) {
|
|
1903
1907
|
return y.value === u;
|
|
1904
1908
|
}
|
|
1905
|
-
function
|
|
1909
|
+
function k(u) {
|
|
1906
1910
|
y.value = u;
|
|
1907
1911
|
}
|
|
1908
|
-
const
|
|
1912
|
+
const F = H(
|
|
1909
1913
|
() => (a.crud.pagination.page - 1) * a.crud.pagination.pageSize
|
|
1910
|
-
),
|
|
1914
|
+
), V = H(
|
|
1911
1915
|
() => 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
1916
|
);
|
|
1913
|
-
function
|
|
1917
|
+
function W(u) {
|
|
1914
1918
|
if (u.align === "right") return "text-right";
|
|
1915
1919
|
if (u.align === "center") return "text-center";
|
|
1916
1920
|
}
|
|
1917
|
-
const
|
|
1921
|
+
const L = H(() => V.value.slice(0, a.cardFields)), J = H(() => {
|
|
1918
1922
|
const u = [];
|
|
1919
1923
|
return a.crud.config.canEdit !== !1 && u.push({ action: "edit", icon: "pi pi-pencil", tooltip: "Editar" }), a.crud.config.canCreate !== !1 && u.push({
|
|
1920
1924
|
action: "duplicate",
|
|
@@ -1927,9 +1931,9 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
1927
1931
|
tooltip: "Excluir",
|
|
1928
1932
|
severity: "danger"
|
|
1929
1933
|
}), u;
|
|
1930
|
-
}),
|
|
1931
|
-
() => a.crud.config.rowActions ??
|
|
1932
|
-
), g = H(() =>
|
|
1934
|
+
}), Z = H(
|
|
1935
|
+
() => a.crud.config.rowActions ?? J.value
|
|
1936
|
+
), g = H(() => Z.value.length > 0 || !!l["row-actions"]);
|
|
1933
1937
|
function b(u, n) {
|
|
1934
1938
|
if (u.handler) {
|
|
1935
1939
|
u.handler(n);
|
|
@@ -1940,10 +1944,10 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
1940
1944
|
function $(u, n) {
|
|
1941
1945
|
return u.visible ? u.visible(n) : !0;
|
|
1942
1946
|
}
|
|
1943
|
-
function
|
|
1947
|
+
function x(u, n) {
|
|
1944
1948
|
return u.disabled ? u.disabled(n) : !1;
|
|
1945
1949
|
}
|
|
1946
|
-
const
|
|
1950
|
+
const j = H(() => {
|
|
1947
1951
|
const u = [];
|
|
1948
1952
|
return a.showKpi && u.push({
|
|
1949
1953
|
icon: a.kpiIcon,
|
|
@@ -1952,20 +1956,20 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
1952
1956
|
}), u.push(...a.extraKpis), u;
|
|
1953
1957
|
});
|
|
1954
1958
|
H(() => a.crud.config.labels ?? {});
|
|
1955
|
-
const U = H(() => a.crud.config.canCreate !== !1),
|
|
1956
|
-
function
|
|
1957
|
-
|
|
1959
|
+
const U = H(() => a.crud.config.canCreate !== !1), N = q(null), K = q(null);
|
|
1960
|
+
function B(u) {
|
|
1961
|
+
N.value = u;
|
|
1958
1962
|
}
|
|
1959
1963
|
function X(u) {
|
|
1960
1964
|
var n;
|
|
1961
|
-
a.contextMenu && (
|
|
1965
|
+
a.contextMenu && (N.value = u.data, (n = K.value) == null || n.show(u.originalEvent));
|
|
1962
1966
|
}
|
|
1963
1967
|
function oe(u, n) {
|
|
1964
|
-
var
|
|
1965
|
-
a.contextMenu && (u.preventDefault(),
|
|
1968
|
+
var p;
|
|
1969
|
+
a.contextMenu && (u.preventDefault(), N.value = n, (p = K.value) == null || p.show(u));
|
|
1966
1970
|
}
|
|
1967
|
-
const
|
|
1968
|
-
const u =
|
|
1971
|
+
const ae = H(() => {
|
|
1972
|
+
const u = N.value;
|
|
1969
1973
|
if (!u) return [];
|
|
1970
1974
|
const n = [
|
|
1971
1975
|
{
|
|
@@ -1974,90 +1978,90 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
1974
1978
|
command: () => a.crud.openViewDialog(u)
|
|
1975
1979
|
}
|
|
1976
1980
|
];
|
|
1977
|
-
for (const
|
|
1978
|
-
$(
|
|
1979
|
-
label:
|
|
1980
|
-
icon:
|
|
1981
|
-
class:
|
|
1982
|
-
disabled:
|
|
1983
|
-
command: () => b(
|
|
1981
|
+
for (const p of Z.value)
|
|
1982
|
+
$(p, u) && n.push({
|
|
1983
|
+
label: p.tooltip ?? p.action,
|
|
1984
|
+
icon: p.icon,
|
|
1985
|
+
class: p.severity === "danger" ? "w-crud-ctx-danger" : void 0,
|
|
1986
|
+
disabled: x(p, u),
|
|
1987
|
+
command: () => b(p, u)
|
|
1984
1988
|
});
|
|
1985
|
-
return n.push({
|
|
1989
|
+
return a.showPrint && n.push({
|
|
1986
1990
|
label: "Imprimir",
|
|
1987
1991
|
icon: "pi pi-print",
|
|
1988
1992
|
command: () => o("print", u)
|
|
1989
1993
|
}), a.exportCsv && (n.push({ separator: !0 }), n.push({
|
|
1990
1994
|
label: a.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)",
|
|
1991
1995
|
icon: "pi pi-download",
|
|
1992
|
-
command: () =>
|
|
1996
|
+
command: () => P()
|
|
1993
1997
|
})), n;
|
|
1994
1998
|
});
|
|
1995
|
-
function
|
|
1996
|
-
|
|
1999
|
+
function _() {
|
|
2000
|
+
N.value && o("print", N.value);
|
|
1997
2001
|
}
|
|
1998
2002
|
const f = q(!1);
|
|
1999
|
-
async function
|
|
2003
|
+
async function P() {
|
|
2000
2004
|
if (!f.value) {
|
|
2001
2005
|
f.value = !0;
|
|
2002
2006
|
try {
|
|
2003
|
-
const u = a.csvScope === "page" ? a.crud.items.value : await a.crud.fetchAll(a.csvPageSize), n =
|
|
2004
|
-
|
|
2007
|
+
const u = a.csvScope === "page" ? a.crud.items.value : await a.crud.fetchAll(a.csvPageSize), n = Rn(u, V.value);
|
|
2008
|
+
In(n, a.csvFilename);
|
|
2005
2009
|
} finally {
|
|
2006
2010
|
f.value = !1;
|
|
2007
2011
|
}
|
|
2008
2012
|
}
|
|
2009
2013
|
}
|
|
2010
|
-
return
|
|
2014
|
+
return Kt(() => {
|
|
2011
2015
|
a.autoInit && a.crud.init();
|
|
2012
2016
|
}), (u, n) => {
|
|
2013
|
-
const
|
|
2014
|
-
return s(),
|
|
2015
|
-
e.showHeader ? (s(),
|
|
2016
|
-
h("div",
|
|
2017
|
-
h("h1",
|
|
2018
|
-
e.subtitle ? (s(),
|
|
2017
|
+
const p = kt("tooltip");
|
|
2018
|
+
return s(), m("div", Tn, [
|
|
2019
|
+
e.showHeader ? (s(), m("div", Ln, [
|
|
2020
|
+
h("div", zn, [
|
|
2021
|
+
h("h1", Nn, T(e.title), 1),
|
|
2022
|
+
e.subtitle ? (s(), m("p", Yn, T(e.subtitle), 1)) : w("", !0)
|
|
2019
2023
|
]),
|
|
2020
|
-
h("div",
|
|
2021
|
-
|
|
2022
|
-
U.value ? (s(),
|
|
2024
|
+
h("div", On, [
|
|
2025
|
+
Y(u.$slots, "header-actions"),
|
|
2026
|
+
U.value && !e.actionRail ? (s(), A(v(ee), {
|
|
2023
2027
|
key: 0,
|
|
2024
2028
|
label: "Novo",
|
|
2025
2029
|
icon: "pi pi-plus",
|
|
2026
|
-
onClick: n[0] || (n[0] = (
|
|
2027
|
-
})) :
|
|
2030
|
+
onClick: n[0] || (n[0] = (d) => e.crud.openCreateDialog())
|
|
2031
|
+
})) : w("", !0)
|
|
2028
2032
|
])
|
|
2029
|
-
])) :
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
(s(!0),
|
|
2033
|
-
key:
|
|
2033
|
+
])) : w("", !0),
|
|
2034
|
+
Y(u.$slots, "before-table", {}, () => [
|
|
2035
|
+
j.value.length ? (s(), m("div", Bn, [
|
|
2036
|
+
(s(!0), m(le, null, ie(j.value, (d, E) => (s(), m("div", {
|
|
2037
|
+
key: E,
|
|
2034
2038
|
class: "w-crud-kpi"
|
|
2035
2039
|
}, [
|
|
2036
2040
|
h("div", {
|
|
2037
|
-
class:
|
|
2041
|
+
class: re(["w-crud-kpi-icon", d.severity ? `w-crud-kpi-icon--${d.severity}` : ""])
|
|
2038
2042
|
}, [
|
|
2039
2043
|
h("i", {
|
|
2040
|
-
class:
|
|
2041
|
-
style: je(
|
|
2044
|
+
class: re([d.icon]),
|
|
2045
|
+
style: je(d.color ? `color: ${d.color}` : "")
|
|
2042
2046
|
}, null, 6)
|
|
2043
2047
|
], 2),
|
|
2044
|
-
h("div",
|
|
2045
|
-
h("div",
|
|
2046
|
-
h("div",
|
|
2048
|
+
h("div", Wn, [
|
|
2049
|
+
h("div", jn, T(d.label), 1),
|
|
2050
|
+
h("div", Un, T(d.value), 1)
|
|
2047
2051
|
])
|
|
2048
2052
|
]))), 128))
|
|
2049
|
-
])) :
|
|
2053
|
+
])) : w("", !0)
|
|
2050
2054
|
]),
|
|
2051
2055
|
h("div", {
|
|
2052
|
-
class:
|
|
2056
|
+
class: re(["w-crud-content", { "w-crud-content--rail": e.actionRail }])
|
|
2053
2057
|
}, [
|
|
2054
|
-
h("div",
|
|
2055
|
-
y.value === "table" ? (s(),
|
|
2056
|
-
|
|
2058
|
+
h("div", qn, [
|
|
2059
|
+
y.value === "table" ? (s(), m("div", Hn, [
|
|
2060
|
+
O(v($t), {
|
|
2057
2061
|
value: e.crud.items.value,
|
|
2058
2062
|
loading: e.crud.loading.value,
|
|
2059
2063
|
"expanded-rows": r.value,
|
|
2060
|
-
"onUpdate:expandedRows": n[4] || (n[4] = (
|
|
2064
|
+
"onUpdate:expandedRows": n[4] || (n[4] = (d) => r.value = d),
|
|
2061
2065
|
paginator: "",
|
|
2062
2066
|
rows: e.crud.pagination.pageSize,
|
|
2063
2067
|
"total-records": e.crud.pagination.rows,
|
|
@@ -2072,25 +2076,25 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2072
2076
|
"sort-field": e.crud.sort.field ?? void 0,
|
|
2073
2077
|
"sort-order": e.crud.sort.order,
|
|
2074
2078
|
"data-key": e.crud.config.pk || "id",
|
|
2075
|
-
selection: e.actionRail || e.contextMenu ?
|
|
2079
|
+
selection: e.actionRail || e.contextMenu ? N.value : void 0,
|
|
2076
2080
|
"selection-mode": e.actionRail || e.contextMenu ? "single" : void 0,
|
|
2077
2081
|
"context-menu": e.contextMenu,
|
|
2078
|
-
"context-menu-selection": e.contextMenu ?
|
|
2079
|
-
"onUpdate:selection": n[5] || (n[5] = (
|
|
2080
|
-
"onUpdate:contextMenuSelection": n[6] || (n[6] = (
|
|
2082
|
+
"context-menu-selection": e.contextMenu ? N.value : void 0,
|
|
2083
|
+
"onUpdate:selection": n[5] || (n[5] = (d) => N.value = d),
|
|
2084
|
+
"onUpdate:contextMenuSelection": n[6] || (n[6] = (d) => N.value = d),
|
|
2081
2085
|
onRowContextmenu: X,
|
|
2082
2086
|
onPage: e.crud.onPage,
|
|
2083
|
-
onSort: n[7] || (n[7] = (
|
|
2084
|
-
onRowExpand: n[8] || (n[8] = (
|
|
2085
|
-
onRowCollapse: n[9] || (n[9] = (
|
|
2087
|
+
onSort: n[7] || (n[7] = (d) => e.crud.onSort({ sortField: d.sortField, sortOrder: d.sortOrder })),
|
|
2088
|
+
onRowExpand: n[8] || (n[8] = (d) => o("row-expand", d.data)),
|
|
2089
|
+
onRowCollapse: n[9] || (n[9] = (d) => o("row-collapse", d.data))
|
|
2086
2090
|
}, ot({
|
|
2087
2091
|
header: ne(() => [
|
|
2088
|
-
h("div",
|
|
2089
|
-
h("div",
|
|
2090
|
-
e.showSearch ? (s(),
|
|
2092
|
+
h("div", Kn, [
|
|
2093
|
+
h("div", Gn, [
|
|
2094
|
+
e.showSearch ? (s(), A(v(qe), { key: 0 }, {
|
|
2091
2095
|
default: ne(() => [
|
|
2092
|
-
|
|
2093
|
-
|
|
2096
|
+
O(v(He), { class: "pi pi-search" }),
|
|
2097
|
+
O(v(me), {
|
|
2094
2098
|
"model-value": e.crud.search.value,
|
|
2095
2099
|
placeholder: "Buscar...",
|
|
2096
2100
|
class: "w-72",
|
|
@@ -2098,54 +2102,54 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2098
2102
|
}, null, 8, ["model-value", "onInput"])
|
|
2099
2103
|
]),
|
|
2100
2104
|
_: 1
|
|
2101
|
-
})) :
|
|
2102
|
-
|
|
2103
|
-
|
|
2105
|
+
})) : w("", !0),
|
|
2106
|
+
Y(u.$slots, "toolbar-start"),
|
|
2107
|
+
Y(u.$slots, "toolbar-filters")
|
|
2104
2108
|
]),
|
|
2105
|
-
h("div",
|
|
2106
|
-
|
|
2107
|
-
e.exportCsv ?
|
|
2109
|
+
h("div", Jn, [
|
|
2110
|
+
Y(u.$slots, "toolbar-actions"),
|
|
2111
|
+
e.exportCsv ? fe((s(), A(v(ee), {
|
|
2108
2112
|
key: 0,
|
|
2109
2113
|
icon: "pi pi-download",
|
|
2110
2114
|
text: "",
|
|
2111
2115
|
size: "small",
|
|
2112
2116
|
loading: f.value,
|
|
2113
|
-
onClick:
|
|
2117
|
+
onClick: P
|
|
2114
2118
|
}, null, 8, ["loading"])), [
|
|
2115
2119
|
[
|
|
2116
|
-
|
|
2120
|
+
p,
|
|
2117
2121
|
e.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)",
|
|
2118
2122
|
void 0,
|
|
2119
2123
|
{ top: !0 }
|
|
2120
2124
|
]
|
|
2121
|
-
]) :
|
|
2122
|
-
e.viewToggle ? (s(),
|
|
2123
|
-
|
|
2125
|
+
]) : w("", !0),
|
|
2126
|
+
e.viewToggle ? (s(), m("div", Zn, [
|
|
2127
|
+
O(v(ee), {
|
|
2124
2128
|
icon: "pi pi-table",
|
|
2125
2129
|
size: "small",
|
|
2126
|
-
text: !
|
|
2127
|
-
outlined:
|
|
2128
|
-
onClick: n[1] || (n[1] = (
|
|
2130
|
+
text: !c("table"),
|
|
2131
|
+
outlined: c("table"),
|
|
2132
|
+
onClick: n[1] || (n[1] = (d) => k("table"))
|
|
2129
2133
|
}, null, 8, ["text", "outlined"]),
|
|
2130
|
-
|
|
2134
|
+
O(v(ee), {
|
|
2131
2135
|
icon: "pi pi-th-large",
|
|
2132
2136
|
size: "small",
|
|
2133
|
-
text: !
|
|
2134
|
-
outlined:
|
|
2135
|
-
onClick: n[2] || (n[2] = (
|
|
2137
|
+
text: !c("cards"),
|
|
2138
|
+
outlined: c("cards"),
|
|
2139
|
+
onClick: n[2] || (n[2] = (d) => k("cards"))
|
|
2136
2140
|
}, null, 8, ["text", "outlined"])
|
|
2137
|
-
])) :
|
|
2138
|
-
!e.showHeader && U.value ? (s(),
|
|
2141
|
+
])) : w("", !0),
|
|
2142
|
+
!e.showHeader && U.value && !e.actionRail ? (s(), A(v(ee), {
|
|
2139
2143
|
key: 2,
|
|
2140
2144
|
label: "Novo",
|
|
2141
2145
|
icon: "pi pi-plus",
|
|
2142
|
-
onClick: n[3] || (n[3] = (
|
|
2143
|
-
})) :
|
|
2146
|
+
onClick: n[3] || (n[3] = (d) => e.crud.openCreateDialog())
|
|
2147
|
+
})) : w("", !0)
|
|
2144
2148
|
])
|
|
2145
2149
|
])
|
|
2146
2150
|
]),
|
|
2147
2151
|
empty: ne(() => [
|
|
2148
|
-
|
|
2152
|
+
Y(u.$slots, "empty", {}, () => [
|
|
2149
2153
|
n[17] || (n[17] = h("div", { class: "w-crud-empty" }, [
|
|
2150
2154
|
h("div", { class: "w-crud-empty-icon" }, [
|
|
2151
2155
|
h("i", { class: "pi pi-inbox" })
|
|
@@ -2156,90 +2160,90 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2156
2160
|
])
|
|
2157
2161
|
]),
|
|
2158
2162
|
default: ne(() => [
|
|
2159
|
-
e.expandable ? (s(),
|
|
2163
|
+
e.expandable ? (s(), A(v(ze), {
|
|
2160
2164
|
key: 0,
|
|
2161
2165
|
expander: "",
|
|
2162
2166
|
style: { width: "3rem" }
|
|
2163
|
-
})) :
|
|
2164
|
-
(s(!0),
|
|
2165
|
-
key:
|
|
2166
|
-
field:
|
|
2167
|
-
header:
|
|
2168
|
-
sortable:
|
|
2169
|
-
style: je(
|
|
2170
|
-
"header-class":
|
|
2171
|
-
"body-class":
|
|
2167
|
+
})) : w("", !0),
|
|
2168
|
+
(s(!0), m(le, null, ie(V.value, (d) => (s(), A(v(ze), {
|
|
2169
|
+
key: d.field,
|
|
2170
|
+
field: d.field,
|
|
2171
|
+
header: d.header,
|
|
2172
|
+
sortable: d.sortable,
|
|
2173
|
+
style: je(d.style),
|
|
2174
|
+
"header-class": W(d),
|
|
2175
|
+
"body-class": W(d)
|
|
2172
2176
|
}, {
|
|
2173
|
-
body: ne(({ data:
|
|
2174
|
-
|
|
2175
|
-
data:
|
|
2176
|
-
value:
|
|
2177
|
+
body: ne(({ data: E }) => [
|
|
2178
|
+
Y(u.$slots, `column-${d.field}`, {
|
|
2179
|
+
data: E,
|
|
2180
|
+
value: E[d.field]
|
|
2177
2181
|
}, () => [
|
|
2178
|
-
|
|
2179
|
-
column:
|
|
2180
|
-
value:
|
|
2181
|
-
"row-data":
|
|
2182
|
+
O(Qe, {
|
|
2183
|
+
column: d,
|
|
2184
|
+
value: E[d.field],
|
|
2185
|
+
"row-data": E
|
|
2182
2186
|
}, null, 8, ["column", "value", "row-data"])
|
|
2183
2187
|
])
|
|
2184
2188
|
]),
|
|
2185
2189
|
_: 2
|
|
2186
2190
|
}, 1032, ["field", "header", "sortable", "style", "header-class", "body-class"]))), 128)),
|
|
2187
|
-
g.value && !e.actionRail ? (s(),
|
|
2191
|
+
g.value && !e.actionRail ? (s(), A(v(ze), {
|
|
2188
2192
|
key: 1,
|
|
2189
2193
|
"header-class": "w-crud-actions-header",
|
|
2190
|
-
style: je({ width: `${(
|
|
2194
|
+
style: je({ width: `${(Z.value.length + (v(l)["row-actions"] ? 1 : 0)) * 2.5 + 1}rem` })
|
|
2191
2195
|
}, {
|
|
2192
|
-
body: ne(({ data:
|
|
2193
|
-
h("div",
|
|
2194
|
-
(s(!0),
|
|
2195
|
-
key:
|
|
2196
|
+
body: ne(({ data: d }) => [
|
|
2197
|
+
h("div", Xn, [
|
|
2198
|
+
(s(!0), m(le, null, ie(Z.value, (E) => (s(), m(le, {
|
|
2199
|
+
key: E.action
|
|
2196
2200
|
}, [
|
|
2197
|
-
$(
|
|
2201
|
+
$(E, d) ? fe((s(), A(v(ee), {
|
|
2198
2202
|
key: 0,
|
|
2199
|
-
icon:
|
|
2203
|
+
icon: E.icon,
|
|
2200
2204
|
text: "",
|
|
2201
2205
|
rounded: "",
|
|
2202
2206
|
size: "small",
|
|
2203
|
-
severity:
|
|
2204
|
-
disabled:
|
|
2205
|
-
onClick: (
|
|
2207
|
+
severity: E.severity,
|
|
2208
|
+
disabled: x(E, d),
|
|
2209
|
+
onClick: (R) => b(E, d)
|
|
2206
2210
|
}, null, 8, ["icon", "severity", "disabled", "onClick"])), [
|
|
2207
2211
|
[
|
|
2208
|
-
|
|
2209
|
-
|
|
2212
|
+
p,
|
|
2213
|
+
E.tooltip,
|
|
2210
2214
|
void 0,
|
|
2211
2215
|
{ top: !0 }
|
|
2212
2216
|
]
|
|
2213
|
-
]) :
|
|
2217
|
+
]) : w("", !0)
|
|
2214
2218
|
], 64))), 128)),
|
|
2215
|
-
|
|
2216
|
-
data:
|
|
2219
|
+
Y(u.$slots, "row-actions", {
|
|
2220
|
+
data: d,
|
|
2217
2221
|
crud: e.crud
|
|
2218
2222
|
})
|
|
2219
2223
|
])
|
|
2220
2224
|
]),
|
|
2221
2225
|
_: 3
|
|
2222
|
-
}, 8, ["style"])) :
|
|
2226
|
+
}, 8, ["style"])) : w("", !0)
|
|
2223
2227
|
]),
|
|
2224
2228
|
_: 2
|
|
2225
2229
|
}, [
|
|
2226
2230
|
e.expandable ? {
|
|
2227
2231
|
name: "expansion",
|
|
2228
|
-
fn: ne((
|
|
2229
|
-
|
|
2230
|
-
data:
|
|
2232
|
+
fn: ne((d) => [
|
|
2233
|
+
Y(u.$slots, "expansion", {
|
|
2234
|
+
data: d.data
|
|
2231
2235
|
})
|
|
2232
2236
|
]),
|
|
2233
2237
|
key: "0"
|
|
2234
2238
|
} : void 0
|
|
2235
2239
|
]), 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(),
|
|
2240
|
+
])) : (s(), m("div", Qn, [
|
|
2241
|
+
h("div", _n, [
|
|
2242
|
+
h("div", eo, [
|
|
2243
|
+
e.showSearch ? (s(), A(v(qe), { key: 0 }, {
|
|
2240
2244
|
default: ne(() => [
|
|
2241
|
-
|
|
2242
|
-
|
|
2245
|
+
O(v(He), { class: "pi pi-search" }),
|
|
2246
|
+
O(v(me), {
|
|
2243
2247
|
"model-value": e.crud.search.value,
|
|
2244
2248
|
placeholder: "Buscar...",
|
|
2245
2249
|
class: "w-72",
|
|
@@ -2247,227 +2251,228 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2247
2251
|
}, null, 8, ["model-value", "onInput"])
|
|
2248
2252
|
]),
|
|
2249
2253
|
_: 1
|
|
2250
|
-
})) :
|
|
2251
|
-
|
|
2252
|
-
|
|
2254
|
+
})) : w("", !0),
|
|
2255
|
+
Y(u.$slots, "toolbar-start"),
|
|
2256
|
+
Y(u.$slots, "toolbar-filters")
|
|
2253
2257
|
]),
|
|
2254
|
-
h("div",
|
|
2255
|
-
|
|
2256
|
-
e.exportCsv ?
|
|
2258
|
+
h("div", to, [
|
|
2259
|
+
Y(u.$slots, "toolbar-actions"),
|
|
2260
|
+
e.exportCsv ? fe((s(), A(v(ee), {
|
|
2257
2261
|
key: 0,
|
|
2258
2262
|
icon: "pi pi-download",
|
|
2259
2263
|
text: "",
|
|
2260
2264
|
size: "small",
|
|
2261
2265
|
loading: f.value,
|
|
2262
|
-
onClick:
|
|
2266
|
+
onClick: P
|
|
2263
2267
|
}, null, 8, ["loading"])), [
|
|
2264
2268
|
[
|
|
2265
|
-
|
|
2269
|
+
p,
|
|
2266
2270
|
e.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)",
|
|
2267
2271
|
void 0,
|
|
2268
2272
|
{ top: !0 }
|
|
2269
2273
|
]
|
|
2270
|
-
]) :
|
|
2271
|
-
e.viewToggle ? (s(),
|
|
2272
|
-
|
|
2274
|
+
]) : w("", !0),
|
|
2275
|
+
e.viewToggle ? (s(), m("div", ao, [
|
|
2276
|
+
O(v(ee), {
|
|
2273
2277
|
icon: "pi pi-table",
|
|
2274
2278
|
size: "small",
|
|
2275
|
-
text: !
|
|
2276
|
-
outlined:
|
|
2277
|
-
onClick: n[10] || (n[10] = (
|
|
2279
|
+
text: !c("table"),
|
|
2280
|
+
outlined: c("table"),
|
|
2281
|
+
onClick: n[10] || (n[10] = (d) => k("table"))
|
|
2278
2282
|
}, null, 8, ["text", "outlined"]),
|
|
2279
|
-
|
|
2283
|
+
O(v(ee), {
|
|
2280
2284
|
icon: "pi pi-th-large",
|
|
2281
2285
|
size: "small",
|
|
2282
|
-
text: !
|
|
2283
|
-
outlined:
|
|
2284
|
-
onClick: n[11] || (n[11] = (
|
|
2286
|
+
text: !c("cards"),
|
|
2287
|
+
outlined: c("cards"),
|
|
2288
|
+
onClick: n[11] || (n[11] = (d) => k("cards"))
|
|
2285
2289
|
}, null, 8, ["text", "outlined"])
|
|
2286
|
-
])) :
|
|
2287
|
-
!e.showHeader && U.value ? (s(),
|
|
2290
|
+
])) : w("", !0),
|
|
2291
|
+
!e.showHeader && U.value && !e.actionRail ? (s(), A(v(ee), {
|
|
2288
2292
|
key: 2,
|
|
2289
2293
|
label: "Novo",
|
|
2290
2294
|
icon: "pi pi-plus",
|
|
2291
|
-
onClick: n[12] || (n[12] = (
|
|
2292
|
-
})) :
|
|
2295
|
+
onClick: n[12] || (n[12] = (d) => e.crud.openCreateDialog())
|
|
2296
|
+
})) : w("", !0)
|
|
2293
2297
|
])
|
|
2294
2298
|
]),
|
|
2295
|
-
e.crud.loading.value ? (s(),
|
|
2299
|
+
e.crud.loading.value ? (s(), m("div", no, [...n[18] || (n[18] = [
|
|
2296
2300
|
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: (
|
|
2301
|
+
])])) : e.crud.items.value.length ? (s(), m("div", oo, [
|
|
2302
|
+
(s(!0), m(le, null, ie(e.crud.items.value, (d, E) => (s(), m("div", {
|
|
2303
|
+
key: d[e.crud.config.pk || "id"] ?? E,
|
|
2304
|
+
class: re(["w-crud-card", { "w-crud-card--selected": N.value === d }]),
|
|
2305
|
+
onClick: (R) => B(d),
|
|
2306
|
+
onDblclick: (R) => e.crud.config.canEdit !== !1 && e.crud.openEditDialog(d),
|
|
2307
|
+
onContextmenu: (R) => oe(R, d)
|
|
2304
2308
|
}, [
|
|
2305
|
-
h("div",
|
|
2306
|
-
(s(!0),
|
|
2307
|
-
key:
|
|
2308
|
-
class:
|
|
2309
|
+
h("div", so, [
|
|
2310
|
+
(s(!0), m(le, null, ie(L.value, (R, G) => (s(), m("div", {
|
|
2311
|
+
key: R.field,
|
|
2312
|
+
class: re(["w-crud-card-row", { "w-crud-card-row--title": G === 0 }])
|
|
2309
2313
|
}, [
|
|
2310
|
-
|
|
2311
|
-
h("span",
|
|
2312
|
-
|
|
2313
|
-
data:
|
|
2314
|
-
value:
|
|
2314
|
+
G !== 0 ? (s(), m("span", io, T(R.header), 1)) : w("", !0),
|
|
2315
|
+
h("span", ro, [
|
|
2316
|
+
Y(u.$slots, `column-${R.field}`, {
|
|
2317
|
+
data: d,
|
|
2318
|
+
value: d[R.field]
|
|
2315
2319
|
}, () => [
|
|
2316
|
-
|
|
2317
|
-
column:
|
|
2318
|
-
value:
|
|
2319
|
-
"row-data":
|
|
2320
|
+
O(Qe, {
|
|
2321
|
+
column: R,
|
|
2322
|
+
value: d[R.field],
|
|
2323
|
+
"row-data": d
|
|
2320
2324
|
}, null, 8, ["column", "value", "row-data"])
|
|
2321
2325
|
])
|
|
2322
2326
|
])
|
|
2323
2327
|
], 2))), 128))
|
|
2324
2328
|
]),
|
|
2325
|
-
g.value && !e.actionRail ? (s(),
|
|
2326
|
-
(s(!0),
|
|
2327
|
-
key:
|
|
2329
|
+
g.value && !e.actionRail ? (s(), m("div", uo, [
|
|
2330
|
+
(s(!0), m(le, null, ie(Z.value, (R) => (s(), m(le, {
|
|
2331
|
+
key: R.action
|
|
2328
2332
|
}, [
|
|
2329
|
-
$(
|
|
2333
|
+
$(R, d) ? fe((s(), A(v(ee), {
|
|
2330
2334
|
key: 0,
|
|
2331
|
-
icon:
|
|
2335
|
+
icon: R.icon,
|
|
2332
2336
|
text: "",
|
|
2333
2337
|
rounded: "",
|
|
2334
2338
|
size: "small",
|
|
2335
|
-
severity:
|
|
2336
|
-
disabled:
|
|
2337
|
-
onClick: (
|
|
2339
|
+
severity: R.severity,
|
|
2340
|
+
disabled: x(R, d),
|
|
2341
|
+
onClick: (G) => b(R, d)
|
|
2338
2342
|
}, null, 8, ["icon", "severity", "disabled", "onClick"])), [
|
|
2339
2343
|
[
|
|
2340
|
-
|
|
2341
|
-
|
|
2344
|
+
p,
|
|
2345
|
+
R.tooltip,
|
|
2342
2346
|
void 0,
|
|
2343
2347
|
{ top: !0 }
|
|
2344
2348
|
]
|
|
2345
|
-
]) :
|
|
2349
|
+
]) : w("", !0)
|
|
2346
2350
|
], 64))), 128)),
|
|
2347
|
-
|
|
2348
|
-
data:
|
|
2351
|
+
Y(u.$slots, "row-actions", {
|
|
2352
|
+
data: d,
|
|
2349
2353
|
crud: e.crud
|
|
2350
2354
|
})
|
|
2351
|
-
])) :
|
|
2352
|
-
], 42,
|
|
2353
|
-
])) :
|
|
2354
|
-
n[19] || (n[19] =
|
|
2355
|
+
])) : w("", !0)
|
|
2356
|
+
], 42, lo))), 128))
|
|
2357
|
+
])) : Y(u.$slots, "empty", { key: 1 }, () => [
|
|
2358
|
+
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
2359
|
]),
|
|
2356
|
-
e.crud.items.value.length ? (s(),
|
|
2360
|
+
e.crud.items.value.length ? (s(), A(v(Jt), {
|
|
2357
2361
|
key: 3,
|
|
2358
2362
|
rows: e.crud.pagination.pageSize,
|
|
2359
2363
|
"total-records": e.crud.pagination.rows,
|
|
2360
|
-
first:
|
|
2364
|
+
first: F.value,
|
|
2361
2365
|
"rows-per-page-options": [10, 20, 50],
|
|
2362
2366
|
template: "CurrentPageReport PrevPageLink NextPageLink",
|
|
2363
2367
|
"current-page-report-template": "Página {currentPage} de {totalPages}",
|
|
2364
2368
|
class: "w-crud-paginator",
|
|
2365
2369
|
onPage: e.crud.onPage
|
|
2366
|
-
}, null, 8, ["rows", "total-records", "first", "onPage"])) :
|
|
2370
|
+
}, null, 8, ["rows", "total-records", "first", "onPage"])) : w("", !0)
|
|
2367
2371
|
]))
|
|
2368
2372
|
]),
|
|
2369
|
-
e.actionRail ? (s(),
|
|
2370
|
-
U.value ?
|
|
2373
|
+
e.actionRail ? (s(), m("aside", co, [
|
|
2374
|
+
U.value ? fe((s(), A(v(ee), {
|
|
2371
2375
|
key: 0,
|
|
2372
2376
|
icon: "pi pi-plus",
|
|
2373
2377
|
rounded: "",
|
|
2374
|
-
onClick: n[13] || (n[13] = (
|
|
2378
|
+
onClick: n[13] || (n[13] = (d) => e.crud.openCreateDialog())
|
|
2375
2379
|
}, null, 512)), [
|
|
2376
2380
|
[
|
|
2377
|
-
|
|
2381
|
+
p,
|
|
2378
2382
|
"Novo",
|
|
2379
2383
|
void 0,
|
|
2380
2384
|
{ left: !0 }
|
|
2381
2385
|
]
|
|
2382
|
-
]) :
|
|
2383
|
-
U.value &&
|
|
2384
|
-
(s(!0),
|
|
2385
|
-
key:
|
|
2386
|
+
]) : w("", !0),
|
|
2387
|
+
U.value && Z.value.length ? (s(), m("div", fo)) : w("", !0),
|
|
2388
|
+
(s(!0), m(le, null, ie(Z.value, (d) => (s(), m(le, {
|
|
2389
|
+
key: d.action
|
|
2386
2390
|
}, [
|
|
2387
|
-
!
|
|
2391
|
+
!N.value || $(d, N.value) ? fe((s(), A(v(ee), {
|
|
2388
2392
|
key: 0,
|
|
2389
|
-
icon:
|
|
2393
|
+
icon: d.icon,
|
|
2390
2394
|
text: "",
|
|
2391
2395
|
rounded: "",
|
|
2392
|
-
severity:
|
|
2393
|
-
disabled: !
|
|
2394
|
-
onClick: (
|
|
2396
|
+
severity: d.severity,
|
|
2397
|
+
disabled: !N.value || x(d, N.value),
|
|
2398
|
+
onClick: (E) => N.value && b(d, N.value)
|
|
2395
2399
|
}, null, 8, ["icon", "severity", "disabled", "onClick"])), [
|
|
2396
2400
|
[
|
|
2397
|
-
|
|
2398
|
-
|
|
2401
|
+
p,
|
|
2402
|
+
d.tooltip,
|
|
2399
2403
|
void 0,
|
|
2400
2404
|
{ left: !0 }
|
|
2401
2405
|
]
|
|
2402
|
-
]) :
|
|
2406
|
+
]) : w("", !0)
|
|
2403
2407
|
], 64))), 128)),
|
|
2404
|
-
|
|
2405
|
-
selected:
|
|
2408
|
+
Y(u.$slots, "rail-actions", {
|
|
2409
|
+
selected: N.value,
|
|
2406
2410
|
crud: e.crud
|
|
2407
2411
|
}),
|
|
2408
|
-
|
|
2409
|
-
|
|
2412
|
+
e.showPrint || e.exportCsv ? (s(), m("div", mo)) : w("", !0),
|
|
2413
|
+
e.showPrint ? fe((s(), A(v(ee), {
|
|
2414
|
+
key: 3,
|
|
2410
2415
|
icon: "pi pi-print",
|
|
2411
2416
|
text: "",
|
|
2412
2417
|
rounded: "",
|
|
2413
|
-
disabled: !
|
|
2414
|
-
onClick:
|
|
2415
|
-
}, null, 8, ["disabled"]), [
|
|
2418
|
+
disabled: !N.value,
|
|
2419
|
+
onClick: _
|
|
2420
|
+
}, null, 8, ["disabled"])), [
|
|
2416
2421
|
[
|
|
2417
|
-
|
|
2422
|
+
p,
|
|
2418
2423
|
"Imprimir",
|
|
2419
2424
|
void 0,
|
|
2420
2425
|
{ left: !0 }
|
|
2421
2426
|
]
|
|
2422
|
-
]),
|
|
2423
|
-
e.exportCsv ?
|
|
2424
|
-
key:
|
|
2427
|
+
]) : w("", !0),
|
|
2428
|
+
e.exportCsv ? fe((s(), A(v(ee), {
|
|
2429
|
+
key: 4,
|
|
2425
2430
|
icon: "pi pi-download",
|
|
2426
2431
|
text: "",
|
|
2427
2432
|
rounded: "",
|
|
2428
2433
|
loading: f.value,
|
|
2429
|
-
onClick:
|
|
2434
|
+
onClick: P
|
|
2430
2435
|
}, null, 8, ["loading"])), [
|
|
2431
2436
|
[
|
|
2432
|
-
|
|
2437
|
+
p,
|
|
2433
2438
|
e.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)",
|
|
2434
2439
|
void 0,
|
|
2435
2440
|
{ left: !0 }
|
|
2436
2441
|
]
|
|
2437
|
-
]) :
|
|
2438
|
-
])) :
|
|
2442
|
+
]) : w("", !0)
|
|
2443
|
+
])) : w("", !0)
|
|
2439
2444
|
], 2),
|
|
2440
|
-
e.contextMenu ? (s(),
|
|
2445
|
+
e.contextMenu ? (s(), A(v(Zt), {
|
|
2441
2446
|
key: 1,
|
|
2442
2447
|
ref_key: "cm",
|
|
2443
|
-
ref:
|
|
2444
|
-
model:
|
|
2445
|
-
}, null, 8, ["model"])) :
|
|
2446
|
-
|
|
2448
|
+
ref: K,
|
|
2449
|
+
model: ae.value
|
|
2450
|
+
}, null, 8, ["model"])) : w("", !0),
|
|
2451
|
+
Y(u.$slots, "form-dialog", {
|
|
2447
2452
|
crud: e.crud,
|
|
2448
2453
|
dialogWidth: e.dialogWidth
|
|
2449
2454
|
}, () => {
|
|
2450
|
-
var
|
|
2455
|
+
var d;
|
|
2451
2456
|
return [
|
|
2452
|
-
|
|
2457
|
+
O(ut, {
|
|
2453
2458
|
visible: e.crud.dialogVisible.value,
|
|
2454
2459
|
title: e.crud.dialogTitle.value,
|
|
2455
2460
|
fields: e.crud.config.form,
|
|
2456
2461
|
"form-data": e.crud.formData,
|
|
2457
2462
|
"is-editing": e.crud.isEditing.value,
|
|
2458
2463
|
saving: e.crud.saving.value,
|
|
2459
|
-
disabled: ((
|
|
2464
|
+
disabled: ((d = e.crud.viewMode) == null ? void 0 : d.value) ?? !1,
|
|
2460
2465
|
width: e.dialogWidth,
|
|
2461
|
-
"onUpdate:visible": n[14] || (n[14] = (
|
|
2462
|
-
e.crud.dialogVisible.value =
|
|
2466
|
+
"onUpdate:visible": n[14] || (n[14] = (E) => {
|
|
2467
|
+
e.crud.dialogVisible.value = E, E || (e.crud.editingItem.value = null);
|
|
2463
2468
|
}),
|
|
2464
|
-
"onUpdate:field": n[15] || (n[15] = (
|
|
2465
|
-
onSave: n[16] || (n[16] = (
|
|
2469
|
+
"onUpdate:field": n[15] || (n[15] = (E, R) => e.crud.setFormField(E, R)),
|
|
2470
|
+
onSave: n[16] || (n[16] = (E) => e.crud.save())
|
|
2466
2471
|
}, ot({ _: 2 }, [
|
|
2467
|
-
|
|
2468
|
-
name: `field-${
|
|
2469
|
-
fn: ne((
|
|
2470
|
-
|
|
2472
|
+
ie(e.crud.config.form, (E) => ({
|
|
2473
|
+
name: `field-${E.field}`,
|
|
2474
|
+
fn: ne((R) => [
|
|
2475
|
+
Y(u.$slots, `field-${E.field}`, lt(st(R)))
|
|
2471
2476
|
])
|
|
2472
2477
|
}))
|
|
2473
2478
|
]), 1032, ["visible", "title", "fields", "form-data", "is-editing", "saving", "disabled", "width"])
|
|
@@ -2476,7 +2481,7 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2476
2481
|
]);
|
|
2477
2482
|
};
|
|
2478
2483
|
}
|
|
2479
|
-
}),
|
|
2484
|
+
}), vo = /* @__PURE__ */ de({
|
|
2480
2485
|
__name: "WStatusTag",
|
|
2481
2486
|
props: {
|
|
2482
2487
|
value: {},
|
|
@@ -2511,15 +2516,15 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2511
2516
|
paga: { label: "Paga", severity: "success" },
|
|
2512
2517
|
inadimplente: { label: "Inadimplente", severity: "danger" }
|
|
2513
2518
|
}, o = H(() => (t.map ?? a)[t.value] ?? { label: t.value, severity: "secondary" });
|
|
2514
|
-
return (l, i) => (s(),
|
|
2519
|
+
return (l, i) => (s(), A(v(Ct), {
|
|
2515
2520
|
value: o.value.label,
|
|
2516
2521
|
severity: o.value.severity
|
|
2517
2522
|
}, null, 8, ["value", "severity"]));
|
|
2518
2523
|
}
|
|
2519
|
-
}),
|
|
2524
|
+
}), go = { class: "w-page-header" }, ho = { class: "w-page-header-content" }, yo = { class: "w-page-header-title" }, bo = {
|
|
2520
2525
|
key: 0,
|
|
2521
2526
|
class: "w-page-header-subtitle"
|
|
2522
|
-
},
|
|
2527
|
+
}, wo = { class: "w-page-header-actions" }, Xl = /* @__PURE__ */ de({
|
|
2523
2528
|
__name: "WPageHeader",
|
|
2524
2529
|
props: {
|
|
2525
2530
|
title: {},
|
|
@@ -2530,26 +2535,26 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2530
2535
|
emits: ["action"],
|
|
2531
2536
|
setup(e, { emit: t }) {
|
|
2532
2537
|
const a = t;
|
|
2533
|
-
return (o, l) => (s(),
|
|
2534
|
-
h("div",
|
|
2535
|
-
h("h2",
|
|
2536
|
-
e.subtitle ? (s(),
|
|
2538
|
+
return (o, l) => (s(), m("div", go, [
|
|
2539
|
+
h("div", ho, [
|
|
2540
|
+
h("h2", yo, T(e.title), 1),
|
|
2541
|
+
e.subtitle ? (s(), m("p", bo, T(e.subtitle), 1)) : w("", !0)
|
|
2537
2542
|
]),
|
|
2538
|
-
h("div",
|
|
2539
|
-
|
|
2540
|
-
e.actionLabel ? (s(),
|
|
2543
|
+
h("div", wo, [
|
|
2544
|
+
Y(o.$slots, "actions"),
|
|
2545
|
+
e.actionLabel ? (s(), A(v(ee), {
|
|
2541
2546
|
key: 0,
|
|
2542
2547
|
label: e.actionLabel,
|
|
2543
2548
|
icon: e.actionIcon,
|
|
2544
2549
|
onClick: l[0] || (l[0] = (i) => a("action"))
|
|
2545
|
-
}, null, 8, ["label", "icon"])) :
|
|
2550
|
+
}, null, 8, ["label", "icon"])) : w("", !0)
|
|
2546
2551
|
])
|
|
2547
2552
|
]));
|
|
2548
2553
|
}
|
|
2549
|
-
}),
|
|
2554
|
+
}), ko = { class: "w-empty-state" }, $o = { class: "w-empty-state-icon" }, Co = { class: "w-empty-state-title" }, Do = {
|
|
2550
2555
|
key: 0,
|
|
2551
2556
|
class: "w-empty-state-description"
|
|
2552
|
-
},
|
|
2557
|
+
}, Ql = /* @__PURE__ */ de({
|
|
2553
2558
|
__name: "WEmptyState",
|
|
2554
2559
|
props: {
|
|
2555
2560
|
icon: {},
|
|
@@ -2561,22 +2566,22 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2561
2566
|
emits: ["action"],
|
|
2562
2567
|
setup(e, { emit: t }) {
|
|
2563
2568
|
const a = t;
|
|
2564
|
-
return (o, l) => (s(),
|
|
2565
|
-
h("div",
|
|
2569
|
+
return (o, l) => (s(), m("div", ko, [
|
|
2570
|
+
h("div", $o, [
|
|
2566
2571
|
h("i", {
|
|
2567
|
-
class:
|
|
2572
|
+
class: re(e.icon)
|
|
2568
2573
|
}, null, 2)
|
|
2569
2574
|
]),
|
|
2570
|
-
h("p",
|
|
2571
|
-
e.description ? (s(),
|
|
2572
|
-
e.actionLabel ? (s(),
|
|
2575
|
+
h("p", Co, T(e.title), 1),
|
|
2576
|
+
e.description ? (s(), m("p", Do, T(e.description), 1)) : w("", !0),
|
|
2577
|
+
e.actionLabel ? (s(), A(v(ee), {
|
|
2573
2578
|
key: 1,
|
|
2574
2579
|
label: e.actionLabel,
|
|
2575
2580
|
icon: e.actionIcon,
|
|
2576
2581
|
size: "small",
|
|
2577
2582
|
class: "mt-3",
|
|
2578
2583
|
onClick: l[0] || (l[0] = (i) => a("action"))
|
|
2579
|
-
}, null, 8, ["label", "icon"])) :
|
|
2584
|
+
}, null, 8, ["label", "icon"])) : w("", !0)
|
|
2580
2585
|
]));
|
|
2581
2586
|
}
|
|
2582
2587
|
});
|
|
@@ -2588,7 +2593,7 @@ const In = { class: "w-crud" }, Tn = {
|
|
|
2588
2593
|
Symbol(process.env.NODE_ENV !== "production" ? "navigation failure" : "");
|
|
2589
2594
|
Symbol(process.env.NODE_ENV !== "production" ? "router view location matched" : "");
|
|
2590
2595
|
Symbol(process.env.NODE_ENV !== "production" ? "router view depth" : "");
|
|
2591
|
-
const
|
|
2596
|
+
const xo = Symbol(process.env.NODE_ENV !== "production" ? "router" : "");
|
|
2592
2597
|
Symbol(process.env.NODE_ENV !== "production" ? "route location" : "");
|
|
2593
2598
|
Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
|
|
2594
2599
|
/*!
|
|
@@ -2596,13 +2601,13 @@ Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
|
|
|
2596
2601
|
* (c) 2025 Eduardo San Martin Morote
|
|
2597
2602
|
* @license MIT
|
|
2598
2603
|
*/
|
|
2599
|
-
function
|
|
2600
|
-
return Ie(
|
|
2604
|
+
function So() {
|
|
2605
|
+
return Ie(xo);
|
|
2601
2606
|
}
|
|
2602
|
-
const
|
|
2607
|
+
const Po = { class: "w-detail-header" }, Vo = { class: "w-detail-header-left" }, Eo = { class: "w-detail-header-content" }, Mo = { class: "w-detail-header-title" }, Fo = {
|
|
2603
2608
|
key: 0,
|
|
2604
2609
|
class: "w-detail-header-subtitle"
|
|
2605
|
-
},
|
|
2610
|
+
}, Ao = { class: "w-detail-header-actions" }, _l = /* @__PURE__ */ de({
|
|
2606
2611
|
__name: "WDetailHeader",
|
|
2607
2612
|
props: {
|
|
2608
2613
|
title: {},
|
|
@@ -2614,41 +2619,41 @@ const xo = { class: "w-detail-header" }, So = { class: "w-detail-header-left" },
|
|
|
2614
2619
|
statusMap: {}
|
|
2615
2620
|
},
|
|
2616
2621
|
setup(e) {
|
|
2617
|
-
const t = e, a =
|
|
2622
|
+
const t = e, a = So();
|
|
2618
2623
|
function o() {
|
|
2619
2624
|
t.backTo ? a.push(typeof t.backTo == "string" ? { name: t.backTo } : t.backTo) : t.backRoute ? a.push({ name: t.backRoute }) : a.back();
|
|
2620
2625
|
}
|
|
2621
|
-
return (l, i) => (s(),
|
|
2622
|
-
h("div",
|
|
2623
|
-
|
|
2626
|
+
return (l, i) => (s(), m("div", Po, [
|
|
2627
|
+
h("div", Vo, [
|
|
2628
|
+
O(v(ee), {
|
|
2624
2629
|
icon: "pi pi-arrow-left",
|
|
2625
2630
|
text: "",
|
|
2626
2631
|
rounded: "",
|
|
2627
2632
|
onClick: o
|
|
2628
2633
|
}),
|
|
2629
|
-
e.icon ? (s(),
|
|
2634
|
+
e.icon ? (s(), m("i", {
|
|
2630
2635
|
key: 0,
|
|
2631
|
-
class:
|
|
2632
|
-
}, null, 2)) :
|
|
2633
|
-
h("div",
|
|
2634
|
-
h("h2",
|
|
2635
|
-
e.subtitle ? (s(),
|
|
2636
|
+
class: re([e.icon, "w-detail-header-icon"])
|
|
2637
|
+
}, null, 2)) : w("", !0),
|
|
2638
|
+
h("div", Eo, [
|
|
2639
|
+
h("h2", Mo, T(e.title), 1),
|
|
2640
|
+
e.subtitle ? (s(), m("p", Fo, T(e.subtitle), 1)) : w("", !0)
|
|
2636
2641
|
]),
|
|
2637
|
-
e.status ? (s(),
|
|
2642
|
+
e.status ? (s(), A(vo, {
|
|
2638
2643
|
key: 1,
|
|
2639
2644
|
value: e.status,
|
|
2640
2645
|
map: e.statusMap
|
|
2641
|
-
}, null, 8, ["value", "map"])) :
|
|
2646
|
+
}, null, 8, ["value", "map"])) : w("", !0)
|
|
2642
2647
|
]),
|
|
2643
|
-
h("div",
|
|
2644
|
-
|
|
2648
|
+
h("div", Ao, [
|
|
2649
|
+
Y(l.$slots, "actions")
|
|
2645
2650
|
])
|
|
2646
2651
|
]));
|
|
2647
2652
|
}
|
|
2648
|
-
}),
|
|
2653
|
+
}), Ro = { class: "w-info-card" }, Io = {
|
|
2649
2654
|
key: 0,
|
|
2650
2655
|
class: "w-info-card-title"
|
|
2651
|
-
},
|
|
2656
|
+
}, To = { class: "w-info-card-grid" }, Lo = { class: "w-info-card-label" }, zo = { class: "w-info-card-value" }, es = /* @__PURE__ */ de({
|
|
2652
2657
|
__name: "WInfoCard",
|
|
2653
2658
|
props: {
|
|
2654
2659
|
title: {},
|
|
@@ -2660,35 +2665,35 @@ const xo = { class: "w-detail-header" }, So = { class: "w-detail-header-left" },
|
|
|
2660
2665
|
const r = i.value;
|
|
2661
2666
|
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
2667
|
}
|
|
2663
|
-
return (i, r) => (s(),
|
|
2664
|
-
e.title ? (s(),
|
|
2665
|
-
h("div",
|
|
2666
|
-
(s(!0),
|
|
2668
|
+
return (i, r) => (s(), m("div", Ro, [
|
|
2669
|
+
e.title ? (s(), m("h3", Io, T(e.title), 1)) : w("", !0),
|
|
2670
|
+
h("div", To, [
|
|
2671
|
+
(s(!0), m(le, null, ie(e.fields, (y) => (s(), m("div", {
|
|
2667
2672
|
key: y.label,
|
|
2668
2673
|
class: "w-info-card-field"
|
|
2669
2674
|
}, [
|
|
2670
|
-
h("span",
|
|
2671
|
-
h("span",
|
|
2675
|
+
h("span", Lo, T(y.label), 1),
|
|
2676
|
+
h("span", zo, T(l(y)), 1)
|
|
2672
2677
|
]))), 128))
|
|
2673
2678
|
])
|
|
2674
2679
|
]));
|
|
2675
2680
|
}
|
|
2676
|
-
}),
|
|
2681
|
+
}), No = {
|
|
2677
2682
|
key: 0,
|
|
2678
2683
|
class: "w-kpi-card__loading"
|
|
2679
|
-
},
|
|
2684
|
+
}, Yo = { class: "w-kpi-card__loading-content" }, Oo = { class: "w-kpi-card__header" }, Bo = {
|
|
2680
2685
|
key: 0,
|
|
2681
2686
|
class: "w-kpi-card__icon"
|
|
2682
|
-
},
|
|
2687
|
+
}, Wo = {
|
|
2683
2688
|
key: 1,
|
|
2684
2689
|
class: "w-kpi-card__trend"
|
|
2685
|
-
},
|
|
2690
|
+
}, jo = { class: "w-kpi-card__content" }, Uo = { class: "w-kpi-card__label" }, qo = { class: "w-kpi-card__value" }, Ho = {
|
|
2686
2691
|
key: 0,
|
|
2687
2692
|
class: "w-kpi-card__hint"
|
|
2688
|
-
},
|
|
2693
|
+
}, Ko = {
|
|
2689
2694
|
key: 0,
|
|
2690
2695
|
class: "w-kpi-card__footer"
|
|
2691
|
-
},
|
|
2696
|
+
}, Go = /* @__PURE__ */ de({
|
|
2692
2697
|
__name: "WKpiCard",
|
|
2693
2698
|
props: {
|
|
2694
2699
|
label: {},
|
|
@@ -2700,67 +2705,67 @@ const xo = { class: "w-detail-header" }, So = { class: "w-detail-header-left" },
|
|
|
2700
2705
|
loading: { type: Boolean }
|
|
2701
2706
|
},
|
|
2702
2707
|
setup(e) {
|
|
2703
|
-
return (t, a) => (s(),
|
|
2704
|
-
class:
|
|
2708
|
+
return (t, a) => (s(), m("article", {
|
|
2709
|
+
class: re(["w-kpi-card", e.severity ? `w-kpi-card--${e.severity}` : ""])
|
|
2705
2710
|
}, [
|
|
2706
|
-
e.loading ? (s(),
|
|
2707
|
-
|
|
2711
|
+
e.loading ? (s(), m("div", No, [
|
|
2712
|
+
O(v(Ge), {
|
|
2708
2713
|
shape: "circle",
|
|
2709
2714
|
size: "2.75rem"
|
|
2710
2715
|
}),
|
|
2711
|
-
h("div",
|
|
2712
|
-
|
|
2716
|
+
h("div", Yo, [
|
|
2717
|
+
O(v(Ge), {
|
|
2713
2718
|
width: "6rem",
|
|
2714
2719
|
height: "0.75rem"
|
|
2715
2720
|
}),
|
|
2716
|
-
|
|
2721
|
+
O(v(Ge), {
|
|
2717
2722
|
width: "7.5rem",
|
|
2718
2723
|
height: "1.5rem"
|
|
2719
2724
|
}),
|
|
2720
|
-
|
|
2725
|
+
O(v(Ge), {
|
|
2721
2726
|
width: "5rem",
|
|
2722
2727
|
height: "0.75rem"
|
|
2723
2728
|
})
|
|
2724
2729
|
])
|
|
2725
|
-
])) : (s(),
|
|
2726
|
-
h("div",
|
|
2727
|
-
e.icon || t.$slots.icon ? (s(),
|
|
2728
|
-
|
|
2729
|
-
e.icon ? (s(),
|
|
2730
|
+
])) : (s(), m(le, { key: 1 }, [
|
|
2731
|
+
h("div", Oo, [
|
|
2732
|
+
e.icon || t.$slots.icon ? (s(), m("div", Bo, [
|
|
2733
|
+
Y(t.$slots, "icon", {}, () => [
|
|
2734
|
+
e.icon ? (s(), m("i", {
|
|
2730
2735
|
key: 0,
|
|
2731
|
-
class:
|
|
2732
|
-
}, null, 2)) :
|
|
2736
|
+
class: re(e.icon)
|
|
2737
|
+
}, null, 2)) : w("", !0)
|
|
2733
2738
|
])
|
|
2734
|
-
])) :
|
|
2735
|
-
e.trend || t.$slots.trend ? (s(),
|
|
2736
|
-
|
|
2737
|
-
e.trend ? (s(),
|
|
2739
|
+
])) : w("", !0),
|
|
2740
|
+
e.trend || t.$slots.trend ? (s(), m("div", Wo, [
|
|
2741
|
+
Y(t.$slots, "trend", {}, () => [
|
|
2742
|
+
e.trend ? (s(), m("span", {
|
|
2738
2743
|
key: 0,
|
|
2739
|
-
class:
|
|
2740
|
-
}, T(e.trend.value), 3)) :
|
|
2744
|
+
class: re(["w-kpi-card__trend-badge", e.trend.direction ? `w-kpi-card__trend-badge--${e.trend.direction}` : ""])
|
|
2745
|
+
}, T(e.trend.value), 3)) : w("", !0)
|
|
2741
2746
|
])
|
|
2742
|
-
])) :
|
|
2747
|
+
])) : w("", !0)
|
|
2743
2748
|
]),
|
|
2744
|
-
h("div",
|
|
2745
|
-
h("p",
|
|
2746
|
-
h("div",
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
+
h("div", jo, [
|
|
2750
|
+
h("p", Uo, T(e.label), 1),
|
|
2751
|
+
h("div", qo, [
|
|
2752
|
+
Y(t.$slots, "value", {}, () => [
|
|
2753
|
+
Pe(T(e.value), 1)
|
|
2749
2754
|
])
|
|
2750
2755
|
]),
|
|
2751
|
-
e.hint || t.$slots.hint ? (s(),
|
|
2752
|
-
|
|
2753
|
-
|
|
2756
|
+
e.hint || t.$slots.hint ? (s(), m("p", Ho, [
|
|
2757
|
+
Y(t.$slots, "hint", {}, () => [
|
|
2758
|
+
Pe(T(e.hint), 1)
|
|
2754
2759
|
])
|
|
2755
|
-
])) :
|
|
2760
|
+
])) : w("", !0)
|
|
2756
2761
|
]),
|
|
2757
|
-
t.$slots.footer ? (s(),
|
|
2758
|
-
|
|
2759
|
-
])) :
|
|
2762
|
+
t.$slots.footer ? (s(), m("footer", Ko, [
|
|
2763
|
+
Y(t.$slots, "footer")
|
|
2764
|
+
])) : w("", !0)
|
|
2760
2765
|
], 64))
|
|
2761
2766
|
], 2));
|
|
2762
2767
|
}
|
|
2763
|
-
}),
|
|
2768
|
+
}), ts = /* @__PURE__ */ de({
|
|
2764
2769
|
__name: "WKpiGrid",
|
|
2765
2770
|
props: {
|
|
2766
2771
|
items: { default: () => [] },
|
|
@@ -2772,14 +2777,14 @@ const xo = { class: "w-detail-header" }, So = { class: "w-detail-header-left" },
|
|
|
2772
2777
|
`w-kpi-grid--cols-${t.columns}`,
|
|
2773
2778
|
{ "w-kpi-grid--dense": t.dense }
|
|
2774
2779
|
]);
|
|
2775
|
-
return (o, l) => (s(),
|
|
2776
|
-
class:
|
|
2780
|
+
return (o, l) => (s(), m("div", {
|
|
2781
|
+
class: re(["w-kpi-grid", a.value])
|
|
2777
2782
|
}, [
|
|
2778
|
-
o.$slots.item ? (s(!0),
|
|
2783
|
+
o.$slots.item ? (s(!0), m(le, { key: 0 }, ie(e.items, (i, r) => Y(o.$slots, "item", {
|
|
2779
2784
|
key: r,
|
|
2780
2785
|
item: i,
|
|
2781
2786
|
index: r
|
|
2782
|
-
})), 128)) : (s(!0),
|
|
2787
|
+
})), 128)) : (s(!0), m(le, { key: 1 }, ie(e.items, (i, r) => (s(), A(Go, {
|
|
2783
2788
|
key: r,
|
|
2784
2789
|
label: i.label,
|
|
2785
2790
|
value: i.value,
|
|
@@ -2791,16 +2796,16 @@ const xo = { class: "w-detail-header" }, So = { class: "w-detail-header-left" },
|
|
|
2791
2796
|
}, null, 8, ["label", "value", "icon", "severity", "hint", "trend", "loading"]))), 128))
|
|
2792
2797
|
], 2));
|
|
2793
2798
|
}
|
|
2794
|
-
}),
|
|
2799
|
+
}), Jo = { class: "w-section-header__main" }, Zo = {
|
|
2795
2800
|
key: 0,
|
|
2796
2801
|
class: "w-section-header__icon"
|
|
2797
|
-
},
|
|
2802
|
+
}, Xo = { class: "w-section-header__content" }, Qo = { class: "w-section-header__title-row" }, _o = { class: "w-section-header__title" }, el = {
|
|
2798
2803
|
key: 0,
|
|
2799
2804
|
class: "w-section-header__subtitle"
|
|
2800
|
-
},
|
|
2805
|
+
}, tl = {
|
|
2801
2806
|
key: 0,
|
|
2802
2807
|
class: "w-section-header__actions"
|
|
2803
|
-
},
|
|
2808
|
+
}, as = /* @__PURE__ */ de({
|
|
2804
2809
|
__name: "WSectionHeader",
|
|
2805
2810
|
props: {
|
|
2806
2811
|
title: {},
|
|
@@ -2809,41 +2814,41 @@ const xo = { class: "w-detail-header" }, So = { class: "w-detail-header-left" },
|
|
|
2809
2814
|
compact: { type: Boolean }
|
|
2810
2815
|
},
|
|
2811
2816
|
setup(e) {
|
|
2812
|
-
return (t, a) => (s(),
|
|
2813
|
-
class:
|
|
2817
|
+
return (t, a) => (s(), m("div", {
|
|
2818
|
+
class: re(["w-section-header", { "w-section-header--compact": e.compact }])
|
|
2814
2819
|
}, [
|
|
2815
|
-
h("div",
|
|
2816
|
-
e.icon || t.$slots.icon ? (s(),
|
|
2817
|
-
|
|
2818
|
-
e.icon ? (s(),
|
|
2820
|
+
h("div", Jo, [
|
|
2821
|
+
e.icon || t.$slots.icon ? (s(), m("div", Zo, [
|
|
2822
|
+
Y(t.$slots, "icon", {}, () => [
|
|
2823
|
+
e.icon ? (s(), m("i", {
|
|
2819
2824
|
key: 0,
|
|
2820
|
-
class:
|
|
2821
|
-
}, null, 2)) :
|
|
2825
|
+
class: re(e.icon)
|
|
2826
|
+
}, null, 2)) : w("", !0)
|
|
2822
2827
|
])
|
|
2823
|
-
])) :
|
|
2824
|
-
h("div",
|
|
2825
|
-
h("div",
|
|
2826
|
-
h("h3",
|
|
2827
|
-
|
|
2828
|
+
])) : w("", !0),
|
|
2829
|
+
h("div", Xo, [
|
|
2830
|
+
h("div", Qo, [
|
|
2831
|
+
h("h3", _o, T(e.title), 1),
|
|
2832
|
+
Y(t.$slots, "meta")
|
|
2828
2833
|
]),
|
|
2829
|
-
e.subtitle ? (s(),
|
|
2834
|
+
e.subtitle ? (s(), m("p", el, T(e.subtitle), 1)) : w("", !0)
|
|
2830
2835
|
])
|
|
2831
2836
|
]),
|
|
2832
|
-
t.$slots.actions ? (s(),
|
|
2833
|
-
|
|
2834
|
-
])) :
|
|
2837
|
+
t.$slots.actions ? (s(), m("div", tl, [
|
|
2838
|
+
Y(t.$slots, "actions")
|
|
2839
|
+
])) : w("", !0)
|
|
2835
2840
|
], 2));
|
|
2836
2841
|
}
|
|
2837
|
-
}),
|
|
2842
|
+
}), al = {
|
|
2838
2843
|
key: 0,
|
|
2839
2844
|
class: "w-form-section__header"
|
|
2840
|
-
},
|
|
2845
|
+
}, nl = { class: "w-form-section__content" }, ol = { class: "w-form-section__title" }, ll = {
|
|
2841
2846
|
key: 0,
|
|
2842
2847
|
class: "w-form-section__description"
|
|
2843
|
-
},
|
|
2848
|
+
}, sl = {
|
|
2844
2849
|
key: 0,
|
|
2845
2850
|
class: "w-form-section__actions"
|
|
2846
|
-
},
|
|
2851
|
+
}, il = { class: "w-form-section__body" }, ns = /* @__PURE__ */ de({
|
|
2847
2852
|
__name: "WFormSection",
|
|
2848
2853
|
props: {
|
|
2849
2854
|
title: {},
|
|
@@ -2851,62 +2856,62 @@ const xo = { class: "w-detail-header" }, So = { class: "w-detail-header-left" },
|
|
|
2851
2856
|
variant: {}
|
|
2852
2857
|
},
|
|
2853
2858
|
setup(e) {
|
|
2854
|
-
return (t, a) => (s(),
|
|
2855
|
-
class:
|
|
2859
|
+
return (t, a) => (s(), m("section", {
|
|
2860
|
+
class: re(["w-form-section", e.variant ? `w-form-section--${e.variant}` : ""])
|
|
2856
2861
|
}, [
|
|
2857
|
-
e.title || e.description || t.$slots.actions ? (s(),
|
|
2858
|
-
h("div",
|
|
2859
|
-
h("h3",
|
|
2860
|
-
e.description ? (s(),
|
|
2862
|
+
e.title || e.description || t.$slots.actions ? (s(), m("div", al, [
|
|
2863
|
+
h("div", nl, [
|
|
2864
|
+
h("h3", ol, T(e.title), 1),
|
|
2865
|
+
e.description ? (s(), m("p", ll, T(e.description), 1)) : w("", !0)
|
|
2861
2866
|
]),
|
|
2862
|
-
t.$slots.actions ? (s(),
|
|
2863
|
-
|
|
2864
|
-
])) :
|
|
2865
|
-
])) :
|
|
2866
|
-
h("div",
|
|
2867
|
-
|
|
2867
|
+
t.$slots.actions ? (s(), m("div", sl, [
|
|
2868
|
+
Y(t.$slots, "actions")
|
|
2869
|
+
])) : w("", !0)
|
|
2870
|
+
])) : w("", !0),
|
|
2871
|
+
h("div", il, [
|
|
2872
|
+
Y(t.$slots, "default")
|
|
2868
2873
|
])
|
|
2869
2874
|
], 2));
|
|
2870
2875
|
}
|
|
2871
|
-
}),
|
|
2876
|
+
}), rl = {
|
|
2872
2877
|
key: 0,
|
|
2873
2878
|
class: "w-action-bar__primary"
|
|
2874
|
-
},
|
|
2879
|
+
}, ul = {
|
|
2875
2880
|
key: 1,
|
|
2876
2881
|
class: "w-action-bar__filters"
|
|
2877
|
-
},
|
|
2882
|
+
}, dl = {
|
|
2878
2883
|
key: 2,
|
|
2879
2884
|
class: "w-action-bar__secondary"
|
|
2880
|
-
},
|
|
2885
|
+
}, os = /* @__PURE__ */ de({
|
|
2881
2886
|
__name: "WActionBar",
|
|
2882
2887
|
props: {
|
|
2883
2888
|
align: { default: "between" },
|
|
2884
2889
|
stackOnMobile: { type: Boolean, default: !0 }
|
|
2885
2890
|
},
|
|
2886
2891
|
setup(e) {
|
|
2887
|
-
return (t, a) => (s(),
|
|
2888
|
-
class:
|
|
2892
|
+
return (t, a) => (s(), m("div", {
|
|
2893
|
+
class: re(["w-action-bar", [
|
|
2889
2894
|
`w-action-bar--${e.align}`,
|
|
2890
2895
|
{ "w-action-bar--stack": e.stackOnMobile }
|
|
2891
2896
|
]])
|
|
2892
2897
|
}, [
|
|
2893
|
-
t.$slots.primary || t.$slots.default ? (s(),
|
|
2894
|
-
|
|
2895
|
-
|
|
2898
|
+
t.$slots.primary || t.$slots.default ? (s(), m("div", rl, [
|
|
2899
|
+
Y(t.$slots, "primary", {}, () => [
|
|
2900
|
+
Y(t.$slots, "default")
|
|
2896
2901
|
])
|
|
2897
|
-
])) :
|
|
2898
|
-
t.$slots.filters ? (s(),
|
|
2899
|
-
|
|
2900
|
-
])) :
|
|
2901
|
-
t.$slots.secondary ? (s(),
|
|
2902
|
-
|
|
2903
|
-
])) :
|
|
2902
|
+
])) : w("", !0),
|
|
2903
|
+
t.$slots.filters ? (s(), m("div", ul, [
|
|
2904
|
+
Y(t.$slots, "filters")
|
|
2905
|
+
])) : w("", !0),
|
|
2906
|
+
t.$slots.secondary ? (s(), m("div", dl, [
|
|
2907
|
+
Y(t.$slots, "secondary")
|
|
2908
|
+
])) : w("", !0)
|
|
2904
2909
|
], 2));
|
|
2905
2910
|
}
|
|
2906
|
-
}),
|
|
2911
|
+
}), cl = { class: "w-progress-flow__marker" }, fl = { class: "w-progress-flow__content" }, ml = { class: "w-progress-flow__label" }, pl = {
|
|
2907
2912
|
key: 0,
|
|
2908
2913
|
class: "w-progress-flow__description"
|
|
2909
|
-
},
|
|
2914
|
+
}, ls = /* @__PURE__ */ de({
|
|
2910
2915
|
__name: "WProgressFlow",
|
|
2911
2916
|
props: {
|
|
2912
2917
|
steps: {},
|
|
@@ -2920,31 +2925,31 @@ const xo = { class: "w-detail-header" }, So = { class: "w-detail-header-left" },
|
|
|
2920
2925
|
function o(l) {
|
|
2921
2926
|
return l < a.value ? "done" : l === a.value ? "current" : "pending";
|
|
2922
2927
|
}
|
|
2923
|
-
return (l, i) => (s(),
|
|
2924
|
-
class:
|
|
2928
|
+
return (l, i) => (s(), m("div", {
|
|
2929
|
+
class: re(["w-progress-flow", `w-progress-flow--${e.orientation}`])
|
|
2925
2930
|
}, [
|
|
2926
|
-
(s(!0),
|
|
2931
|
+
(s(!0), m(le, null, ie(e.steps, (r, y) => (s(), m("div", {
|
|
2927
2932
|
key: r.key,
|
|
2928
|
-
class:
|
|
2933
|
+
class: re(["w-progress-flow__step", `w-progress-flow__step--${o(y)}`])
|
|
2929
2934
|
}, [
|
|
2930
|
-
|
|
2935
|
+
Y(l.$slots, "step", {
|
|
2931
2936
|
step: r,
|
|
2932
2937
|
index: y,
|
|
2933
2938
|
state: o(y)
|
|
2934
2939
|
}, () => [
|
|
2935
|
-
h("div",
|
|
2940
|
+
h("div", cl, [
|
|
2936
2941
|
h("span", null, T(y + 1), 1)
|
|
2937
2942
|
]),
|
|
2938
|
-
h("div",
|
|
2939
|
-
h("p",
|
|
2940
|
-
r.description ? (s(),
|
|
2943
|
+
h("div", fl, [
|
|
2944
|
+
h("p", ml, T(r.label), 1),
|
|
2945
|
+
r.description ? (s(), m("p", pl, T(r.description), 1)) : w("", !0)
|
|
2941
2946
|
])
|
|
2942
2947
|
])
|
|
2943
2948
|
], 2))), 128))
|
|
2944
2949
|
], 2));
|
|
2945
2950
|
}
|
|
2946
2951
|
});
|
|
2947
|
-
function
|
|
2952
|
+
function vl(e, t, a) {
|
|
2948
2953
|
const o = e;
|
|
2949
2954
|
return Array.isArray(o.results) ? {
|
|
2950
2955
|
data: o.results,
|
|
@@ -2966,11 +2971,11 @@ function ml(e, t, a) {
|
|
|
2966
2971
|
extras: {}
|
|
2967
2972
|
};
|
|
2968
2973
|
}
|
|
2969
|
-
function
|
|
2974
|
+
function gl(e) {
|
|
2970
2975
|
return {
|
|
2971
2976
|
async list(t, a = {}) {
|
|
2972
2977
|
const o = await e.get(t, { params: a });
|
|
2973
|
-
return
|
|
2978
|
+
return vl(
|
|
2974
2979
|
o.data,
|
|
2975
2980
|
Number(a.page ?? 1),
|
|
2976
2981
|
Number(a.page_size ?? 20)
|
|
@@ -2994,13 +2999,13 @@ function pl(e) {
|
|
|
2994
2999
|
}
|
|
2995
3000
|
};
|
|
2996
3001
|
}
|
|
2997
|
-
const
|
|
3002
|
+
const ss = {
|
|
2998
3003
|
install(e, t) {
|
|
2999
3004
|
if (!(t != null && t.axios) && !(t != null && t.dataProvider))
|
|
3000
3005
|
throw new Error(
|
|
3001
3006
|
'[wPrimeVueComponents] Informe "axios" ou "dataProvider" ao registrar o WPrimeVuePlugin.'
|
|
3002
3007
|
);
|
|
3003
|
-
const a = t.dataProvider ??
|
|
3008
|
+
const a = t.dataProvider ?? gl(t.axios), o = {
|
|
3004
3009
|
axios: t.axios,
|
|
3005
3010
|
dataProvider: a,
|
|
3006
3011
|
defaultPageSize: t.defaultPageSize ?? 20,
|
|
@@ -3009,9 +3014,9 @@ const os = {
|
|
|
3009
3014
|
locale: t.locale ?? "pt-BR",
|
|
3010
3015
|
currency: t.currency ?? "BRL"
|
|
3011
3016
|
};
|
|
3012
|
-
t.axios && e.provide(
|
|
3017
|
+
t.axios && e.provide(la, t.axios), e.provide(_e, a), e.provide(et, o), t.registerComponents !== !1 && (e.component("WCrudView", po), e.component("WCrudFormDialog", ut), e.component("WCrudColumnRenderer", Qe), e.component("WAutoCompleteFK", Lt), e.component("WMoneyInput", zt), e.component("WTransferList", Nt));
|
|
3013
3018
|
}
|
|
3014
|
-
},
|
|
3019
|
+
}, hl = {
|
|
3015
3020
|
createTitle: "Novo Registro",
|
|
3016
3021
|
editTitle: "Editar Registro",
|
|
3017
3022
|
createButton: "Novo",
|
|
@@ -3026,13 +3031,13 @@ const os = {
|
|
|
3026
3031
|
successUpdate: "Registro atualizado com sucesso",
|
|
3027
3032
|
successDelete: "Registro excluído com sucesso"
|
|
3028
3033
|
};
|
|
3029
|
-
function
|
|
3034
|
+
function yl(e, t) {
|
|
3030
3035
|
const a = {};
|
|
3031
3036
|
for (const o of Object.keys(t))
|
|
3032
3037
|
JSON.stringify(e[o]) !== JSON.stringify(t[o]) && (a[o] = t[o]);
|
|
3033
3038
|
return a;
|
|
3034
3039
|
}
|
|
3035
|
-
function
|
|
3040
|
+
function is(e) {
|
|
3036
3041
|
const {
|
|
3037
3042
|
endpoint: t,
|
|
3038
3043
|
columns: a,
|
|
@@ -3040,357 +3045,362 @@ function ls(e) {
|
|
|
3040
3045
|
pk: l = "id",
|
|
3041
3046
|
searchDebounce: i = 300,
|
|
3042
3047
|
partialUpdate: r = !0,
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3048
|
+
refetchOnSave: y = !0,
|
|
3049
|
+
canCreate: c = !0,
|
|
3050
|
+
canEdit: k = !0,
|
|
3051
|
+
canDelete: F = !0,
|
|
3052
|
+
rowActions: V = void 0,
|
|
3053
|
+
filterParams: W = void 0,
|
|
3054
|
+
createDefaults: L = void 0,
|
|
3055
|
+
transformPayload: J = void 0,
|
|
3050
3056
|
onAfterSave: Z = void 0,
|
|
3051
|
-
onAfterDelete:
|
|
3052
|
-
} = e,
|
|
3053
|
-
if (!
|
|
3057
|
+
onAfterDelete: g = void 0
|
|
3058
|
+
} = e, b = Ie(_e);
|
|
3059
|
+
if (!b)
|
|
3054
3060
|
throw new Error(
|
|
3055
3061
|
"[wPrimeVueComponents] dataProvider não encontrado. Registre o WPrimeVuePlugin antes de usar useCrudManager."
|
|
3056
3062
|
);
|
|
3057
|
-
const
|
|
3058
|
-
let
|
|
3059
|
-
const
|
|
3063
|
+
const $ = b, x = Ie(et), j = e.pageSize ?? (x == null ? void 0 : x.defaultPageSize) ?? 20, U = { ...hl, ...e.labels }, N = 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({});
|
|
3064
|
+
let p = null;
|
|
3065
|
+
const d = ge({
|
|
3060
3066
|
page: 1,
|
|
3061
|
-
pageSize:
|
|
3067
|
+
pageSize: j,
|
|
3062
3068
|
rows: 0,
|
|
3063
3069
|
totalPages: 0
|
|
3064
|
-
}),
|
|
3070
|
+
}), E = ge({
|
|
3065
3071
|
field: null,
|
|
3066
3072
|
order: 0
|
|
3067
3073
|
});
|
|
3068
|
-
function
|
|
3074
|
+
function R() {
|
|
3069
3075
|
const D = {};
|
|
3070
|
-
for (const
|
|
3071
|
-
D[
|
|
3076
|
+
for (const M of o)
|
|
3077
|
+
D[M.field] = M.defaultValue !== void 0 ? typeof M.defaultValue == "function" ? M.defaultValue() : M.defaultValue : null;
|
|
3072
3078
|
return D;
|
|
3073
3079
|
}
|
|
3074
|
-
const
|
|
3075
|
-
for (const D of Object.keys(
|
|
3076
|
-
|
|
3077
|
-
const
|
|
3078
|
-
() =>
|
|
3079
|
-
),
|
|
3080
|
-
() =>
|
|
3081
|
-
),
|
|
3082
|
-
let
|
|
3083
|
-
async function
|
|
3084
|
-
|
|
3080
|
+
const G = R();
|
|
3081
|
+
for (const D of Object.keys(G))
|
|
3082
|
+
n[D] = G[D];
|
|
3083
|
+
const se = H(
|
|
3084
|
+
() => u.value !== null && !P.value
|
|
3085
|
+
), pe = H(() => P.value), Ne = H(
|
|
3086
|
+
() => P.value ? U.viewTitle ?? "Visualizar Registro" : se.value ? U.editTitle : U.createTitle
|
|
3087
|
+
), Ye = H(() => d.page <= 1), we = H(() => d.page >= d.totalPages);
|
|
3088
|
+
let ke = null;
|
|
3089
|
+
async function ue(D = {}) {
|
|
3090
|
+
oe.value = !0;
|
|
3085
3091
|
try {
|
|
3086
|
-
const
|
|
3087
|
-
page:
|
|
3088
|
-
page_size:
|
|
3092
|
+
const M = {
|
|
3093
|
+
page: d.page,
|
|
3094
|
+
page_size: d.pageSize,
|
|
3089
3095
|
...D
|
|
3090
3096
|
};
|
|
3091
|
-
_.value && (
|
|
3092
|
-
const
|
|
3093
|
-
|
|
3097
|
+
_.value && (M.search = _.value), E.field && E.order !== 0 && (M.ordering = E.order === -1 ? `-${E.field}` : E.field), W && Object.assign(M, W());
|
|
3098
|
+
const I = await $.list(t, M);
|
|
3099
|
+
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
3100
|
} finally {
|
|
3095
|
-
|
|
3101
|
+
oe.value = !1;
|
|
3096
3102
|
}
|
|
3097
3103
|
}
|
|
3098
|
-
async function ye() {
|
|
3099
|
-
await me();
|
|
3100
|
-
}
|
|
3101
3104
|
async function ve() {
|
|
3102
|
-
await
|
|
3105
|
+
await ue();
|
|
3106
|
+
}
|
|
3107
|
+
async function Ce() {
|
|
3108
|
+
await ue();
|
|
3103
3109
|
}
|
|
3104
|
-
async function
|
|
3105
|
-
const
|
|
3106
|
-
_.value && (
|
|
3107
|
-
const
|
|
3110
|
+
async function Ee(D = 200) {
|
|
3111
|
+
const M = {};
|
|
3112
|
+
_.value && (M.search = _.value), E.field && E.order !== 0 && (M.ordering = E.order === -1 ? `-${E.field}` : E.field), W && Object.assign(M, W());
|
|
3113
|
+
const I = [];
|
|
3108
3114
|
let Q = 1;
|
|
3109
3115
|
const Le = 1e4;
|
|
3110
3116
|
for (; Q <= Le; ) {
|
|
3111
|
-
const
|
|
3112
|
-
...
|
|
3117
|
+
const be = await $.list(t, {
|
|
3118
|
+
...M,
|
|
3113
3119
|
page: Q,
|
|
3114
3120
|
page_size: D
|
|
3115
3121
|
});
|
|
3116
|
-
|
|
3117
|
-
const
|
|
3118
|
-
if (
|
|
3122
|
+
I.push(...be.data);
|
|
3123
|
+
const he = be.rows ?? I.length;
|
|
3124
|
+
if (be.data.length === 0 || I.length >= he) break;
|
|
3119
3125
|
Q++;
|
|
3120
3126
|
}
|
|
3121
|
-
return
|
|
3127
|
+
return I;
|
|
3122
3128
|
}
|
|
3123
|
-
function
|
|
3124
|
-
_.value = D,
|
|
3125
|
-
|
|
3129
|
+
function De(D) {
|
|
3130
|
+
_.value = D, ke && clearTimeout(ke), ke = setTimeout(() => {
|
|
3131
|
+
d.page = 1, ue();
|
|
3126
3132
|
}, i);
|
|
3127
3133
|
}
|
|
3128
|
-
function
|
|
3129
|
-
const
|
|
3130
|
-
|
|
3134
|
+
function Me(D) {
|
|
3135
|
+
const M = D.target;
|
|
3136
|
+
De(M.value);
|
|
3131
3137
|
}
|
|
3132
|
-
function
|
|
3133
|
-
|
|
3138
|
+
function ye(D) {
|
|
3139
|
+
d.page = D, ue();
|
|
3134
3140
|
}
|
|
3135
|
-
function
|
|
3136
|
-
|
|
3141
|
+
function xe() {
|
|
3142
|
+
ye(1);
|
|
3137
3143
|
}
|
|
3138
|
-
function
|
|
3139
|
-
|
|
3144
|
+
function Fe() {
|
|
3145
|
+
ye(d.totalPages);
|
|
3140
3146
|
}
|
|
3141
3147
|
function Ae(D) {
|
|
3142
|
-
|
|
3148
|
+
d.page = D.page + 1, d.pageSize = D.rows, ue();
|
|
3143
3149
|
}
|
|
3144
3150
|
function Re(D) {
|
|
3145
|
-
|
|
3151
|
+
E.field = D.sortField ?? null, E.order = D.sortOrder ?? 0, d.page = 1, ue();
|
|
3146
3152
|
}
|
|
3147
|
-
function
|
|
3148
|
-
const D =
|
|
3149
|
-
for (const
|
|
3150
|
-
|
|
3153
|
+
function C() {
|
|
3154
|
+
const D = R();
|
|
3155
|
+
for (const M of Object.keys(D))
|
|
3156
|
+
n[M] = D[M];
|
|
3151
3157
|
}
|
|
3152
|
-
function
|
|
3153
|
-
|
|
3158
|
+
function S(D, M) {
|
|
3159
|
+
n[D] = M;
|
|
3154
3160
|
}
|
|
3155
|
-
function
|
|
3156
|
-
if (
|
|
3157
|
-
const D =
|
|
3158
|
-
for (const [
|
|
3159
|
-
|
|
3161
|
+
function te() {
|
|
3162
|
+
if (P.value = !1, u.value = null, p = null, C(), L) {
|
|
3163
|
+
const D = L();
|
|
3164
|
+
for (const [M, I] of Object.entries(D))
|
|
3165
|
+
n[M] = I;
|
|
3160
3166
|
}
|
|
3161
|
-
|
|
3167
|
+
f.value = !0;
|
|
3162
3168
|
}
|
|
3163
|
-
function
|
|
3164
|
-
const
|
|
3165
|
-
for (const
|
|
3166
|
-
let Q = D[
|
|
3167
|
-
Q && (
|
|
3169
|
+
function z(D) {
|
|
3170
|
+
const M = {};
|
|
3171
|
+
for (const I of o) {
|
|
3172
|
+
let Q = D[I.field] !== void 0 ? D[I.field] : null;
|
|
3173
|
+
Q && (I.type === "date" || I.type === "datetime") && typeof Q == "string" && (Q = it(Q)), n[I.field] = Q, M[I.field] = Q;
|
|
3168
3174
|
}
|
|
3169
|
-
|
|
3175
|
+
p = M;
|
|
3170
3176
|
}
|
|
3171
|
-
function
|
|
3172
|
-
|
|
3173
|
-
}
|
|
3174
|
-
function ue(D) {
|
|
3175
|
-
f.value = !0, x.value = D, te(D), ee.value = !0;
|
|
3177
|
+
function ce(D) {
|
|
3178
|
+
P.value = !1, u.value = D, z(D), f.value = !0;
|
|
3176
3179
|
}
|
|
3177
3180
|
function Ot(D) {
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3181
|
+
P.value = !0, u.value = D, z(D), f.value = !0;
|
|
3182
|
+
}
|
|
3183
|
+
function Bt(D) {
|
|
3184
|
+
P.value = !1, u.value = null, p = null, C();
|
|
3185
|
+
for (const M of o) {
|
|
3186
|
+
if (M.field === l) continue;
|
|
3187
|
+
let I = D[M.field] !== void 0 ? D[M.field] : n[M.field];
|
|
3188
|
+
I && (M.type === "date" || M.type === "datetime") && typeof I == "string" && (I = it(I)), n[M.field] = I;
|
|
3183
3189
|
}
|
|
3184
|
-
if (
|
|
3185
|
-
const
|
|
3186
|
-
for (const [
|
|
3187
|
-
|
|
3190
|
+
if (L) {
|
|
3191
|
+
const M = L();
|
|
3192
|
+
for (const [I, Q] of Object.entries(M))
|
|
3193
|
+
n[I] = Q;
|
|
3188
3194
|
}
|
|
3189
|
-
|
|
3195
|
+
f.value = !0;
|
|
3190
3196
|
}
|
|
3191
3197
|
function dt(D) {
|
|
3192
|
-
const
|
|
3193
|
-
for (const
|
|
3194
|
-
const Q =
|
|
3195
|
-
if (
|
|
3196
|
-
const Le =
|
|
3197
|
-
|
|
3198
|
+
const M = { ...D };
|
|
3199
|
+
for (const I of o) {
|
|
3200
|
+
const Q = M[I.field];
|
|
3201
|
+
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") {
|
|
3202
|
+
const Le = I.optionValue || "id";
|
|
3203
|
+
M[I.field] = Q[Le] ?? Q;
|
|
3198
3204
|
}
|
|
3199
|
-
(
|
|
3205
|
+
(I.type === "mask" || I.type === "cpf_cnpj") && typeof Q == "string" && (M[I.field] = Ve(Q));
|
|
3200
3206
|
}
|
|
3201
|
-
return
|
|
3207
|
+
return M;
|
|
3202
3208
|
}
|
|
3203
|
-
async function
|
|
3209
|
+
async function Wt() {
|
|
3204
3210
|
for (const D of o) {
|
|
3205
3211
|
if (D.validate) {
|
|
3206
|
-
const
|
|
3207
|
-
if (
|
|
3208
|
-
return
|
|
3212
|
+
const M = D.validate(n[D.field]);
|
|
3213
|
+
if (M)
|
|
3214
|
+
return N.error(M), null;
|
|
3209
3215
|
}
|
|
3210
3216
|
if (D.required) {
|
|
3211
|
-
const
|
|
3212
|
-
if (
|
|
3213
|
-
return
|
|
3217
|
+
const M = n[D.field];
|
|
3218
|
+
if (M == null || M === "")
|
|
3219
|
+
return N.error(`${D.label} é obrigatório`), null;
|
|
3214
3220
|
}
|
|
3215
3221
|
}
|
|
3216
|
-
|
|
3222
|
+
ae.value = !0;
|
|
3217
3223
|
try {
|
|
3218
|
-
let D = dt(
|
|
3219
|
-
if (!
|
|
3220
|
-
const
|
|
3221
|
-
if (D =
|
|
3222
|
-
|
|
3223
|
-
const
|
|
3224
|
-
return
|
|
3224
|
+
let D = dt(n);
|
|
3225
|
+
if (!se.value && L && Object.assign(D, L()), se.value && r && p) {
|
|
3226
|
+
const he = dt(p);
|
|
3227
|
+
if (D = yl(he, D), Object.keys(D).length === 0 && !J) {
|
|
3228
|
+
f.value = !1;
|
|
3229
|
+
const Se = u.value;
|
|
3230
|
+
return u.value = null, p = null, Se;
|
|
3225
3231
|
}
|
|
3226
3232
|
}
|
|
3227
|
-
|
|
3228
|
-
const
|
|
3229
|
-
(
|
|
3233
|
+
J && (D = J(D, se.value));
|
|
3234
|
+
const M = o.some(
|
|
3235
|
+
(he) => he.type === "image" && D[he.field] instanceof File
|
|
3230
3236
|
);
|
|
3231
|
-
let
|
|
3232
|
-
if (
|
|
3233
|
-
const
|
|
3234
|
-
o.filter((
|
|
3235
|
-
),
|
|
3236
|
-
for (const [
|
|
3237
|
+
let I = D, Q;
|
|
3238
|
+
if (M) {
|
|
3239
|
+
const he = new Set(
|
|
3240
|
+
o.filter(($e) => $e.type === "image").map(($e) => $e.field)
|
|
3241
|
+
), Se = new FormData();
|
|
3242
|
+
for (const [$e, Oe] of Object.entries(D))
|
|
3237
3243
|
if (Oe != null)
|
|
3238
3244
|
if (Oe instanceof File)
|
|
3239
|
-
|
|
3245
|
+
Se.append($e, Oe);
|
|
3240
3246
|
else {
|
|
3241
|
-
if (
|
|
3247
|
+
if (he.has($e))
|
|
3242
3248
|
continue;
|
|
3243
|
-
|
|
3249
|
+
Se.append($e, String(Oe));
|
|
3244
3250
|
}
|
|
3245
|
-
|
|
3251
|
+
I = Se, Q = { "Content-Type": "multipart/form-data" };
|
|
3246
3252
|
}
|
|
3247
3253
|
const Le = Q ? { headers: Q } : void 0;
|
|
3248
|
-
let
|
|
3249
|
-
if (
|
|
3250
|
-
const
|
|
3251
|
-
|
|
3254
|
+
let be;
|
|
3255
|
+
if (se.value && u.value) {
|
|
3256
|
+
const he = u.value[l];
|
|
3257
|
+
if (be = await $.update(
|
|
3252
3258
|
t,
|
|
3253
|
-
|
|
3254
|
-
|
|
3259
|
+
he,
|
|
3260
|
+
I,
|
|
3255
3261
|
Le
|
|
3256
|
-
)
|
|
3257
|
-
|
|
3258
|
-
|
|
3262
|
+
), !y) {
|
|
3263
|
+
const Se = B.value.findIndex(
|
|
3264
|
+
($e) => $e[l] === he
|
|
3265
|
+
);
|
|
3266
|
+
Se !== -1 && (B.value[Se] = be.data);
|
|
3267
|
+
}
|
|
3268
|
+
N.success(U.successUpdate);
|
|
3259
3269
|
} else
|
|
3260
|
-
|
|
3261
|
-
return
|
|
3270
|
+
be = await $.create(t, I, Le), y || (B.value.unshift(be.data), d.rows++), N.success(U.successCreate);
|
|
3271
|
+
return f.value = !1, u.value = null, p = null, y && await ue(), Z && Z(be.data, se.value), be.data;
|
|
3262
3272
|
} catch (D) {
|
|
3263
|
-
return
|
|
3273
|
+
return N.error(Ke(D, "Erro ao salvar registro")), null;
|
|
3264
3274
|
} finally {
|
|
3265
|
-
|
|
3275
|
+
ae.value = !1;
|
|
3266
3276
|
}
|
|
3267
3277
|
}
|
|
3268
|
-
function
|
|
3278
|
+
function jt(D) {
|
|
3269
3279
|
K(async () => {
|
|
3270
3280
|
try {
|
|
3271
|
-
const
|
|
3272
|
-
await
|
|
3273
|
-
const
|
|
3274
|
-
|
|
3275
|
-
} catch (
|
|
3276
|
-
|
|
3281
|
+
const M = D[l];
|
|
3282
|
+
await $.delete(t, M);
|
|
3283
|
+
const I = B.value.findIndex((Q) => Q[l] === M);
|
|
3284
|
+
I !== -1 && (B.value.splice(I, 1), d.rows--), N.success(U.successDelete), g && g(D);
|
|
3285
|
+
} catch (M) {
|
|
3286
|
+
N.error(Ke(M, "Erro ao excluir registro"));
|
|
3277
3287
|
}
|
|
3278
|
-
},
|
|
3288
|
+
}, U.deleteConfirmMessage);
|
|
3279
3289
|
}
|
|
3280
3290
|
return {
|
|
3281
|
-
items:
|
|
3282
|
-
extras:
|
|
3283
|
-
loading:
|
|
3284
|
-
saving:
|
|
3291
|
+
items: B,
|
|
3292
|
+
extras: X,
|
|
3293
|
+
loading: oe,
|
|
3294
|
+
saving: ae,
|
|
3285
3295
|
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:
|
|
3296
|
+
dialogVisible: f,
|
|
3297
|
+
editingItem: u,
|
|
3298
|
+
formData: n,
|
|
3299
|
+
pagination: d,
|
|
3300
|
+
sort: E,
|
|
3301
|
+
isEditing: se,
|
|
3302
|
+
isViewing: pe,
|
|
3303
|
+
viewMode: P,
|
|
3304
|
+
dialogTitle: Ne,
|
|
3305
|
+
isFirstPage: Ye,
|
|
3306
|
+
isLastPage: we,
|
|
3307
|
+
init: ve,
|
|
3308
|
+
fetchItems: ue,
|
|
3309
|
+
fetchAll: Ee,
|
|
3310
|
+
refresh: Ce,
|
|
3311
|
+
setSearch: De,
|
|
3312
|
+
onSearch: Me,
|
|
3303
3313
|
onPage: Ae,
|
|
3304
3314
|
onSort: Re,
|
|
3305
|
-
openCreateDialog:
|
|
3306
|
-
openEditDialog:
|
|
3307
|
-
openViewDialog:
|
|
3308
|
-
openDuplicateDialog:
|
|
3309
|
-
save:
|
|
3310
|
-
confirmDelete:
|
|
3311
|
-
setFormField:
|
|
3312
|
-
resetForm:
|
|
3313
|
-
goToPage:
|
|
3314
|
-
firstPage:
|
|
3315
|
-
lastPage:
|
|
3315
|
+
openCreateDialog: te,
|
|
3316
|
+
openEditDialog: ce,
|
|
3317
|
+
openViewDialog: Ot,
|
|
3318
|
+
openDuplicateDialog: Bt,
|
|
3319
|
+
save: Wt,
|
|
3320
|
+
confirmDelete: jt,
|
|
3321
|
+
setFormField: S,
|
|
3322
|
+
resetForm: C,
|
|
3323
|
+
goToPage: ye,
|
|
3324
|
+
firstPage: xe,
|
|
3325
|
+
lastPage: Fe,
|
|
3316
3326
|
config: e
|
|
3317
3327
|
};
|
|
3318
3328
|
}
|
|
3319
|
-
function
|
|
3329
|
+
function rs(e) {
|
|
3320
3330
|
const { endpoint: t, searchDebounce: a = 300, immediate: o = !1 } = e, l = Ie(_e);
|
|
3321
3331
|
if (!l)
|
|
3322
3332
|
throw new Error(
|
|
3323
3333
|
"[wPrimeVueComponents] dataProvider não encontrado. Registre o WPrimeVuePlugin antes de usar useApi."
|
|
3324
3334
|
);
|
|
3325
|
-
const i = l, r = Ie(et), y = e.pageSize ?? (r == null ? void 0 : r.defaultPageSize) ?? 20,
|
|
3335
|
+
const i = l, r = Ie(et), y = e.pageSize ?? (r == null ? void 0 : r.defaultPageSize) ?? 20, c = q([]), k = q(!1), F = q(""), V = q({}), W = ge({}), L = ge({
|
|
3326
3336
|
page: 1,
|
|
3327
3337
|
pageSize: y,
|
|
3328
3338
|
rows: 0,
|
|
3329
3339
|
totalPages: 0
|
|
3330
|
-
}),
|
|
3340
|
+
}), J = ge({
|
|
3331
3341
|
field: null,
|
|
3332
3342
|
order: 0
|
|
3333
3343
|
});
|
|
3334
|
-
let
|
|
3335
|
-
async function g(
|
|
3336
|
-
|
|
3344
|
+
let Z = null;
|
|
3345
|
+
async function g(K = {}) {
|
|
3346
|
+
k.value = !0;
|
|
3337
3347
|
try {
|
|
3338
|
-
const
|
|
3339
|
-
page:
|
|
3340
|
-
page_size:
|
|
3341
|
-
...
|
|
3348
|
+
const B = {
|
|
3349
|
+
page: L.page,
|
|
3350
|
+
page_size: L.pageSize,
|
|
3351
|
+
...K
|
|
3342
3352
|
};
|
|
3343
|
-
|
|
3344
|
-
for (const [oe,
|
|
3345
|
-
|
|
3346
|
-
const X = await i.list(t,
|
|
3347
|
-
|
|
3353
|
+
F.value && (B.search = F.value), J.field && J.order !== 0 && (B.ordering = J.order === -1 ? `-${J.field}` : J.field);
|
|
3354
|
+
for (const [oe, ae] of Object.entries(W))
|
|
3355
|
+
ae != null && ae !== "" && (B[oe] = ae);
|
|
3356
|
+
const X = await i.list(t, B);
|
|
3357
|
+
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
3358
|
} finally {
|
|
3349
|
-
|
|
3359
|
+
k.value = !1;
|
|
3350
3360
|
}
|
|
3351
3361
|
}
|
|
3352
3362
|
async function b() {
|
|
3353
3363
|
await g();
|
|
3354
3364
|
}
|
|
3355
|
-
function $(
|
|
3356
|
-
|
|
3357
|
-
|
|
3365
|
+
function $(K) {
|
|
3366
|
+
F.value = K, Z && clearTimeout(Z), Z = setTimeout(() => {
|
|
3367
|
+
L.page = 1, g();
|
|
3358
3368
|
}, a);
|
|
3359
3369
|
}
|
|
3360
|
-
function
|
|
3361
|
-
|
|
3370
|
+
function x(K, B) {
|
|
3371
|
+
W[K] = B, L.page = 1, g();
|
|
3362
3372
|
}
|
|
3363
|
-
function
|
|
3364
|
-
for (const
|
|
3365
|
-
delete
|
|
3366
|
-
|
|
3373
|
+
function j() {
|
|
3374
|
+
for (const K of Object.keys(W))
|
|
3375
|
+
delete W[K];
|
|
3376
|
+
L.page = 1, g();
|
|
3367
3377
|
}
|
|
3368
|
-
function U(
|
|
3369
|
-
|
|
3378
|
+
function U(K) {
|
|
3379
|
+
L.page = K.page + 1, L.pageSize = K.rows, g();
|
|
3370
3380
|
}
|
|
3371
|
-
function K
|
|
3372
|
-
|
|
3381
|
+
function N(K) {
|
|
3382
|
+
J.field = K.sortField ?? null, J.order = K.sortOrder ?? 0, L.page = 1, g();
|
|
3373
3383
|
}
|
|
3374
3384
|
return o && g(), {
|
|
3375
|
-
items:
|
|
3376
|
-
loading:
|
|
3377
|
-
search:
|
|
3378
|
-
pagination:
|
|
3379
|
-
sort:
|
|
3380
|
-
extras:
|
|
3385
|
+
items: c,
|
|
3386
|
+
loading: k,
|
|
3387
|
+
search: F,
|
|
3388
|
+
pagination: L,
|
|
3389
|
+
sort: J,
|
|
3390
|
+
extras: V,
|
|
3381
3391
|
fetchItems: g,
|
|
3382
3392
|
refresh: b,
|
|
3383
3393
|
setSearch: $,
|
|
3384
|
-
setFilter:
|
|
3385
|
-
clearFilters:
|
|
3394
|
+
setFilter: x,
|
|
3395
|
+
clearFilters: j,
|
|
3386
3396
|
onPage: U,
|
|
3387
|
-
onSort:
|
|
3397
|
+
onSort: N
|
|
3388
3398
|
};
|
|
3389
3399
|
}
|
|
3390
|
-
function
|
|
3400
|
+
function bl(e) {
|
|
3391
3401
|
return e.split("?")[0].replace(/^\/+|\/+$/g, "").replace(/^api\/v\d+\//, "");
|
|
3392
3402
|
}
|
|
3393
|
-
function
|
|
3403
|
+
function wl(e) {
|
|
3394
3404
|
return typeof e == "string" ? { table: e } : e;
|
|
3395
3405
|
}
|
|
3396
3406
|
function Yt(e, t = 400) {
|
|
@@ -3424,9 +3434,9 @@ function Be(e) {
|
|
|
3424
3434
|
}
|
|
3425
3435
|
function We(e, t) {
|
|
3426
3436
|
var l, i;
|
|
3427
|
-
const a =
|
|
3437
|
+
const a = bl(e), o = (l = t.resources) == null ? void 0 : l[a];
|
|
3428
3438
|
if (o)
|
|
3429
|
-
return
|
|
3439
|
+
return wl(o);
|
|
3430
3440
|
if ((i = t.allowedTables) != null && i.includes(a))
|
|
3431
3441
|
return { table: a };
|
|
3432
3442
|
throw Yt(
|
|
@@ -3434,26 +3444,26 @@ function We(e, t) {
|
|
|
3434
3444
|
404
|
|
3435
3445
|
);
|
|
3436
3446
|
}
|
|
3437
|
-
function
|
|
3447
|
+
function kl(e, t, a) {
|
|
3438
3448
|
const o = /* @__PURE__ */ new Set(["page", "page_size", "search", "ordering"]), l = { ...a.defaultFilters, ...t };
|
|
3439
3449
|
for (const [i, r] of Object.entries(l))
|
|
3440
3450
|
o.has(i) || r === null || r === void 0 || r === "" || (e = e.eq(i, r));
|
|
3441
3451
|
return e;
|
|
3442
3452
|
}
|
|
3443
|
-
function
|
|
3453
|
+
function $l(e, t, a) {
|
|
3444
3454
|
if (typeof t != "string" || !t.trim() || !(a != null && a.length))
|
|
3445
3455
|
return e;
|
|
3446
3456
|
const o = t.trim().replace(/,/g, "\\,"), l = a.map((i) => `${i}.ilike.%${o}%`).join(",");
|
|
3447
3457
|
return e.or(l);
|
|
3448
3458
|
}
|
|
3449
|
-
function
|
|
3459
|
+
function Cl(e, t) {
|
|
3450
3460
|
const a = typeof e == "string" && e ? e : t;
|
|
3451
3461
|
return a ? {
|
|
3452
3462
|
field: a.startsWith("-") ? a.slice(1) : a,
|
|
3453
3463
|
ascending: !a.startsWith("-")
|
|
3454
3464
|
} : null;
|
|
3455
3465
|
}
|
|
3456
|
-
function
|
|
3466
|
+
function Dl(e, t) {
|
|
3457
3467
|
return e ? t.mapListItem ? e.map(
|
|
3458
3468
|
(a) => {
|
|
3459
3469
|
var o;
|
|
@@ -3461,22 +3471,22 @@ function $l(e, t) {
|
|
|
3461
3471
|
}
|
|
3462
3472
|
) : e : [];
|
|
3463
3473
|
}
|
|
3464
|
-
function
|
|
3474
|
+
function us(e) {
|
|
3465
3475
|
const t = e.defaultSelect ?? "*";
|
|
3466
3476
|
return {
|
|
3467
3477
|
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,
|
|
3470
|
-
let
|
|
3471
|
-
|
|
3472
|
-
const
|
|
3473
|
-
|
|
3474
|
-
const
|
|
3475
|
-
return
|
|
3476
|
-
data:
|
|
3478
|
+
var W;
|
|
3479
|
+
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;
|
|
3480
|
+
let k = e.client.from(l.table).select(l.select ?? t, { count: "exact" });
|
|
3481
|
+
k = kl(k, o, l), k = $l(k, o.search, l.searchFields);
|
|
3482
|
+
const F = Cl(o.ordering, l.defaultOrdering);
|
|
3483
|
+
F && (k = k.order(F.field, { ascending: F.ascending }));
|
|
3484
|
+
const V = await k.range(y, c);
|
|
3485
|
+
return V.error && Be(V.error), {
|
|
3486
|
+
data: Dl(V.data, l),
|
|
3477
3487
|
page: i,
|
|
3478
3488
|
page_size: r,
|
|
3479
|
-
rows:
|
|
3489
|
+
rows: V.count ?? ((W = V.data) == null ? void 0 : W.length) ?? 0,
|
|
3480
3490
|
extras: {}
|
|
3481
3491
|
};
|
|
3482
3492
|
},
|
|
@@ -3485,12 +3495,12 @@ function is(e) {
|
|
|
3485
3495
|
return y.error && Be(y.error), { data: y.data };
|
|
3486
3496
|
},
|
|
3487
3497
|
async create(a, o, l) {
|
|
3488
|
-
const i = We(a, e), r = wt(o), y = i.mapPayload ? i.mapPayload(r, "create") : r,
|
|
3489
|
-
return
|
|
3498
|
+
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();
|
|
3499
|
+
return c.error && Be(c.error), { data: c.data };
|
|
3490
3500
|
},
|
|
3491
3501
|
async update(a, o, l, i) {
|
|
3492
|
-
const r = We(a, e), y = r.pk ?? "id",
|
|
3493
|
-
return
|
|
3502
|
+
const r = We(a, e), y = r.pk ?? "id", c = wt(l), k = r.mapPayload ? r.mapPayload(c, "update") : c, F = await e.client.from(r.table).update(k).eq(y, o).select(r.select ?? t).single();
|
|
3503
|
+
return F.error && Be(F.error), { data: F.data };
|
|
3494
3504
|
},
|
|
3495
3505
|
async delete(a, o) {
|
|
3496
3506
|
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 +3509,43 @@ function is(e) {
|
|
|
3499
3509
|
};
|
|
3500
3510
|
}
|
|
3501
3511
|
export {
|
|
3502
|
-
|
|
3503
|
-
|
|
3512
|
+
hl as DEFAULT_CRUD_LABELS,
|
|
3513
|
+
os as WActionBar,
|
|
3504
3514
|
Lt as WAutoCompleteFK,
|
|
3505
3515
|
Qe as WCrudColumnRenderer,
|
|
3506
3516
|
ut as WCrudFormDialog,
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3517
|
+
po as WCrudView,
|
|
3518
|
+
_l as WDetailHeader,
|
|
3519
|
+
Ql as WEmptyState,
|
|
3520
|
+
Mn as WFormRenderer,
|
|
3521
|
+
ns as WFormSection,
|
|
3522
|
+
es as WInfoCard,
|
|
3523
|
+
Go as WKpiCard,
|
|
3524
|
+
ts as WKpiGrid,
|
|
3515
3525
|
zt as WMoneyInput,
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3526
|
+
Xl as WPageHeader,
|
|
3527
|
+
ss as WPrimeVuePlugin,
|
|
3528
|
+
ls as WProgressFlow,
|
|
3529
|
+
as as WSectionHeader,
|
|
3530
|
+
vo as WStatusTag,
|
|
3521
3531
|
Nt as WTransferList,
|
|
3522
|
-
|
|
3532
|
+
la as W_AXIOS_KEY,
|
|
3523
3533
|
et as W_CONFIG_KEY,
|
|
3524
3534
|
_e as W_DATA_PROVIDER_KEY,
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3535
|
+
gl as createAxiosDataProvider,
|
|
3536
|
+
us as createSupabaseDataProvider,
|
|
3537
|
+
In as downloadCsv,
|
|
3528
3538
|
Ke as extractApiError,
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3539
|
+
za as mapApiFieldToColumnDef,
|
|
3540
|
+
Ia as mapApiFieldToFieldDef,
|
|
3541
|
+
Na as mapApiFieldsToColumnDefs,
|
|
3542
|
+
Ta as mapApiFieldsToFieldDefs,
|
|
3543
|
+
Rn as toCsv,
|
|
3544
|
+
rs as useApi,
|
|
3545
|
+
Zl as useApiError,
|
|
3536
3546
|
Tt as useAppConfirm,
|
|
3537
3547
|
It as useAppToast,
|
|
3538
|
-
|
|
3548
|
+
is as useCrudManager,
|
|
3539
3549
|
rt as useFormatters
|
|
3540
3550
|
};
|
|
3541
3551
|
//# sourceMappingURL=index.js.map
|