@greenborn/vue-table-editor 1.4.7 → 1.4.9
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/README.md +11 -8
- package/dist/vue-table-editor.js +835 -821
- package/dist/vue-table-editor.js.map +1 -1
- package/dist/vue-table-editor.umd.cjs +4 -4
- package/dist/vue-table-editor.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/vue-table-editor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
class
|
|
1
|
+
import { computed as b, ref as g, watch as Lt, nextTick as Ze, onMounted as Hl, onUnmounted as Ol, openBlock as r, createElementBlock as u, createElementVNode as h, Fragment as T, renderList as D, normalizeClass as N, unref as z, createCommentVNode as y, createTextVNode as te, toDisplayString as E, withDirectives as pe, vModelCheckbox as Nl, vModelText as wt, normalizeStyle as he, withModifiers as S, vModelSelect as ll, withKeys as nl, vShow as zl } from "vue";
|
|
2
|
+
class ge {
|
|
3
3
|
constructor(a = {}) {
|
|
4
4
|
this.key = a.key || "", this.icon = a.icon, this.severity = a.severity || "primary", this.class = a.class || "", this.label = a.label || "", this._getLabel = a.getLabel || (() => a.label || ""), this._isVisible = a.isVisible || (() => !0), this._isDisabled = a.isDisabled || (() => !1), this.onClick = a.onClick || (() => {
|
|
5
5
|
}), this.helpKey = a.helpKey || null, this.permissions = a.permissions || null;
|
|
@@ -14,23 +14,23 @@ class pe {
|
|
|
14
14
|
return this._isDisabled();
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
17
|
+
function il(o) {
|
|
18
|
+
return o instanceof ge ? o : new ge(o);
|
|
19
19
|
}
|
|
20
|
-
const
|
|
21
|
-
function
|
|
20
|
+
const $l = "te_preferencias";
|
|
21
|
+
function Il(o = $l) {
|
|
22
22
|
let a = {};
|
|
23
23
|
function v() {
|
|
24
24
|
try {
|
|
25
|
-
const
|
|
26
|
-
a =
|
|
25
|
+
const k = localStorage.getItem(o);
|
|
26
|
+
a = k ? JSON.parse(k) : {};
|
|
27
27
|
} catch {
|
|
28
28
|
a = {};
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
function s() {
|
|
32
32
|
try {
|
|
33
|
-
localStorage.setItem(
|
|
33
|
+
localStorage.setItem(o, JSON.stringify(a));
|
|
34
34
|
} catch {
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -38,33 +38,33 @@ function $l(u = zl) {
|
|
|
38
38
|
get misValores() {
|
|
39
39
|
return a;
|
|
40
40
|
},
|
|
41
|
-
valor(
|
|
42
|
-
const
|
|
43
|
-
if (!
|
|
41
|
+
valor(k) {
|
|
42
|
+
const w = a[k];
|
|
43
|
+
if (!w) return null;
|
|
44
44
|
try {
|
|
45
|
-
return JSON.parse(
|
|
45
|
+
return JSON.parse(w);
|
|
46
46
|
} catch {
|
|
47
|
-
return
|
|
47
|
+
return w;
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
-
async guardarValores(
|
|
51
|
-
return a = { ...a, ...
|
|
50
|
+
async guardarValores(k) {
|
|
51
|
+
return a = { ...a, ...k }, s(), { status: !0 };
|
|
52
52
|
},
|
|
53
53
|
async fetchMisPreferencias() {
|
|
54
54
|
v();
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
const
|
|
58
|
+
const et = {
|
|
59
59
|
adapter: null
|
|
60
60
|
};
|
|
61
|
-
function
|
|
62
|
-
|
|
61
|
+
function zi(o) {
|
|
62
|
+
et.adapter = o;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
return
|
|
64
|
+
function Bl() {
|
|
65
|
+
return et.adapter || (et.adapter = Il()), et.adapter;
|
|
66
66
|
}
|
|
67
|
-
const
|
|
67
|
+
const sl = {
|
|
68
68
|
search: '<circle cx="11" cy="11" r="7"/><line x1="21" y1="21" x2="16.65" y2="16.65"/>',
|
|
69
69
|
download: '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/>',
|
|
70
70
|
plus: '<line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/>',
|
|
@@ -82,13 +82,13 @@ const al = {
|
|
|
82
82
|
files: '<polyline points="16 16 16 16"/><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/>',
|
|
83
83
|
gear: '<circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h0a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51h0a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v0a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/>'
|
|
84
84
|
};
|
|
85
|
-
function
|
|
86
|
-
if (!
|
|
87
|
-
const a =
|
|
85
|
+
function j(o) {
|
|
86
|
+
if (!o) return "";
|
|
87
|
+
const a = jl(o), v = sl[a];
|
|
88
88
|
return v ? `<svg class="te-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${v}</svg>` : "";
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
let a = String(
|
|
90
|
+
function jl(o) {
|
|
91
|
+
let a = String(o).trim().toLowerCase();
|
|
92
92
|
return a = a.replace(/^bi\s+bi-/, ""), a = a.replace(/^te-/, ""), {
|
|
93
93
|
"arrow-clockwise": "refresh",
|
|
94
94
|
"arrow-counterclockwise": "refresh",
|
|
@@ -101,116 +101,116 @@ function Bl(u) {
|
|
|
101
101
|
"stop-fill": "stop"
|
|
102
102
|
}[a] || a;
|
|
103
103
|
}
|
|
104
|
-
const
|
|
105
|
-
function
|
|
106
|
-
return !
|
|
104
|
+
const $i = Object.keys(sl);
|
|
105
|
+
function Kl(o) {
|
|
106
|
+
return !o || o.length !== 7 ? null : "#" + (255 - parseInt(o.slice(1, 3), 16)).toString(16).padStart(2, "0") + (255 - parseInt(o.slice(3, 5), 16)).toString(16).padStart(2, "0") + (255 - parseInt(o.slice(5, 7), 16)).toString(16).padStart(2, "0");
|
|
107
107
|
}
|
|
108
|
-
function Wl(
|
|
109
|
-
if (!Array.isArray(
|
|
108
|
+
function Wl(o, a) {
|
|
109
|
+
if (!Array.isArray(o)) return o;
|
|
110
110
|
const v = a == null ? void 0 : a.fieldClasses;
|
|
111
|
-
if (!v) return
|
|
112
|
-
for (const s of
|
|
111
|
+
if (!v) return o;
|
|
112
|
+
for (const s of o)
|
|
113
113
|
v[s.field] && (s.css = (s.css || "") + " " + v[s.field]);
|
|
114
|
-
return
|
|
114
|
+
return o;
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
if (!a) return
|
|
118
|
-
if (
|
|
116
|
+
function ol(o, a) {
|
|
117
|
+
if (!a) return o;
|
|
118
|
+
if (o.__css_class = "", typeof a.rowClassFn == "function" && (o.__css_class = a.rowClassFn(o)), typeof a.rowStyleFn == "function" && (o.__style = a.rowStyleFn(o)), o.__field_styles = {}, a.fieldStyleFns)
|
|
119
119
|
for (const v of Object.keys(a.fieldStyleFns))
|
|
120
|
-
|
|
121
|
-
return
|
|
120
|
+
o[v] != null && (o.__field_styles[v] = a.fieldStyleFns[v](o[v]));
|
|
121
|
+
return o;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function rl(o, a) {
|
|
124
124
|
var s;
|
|
125
|
-
if (
|
|
126
|
-
const v =
|
|
127
|
-
return v != null && typeof v == "object" && "__style" in v ? { value: v.value, style: v.__style } : (s =
|
|
125
|
+
if (o == null) return { value: null, style: null };
|
|
126
|
+
const v = o[a == null ? void 0 : a.field];
|
|
127
|
+
return v != null && typeof v == "object" && "__style" in v ? { value: v.value, style: v.__style } : (s = o.__field_styles) != null && s[a == null ? void 0 : a.field] ? { value: v, style: o.__field_styles[a == null ? void 0 : a.field] } : { value: v, style: null };
|
|
128
128
|
}
|
|
129
|
-
function Gl(
|
|
130
|
-
return
|
|
129
|
+
function Gl(o, a) {
|
|
130
|
+
return rl(o, a).style;
|
|
131
131
|
}
|
|
132
132
|
const ql = { class: "te-wrapper" }, Jl = {
|
|
133
133
|
key: 0,
|
|
134
134
|
class: "te-toolbar"
|
|
135
|
-
}, Ul = { class: "te-toolbar-start" },
|
|
135
|
+
}, Ul = { class: "te-toolbar-start" }, Xl = ["disabled", "onClick", "title", "data-help"], Yl = ["innerHTML"], Ql = {
|
|
136
136
|
key: 0,
|
|
137
137
|
class: "te-toolbar-divider"
|
|
138
|
-
},
|
|
138
|
+
}, Zl = ["disabled", "onClick", "title", "data-help"], en = ["innerHTML"], tn = {
|
|
139
139
|
key: 0,
|
|
140
140
|
class: "te-toolbar-end"
|
|
141
|
-
},
|
|
141
|
+
}, ln = ["data-help"], nn = ["innerHTML"], an = {
|
|
142
142
|
key: 0,
|
|
143
143
|
class: "te-dropdown-menu",
|
|
144
144
|
style: { "min-width": "220px" }
|
|
145
|
-
},
|
|
145
|
+
}, sn = ["id", "value"], on = ["data-help"], rn = ["innerHTML"], un = {
|
|
146
146
|
key: 0,
|
|
147
147
|
class: "te-loading-overlay"
|
|
148
|
-
},
|
|
148
|
+
}, cn = {
|
|
149
149
|
key: 1,
|
|
150
150
|
class: "te-mobile-list"
|
|
151
|
-
},
|
|
151
|
+
}, dn = ["onClick", "onDblclick"], fn = { class: "te-mobile-card-head" }, vn = ["checked", "onChange"], pn = ["checked", "onClick"], hn = ["innerHTML"], gn = {
|
|
152
152
|
key: 0,
|
|
153
153
|
class: "te-mobile-card-body"
|
|
154
|
-
},
|
|
154
|
+
}, yn = ["innerHTML"], mn = ["disabled", "onClick", "title", "data-help"], kn = ["innerHTML"], bn = {
|
|
155
155
|
key: 0,
|
|
156
156
|
class: "te-mobile-empty"
|
|
157
|
-
},
|
|
157
|
+
}, _n = ["data-field"], Cn = {
|
|
158
158
|
key: 0,
|
|
159
159
|
class: "te-header-group-row"
|
|
160
|
-
},
|
|
160
|
+
}, Sn = {
|
|
161
161
|
key: 0,
|
|
162
162
|
class: "te-th te-th-sel",
|
|
163
163
|
rowspan: 2
|
|
164
|
-
},
|
|
164
|
+
}, Mn = ["checked"], Tn = {
|
|
165
165
|
key: 1,
|
|
166
166
|
class: "te-th te-th-acts",
|
|
167
167
|
rowspan: 2
|
|
168
|
-
},
|
|
168
|
+
}, Ln = ["colspan"], wn = { class: "te-th-content" }, xn = { class: "te-th-group-label" }, Dn = ["data-field", "data-help"], En = { class: "te-th-content" }, Fn = ["onClick"], An = {
|
|
169
169
|
key: 0,
|
|
170
170
|
class: "te-sort-icon-std"
|
|
171
|
-
},
|
|
171
|
+
}, Rn = ["innerHTML"], Pn = ["onPointerdown", "onDblclick"], Vn = {
|
|
172
172
|
key: 1,
|
|
173
173
|
class: "te-header-row te-has-groups"
|
|
174
|
-
},
|
|
174
|
+
}, Hn = ["data-field", "data-help"], On = { class: "te-th-content" }, Nn = ["onClick"], zn = {
|
|
175
175
|
key: 0,
|
|
176
176
|
class: "te-sort-icon-std"
|
|
177
|
-
},
|
|
177
|
+
}, $n = ["innerHTML"], In = ["onPointerdown", "onDblclick"], Bn = {
|
|
178
178
|
key: 2,
|
|
179
179
|
class: "te-header-row"
|
|
180
|
-
},
|
|
180
|
+
}, jn = {
|
|
181
181
|
key: 0,
|
|
182
182
|
class: "te-th te-th-sel"
|
|
183
|
-
},
|
|
183
|
+
}, Kn = ["checked"], Wn = {
|
|
184
184
|
key: 1,
|
|
185
185
|
class: "te-th te-th-acts"
|
|
186
|
-
},
|
|
186
|
+
}, Gn = ["data-field", "data-help", "draggable", "onDragstart", "onDragenter", "onDragover", "onDragleave", "onDrop"], qn = { class: "te-th-content" }, Jn = ["innerHTML"], Un = ["onClick"], Xn = {
|
|
187
187
|
key: 0,
|
|
188
188
|
class: "te-sort-icon-std"
|
|
189
|
-
},
|
|
189
|
+
}, Yn = ["innerHTML"], Qn = ["onPointerdown", "onDblclick"], Zn = {
|
|
190
190
|
key: 0,
|
|
191
191
|
class: "te-drop-indicator te-drop-left"
|
|
192
|
-
},
|
|
192
|
+
}, ei = {
|
|
193
193
|
key: 1,
|
|
194
194
|
class: "te-drop-indicator te-drop-right"
|
|
195
|
-
},
|
|
195
|
+
}, ti = {
|
|
196
196
|
key: 3,
|
|
197
197
|
class: "te-filter-row"
|
|
198
|
-
},
|
|
198
|
+
}, li = {
|
|
199
199
|
key: 0,
|
|
200
200
|
class: "te-td"
|
|
201
|
-
},
|
|
201
|
+
}, ni = {
|
|
202
202
|
key: 1,
|
|
203
203
|
class: "te-td"
|
|
204
|
-
},
|
|
204
|
+
}, ii = ["onUpdate:modelValue"], ai = ["value"], si = ["onUpdate:modelValue"], oi = ["onPointerdown", "onDblclick"], ri = ["onClick", "onDblclick"], ui = ["checked", "onChange"], ci = ["checked", "onClick"], di = {
|
|
205
205
|
key: 1,
|
|
206
206
|
class: "te-td te-td-acts"
|
|
207
|
-
},
|
|
207
|
+
}, fi = { class: "te-actions-wrap" }, vi = ["disabled", "onClick", "title", "data-help"], pi = ["innerHTML"], hi = ["onBlur", "onKeydown"], gi = {
|
|
208
208
|
key: 1,
|
|
209
209
|
class: "te-cell-wrap"
|
|
210
|
-
},
|
|
210
|
+
}, yi = ["onDblclick", "innerHTML"], mi = ["onClick"], ki = ["innerHTML"], bi = ["onPointerdown", "onDblclick"], _i = { key: 0 }, Ci = ["colspan"], Si = {
|
|
211
211
|
key: 0,
|
|
212
212
|
class: "te-loading-spinner"
|
|
213
|
-
},
|
|
213
|
+
}, Mi = ["data-help"], Ti = { class: "te-page-info" }, Li = { class: "te-page-controls" }, wi = ["disabled"], xi = ["disabled"], Di = { class: "te-page-current" }, Ei = ["disabled"], Fi = ["disabled"], Ai = ["value"], Ri = "te_cfg", Ii = {
|
|
214
214
|
__name: "TableEditor",
|
|
215
215
|
props: {
|
|
216
216
|
api: { type: Object, default: null },
|
|
@@ -220,68 +220,68 @@ const ql = { class: "te-wrapper" }, Jl = {
|
|
|
220
220
|
id: { type: String, default: null }
|
|
221
221
|
},
|
|
222
222
|
emits: ["loaded", "rowSelected", "rowDoubleClick", "createRequest", "editRequest", "deleteRequest"],
|
|
223
|
-
setup(
|
|
224
|
-
const s =
|
|
223
|
+
setup(o, { expose: a, emit: v }) {
|
|
224
|
+
const s = o, k = v, w = b(() => {
|
|
225
225
|
var e;
|
|
226
|
-
return ((e = s.config) == null ? void 0 : e.preferencesStore) ||
|
|
226
|
+
return ((e = s.config) == null ? void 0 : e.preferencesStore) || Bl();
|
|
227
227
|
});
|
|
228
|
-
function
|
|
229
|
-
return s.id ? `${
|
|
228
|
+
function ye() {
|
|
229
|
+
return s.id ? `${Ri}_${s.id}` : null;
|
|
230
230
|
}
|
|
231
|
-
let
|
|
232
|
-
async function
|
|
233
|
-
const e =
|
|
231
|
+
let ue = null;
|
|
232
|
+
async function cl() {
|
|
233
|
+
const e = ye();
|
|
234
234
|
if (!e) return null;
|
|
235
235
|
try {
|
|
236
|
-
const t =
|
|
236
|
+
const t = w.value.valor(e);
|
|
237
237
|
return t ? typeof t == "string" ? JSON.parse(t) : t : null;
|
|
238
238
|
} catch {
|
|
239
239
|
return null;
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
async function
|
|
243
|
-
const e =
|
|
242
|
+
async function tt() {
|
|
243
|
+
const e = ye();
|
|
244
244
|
if (!e) return;
|
|
245
|
-
const t =
|
|
246
|
-
for (const
|
|
247
|
-
const c =
|
|
248
|
-
await
|
|
249
|
-
[e]: JSON.stringify({ columnOrder: c, columnWidths: i, hiddenFields:
|
|
245
|
+
const t = it.value.map((m) => m.field), n = new Set(R.value.map((m) => m.field)), i = {};
|
|
246
|
+
for (const m of t) i[m] = Se.value[m] || "15rem";
|
|
247
|
+
const c = le.value.length ? le.value : t, f = t.filter((m) => !n.has(m));
|
|
248
|
+
await w.value.guardarValores({
|
|
249
|
+
[e]: JSON.stringify({ columnOrder: c, columnWidths: i, hiddenFields: f })
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
function
|
|
253
|
-
|
|
254
|
-
|
|
252
|
+
function lt() {
|
|
253
|
+
ue && clearTimeout(ue), ue = setTimeout(() => {
|
|
254
|
+
ue = null, tt();
|
|
255
255
|
}, 500);
|
|
256
256
|
}
|
|
257
|
-
function
|
|
258
|
-
return
|
|
257
|
+
function nt() {
|
|
258
|
+
return ae ? (clearTimeout(ae), ae = null, tt()) : ue ? (clearTimeout(ue), ue = null, tt()) : null;
|
|
259
259
|
}
|
|
260
|
-
const
|
|
261
|
-
|
|
262
|
-
const
|
|
260
|
+
const A = g([]), xt = g([]), R = g([]), it = g([]), Dt = g(null), Et = g(!1), X = g(!0), L = g("single"), x = g(null), P = g(/* @__PURE__ */ new Map()), K = g(null), ce = g("asc"), Y = g({}), Re = g(""), F = g(1), $ = g(25), Ft = g([25, 50, 100, 200]), Pe = g(null), At = g(!0), Rt = g(!1), dl = g(!0);
|
|
261
|
+
g(!0);
|
|
262
|
+
const Pt = g(!0), fl = g("3rem"), Vt = g("10rem"), Se = g({}), le = g([]), Me = g(!1), Te = g(0), I = b(() => {
|
|
263
263
|
var e;
|
|
264
264
|
return ((e = s.config) == null ? void 0 : e.lazy) === !0;
|
|
265
|
-
}),
|
|
265
|
+
}), Q = b(() => {
|
|
266
266
|
var e, t;
|
|
267
|
-
return ((e = s.config) == null ? void 0 : e.infiniteScroll) === !0 || ((t = s.config) == null ? void 0 : t.infiniteScroll) !== !1 &&
|
|
268
|
-
}),
|
|
269
|
-
let
|
|
270
|
-
const
|
|
267
|
+
return ((e = s.config) == null ? void 0 : e.infiniteScroll) === !0 || ((t = s.config) == null ? void 0 : t.infiniteScroll) !== !1 && I.value;
|
|
268
|
+
}), Ve = g(!1), ne = g(!0), de = g(1), at = g(null), st = g(null), ot = g(null), He = g(!1);
|
|
269
|
+
let ie = null;
|
|
270
|
+
const H = g(null), Z = g(null), W = g(null), G = g(null);
|
|
271
271
|
let Oe = null, Ne = null;
|
|
272
|
-
const
|
|
273
|
-
let
|
|
274
|
-
const
|
|
272
|
+
const q = g(null), fe = g(""), ze = g(null), me = g(null);
|
|
273
|
+
let J = null, V = null, Le = null, we = null, ae = null;
|
|
274
|
+
const xe = g({
|
|
275
275
|
create: "Nuevo",
|
|
276
276
|
edit: "Editar",
|
|
277
277
|
delete: "Borrar",
|
|
278
278
|
article: "un",
|
|
279
279
|
deleted: "eliminado"
|
|
280
|
-
}),
|
|
281
|
-
const e =
|
|
282
|
-
if (
|
|
280
|
+
}), O = b(() => {
|
|
281
|
+
const e = R.value;
|
|
282
|
+
if (le.value.length) {
|
|
283
283
|
const t = [];
|
|
284
|
-
for (const n of
|
|
284
|
+
for (const n of le.value) {
|
|
285
285
|
const i = e.find((c) => c.field === n);
|
|
286
286
|
i && t.push(i);
|
|
287
287
|
}
|
|
@@ -289,103 +289,103 @@ const ql = { class: "te-wrapper" }, Jl = {
|
|
|
289
289
|
return t;
|
|
290
290
|
}
|
|
291
291
|
return e;
|
|
292
|
-
}),
|
|
292
|
+
}), B = b(() => vt.value.rowActions || []), U = b(() => {
|
|
293
293
|
var e;
|
|
294
294
|
return ((e = s.config) == null ? void 0 : e.rowActionsMode) === "toolbar";
|
|
295
|
-
}),
|
|
295
|
+
}), vl = b(() => {
|
|
296
296
|
var e;
|
|
297
|
-
return
|
|
298
|
-
}),
|
|
297
|
+
return U.value && ((e = s.config) == null ? void 0 : e.cardActions) === !0;
|
|
298
|
+
}), rt = b(() => U.value ? B.value : []), $e = b(() => L.value === "multiple" ? [...P.value.keys()] : x.value ? [x.value] : []), Ie = b(() => {
|
|
299
299
|
var e;
|
|
300
300
|
return ((e = s.config) == null ? void 0 : e.lazyProtocol) === "legacy";
|
|
301
|
-
}),
|
|
301
|
+
}), pl = b(() => {
|
|
302
302
|
var e;
|
|
303
303
|
return !!((e = s.config) != null && e.columnFilterDefs);
|
|
304
|
-
}),
|
|
304
|
+
}), ve = b(() => {
|
|
305
305
|
var e;
|
|
306
306
|
return ((e = s.config) == null ? void 0 : e.dataPipeline) || null;
|
|
307
|
-
}),
|
|
307
|
+
}), Be = b(() => {
|
|
308
308
|
var e;
|
|
309
309
|
return ((e = s.config) == null ? void 0 : e.styling) || null;
|
|
310
|
-
}),
|
|
310
|
+
}), hl = b(() => {
|
|
311
311
|
var e;
|
|
312
312
|
return typeof ((e = s.config) == null ? void 0 : e.permissionsCheck) == "function";
|
|
313
|
-
}),
|
|
314
|
-
let e =
|
|
315
|
-
return
|
|
316
|
-
}),
|
|
313
|
+
}), gl = b(() => {
|
|
314
|
+
let e = O.value.length + 1;
|
|
315
|
+
return L.value !== null && e++, B.value.length && !U.value && e++, e;
|
|
316
|
+
}), je = b(() => {
|
|
317
317
|
var e, t;
|
|
318
318
|
return ((t = (e = s.config) == null ? void 0 : e.columnGroups) == null ? void 0 : t.length) > 0;
|
|
319
|
-
}),
|
|
319
|
+
}), ut = b(() => {
|
|
320
320
|
var e;
|
|
321
321
|
return ((e = s.config) == null ? void 0 : e.mobileListView) === !0;
|
|
322
|
-
}),
|
|
322
|
+
}), Ht = b(() => {
|
|
323
323
|
var e;
|
|
324
324
|
return ((e = s.config) == null ? void 0 : e.mobileBreakpoint) ?? 768;
|
|
325
|
-
}),
|
|
326
|
-
let
|
|
327
|
-
function
|
|
328
|
-
|
|
325
|
+
}), Ke = g(!1), Ot = b(() => O.value[0] || null), Nt = b(() => O.value.slice(1)), yl = b(() => ut.value && Ke.value);
|
|
326
|
+
let se = null;
|
|
327
|
+
function ct(e) {
|
|
328
|
+
Ke.value = e.matches;
|
|
329
329
|
}
|
|
330
|
-
function
|
|
331
|
-
|
|
330
|
+
function zt() {
|
|
331
|
+
se && se.removeEventListener("change", ct), se = null, Ke.value = !1, !(!ut.value || typeof window > "u" || !window.matchMedia) && (se = window.matchMedia(`(max-width: ${Ht.value}px)`), Ke.value = se.matches, se.addEventListener("change", ct));
|
|
332
332
|
}
|
|
333
|
-
const
|
|
333
|
+
const $t = b(() => {
|
|
334
334
|
var e;
|
|
335
335
|
return (e = s.config) == null ? void 0 : e.inlineEditing;
|
|
336
|
-
}),
|
|
336
|
+
}), ml = b(() => {
|
|
337
337
|
var e;
|
|
338
|
-
return ((e =
|
|
339
|
-
}),
|
|
340
|
-
if (!
|
|
341
|
-
const e = s.config.columnGroups || [], t =
|
|
342
|
-
for (let
|
|
343
|
-
for (const
|
|
338
|
+
return ((e = $t.value) == null ? void 0 : e.campos) || {};
|
|
339
|
+
}), It = b(() => {
|
|
340
|
+
if (!je.value) return [];
|
|
341
|
+
const e = s.config.columnGroups || [], t = O.value, n = {};
|
|
342
|
+
for (let f = 0; f < e.length; f++)
|
|
343
|
+
for (const m of e[f].fields) n[m] = f;
|
|
344
344
|
const i = [];
|
|
345
345
|
let c = 0;
|
|
346
346
|
for (; c < t.length; ) {
|
|
347
|
-
const
|
|
348
|
-
if (
|
|
349
|
-
const
|
|
350
|
-
for (; c < t.length && n[t[c].field] ===
|
|
351
|
-
|
|
352
|
-
i.push({ _key: "g-" +
|
|
347
|
+
const f = t[c], m = n[f.field];
|
|
348
|
+
if (m !== void 0) {
|
|
349
|
+
const M = [];
|
|
350
|
+
for (; c < t.length && n[t[c].field] === m; )
|
|
351
|
+
M.push(t[c]), c++;
|
|
352
|
+
i.push({ _key: "g-" + m, _type: "group", headerName: e[m].headerName, _span: M.length, _cols: M });
|
|
353
353
|
} else
|
|
354
|
-
i.push({ _key: "c-" +
|
|
354
|
+
i.push({ _key: "c-" + f.field, _type: "col", _col: f }), c++;
|
|
355
355
|
}
|
|
356
356
|
return i;
|
|
357
|
-
}),
|
|
358
|
-
let e =
|
|
359
|
-
const t =
|
|
357
|
+
}), We = b(() => {
|
|
358
|
+
let e = A.value || [];
|
|
359
|
+
const t = Re.value;
|
|
360
360
|
if (t) {
|
|
361
361
|
const n = t.toLowerCase();
|
|
362
|
-
e = e.filter((i) =>
|
|
363
|
-
const
|
|
364
|
-
return
|
|
362
|
+
e = e.filter((i) => O.value.some((c) => {
|
|
363
|
+
const f = i[c.field];
|
|
364
|
+
return f != null && String(f).toLowerCase().includes(n);
|
|
365
365
|
}));
|
|
366
366
|
}
|
|
367
|
-
for (const n of
|
|
368
|
-
const i =
|
|
367
|
+
for (const n of O.value) {
|
|
368
|
+
const i = Y.value[n.field];
|
|
369
369
|
if (i) {
|
|
370
370
|
const c = i.toLowerCase();
|
|
371
|
-
e = e.filter((
|
|
372
|
-
const
|
|
373
|
-
return
|
|
371
|
+
e = e.filter((f) => {
|
|
372
|
+
const m = f[n.field];
|
|
373
|
+
return m != null && String(m).toLowerCase().includes(c);
|
|
374
374
|
});
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
|
-
return
|
|
378
|
-
let c = n[
|
|
379
|
-
return c == null && (c = ""),
|
|
377
|
+
return K.value && (e = [...e].sort((n, i) => {
|
|
378
|
+
let c = n[K.value], f = i[K.value];
|
|
379
|
+
return c == null && (c = ""), f == null && (f = ""), typeof c == "number" && typeof f == "number" ? ce.value === "asc" ? c - f : f - c : (c = String(c).toLowerCase(), f = String(f).toLowerCase(), ce.value === "asc" ? c.localeCompare(f) : f.localeCompare(c));
|
|
380
380
|
})), e;
|
|
381
|
-
}),
|
|
382
|
-
if (
|
|
383
|
-
if (
|
|
384
|
-
const e = (
|
|
385
|
-
return
|
|
386
|
-
}),
|
|
381
|
+
}), dt = b(() => I.value ? Te.value : We.value.length), De = b(() => Math.max(1, Math.ceil(dt.value / $.value))), oe = b(() => {
|
|
382
|
+
if (Q.value) return A.value || [];
|
|
383
|
+
if (I.value) return A.value || [];
|
|
384
|
+
const e = (F.value - 1) * $.value;
|
|
385
|
+
return We.value.slice(e, e + $.value);
|
|
386
|
+
}), kl = b(() => (F.value - 1) * $.value + 1), bl = b(() => Math.min(F.value * $.value, dt.value)), ft = b(() => oe.value.length > 0 && oe.value.every((e) => Ee(e))), vt = g({
|
|
387
387
|
toolbar: [
|
|
388
|
-
new
|
|
388
|
+
new ge({
|
|
389
389
|
key: "refresh",
|
|
390
390
|
icon: "refresh",
|
|
391
391
|
severity: "outline-info",
|
|
@@ -393,9 +393,9 @@ const ql = { class: "te-wrapper" }, Jl = {
|
|
|
393
393
|
var e;
|
|
394
394
|
return !((e = s.config) != null && e.hideRefresh);
|
|
395
395
|
},
|
|
396
|
-
onClick: () =>
|
|
396
|
+
onClick: () => Ye()
|
|
397
397
|
}),
|
|
398
|
-
new
|
|
398
|
+
new ge({
|
|
399
399
|
key: "csv",
|
|
400
400
|
icon: "download",
|
|
401
401
|
severity: "outline-info",
|
|
@@ -404,74 +404,74 @@ const ql = { class: "te-wrapper" }, Jl = {
|
|
|
404
404
|
var e;
|
|
405
405
|
return !((e = s.config) != null && e.hideCsvExport);
|
|
406
406
|
},
|
|
407
|
-
onClick: () =>
|
|
407
|
+
onClick: () => Rl()
|
|
408
408
|
}),
|
|
409
|
-
new
|
|
409
|
+
new ge({
|
|
410
410
|
key: "create",
|
|
411
411
|
icon: "plus",
|
|
412
412
|
severity: "success",
|
|
413
413
|
isVisible: () => {
|
|
414
414
|
var e, t;
|
|
415
|
-
return ((e = s.api) == null ? void 0 : e.create) != null &&
|
|
415
|
+
return ((e = s.api) == null ? void 0 : e.create) != null && Ge((t = s.permisos) == null ? void 0 : t.create);
|
|
416
416
|
},
|
|
417
|
-
getLabel: () =>
|
|
418
|
-
onClick: () =>
|
|
417
|
+
getLabel: () => xe.value.create,
|
|
418
|
+
onClick: () => _t("create")
|
|
419
419
|
}),
|
|
420
|
-
new
|
|
420
|
+
new ge({
|
|
421
421
|
key: "edit",
|
|
422
422
|
icon: "pencil",
|
|
423
423
|
severity: "warning",
|
|
424
424
|
isVisible: () => {
|
|
425
425
|
var e, t;
|
|
426
|
-
return ((e = s.api) == null ? void 0 : e.edit) != null &&
|
|
426
|
+
return ((e = s.api) == null ? void 0 : e.edit) != null && Ge((t = s.permisos) == null ? void 0 : t.edit);
|
|
427
427
|
},
|
|
428
|
-
getLabel: () =>
|
|
429
|
-
isDisabled: () =>
|
|
430
|
-
onClick: () =>
|
|
428
|
+
getLabel: () => xe.value.edit,
|
|
429
|
+
isDisabled: () => X.value,
|
|
430
|
+
onClick: () => _t("edit")
|
|
431
431
|
}),
|
|
432
|
-
new
|
|
432
|
+
new ge({
|
|
433
433
|
key: "delete",
|
|
434
434
|
icon: "trash",
|
|
435
435
|
severity: "danger",
|
|
436
436
|
isVisible: () => {
|
|
437
437
|
var e, t;
|
|
438
|
-
return ((e = s.api) == null ? void 0 : e.delete) != null &&
|
|
438
|
+
return ((e = s.api) == null ? void 0 : e.delete) != null && Ge((t = s.permisos) == null ? void 0 : t.delete);
|
|
439
439
|
},
|
|
440
|
-
getLabel: () =>
|
|
441
|
-
isDisabled: () =>
|
|
442
|
-
onClick: () =>
|
|
440
|
+
getLabel: () => xe.value.delete,
|
|
441
|
+
isDisabled: () => X.value,
|
|
442
|
+
onClick: () => Fl()
|
|
443
443
|
})
|
|
444
444
|
],
|
|
445
445
|
rowActions: []
|
|
446
446
|
});
|
|
447
|
-
function
|
|
448
|
-
return !e || !
|
|
447
|
+
function Ge(e) {
|
|
448
|
+
return !e || !hl.value ? !0 : !!s.config.permissionsCheck(e);
|
|
449
449
|
}
|
|
450
|
-
const
|
|
450
|
+
const Bt = b(() => {
|
|
451
451
|
var t, n;
|
|
452
452
|
const e = [];
|
|
453
|
-
for (const i of
|
|
453
|
+
for (const i of vt.value.toolbar)
|
|
454
454
|
i.isVisible() && e.push(i);
|
|
455
455
|
if ((n = (t = s.config) == null ? void 0 : t.buttons) != null && n.toolbar)
|
|
456
456
|
for (const i of s.config.buttons.toolbar)
|
|
457
|
-
e.push(
|
|
457
|
+
e.push(il(i));
|
|
458
458
|
return e;
|
|
459
459
|
});
|
|
460
|
-
function
|
|
461
|
-
var e, t, n, i, c,
|
|
462
|
-
((e = s.config) == null ? void 0 : e.selectionMode) != null && (
|
|
460
|
+
function jt() {
|
|
461
|
+
var e, t, n, i, c, f, m, M, l, p;
|
|
462
|
+
((e = s.config) == null ? void 0 : e.selectionMode) != null && (L.value = s.config.selectionMode), ((n = (t = s.config) == null ? void 0 : t.elementName) == null ? void 0 : n.gender) === "F" && (xe.value = { create: "Nueva", edit: "Editar", delete: "Borrar", article: "una", deleted: "eliminada" }), ((i = s.config) == null ? void 0 : i.pageSize) != null && ($.value = s.config.pageSize), ((c = s.config) == null ? void 0 : c.pageSizeOptions) != null && (Ft.value = s.config.pageSizeOptions), ((f = s.config) == null ? void 0 : f.scrollHeight) != null && (Pe.value = s.config.scrollHeight), ((m = s.config) == null ? void 0 : m.showPaginator) != null && (At.value = s.config.showPaginator), ((M = s.config) == null ? void 0 : M.showFilterRow) != null && (Rt.value = s.config.showFilterRow), (p = (l = s.config) == null ? void 0 : l.buttons) != null && p.rowActions && (vt.value.rowActions = s.config.buttons.rowActions.map(il)), Ze(() => tl());
|
|
463
463
|
}
|
|
464
|
-
function
|
|
465
|
-
var c,
|
|
466
|
-
let { value: n } =
|
|
464
|
+
function pt(e, t) {
|
|
465
|
+
var c, f, m, M;
|
|
466
|
+
let { value: n } = rl(e, t);
|
|
467
467
|
if (n == null || n === "") return "-";
|
|
468
|
-
const i = (
|
|
468
|
+
const i = (f = (c = s.config) == null ? void 0 : c.valueFormatters) == null ? void 0 : f[t == null ? void 0 : t.field];
|
|
469
469
|
if ((t == null ? void 0 : t.form_type) === "color") {
|
|
470
|
-
const
|
|
471
|
-
return `<span class="te-color-badge" style="background:${
|
|
470
|
+
const l = "#" + (n || "000000"), p = Kl(l) || "#ffffff";
|
|
471
|
+
return `<span class="te-color-badge" style="background:${l};color:${p}">${n}</span>`;
|
|
472
472
|
}
|
|
473
473
|
if ((t == null ? void 0 : t.form_type) === "json") return JSON.stringify(n);
|
|
474
|
-
if ((t == null ? void 0 : t.type) === "date" || (
|
|
474
|
+
if ((t == null ? void 0 : t.type) === "date" || (m = t == null ? void 0 : t.field) != null && m.endsWith("_at") || (M = t == null ? void 0 : t.field) != null && M.endsWith("At"))
|
|
475
475
|
try {
|
|
476
476
|
return new Date(n).toLocaleDateString();
|
|
477
477
|
} catch {
|
|
@@ -485,61 +485,61 @@ const ql = { class: "te-wrapper" }, Jl = {
|
|
|
485
485
|
}
|
|
486
486
|
return (t == null ? void 0 : t.type) === "boolean" || (t == null ? void 0 : t.type) === "bool" ? n ? "Sí" : "No" : typeof i == "function" ? i(e) : String(n);
|
|
487
487
|
}
|
|
488
|
-
function
|
|
489
|
-
return
|
|
488
|
+
function Ee(e) {
|
|
489
|
+
return L.value === "single" ? x.value === e : P.value.has(e);
|
|
490
490
|
}
|
|
491
|
-
function
|
|
492
|
-
|
|
491
|
+
function ht(e) {
|
|
492
|
+
x.value === e ? (x.value = null, X.value = !0, k("rowSelected", null)) : (x.value = e, X.value = !1, k("rowSelected", e));
|
|
493
493
|
}
|
|
494
|
-
function
|
|
495
|
-
|
|
494
|
+
function gt(e) {
|
|
495
|
+
P.value.has(e) ? P.value.delete(e) : P.value.set(e, !0), X.value = P.value.size === 0, k("rowSelected", [...P.value.keys()]);
|
|
496
496
|
}
|
|
497
|
-
function
|
|
498
|
-
if (
|
|
499
|
-
|
|
497
|
+
function Kt() {
|
|
498
|
+
if (ft.value)
|
|
499
|
+
P.value = /* @__PURE__ */ new Map(), X.value = !0, k("rowSelected", []);
|
|
500
500
|
else {
|
|
501
501
|
const e = /* @__PURE__ */ new Map();
|
|
502
|
-
for (const t of
|
|
503
|
-
|
|
502
|
+
for (const t of oe.value) e.set(t, !0);
|
|
503
|
+
P.value = e, X.value = !1, k("rowSelected", [...e.keys()]);
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
function Wt(e) {
|
|
507
|
-
|
|
507
|
+
G.value || H.value || (L.value === "multiple" ? gt(e) : ht(e));
|
|
508
508
|
}
|
|
509
509
|
function Gt(e) {
|
|
510
510
|
var t, n, i;
|
|
511
|
-
|
|
511
|
+
G.value || H.value || (k("rowDoubleClick", e), (t = s.config) != null && t.editOnDoubleClick && ((n = s.api) != null && n.edit) && Ge((i = s.permisos) == null ? void 0 : i.edit) && (L.value === "single" && (x.value = e), _t("edit")));
|
|
512
512
|
}
|
|
513
|
-
function
|
|
514
|
-
return
|
|
513
|
+
function yt(e) {
|
|
514
|
+
return K.value !== e ? "sort" : ce.value === "asc" ? "sort-asc" : "sort-desc";
|
|
515
515
|
}
|
|
516
|
-
function
|
|
517
|
-
if (
|
|
518
|
-
|
|
519
|
-
const t =
|
|
520
|
-
(t == null ? void 0 : t.sortable) !== !1 && (
|
|
516
|
+
function mt(e) {
|
|
517
|
+
if (G.value || H.value) return;
|
|
518
|
+
be();
|
|
519
|
+
const t = O.value.find((n) => n.field === e);
|
|
520
|
+
(t == null ? void 0 : t.sortable) !== !1 && (K.value === e ? ce.value = ce.value === "asc" ? "desc" : "asc" : (K.value = e, ce.value = "asc"), F.value = 1, I.value && (Q.value && (de.value = 1, ne.value = !0, A.value = []), Ce()));
|
|
521
521
|
}
|
|
522
|
-
function
|
|
523
|
-
|
|
524
|
-
|
|
522
|
+
function _l() {
|
|
523
|
+
we && clearTimeout(we), we = setTimeout(() => {
|
|
524
|
+
F.value = 1, I.value && (Q.value && (de.value = 1, ne.value = !0, A.value = []), Ce());
|
|
525
525
|
}, 300);
|
|
526
526
|
}
|
|
527
527
|
function qt() {
|
|
528
|
-
|
|
529
|
-
|
|
528
|
+
Le && clearTimeout(Le), Le = setTimeout(() => {
|
|
529
|
+
F.value = 1, I.value && (Q.value && (de.value = 1, ne.value = !0, A.value = []), Ce());
|
|
530
530
|
}, 400);
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
|
|
532
|
+
function Cl() {
|
|
533
|
+
ae && clearTimeout(ae), ae = setTimeout(() => lt(), 300);
|
|
534
534
|
}
|
|
535
|
-
function
|
|
536
|
-
|
|
535
|
+
function qe(e) {
|
|
536
|
+
be(), F.value = Math.max(1, Math.min(e, De.value)), I.value && Ce();
|
|
537
537
|
}
|
|
538
|
-
function
|
|
539
|
-
|
|
538
|
+
function Sl() {
|
|
539
|
+
be(), F.value = 1, I.value && Ce();
|
|
540
540
|
}
|
|
541
|
-
function
|
|
542
|
-
if (e.button !== 0 ||
|
|
541
|
+
function ke(e, t) {
|
|
542
|
+
if (e.button !== 0 || H.value) return;
|
|
543
543
|
e.preventDefault();
|
|
544
544
|
const n = e.currentTarget.closest("th, td");
|
|
545
545
|
if (!(!n || n.getBoundingClientRect().right - e.clientX > 11)) {
|
|
@@ -547,328 +547,328 @@ const ql = { class: "te-wrapper" }, Jl = {
|
|
|
547
547
|
n.setPointerCapture(e.pointerId);
|
|
548
548
|
} catch {
|
|
549
549
|
}
|
|
550
|
-
|
|
550
|
+
G.value = t, Oe = e.clientX, Ne = n.offsetWidth, document.body.style.cursor = "col-resize", document.body.classList.add("te-resizing"), document.addEventListener("pointermove", kt), document.addEventListener("pointerup", bt);
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
|
-
function
|
|
554
|
-
if (!
|
|
553
|
+
function kt(e) {
|
|
554
|
+
if (!G.value || Oe == null || Ne == null) return;
|
|
555
555
|
const t = Math.max(100, Ne + (e.clientX - Oe));
|
|
556
|
-
|
|
556
|
+
Se.value = { ...Se.value, [G.value]: t + "px" };
|
|
557
557
|
}
|
|
558
|
-
function
|
|
559
|
-
document.removeEventListener("pointermove",
|
|
558
|
+
function bt() {
|
|
559
|
+
document.removeEventListener("pointermove", kt), document.removeEventListener("pointerup", bt), document.body.style.cursor = "", document.body.classList.remove("te-resizing"), G.value && lt(), Oe = null, Ne = null, G.value = null;
|
|
560
560
|
}
|
|
561
|
-
function
|
|
562
|
-
|
|
561
|
+
function Fe(e, t) {
|
|
562
|
+
ke(e, t);
|
|
563
563
|
}
|
|
564
|
-
function
|
|
565
|
-
if (
|
|
564
|
+
function Ml(e, t) {
|
|
565
|
+
if (G.value) {
|
|
566
566
|
e.preventDefault();
|
|
567
567
|
return;
|
|
568
568
|
}
|
|
569
|
-
|
|
570
|
-
}
|
|
571
|
-
function Ml(e, t) {
|
|
572
|
-
R.value === t || e.relatedTarget && e.currentTarget.contains(e.relatedTarget) || (X.value = t);
|
|
569
|
+
H.value = t, Z.value = null, W.value = null, e.dataTransfer && (e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", t));
|
|
573
570
|
}
|
|
574
571
|
function Tl(e, t) {
|
|
575
|
-
|
|
576
|
-
e.dataTransfer && (e.dataTransfer.dropEffect = "move");
|
|
577
|
-
const n = e.currentTarget.getBoundingClientRect();
|
|
578
|
-
B.value = e.clientX < n.left + n.width / 2 ? "left" : "right";
|
|
572
|
+
H.value === t || e.relatedTarget && e.currentTarget.contains(e.relatedTarget) || (Z.value = t);
|
|
579
573
|
}
|
|
580
574
|
function Ll(e, t) {
|
|
581
|
-
|
|
575
|
+
if (H.value === t) return;
|
|
576
|
+
e.dataTransfer && (e.dataTransfer.dropEffect = "move");
|
|
577
|
+
const n = e.currentTarget.getBoundingClientRect();
|
|
578
|
+
W.value = e.clientX < n.left + n.width / 2 ? "left" : "right";
|
|
582
579
|
}
|
|
583
580
|
function wl(e, t) {
|
|
584
|
-
|
|
585
|
-
|
|
581
|
+
e.currentTarget.contains(e.relatedTarget) || Z.value === t && (Z.value = null, W.value = null);
|
|
582
|
+
}
|
|
583
|
+
function xl(e, t) {
|
|
584
|
+
if (!H.value || H.value === t) {
|
|
585
|
+
Je();
|
|
586
586
|
return;
|
|
587
587
|
}
|
|
588
|
-
const n =
|
|
588
|
+
const n = le.value.length ? [...le.value] : R.value.map((M) => M.field), i = n.indexOf(H.value), c = n.indexOf(t);
|
|
589
589
|
if (i < 0 || c < 0) {
|
|
590
|
-
|
|
590
|
+
Je();
|
|
591
591
|
return;
|
|
592
592
|
}
|
|
593
|
-
const [
|
|
594
|
-
n.splice(Math.max(0, Math.min(n.length,
|
|
593
|
+
const [f] = n.splice(i, 1), m = i < c ? W.value === "right" ? c : c - 1 : W.value === "left" ? c : c + 1;
|
|
594
|
+
n.splice(Math.max(0, Math.min(n.length, m)), 0, f), le.value = n, lt(), Je();
|
|
595
595
|
}
|
|
596
|
-
function
|
|
597
|
-
|
|
596
|
+
function Je() {
|
|
597
|
+
H.value = null, Z.value = null, W.value = null;
|
|
598
598
|
}
|
|
599
|
-
function
|
|
600
|
-
return
|
|
599
|
+
function Ue(e) {
|
|
600
|
+
return ml.value[e == null ? void 0 : e.field] || null;
|
|
601
601
|
}
|
|
602
|
-
function
|
|
603
|
-
return
|
|
602
|
+
function Dl(e, t) {
|
|
603
|
+
return q.value ? q.value.row === e && q.value.field === t.field : !1;
|
|
604
604
|
}
|
|
605
605
|
function Jt(e, t, n) {
|
|
606
|
-
var
|
|
607
|
-
if (!
|
|
608
|
-
(
|
|
609
|
-
const
|
|
610
|
-
|
|
611
|
-
const
|
|
612
|
-
|
|
606
|
+
var m, M;
|
|
607
|
+
if (!Ue(n)) return;
|
|
608
|
+
(m = e == null ? void 0 : e.stopPropagation) == null || m.call(e);
|
|
609
|
+
const f = ((M = t.__raw) == null ? void 0 : M[n.field]) ?? t[n.field] ?? "";
|
|
610
|
+
me.value = f, q.value = { row: t, field: n.field }, fe.value = f, Ze(() => {
|
|
611
|
+
const l = Array.isArray(ze.value) ? ze.value[0] : ze.value;
|
|
612
|
+
l && typeof l.focus == "function" && (l.focus(), l.select());
|
|
613
613
|
});
|
|
614
614
|
}
|
|
615
615
|
function Ut(e, t) {
|
|
616
|
-
if (!
|
|
617
|
-
const n =
|
|
616
|
+
if (!q.value) return;
|
|
617
|
+
const n = Ue(t);
|
|
618
618
|
if (!n) {
|
|
619
|
-
|
|
619
|
+
Ae();
|
|
620
620
|
return;
|
|
621
621
|
}
|
|
622
|
-
let i =
|
|
622
|
+
let i = fe.value;
|
|
623
623
|
if (n.type === "currency") {
|
|
624
624
|
const c = String(i).replace(/[^0-9,\-]/g, "").replace(",", ".");
|
|
625
625
|
if (i = parseFloat(c), isNaN(i)) {
|
|
626
|
-
|
|
626
|
+
Ae();
|
|
627
627
|
return;
|
|
628
628
|
}
|
|
629
629
|
} else if (n.type === "integer") {
|
|
630
630
|
if (i = parseInt(i, 10), isNaN(i) || n.min !== void 0 && i < n.min) {
|
|
631
|
-
|
|
631
|
+
Ae();
|
|
632
632
|
return;
|
|
633
633
|
}
|
|
634
634
|
} else if (n.type === "number" && (i = parseFloat(i), isNaN(i) || n.min !== void 0 && i < n.min)) {
|
|
635
|
-
|
|
635
|
+
Ae();
|
|
636
636
|
return;
|
|
637
637
|
}
|
|
638
|
-
e[t.field] = n.format ? n.format(i) : i, e.__raw || (e.__raw = {}), e.__raw[t.field] = i, n.afterEdit && n.afterEdit(e, t.field, i),
|
|
638
|
+
e[t.field] = n.format ? n.format(i) : i, e.__raw || (e.__raw = {}), e.__raw[t.field] = i, n.afterEdit && n.afterEdit(e, t.field, i), q.value = null, fe.value = "", El(e, t.field, i);
|
|
639
639
|
}
|
|
640
|
-
function
|
|
641
|
-
if (
|
|
642
|
-
const { row: e, field: t } =
|
|
643
|
-
e[t] =
|
|
640
|
+
function Ae() {
|
|
641
|
+
if (q.value && me.value !== null) {
|
|
642
|
+
const { row: e, field: t } = q.value;
|
|
643
|
+
e[t] = me.value;
|
|
644
644
|
}
|
|
645
|
-
|
|
645
|
+
q.value = null, fe.value = "", me.value = null;
|
|
646
646
|
}
|
|
647
|
-
function
|
|
648
|
-
const i =
|
|
647
|
+
function El(e, t, n) {
|
|
648
|
+
const i = $t.value;
|
|
649
649
|
if (!(i != null && i.api)) return;
|
|
650
650
|
const c = e.id;
|
|
651
651
|
if (!c) return;
|
|
652
|
-
|
|
653
|
-
const
|
|
654
|
-
|
|
655
|
-
const
|
|
656
|
-
|
|
652
|
+
J && (clearTimeout(J), J = null), V && (V.api(V.data), V = null);
|
|
653
|
+
const f = me.value ?? e[t];
|
|
654
|
+
V = { api: i.api, data: { id: c, field: t, value: n } }, J = setTimeout(async () => {
|
|
655
|
+
const m = await i.api({ id: c, field: t, value: n });
|
|
656
|
+
V = null, _e(m) ? (e[t] = f, console.error("[TableEditor] inline save failed:", m)) : i.onSave && i.onSave();
|
|
657
657
|
}, i.debounce_ms ?? 1e3);
|
|
658
658
|
}
|
|
659
|
-
function
|
|
660
|
-
|
|
659
|
+
function be() {
|
|
660
|
+
q.value = null, fe.value = "", me.value = null, J && (clearTimeout(J), J = null), V && (V.api(V.data), V = null);
|
|
661
661
|
}
|
|
662
|
-
function
|
|
663
|
-
var i, c,
|
|
662
|
+
function Xt(e) {
|
|
663
|
+
var i, c, f, m, M;
|
|
664
664
|
const t = ((c = (i = s.config) == null ? void 0 : i.extraFields) == null ? void 0 : c[e === "create" ? "create" : e === "edit" ? "edit" : "list"]) || [], n = e === "edit";
|
|
665
665
|
return {
|
|
666
666
|
action: e,
|
|
667
|
-
title: `${
|
|
668
|
-
campos: [...
|
|
669
|
-
modelo: n ?
|
|
670
|
-
onSubmit: (
|
|
671
|
-
guardado: () =>
|
|
672
|
-
selectedRows:
|
|
667
|
+
title: `${xe.value[e]} ${((m = (f = s.config) == null ? void 0 : f.elementName) == null ? void 0 : m.singular) || ""}`.trim(),
|
|
668
|
+
campos: [...xt.value, ...t],
|
|
669
|
+
modelo: n ? x.value : {},
|
|
670
|
+
onSubmit: (M = s.api) == null ? void 0 : M[e],
|
|
671
|
+
guardado: () => Ye(),
|
|
672
|
+
selectedRows: L.value === "multiple" ? [...P.value.keys()] : [x.value]
|
|
673
673
|
};
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function _t(e) {
|
|
676
676
|
var n, i, c;
|
|
677
677
|
if (!((n = s.api) != null && n[e])) return;
|
|
678
678
|
const t = (c = (i = s.config) == null ? void 0 : i.crud) == null ? void 0 : c.openModal;
|
|
679
679
|
if (typeof t == "function") {
|
|
680
|
-
t(
|
|
680
|
+
t(Xt(e));
|
|
681
681
|
return;
|
|
682
682
|
}
|
|
683
|
-
|
|
683
|
+
k(e + "Request", Xt(e));
|
|
684
684
|
}
|
|
685
|
-
async function
|
|
685
|
+
async function Fl() {
|
|
686
686
|
var i, c;
|
|
687
|
-
const t = (
|
|
687
|
+
const t = (L.value === "multiple" ? [...P.value.keys()] : [x.value]).map((f) => f == null ? void 0 : f.id).filter(Boolean);
|
|
688
688
|
if (!t.length) {
|
|
689
|
-
|
|
689
|
+
k("deleteRequest", { ids: [], action: "delete" });
|
|
690
690
|
return;
|
|
691
691
|
}
|
|
692
692
|
const n = (c = (i = s.config) == null ? void 0 : i.crud) == null ? void 0 : c.confirmDelete;
|
|
693
|
-
typeof n == "function" ? Promise.resolve(n(t)).then((
|
|
694
|
-
|
|
695
|
-
}).catch((
|
|
693
|
+
typeof n == "function" ? Promise.resolve(n(t)).then((f) => {
|
|
694
|
+
f && Al(t);
|
|
695
|
+
}).catch((f) => console.error("[TableEditor] confirmDelete error:", f)) : k("deleteRequest", { ids: t, action: "delete" });
|
|
696
696
|
}
|
|
697
|
-
async function
|
|
697
|
+
async function Al(e) {
|
|
698
698
|
var t;
|
|
699
699
|
if (!(!((t = s.api) != null && t.delete) || !e.length))
|
|
700
700
|
try {
|
|
701
701
|
const n = await s.api.delete({ id: e[0] });
|
|
702
|
-
if (
|
|
702
|
+
if (_e(n)) {
|
|
703
703
|
console.error("[TableEditor] delete failed:", n);
|
|
704
704
|
return;
|
|
705
705
|
}
|
|
706
|
-
|
|
706
|
+
x.value = null, P.value = /* @__PURE__ */ new Map(), X.value = !0, Ye();
|
|
707
707
|
} catch (n) {
|
|
708
708
|
console.error("[TableEditor] delete error:", n);
|
|
709
709
|
}
|
|
710
710
|
}
|
|
711
|
-
function
|
|
711
|
+
function _e(e) {
|
|
712
712
|
return e != null && (e.status === !1 || e.stat === !1);
|
|
713
713
|
}
|
|
714
|
-
async function
|
|
714
|
+
async function Rl() {
|
|
715
715
|
var e, t, n;
|
|
716
|
-
if (
|
|
716
|
+
if (I.value && ((e = s.config) != null && e.csvFetchAll) && ((t = s.api) != null && t.list))
|
|
717
717
|
try {
|
|
718
|
-
const i =
|
|
719
|
-
i[
|
|
718
|
+
const i = Ct({ page: 1 });
|
|
719
|
+
i[Ie.value ? "rows" : "pageSize"] = Math.max(Te.value || 0, $.value);
|
|
720
720
|
const c = await s.api.list(i);
|
|
721
|
-
if (
|
|
721
|
+
if (_e(c)) {
|
|
722
722
|
console.error("[TableEditor] CSV fetch error:", c);
|
|
723
723
|
return;
|
|
724
724
|
}
|
|
725
|
-
|
|
725
|
+
Yt(((n = c == null ? void 0 : c.data) == null ? void 0 : n.rows) || []);
|
|
726
726
|
return;
|
|
727
727
|
} catch (i) {
|
|
728
728
|
console.error("[TableEditor] CSV fetch error:", i);
|
|
729
729
|
return;
|
|
730
730
|
}
|
|
731
|
-
|
|
731
|
+
Yt(A.value || []);
|
|
732
732
|
}
|
|
733
|
-
function
|
|
733
|
+
function Yt(e) {
|
|
734
734
|
if (!e.length) return;
|
|
735
|
-
const t =
|
|
736
|
-
let n = t.map((c) =>
|
|
735
|
+
const t = O.value;
|
|
736
|
+
let n = t.map((c) => Qt(c.headerName)).join(",") + `
|
|
737
737
|
`;
|
|
738
738
|
for (const c of e)
|
|
739
|
-
n += t.map((
|
|
739
|
+
n += t.map((f) => Qt(c[f.field] != null ? String(c[f.field]) : "")).join(",") + `
|
|
740
740
|
`;
|
|
741
741
|
const i = document.createElement("a");
|
|
742
742
|
i.href = "data:text/csv;charset=utf-8," + encodeURIComponent("\uFEFF" + n), i.download = "datos.csv", i.click();
|
|
743
743
|
}
|
|
744
|
-
function
|
|
744
|
+
function Qt(e) {
|
|
745
745
|
return e = String(e).replace(/"/g, '""'), e.includes(",") || e.includes('"') || e.includes(`
|
|
746
746
|
`) ? '"' + e + '"' : e;
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function Xe(e) {
|
|
749
749
|
let t = String(e || "primary");
|
|
750
750
|
return t.startsWith("te-btn-") ? t : (t.startsWith("btn-") && (t = t.slice(4)), "te-btn-" + t);
|
|
751
751
|
}
|
|
752
|
-
function
|
|
753
|
-
|
|
752
|
+
function Zt(e) {
|
|
753
|
+
ot.value && !ot.value.contains(e.target) && (He.value = !1);
|
|
754
754
|
}
|
|
755
|
-
function
|
|
756
|
-
|
|
755
|
+
function Ye() {
|
|
756
|
+
be(), x.value = null, P.value = /* @__PURE__ */ new Map(), X.value = !0, Q.value && (de.value = 1, ne.value = !0, A.value = []), Qe();
|
|
757
757
|
}
|
|
758
|
-
function
|
|
758
|
+
function Ct(e = {}) {
|
|
759
759
|
const n = {
|
|
760
|
-
page: e.page ?? (
|
|
761
|
-
[
|
|
762
|
-
sortField:
|
|
763
|
-
sortOrder:
|
|
764
|
-
[
|
|
760
|
+
page: e.page ?? (Q.value ? de.value : F.value),
|
|
761
|
+
[Ie.value ? "rows" : "pageSize"]: $.value,
|
|
762
|
+
sortField: K.value || "",
|
|
763
|
+
sortOrder: ce.value,
|
|
764
|
+
[Ie.value ? "globalSearch" : "search"]: Re.value || ""
|
|
765
765
|
}, i = {};
|
|
766
|
-
for (const c of Object.keys(
|
|
767
|
-
|
|
766
|
+
for (const c of Object.keys(Y.value))
|
|
767
|
+
Y.value[c] && (i[c] = Ie.value ? { value: Y.value[c], matchMode: "contains" } : Y.value[c]);
|
|
768
768
|
return Object.keys(i).length && (n.filters = JSON.stringify(i)), n;
|
|
769
769
|
}
|
|
770
|
-
async function
|
|
770
|
+
async function Ce() {
|
|
771
771
|
var e, t;
|
|
772
|
-
|
|
772
|
+
be(), Me.value = !0;
|
|
773
773
|
try {
|
|
774
|
-
const n = await s.api.list(
|
|
775
|
-
|
|
774
|
+
const n = await s.api.list(Ct());
|
|
775
|
+
_e(n) || (Te.value = ((e = n == null ? void 0 : n.data) == null ? void 0 : e.totalRecords) || ((t = n == null ? void 0 : n.data) == null ? void 0 : t.total) || 0, St(n == null ? void 0 : n.data));
|
|
776
776
|
} catch (n) {
|
|
777
777
|
console.error("[TableEditor] load error:", n);
|
|
778
778
|
} finally {
|
|
779
|
-
|
|
779
|
+
Me.value = !1;
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
|
-
async function
|
|
782
|
+
async function Qe(e) {
|
|
783
783
|
var n;
|
|
784
784
|
const t = e || s.data;
|
|
785
|
-
if (t != null) return
|
|
785
|
+
if (t != null) return St(t);
|
|
786
786
|
if ((n = s.api) != null && n.list) {
|
|
787
|
-
if (
|
|
788
|
-
|
|
787
|
+
if (I.value) return Ce();
|
|
788
|
+
Me.value = !0;
|
|
789
789
|
try {
|
|
790
790
|
const i = await s.api.list();
|
|
791
|
-
|
|
791
|
+
_e(i) || St(i == null ? void 0 : i.data);
|
|
792
792
|
} catch (i) {
|
|
793
793
|
console.error("[TableEditor] load error:", i);
|
|
794
794
|
} finally {
|
|
795
|
-
|
|
795
|
+
Me.value = !1;
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
|
-
|
|
798
|
+
k("rowSelected", L.value === "single" ? null : []), x.value = null, P.value = /* @__PURE__ */ new Map();
|
|
799
799
|
}
|
|
800
|
-
function
|
|
801
|
-
var i, c,
|
|
800
|
+
function St(e) {
|
|
801
|
+
var i, c, f, m, M, l;
|
|
802
802
|
if (!e) {
|
|
803
|
-
|
|
803
|
+
Et.value = !0, k("loaded", !0);
|
|
804
804
|
return;
|
|
805
805
|
}
|
|
806
806
|
let t = e.rows || [], n = e.fields_def;
|
|
807
|
-
if (
|
|
808
|
-
const
|
|
809
|
-
if (
|
|
810
|
-
|
|
811
|
-
let
|
|
812
|
-
(c = (i = s.config) == null ? void 0 : i.extraFields) != null && c.list &&
|
|
813
|
-
const
|
|
814
|
-
if (
|
|
815
|
-
for (const
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
let
|
|
819
|
-
if ((
|
|
820
|
-
for (let
|
|
821
|
-
|
|
822
|
-
if ((
|
|
823
|
-
const
|
|
824
|
-
for (const
|
|
825
|
-
const
|
|
826
|
-
|
|
807
|
+
if (ve.value ? (ve.value.processRows && (t = ve.value.processRows(t, n) || t), ve.value.processFields && (n = ve.value.processFields(n, t[0]) ?? n)) : Be.value && (t = t.map((p) => ol(p, Be.value))), A.value = t, be(), n) {
|
|
808
|
+
const p = JSON.stringify(n.map((_) => _ == null ? void 0 : _.field));
|
|
809
|
+
if (p === Dt.value) return;
|
|
810
|
+
Dt.value = p;
|
|
811
|
+
let d = [...n];
|
|
812
|
+
(c = (i = s.config) == null ? void 0 : i.extraFields) != null && c.list && d.push(...s.config.extraFields.list), Be.value && Wl(d, Be.value);
|
|
813
|
+
const C = (f = s.config) == null ? void 0 : f.columnFilterDefs;
|
|
814
|
+
if (C)
|
|
815
|
+
for (const _ of d)
|
|
816
|
+
C[_.field] && (_.filter = { type: "text", ...C[_.field] });
|
|
817
|
+
xt.value = d;
|
|
818
|
+
let Mt = d;
|
|
819
|
+
if ((m = ve.value) != null && m.processColumns && (Mt = ve.value.processColumns(d)), R.value = [...Mt], it.value = [...Mt], (M = s.config) != null && M.defaultColumnProps)
|
|
820
|
+
for (let _ = 0; _ < R.value.length; _++)
|
|
821
|
+
R.value[_] = { ...R.value[_], ...s.config.defaultColumnProps };
|
|
822
|
+
if ((l = s.config) != null && l.columnOrder) {
|
|
823
|
+
const _ = [];
|
|
824
|
+
for (const re of s.config.columnOrder) {
|
|
825
|
+
const ee = R.value.find((Tt) => Tt.field === re);
|
|
826
|
+
ee && _.push(ee);
|
|
827
827
|
}
|
|
828
|
-
for (const
|
|
829
|
-
|
|
830
|
-
|
|
828
|
+
for (const re of R.value)
|
|
829
|
+
_.some((ee) => ee.field === re.field) || _.push(re);
|
|
830
|
+
R.value = _;
|
|
831
831
|
}
|
|
832
|
-
|
|
833
|
-
if (
|
|
834
|
-
for (const [
|
|
835
|
-
|
|
836
|
-
if (
|
|
837
|
-
const
|
|
838
|
-
|
|
832
|
+
cl().then((_) => {
|
|
833
|
+
if (_ != null && _.columnWidths)
|
|
834
|
+
for (const [re, ee] of Object.entries(_.columnWidths))
|
|
835
|
+
Se.value[re] = ee;
|
|
836
|
+
if (le.value = (_ == null ? void 0 : _.columnOrder) || [], Array.isArray(_ == null ? void 0 : _.hiddenFields) && _.hiddenFields.length) {
|
|
837
|
+
const re = new Set(_.hiddenFields), ee = R.value.filter((Tt) => !re.has(Tt.field));
|
|
838
|
+
ee.length && (R.value = ee);
|
|
839
839
|
}
|
|
840
840
|
});
|
|
841
841
|
}
|
|
842
|
-
|
|
842
|
+
Et.value = !0, k("loaded", !0);
|
|
843
843
|
}
|
|
844
|
-
function
|
|
845
|
-
if (!
|
|
846
|
-
const e =
|
|
847
|
-
!e || !
|
|
848
|
-
t.isIntersecting &&
|
|
849
|
-
}, { root: e, rootMargin: "0px 0px 200px 0px", threshold: 0 }),
|
|
844
|
+
function Pl() {
|
|
845
|
+
if (!Q.value) return;
|
|
846
|
+
const e = st.value;
|
|
847
|
+
!e || !at.value || (ie == null || ie.disconnect(), ie = new IntersectionObserver(([t]) => {
|
|
848
|
+
t.isIntersecting && ne.value && !Ve.value && Vl();
|
|
849
|
+
}, { root: e, rootMargin: "0px 0px 200px 0px", threshold: 0 }), ie.observe(at.value));
|
|
850
850
|
}
|
|
851
|
-
async function
|
|
851
|
+
async function Vl() {
|
|
852
852
|
var e, t, n;
|
|
853
|
-
if (
|
|
854
|
-
|
|
853
|
+
if (Ve.value = !0, I.value) {
|
|
854
|
+
de.value++;
|
|
855
855
|
try {
|
|
856
|
-
const i = await s.api.list(
|
|
857
|
-
if (!
|
|
856
|
+
const i = await s.api.list(Ct({ page: de.value }));
|
|
857
|
+
if (!_e(i)) {
|
|
858
858
|
const c = ((e = i == null ? void 0 : i.data) == null ? void 0 : e.rows) || [];
|
|
859
|
-
c.length && (
|
|
859
|
+
c.length && (A.value = [...A.value, ...c]), Te.value = ((t = i == null ? void 0 : i.data) == null ? void 0 : t.totalRecords) || ((n = i == null ? void 0 : i.data) == null ? void 0 : n.total) || 0;
|
|
860
860
|
}
|
|
861
|
-
|
|
861
|
+
ne.value = A.value.length < Te.value;
|
|
862
862
|
} catch (i) {
|
|
863
|
-
console.error("[TableEditor] load more error:", i),
|
|
863
|
+
console.error("[TableEditor] load more error:", i), ne.value = !1;
|
|
864
864
|
}
|
|
865
865
|
} else {
|
|
866
|
-
const i =
|
|
867
|
-
|
|
866
|
+
const i = We.value.length, c = A.value.length, f = Math.min(c + $.value, i);
|
|
867
|
+
f > c && (A.value = [...We.value.slice(0, f)]), ne.value = A.value.length < i;
|
|
868
868
|
}
|
|
869
|
-
|
|
869
|
+
Ve.value = !1;
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function el(e, t) {
|
|
872
872
|
var i;
|
|
873
873
|
const n = (i = s.config) == null ? void 0 : i.trackBy;
|
|
874
874
|
if (n) {
|
|
@@ -880,624 +880,638 @@ const ql = { class: "te-wrapper" }, Jl = {
|
|
|
880
880
|
}
|
|
881
881
|
return (e == null ? void 0 : e.id) ?? (e == null ? void 0 : e.__uid) ?? t;
|
|
882
882
|
}
|
|
883
|
-
|
|
884
|
-
(e == null ? void 0 : e.rows) !== void 0 &&
|
|
885
|
-
}),
|
|
886
|
-
function
|
|
887
|
-
!
|
|
888
|
-
const e =
|
|
883
|
+
Lt(() => s.data, (e) => {
|
|
884
|
+
(e == null ? void 0 : e.rows) !== void 0 && Qe(e);
|
|
885
|
+
}), Lt(oe, () => tl()), Lt([ut, Ht], () => zt());
|
|
886
|
+
function tl() {
|
|
887
|
+
!B.value.length || U.value || Ze(() => {
|
|
888
|
+
const e = st.value;
|
|
889
889
|
if (!e) return;
|
|
890
890
|
let t = 0;
|
|
891
891
|
e.querySelectorAll(".te-actions-wrap").forEach((n) => {
|
|
892
892
|
t = Math.max(t, n.scrollWidth);
|
|
893
|
-
}), t > 0 && (
|
|
893
|
+
}), t > 0 && (Vt.value = Math.max(56, t + 24) + "px");
|
|
894
894
|
});
|
|
895
895
|
}
|
|
896
|
-
return
|
|
897
|
-
|
|
896
|
+
return Hl(async () => {
|
|
897
|
+
jt(), zt(), document.addEventListener("click", Zt), window.addEventListener("beforeunload", nt), w.value.fetchMisPreferencias && await w.value.fetchMisPreferencias(), await Qe(), Ze(() => Pl());
|
|
898
898
|
}), Ol(() => {
|
|
899
|
-
document.removeEventListener("click",
|
|
900
|
-
}), a({ loadData:
|
|
901
|
-
var n, i, c;
|
|
902
|
-
return
|
|
903
|
-
!((n =
|
|
904
|
-
|
|
905
|
-
(
|
|
899
|
+
document.removeEventListener("click", Zt), se && se.removeEventListener("change", ct), document.removeEventListener("pointermove", kt), document.removeEventListener("pointerup", bt), window.removeEventListener("beforeunload", nt), nt(), ie == null || ie.disconnect(), J && (clearTimeout(J), J = null), V && (V.api(V.data), V = null), Le && clearTimeout(Le), we && clearTimeout(we), ae && clearTimeout(ae);
|
|
900
|
+
}), a({ loadData: Qe, applyConfig: jt, refresh: Ye }), (e, t) => {
|
|
901
|
+
var n, i, c, f, m, M;
|
|
902
|
+
return r(), u("div", ql, [
|
|
903
|
+
!((n = o.config) != null && n.hideToolbar) || rt.value.length ? (r(), u("div", Jl, [
|
|
904
|
+
h("div", Ul, [
|
|
905
|
+
(r(!0), u(T, null, D(Bt.value, (l) => (r(), u("button", {
|
|
906
906
|
key: l.key,
|
|
907
|
-
class:
|
|
907
|
+
class: N(["te-btn", Xe(l.severity), l.class]),
|
|
908
908
|
disabled: l.isDisabled(),
|
|
909
909
|
onClick: l.onClick,
|
|
910
|
-
title: l.getLabel()
|
|
910
|
+
title: l.getLabel(),
|
|
911
|
+
"data-help": l.helpKey || void 0
|
|
911
912
|
}, [
|
|
912
|
-
l.icon ? (
|
|
913
|
+
l.icon ? (r(), u("span", {
|
|
913
914
|
key: 0,
|
|
914
915
|
class: "te-btn-icon",
|
|
915
|
-
innerHTML:
|
|
916
|
-
}, null, 8,
|
|
917
|
-
|
|
918
|
-
], 10,
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
(
|
|
916
|
+
innerHTML: z(j)(l.icon)
|
|
917
|
+
}, null, 8, Yl)) : y("", !0),
|
|
918
|
+
te(E(l.getLabel()), 1)
|
|
919
|
+
], 10, Xl))), 128)),
|
|
920
|
+
rt.value.length ? (r(), u(T, { key: 0 }, [
|
|
921
|
+
Bt.value.length ? (r(), u("span", Ql, "|")) : y("", !0),
|
|
922
|
+
(r(!0), u(T, null, D(rt.value, (l) => (r(), u("button", {
|
|
922
923
|
key: "ra-" + l.key,
|
|
923
|
-
class:
|
|
924
|
-
disabled: l.isDisabled() ||
|
|
925
|
-
onClick: (
|
|
926
|
-
title: l.getLabel()
|
|
924
|
+
class: N(["te-btn", Xe(l.severity), l.class]),
|
|
925
|
+
disabled: l.isDisabled() || !$e.value.length,
|
|
926
|
+
onClick: (p) => l.onClick($e.value.length === 1 ? $e.value[0] : $e.value),
|
|
927
|
+
title: l.getLabel(),
|
|
928
|
+
"data-help": l.helpKey || void 0
|
|
927
929
|
}, [
|
|
928
|
-
l.icon ? (
|
|
930
|
+
l.icon ? (r(), u("span", {
|
|
929
931
|
key: 0,
|
|
930
932
|
class: "te-btn-icon",
|
|
931
|
-
innerHTML:
|
|
932
|
-
}, null, 8,
|
|
933
|
-
|
|
934
|
-
], 10,
|
|
935
|
-
], 64)) :
|
|
933
|
+
innerHTML: z(j)(l.icon)
|
|
934
|
+
}, null, 8, en)) : y("", !0),
|
|
935
|
+
te(E(l.getLabel()), 1)
|
|
936
|
+
], 10, Zl))), 128))
|
|
937
|
+
], 64)) : y("", !0)
|
|
936
938
|
]),
|
|
937
|
-
(i =
|
|
938
|
-
(c =
|
|
939
|
+
(i = o.config) != null && i.hideToolbarEnd ? y("", !0) : (r(), u("div", tn, [
|
|
940
|
+
(c = o.config) != null && c.hideColumnSelector ? y("", !0) : (r(), u("div", {
|
|
939
941
|
key: 0,
|
|
940
942
|
class: "te-dropdown",
|
|
941
943
|
ref_key: "colsDropdownRef",
|
|
942
|
-
ref:
|
|
944
|
+
ref: ot,
|
|
945
|
+
"data-help": ((f = o.config) == null ? void 0 : f.columnSelectorHelpKey) || void 0
|
|
943
946
|
}, [
|
|
944
|
-
|
|
947
|
+
h("button", {
|
|
945
948
|
class: "te-btn te-btn-outline-secondary",
|
|
946
949
|
type: "button",
|
|
947
950
|
title: "Columnas",
|
|
948
|
-
onClick: t[0] || (t[0] = (l) =>
|
|
951
|
+
onClick: t[0] || (t[0] = (l) => He.value = !He.value)
|
|
949
952
|
}, [
|
|
950
|
-
|
|
953
|
+
h("span", {
|
|
951
954
|
class: "te-btn-icon",
|
|
952
|
-
innerHTML:
|
|
953
|
-
}, null, 8,
|
|
954
|
-
t[17] || (t[17] =
|
|
955
|
+
innerHTML: z(j)("columns")
|
|
956
|
+
}, null, 8, nn),
|
|
957
|
+
t[17] || (t[17] = te("Columnas ", -1))
|
|
955
958
|
]),
|
|
956
|
-
|
|
957
|
-
(
|
|
959
|
+
He.value ? (r(), u("div", an, [
|
|
960
|
+
(r(!0), u(T, null, D(it.value, (l) => (r(), u("label", {
|
|
958
961
|
key: l.field,
|
|
959
962
|
class: "te-dropdown-item"
|
|
960
963
|
}, [
|
|
961
|
-
|
|
964
|
+
pe(h("input", {
|
|
962
965
|
type: "checkbox",
|
|
963
966
|
id: "te-cols-" + l.field,
|
|
964
967
|
value: l,
|
|
965
|
-
"onUpdate:modelValue": t[1] || (t[1] = (
|
|
968
|
+
"onUpdate:modelValue": t[1] || (t[1] = (p) => R.value = p),
|
|
966
969
|
class: "te-checkbox",
|
|
967
|
-
onChange:
|
|
968
|
-
}, null, 40,
|
|
969
|
-
[Nl,
|
|
970
|
+
onChange: Cl
|
|
971
|
+
}, null, 40, sn), [
|
|
972
|
+
[Nl, R.value]
|
|
970
973
|
]),
|
|
971
|
-
|
|
974
|
+
te(" " + E(l.headerName), 1)
|
|
972
975
|
]))), 128))
|
|
973
|
-
])) :
|
|
974
|
-
],
|
|
975
|
-
|
|
976
|
-
|
|
976
|
+
])) : y("", !0)
|
|
977
|
+
], 8, ln)),
|
|
978
|
+
h("div", {
|
|
979
|
+
class: "te-search",
|
|
980
|
+
"data-help": ((m = o.config) == null ? void 0 : m.searchHelpKey) || void 0
|
|
981
|
+
}, [
|
|
982
|
+
h("span", {
|
|
977
983
|
class: "te-search-icon",
|
|
978
|
-
innerHTML:
|
|
979
|
-
}, null, 8,
|
|
980
|
-
|
|
984
|
+
innerHTML: z(j)("search")
|
|
985
|
+
}, null, 8, rn),
|
|
986
|
+
pe(h("input", {
|
|
981
987
|
type: "text",
|
|
982
988
|
class: "te-search-input",
|
|
983
|
-
"onUpdate:modelValue": t[2] || (t[2] = (l) =>
|
|
984
|
-
onInput:
|
|
989
|
+
"onUpdate:modelValue": t[2] || (t[2] = (l) => Re.value = l),
|
|
990
|
+
onInput: _l,
|
|
985
991
|
placeholder: "Buscar..."
|
|
986
992
|
}, null, 544), [
|
|
987
|
-
[
|
|
993
|
+
[wt, Re.value]
|
|
988
994
|
])
|
|
989
|
-
])
|
|
995
|
+
], 8, on)
|
|
990
996
|
]))
|
|
991
|
-
])) :
|
|
992
|
-
|
|
997
|
+
])) : y("", !0),
|
|
998
|
+
h("div", {
|
|
993
999
|
class: "te-scroll-wrap",
|
|
994
|
-
style:
|
|
1000
|
+
style: he(Pe.value ? { height: Pe.value, minHeight: Pe.value } : {}),
|
|
995
1001
|
ref_key: "scrollWrapRef",
|
|
996
|
-
ref:
|
|
1002
|
+
ref: st
|
|
997
1003
|
}, [
|
|
998
|
-
|
|
999
|
-
|
|
1004
|
+
Me.value ? (r(), u("div", un, [...t[18] || (t[18] = [
|
|
1005
|
+
h("div", {
|
|
1000
1006
|
class: "te-loading-spinner",
|
|
1001
1007
|
role: "status"
|
|
1002
1008
|
}, [
|
|
1003
|
-
|
|
1009
|
+
h("span", { class: "te-sr-only" }, "Cargando...")
|
|
1004
1010
|
], -1)
|
|
1005
|
-
])])) :
|
|
1006
|
-
|
|
1007
|
-
(
|
|
1008
|
-
key:
|
|
1009
|
-
class:
|
|
1010
|
-
"te-tr-selected":
|
|
1011
|
-
"te-tr-highlight":
|
|
1011
|
+
])])) : y("", !0),
|
|
1012
|
+
yl.value ? (r(), u("div", cn, [
|
|
1013
|
+
(r(!0), u(T, null, D(oe.value, (l, p) => (r(), u("div", {
|
|
1014
|
+
key: el(l, p),
|
|
1015
|
+
class: N(["te-mobile-card", l.__css_class, {
|
|
1016
|
+
"te-tr-selected": Ee(l),
|
|
1017
|
+
"te-tr-highlight": x.value === l
|
|
1012
1018
|
}]),
|
|
1013
|
-
style:
|
|
1014
|
-
onClick: (
|
|
1015
|
-
onDblclick: (
|
|
1019
|
+
style: he(l.__style),
|
|
1020
|
+
onClick: (d) => Wt(l),
|
|
1021
|
+
onDblclick: (d) => Gt(l)
|
|
1016
1022
|
}, [
|
|
1017
|
-
|
|
1018
|
-
|
|
1023
|
+
h("div", fn, [
|
|
1024
|
+
L.value !== null ? (r(), u("div", {
|
|
1019
1025
|
key: 0,
|
|
1020
1026
|
class: "te-mobile-card-sel",
|
|
1021
|
-
onClick: t[3] || (t[3] =
|
|
1027
|
+
onClick: t[3] || (t[3] = S(() => {
|
|
1022
1028
|
}, ["stop"]))
|
|
1023
1029
|
}, [
|
|
1024
|
-
|
|
1030
|
+
L.value === "multiple" ? (r(), u("input", {
|
|
1025
1031
|
key: 0,
|
|
1026
1032
|
type: "checkbox",
|
|
1027
|
-
checked:
|
|
1028
|
-
onChange: (
|
|
1033
|
+
checked: Ee(l),
|
|
1034
|
+
onChange: (d) => gt(l),
|
|
1029
1035
|
class: "te-checkbox"
|
|
1030
|
-
}, null, 40,
|
|
1036
|
+
}, null, 40, vn)) : (r(), u("input", {
|
|
1031
1037
|
key: 1,
|
|
1032
1038
|
type: "radio",
|
|
1033
|
-
checked:
|
|
1034
|
-
onClick: (
|
|
1039
|
+
checked: x.value === l,
|
|
1040
|
+
onClick: (d) => ht(l),
|
|
1035
1041
|
class: "te-checkbox"
|
|
1036
|
-
}, null, 8,
|
|
1037
|
-
])) :
|
|
1038
|
-
Ot.value ? (
|
|
1042
|
+
}, null, 8, pn))
|
|
1043
|
+
])) : y("", !0),
|
|
1044
|
+
Ot.value ? (r(), u("span", {
|
|
1039
1045
|
key: 1,
|
|
1040
1046
|
class: "te-mobile-card-title",
|
|
1041
|
-
innerHTML:
|
|
1042
|
-
}, null, 8,
|
|
1047
|
+
innerHTML: pt(l, Ot.value)
|
|
1048
|
+
}, null, 8, hn)) : y("", !0)
|
|
1043
1049
|
]),
|
|
1044
|
-
Nt.value.length ? (
|
|
1045
|
-
(
|
|
1046
|
-
key:
|
|
1050
|
+
Nt.value.length ? (r(), u("dl", gn, [
|
|
1051
|
+
(r(!0), u(T, null, D(Nt.value, (d) => (r(), u(T, {
|
|
1052
|
+
key: d.field
|
|
1047
1053
|
}, [
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
innerHTML:
|
|
1051
|
-
}, null, 8,
|
|
1054
|
+
h("dt", null, E(d.headerName), 1),
|
|
1055
|
+
h("dd", {
|
|
1056
|
+
innerHTML: pt(l, d)
|
|
1057
|
+
}, null, 8, yn)
|
|
1052
1058
|
], 64))), 128))
|
|
1053
|
-
])) :
|
|
1054
|
-
|
|
1059
|
+
])) : y("", !0),
|
|
1060
|
+
B.value.length && (!U.value || vl.value) ? (r(), u("div", {
|
|
1055
1061
|
key: 1,
|
|
1056
1062
|
class: "te-mobile-card-actions",
|
|
1057
|
-
onClick: t[4] || (t[4] =
|
|
1063
|
+
onClick: t[4] || (t[4] = S(() => {
|
|
1058
1064
|
}, ["stop"]))
|
|
1059
1065
|
}, [
|
|
1060
|
-
(
|
|
1061
|
-
key:
|
|
1066
|
+
(r(!0), u(T, null, D(B.value, (d) => (r(), u(T, {
|
|
1067
|
+
key: d.key
|
|
1062
1068
|
}, [
|
|
1063
|
-
|
|
1069
|
+
d.isVisible() ? (r(), u("button", {
|
|
1064
1070
|
key: 0,
|
|
1065
|
-
class:
|
|
1066
|
-
disabled:
|
|
1067
|
-
onClick:
|
|
1068
|
-
title:
|
|
1071
|
+
class: N(["te-btn", Xe(d.severity), d.class]),
|
|
1072
|
+
disabled: d.isDisabled(),
|
|
1073
|
+
onClick: S((C) => d.onClick(l), ["stop"]),
|
|
1074
|
+
title: d.getLabel(),
|
|
1075
|
+
"data-help": d.helpKey || void 0
|
|
1069
1076
|
}, [
|
|
1070
|
-
|
|
1077
|
+
d.icon ? (r(), u("span", {
|
|
1071
1078
|
key: 0,
|
|
1072
1079
|
class: "te-btn-icon",
|
|
1073
|
-
innerHTML:
|
|
1074
|
-
}, null, 8,
|
|
1075
|
-
|
|
1076
|
-
], 10,
|
|
1080
|
+
innerHTML: z(j)(d.icon)
|
|
1081
|
+
}, null, 8, kn)) : y("", !0),
|
|
1082
|
+
te(" " + E(d.getLabel()), 1)
|
|
1083
|
+
], 10, mn)) : y("", !0)
|
|
1077
1084
|
], 64))), 128))
|
|
1078
|
-
])) :
|
|
1079
|
-
], 46,
|
|
1080
|
-
|
|
1081
|
-
])) : (
|
|
1085
|
+
])) : y("", !0)
|
|
1086
|
+
], 46, dn))), 128)),
|
|
1087
|
+
oe.value.length ? y("", !0) : (r(), u("div", bn, "Sin registros"))
|
|
1088
|
+
])) : (r(), u("table", {
|
|
1082
1089
|
key: 2,
|
|
1083
|
-
class:
|
|
1090
|
+
class: N(["te-table", { "te-striped": dl.value }])
|
|
1084
1091
|
}, [
|
|
1085
|
-
|
|
1086
|
-
|
|
1092
|
+
h("colgroup", null, [
|
|
1093
|
+
L.value !== null ? (r(), u("col", {
|
|
1087
1094
|
key: 0,
|
|
1088
|
-
style:
|
|
1089
|
-
}, null, 4)) :
|
|
1090
|
-
|
|
1095
|
+
style: he({ width: fl.value })
|
|
1096
|
+
}, null, 4)) : y("", !0),
|
|
1097
|
+
B.value.length && !U.value ? (r(), u("col", {
|
|
1091
1098
|
key: 1,
|
|
1092
|
-
style:
|
|
1093
|
-
}, null, 4)) :
|
|
1094
|
-
(
|
|
1099
|
+
style: he({ width: Vt.value })
|
|
1100
|
+
}, null, 4)) : y("", !0),
|
|
1101
|
+
(r(!0), u(T, null, D(O.value, (l) => (r(), u("col", {
|
|
1095
1102
|
key: l.field,
|
|
1096
|
-
style:
|
|
1103
|
+
style: he({ width: Se.value[l.field] || "15rem" }),
|
|
1097
1104
|
"data-field": l.field
|
|
1098
|
-
}, null, 12,
|
|
1099
|
-
t[19] || (t[19] =
|
|
1105
|
+
}, null, 12, _n))), 128)),
|
|
1106
|
+
t[19] || (t[19] = h("col", { class: "te-col-filler" }, null, -1))
|
|
1100
1107
|
]),
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1108
|
+
h("thead", null, [
|
|
1109
|
+
je.value ? (r(), u("tr", Cn, [
|
|
1110
|
+
L.value !== null ? (r(), u("th", Sn, [
|
|
1111
|
+
L.value === "multiple" ? (r(), u("input", {
|
|
1105
1112
|
key: 0,
|
|
1106
1113
|
type: "checkbox",
|
|
1107
|
-
checked:
|
|
1108
|
-
onChange:
|
|
1114
|
+
checked: ft.value,
|
|
1115
|
+
onChange: Kt,
|
|
1109
1116
|
class: "te-checkbox"
|
|
1110
|
-
}, null, 40,
|
|
1111
|
-
])) :
|
|
1112
|
-
|
|
1113
|
-
(
|
|
1117
|
+
}, null, 40, Mn)) : y("", !0)
|
|
1118
|
+
])) : y("", !0),
|
|
1119
|
+
B.value.length && !U.value ? (r(), u("th", Tn, "Acciones")) : y("", !0),
|
|
1120
|
+
(r(!0), u(T, null, D(It.value, (l) => (r(), u(T, {
|
|
1114
1121
|
key: l._key
|
|
1115
1122
|
}, [
|
|
1116
|
-
l._type === "group" ? (
|
|
1123
|
+
l._type === "group" ? (r(), u("th", {
|
|
1117
1124
|
key: 0,
|
|
1118
1125
|
colspan: l._span,
|
|
1119
1126
|
class: "te-th te-th-group"
|
|
1120
1127
|
}, [
|
|
1121
|
-
|
|
1122
|
-
|
|
1128
|
+
h("div", wn, [
|
|
1129
|
+
h("span", xn, E(l.headerName), 1)
|
|
1123
1130
|
])
|
|
1124
|
-
], 8,
|
|
1131
|
+
], 8, Ln)) : (r(), u("th", {
|
|
1125
1132
|
key: 1,
|
|
1126
1133
|
rowspan: 2,
|
|
1127
1134
|
"data-field": l._col.field,
|
|
1128
|
-
|
|
1135
|
+
"data-help": l._col.helpKey || void 0,
|
|
1136
|
+
class: N(["te-th", l._col.css, { "te-th-sorted": K.value === l._col.field }])
|
|
1129
1137
|
}, [
|
|
1130
|
-
|
|
1131
|
-
|
|
1138
|
+
h("div", En, [
|
|
1139
|
+
h("span", {
|
|
1132
1140
|
class: "te-th-label",
|
|
1133
|
-
onClick: (
|
|
1141
|
+
onClick: (p) => mt(l._col.field)
|
|
1134
1142
|
}, [
|
|
1135
|
-
|
|
1136
|
-
l._col.sortable !== !1 ? (
|
|
1137
|
-
|
|
1138
|
-
innerHTML:
|
|
1139
|
-
}, null, 8,
|
|
1140
|
-
])) :
|
|
1141
|
-
], 8,
|
|
1143
|
+
te(E(l._col.headerName) + " ", 1),
|
|
1144
|
+
l._col.sortable !== !1 ? (r(), u("span", An, [
|
|
1145
|
+
h("span", {
|
|
1146
|
+
innerHTML: z(j)(yt(l._col.field))
|
|
1147
|
+
}, null, 8, Rn)
|
|
1148
|
+
])) : y("", !0)
|
|
1149
|
+
], 8, Fn)
|
|
1142
1150
|
]),
|
|
1143
|
-
|
|
1151
|
+
h("div", {
|
|
1144
1152
|
class: "te-resize-handle",
|
|
1145
|
-
onPointerdown:
|
|
1146
|
-
onDblclick:
|
|
1147
|
-
onClick: t[5] || (t[5] =
|
|
1153
|
+
onPointerdown: S((p) => ke(p, l._col.field), ["stop"]),
|
|
1154
|
+
onDblclick: S((p) => Fe(p, l._col.field), ["stop"]),
|
|
1155
|
+
onClick: t[5] || (t[5] = S(() => {
|
|
1148
1156
|
}, ["stop"]))
|
|
1149
|
-
}, null, 40,
|
|
1150
|
-
], 10,
|
|
1157
|
+
}, null, 40, Pn)
|
|
1158
|
+
], 10, Dn))
|
|
1151
1159
|
], 64))), 128)),
|
|
1152
|
-
t[20] || (t[20] =
|
|
1160
|
+
t[20] || (t[20] = h("th", {
|
|
1153
1161
|
class: "te-th te-th-filler",
|
|
1154
1162
|
rowspan: 2
|
|
1155
1163
|
}, null, -1))
|
|
1156
|
-
])) :
|
|
1157
|
-
|
|
1158
|
-
(
|
|
1164
|
+
])) : y("", !0),
|
|
1165
|
+
je.value ? (r(), u("tr", Vn, [
|
|
1166
|
+
(r(!0), u(T, null, D(It.value, (l) => (r(), u(T, {
|
|
1159
1167
|
key: "r2-" + l._key
|
|
1160
1168
|
}, [
|
|
1161
|
-
l._type === "group" ? (
|
|
1162
|
-
key:
|
|
1163
|
-
"data-field":
|
|
1164
|
-
|
|
1169
|
+
l._type === "group" ? (r(!0), u(T, { key: 0 }, D(l._cols, (p) => (r(), u("th", {
|
|
1170
|
+
key: p.field,
|
|
1171
|
+
"data-field": p.field,
|
|
1172
|
+
"data-help": p.helpKey || void 0,
|
|
1173
|
+
class: N(["te-th", p.css, { "te-th-sorted": K.value === p.field }])
|
|
1165
1174
|
}, [
|
|
1166
|
-
|
|
1167
|
-
|
|
1175
|
+
h("div", On, [
|
|
1176
|
+
h("span", {
|
|
1168
1177
|
class: "te-th-label",
|
|
1169
|
-
onClick: (
|
|
1178
|
+
onClick: (d) => mt(p.field)
|
|
1170
1179
|
}, [
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
innerHTML:
|
|
1175
|
-
}, null, 8,
|
|
1176
|
-
])) :
|
|
1177
|
-
], 8,
|
|
1180
|
+
te(E(p.headerName) + " ", 1),
|
|
1181
|
+
p.sortable !== !1 ? (r(), u("span", zn, [
|
|
1182
|
+
h("span", {
|
|
1183
|
+
innerHTML: z(j)(yt(p.field))
|
|
1184
|
+
}, null, 8, $n)
|
|
1185
|
+
])) : y("", !0)
|
|
1186
|
+
], 8, Nn)
|
|
1178
1187
|
]),
|
|
1179
|
-
|
|
1188
|
+
h("div", {
|
|
1180
1189
|
class: "te-resize-handle",
|
|
1181
|
-
onPointerdown:
|
|
1182
|
-
onDblclick:
|
|
1183
|
-
onClick: t[6] || (t[6] =
|
|
1190
|
+
onPointerdown: S((d) => ke(d, p.field), ["stop"]),
|
|
1191
|
+
onDblclick: S((d) => Fe(d, p.field), ["stop"]),
|
|
1192
|
+
onClick: t[6] || (t[6] = S(() => {
|
|
1184
1193
|
}, ["stop"]))
|
|
1185
|
-
}, null, 40,
|
|
1186
|
-
], 10,
|
|
1194
|
+
}, null, 40, In)
|
|
1195
|
+
], 10, Hn))), 128)) : y("", !0)
|
|
1187
1196
|
], 64))), 128))
|
|
1188
|
-
])) :
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1197
|
+
])) : y("", !0),
|
|
1198
|
+
je.value ? y("", !0) : (r(), u("tr", Bn, [
|
|
1199
|
+
L.value !== null ? (r(), u("th", jn, [
|
|
1200
|
+
L.value === "multiple" ? (r(), u("input", {
|
|
1192
1201
|
key: 0,
|
|
1193
1202
|
type: "checkbox",
|
|
1194
|
-
checked:
|
|
1195
|
-
onChange:
|
|
1203
|
+
checked: ft.value,
|
|
1204
|
+
onChange: Kt,
|
|
1196
1205
|
class: "te-checkbox"
|
|
1197
|
-
}, null, 40,
|
|
1198
|
-
])) :
|
|
1199
|
-
|
|
1200
|
-
(
|
|
1206
|
+
}, null, 40, Kn)) : y("", !0)
|
|
1207
|
+
])) : y("", !0),
|
|
1208
|
+
B.value.length && !U.value ? (r(), u("th", Wn, "Acciones")) : y("", !0),
|
|
1209
|
+
(r(!0), u(T, null, D(O.value, (l) => (r(), u("th", {
|
|
1201
1210
|
key: l.field,
|
|
1202
1211
|
"data-field": l.field,
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
"te-th-dragover-
|
|
1206
|
-
"te-th-
|
|
1207
|
-
"te-th-
|
|
1212
|
+
"data-help": l.helpKey || void 0,
|
|
1213
|
+
class: N(["te-th", l.css, {
|
|
1214
|
+
"te-th-dragover-left": Z.value === l.field && W.value === "left",
|
|
1215
|
+
"te-th-dragover-right": Z.value === l.field && W.value === "right",
|
|
1216
|
+
"te-th-dragging": H.value === l.field,
|
|
1217
|
+
"te-th-sorted": K.value === l.field
|
|
1208
1218
|
}]),
|
|
1209
|
-
draggable:
|
|
1210
|
-
onDragstart: (
|
|
1211
|
-
onDragenter:
|
|
1212
|
-
onDragover:
|
|
1213
|
-
onDragleave: (
|
|
1214
|
-
onDrop:
|
|
1215
|
-
onDragend:
|
|
1219
|
+
draggable: Pt.value,
|
|
1220
|
+
onDragstart: (p) => Ml(p, l.field),
|
|
1221
|
+
onDragenter: S((p) => Tl(p, l.field), ["prevent"]),
|
|
1222
|
+
onDragover: S((p) => Ll(p, l.field), ["prevent"]),
|
|
1223
|
+
onDragleave: (p) => wl(p, l.field),
|
|
1224
|
+
onDrop: S((p) => xl(p, l.field), ["prevent"]),
|
|
1225
|
+
onDragend: Je
|
|
1216
1226
|
}, [
|
|
1217
|
-
|
|
1218
|
-
|
|
1227
|
+
h("div", qn, [
|
|
1228
|
+
Pt.value ? (r(), u("span", {
|
|
1219
1229
|
key: 0,
|
|
1220
1230
|
class: "te-th-grip",
|
|
1221
|
-
innerHTML:
|
|
1222
|
-
}, null, 8,
|
|
1223
|
-
|
|
1231
|
+
innerHTML: z(j)("grip")
|
|
1232
|
+
}, null, 8, Jn)) : y("", !0),
|
|
1233
|
+
h("span", {
|
|
1224
1234
|
class: "te-th-label",
|
|
1225
|
-
onClick: (
|
|
1235
|
+
onClick: (p) => mt(l.field)
|
|
1226
1236
|
}, [
|
|
1227
|
-
|
|
1228
|
-
l.sortable !== !1 ? (
|
|
1229
|
-
|
|
1230
|
-
innerHTML:
|
|
1231
|
-
}, null, 8,
|
|
1232
|
-
])) :
|
|
1233
|
-
], 8,
|
|
1237
|
+
te(E(l.headerName) + " ", 1),
|
|
1238
|
+
l.sortable !== !1 ? (r(), u("span", Xn, [
|
|
1239
|
+
h("span", {
|
|
1240
|
+
innerHTML: z(j)(yt(l.field))
|
|
1241
|
+
}, null, 8, Yn)
|
|
1242
|
+
])) : y("", !0)
|
|
1243
|
+
], 8, Un)
|
|
1234
1244
|
]),
|
|
1235
|
-
|
|
1236
|
-
class:
|
|
1245
|
+
h("div", {
|
|
1246
|
+
class: N(["te-resize-handle", { "te-resizing-active": G.value === l.field }]),
|
|
1237
1247
|
draggable: "false",
|
|
1238
|
-
onPointerdown:
|
|
1239
|
-
onDblclick:
|
|
1240
|
-
onClick: t[7] || (t[7] =
|
|
1248
|
+
onPointerdown: S((p) => ke(p, l.field), ["stop"]),
|
|
1249
|
+
onDblclick: S((p) => Fe(p, l.field), ["stop"]),
|
|
1250
|
+
onClick: t[7] || (t[7] = S(() => {
|
|
1241
1251
|
}, ["stop"]))
|
|
1242
|
-
}, null, 42,
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
], 42,
|
|
1246
|
-
t[21] || (t[21] =
|
|
1252
|
+
}, null, 42, Qn),
|
|
1253
|
+
Z.value === l.field && W.value === "left" ? (r(), u("div", Zn)) : y("", !0),
|
|
1254
|
+
Z.value === l.field && W.value === "right" ? (r(), u("div", ei)) : y("", !0)
|
|
1255
|
+
], 42, Gn))), 128)),
|
|
1256
|
+
t[21] || (t[21] = h("th", { class: "te-th te-th-filler" }, null, -1))
|
|
1247
1257
|
])),
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
(
|
|
1252
|
-
var
|
|
1253
|
-
return
|
|
1258
|
+
Rt.value ? (r(), u("tr", ti, [
|
|
1259
|
+
L.value !== null ? (r(), u("td", li)) : y("", !0),
|
|
1260
|
+
B.value.length && !U.value ? (r(), u("td", ni)) : y("", !0),
|
|
1261
|
+
(r(!0), u(T, null, D(O.value, (l) => {
|
|
1262
|
+
var p, d;
|
|
1263
|
+
return r(), u("td", {
|
|
1254
1264
|
key: "f-" + l.field,
|
|
1255
1265
|
class: "te-td"
|
|
1256
1266
|
}, [
|
|
1257
|
-
((
|
|
1267
|
+
((p = l.filter) == null ? void 0 : p.type) === "select" ? pe((r(), u("select", {
|
|
1258
1268
|
key: 0,
|
|
1259
|
-
"onUpdate:modelValue": (
|
|
1269
|
+
"onUpdate:modelValue": (C) => Y.value[l.field] = C,
|
|
1260
1270
|
onChange: qt,
|
|
1261
1271
|
class: "te-filter-input te-filter-select"
|
|
1262
1272
|
}, [
|
|
1263
|
-
t[22] || (t[22] =
|
|
1264
|
-
(
|
|
1265
|
-
key:
|
|
1266
|
-
value:
|
|
1267
|
-
},
|
|
1268
|
-
], 40,
|
|
1269
|
-
[
|
|
1270
|
-
]) : ((
|
|
1273
|
+
t[22] || (t[22] = h("option", { value: "" }, "Todos", -1)),
|
|
1274
|
+
(r(!0), u(T, null, D(l.filter.options, (C) => (r(), u("option", {
|
|
1275
|
+
key: C.value,
|
|
1276
|
+
value: C.value
|
|
1277
|
+
}, E(C.label), 9, ai))), 128))
|
|
1278
|
+
], 40, ii)), [
|
|
1279
|
+
[ll, Y.value[l.field]]
|
|
1280
|
+
]) : ((d = l.filter) == null ? void 0 : d.type) === "text" || !pl.value ? pe((r(), u("input", {
|
|
1271
1281
|
key: 1,
|
|
1272
|
-
"onUpdate:modelValue": (
|
|
1282
|
+
"onUpdate:modelValue": (C) => Y.value[l.field] = C,
|
|
1273
1283
|
onInput: qt,
|
|
1274
1284
|
type: "text",
|
|
1275
1285
|
class: "te-filter-input",
|
|
1276
1286
|
placeholder: ""
|
|
1277
|
-
}, null, 40,
|
|
1278
|
-
[
|
|
1279
|
-
]) :
|
|
1280
|
-
|
|
1287
|
+
}, null, 40, si)), [
|
|
1288
|
+
[wt, Y.value[l.field]]
|
|
1289
|
+
]) : y("", !0),
|
|
1290
|
+
h("div", {
|
|
1281
1291
|
class: "te-resize-handle",
|
|
1282
1292
|
draggable: "false",
|
|
1283
|
-
onPointerdown:
|
|
1284
|
-
onDblclick:
|
|
1285
|
-
onClick: t[8] || (t[8] =
|
|
1293
|
+
onPointerdown: S((C) => ke(C, l.field), ["stop"]),
|
|
1294
|
+
onDblclick: S((C) => Fe(C, l.field), ["stop"]),
|
|
1295
|
+
onClick: t[8] || (t[8] = S(() => {
|
|
1286
1296
|
}, ["stop"]))
|
|
1287
|
-
}, null, 40,
|
|
1297
|
+
}, null, 40, oi)
|
|
1288
1298
|
]);
|
|
1289
1299
|
}), 128)),
|
|
1290
|
-
t[23] || (t[23] =
|
|
1291
|
-
])) :
|
|
1300
|
+
t[23] || (t[23] = h("td", { class: "te-td te-td-filler" }, null, -1))
|
|
1301
|
+
])) : y("", !0)
|
|
1292
1302
|
]),
|
|
1293
|
-
|
|
1294
|
-
(
|
|
1295
|
-
key:
|
|
1296
|
-
class:
|
|
1297
|
-
"te-tr-selected":
|
|
1298
|
-
"te-tr-highlight":
|
|
1303
|
+
h("tbody", null, [
|
|
1304
|
+
(r(!0), u(T, null, D(oe.value, (l, p) => (r(), u("tr", {
|
|
1305
|
+
key: el(l, p),
|
|
1306
|
+
class: N(["te-tr", l.__css_class, {
|
|
1307
|
+
"te-tr-selected": Ee(l),
|
|
1308
|
+
"te-tr-highlight": x.value === l
|
|
1299
1309
|
}]),
|
|
1300
|
-
style:
|
|
1301
|
-
onClick: (
|
|
1302
|
-
onDblclick: (
|
|
1310
|
+
style: he(l.__style),
|
|
1311
|
+
onClick: (d) => Wt(l),
|
|
1312
|
+
onDblclick: (d) => Gt(l)
|
|
1303
1313
|
}, [
|
|
1304
|
-
|
|
1314
|
+
L.value !== null ? (r(), u("td", {
|
|
1305
1315
|
key: 0,
|
|
1306
1316
|
class: "te-td te-td-sel",
|
|
1307
|
-
onClick: t[9] || (t[9] =
|
|
1317
|
+
onClick: t[9] || (t[9] = S(() => {
|
|
1308
1318
|
}, ["stop"]))
|
|
1309
1319
|
}, [
|
|
1310
|
-
|
|
1320
|
+
L.value === "multiple" ? (r(), u("input", {
|
|
1311
1321
|
key: 0,
|
|
1312
1322
|
type: "checkbox",
|
|
1313
|
-
checked:
|
|
1314
|
-
onChange: (
|
|
1323
|
+
checked: Ee(l),
|
|
1324
|
+
onChange: (d) => gt(l),
|
|
1315
1325
|
class: "te-checkbox"
|
|
1316
|
-
}, null, 40,
|
|
1326
|
+
}, null, 40, ui)) : (r(), u("input", {
|
|
1317
1327
|
key: 1,
|
|
1318
1328
|
type: "radio",
|
|
1319
|
-
checked:
|
|
1320
|
-
onClick: (
|
|
1329
|
+
checked: x.value === l,
|
|
1330
|
+
onClick: (d) => ht(l),
|
|
1321
1331
|
class: "te-checkbox"
|
|
1322
|
-
}, null, 8,
|
|
1323
|
-
])) :
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
(
|
|
1327
|
-
key:
|
|
1332
|
+
}, null, 8, ci))
|
|
1333
|
+
])) : y("", !0),
|
|
1334
|
+
B.value.length && !U.value ? (r(), u("td", di, [
|
|
1335
|
+
h("div", fi, [
|
|
1336
|
+
(r(!0), u(T, null, D(B.value, (d) => (r(), u(T, {
|
|
1337
|
+
key: d.key
|
|
1328
1338
|
}, [
|
|
1329
|
-
|
|
1339
|
+
d.isVisible() ? (r(), u("button", {
|
|
1330
1340
|
key: 0,
|
|
1331
|
-
class:
|
|
1332
|
-
disabled:
|
|
1333
|
-
onClick:
|
|
1334
|
-
title:
|
|
1341
|
+
class: N(["te-btn", Xe(d.severity), d.class]),
|
|
1342
|
+
disabled: d.isDisabled(),
|
|
1343
|
+
onClick: S((C) => d.onClick(l), ["stop"]),
|
|
1344
|
+
title: d.getLabel(),
|
|
1345
|
+
"data-help": d.helpKey || void 0
|
|
1335
1346
|
}, [
|
|
1336
|
-
|
|
1347
|
+
d.icon ? (r(), u("span", {
|
|
1337
1348
|
key: 0,
|
|
1338
1349
|
class: "te-btn-icon",
|
|
1339
|
-
innerHTML:
|
|
1340
|
-
}, null, 8,
|
|
1341
|
-
|
|
1342
|
-
], 10,
|
|
1350
|
+
innerHTML: z(j)(d.icon)
|
|
1351
|
+
}, null, 8, pi)) : y("", !0),
|
|
1352
|
+
te(" " + E(d.getLabel()), 1)
|
|
1353
|
+
], 10, vi)) : y("", !0)
|
|
1343
1354
|
], 64))), 128))
|
|
1344
1355
|
])
|
|
1345
|
-
])) :
|
|
1346
|
-
(
|
|
1347
|
-
key:
|
|
1348
|
-
class:
|
|
1349
|
-
"te-td-inline-edit": !!
|
|
1356
|
+
])) : y("", !0),
|
|
1357
|
+
(r(!0), u(T, null, D(O.value, (d) => (r(), u("td", {
|
|
1358
|
+
key: d.field,
|
|
1359
|
+
class: N(["te-td", d.css, {
|
|
1360
|
+
"te-td-inline-edit": !!Ue(d)
|
|
1350
1361
|
}]),
|
|
1351
|
-
style:
|
|
1362
|
+
style: he(z(Gl)(l, d))
|
|
1352
1363
|
}, [
|
|
1353
|
-
|
|
1364
|
+
Dl(l, d) ? pe((r(), u("input", {
|
|
1354
1365
|
key: 0,
|
|
1355
|
-
"onUpdate:modelValue": t[10] || (t[10] = (
|
|
1366
|
+
"onUpdate:modelValue": t[10] || (t[10] = (C) => fe.value = C),
|
|
1356
1367
|
type: "text",
|
|
1357
1368
|
class: "te-editing-input",
|
|
1358
|
-
onBlur: (
|
|
1369
|
+
onBlur: (C) => Ut(l, d),
|
|
1359
1370
|
onKeydown: [
|
|
1360
|
-
|
|
1361
|
-
|
|
1371
|
+
nl((C) => Ut(l, d), ["enter"]),
|
|
1372
|
+
nl(Ae, ["escape"])
|
|
1362
1373
|
],
|
|
1363
1374
|
ref_for: !0,
|
|
1364
1375
|
ref_key: "inlineEditRef",
|
|
1365
|
-
ref:
|
|
1366
|
-
}, null, 40,
|
|
1367
|
-
[
|
|
1368
|
-
]) : (
|
|
1369
|
-
|
|
1370
|
-
onDblclick: (
|
|
1371
|
-
innerHTML:
|
|
1372
|
-
}, null, 40,
|
|
1373
|
-
|
|
1376
|
+
ref: ze
|
|
1377
|
+
}, null, 40, hi)), [
|
|
1378
|
+
[wt, fe.value]
|
|
1379
|
+
]) : (r(), u("div", gi, [
|
|
1380
|
+
h("span", {
|
|
1381
|
+
onDblclick: (C) => Jt(C, l, d),
|
|
1382
|
+
innerHTML: pt(l, d)
|
|
1383
|
+
}, null, 40, yi),
|
|
1384
|
+
Ue(d) ? (r(), u("button", {
|
|
1374
1385
|
key: 0,
|
|
1375
1386
|
class: "te-inline-edit-btn",
|
|
1376
|
-
onClick:
|
|
1387
|
+
onClick: S((C) => Jt(C, l, d), ["stop"]),
|
|
1377
1388
|
title: "Editar inline"
|
|
1378
1389
|
}, [
|
|
1379
|
-
|
|
1390
|
+
h("span", {
|
|
1380
1391
|
class: "te-btn-icon",
|
|
1381
|
-
innerHTML:
|
|
1382
|
-
}, null, 8,
|
|
1383
|
-
], 8,
|
|
1392
|
+
innerHTML: z(j)("pencil")
|
|
1393
|
+
}, null, 8, ki)
|
|
1394
|
+
], 8, mi)) : y("", !0)
|
|
1384
1395
|
])),
|
|
1385
|
-
|
|
1396
|
+
h("div", {
|
|
1386
1397
|
class: "te-resize-handle",
|
|
1387
1398
|
draggable: "false",
|
|
1388
|
-
onPointerdown:
|
|
1389
|
-
onDblclick:
|
|
1390
|
-
onClick: t[11] || (t[11] =
|
|
1399
|
+
onPointerdown: S((C) => ke(C, d.field), ["stop"]),
|
|
1400
|
+
onDblclick: S((C) => Fe(C, d.field), ["stop"]),
|
|
1401
|
+
onClick: t[11] || (t[11] = S(() => {
|
|
1391
1402
|
}, ["stop"]))
|
|
1392
|
-
}, null, 40,
|
|
1403
|
+
}, null, 40, bi)
|
|
1393
1404
|
], 6))), 128)),
|
|
1394
|
-
t[24] || (t[24] =
|
|
1395
|
-
], 46,
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
colspan:
|
|
1405
|
+
t[24] || (t[24] = h("td", { class: "te-td te-td-filler" }, null, -1))
|
|
1406
|
+
], 46, ri))), 128)),
|
|
1407
|
+
oe.value.length ? y("", !0) : (r(), u("tr", _i, [
|
|
1408
|
+
h("td", {
|
|
1409
|
+
colspan: gl.value,
|
|
1399
1410
|
class: "te-td te-empty"
|
|
1400
|
-
}, "Sin registros", 8,
|
|
1411
|
+
}, "Sin registros", 8, Ci)
|
|
1401
1412
|
]))
|
|
1402
1413
|
])
|
|
1403
1414
|
], 2)),
|
|
1404
|
-
|
|
1415
|
+
Q.value ? (r(), u("div", {
|
|
1405
1416
|
key: 3,
|
|
1406
1417
|
ref_key: "sentinelRef",
|
|
1407
|
-
ref:
|
|
1418
|
+
ref: at,
|
|
1408
1419
|
class: "te-sentinel"
|
|
1409
1420
|
}, [
|
|
1410
|
-
|
|
1411
|
-
], 512)) :
|
|
1421
|
+
Ve.value ? (r(), u("span", Si)) : y("", !0)
|
|
1422
|
+
], 512)) : y("", !0)
|
|
1412
1423
|
], 4),
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1424
|
+
pe(h("div", {
|
|
1425
|
+
class: "te-paginator",
|
|
1426
|
+
"data-help": ((M = o.config) == null ? void 0 : M.paginatorHelpKey) || void 0
|
|
1427
|
+
}, [
|
|
1428
|
+
h("span", Ti, "Mostrando " + E(kl.value) + " a " + E(bl.value) + " de " + E(dt.value), 1),
|
|
1429
|
+
h("div", Li, [
|
|
1430
|
+
h("button", {
|
|
1417
1431
|
class: "te-page-btn",
|
|
1418
|
-
disabled:
|
|
1419
|
-
onClick: t[12] || (t[12] = (l) =>
|
|
1420
|
-
}, "««", 8,
|
|
1421
|
-
|
|
1432
|
+
disabled: F.value <= 1,
|
|
1433
|
+
onClick: t[12] || (t[12] = (l) => qe(1))
|
|
1434
|
+
}, "««", 8, wi),
|
|
1435
|
+
h("button", {
|
|
1422
1436
|
class: "te-page-btn",
|
|
1423
|
-
disabled:
|
|
1424
|
-
onClick: t[13] || (t[13] = (l) =>
|
|
1425
|
-
}, "«", 8,
|
|
1426
|
-
|
|
1427
|
-
|
|
1437
|
+
disabled: F.value <= 1,
|
|
1438
|
+
onClick: t[13] || (t[13] = (l) => qe(F.value - 1))
|
|
1439
|
+
}, "«", 8, xi),
|
|
1440
|
+
h("span", Di, E(F.value) + " / " + E(De.value), 1),
|
|
1441
|
+
h("button", {
|
|
1428
1442
|
class: "te-page-btn",
|
|
1429
|
-
disabled:
|
|
1430
|
-
onClick: t[14] || (t[14] = (l) =>
|
|
1431
|
-
}, "»", 8,
|
|
1432
|
-
|
|
1443
|
+
disabled: F.value >= De.value,
|
|
1444
|
+
onClick: t[14] || (t[14] = (l) => qe(F.value + 1))
|
|
1445
|
+
}, "»", 8, Ei),
|
|
1446
|
+
h("button", {
|
|
1433
1447
|
class: "te-page-btn",
|
|
1434
|
-
disabled:
|
|
1435
|
-
onClick: t[15] || (t[15] = (l) =>
|
|
1436
|
-
}, "»»", 8,
|
|
1448
|
+
disabled: F.value >= De.value,
|
|
1449
|
+
onClick: t[15] || (t[15] = (l) => qe(De.value))
|
|
1450
|
+
}, "»»", 8, Fi)
|
|
1437
1451
|
]),
|
|
1438
|
-
|
|
1439
|
-
"onUpdate:modelValue": t[16] || (t[16] = (l) =>
|
|
1452
|
+
pe(h("select", {
|
|
1453
|
+
"onUpdate:modelValue": t[16] || (t[16] = (l) => $.value = l),
|
|
1440
1454
|
class: "te-select",
|
|
1441
|
-
onChange:
|
|
1455
|
+
onChange: Sl
|
|
1442
1456
|
}, [
|
|
1443
|
-
(
|
|
1457
|
+
(r(!0), u(T, null, D(Ft.value, (l) => (r(), u("option", {
|
|
1444
1458
|
key: l,
|
|
1445
1459
|
value: l
|
|
1446
|
-
},
|
|
1460
|
+
}, E(l), 9, Ai))), 128))
|
|
1447
1461
|
], 544), [
|
|
1448
|
-
[
|
|
1462
|
+
[ll, $.value]
|
|
1449
1463
|
])
|
|
1450
|
-
],
|
|
1451
|
-
[
|
|
1464
|
+
], 8, Mi), [
|
|
1465
|
+
[zl, !Q.value && At.value]
|
|
1452
1466
|
])
|
|
1453
1467
|
]);
|
|
1454
1468
|
};
|
|
1455
1469
|
}
|
|
1456
1470
|
};
|
|
1457
|
-
function
|
|
1458
|
-
if (!
|
|
1471
|
+
function al(o) {
|
|
1472
|
+
if (!o || !Array.isArray(o)) return {};
|
|
1459
1473
|
const a = {};
|
|
1460
|
-
for (const v of
|
|
1474
|
+
for (const v of o)
|
|
1461
1475
|
v.isJson && (a[v.field] = v);
|
|
1462
1476
|
return a;
|
|
1463
1477
|
}
|
|
1464
|
-
function
|
|
1465
|
-
if (!
|
|
1478
|
+
function Pi(o, a) {
|
|
1479
|
+
if (!o || !a) return o;
|
|
1466
1480
|
for (const [v] of Object.entries(a)) {
|
|
1467
|
-
const s =
|
|
1481
|
+
const s = o[v];
|
|
1468
1482
|
if (typeof s == "string")
|
|
1469
1483
|
try {
|
|
1470
|
-
|
|
1484
|
+
o[v] = JSON.parse(s);
|
|
1471
1485
|
} catch {
|
|
1472
|
-
|
|
1486
|
+
o[v] = s;
|
|
1473
1487
|
}
|
|
1474
1488
|
}
|
|
1475
|
-
return
|
|
1489
|
+
return o;
|
|
1476
1490
|
}
|
|
1477
|
-
function
|
|
1478
|
-
if (!
|
|
1491
|
+
function Vi(o, a, v) {
|
|
1492
|
+
if (!o || !Array.isArray(o) || !a || !v) return o;
|
|
1479
1493
|
for (const [s] of Object.entries(a)) {
|
|
1480
|
-
const
|
|
1481
|
-
if (
|
|
1482
|
-
for (const [
|
|
1483
|
-
typeof
|
|
1484
|
-
field: `${s}.${
|
|
1485
|
-
headerName:
|
|
1494
|
+
const k = v[s];
|
|
1495
|
+
if (k && typeof k == "object" && !Array.isArray(k))
|
|
1496
|
+
for (const [w, ye] of Object.entries(k))
|
|
1497
|
+
typeof ye == "object" && ye !== null && !Array.isArray(ye) || o.push({
|
|
1498
|
+
field: `${s}.${w}`,
|
|
1499
|
+
headerName: w,
|
|
1486
1500
|
sortable: !1,
|
|
1487
1501
|
filterable: !1
|
|
1488
1502
|
});
|
|
1489
1503
|
}
|
|
1490
|
-
return
|
|
1504
|
+
return o;
|
|
1491
1505
|
}
|
|
1492
|
-
function
|
|
1493
|
-
if (!
|
|
1506
|
+
function ul(o, a) {
|
|
1507
|
+
if (!o || !a) return o;
|
|
1494
1508
|
for (const v of a)
|
|
1495
|
-
v.formatter && typeof v.formatter == "function" && (
|
|
1496
|
-
return
|
|
1509
|
+
v.formatter && typeof v.formatter == "function" && (o[v.field] = v.formatter(o[v.field], o));
|
|
1510
|
+
return o;
|
|
1497
1511
|
}
|
|
1498
|
-
const
|
|
1499
|
-
function
|
|
1500
|
-
return !
|
|
1512
|
+
const Bi = ul;
|
|
1513
|
+
function Hi(o) {
|
|
1514
|
+
return !o || !Array.isArray(o) ? [] : o.map((a) => ({
|
|
1501
1515
|
field: a.field,
|
|
1502
1516
|
headerName: a.headerName || a.field,
|
|
1503
1517
|
sortable: a.sortable !== !1,
|
|
@@ -1508,67 +1522,67 @@ function Pi(u) {
|
|
|
1508
1522
|
editable: a.editable || !1
|
|
1509
1523
|
}));
|
|
1510
1524
|
}
|
|
1511
|
-
function
|
|
1512
|
-
if (!a || !a.length) return
|
|
1525
|
+
function ji(o, a) {
|
|
1526
|
+
if (!a || !a.length) return o;
|
|
1513
1527
|
const v = [];
|
|
1514
1528
|
for (const s of a) {
|
|
1515
|
-
const
|
|
1516
|
-
|
|
1529
|
+
const k = o.find((w) => w.field === s);
|
|
1530
|
+
k && v.push(k);
|
|
1517
1531
|
}
|
|
1518
|
-
for (const s of
|
|
1519
|
-
v.some((
|
|
1532
|
+
for (const s of o)
|
|
1533
|
+
v.some((k) => k.field === s.field) || v.push(s);
|
|
1520
1534
|
return v;
|
|
1521
1535
|
}
|
|
1522
|
-
function
|
|
1523
|
-
return !
|
|
1536
|
+
function Oi(o) {
|
|
1537
|
+
return !o || !Array.isArray(o) ? o : o.map((a) => ({
|
|
1524
1538
|
...a,
|
|
1525
1539
|
headerName: a.headerName || a.field
|
|
1526
1540
|
}));
|
|
1527
1541
|
}
|
|
1528
|
-
function
|
|
1542
|
+
function Ki(o = null) {
|
|
1529
1543
|
return {
|
|
1530
1544
|
processRows(a, v) {
|
|
1531
1545
|
if (!(a != null && a.length)) return a;
|
|
1532
|
-
const s =
|
|
1533
|
-
for (let
|
|
1534
|
-
let
|
|
1535
|
-
|
|
1546
|
+
const s = al(v);
|
|
1547
|
+
for (let k = 0; k < a.length; k++) {
|
|
1548
|
+
let w = Pi(a[k], s);
|
|
1549
|
+
w = ul(w, v), a[k] = ol(w, o);
|
|
1536
1550
|
}
|
|
1537
1551
|
return a;
|
|
1538
1552
|
},
|
|
1539
1553
|
processFields(a, v) {
|
|
1540
1554
|
if (!a || !Array.isArray(a)) return a;
|
|
1541
1555
|
let s = a;
|
|
1542
|
-
return v && (s =
|
|
1556
|
+
return v && (s = Vi([...s], al(s), v)), Oi(s);
|
|
1543
1557
|
},
|
|
1544
1558
|
processColumns(a) {
|
|
1545
|
-
return
|
|
1559
|
+
return Hi(a);
|
|
1546
1560
|
}
|
|
1547
1561
|
};
|
|
1548
1562
|
}
|
|
1549
1563
|
export {
|
|
1550
|
-
|
|
1551
|
-
|
|
1564
|
+
ge as BtnConfig,
|
|
1565
|
+
Ii as TableEditor,
|
|
1552
1566
|
Wl as applyFieldDefCss,
|
|
1553
|
-
|
|
1554
|
-
|
|
1567
|
+
ol as applyRowStyling,
|
|
1568
|
+
$i as availableIcons,
|
|
1555
1569
|
Gl as cellStyle,
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1570
|
+
Il as createLocalStoragePrefsAdapter,
|
|
1571
|
+
Ii as default,
|
|
1572
|
+
Vi as getCamposJSONyFieldDef,
|
|
1573
|
+
al as getCamposJson,
|
|
1574
|
+
Oi as getFieldDefFFormated,
|
|
1575
|
+
Bl as getGlobalPreferencesAdapter,
|
|
1576
|
+
Hi as getProcessFieldDef,
|
|
1577
|
+
Ki as greenbornDataPipeline,
|
|
1578
|
+
j as iconSvg,
|
|
1579
|
+
Kl as invertHexColor,
|
|
1580
|
+
Pi as mapFilaJSONtabla,
|
|
1581
|
+
ji as reOrder,
|
|
1582
|
+
ul as rowFormatter,
|
|
1583
|
+
Bi as row_formatter,
|
|
1584
|
+
zi as setGlobalPreferencesAdapter,
|
|
1585
|
+
il as toBtnConfig,
|
|
1586
|
+
rl as unwrapCell
|
|
1573
1587
|
};
|
|
1574
1588
|
//# sourceMappingURL=vue-table-editor.js.map
|