@wgalleti/primevue-components 0.3.6 → 0.3.7

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