@wgalleti/primevue-components 0.9.1 → 0.9.3

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.
@@ -1,30 +1,30 @@
1
- import { defineComponent as ne, openBlock as o, createElementBlock as d, createBlock as C, unref as r, toDisplayString as I, inject as ut, ref as B, onMounted as _e, nextTick as Ge, computed as P, watch as Fe, reactive as Pe, resolveDirective as dt, Fragment as Y, createElementVNode as m, mergeProps as Dt, createVNode as S, withDirectives as fe, withCtx as K, createCommentVNode as b, renderList as le, normalizeStyle as be, createTextVNode as Ie, normalizeClass as Q, onBeforeUnmount as Et, renderSlot as A, isRef as Pt, withModifiers as Ft, createSlots as qe, normalizeProps as Je, guardReactiveProps as Xe, useSlots as It, createStaticVNode as Rt } from "vue";
2
- import ct from "primevue/datatable";
3
- import Ae from "primevue/column";
4
- import z from "primevue/button";
5
- import ve from "primevue/inputtext";
6
- import He from "primevue/inputnumber";
7
- import Ze from "primevue/select";
8
- import mt from "primevue/popover";
1
+ import { defineComponent as re, openBlock as o, createElementBlock as d, createBlock as C, unref as r, toDisplayString as I, inject as ft, ref as U, onMounted as ot, nextTick as Qe, computed as P, watch as Pe, reactive as Ee, resolveDirective as vt, Fragment as J, createElementVNode as m, mergeProps as Dt, createVNode as S, withDirectives as he, withCtx as K, createCommentVNode as b, renderList as oe, normalizeStyle as ke, createTextVNode as Fe, normalizeClass as Q, onBeforeUnmount as Et, renderSlot as B, isRef as Pt, withModifiers as Ft, createSlots as Ge, normalizeProps as et, guardReactiveProps as tt, useSlots as It, createStaticVNode as Rt } from "vue";
2
+ import pt from "primevue/datatable";
3
+ import Me from "primevue/column";
4
+ import N from "primevue/button";
5
+ import ye from "primevue/inputtext";
6
+ import Je from "primevue/inputnumber";
7
+ import lt from "primevue/select";
8
+ import ht from "primevue/popover";
9
9
  import Mt from "primevue/checkbox";
10
- import Te from "primevue/iconfield";
11
- import Ne from "primevue/inputicon";
10
+ import Ue from "primevue/iconfield";
11
+ import Be from "primevue/inputicon";
12
12
  import At from "primevue/paginator";
13
13
  import Ut from "primevue/contextmenu";
14
- import ft from "primevue/tag";
15
- import { f as et, b as Bt, a as Tt, e as lt, c as Nt, d as Lt } from "./useFormKeyboardNav-D4Irq5RE.js";
16
- import tt from "primevue/dialog";
14
+ import Xe from "primevue/dialog";
15
+ import yt from "primevue/tag";
16
+ import { f as nt, b as Bt, a as Tt, e as it, c as Nt, d as Lt } from "./useFormKeyboardNav-D4Irq5RE.js";
17
17
  import zt from "primevue/textarea";
18
- import vt from "primevue/autocomplete";
18
+ import gt from "primevue/autocomplete";
19
19
  import Ot from "primevue/toggleswitch";
20
20
  import Wt from "primevue/colorpicker";
21
21
  import jt from "primevue/password";
22
22
  import { W as qt } from "./plugin-BKa0eSEM.js";
23
- import pt from "primevue/datepicker";
23
+ import bt from "primevue/datepicker";
24
24
  import Kt from "primevue/inputgroup";
25
- import at from "primevue/inputgroupaddon";
25
+ import st from "primevue/inputgroupaddon";
26
26
  import Ht from "primevue/slider";
