@wgalleti/primevue-components 0.3.6 → 0.3.8

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