@wgalleti/primevue-components 2.3.3 → 2.4.0
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/components/crud/WCrudView.vue.d.ts +54 -46
- package/dist/components/crud/WCrudView.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/crud/WCrudView.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/crud/WCrudView.vue_vue_type_script_setup_true_lang.js +582 -641
- package/dist/components/crud/WCrudView.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/crud/WEditableTable.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/crud/WEditableTable.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/crud/WEditableTable.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/crud/WEditableTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/form/WFormRenderer.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/form/WFormRenderer.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/form/WFormRenderer.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/components/form/WFormRenderer.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ui/WDialog.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/ui/WDialog.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/ui/WDialog.vue_vue_type_script_setup_true_lang.js +8 -2
- package/dist/components/ui/WDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ui/WTabBar.vue.d.ts +4 -1
- package/dist/components/ui/WTabBar.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/ui/WTabBar.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/ui/WTabBar.vue_vue_type_script_setup_true_lang.js +77 -33
- package/dist/components/ui/WTabBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/ui/WTabNav.vue_vue_type_script_setup_true_lang.cjs +1 -1
- package/dist/components/ui/WTabNav.vue_vue_type_script_setup_true_lang.cjs.map +1 -1
- package/dist/components/ui/WTabNav.vue_vue_type_script_setup_true_lang.js +73 -72
- package/dist/components/ui/WTabNav.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/internal/WCrudFilters.vue.cjs +2 -0
- package/dist/internal/WCrudFilters.vue.cjs.map +1 -0
- package/dist/internal/WCrudFilters.vue.d.ts +29 -0
- package/dist/internal/WCrudFilters.vue.js +6 -0
- package/dist/internal/WCrudFilters.vue.js.map +1 -0
- package/dist/internal/WCrudFilters.vue_vue_type_script_setup_true_lang.cjs +2 -0
- package/dist/internal/WCrudFilters.vue_vue_type_script_setup_true_lang.cjs.map +1 -0
- package/dist/internal/WCrudFilters.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/internal/WCrudFilters.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/primevue-components.css +1 -1
- package/dist/types/column.d.ts +5 -0
- package/package.json +1 -1
|
@@ -10,93 +10,106 @@ import { useDelayedLoading as te } from "../../composables/useDelayedLoading.js"
|
|
|
10
10
|
import ne from "../ui/WSkeleton.vue.js";
|
|
11
11
|
import re from "./WCrudColumnRenderer.vue.js";
|
|
12
12
|
import ie from "./WCrudFormDialog.vue.js";
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import be from "
|
|
17
|
-
import xe from "primevue/
|
|
18
|
-
import Se from "primevue/
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
13
|
+
import ae from "../../internal/WCrudFilters.vue.js";
|
|
14
|
+
import { useFormatters as oe } from "../../composables/useFormatters.js";
|
|
15
|
+
import { downloadCsv as se, toCsv as ce } from "../../utils/csv.js";
|
|
16
|
+
import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createSlots as le, createVNode as f, defineComponent as p, getCurrentInstance as ue, guardReactiveProps as m, mergeModels as de, mergeProps as fe, nextTick as pe, normalizeClass as h, normalizeProps as g, normalizeStyle as me, onMounted as he, openBlock as _, reactive as ge, ref as v, renderList as y, renderSlot as b, resolveDirective as _e, toDisplayString as x, unref as S, useModel as ve, useSlots as ye, vShow as be, watch as C, withCtx as w, withDirectives as T } from "vue";
|
|
17
|
+
import xe from "primevue/dialog";
|
|
18
|
+
import Se from "primevue/drawer";
|
|
19
|
+
import Ce from "primevue/datatable";
|
|
20
|
+
import we from "primevue/column";
|
|
21
|
+
import Te from "primevue/inputtext";
|
|
22
|
+
import Ee from "primevue/inputnumber";
|
|
23
|
+
import De from "primevue/checkbox";
|
|
24
|
+
import Oe from "primevue/iconfield";
|
|
25
|
+
import ke from "primevue/inputicon";
|
|
26
|
+
import Ae from "primevue/paginator";
|
|
27
|
+
import je from "primevue/tag";
|
|
27
28
|
// src/components/crud/WCrudView.vue?vue&type=script&setup=true&lang.ts
|
|
28
|
-
var
|
|
29
|
+
var Me = {
|
|
29
30
|
key: 0,
|
|
30
31
|
class: "w-crud-header"
|
|
31
|
-
},
|
|
32
|
+
}, Ne = { class: "w-crud-header-content" }, Pe = { class: "w-crud-title-row" }, Fe = { class: "w-crud-title" }, Ie = ["aria-busy"], Le = {
|
|
32
33
|
key: 0,
|
|
33
34
|
class: "w-crud-subtitle"
|
|
34
|
-
},
|
|
35
|
+
}, Re = { class: "w-crud-header-actions" }, ze = {
|
|
35
36
|
key: 0,
|
|
36
37
|
class: "w-crud-kpis"
|
|
37
|
-
},
|
|
38
|
+
}, Be = { class: "w-crud-kpi-content" }, Ve = { class: "w-crud-kpi-label" }, He = { class: "w-crud-kpi-value" }, Ue = {
|
|
38
39
|
key: 0,
|
|
39
40
|
class: "w-crud-probe",
|
|
40
41
|
"aria-hidden": "true"
|
|
41
|
-
},
|
|
42
|
+
}, We = {
|
|
42
43
|
key: 0,
|
|
43
44
|
class: "w-crud-bulkbar"
|
|
44
|
-
},
|
|
45
|
+
}, Ge = { class: "w-crud-bulkbar__count" }, Ke = { class: "w-crud-toolbar" }, qe = { class: "w-crud-toolbar-start" }, Je = {
|
|
45
46
|
key: 0,
|
|
46
47
|
class: "w-crud-search-row"
|
|
47
|
-
},
|
|
48
|
+
}, Ye = {
|
|
49
|
+
key: 1,
|
|
50
|
+
class: "w-crud-filters-btn"
|
|
51
|
+
}, Xe = {
|
|
52
|
+
key: 0,
|
|
53
|
+
class: "w-crud-filters-btn__count"
|
|
54
|
+
}, Ze = ["aria-busy"], Qe = { class: "w-crud-toolbar-end" }, $e = { class: "w-crud-chooser" }, et = ["for"], tt = {
|
|
48
55
|
key: 3,
|
|
49
56
|
class: "w-crud-view-toggle"
|
|
50
|
-
},
|
|
57
|
+
}, nt = { class: "w-crud-empty" }, rt = { class: "w-crud-empty-text" }, it = {
|
|
51
58
|
key: 0,
|
|
52
59
|
class: "w-crud-group-head"
|
|
53
|
-
},
|
|
60
|
+
}, at = { class: "w-crud-group-label" }, ot = { class: "w-crud-group-meta" }, st = { class: "w-crud-actions" }, ct = {
|
|
54
61
|
key: 2,
|
|
55
62
|
class: "w-crud-cards-wrap"
|
|
56
|
-
},
|
|
63
|
+
}, lt = { class: "w-crud-toolbar w-crud-toolbar--standalone" }, ut = { class: "w-crud-toolbar-start" }, dt = {
|
|
57
64
|
key: 0,
|
|
58
65
|
class: "w-crud-search-row"
|
|
59
|
-
},
|
|
66
|
+
}, ft = {
|
|
67
|
+
key: 1,
|
|
68
|
+
class: "w-crud-filters-btn"
|
|
69
|
+
}, pt = {
|
|
70
|
+
key: 0,
|
|
71
|
+
class: "w-crud-filters-btn__count"
|
|
72
|
+
}, mt = ["aria-busy"], ht = { class: "w-crud-toolbar-end" }, gt = {
|
|
60
73
|
key: 2,
|
|
61
74
|
class: "w-crud-view-toggle"
|
|
62
|
-
},
|
|
75
|
+
}, _t = {
|
|
63
76
|
key: 0,
|
|
64
77
|
class: "w-crud-cards-loading"
|
|
65
|
-
},
|
|
78
|
+
}, vt = {
|
|
66
79
|
key: 1,
|
|
67
80
|
class: "pi pi-spin pi-spinner"
|
|
68
|
-
},
|
|
81
|
+
}, yt = { class: "w-crud-empty" }, bt = { class: "w-crud-empty-text" }, xt = {
|
|
69
82
|
key: 0,
|
|
70
83
|
class: "w-crud-group-bar"
|
|
71
|
-
},
|
|
84
|
+
}, St = [
|
|
72
85
|
"aria-expanded",
|
|
73
86
|
"aria-label",
|
|
74
87
|
"onClick"
|
|
75
|
-
],
|
|
88
|
+
], Ct = { class: "w-crud-group-head" }, wt = { class: "w-crud-group-label" }, Tt = { class: "w-crud-group-meta" }, Et = ["aria-label"], Dt = [
|
|
76
89
|
"onClick",
|
|
77
90
|
"onDblclick",
|
|
78
91
|
"onContextmenu"
|
|
79
|
-
],
|
|
92
|
+
], Ot = { class: "w-crud-card-body" }, kt = {
|
|
80
93
|
key: 0,
|
|
81
94
|
class: "w-crud-card-select"
|
|
82
|
-
},
|
|
95
|
+
}, At = {
|
|
83
96
|
key: 0,
|
|
84
97
|
class: "w-crud-card-label"
|
|
85
|
-
},
|
|
98
|
+
}, jt = { class: "w-crud-card-value" }, Mt = {
|
|
86
99
|
key: 0,
|
|
87
100
|
class: "w-crud-card-actions"
|
|
88
|
-
},
|
|
101
|
+
}, Nt = {
|
|
89
102
|
key: 0,
|
|
90
103
|
class: "w-crud-rail"
|
|
91
|
-
},
|
|
104
|
+
}, Pt = {
|
|
92
105
|
key: 1,
|
|
93
106
|
class: "w-crud-rail-sep"
|
|
94
|
-
},
|
|
107
|
+
}, Ft = {
|
|
95
108
|
key: 2,
|
|
96
109
|
class: "w-crud-rail-sep"
|
|
97
|
-
},
|
|
110
|
+
}, It = { class: "w-crud-filters-drawer__body" }, Lt = /*@__PURE__*/ p({
|
|
98
111
|
__name: "WCrudView",
|
|
99
|
-
props: /*@__PURE__*/
|
|
112
|
+
props: /*@__PURE__*/ de({
|
|
100
113
|
crud: {},
|
|
101
114
|
title: {},
|
|
102
115
|
subtitle: {},
|
|
@@ -147,6 +160,7 @@ var Ae = {
|
|
|
147
160
|
default: !0
|
|
148
161
|
},
|
|
149
162
|
railMenu: { default: "auto" },
|
|
163
|
+
filtersDrawer: { default: "auto" },
|
|
150
164
|
contextMenu: {
|
|
151
165
|
type: Boolean,
|
|
152
166
|
default: !0
|
|
@@ -186,202 +200,202 @@ var Ae = {
|
|
|
186
200
|
collapsedGroups: { default: () => [] },
|
|
187
201
|
collapsedGroupsModifiers: {}
|
|
188
202
|
}),
|
|
189
|
-
emits: /*@__PURE__*/
|
|
203
|
+
emits: /*@__PURE__*/ de([
|
|
190
204
|
"row-expand",
|
|
191
205
|
"row-collapse",
|
|
192
206
|
"print",
|
|
193
207
|
"row-click"
|
|
194
208
|
], ["update:selectedRow", "update:collapsedGroups"]),
|
|
195
|
-
setup(p, { expose:
|
|
196
|
-
let
|
|
197
|
-
function
|
|
198
|
-
return
|
|
209
|
+
setup(p, { expose: de, emit: Lt }) {
|
|
210
|
+
let Rt = r(), E = p, zt = Lt, Bt = ye(), { formatNumber: Vt } = oe(), { showSkeleton: Ht } = te(() => E.crud.loading.value, { delay: () => E.loadingDelay }), Ut = v({});
|
|
211
|
+
function Wt() {
|
|
212
|
+
return E.persistState ? `wcrud:view:${E.persistState}` : null;
|
|
199
213
|
}
|
|
200
|
-
function
|
|
214
|
+
function Gt(e) {
|
|
201
215
|
try {
|
|
202
216
|
return localStorage.getItem(e);
|
|
203
217
|
} catch {
|
|
204
218
|
return null;
|
|
205
219
|
}
|
|
206
220
|
}
|
|
207
|
-
function
|
|
221
|
+
function Kt(e, t) {
|
|
208
222
|
try {
|
|
209
223
|
localStorage.setItem(e, t);
|
|
210
224
|
} catch {}
|
|
211
225
|
}
|
|
212
|
-
function
|
|
213
|
-
let e =
|
|
226
|
+
function qt() {
|
|
227
|
+
let e = Wt();
|
|
214
228
|
if (e) {
|
|
215
|
-
let t =
|
|
229
|
+
let t = Gt(e);
|
|
216
230
|
if (t === "table" || t === "cards") return t;
|
|
217
231
|
}
|
|
218
|
-
return
|
|
232
|
+
return E.defaultView;
|
|
219
233
|
}
|
|
220
|
-
let
|
|
221
|
-
function
|
|
222
|
-
return
|
|
234
|
+
let Jt = v(E.defaultView), Yt = v(null), Xt = v(null), Zt = E.cardMode === "fit", { estreito: Qt } = i(Yt, Xt, Zt ? { regua: 0 } : {}), $t = s(() => E.cardMode === "always" || (E.cardMode === "auto" || E.cardMode === "fit") && Qt.value), en = s(() => $t.value ? "cards" : Jt.value), tn = s(() => E.viewToggle && !$t.value);
|
|
235
|
+
function D(e) {
|
|
236
|
+
return en.value === e;
|
|
223
237
|
}
|
|
224
|
-
function
|
|
225
|
-
|
|
226
|
-
let t =
|
|
227
|
-
t &&
|
|
238
|
+
function nn(e) {
|
|
239
|
+
Jt.value = e;
|
|
240
|
+
let t = Wt();
|
|
241
|
+
t && Kt(t, e);
|
|
228
242
|
}
|
|
229
|
-
let
|
|
230
|
-
function
|
|
231
|
-
return
|
|
243
|
+
let rn = s(() => E.crud.pagination.rows ? (E.crud.pagination.page - 1) * E.crud.pagination.pageSize : 0), O = ge({ hidden: [] }), an = v(null);
|
|
244
|
+
function on() {
|
|
245
|
+
return E.persistState ? `wcrud:cols:${E.persistState}` : null;
|
|
232
246
|
}
|
|
233
|
-
function
|
|
234
|
-
let e =
|
|
247
|
+
function sn() {
|
|
248
|
+
let e = on();
|
|
235
249
|
if (e) try {
|
|
236
|
-
let t = JSON.parse(
|
|
237
|
-
Array.isArray(t.hidden) && (
|
|
250
|
+
let t = JSON.parse(Gt(e) || "{}");
|
|
251
|
+
Array.isArray(t.hidden) && (O.hidden = t.hidden);
|
|
238
252
|
} catch {}
|
|
239
253
|
}
|
|
240
|
-
function
|
|
241
|
-
let e =
|
|
242
|
-
e &&
|
|
254
|
+
function cn() {
|
|
255
|
+
let e = on();
|
|
256
|
+
e && Kt(e, JSON.stringify({ hidden: O.hidden }));
|
|
243
257
|
}
|
|
244
|
-
function
|
|
245
|
-
return
|
|
258
|
+
function ln() {
|
|
259
|
+
return E.persistState ? `wcrud:filters:${E.persistState}` : null;
|
|
246
260
|
}
|
|
247
|
-
function
|
|
248
|
-
let e =
|
|
261
|
+
function un() {
|
|
262
|
+
let e = ln();
|
|
249
263
|
if (e) try {
|
|
250
|
-
let t = JSON.parse(
|
|
251
|
-
if (t && typeof t.columnFilters == "object" && t.columnFilters) for (let [e, n] of Object.entries(t.columnFilters)) n != null && n !== "" && (
|
|
252
|
-
typeof t.search == "string" && t.search && (
|
|
264
|
+
let t = JSON.parse(Gt(e) || "{}");
|
|
265
|
+
if (t && typeof t.columnFilters == "object" && t.columnFilters) for (let [e, n] of Object.entries(t.columnFilters)) n != null && n !== "" && (E.crud.columnFilters[e] = n);
|
|
266
|
+
typeof t.search == "string" && t.search && (E.crud.search.value = t.search);
|
|
253
267
|
} catch {}
|
|
254
268
|
}
|
|
255
|
-
function
|
|
256
|
-
let e =
|
|
257
|
-
e &&
|
|
258
|
-
columnFilters: { ...
|
|
259
|
-
search:
|
|
269
|
+
function dn() {
|
|
270
|
+
let e = ln();
|
|
271
|
+
e && Kt(e, JSON.stringify({
|
|
272
|
+
columnFilters: { ...E.crud.columnFilters },
|
|
273
|
+
search: E.crud.search.value
|
|
260
274
|
}));
|
|
261
275
|
}
|
|
262
|
-
C(
|
|
263
|
-
let
|
|
264
|
-
function
|
|
265
|
-
|
|
276
|
+
C(E.crud.columnFilters, dn, { deep: !0 }), C(E.crud.search, dn);
|
|
277
|
+
let fn = s(() => E.crud.config.columns.filter((e) => e.visible !== !1));
|
|
278
|
+
function pn(e, t) {
|
|
279
|
+
O.hidden = t ? O.hidden.filter((t) => t !== e) : [.../* @__PURE__ */ new Set([...O.hidden, e])], cn();
|
|
266
280
|
}
|
|
267
|
-
let
|
|
281
|
+
let k = s(() => E.crud.config.columns.filter((e) => e.visible !== !1 && !O.hidden.includes(e.field)).map((e) => e.type === "number" && !e.align || e.type === "currency" && !e.align ? {
|
|
268
282
|
...e,
|
|
269
283
|
align: "right"
|
|
270
284
|
} : e));
|
|
271
|
-
function
|
|
285
|
+
function mn(e) {
|
|
272
286
|
if (e.align === "right") return "w-col-right text-right";
|
|
273
287
|
if (e.align === "center") return "w-col-center text-center";
|
|
274
288
|
}
|
|
275
|
-
let
|
|
276
|
-
let e =
|
|
277
|
-
return t ? [t, ...e.filter((e) => e !== t)].slice(0,
|
|
278
|
-
}),
|
|
289
|
+
let hn = s(() => {
|
|
290
|
+
let e = k.value.slice(0, E.cardFields), t = k.value.find((e) => e.card === "title") ?? (E.composed ? k.value.find((e) => e.type === "identity") : void 0);
|
|
291
|
+
return t ? [t, ...e.filter((e) => e !== t)].slice(0, E.cardFields) : e;
|
|
292
|
+
}), gn = s(() => {
|
|
279
293
|
let e = [];
|
|
280
|
-
return
|
|
294
|
+
return E.crud.config.canEdit !== !1 && e.push({
|
|
281
295
|
action: "edit",
|
|
282
296
|
icon: "pi pi-pencil",
|
|
283
297
|
tooltip: "Editar"
|
|
284
|
-
}),
|
|
298
|
+
}), E.crud.config.canCreate !== !1 && e.push({
|
|
285
299
|
action: "duplicate",
|
|
286
300
|
icon: "pi pi-copy",
|
|
287
301
|
tooltip: "Duplicar"
|
|
288
|
-
}),
|
|
302
|
+
}), E.crud.config.canDelete !== !1 && e.push({
|
|
289
303
|
action: "delete",
|
|
290
304
|
icon: "pi pi-trash",
|
|
291
305
|
tooltip: "Excluir",
|
|
292
306
|
severity: "danger"
|
|
293
307
|
}), e;
|
|
294
|
-
}),
|
|
308
|
+
}), A = s(() => E.crud.config.rowActions ?? gn.value), _n = [
|
|
295
309
|
"success",
|
|
296
310
|
"warn",
|
|
297
311
|
"info",
|
|
298
312
|
"contrast"
|
|
299
313
|
];
|
|
300
|
-
C([
|
|
301
|
-
for (let n of [...e, ...t ?? []]) n.severity &&
|
|
314
|
+
C([A, () => E.crud.config.bulkActions], ([e, t]) => {
|
|
315
|
+
for (let n of [...e, ...t ?? []]) n.severity && _n.includes(n.severity) && (`${n.action}`, `${n.action}${n.severity}`);
|
|
302
316
|
}, { immediate: !0 });
|
|
303
|
-
let
|
|
304
|
-
function
|
|
317
|
+
let vn = s(() => A.value.length > 0 || !!Bt["row-actions"]), yn = s(() => `${(A.value.length + +!!Bt["row-actions"]) * 2.5 + 1}rem`);
|
|
318
|
+
function bn(e) {
|
|
305
319
|
return e.tooltip ?? e.action;
|
|
306
320
|
}
|
|
307
|
-
function
|
|
308
|
-
let n = t &&
|
|
309
|
-
return n ? `${
|
|
321
|
+
function j(e, t) {
|
|
322
|
+
let n = t && L(e, t) ? e.disabledReason?.(t) : void 0;
|
|
323
|
+
return n ? `${bn(e)}: ${n}` : bn(e);
|
|
310
324
|
}
|
|
311
|
-
let
|
|
312
|
-
function
|
|
313
|
-
e.handler ? e.handler(t) : e.action === "edit" ?
|
|
325
|
+
let M = s(() => E.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)");
|
|
326
|
+
function N(e, t) {
|
|
327
|
+
e.handler ? e.handler(t) : e.action === "edit" ? E.crud.openEditDialog(t) : e.action === "view" ? E.crud.openViewDialog(t) : e.action === "duplicate" ? E.crud.openDuplicateDialog(t) : e.action === "delete" && (Bt["delete-message"] ? (P.value = t, F.value = !0) : E.crud.confirmDelete(t));
|
|
314
328
|
}
|
|
315
|
-
let
|
|
316
|
-
async function
|
|
317
|
-
if (
|
|
318
|
-
|
|
329
|
+
let P = v(null), F = v(!1), xn = v(!1);
|
|
330
|
+
async function Sn() {
|
|
331
|
+
if (P.value) {
|
|
332
|
+
xn.value = !0;
|
|
319
333
|
try {
|
|
320
|
-
await
|
|
334
|
+
await E.crud.performDelete(P.value), F.value = !1, P.value = null;
|
|
321
335
|
} finally {
|
|
322
|
-
|
|
336
|
+
xn.value = !1;
|
|
323
337
|
}
|
|
324
338
|
}
|
|
325
339
|
}
|
|
326
|
-
function
|
|
340
|
+
function I(e, t) {
|
|
327
341
|
return !e.visible || e.visible(t);
|
|
328
342
|
}
|
|
329
|
-
function
|
|
343
|
+
function L(e, t) {
|
|
330
344
|
return e.disabled ? e.disabled(t) : !1;
|
|
331
345
|
}
|
|
332
|
-
let
|
|
333
|
-
let e =
|
|
334
|
-
return typeof e == "number" && e > 0 ? e :
|
|
335
|
-
}),
|
|
336
|
-
if (
|
|
337
|
-
let e =
|
|
338
|
-
return `${
|
|
339
|
-
}),
|
|
346
|
+
let Cn = s(() => {
|
|
347
|
+
let e = E.crud.pagination.rows;
|
|
348
|
+
return typeof e == "number" && e > 0 ? e : E.crud.items.value.length;
|
|
349
|
+
}), wn = s(() => E.crud.loading.value && !E.crud.items.value.length), Tn = s(() => E.crud.extras.value.count_aproximado === !0), En = s(() => `${Vt(Cn.value, 0)}${Tn.value ? "+" : ""}`), Dn = s(() => {
|
|
350
|
+
if (wn.value) return "—";
|
|
351
|
+
let e = Cn.value;
|
|
352
|
+
return `${En.value} ${e === 1 && !Tn.value ? "registro" : "registros"}`;
|
|
353
|
+
}), On = s(() => !E.hideCount), kn = s(() => wn.value ? "—" : `{first}–{last} de ${Tn.value ? En.value : "{totalRecords}"}`), An = s(() => {
|
|
340
354
|
let e = [];
|
|
341
|
-
return
|
|
342
|
-
icon:
|
|
343
|
-
label:
|
|
344
|
-
value:
|
|
345
|
-
}), e.push(...
|
|
346
|
-
}),
|
|
347
|
-
function
|
|
348
|
-
return typeof
|
|
355
|
+
return E.showKpi && e.push({
|
|
356
|
+
icon: E.kpiIcon,
|
|
357
|
+
label: E.kpiLabel,
|
|
358
|
+
value: Vt(E.crud.pagination.rows, 0)
|
|
359
|
+
}), e.push(...E.extraKpis), e;
|
|
360
|
+
}), R = s(() => E.crud.config.canCreate !== !1), jn = s(() => E.actionRail && (R.value || A.value.length > 0 || !!Bt["rail-actions"] || E.showPrint || E.exportCsv)), { isCelular: Mn } = a(), z = s(() => jn.value && E.railMenu === "auto" && Mn.value), Nn = v(null), B = ve(p, "selectedRow"), V = ve(p, "collapsedGroups");
|
|
361
|
+
function Pn(e) {
|
|
362
|
+
return typeof E.groupBy == "function" ? E.groupBy(e) : String(e[E.groupBy] ?? "");
|
|
349
363
|
}
|
|
350
|
-
let
|
|
351
|
-
if (!
|
|
364
|
+
let H = s(() => {
|
|
365
|
+
if (!E.groupBy) return [];
|
|
352
366
|
let e = /* @__PURE__ */ new Map();
|
|
353
|
-
for (let t of
|
|
354
|
-
let n =
|
|
367
|
+
for (let t of E.crud.items.value) {
|
|
368
|
+
let n = Pn(t), r = e.get(n);
|
|
355
369
|
r ? r.push(t) : e.set(n, [t]);
|
|
356
370
|
}
|
|
357
|
-
let t = new Set(
|
|
371
|
+
let t = new Set(V.value);
|
|
358
372
|
return [...e].map(([e, n]) => ({
|
|
359
373
|
groupKey: e,
|
|
360
|
-
label:
|
|
374
|
+
label: E.groupLabel?.(e, n) ?? (e || "Sem grupo"),
|
|
361
375
|
items: n,
|
|
362
376
|
count: n.length,
|
|
363
377
|
collapsed: t.has(e)
|
|
364
378
|
}));
|
|
365
|
-
}),
|
|
366
|
-
function
|
|
367
|
-
let t = new Set(e ?? []), n = new Set(
|
|
368
|
-
|
|
379
|
+
}), U = s(() => !!E.groupBy), Fn = s(() => U.value ? Pn : void 0), In = s(() => new Map(H.value.map((e) => [e.groupKey, e]))), W = (e) => In.value.get(Pn(e)), G = s(() => U.value ? H.value.flatMap((e) => e.items) : E.crud.items.value), Ln = s(() => H.value.filter((e) => !e.collapsed).map((e) => e.groupKey));
|
|
380
|
+
function Rn(e) {
|
|
381
|
+
let t = new Set(e ?? []), n = new Set(H.value.map((e) => e.groupKey));
|
|
382
|
+
V.value = [...V.value.filter((e) => !n.has(e)), ...H.value.filter((e) => !t.has(e.groupKey)).map((e) => e.groupKey)];
|
|
369
383
|
}
|
|
370
|
-
function
|
|
371
|
-
|
|
384
|
+
function zn(e) {
|
|
385
|
+
V.value = V.value.includes(e) ? V.value.filter((t) => t !== e) : [...V.value, e];
|
|
372
386
|
}
|
|
373
|
-
function
|
|
374
|
-
let t =
|
|
375
|
-
|
|
387
|
+
function Bn(e) {
|
|
388
|
+
let t = H.value.map((e) => e.groupKey), n = V.value.filter((e) => !t.includes(e));
|
|
389
|
+
V.value = e ? [...n, ...t] : n;
|
|
376
390
|
}
|
|
377
|
-
let
|
|
378
|
-
if (!
|
|
391
|
+
let Vn = s(() => {
|
|
392
|
+
if (!U.value) return [{
|
|
379
393
|
group: null,
|
|
380
|
-
items:
|
|
394
|
+
items: G.value,
|
|
381
395
|
offset: 0
|
|
382
396
|
}];
|
|
383
397
|
let e = 0;
|
|
384
|
-
return
|
|
398
|
+
return H.value.map((t) => {
|
|
385
399
|
let n = {
|
|
386
400
|
group: t,
|
|
387
401
|
items: t.items,
|
|
@@ -389,195 +403,193 @@ var Ae = {
|
|
|
389
403
|
};
|
|
390
404
|
return e += t.count, n;
|
|
391
405
|
});
|
|
392
|
-
}),
|
|
393
|
-
function
|
|
394
|
-
let t =
|
|
395
|
-
|
|
406
|
+
}), K = s(() => E.crud.config.selectionMode === "multiple"), Hn = (e) => e[E.crud.config.pk || "id"], Un = (e) => E.crud.selectedItems.value.some((t) => Hn(t) === Hn(e));
|
|
407
|
+
function Wn(e) {
|
|
408
|
+
let t = E.crud.selectedItems.value;
|
|
409
|
+
E.crud.selectedItems.value = Un(e) ? t.filter((t) => Hn(t) !== Hn(e)) : [...t, e];
|
|
396
410
|
}
|
|
397
|
-
let
|
|
398
|
-
function
|
|
399
|
-
let t =
|
|
411
|
+
let Gn = v(null);
|
|
412
|
+
function Kn(e) {
|
|
413
|
+
let t = E.crud.config.pk || "id", n = G.value.find((n) => n[t] === e);
|
|
400
414
|
if (!n) return;
|
|
401
415
|
let r = () => {
|
|
402
|
-
let e =
|
|
416
|
+
let e = G.value.filter((e) => !W(e)?.collapsed), t = (Gn.value?.$el)?.querySelectorAll("tbody > tr:not(.p-datatable-row-group-header)");
|
|
403
417
|
t && t.length === e.length && t[e.indexOf(n)]?.scrollIntoView({
|
|
404
418
|
block: "nearest",
|
|
405
419
|
behavior: "smooth"
|
|
406
420
|
});
|
|
407
|
-
}, i =
|
|
408
|
-
i?.collapsed ? (
|
|
421
|
+
}, i = W(n);
|
|
422
|
+
i?.collapsed ? (zn(i.groupKey), pe(r)) : r();
|
|
409
423
|
}
|
|
410
|
-
|
|
411
|
-
let
|
|
424
|
+
de({ scrollToRow: Kn });
|
|
425
|
+
let qn = s(() => E.crud.config.editMode === "cell"), Jn = s(() => new Map(E.crud.config.form.map((e) => [e.field, e]))), Yn = [
|
|
412
426
|
"text",
|
|
413
427
|
"email",
|
|
414
428
|
"number",
|
|
415
429
|
"currency"
|
|
416
430
|
];
|
|
417
|
-
function
|
|
418
|
-
let t =
|
|
419
|
-
return t &&
|
|
431
|
+
function Xn(e) {
|
|
432
|
+
let t = Jn.value.get(e);
|
|
433
|
+
return t && Yn.includes(t.type || "text") ? t : void 0;
|
|
420
434
|
}
|
|
421
|
-
function
|
|
422
|
-
e.newValue !== (e.value ?? e.data[e.field]) &&
|
|
435
|
+
function Zn(e) {
|
|
436
|
+
e.newValue !== (e.value ?? e.data[e.field]) && E.crud.updateField(e.data, e.field, e.newValue);
|
|
423
437
|
}
|
|
424
|
-
let
|
|
425
|
-
|
|
426
|
-
value: !0
|
|
427
|
-
}, {
|
|
428
|
-
label: "Não",
|
|
429
|
-
value: !1
|
|
430
|
-
}];
|
|
431
|
-
function Y(e) {
|
|
438
|
+
let q = s(() => E.crud.config.columns.filter((e) => e.filter));
|
|
439
|
+
function J(e) {
|
|
432
440
|
return e.filter?.param || e.field;
|
|
433
441
|
}
|
|
434
|
-
let
|
|
435
|
-
function
|
|
436
|
-
let n =
|
|
437
|
-
|
|
442
|
+
let Qn = {};
|
|
443
|
+
function $n(e, t) {
|
|
444
|
+
let n = J(e);
|
|
445
|
+
Qn[n] && clearTimeout(Qn[n]), Qn[n] = setTimeout(() => E.crud.setColumnFilter(n, t || null), 300);
|
|
438
446
|
}
|
|
439
|
-
let
|
|
440
|
-
|
|
441
|
-
|
|
447
|
+
let Y = s(() => E.filtersDrawer === "auto" && Mn.value && (q.value.length > 0 || !!Bt["toolbar-filters"])), X = v(!1), er = s(() => Object.keys(E.crud.columnFilters).length);
|
|
448
|
+
C(Y, (e) => {
|
|
449
|
+
e || (X.value = !1);
|
|
450
|
+
});
|
|
451
|
+
let tr = v(null);
|
|
452
|
+
function nr(e) {
|
|
453
|
+
B.value = e;
|
|
442
454
|
}
|
|
443
|
-
let
|
|
444
|
-
function
|
|
455
|
+
let rr = s(() => E.crud.config.openOnRowClick === !0);
|
|
456
|
+
function ir(e) {
|
|
445
457
|
let t = e.target;
|
|
446
458
|
return t instanceof Element && t.closest("button,a,input,select,textarea,label,[role=\"button\"],[role=\"checkbox\"],[role=\"menu\"],[role=\"menuitem\"],[contenteditable],[data-p-selection-column=\"true\"],[data-p-cell-editing=\"true\"]") !== null;
|
|
447
459
|
}
|
|
448
|
-
let
|
|
449
|
-
function
|
|
450
|
-
if (
|
|
451
|
-
let t =
|
|
452
|
-
t && (
|
|
460
|
+
let ar = !1;
|
|
461
|
+
function or(e) {
|
|
462
|
+
if (E.crud.config.canEdit === !1 || E.crud.dialogVisible.value || ar) return;
|
|
463
|
+
let t = E.crud.openEditDialog(e);
|
|
464
|
+
t && (ar = !0, t.finally(() => ar = !1));
|
|
453
465
|
}
|
|
454
|
-
function
|
|
455
|
-
|
|
466
|
+
function sr(e, t) {
|
|
467
|
+
ir(e) || e instanceof KeyboardEvent && e.key !== "Enter" || (zt("row-click", t), rr.value || (B.value = t), rr.value && !qn.value && or(t));
|
|
456
468
|
}
|
|
457
|
-
C(() =>
|
|
458
|
-
|
|
469
|
+
C(() => E.crud.selectedItems.value, () => {
|
|
470
|
+
K.value && B.value && (B.value = null);
|
|
459
471
|
});
|
|
460
|
-
let
|
|
461
|
-
if (
|
|
462
|
-
let e =
|
|
463
|
-
return
|
|
472
|
+
let Z = s(() => {
|
|
473
|
+
if (B.value) return B.value;
|
|
474
|
+
let e = E.crud.selectedItems.value;
|
|
475
|
+
return K.value && e.length === 1 ? e[0] : null;
|
|
464
476
|
});
|
|
465
|
-
C(() =>
|
|
466
|
-
let t =
|
|
477
|
+
C(() => E.crud.items.value, (e) => {
|
|
478
|
+
let t = B.value;
|
|
467
479
|
if (!t || e.includes(t)) return;
|
|
468
|
-
let n =
|
|
469
|
-
|
|
480
|
+
let n = E.crud.config.pk || "id", r = e.find((e) => e[n] === t[n]);
|
|
481
|
+
B.value = r ?? null;
|
|
470
482
|
});
|
|
471
|
-
function
|
|
472
|
-
let t =
|
|
473
|
-
return
|
|
483
|
+
function cr(e) {
|
|
484
|
+
let t = E.crud.config.pk || "id";
|
|
485
|
+
return K.value && B.value?.[t] === e[t] ? "p-datatable-row-selected" : void 0;
|
|
474
486
|
}
|
|
475
|
-
function
|
|
476
|
-
|
|
487
|
+
function lr(e) {
|
|
488
|
+
sr(e.originalEvent, e.data);
|
|
477
489
|
}
|
|
478
|
-
function
|
|
479
|
-
|
|
490
|
+
function ur(e, t) {
|
|
491
|
+
E.cardBare || (nr(t), sr(e, t));
|
|
480
492
|
}
|
|
481
|
-
function
|
|
482
|
-
|
|
493
|
+
function dr(e) {
|
|
494
|
+
E.cardBare || rr.value || or(e);
|
|
483
495
|
}
|
|
484
|
-
function
|
|
485
|
-
|
|
496
|
+
function fr(e) {
|
|
497
|
+
E.contextMenu && (B.value = e.data, tr.value?.show(e.originalEvent));
|
|
486
498
|
}
|
|
487
|
-
function
|
|
488
|
-
|
|
499
|
+
function pr(e, t) {
|
|
500
|
+
E.contextMenu && (e.preventDefault(), B.value = t, tr.value?.show(e));
|
|
489
501
|
}
|
|
490
|
-
let
|
|
491
|
-
let e =
|
|
502
|
+
let mr = s(() => {
|
|
503
|
+
let e = B.value;
|
|
492
504
|
if (!e) return [];
|
|
493
505
|
let t = [{
|
|
494
506
|
label: "Ver detalhes",
|
|
495
507
|
icon: "pi pi-eye",
|
|
496
|
-
command: () =>
|
|
508
|
+
command: () => E.crud.openViewDialog(e)
|
|
497
509
|
}];
|
|
498
|
-
for (let n of
|
|
499
|
-
label:
|
|
510
|
+
for (let n of A.value) I(n, e) && t.push({
|
|
511
|
+
label: bn(n),
|
|
500
512
|
icon: n.icon,
|
|
501
513
|
class: n.severity === "danger" ? "w-crud-ctx-danger" : void 0,
|
|
502
|
-
disabled:
|
|
503
|
-
command: () =>
|
|
514
|
+
disabled: L(n, e),
|
|
515
|
+
command: () => N(n, e)
|
|
504
516
|
});
|
|
505
|
-
return
|
|
517
|
+
return E.showPrint && t.push({
|
|
506
518
|
label: "Imprimir",
|
|
507
519
|
icon: "pi pi-print",
|
|
508
|
-
command: () =>
|
|
509
|
-
}),
|
|
510
|
-
label:
|
|
520
|
+
command: () => zt("print", e)
|
|
521
|
+
}), E.exportCsv && (t.push({ separator: !0 }), t.push({
|
|
522
|
+
label: E.csvScope === "all" ? "Exportar tudo (CSV)" : "Exportar página (CSV)",
|
|
511
523
|
icon: "pi pi-download",
|
|
512
|
-
command: () =>
|
|
524
|
+
command: () => _r()
|
|
513
525
|
})), t;
|
|
514
|
-
}),
|
|
515
|
-
let e =
|
|
516
|
-
|
|
526
|
+
}), hr = s(() => {
|
|
527
|
+
let e = Z.value, t = [];
|
|
528
|
+
R.value && t.push({
|
|
517
529
|
label: "Novo",
|
|
518
530
|
icon: "pi pi-plus",
|
|
519
|
-
command: () =>
|
|
531
|
+
command: () => E.crud.openCreateDialog()
|
|
520
532
|
});
|
|
521
|
-
let n =
|
|
533
|
+
let n = A.value.filter((t) => !e || I(t, e));
|
|
522
534
|
t.length && n.length && t.push({ separator: !0 });
|
|
523
535
|
for (let r of n) t.push({
|
|
524
|
-
label:
|
|
536
|
+
label: bn(r),
|
|
525
537
|
icon: r.icon,
|
|
526
538
|
class: r.severity === "danger" ? "w-crud-ctx-danger" : void 0,
|
|
527
|
-
disabled: !e ||
|
|
528
|
-
command: () => e &&
|
|
539
|
+
disabled: !e || L(r, e),
|
|
540
|
+
command: () => e && N(r, e)
|
|
529
541
|
});
|
|
530
|
-
return t.length && (
|
|
542
|
+
return t.length && (E.showPrint || E.exportCsv) && t.push({ separator: !0 }), E.showPrint && t.push({
|
|
531
543
|
label: "Imprimir",
|
|
532
544
|
icon: "pi pi-print",
|
|
533
545
|
disabled: !e,
|
|
534
|
-
command: () =>
|
|
535
|
-
}),
|
|
536
|
-
label:
|
|
546
|
+
command: () => gr()
|
|
547
|
+
}), E.exportCsv && t.push({
|
|
548
|
+
label: M.value,
|
|
537
549
|
icon: "pi pi-download",
|
|
538
|
-
command: () =>
|
|
550
|
+
command: () => _r()
|
|
539
551
|
}), t;
|
|
540
552
|
});
|
|
541
|
-
function
|
|
542
|
-
|
|
553
|
+
function gr() {
|
|
554
|
+
Z.value && zt("print", Z.value);
|
|
543
555
|
}
|
|
544
|
-
let
|
|
545
|
-
async function
|
|
546
|
-
if (!
|
|
547
|
-
|
|
556
|
+
let Q = v(!1);
|
|
557
|
+
async function _r() {
|
|
558
|
+
if (!Q.value) {
|
|
559
|
+
Q.value = !0;
|
|
548
560
|
try {
|
|
549
|
-
let e =
|
|
550
|
-
|
|
561
|
+
let e = E.csvScope === "page" ? E.crud.items.value : await E.crud.fetchAll(E.csvPageSize), t = ce(e, k.value);
|
|
562
|
+
se(t, E.csvFilename);
|
|
551
563
|
} finally {
|
|
552
|
-
|
|
564
|
+
Q.value = !1;
|
|
553
565
|
}
|
|
554
566
|
}
|
|
555
567
|
}
|
|
556
|
-
function
|
|
568
|
+
function vr(e) {
|
|
557
569
|
if (!e) return;
|
|
558
570
|
let t = /(?:^|;)\s*min-width\s*:\s*([^;!]+)/i.exec(e)?.[1], n = /(?:^|;)\s*width\s*:\s*([^;!]+)/i.exec(e)?.[1];
|
|
559
571
|
return (t ?? n)?.trim();
|
|
560
572
|
}
|
|
561
|
-
let
|
|
562
|
-
function
|
|
563
|
-
return [
|
|
573
|
+
let yr = s(() => (k.value.find((e) => !vr(e.style)) ?? k.value[0])?.field);
|
|
574
|
+
function br(e) {
|
|
575
|
+
return [mn(e), e.field === yr.value ? "w-crud-col-title" : ""].filter(Boolean).join(" ");
|
|
564
576
|
}
|
|
565
|
-
let
|
|
577
|
+
let xr = s(() => {
|
|
566
578
|
let e = [];
|
|
567
|
-
|
|
568
|
-
for (let t of
|
|
569
|
-
let n =
|
|
570
|
-
t.field ===
|
|
579
|
+
K.value && e.push("var(--w-col-narrow)"), E.expandable && e.push("var(--w-col-narrow)");
|
|
580
|
+
for (let t of k.value) {
|
|
581
|
+
let n = vr(t.style);
|
|
582
|
+
t.field === yr.value ? n ? e.push(`max(var(--w-col-title-min), ${n})`) : e.push("var(--w-col-title-min)") : e.push(n ?? "var(--w-col-min)");
|
|
571
583
|
}
|
|
572
|
-
return
|
|
573
|
-
}),
|
|
584
|
+
return vn.value && !E.actionRail && e.push(yn.value), e.length ? `calc(${e.join(" + ")})` : void 0;
|
|
585
|
+
}), Sr = s(() => xr.value ? { "--w-crud-min": xr.value } : void 0), Cr = s(() => ({
|
|
574
586
|
pcPaginator: { root: { class: "w-crud-paginator" } },
|
|
575
|
-
...
|
|
576
|
-
})),
|
|
577
|
-
function
|
|
578
|
-
return
|
|
587
|
+
...U.value ? { rowGroupHeaderCell: { colspan: +!!K.value + +!!E.expandable + k.value.length + (vn.value && !E.actionRail ? 1 : 0) } } : {}
|
|
588
|
+
})), wr = ue()?.vnode.props ?? {}, Tr = "urlState" in wr || "url-state" in wr, $ = E.urlState ? ee(typeof E.urlState == "string" ? E.urlState : "", Tr) : null, Er = "onUpdate:selectedRow" in wr || "onUpdate:selected-row" in wr, Dr = null;
|
|
589
|
+
function Or() {
|
|
590
|
+
return q.value;
|
|
579
591
|
}
|
|
580
|
-
function
|
|
592
|
+
function kr(e) {
|
|
581
593
|
return Array.isArray(e) ? e.length && e.every((e) => [
|
|
582
594
|
"string",
|
|
583
595
|
"number",
|
|
@@ -588,7 +600,7 @@ var Ae = {
|
|
|
588
600
|
"boolean"
|
|
589
601
|
].includes(typeof e) && e !== "" ? String(e) : null;
|
|
590
602
|
}
|
|
591
|
-
function
|
|
603
|
+
function Ar(e, t) {
|
|
592
604
|
let n = e.filter?.type || "text";
|
|
593
605
|
if (n === "numeric") return Number.isNaN(Number(t)) ? void 0 : Number(t);
|
|
594
606
|
if (n === "boolean") return t === "true" || t !== "false" && void 0;
|
|
@@ -600,13 +612,13 @@ var Ae = {
|
|
|
600
612
|
}
|
|
601
613
|
return t;
|
|
602
614
|
}
|
|
603
|
-
function
|
|
615
|
+
function jr() {
|
|
604
616
|
if (!$) return;
|
|
605
|
-
let e =
|
|
617
|
+
let e = E.crud, t = $.get("search");
|
|
606
618
|
t && (e.search.value = t);
|
|
607
|
-
for (let t of
|
|
608
|
-
let n = $.get(`f_${
|
|
609
|
-
r !== void 0 && (e.columnFilters[
|
|
619
|
+
for (let t of Or()) {
|
|
620
|
+
let n = $.get(`f_${J(t)}`), r = n === void 0 ? void 0 : Ar(t, n);
|
|
621
|
+
r !== void 0 && (e.columnFilters[J(t)] = r);
|
|
610
622
|
}
|
|
611
623
|
let n = Number($.get("page"));
|
|
612
624
|
Number.isInteger(n) && n > 1 && (e.pagination.page = n);
|
|
@@ -615,75 +627,76 @@ var Ae = {
|
|
|
615
627
|
let t = r.startsWith("-"), n = t ? r.slice(1) : r;
|
|
616
628
|
e.config.columns.some((e) => e.sortable && (e.sortField || e.field) === n) && (e.sort.field = n, e.sort.order = t ? -1 : 1);
|
|
617
629
|
}
|
|
618
|
-
|
|
630
|
+
Er && (Dr = $.get("id") ?? null);
|
|
619
631
|
}
|
|
620
|
-
function
|
|
621
|
-
return !!$ && ($.get("search") !== void 0 ||
|
|
632
|
+
function Mr() {
|
|
633
|
+
return !!$ && ($.get("search") !== void 0 || Or().some((e) => $.get(`f_${J(e)}`) !== void 0));
|
|
622
634
|
}
|
|
623
|
-
function
|
|
635
|
+
function Nr() {
|
|
624
636
|
if (!$) return;
|
|
625
|
-
let e =
|
|
637
|
+
let e = E.crud, t = {
|
|
626
638
|
search: e.search.value || null,
|
|
627
639
|
page: e.pagination.page > 1 ? String(e.pagination.page) : null,
|
|
628
640
|
sort: e.sort.field && e.sort.order !== 0 ? `${e.sort.order === -1 ? "-" : ""}${e.sort.field}` : null
|
|
629
641
|
};
|
|
630
|
-
for (let n of
|
|
631
|
-
if (
|
|
632
|
-
let n =
|
|
642
|
+
for (let n of Or()) t[`f_${J(n)}`] = kr(e.columnFilters[J(n)]);
|
|
643
|
+
if (Er && Dr === null) {
|
|
644
|
+
let n = B.value?.[e.config.pk || "id"];
|
|
633
645
|
t.id = n == null ? null : String(n);
|
|
634
646
|
}
|
|
635
647
|
$.write(t);
|
|
636
648
|
}
|
|
637
649
|
return $ && (C(() => [
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
JSON.stringify(
|
|
643
|
-
|
|
644
|
-
],
|
|
645
|
-
if (
|
|
646
|
-
let t =
|
|
647
|
-
|
|
648
|
-
})),
|
|
649
|
-
|
|
650
|
+
E.crud.search.value,
|
|
651
|
+
E.crud.pagination.page,
|
|
652
|
+
E.crud.sort.field,
|
|
653
|
+
E.crud.sort.order,
|
|
654
|
+
JSON.stringify(E.crud.columnFilters),
|
|
655
|
+
B.value
|
|
656
|
+
], Nr), C(() => E.crud.items.value, (e) => {
|
|
657
|
+
if (Dr === null) return;
|
|
658
|
+
let t = E.crud.config.pk || "id", n = e.find((e) => String(e[t]) === Dr);
|
|
659
|
+
Dr = null, B.value = n ?? null, Nr();
|
|
660
|
+
})), he(() => {
|
|
661
|
+
Jt.value = qt(), sn(), Mr() || un(), jr(), E.autoInit && E.crud.init();
|
|
650
662
|
}), (r, i) => {
|
|
651
|
-
let a =
|
|
663
|
+
let a = _e("tooltip");
|
|
652
664
|
return _(), u("div", { class: h(["w-crud", {
|
|
653
665
|
"w-crud--composed": p.composed,
|
|
654
|
-
"w-crud--rail-menu":
|
|
666
|
+
"w-crud--rail-menu": z.value,
|
|
667
|
+
"w-crud--filters-drawer": Y.value
|
|
655
668
|
}]) }, [
|
|
656
|
-
p.showHeader ? (_(), u("div",
|
|
669
|
+
p.showHeader ? (_(), u("div", Me, [d("div", Ne, [d("div", Pe, [d("h1", Fe, x(p.title), 1), On.value ? (_(), u("span", {
|
|
657
670
|
key: 0,
|
|
658
671
|
class: "w-crud-count",
|
|
659
672
|
"aria-live": "polite",
|
|
660
673
|
"aria-busy": p.crud.loading.value || void 0
|
|
661
|
-
}, x(
|
|
674
|
+
}, x(Dn.value), 9, Ie)) : l("", !0)]), p.subtitle ? (_(), u("p", Le, x(p.subtitle), 1)) : l("", !0)]), d("div", Re, [b(r.$slots, "header-actions"), R.value && !p.actionRail ? (_(), c(e, {
|
|
662
675
|
key: 0,
|
|
663
676
|
label: "Novo",
|
|
664
677
|
icon: "pi pi-plus",
|
|
665
678
|
onClick: i[0] ||= (e) => p.crud.openCreateDialog()
|
|
666
679
|
})) : l("", !0)])])) : l("", !0),
|
|
667
|
-
b(r.$slots, "before-table", {}, () => [
|
|
680
|
+
b(r.$slots, "before-table", {}, () => [An.value.length ? (_(), u("div", ze, [(_(!0), u(o, null, y(An.value, (e, t) => (_(), u("div", {
|
|
668
681
|
key: t,
|
|
669
682
|
class: "w-crud-kpi"
|
|
670
683
|
}, [d("div", { class: h(["w-crud-kpi-icon", e.severity ? `w-crud-kpi-icon--${e.severity}` : ""]) }, [d("i", {
|
|
671
684
|
class: h([e.icon]),
|
|
672
|
-
style:
|
|
673
|
-
}, null, 6)], 2), d("div",
|
|
674
|
-
d("div", { class: h(["w-crud-content", { "w-crud-content--rail":
|
|
685
|
+
style: me(e.color ? `color: ${e.color}` : "")
|
|
686
|
+
}, null, 6)], 2), d("div", Be, [d("div", Ve, x(e.label), 1), d("div", He, x(e.value), 1)])]))), 128))])) : l("", !0)]),
|
|
687
|
+
d("div", { class: h(["w-crud-content", { "w-crud-content--rail": jn.value && !z.value }]) }, [d("div", {
|
|
675
688
|
ref_key: "conteudo",
|
|
676
|
-
ref:
|
|
689
|
+
ref: Yt,
|
|
677
690
|
class: "w-crud-content-main"
|
|
678
|
-
}, [
|
|
691
|
+
}, [Zt ? (_(), u("div", Ue, [d("div", {
|
|
679
692
|
ref_key: "sonda",
|
|
680
|
-
ref:
|
|
681
|
-
style:
|
|
682
|
-
}, null, 4)])) : l("", !0),
|
|
693
|
+
ref: Xt,
|
|
694
|
+
style: me({ width: xr.value ?? "0" })
|
|
695
|
+
}, null, 4)])) : l("", !0), D("table") ? (_(), u("div", {
|
|
683
696
|
key: 1,
|
|
684
|
-
class: h(["w-crud-table", { "w-crud-table--grouped":
|
|
685
|
-
}, [
|
|
686
|
-
d("span",
|
|
697
|
+
class: h(["w-crud-table", { "w-crud-table--grouped": U.value }])
|
|
698
|
+
}, [K.value && p.crud.selectedItems.value.length ? (_(), u("div", We, [
|
|
699
|
+
d("span", Ge, x(p.crud.selectedItems.value.length) + " selecionado(s) ", 1),
|
|
687
700
|
b(r.$slots, "bulk-actions", {
|
|
688
701
|
selected: p.crud.selectedItems.value,
|
|
689
702
|
crud: p.crud
|
|
@@ -715,20 +728,20 @@ var Ae = {
|
|
|
715
728
|
void 0,
|
|
716
729
|
{ top: !0 }
|
|
717
730
|
]])
|
|
718
|
-
])) : l("", !0), f(S(
|
|
731
|
+
])) : l("", !0), f(S(Ce), {
|
|
719
732
|
ref_key: "tableRef",
|
|
720
|
-
ref:
|
|
721
|
-
"expanded-rows":
|
|
722
|
-
"onUpdate:expandedRows": i[10] ||= (e) =>
|
|
723
|
-
value:
|
|
724
|
-
loading: p.skeleton ? p.crud.loading.value && !!
|
|
725
|
-
"row-group-mode":
|
|
726
|
-
"group-rows-by":
|
|
727
|
-
"expandable-row-groups":
|
|
728
|
-
"expanded-row-groups":
|
|
733
|
+
ref: Gn,
|
|
734
|
+
"expanded-rows": Ut.value,
|
|
735
|
+
"onUpdate:expandedRows": i[10] ||= (e) => Ut.value = e,
|
|
736
|
+
value: G.value,
|
|
737
|
+
loading: p.skeleton ? p.crud.loading.value && !!G.value.length : p.crud.loading.value,
|
|
738
|
+
"row-group-mode": U.value ? "subheader" : void 0,
|
|
739
|
+
"group-rows-by": Fn.value,
|
|
740
|
+
"expandable-row-groups": U.value,
|
|
741
|
+
"expanded-row-groups": U.value ? Ln.value : void 0,
|
|
729
742
|
paginator: "",
|
|
730
743
|
rows: p.crud.pagination.pageSize,
|
|
731
|
-
first:
|
|
744
|
+
first: rn.value,
|
|
732
745
|
"total-records": p.crud.pagination.rows,
|
|
733
746
|
"rows-per-page-options": [
|
|
734
747
|
10,
|
|
@@ -736,8 +749,8 @@ var Ae = {
|
|
|
736
749
|
50
|
|
737
750
|
],
|
|
738
751
|
"paginator-template": "CurrentPageReport PrevPageLink NextPageLink",
|
|
739
|
-
"current-page-report-template":
|
|
740
|
-
pt:
|
|
752
|
+
"current-page-report-template": kn.value,
|
|
753
|
+
pt: Cr.value,
|
|
741
754
|
lazy: "",
|
|
742
755
|
"striped-rows": "",
|
|
743
756
|
"removable-sort": "",
|
|
@@ -745,132 +758,86 @@ var Ae = {
|
|
|
745
758
|
"sort-field": p.crud.sort.field ?? void 0,
|
|
746
759
|
"sort-order": p.crud.sort.order,
|
|
747
760
|
"data-key": p.crud.config.pk || "id",
|
|
748
|
-
"table-style":
|
|
749
|
-
"edit-mode":
|
|
750
|
-
selection:
|
|
751
|
-
"selection-mode":
|
|
761
|
+
"table-style": Sr.value,
|
|
762
|
+
"edit-mode": qn.value ? "cell" : void 0,
|
|
763
|
+
selection: K.value ? p.crud.selectedItems.value : p.actionRail || p.contextMenu ? B.value : void 0,
|
|
764
|
+
"selection-mode": K.value ? void 0 : p.actionRail || p.contextMenu ? "single" : void 0,
|
|
752
765
|
"context-menu": p.contextMenu,
|
|
753
|
-
"context-menu-selection": p.contextMenu ?
|
|
754
|
-
"onUpdate:selection": i[11] ||= (e) =>
|
|
755
|
-
"onUpdate:contextMenuSelection": i[12] ||= (e) =>
|
|
756
|
-
"onUpdate:expandedRowGroups":
|
|
757
|
-
onRowContextmenu:
|
|
758
|
-
"row-class":
|
|
759
|
-
onRowClick:
|
|
766
|
+
"context-menu-selection": p.contextMenu ? B.value : void 0,
|
|
767
|
+
"onUpdate:selection": i[11] ||= (e) => K.value ? p.crud.selectedItems.value = e : B.value = e,
|
|
768
|
+
"onUpdate:contextMenuSelection": i[12] ||= (e) => B.value = e,
|
|
769
|
+
"onUpdate:expandedRowGroups": Rn,
|
|
770
|
+
onRowContextmenu: fr,
|
|
771
|
+
"row-class": cr,
|
|
772
|
+
onRowClick: lr,
|
|
760
773
|
onPage: p.crud.onPage,
|
|
761
774
|
onSort: i[13] ||= (e) => p.crud.onSort({
|
|
762
775
|
sortField: e.sortField,
|
|
763
776
|
sortOrder: e.sortOrder
|
|
764
777
|
}),
|
|
765
|
-
onRowExpand: i[14] ||= (e) =>
|
|
766
|
-
onRowCollapse: i[15] ||= (e) =>
|
|
767
|
-
onCellEditComplete:
|
|
768
|
-
},
|
|
769
|
-
header: w(() => [d("div",
|
|
770
|
-
p.showSearch ||
|
|
771
|
-
|
|
772
|
-
"
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
778
|
+
onRowExpand: i[14] ||= (e) => zt("row-expand", e.data),
|
|
779
|
+
onRowCollapse: i[15] ||= (e) => zt("row-collapse", e.data),
|
|
780
|
+
onCellEditComplete: Zn
|
|
781
|
+
}, le({
|
|
782
|
+
header: w(() => [d("div", Ke, [d("div", qe, [
|
|
783
|
+
p.showSearch || z.value || Y.value ? (_(), u("div", Je, [
|
|
784
|
+
p.showSearch ? (_(), c(S(Oe), { key: 0 }, {
|
|
785
|
+
default: w(() => [f(S(ke), { class: "pi pi-search" }), f(S(Te), {
|
|
786
|
+
"model-value": p.crud.search.value,
|
|
787
|
+
placeholder: "Buscar...",
|
|
788
|
+
"aria-label": "Buscar",
|
|
789
|
+
class: "w-crud-search",
|
|
790
|
+
onInput: p.crud.onSearch
|
|
791
|
+
}, null, 8, ["model-value", "onInput"])]),
|
|
792
|
+
_: 1
|
|
793
|
+
})) : l("", !0),
|
|
794
|
+
Y.value ? (_(), u("span", Ye, [f(e, {
|
|
795
|
+
variant: "ghost",
|
|
796
|
+
"icon-only": "",
|
|
797
|
+
icon: "pi pi-filter",
|
|
798
|
+
"aria-label": "Filtros",
|
|
799
|
+
"aria-haspopup": "dialog",
|
|
800
|
+
onClick: i[2] ||= (e) => X.value = !0
|
|
801
|
+
}), er.value > 0 ? (_(), u("span", Xe, x(er.value), 1)) : l("", !0)])) : l("", !0),
|
|
802
|
+
z.value ? (_(), u(o, { key: 2 }, [b(r.$slots, "rail-actions", {
|
|
803
|
+
selected: Z.value,
|
|
804
|
+
crud: p.crud
|
|
805
|
+
}), f(e, {
|
|
806
|
+
variant: "ghost",
|
|
807
|
+
"icon-only": "",
|
|
808
|
+
icon: "pi pi-ellipsis-v",
|
|
809
|
+
"aria-label": "Ações",
|
|
810
|
+
"aria-haspopup": "menu",
|
|
811
|
+
class: "w-crud-rail-menu-btn",
|
|
812
|
+
onClick: i[3] ||= (e) => Nn.value?.toggle(e)
|
|
813
|
+
})], 64)) : l("", !0)
|
|
814
|
+
])) : l("", !0),
|
|
815
|
+
!p.showHeader && On.value ? (_(), u("span", {
|
|
792
816
|
key: 1,
|
|
793
817
|
class: "w-crud-count",
|
|
794
818
|
"aria-live": "polite",
|
|
795
819
|
"aria-busy": p.crud.loading.value || void 0
|
|
796
|
-
}, x(
|
|
820
|
+
}, x(Dn.value), 9, Ze)) : l("", !0),
|
|
797
821
|
b(r.$slots, "toolbar-start"),
|
|
798
|
-
|
|
799
|
-
key: 0,
|
|
800
|
-
"model-value": p.crud.columnFilters[Y(e)] ?? "",
|
|
801
|
-
placeholder: e.filter?.placeholder || e.header,
|
|
802
|
-
"aria-label": e.filter?.placeholder || e.header,
|
|
803
|
-
size: "small",
|
|
804
|
-
onInput: (t) => qn(e, t.target.value)
|
|
805
|
-
}, null, 8, [
|
|
806
|
-
"model-value",
|
|
807
|
-
"placeholder",
|
|
808
|
-
"aria-label",
|
|
809
|
-
"onInput"
|
|
810
|
-
])) : e.filter?.type === "select" ? (_(), c(S(we), {
|
|
811
|
-
key: 1,
|
|
812
|
-
"model-value": p.crud.columnFilters[Y(e)],
|
|
813
|
-
options: e.filter?.options,
|
|
814
|
-
"option-label": "label",
|
|
815
|
-
"option-value": "value",
|
|
816
|
-
placeholder: e.filter?.placeholder || e.header,
|
|
817
|
-
"aria-label": e.filter?.placeholder || e.header,
|
|
818
|
-
"show-clear": "",
|
|
819
|
-
size: "small",
|
|
820
|
-
"onUpdate:modelValue": (t) => p.crud.setColumnFilter(Y(e), t)
|
|
821
|
-
}, null, 8, [
|
|
822
|
-
"model-value",
|
|
823
|
-
"options",
|
|
824
|
-
"placeholder",
|
|
825
|
-
"aria-label",
|
|
826
|
-
"onUpdate:modelValue"
|
|
827
|
-
])) : e.filter?.type === "boolean" ? (_(), c(S(we), {
|
|
828
|
-
key: 2,
|
|
829
|
-
"model-value": p.crud.columnFilters[Y(e)],
|
|
830
|
-
options: Gn,
|
|
831
|
-
"option-label": "label",
|
|
832
|
-
"option-value": "value",
|
|
833
|
-
placeholder: e.filter?.placeholder || e.header,
|
|
834
|
-
"aria-label": e.filter?.placeholder || e.header,
|
|
835
|
-
"show-clear": "",
|
|
836
|
-
size: "small",
|
|
837
|
-
"onUpdate:modelValue": (t) => p.crud.setColumnFilter(Y(e), t)
|
|
838
|
-
}, null, 8, [
|
|
839
|
-
"model-value",
|
|
840
|
-
"placeholder",
|
|
841
|
-
"aria-label",
|
|
842
|
-
"onUpdate:modelValue"
|
|
843
|
-
])) : e.filter?.type === "numeric" ? (_(), c(S(Ce), {
|
|
844
|
-
key: 3,
|
|
845
|
-
"model-value": p.crud.columnFilters[Y(e)] ?? null,
|
|
846
|
-
placeholder: e.filter?.placeholder || e.header,
|
|
847
|
-
"aria-label": e.filter?.placeholder || e.header,
|
|
848
|
-
size: "small",
|
|
849
|
-
"onUpdate:modelValue": (t) => p.crud.setColumnFilter(Y(e), t)
|
|
850
|
-
}, null, 8, [
|
|
851
|
-
"model-value",
|
|
852
|
-
"placeholder",
|
|
853
|
-
"aria-label",
|
|
854
|
-
"onUpdate:modelValue"
|
|
855
|
-
])) : l("", !0)], 64))), 128)),
|
|
856
|
-
b(r.$slots, "toolbar-filters"),
|
|
857
|
-
Object.keys(p.crud.columnFilters).length ? (_(), c(e, {
|
|
822
|
+
Y.value ? l("", !0) : (_(), c(ae, {
|
|
858
823
|
key: 2,
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
824
|
+
crud: p.crud,
|
|
825
|
+
columns: q.value,
|
|
826
|
+
"param-of": J,
|
|
827
|
+
"on-text": $n
|
|
828
|
+
}, {
|
|
829
|
+
default: w(() => [b(r.$slots, "toolbar-filters")]),
|
|
830
|
+
_: 3
|
|
831
|
+
}, 8, ["crud", "columns"]))
|
|
832
|
+
]), d("div", Qe, [
|
|
866
833
|
b(r.$slots, "toolbar-actions"),
|
|
867
|
-
|
|
834
|
+
H.value.length > 1 ? (_(), u(o, { key: 0 }, [T(f(e, {
|
|
868
835
|
variant: "ghost",
|
|
869
836
|
"icon-only": "",
|
|
870
837
|
icon: "pi pi-angle-double-down",
|
|
871
838
|
"aria-label": "Expandir grupos",
|
|
872
839
|
size: "sm",
|
|
873
|
-
onClick: i[4] ||= (e) =>
|
|
840
|
+
onClick: i[4] ||= (e) => Bn(!1)
|
|
874
841
|
}, null, 512), [[
|
|
875
842
|
a,
|
|
876
843
|
"Expandir grupos",
|
|
@@ -882,7 +849,7 @@ var Ae = {
|
|
|
882
849
|
icon: "pi pi-angle-double-up",
|
|
883
850
|
"aria-label": "Recolher grupos",
|
|
884
851
|
size: "sm",
|
|
885
|
-
onClick: i[5] ||= (e) =>
|
|
852
|
+
onClick: i[5] ||= (e) => Bn(!0)
|
|
886
853
|
}, null, 512), [[
|
|
887
854
|
a,
|
|
888
855
|
"Recolher grupos",
|
|
@@ -896,7 +863,7 @@ var Ae = {
|
|
|
896
863
|
"aria-label": "Colunas",
|
|
897
864
|
"aria-haspopup": "dialog",
|
|
898
865
|
size: "sm",
|
|
899
|
-
onClick: i[6] ||= (e) =>
|
|
866
|
+
onClick: i[6] ||= (e) => an.value?.toggle(e)
|
|
900
867
|
}, null, 512), [[
|
|
901
868
|
a,
|
|
902
869
|
"Colunas",
|
|
@@ -904,16 +871,16 @@ var Ae = {
|
|
|
904
871
|
{ top: !0 }
|
|
905
872
|
]]), f(t, {
|
|
906
873
|
ref_key: "chooser",
|
|
907
|
-
ref:
|
|
874
|
+
ref: an
|
|
908
875
|
}, {
|
|
909
|
-
default: w(() => [d("div",
|
|
876
|
+
default: w(() => [d("div", $e, [(_(!0), u(o, null, y(fn.value, (e) => (_(), u("div", {
|
|
910
877
|
key: e.field,
|
|
911
878
|
class: "w-crud-chooser__item"
|
|
912
|
-
}, [f(S(
|
|
913
|
-
"model-value": !
|
|
879
|
+
}, [f(S(De), {
|
|
880
|
+
"model-value": !O.hidden.includes(e.field),
|
|
914
881
|
"input-id": `wcrud-col-${e.field}`,
|
|
915
882
|
binary: "",
|
|
916
|
-
"onUpdate:modelValue": (t) =>
|
|
883
|
+
"onUpdate:modelValue": (t) => pn(e.field, !!t)
|
|
917
884
|
}, null, 8, [
|
|
918
885
|
"model-value",
|
|
919
886
|
"input-id",
|
|
@@ -921,32 +888,32 @@ var Ae = {
|
|
|
921
888
|
]), d("label", {
|
|
922
889
|
for: `wcrud-col-${e.field}`,
|
|
923
890
|
class: "w-crud-chooser__label"
|
|
924
|
-
}, x(e.header), 9,
|
|
891
|
+
}, x(e.header), 9, et)]))), 128))])]),
|
|
925
892
|
_: 1
|
|
926
893
|
}, 512)], 64)) : l("", !0),
|
|
927
|
-
p.exportCsv && !
|
|
894
|
+
p.exportCsv && !z.value ? T((_(), c(e, {
|
|
928
895
|
key: 2,
|
|
929
896
|
variant: "ghost",
|
|
930
897
|
"icon-only": "",
|
|
931
898
|
icon: "pi pi-download",
|
|
932
|
-
"aria-label":
|
|
899
|
+
"aria-label": M.value,
|
|
933
900
|
size: "sm",
|
|
934
|
-
loading:
|
|
935
|
-
onClick:
|
|
901
|
+
loading: Q.value,
|
|
902
|
+
onClick: _r
|
|
936
903
|
}, null, 8, ["aria-label", "loading"])), [[
|
|
937
904
|
a,
|
|
938
|
-
|
|
905
|
+
M.value,
|
|
939
906
|
void 0,
|
|
940
907
|
{ top: !0 }
|
|
941
908
|
]]) : l("", !0),
|
|
942
|
-
|
|
909
|
+
tn.value ? (_(), u("div", tt, [T(f(e, {
|
|
943
910
|
"icon-only": "",
|
|
944
911
|
icon: "pi pi-table",
|
|
945
912
|
"aria-label": "Ver como tabela",
|
|
946
|
-
"aria-pressed":
|
|
913
|
+
"aria-pressed": D("table"),
|
|
947
914
|
size: "sm",
|
|
948
|
-
variant:
|
|
949
|
-
onClick: i[7] ||= (e) =>
|
|
915
|
+
variant: D("table") ? "secondary" : "ghost",
|
|
916
|
+
onClick: i[7] ||= (e) => nn("table")
|
|
950
917
|
}, null, 8, ["aria-pressed", "variant"]), [[
|
|
951
918
|
a,
|
|
952
919
|
"Ver como tabela",
|
|
@@ -956,17 +923,17 @@ var Ae = {
|
|
|
956
923
|
"icon-only": "",
|
|
957
924
|
icon: "pi pi-th-large",
|
|
958
925
|
"aria-label": "Ver como cards",
|
|
959
|
-
"aria-pressed":
|
|
926
|
+
"aria-pressed": D("cards"),
|
|
960
927
|
size: "sm",
|
|
961
|
-
variant:
|
|
962
|
-
onClick: i[8] ||= (e) =>
|
|
928
|
+
variant: D("cards") ? "secondary" : "ghost",
|
|
929
|
+
onClick: i[8] ||= (e) => nn("cards")
|
|
963
930
|
}, null, 8, ["aria-pressed", "variant"]), [[
|
|
964
931
|
a,
|
|
965
932
|
"Ver como cards",
|
|
966
933
|
void 0,
|
|
967
934
|
{ top: !0 }
|
|
968
935
|
]])])) : l("", !0),
|
|
969
|
-
!p.showHeader &&
|
|
936
|
+
!p.showHeader && R.value && !p.actionRail ? (_(), c(e, {
|
|
970
937
|
key: 4,
|
|
971
938
|
label: "Novo",
|
|
972
939
|
icon: "pi pi-plus",
|
|
@@ -977,32 +944,32 @@ var Ae = {
|
|
|
977
944
|
key: 0,
|
|
978
945
|
variant: "rows",
|
|
979
946
|
count: Math.min(p.crud.pagination.pageSize, 8)
|
|
980
|
-
}, null, 8, ["count"])), [[
|
|
981
|
-
i[
|
|
982
|
-
i[
|
|
983
|
-
d("p",
|
|
947
|
+
}, null, 8, ["count"])), [[be, S(Ht)]]) : b(r.$slots, "empty", {}, () => [d("div", nt, [
|
|
948
|
+
i[30] ||= d("div", { class: "w-crud-empty-icon" }, [d("i", { class: "pi pi-inbox" })], -1),
|
|
949
|
+
i[31] ||= d("p", { class: "w-crud-empty-title" }, "Nenhum registro encontrado", -1),
|
|
950
|
+
d("p", rt, " Tente ajustar sua busca" + x(R.value ? " ou crie um novo registro" : ""), 1)
|
|
984
951
|
])], void 0, 1)]),
|
|
985
952
|
default: w(() => [
|
|
986
|
-
|
|
953
|
+
K.value ? (_(), c(S(we), {
|
|
987
954
|
key: 0,
|
|
988
955
|
"selection-mode": "multiple",
|
|
989
956
|
class: "w-col-narrow"
|
|
990
957
|
})) : l("", !0),
|
|
991
|
-
p.expandable ? (_(), c(S(
|
|
958
|
+
p.expandable ? (_(), c(S(we), {
|
|
992
959
|
key: 1,
|
|
993
960
|
expander: "",
|
|
994
961
|
class: "w-col-narrow"
|
|
995
962
|
})) : l("", !0),
|
|
996
|
-
(_(!0), u(o, null, y(
|
|
963
|
+
(_(!0), u(o, null, y(k.value, (e) => (_(), c(S(we), {
|
|
997
964
|
key: e.field,
|
|
998
965
|
field: e.field,
|
|
999
966
|
header: e.header,
|
|
1000
967
|
sortable: e.sortable,
|
|
1001
968
|
"sort-field": e.sortField,
|
|
1002
|
-
style:
|
|
1003
|
-
"header-class":
|
|
1004
|
-
"body-class":
|
|
1005
|
-
},
|
|
969
|
+
style: me(e.style),
|
|
970
|
+
"header-class": br(e),
|
|
971
|
+
"body-class": br(e)
|
|
972
|
+
}, le({
|
|
1006
973
|
body: w(({ data: t }) => [b(r.$slots, `column-${e.field}`, {
|
|
1007
974
|
data: t,
|
|
1008
975
|
value: t[e.field]
|
|
@@ -1016,16 +983,16 @@ var Ae = {
|
|
|
1016
983
|
"row-data"
|
|
1017
984
|
])])]),
|
|
1018
985
|
_: 2
|
|
1019
|
-
}, [
|
|
986
|
+
}, [qn.value && Xn(e.field) ? {
|
|
1020
987
|
name: "editor",
|
|
1021
|
-
fn: w(({ data: t }) => [["number", "currency"].includes(
|
|
988
|
+
fn: w(({ data: t }) => [["number", "currency"].includes(Xn(e.field)?.type || "") ? (_(), c(S(Ee), {
|
|
1022
989
|
key: 0,
|
|
1023
990
|
"model-value": t[e.field] ?? null,
|
|
1024
991
|
fluid: "",
|
|
1025
992
|
"onUpdate:modelValue": (n) => {
|
|
1026
993
|
t[e.field] = n;
|
|
1027
994
|
}
|
|
1028
|
-
}, null, 8, ["model-value", "onUpdate:modelValue"])) : (_(), c(S(
|
|
995
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])) : (_(), c(S(Te), {
|
|
1029
996
|
key: 1,
|
|
1030
997
|
"model-value": t[e.field] ?? "",
|
|
1031
998
|
fluid: "",
|
|
@@ -1043,21 +1010,21 @@ var Ae = {
|
|
|
1043
1010
|
"header-class",
|
|
1044
1011
|
"body-class"
|
|
1045
1012
|
]))), 128)),
|
|
1046
|
-
|
|
1013
|
+
vn.value && !p.actionRail ? (_(), c(S(we), {
|
|
1047
1014
|
key: 2,
|
|
1048
1015
|
"header-class": "w-crud-actions-header",
|
|
1049
|
-
style:
|
|
1016
|
+
style: me({ width: yn.value })
|
|
1050
1017
|
}, {
|
|
1051
|
-
body: w(({ data: t }) => [d("div",
|
|
1018
|
+
body: w(({ data: t }) => [d("div", st, [(_(!0), u(o, null, y(A.value, (n) => (_(), u(o, { key: n.action }, [I(n, t) ? T((_(), c(e, {
|
|
1052
1019
|
key: 0,
|
|
1053
1020
|
"icon-only": "",
|
|
1054
1021
|
icon: n.icon,
|
|
1055
|
-
"aria-label":
|
|
1056
|
-
title: n.disabledReason ?
|
|
1022
|
+
"aria-label": j(n, t),
|
|
1023
|
+
title: n.disabledReason ? j(n, t) : void 0,
|
|
1057
1024
|
size: "sm",
|
|
1058
1025
|
variant: n.severity === "danger" ? "danger" : "ghost",
|
|
1059
|
-
disabled:
|
|
1060
|
-
onClick: (e) =>
|
|
1026
|
+
disabled: L(n, t),
|
|
1027
|
+
onClick: (e) => N(n, t)
|
|
1061
1028
|
}, null, 8, [
|
|
1062
1029
|
"icon",
|
|
1063
1030
|
"aria-label",
|
|
@@ -1067,7 +1034,7 @@ var Ae = {
|
|
|
1067
1034
|
"onClick"
|
|
1068
1035
|
])), [[
|
|
1069
1036
|
a,
|
|
1070
|
-
n.disabledReason ?
|
|
1037
|
+
n.disabledReason ? j(n, t) : n.tooltip,
|
|
1071
1038
|
void 0,
|
|
1072
1039
|
{ top: !0 }
|
|
1073
1040
|
]]) : l("", !0)], 64))), 128)), b(r.$slots, "row-actions", {
|
|
@@ -1078,10 +1045,10 @@ var Ae = {
|
|
|
1078
1045
|
}, 8, ["style"])) : l("", !0)
|
|
1079
1046
|
]),
|
|
1080
1047
|
_: 2
|
|
1081
|
-
}, [
|
|
1048
|
+
}, [U.value ? {
|
|
1082
1049
|
name: "groupheader",
|
|
1083
|
-
fn: w(({ data: e }) => [
|
|
1084
|
-
value: String(
|
|
1050
|
+
fn: w(({ data: e }) => [W(e) ? (_(), u("span", it, [b(r.$slots, "group-header", g(m(W(e))), () => [d("span", at, x(W(e).label), 1)]), d("span", ot, [b(r.$slots, "group-meta", g(m(W(e))), () => [f(S(je), {
|
|
1051
|
+
value: String(W(e).count),
|
|
1085
1052
|
severity: "secondary",
|
|
1086
1053
|
rounded: ""
|
|
1087
1054
|
}, null, 8, ["value"])])])])) : l("", !0)]),
|
|
@@ -1113,112 +1080,66 @@ var Ae = {
|
|
|
1113
1080
|
"context-menu",
|
|
1114
1081
|
"context-menu-selection",
|
|
1115
1082
|
"onPage"
|
|
1116
|
-
])], 2)) : (_(), u("div",
|
|
1117
|
-
d("div",
|
|
1118
|
-
p.showSearch ||
|
|
1119
|
-
|
|
1120
|
-
"
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1083
|
+
])], 2)) : (_(), u("div", ct, [
|
|
1084
|
+
d("div", lt, [d("div", ut, [
|
|
1085
|
+
p.showSearch || z.value || Y.value ? (_(), u("div", dt, [
|
|
1086
|
+
p.showSearch ? (_(), c(S(Oe), { key: 0 }, {
|
|
1087
|
+
default: w(() => [f(S(ke), { class: "pi pi-search" }), f(S(Te), {
|
|
1088
|
+
"model-value": p.crud.search.value,
|
|
1089
|
+
placeholder: "Buscar...",
|
|
1090
|
+
"aria-label": "Buscar",
|
|
1091
|
+
class: "w-crud-search",
|
|
1092
|
+
onInput: p.crud.onSearch
|
|
1093
|
+
}, null, 8, ["model-value", "onInput"])]),
|
|
1094
|
+
_: 1
|
|
1095
|
+
})) : l("", !0),
|
|
1096
|
+
Y.value ? (_(), u("span", ft, [f(e, {
|
|
1097
|
+
variant: "ghost",
|
|
1098
|
+
"icon-only": "",
|
|
1099
|
+
icon: "pi pi-filter",
|
|
1100
|
+
"aria-label": "Filtros",
|
|
1101
|
+
"aria-haspopup": "dialog",
|
|
1102
|
+
onClick: i[16] ||= (e) => X.value = !0
|
|
1103
|
+
}), er.value > 0 ? (_(), u("span", pt, x(er.value), 1)) : l("", !0)])) : l("", !0),
|
|
1104
|
+
z.value ? (_(), u(o, { key: 2 }, [b(r.$slots, "rail-actions", {
|
|
1105
|
+
selected: Z.value,
|
|
1106
|
+
crud: p.crud
|
|
1107
|
+
}), f(e, {
|
|
1108
|
+
variant: "ghost",
|
|
1109
|
+
"icon-only": "",
|
|
1110
|
+
icon: "pi pi-ellipsis-v",
|
|
1111
|
+
"aria-label": "Ações",
|
|
1112
|
+
"aria-haspopup": "menu",
|
|
1113
|
+
class: "w-crud-rail-menu-btn",
|
|
1114
|
+
onClick: i[17] ||= (e) => Nn.value?.toggle(e)
|
|
1115
|
+
})], 64)) : l("", !0)
|
|
1116
|
+
])) : l("", !0),
|
|
1117
|
+
!p.showHeader && On.value ? (_(), u("span", {
|
|
1140
1118
|
key: 1,
|
|
1141
1119
|
class: "w-crud-count",
|
|
1142
1120
|
"aria-live": "polite",
|
|
1143
1121
|
"aria-busy": p.crud.loading.value || void 0
|
|
1144
|
-
}, x(
|
|
1122
|
+
}, x(Dn.value), 9, mt)) : l("", !0),
|
|
1145
1123
|
b(r.$slots, "toolbar-start"),
|
|
1146
|
-
|
|
1147
|
-
key: 0,
|
|
1148
|
-
"model-value": p.crud.columnFilters[Y(e)] ?? "",
|
|
1149
|
-
placeholder: e.filter?.placeholder || e.header,
|
|
1150
|
-
"aria-label": e.filter?.placeholder || e.header,
|
|
1151
|
-
size: "small",
|
|
1152
|
-
onInput: (t) => qn(e, t.target.value)
|
|
1153
|
-
}, null, 8, [
|
|
1154
|
-
"model-value",
|
|
1155
|
-
"placeholder",
|
|
1156
|
-
"aria-label",
|
|
1157
|
-
"onInput"
|
|
1158
|
-
])) : e.filter?.type === "select" ? (_(), c(S(we), {
|
|
1159
|
-
key: 1,
|
|
1160
|
-
"model-value": p.crud.columnFilters[Y(e)],
|
|
1161
|
-
options: e.filter?.options,
|
|
1162
|
-
"option-label": "label",
|
|
1163
|
-
"option-value": "value",
|
|
1164
|
-
placeholder: e.filter?.placeholder || e.header,
|
|
1165
|
-
"aria-label": e.filter?.placeholder || e.header,
|
|
1166
|
-
"show-clear": "",
|
|
1167
|
-
size: "small",
|
|
1168
|
-
"onUpdate:modelValue": (t) => p.crud.setColumnFilter(Y(e), t)
|
|
1169
|
-
}, null, 8, [
|
|
1170
|
-
"model-value",
|
|
1171
|
-
"options",
|
|
1172
|
-
"placeholder",
|
|
1173
|
-
"aria-label",
|
|
1174
|
-
"onUpdate:modelValue"
|
|
1175
|
-
])) : e.filter?.type === "boolean" ? (_(), c(S(we), {
|
|
1176
|
-
key: 2,
|
|
1177
|
-
"model-value": p.crud.columnFilters[Y(e)],
|
|
1178
|
-
options: Gn,
|
|
1179
|
-
"option-label": "label",
|
|
1180
|
-
"option-value": "value",
|
|
1181
|
-
placeholder: e.filter?.placeholder || e.header,
|
|
1182
|
-
"aria-label": e.filter?.placeholder || e.header,
|
|
1183
|
-
"show-clear": "",
|
|
1184
|
-
size: "small",
|
|
1185
|
-
"onUpdate:modelValue": (t) => p.crud.setColumnFilter(Y(e), t)
|
|
1186
|
-
}, null, 8, [
|
|
1187
|
-
"model-value",
|
|
1188
|
-
"placeholder",
|
|
1189
|
-
"aria-label",
|
|
1190
|
-
"onUpdate:modelValue"
|
|
1191
|
-
])) : e.filter?.type === "numeric" ? (_(), c(S(Ce), {
|
|
1192
|
-
key: 3,
|
|
1193
|
-
"model-value": p.crud.columnFilters[Y(e)] ?? null,
|
|
1194
|
-
placeholder: e.filter?.placeholder || e.header,
|
|
1195
|
-
"aria-label": e.filter?.placeholder || e.header,
|
|
1196
|
-
size: "small",
|
|
1197
|
-
"onUpdate:modelValue": (t) => p.crud.setColumnFilter(Y(e), t)
|
|
1198
|
-
}, null, 8, [
|
|
1199
|
-
"model-value",
|
|
1200
|
-
"placeholder",
|
|
1201
|
-
"aria-label",
|
|
1202
|
-
"onUpdate:modelValue"
|
|
1203
|
-
])) : l("", !0)], 64))), 128)),
|
|
1204
|
-
b(r.$slots, "toolbar-filters"),
|
|
1205
|
-
Object.keys(p.crud.columnFilters).length ? (_(), c(e, {
|
|
1124
|
+
Y.value ? l("", !0) : (_(), c(ae, {
|
|
1206
1125
|
key: 2,
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1126
|
+
crud: p.crud,
|
|
1127
|
+
columns: q.value,
|
|
1128
|
+
"param-of": J,
|
|
1129
|
+
"on-text": $n
|
|
1130
|
+
}, {
|
|
1131
|
+
default: w(() => [b(r.$slots, "toolbar-filters")]),
|
|
1132
|
+
_: 3
|
|
1133
|
+
}, 8, ["crud", "columns"]))
|
|
1134
|
+
]), d("div", ht, [
|
|
1214
1135
|
b(r.$slots, "toolbar-actions"),
|
|
1215
|
-
|
|
1136
|
+
H.value.length > 1 ? (_(), u(o, { key: 0 }, [T(f(e, {
|
|
1216
1137
|
variant: "ghost",
|
|
1217
1138
|
"icon-only": "",
|
|
1218
1139
|
icon: "pi pi-angle-double-down",
|
|
1219
1140
|
"aria-label": "Expandir grupos",
|
|
1220
1141
|
size: "sm",
|
|
1221
|
-
onClick: i[18] ||= (e) =>
|
|
1142
|
+
onClick: i[18] ||= (e) => Bn(!1)
|
|
1222
1143
|
}, null, 512), [[
|
|
1223
1144
|
a,
|
|
1224
1145
|
"Expandir grupos",
|
|
@@ -1230,36 +1151,36 @@ var Ae = {
|
|
|
1230
1151
|
icon: "pi pi-angle-double-up",
|
|
1231
1152
|
"aria-label": "Recolher grupos",
|
|
1232
1153
|
size: "sm",
|
|
1233
|
-
onClick: i[19] ||= (e) =>
|
|
1154
|
+
onClick: i[19] ||= (e) => Bn(!0)
|
|
1234
1155
|
}, null, 512), [[
|
|
1235
1156
|
a,
|
|
1236
1157
|
"Recolher grupos",
|
|
1237
1158
|
void 0,
|
|
1238
1159
|
{ top: !0 }
|
|
1239
1160
|
]])], 64)) : l("", !0),
|
|
1240
|
-
p.exportCsv && !
|
|
1161
|
+
p.exportCsv && !z.value ? T((_(), c(e, {
|
|
1241
1162
|
key: 1,
|
|
1242
1163
|
variant: "ghost",
|
|
1243
1164
|
"icon-only": "",
|
|
1244
1165
|
icon: "pi pi-download",
|
|
1245
|
-
"aria-label":
|
|
1166
|
+
"aria-label": M.value,
|
|
1246
1167
|
size: "sm",
|
|
1247
|
-
loading:
|
|
1248
|
-
onClick:
|
|
1168
|
+
loading: Q.value,
|
|
1169
|
+
onClick: _r
|
|
1249
1170
|
}, null, 8, ["aria-label", "loading"])), [[
|
|
1250
1171
|
a,
|
|
1251
|
-
|
|
1172
|
+
M.value,
|
|
1252
1173
|
void 0,
|
|
1253
1174
|
{ top: !0 }
|
|
1254
1175
|
]]) : l("", !0),
|
|
1255
|
-
|
|
1176
|
+
tn.value ? (_(), u("div", gt, [T(f(e, {
|
|
1256
1177
|
"icon-only": "",
|
|
1257
1178
|
icon: "pi pi-table",
|
|
1258
1179
|
"aria-label": "Ver como tabela",
|
|
1259
|
-
"aria-pressed":
|
|
1180
|
+
"aria-pressed": D("table"),
|
|
1260
1181
|
size: "sm",
|
|
1261
|
-
variant:
|
|
1262
|
-
onClick: i[20] ||= (e) =>
|
|
1182
|
+
variant: D("table") ? "secondary" : "ghost",
|
|
1183
|
+
onClick: i[20] ||= (e) => nn("table")
|
|
1263
1184
|
}, null, 8, ["aria-pressed", "variant"]), [[
|
|
1264
1185
|
a,
|
|
1265
1186
|
"Ver como tabela",
|
|
@@ -1269,36 +1190,36 @@ var Ae = {
|
|
|
1269
1190
|
"icon-only": "",
|
|
1270
1191
|
icon: "pi pi-th-large",
|
|
1271
1192
|
"aria-label": "Ver como cards",
|
|
1272
|
-
"aria-pressed":
|
|
1193
|
+
"aria-pressed": D("cards"),
|
|
1273
1194
|
size: "sm",
|
|
1274
|
-
variant:
|
|
1275
|
-
onClick: i[21] ||= (e) =>
|
|
1195
|
+
variant: D("cards") ? "secondary" : "ghost",
|
|
1196
|
+
onClick: i[21] ||= (e) => nn("cards")
|
|
1276
1197
|
}, null, 8, ["aria-pressed", "variant"]), [[
|
|
1277
1198
|
a,
|
|
1278
1199
|
"Ver como cards",
|
|
1279
1200
|
void 0,
|
|
1280
1201
|
{ top: !0 }
|
|
1281
1202
|
]])])) : l("", !0),
|
|
1282
|
-
!p.showHeader &&
|
|
1203
|
+
!p.showHeader && R.value && !p.actionRail ? (_(), c(e, {
|
|
1283
1204
|
key: 3,
|
|
1284
1205
|
label: "Novo",
|
|
1285
1206
|
icon: "pi pi-plus",
|
|
1286
1207
|
onClick: i[22] ||= (e) => p.crud.openCreateDialog()
|
|
1287
1208
|
})) : l("", !0)
|
|
1288
1209
|
])]),
|
|
1289
|
-
p.crud.loading.value && (!p.skeleton || !p.crud.items.value.length) ? (_(), u("div",
|
|
1210
|
+
p.crud.loading.value && (!p.skeleton || !p.crud.items.value.length) ? (_(), u("div", _t, [p.skeleton ? (_(), u(o, { key: 0 }, [S(Ht) ? (_(), c(ne, {
|
|
1290
1211
|
key: 0,
|
|
1291
1212
|
variant: "card"
|
|
1292
|
-
})) : l("", !0)], 64)) : (_(), u("i",
|
|
1213
|
+
})) : l("", !0)], 64)) : (_(), u("i", vt))])) : p.crud.items.value.length ? (_(!0), u(o, { key: 2 }, y(Vn.value, (t) => (_(), u(o, { key: t.group?.groupKey ?? "" }, [t.group ? (_(), u("div", xt, [d("button", {
|
|
1293
1214
|
type: "button",
|
|
1294
1215
|
class: "w-crud-group-toggle",
|
|
1295
1216
|
"aria-expanded": !t.group.collapsed,
|
|
1296
1217
|
"aria-label": `${t.group.collapsed ? "Expandir" : "Recolher"} ${t.group.label}`,
|
|
1297
|
-
onClick: (e) =>
|
|
1218
|
+
onClick: (e) => zn(t.group.groupKey)
|
|
1298
1219
|
}, [d("i", {
|
|
1299
1220
|
class: h(t.group.collapsed ? "pi pi-chevron-right" : "pi pi-chevron-down"),
|
|
1300
1221
|
"aria-hidden": "true"
|
|
1301
|
-
}, null, 2)], 8,
|
|
1222
|
+
}, null, 2)], 8, St), d("span", Ct, [b(r.$slots, "group-header", fe({ ref_for: !0 }, t.group), () => [d("span", wt, x(t.group.label), 1)]), d("span", Tt, [b(r.$slots, "group-meta", fe({ ref_for: !0 }, t.group), () => [f(S(je), {
|
|
1302
1223
|
value: String(t.group.count),
|
|
1303
1224
|
severity: "secondary",
|
|
1304
1225
|
rounded: ""
|
|
@@ -1310,28 +1231,28 @@ var Ae = {
|
|
|
1310
1231
|
}, [(_(!0), u(o, null, y(t.items, (n, ee) => (_(), u("div", {
|
|
1311
1232
|
key: n[p.crud.config.pk || "id"] ?? ee,
|
|
1312
1233
|
role: "listitem",
|
|
1313
|
-
class: h(p.cardBare ? "w-crud-card-bare" : ["w-crud-card", { "w-crud-card--selected":
|
|
1314
|
-
onClick: (e) =>
|
|
1315
|
-
onDblclick: (e) =>
|
|
1316
|
-
onContextmenu: (e) => !p.cardBare &&
|
|
1234
|
+
class: h(p.cardBare ? "w-crud-card-bare" : ["w-crud-card", { "w-crud-card--selected": B.value === n || K.value && Un(n) }]),
|
|
1235
|
+
onClick: (e) => ur(e, n),
|
|
1236
|
+
onDblclick: (e) => dr(n),
|
|
1237
|
+
onContextmenu: (e) => !p.cardBare && pr(e, n)
|
|
1317
1238
|
}, [b(r.$slots, "card", {
|
|
1318
1239
|
data: n,
|
|
1319
1240
|
crud: p.crud,
|
|
1320
|
-
columns:
|
|
1241
|
+
columns: hn.value,
|
|
1321
1242
|
index: t.offset + ee
|
|
1322
|
-
}, () => [d("div",
|
|
1243
|
+
}, () => [d("div", Ot, [K.value ? (_(), u("label", kt, [f(S(De), {
|
|
1323
1244
|
binary: "",
|
|
1324
|
-
"model-value":
|
|
1325
|
-
"aria-label": `Selecionar ${String(n[
|
|
1326
|
-
"onUpdate:modelValue": (e) =>
|
|
1245
|
+
"model-value": Un(n),
|
|
1246
|
+
"aria-label": `Selecionar ${String(n[hn.value[0]?.field] ?? "")}`,
|
|
1247
|
+
"onUpdate:modelValue": (e) => Wn(n)
|
|
1327
1248
|
}, null, 8, [
|
|
1328
1249
|
"model-value",
|
|
1329
1250
|
"aria-label",
|
|
1330
1251
|
"onUpdate:modelValue"
|
|
1331
|
-
]), i[
|
|
1252
|
+
]), i[34] ||= d("span", null, "Selecionar", -1)])) : l("", !0), (_(!0), u(o, null, y(hn.value, (e, t) => (_(), u("div", {
|
|
1332
1253
|
key: e.field,
|
|
1333
1254
|
class: h(["w-crud-card-row", { "w-crud-card-row--title": t === 0 }])
|
|
1334
|
-
}, [t === 0 ? l("", !0) : (_(), u("span",
|
|
1255
|
+
}, [t === 0 ? l("", !0) : (_(), u("span", At, x(e.header), 1)), d("span", jt, [b(r.$slots, `column-${e.field}`, {
|
|
1335
1256
|
data: n,
|
|
1336
1257
|
value: n[e.field]
|
|
1337
1258
|
}, () => [f(re, {
|
|
@@ -1342,16 +1263,16 @@ var Ae = {
|
|
|
1342
1263
|
"column",
|
|
1343
1264
|
"value",
|
|
1344
1265
|
"row-data"
|
|
1345
|
-
])])])], 2))), 128))]),
|
|
1266
|
+
])])])], 2))), 128))]), vn.value && !p.actionRail ? (_(), u("div", Mt, [(_(!0), u(o, null, y(A.value, (t) => (_(), u(o, { key: t.action }, [I(t, n) ? T((_(), c(e, {
|
|
1346
1267
|
key: 0,
|
|
1347
1268
|
"icon-only": "",
|
|
1348
1269
|
icon: t.icon,
|
|
1349
|
-
"aria-label":
|
|
1350
|
-
title: t.disabledReason ?
|
|
1270
|
+
"aria-label": j(t, n),
|
|
1271
|
+
title: t.disabledReason ? j(t, n) : void 0,
|
|
1351
1272
|
size: "sm",
|
|
1352
1273
|
variant: t.severity === "danger" ? "danger" : "ghost",
|
|
1353
|
-
disabled:
|
|
1354
|
-
onClick: (e) =>
|
|
1274
|
+
disabled: L(t, n),
|
|
1275
|
+
onClick: (e) => N(t, n)
|
|
1355
1276
|
}, null, 8, [
|
|
1356
1277
|
"icon",
|
|
1357
1278
|
"aria-label",
|
|
@@ -1361,29 +1282,29 @@ var Ae = {
|
|
|
1361
1282
|
"onClick"
|
|
1362
1283
|
])), [[
|
|
1363
1284
|
a,
|
|
1364
|
-
t.disabledReason ?
|
|
1285
|
+
t.disabledReason ? j(t, n) : t.tooltip,
|
|
1365
1286
|
void 0,
|
|
1366
1287
|
{ top: !0 }
|
|
1367
1288
|
]]) : l("", !0)], 64))), 128)), b(r.$slots, "row-actions", {
|
|
1368
1289
|
data: n,
|
|
1369
1290
|
crud: p.crud
|
|
1370
|
-
})])) : l("", !0)])], 42,
|
|
1371
|
-
i[
|
|
1372
|
-
i[
|
|
1373
|
-
d("p",
|
|
1291
|
+
})])) : l("", !0)])], 42, Dt))), 128))], 10, Et))], 64))), 128)) : b(r.$slots, "empty", {}, () => [d("div", yt, [
|
|
1292
|
+
i[32] ||= d("div", { class: "w-crud-empty-icon" }, [d("i", { class: "pi pi-inbox" })], -1),
|
|
1293
|
+
i[33] ||= d("p", { class: "w-crud-empty-title" }, "Nenhum registro encontrado", -1),
|
|
1294
|
+
d("p", bt, " Tente ajustar sua busca" + x(R.value ? " ou crie um novo registro" : ""), 1)
|
|
1374
1295
|
])], void 0, 1),
|
|
1375
|
-
p.crud.items.value.length ? (_(), c(S(
|
|
1296
|
+
p.crud.items.value.length ? (_(), c(S(Ae), {
|
|
1376
1297
|
key: 3,
|
|
1377
1298
|
rows: p.crud.pagination.pageSize,
|
|
1378
1299
|
"total-records": p.crud.pagination.rows,
|
|
1379
|
-
first:
|
|
1300
|
+
first: rn.value,
|
|
1380
1301
|
"rows-per-page-options": [
|
|
1381
1302
|
10,
|
|
1382
1303
|
20,
|
|
1383
1304
|
50
|
|
1384
1305
|
],
|
|
1385
1306
|
template: "CurrentPageReport PrevPageLink NextPageLink",
|
|
1386
|
-
"current-page-report-template":
|
|
1307
|
+
"current-page-report-template": kn.value,
|
|
1387
1308
|
class: "w-crud-paginator",
|
|
1388
1309
|
onPage: p.crud.onPage
|
|
1389
1310
|
}, null, 8, [
|
|
@@ -1393,8 +1314,8 @@ var Ae = {
|
|
|
1393
1314
|
"current-page-report-template",
|
|
1394
1315
|
"onPage"
|
|
1395
1316
|
])) : l("", !0)
|
|
1396
|
-
]))], 512),
|
|
1397
|
-
|
|
1317
|
+
]))], 512), jn.value && !z.value ? (_(), u("aside", Nt, [
|
|
1318
|
+
R.value ? T((_(), c(e, {
|
|
1398
1319
|
key: 0,
|
|
1399
1320
|
"icon-only": "",
|
|
1400
1321
|
icon: "pi pi-plus",
|
|
@@ -1406,16 +1327,16 @@ var Ae = {
|
|
|
1406
1327
|
void 0,
|
|
1407
1328
|
{ left: !0 }
|
|
1408
1329
|
]]) : l("", !0),
|
|
1409
|
-
|
|
1410
|
-
(_(!0), u(o, null, y(
|
|
1330
|
+
R.value && A.value.length ? (_(), u("div", Pt)) : l("", !0),
|
|
1331
|
+
(_(!0), u(o, null, y(A.value, (t) => (_(), u(o, { key: t.action }, [!Z.value || I(t, Z.value) ? T((_(), c(e, {
|
|
1411
1332
|
key: 0,
|
|
1412
1333
|
"icon-only": "",
|
|
1413
1334
|
icon: t.icon,
|
|
1414
|
-
"aria-label":
|
|
1415
|
-
title: t.disabledReason ?
|
|
1335
|
+
"aria-label": j(t, Z.value),
|
|
1336
|
+
title: t.disabledReason ? j(t, Z.value) : void 0,
|
|
1416
1337
|
variant: t.severity === "danger" ? "danger" : "ghost",
|
|
1417
|
-
disabled: !
|
|
1418
|
-
onClick: (e) =>
|
|
1338
|
+
disabled: !Z.value || L(t, Z.value),
|
|
1339
|
+
onClick: (e) => Z.value && N(t, Z.value)
|
|
1419
1340
|
}, null, 8, [
|
|
1420
1341
|
"icon",
|
|
1421
1342
|
"aria-label",
|
|
@@ -1425,23 +1346,23 @@ var Ae = {
|
|
|
1425
1346
|
"onClick"
|
|
1426
1347
|
])), [[
|
|
1427
1348
|
a,
|
|
1428
|
-
t.disabledReason ?
|
|
1349
|
+
t.disabledReason ? j(t, Z.value) : t.tooltip,
|
|
1429
1350
|
void 0,
|
|
1430
1351
|
{ left: !0 }
|
|
1431
1352
|
]]) : l("", !0)], 64))), 128)),
|
|
1432
1353
|
b(r.$slots, "rail-actions", {
|
|
1433
|
-
selected:
|
|
1354
|
+
selected: Z.value,
|
|
1434
1355
|
crud: p.crud
|
|
1435
1356
|
}),
|
|
1436
|
-
(
|
|
1357
|
+
(R.value || A.value.length || r.$slots["rail-actions"]) && (p.showPrint || p.exportCsv) ? (_(), u("div", Ft)) : l("", !0),
|
|
1437
1358
|
p.showPrint ? T((_(), c(e, {
|
|
1438
1359
|
key: 3,
|
|
1439
1360
|
variant: "ghost",
|
|
1440
1361
|
"icon-only": "",
|
|
1441
1362
|
icon: "pi pi-print",
|
|
1442
1363
|
"aria-label": "Imprimir",
|
|
1443
|
-
disabled: !
|
|
1444
|
-
onClick:
|
|
1364
|
+
disabled: !Z.value,
|
|
1365
|
+
onClick: gr
|
|
1445
1366
|
}, null, 8, ["disabled"])), [[
|
|
1446
1367
|
a,
|
|
1447
1368
|
"Imprimir",
|
|
@@ -1453,12 +1374,12 @@ var Ae = {
|
|
|
1453
1374
|
variant: "ghost",
|
|
1454
1375
|
"icon-only": "",
|
|
1455
1376
|
icon: "pi pi-download",
|
|
1456
|
-
"aria-label":
|
|
1457
|
-
loading:
|
|
1458
|
-
onClick:
|
|
1377
|
+
"aria-label": M.value,
|
|
1378
|
+
loading: Q.value,
|
|
1379
|
+
onClick: _r
|
|
1459
1380
|
}, null, 8, ["aria-label", "loading"])), [[
|
|
1460
1381
|
a,
|
|
1461
|
-
|
|
1382
|
+
M.value,
|
|
1462
1383
|
void 0,
|
|
1463
1384
|
{ left: !0 }
|
|
1464
1385
|
]]) : l("", !0)
|
|
@@ -1466,16 +1387,36 @@ var Ae = {
|
|
|
1466
1387
|
p.contextMenu ? (_(), c(n, {
|
|
1467
1388
|
key: 1,
|
|
1468
1389
|
ref_key: "cm",
|
|
1469
|
-
ref:
|
|
1390
|
+
ref: tr,
|
|
1470
1391
|
mode: "context",
|
|
1471
|
-
items:
|
|
1392
|
+
items: mr.value
|
|
1472
1393
|
}, null, 8, ["items"])) : l("", !0),
|
|
1473
|
-
|
|
1394
|
+
z.value ? (_(), c(n, {
|
|
1474
1395
|
key: 2,
|
|
1475
1396
|
ref_key: "railMenuRef",
|
|
1476
|
-
ref:
|
|
1477
|
-
items:
|
|
1397
|
+
ref: Nn,
|
|
1398
|
+
items: hr.value
|
|
1478
1399
|
}, null, 8, ["items"])) : l("", !0),
|
|
1400
|
+
Y.value ? (_(), c(S(Se), {
|
|
1401
|
+
key: 3,
|
|
1402
|
+
visible: X.value,
|
|
1403
|
+
"onUpdate:visible": i[24] ||= (e) => X.value = e,
|
|
1404
|
+
position: "bottom",
|
|
1405
|
+
header: "Filtros",
|
|
1406
|
+
"append-to": S(Rt)?.hostEl.value ?? "body",
|
|
1407
|
+
class: "w-crud-filters-drawer"
|
|
1408
|
+
}, {
|
|
1409
|
+
default: w(() => [d("div", It, [f(ae, {
|
|
1410
|
+
crud: p.crud,
|
|
1411
|
+
columns: q.value,
|
|
1412
|
+
"param-of": J,
|
|
1413
|
+
"on-text": $n
|
|
1414
|
+
}, {
|
|
1415
|
+
default: w(() => [b(r.$slots, "toolbar-filters")]),
|
|
1416
|
+
_: 3
|
|
1417
|
+
}, 8, ["crud", "columns"])])]),
|
|
1418
|
+
_: 3
|
|
1419
|
+
}, 8, ["visible", "append-to"])) : l("", !0),
|
|
1479
1420
|
b(r.$slots, "form-dialog", {
|
|
1480
1421
|
crud: p.crud,
|
|
1481
1422
|
dialogWidth: p.dialogWidth
|
|
@@ -1492,12 +1433,12 @@ var Ae = {
|
|
|
1492
1433
|
"form-columns": p.formColumns ?? p.crud.config.formColumns,
|
|
1493
1434
|
"keyboard-nav": p.crud.config.keyboardNav,
|
|
1494
1435
|
"aside-width": p.asideWidth,
|
|
1495
|
-
"onUpdate:visible": i[
|
|
1436
|
+
"onUpdate:visible": i[25] ||= (e) => {
|
|
1496
1437
|
p.crud.dialogVisible.value = e, e || (p.crud.editingItem.value = null);
|
|
1497
1438
|
},
|
|
1498
|
-
"onUpdate:field": i[
|
|
1499
|
-
onSave: i[
|
|
1500
|
-
},
|
|
1439
|
+
"onUpdate:field": i[26] ||= (e, t) => p.crud.setFormField(e, t),
|
|
1440
|
+
onSave: i[27] ||= (e) => p.crud.save()
|
|
1441
|
+
}, le({ _: 2 }, [
|
|
1501
1442
|
y(p.crud.config.form, (e) => ({
|
|
1502
1443
|
name: `field-${e.field}`,
|
|
1503
1444
|
fn: w((t) => [b(r.$slots, `field-${e.field}`, g(m(t)))])
|
|
@@ -1530,11 +1471,11 @@ var Ae = {
|
|
|
1530
1471
|
"keyboard-nav",
|
|
1531
1472
|
"aside-width"
|
|
1532
1473
|
])]),
|
|
1533
|
-
r.$slots["delete-message"] ? (_(), c(S(
|
|
1534
|
-
key:
|
|
1535
|
-
visible:
|
|
1536
|
-
"onUpdate:visible": i[
|
|
1537
|
-
"append-to": S(
|
|
1474
|
+
r.$slots["delete-message"] ? (_(), c(S(xe), {
|
|
1475
|
+
key: 4,
|
|
1476
|
+
visible: F.value,
|
|
1477
|
+
"onUpdate:visible": i[29] ||= (e) => F.value = e,
|
|
1478
|
+
"append-to": S(Rt)?.hostEl.value ?? "body",
|
|
1538
1479
|
header: "Confirmar Exclusão",
|
|
1539
1480
|
modal: "",
|
|
1540
1481
|
draggable: !1,
|
|
@@ -1543,22 +1484,22 @@ var Ae = {
|
|
|
1543
1484
|
footer: w(() => [f(e, {
|
|
1544
1485
|
variant: "ghost",
|
|
1545
1486
|
label: "Cancelar",
|
|
1546
|
-
disabled:
|
|
1547
|
-
onClick: i[
|
|
1487
|
+
disabled: xn.value,
|
|
1488
|
+
onClick: i[28] ||= (e) => F.value = !1
|
|
1548
1489
|
}, null, 8, ["disabled"]), f(e, {
|
|
1549
1490
|
variant: "danger",
|
|
1550
1491
|
label: "Excluir",
|
|
1551
1492
|
icon: "pi pi-trash",
|
|
1552
|
-
loading:
|
|
1553
|
-
onClick:
|
|
1493
|
+
loading: xn.value,
|
|
1494
|
+
onClick: Sn
|
|
1554
1495
|
}, null, 8, ["loading"])]),
|
|
1555
|
-
default: w(() => [b(r.$slots, "delete-message", { item:
|
|
1496
|
+
default: w(() => [b(r.$slots, "delete-message", { item: P.value })]),
|
|
1556
1497
|
_: 3
|
|
1557
1498
|
}, 8, ["visible", "append-to"])) : l("", !0)
|
|
1558
1499
|
], 2);
|
|
1559
1500
|
};
|
|
1560
1501
|
}
|
|
1561
1502
|
});
|
|
1562
|
-
export {
|
|
1503
|
+
export { Lt as default };
|
|
1563
1504
|
|
|
1564
1505
|
//# sourceMappingURL=WCrudView.vue_vue_type_script_setup_true_lang.js.map
|