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