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