@wgalleti/primevue-components 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{WProgressFlow.vue_vue_type_script_setup_true_lang-Cxudafdt.js → WProgressFlow.vue_vue_type_script_setup_true_lang-BZxi1797.js} +864 -819
- package/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-BZxi1797.js.map +1 -0
- package/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-CRx96kle.cjs +12 -0
- package/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-CRx96kle.cjs.map +1 -0
- package/dist/components/crud/WCrudView.vue.d.ts +3 -0
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/types/manager.d.ts +3 -0
- package/dist/{useApi-CzOJADZw.js → useApi-D8-gfJR-.js} +97 -95
- package/dist/useApi-D8-gfJR-.js.map +1 -0
- package/dist/useApi-Dms28942.cjs +2 -0
- package/dist/useApi-Dms28942.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-Cxudafdt.js.map +0 -1
- package/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-DobZvbe0.cjs +0 -12
- package/dist/WProgressFlow.vue_vue_type_script_setup_true_lang-DobZvbe0.cjs.map +0 -1
- package/dist/useApi-BDjRqSFt.cjs +0 -2
- package/dist/useApi-BDjRqSFt.cjs.map +0 -1
- package/dist/useApi-CzOJADZw.js.map +0 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
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
|
|
11
|
-
import
|
|
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
|
|
15
|
-
import
|
|
16
|
-
import
|
|
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
|
|
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
|
|
23
|
+
import bt from "primevue/datepicker";
|
|
24
24
|
import Kt from "primevue/inputgroup";
|
|
25
|
-
import
|
|
25
|
+
import st from "primevue/inputgroupaddon";
|
|
26
26
|
import Ht from "primevue/slider";
|
|
27
|
-
import
|
|
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
|
-
},
|
|
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 } =
|
|
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(
|
|
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,
|
|
69
|
-
const
|
|
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
|
-
},
|
|
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 =
|
|
84
|
-
const T = E.formatToParts(1000.12), w = ((v = T.find((F) => F.type === "group")) == null ? void 0 : v.value) ?? " ",
|
|
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
85
|
if (Number.isNaN(parseFloat(X))) return D;
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
88
|
-
const F =
|
|
89
|
-
E =
|
|
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
91
|
let Z = E.format(parseFloat(X));
|
|
92
|
-
return a ? x > 0 && X.endsWith(".") && !X.slice(0, -1).includes(".") && (Z +=
|
|
93
|
-
},
|
|
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 =
|
|
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 =
|
|
98
|
-
},
|
|
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
|
|
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:
|
|
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
|
-
},
|
|
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
|
-
|
|
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 } : { ...
|
|
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 =
|
|
125
|
+
typeof n.pattern == "string" && (n.pattern = kt() ? new RegExp(n.pattern, "u") : new RegExp(n.pattern));
|
|
126
126
|
} else
|
|
127
|
-
t.tokens =
|
|
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,
|
|
171
|
-
let
|
|
172
|
-
for (;
|
|
173
|
-
const V = v.charAt(F), O = x[V],
|
|
174
|
-
if (!$.includes(F) && O != null ? (
|
|
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
175
|
for (; X(F) && (x[v.charAt(F)] == null || $.includes(F)); ) {
|
|
176
176
|
if (n) {
|
|
177
|
-
if (D[T](v.charAt(F)), a.charAt(
|
|
178
|
-
F += 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(
|
|
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
|
-
|
|
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,
|
|
232
|
-
if (w === void 0 ||
|
|
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
233
|
let X = $;
|
|
234
|
-
E !== T && (X += t ? x.length - D.length : w.length -
|
|
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
|
|
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
|
-
},
|
|
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
|
-
|
|
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__ */
|
|
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 =
|
|
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 =
|
|
351
|
+
const v = i, $ = Bt(), { confirmDelete: D } = Tt(), x = U(null), E = U([]), T = U(!1);
|
|
352
352
|
let w = null;
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
t.autofocus &&
|
|
356
|
-
var
|
|
357
|
-
const u = (R = (
|
|
358
|
-
u && (u.setAttribute("autofocus", ""), u.focus(), (
|
|
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
361
|
function X(u) {
|
|
362
362
|
return u == null || u === "";
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function Y(u) {
|
|
365
365
|
if (u && typeof u == "object") {
|
|
366
|
-
const
|
|
367
|
-
return
|
|
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) && X(
|
|
376
|
+
(u) => (u.required ?? !0) && X(Y(u.value))
|
|
377
377
|
)
|
|
378
378
|
);
|
|
379
|
-
function
|
|
379
|
+
function A() {
|
|
380
380
|
const u = {};
|
|
381
|
-
for (const
|
|
382
|
-
const
|
|
383
|
-
X(
|
|
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
|
|
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
|
|
393
|
-
x.value =
|
|
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
|
|
405
|
+
const y = {
|
|
406
406
|
page_size: 20,
|
|
407
407
|
...t.endpointParams,
|
|
408
|
-
...
|
|
408
|
+
...A()
|
|
409
409
|
};
|
|
410
|
-
u && (
|
|
411
|
-
const
|
|
412
|
-
E.value =
|
|
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
|
|
420
|
-
const
|
|
421
|
-
if (
|
|
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(
|
|
425
|
+
w && clearTimeout(w), w = setTimeout(() => O(y), 300);
|
|
426
426
|
}
|
|
427
|
-
function
|
|
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
|
-
|
|
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 =
|
|
448
|
-
let
|
|
449
|
-
const
|
|
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 :
|
|
452
|
-
}), p = P(() => t.canCreate ?? f.value),
|
|
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(
|
|
455
|
-
}),
|
|
456
|
-
var u,
|
|
457
|
-
return (u = t.crudColumns) != null && u.length ? t.crudColumns : (
|
|
458
|
-
field:
|
|
459
|
-
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
|
-
})) :
|
|
461
|
+
})) : $e.value.length ? vl($e.value) : [{ field: t.optionLabel, header: t.optionLabel, sortable: !0 }];
|
|
462
462
|
});
|
|
463
|
-
async function
|
|
464
|
-
var u,
|
|
463
|
+
async function le() {
|
|
464
|
+
var u, y, z;
|
|
465
465
|
if (F.value) {
|
|
466
|
-
ie.value = [],
|
|
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:
|
|
473
|
-
page_size:
|
|
472
|
+
page: be.value,
|
|
473
|
+
page_size: we.value,
|
|
474
474
|
...t.endpointParams,
|
|
475
|
-
...
|
|
475
|
+
...A()
|
|
476
476
|
};
|
|
477
|
-
|
|
478
|
-
const
|
|
479
|
-
ie.value =
|
|
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 = [],
|
|
481
|
+
ie.value = [], ue.value = 0;
|
|
482
482
|
} finally {
|
|
483
483
|
ge.value = !1;
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
|
-
function
|
|
487
|
-
u.key === "F2" && !t.disabled && (u.preventDefault(),
|
|
486
|
+
function _(u) {
|
|
487
|
+
u.key === "F2" && !t.disabled && (u.preventDefault(), ae());
|
|
488
488
|
}
|
|
489
|
-
function
|
|
490
|
-
t.disabled || (
|
|
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
|
|
493
|
-
|
|
492
|
+
function Ie(u) {
|
|
493
|
+
be.value = u.page + 1, we.value = u.rows, le();
|
|
494
494
|
}
|
|
495
|
-
function
|
|
496
|
-
|
|
495
|
+
function Re(u) {
|
|
496
|
+
pe.value = u.sortField ?? null, W.value = u.sortOrder ?? 0, be.value = 1, le();
|
|
497
497
|
}
|
|
498
|
-
function
|
|
499
|
-
|
|
498
|
+
function Ne() {
|
|
499
|
+
ee.value && (x.value = ee.value, n("update:modelValue", ee.value), de.value = !1);
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function Ze(u) {
|
|
502
502
|
x.value = u.data, n("update:modelValue", u.data), de.value = !1;
|
|
503
503
|
}
|
|
504
|
-
const
|
|
505
|
-
let
|
|
506
|
-
function
|
|
507
|
-
|
|
508
|
-
var
|
|
509
|
-
const u = (
|
|
510
|
-
(
|
|
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
|
|
514
|
-
|
|
515
|
-
var
|
|
516
|
-
const u = (
|
|
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
|
|
520
|
+
function G(u) {
|
|
521
521
|
if (u.key !== "Enter" || u.isComposing) return;
|
|
522
522
|
u.preventDefault();
|
|
523
|
-
const
|
|
524
|
-
if (
|
|
525
|
-
|
|
523
|
+
const y = ce.value.trim();
|
|
524
|
+
if (y === "" || y === Ve) {
|
|
525
|
+
h();
|
|
526
526
|
return;
|
|
527
527
|
}
|
|
528
|
-
|
|
528
|
+
me && clearTimeout(me), Ve = y, be.value = 1, le();
|
|
529
529
|
}
|
|
530
|
-
function
|
|
531
|
-
u.key === "Enter" && (u.preventDefault(), u.stopPropagation(),
|
|
530
|
+
function s(u) {
|
|
531
|
+
u.key === "Enter" && (u.preventDefault(), u.stopPropagation(), ee.value && Ne());
|
|
532
532
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
533
|
+
Pe(ce, () => {
|
|
534
|
+
me && clearTimeout(me), me = setTimeout(() => {
|
|
535
|
+
be.value = 1, Ve = ce.value.trim(), le();
|
|
536
536
|
}, 300);
|
|
537
|
-
}),
|
|
538
|
-
() => Z.value.map((u) =>
|
|
539
|
-
(u,
|
|
540
|
-
if (de.value && (
|
|
541
|
-
const
|
|
542
|
-
|
|
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
|
|
546
|
-
function
|
|
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
|
|
549
|
-
u[
|
|
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
|
|
553
|
-
const u =
|
|
554
|
-
for (const
|
|
555
|
-
delete
|
|
556
|
-
for (const [
|
|
557
|
-
|
|
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
|
|
560
|
-
|
|
559
|
+
function je() {
|
|
560
|
+
fe.value = null, We(), M.value = !0;
|
|
561
561
|
}
|
|
562
|
-
function
|
|
563
|
-
|
|
564
|
-
for (const
|
|
565
|
-
|
|
566
|
-
|
|
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,
|
|
569
|
-
|
|
568
|
+
function xt(u, y) {
|
|
569
|
+
xe[u] = y;
|
|
570
570
|
}
|
|
571
571
|
async function Ct() {
|
|
572
|
-
|
|
572
|
+
q.value = !0;
|
|
573
573
|
try {
|
|
574
|
-
const u = { ...
|
|
575
|
-
for (const
|
|
576
|
-
const R = u[
|
|
577
|
-
if (
|
|
578
|
-
const
|
|
579
|
-
u[
|
|
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
|
|
583
|
-
if (
|
|
584
|
-
const
|
|
585
|
-
|
|
586
|
-
const R = ie.value.findIndex((
|
|
587
|
-
R !== -1 && (ie.value[R] =
|
|
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
|
-
|
|
590
|
-
|
|
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(
|
|
592
|
+
$.error(it(u, "Erro ao salvar registro"));
|
|
593
593
|
} finally {
|
|
594
|
-
|
|
594
|
+
q.value = !1;
|
|
595
595
|
}
|
|
596
596
|
}
|
|
597
597
|
function Vt(u) {
|
|
598
598
|
D(async () => {
|
|
599
599
|
try {
|
|
600
|
-
const
|
|
601
|
-
await v.delete(t.endpoint,
|
|
602
|
-
const
|
|
603
|
-
|
|
604
|
-
} catch (
|
|
605
|
-
$.error(
|
|
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,
|
|
610
|
-
const
|
|
611
|
-
return o(), d(
|
|
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(
|
|
613
|
+
S(r(gt), {
|
|
614
614
|
ref_key: "acRef",
|
|
615
|
-
ref:
|
|
615
|
+
ref: H,
|
|
616
616
|
"model-value": x.value,
|
|
617
617
|
suggestions: E.value,
|
|
618
618
|
"option-label": e.optionLabel,
|
|
619
|
-
placeholder:
|
|
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:
|
|
625
|
-
onItemSelect:
|
|
624
|
+
onComplete: ne,
|
|
625
|
+
onItemSelect: ve,
|
|
626
626
|
onClear: De,
|
|
627
|
-
onKeydown:
|
|
627
|
+
onKeydown: _
|
|
628
628
|
}, null, 8, ["model-value", "suggestions", "option-label", "placeholder", "disabled", "force-selection", "loading"]),
|
|
629
|
-
|
|
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:
|
|
636
|
-
}, [...
|
|
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
|
-
|
|
640
|
+
z,
|
|
641
641
|
"Pesquisar (F2)",
|
|
642
642
|
void 0,
|
|
643
643
|
{ top: !0 }
|
|
644
644
|
]
|
|
645
645
|
])
|
|
646
646
|
], 16),
|
|
647
|
-
S(r(
|
|
647
|
+
S(r(Xe), {
|
|
648
648
|
visible: de.value,
|
|
649
|
-
"onUpdate:visible":
|
|
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:
|
|
655
|
+
onShow: c
|
|
656
656
|
}, {
|
|
657
657
|
footer: K(() => [
|
|
658
658
|
m("div", bl, [
|
|
659
|
-
S(r(
|
|
659
|
+
S(r(N), {
|
|
660
660
|
label: "Cancelar",
|
|
661
661
|
severity: "secondary",
|
|
662
662
|
text: "",
|
|
663
|
-
onClick:
|
|
663
|
+
onClick: y[3] || (y[3] = (R) => de.value = !1)
|
|
664
664
|
}),
|
|
665
|
-
S(r(
|
|
665
|
+
S(r(N), {
|
|
666
666
|
label: "Selecionar",
|
|
667
667
|
icon: "pi pi-check",
|
|
668
|
-
disabled: !
|
|
669
|
-
onClick:
|
|
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(
|
|
675
|
+
S(r(Ue), { class: "w-autocompletefk-toolbar-search" }, {
|
|
676
676
|
default: K(() => [
|
|
677
|
-
S(r(
|
|
678
|
-
S(r(
|
|
677
|
+
S(r(Be), { class: "pi pi-search" }),
|
|
678
|
+
S(r(ye), {
|
|
679
679
|
ref_key: "modalSearchInput",
|
|
680
|
-
ref:
|
|
681
|
-
modelValue:
|
|
682
|
-
"onUpdate:modelValue":
|
|
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:
|
|
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(
|
|
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:
|
|
697
|
+
onClick: je
|
|
698
698
|
})) : b("", !0)
|
|
699
699
|
])
|
|
700
700
|
]),
|
|
701
701
|
m("div", {
|
|
702
702
|
ref_key: "modalTableWrap",
|
|
703
|
-
ref:
|
|
704
|
-
onKeydownCapture:
|
|
703
|
+
ref: Ce,
|
|
704
|
+
onKeydownCapture: s
|
|
705
705
|
}, [
|
|
706
|
-
S(r(
|
|
707
|
-
selection:
|
|
708
|
-
"onUpdate:selection":
|
|
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:
|
|
718
|
-
"total-records":
|
|
719
|
-
"sort-field":
|
|
720
|
-
"sort-order":
|
|
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:
|
|
724
|
-
onSort:
|
|
725
|
-
onRowDblclick:
|
|
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(() => [...
|
|
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(
|
|
731
|
+
S(r(Me), {
|
|
732
732
|
"selection-mode": "single",
|
|
733
733
|
"header-style": "width: 3rem"
|
|
734
734
|
}),
|
|
735
|
-
(o(!0), d(
|
|
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:
|
|
740
|
+
style: ke(R.style)
|
|
741
741
|
}, {
|
|
742
|
-
body: K(({ data:
|
|
743
|
-
R.type ? (o(), C(
|
|
742
|
+
body: K(({ data: se }) => [
|
|
743
|
+
R.type ? (o(), C(at, {
|
|
744
744
|
key: 0,
|
|
745
745
|
column: R,
|
|
746
|
-
value:
|
|
747
|
-
"row-data":
|
|
748
|
-
}, null, 8, ["column", "value", "row-data"])) : (o(), d(
|
|
749
|
-
|
|
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(
|
|
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
|
-
|
|
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: (
|
|
767
|
+
onClick: (se) => Se(R)
|
|
768
768
|
}, null, 8, ["onClick"])), [
|
|
769
769
|
[
|
|
770
|
-
|
|
770
|
+
z,
|
|
771
771
|
"Editar",
|
|
772
772
|
void 0,
|
|
773
773
|
{ top: !0 }
|
|
774
774
|
]
|
|
775
775
|
]) : b("", !0),
|
|
776
|
-
l.value ?
|
|
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: (
|
|
783
|
+
onClick: (se) => Vt(R)
|
|
784
784
|
}, null, 8, ["onClick"])), [
|
|
785
785
|
[
|
|
786
|
-
|
|
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(
|
|
803
|
+
f.value ? (o(), C($t, {
|
|
804
804
|
key: 0,
|
|
805
|
-
visible:
|
|
806
|
-
title:
|
|
807
|
-
fields:
|
|
808
|
-
"form-data":
|
|
809
|
-
"is-editing":
|
|
810
|
-
saving:
|
|
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":
|
|
813
|
-
|
|
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" },
|
|
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 =
|
|
842
|
-
|
|
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
|
|
853
|
+
function H() {
|
|
854
854
|
if (v.value === "") {
|
|
855
855
|
w(null);
|
|
856
856
|
return;
|
|
@@ -861,62 +861,62 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
|
|
|
861
861
|
function X() {
|
|
862
862
|
v.value = i.toDisplay(i.toDate(t.modelValue));
|
|
863
863
|
}
|
|
864
|
-
function
|
|
864
|
+
function Y(V) {
|
|
865
865
|
V.key === "F2" && !t.disabled && (V.preventDefault(), F());
|
|
866
866
|
}
|
|
867
867
|
function Z(V) {
|
|
868
|
-
var
|
|
869
|
-
w(V ?? null), t.showTime || (
|
|
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
|
|
874
|
+
function A() {
|
|
875
875
|
var V;
|
|
876
876
|
w(null), (V = D.value) == null || V.hide();
|
|
877
877
|
}
|
|
878
|
-
function
|
|
878
|
+
function L(V) {
|
|
879
879
|
var O;
|
|
880
880
|
t.disabled || (O = D.value) == null || O.toggle(V);
|
|
881
881
|
}
|
|
882
|
-
return
|
|
882
|
+
return ot(() => {
|
|
883
883
|
t.autonow && t.modelValue == null && F();
|
|
884
884
|
}), (V, O) => (o(), d("div", kl, [
|
|
885
|
-
S(r(
|
|
885
|
+
S(r(Ue), null, {
|
|
886
886
|
default: K(() => [
|
|
887
|
-
|
|
887
|
+
he(S(r(ye), {
|
|
888
888
|
id: e.inputId,
|
|
889
889
|
modelValue: v.value,
|
|
890
|
-
"onUpdate:modelValue": O[0] || (O[0] = (
|
|
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:
|
|
897
|
+
onInput: H,
|
|
898
898
|
onBlur: X,
|
|
899
|
-
onKeydown:
|
|
899
|
+
onKeydown: Y
|
|
900
900
|
}, null, 8, ["id", "modelValue", "placeholder", "disabled", "invalid"]), [
|
|
901
|
-
[r(
|
|
901
|
+
[r(Ye), x.value]
|
|
902
902
|
]),
|
|
903
|
-
S(r(
|
|
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:
|
|
908
|
+
onClick: L
|
|
909
909
|
}, null, 8, ["class"])
|
|
910
910
|
]),
|
|
911
911
|
_: 1
|
|
912
912
|
}),
|
|
913
|
-
S(r(
|
|
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(
|
|
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(
|
|
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(
|
|
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:
|
|
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__ */
|
|
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(
|
|
986
|
+
i.value ? (o(), C(r(st), { key: 0 }, {
|
|
987
987
|
default: K(() => [
|
|
988
|
-
|
|
988
|
+
Fe(I(i.value), 1)
|
|
989
989
|
]),
|
|
990
990
|
_: 1
|
|
991
991
|
})) : b("", !0),
|
|
992
|
-
S(r(
|
|
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(
|
|
1001
|
+
e.suffix ? (o(), C(r(st), { key: 1 }, {
|
|
1002
1002
|
default: K(() => [
|
|
1003
|
-
|
|
1003
|
+
Fe(I(e.suffix), 1)
|
|
1004
1004
|
]),
|
|
1005
1005
|
_: 1
|
|
1006
1006
|
})) : b("", !0)
|
|
1007
1007
|
]),
|
|
1008
1008
|
_: 1
|
|
1009
|
-
})) : (o(), C(r(
|
|
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" },
|
|
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 =
|
|
1035
|
-
|
|
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), $ =
|
|
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
|
|
1051
|
-
return !
|
|
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
|
|
1055
|
-
var
|
|
1056
|
-
const
|
|
1057
|
-
if (
|
|
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
|
|
1070
|
-
|
|
1071
|
-
w =
|
|
1072
|
-
},
|
|
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
1075
|
function X() {
|
|
1076
1076
|
n("update:modelValue", null);
|
|
1077
1077
|
}
|
|
1078
|
-
const
|
|
1079
|
-
() => F.value &&
|
|
1080
|
-
), de = P(() => De.value *
|
|
1081
|
-
function
|
|
1082
|
-
V.x = Math.min(0, Math.max(
|
|
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
|
-
|
|
1085
|
-
const
|
|
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
|
-
})),
|
|
1090
|
-
let
|
|
1091
|
-
function
|
|
1092
|
-
var
|
|
1093
|
-
|
|
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
|
|
1096
|
-
|
|
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
|
|
1099
|
-
|
|
1098
|
+
function W() {
|
|
1099
|
+
we.value = !1;
|
|
1100
1100
|
}
|
|
1101
|
-
function
|
|
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
|
|
1105
|
-
const
|
|
1106
|
-
return `${E.replace(/\.[^.]+$/, "") || "image"}.${
|
|
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,
|
|
1111
|
-
|
|
1112
|
-
const
|
|
1113
|
-
if (!
|
|
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 && (
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
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
|
-
),
|
|
1126
|
-
const
|
|
1127
|
-
|
|
1128
|
-
(
|
|
1129
|
-
if (!
|
|
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([
|
|
1133
|
+
n("update:modelValue", new File([ae], $e(_), { type: _ })), Y.value = !1;
|
|
1134
1134
|
},
|
|
1135
|
-
|
|
1135
|
+
_,
|
|
1136
1136
|
0.92
|
|
1137
1137
|
);
|
|
1138
1138
|
}
|
|
1139
|
-
return (p,
|
|
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:
|
|
1142
|
+
style: ke({ width: `${e.width}px`, height: `${e.height}px` })
|
|
1143
1143
|
}, [
|
|
1144
|
-
v.value ? (o(), d(
|
|
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(
|
|
1151
|
+
S(r(N), {
|
|
1152
1152
|
type: "button",
|
|
1153
1153
|
icon: "pi pi-pencil",
|
|
1154
1154
|
rounded: "",
|
|
@@ -1156,7 +1156,7 @@ 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(
|
|
1159
|
+
S(r(N), {
|
|
1160
1160
|
type: "button",
|
|
1161
1161
|
icon: "pi pi-trash",
|
|
1162
1162
|
rounded: "",
|
|
@@ -1166,12 +1166,12 @@ const pl = ["disabled"], hl = { class: "w-autocompletefk-toolbar" }, yl = { clas
|
|
|
1166
1166
|
onClick: X
|
|
1167
1167
|
})
|
|
1168
1168
|
])
|
|
1169
|
-
], 64)) :
|
|
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
|
-
}, [...
|
|
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:
|
|
1186
|
+
onChange: H
|
|
1187
1187
|
}, null, 40, El),
|
|
1188
|
-
S(r(
|
|
1189
|
-
visible:
|
|
1190
|
-
"onUpdate:visible":
|
|
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(
|
|
1197
|
+
S(r(N), {
|
|
1198
1198
|
type: "button",
|
|
1199
1199
|
label: "Cancelar",
|
|
1200
1200
|
text: "",
|
|
1201
|
-
onClick:
|
|
1201
|
+
onClick: g[1] || (g[1] = (l) => Y.value = !1)
|
|
1202
1202
|
}),
|
|
1203
|
-
S(r(
|
|
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:
|
|
1214
|
-
onPointerdown:
|
|
1215
|
-
onPointermove:
|
|
1216
|
-
onPointerup:
|
|
1217
|
-
onPointerleave:
|
|
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
|
|
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
|
-
|
|
1232
|
+
g[4] || (g[4] = m("i", { class: "pi pi-search-minus" }, null, -1)),
|
|
1233
1233
|
S(r(Ht), {
|
|
1234
|
-
modelValue:
|
|
1235
|
-
"onUpdate:modelValue":
|
|
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
|
-
|
|
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__ */
|
|
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 =
|
|
1273
|
-
function x(
|
|
1274
|
-
return
|
|
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(
|
|
1277
|
-
return String(
|
|
1276
|
+
function E(A) {
|
|
1277
|
+
return String(A[t.optionLabel] ?? "");
|
|
1278
1278
|
}
|
|
1279
|
-
function T(
|
|
1280
|
-
if (!
|
|
1281
|
-
const V =
|
|
1279
|
+
function T(A, L) {
|
|
1280
|
+
if (!L) return !0;
|
|
1281
|
+
const V = L.toLowerCase();
|
|
1282
1282
|
return D.value.some(
|
|
1283
|
-
(O) => String(
|
|
1283
|
+
(O) => String(A[O] ?? "").toLowerCase().includes(V)
|
|
1284
1284
|
);
|
|
1285
1285
|
}
|
|
1286
1286
|
const w = P(
|
|
1287
|
-
() => t.source.filter((
|
|
1288
|
-
),
|
|
1289
|
-
() => t.source.filter((
|
|
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 X(
|
|
1292
|
-
t.disabled || n("update:selected", [...t.selected, x(
|
|
1291
|
+
function X(A) {
|
|
1292
|
+
t.disabled || n("update:selected", [...t.selected, x(A)]);
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1294
|
+
function Y(A) {
|
|
1295
1295
|
if (t.disabled) return;
|
|
1296
|
-
const
|
|
1296
|
+
const L = x(A);
|
|
1297
1297
|
n(
|
|
1298
1298
|
"update:selected",
|
|
1299
|
-
t.selected.filter((V) => V !==
|
|
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 (
|
|
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
|
-
|
|
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(
|
|
1316
|
+
S(r(Ue), { class: "w-transfer__search" }, {
|
|
1317
1317
|
default: K(() => [
|
|
1318
|
-
S(r(
|
|
1319
|
-
S(r(
|
|
1318
|
+
S(r(Be), { class: "pi pi-search" }),
|
|
1319
|
+
S(r(ye), {
|
|
1320
1320
|
modelValue: i.value,
|
|
1321
|
-
"onUpdate:modelValue":
|
|
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(
|
|
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
1332
|
onClick: (O) => X(V)
|
|
1333
1333
|
}, [
|
|
1334
1334
|
m("span", null, I(E(V)), 1),
|
|
1335
|
-
|
|
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(
|
|
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(
|
|
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
|
-
|
|
1361
|
-
m("span", ql, I(
|
|
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(
|
|
1363
|
+
S(r(Ue), { class: "w-transfer__search" }, {
|
|
1364
1364
|
default: K(() => [
|
|
1365
|
-
S(r(
|
|
1366
|
-
S(r(
|
|
1365
|
+
S(r(Be), { class: "pi pi-search" }),
|
|
1366
|
+
S(r(ye), {
|
|
1367
1367
|
modelValue: v.value,
|
|
1368
|
-
"onUpdate:modelValue":
|
|
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(
|
|
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) =>
|
|
1379
|
+
onClick: (O) => Y(V)
|
|
1380
1380
|
}, [
|
|
1381
|
-
|
|
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
|
-
|
|
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__ */
|
|
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 =
|
|
1440
|
+
const n = e, i = t, v = Ee({}), $ = Ee({}), D = Ee({}), x = Ee({});
|
|
1441
1441
|
function E(f, p) {
|
|
1442
|
-
const
|
|
1443
|
-
i("update:field", f.field,
|
|
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
|
|
1451
|
-
for (const
|
|
1452
|
-
const
|
|
1453
|
-
if (!
|
|
1454
|
-
const
|
|
1455
|
-
(
|
|
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,65 +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
|
|
1469
|
+
function H(f) {
|
|
1470
1470
|
const p = f.endpointParams;
|
|
1471
1471
|
return typeof p == "function" ? p() : p;
|
|
1472
1472
|
}
|
|
1473
|
-
const X = P(
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
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)),
|
|
1478
|
+
(f) => {
|
|
1479
|
+
X.value.forEach((p, g) => {
|
|
1480
|
+
n.formData[p.field] !== f[g] && i("update:field", p.field, f[g]);
|
|
1481
|
+
});
|
|
1481
1482
|
},
|
|
1482
|
-
{
|
|
1483
|
+
{ immediate: !0 }
|
|
1483
1484
|
);
|
|
1484
|
-
function
|
|
1485
|
+
function Y(f) {
|
|
1485
1486
|
return Pt(f) ? f.value : f;
|
|
1486
1487
|
}
|
|
1487
1488
|
const Z = P(() => {
|
|
1488
1489
|
const f = n.isEditing ? "edit" : "create", p = n.fields.find((l) => l.autofocus === !0 || l.autofocus === f);
|
|
1489
1490
|
if (p) return p.field;
|
|
1490
|
-
const
|
|
1491
|
-
return (
|
|
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;
|
|
1492
1493
|
});
|
|
1493
1494
|
function F(f) {
|
|
1494
1495
|
return f.field === Z.value;
|
|
1495
1496
|
}
|
|
1496
|
-
function
|
|
1497
|
+
function A(f) {
|
|
1497
1498
|
if (f)
|
|
1498
1499
|
return f.replace(/9/g, "#").replace(/a/g, "S").replace(/\*/g, "X");
|
|
1499
1500
|
}
|
|
1500
|
-
function
|
|
1501
|
+
function L(f) {
|
|
1501
1502
|
if (!f) return "";
|
|
1502
1503
|
const p = String(f).replace(/\D/g, "").slice(0, 14);
|
|
1503
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");
|
|
1504
1505
|
}
|
|
1505
1506
|
function V(f, p) {
|
|
1506
|
-
const
|
|
1507
|
-
i("update:field", f,
|
|
1507
|
+
const g = p.target.value.replace(/\D/g, "").slice(0, 14);
|
|
1508
|
+
i("update:field", f, g);
|
|
1508
1509
|
}
|
|
1509
|
-
const O =
|
|
1510
|
-
function
|
|
1510
|
+
const O = Ee({});
|
|
1511
|
+
function ne(f) {
|
|
1511
1512
|
const p = n.formData[f.field];
|
|
1512
1513
|
if (p == null) return null;
|
|
1513
|
-
const
|
|
1514
|
-
return (
|
|
1514
|
+
const g = f.optionValue || "value";
|
|
1515
|
+
return (Y(f.options) || []).find((k) => k[g] === p) ?? null;
|
|
1515
1516
|
}
|
|
1516
|
-
function
|
|
1517
|
+
function ve(f) {
|
|
1517
1518
|
return O[f.field] || [];
|
|
1518
1519
|
}
|
|
1519
1520
|
function De(f, p) {
|
|
1520
|
-
const
|
|
1521
|
+
const g = (p.query || "").toLowerCase(), l = Y(f.options) || [], k = f.optionLabel || "label";
|
|
1521
1522
|
O[f.field] = l.filter(
|
|
1522
|
-
(
|
|
1523
|
+
(te) => String(te[k] || "").toLowerCase().includes(g)
|
|
1523
1524
|
);
|
|
1524
1525
|
}
|
|
1525
1526
|
function de(f, p) {
|
|
1526
|
-
const
|
|
1527
|
-
i("update:field", f.field, p.value[
|
|
1527
|
+
const g = f.optionValue || "value";
|
|
1528
|
+
i("update:field", f.field, p.value[g]);
|
|
1528
1529
|
}
|
|
1529
1530
|
function ie(f) {
|
|
1530
1531
|
const p = n.formData[f.field];
|
|
@@ -1533,7 +1534,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1533
1534
|
function ge(f, p) {
|
|
1534
1535
|
i("update:field", f.field, `#${p}`);
|
|
1535
1536
|
}
|
|
1536
|
-
function
|
|
1537
|
+
function ce(f) {
|
|
1537
1538
|
const p = f.dependsOn;
|
|
1538
1539
|
return p ? (Array.isArray(p) ? p : [p]).map((l) => ({
|
|
1539
1540
|
field: l.param || l.field,
|
|
@@ -1541,78 +1542,78 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1541
1542
|
required: l.required
|
|
1542
1543
|
})) : void 0;
|
|
1543
1544
|
}
|
|
1544
|
-
function
|
|
1545
|
+
function be(f) {
|
|
1545
1546
|
if (typeof f.validate == "function") {
|
|
1546
1547
|
const p = f.validate(n.formData[f.field]);
|
|
1547
1548
|
v[f.field] = p || null;
|
|
1548
1549
|
}
|
|
1549
1550
|
}
|
|
1550
|
-
function
|
|
1551
|
+
function we() {
|
|
1551
1552
|
const f = [];
|
|
1552
1553
|
for (const p of n.fields)
|
|
1553
1554
|
if (typeof p.validate == "function") {
|
|
1554
|
-
const
|
|
1555
|
-
v[p.field] =
|
|
1555
|
+
const g = p.validate(n.formData[p.field]);
|
|
1556
|
+
v[p.field] = g || null, g && f.push(g);
|
|
1556
1557
|
}
|
|
1557
1558
|
return f;
|
|
1558
1559
|
}
|
|
1559
|
-
function
|
|
1560
|
+
function ue() {
|
|
1560
1561
|
Object.keys(v).forEach((f) => delete v[f]);
|
|
1561
1562
|
}
|
|
1562
|
-
function
|
|
1563
|
+
function ee(f) {
|
|
1563
1564
|
return Math.max(1, Math.floor(f.columns ?? n.columns));
|
|
1564
1565
|
}
|
|
1565
|
-
function
|
|
1566
|
-
const
|
|
1567
|
-
return
|
|
1568
|
-
}
|
|
1569
|
-
function
|
|
1570
|
-
return { "--w-col-span":
|
|
1571
|
-
}
|
|
1572
|
-
function
|
|
1573
|
-
return
|
|
1574
|
-
}
|
|
1575
|
-
const
|
|
1576
|
-
var l, k,
|
|
1577
|
-
const f = /* @__PURE__ */ new Map(), p = [],
|
|
1578
|
-
for (const
|
|
1579
|
-
const
|
|
1580
|
-
f.has(
|
|
1581
|
-
id:
|
|
1582
|
-
title: (k =
|
|
1583
|
-
description: (
|
|
1584
|
-
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,
|
|
1585
1586
|
fields: []
|
|
1586
|
-
}), p.push(
|
|
1587
|
+
}), p.push(ae), ((le = _.fieldGroup) == null ? void 0 : le.order) != null && g.set(ae, _.fieldGroup.order)), f.get(ae).fields.push(_);
|
|
1587
1588
|
}
|
|
1588
|
-
return p.slice().sort((
|
|
1589
|
-
const
|
|
1590
|
-
return
|
|
1591
|
-
}).map((
|
|
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(_));
|
|
1592
1593
|
});
|
|
1593
|
-
return a({ validateAll:
|
|
1594
|
-
(o(!0), d(
|
|
1595
|
-
key:
|
|
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,
|
|
1596
1597
|
class: "w-crud-form-group"
|
|
1597
1598
|
}, [
|
|
1598
|
-
|
|
1599
|
-
m("h3", Ql, I(
|
|
1600
|
-
|
|
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)
|
|
1601
1602
|
])) : b("", !0),
|
|
1602
1603
|
m("div", {
|
|
1603
1604
|
class: "w-crud-form-fields",
|
|
1604
|
-
style:
|
|
1605
|
+
style: ke({ "--w-form-cols": ee(g) })
|
|
1605
1606
|
}, [
|
|
1606
|
-
(o(!0), d(
|
|
1607
|
+
(o(!0), d(J, null, oe(g.fields, (l) => B(f.$slots, `field-${l.field}`, {
|
|
1607
1608
|
field: l,
|
|
1608
1609
|
formData: e.formData,
|
|
1609
1610
|
isEditing: e.isEditing,
|
|
1610
|
-
setFormField: (k,
|
|
1611
|
+
setFormField: (k, te) => i("update:field", k, te)
|
|
1611
1612
|
}, () => [
|
|
1612
1613
|
l.type === "switch" ? (o(), d("div", {
|
|
1613
1614
|
key: 0,
|
|
1614
1615
|
class: "w-crud-form-switch",
|
|
1615
|
-
style:
|
|
1616
|
+
style: ke(W(l, g))
|
|
1616
1617
|
}, [
|
|
1617
1618
|
S(r(Ot), {
|
|
1618
1619
|
"model-value": e.formData[l.field],
|
|
@@ -1622,11 +1623,11 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1622
1623
|
m("label", ea, I(l.switchLabel || l.label), 1)
|
|
1623
1624
|
], 4)) : l.type === "color" ? (o(), d("div", {
|
|
1624
1625
|
key: 1,
|
|
1625
|
-
class: Q(
|
|
1626
|
-
style:
|
|
1626
|
+
class: Q(me(l, g)),
|
|
1627
|
+
style: ke(W(l, g))
|
|
1627
1628
|
}, [
|
|
1628
1629
|
m("label", ta, [
|
|
1629
|
-
|
|
1630
|
+
Fe(I(l.label) + " ", 1),
|
|
1630
1631
|
l.required ? (o(), d("span", la, "*")) : b("", !0)
|
|
1631
1632
|
]),
|
|
1632
1633
|
m("div", aa, [
|
|
@@ -1635,7 +1636,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1635
1636
|
disabled: w(l),
|
|
1636
1637
|
"onUpdate:modelValue": (k) => ge(l, k)
|
|
1637
1638
|
}, null, 8, ["model-value", "disabled", "onUpdate:modelValue"]),
|
|
1638
|
-
S(r(
|
|
1639
|
+
S(r(ye), {
|
|
1639
1640
|
"model-value": e.formData[l.field],
|
|
1640
1641
|
class: "w-28",
|
|
1641
1642
|
maxlength: "7",
|
|
@@ -1646,11 +1647,11 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1646
1647
|
])
|
|
1647
1648
|
], 6)) : l.type === "image" ? (o(), d("div", {
|
|
1648
1649
|
key: 2,
|
|
1649
|
-
class: Q(
|
|
1650
|
-
style:
|
|
1650
|
+
class: Q(me(l, g)),
|
|
1651
|
+
style: ke(W(l, g))
|
|
1651
1652
|
}, [
|
|
1652
1653
|
m("label", oa, I(l.label), 1),
|
|
1653
|
-
|
|
1654
|
+
B(f.$slots, `image-${l.field}`, {
|
|
1654
1655
|
field: l,
|
|
1655
1656
|
formData: e.formData
|
|
1656
1657
|
}, () => [
|
|
@@ -1666,15 +1667,15 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1666
1667
|
v[l.field] ? (o(), d("small", na, I(v[l.field]), 1)) : b("", !0)
|
|
1667
1668
|
], 6)) : l.type === "transfer" ? (o(), d("div", {
|
|
1668
1669
|
key: 3,
|
|
1669
|
-
class: Q(
|
|
1670
|
-
style:
|
|
1670
|
+
class: Q(me(l, g)),
|
|
1671
|
+
style: ke(W(l, g))
|
|
1671
1672
|
}, [
|
|
1672
1673
|
m("label", ia, [
|
|
1673
|
-
|
|
1674
|
+
Fe(I(l.label) + " ", 1),
|
|
1674
1675
|
l.required ? (o(), d("span", sa, "*")) : b("", !0)
|
|
1675
1676
|
]),
|
|
1676
1677
|
S(Yl, {
|
|
1677
|
-
source:
|
|
1678
|
+
source: Y(l.options) || [],
|
|
1678
1679
|
selected: e.formData[l.field] || [],
|
|
1679
1680
|
"track-by": l.optionValue || "id",
|
|
1680
1681
|
"option-label": l.optionLabel || "nome",
|
|
@@ -1684,15 +1685,15 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1684
1685
|
}, null, 8, ["source", "selected", "track-by", "option-label", "search-fields", "disabled", "onUpdate:selected"])
|
|
1685
1686
|
], 6)) : (o(), d("div", {
|
|
1686
1687
|
key: 4,
|
|
1687
|
-
class: Q(
|
|
1688
|
-
style:
|
|
1688
|
+
class: Q(me(l, g)),
|
|
1689
|
+
style: ke(W(l, g))
|
|
1689
1690
|
}, [
|
|
1690
1691
|
m("label", ra, [
|
|
1691
|
-
|
|
1692
|
+
Fe(I(l.label) + " ", 1),
|
|
1692
1693
|
l.required ? (o(), d("span", ua, "*")) : b("", !0),
|
|
1693
1694
|
$[l.field] ? (o(), d("i", da)) : b("", !0)
|
|
1694
1695
|
]),
|
|
1695
|
-
(!l.type || l.type === "text") && l.mask ?
|
|
1696
|
+
(!l.type || l.type === "text") && l.mask ? he((o(), C(r(ye), {
|
|
1696
1697
|
key: 0,
|
|
1697
1698
|
"model-value": e.formData[l.field],
|
|
1698
1699
|
fluid: "",
|
|
@@ -1701,8 +1702,8 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1701
1702
|
disabled: w(l),
|
|
1702
1703
|
"onUpdate:modelValue": (k) => i("update:field", l.field, k)
|
|
1703
1704
|
}, null, 8, ["model-value", "autofocus", "placeholder", "disabled", "onUpdate:modelValue"])), [
|
|
1704
|
-
[r(
|
|
1705
|
-
]) : !l.type || l.type === "text" ? (o(), C(r(
|
|
1705
|
+
[r(Ye), { mask: A(l.mask) }]
|
|
1706
|
+
]) : !l.type || l.type === "text" ? (o(), C(r(ye), {
|
|
1706
1707
|
key: 1,
|
|
1707
1708
|
"model-value": e.formData[l.field],
|
|
1708
1709
|
fluid: "",
|
|
@@ -1710,7 +1711,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1710
1711
|
placeholder: l.placeholder,
|
|
1711
1712
|
disabled: w(l),
|
|
1712
1713
|
"onUpdate:modelValue": (k) => i("update:field", l.field, k)
|
|
1713
|
-
}, null, 8, ["model-value", "autofocus", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "email" ? (o(), C(r(
|
|
1714
|
+
}, null, 8, ["model-value", "autofocus", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "email" ? (o(), C(r(ye), {
|
|
1714
1715
|
key: 2,
|
|
1715
1716
|
"model-value": e.formData[l.field],
|
|
1716
1717
|
type: "email",
|
|
@@ -1728,7 +1729,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1728
1729
|
placeholder: l.placeholder,
|
|
1729
1730
|
disabled: w(l),
|
|
1730
1731
|
"onUpdate:modelValue": (k) => i("update:field", l.field, k)
|
|
1731
|
-
}, null, 8, ["model-value", "feedback", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "number" ? (o(), C(r(
|
|
1732
|
+
}, null, 8, ["model-value", "feedback", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "number" ? (o(), C(r(Je), {
|
|
1732
1733
|
key: 4,
|
|
1733
1734
|
"model-value": e.formData[l.field],
|
|
1734
1735
|
fluid: "",
|
|
@@ -1752,7 +1753,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1752
1753
|
placeholder: l.placeholder,
|
|
1753
1754
|
disabled: w(l),
|
|
1754
1755
|
"onUpdate:modelValue": (k) => i("update:field", l.field, k)
|
|
1755
|
-
}, null, 8, ["model-value", "decimals", "prefix", "suffix", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "currency" ? (o(), C(r(
|
|
1756
|
+
}, null, 8, ["model-value", "decimals", "prefix", "suffix", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "currency" ? (o(), C(r(Je), {
|
|
1756
1757
|
key: 6,
|
|
1757
1758
|
"model-value": e.formData[l.field],
|
|
1758
1759
|
fluid: "",
|
|
@@ -1764,22 +1765,22 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1764
1765
|
placeholder: l.placeholder,
|
|
1765
1766
|
disabled: w(l),
|
|
1766
1767
|
"onUpdate:modelValue": (k) => i("update:field", l.field, k)
|
|
1767
|
-
}, null, 8, ["model-value", "min", "max", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "select" ? (o(), C(r(
|
|
1768
|
+
}, null, 8, ["model-value", "min", "max", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "select" ? (o(), C(r(lt), {
|
|
1768
1769
|
key: 7,
|
|
1769
1770
|
"model-value": e.formData[l.field],
|
|
1770
1771
|
fluid: "",
|
|
1771
|
-
options:
|
|
1772
|
+
options: Y(l.options),
|
|
1772
1773
|
"option-label": l.optionLabel || "label",
|
|
1773
1774
|
"option-value": l.optionValue || "value",
|
|
1774
1775
|
"show-clear": l.showClear !== !1,
|
|
1775
1776
|
placeholder: l.placeholder,
|
|
1776
1777
|
disabled: w(l),
|
|
1777
1778
|
"onUpdate:modelValue": (k) => i("update:field", l.field, k)
|
|
1778
|
-
}, null, 8, ["model-value", "options", "option-label", "option-value", "show-clear", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "autocomplete" ? (o(), C(r(
|
|
1779
|
+
}, null, 8, ["model-value", "options", "option-label", "option-value", "show-clear", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "autocomplete" ? (o(), C(r(gt), {
|
|
1779
1780
|
key: 8,
|
|
1780
|
-
"model-value":
|
|
1781
|
+
"model-value": ne(l),
|
|
1781
1782
|
fluid: "",
|
|
1782
|
-
suggestions:
|
|
1783
|
+
suggestions: ve(l),
|
|
1783
1784
|
"option-label": l.optionLabel || "label",
|
|
1784
1785
|
placeholder: l.placeholder,
|
|
1785
1786
|
disabled: w(l),
|
|
@@ -1791,8 +1792,8 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1791
1792
|
"model-value": e.formData[l.field],
|
|
1792
1793
|
autofocus: F(l) || void 0,
|
|
1793
1794
|
endpoint: l.endpoint,
|
|
1794
|
-
"endpoint-params":
|
|
1795
|
-
drilldown:
|
|
1795
|
+
"endpoint-params": H(l),
|
|
1796
|
+
drilldown: ce(l),
|
|
1796
1797
|
"blocked-placeholder": l.blockedPlaceholder,
|
|
1797
1798
|
"option-label": l.optionLabel || "nome",
|
|
1798
1799
|
placeholder: l.placeholder,
|
|
@@ -1805,7 +1806,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1805
1806
|
"can-edit": l.canEdit,
|
|
1806
1807
|
"can-delete": l.canDelete,
|
|
1807
1808
|
"onUpdate:modelValue": (k) => i("update:field", l.field, k)
|
|
1808
|
-
}, 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(
|
|
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, {
|
|
1809
1810
|
key: 10,
|
|
1810
1811
|
"model-value": e.formData[l.field],
|
|
1811
1812
|
"value-format": "date",
|
|
@@ -1815,7 +1816,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1815
1816
|
placeholder: l.placeholder,
|
|
1816
1817
|
disabled: w(l),
|
|
1817
1818
|
"onUpdate:modelValue": (k) => i("update:field", l.field, k)
|
|
1818
|
-
}, null, 8, ["model-value", "autonow", "min-date", "max-date", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "datetime" ? (o(), C(
|
|
1819
|
+
}, null, 8, ["model-value", "autonow", "min-date", "max-date", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "datetime" ? (o(), C(ct, {
|
|
1819
1820
|
key: 11,
|
|
1820
1821
|
"model-value": e.formData[l.field],
|
|
1821
1822
|
"value-format": "date",
|
|
@@ -1826,17 +1827,17 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1826
1827
|
placeholder: l.placeholder,
|
|
1827
1828
|
disabled: w(l),
|
|
1828
1829
|
"onUpdate:modelValue": (k) => i("update:field", l.field, k)
|
|
1829
|
-
}, null, 8, ["model-value", "autonow", "min-date", "max-date", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "cpf_cnpj" ? (o(), C(r(
|
|
1830
|
+
}, null, 8, ["model-value", "autonow", "min-date", "max-date", "placeholder", "disabled", "onUpdate:modelValue"])) : l.type === "cpf_cnpj" ? (o(), C(r(ye), {
|
|
1830
1831
|
key: 12,
|
|
1831
|
-
"model-value":
|
|
1832
|
+
"model-value": L(e.formData[l.field]),
|
|
1832
1833
|
fluid: "",
|
|
1833
1834
|
maxlength: "18",
|
|
1834
1835
|
placeholder: l.placeholder || "000.000.000-00",
|
|
1835
1836
|
disabled: w(l),
|
|
1836
1837
|
invalid: !!v[l.field],
|
|
1837
1838
|
onInput: (k) => V(l.field, k),
|
|
1838
|
-
onBlur: (k) =>
|
|
1839
|
-
}, null, 8, ["model-value", "placeholder", "disabled", "invalid", "onInput", "onBlur"])) : l.type === "mask" ?
|
|
1839
|
+
onBlur: (k) => be(l)
|
|
1840
|
+
}, null, 8, ["model-value", "placeholder", "disabled", "invalid", "onInput", "onBlur"])) : l.type === "mask" ? he((o(), C(r(ye), {
|
|
1840
1841
|
key: 13,
|
|
1841
1842
|
"model-value": e.formData[l.field],
|
|
1842
1843
|
fluid: "",
|
|
@@ -1844,10 +1845,10 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1844
1845
|
disabled: w(l),
|
|
1845
1846
|
invalid: !!v[l.field],
|
|
1846
1847
|
"onUpdate:modelValue": (k) => i("update:field", l.field, k),
|
|
1847
|
-
onBlur: (k) =>
|
|
1848
|
+
onBlur: (k) => be(l)
|
|
1848
1849
|
}, null, 8, ["model-value", "placeholder", "disabled", "invalid", "onUpdate:modelValue", "onBlur"])), [
|
|
1849
|
-
[r(
|
|
1850
|
-
]) : l.type === "cep" ?
|
|
1850
|
+
[r(Ye), { mask: A(l.mask) }]
|
|
1851
|
+
]) : l.type === "cep" ? he((o(), C(r(ye), {
|
|
1851
1852
|
key: 14,
|
|
1852
1853
|
"model-value": e.formData[l.field],
|
|
1853
1854
|
fluid: "",
|
|
@@ -1856,7 +1857,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1856
1857
|
invalid: !!D[l.field],
|
|
1857
1858
|
onInput: (k) => E(l, k)
|
|
1858
1859
|
}, null, 8, ["model-value", "placeholder", "disabled", "invalid", "onInput"])), [
|
|
1859
|
-
[r(
|
|
1860
|
+
[r(Ye), { mask: "#####-###" }]
|
|
1860
1861
|
]) : l.type === "textarea" ? (o(), C(r(zt), {
|
|
1861
1862
|
key: 15,
|
|
1862
1863
|
"model-value": e.formData[l.field],
|
|
@@ -1874,7 +1875,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1874
1875
|
]))), 128))
|
|
1875
1876
|
]));
|
|
1876
1877
|
}
|
|
1877
|
-
}), va = { class: "w-crud-form-footer" },
|
|
1878
|
+
}), va = { class: "w-crud-form-footer" }, $t = /* @__PURE__ */ re({
|
|
1878
1879
|
__name: "WCrudFormDialog",
|
|
1879
1880
|
props: {
|
|
1880
1881
|
visible: { type: Boolean },
|
|
@@ -1890,7 +1891,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1890
1891
|
},
|
|
1891
1892
|
emits: ["update:visible", "update:field", "save"],
|
|
1892
1893
|
setup(e, { emit: a }) {
|
|
1893
|
-
const t = e, n = a, i =
|
|
1894
|
+
const t = e, n = a, i = U(null), v = U(null);
|
|
1894
1895
|
function $() {
|
|
1895
1896
|
i.value ? i.value.validateAll().length === 0 && n("save") : n("save");
|
|
1896
1897
|
}
|
|
@@ -1898,15 +1899,15 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1898
1899
|
enabled: () => t.keyboardNav === !0,
|
|
1899
1900
|
onSubmit: $
|
|
1900
1901
|
});
|
|
1901
|
-
return
|
|
1902
|
+
return Pe(
|
|
1902
1903
|
() => t.visible,
|
|
1903
1904
|
(E) => {
|
|
1904
1905
|
E && i.value && i.value.clearErrors();
|
|
1905
1906
|
}
|
|
1906
|
-
), (E, T) => (o(), C(r(
|
|
1907
|
+
), (E, T) => (o(), C(r(Xe), {
|
|
1907
1908
|
visible: e.visible,
|
|
1908
1909
|
header: e.title,
|
|
1909
|
-
style:
|
|
1910
|
+
style: ke({ width: e.width }),
|
|
1910
1911
|
modal: "",
|
|
1911
1912
|
draggable: !1,
|
|
1912
1913
|
class: "w-crud-form-dialog",
|
|
@@ -1930,27 +1931,27 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1930
1931
|
"is-editing": e.isEditing,
|
|
1931
1932
|
disabled: e.disabled,
|
|
1932
1933
|
columns: e.formColumns,
|
|
1933
|
-
"onUpdate:field": T[0] || (T[0] = (w,
|
|
1934
|
-
},
|
|
1935
|
-
|
|
1934
|
+
"onUpdate:field": T[0] || (T[0] = (w, H) => n("update:field", w, H))
|
|
1935
|
+
}, Ge({ _: 2 }, [
|
|
1936
|
+
oe(e.fields, (w) => ({
|
|
1936
1937
|
name: `field-${w.field}`,
|
|
1937
|
-
fn: K((
|
|
1938
|
-
|
|
1938
|
+
fn: K((H) => [
|
|
1939
|
+
B(E.$slots, `field-${w.field}`, et(tt(H)))
|
|
1939
1940
|
])
|
|
1940
1941
|
})),
|
|
1941
|
-
|
|
1942
|
+
oe(e.fields.filter((w) => w.type === "image"), (w) => ({
|
|
1942
1943
|
name: `image-${w.field}`,
|
|
1943
|
-
fn: K((
|
|
1944
|
-
|
|
1944
|
+
fn: K((H) => [
|
|
1945
|
+
B(E.$slots, `image-${w.field}`, et(tt(H)))
|
|
1945
1946
|
])
|
|
1946
1947
|
}))
|
|
1947
1948
|
]), 1032, ["fields", "form-data", "is-editing", "disabled", "columns"]),
|
|
1948
1949
|
m("div", va, [
|
|
1949
|
-
|
|
1950
|
+
B(E.$slots, "footer", {
|
|
1950
1951
|
saving: e.saving,
|
|
1951
1952
|
disabled: e.disabled
|
|
1952
1953
|
}, () => [
|
|
1953
|
-
S(r(
|
|
1954
|
+
S(r(N), {
|
|
1954
1955
|
type: "button",
|
|
1955
1956
|
label: e.disabled ? "Fechar" : "Cancelar",
|
|
1956
1957
|
severity: "secondary",
|
|
@@ -1959,7 +1960,7 @@ const Xl = { class: "w-crud-form" }, Zl = {
|
|
|
1959
1960
|
"data-kbd-skip": "",
|
|
1960
1961
|
onClick: T[1] || (T[1] = (w) => n("update:visible", !1))
|
|
1961
1962
|
}, null, 8, ["label", "disabled"]),
|
|
1962
|
-
e.disabled ? b("", !0) : (o(), C(r(
|
|
1963
|
+
e.disabled ? b("", !0) : (o(), C(r(N), {
|
|
1963
1964
|
key: 0,
|
|
1964
1965
|
type: "submit",
|
|
1965
1966
|
label: e.isEditing ? "Atualizar" : "Salvar",
|
|
@@ -1978,12 +1979,12 @@ function pa(e, a) {
|
|
|
1978
1979
|
const t = a[e.field];
|
|
1979
1980
|
return e.format ? e.format(t, a) : t == null ? "" : typeof t == "boolean" ? t ? "Sim" : "Não" : String(t);
|
|
1980
1981
|
}
|
|
1981
|
-
function
|
|
1982
|
+
function mt(e, a) {
|
|
1982
1983
|
return e.includes('"') || e.includes(a) || e.includes(`
|
|
1983
1984
|
`) || e.includes("\r") ? `"${e.replace(/"/g, '""')}"` : e;
|
|
1984
1985
|
}
|
|
1985
1986
|
function ha(e, a, t = {}) {
|
|
1986
|
-
const n = t.separator ?? ";", i = a.map(($) =>
|
|
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));
|
|
1987
1988
|
return "\uFEFF" + [i, ...v].join(`\r
|
|
1988
1989
|
`);
|
|
1989
1990
|
}
|
|
@@ -2041,7 +2042,7 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2041
2042
|
}, eo = {
|
|
2042
2043
|
key: 2,
|
|
2043
2044
|
class: "w-crud-rail-sep"
|
|
2044
|
-
}, Fn = /* @__PURE__ */
|
|
2045
|
+
}, Fn = /* @__PURE__ */ re({
|
|
2045
2046
|
__name: "WCrudView",
|
|
2046
2047
|
props: {
|
|
2047
2048
|
crud: {},
|
|
@@ -2071,7 +2072,7 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2071
2072
|
},
|
|
2072
2073
|
emits: ["row-expand", "row-collapse", "print"],
|
|
2073
2074
|
setup(e, { emit: a }) {
|
|
2074
|
-
const t = e, n = a, i = It(), { formatNumber: v } =
|
|
2075
|
+
const t = e, n = a, i = It(), { formatNumber: v } = nt(), $ = U({}), D = U(t.defaultView);
|
|
2075
2076
|
function x(c) {
|
|
2076
2077
|
return D.value === c;
|
|
2077
2078
|
}
|
|
@@ -2080,11 +2081,11 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2080
2081
|
}
|
|
2081
2082
|
const T = P(
|
|
2082
2083
|
() => (t.crud.pagination.page - 1) * t.crud.pagination.pageSize
|
|
2083
|
-
), w =
|
|
2084
|
+
), w = Ee({ hidden: [] }), H = U(null);
|
|
2084
2085
|
function X() {
|
|
2085
2086
|
return t.persistState ? `wcrud:cols:${t.persistState}` : null;
|
|
2086
2087
|
}
|
|
2087
|
-
function
|
|
2088
|
+
function Y() {
|
|
2088
2089
|
const c = X();
|
|
2089
2090
|
if (c)
|
|
2090
2091
|
try {
|
|
@@ -2098,17 +2099,17 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2098
2099
|
c && localStorage.setItem(c, JSON.stringify({ hidden: w.hidden }));
|
|
2099
2100
|
}
|
|
2100
2101
|
const F = P(() => t.crud.config.columns.filter((c) => c.visible !== !1));
|
|
2101
|
-
function
|
|
2102
|
-
w.hidden = h ? w.hidden.filter((
|
|
2102
|
+
function A(c, h) {
|
|
2103
|
+
w.hidden = h ? w.hidden.filter((G) => G !== c) : [.../* @__PURE__ */ new Set([...w.hidden, c])], Z();
|
|
2103
2104
|
}
|
|
2104
|
-
const
|
|
2105
|
+
const L = P(
|
|
2105
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)
|
|
2106
2107
|
);
|
|
2107
2108
|
function V(c) {
|
|
2108
2109
|
if (c.align === "right") return "text-right";
|
|
2109
2110
|
if (c.align === "center") return "text-center";
|
|
2110
2111
|
}
|
|
2111
|
-
const O = P(() =>
|
|
2112
|
+
const O = P(() => L.value.slice(0, t.cardFields)), ne = P(() => {
|
|
2112
2113
|
const c = [];
|
|
2113
2114
|
return t.crud.config.canEdit !== !1 && c.push({ action: "edit", icon: "pi pi-pencil", tooltip: "Editar" }), t.crud.config.canCreate !== !1 && c.push({
|
|
2114
2115
|
action: "duplicate",
|
|
@@ -2121,68 +2122,79 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2121
2122
|
tooltip: "Excluir",
|
|
2122
2123
|
severity: "danger"
|
|
2123
2124
|
}), c;
|
|
2124
|
-
}),
|
|
2125
|
-
() => t.crud.config.rowActions ??
|
|
2125
|
+
}), ve = P(
|
|
2126
|
+
() => t.crud.config.rowActions ?? ne.value
|
|
2126
2127
|
), De = P(
|
|
2127
|
-
() =>
|
|
2128
|
+
() => ve.value.length > 0 || !!i["row-actions"]
|
|
2128
2129
|
);
|
|
2129
2130
|
function de(c, h) {
|
|
2130
2131
|
if (c.handler) {
|
|
2131
2132
|
c.handler(h);
|
|
2132
2133
|
return;
|
|
2133
2134
|
}
|
|
2134
|
-
c.action === "edit" ? t.crud.openEditDialog(h) : c.action === "view" ? t.crud.openViewDialog(h) : c.action === "duplicate" ? t.crud.openDuplicateDialog(h) : c.action === "delete" && t.crud.confirmDelete(h);
|
|
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));
|
|
2136
|
+
}
|
|
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
|
+
}
|
|
2135
2147
|
}
|
|
2136
|
-
function
|
|
2148
|
+
function we(c, h) {
|
|
2137
2149
|
return c.visible ? c.visible(h) : !0;
|
|
2138
2150
|
}
|
|
2139
|
-
function
|
|
2151
|
+
function ue(c, h) {
|
|
2140
2152
|
return c.disabled ? c.disabled(h) : !1;
|
|
2141
2153
|
}
|
|
2142
|
-
const
|
|
2154
|
+
const ee = P(() => {
|
|
2143
2155
|
const c = [];
|
|
2144
2156
|
return t.showKpi && c.push({
|
|
2145
2157
|
icon: t.kpiIcon,
|
|
2146
2158
|
label: t.kpiLabel,
|
|
2147
2159
|
value: v(t.crud.pagination.rows, 0)
|
|
2148
2160
|
}), c.push(...t.extraKpis), c;
|
|
2149
|
-
}),
|
|
2150
|
-
function
|
|
2151
|
-
const h =
|
|
2152
|
-
return h &&
|
|
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;
|
|
2153
2165
|
}
|
|
2154
|
-
function
|
|
2166
|
+
function l(c) {
|
|
2155
2167
|
c.newValue !== (c.value ?? c.data[c.field]) && t.crud.updateField(c.data, c.field, c.newValue);
|
|
2156
2168
|
}
|
|
2157
|
-
const
|
|
2169
|
+
const k = P(
|
|
2158
2170
|
() => t.crud.config.columns.filter((c) => c.filter)
|
|
2159
|
-
),
|
|
2171
|
+
), te = [
|
|
2160
2172
|
{ label: "Sim", value: !0 },
|
|
2161
2173
|
{ label: "Não", value: !1 }
|
|
2162
2174
|
];
|
|
2163
|
-
function
|
|
2175
|
+
function j(c) {
|
|
2164
2176
|
var h;
|
|
2165
2177
|
return ((h = c.filter) == null ? void 0 : h.param) || c.field;
|
|
2166
2178
|
}
|
|
2167
|
-
const
|
|
2168
|
-
function
|
|
2169
|
-
const
|
|
2170
|
-
|
|
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);
|
|
2171
2183
|
}
|
|
2172
|
-
const
|
|
2173
|
-
function
|
|
2174
|
-
|
|
2184
|
+
const ae = U(null);
|
|
2185
|
+
function Ie(c) {
|
|
2186
|
+
W.value = c;
|
|
2175
2187
|
}
|
|
2176
|
-
function
|
|
2188
|
+
function Re(c) {
|
|
2177
2189
|
var h;
|
|
2178
|
-
t.contextMenu && (
|
|
2190
|
+
t.contextMenu && (W.value = c.data, (h = ae.value) == null || h.show(c.originalEvent));
|
|
2179
2191
|
}
|
|
2180
|
-
function
|
|
2181
|
-
var
|
|
2182
|
-
t.contextMenu && (c.preventDefault(),
|
|
2192
|
+
function Ne(c, h) {
|
|
2193
|
+
var G;
|
|
2194
|
+
t.contextMenu && (c.preventDefault(), W.value = h, (G = ae.value) == null || G.show(c));
|
|
2183
2195
|
}
|
|
2184
|
-
const
|
|
2185
|
-
const c =
|
|
2196
|
+
const Ze = P(() => {
|
|
2197
|
+
const c = W.value;
|
|
2186
2198
|
if (!c) return [];
|
|
2187
2199
|
const h = [
|
|
2188
2200
|
{
|
|
@@ -2191,13 +2203,13 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2191
2203
|
command: () => t.crud.openViewDialog(c)
|
|
2192
2204
|
}
|
|
2193
2205
|
];
|
|
2194
|
-
for (const
|
|
2195
|
-
|
|
2196
|
-
label:
|
|
2197
|
-
icon:
|
|
2198
|
-
class:
|
|
2199
|
-
disabled:
|
|
2200
|
-
command: () => de(
|
|
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)
|
|
2201
2213
|
});
|
|
2202
2214
|
return t.showPrint && h.push({
|
|
2203
2215
|
label: "Imprimir",
|
|
@@ -2206,28 +2218,28 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2206
2218
|
}), t.exportCsv && (h.push({ separator: !0 }), h.push({
|
|
2207
2219
|
label: t.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)",
|
|
2208
2220
|
icon: "pi pi-download",
|
|
2209
|
-
command: () =>
|
|
2221
|
+
command: () => Ve()
|
|
2210
2222
|
})), h;
|
|
2211
2223
|
});
|
|
2212
|
-
function
|
|
2213
|
-
|
|
2224
|
+
function Le() {
|
|
2225
|
+
W.value && n("print", W.value);
|
|
2214
2226
|
}
|
|
2215
|
-
const
|
|
2216
|
-
async function
|
|
2217
|
-
if (!
|
|
2218
|
-
|
|
2227
|
+
const Ce = U(!1);
|
|
2228
|
+
async function Ve() {
|
|
2229
|
+
if (!Ce.value) {
|
|
2230
|
+
Ce.value = !0;
|
|
2219
2231
|
try {
|
|
2220
|
-
const c = t.csvScope === "page" ? t.crud.items.value : await t.crud.fetchAll(t.csvPageSize), h = ha(c,
|
|
2232
|
+
const c = t.csvScope === "page" ? t.crud.items.value : await t.crud.fetchAll(t.csvPageSize), h = ha(c, L.value);
|
|
2221
2233
|
ya(h, t.csvFilename);
|
|
2222
2234
|
} finally {
|
|
2223
|
-
|
|
2235
|
+
Ce.value = !1;
|
|
2224
2236
|
}
|
|
2225
2237
|
}
|
|
2226
2238
|
}
|
|
2227
|
-
return
|
|
2228
|
-
|
|
2239
|
+
return ot(() => {
|
|
2240
|
+
Y(), t.autoInit && t.crud.init();
|
|
2229
2241
|
}), (c, h) => {
|
|
2230
|
-
const
|
|
2242
|
+
const G = vt("tooltip");
|
|
2231
2243
|
return o(), d("div", ga, [
|
|
2232
2244
|
e.showHeader ? (o(), d("div", ba, [
|
|
2233
2245
|
m("div", wa, [
|
|
@@ -2235,8 +2247,8 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2235
2247
|
e.subtitle ? (o(), d("p", $a, I(e.subtitle), 1)) : b("", !0)
|
|
2236
2248
|
]),
|
|
2237
2249
|
m("div", xa, [
|
|
2238
|
-
|
|
2239
|
-
|
|
2250
|
+
B(c.$slots, "header-actions"),
|
|
2251
|
+
pe.value && !e.actionRail ? (o(), C(r(N), {
|
|
2240
2252
|
key: 0,
|
|
2241
2253
|
label: "Novo",
|
|
2242
2254
|
icon: "pi pi-plus",
|
|
@@ -2244,10 +2256,10 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2244
2256
|
})) : b("", !0)
|
|
2245
2257
|
])
|
|
2246
2258
|
])) : b("", !0),
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
(o(!0), d(
|
|
2250
|
-
key:
|
|
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,
|
|
2251
2263
|
class: "w-crud-kpi"
|
|
2252
2264
|
}, [
|
|
2253
2265
|
m("div", {
|
|
@@ -2255,7 +2267,7 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2255
2267
|
}, [
|
|
2256
2268
|
m("i", {
|
|
2257
2269
|
class: Q([s.icon]),
|
|
2258
|
-
style:
|
|
2270
|
+
style: ke(s.color ? `color: ${s.color}` : "")
|
|
2259
2271
|
}, null, 6)
|
|
2260
2272
|
], 2),
|
|
2261
2273
|
m("div", Va, [
|
|
@@ -2269,48 +2281,48 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2269
2281
|
class: Q(["w-crud-content", { "w-crud-content--rail": e.actionRail }])
|
|
2270
2282
|
}, [
|
|
2271
2283
|
m("div", Ea, [
|
|
2272
|
-
|
|
2273
|
-
(o(!0), d(
|
|
2274
|
-
var
|
|
2275
|
-
return o(), d(
|
|
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, {
|
|
2276
2288
|
key: s.field
|
|
2277
2289
|
}, [
|
|
2278
|
-
(((
|
|
2290
|
+
(((M = s.filter) == null ? void 0 : M.type) || "text") === "text" ? (o(), C(r(ye), {
|
|
2279
2291
|
key: 0,
|
|
2280
|
-
"model-value": e.crud.columnFilters[
|
|
2281
|
-
placeholder: ((
|
|
2292
|
+
"model-value": e.crud.columnFilters[j(s)] ?? "",
|
|
2293
|
+
placeholder: ((q = s.filter) == null ? void 0 : q.placeholder) || s.header,
|
|
2282
2294
|
size: "small",
|
|
2283
|
-
onInput: (Se) =>
|
|
2284
|
-
}, null, 8, ["model-value", "placeholder", "onInput"])) : ((
|
|
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), {
|
|
2285
2297
|
key: 1,
|
|
2286
|
-
"model-value": e.crud.columnFilters[
|
|
2287
|
-
options: (
|
|
2298
|
+
"model-value": e.crud.columnFilters[j(s)],
|
|
2299
|
+
options: (xe = s.filter) == null ? void 0 : xe.options,
|
|
2288
2300
|
"option-label": "label",
|
|
2289
2301
|
"option-value": "value",
|
|
2290
|
-
placeholder: ((
|
|
2302
|
+
placeholder: ((Ae = s.filter) == null ? void 0 : Ae.placeholder) || s.header,
|
|
2291
2303
|
"show-clear": "",
|
|
2292
2304
|
size: "small",
|
|
2293
|
-
"onUpdate:modelValue": (Se) => e.crud.setColumnFilter(
|
|
2294
|
-
}, null, 8, ["model-value", "options", "placeholder", "onUpdate:modelValue"])) : ((
|
|
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), {
|
|
2295
2307
|
key: 2,
|
|
2296
|
-
"model-value": e.crud.columnFilters[
|
|
2297
|
-
options:
|
|
2308
|
+
"model-value": e.crud.columnFilters[j(s)],
|
|
2309
|
+
options: te,
|
|
2298
2310
|
"option-label": "label",
|
|
2299
2311
|
"option-value": "value",
|
|
2300
|
-
placeholder: ((
|
|
2312
|
+
placeholder: ((Oe = s.filter) == null ? void 0 : Oe.placeholder) || s.header,
|
|
2301
2313
|
"show-clear": "",
|
|
2302
2314
|
size: "small",
|
|
2303
|
-
"onUpdate:modelValue": (Se) => e.crud.setColumnFilter(
|
|
2304
|
-
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])) : ((
|
|
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), {
|
|
2305
2317
|
key: 3,
|
|
2306
|
-
"model-value": e.crud.columnFilters[
|
|
2307
|
-
placeholder: ((
|
|
2318
|
+
"model-value": e.crud.columnFilters[j(s)] ?? null,
|
|
2319
|
+
placeholder: ((je = s.filter) == null ? void 0 : je.placeholder) || s.header,
|
|
2308
2320
|
size: "small",
|
|
2309
|
-
"onUpdate:modelValue": (Se) => e.crud.setColumnFilter(
|
|
2321
|
+
"onUpdate:modelValue": (Se) => e.crud.setColumnFilter(j(s), Se)
|
|
2310
2322
|
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"])) : b("", !0)
|
|
2311
2323
|
], 64);
|
|
2312
2324
|
}), 128)),
|
|
2313
|
-
Object.keys(e.crud.columnFilters).length ? (o(), C(r(
|
|
2325
|
+
Object.keys(e.crud.columnFilters).length ? (o(), C(r(N), {
|
|
2314
2326
|
key: 0,
|
|
2315
2327
|
label: "Limpar filtros",
|
|
2316
2328
|
icon: "pi pi-filter-slash",
|
|
@@ -2320,23 +2332,23 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2320
2332
|
})) : b("", !0)
|
|
2321
2333
|
])) : b("", !0),
|
|
2322
2334
|
D.value === "table" ? (o(), d("div", Fa, [
|
|
2323
|
-
|
|
2335
|
+
me.value && e.crud.selectedItems.value.length ? (o(), d("div", Ia, [
|
|
2324
2336
|
m("span", Ra, I(e.crud.selectedItems.value.length) + " selecionado(s) ", 1),
|
|
2325
|
-
|
|
2337
|
+
B(c.$slots, "bulk-actions", {
|
|
2326
2338
|
selected: e.crud.selectedItems.value,
|
|
2327
2339
|
crud: e.crud
|
|
2328
2340
|
}, () => [
|
|
2329
|
-
(o(!0), d(
|
|
2341
|
+
(o(!0), d(J, null, oe(e.crud.config.bulkActions || [], (s) => (o(), C(r(N), {
|
|
2330
2342
|
key: s.action,
|
|
2331
2343
|
label: s.label,
|
|
2332
2344
|
icon: s.icon,
|
|
2333
2345
|
severity: s.severity,
|
|
2334
2346
|
size: "small",
|
|
2335
2347
|
disabled: s.disabled ? s.disabled(e.crud.selectedItems.value) : !1,
|
|
2336
|
-
onClick: (
|
|
2348
|
+
onClick: (M) => s.handler(e.crud.selectedItems.value)
|
|
2337
2349
|
}, null, 8, ["label", "icon", "severity", "disabled", "onClick"]))), 128))
|
|
2338
2350
|
]),
|
|
2339
|
-
|
|
2351
|
+
he(S(r(N), {
|
|
2340
2352
|
icon: "pi pi-times",
|
|
2341
2353
|
text: "",
|
|
2342
2354
|
rounded: "",
|
|
@@ -2344,14 +2356,14 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2344
2356
|
onClick: h[2] || (h[2] = (s) => e.crud.clearSelection())
|
|
2345
2357
|
}, null, 512), [
|
|
2346
2358
|
[
|
|
2347
|
-
|
|
2359
|
+
G,
|
|
2348
2360
|
"Limpar seleção",
|
|
2349
2361
|
void 0,
|
|
2350
2362
|
{ top: !0 }
|
|
2351
2363
|
]
|
|
2352
2364
|
])
|
|
2353
2365
|
])) : b("", !0),
|
|
2354
|
-
S(r(
|
|
2366
|
+
S(r(pt), {
|
|
2355
2367
|
"expanded-rows": $.value,
|
|
2356
2368
|
"onUpdate:expandedRows": h[7] || (h[7] = (s) => $.value = s),
|
|
2357
2369
|
value: e.crud.items.value,
|
|
@@ -2370,27 +2382,27 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2370
2382
|
"sort-field": e.crud.sort.field ?? void 0,
|
|
2371
2383
|
"sort-order": e.crud.sort.order,
|
|
2372
2384
|
"data-key": e.crud.config.pk || "id",
|
|
2373
|
-
"edit-mode":
|
|
2374
|
-
selection:
|
|
2375
|
-
"selection-mode":
|
|
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,
|
|
2376
2388
|
"context-menu": e.contextMenu,
|
|
2377
|
-
"context-menu-selection": e.contextMenu ?
|
|
2378
|
-
"onUpdate:selection": h[8] || (h[8] = (s) =>
|
|
2379
|
-
"onUpdate:contextMenuSelection": h[9] || (h[9] = (s) =>
|
|
2380
|
-
onRowContextmenu:
|
|
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,
|
|
2381
2393
|
onPage: e.crud.onPage,
|
|
2382
2394
|
onSort: h[10] || (h[10] = (s) => e.crud.onSort({ sortField: s.sortField, sortOrder: s.sortOrder })),
|
|
2383
2395
|
onRowExpand: h[11] || (h[11] = (s) => n("row-expand", s.data)),
|
|
2384
2396
|
onRowCollapse: h[12] || (h[12] = (s) => n("row-collapse", s.data)),
|
|
2385
|
-
onCellEditComplete:
|
|
2386
|
-
},
|
|
2397
|
+
onCellEditComplete: l
|
|
2398
|
+
}, Ge({
|
|
2387
2399
|
header: K(() => [
|
|
2388
2400
|
m("div", Ma, [
|
|
2389
2401
|
m("div", Aa, [
|
|
2390
|
-
e.showSearch ? (o(), C(r(
|
|
2402
|
+
e.showSearch ? (o(), C(r(Ue), { key: 0 }, {
|
|
2391
2403
|
default: K(() => [
|
|
2392
|
-
S(r(
|
|
2393
|
-
S(r(
|
|
2404
|
+
S(r(Be), { class: "pi pi-search" }),
|
|
2405
|
+
S(r(ye), {
|
|
2394
2406
|
"model-value": e.crud.search.value,
|
|
2395
2407
|
placeholder: "Buscar...",
|
|
2396
2408
|
class: "w-72",
|
|
@@ -2399,35 +2411,35 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2399
2411
|
]),
|
|
2400
2412
|
_: 1
|
|
2401
2413
|
})) : b("", !0),
|
|
2402
|
-
|
|
2403
|
-
|
|
2414
|
+
B(c.$slots, "toolbar-start"),
|
|
2415
|
+
B(c.$slots, "toolbar-filters")
|
|
2404
2416
|
]),
|
|
2405
2417
|
m("div", Ua, [
|
|
2406
|
-
|
|
2407
|
-
e.persistState ? (o(), d(
|
|
2408
|
-
|
|
2418
|
+
B(c.$slots, "toolbar-actions"),
|
|
2419
|
+
e.persistState ? (o(), d(J, { key: 0 }, [
|
|
2420
|
+
he(S(r(N), {
|
|
2409
2421
|
icon: "pi pi-sliders-h",
|
|
2410
2422
|
text: "",
|
|
2411
2423
|
size: "small",
|
|
2412
2424
|
onClick: h[3] || (h[3] = (s) => {
|
|
2413
|
-
var
|
|
2414
|
-
return (
|
|
2425
|
+
var M;
|
|
2426
|
+
return (M = H.value) == null ? void 0 : M.toggle(s);
|
|
2415
2427
|
})
|
|
2416
2428
|
}, null, 512), [
|
|
2417
2429
|
[
|
|
2418
|
-
|
|
2430
|
+
G,
|
|
2419
2431
|
"Colunas",
|
|
2420
2432
|
void 0,
|
|
2421
2433
|
{ top: !0 }
|
|
2422
2434
|
]
|
|
2423
2435
|
]),
|
|
2424
|
-
S(r(
|
|
2436
|
+
S(r(ht), {
|
|
2425
2437
|
ref_key: "chooser",
|
|
2426
|
-
ref:
|
|
2438
|
+
ref: H
|
|
2427
2439
|
}, {
|
|
2428
2440
|
default: K(() => [
|
|
2429
2441
|
m("div", Ba, [
|
|
2430
|
-
(o(!0), d(
|
|
2442
|
+
(o(!0), d(J, null, oe(F.value, (s) => (o(), d("div", {
|
|
2431
2443
|
key: s.field,
|
|
2432
2444
|
style: { display: "flex", "align-items": "center", gap: "0.5rem" }
|
|
2433
2445
|
}, [
|
|
@@ -2435,7 +2447,7 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2435
2447
|
"model-value": !w.hidden.includes(s.field),
|
|
2436
2448
|
"input-id": `wcrud-col-${s.field}`,
|
|
2437
2449
|
binary: "",
|
|
2438
|
-
"onUpdate:modelValue": (
|
|
2450
|
+
"onUpdate:modelValue": (M) => A(s.field, !!M)
|
|
2439
2451
|
}, null, 8, ["model-value", "input-id", "onUpdate:modelValue"]),
|
|
2440
2452
|
m("label", {
|
|
2441
2453
|
for: `wcrud-col-${s.field}`,
|
|
@@ -2447,30 +2459,30 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2447
2459
|
_: 1
|
|
2448
2460
|
}, 512)
|
|
2449
2461
|
], 64)) : b("", !0),
|
|
2450
|
-
e.exportCsv ?
|
|
2462
|
+
e.exportCsv ? he((o(), C(r(N), {
|
|
2451
2463
|
key: 1,
|
|
2452
2464
|
icon: "pi pi-download",
|
|
2453
2465
|
text: "",
|
|
2454
2466
|
size: "small",
|
|
2455
|
-
loading:
|
|
2456
|
-
onClick:
|
|
2467
|
+
loading: Ce.value,
|
|
2468
|
+
onClick: Ve
|
|
2457
2469
|
}, null, 8, ["loading"])), [
|
|
2458
2470
|
[
|
|
2459
|
-
|
|
2471
|
+
G,
|
|
2460
2472
|
e.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)",
|
|
2461
2473
|
void 0,
|
|
2462
2474
|
{ top: !0 }
|
|
2463
2475
|
]
|
|
2464
2476
|
]) : b("", !0),
|
|
2465
2477
|
e.viewToggle ? (o(), d("div", Na, [
|
|
2466
|
-
S(r(
|
|
2478
|
+
S(r(N), {
|
|
2467
2479
|
icon: "pi pi-table",
|
|
2468
2480
|
size: "small",
|
|
2469
2481
|
text: !x("table"),
|
|
2470
2482
|
outlined: x("table"),
|
|
2471
2483
|
onClick: h[4] || (h[4] = (s) => E("table"))
|
|
2472
2484
|
}, null, 8, ["text", "outlined"]),
|
|
2473
|
-
S(r(
|
|
2485
|
+
S(r(N), {
|
|
2474
2486
|
icon: "pi pi-th-large",
|
|
2475
2487
|
size: "small",
|
|
2476
2488
|
text: !x("cards"),
|
|
@@ -2478,7 +2490,7 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2478
2490
|
onClick: h[5] || (h[5] = (s) => E("cards"))
|
|
2479
2491
|
}, null, 8, ["text", "outlined"])
|
|
2480
2492
|
])) : b("", !0),
|
|
2481
|
-
!e.showHeader &&
|
|
2493
|
+
!e.showHeader && pe.value && !e.actionRail ? (o(), C(r(N), {
|
|
2482
2494
|
key: 3,
|
|
2483
2495
|
label: "Novo",
|
|
2484
2496
|
icon: "pi pi-plus",
|
|
@@ -2488,8 +2500,8 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2488
2500
|
])
|
|
2489
2501
|
]),
|
|
2490
2502
|
empty: K(() => [
|
|
2491
|
-
|
|
2492
|
-
h[
|
|
2503
|
+
B(c.$slots, "empty", {}, () => [
|
|
2504
|
+
h[22] || (h[22] = m("div", { class: "w-crud-empty" }, [
|
|
2493
2505
|
m("div", { class: "w-crud-empty-icon" }, [
|
|
2494
2506
|
m("i", { class: "pi pi-inbox" })
|
|
2495
2507
|
]),
|
|
@@ -2499,57 +2511,57 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2499
2511
|
])
|
|
2500
2512
|
]),
|
|
2501
2513
|
default: K(() => [
|
|
2502
|
-
|
|
2514
|
+
me.value ? (o(), C(r(Me), {
|
|
2503
2515
|
key: 0,
|
|
2504
2516
|
"selection-mode": "multiple",
|
|
2505
2517
|
style: { width: "3rem" }
|
|
2506
2518
|
})) : b("", !0),
|
|
2507
|
-
e.expandable ? (o(), C(r(
|
|
2519
|
+
e.expandable ? (o(), C(r(Me), {
|
|
2508
2520
|
key: 1,
|
|
2509
2521
|
expander: "",
|
|
2510
2522
|
style: { width: "3rem" }
|
|
2511
2523
|
})) : b("", !0),
|
|
2512
|
-
(o(!0), d(
|
|
2524
|
+
(o(!0), d(J, null, oe(L.value, (s) => (o(), C(r(Me), {
|
|
2513
2525
|
key: s.field,
|
|
2514
2526
|
field: s.field,
|
|
2515
2527
|
header: s.header,
|
|
2516
2528
|
sortable: s.sortable,
|
|
2517
|
-
style:
|
|
2529
|
+
style: ke(s.style),
|
|
2518
2530
|
"header-class": V(s),
|
|
2519
2531
|
"body-class": V(s)
|
|
2520
|
-
},
|
|
2521
|
-
body: K(({ data:
|
|
2522
|
-
|
|
2523
|
-
data:
|
|
2524
|
-
value:
|
|
2532
|
+
}, Ge({
|
|
2533
|
+
body: K(({ data: M }) => [
|
|
2534
|
+
B(c.$slots, `column-${s.field}`, {
|
|
2535
|
+
data: M,
|
|
2536
|
+
value: M[s.field]
|
|
2525
2537
|
}, () => [
|
|
2526
|
-
S(
|
|
2538
|
+
S(at, {
|
|
2527
2539
|
column: s,
|
|
2528
|
-
value:
|
|
2529
|
-
"row-data":
|
|
2540
|
+
value: M[s.field],
|
|
2541
|
+
"row-data": M
|
|
2530
2542
|
}, null, 8, ["column", "value", "row-data"])
|
|
2531
2543
|
])
|
|
2532
2544
|
]),
|
|
2533
2545
|
_: 2
|
|
2534
2546
|
}, [
|
|
2535
|
-
|
|
2547
|
+
$e.value && g(s.field) ? {
|
|
2536
2548
|
name: "editor",
|
|
2537
|
-
fn: K(({ data:
|
|
2538
|
-
var
|
|
2549
|
+
fn: K(({ data: M }) => {
|
|
2550
|
+
var q;
|
|
2539
2551
|
return [
|
|
2540
|
-
["number", "currency"].includes(((
|
|
2552
|
+
["number", "currency"].includes(((q = g(s.field)) == null ? void 0 : q.type) || "") ? (o(), C(r(Je), {
|
|
2541
2553
|
key: 0,
|
|
2542
|
-
"model-value":
|
|
2554
|
+
"model-value": M[s.field] ?? null,
|
|
2543
2555
|
fluid: "",
|
|
2544
|
-
"onUpdate:modelValue": (
|
|
2545
|
-
|
|
2556
|
+
"onUpdate:modelValue": (fe) => {
|
|
2557
|
+
M[s.field] = fe;
|
|
2546
2558
|
}
|
|
2547
|
-
}, null, 8, ["model-value", "onUpdate:modelValue"])) : (o(), C(r(
|
|
2559
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])) : (o(), C(r(ye), {
|
|
2548
2560
|
key: 1,
|
|
2549
|
-
"model-value":
|
|
2561
|
+
"model-value": M[s.field] ?? "",
|
|
2550
2562
|
fluid: "",
|
|
2551
|
-
"onUpdate:modelValue": (
|
|
2552
|
-
|
|
2563
|
+
"onUpdate:modelValue": (fe) => {
|
|
2564
|
+
M[s.field] = fe;
|
|
2553
2565
|
}
|
|
2554
2566
|
}, null, 8, ["model-value", "onUpdate:modelValue"]))
|
|
2555
2567
|
];
|
|
@@ -2557,37 +2569,37 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2557
2569
|
key: "0"
|
|
2558
2570
|
} : void 0
|
|
2559
2571
|
]), 1032, ["field", "header", "sortable", "style", "header-class", "body-class"]))), 128)),
|
|
2560
|
-
De.value && !e.actionRail ? (o(), C(r(
|
|
2572
|
+
De.value && !e.actionRail ? (o(), C(r(Me), {
|
|
2561
2573
|
key: 2,
|
|
2562
2574
|
"header-class": "w-crud-actions-header",
|
|
2563
|
-
style:
|
|
2564
|
-
width: `${(
|
|
2575
|
+
style: ke({
|
|
2576
|
+
width: `${(ve.value.length + (r(i)["row-actions"] ? 1 : 0)) * 2.5 + 1}rem`
|
|
2565
2577
|
})
|
|
2566
2578
|
}, {
|
|
2567
2579
|
body: K(({ data: s }) => [
|
|
2568
2580
|
m("div", La, [
|
|
2569
|
-
(o(!0), d(
|
|
2570
|
-
key:
|
|
2581
|
+
(o(!0), d(J, null, oe(ve.value, (M) => (o(), d(J, {
|
|
2582
|
+
key: M.action
|
|
2571
2583
|
}, [
|
|
2572
|
-
|
|
2584
|
+
we(M, s) ? he((o(), C(r(N), {
|
|
2573
2585
|
key: 0,
|
|
2574
|
-
icon:
|
|
2586
|
+
icon: M.icon,
|
|
2575
2587
|
text: "",
|
|
2576
2588
|
rounded: "",
|
|
2577
2589
|
size: "small",
|
|
2578
|
-
severity:
|
|
2579
|
-
disabled:
|
|
2580
|
-
onClick: (
|
|
2590
|
+
severity: M.severity,
|
|
2591
|
+
disabled: ue(M, s),
|
|
2592
|
+
onClick: (q) => de(M, s)
|
|
2581
2593
|
}, null, 8, ["icon", "severity", "disabled", "onClick"])), [
|
|
2582
2594
|
[
|
|
2583
|
-
|
|
2584
|
-
|
|
2595
|
+
G,
|
|
2596
|
+
M.tooltip,
|
|
2585
2597
|
void 0,
|
|
2586
2598
|
{ top: !0 }
|
|
2587
2599
|
]
|
|
2588
2600
|
]) : b("", !0)
|
|
2589
2601
|
], 64))), 128)),
|
|
2590
|
-
|
|
2602
|
+
B(c.$slots, "row-actions", {
|
|
2591
2603
|
data: s,
|
|
2592
2604
|
crud: e.crud
|
|
2593
2605
|
})
|
|
@@ -2601,7 +2613,7 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2601
2613
|
e.expandable ? {
|
|
2602
2614
|
name: "expansion",
|
|
2603
2615
|
fn: K((s) => [
|
|
2604
|
-
|
|
2616
|
+
B(c.$slots, "expansion", {
|
|
2605
2617
|
data: s.data
|
|
2606
2618
|
})
|
|
2607
2619
|
]),
|
|
@@ -2611,10 +2623,10 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2611
2623
|
])) : (o(), d("div", za, [
|
|
2612
2624
|
m("div", Oa, [
|
|
2613
2625
|
m("div", Wa, [
|
|
2614
|
-
e.showSearch ? (o(), C(r(
|
|
2626
|
+
e.showSearch ? (o(), C(r(Ue), { key: 0 }, {
|
|
2615
2627
|
default: K(() => [
|
|
2616
|
-
S(r(
|
|
2617
|
-
S(r(
|
|
2628
|
+
S(r(Be), { class: "pi pi-search" }),
|
|
2629
|
+
S(r(ye), {
|
|
2618
2630
|
"model-value": e.crud.search.value,
|
|
2619
2631
|
placeholder: "Buscar...",
|
|
2620
2632
|
class: "w-72",
|
|
@@ -2623,35 +2635,35 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2623
2635
|
]),
|
|
2624
2636
|
_: 1
|
|
2625
2637
|
})) : b("", !0),
|
|
2626
|
-
|
|
2627
|
-
|
|
2638
|
+
B(c.$slots, "toolbar-start"),
|
|
2639
|
+
B(c.$slots, "toolbar-filters")
|
|
2628
2640
|
]),
|
|
2629
2641
|
m("div", ja, [
|
|
2630
|
-
|
|
2631
|
-
e.exportCsv ?
|
|
2642
|
+
B(c.$slots, "toolbar-actions"),
|
|
2643
|
+
e.exportCsv ? he((o(), C(r(N), {
|
|
2632
2644
|
key: 0,
|
|
2633
2645
|
icon: "pi pi-download",
|
|
2634
2646
|
text: "",
|
|
2635
2647
|
size: "small",
|
|
2636
|
-
loading:
|
|
2637
|
-
onClick:
|
|
2648
|
+
loading: Ce.value,
|
|
2649
|
+
onClick: Ve
|
|
2638
2650
|
}, null, 8, ["loading"])), [
|
|
2639
2651
|
[
|
|
2640
|
-
|
|
2652
|
+
G,
|
|
2641
2653
|
e.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)",
|
|
2642
2654
|
void 0,
|
|
2643
2655
|
{ top: !0 }
|
|
2644
2656
|
]
|
|
2645
2657
|
]) : b("", !0),
|
|
2646
2658
|
e.viewToggle ? (o(), d("div", qa, [
|
|
2647
|
-
S(r(
|
|
2659
|
+
S(r(N), {
|
|
2648
2660
|
icon: "pi pi-table",
|
|
2649
2661
|
size: "small",
|
|
2650
2662
|
text: !x("table"),
|
|
2651
2663
|
outlined: x("table"),
|
|
2652
2664
|
onClick: h[13] || (h[13] = (s) => E("table"))
|
|
2653
2665
|
}, null, 8, ["text", "outlined"]),
|
|
2654
|
-
S(r(
|
|
2666
|
+
S(r(N), {
|
|
2655
2667
|
icon: "pi pi-th-large",
|
|
2656
2668
|
size: "small",
|
|
2657
2669
|
text: !x("cards"),
|
|
@@ -2659,7 +2671,7 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2659
2671
|
onClick: h[14] || (h[14] = (s) => E("cards"))
|
|
2660
2672
|
}, null, 8, ["text", "outlined"])
|
|
2661
2673
|
])) : b("", !0),
|
|
2662
|
-
!e.showHeader &&
|
|
2674
|
+
!e.showHeader && pe.value && !e.actionRail ? (o(), C(r(N), {
|
|
2663
2675
|
key: 2,
|
|
2664
2676
|
label: "Novo",
|
|
2665
2677
|
icon: "pi pi-plus",
|
|
@@ -2667,30 +2679,30 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2667
2679
|
})) : b("", !0)
|
|
2668
2680
|
])
|
|
2669
2681
|
]),
|
|
2670
|
-
e.crud.loading.value ? (o(), d("div", Ka, [...h[
|
|
2682
|
+
e.crud.loading.value ? (o(), d("div", Ka, [...h[23] || (h[23] = [
|
|
2671
2683
|
m("i", { class: "pi pi-spin pi-spinner" }, null, -1)
|
|
2672
2684
|
])])) : e.crud.items.value.length ? (o(), d("div", Ha, [
|
|
2673
|
-
(o(!0), d(
|
|
2674
|
-
key: s[e.crud.config.pk || "id"] ??
|
|
2675
|
-
class: Q(["w-crud-card", { "w-crud-card--selected":
|
|
2676
|
-
onClick: (
|
|
2677
|
-
onDblclick: (
|
|
2678
|
-
onContextmenu: (
|
|
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)
|
|
2679
2691
|
}, [
|
|
2680
2692
|
m("div", Ya, [
|
|
2681
|
-
(o(!0), d(
|
|
2682
|
-
key:
|
|
2683
|
-
class: Q(["w-crud-card-row", { "w-crud-card-row--title":
|
|
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 }])
|
|
2684
2696
|
}, [
|
|
2685
|
-
|
|
2697
|
+
fe !== 0 ? (o(), d("span", Ja, I(q.header), 1)) : b("", !0),
|
|
2686
2698
|
m("span", Xa, [
|
|
2687
|
-
|
|
2699
|
+
B(c.$slots, `column-${q.field}`, {
|
|
2688
2700
|
data: s,
|
|
2689
|
-
value: s[
|
|
2701
|
+
value: s[q.field]
|
|
2690
2702
|
}, () => [
|
|
2691
|
-
S(
|
|
2692
|
-
column:
|
|
2693
|
-
value: s[
|
|
2703
|
+
S(at, {
|
|
2704
|
+
column: q,
|
|
2705
|
+
value: s[q.field],
|
|
2694
2706
|
"row-data": s
|
|
2695
2707
|
}, null, 8, ["column", "value", "row-data"])
|
|
2696
2708
|
])
|
|
@@ -2698,35 +2710,35 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2698
2710
|
], 2))), 128))
|
|
2699
2711
|
]),
|
|
2700
2712
|
De.value && !e.actionRail ? (o(), d("div", Za, [
|
|
2701
|
-
(o(!0), d(
|
|
2702
|
-
key:
|
|
2713
|
+
(o(!0), d(J, null, oe(ve.value, (q) => (o(), d(J, {
|
|
2714
|
+
key: q.action
|
|
2703
2715
|
}, [
|
|
2704
|
-
|
|
2716
|
+
we(q, s) ? he((o(), C(r(N), {
|
|
2705
2717
|
key: 0,
|
|
2706
|
-
icon:
|
|
2718
|
+
icon: q.icon,
|
|
2707
2719
|
text: "",
|
|
2708
2720
|
rounded: "",
|
|
2709
2721
|
size: "small",
|
|
2710
|
-
severity:
|
|
2711
|
-
disabled:
|
|
2712
|
-
onClick: (
|
|
2722
|
+
severity: q.severity,
|
|
2723
|
+
disabled: ue(q, s),
|
|
2724
|
+
onClick: (fe) => de(q, s)
|
|
2713
2725
|
}, null, 8, ["icon", "severity", "disabled", "onClick"])), [
|
|
2714
2726
|
[
|
|
2715
|
-
|
|
2716
|
-
|
|
2727
|
+
G,
|
|
2728
|
+
q.tooltip,
|
|
2717
2729
|
void 0,
|
|
2718
2730
|
{ top: !0 }
|
|
2719
2731
|
]
|
|
2720
2732
|
]) : b("", !0)
|
|
2721
2733
|
], 64))), 128)),
|
|
2722
|
-
|
|
2734
|
+
B(c.$slots, "row-actions", {
|
|
2723
2735
|
data: s,
|
|
2724
2736
|
crud: e.crud
|
|
2725
2737
|
})
|
|
2726
2738
|
])) : b("", !0)
|
|
2727
2739
|
], 42, Ga))), 128))
|
|
2728
|
-
])) :
|
|
2729
|
-
h[
|
|
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))
|
|
2730
2742
|
], void 0, 1),
|
|
2731
2743
|
e.crud.items.value.length ? (o(), C(r(At), {
|
|
2732
2744
|
key: 3,
|
|
@@ -2742,70 +2754,70 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2742
2754
|
]))
|
|
2743
2755
|
]),
|
|
2744
2756
|
e.actionRail ? (o(), d("aside", Qa, [
|
|
2745
|
-
|
|
2757
|
+
pe.value ? he((o(), C(r(N), {
|
|
2746
2758
|
key: 0,
|
|
2747
2759
|
icon: "pi pi-plus",
|
|
2748
2760
|
rounded: "",
|
|
2749
2761
|
onClick: h[16] || (h[16] = (s) => e.crud.openCreateDialog())
|
|
2750
2762
|
}, null, 512)), [
|
|
2751
2763
|
[
|
|
2752
|
-
|
|
2764
|
+
G,
|
|
2753
2765
|
"Novo",
|
|
2754
2766
|
void 0,
|
|
2755
2767
|
{ left: !0 }
|
|
2756
2768
|
]
|
|
2757
2769
|
]) : b("", !0),
|
|
2758
|
-
|
|
2759
|
-
(o(!0), d(
|
|
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, {
|
|
2760
2772
|
key: s.action
|
|
2761
2773
|
}, [
|
|
2762
|
-
!
|
|
2774
|
+
!W.value || we(s, W.value) ? he((o(), C(r(N), {
|
|
2763
2775
|
key: 0,
|
|
2764
2776
|
icon: s.icon,
|
|
2765
2777
|
text: "",
|
|
2766
2778
|
rounded: "",
|
|
2767
2779
|
severity: s.severity,
|
|
2768
|
-
disabled: !
|
|
2769
|
-
onClick: (
|
|
2780
|
+
disabled: !W.value || ue(s, W.value),
|
|
2781
|
+
onClick: (M) => W.value && de(s, W.value)
|
|
2770
2782
|
}, null, 8, ["icon", "severity", "disabled", "onClick"])), [
|
|
2771
2783
|
[
|
|
2772
|
-
|
|
2784
|
+
G,
|
|
2773
2785
|
s.tooltip,
|
|
2774
2786
|
void 0,
|
|
2775
2787
|
{ left: !0 }
|
|
2776
2788
|
]
|
|
2777
2789
|
]) : b("", !0)
|
|
2778
2790
|
], 64))), 128)),
|
|
2779
|
-
|
|
2780
|
-
selected:
|
|
2791
|
+
B(c.$slots, "rail-actions", {
|
|
2792
|
+
selected: W.value,
|
|
2781
2793
|
crud: e.crud
|
|
2782
2794
|
}),
|
|
2783
2795
|
e.showPrint || e.exportCsv ? (o(), d("div", eo)) : b("", !0),
|
|
2784
|
-
e.showPrint ?
|
|
2796
|
+
e.showPrint ? he((o(), C(r(N), {
|
|
2785
2797
|
key: 3,
|
|
2786
2798
|
icon: "pi pi-print",
|
|
2787
2799
|
text: "",
|
|
2788
2800
|
rounded: "",
|
|
2789
|
-
disabled: !
|
|
2790
|
-
onClick:
|
|
2801
|
+
disabled: !W.value,
|
|
2802
|
+
onClick: Le
|
|
2791
2803
|
}, null, 8, ["disabled"])), [
|
|
2792
2804
|
[
|
|
2793
|
-
|
|
2805
|
+
G,
|
|
2794
2806
|
"Imprimir",
|
|
2795
2807
|
void 0,
|
|
2796
2808
|
{ left: !0 }
|
|
2797
2809
|
]
|
|
2798
2810
|
]) : b("", !0),
|
|
2799
|
-
e.exportCsv ?
|
|
2811
|
+
e.exportCsv ? he((o(), C(r(N), {
|
|
2800
2812
|
key: 4,
|
|
2801
2813
|
icon: "pi pi-download",
|
|
2802
2814
|
text: "",
|
|
2803
2815
|
rounded: "",
|
|
2804
|
-
loading:
|
|
2805
|
-
onClick:
|
|
2816
|
+
loading: Ce.value,
|
|
2817
|
+
onClick: Ve
|
|
2806
2818
|
}, null, 8, ["loading"])), [
|
|
2807
2819
|
[
|
|
2808
|
-
|
|
2820
|
+
G,
|
|
2809
2821
|
e.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)",
|
|
2810
2822
|
void 0,
|
|
2811
2823
|
{ left: !0 }
|
|
@@ -2816,16 +2828,16 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2816
2828
|
e.contextMenu ? (o(), C(r(Ut), {
|
|
2817
2829
|
key: 1,
|
|
2818
2830
|
ref_key: "cm",
|
|
2819
|
-
ref:
|
|
2820
|
-
model:
|
|
2831
|
+
ref: ae,
|
|
2832
|
+
model: Ze.value
|
|
2821
2833
|
}, null, 8, ["model"])) : b("", !0),
|
|
2822
|
-
|
|
2834
|
+
B(c.$slots, "form-dialog", {
|
|
2823
2835
|
crud: e.crud,
|
|
2824
2836
|
dialogWidth: e.dialogWidth
|
|
2825
2837
|
}, () => {
|
|
2826
2838
|
var s;
|
|
2827
2839
|
return [
|
|
2828
|
-
S(
|
|
2840
|
+
S($t, {
|
|
2829
2841
|
visible: e.crud.dialogVisible.value,
|
|
2830
2842
|
title: e.crud.dialogTitle.value,
|
|
2831
2843
|
fields: e.crud.config.form,
|
|
@@ -2836,25 +2848,58 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2836
2848
|
width: e.dialogWidth,
|
|
2837
2849
|
"form-columns": e.formColumns ?? e.crud.config.formColumns,
|
|
2838
2850
|
"keyboard-nav": e.crud.config.keyboardNav,
|
|
2839
|
-
"onUpdate:visible": h[17] || (h[17] = (
|
|
2840
|
-
e.crud.dialogVisible.value =
|
|
2851
|
+
"onUpdate:visible": h[17] || (h[17] = (M) => {
|
|
2852
|
+
e.crud.dialogVisible.value = M, M || (e.crud.editingItem.value = null);
|
|
2841
2853
|
}),
|
|
2842
|
-
"onUpdate:field": h[18] || (h[18] = (
|
|
2843
|
-
onSave: h[19] || (h[19] = (
|
|
2844
|
-
},
|
|
2845
|
-
|
|
2846
|
-
name: `field-${
|
|
2847
|
-
fn: K((
|
|
2848
|
-
|
|
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)))
|
|
2849
2861
|
])
|
|
2850
2862
|
}))
|
|
2851
2863
|
]), 1032, ["visible", "title", "fields", "form-data", "is-editing", "saving", "disabled", "width", "form-columns", "keyboard-nav"])
|
|
2852
2864
|
];
|
|
2853
|
-
})
|
|
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)
|
|
2854
2899
|
]);
|
|
2855
2900
|
};
|
|
2856
2901
|
}
|
|
2857
|
-
}), In = /* @__PURE__ */
|
|
2902
|
+
}), In = /* @__PURE__ */ re({
|
|
2858
2903
|
__name: "WDateRange",
|
|
2859
2904
|
props: {
|
|
2860
2905
|
modelValue: { default: null },
|
|
@@ -2870,7 +2915,7 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2870
2915
|
function n(i) {
|
|
2871
2916
|
t("update:modelValue", i ?? null);
|
|
2872
2917
|
}
|
|
2873
|
-
return (i, v) => (o(), C(r(
|
|
2918
|
+
return (i, v) => (o(), C(r(bt), {
|
|
2874
2919
|
"model-value": e.modelValue ?? void 0,
|
|
2875
2920
|
"selection-mode": "range",
|
|
2876
2921
|
placeholder: e.placeholder,
|
|
@@ -2883,7 +2928,7 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2883
2928
|
"onUpdate:modelValue": n
|
|
2884
2929
|
}, null, 8, ["model-value", "placeholder", "min-date", "max-date", "show-button-bar", "disabled"]));
|
|
2885
2930
|
}
|
|
2886
|
-
}), to = /* @__PURE__ */
|
|
2931
|
+
}), to = /* @__PURE__ */ re({
|
|
2887
2932
|
__name: "WStatusTag",
|
|
2888
2933
|
props: {
|
|
2889
2934
|
value: {},
|
|
@@ -2918,7 +2963,7 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2918
2963
|
paga: { label: "Paga", severity: "success" },
|
|
2919
2964
|
inadimplente: { label: "Inadimplente", severity: "danger" }
|
|
2920
2965
|
}, n = P(() => (a.map ?? t)[a.value] ?? { label: a.value, severity: "secondary" });
|
|
2921
|
-
return (i, v) => (o(), C(r(
|
|
2966
|
+
return (i, v) => (o(), C(r(yt), {
|
|
2922
2967
|
value: n.value.label,
|
|
2923
2968
|
severity: n.value.severity
|
|
2924
2969
|
}, null, 8, ["value", "severity"]));
|
|
@@ -2926,7 +2971,7 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2926
2971
|
}), lo = { class: "w-page-header" }, ao = { class: "w-page-header-content" }, oo = { class: "w-page-header-title" }, no = {
|
|
2927
2972
|
key: 0,
|
|
2928
2973
|
class: "w-page-header-subtitle"
|
|
2929
|
-
}, io = { class: "w-page-header-actions" }, Rn = /* @__PURE__ */
|
|
2974
|
+
}, io = { class: "w-page-header-actions" }, Rn = /* @__PURE__ */ re({
|
|
2930
2975
|
__name: "WPageHeader",
|
|
2931
2976
|
props: {
|
|
2932
2977
|
title: {},
|
|
@@ -2943,8 +2988,8 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2943
2988
|
e.subtitle ? (o(), d("p", no, I(e.subtitle), 1)) : b("", !0)
|
|
2944
2989
|
]),
|
|
2945
2990
|
m("div", io, [
|
|
2946
|
-
|
|
2947
|
-
e.actionLabel ? (o(), C(r(
|
|
2991
|
+
B(n.$slots, "actions"),
|
|
2992
|
+
e.actionLabel ? (o(), C(r(N), {
|
|
2948
2993
|
key: 0,
|
|
2949
2994
|
label: e.actionLabel,
|
|
2950
2995
|
icon: e.actionIcon,
|
|
@@ -2956,7 +3001,7 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2956
3001
|
}), so = { class: "w-empty-state" }, ro = { class: "w-empty-state-icon" }, uo = { class: "w-empty-state-title" }, co = {
|
|
2957
3002
|
key: 0,
|
|
2958
3003
|
class: "w-empty-state-description"
|
|
2959
|
-
}, Mn = /* @__PURE__ */
|
|
3004
|
+
}, Mn = /* @__PURE__ */ re({
|
|
2960
3005
|
__name: "WEmptyState",
|
|
2961
3006
|
props: {
|
|
2962
3007
|
icon: {},
|
|
@@ -2976,7 +3021,7 @@ const ga = { class: "w-crud" }, ba = {
|
|
|
2976
3021
|
]),
|
|
2977
3022
|
m("p", uo, I(e.title), 1),
|
|
2978
3023
|
e.description ? (o(), d("p", co, I(e.description), 1)) : b("", !0),
|
|
2979
|
-
e.actionLabel ? (o(), C(r(
|
|
3024
|
+
e.actionLabel ? (o(), C(r(N), {
|
|
2980
3025
|
key: 1,
|
|
2981
3026
|
label: e.actionLabel,
|
|
2982
3027
|
icon: e.actionIcon,
|
|
@@ -3004,12 +3049,12 @@ Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
|
|
|
3004
3049
|
* @license MIT
|
|
3005
3050
|
*/
|
|
3006
3051
|
function fo() {
|
|
3007
|
-
return
|
|
3052
|
+
return ft(mo);
|
|
3008
3053
|
}
|
|
3009
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 = {
|
|
3010
3055
|
key: 0,
|
|
3011
3056
|
class: "w-detail-header-subtitle"
|
|
3012
|
-
}, bo = { class: "w-detail-header-actions" }, An = /* @__PURE__ */
|
|
3057
|
+
}, bo = { class: "w-detail-header-actions" }, An = /* @__PURE__ */ re({
|
|
3013
3058
|
__name: "WDetailHeader",
|
|
3014
3059
|
props: {
|
|
3015
3060
|
title: {},
|
|
@@ -3027,7 +3072,7 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
|
|
|
3027
3072
|
}
|
|
3028
3073
|
return (i, v) => (o(), d("div", vo, [
|
|
3029
3074
|
m("div", po, [
|
|
3030
|
-
S(r(
|
|
3075
|
+
S(r(N), {
|
|
3031
3076
|
icon: "pi pi-arrow-left",
|
|
3032
3077
|
text: "",
|
|
3033
3078
|
rounded: "",
|
|
@@ -3048,21 +3093,21 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
|
|
|
3048
3093
|
}, null, 8, ["value", "map"])) : b("", !0)
|
|
3049
3094
|
]),
|
|
3050
3095
|
m("div", bo, [
|
|
3051
|
-
|
|
3096
|
+
B(i.$slots, "actions")
|
|
3052
3097
|
])
|
|
3053
3098
|
]));
|
|
3054
3099
|
}
|
|
3055
3100
|
}), wo = { class: "w-info-card" }, ko = {
|
|
3056
3101
|
key: 0,
|
|
3057
3102
|
class: "w-info-card-title"
|
|
3058
|
-
}, $o = { class: "w-info-card-grid" }, xo = { class: "w-info-card-label" }, Co = { class: "w-info-card-value" }, Un = /* @__PURE__ */
|
|
3103
|
+
}, $o = { class: "w-info-card-grid" }, xo = { class: "w-info-card-label" }, Co = { class: "w-info-card-value" }, Un = /* @__PURE__ */ re({
|
|
3059
3104
|
__name: "WInfoCard",
|
|
3060
3105
|
props: {
|
|
3061
3106
|
title: {},
|
|
3062
3107
|
fields: {}
|
|
3063
3108
|
},
|
|
3064
3109
|
setup(e) {
|
|
3065
|
-
const { formatCurrency: a, formatDate: t, formatNumber: n } =
|
|
3110
|
+
const { formatCurrency: a, formatDate: t, formatNumber: n } = nt();
|
|
3066
3111
|
function i(v) {
|
|
3067
3112
|
const $ = v.value;
|
|
3068
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($);
|
|
@@ -3070,7 +3115,7 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
|
|
|
3070
3115
|
return (v, $) => (o(), d("div", wo, [
|
|
3071
3116
|
e.title ? (o(), d("h3", ko, I(e.title), 1)) : b("", !0),
|
|
3072
3117
|
m("div", $o, [
|
|
3073
|
-
(o(!0), d(
|
|
3118
|
+
(o(!0), d(J, null, oe(e.fields, (D) => (o(), d("div", {
|
|
3074
3119
|
key: D.label,
|
|
3075
3120
|
class: "w-info-card-field"
|
|
3076
3121
|
}, [
|
|
@@ -3095,7 +3140,7 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
|
|
|
3095
3140
|
}, Ao = {
|
|
3096
3141
|
key: 0,
|
|
3097
3142
|
class: "w-kpi-card__footer"
|
|
3098
|
-
}, Uo = /* @__PURE__ */
|
|
3143
|
+
}, Uo = /* @__PURE__ */ re({
|
|
3099
3144
|
__name: "WKpiCard",
|
|
3100
3145
|
props: {
|
|
3101
3146
|
label: {},
|
|
@@ -3111,28 +3156,28 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
|
|
|
3111
3156
|
class: Q(["w-kpi-card", e.severity ? `w-kpi-card--${e.severity}` : ""])
|
|
3112
3157
|
}, [
|
|
3113
3158
|
e.loading ? (o(), d("div", Vo, [
|
|
3114
|
-
S(r(
|
|
3159
|
+
S(r(qe), {
|
|
3115
3160
|
shape: "circle",
|
|
3116
3161
|
size: "2.75rem"
|
|
3117
3162
|
}),
|
|
3118
3163
|
m("div", So, [
|
|
3119
|
-
S(r(
|
|
3164
|
+
S(r(qe), {
|
|
3120
3165
|
width: "6rem",
|
|
3121
3166
|
height: "0.75rem"
|
|
3122
3167
|
}),
|
|
3123
|
-
S(r(
|
|
3168
|
+
S(r(qe), {
|
|
3124
3169
|
width: "7.5rem",
|
|
3125
3170
|
height: "1.5rem"
|
|
3126
3171
|
}),
|
|
3127
|
-
S(r(
|
|
3172
|
+
S(r(qe), {
|
|
3128
3173
|
width: "5rem",
|
|
3129
3174
|
height: "0.75rem"
|
|
3130
3175
|
})
|
|
3131
3176
|
])
|
|
3132
|
-
])) : (o(), d(
|
|
3177
|
+
])) : (o(), d(J, { key: 1 }, [
|
|
3133
3178
|
m("div", Do, [
|
|
3134
3179
|
e.icon || a.$slots.icon ? (o(), d("div", Eo, [
|
|
3135
|
-
|
|
3180
|
+
B(a.$slots, "icon", {}, () => [
|
|
3136
3181
|
e.icon ? (o(), d("i", {
|
|
3137
3182
|
key: 0,
|
|
3138
3183
|
class: Q(e.icon)
|
|
@@ -3140,7 +3185,7 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
|
|
|
3140
3185
|
])
|
|
3141
3186
|
])) : b("", !0),
|
|
3142
3187
|
e.trend || a.$slots.trend ? (o(), d("div", Po, [
|
|
3143
|
-
|
|
3188
|
+
B(a.$slots, "trend", {}, () => [
|
|
3144
3189
|
e.trend ? (o(), d("span", {
|
|
3145
3190
|
key: 0,
|
|
3146
3191
|
class: Q(["w-kpi-card__trend-badge", e.trend.direction ? `w-kpi-card__trend-badge--${e.trend.direction}` : ""])
|
|
@@ -3151,23 +3196,23 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
|
|
|
3151
3196
|
m("div", Fo, [
|
|
3152
3197
|
m("p", Io, I(e.label), 1),
|
|
3153
3198
|
m("div", Ro, [
|
|
3154
|
-
|
|
3155
|
-
|
|
3199
|
+
B(a.$slots, "value", {}, () => [
|
|
3200
|
+
Fe(I(e.value), 1)
|
|
3156
3201
|
])
|
|
3157
3202
|
]),
|
|
3158
3203
|
e.hint || a.$slots.hint ? (o(), d("p", Mo, [
|
|
3159
|
-
|
|
3160
|
-
|
|
3204
|
+
B(a.$slots, "hint", {}, () => [
|
|
3205
|
+
Fe(I(e.hint), 1)
|
|
3161
3206
|
])
|
|
3162
3207
|
])) : b("", !0)
|
|
3163
3208
|
]),
|
|
3164
3209
|
a.$slots.footer ? (o(), d("footer", Ao, [
|
|
3165
|
-
|
|
3210
|
+
B(a.$slots, "footer")
|
|
3166
3211
|
])) : b("", !0)
|
|
3167
3212
|
], 64))
|
|
3168
3213
|
], 2));
|
|
3169
3214
|
}
|
|
3170
|
-
}), Bn = /* @__PURE__ */
|
|
3215
|
+
}), Bn = /* @__PURE__ */ re({
|
|
3171
3216
|
__name: "WKpiGrid",
|
|
3172
3217
|
props: {
|
|
3173
3218
|
items: { default: () => [] },
|
|
@@ -3182,11 +3227,11 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
|
|
|
3182
3227
|
return (n, i) => (o(), d("div", {
|
|
3183
3228
|
class: Q(["w-kpi-grid", t.value])
|
|
3184
3229
|
}, [
|
|
3185
|
-
n.$slots.item ? (o(!0), d(
|
|
3230
|
+
n.$slots.item ? (o(!0), d(J, { key: 0 }, oe(e.items, (v, $) => B(n.$slots, "item", {
|
|
3186
3231
|
key: $,
|
|
3187
3232
|
item: v,
|
|
3188
3233
|
index: $
|
|
3189
|
-
})), 128)) : (o(!0), d(
|
|
3234
|
+
})), 128)) : (o(!0), d(J, { key: 1 }, oe(e.items, (v, $) => (o(), C(Uo, {
|
|
3190
3235
|
key: $,
|
|
3191
3236
|
label: v.label,
|
|
3192
3237
|
value: v.value,
|
|
@@ -3207,7 +3252,7 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
|
|
|
3207
3252
|
}, Wo = {
|
|
3208
3253
|
key: 0,
|
|
3209
3254
|
class: "w-section-header__actions"
|
|
3210
|
-
}, Tn = /* @__PURE__ */
|
|
3255
|
+
}, Tn = /* @__PURE__ */ re({
|
|
3211
3256
|
__name: "WSectionHeader",
|
|
3212
3257
|
props: {
|
|
3213
3258
|
title: {},
|
|
@@ -3221,7 +3266,7 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
|
|
|
3221
3266
|
}, [
|
|
3222
3267
|
m("div", Bo, [
|
|
3223
3268
|
e.icon || a.$slots.icon ? (o(), d("div", To, [
|
|
3224
|
-
|
|
3269
|
+
B(a.$slots, "icon", {}, () => [
|
|
3225
3270
|
e.icon ? (o(), d("i", {
|
|
3226
3271
|
key: 0,
|
|
3227
3272
|
class: Q(e.icon)
|
|
@@ -3231,13 +3276,13 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
|
|
|
3231
3276
|
m("div", No, [
|
|
3232
3277
|
m("div", Lo, [
|
|
3233
3278
|
m("h3", zo, I(e.title), 1),
|
|
3234
|
-
|
|
3279
|
+
B(a.$slots, "meta")
|
|
3235
3280
|
]),
|
|
3236
3281
|
e.subtitle ? (o(), d("p", Oo, I(e.subtitle), 1)) : b("", !0)
|
|
3237
3282
|
])
|
|
3238
3283
|
]),
|
|
3239
3284
|
a.$slots.actions ? (o(), d("div", Wo, [
|
|
3240
|
-
|
|
3285
|
+
B(a.$slots, "actions")
|
|
3241
3286
|
])) : b("", !0)
|
|
3242
3287
|
], 2));
|
|
3243
3288
|
}
|
|
@@ -3250,7 +3295,7 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
|
|
|
3250
3295
|
}, Go = {
|
|
3251
3296
|
key: 0,
|
|
3252
3297
|
class: "w-form-section__actions"
|
|
3253
|
-
}, Yo = { class: "w-form-section__body" }, Nn = /* @__PURE__ */
|
|
3298
|
+
}, Yo = { class: "w-form-section__body" }, Nn = /* @__PURE__ */ re({
|
|
3254
3299
|
__name: "WFormSection",
|
|
3255
3300
|
props: {
|
|
3256
3301
|
title: {},
|
|
@@ -3267,11 +3312,11 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
|
|
|
3267
3312
|
e.description ? (o(), d("p", Ho, I(e.description), 1)) : b("", !0)
|
|
3268
3313
|
]),
|
|
3269
3314
|
a.$slots.actions ? (o(), d("div", Go, [
|
|
3270
|
-
|
|
3315
|
+
B(a.$slots, "actions")
|
|
3271
3316
|
])) : b("", !0)
|
|
3272
3317
|
])) : b("", !0),
|
|
3273
3318
|
m("div", Yo, [
|
|
3274
|
-
|
|
3319
|
+
B(a.$slots, "default")
|
|
3275
3320
|
])
|
|
3276
3321
|
], 2));
|
|
3277
3322
|
}
|
|
@@ -3284,7 +3329,7 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
|
|
|
3284
3329
|
}, Zo = {
|
|
3285
3330
|
key: 2,
|
|
3286
3331
|
class: "w-action-bar__secondary"
|
|
3287
|
-
}, Ln = /* @__PURE__ */
|
|
3332
|
+
}, Ln = /* @__PURE__ */ re({
|
|
3288
3333
|
__name: "WActionBar",
|
|
3289
3334
|
props: {
|
|
3290
3335
|
align: { default: "between" },
|
|
@@ -3295,22 +3340,22 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
|
|
|
3295
3340
|
class: Q(["w-action-bar", [`w-action-bar--${e.align}`, { "w-action-bar--stack": e.stackOnMobile }]])
|
|
3296
3341
|
}, [
|
|
3297
3342
|
a.$slots.primary || a.$slots.default ? (o(), d("div", Jo, [
|
|
3298
|
-
|
|
3299
|
-
|
|
3343
|
+
B(a.$slots, "primary", {}, () => [
|
|
3344
|
+
B(a.$slots, "default")
|
|
3300
3345
|
])
|
|
3301
3346
|
])) : b("", !0),
|
|
3302
3347
|
a.$slots.filters ? (o(), d("div", Xo, [
|
|
3303
|
-
|
|
3348
|
+
B(a.$slots, "filters")
|
|
3304
3349
|
])) : b("", !0),
|
|
3305
3350
|
a.$slots.secondary ? (o(), d("div", Zo, [
|
|
3306
|
-
|
|
3351
|
+
B(a.$slots, "secondary")
|
|
3307
3352
|
])) : b("", !0)
|
|
3308
3353
|
], 2));
|
|
3309
3354
|
}
|
|
3310
3355
|
}), Qo = { class: "w-progress-flow__marker" }, _o = { class: "w-progress-flow__content" }, en = { class: "w-progress-flow__label" }, tn = {
|
|
3311
3356
|
key: 0,
|
|
3312
3357
|
class: "w-progress-flow__description"
|
|
3313
|
-
}, zn = /* @__PURE__ */
|
|
3358
|
+
}, zn = /* @__PURE__ */ re({
|
|
3314
3359
|
__name: "WProgressFlow",
|
|
3315
3360
|
props: {
|
|
3316
3361
|
steps: {},
|
|
@@ -3325,11 +3370,11 @@ const vo = { class: "w-detail-header" }, po = { class: "w-detail-header-left" },
|
|
|
3325
3370
|
return (i, v) => (o(), d("div", {
|
|
3326
3371
|
class: Q(["w-progress-flow", `w-progress-flow--${e.orientation}`])
|
|
3327
3372
|
}, [
|
|
3328
|
-
(o(!0), d(
|
|
3373
|
+
(o(!0), d(J, null, oe(e.steps, ($, D) => (o(), d("div", {
|
|
3329
3374
|
key: $.key,
|
|
3330
3375
|
class: Q(["w-progress-flow__step", `w-progress-flow__step--${n(D)}`])
|
|
3331
3376
|
}, [
|
|
3332
|
-
|
|
3377
|
+
B(i.$slots, "step", {
|
|
3333
3378
|
step: $,
|
|
3334
3379
|
index: D,
|
|
3335
3380
|
state: n(D)
|
|
@@ -3350,10 +3395,10 @@ export {
|
|
|
3350
3395
|
Al as W,
|
|
3351
3396
|
Ln as _,
|
|
3352
3397
|
wl as a,
|
|
3353
|
-
|
|
3354
|
-
|
|
3398
|
+
at as b,
|
|
3399
|
+
$t as c,
|
|
3355
3400
|
Fn as d,
|
|
3356
|
-
|
|
3401
|
+
ct as e,
|
|
3357
3402
|
In as f,
|
|
3358
3403
|
An as g,
|
|
3359
3404
|
Mn as h,
|
|
@@ -3375,4 +3420,4 @@ export {
|
|
|
3375
3420
|
cl as x,
|
|
3376
3421
|
ha as y
|
|
3377
3422
|
};
|
|
3378
|
-
//# sourceMappingURL=WProgressFlow.vue_vue_type_script_setup_true_lang-
|
|
3423
|
+
//# sourceMappingURL=WProgressFlow.vue_vue_type_script_setup_true_lang-BZxi1797.js.map
|