27
- import Oe from "primevue/skeleton";
27
+ import qe from "primevue/skeleton";
28
28
  const Gt = {
29
29
  key: 0,
30
30
  class: "text-muted-color text-xs"
@@ -43,7 +43,7 @@ const Gt = {
43
43
  }, _t = {
44
44
  key: 7,
45
45
  class: "text-[0.8125rem]"
46
- }, Qe = /* @__PURE__ */ ne({
46
+ }, at = /* @__PURE__ */ re({
47
47
  __name: "WCrudColumnRenderer",
48
48
  props: {
49
49
  column: {},
@@ -51,13 +51,13 @@ const Gt = {
51
51
  rowData: {}
52
52
  },
53
53
  setup(e) {
54
- const { formatDate: a, formatDateTime: t, formatCurrency: n, formatNumber: i } = et();
54
+ const { formatDate: a, formatDateTime: t, formatCurrency: n, formatNumber: i } = nt();
55
55
  return (v, $) => e.value == null ? (o(), d("span", Gt, "—")) : e.column.type === "image" ? (o(), d("img", {
56
56
  key: 1,
57
57
  src: String(e.value),
58
58
  alt: e.column.header,
59
59
  class: "size-9 rounded-lg object-cover ring-1 ring-surface-200 dark:ring-surface-700"
60
- }, null, 8, Yt)) : e.column.type === "boolean" ? (o(), C(r(ft), {
60
+ }, null, 8, Yt)) : e.column.type === "boolean" ? (o(), C(r(yt), {
61
61
  key: 2,
62
62
  value: e.column.tagValue ? e.column.tagValue(e.value, e.rowData) : e.value ? "Ativo" : "Inativo",
63
63
  severity: e.column.tagSeverity ? e.column.tagSeverity(e.value, e.rowData) : e.value ? "success" : "danger",
@@ -65,12 +65,12 @@ const Gt = {
65
65
  }, null, 8, ["value", "severity"])) : e.column.type === "date" ? (o(), d("span", Jt, I(r(a)(e.value)), 1)) : e.column.type === "datetime" ? (o(), d("span", Xt, I(r(t)(e.value)), 1)) : e.column.type === "currency" ? (o(), d("span", Zt, I(r(n)(e.value)), 1)) : e.column.type === "number" ? (o(), d("span", Qt, I(e.column.format ? e.column.format(e.value, e.rowData) : r(i)(e.value, e.column.decimals ?? 0)), 1)) : (o(), d("span", _t, I(e.column.format ? e.column.format(e.value, e.rowData) : e.value), 1));
66
66
  }
67
67
  });
68
- var el = Object.defineProperty, tl = (e, a, t) => a in e ? el(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t, Le = (e, a, t) => tl(e, typeof a != "symbol" ? a + "" : a, t);
69
- const ot = {
68
+ var el = Object.defineProperty, tl = (e, a, t) => a in e ? el(e, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[a] = t, Te = (e, a, t) => tl(e, typeof a != "symbol" ? a + "" : a, t);
69
+ const rt = {
70
70
  "#": { pattern: /[0-9]/ },
71
71
  "@": { pattern: /[a-zA-Z]/ },
72
72
  "*": { pattern: /[a-zA-Z0-9]/ }
73
- }, nt = (e, a, t) => e.replaceAll(a, "").replace(t, ".").replace("..", ".").replace(/[^.\d]/g, ""), it = (e, a, t) => {
73
+ }, ut = (e, a, t) => e.replaceAll(a, "").replace(t, ".").replace("..", ".").replace(/[^.\d]/g, ""), dt = (e, a, t) => {
74
74
  var n;
75
75
  return new Intl.NumberFormat(((n = t.number) == null ? void 0 : n.locale) ?? "en", {
76
76
  minimumFractionDigits: e,
@@ -80,35 +80,35 @@ const ot = {
80
80
  }, ll = (e, a = !0, t) => {
81
81
  var n, i, v, $;
82
82
  const D = ((n = t.number) == null ? void 0 : n.unsigned) !== !0 && e.startsWith("-") ? "-" : "", x = ((i = t.number) == null ? void 0 : i.fraction) ?? 0;
83
- let E = it(0, x, t);
84
- const T = E.formatToParts(1000.12), w = ((v = T.find((F) => F.type === "group")) == null ? void 0 : v.value) ?? " ", q = (($ = T.find((F) => F.type === "decimal")) == null ? void 0 : $.value) ?? ".", J = nt(e, w, q);
85
- if (Number.isNaN(parseFloat(J))) return D;
86
- const H = J.split(".");
87
- if (H[1] != null && H[1].length >= 1) {
88
- const F = H[1].length <= x ? H[1].length : x;
89
- E = it(F, x, t);
83
+ let E = dt(0, x, t);
84
+ const T = E.formatToParts(1000.12), w = ((v = T.find((F) => F.type === "group")) == null ? void 0 : v.value) ?? " ", H = (($ = T.find((F) => F.type === "decimal")) == null ? void 0 : $.value) ?? ".", X = ut(e, w, H);
85
+ if (Number.isNaN(parseFloat(X))) return D;
86
+ const Y = X.split(".");
87
+ if (Y[1] != null && Y[1].length >= 1) {
88
+ const F = Y[1].length <= x ? Y[1].length : x;
89
+ E = dt(F, x, t);
90
90
  }
91
- let Z = E.format(parseFloat(J));
92
- return a ? x > 0 && J.endsWith(".") && !J.slice(0, -1).includes(".") && (Z += q) : Z = nt(Z, w, q), D + Z;
93
- }, ht = (e) => JSON.parse(e.replaceAll("'", '"')), al = (e, a = {}) => {
91
+ let Z = E.format(parseFloat(X));
92
+ return a ? x > 0 && X.endsWith(".") && !X.slice(0, -1).includes(".") && (Z += H) : Z = ut(Z, w, H), D + Z;
93
+ }, wt = (e) => JSON.parse(e.replaceAll("'", '"')), al = (e, a = {}) => {
94
94
  const t = { ...a };
95
- e.dataset.maska != null && e.dataset.maska !== "" && (t.mask = ol(e.dataset.maska)), e.dataset.maskaEager != null && (t.eager = We(e.dataset.maskaEager)), e.dataset.maskaReversed != null && (t.reversed = We(e.dataset.maskaReversed)), e.dataset.maskaTokensReplace != null && (t.tokensReplace = We(e.dataset.maskaTokensReplace)), e.dataset.maskaTokens != null && (t.tokens = nl(e.dataset.maskaTokens));
95
+ e.dataset.maska != null && e.dataset.maska !== "" && (t.mask = ol(e.dataset.maska)), e.dataset.maskaEager != null && (t.eager = Ke(e.dataset.maskaEager)), e.dataset.maskaReversed != null && (t.reversed = Ke(e.dataset.maskaReversed)), e.dataset.maskaTokensReplace != null && (t.tokensReplace = Ke(e.dataset.maskaTokensReplace)), e.dataset.maskaTokens != null && (t.tokens = nl(e.dataset.maskaTokens));
96
96
  const n = {};
97
- return e.dataset.maskaNumberLocale != null && (n.locale = e.dataset.maskaNumberLocale), e.dataset.maskaNumberFraction != null && (n.fraction = parseInt(e.dataset.maskaNumberFraction)), e.dataset.maskaNumberUnsigned != null && (n.unsigned = We(e.dataset.maskaNumberUnsigned)), (e.dataset.maskaNumber != null || Object.values(n).length > 0) && (t.number = n), t;
98
- }, We = (e) => e !== "" ? !!JSON.parse(e) : !0, ol = (e) => e.startsWith("[") && e.endsWith("]") ? ht(e) : e, nl = (e) => {
97
+ return e.dataset.maskaNumberLocale != null && (n.locale = e.dataset.maskaNumberLocale), e.dataset.maskaNumberFraction != null && (n.fraction = parseInt(e.dataset.maskaNumberFraction)), e.dataset.maskaNumberUnsigned != null && (n.unsigned = Ke(e.dataset.maskaNumberUnsigned)), (e.dataset.maskaNumber != null || Object.values(n).length > 0) && (t.number = n), t;
98
+ }, Ke = (e) => e !== "" ? !!JSON.parse(e) : !0, ol = (e) => e.startsWith("[") && e.endsWith("]") ? wt(e) : e, nl = (e) => {
99
99
  if (e.startsWith("{") && e.endsWith("}"))
100
- return ht(e);
100
+ return wt(e);
101
101
  const a = {};
102
102
  return e.split("|").forEach((t) => {
103
103
  const n = t.split(":");
104
104
  a[n[0]] = {
105
- pattern: yt() ? new RegExp(n[1], "u") : new RegExp(n[1]),
105
+ pattern: kt() ? new RegExp(n[1], "u") : new RegExp(n[1]),
106
106
  optional: n[2] === "optional",
107
107
  multiple: n[2] === "multiple",
108
108
  repeated: n[2] === "repeated"
109
109
  };
110
110
  }), a;
111
- }, yt = () => {
111
+ }, kt = () => {
112
112
  try {
113
113
  return new RegExp("\\p{L}", "u"), !0;
114
114
  } catch {
@@ -117,14 +117,14 @@ const ot = {
117
117
  };
118
118
  class il {
119
119
  constructor(a = {}) {
120
- Le(this, "opts", {}), Le(this, "memo", /* @__PURE__ */ new Map());
120
+ Te(this, "opts", {}), Te(this, "memo", /* @__PURE__ */ new Map());
121
121
  const t = { ...a };
122
122
  if (t.tokens != null) {
123
- t.tokens = t.tokensReplace ? { ...t.tokens } : { ...ot, ...t.tokens };
123
+ t.tokens = t.tokensReplace ? { ...t.tokens } : { ...rt, ...t.tokens };
124
124
  for (const n of Object.values(t.tokens))
125
- typeof n.pattern == "string" && (n.pattern = yt() ? new RegExp(n.pattern, "u") : new RegExp(n.pattern));
125
+ typeof n.pattern == "string" && (n.pattern = kt() ? new RegExp(n.pattern, "u") : new RegExp(n.pattern));
126
126
  } else
127
- t.tokens = ot;
127
+ t.tokens = rt;
128
128
  Array.isArray(t.mask) && (t.mask.length > 1 ? t.mask = [...t.mask].sort((n, i) => n.length - i.length) : t.mask = t.mask[0] ?? ""), t.mask === "" && (t.mask = null), this.opts = t;
129
129
  }
130
130
  masked(a) {
@@ -167,18 +167,18 @@ class il {
167
167
  if (t == null) return a;
168
168
  const i = `v=${a},mr=${t},m=${n ? 1 : 0}`;
169
169
  if (this.memo.has(i)) return this.memo.get(i);
170
- const { mask: v, escaped: $ } = this.escapeMask(t), D = [], x = this.opts.tokens != null ? this.opts.tokens : {}, E = this.isReversed() ? -1 : 1, T = this.isReversed() ? "unshift" : "push", w = this.isReversed() ? 0 : v.length - 1, q = this.isReversed() ? () => F > -1 && M > -1 : () => F < v.length && M < a.length, J = (V) => !this.isReversed() && V <= w || this.isReversed() && V >= w;
171
- let H, Z = -1, F = this.isReversed() ? v.length - 1 : 0, M = this.isReversed() ? a.length - 1 : 0, N = !1;
172
- for (; q(); ) {
173
- const V = v.charAt(F), O = x[V], ae = (O == null ? void 0 : O.transform) != null ? O.transform(a.charAt(M)) : a.charAt(M);
174
- if (!$.includes(F) && O != null ? (ae.match(O.pattern) != null ? (D[T](ae), O.repeated ? (Z === -1 ? Z = F : F === w && F !== Z && (F = Z - E), w === Z && (F -= E)) : O.multiple && (N = !0, F -= E), F += E) : O.multiple ? N && (F += E, M -= E, N = !1) : ae === H ? H = void 0 : O.optional && (F += E, M -= E), M += E) : (n && !this.isEager() && D[T](V), ae === V && !this.isEager() ? M += E : H = V, this.isEager() || (F += E)), this.isEager())
175
- for (; J(F) && (x[v.charAt(F)] == null || $.includes(F)); ) {
170
+ const { mask: v, escaped: $ } = this.escapeMask(t), D = [], x = this.opts.tokens != null ? this.opts.tokens : {}, E = this.isReversed() ? -1 : 1, T = this.isReversed() ? "unshift" : "push", w = this.isReversed() ? 0 : v.length - 1, H = this.isReversed() ? () => F > -1 && A > -1 : () => F < v.length && A < a.length, X = (V) => !this.isReversed() && V <= w || this.isReversed() && V >= w;
171
+ let Y, Z = -1, F = this.isReversed() ? v.length - 1 : 0, A = this.isReversed() ? a.length - 1 : 0, L = !1;
172
+ for (; H(); ) {
173
+ const V = v.charAt(F), O = x[V], ne = (O == null ? void 0 : O.transform) != null ? O.transform(a.charAt(A)) : a.charAt(A);
174
+ if (!$.includes(F) && O != null ? (ne.match(O.pattern) != null ? (D[T](ne), O.repeated ? (Z === -1 ? Z = F : F === w && F !== Z && (F = Z - E), w === Z && (F -= E)) : O.multiple && (L = !0, F -= E), F += E) : O.multiple ? L && (F += E, A -= E, L = !1) : ne === Y ? Y = void 0 : O.optional && (F += E, A -= E), A += E) : (n && !this.isEager() && D[T](V), ne === V && !this.isEager() ? A += E : Y = V, this.isEager() || (F += E)), this.isEager())
175
+ for (; X(F) && (x[v.charAt(F)] == null || $.includes(F)); ) {
176
176
  if (n) {
177
- if (D[T](v.charAt(F)), a.charAt(M) === v.charAt(F)) {
178
- F += E, M += E;
177
+ if (D[T](v.charAt(F)), a.charAt(A) === v.charAt(F)) {
178
+ F += E, A += E;
179
179
  continue;
180
180
  }
181
- } else v.charAt(F) === a.charAt(M) && (M += E);
181
+ } else v.charAt(F) === a.charAt(A) && (A += E);
182
182
  F += E;
183
183
  }
184
184
  }
@@ -187,7 +187,7 @@ class il {
187
187
  }
188
188
  class sl {
189
189
  constructor(a, t = {}) {
190
- Le(this, "items", /* @__PURE__ */ new Map()), Le(this, "eventAbortController"), Le(this, "onInput", (n) => {
190
+ Te(this, "items", /* @__PURE__ */ new Map()), Te(this, "eventAbortController"), Te(this, "onInput", (n) => {
191
191
  if (n instanceof CustomEvent && n.type === "input" && !n.isTrusted && !n.bubbles)
192
192
  return;
193
193
  const i = n.target, v = this.items.get(i);
@@ -228,10 +228,10 @@ class sl {
228
228
  var i, v;
229
229
  const $ = a.selectionStart, D = a.value;
230
230
  if (n(), $ === null || $ === D.length && !t) return;
231
- const x = a.value, E = D.slice(0, $), T = x.slice(0, $), w = (i = this.processInput(a, E)) == null ? void 0 : i.unmasked, q = (v = this.processInput(a, T)) == null ? void 0 : v.unmasked;
232
- if (w === void 0 || q === void 0) return;
233
- let J = $;
234
- E !== T && (J += t ? x.length - D.length : w.length - q.length), a.setSelectionRange(J, J);
231
+ const x = a.value, E = D.slice(0, $), T = x.slice(0, $), w = (i = this.processInput(a, E)) == null ? void 0 : i.unmasked, H = (v = this.processInput(a, T)) == null ? void 0 : v.unmasked;
232
+ if (w === void 0 || H === void 0) return;
233
+ let X = $;
234
+ E !== T && (X += t ? x.length - D.length : w.length - H.length), a.setSelectionRange(X, X);
235
235
  }
236
236
  setValue(a, t) {
237
237
  const n = this.processInput(a, t);
@@ -250,11 +250,11 @@ class sl {
250
250
  };
251
251
  }
252
252
  }
253
- const Ye = /* @__PURE__ */ new WeakMap(), rl = (e, a) => {
253
+ const _e = /* @__PURE__ */ new WeakMap(), rl = (e, a) => {
254
254
  if (e.arg == null || e.instance == null) return;
255
255
  const t = "setup" in e.instance.$.type;
256
256
  e.arg in e.instance ? e.instance[e.arg] = a : t && console.warn("Maska: please expose `%s` using defineExpose", e.arg);
257
- }, Ke = (e, a) => {
257
+ }, Ye = (e, a) => {
258
258
  var t;
259
259
  const n = e instanceof HTMLInputElement ? e : e.querySelector("input");
260
260
  if (n == null || (n == null ? void 0 : n.type) === "file") return;
@@ -266,7 +266,7 @@ const Ye = /* @__PURE__ */ new WeakMap(), rl = (e, a) => {
266
266
  };
267
267
  i.onMaska = i.onMaska == null ? v : Array.isArray(i.onMaska) ? [...i.onMaska, v] : [i.onMaska, v];
268
268
  }
269
- Ye.has(n) ? (t = Ye.get(n)) == null || t.update(i) : Ye.set(n, new sl(n, i));
269
+ _e.has(n) ? (t = _e.get(n)) == null || t.update(i) : _e.set(n, new sl(n, i));
270
270
  }, ul = {
271
271
  string: "text",
272
272
  integer: "number",
@@ -317,7 +317,7 @@ function fl(e) {
317
317
  function vl(e, a = 6) {
318
318
  return e.filter((t) => !t.read_only && t.name !== "id").slice(0, a).map(fl);
319
319
  }
320
- const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { class: "w-autocompletefk-toolbar-actions" }, gl = { class: "flex items-center justify-end gap-1" }, bl = { class: "w-autocompletefk-footer" }, wl = /* @__PURE__ */ ne({
320
+ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { class: "w-autocompletefk-toolbar-actions" }, gl = { class: "flex items-center justify-end gap-1" }, bl = { class: "w-autocompletefk-footer" }, wl = /* @__PURE__ */ re({
321
321
  inheritAttrs: !1,
322
322
  __name: "WAutoCompleteFK",
323
323
  props: {
@@ -345,26 +345,26 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
345
345
  },
346
346
  emits: ["update:modelValue"],
347
347
  setup(e, { emit: a }) {
348
- const t = e, n = a, i = ut(qt);
348
+ const t = e, n = a, i = ft(qt);
349
349
  if (!i)
350
350
  throw new Error("[wPrimeVueComponents] dataProvider não encontrado. Registre o WPrimeVuePlugin.");
351
- const v = i, $ = Bt(), { confirmDelete: D } = Tt(), x = B(null), E = B([]), T = B(!1);
351
+ const v = i, $ = Bt(), { confirmDelete: D } = Tt(), x = U(null), E = U([]), T = U(!1);
352
352
  let w = null;
353
- const q = B(null);
354
- _e(() => {
355
- t.autofocus && Ge(() => {
356
- var g, L, R, oe;
357
- const u = (R = (L = (g = q.value) == null ? void 0 : g.$el) == null ? void 0 : L.querySelector) == null ? void 0 : R.call(L, "input");
358
- u && (u.setAttribute("autofocus", ""), u.focus(), (oe = u.select) == null || oe.call(u));
353
+ const H = U(null);
354
+ ot(() => {
355
+ t.autofocus && Qe(() => {
356
+ var y, z, R, se;
357
+ const u = (R = (z = (y = H.value) == null ? void 0 : y.$el) == null ? void 0 : z.querySelector) == null ? void 0 : R.call(z, "input");
358
+ u && (u.setAttribute("autofocus", ""), u.focus(), (se = u.select) == null || se.call(u));
359
359
  });
360
360
  });
361
- function J(u) {
361
+ function X(u) {
362
362
  return u == null || u === "";
363
363
  }
364
- function H(u) {
364
+ function Y(u) {
365
365
  if (u && typeof u == "object") {
366
- const g = u;
367
- return g.id ?? g.value ?? g;
366
+ const y = u;
367
+ return y.id ?? y.value ?? y;
368
368
  }
369
369
  return u;
370
370
  }
@@ -373,24 +373,24 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
373
373
  return u ? Array.isArray(u) ? u : [u] : [];
374
374
  }), F = P(
375
375
  () => Z.value.some(
376
- (u) => (u.required ?? !0) && J(H(u.value))
376
+ (u) => (u.required ?? !0) && X(Y(u.value))
377
377
  )
378
378
  );
379
- function M() {
379
+ function A() {
380
380
  const u = {};
381
- for (const g of Z.value) {
382
- const L = H(g.value);
383
- J(L) || (u[g.field] = L);
381
+ for (const y of Z.value) {
382
+ const z = Y(y.value);
383
+ X(z) || (u[y.field] = z);
384
384
  }
385
385
  return u;
386
386
  }
387
- const N = P(
387
+ const L = P(
388
388
  () => F.value && t.blockedPlaceholder ? t.blockedPlaceholder : t.placeholder
389
389
  );
390
390
  async function V(u) {
391
391
  try {
392
- const g = await v.get(t.endpoint, u);
393
- x.value = g.data;
392
+ const y = await v.get(t.endpoint, u);
393
+ x.value = y.data;
394
394
  } catch {
395
395
  x.value = null;
396
396
  }
@@ -402,35 +402,35 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
402
402
  }
403
403
  T.value = !0;
404
404
  try {
405
- const g = {
405
+ const y = {
406
406
  page_size: 20,
407
407
  ...t.endpointParams,
408
- ...M()
408
+ ...A()
409
409
  };
410
- u && (g.search = u);
411
- const L = await v.list(t.endpoint, g);
412
- E.value = L.data;
410
+ u && (y.search = u);
411
+ const z = await v.list(t.endpoint, y);
412
+ E.value = z.data;
413
413
  } catch {
414
414
  E.value = [];
415
415
  } finally {
416
416
  T.value = !1;
417
417
  }
418
418
  }
419
- function ae(u) {
420
- const g = u.query || "";
421
- if (g.length < t.minLength) {
419
+ function ne(u) {
420
+ const y = u.query || "";
421
+ if (y.length < t.minLength) {
422
422
  E.value = [];
423
423
  return;
424
424
  }
425
- w && clearTimeout(w), w = setTimeout(() => O(g), 300);
425
+ w && clearTimeout(w), w = setTimeout(() => O(y), 300);
426
426
  }
427
- function me(u) {
427
+ function ve(u) {
428
428
  x.value = u.value, n("update:modelValue", u.value);
429
429
  }
430
430
  function De() {
431
431
  x.value = null, n("update:modelValue", null);
432
432
  }
433
- Fe(
433
+ Pe(
434
434
  () => t.modelValue,
435
435
  async (u) => {
436
436
  if (u != null) {
@@ -444,268 +444,268 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
444
444
  },
445
445
  { immediate: !0 }
446
446
  );
447
- const de = B(!1), ie = B([]), ge = B(!1), pe = B(""), ce = B(1), G = B(15), se = B(0), te = B(null), we = B(null), he = B(0);
448
- let ye = null;
449
- const xe = B([]), f = P(() => {
447
+ const de = U(!1), ie = U([]), ge = U(!1), ce = U(""), be = U(1), we = U(15), ue = U(0), ee = U(null), pe = U(null), W = U(0);
448
+ let me = null;
449
+ const $e = U([]), f = P(() => {
450
450
  var u;
451
- return (u = t.crudFields) != null && u.length ? !0 : xe.value.length > 0;
452
- }), p = P(() => t.canCreate ?? f.value), h = P(() => t.canEdit ?? f.value), l = P(() => t.canDelete ?? f.value), k = P(() => h.value || l.value), _ = P(() => {
451
+ return (u = t.crudFields) != null && u.length ? !0 : $e.value.length > 0;
452
+ }), p = P(() => t.canCreate ?? f.value), g = P(() => t.canEdit ?? f.value), l = P(() => t.canDelete ?? f.value), k = P(() => g.value || l.value), te = P(() => {
453
453
  var u;
454
- return (u = t.crudFields) != null && u.length ? t.crudFields : cl(xe.value);
455
- }), X = P(() => {
456
- var u, g;
457
- return (u = t.crudColumns) != null && u.length ? t.crudColumns : (g = t.columns) != null && g.length ? t.columns.map((L) => ({
458
- field: L.field,
459
- header: L.header,
454
+ return (u = t.crudFields) != null && u.length ? t.crudFields : cl($e.value);
455
+ }), j = P(() => {
456
+ var u, y;
457
+ return (u = t.crudColumns) != null && u.length ? t.crudColumns : (y = t.columns) != null && y.length ? t.columns.map((z) => ({
458
+ field: z.field,
459
+ header: z.header,
460
460
  sortable: !0
461
- })) : xe.value.length ? vl(xe.value) : [{ field: t.optionLabel, header: t.optionLabel, sortable: !0 }];
461
+ })) : $e.value.length ? vl($e.value) : [{ field: t.optionLabel, header: t.optionLabel, sortable: !0 }];
462
462
  });
463
- async function re() {
464
- var u, g, L;
463
+ async function le() {
464
+ var u, y, z;
465
465
  if (F.value) {
466
- ie.value = [], se.value = 0;
466
+ ie.value = [], ue.value = 0;
467
467
  return;
468
468
  }
469
469
  ge.value = !0;
470
470
  try {
471
471
  const R = {
472
- page: ce.value,
473
- page_size: G.value,
472
+ page: be.value,
473
+ page_size: we.value,
474
474
  ...t.endpointParams,
475
- ...M()
475
+ ...A()
476
476
  };
477
- pe.value && (R.search = pe.value), we.value && he.value !== 0 && (R.ordering = he.value === -1 ? `-${we.value}` : we.value);
478
- const oe = await v.list(t.endpoint, R);
479
- ie.value = oe.data, se.value = oe.rows, (u = oe.extras) != null && u.fields && !((g = t.columns) != null && g.length) && !((L = t.crudFields) != null && L.length) && (xe.value = oe.extras.fields);
477
+ ce.value && (R.search = ce.value), pe.value && W.value !== 0 && (R.ordering = W.value === -1 ? `-${pe.value}` : pe.value);
478
+ const se = await v.list(t.endpoint, R);
479
+ ie.value = se.data, ue.value = se.rows, (u = se.extras) != null && u.fields && !((y = t.columns) != null && y.length) && !((z = t.crudFields) != null && z.length) && ($e.value = se.extras.fields);
480
480
  } catch {
481
- ie.value = [], se.value = 0;
481
+ ie.value = [], ue.value = 0;
482
482
  } finally {
483
483
  ge.value = !1;
484
484
  }
485
485
  }
486
- function ee(u) {
487
- u.key === "F2" && !t.disabled && (u.preventDefault(), ue());
486
+ function _(u) {
487
+ u.key === "F2" && !t.disabled && (u.preventDefault(), ae());
488
488
  }
489
- function ue() {
490
- t.disabled || (pe.value = "", ce.value = 1, we.value = null, he.value = 0, te.value = null, de.value = !0, re());
489
+ function ae() {
490
+ t.disabled || (ce.value = "", be.value = 1, pe.value = null, W.value = 0, ee.value = null, de.value = !0, le());
491
491
  }
492
- function Re(u) {
493
- ce.value = u.page + 1, G.value = u.rows, re();
492
+ function Ie(u) {
493
+ be.value = u.page + 1, we.value = u.rows, le();
494
494
  }
495
- function ke(u) {
496
- we.value = u.sortField ?? null, he.value = u.sortOrder ?? 0, ce.value = 1, re();
495
+ function Re(u) {
496
+ pe.value = u.sortField ?? null, W.value = u.sortOrder ?? 0, be.value = 1, le();
497
497
  }
498
- function Me() {
499
- te.value && (x.value = te.value, n("update:modelValue", te.value), de.value = !1);
498
+ function Ne() {
499
+ ee.value && (x.value = ee.value, n("update:modelValue", ee.value), de.value = !1);
500
500
  }
501
- function c(u) {
501
+ function Ze(u) {
502
502
  x.value = u.data, n("update:modelValue", u.data), de.value = !1;
503
503
  }
504
- const y = B(null), W = B(null);
505
- let s = "";
506
- function U() {
507
- s = "", Ge(() => {
508
- var g, L, R;
509
- const u = (g = y.value) == null ? void 0 : g.$el;
510
- (L = u == null ? void 0 : u.focus) == null || L.call(u), (R = u == null ? void 0 : u.select) == null || R.call(u);
504
+ const Le = U(null), Ce = U(null);
505
+ let Ve = "";
506
+ function c() {
507
+ Ve = "", Qe(() => {
508
+ var y, z, R;
509
+ const u = (y = Le.value) == null ? void 0 : y.$el;
510
+ (z = u == null ? void 0 : u.focus) == null || z.call(u), (R = u == null ? void 0 : u.select) == null || R.call(u);
511
511
  });
512
512
  }
513
- function j() {
514
- Ge(() => {
515
- var g;
516
- const u = (g = W.value) == null ? void 0 : g.querySelector(".p-datatable-tbody > tr");
513
+ function h() {
514
+ Qe(() => {
515
+ var y;
516
+ const u = (y = Ce.value) == null ? void 0 : y.querySelector(".p-datatable-tbody > tr");
517
517
  u == null || u.focus();
518
518
  });
519
519
  }
520
- function $e(u) {
520
+ function G(u) {
521
521
  if (u.key !== "Enter" || u.isComposing) return;
522
522
  u.preventDefault();
523
- const g = pe.value.trim();
524
- if (g === "" || g === s) {
525
- j();
523
+ const y = ce.value.trim();
524
+ if (y === "" || y === Ve) {
525
+ h();
526
526
  return;
527
527
  }
528
- ye && clearTimeout(ye), s = g, ce.value = 1, re();
528
+ me && clearTimeout(me), Ve = y, be.value = 1, le();
529
529
  }
530
- function ze(u) {
531
- u.key === "Enter" && (u.preventDefault(), u.stopPropagation(), te.value && Me());
530
+ function s(u) {
531
+ u.key === "Enter" && (u.preventDefault(), u.stopPropagation(), ee.value && Ne());
532
532
  }
533
- Fe(pe, () => {
534
- ye && clearTimeout(ye), ye = setTimeout(() => {
535
- ce.value = 1, s = pe.value.trim(), re();
533
+ Pe(ce, () => {
534
+ me && clearTimeout(me), me = setTimeout(() => {
535
+ be.value = 1, Ve = ce.value.trim(), le();
536
536
  }, 300);
537
- }), Fe(
538
- () => Z.value.map((u) => H(u.value)),
539
- (u, g) => {
540
- if (de.value && (ce.value = 1, re()), !g) return;
541
- const L = u.some((oe, St) => oe !== g[St]), R = g.some((oe) => !J(oe));
542
- L && R && x.value && (x.value = null, n("update:modelValue", null));
537
+ }), Pe(
538
+ () => Z.value.map((u) => Y(u.value)),
539
+ (u, y) => {
540
+ if (de.value && (be.value = 1, le()), !y) return;
541
+ const z = u.some((se, St) => se !== y[St]), R = y.some((se) => !X(se));
542
+ z && R && x.value && (x.value = null, n("update:modelValue", null));
543
543
  }
544
544
  );
545
- const Ee = B(!1), Ue = B(!1), Ce = B(null), Ve = Pe({}), Be = P(() => Ce.value !== null), Se = P(() => Be.value ? "Editar Registro" : "Novo Registro");
546
- function bt() {
545
+ const M = U(!1), q = U(!1), fe = U(null), xe = Ee({}), Ae = P(() => fe.value !== null), ze = P(() => Ae.value ? "Editar Registro" : "Novo Registro");
546
+ function Oe() {
547
547
  const u = {};
548
- for (const g of _.value)
549
- u[g.field] = g.defaultValue !== void 0 ? typeof g.defaultValue == "function" ? g.defaultValue() : g.defaultValue : null;
548
+ for (const y of te.value)
549
+ u[y.field] = y.defaultValue !== void 0 ? typeof y.defaultValue == "function" ? y.defaultValue() : y.defaultValue : null;
550
550
  return u;
551
551
  }
552
- function wt() {
553
- const u = bt();
554
- for (const g of Object.keys(Ve))
555
- delete Ve[g];
556
- for (const [g, L] of Object.entries(u))
557
- Ve[g] = L;
552
+ function We() {
553
+ const u = Oe();
554
+ for (const y of Object.keys(xe))
555
+ delete xe[y];
556
+ for (const [y, z] of Object.entries(u))
557
+ xe[y] = z;
558
558
  }
559
- function kt() {
560
- Ce.value = null, wt(), Ee.value = !0;
559
+ function je() {
560
+ fe.value = null, We(), M.value = !0;
561
561
  }
562
- function $t(u) {
563
- Ce.value = u;
564
- for (const g of _.value)
565
- Ve[g.field] = u[g.field] !== void 0 ? u[g.field] : null;
566
- Ee.value = !0;
562
+ function Se(u) {
563
+ fe.value = u;
564
+ for (const y of te.value)
565
+ xe[y.field] = u[y.field] !== void 0 ? u[y.field] : null;
566
+ M.value = !0;
567
567
  }
568
- function xt(u, g) {
569
- Ve[u] = g;
568
+ function xt(u, y) {
569
+ xe[u] = y;
570
570
  }
571
571
  async function Ct() {
572
- Ue.value = !0;
572
+ q.value = !0;
573
573
  try {
574
- const u = { ...Ve };
575
- for (const L of _.value) {
576
- const R = u[L.field];
577
- if (L.type === "fk" && R !== null && typeof R == "object") {
578
- const oe = L.optionValue || "id";
579
- u[L.field] = R[oe] ?? R;
574
+ const u = { ...xe };
575
+ for (const z of te.value) {
576
+ const R = u[z.field];
577
+ if (z.type === "fk" && R !== null && typeof R == "object") {
578
+ const se = z.optionValue || "id";
579
+ u[z.field] = R[se] ?? R;
580
580
  }
581
581
  }
582
- let g;
583
- if (Be.value && Ce.value) {
584
- const L = Ce.value[t.optionValue];
585
- g = await v.update(t.endpoint, L, u);
586
- const R = ie.value.findIndex((oe) => oe[t.optionValue] === L);
587
- R !== -1 && (ie.value[R] = g.data), $.success("Registro atualizado com sucesso");
582
+ let y;
583
+ if (Ae.value && fe.value) {
584
+ const z = fe.value[t.optionValue];
585
+ y = await v.update(t.endpoint, z, u);
586
+ const R = ie.value.findIndex((se) => se[t.optionValue] === z);
587
+ R !== -1 && (ie.value[R] = y.data), $.success("Registro atualizado com sucesso");
588
588
  } else
589
- g = await v.create(t.endpoint, u), ie.value.unshift(g.data), se.value++, $.success("Registro criado com sucesso");
590
- Ee.value = !1, Ce.value = null, te.value = g.data;
589
+ y = await v.create(t.endpoint, u), ie.value.unshift(y.data), ue.value++, $.success("Registro criado com sucesso");
590
+ M.value = !1, fe.value = null, ee.value = y.data;
591
591
  } catch (u) {
592
- $.error(lt(u, "Erro ao salvar registro"));
592
+ $.error(it(u, "Erro ao salvar registro"));
593
593
  } finally {
594
- Ue.value = !1;
594
+ q.value = !1;
595
595
  }
596
596
  }
597
597
  function Vt(u) {
598
598
  D(async () => {
599
599
  try {
600
- const g = u[t.optionValue];
601
- await v.delete(t.endpoint, g);
602
- const L = ie.value.findIndex((R) => R[t.optionValue] === g);
603
- L !== -1 && (ie.value.splice(L, 1), se.value--), x.value && x.value[t.optionValue] === g && (x.value = null, n("update:modelValue", null)), te.value && te.value[t.optionValue] === g && (te.value = null), $.success("Registro excluído com sucesso");
604
- } catch (g) {
605
- $.error(lt(g, "Erro ao excluir registro"));
600
+ const y = u[t.optionValue];
601
+ await v.delete(t.endpoint, y);
602
+ const z = ie.value.findIndex((R) => R[t.optionValue] === y);
603
+ z !== -1 && (ie.value.splice(z, 1), ue.value--), x.value && x.value[t.optionValue] === y && (x.value = null, n("update:modelValue", null)), ee.value && ee.value[t.optionValue] === y && (ee.value = null), $.success("Registro excluído com sucesso");
604
+ } catch (y) {
605
+ $.error(it(y, "Erro ao excluir registro"));
606
606
  }
607
607
  });
608
608
  }
609
- return (u, g) => {
610
- const L = dt("tooltip");
611
- return o(), d(Y, null, [
609
+ return (u, y) => {
610
+ const z = vt("tooltip");
611
+ return o(), d(J, null, [
612
612
  m("div", Dt({ class: "w-autocompletefk" }, u.$attrs), [
613
- S(r(vt), {
613
+ S(r(gt), {
614
614
  ref_key: "acRef",
615
- ref: q,
615
+ ref: H,
616
616
  "model-value": x.value,
617
617
  suggestions: E.value,
618
618
  "option-label": e.optionLabel,
619
- placeholder: N.value,
619
+ placeholder: L.value,
620
620
  disabled: e.disabled,
621
621
  "force-selection": e.forceSelection,
622
622
  loading: T.value,
623
623
  fluid: "",
624
- onComplete: ae,
625
- onItemSelect: me,
624
+ onComplete: ne,
625
+ onItemSelect: ve,
626
626
  onClear: De,
627
- onKeydown: ee
627
+ onKeydown: _
628
628
  }, null, 8, ["model-value", "suggestions", "option-label", "placeholder", "disabled", "force-selection", "loading"]),
629
- fe((o(), d("button", {
629
+ he((o(), d("button", {
630
630
  type: "button",
631
631
  disabled: e.disabled,
632
632
  "data-kbd-skip": "",
633
633
  tabindex: "-1",
634
634
  class: "w-autocompletefk-trigger",
635
- onClick: ue
636
- }, [...g[6] || (g[6] = [
635
+ onClick: ae
636
+ }, [...y[6] || (y[6] = [
637
637
  m("i", { class: "pi pi-search" }, null, -1)
638
638
  ])], 8, pl)), [
639
639
  [
640
- L,
640
+ z,
641
641
  "Pesquisar (F2)",
642
642
  void 0,
643
643
  { top: !0 }
644
644
  ]
645
645
  ])
646
646
  ], 16),
647
- S(r(tt), {
647
+ S(r(Xe), {
648
648
  visible: de.value,
649
- "onUpdate:visible": g[4] || (g[4] = (R) => de.value = R),
649
+ "onUpdate:visible": y[4] || (y[4] = (R) => de.value = R),
650
650
  header: e.dialogHeader || "Pesquisar",
651
651
  style: { width: "80vw" },
652
652
  modal: "",
653
653
  draggable: !1,
654
654
  class: "w-autocompletefk-dialog",
655
- onShow: U
655
+ onShow: c
656
656
  }, {
657
657
  footer: K(() => [
658
658
  m("div", bl, [
659
- S(r(z), {
659
+ S(r(N), {
660
660
  label: "Cancelar",
661
661
  severity: "secondary",
662
662
  text: "",
663
- onClick: g[3] || (g[3] = (R) => de.value = !1)
663
+ onClick: y[3] || (y[3] = (R) => de.value = !1)
664
664
  }),
665
- S(r(z), {
665
+ S(r(N), {
666
666
  label: "Selecionar",
667
667
  icon: "pi pi-check",
668
- disabled: !te.value,
669
- onClick: Me
668
+ disabled: !ee.value,
669
+ onClick: Ne
670
670
  }, null, 8, ["disabled"])
671
671
  ])
672
672
  ]),
673
673
  default: K(() => [
674
674
  m("div", hl, [
675
- S(r(Te), { class: "w-autocompletefk-toolbar-search" }, {
675
+ S(r(Ue), { class: "w-autocompletefk-toolbar-search" }, {
676
676
  default: K(() => [
677
- S(r(Ne), { class: "pi pi-search" }),
678
- S(r(ve), {
677
+ S(r(Be), { class: "pi pi-search" }),
678
+ S(r(ye), {
679
679
  ref_key: "modalSearchInput",
680
- ref: y,
681
- modelValue: pe.value,
682
- "onUpdate:modelValue": g[0] || (g[0] = (R) => pe.value = R),
680
+ ref: Le,
681
+ modelValue: ce.value,
682
+ "onUpdate:modelValue": y[0] || (y[0] = (R) => ce.value = R),
683
683
  placeholder: "Pesquisar...",
684
684
  class: "w-full",
685
685
  autofocus: "",
686
- onKeydown: $e
686
+ onKeydown: G
687
687
  }, null, 8, ["modelValue"])
688
688
  ]),
689
689
  _: 1
690
690
  }),
691
691
  m("div", yl, [
692
- p.value ? (o(), C(r(z), {
692
+ p.value ? (o(), C(r(N), {
693
693
  key: 0,
694
694
  label: "Novo",
695
695
  icon: "pi pi-plus",
696
696
  size: "small",
697
- onClick: kt
697
+ onClick: je
698
698
  })) : b("", !0)
699
699
  ])
700
700
  ]),
701
701
  m("div", {
702
702
  ref_key: "modalTableWrap",
703
- ref: W,
704
- onKeydownCapture: ze
703
+ ref: Ce,
704
+ onKeydownCapture: s
705
705
  }, [
706
- S(r(ct), {
707
- selection: te.value,
708
- "onUpdate:selection": g[1] || (g[1] = (R) => te.value = R),
706
+ S(r(pt), {
707
+ selection: ee.value,
708
+ "onUpdate:selection": y[1] || (y[1] = (R) => ee.value = R),
709
709
  "meta-key-selection": !1,
710
710
  value: ie.value,
711
711
  loading: ge.value,
@@ -714,76 +714,76 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
714
714
  "striped-rows": "",
715
715
  "removable-sort": "",
716
716
  size: "small",
717
- rows: G.value,
718
- "total-records": se.value,
719
- "sort-field": we.value ?? void 0,
720
- "sort-order": he.value,
717
+ rows: we.value,
718
+ "total-records": ue.value,
719
+ "sort-field": pe.value ?? void 0,
720
+ "sort-order": W.value,
721
721
  "selection-mode": "single",
722
722
  "data-key": e.optionValue,
723
- onPage: Re,
724
- onSort: g[2] || (g[2] = (R) => ke({ sortField: R.sortField, sortOrder: R.sortOrder })),
725
- onRowDblclick: c
723
+ onPage: Ie,
724
+ onSort: y[2] || (y[2] = (R) => Re({ sortField: R.sortField, sortOrder: R.sortOrder })),
725
+ onRowDblclick: Ze
726
726
  }, {
727
- empty: K(() => [...g[7] || (g[7] = [
727
+ empty: K(() => [...y[7] || (y[7] = [
728
728
  m("div", { class: "w-autocompletefk-empty" }, "Nenhum registro encontrado", -1)
729
729
  ])]),
730
730
  default: K(() => [
731
- S(r(Ae), {
731
+ S(r(Me), {
732
732
  "selection-mode": "single",
733
733
  "header-style": "width: 3rem"
734
734
  }),
735
- (o(!0), d(Y, null, le(X.value, (R) => (o(), C(r(Ae), {
735
+ (o(!0), d(J, null, oe(j.value, (R) => (o(), C(r(Me), {
736
736
  key: R.field,
737
737
  field: R.field,
738
738
  header: R.header,
739
739
  sortable: R.sortable ?? !0,
740
- style: be(R.style)
740
+ style: ke(R.style)
741
741
  }, {
742
- body: K(({ data: oe }) => [
743
- R.type ? (o(), C(Qe, {
742
+ body: K(({ data: se }) => [
743
+ R.type ? (o(), C(at, {
744
744
  key: 0,
745
745
  column: R,
746
- value: oe[R.field],
747
- "row-data": oe
748
- }, null, 8, ["column", "value", "row-data"])) : (o(), d(Y, { key: 1 }, [
749
- Ie(I(oe[R.field]), 1)
746
+ value: se[R.field],
747
+ "row-data": se
748
+ }, null, 8, ["column", "value", "row-data"])) : (o(), d(J, { key: 1 }, [
749
+ Fe(I(se[R.field]), 1)
750
750
  ], 64))
751
751
  ]),
752
752
  _: 2
753
753
  }, 1032, ["field", "header", "sortable", "style"]))), 128)),
754
- k.value ? (o(), C(r(Ae), {
754
+ k.value ? (o(), C(r(Me), {
755
755
  key: 0,
756
756
  header: "",
757
757
  style: { width: "6rem" }
758
758
  }, {
759
759
  body: K(({ data: R }) => [
760
760
  m("div", gl, [
761
- h.value ? fe((o(), C(r(z), {
761
+ g.value ? he((o(), C(r(N), {
762
762
  key: 0,
763
763
  icon: "pi pi-pencil",
764
764
  text: "",
765
765
  rounded: "",
766
766
  size: "small",
767
- onClick: (oe) => $t(R)
767
+ onClick: (se) => Se(R)
768
768
  }, null, 8, ["onClick"])), [
769
769
  [
770
- L,
770
+ z,
771
771
  "Editar",
772
772
  void 0,
773
773
  { top: !0 }
774
774
  ]
775
775
  ]) : b("", !0),
776
- l.value ? fe((o(), C(r(z), {
776
+ l.value ? he((o(), C(r(N), {
777
777
  key: 1,
778
778
  icon: "pi pi-trash",
779
779
  text: "",
780
780
  rounded: "",
781
781
  size: "small",
782
782
  severity: "danger",
783
- onClick: (oe) => Vt(R)
783
+ onClick: (se) => Vt(R)
784
784
  }, null, 8, ["onClick"])), [
785
785
  [
786
- L,
786
+ z,
787
787
  "Excluir",
788
788
  void 0,
789
789
  { top: !0 }
@@ -800,17 +800,17 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
800
800
  ]),
801
801
  _: 1
802
802
  }, 8, ["visible", "header"]),
803
- f.value ? (o(), C(gt, {
803
+ f.value ? (o(), C($t, {
804
804
  key: 0,
805
- visible: Ee.value,
806
- title: Se.value,
807
- fields: _.value,
808
- "form-data": Ve,
809
- "is-editing": Be.value,
810
- saving: Ue.value,
805
+ visible: M.value,
806
+ title: ze.value,
807
+ fields: te.value,
808
+ "form-data": xe,
809
+ "is-editing": Ae.value,
810
+ saving: q.value,
811
811
  width: e.dialogWidth,
812
- "onUpdate:visible": g[5] || (g[5] = (R) => {
813
- Ee.value = R, R || (Ce.value = null);
812
+ "onUpdate:visible": y[5] || (y[5] = (R) => {
813
+ M.value = R, R || (fe.value = null);
814
814
  }),
815
815
  "onUpdate:field": xt,
816
816
  onSave: Ct
@@ -818,7 +818,7 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
818
818
  ], 64);
819
819
  };
820
820
  }
821
- }), kl = { class: "w-datepicker" }, $l = { class: "w-datepicker-panel" }, xl = { class: "w-datepicker-actions" }, st = /* @__PURE__ */ ne({
821
+ }), kl = { class: "w-datepicker" }, $l = { class: "w-datepicker-panel" }, xl = { class: "w-datepicker-actions" }, ct = /* @__PURE__ */ re({
822
822
  __name: "WDatePicker",
823
823
  props: {
824
824
  modelValue: { default: null },
@@ -838,8 +838,8 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
838
838
  const t = e, n = a, i = Nt({
839
839
  showTime: () => t.showTime,
840
840
  valueFormat: () => t.valueFormat
841
- }), v = B(""), $ = B(null), D = B(null), x = P(() => ({ mask: i.mask() })), E = P(() => i.toDate(t.minDate) ?? void 0), T = P(() => i.toDate(t.maxDate) ?? void 0);
842
- Fe(
841
+ }), v = U(""), $ = U(null), D = U(null), x = P(() => ({ mask: i.mask() })), E = P(() => i.toDate(t.minDate) ?? void 0), T = P(() => i.toDate(t.maxDate) ?? void 0);
842
+ Pe(
843
843
  () => t.modelValue,
844
844
  (V) => {
845
845
  const O = i.toDate(V);
@@ -850,7 +850,7 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
850
850
  function w(V) {
851
851
  n("update:modelValue", i.toValue(V));
852
852
  }
853
- function q() {
853
+ function H() {
854
854
  if (v.value === "") {
855
855
  w(null);
856
856
  return;
@@ -858,65 +858,65 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
858
858
  const V = i.fromDisplay(v.value);
859
859
  V && w(V);
860
860
  }
861
- function J() {
861
+ function X() {
862
862
  v.value = i.toDisplay(i.toDate(t.modelValue));
863
863
  }
864
- function H(V) {
864
+ function Y(V) {
865
865
  V.key === "F2" && !t.disabled && (V.preventDefault(), F());
866
866
  }
867
867
  function Z(V) {
868
- var ae;
869
- w(V ?? null), t.showTime || (ae = D.value) == null || ae.hide();
868
+ var ne;
869
+ w(V ?? null), t.showTime || (ne = D.value) == null || ne.hide();
870
870
  }
871
871
  function F() {
872
872
  w(i.today());
873
873
  }
874
- function M() {
874
+ function A() {
875
875
  var V;
876
876
  w(null), (V = D.value) == null || V.hide();
877
877
  }
878
- function N(V) {
878
+ function L(V) {
879
879
  var O;
880
880
  t.disabled || (O = D.value) == null || O.toggle(V);
881
881
  }
882
- return _e(() => {
882
+ return ot(() => {
883
883
  t.autonow && t.modelValue == null && F();
884
884
  }), (V, O) => (o(), d("div", kl, [
885
- S(r(Te), null, {
885
+ S(r(Ue), null, {
886
886
  default: K(() => [
887
- fe(S(r(ve), {
887
+ he(S(r(ye), {
888
888
  id: e.inputId,
889
889
  modelValue: v.value,
890
- "onUpdate:modelValue": O[0] || (O[0] = (ae) => v.value = ae),
890
+ "onUpdate:modelValue": O[0] || (O[0] = (ne) => v.value = ne),
891
891
  placeholder: e.placeholder ?? r(i).placeholder(),
892
892
  disabled: e.disabled,
893
893
  invalid: e.invalid,
894
894
  fluid: "",
895
895
  autocomplete: "off",
896
896
  inputmode: "numeric",
897
- onInput: q,
898
- onBlur: J,
899
- onKeydown: H
897
+ onInput: H,
898
+ onBlur: X,
899
+ onKeydown: Y
900
900
  }, null, 8, ["id", "modelValue", "placeholder", "disabled", "invalid"]), [
901
- [r(Ke), x.value]
901
+ [r(Ye), x.value]
902
902
  ]),
903
- S(r(Ne), {
903
+ S(r(Be), {
904
904
  class: Q(["pi pi-calendar w-datepicker-icon", { "w-datepicker-icon-disabled": e.disabled }]),
905
905
  role: "button",
906
906
  tabindex: "-1",
907
907
  "aria-label": "Abrir calendário",
908
- onClick: N
908
+ onClick: L
909
909
  }, null, 8, ["class"])
910
910
  ]),
911
911
  _: 1
912
912
  }),
913
- S(r(mt), {
913
+ S(r(ht), {
914
914
  ref_key: "op",
915
915
  ref: D
916
916
  }, {
917
917
  default: K(() => [
918
918
  m("div", $l, [
919
- S(r(pt), {
919
+ S(r(bt), {
920
920
  "model-value": $.value ?? void 0,
921
921
  inline: "",
922
922
  "show-time": e.showTime,
@@ -926,19 +926,19 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
926
926
  "onUpdate:modelValue": Z
927
927
  }, null, 8, ["model-value", "show-time", "min-date", "max-date"]),
928
928
  m("div", xl, [
929
- S(r(z), {
929
+ S(r(N), {
930
930
  label: "Hoje",
931
931
  text: "",
932
932
  size: "small",
933
933
  onClick: F
934
934
  }),
935
- e.showClear ? (o(), C(r(z), {
935
+ e.showClear ? (o(), C(r(N), {
936
936
  key: 0,
937
937
  label: "Limpar",
938
938
  text: "",
939
939
  size: "small",
940
940
  severity: "secondary",
941
- onClick: M
941
+ onClick: A
942
942
  })) : b("", !0)
943
943
  ])
944
944
  ])
@@ -947,7 +947,7 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
947
947
  }, 512)
948
948
  ]));
949
949
  }
950
- }), Cl = /* @__PURE__ */ ne({
950
+ }), Cl = /* @__PURE__ */ re({
951
951
  __name: "WMoneyInput",
952
952
  props: {
953
953
  modelValue: {},
@@ -983,13 +983,13 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
983
983
  class: "w-money-input"
984
984
  }, {
985
985
  default: K(() => [
986
- i.value ? (o(), C(r(at), { key: 0 }, {
986
+ i.value ? (o(), C(r(st), { key: 0 }, {
987
987
  default: K(() => [
988
- Ie(I(i.value), 1)
988
+ Fe(I(i.value), 1)
989
989
  ]),
990
990
  _: 1
991
991
  })) : b("", !0),
992
- S(r(ve), {
992
+ S(r(ye), {
993
993
  "model-value": $.value,
994
994
  inputmode: "numeric",
995
995
  class: "w-money-input__field",
@@ -998,15 +998,15 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
998
998
  invalid: e.invalid,
999
999
  onInput: D
1000
1000
  }, null, 8, ["model-value", "placeholder", "disabled", "invalid"]),
1001
- e.suffix ? (o(), C(r(at), { key: 1 }, {
1001
+ e.suffix ? (o(), C(r(st), { key: 1 }, {
1002
1002
  default: K(() => [
1003
- Ie(I(e.suffix), 1)
1003
+ Fe(I(e.suffix), 1)
1004
1004
  ]),
1005
1005
  _: 1
1006
1006
  })) : b("", !0)
1007
1007
  ]),
1008
1008
  _: 1
1009
- })) : (o(), C(r(ve), {
1009
+ })) : (o(), C(r(ye), {
1010
1010
  key: 1,
1011
1011
  "model-value": $.value,
1012
1012
  inputmode: "numeric",
@@ -1018,7 +1018,7 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
1018
1018
  onInput: D
1019
1019
  }, null, 8, ["model-value", "placeholder", "disabled", "invalid"]));
1020
1020
  }
1021
- }), Vl = { class: "w-imgcropper" }, Sl = ["src"], Dl = { class: "w-imgcropper-actions" }, El = ["accept"], Pl = { class: "w-imgcropper-stage" }, Fl = ["src"], Il = { class: "w-imgcropper-zoom" }, je = 300, Rl = /* @__PURE__ */ ne({
1021
+ }), Vl = { class: "w-imgcropper" }, Sl = ["src"], Dl = { class: "w-imgcropper-actions" }, El = ["accept"], Pl = { class: "w-imgcropper-stage" }, Fl = ["src"], Il = { class: "w-imgcropper-zoom" }, He = 300, Rl = /* @__PURE__ */ re({
1022
1022
  __name: "WImageCropper",
1023
1023
  props: {
1024
1024
  modelValue: { default: null },
@@ -1031,8 +1031,8 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
1031
1031
  },
1032
1032
  emits: ["update:modelValue", "error"],
1033
1033
  setup(e, { emit: a }) {
1034
- const t = e, n = a, i = B(null);
1035
- Fe(
1034
+ const t = e, n = a, i = U(null);
1035
+ Pe(
1036
1036
  () => t.modelValue,
1037
1037
  (p) => {
1038
1038
  i.value && (URL.revokeObjectURL(i.value), i.value = null), p instanceof File && (i.value = URL.createObjectURL(p));
@@ -1041,20 +1041,20 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
1041
1041
  ), Et(() => {
1042
1042
  i.value && URL.revokeObjectURL(i.value);
1043
1043
  });
1044
- const v = P(() => t.modelValue instanceof File ? i.value : typeof t.modelValue == "string" && t.modelValue ? t.modelValue : null), $ = B(null);
1044
+ const v = P(() => t.modelValue instanceof File ? i.value : typeof t.modelValue == "string" && t.modelValue ? t.modelValue : null), $ = U(null);
1045
1045
  function D() {
1046
1046
  var p;
1047
1047
  (p = $.value) == null || p.click();
1048
1048
  }
1049
1049
  function x(p) {
1050
- const h = (t.accept || "").trim();
1051
- return !h || h === "*" || h.includes("image/*") ? p.type.startsWith("image/") : h.split(",").map((l) => l.trim()).filter(Boolean).some((l) => l.endsWith("/*") ? p.type.startsWith(l.slice(0, -1)) : l.startsWith(".") ? p.name.toLowerCase().endsWith(l.toLowerCase()) : p.type === l);
1050
+ const g = (t.accept || "").trim();
1051
+ return !g || g === "*" || g.includes("image/*") ? p.type.startsWith("image/") : g.split(",").map((l) => l.trim()).filter(Boolean).some((l) => l.endsWith("/*") ? p.type.startsWith(l.slice(0, -1)) : l.startsWith(".") ? p.name.toLowerCase().endsWith(l.toLowerCase()) : p.type === l);
1052
1052
  }
1053
1053
  let E = "image.png", T = "image/png", w = null;
1054
- function q(p) {
1055
- var _;
1056
- const h = p.target, l = (_ = h.files) == null ? void 0 : _[0];
1057
- if (h.value = "", !l) return;
1054
+ function H(p) {
1055
+ var te;
1056
+ const g = p.target, l = (te = g.files) == null ? void 0 : te[0];
1057
+ if (g.value = "", !l) return;
1058
1058
  if (!x(l)) {
1059
1059
  n("error", "Tipo de arquivo não suportado.");
1060
1060
  return;
@@ -1066,89 +1066,89 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
1066
1066
  E = l.name, T = l.type || "image/png";
1067
1067
  const k = new FileReader();
1068
1068
  k.onload = () => {
1069
- const X = new Image();
1070
- X.onload = () => {
1071
- w = X, F.value = X.naturalWidth, M.value = X.naturalHeight, N.value = 1, Z.value = X.src, V.x = (ae.value - ie.value) / 2, V.y = (me.value - ge.value) / 2, H.value = !0;
1072
- }, X.onerror = () => n("error", "Não foi possível carregar a imagem."), X.src = String(k.result);
1069
+ const j = new Image();
1070
+ j.onload = () => {
1071
+ w = j, F.value = j.naturalWidth, A.value = j.naturalHeight, L.value = 1, Z.value = j.src, V.x = (ne.value - ie.value) / 2, V.y = (ve.value - ge.value) / 2, Y.value = !0;
1072
+ }, j.onerror = () => n("error", "Não foi possível carregar a imagem."), j.src = String(k.result);
1073
1073
  }, k.onerror = () => n("error", "Falha ao ler o arquivo."), k.readAsDataURL(l);
1074
1074
  }
1075
- function J() {
1075
+ function X() {
1076
1076
  n("update:modelValue", null);
1077
1077
  }
1078
- const H = B(!1), Z = B(""), F = B(0), M = B(0), N = B(1), V = Pe({ x: 0, y: 0 }), O = P(() => t.circular ? 1 : t.aspectRatio || 1), ae = P(() => O.value >= 1 ? je : Math.round(je * O.value)), me = P(() => O.value >= 1 ? Math.round(je / O.value) : je), De = P(
1079
- () => F.value && M.value ? Math.max(ae.value / F.value, me.value / M.value) : 1
1080
- ), de = P(() => De.value * N.value), ie = P(() => F.value * de.value), ge = P(() => M.value * de.value);
1081
- function pe() {
1082
- V.x = Math.min(0, Math.max(ae.value - ie.value, V.x)), V.y = Math.min(0, Math.max(me.value - ge.value, V.y));
1078
+ const Y = U(!1), Z = U(""), F = U(0), A = U(0), L = U(1), V = Ee({ x: 0, y: 0 }), O = P(() => t.circular ? 1 : t.aspectRatio || 1), ne = P(() => O.value >= 1 ? He : Math.round(He * O.value)), ve = P(() => O.value >= 1 ? Math.round(He / O.value) : He), De = P(
1079
+ () => F.value && A.value ? Math.max(ne.value / F.value, ve.value / A.value) : 1
1080
+ ), de = P(() => De.value * L.value), ie = P(() => F.value * de.value), ge = P(() => A.value * de.value);
1081
+ function ce() {
1082
+ V.x = Math.min(0, Math.max(ne.value - ie.value, V.x)), V.y = Math.min(0, Math.max(ve.value - ge.value, V.y));
1083
1083
  }
1084
- Fe(N, pe);
1085
- const ce = P(() => ({
1084
+ Pe(L, ce);
1085
+ const be = P(() => ({
1086
1086
  width: `${ie.value}px`,
1087
1087
  height: `${ge.value}px`,
1088
1088
  transform: `translate(${V.x}px, ${V.y}px)`
1089
- })), G = B(!1);
1090
- let se = { x: 0, y: 0, ox: 0, oy: 0 };
1091
- function te(p) {
1092
- var h, l;
1093
- G.value = !0, (l = (h = p.currentTarget).setPointerCapture) == null || l.call(h, p.pointerId), se = { x: p.clientX, y: p.clientY, ox: V.x, oy: V.y };
1089
+ })), we = U(!1);
1090
+ let ue = { x: 0, y: 0, ox: 0, oy: 0 };
1091
+ function ee(p) {
1092
+ var g, l;
1093
+ we.value = !0, (l = (g = p.currentTarget).setPointerCapture) == null || l.call(g, p.pointerId), ue = { x: p.clientX, y: p.clientY, ox: V.x, oy: V.y };
1094
1094
  }
1095
- function we(p) {
1096
- G.value && (V.x = se.ox + (p.clientX - se.x), V.y = se.oy + (p.clientY - se.y), pe());
1095
+ function pe(p) {
1096
+ we.value && (V.x = ue.ox + (p.clientX - ue.x), V.y = ue.oy + (p.clientY - ue.y), ce());
1097
1097
  }
1098
- function he() {
1099
- G.value = !1;
1098
+ function W() {
1099
+ we.value = !1;
1100
1100
  }
1101
- function ye() {
1101
+ function me() {
1102
1102
  return t.circular ? "image/png" : T === "image/jpeg" || T === "image/png" || T === "image/webp" ? T : "image/png";
1103
1103
  }
1104
- function xe(p) {
1105
- const h = p === "image/png" ? "png" : p === "image/webp" ? "webp" : "jpg";
1106
- return `${E.replace(/\.[^.]+$/, "") || "image"}.${h}`;
1104
+ function $e(p) {
1105
+ const g = p === "image/png" ? "png" : p === "image/webp" ? "webp" : "jpg";
1106
+ return `${E.replace(/\.[^.]+$/, "") || "image"}.${g}`;
1107
1107
  }
1108
1108
  function f() {
1109
1109
  if (!w) return;
1110
- const p = de.value, h = -V.x / p, l = -V.y / p, k = ae.value / p, _ = me.value / p, X = document.createElement("canvas");
1111
- X.width = Math.max(1, Math.round(k)), X.height = Math.max(1, Math.round(_));
1112
- const re = X.getContext("2d");
1113
- if (!re) {
1110
+ const p = de.value, g = -V.x / p, l = -V.y / p, k = ne.value / p, te = ve.value / p, j = document.createElement("canvas");
1111
+ j.width = Math.max(1, Math.round(k)), j.height = Math.max(1, Math.round(te));
1112
+ const le = j.getContext("2d");
1113
+ if (!le) {
1114
1114
  n("error", "Canvas indisponível neste ambiente.");
1115
1115
  return;
1116
1116
  }
1117
- t.circular && (re.beginPath(), re.ellipse(
1118
- X.width / 2,
1119
- X.height / 2,
1120
- X.width / 2,
1121
- X.height / 2,
1117
+ t.circular && (le.beginPath(), le.ellipse(
1118
+ j.width / 2,
1119
+ j.height / 2,
1120
+ j.width / 2,
1121
+ j.height / 2,
1122
1122
  0,
1123
1123
  0,
1124
1124
  Math.PI * 2
1125
- ), re.clip()), re.drawImage(w, h, l, k, _, 0, 0, X.width, X.height);
1126
- const ee = ye();
1127
- X.toBlob(
1128
- (ue) => {
1129
- if (!ue) {
1125
+ ), le.clip()), le.drawImage(w, g, l, k, te, 0, 0, j.width, j.height);
1126
+ const _ = me();
1127
+ j.toBlob(
1128
+ (ae) => {
1129
+ if (!ae) {
1130
1130
  n("error", "Falha ao processar a imagem.");
1131
1131
  return;
1132
1132
  }
1133
- n("update:modelValue", new File([ue], xe(ee), { type: ee })), H.value = !1;
1133
+ n("update:modelValue", new File([ae], $e(_), { type: _ })), Y.value = !1;
1134
1134
  },
1135
- ee,
1135
+ _,
1136
1136
  0.92
1137
1137
  );
1138
1138
  }
1139
- return (p, h) => (o(), d("div", Vl, [
1139
+ return (p, g) => (o(), d("div", Vl, [
1140
1140
  m("div", {
1141
1141
  class: Q(["w-imgcropper-preview", { "is-circular": e.circular, "is-empty": !v.value }]),
1142
- style: be({ width: `${e.width}px`, height: `${e.height}px` })
1142
+ style: ke({ width: `${e.width}px`, height: `${e.height}px` })
1143
1143
  }, [
1144
- v.value ? (o(), d(Y, { key: 0 }, [
1144
+ v.value ? (o(), d(J, { key: 0 }, [
1145
1145
  m("img", {
1146
1146
  src: v.value,
1147
1147
  alt: "",
1148
1148
  class: "w-imgcropper-img"
1149
1149
  }, null, 8, Sl),
1150
1150
  m("div", Dl, [
1151
- S(r(z), {
1151
+ S(r(N), {
1152
1152
  type: "button",
1153
1153
  icon: "pi pi-pencil",
1154
1154
  rounded: "",
@@ -1156,22 +1156,22 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
1156
1156
  "aria-label": "Trocar imagem",
1157
1157
  onClick: D
1158
1158
  }),
1159
- S(r(z), {
1159
+ S(r(N), {
1160
1160
  type: "button",
1161
1161
  icon: "pi pi-trash",
1162
1162
  rounded: "",
1163
1163
  text: "",
1164
1164
  severity: "danger",
1165
1165
  "aria-label": "Remover imagem",
1166
- onClick: J
1166
+ onClick: X
1167
1167
  })
1168
1168
  ])
1169
- ], 64)) : A(p.$slots, "placeholder", { open: D }, () => [
1169
+ ], 64)) : B(p.$slots, "placeholder", { open: D }, () => [
1170
1170
  m("button", {
1171
1171
  type: "button",
1172
1172
  class: "w-imgcropper-empty",
1173
1173
  onClick: D
1174
- }, [...h[3] || (h[3] = [
1174
+ }, [...g[3] || (g[3] = [
1175
1175
  m("i", { class: "pi pi-image" }, null, -1),
1176
1176
  m("span", null, "Selecionar imagem", -1)
1177
1177
  ])])
@@ -1183,24 +1183,24 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
1183
1183
  type: "file",
1184
1184
  accept: e.accept,
1185
1185
  class: "w-imgcropper-file",
1186
- onChange: q
1186
+ onChange: H
1187
1187
  }, null, 40, El),
1188
- S(r(tt), {
1189
- visible: H.value,
1190
- "onUpdate:visible": h[2] || (h[2] = (l) => H.value = l),
1188
+ S(r(Xe), {
1189
+ visible: Y.value,
1190
+ "onUpdate:visible": g[2] || (g[2] = (l) => Y.value = l),
1191
1191
  modal: "",
1192
1192
  header: "Ajustar imagem",
1193
1193
  "dismissable-mask": !1,
1194
1194
  style: { width: "auto" }
1195
1195
  }, {
1196
1196
  footer: K(() => [
1197
- S(r(z), {
1197
+ S(r(N), {
1198
1198
  type: "button",
1199
1199
  label: "Cancelar",
1200
1200
  text: "",
1201
- onClick: h[1] || (h[1] = (l) => H.value = !1)
1201
+ onClick: g[1] || (g[1] = (l) => Y.value = !1)
1202
1202
  }),
1203
- S(r(z), {
1203
+ S(r(N), {
1204
1204
  type: "button",
1205
1205
  label: "Confirmar",
1206
1206
  onClick: f
@@ -1210,18 +1210,18 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
1210
1210
  m("div", Pl, [
1211
1211
  m("div", {
1212
1212
  class: Q(["w-imgcropper-viewport", { "is-circular": e.circular }]),
1213
- style: be({ width: `${ae.value}px`, height: `${me.value}px` }),
1214
- onPointerdown: te,
1215
- onPointermove: we,
1216
- onPointerup: he,
1217
- onPointerleave: he
1213
+ style: ke({ width: `${ne.value}px`, height: `${ve.value}px` }),
1214
+ onPointerdown: ee,
1215
+ onPointermove: pe,
1216
+ onPointerup: W,
1217
+ onPointerleave: W
1218
1218
  }, [
1219
1219
  Z.value ? (o(), d("img", {
1220
1220
  key: 0,
1221
1221
  src: Z.value,
1222
1222
  alt: "",
1223
1223
  class: "w-imgcropper-cropimg",
1224
- style: be(ce.value),
1224
+ style: ke(be.value),
1225
1225
  draggable: "false"
1226
1226
  }, null, 12, Fl)) : b("", !0),
1227
1227
  m("div", {
@@ -1229,16 +1229,16 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
1229
1229
  }, null, 2)
1230
1230
  ], 38),
1231
1231
  m("div", Il, [
1232
- h[4] || (h[4] = m("i", { class: "pi pi-search-minus" }, null, -1)),
1232
+ g[4] || (g[4] = m("i", { class: "pi pi-search-minus" }, null, -1)),
1233
1233
  S(r(Ht), {
1234
- modelValue: N.value,
1235
- "onUpdate:modelValue": h[0] || (h[0] = (l) => N.value = l),
1234
+ modelValue: L.value,
1235
+ "onUpdate:modelValue": g[0] || (g[0] = (l) => L.value = l),
1236
1236
  min: 1,
1237
1237
  max: 4,
1238
1238
  step: 0.01,
1239
1239
  class: "w-imgcropper-slider"
1240
1240
  }, null, 8, ["modelValue"]),
1241
- h[5] || (h[5] = m("i", { class: "pi pi-search-plus" }, null, -1))
1241
+ g[5] || (g[5] = m("i", { class: "pi pi-search-plus" }, null, -1))
1242
1242
  ])
1243
1243
  ])
1244
1244
  ]),
@@ -1257,7 +1257,7 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
1257
1257
  }, Ol = { class: "w-transfer__controls" }, Wl = { class: "w-transfer__pane" }, jl = { class: "w-transfer__head" }, ql = { class: "w-transfer__count" }, Kl = { class: "w-transfer__list" }, Hl = ["onClick"], Gl = {
1258
1258
  key: 0,
1259
1259
  class: "w-transfer__empty"
1260
- }, Yl = /* @__PURE__ */ ne({
1260
+ }, Yl = /* @__PURE__ */ re({
1261
1261
  __name: "WTransferList",
1262
1262
  props: {
1263
1263
  source: {},
@@ -1269,34 +1269,34 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
1269
1269
  },
1270
1270
  emits: ["update:selected"],
1271
1271
  setup(e, { emit: a }) {
1272
- const t = e, n = a, i = B(""), v = B(""), $ = P(() => new Set(t.selected)), D = P(() => t.searchFields ?? [t.optionLabel]);
1273
- function x(M) {
1274
- return M[t.trackBy];
1272
+ const t = e, n = a, i = U(""), v = U(""), $ = P(() => new Set(t.selected)), D = P(() => t.searchFields ?? [t.optionLabel]);
1273
+ function x(A) {
1274
+ return A[t.trackBy];
1275
1275
  }
1276
- function E(M) {
1277
- return String(M[t.optionLabel] ?? "");
1276
+ function E(A) {
1277
+ return String(A[t.optionLabel] ?? "");
1278
1278
  }
1279
- function T(M, N) {
1280
- if (!N) return !0;
1281
- const V = N.toLowerCase();
1279
+ function T(A, L) {
1280
+ if (!L) return !0;
1281
+ const V = L.toLowerCase();
1282
1282
  return D.value.some(
1283
- (O) => String(M[O] ?? "").toLowerCase().includes(V)
1283
+ (O) => String(A[O] ?? "").toLowerCase().includes(V)
1284
1284
  );
1285
1285
  }
1286
1286
  const w = P(
1287
- () => t.source.filter((M) => !$.value.has(x(M)) && T(M, i.value))
1288
- ), q = P(
1289
- () => t.source.filter((M) => $.value.has(x(M)) && T(M, v.value))
1287
+ () => t.source.filter((A) => !$.value.has(x(A)) && T(A, i.value))
1288
+ ), H = P(
1289
+ () => t.source.filter((A) => $.value.has(x(A)) && T(A, v.value))
1290
1290
  );
1291
- function J(M) {
1292
- t.disabled || n("update:selected", [...t.selected, x(M)]);
1291
+ function X(A) {
1292
+ t.disabled || n("update:selected", [...t.selected, x(A)]);
1293
1293
  }
1294
- function H(M) {
1294
+ function Y(A) {
1295
1295
  if (t.disabled) return;
1296
- const N = x(M);
1296
+ const L = x(A);
1297
1297
  n(
1298
1298
  "update:selected",
1299
- t.selected.filter((V) => V !== N)
1299
+ t.selected.filter((V) => V !== L)
1300
1300
  );
1301
1301
  }
1302
1302
  function Z() {
@@ -1305,20 +1305,20 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
1305
1305
  function F() {
1306
1306
  t.disabled || n("update:selected", []);
1307
1307
  }
1308
- return (M, N) => (o(), d("div", {
1308
+ return (A, L) => (o(), d("div", {
1309
1309
  class: Q(["w-transfer", { "w-transfer--disabled": e.disabled }])
1310
1310
  }, [
1311
1311
  m("div", Ul, [
1312
1312
  m("div", Bl, [
1313
- N[2] || (N[2] = m("span", { class: "w-transfer__title" }, "Disponíveis", -1)),
1313
+ L[2] || (L[2] = m("span", { class: "w-transfer__title" }, "Disponíveis", -1)),
1314
1314
  m("span", Tl, I(w.value.length), 1)
1315
1315
  ]),
1316
- S(r(Te), { class: "w-transfer__search" }, {
1316
+ S(r(Ue), { class: "w-transfer__search" }, {
1317
1317
  default: K(() => [
1318
- S(r(Ne), { class: "pi pi-search" }),
1319
- S(r(ve), {
1318
+ S(r(Be), { class: "pi pi-search" }),
1319
+ S(r(ye), {
1320
1320
  modelValue: i.value,
1321
- "onUpdate:modelValue": N[0] || (N[0] = (V) => i.value = V),
1321
+ "onUpdate:modelValue": L[0] || (L[0] = (V) => i.value = V),
1322
1322
  placeholder: "Buscar...",
1323
1323
  fluid: ""
1324
1324
  }, null, 8, ["modelValue"])
@@ -1326,19 +1326,19 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
1326
1326
  _: 1
1327
1327
  }),
1328
1328
  m("ul", Nl, [
1329
- (o(!0), d(Y, null, le(w.value, (V) => (o(), d("li", {
1329
+ (o(!0), d(J, null, oe(w.value, (V) => (o(), d("li", {
1330
1330
  key: `a-${x(V)}`,
1331
1331
  class: "w-transfer__item",
1332
- onClick: (O) => J(V)
1332
+ onClick: (O) => X(V)
1333
1333
  }, [
1334
1334
  m("span", null, I(E(V)), 1),
1335
- N[3] || (N[3] = m("i", { class: "pi pi-angle-right" }, null, -1))
1335
+ L[3] || (L[3] = m("i", { class: "pi pi-angle-right" }, null, -1))
1336
1336
  ], 8, Ll))), 128)),
1337
1337
  w.value.length ? b("", !0) : (o(), d("li", zl, "Nenhum item"))
1338
1338
  ])
1339
1339
  ]),
1340
1340
  m("div", Ol, [
1341
- S(r(z), {
1341
+ S(r(N), {
1342
1342
  type: "button",
1343
1343
  icon: "pi pi-angle-double-right",
1344
1344
  text: "",
@@ -1346,7 +1346,7 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
1346
1346
  disabled: e.disabled || !w.value.length,
1347
1347
  onClick: Z
1348
1348
  }, null, 8, ["disabled"]),
1349
- S(r(z), {
1349
+ S(r(N), {
1350
1350
  type: "button",
1351
1351
  icon: "pi pi-angle-double-left",
1352
1352
  text: "",
@@ -1357,15 +1357,15 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
1357
1357
  ]),
1358
1358
  m("div", Wl, [
1359
1359
  m("div", jl, [
1360
- N[4] || (N[4] = m("span", { class: "w-transfer__title" }, "Selecionados", -1)),
1361
- m("span", ql, I(q.value.length), 1)
1360
+ L[4] || (L[4] = m("span", { class: "w-transfer__title" }, "Selecionados", -1)),
1361
+ m("span", ql, I(H.value.length), 1)
1362
1362
  ]),
1363
- S(r(Te), { class: "w-transfer__search" }, {
1363
+ S(r(Ue), { class: "w-transfer__search" }, {
1364
1364
  default: K(() => [
1365
- S(r(Ne), { class: "pi pi-search" }),
1366
- S(r(ve), {
1365
+ S(r(Be), { class: "pi pi-search" }),
1366
+ S(r(ye), {
1367
1367
  modelValue: v.value,
1368
- "onUpdate:modelValue": N[1] || (N[1] = (V) => v.value = V),
1368
+ "onUpdate:modelValue": L[1] || (L[1] = (V) => v.value = V),
1369
1369
  placeholder: "Buscar...",
1370
1370
  fluid: ""
1371
1371
  }, null, 8, ["modelValue"])
@@ -1373,15 +1373,15 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
1373
1373
  _: 1
1374
1374
  }),
1375
1375
  m("ul", Kl, [
1376
- (o(!0), d(Y, null, le(q.value, (V) => (o(), d("li", {
1376
+ (o(!0), d(J, null, oe(H.value, (V) => (o(), d("li", {
1377
1377
  key: `s-${x(V)}`,
1378
1378
  class: "w-transfer__item",
1379
- onClick: (O) => H(V)
1379
+ onClick: (O) => Y(V)
1380
1380
  }, [
1381
- N[5] || (N[5] = m("i", { class: "pi pi-angle-left" }, null, -1)),
1381
+ L[5] || (L[5] = m("i", { class: "pi pi-angle-left" }, null, -1)),
1382
1382
  m("span", null, I(E(V)), 1)
1383
1383
  ], 8, Hl))), 128)),
1384
- q.value.length ? b("", !0) : (o(), d("li", Gl, "Nenhum item"))
1384
+ H.value.length ? b("", !0) : (o(), d("li", Gl, "Nenhum item"))
1385
1385
  ])
1386
1386
  ])
1387
1387
  ], 2));
@@ -1426,7 +1426,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
1426
1426
  }, ma = {
1427
1427
  key: 17,
1428
1428
  class: "w-crud-form-error"
1429
- }, fa = /* @__PURE__ */ ne({
1429
+ }, fa = /* @__PURE__ */ re({
1430
1430
  __name: "WFormRenderer",
1431
1431
  props: {
1432
1432
  fields: {},
@@ -1437,22 +1437,22 @@ const Xl = { class: "w-crud-form" }, Zl = {
1437
1437
  },
1438
1438
  emits: ["update:field"],
1439
1439
  setup(e, { expose: a, emit: t }) {
1440
- const n = e, i = t, v = Pe({}), $ = Pe({}), D = Pe({}), x = Pe({});
1440
+ const n = e, i = t, v = Ee({}), $ = Ee({}), D = Ee({}), x = Ee({});
1441
1441
  function E(f, p) {
1442
- const h = p.target.value, l = h.replace(/\D/g, "");
1443
- i("update:field", f.field, h), D[f.field] = null, x[f.field] && (clearTimeout(x[f.field]), x[f.field] = null), l.length === 8 && (x[f.field] = setTimeout(async () => {
1442
+ const g = p.target.value, l = g.replace(/\D/g, "");
1443
+ i("update:field", f.field, g), D[f.field] = null, x[f.field] && (clearTimeout(x[f.field]), x[f.field] = null), l.length === 8 && (x[f.field] = setTimeout(async () => {
1444
1444
  $[f.field] = !0, D[f.field] = null;
1445
1445
  try {
1446
1446
  const k = await Jl(l);
1447
1447
  if (!k)
1448
1448
  D[f.field] = "CEP não encontrado. Preencha os campos manualmente.";
1449
1449
  else {
1450
- const _ = f.cepFields || {}, X = Object.keys(_);
1451
- for (const re of X) {
1452
- const ee = _[re];
1453
- if (!ee) continue;
1454
- const ue = n.formData[ee];
1455
- (ue == null || ue === "") && i("update:field", ee, k[re] ?? "");
1450
+ const te = f.cepFields || {}, j = Object.keys(te);
1451
+ for (const le of j) {
1452
+ const _ = te[le];
1453
+ if (!_) continue;
1454
+ const ae = n.formData[_];
1455
+ (ae == null || ae === "") && i("update:field", _, k[le] ?? "");
1456
1456
  }
1457
1457
  }
1458
1458
  } finally {
@@ -1466,64 +1466,66 @@ const Xl = { class: "w-crud-form" }, Zl = {
1466
1466
  function w(f) {
1467
1467
  return n.disabled || f.readonly || f.computed || f.disabledOnEdit && n.isEditing ? !0 : typeof f.disabled == "function" ? f.disabled(n.formData, n.isEditing) : !!f.disabled;
1468
1468
  }
1469
- function q(f) {
1469
+ function H(f) {
1470
1470
  const p = f.endpointParams;
1471
1471
  return typeof p == "function" ? p() : p;
1472
1472
  }
1473
- const J = P(() => n.fields.filter((f) => typeof f.calculate == "function"));
1474
- Fe(
1475
- () => J.value.map((f) => f.calculate(n.formData, n.isEditing)),
1473
+ const X = P(
1474
+ () => n.fields.filter((f) => typeof f.calculate == "function")
1475
+ );
1476
+ Pe(
1477
+ () => X.value.map((f) => f.calculate(n.formData, n.isEditing)),
1476
1478
  (f) => {
1477
- J.value.forEach((p, h) => {
1478
- n.formData[p.field] !== f[h] && i("update:field", p.field, f[h]);
1479
+ X.value.forEach((p, g) => {
1480
+ n.formData[p.field] !== f[g] && i("update:field", p.field, f[g]);
1479
1481
  });
1480
1482
  },
1481
1483
  { immediate: !0 }
1482
1484
  );
1483
- function H(f) {
1485
+ function Y(f) {
1484
1486
  return Pt(f) ? f.value : f;
1485
1487
  }
1486
1488
  const Z = P(() => {
1487
1489
  const f = n.isEditing ? "edit" : "create", p = n.fields.find((l) => l.autofocus === !0 || l.autofocus === f);
1488
1490
  if (p) return p.field;
1489
- const h = T.value.find((l) => !(l.type === "switch" || l.type === "fk" || l.type === "select" || l.type === "image" || l.disabled === !0 || l.disabledOnEdit && n.isEditing));
1490
- return (h == null ? void 0 : h.field) ?? null;
1491
+ const g = T.value.find((l) => !(l.type === "switch" || l.type === "fk" || l.type === "select" || l.type === "image" || l.disabled === !0 || l.disabledOnEdit && n.isEditing));
1492
+ return (g == null ? void 0 : g.field) ?? null;
1491
1493
  });
1492
1494
  function F(f) {
1493
1495
  return f.field === Z.value;
1494
1496
  }
1495
- function M(f) {
1497
+ function A(f) {
1496
1498
  if (f)
1497
1499
  return f.replace(/9/g, "#").replace(/a/g, "S").replace(/\*/g, "X");
1498
1500
  }
1499
- function N(f) {
1501
+ function L(f) {
1500
1502
  if (!f) return "";
1501
1503
  const p = String(f).replace(/\D/g, "").slice(0, 14);
1502
1504
  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");
1503
1505
  }
1504
1506
  function V(f, p) {
1505
- const h = p.target.value.replace(/\D/g, "").slice(0, 14);
1506
- i("update:field", f, h);
1507
+ const g = p.target.value.replace(/\D/g, "").slice(0, 14);
1508
+ i("update:field", f, g);
1507
1509
  }
1508
- const O = Pe({});
1509
- function ae(f) {
1510
+ const O = Ee({});
1511
+ function ne(f) {
1510
1512
  const p = n.formData[f.field];
1511
1513
  if (p == null) return null;
1512
- const h = f.optionValue || "value";
1513
- return (H(f.options) || []).find((k) => k[h] === p) ?? null;
1514
+ const g = f.optionValue || "value";
1515
+ return (Y(f.options) || []).find((k) => k[g] === p) ?? null;
1514
1516
  }
1515
- function me(f) {
1517
+ function ve(f) {
1516
1518
  return O[f.field] || [];
1517
1519
  }
1518
1520
  function De(f, p) {
1519
- const h = (p.query || "").toLowerCase(), l = H(f.options) || [], k = f.optionLabel || "label";
1521
+ const g = (p.query || "").toLowerCase(), l = Y(f.options) || [], k = f.optionLabel || "label";
1520
1522
  O[f.field] = l.filter(
1521
- (_) => String(_[k] || "").toLowerCase().includes(h)
1523
+ (te) => String(te[k] || "").toLowerCase().includes(g)
1522
1524
  );
1523
1525
  }
1524
1526
  function de(f, p) {
1525
- const h = f.optionValue || "value";
1526
- i("update:field", f.field, p.value[h]);
1527
+ const g = f.optionValue || "value";
1528
+ i("update:field", f.field, p.value[g]);
1527
1529
  }
1528
1530
  function ie(f) {
1529
1531
  const p = n.formData[f.field];
@@ -1532,7 +1534,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
1532
1534
  function ge(f, p) {
1533
1535
  i("update:field", f.field, `#${p}`);
1534
1536
  }
1535
- function pe(f) {
1537
+ function ce(f) {
1536
1538
  const p = f.dependsOn;
1537
1539
  return p ? (Array.isArray(p) ? p : [p]).map((l) => ({
1538
1540
  field: l.param || l.field,
@@ -1540,78 +1542,78 @@ const Xl = { class: "w-crud-form" }, Zl = {
1540
1542
  required: l.required
1541
1543
  })) : void 0;
1542
1544
  }
1543
- function ce(f) {
1545
+ function be(f) {
1544
1546
  if (typeof f.validate == "function") {
1545
1547
  const p = f.validate(n.formData[f.field]);
1546
1548
  v[f.field] = p || null;
1547
1549
  }
1548
1550
  }
1549
- function G() {
1551
+ function we() {
1550
1552
  const f = [];
1551
1553
  for (const p of n.fields)
1552
1554
  if (typeof p.validate == "function") {
1553
- const h = p.validate(n.formData[p.field]);
1554
- v[p.field] = h || null, h && f.push(h);
1555
+ const g = p.validate(n.formData[p.field]);
1556
+ v[p.field] = g || null, g && f.push(g);
1555
1557
  }
1556
1558
  return f;
1557
1559
  }
1558
- function se() {
1560
+ function ue() {
1559
1561
  Object.keys(v).forEach((f) => delete v[f]);
1560
1562
  }
1561
- function te(f) {
1563
+ function ee(f) {
1562
1564
  return Math.max(1, Math.floor(f.columns ?? n.columns));
1563
1565
  }
1564
- function we(f, p) {
1565
- const h = f.colSpan;
1566
- return h == null || h === "full" ? p : h === 0.5 ? Math.max(1, Math.round(p / 2)) : Math.min(Math.max(1, Math.floor(h)), p);
1567
- }
1568
- function he(f, p) {
1569
- return { "--w-col-span": we(f, te(p)) };
1570
- }
1571
- function ye(f, p) {
1572
- return we(f, te(p)) === te(p) ? "w-crud-form-col-full" : "w-crud-form-col-half";
1573
- }
1574
- const xe = P(() => {
1575
- var l, k, _, X, re;
1576
- const f = /* @__PURE__ */ new Map(), p = [], h = /* @__PURE__ */ new Map();
1577
- for (const ee of T.value) {
1578
- const ue = ((l = ee.fieldGroup) == null ? void 0 : l.id) ?? "__default__";
1579
- f.has(ue) || (f.set(ue, {
1580
- id: ue,
1581
- title: (k = ee.fieldGroup) == null ? void 0 : k.title,
1582
- description: (_ = ee.fieldGroup) == null ? void 0 : _.description,
1583
- columns: (X = ee.fieldGroup) == null ? void 0 : X.columns,
1566
+ function pe(f, p) {
1567
+ const g = f.colSpan;
1568
+ return g == null || g === "full" ? p : g === 0.5 ? Math.max(1, Math.round(p / 2)) : Math.min(Math.max(1, Math.floor(g)), p);
1569
+ }
1570
+ function W(f, p) {
1571
+ return { "--w-col-span": pe(f, ee(p)) };
1572
+ }
1573
+ function me(f, p) {
1574
+ return pe(f, ee(p)) === ee(p) ? "w-crud-form-col-full" : "w-crud-form-col-half";
1575
+ }
1576
+ const $e = P(() => {
1577
+ var l, k, te, j, le;
1578
+ const f = /* @__PURE__ */ new Map(), p = [], g = /* @__PURE__ */ new Map();
1579
+ for (const _ of T.value) {
1580
+ const ae = ((l = _.fieldGroup) == null ? void 0 : l.id) ?? "__default__";
1581
+ f.has(ae) || (f.set(ae, {
1582
+ id: ae,
1583
+ title: (k = _.fieldGroup) == null ? void 0 : k.title,
1584
+ description: (te = _.fieldGroup) == null ? void 0 : te.description,
1585
+ columns: (j = _.fieldGroup) == null ? void 0 : j.columns,
1584
1586
  fields: []
1585
- }), p.push(ue), ((re = ee.fieldGroup) == null ? void 0 : re.order) != null && h.set(ue, ee.fieldGroup.order)), f.get(ue).fields.push(ee);
1587
+ }), p.push(ae), ((le = _.fieldGroup) == null ? void 0 : le.order) != null && g.set(ae, _.fieldGroup.order)), f.get(ae).fields.push(_);
1586
1588
  }
1587
- return p.slice().sort((ee, ue) => {
1588
- const Re = h.get(ee), ke = h.get(ue);
1589
- return Re != null && ke != null ? Re - ke : Re != null ? -1 : ke != null ? 1 : p.indexOf(ee) - p.indexOf(ue);
1590
- }).map((ee) => f.get(ee));
1589
+ return p.slice().sort((_, ae) => {
1590
+ const Ie = g.get(_), Re = g.get(ae);
1591
+ return Ie != null && Re != null ? Ie - Re : Ie != null ? -1 : Re != null ? 1 : p.indexOf(_) - p.indexOf(ae);
1592
+ }).map((_) => f.get(_));
1591
1593
  });
1592
- return a({ validateAll: G, clearErrors: se }), (f, p) => (o(), d("div", Xl, [
1593
- (o(!0), d(Y, null, le(xe.value, (h) => (o(), d("div", {
1594
- key: h.id,
1594
+ return a({ validateAll: we, clearErrors: ue }), (f, p) => (o(), d("div", Xl, [
1595
+ (o(!0), d(J, null, oe($e.value, (g) => (o(), d("div", {
1596
+ key: g.id,
1595
1597
  class: "w-crud-form-group"
1596
1598
  }, [
1597
- h.title ? (o(), d("div", Zl, [
1598
- m("h3", Ql, I(h.title), 1),
1599
- h.description ? (o(), d("p", _l, I(h.description), 1)) : b("", !0)
1599
+ g.title ? (o(), d("div", Zl, [
1600
+ m("h3", Ql, I(g.title), 1),
1601
+ g.description ? (o(), d("p", _l, I(g.description), 1)) : b("", !0)
1600
1602
  ])) : b("", !0),
1601
1603
  m("div", {
1602
1604
  class: "w-crud-form-fields",
1603
- style: be({ "--w-form-cols": te(h) })
1605
+ style: ke({ "--w-form-cols": ee(g) })
1604
1606
  }, [
1605
- (o(!0), d(Y, null, le(h.fields, (l) => A(f.$slots, `field-${l.field}`, {
1607
+ (o(!0), d(J, null, oe(g.fields, (l) => B(f.$slots, `field-${l.field}`, {
1606
1608
  field: l,
1607
1609
  formData: e.formData,
1608
1610
  isEditing: e.isEditing,
1609
- setFormField: (k, _) => i("update:field", k, _)
1611
+ setFormField: (k, te) => i("update:field", k, te)
1610
1612
  }, () => [
1611
1613
  l.type === "switch" ? (o(), d("div", {
1612
1614
  key: 0,
1613
1615
  class: "w-crud-form-switch",
1614
- style: be(he(l, h))
1616
+ style: ke(W(l, g))
1615
1617
  }, [
1616
1618
  S(r(Ot), {
1617
1619
  "model-value": e.formData[l.field],
@@ -1621,11 +1623,11 @@ const Xl = { class: "w-crud-form" }, Zl = {
1621
1623
  m("label", ea, I(l.switchLabel || l.label), 1)
1622
1624
  ], 4)) : l.type === "color" ? (o(), d("div", {
1623
1625
  key: 1,
1624
- class: Q(ye(l, h)),
1625
- style: be(he(l, h))
1626
+ class: Q(me(l, g)),
1627
+ style: ke(W(l, g))
1626
1628
  }, [
1627
1629
  m("label", ta, [
1628
- Ie(I(l.label) + " ", 1),
1630
+ Fe(I(l.label) + " ", 1),
1629
1631
  l.required ? (o(), d("span", la, "*")) : b("", !0)
1630
1632
  ]),
1631
1633
  m("div", aa, [
@@ -1634,7 +1636,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
1634
1636
  disabled: w(l),
1635
1637
  "onUpdate:modelValue": (k) => ge(l, k)
1636
1638
  }, null, 8, ["model-value", "disabled", "onUpdate:modelValue"]),
1637
- S(r(ve), {
1639
+ S(r(ye), {
1638
1640
  "model-value": e.formData[l.field],
1639
1641
  class: "w-28",
1640
1642
  maxlength: "7",
@@ -1645,11 +1647,11 @@ const Xl = { class: "w-crud-form" }, Zl = {
1645
1647
  ])
1646
1648
  ], 6)) : l.type === "image" ? (o(), d("div", {
1647
1649
  key: 2,
1648
- class: Q(ye(l, h)),
1649
- style: be(he(l, h))
1650
+ class: Q(me(l, g)),
1651
+ style: ke(W(l, g))
1650
1652
  }, [
1651
1653
  m("label", oa, I(l.label), 1),
1652
- A(f.$slots, `image-${l.field}`, {
1654
+ B(f.$slots, `image-${l.field}`, {
1653
1655
  field: l,
1654
1656
  formData: e.formData
1655
1657
  }, () => [
@@ -1665,15 +1667,15 @@ const Xl = { class: "w-crud-form" }, Zl = {
1665
1667
  v[l.field] ? (o(), d("small", na, I(v[l.field]), 1)) : b("", !0)
1666
1668
  ], 6)) : l.type === "transfer" ? (o(), d("div", {
1667
1669
  key: 3,
1668
- class: Q(ye(l, h)),
1669
- style: be(he(l, h))
1670
+ class: Q(me(l, g)),
1671
+ style: ke(W(l, g))
1670
1672
  }, [
1671
1673
  m("label", ia, [
1672
- Ie(I(l.label) + " ", 1),
1674
+ Fe(I(l.label) + " ", 1),
1673
1675
  l.required ? (o(), d("span", sa, "*")) : b("", !0)
1674
1676
  ]),
1675
1677
  S(Yl, {
1676
- source: H(l.options) || [],
1678
+ source: Y(l.options) || [],
1677
1679
  selected: e.formData[l.field] || [],
1678
1680
  "track-by": l.optionValue || "id",
1679
1681
  "option-label": l.optionLabel || "nome",
@@ -1683,15 +1685,15 @@ const Xl = { class: "w-crud-form" }, Zl = {
1683
1685
  }, null, 8, ["source", "selected", "track-by", "option-label", "search-fields", "disabled", "onUpdate:selected"])
1684
1686
  ], 6)) : (o(), d("div", {
1685
1687
  key: 4,
1686
- class: Q(ye(l, h)),
1687
- style: be(he(l, h))
1688
+ class: Q(me(l, g)),
1689
+ style: ke(W(l, g))
1688
1690
  }, [
1689
1691
  m("label", ra, [
1690
- Ie(I(l.label) + " ", 1),
1692
+ Fe(I(l.label) + " ", 1),
1691
1693
  l.required ? (o(), d("span", ua, "*")) : b("", !0),
1692
1694
  $[l.field] ? (o(), d("i", da)) : b("", !0)
1693
1695
  ]),
1694
- (!l.type || l.type === "text") && l.mask ? fe((o(), C(r(ve), {
1696
+ (!l.type || l.type === "text") && l.mask ? he((o(), C(r(ye), {
1695
1697
  key: 0,
1696
1698
  "model-value": e.formData[l.field],
1697
1699
  fluid: "",
@@ -1700,8 +1702,8 @@ const Xl = { class: "w-crud-form" }, Zl = {
1700
1702
  disabled: w(l),
1701
1703
  "onUpdate:modelValue": (k) => i("update:field", l.field, k)
1702
1704
  }, null, 8, ["model-value", "autofocus", "placeholder", "disabled", "onUpdate:modelValue"])), [
1703
- [r(Ke), { mask: M(l.mask) }]
1704
- ]) : !l.type || l.type === "text" ? (o(), C(r(ve), {
1705
+ [r(Ye), { mask: A(l.mask) }]
1706
+ ]) : !l.type || l.type === "text" ? (o(), C(r(ye), {
1705
1707
  key: 1,
1706
1708
  "model-value": e.formData[l.field],
1707
1709
  fluid: "",
@@ -1709,7 +1711,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
1709
1711
  placeholder: l.placeholder,
1710
1712
  disabled: w(l),
1711
1713
  "onUpdate:modelValue": (k) => i("update:field", l.field, k)
1712
- }, null, 8, ["model-value", "autofocus", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "email" ? (o(), C(r(ve), {
1714
+ }, null, 8, ["model-value", "autofocus", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "email" ? (o(), C(r(ye), {
1713
1715
  key: 2,
1714
1716
  "model-value": e.formData[l.field],
1715
1717
  type: "email",
@@ -1727,7 +1729,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
1727
1729
  placeholder: l.placeholder,
1728
1730
  disabled: w(l),
1729
1731
  "onUpdate:modelValue": (k) => i("update:field", l.field, k)
1730
- }, null, 8, ["model-value", "feedback", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "number" ? (o(), C(r(He), {
1732
+ }, null, 8, ["model-value", "feedback", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "number" ? (o(), C(r(Je), {
1731
1733
  key: 4,
1732
1734
  "model-value": e.formData[l.field],
1733
1735
  fluid: "",
@@ -1751,7 +1753,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
1751
1753
  placeholder: l.placeholder,
1752
1754
  disabled: w(l),
1753
1755
  "onUpdate:modelValue": (k) => i("update:field", l.field, k)
1754
- }, null, 8, ["model-value", "decimals", "prefix", "suffix", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "currency" ? (o(), C(r(He), {
1756
+ }, null, 8, ["model-value", "decimals", "prefix", "suffix", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "currency" ? (o(), C(r(Je), {
1755
1757
  key: 6,
1756
1758
  "model-value": e.formData[l.field],
1757
1759
  fluid: "",
@@ -1763,22 +1765,22 @@ const Xl = { class: "w-crud-form" }, Zl = {
1763
1765
  placeholder: l.placeholder,
1764
1766
  disabled: w(l),
1765
1767
  "onUpdate:modelValue": (k) => i("update:field", l.field, k)
1766
- }, null, 8, ["model-value", "min", "max", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "select" ? (o(), C(r(Ze), {
1768
+ }, null, 8, ["model-value", "min", "max", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "select" ? (o(), C(r(lt), {
1767
1769
  key: 7,
1768
1770
  "model-value": e.formData[l.field],
1769
1771
  fluid: "",
1770
- options: H(l.options),
1772
+ options: Y(l.options),
1771
1773
  "option-label": l.optionLabel || "label",
1772
1774
  "option-value": l.optionValue || "value",
1773
1775
  "show-clear": l.showClear !== !1,
1774
1776
  placeholder: l.placeholder,
1775
1777
  disabled: w(l),
1776
1778
  "onUpdate:modelValue": (k) => i("update:field", l.field, k)
1777
- }, null, 8, ["model-value", "options", "option-label", "option-value", "show-clear", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "autocomplete" ? (o(), C(r(vt), {
1779
+ }, null, 8, ["model-value", "options", "option-label", "option-value", "show-clear", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "autocomplete" ? (o(), C(r(gt), {
1778
1780
  key: 8,
1779
- "model-value": ae(l),
1781
+ "model-value": ne(l),
1780
1782
  fluid: "",
1781
- suggestions: me(l),
1783
+ suggestions: ve(l),
1782
1784
  "option-label": l.optionLabel || "label",
1783
1785
  placeholder: l.placeholder,
1784
1786
  disabled: w(l),
@@ -1790,8 +1792,8 @@ const Xl = { class: "w-crud-form" }, Zl = {
1790
1792
  "model-value": e.formData[l.field],
1791
1793
  autofocus: F(l) || void 0,
1792
1794
  endpoint: l.endpoint,
1793
- "endpoint-params": q(l),
1794
- drilldown: pe(l),
1795
+ "endpoint-params": H(l),
1796
+ drilldown: ce(l),
1795
1797
  "blocked-placeholder": l.blockedPlaceholder,
1796
1798
  "option-label": l.optionLabel || "nome",
1797
1799
  placeholder: l.placeholder,
@@ -1804,7 +1806,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
1804
1806
  "can-edit": l.canEdit,
1805
1807
  "can-delete": l.canDelete,
1806
1808
  "onUpdate:modelValue": (k) => i("update:field", l.field, k)
1807
- }, null, 8, ["model-value", "autofocus", "endpoint", "endpoint-params", "drilldown", "blocked-placeholder", "option-label", "placeholder", "disabled", "show-clear", "dialog-header", "crud-fields", "crud-columns", "can-create", "can-edit", "can-delete", "onUpdate:modelValue"])) : l.type === "date" ? (o(), C(st, {
1809
+ }, null, 8, ["model-value", "autofocus", "endpoint", "endpoint-params", "drilldown", "blocked-placeholder", "option-label", "placeholder", "disabled", "show-clear", "dialog-header", "crud-fields", "crud-columns", "can-create", "can-edit", "can-delete", "onUpdate:modelValue"])) : l.type === "date" ? (o(), C(ct, {
1808
1810
  key: 10,
1809
1811
  "model-value": e.formData[l.field],
1810
1812
  "value-format": "date",
@@ -1814,7 +1816,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
1814
1816
  placeholder: l.placeholder,
1815
1817
  disabled: w(l),
1816
1818
  "onUpdate:modelValue": (k) => i("update:field", l.field, k)
1817
- }, null, 8, ["model-value", "autonow", "min-date", "max-date", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "datetime" ? (o(), C(st, {
1819
+ }, null, 8, ["model-value", "autonow", "min-date", "max-date", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "datetime" ? (o(), C(ct, {
1818
1820
  key: 11,
1819
1821
  "model-value": e.formData[l.field],
1820
1822
  "value-format": "date",
@@ -1825,17 +1827,17 @@ const Xl = { class: "w-crud-form" }, Zl = {
1825
1827
  placeholder: l.placeholder,
1826
1828
  disabled: w(l),
1827
1829
  "onUpdate:modelValue": (k) => i("update:field", l.field, k)
1828
- }, null, 8, ["model-value", "autonow", "min-date", "max-date", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "cpf_cnpj" ? (o(), C(r(ve), {
1830
+ }, null, 8, ["model-value", "autonow", "min-date", "max-date", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "cpf_cnpj" ? (o(), C(r(ye), {
1829
1831
  key: 12,
1830
- "model-value": N(e.formData[l.field]),
1832
+ "model-value": L(e.formData[l.field]),
1831
1833
  fluid: "",
1832
1834
  maxlength: "18",
1833
1835
  placeholder: l.placeholder || "000.000.000-00",
1834
1836
  disabled: w(l),
1835
1837
  invalid: !!v[l.field],
1836
1838
  onInput: (k) => V(l.field, k),
1837
- onBlur: (k) => ce(l)
1838
- }, null, 8, ["model-value", "placeholder", "disabled", "invalid", "onInput", "onBlur"])) : l.type === "mask" ? fe((o(), C(r(ve), {
1839
+ onBlur: (k) => be(l)
1840
+ }, null, 8, ["model-value", "placeholder", "disabled", "invalid", "onInput", "onBlur"])) : l.type === "mask" ? he((o(), C(r(ye), {
1839
1841
  key: 13,
1840
1842
  "model-value": e.formData[l.field],
1841
1843
  fluid: "",
@@ -1843,10 +1845,10 @@ const Xl = { class: "w-crud-form" }, Zl = {
1843
1845
  disabled: w(l),
1844
1846
  invalid: !!v[l.field],
1845
1847
  "onUpdate:modelValue": (k) => i("update:field", l.field, k),
1846
- onBlur: (k) => ce(l)
1848
+ onBlur: (k) => be(l)
1847
1849
  }, null, 8, ["model-value", "placeholder", "disabled", "invalid", "onUpdate:modelValue", "onBlur"])), [
1848
- [r(Ke), { mask: M(l.mask) }]
1849
- ]) : l.type === "cep" ? fe((o(), C(r(ve), {
1850
+ [r(Ye), { mask: A(l.mask) }]
1851
+ ]) : l.type === "cep" ? he((o(), C(r(ye), {
1850
1852
  key: 14,
1851
1853
  "model-value": e.formData[l.field],
1852
1854
  fluid: "",
@@ -1855,7 +1857,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
1855
1857
  invalid: !!D[l.field],
1856
1858
  onInput: (k) => E(l, k)
1857
1859
  }, null, 8, ["model-value", "placeholder", "disabled", "invalid", "onInput"])), [
1858
- [r(Ke), { mask: "#####-###" }]
1860
+ [r(Ye), { mask: "#####-###" }]
1859
1861
  ]) : l.type === "textarea" ? (o(), C(r(zt), {
1860
1862
  key: 15,
1861
1863
  "model-value": e.formData[l.field],
@@ -1873,7 +1875,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
1873
1875
  ]))), 128))
1874
1876
  ]));
1875
1877
  }
1876
- }), va = { class: "w-crud-form-footer" }, gt = /* @__PURE__ */ ne({
1878
+ }), va = { class: "w-crud-form-footer" }, $t = /* @__PURE__ */ re({
1877
1879
  __name: "WCrudFormDialog",
1878
1880
  props: {
1879
1881
  visible: { type: Boolean },
@@ -1889,7 +1891,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
1889
1891
  },
1890
1892
  emits: ["update:visible", "update:field", "save"],
1891
1893
  setup(e, { emit: a }) {
1892
- const t = e, n = a, i = B(null), v = B(null);
1894
+ const t = e, n = a, i = U(null), v = U(null);
1893
1895
  function $() {
1894
1896
  i.value ? i.value.validateAll().length === 0 && n("save") : n("save");
1895
1897
  }
@@ -1897,15 +1899,15 @@ const Xl = { class: "w-crud-form" }, Zl = {
1897
1899
  enabled: () => t.keyboardNav === !0,
1898
1900
  onSubmit: $
1899
1901
  });
1900
- return Fe(
1902
+ return Pe(
1901
1903
  () => t.visible,
1902
1904
  (E) => {
1903
1905
  E && i.value && i.value.clearErrors();
1904
1906
  }
1905
- ), (E, T) => (o(), C(r(tt), {
1907
+ ), (E, T) => (o(), C(r(Xe), {
1906
1908
  visible: e.visible,
1907
1909
  header: e.title,
1908
- style: be({ width: e.width }),
1910
+ style: ke({ width: e.width }),
1909
1911
  modal: "",
1910
1912
  draggable: !1,
1911
1913
  class: "w-crud-form-dialog",
@@ -1929,27 +1931,27 @@ const Xl = { class: "w-crud-form" }, Zl = {
1929
1931
  "is-editing": e.isEditing,
1930
1932
  disabled: e.disabled,
1931
1933
  columns: e.formColumns,
1932
- "onUpdate:field": T[0] || (T[0] = (w, q) => n("update:field", w, q))
1933
- }, qe({ _: 2 }, [
1934
- le(e.fields, (w) => ({
1934
+ "onUpdate:field": T[0] || (T[0] = (w, H) => n("update:field", w, H))
1935
+ }, Ge({ _: 2 }, [
1936
+ oe(e.fields, (w) => ({
1935
1937
  name: `field-${w.field}`,
1936
- fn: K((q) => [
1937
- A(E.$slots, `field-${w.field}`, Je(Xe(q)))
1938
+ fn: K((H) => [
1939
+ B(E.$slots, `field-${w.field}`, et(tt(H)))
1938
1940
  ])
1939
1941
  })),
1940
- le(e.fields.filter((w) => w.type === "image"), (w) => ({
1942
+ oe(e.fields.filter((w) => w.type === "image"), (w) => ({
1941
1943
  name: `image-${w.field}`,
1942
- fn: K((q) => [
1943
- A(E.$slots, `image-${w.field}`, Je(Xe(q)))
1944
+ fn: K((H) => [
1945
+ B(E.$slots, `image-${w.field}`, et(tt(H)))
1944
1946
  ])
1945
1947
  }))
1946
1948
  ]), 1032, ["fields", "form-data", "is-editing", "disabled", "columns"]),
1947
1949
  m("div", va, [
1948
- A(E.$slots, "footer", {
1950
+ B(E.$slots, "footer", {
1949
1951
  saving: e.saving,
1950
1952
  disabled: e.disabled
1951
1953
  }, () => [
1952
- S(r(z), {
1954
+ S(r(N), {
1953
1955
  type: "button",
1954
1956
  label: e.disabled ? "Fechar" : "Cancelar",
1955
1957
  severity: "secondary",
@@ -1958,7 +1960,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
1958
1960
  "data-kbd-skip": "",
1959
1961
  onClick: T[1] || (T[1] = (w) => n("update:visible", !1))
1960
1962
  }, null, 8, ["label", "disabled"]),
1961
- e.disabled ? b("", !0) : (o(), C(r(z), {
1963
+ e.disabled ? b("", !0) : (o(), C(r(N), {
1962
1964
  key: 0,
1963
1965
  type: "submit",
1964
1966
  label: e.isEditing ? "Atualizar" : "Salvar",
@@ -1977,12 +1979,12 @@ function pa(e, a) {
1977
1979
  const t = a[e.field];
1978
1980
  return e.format ? e.format(t, a) : t == null ? "" : typeof t == "boolean" ? t ? "Sim" : "Não" : String(t);
1979
1981
  }
1980
- function rt(e, a) {
1982
+ function mt(e, a) {
1981
1983
  return e.includes('"') || e.includes(a) || e.includes(`
1982
1984
  `) || e.includes("\r") ? `"${e.replace(/"/g, '""')}"` : e;
1983
1985
  }
1984
1986
  function ha(e, a, t = {}) {
1985
- const n = t.separator ?? ";", i = a.map(($) => rt($.header, n)).join(n), v = e.map(($) => a.map((D) => rt(pa(D, $), n)).join(n));
1987
+ const n = t.separator ?? ";", i = a.map(($) => mt($.header, n)).join(n), v = e.map(($) => a.map((D) => mt(pa(D, $), n)).join(n));
1986
1988
  return "\uFEFF" + [i, ...v].join(`\r
1987
1989
  `);
1988
1990
  }
@@ -2040,7 +2042,7 @@ const ga = { class: "w-crud" }, ba = {
2040
2042
  }, eo = {
2041
2043
  key: 2,
2042
2044
  class: "w-crud-rail-sep"
2043
- }, Fn = /* @__PURE__ */ ne({
2045
+ }, Fn = /* @__PURE__ */ re({
2044
2046
  __name: "WCrudView",
2045
2047
  props: {
2046
2048
  crud: {},
@@ -2070,7 +2072,7 @@ const ga = { class: "w-crud" }, ba = {
2070
2072
  },
2071
2073
  emits: ["row-expand", "row-collapse", "print"],
2072
2074
  setup(e, { emit: a }) {
2073
- const t = e, n = a, i = It(), { formatNumber: v } = et(), $ = B({}), D = B(t.defaultView);
2075
+ const t = e, n = a, i = It(), { formatNumber: v } = nt(), $ = U({}), D = U(t.defaultView);
2074
2076
  function x(c) {
2075
2077
  return D.value === c;
2076
2078
  }
@@ -2079,35 +2081,35 @@ const ga = { class: "w-crud" }, ba = {
2079
2081
  }
2080
2082
  const T = P(
2081
2083
  () => (t.crud.pagination.page - 1) * t.crud.pagination.pageSize
2082
- ), w = Pe({ hidden: [] }), q = B(null);
2083
- function J() {
2084
+ ), w = Ee({ hidden: [] }), H = U(null);
2085
+ function X() {
2084
2086
  return t.persistState ? `wcrud:cols:${t.persistState}` : null;
2085
2087
  }
2086
- function H() {
2087
- const c = J();
2088
+ function Y() {
2089
+ const c = X();
2088
2090
  if (c)
2089
2091
  try {
2090
- const y = JSON.parse(localStorage.getItem(c) || "{}");
2091
- Array.isArray(y.hidden) && (w.hidden = y.hidden);
2092
+ const h = JSON.parse(localStorage.getItem(c) || "{}");
2093
+ Array.isArray(h.hidden) && (w.hidden = h.hidden);
2092
2094
  } catch {
2093
2095
  }
2094
2096
  }
2095
2097
  function Z() {
2096
- const c = J();
2098
+ const c = X();
2097
2099
  c && localStorage.setItem(c, JSON.stringify({ hidden: w.hidden }));
2098
2100
  }
2099
2101
  const F = P(() => t.crud.config.columns.filter((c) => c.visible !== !1));
2100
- function M(c, y) {
2101
- w.hidden = y ? w.hidden.filter((W) => W !== c) : [.../* @__PURE__ */ new Set([...w.hidden, c])], Z();
2102
+ function A(c, h) {
2103
+ w.hidden = h ? w.hidden.filter((G) => G !== c) : [.../* @__PURE__ */ new Set([...w.hidden, c])], Z();
2102
2104
  }
2103
- const N = P(
2105
+ const L = P(
2104
2106
  () => t.crud.config.columns.filter((c) => c.visible !== !1 && !w.hidden.includes(c.field)).map((c) => c.type === "number" && !c.align ? { ...c, align: "right" } : c.type === "currency" && !c.align ? { ...c, align: "right" } : c)
2105
2107
  );
2106
2108
  function V(c) {
2107
2109
  if (c.align === "right") return "text-right";
2108
2110
  if (c.align === "center") return "text-center";
2109
2111
  }
2110
- const O = P(() => N.value.slice(0, t.cardFields)), ae = P(() => {
2112
+ const O = P(() => L.value.slice(0, t.cardFields)), ne = P(() => {
2111
2113
  const c = [];
2112
2114
  return t.crud.config.canEdit !== !1 && c.push({ action: "edit", icon: "pi pi-pencil", tooltip: "Editar" }), t.crud.config.canCreate !== !1 && c.push({
2113
2115
  action: "duplicate",
@@ -2120,113 +2122,124 @@ const ga = { class: "w-crud" }, ba = {
2120
2122
  tooltip: "Excluir",
2121
2123
  severity: "danger"
2122
2124
  }), c;
2123
- }), me = P(
2124
- () => t.crud.config.rowActions ?? ae.value
2125
+ }), ve = P(
2126
+ () => t.crud.config.rowActions ?? ne.value
2125
2127
  ), De = P(
2126
- () => me.value.length > 0 || !!i["row-actions"]
2128
+ () => ve.value.length > 0 || !!i["row-actions"]
2127
2129
  );
2128
- function de(c, y) {
2130
+ function de(c, h) {
2129
2131
  if (c.handler) {
2130
- c.handler(y);
2132
+ c.handler(h);
2131
2133
  return;
2132
2134
  }
2133
- c.action === "edit" ? t.crud.openEditDialog(y) : c.action === "view" ? t.crud.openViewDialog(y) : c.action === "duplicate" ? t.crud.openDuplicateDialog(y) : c.action === "delete" && t.crud.confirmDelete(y);
2135
+ c.action === "edit" ? t.crud.openEditDialog(h) : c.action === "view" ? t.crud.openViewDialog(h) : c.action === "duplicate" ? t.crud.openDuplicateDialog(h) : c.action === "delete" && (i["delete-message"] ? (ie.value = h, ge.value = !0) : t.crud.confirmDelete(h));
2134
2136
  }
2135
- function ie(c, y) {
2136
- return c.visible ? c.visible(y) : !0;
2137
+ const ie = U(null), ge = U(!1), ce = U(!1);
2138
+ async function be() {
2139
+ if (ie.value) {
2140
+ ce.value = !0;
2141
+ try {
2142
+ await t.crud.performDelete(ie.value), ge.value = !1, ie.value = null;
2143
+ } finally {
2144
+ ce.value = !1;
2145
+ }
2146
+ }
2137
2147
  }
2138
- function ge(c, y) {
2139
- return c.disabled ? c.disabled(y) : !1;
2148
+ function we(c, h) {
2149
+ return c.visible ? c.visible(h) : !0;
2140
2150
  }
2141
- const pe = P(() => {
2151
+ function ue(c, h) {
2152
+ return c.disabled ? c.disabled(h) : !1;
2153
+ }
2154
+ const ee = P(() => {
2142
2155
  const c = [];
2143
2156
  return t.showKpi && c.push({
2144
2157
  icon: t.kpiIcon,
2145
2158
  label: t.kpiLabel,
2146
2159
  value: v(t.crud.pagination.rows, 0)
2147
2160
  }), c.push(...t.extraKpis), c;
2148
- }), ce = P(() => t.crud.config.canCreate !== !1), G = B(null), se = P(() => t.crud.config.selectionMode === "multiple"), te = P(() => t.crud.config.editMode === "cell"), we = P(() => new Map(t.crud.config.form.map((c) => [c.field, c]))), he = ["text", "email", "number", "currency"];
2149
- function ye(c) {
2150
- const y = we.value.get(c);
2151
- return y && he.includes(y.type || "text") ? y : void 0;
2161
+ }), pe = P(() => t.crud.config.canCreate !== !1), W = U(null), me = P(() => t.crud.config.selectionMode === "multiple"), $e = P(() => t.crud.config.editMode === "cell"), f = P(() => new Map(t.crud.config.form.map((c) => [c.field, c]))), p = ["text", "email", "number", "currency"];
2162
+ function g(c) {
2163
+ const h = f.value.get(c);
2164
+ return h && p.includes(h.type || "text") ? h : void 0;
2152
2165
  }
2153
- function xe(c) {
2166
+ function l(c) {
2154
2167
  c.newValue !== (c.value ?? c.data[c.field]) && t.crud.updateField(c.data, c.field, c.newValue);
2155
2168
  }
2156
- const f = P(
2169
+ const k = P(
2157
2170
  () => t.crud.config.columns.filter((c) => c.filter)
2158
- ), p = [
2171
+ ), te = [
2159
2172
  { label: "Sim", value: !0 },
2160
2173
  { label: "Não", value: !1 }
2161
2174
  ];
2162
- function h(c) {
2163
- var y;
2164
- return ((y = c.filter) == null ? void 0 : y.param) || c.field;
2175
+ function j(c) {
2176
+ var h;
2177
+ return ((h = c.filter) == null ? void 0 : h.param) || c.field;
2165
2178
  }
2166
- const l = {};
2167
- function k(c, y) {
2168
- const W = h(c);
2169
- l[W] && clearTimeout(l[W]), l[W] = setTimeout(() => t.crud.setColumnFilter(W, y || null), 300);
2179
+ const le = {};
2180
+ function _(c, h) {
2181
+ const G = j(c);
2182
+ le[G] && clearTimeout(le[G]), le[G] = setTimeout(() => t.crud.setColumnFilter(G, h || null), 300);
2170
2183
  }
2171
- const _ = B(null);
2172
- function X(c) {
2173
- G.value = c;
2184
+ const ae = U(null);
2185
+ function Ie(c) {
2186
+ W.value = c;
2174
2187
  }
2175
- function re(c) {
2176
- var y;
2177
- t.contextMenu && (G.value = c.data, (y = _.value) == null || y.show(c.originalEvent));
2188
+ function Re(c) {
2189
+ var h;
2190
+ t.contextMenu && (W.value = c.data, (h = ae.value) == null || h.show(c.originalEvent));
2178
2191
  }
2179
- function ee(c, y) {
2180
- var W;
2181
- t.contextMenu && (c.preventDefault(), G.value = y, (W = _.value) == null || W.show(c));
2192
+ function Ne(c, h) {
2193
+ var G;
2194
+ t.contextMenu && (c.preventDefault(), W.value = h, (G = ae.value) == null || G.show(c));
2182
2195
  }
2183
- const ue = P(() => {
2184
- const c = G.value;
2196
+ const Ze = P(() => {
2197
+ const c = W.value;
2185
2198
  if (!c) return [];
2186
- const y = [
2199
+ const h = [
2187
2200
  {
2188
2201
  label: "Ver detalhes",
2189
2202
  icon: "pi pi-eye",
2190
2203
  command: () => t.crud.openViewDialog(c)
2191
2204
  }
2192
2205
  ];
2193
- for (const W of me.value)
2194
- ie(W, c) && y.push({
2195
- label: W.tooltip ?? W.action,
2196
- icon: W.icon,
2197
- class: W.severity === "danger" ? "w-crud-ctx-danger" : void 0,
2198
- disabled: ge(W, c),
2199
- command: () => de(W, c)
2206
+ for (const G of ve.value)
2207
+ we(G, c) && h.push({
2208
+ label: G.tooltip ?? G.action,
2209
+ icon: G.icon,
2210
+ class: G.severity === "danger" ? "w-crud-ctx-danger" : void 0,
2211
+ disabled: ue(G, c),
2212
+ command: () => de(G, c)
2200
2213
  });
2201
- return t.showPrint && y.push({
2214
+ return t.showPrint && h.push({
2202
2215
  label: "Imprimir",
2203
2216
  icon: "pi pi-print",
2204
2217
  command: () => n("print", c)
2205
- }), t.exportCsv && (y.push({ separator: !0 }), y.push({
2218
+ }), t.exportCsv && (h.push({ separator: !0 }), h.push({
2206
2219
  label: t.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)",
2207
2220
  icon: "pi pi-download",
2208
- command: () => Me()
2209
- })), y;
2221
+ command: () => Ve()
2222
+ })), h;
2210
2223
  });
2211
- function Re() {
2212
- G.value && n("print", G.value);
2224
+ function Le() {
2225
+ W.value && n("print", W.value);
2213
2226
  }
2214
- const ke = B(!1);
2215
- async function Me() {
2216
- if (!ke.value) {
2217
- ke.value = !0;
2227
+ const Ce = U(!1);
2228
+ async function Ve() {
2229
+ if (!Ce.value) {
2230
+ Ce.value = !0;
2218
2231
  try {
2219
- const c = t.csvScope === "page" ? t.crud.items.value : await t.crud.fetchAll(t.csvPageSize), y = ha(c, N.value);
2220
- ya(y, t.csvFilename);
2232
+ const c = t.csvScope === "page" ? t.crud.items.value : await t.crud.fetchAll(t.csvPageSize), h = ha(c, L.value);
2233
+ ya(h, t.csvFilename);
2221
2234
  } finally {
2222
- ke.value = !1;
2235
+ Ce.value = !1;
2223
2236
  }
2224
2237
  }
2225
2238
  }
2226
- return _e(() => {
2227
- H(), t.autoInit && t.crud.init();
2228
- }), (c, y) => {
2229
- const W = dt("tooltip");
2239
+ return ot(() => {
2240
+ Y(), t.autoInit && t.crud.init();
2241
+ }), (c, h) => {
2242
+ const G = vt("tooltip");
2230
2243
  return o(), d("div", ga, [
2231
2244
  e.showHeader ? (o(), d("div", ba, [
2232
2245
  m("div", wa, [
@@ -2234,19 +2247,19 @@ const ga = { class: "w-crud" }, ba = {
2234
2247
  e.subtitle ? (o(), d("p", $a, I(e.subtitle), 1)) : b("", !0)
2235
2248
  ]),
2236
2249
  m("div", xa, [
2237
- A(c.$slots, "header-actions"),
2238
- ce.value && !e.actionRail ? (o(), C(r(z), {
2250
+ B(c.$slots, "header-actions"),
2251
+ pe.value && !e.actionRail ? (o(), C(r(N), {
2239
2252
  key: 0,
2240
2253
  label: "Novo",
2241
2254
  icon: "pi pi-plus",
2242
- onClick: y[0] || (y[0] = (s) => e.crud.openCreateDialog())
2255
+ onClick: h[0] || (h[0] = (s) => e.crud.openCreateDialog())
2243
2256
  })) : b("", !0)
2244
2257
  ])
2245
2258
  ])) : b("", !0),
2246
- A(c.$slots, "before-table", {}, () => [
2247
- pe.value.length ? (o(), d("div", Ca, [
2248
- (o(!0), d(Y, null, le(pe.value, (s, U) => (o(), d("div", {
2249
- key: U,
2259
+ B(c.$slots, "before-table", {}, () => [
2260
+ ee.value.length ? (o(), d("div", Ca, [
2261
+ (o(!0), d(J, null, oe(ee.value, (s, M) => (o(), d("div", {
2262
+ key: M,
2250
2263
  class: "w-crud-kpi"
2251
2264
  }, [
2252
2265
  m("div", {
@@ -2254,7 +2267,7 @@ const ga = { class: "w-crud" }, ba = {
2254
2267
  }, [
2255
2268
  m("i", {
2256
2269
  class: Q([s.icon]),
2257
- style: be(s.color ? `color: ${s.color}` : "")
2270
+ style: ke(s.color ? `color: ${s.color}` : "")
2258
2271
  }, null, 6)
2259
2272
  ], 2),
2260
2273
  m("div", Va, [
@@ -2268,91 +2281,91 @@ const ga = { class: "w-crud" }, ba = {
2268
2281
  class: Q(["w-crud-content", { "w-crud-content--rail": e.actionRail }])
2269
2282
  }, [
2270
2283
  m("div", Ea, [
2271
- f.value.length ? (o(), d("div", Pa, [
2272
- (o(!0), d(Y, null, le(f.value, (s) => {
2273
- var U, j, $e, ze, Ee, Ue, Ce, Ve, Be;
2274
- return o(), d(Y, {
2284
+ k.value.length ? (o(), d("div", Pa, [
2285
+ (o(!0), d(J, null, oe(k.value, (s) => {
2286
+ var M, q, fe, xe, Ae, ze, Oe, We, je;
2287
+ return o(), d(J, {
2275
2288
  key: s.field
2276
2289
  }, [
2277
- (((U = s.filter) == null ? void 0 : U.type) || "text") === "text" ? (o(), C(r(ve), {
2290
+ (((M = s.filter) == null ? void 0 : M.type) || "text") === "text" ? (o(), C(r(ye), {
2278
2291
  key: 0,
2279
- "model-value": e.crud.columnFilters[h(s)] ?? "",
2280
- placeholder: ((j = s.filter) == null ? void 0 : j.placeholder) || s.header,
2292
+ "model-value": e.crud.columnFilters[j(s)] ?? "",
2293
+ placeholder: ((q = s.filter) == null ? void 0 : q.placeholder) || s.header,
2281
2294
  size: "small",
2282
- onInput: (Se) => k(s, Se.target.value)
2283
- }, null, 8, ["model-value", "placeholder", "onInput"])) : (($e = s.filter) == null ? void 0 : $e.type) === "select" ? (o(), C(r(Ze), {
2295
+ onInput: (Se) => _(s, Se.target.value)
2296
+ }, null, 8, ["model-value", "placeholder", "onInput"])) : ((fe = s.filter) == null ? void 0 : fe.type) === "select" ? (o(), C(r(lt), {
2284
2297
  key: 1,
2285
- "model-value": e.crud.columnFilters[h(s)],
2286
- options: (ze = s.filter) == null ? void 0 : ze.options,
2298
+ "model-value": e.crud.columnFilters[j(s)],
2299
+ options: (xe = s.filter) == null ? void 0 : xe.options,
2287
2300
  "option-label": "label",
2288
2301
  "option-value": "value",
2289
- placeholder: ((Ee = s.filter) == null ? void 0 : Ee.placeholder) || s.header,
2302
+ placeholder: ((Ae = s.filter) == null ? void 0 : Ae.placeholder) || s.header,
2290
2303
  "show-clear": "",
2291
2304
  size: "small",
2292
- "onUpdate:modelValue": (Se) => e.crud.setColumnFilter(h(s), Se)
2293
- }, null, 8, ["model-value", "options", "placeholder", "onUpdate:modelValue"])) : ((Ue = s.filter) == null ? void 0 : Ue.type) === "boolean" ? (o(), C(r(Ze), {
2305
+ "onUpdate:modelValue": (Se) => e.crud.setColumnFilter(j(s), Se)
2306
+ }, null, 8, ["model-value", "options", "placeholder", "onUpdate:modelValue"])) : ((ze = s.filter) == null ? void 0 : ze.type) === "boolean" ? (o(), C(r(lt), {
2294
2307
  key: 2,
2295
- "model-value": e.crud.columnFilters[h(s)],
2296
- options: p,
2308
+ "model-value": e.crud.columnFilters[j(s)],
2309
+ options: te,
2297
2310
  "option-label": "label",
2298
2311
  "option-value": "value",
2299
- placeholder: ((Ce = s.filter) == null ? void 0 : Ce.placeholder) || s.header,
2312
+ placeholder: ((Oe = s.filter) == null ? void 0 : Oe.placeholder) || s.header,
2300
2313
  "show-clear": "",
2301
2314
  size: "small",
2302
- "onUpdate:modelValue": (Se) => e.crud.setColumnFilter(h(s), Se)
2303
- }, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])) : ((Ve = s.filter) == null ? void 0 : Ve.type) === "numeric" ? (o(), C(r(He), {
2315
+ "onUpdate:modelValue": (Se) => e.crud.setColumnFilter(j(s), Se)
2316
+ }, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])) : ((We = s.filter) == null ? void 0 : We.type) === "numeric" ? (o(), C(r(Je), {
2304
2317
  key: 3,
2305
- "model-value": e.crud.columnFilters[h(s)] ?? null,
2306
- placeholder: ((Be = s.filter) == null ? void 0 : Be.placeholder) || s.header,
2318
+ "model-value": e.crud.columnFilters[j(s)] ?? null,
2319
+ placeholder: ((je = s.filter) == null ? void 0 : je.placeholder) || s.header,
2307
2320
  size: "small",
2308
- "onUpdate:modelValue": (Se) => e.crud.setColumnFilter(h(s), Se)
2321
+ "onUpdate:modelValue": (Se) => e.crud.setColumnFilter(j(s), Se)
2309
2322
  }, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])) : b("", !0)
2310
2323
  ], 64);
2311
2324
  }), 128)),
2312
- Object.keys(e.crud.columnFilters).length ? (o(), C(r(z), {
2325
+ Object.keys(e.crud.columnFilters).length ? (o(), C(r(N), {
2313
2326
  key: 0,
2314
2327
  label: "Limpar filtros",
2315
2328
  icon: "pi pi-filter-slash",
2316
2329
  text: "",
2317
2330
  size: "small",
2318
- onClick: y[1] || (y[1] = (s) => e.crud.clearColumnFilters())
2331
+ onClick: h[1] || (h[1] = (s) => e.crud.clearColumnFilters())
2319
2332
  })) : b("", !0)
2320
2333
  ])) : b("", !0),
2321
2334
  D.value === "table" ? (o(), d("div", Fa, [
2322
- se.value && e.crud.selectedItems.value.length ? (o(), d("div", Ia, [
2335
+ me.value && e.crud.selectedItems.value.length ? (o(), d("div", Ia, [
2323
2336
  m("span", Ra, I(e.crud.selectedItems.value.length) + " selecionado(s) ", 1),
2324
- A(c.$slots, "bulk-actions", {
2337
+ B(c.$slots, "bulk-actions", {
2325
2338
  selected: e.crud.selectedItems.value,
2326
2339
  crud: e.crud
2327
2340
  }, () => [
2328
- (o(!0), d(Y, null, le(e.crud.config.bulkActions || [], (s) => (o(), C(r(z), {
2341
+ (o(!0), d(J, null, oe(e.crud.config.bulkActions || [], (s) => (o(), C(r(N), {
2329
2342
  key: s.action,
2330
2343
  label: s.label,
2331
2344
  icon: s.icon,
2332
2345
  severity: s.severity,
2333
2346
  size: "small",
2334
2347
  disabled: s.disabled ? s.disabled(e.crud.selectedItems.value) : !1,
2335
- onClick: (U) => s.handler(e.crud.selectedItems.value)
2348
+ onClick: (M) => s.handler(e.crud.selectedItems.value)
2336
2349
  }, null, 8, ["label", "icon", "severity", "disabled", "onClick"]))), 128))
2337
2350
  ]),
2338
- fe(S(r(z), {
2351
+ he(S(r(N), {
2339
2352
  icon: "pi pi-times",
2340
2353
  text: "",
2341
2354
  rounded: "",
2342
2355
  size: "small",
2343
- onClick: y[2] || (y[2] = (s) => e.crud.clearSelection())
2356
+ onClick: h[2] || (h[2] = (s) => e.crud.clearSelection())
2344
2357
  }, null, 512), [
2345
2358
  [
2346
- W,
2359
+ G,
2347
2360
  "Limpar seleção",
2348
2361
  void 0,
2349
2362
  { top: !0 }
2350
2363
  ]
2351
2364
  ])
2352
2365
  ])) : b("", !0),
2353
- S(r(ct), {
2366
+ S(r(pt), {
2354
2367
  "expanded-rows": $.value,
2355
- "onUpdate:expandedRows": y[7] || (y[7] = (s) => $.value = s),
2368
+ "onUpdate:expandedRows": h[7] || (h[7] = (s) => $.value = s),
2356
2369
  value: e.crud.items.value,
2357
2370
  loading: e.crud.loading.value,
2358
2371
  paginator: "",
@@ -2369,27 +2382,27 @@ const ga = { class: "w-crud" }, ba = {
2369
2382
  "sort-field": e.crud.sort.field ?? void 0,
2370
2383
  "sort-order": e.crud.sort.order,
2371
2384
  "data-key": e.crud.config.pk || "id",
2372
- "edit-mode": te.value ? "cell" : void 0,
2373
- selection: se.value ? e.crud.selectedItems.value : e.actionRail || e.contextMenu ? G.value : void 0,
2374
- "selection-mode": se.value ? void 0 : e.actionRail || e.contextMenu ? "single" : void 0,
2385
+ "edit-mode": $e.value ? "cell" : void 0,
2386
+ selection: me.value ? e.crud.selectedItems.value : e.actionRail || e.contextMenu ? W.value : void 0,
2387
+ "selection-mode": me.value ? void 0 : e.actionRail || e.contextMenu ? "single" : void 0,
2375
2388
  "context-menu": e.contextMenu,
2376
- "context-menu-selection": e.contextMenu ? G.value : void 0,
2377
- "onUpdate:selection": y[8] || (y[8] = (s) => se.value ? e.crud.selectedItems.value = s : G.value = s),
2378
- "onUpdate:contextMenuSelection": y[9] || (y[9] = (s) => G.value = s),
2379
- onRowContextmenu: re,
2389
+ "context-menu-selection": e.contextMenu ? W.value : void 0,
2390
+ "onUpdate:selection": h[8] || (h[8] = (s) => me.value ? e.crud.selectedItems.value = s : W.value = s),
2391
+ "onUpdate:contextMenuSelection": h[9] || (h[9] = (s) => W.value = s),
2392
+ onRowContextmenu: Re,
2380
2393
  onPage: e.crud.onPage,
2381
- onSort: y[10] || (y[10] = (s) => e.crud.onSort({ sortField: s.sortField, sortOrder: s.sortOrder })),
2382
- onRowExpand: y[11] || (y[11] = (s) => n("row-expand", s.data)),
2383
- onRowCollapse: y[12] || (y[12] = (s) => n("row-collapse", s.data)),
2384
- onCellEditComplete: xe
2385
- }, qe({
2394
+ onSort: h[10] || (h[10] = (s) => e.crud.onSort({ sortField: s.sortField, sortOrder: s.sortOrder })),
2395
+ onRowExpand: h[11] || (h[11] = (s) => n("row-expand", s.data)),
2396
+ onRowCollapse: h[12] || (h[12] = (s) => n("row-collapse", s.data)),
2397
+ onCellEditComplete: l
2398
+ }, Ge({
2386
2399
  header: K(() => [
2387
2400
  m("div", Ma, [
2388
2401
  m("div", Aa, [
2389
- e.showSearch ? (o(), C(r(Te), { key: 0 }, {
2402
+ e.showSearch ? (o(), C(r(Ue), { key: 0 }, {
2390
2403
  default: K(() => [
2391
- S(r(Ne), { class: "pi pi-search" }),
2392
- S(r(ve), {
2404
+ S(r(Be), { class: "pi pi-search" }),
2405
+ S(r(ye), {
2393
2406
  "model-value": e.crud.search.value,
2394
2407
  placeholder: "Buscar...",
2395
2408
  class: "w-72",
@@ -2398,35 +2411,35 @@ const ga = { class: "w-crud" }, ba = {
2398
2411
  ]),
2399
2412
  _: 1
2400
2413
  })) : b("", !0),
2401
- A(c.$slots, "toolbar-start"),
2402
- A(c.$slots, "toolbar-filters")
2414
+ B(c.$slots, "toolbar-start"),
2415
+ B(c.$slots, "toolbar-filters")
2403
2416
  ]),
2404
2417
  m("div", Ua, [
2405
- A(c.$slots, "toolbar-actions"),
2406
- e.persistState ? (o(), d(Y, { key: 0 }, [
2407
- fe(S(r(z), {
2418
+ B(c.$slots, "toolbar-actions"),
2419
+ e.persistState ? (o(), d(J, { key: 0 }, [
2420
+ he(S(r(N), {
2408
2421
  icon: "pi pi-sliders-h",
2409
2422
  text: "",
2410
2423
  size: "small",
2411
- onClick: y[3] || (y[3] = (s) => {
2412
- var U;
2413
- return (U = q.value) == null ? void 0 : U.toggle(s);
2424
+ onClick: h[3] || (h[3] = (s) => {
2425
+ var M;
2426
+ return (M = H.value) == null ? void 0 : M.toggle(s);
2414
2427
  })
2415
2428
  }, null, 512), [
2416
2429
  [
2417
- W,
2430
+ G,
2418
2431
  "Colunas",
2419
2432
  void 0,
2420
2433
  { top: !0 }
2421
2434
  ]
2422
2435
  ]),
2423
- S(r(mt), {
2436
+ S(r(ht), {
2424
2437
  ref_key: "chooser",
2425
- ref: q
2438
+ ref: H
2426
2439
  }, {
2427
2440
  default: K(() => [
2428
2441
  m("div", Ba, [
2429
- (o(!0), d(Y, null, le(F.value, (s) => (o(), d("div", {
2442
+ (o(!0), d(J, null, oe(F.value, (s) => (o(), d("div", {
2430
2443
  key: s.field,
2431
2444
  style: { display: "flex", "align-items": "center", gap: "0.5rem" }
2432
2445
  }, [
@@ -2434,7 +2447,7 @@ const ga = { class: "w-crud" }, ba = {
2434
2447
  "model-value": !w.hidden.includes(s.field),
2435
2448
  "input-id": `wcrud-col-${s.field}`,
2436
2449
  binary: "",
2437
- "onUpdate:modelValue": (U) => M(s.field, !!U)
2450
+ "onUpdate:modelValue": (M) => A(s.field, !!M)
2438
2451
  }, null, 8, ["model-value", "input-id", "onUpdate:modelValue"]),
2439
2452
  m("label", {
2440
2453
  for: `wcrud-col-${s.field}`,
@@ -2446,49 +2459,49 @@ const ga = { class: "w-crud" }, ba = {
2446
2459
  _: 1
2447
2460
  }, 512)
2448
2461
  ], 64)) : b("", !0),
2449
- e.exportCsv ? fe((o(), C(r(z), {
2462
+ e.exportCsv ? he((o(), C(r(N), {
2450
2463
  key: 1,
2451
2464
  icon: "pi pi-download",
2452
2465
  text: "",
2453
2466
  size: "small",
2454
- loading: ke.value,
2455
- onClick: Me
2467
+ loading: Ce.value,
2468
+ onClick: Ve
2456
2469
  }, null, 8, ["loading"])), [
2457
2470
  [
2458
- W,
2471
+ G,
2459
2472
  e.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)",
2460
2473
  void 0,
2461
2474
  { top: !0 }
2462
2475
  ]
2463
2476
  ]) : b("", !0),
2464
2477
  e.viewToggle ? (o(), d("div", Na, [
2465
- S(r(z), {
2478
+ S(r(N), {
2466
2479
  icon: "pi pi-table",
2467
2480
  size: "small",
2468
2481
  text: !x("table"),
2469
2482
  outlined: x("table"),
2470
- onClick: y[4] || (y[4] = (s) => E("table"))
2483
+ onClick: h[4] || (h[4] = (s) => E("table"))
2471
2484
  }, null, 8, ["text", "outlined"]),
2472
- S(r(z), {
2485
+ S(r(N), {
2473
2486
  icon: "pi pi-th-large",
2474
2487
  size: "small",
2475
2488
  text: !x("cards"),
2476
2489
  outlined: x("cards"),
2477
- onClick: y[5] || (y[5] = (s) => E("cards"))
2490
+ onClick: h[5] || (h[5] = (s) => E("cards"))
2478
2491
  }, null, 8, ["text", "outlined"])
2479
2492
  ])) : b("", !0),
2480
- !e.showHeader && ce.value && !e.actionRail ? (o(), C(r(z), {
2493
+ !e.showHeader && pe.value && !e.actionRail ? (o(), C(r(N), {
2481
2494
  key: 3,
2482
2495
  label: "Novo",
2483
2496
  icon: "pi pi-plus",
2484
- onClick: y[6] || (y[6] = (s) => e.crud.openCreateDialog())
2497
+ onClick: h[6] || (h[6] = (s) => e.crud.openCreateDialog())
2485
2498
  })) : b("", !0)
2486
2499
  ])
2487
2500
  ])
2488
2501
  ]),
2489
2502
  empty: K(() => [
2490
- A(c.$slots, "empty", {}, () => [
2491
- y[20] || (y[20] = m("div", { class: "w-crud-empty" }, [
2503
+ B(c.$slots, "empty", {}, () => [
2504
+ h[22] || (h[22] = m("div", { class: "w-crud-empty" }, [
2492
2505
  m("div", { class: "w-crud-empty-icon" }, [
2493
2506
  m("i", { class: "pi pi-inbox" })
2494
2507
  ]),
@@ -2498,57 +2511,57 @@ const ga = { class: "w-crud" }, ba = {
2498
2511
  ])
2499
2512
  ]),
2500
2513
  default: K(() => [
2501
- se.value ? (o(), C(r(Ae), {
2514
+ me.value ? (o(), C(r(Me), {
2502
2515
  key: 0,
2503
2516
  "selection-mode": "multiple",
2504
2517
  style: { width: "3rem" }
2505
2518
  })) : b("", !0),
2506
- e.expandable ? (o(), C(r(Ae), {
2519
+ e.expandable ? (o(), C(r(Me), {
2507
2520
  key: 1,
2508
2521
  expander: "",
2509
2522
  style: { width: "3rem" }
2510
2523
  })) : b("", !0),
2511
- (o(!0), d(Y, null, le(N.value, (s) => (o(), C(r(Ae), {
2524
+ (o(!0), d(J, null, oe(L.value, (s) => (o(), C(r(Me), {
2512
2525
  key: s.field,
2513
2526
  field: s.field,
2514
2527
  header: s.header,
2515
2528
  sortable: s.sortable,
2516
- style: be(s.style),
2529
+ style: ke(s.style),
2517
2530
  "header-class": V(s),
2518
2531
  "body-class": V(s)
2519
- }, qe({
2520
- body: K(({ data: U }) => [
2521
- A(c.$slots, `column-${s.field}`, {
2522
- data: U,
2523
- value: U[s.field]
2532
+ }, Ge({
2533
+ body: K(({ data: M }) => [
2534
+ B(c.$slots, `column-${s.field}`, {
2535
+ data: M,
2536
+ value: M[s.field]
2524
2537
  }, () => [
2525
- S(Qe, {
2538
+ S(at, {
2526
2539
  column: s,
2527
- value: U[s.field],
2528
- "row-data": U
2540
+ value: M[s.field],
2541
+ "row-data": M
2529
2542
  }, null, 8, ["column", "value", "row-data"])
2530
2543
  ])
2531
2544
  ]),
2532
2545
  _: 2
2533
2546
  }, [
2534
- te.value && ye(s.field) ? {
2547
+ $e.value && g(s.field) ? {
2535
2548
  name: "editor",
2536
- fn: K(({ data: U }) => {
2537
- var j;
2549
+ fn: K(({ data: M }) => {
2550
+ var q;
2538
2551
  return [
2539
- ["number", "currency"].includes(((j = ye(s.field)) == null ? void 0 : j.type) || "") ? (o(), C(r(He), {
2552
+ ["number", "currency"].includes(((q = g(s.field)) == null ? void 0 : q.type) || "") ? (o(), C(r(Je), {
2540
2553
  key: 0,
2541
- "model-value": U[s.field] ?? null,
2554
+ "model-value": M[s.field] ?? null,
2542
2555
  fluid: "",
2543
- "onUpdate:modelValue": ($e) => {
2544
- U[s.field] = $e;
2556
+ "onUpdate:modelValue": (fe) => {
2557
+ M[s.field] = fe;
2545
2558
  }
2546
- }, null, 8, ["model-value", "onUpdate:modelValue"])) : (o(), C(r(ve), {
2559
+ }, null, 8, ["model-value", "onUpdate:modelValue"])) : (o(), C(r(ye), {
2547
2560
  key: 1,
2548
- "model-value": U[s.field] ?? "",
2561
+ "model-value": M[s.field] ?? "",
2549
2562
  fluid: "",
2550
- "onUpdate:modelValue": ($e) => {
2551
- U[s.field] = $e;
2563
+ "onUpdate:modelValue": (fe) => {
2564
+ M[s.field] = fe;
2552
2565
  }
2553
2566
  }, null, 8, ["model-value", "onUpdate:modelValue"]))
2554
2567
  ];
@@ -2556,37 +2569,37 @@ const ga = { class: "w-crud" }, ba = {
2556
2569
  key: "0"
2557
2570
  } : void 0
2558
2571
  ]), 1032, ["field", "header", "sortable", "style", "header-class", "body-class"]))), 128)),
2559
- De.value && !e.actionRail ? (o(), C(r(Ae), {
2572
+ De.value && !e.actionRail ? (o(), C(r(Me), {
2560
2573
  key: 2,
2561
2574
  "header-class": "w-crud-actions-header",
2562
- style: be({
2563
- width: `${(me.value.length + (r(i)["row-actions"] ? 1 : 0)) * 2.5 + 1}rem`
2575
+ style: ke({
2576
+ width: `${(ve.value.length + (r(i)["row-actions"] ? 1 : 0)) * 2.5 + 1}rem`
2564
2577
  })
2565
2578
  }, {
2566
2579
  body: K(({ data: s }) => [
2567
2580
  m("div", La, [
2568
- (o(!0), d(Y, null, le(me.value, (U) => (o(), d(Y, {
2569
- key: U.action
2581
+ (o(!0), d(J, null, oe(ve.value, (M) => (o(), d(J, {
2582
+ key: M.action
2570
2583
  }, [
2571
- ie(U, s) ? fe((o(), C(r(z), {
2584
+ we(M, s) ? he((o(), C(r(N), {
2572
2585
  key: 0,
2573
- icon: U.icon,
2586
+ icon: M.icon,
2574
2587
  text: "",
2575
2588
  rounded: "",
2576
2589
  size: "small",
2577
- severity: U.severity,
2578
- disabled: ge(U, s),
2579
- onClick: (j) => de(U, s)
2590
+ severity: M.severity,
2591
+ disabled: ue(M, s),
2592
+ onClick: (q) => de(M, s)
2580
2593
  }, null, 8, ["icon", "severity", "disabled", "onClick"])), [
2581
2594
  [
2582
- W,
2583
- U.tooltip,
2595
+ G,
2596
+ M.tooltip,
2584
2597
  void 0,
2585
2598
  { top: !0 }
2586
2599
  ]
2587
2600
  ]) : b("", !0)
2588
2601
  ], 64))), 128)),
2589
- A(c.$slots, "row-actions", {
2602
+ B(c.$slots, "row-actions", {
2590
2603
  data: s,
2591
2604
  crud: e.crud
2592
2605
  })
@@ -2600,7 +2613,7 @@ const ga = { class: "w-crud" }, ba = {
2600
2613
  e.expandable ? {
2601
2614
  name: "expansion",
2602
2615
  fn: K((s) => [
2603
- A(c.$slots, "expansion", {
2616
+ B(c.$slots, "expansion", {
2604
2617
  data: s.data
2605
2618
  })
2606
2619
  ]),
@@ -2610,10 +2623,10 @@ const ga = { class: "w-crud" }, ba = {
2610
2623
  ])) : (o(), d("div", za, [
2611
2624
  m("div", Oa, [
2612
2625
  m("div", Wa, [
2613
- e.showSearch ? (o(), C(r(Te), { key: 0 }, {
2626
+ e.showSearch ? (o(), C(r(Ue), { key: 0 }, {
2614
2627
  default: K(() => [
2615
- S(r(Ne), { class: "pi pi-search" }),
2616
- S(r(ve), {
2628
+ S(r(Be), { class: "pi pi-search" }),
2629
+ S(r(ye), {
2617
2630
  "model-value": e.crud.search.value,
2618
2631
  placeholder: "Buscar...",
2619
2632
  class: "w-72",
@@ -2622,74 +2635,74 @@ const ga = { class: "w-crud" }, ba = {
2622
2635
  ]),
2623
2636
  _: 1
2624
2637
  })) : b("", !0),
2625
- A(c.$slots, "toolbar-start"),
2626
- A(c.$slots, "toolbar-filters")
2638
+ B(c.$slots, "toolbar-start"),
2639
+ B(c.$slots, "toolbar-filters")
2627
2640
  ]),
2628
2641
  m("div", ja, [
2629
- A(c.$slots, "toolbar-actions"),
2630
- e.exportCsv ? fe((o(), C(r(z), {
2642
+ B(c.$slots, "toolbar-actions"),
2643
+ e.exportCsv ? he((o(), C(r(N), {
2631
2644
  key: 0,
2632
2645
  icon: "pi pi-download",
2633
2646
  text: "",
2634
2647
  size: "small",
2635
- loading: ke.value,
2636
- onClick: Me
2648
+ loading: Ce.value,
2649
+ onClick: Ve
2637
2650
  }, null, 8, ["loading"])), [
2638
2651
  [
2639
- W,
2652
+ G,
2640
2653
  e.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)",
2641
2654
  void 0,
2642
2655
  { top: !0 }
2643
2656
  ]
2644
2657
  ]) : b("", !0),
2645
2658
  e.viewToggle ? (o(), d("div", qa, [
2646
- S(r(z), {
2659
+ S(r(N), {
2647
2660
  icon: "pi pi-table",
2648
2661
  size: "small",
2649
2662
  text: !x("table"),
2650
2663
  outlined: x("table"),
2651
- onClick: y[13] || (y[13] = (s) => E("table"))
2664
+ onClick: h[13] || (h[13] = (s) => E("table"))
2652
2665
  }, null, 8, ["text", "outlined"]),
2653
- S(r(z), {
2666
+ S(r(N), {
2654
2667
  icon: "pi pi-th-large",
2655
2668
  size: "small",
2656
2669
  text: !x("cards"),
2657
2670
  outlined: x("cards"),
2658
- onClick: y[14] || (y[14] = (s) => E("cards"))
2671
+ onClick: h[14] || (h[14] = (s) => E("cards"))
2659
2672
  }, null, 8, ["text", "outlined"])
2660
2673
  ])) : b("", !0),
2661
- !e.showHeader && ce.value && !e.actionRail ? (o(), C(r(z), {
2674
+ !e.showHeader && pe.value && !e.actionRail ? (o(), C(r(N), {
2662
2675
  key: 2,
2663
2676
  label: "Novo",
2664
2677
  icon: "pi pi-plus",
2665
- onClick: y[15] || (y[15] = (s) => e.crud.openCreateDialog())
2678
+ onClick: h[15] || (h[15] = (s) => e.crud.openCreateDialog())
2666
2679
  })) : b("", !0)
2667
2680
  ])
2668
2681
  ]),
2669
- e.crud.loading.value ? (o(), d("div", Ka, [...y[21] || (y[21] = [
2682
+ e.crud.loading.value ? (o(), d("div", Ka, [...h[23] || (h[23] = [
2670
2683
  m("i", { class: "pi pi-spin pi-spinner" }, null, -1)
2671
2684
  ])])) : e.crud.items.value.length ? (o(), d("div", Ha, [
2672
- (o(!0), d(Y, null, le(e.crud.items.value, (s, U) => (o(), d("div", {
2673
- key: s[e.crud.config.pk || "id"] ?? U,
2674
- class: Q(["w-crud-card", { "w-crud-card--selected": G.value === s }]),
2675
- onClick: (j) => X(s),
2676
- onDblclick: (j) => e.crud.config.canEdit !== !1 && e.crud.openEditDialog(s),
2677
- onContextmenu: (j) => ee(j, s)
2685
+ (o(!0), d(J, null, oe(e.crud.items.value, (s, M) => (o(), d("div", {
2686
+ key: s[e.crud.config.pk || "id"] ?? M,
2687
+ class: Q(["w-crud-card", { "w-crud-card--selected": W.value === s }]),
2688
+ onClick: (q) => Ie(s),
2689
+ onDblclick: (q) => e.crud.config.canEdit !== !1 && e.crud.openEditDialog(s),
2690
+ onContextmenu: (q) => Ne(q, s)
2678
2691
  }, [
2679
2692
  m("div", Ya, [
2680
- (o(!0), d(Y, null, le(O.value, (j, $e) => (o(), d("div", {
2681
- key: j.field,
2682
- class: Q(["w-crud-card-row", { "w-crud-card-row--title": $e === 0 }])
2693
+ (o(!0), d(J, null, oe(O.value, (q, fe) => (o(), d("div", {
2694
+ key: q.field,
2695
+ class: Q(["w-crud-card-row", { "w-crud-card-row--title": fe === 0 }])
2683
2696
  }, [
2684
- $e !== 0 ? (o(), d("span", Ja, I(j.header), 1)) : b("", !0),
2697
+ fe !== 0 ? (o(), d("span", Ja, I(q.header), 1)) : b("", !0),
2685
2698
  m("span", Xa, [
2686
- A(c.$slots, `column-${j.field}`, {
2699
+ B(c.$slots, `column-${q.field}`, {
2687
2700
  data: s,
2688
- value: s[j.field]
2701
+ value: s[q.field]
2689
2702
  }, () => [
2690
- S(Qe, {
2691
- column: j,
2692
- value: s[j.field],
2703
+ S(at, {
2704
+ column: q,
2705
+ value: s[q.field],
2693
2706
  "row-data": s
2694
2707
  }, null, 8, ["column", "value", "row-data"])
2695
2708
  ])
@@ -2697,35 +2710,35 @@ const ga = { class: "w-crud" }, ba = {
2697
2710
  ], 2))), 128))
2698
2711
  ]),
2699
2712
  De.value && !e.actionRail ? (o(), d("div", Za, [
2700
- (o(!0), d(Y, null, le(me.value, (j) => (o(), d(Y, {
2701
- key: j.action
2713
+ (o(!0), d(J, null, oe(ve.value, (q) => (o(), d(J, {
2714
+ key: q.action
2702
2715
  }, [
2703
- ie(j, s) ? fe((o(), C(r(z), {
2716
+ we(q, s) ? he((o(), C(r(N), {
2704
2717
  key: 0,
2705
- icon: j.icon,
2718
+ icon: q.icon,
2706
2719
  text: "",
2707
2720
  rounded: "",
2708
2721
  size: "small",
2709
- severity: j.severity,
2710
- disabled: ge(j, s),
2711
- onClick: ($e) => de(j, s)
2722
+ severity: q.severity,
2723
+ disabled: ue(q, s),
2724
+ onClick: (fe) => de(q, s)
2712
2725
  }, null, 8, ["icon", "severity", "disabled", "onClick"])), [
2713
2726
  [
2714
- W,
2715
- j.tooltip,
2727
+ G,
2728
+ q.tooltip,
2716
2729
  void 0,
2717
2730
  { top: !0 }
2718
2731
  ]
2719
2732
  ]) : b("", !0)
2720
2733
  ], 64))), 128)),
2721
- A(c.$slots, "row-actions", {
2734
+ B(c.$slots, "row-actions", {
2722
2735
  data: s,
2723
2736
  crud: e.crud
2724
2737
  })
2725
2738
  ])) : b("", !0)
2726
2739
  ], 42, Ga))), 128))
2727
- ])) : A(c.$slots, "empty", {}, () => [
2728
- y[22] || (y[22] = Rt('<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))
2740
+ ])) : B(c.$slots, "empty", {}, () => [
2741
+ h[24] || (h[24] = Rt('<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))
2729
2742
  ], void 0, 1),
2730
2743
  e.crud.items.value.length ? (o(), C(r(At), {
2731
2744
  key: 3,
@@ -2741,70 +2754,70 @@ const ga = { class: "w-crud" }, ba = {
2741
2754
  ]))
2742
2755
  ]),
2743
2756
  e.actionRail ? (o(), d("aside", Qa, [
2744
- ce.value ? fe((o(), C(r(z), {
2757
+ pe.value ? he((o(), C(r(N), {
2745
2758
  key: 0,
2746
2759
  icon: "pi pi-plus",
2747
2760
  rounded: "",
2748
- onClick: y[16] || (y[16] = (s) => e.crud.openCreateDialog())
2761
+ onClick: h[16] || (h[16] = (s) => e.crud.openCreateDialog())
2749
2762
  }, null, 512)), [
2750
2763
  [
2751
- W,
2764
+ G,
2752
2765
  "Novo",
2753
2766
  void 0,
2754
2767
  { left: !0 }
2755
2768
  ]
2756
2769
  ]) : b("", !0),
2757
- ce.value && me.value.length ? (o(), d("div", _a)) : b("", !0),
2758
- (o(!0), d(Y, null, le(me.value, (s) => (o(), d(Y, {
2770
+ pe.value && ve.value.length ? (o(), d("div", _a)) : b("", !0),
2771
+ (o(!0), d(J, null, oe(ve.value, (s) => (o(), d(J, {
2759
2772
  key: s.action
2760
2773
  }, [
2761
- !G.value || ie(s, G.value) ? fe((o(), C(r(z), {
2774
+ !W.value || we(s, W.value) ? he((o(), C(r(N), {
2762
2775
  key: 0,
2763
2776
  icon: s.icon,
2764
2777
  text: "",
2765
2778
  rounded: "",
2766
2779
  severity: s.severity,
2767
- disabled: !G.value || ge(s, G.value),
2768
- onClick: (U) => G.value && de(s, G.value)
2780
+ disabled: !W.value || ue(s, W.value),
2781
+ onClick: (M) => W.value && de(s, W.value)
2769
2782
  }, null, 8, ["icon", "severity", "disabled", "onClick"])), [
2770
2783
  [
2771
- W,
2784
+ G,
2772
2785
  s.tooltip,
2773
2786
  void 0,
2774
2787
  { left: !0 }
2775
2788
  ]
2776
2789
  ]) : b("", !0)
2777
2790
  ], 64))), 128)),
2778
- A(c.$slots, "rail-actions", {
2779
- selected: G.value,
2791
+ B(c.$slots, "rail-actions", {
2792
+ selected: W.value,
2780
2793
  crud: e.crud
2781
2794
  }),
2782
2795
  e.showPrint || e.exportCsv ? (o(), d("div", eo)) : b("", !0),
2783
- e.showPrint ? fe((o(), C(r(z), {
2796
+ e.showPrint ? he((o(), C(r(N), {
2784
2797
  key: 3,
2785
2798
  icon: "pi pi-print",
2786
2799
  text: "",
2787
2800
  rounded: "",
2788
- disabled: !G.value,
2789
- onClick: Re
2801
+ disabled: !W.value,
2802
+ onClick: Le
2790
2803
  }, null, 8, ["disabled"])), [
2791
2804
  [
2792
- W,
2805
+ G,
2793
2806
  "Imprimir",
2794
2807
  void 0,
2795
2808
  { left: !0 }
2796
2809
  ]
2797
2810
  ]) : b("", !0),
2798
- e.exportCsv ? fe((o(), C(r(z), {
2811
+ e.exportCsv ? he((o(), C(r(N), {
2799
2812
  key: 4,
2800
2813
  icon: "pi pi-download",
2801
2814
  text: "",
2802
2815
  rounded: "",
2803
- loading: ke.value,
2804
- onClick: Me
2816
+ loading: Ce.value,
2817
+ onClick: Ve
2805
2818
  }, null, 8, ["loading"])), [
2806
2819
  [
2807
- W,
2820
+ G,
2808
2821
  e.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)",
2809
2822
  void 0,
2810
2823
  { left: !0 }
@@ -2815,16 +2828,16 @@ const ga = { class: "w-crud" }, ba = {
2815
2828
  e.contextMenu ? (o(), C(r(Ut), {
2816
2829
  key: 1,
2817
2830
  ref_key: "cm",
2818
- ref: _,
2819
- model: ue.value
2831
+ ref: ae,
2832
+ model: Ze.value
2820
2833
  }, null, 8, ["model"])) : b("", !0),
2821
- A(c.$slots, "form-dialog", {
2834
+ B(c.$slots, "form-dialog", {
2822
2835
  crud: e.crud,
2823
2836
  dialogWidth: e.dialogWidth
2824
2837
  }, () => {
2825
2838
  var s;
2826
2839
  return [
2827
- S(gt, {
2840
+ S($t, {
2828
2841
  visible: e.crud.dialogVisible.value,
2829
2842
  title: e.crud.dialogTitle.value,
2830
2843
  fields: e.crud.config.form,
@@ -2835,25 +2848,58 @@ const ga = { class: "w-crud" }, ba = {
2835
2848
  width: e.dialogWidth,
2836
2849
  "form-columns": e.formColumns ?? e.crud.config.formColumns,
2837
2850
  "keyboard-nav": e.crud.config.keyboardNav,
2838
- "onUpdate:visible": y[17] || (y[17] = (U) => {
2839
- e.crud.dialogVisible.value = U, U || (e.crud.editingItem.value = null);
2851
+ "onUpdate:visible": h[17] || (h[17] = (M) => {
2852
+ e.crud.dialogVisible.value = M, M || (e.crud.editingItem.value = null);
2840
2853
  }),
2841
- "onUpdate:field": y[18] || (y[18] = (U, j) => e.crud.setFormField(U, j)),
2842
- onSave: y[19] || (y[19] = (U) => e.crud.save())
2843
- }, qe({ _: 2 }, [
2844
- le(e.crud.config.form, (U) => ({
2845
- name: `field-${U.field}`,
2846
- fn: K((j) => [
2847
- A(c.$slots, `field-${U.field}`, Je(Xe(j)))
2854
+ "onUpdate:field": h[18] || (h[18] = (M, q) => e.crud.setFormField(M, q)),
2855
+ onSave: h[19] || (h[19] = (M) => e.crud.save())
2856
+ }, Ge({ _: 2 }, [
2857
+ oe(e.crud.config.form, (M) => ({
2858
+ name: `field-${M.field}`,
2859
+ fn: K((q) => [
2860
+ B(c.$slots, `field-${M.field}`, et(tt(q)))
2848
2861
  ])
2849
2862
  }))
2850
2863
  ]), 1032, ["visible", "title", "fields", "form-data", "is-editing", "saving", "disabled", "width", "form-columns", "keyboard-nav"])
2851
2864
  ];
2852
- })
2865
+ }),
2866
+ c.$slots["delete-message"] ? (o(), C(r(Xe), {
2867
+ key: 2,
2868
+ visible: ge.value,
2869
+ "onUpdate:visible": h[21] || (h[21] = (s) => ge.value = s),
2870
+ header: "Confirmar Exclusão",
2871
+ modal: "",
2872
+ draggable: !1,
2873
+ class: "w-crud-delete-dialog",
2874
+ style: { width: "30rem" }
2875
+ }, {
2876
+ footer: K(() => [
2877
+ S(r(N), {
2878
+ type: "button",
2879
+ label: "Cancelar",
2880
+ severity: "secondary",
2881
+ text: "",
2882
+ disabled: ce.value,
2883
+ onClick: h[20] || (h[20] = (s) => ge.value = !1)
2884
+ }, null, 8, ["disabled"]),
2885
+ S(r(N), {
2886
+ type: "button",
2887
+ label: "Excluir",
2888
+ icon: "pi pi-trash",
2889
+ severity: "danger",
2890
+ loading: ce.value,
2891
+ onClick: be
2892
+ }, null, 8, ["loading"])
2893
+ ]),
2894
+ default: K(() => [
2895
+ B(c.$slots, "delete-message", { item: ie.value })
2896
+ ]),
2897
+ _: 3
2898
+ }, 8, ["visible"])) : b("", !0)
2853
2899
  ]);
2854
2900
  };
2855
2901
  }
2856
- }), In = /* @__PURE__ */ ne({
2902
+ }), In = /* @__PURE__ */ re({
2857
2903
  __name: "WDateRange",
2858
2904
  props: {
2859
2905
  modelValue: { default: null },
@@ -2869,7 +2915,7 @@ const ga = { class: "w-crud" }, ba = {
2869
2915
  function n(i) {
2870
2916
  t("update:modelValue", i ?? null);
2871
2917
  }
2872
- return (i, v) => (o(), C(r(pt), {
2918
+ return (i, v) => (o(), C(r(bt), {
2873
2919
  "model-value": e.modelValue ?? void 0,
2874
2920
  "selection-mode": "range",
2875
2921
  placeholder: e.placeholder,
@@ -2882,7 +2928,7 @@ const ga = { class: "w-crud" }, ba = {
2882
2928
  "onUpdate:modelValue": n
2883
2929
  }, null, 8, ["model-value", "placeholder", "min-date", "max-date", "show-button-bar", "disabled"]));
2884
2930
  }
2885
- }), to = /* @__PURE__ */ ne({
2931
+ }), to = /* @__PURE__ */ re({
2886
2932
  __name: "WStatusTag",
2887
2933
  props: {
2888
2934
  value: {},
@@ -2917,7 +2963,7 @@ const ga = { class: "w-crud" }, ba = {
2917
2963
  paga: { label: "Paga", severity: "success" },
2918
2964
  inadimplente: { label: "Inadimplente", severity: "danger" }
2919
2965
  }, n = P(() => (a.map ?? t)[a.value] ?? { label: a.value, severity: "secondary" });
2920
- return (i, v) => (o(), C(r(ft), {
2966
+ return (i, v) => (o(), C(r(yt), {
2921
2967
  value: n.value.label,
2922
2968
  severity: n.value.severity
2923
2969
  }, null, 8, ["value", "severity"]));
@@ -2925,7 +2971,7 @@ const ga = { class: "w-crud" }, ba = {
2925
2971
  }), lo = { class: "w-page-header" }, ao = { class: "w-page-header-content" }, oo = { class: "w-page-header-title" }, no = {
2926
2972
  key: 0,
2927
2973
  class: "w-page-header-subtitle"
2928
- }, io = { class: "w-page-header-actions" }, Rn = /* @__PURE__ */ ne({
2974
+ }, io = { class: "w-page-header-actions" }, Rn = /* @__PURE__ */ re({
2929
2975
  __name: "WPageHeader",
2930
2976
  props: {
2931
2977
  title: {},
@@ -2942,8 +2988,8 @@ const ga = { class: "w-crud" }, ba = {
2942
2988
  e.subtitle ? (o(), d("p", no, I(e.subtitle), 1)) : b("", !0)
2943
2989
  ]),
2944
2990
  m("div", io, [
2945
- A(n.$slots, "actions"),
2946
- e.actionLabel ? (o(), C(r(z), {
2991
+ B(n.$slots, "actions"),
2992
+ e.actionLabel ? (o(), C(r(N), {
2947
2993
  key: 0,
2948
2994
  label: e.actionLabel,
2949
2995
  icon: e.actionIcon,
@@ -2955,7 +3001,7 @@ const ga = { class: "w-crud" }, ba = {
2955
3001
  }), so = { class: "w-empty-state" }, ro = { class: "w-empty-state-icon" }, uo = { class: "w-empty-state-title" }, co = {
2956
3002
  key: 0,
2957
3003
  class: "w-empty-state-description"
2958
- }, Mn = /* @__PURE__ */ ne({
3004
+ }, Mn = /* @__PURE__ */ re({
2959
3005
  __name: "WEmptyState",
2960
3006
  props: {
2961
3007
  icon: {},
@@ -2975,7 +3021,7 @@ const ga = { class: "w-crud" }, ba = {
2975
3021
  ]),
2976
3022
  m("p", uo, I(e.title), 1),
2977
3023
  e.description ? (o(), d("p", co, I(e.description), 1)) : b("", !0),
2978
- e.actionLabel ? (o(), C(r(z), {
3024
+ e.actionLabel ? (o(), C(r(N), {
2979
3025
  key: 1,
2980
3026
  label: e.actionLabel,
2981
3027
  icon: e.actionIcon,
@@ -3003,12 +3049,12 @@ Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
3003
3049
  * @license MIT
3004
3050
  */
3005
3051
  function fo() {
3006
- return ut(mo);
3052
+ return ft(mo);
3007
3053
  }
3008
3054
  const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" }, ho = { class: "w-detail-header-content" }, yo = { class: "w-detail-header-title" }, go = {
3009
3055
  key: 0,
3010
3056
  class: "w-detail-header-subtitle"
3011
- }, bo = { class: "w-detail-header-actions" }, An = /* @__PURE__ */ ne({
3057
+ }, bo = { class: "w-detail-header-actions" }, An = /* @__PURE__ */ re({
3012
3058
  __name: "WDetailHeader",
3013
3059
  props: {
3014
3060
  title: {},
@@ -3026,7 +3072,7 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
3026
3072
  }
3027
3073
  return (i, v) => (o(), d("div", vo, [
3028
3074
  m("div", po, [
3029
- S(r(z), {
3075
+ S(r(N), {
3030
3076
  icon: "pi pi-arrow-left",
3031
3077
  text: "",
3032
3078
  rounded: "",
@@ -3047,21 +3093,21 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
3047
3093
  }, null, 8, ["value", "map"])) : b("", !0)
3048
3094
  ]),
3049
3095
  m("div", bo, [
3050
- A(i.$slots, "actions")
3096
+ B(i.$slots, "actions")
3051
3097
  ])
3052
3098
  ]));
3053
3099
  }
3054
3100
  }), wo = { class: "w-info-card" }, ko = {
3055
3101
  key: 0,
3056
3102
  class: "w-info-card-title"
3057
- }, $o = { class: "w-info-card-grid" }, xo = { class: "w-info-card-label" }, Co = { class: "w-info-card-value" }, Un = /* @__PURE__ */ ne({
3103
+ }, $o = { class: "w-info-card-grid" }, xo = { class: "w-info-card-label" }, Co = { class: "w-info-card-value" }, Un = /* @__PURE__ */ re({
3058
3104
  __name: "WInfoCard",
3059
3105
  props: {
3060
3106
  title: {},
3061
3107
  fields: {}
3062
3108
  },
3063
3109
  setup(e) {
3064
- const { formatCurrency: a, formatDate: t, formatNumber: n } = et();
3110
+ const { formatCurrency: a, formatDate: t, formatNumber: n } = nt();
3065
3111
  function i(v) {
3066
3112
  const $ = v.value;
3067
3113
  return $ == null || $ === "" ? "-" : v.format === "currency" ? a(Number($)) : v.format === "date" ? t(String($)) : v.format === "datetime" ? t(String($), "DD/MM/YYYY HH:mm") : v.format === "number" ? n(Number($)) : String($);
@@ -3069,7 +3115,7 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
3069
3115
  return (v, $) => (o(), d("div", wo, [
3070
3116
  e.title ? (o(), d("h3", ko, I(e.title), 1)) : b("", !0),
3071
3117
  m("div", $o, [
3072
- (o(!0), d(Y, null, le(e.fields, (D) => (o(), d("div", {
3118
+ (o(!0), d(J, null, oe(e.fields, (D) => (o(), d("div", {
3073
3119
  key: D.label,
3074
3120
  class: "w-info-card-field"
3075
3121
  }, [
@@ -3094,7 +3140,7 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
3094
3140
  }, Ao = {
3095
3141
  key: 0,
3096
3142
  class: "w-kpi-card__footer"
3097
- }, Uo = /* @__PURE__ */ ne({
3143
+ }, Uo = /* @__PURE__ */ re({
3098
3144
  __name: "WKpiCard",
3099
3145
  props: {
3100
3146
  label: {},
@@ -3110,28 +3156,28 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
3110
3156
  class: Q(["w-kpi-card", e.severity ? `w-kpi-card--${e.severity}` : ""])
3111
3157
  }, [
3112
3158
  e.loading ? (o(), d("div", Vo, [
3113
- S(r(Oe), {
3159
+ S(r(qe), {
3114
3160
  shape: "circle",
3115
3161
  size: "2.75rem"
3116
3162
  }),
3117
3163
  m("div", So, [
3118
- S(r(Oe), {
3164
+ S(r(qe), {
3119
3165
  width: "6rem",
3120
3166
  height: "0.75rem"
3121
3167
  }),
3122
- S(r(Oe), {
3168
+ S(r(qe), {
3123
3169
  width: "7.5rem",
3124
3170
  height: "1.5rem"
3125
3171
  }),
3126
- S(r(Oe), {
3172
+ S(r(qe), {
3127
3173
  width: "5rem",
3128
3174
  height: "0.75rem"
3129
3175
  })
3130
3176
  ])
3131
- ])) : (o(), d(Y, { key: 1 }, [
3177
+ ])) : (o(), d(J, { key: 1 }, [
3132
3178
  m("div", Do, [
3133
3179
  e.icon || a.$slots.icon ? (o(), d("div", Eo, [
3134
- A(a.$slots, "icon", {}, () => [
3180
+ B(a.$slots, "icon", {}, () => [
3135
3181
  e.icon ? (o(), d("i", {
3136
3182
  key: 0,
3137
3183
  class: Q(e.icon)
@@ -3139,7 +3185,7 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
3139
3185
  ])
3140
3186
  ])) : b("", !0),
3141
3187
  e.trend || a.$slots.trend ? (o(), d("div", Po, [
3142
- A(a.$slots, "trend", {}, () => [
3188
+ B(a.$slots, "trend", {}, () => [
3143
3189
  e.trend ? (o(), d("span", {
3144
3190
  key: 0,
3145
3191
  class: Q(["w-kpi-card__trend-badge", e.trend.direction ? `w-kpi-card__trend-badge--${e.trend.direction}` : ""])
@@ -3150,23 +3196,23 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
3150
3196
  m("div", Fo, [
3151
3197
  m("p", Io, I(e.label), 1),
3152
3198
  m("div", Ro, [
3153
- A(a.$slots, "value", {}, () => [
3154
- Ie(I(e.value), 1)
3199
+ B(a.$slots, "value", {}, () => [
3200
+ Fe(I(e.value), 1)
3155
3201
  ])
3156
3202
  ]),
3157
3203
  e.hint || a.$slots.hint ? (o(), d("p", Mo, [
3158
- A(a.$slots, "hint", {}, () => [
3159
- Ie(I(e.hint), 1)
3204
+ B(a.$slots, "hint", {}, () => [
3205
+ Fe(I(e.hint), 1)
3160
3206
  ])
3161
3207
  ])) : b("", !0)
3162
3208
  ]),
3163
3209
  a.$slots.footer ? (o(), d("footer", Ao, [
3164
- A(a.$slots, "footer")
3210
+ B(a.$slots, "footer")
3165
3211
  ])) : b("", !0)
3166
3212
  ], 64))
3167
3213
  ], 2));
3168
3214
  }
3169
- }), Bn = /* @__PURE__ */ ne({
3215
+ }), Bn = /* @__PURE__ */ re({
3170
3216
  __name: "WKpiGrid",
3171
3217
  props: {
3172
3218
  items: { default: () => [] },
@@ -3181,11 +3227,11 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
3181
3227
  return (n, i) => (o(), d("div", {
3182
3228
  class: Q(["w-kpi-grid", t.value])
3183
3229
  }, [
3184
- n.$slots.item ? (o(!0), d(Y, { key: 0 }, le(e.items, (v, $) => A(n.$slots, "item", {
3230
+ n.$slots.item ? (o(!0), d(J, { key: 0 }, oe(e.items, (v, $) => B(n.$slots, "item", {
3185
3231
  key: $,
3186
3232
  item: v,
3187
3233
  index: $
3188
- })), 128)) : (o(!0), d(Y, { key: 1 }, le(e.items, (v, $) => (o(), C(Uo, {
3234
+ })), 128)) : (o(!0), d(J, { key: 1 }, oe(e.items, (v, $) => (o(), C(Uo, {
3189
3235
  key: $,
3190
3236
  label: v.label,
3191
3237
  value: v.value,
@@ -3206,7 +3252,7 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
3206
3252
  }, Wo = {
3207
3253
  key: 0,
3208
3254
  class: "w-section-header__actions"
3209
- }, Tn = /* @__PURE__ */ ne({
3255
+ }, Tn = /* @__PURE__ */ re({
3210
3256
  __name: "WSectionHeader",
3211
3257
  props: {
3212
3258
  title: {},
@@ -3220,7 +3266,7 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
3220
3266
  }, [
3221
3267
  m("div", Bo, [
3222
3268
  e.icon || a.$slots.icon ? (o(), d("div", To, [
3223
- A(a.$slots, "icon", {}, () => [
3269
+ B(a.$slots, "icon", {}, () => [
3224
3270
  e.icon ? (o(), d("i", {
3225
3271
  key: 0,
3226
3272
  class: Q(e.icon)
@@ -3230,13 +3276,13 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
3230
3276
  m("div", No, [
3231
3277
  m("div", Lo, [
3232
3278
  m("h3", zo, I(e.title), 1),
3233
- A(a.$slots, "meta")
3279
+ B(a.$slots, "meta")
3234
3280
  ]),
3235
3281
  e.subtitle ? (o(), d("p", Oo, I(e.subtitle), 1)) : b("", !0)
3236
3282
  ])
3237
3283
  ]),
3238
3284
  a.$slots.actions ? (o(), d("div", Wo, [
3239
- A(a.$slots, "actions")
3285
+ B(a.$slots, "actions")
3240
3286
  ])) : b("", !0)
3241
3287
  ], 2));
3242
3288
  }
@@ -3249,7 +3295,7 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
3249
3295
  }, Go = {
3250
3296
  key: 0,
3251
3297
  class: "w-form-section__actions"
3252
- }, Yo = { class: "w-form-section__body" }, Nn = /* @__PURE__ */ ne({
3298
+ }, Yo = { class: "w-form-section__body" }, Nn = /* @__PURE__ */ re({
3253
3299
  __name: "WFormSection",
3254
3300
  props: {
3255
3301
  title: {},
@@ -3266,11 +3312,11 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
3266
3312
  e.description ? (o(), d("p", Ho, I(e.description), 1)) : b("", !0)
3267
3313
  ]),
3268
3314
  a.$slots.actions ? (o(), d("div", Go, [
3269
- A(a.$slots, "actions")
3315
+ B(a.$slots, "actions")
3270
3316
  ])) : b("", !0)
3271
3317
  ])) : b("", !0),
3272
3318
  m("div", Yo, [
3273
- A(a.$slots, "default")
3319
+ B(a.$slots, "default")
3274
3320
  ])
3275
3321
  ], 2));
3276
3322
  }
@@ -3283,7 +3329,7 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
3283
3329
  }, Zo = {
3284
3330
  key: 2,
3285
3331
  class: "w-action-bar__secondary"
3286
- }, Ln = /* @__PURE__ */ ne({
3332
+ }, Ln = /* @__PURE__ */ re({
3287
3333
  __name: "WActionBar",
3288
3334
  props: {
3289
3335
  align: { default: "between" },
@@ -3294,22 +3340,22 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
3294
3340
  class: Q(["w-action-bar", [`w-action-bar--${e.align}`, { "w-action-bar--stack": e.stackOnMobile }]])
3295
3341
  }, [
3296
3342
  a.$slots.primary || a.$slots.default ? (o(), d("div", Jo, [
3297
- A(a.$slots, "primary", {}, () => [
3298
- A(a.$slots, "default")
3343
+ B(a.$slots, "primary", {}, () => [
3344
+ B(a.$slots, "default")
3299
3345
  ])
3300
3346
  ])) : b("", !0),
3301
3347
  a.$slots.filters ? (o(), d("div", Xo, [
3302
- A(a.$slots, "filters")
3348
+ B(a.$slots, "filters")
3303
3349
  ])) : b("", !0),
3304
3350
  a.$slots.secondary ? (o(), d("div", Zo, [
3305
- A(a.$slots, "secondary")
3351
+ B(a.$slots, "secondary")
3306
3352
  ])) : b("", !0)
3307
3353
  ], 2));
3308
3354
  }
3309
3355
  }), Qo = { class: "w-progress-flow__marker" }, _o = { class: "w-progress-flow__content" }, en = { class: "w-progress-flow__label" }, tn = {
3310
3356
  key: 0,
3311
3357
  class: "w-progress-flow__description"
3312
- }, zn = /* @__PURE__ */ ne({
3358
+ }, zn = /* @__PURE__ */ re({
3313
3359
  __name: "WProgressFlow",
3314
3360
  props: {
3315
3361
  steps: {},
@@ -3324,11 +3370,11 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
3324
3370
  return (i, v) => (o(), d("div", {
3325
3371
  class: Q(["w-progress-flow", `w-progress-flow--${e.orientation}`])
3326
3372
  }, [
3327
- (o(!0), d(Y, null, le(e.steps, ($, D) => (o(), d("div", {
3373
+ (o(!0), d(J, null, oe(e.steps, ($, D) => (o(), d("div", {
3328
3374
  key: $.key,
3329
3375
  class: Q(["w-progress-flow__step", `w-progress-flow__step--${n(D)}`])
3330
3376
  }, [
3331
- A(i.$slots, "step", {
3377
+ B(i.$slots, "step", {
3332
3378
  step: $,
3333
3379
  index: D,
3334
3380
  state: n(D)
@@ -3349,10 +3395,10 @@ export {
3349
3395
  Al as W,
3350
3396
  Ln as _,
3351
3397
  wl as a,
3352
- Qe as b,
3353
- gt as c,
3398
+ at as b,
3399
+ $t as c,
3354
3400
  Fn as d,
3355
- st as e,
3401
+ ct as e,
3356
3402
  In as f,
3357
3403
  An as g,
3358
3404
  Mn as h,
@@ -3374,4 +3420,4 @@ export {
3374
3420
  cl as x,
3375
3421
  ha as y
3376
3422
  };
3377
- //# sourceMappingURL=WProgressFlow.vue_vue_type_script_setup_true_lang-CURYPiY8.js.map
3423
+ //# sourceMappingURL=WProgressFlow.vue_vue_type_script_setup_true_lang-BZxi1797.js.map