@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.
@@ -1,5 +1,5 @@
1
- import { computed as k, ref as h, watch as Tt, nextTick as Ye, onMounted as Vl, onUnmounted as Ol, openBlock as o, createElementBlock as r, createElementVNode as p, Fragment as C, renderList as L, normalizeClass as V, unref as O, createCommentVNode as g, createTextVNode as Z, toDisplayString as w, withDirectives as fe, vModelCheckbox as Nl, vModelText as Lt, normalizeStyle as ve, withModifiers as _, vModelSelect as tl, withKeys as ll, vShow as Hl } from "vue";
2
- class pe {
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 nl(u) {
18
- return u instanceof pe ? u : new pe(u);
17
+ function il(o) {
18
+ return o instanceof ge ? o : new ge(o);
19
19
  }
20
- const zl = "te_preferencias";
21
- function $l(u = zl) {
20
+ const $l = "te_preferencias";
21
+ function Il(o = $l) {
22
22
  let a = {};
23
23
  function v() {
24
24
  try {
25
- const m = localStorage.getItem(u);
26
- a = m ? JSON.parse(m) : {};
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(u, JSON.stringify(a));
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(m) {
42
- const M = a[m];
43
- if (!M) return null;
41
+ valor(k) {
42
+ const w = a[k];
43
+ if (!w) return null;
44
44
  try {
45
- return JSON.parse(M);
45
+ return JSON.parse(w);
46
46
  } catch {
47
- return M;
47
+ return w;
48
48
  }
49
49
  },
50
- async guardarValores(m) {
51
- return a = { ...a, ...m }, s(), { status: !0 };
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 Qe = {
58
+ const et = {
59
59
  adapter: null
60
60
  };
61
- function Ni(u) {
62
- Qe.adapter = u;
61
+ function zi(o) {
62
+ et.adapter = o;
63
63
  }
64
- function Il() {
65
- return Qe.adapter || (Qe.adapter = $l()), Qe.adapter;
64
+ function Bl() {
65
+ return et.adapter || (et.adapter = Il()), et.adapter;
66
66
  }
67
- const al = {
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 $(u) {
86
- if (!u) return "";
87
- const a = Bl(u), v = al[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 Bl(u) {
91
- let a = String(u).trim().toLowerCase();
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 Hi = Object.keys(al);
105
- function jl(u) {
106
- return !u || u.length !== 7 ? null : "#" + (255 - parseInt(u.slice(1, 3), 16)).toString(16).padStart(2, "0") + (255 - parseInt(u.slice(3, 5), 16)).toString(16).padStart(2, "0") + (255 - parseInt(u.slice(5, 7), 16)).toString(16).padStart(2, "0");
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(u, a) {
109
- if (!Array.isArray(u)) return u;
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 u;
112
- for (const s of u)
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 u;
114
+ return o;
115
115
  }
116
- function sl(u, a) {
117
- if (!a) return u;
118
- if (u.__css_class = "", typeof a.rowClassFn == "function" && (u.__css_class = a.rowClassFn(u)), typeof a.rowStyleFn == "function" && (u.__style = a.rowStyleFn(u)), u.__field_styles = {}, a.fieldStyleFns)
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
- u[v] != null && (u.__field_styles[v] = a.fieldStyleFns[v](u[v]));
121
- return u;
120
+ o[v] != null && (o.__field_styles[v] = a.fieldStyleFns[v](o[v]));
121
+ return o;
122
122
  }
123
- function ol(u, a) {
123
+ function rl(o, a) {
124
124
  var s;
125
- if (u == null) return { value: null, style: null };
126
- const v = u[a == null ? void 0 : a.field];
127
- return v != null && typeof v == "object" && "__style" in v ? { value: v.value, style: v.__style } : (s = u.__field_styles) != null && s[a == null ? void 0 : a.field] ? { value: v, style: u.__field_styles[a == null ? void 0 : a.field] } : { value: v, style: null };
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(u, a) {
130
- return ol(u, a).style;
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" }, Kl = ["disabled", "onClick", "title"], Xl = ["innerHTML"], Yl = {
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
- }, Ql = ["disabled", "onClick", "title"], Zl = ["innerHTML"], en = {
138
+ }, Zl = ["disabled", "onClick", "title", "data-help"], en = ["innerHTML"], tn = {
139
139
  key: 0,
140
140
  class: "te-toolbar-end"
141
- }, tn = ["innerHTML"], ln = {
141
+ }, ln = ["data-help"], nn = ["innerHTML"], an = {
142
142
  key: 0,
143
143
  class: "te-dropdown-menu",
144
144
  style: { "min-width": "220px" }
145
- }, nn = ["id", "value"], an = { class: "te-search" }, sn = ["innerHTML"], on = {
145
+ }, sn = ["id", "value"], on = ["data-help"], rn = ["innerHTML"], un = {
146
146
  key: 0,
147
147
  class: "te-loading-overlay"
148
- }, rn = {
148
+ }, cn = {
149
149
  key: 1,
150
150
  class: "te-mobile-list"
151
- }, un = ["onClick", "onDblclick"], cn = { class: "te-mobile-card-head" }, dn = ["checked", "onChange"], fn = ["checked", "onClick"], vn = ["innerHTML"], pn = {
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
- }, hn = ["innerHTML"], gn = ["disabled", "onClick", "title"], yn = ["innerHTML"], mn = {
154
+ }, yn = ["innerHTML"], mn = ["disabled", "onClick", "title", "data-help"], kn = ["innerHTML"], bn = {
155
155
  key: 0,
156
156
  class: "te-mobile-empty"
157
- }, kn = ["data-field"], bn = {
157
+ }, _n = ["data-field"], Cn = {
158
158
  key: 0,
159
159
  class: "te-header-group-row"
160
- }, _n = {
160
+ }, Sn = {
161
161
  key: 0,
162
162
  class: "te-th te-th-sel",
163
163
  rowspan: 2
164
- }, Cn = ["checked"], Sn = {
164
+ }, Mn = ["checked"], Tn = {
165
165
  key: 1,
166
166
  class: "te-th te-th-acts",
167
167
  rowspan: 2
168
- }, Mn = ["colspan"], Tn = { class: "te-th-content" }, Ln = { class: "te-th-group-label" }, wn = ["data-field"], xn = { class: "te-th-content" }, Dn = ["onClick"], En = {
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
- }, Fn = ["innerHTML"], An = ["onPointerdown", "onDblclick"], Rn = {
171
+ }, Rn = ["innerHTML"], Pn = ["onPointerdown", "onDblclick"], Vn = {
172
172
  key: 1,
173
173
  class: "te-header-row te-has-groups"
174
- }, Pn = ["data-field"], Vn = { class: "te-th-content" }, On = ["onClick"], Nn = {
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
- }, Hn = ["innerHTML"], zn = ["onPointerdown", "onDblclick"], $n = {
177
+ }, $n = ["innerHTML"], In = ["onPointerdown", "onDblclick"], Bn = {
178
178
  key: 2,
179
179
  class: "te-header-row"
180
- }, In = {
180
+ }, jn = {
181
181
  key: 0,
182
182
  class: "te-th te-th-sel"
183
- }, Bn = ["checked"], jn = {
183
+ }, Kn = ["checked"], Wn = {
184
184
  key: 1,
185
185
  class: "te-th te-th-acts"
186
- }, Wn = ["data-field", "draggable", "onDragstart", "onDragenter", "onDragover", "onDragleave", "onDrop"], Gn = { class: "te-th-content" }, qn = ["innerHTML"], Jn = ["onClick"], Un = {
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
- }, Kn = ["innerHTML"], Xn = ["onPointerdown", "onDblclick"], Yn = {
189
+ }, Yn = ["innerHTML"], Qn = ["onPointerdown", "onDblclick"], Zn = {
190
190
  key: 0,
191
191
  class: "te-drop-indicator te-drop-left"
192
- }, Qn = {
192
+ }, ei = {
193
193
  key: 1,
194
194
  class: "te-drop-indicator te-drop-right"
195
- }, Zn = {
195
+ }, ti = {
196
196
  key: 3,
197
197
  class: "te-filter-row"
198
- }, ei = {
198
+ }, li = {
199
199
  key: 0,
200
200
  class: "te-td"
201
- }, ti = {
201
+ }, ni = {
202
202
  key: 1,
203
203
  class: "te-td"
204
- }, li = ["onUpdate:modelValue"], ni = ["value"], ii = ["onUpdate:modelValue"], ai = ["onPointerdown", "onDblclick"], si = ["onClick", "onDblclick"], oi = ["checked", "onChange"], ri = ["checked", "onClick"], ui = {
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
- }, ci = { class: "te-actions-wrap" }, di = ["disabled", "onClick", "title"], fi = ["innerHTML"], vi = ["onBlur", "onKeydown"], pi = {
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
- }, hi = ["onDblclick", "innerHTML"], gi = ["onClick"], yi = ["innerHTML"], mi = ["onPointerdown", "onDblclick"], ki = { key: 0 }, bi = ["colspan"], _i = {
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
- }, Ci = { class: "te-paginator" }, Si = { class: "te-page-info" }, Mi = { class: "te-page-controls" }, Ti = ["disabled"], Li = ["disabled"], wi = { class: "te-page-current" }, xi = ["disabled"], Di = ["disabled"], Ei = ["value"], Fi = "te_cfg", zi = {
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(u, { expose: a, emit: v }) {
224
- const s = u, m = v, M = k(() => {
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) || Il();
226
+ return ((e = s.config) == null ? void 0 : e.preferencesStore) || Bl();
227
227
  });
228
- function he() {
229
- return s.id ? `${Fi}_${s.id}` : null;
228
+ function ye() {
229
+ return s.id ? `${Ri}_${s.id}` : null;
230
230
  }
231
- let oe = null;
232
- async function ul() {
233
- const e = he();
231
+ let ue = null;
232
+ async function cl() {
233
+ const e = ye();
234
234
  if (!e) return null;
235
235
  try {
236
- const t = M.value.valor(e);
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 Ze() {
243
- const e = he();
242
+ async function tt() {
243
+ const e = ye();
244
244
  if (!e) return;
245
- const t = lt.value.map((d) => d.field), n = new Set(E.value.map((d) => d.field)), i = {};
246
- for (const d of t) i[d] = Ce.value[d] || "15rem";
247
- const c = ee.value.length ? ee.value : t, l = t.filter((d) => !n.has(d));
248
- await M.value.guardarValores({
249
- [e]: JSON.stringify({ columnOrder: c, columnWidths: i, hiddenFields: l })
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 et() {
253
- oe && clearTimeout(oe), oe = setTimeout(() => {
254
- oe = null, Ze();
252
+ function lt() {
253
+ ue && clearTimeout(ue), ue = setTimeout(() => {
254
+ ue = null, tt();
255
255
  }, 500);
256
256
  }
257
- function tt() {
258
- return ne ? (clearTimeout(ne), ne = null, Ze()) : oe ? (clearTimeout(oe), oe = null, Ze()) : null;
257
+ function nt() {
258
+ return ae ? (clearTimeout(ae), ae = null, tt()) : ue ? (clearTimeout(ue), ue = null, tt()) : null;
259
259
  }
260
- const D = h([]), wt = h([]), E = h([]), lt = h([]), xt = h(null), Dt = h(!1), J = h(!0), S = h("single"), T = h(null), A = h(/* @__PURE__ */ new Map()), I = h(null), re = h("asc"), U = h({}), Ae = h(""), x = h(1), N = h(25), Et = h([25, 50, 100, 200]), Re = h(null), Ft = h(!0), At = h(!1), cl = h(!0);
261
- h(!0);
262
- const Rt = h(!0), dl = h("3rem"), Pt = h("10rem"), Ce = h({}), ee = h([]), Se = h(!1), Me = h(0), H = k(() => {
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
- }), K = k(() => {
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 && H.value;
268
- }), Pe = h(!1), te = h(!0), ue = h(1), nt = h(null), it = h(null), at = h(null), Ve = h(!1);
269
- let le = null;
270
- const R = h(null), X = h(null), B = h(null), j = h(null);
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 W = h(null), ce = h(""), He = h(null), ge = h(null);
273
- let G = null, F = null, Te = null, Le = null, ne = null;
274
- const we = h({
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
- }), P = k(() => {
281
- const e = E.value;
282
- if (ee.value.length) {
280
+ }), O = b(() => {
281
+ const e = R.value;
282
+ if (le.value.length) {
283
283
  const t = [];
284
- for (const n of ee.value) {
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
- }), z = k(() => dt.value.rowActions || []), q = k(() => {
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
- }), fl = k(() => {
295
+ }), vl = b(() => {
296
296
  var e;
297
- return q.value && ((e = s.config) == null ? void 0 : e.cardActions) === !0;
298
- }), st = k(() => q.value ? z.value : []), ze = k(() => {
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
- }), vl = k(() => {
301
+ }), pl = b(() => {
302
302
  var e;
303
303
  return !!((e = s.config) != null && e.columnFilterDefs);
304
- }), de = k(() => {
304
+ }), ve = b(() => {
305
305
  var e;
306
306
  return ((e = s.config) == null ? void 0 : e.dataPipeline) || null;
307
- }), $e = k(() => {
307
+ }), Be = b(() => {
308
308
  var e;
309
309
  return ((e = s.config) == null ? void 0 : e.styling) || null;
310
- }), pl = k(() => {
310
+ }), hl = b(() => {
311
311
  var e;
312
312
  return typeof ((e = s.config) == null ? void 0 : e.permissionsCheck) == "function";
313
- }), hl = k(() => {
314
- let e = P.value.length + 1;
315
- return S.value !== null && e++, z.value.length && !q.value && e++, e;
316
- }), Ie = k(() => {
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
- }), ot = k(() => {
319
+ }), ut = b(() => {
320
320
  var e;
321
321
  return ((e = s.config) == null ? void 0 : e.mobileListView) === !0;
322
- }), Vt = k(() => {
322
+ }), Ht = b(() => {
323
323
  var e;
324
324
  return ((e = s.config) == null ? void 0 : e.mobileBreakpoint) ?? 768;
325
- }), Be = h(!1), Ot = k(() => P.value[0] || null), Nt = k(() => P.value.slice(1)), gl = k(() => ot.value && Be.value);
326
- let ie = null;
327
- function rt(e) {
328
- Be.value = e.matches;
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 Ht() {
331
- ie && ie.removeEventListener("change", rt), ie = null, Be.value = !1, !(!ot.value || typeof window > "u" || !window.matchMedia) && (ie = window.matchMedia(`(max-width: ${Vt.value}px)`), Be.value = ie.matches, ie.addEventListener("change", rt));
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 zt = k(() => {
333
+ const $t = b(() => {
334
334
  var e;
335
335
  return (e = s.config) == null ? void 0 : e.inlineEditing;
336
- }), yl = k(() => {
336
+ }), ml = b(() => {
337
337
  var e;
338
- return ((e = zt.value) == null ? void 0 : e.campos) || {};
339
- }), $t = k(() => {
340
- if (!Ie.value) return [];
341
- const e = s.config.columnGroups || [], t = P.value, n = {};
342
- for (let l = 0; l < e.length; l++)
343
- for (const d of e[l].fields) n[d] = l;
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 l = t[c], d = n[l.field];
348
- if (d !== void 0) {
349
- const f = [];
350
- for (; c < t.length && n[t[c].field] === d; )
351
- f.push(t[c]), c++;
352
- i.push({ _key: "g-" + d, _type: "group", headerName: e[d].headerName, _span: f.length, _cols: f });
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-" + l.field, _type: "col", _col: l }), c++;
354
+ i.push({ _key: "c-" + f.field, _type: "col", _col: f }), c++;
355
355
  }
356
356
  return i;
357
- }), je = k(() => {
358
- let e = D.value || [];
359
- const t = Ae.value;
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) => P.value.some((c) => {
363
- const l = i[c.field];
364
- return l != null && String(l).toLowerCase().includes(n);
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 P.value) {
368
- const i = U.value[n.field];
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((l) => {
372
- const d = l[n.field];
373
- return d != null && String(d).toLowerCase().includes(c);
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 I.value && (e = [...e].sort((n, i) => {
378
- let c = n[I.value], l = i[I.value];
379
- return c == null && (c = ""), l == null && (l = ""), typeof c == "number" && typeof l == "number" ? re.value === "asc" ? c - l : l - c : (c = String(c).toLowerCase(), l = String(l).toLowerCase(), re.value === "asc" ? c.localeCompare(l) : l.localeCompare(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
- }), ut = k(() => H.value ? Me.value : je.value.length), xe = k(() => Math.max(1, Math.ceil(ut.value / N.value))), ae = k(() => {
382
- if (K.value) return D.value || [];
383
- if (H.value) return D.value || [];
384
- const e = (x.value - 1) * N.value;
385
- return je.value.slice(e, e + N.value);
386
- }), ml = k(() => (x.value - 1) * N.value + 1), kl = k(() => Math.min(x.value * N.value, ut.value)), ct = k(() => ae.value.length > 0 && ae.value.every((e) => De(e))), dt = h({
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 pe({
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: () => Ke()
396
+ onClick: () => Ye()
397
397
  }),
398
- new pe({
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: () => Al()
407
+ onClick: () => Rl()
408
408
  }),
409
- new pe({
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 && We((t = s.permisos) == null ? void 0 : t.create);
415
+ return ((e = s.api) == null ? void 0 : e.create) != null && Ge((t = s.permisos) == null ? void 0 : t.create);
416
416
  },
417
- getLabel: () => we.value.create,
418
- onClick: () => kt("create")
417
+ getLabel: () => xe.value.create,
418
+ onClick: () => _t("create")
419
419
  }),
420
- new pe({
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 && We((t = s.permisos) == null ? void 0 : t.edit);
426
+ return ((e = s.api) == null ? void 0 : e.edit) != null && Ge((t = s.permisos) == null ? void 0 : t.edit);
427
427
  },
428
- getLabel: () => we.value.edit,
429
- isDisabled: () => J.value,
430
- onClick: () => kt("edit")
428
+ getLabel: () => xe.value.edit,
429
+ isDisabled: () => X.value,
430
+ onClick: () => _t("edit")
431
431
  }),
432
- new pe({
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 && We((t = s.permisos) == null ? void 0 : t.delete);
438
+ return ((e = s.api) == null ? void 0 : e.delete) != null && Ge((t = s.permisos) == null ? void 0 : t.delete);
439
439
  },
440
- getLabel: () => we.value.delete,
441
- isDisabled: () => J.value,
442
- onClick: () => El()
440
+ getLabel: () => xe.value.delete,
441
+ isDisabled: () => X.value,
442
+ onClick: () => Fl()
443
443
  })
444
444
  ],
445
445
  rowActions: []
446
446
  });
447
- function We(e) {
448
- return !e || !pl.value ? !0 : !!s.config.permissionsCheck(e);
447
+ function Ge(e) {
448
+ return !e || !hl.value ? !0 : !!s.config.permissionsCheck(e);
449
449
  }
450
- const It = k(() => {
450
+ const Bt = b(() => {
451
451
  var t, n;
452
452
  const e = [];
453
- for (const i of dt.value.toolbar)
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(nl(i));
457
+ e.push(il(i));
458
458
  return e;
459
459
  });
460
- function Bt() {
461
- var e, t, n, i, c, l, d, f, y, Y;
462
- ((e = s.config) == null ? void 0 : e.selectionMode) != null && (S.value = s.config.selectionMode), ((n = (t = s.config) == null ? void 0 : t.elementName) == null ? void 0 : n.gender) === "F" && (we.value = { create: "Nueva", edit: "Editar", delete: "Borrar", article: "una", deleted: "eliminada" }), ((i = s.config) == null ? void 0 : i.pageSize) != null && (N.value = s.config.pageSize), ((c = s.config) == null ? void 0 : c.pageSizeOptions) != null && (Et.value = s.config.pageSizeOptions), ((l = s.config) == null ? void 0 : l.scrollHeight) != null && (Re.value = s.config.scrollHeight), ((d = s.config) == null ? void 0 : d.showPaginator) != null && (Ft.value = s.config.showPaginator), ((f = s.config) == null ? void 0 : f.showFilterRow) != null && (At.value = s.config.showFilterRow), (Y = (y = s.config) == null ? void 0 : y.buttons) != null && Y.rowActions && (dt.value.rowActions = s.config.buttons.rowActions.map(nl)), Ye(() => el());
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 ft(e, t) {
465
- var c, l, d, f;
466
- let { value: n } = ol(e, t);
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 = (l = (c = s.config) == null ? void 0 : c.valueFormatters) == null ? void 0 : l[t == null ? void 0 : t.field];
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 y = "#" + (n || "000000"), Y = jl(y) || "#ffffff";
471
- return `<span class="te-color-badge" style="background:${y};color:${Y}">${n}</span>`;
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" || (d = t == null ? void 0 : t.field) != null && d.endsWith("_at") || (f = t == null ? void 0 : t.field) != null && f.endsWith("At"))
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 De(e) {
489
- return S.value === "single" ? T.value === e : A.value.has(e);
488
+ function Ee(e) {
489
+ return L.value === "single" ? x.value === e : P.value.has(e);
490
490
  }
491
- function vt(e) {
492
- T.value === e ? (T.value = null, J.value = !0, m("rowSelected", null)) : (T.value = e, J.value = !1, m("rowSelected", e));
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 pt(e) {
495
- A.value.has(e) ? A.value.delete(e) : A.value.set(e, !0), J.value = A.value.size === 0, m("rowSelected", [...A.value.keys()]);
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 jt() {
498
- if (ct.value)
499
- A.value = /* @__PURE__ */ new Map(), J.value = !0, m("rowSelected", []);
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 ae.value) e.set(t, !0);
503
- A.value = e, J.value = !1, m("rowSelected", [...e.keys()]);
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
- j.value || R.value || (S.value === "multiple" ? pt(e) : vt(e));
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
- j.value || R.value || (m("rowDoubleClick", e), (t = s.config) != null && t.editOnDoubleClick && ((n = s.api) != null && n.edit) && We((i = s.permisos) == null ? void 0 : i.edit) && (S.value === "single" && (T.value = e), kt("edit")));
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 ht(e) {
514
- return I.value !== e ? "sort" : re.value === "asc" ? "sort-asc" : "sort-desc";
513
+ function yt(e) {
514
+ return K.value !== e ? "sort" : ce.value === "asc" ? "sort-asc" : "sort-desc";
515
515
  }
516
- function gt(e) {
517
- if (j.value || R.value) return;
518
- me();
519
- const t = P.value.find((n) => n.field === e);
520
- (t == null ? void 0 : t.sortable) !== !1 && (I.value === e ? re.value = re.value === "asc" ? "desc" : "asc" : (I.value = e, re.value = "asc"), x.value = 1, H.value && (K.value && (ue.value = 1, te.value = !0, D.value = []), be()));
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 bl() {
523
- Le && clearTimeout(Le), Le = setTimeout(() => {
524
- x.value = 1, H.value && (K.value && (ue.value = 1, te.value = !0, D.value = []), be());
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
- Te && clearTimeout(Te), Te = setTimeout(() => {
529
- x.value = 1, H.value && (K.value && (ue.value = 1, te.value = !0, D.value = []), be());
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 _l() {
533
- ne && clearTimeout(ne), ne = setTimeout(() => et(), 300);
532
+ function Cl() {
533
+ ae && clearTimeout(ae), ae = setTimeout(() => lt(), 300);
534
534
  }
535
- function Ge(e) {
536
- me(), x.value = Math.max(1, Math.min(e, xe.value)), H.value && be();
535
+ function qe(e) {
536
+ be(), F.value = Math.max(1, Math.min(e, De.value)), I.value && Ce();
537
537
  }
538
- function Cl() {
539
- me(), x.value = 1, H.value && be();
538
+ function Sl() {
539
+ be(), F.value = 1, I.value && Ce();
540
540
  }
541
- function ye(e, t) {
542
- if (e.button !== 0 || R.value) return;
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
- j.value = t, Oe = e.clientX, Ne = n.offsetWidth, document.body.style.cursor = "col-resize", document.body.classList.add("te-resizing"), document.addEventListener("pointermove", yt), document.addEventListener("pointerup", mt);
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 yt(e) {
554
- if (!j.value || Oe == null || Ne == null) return;
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
- Ce.value = { ...Ce.value, [j.value]: t + "px" };
556
+ Se.value = { ...Se.value, [G.value]: t + "px" };
557
557
  }
558
- function mt() {
559
- document.removeEventListener("pointermove", yt), document.removeEventListener("pointerup", mt), document.body.style.cursor = "", document.body.classList.remove("te-resizing"), j.value && et(), Oe = null, Ne = null, j.value = null;
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 Ee(e, t) {
562
- ye(e, t);
561
+ function Fe(e, t) {
562
+ ke(e, t);
563
563
  }
564
- function Sl(e, t) {
565
- if (j.value) {
564
+ function Ml(e, t) {
565
+ if (G.value) {
566
566
  e.preventDefault();
567
567
  return;
568
568
  }
569
- R.value = t, X.value = null, B.value = null, e.dataTransfer && (e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", t));
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
- if (R.value === t) return;
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
- e.currentTarget.contains(e.relatedTarget) || X.value === t && (X.value = null, B.value = null);
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
- if (!R.value || R.value === t) {
585
- qe();
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 = ee.value.length ? [...ee.value] : E.value.map((f) => f.field), i = n.indexOf(R.value), c = n.indexOf(t);
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
- qe();
590
+ Je();
591
591
  return;
592
592
  }
593
- const [l] = n.splice(i, 1), d = i < c ? B.value === "right" ? c : c - 1 : B.value === "left" ? c : c + 1;
594
- n.splice(Math.max(0, Math.min(n.length, d)), 0, l), ee.value = n, et(), qe();
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 qe() {
597
- R.value = null, X.value = null, B.value = null;
596
+ function Je() {
597
+ H.value = null, Z.value = null, W.value = null;
598
598
  }
599
- function Je(e) {
600
- return yl.value[e == null ? void 0 : e.field] || null;
599
+ function Ue(e) {
600
+ return ml.value[e == null ? void 0 : e.field] || null;
601
601
  }
602
- function xl(e, t) {
603
- return W.value ? W.value.row === e && W.value.field === t.field : !1;
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 d, f;
607
- if (!Je(n)) return;
608
- (d = e == null ? void 0 : e.stopPropagation) == null || d.call(e);
609
- const l = ((f = t.__raw) == null ? void 0 : f[n.field]) ?? t[n.field] ?? "";
610
- ge.value = l, W.value = { row: t, field: n.field }, ce.value = l, Ye(() => {
611
- const y = Array.isArray(He.value) ? He.value[0] : He.value;
612
- y && typeof y.focus == "function" && (y.focus(), y.select());
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 (!W.value) return;
617
- const n = Je(t);
616
+ if (!q.value) return;
617
+ const n = Ue(t);
618
618
  if (!n) {
619
- Fe();
619
+ Ae();
620
620
  return;
621
621
  }
622
- let i = ce.value;
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
- Fe();
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
- Fe();
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
- Fe();
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), W.value = null, ce.value = "", Dl(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 Fe() {
641
- if (W.value && ge.value !== null) {
642
- const { row: e, field: t } = W.value;
643
- e[t] = ge.value;
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
- W.value = null, ce.value = "", ge.value = null;
645
+ q.value = null, fe.value = "", me.value = null;
646
646
  }
647
- function Dl(e, t, n) {
648
- const i = zt.value;
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
- G && (clearTimeout(G), G = null), F && (F.api(F.data), F = null);
653
- const l = ge.value ?? e[t];
654
- F = { api: i.api, data: { id: c, field: t, value: n } }, G = setTimeout(async () => {
655
- const d = await i.api({ id: c, field: t, value: n });
656
- F = null, ke(d) ? (e[t] = l, console.error("[TableEditor] inline save failed:", d)) : i.onSave && i.onSave();
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 me() {
660
- W.value = null, ce.value = "", ge.value = null, G && (clearTimeout(G), G = null), F && (F.api(F.data), F = null);
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 Kt(e) {
663
- var i, c, l, d, f;
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: `${we.value[e]} ${((d = (l = s.config) == null ? void 0 : l.elementName) == null ? void 0 : d.singular) || ""}`.trim(),
668
- campos: [...wt.value, ...t],
669
- modelo: n ? T.value : {},
670
- onSubmit: (f = s.api) == null ? void 0 : f[e],
671
- guardado: () => Ke(),
672
- selectedRows: S.value === "multiple" ? [...A.value.keys()] : [T.value]
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 kt(e) {
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(Kt(e));
680
+ t(Xt(e));
681
681
  return;
682
682
  }
683
- m(e + "Request", Kt(e));
683
+ k(e + "Request", Xt(e));
684
684
  }
685
- async function El() {
685
+ async function Fl() {
686
686
  var i, c;
687
- const t = (S.value === "multiple" ? [...A.value.keys()] : [T.value]).map((l) => l == null ? void 0 : l.id).filter(Boolean);
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
- m("deleteRequest", { ids: [], action: "delete" });
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((l) => {
694
- l && Fl(t);
695
- }).catch((l) => console.error("[TableEditor] confirmDelete error:", l)) : m("deleteRequest", { ids: t, action: "delete" });
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 Fl(e) {
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 (ke(n)) {
702
+ if (_e(n)) {
703
703
  console.error("[TableEditor] delete failed:", n);
704
704
  return;
705
705
  }
706
- T.value = null, A.value = /* @__PURE__ */ new Map(), J.value = !0, Ke();
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 ke(e) {
711
+ function _e(e) {
712
712
  return e != null && (e.status === !1 || e.stat === !1);
713
713
  }
714
- async function Al() {
714
+ async function Rl() {
715
715
  var e, t, n;
716
- if (H.value && ((e = s.config) != null && e.csvFetchAll) && ((t = s.api) != null && t.list))
716
+ if (I.value && ((e = s.config) != null && e.csvFetchAll) && ((t = s.api) != null && t.list))
717
717
  try {
718
- const i = bt({ page: 1 });
719
- i[ze.value ? "rows" : "pageSize"] = Math.max(Me.value || 0, N.value);
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 (ke(c)) {
721
+ if (_e(c)) {
722
722
  console.error("[TableEditor] CSV fetch error:", c);
723
723
  return;
724
724
  }
725
- Xt(((n = c == null ? void 0 : c.data) == null ? void 0 : n.rows) || []);
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
- Xt(D.value || []);
731
+ Yt(A.value || []);
732
732
  }
733
- function Xt(e) {
733
+ function Yt(e) {
734
734
  if (!e.length) return;
735
- const t = P.value;
736
- let n = t.map((c) => Yt(c.headerName)).join(",") + `
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((l) => Yt(c[l.field] != null ? String(c[l.field]) : "")).join(",") + `
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 Yt(e) {
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 Ue(e) {
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 Qt(e) {
753
- at.value && !at.value.contains(e.target) && (Ve.value = !1);
752
+ function Zt(e) {
753
+ ot.value && !ot.value.contains(e.target) && (He.value = !1);
754
754
  }
755
- function Ke() {
756
- me(), T.value = null, A.value = /* @__PURE__ */ new Map(), J.value = !0, K.value && (ue.value = 1, te.value = !0, D.value = []), Xe();
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 bt(e = {}) {
758
+ function Ct(e = {}) {
759
759
  const n = {
760
- page: e.page ?? (K.value ? ue.value : x.value),
761
- [ze.value ? "rows" : "pageSize"]: N.value,
762
- sortField: I.value || "",
763
- sortOrder: re.value,
764
- [ze.value ? "globalSearch" : "search"]: Ae.value || ""
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(U.value))
767
- U.value[c] && (i[c] = ze.value ? { value: U.value[c], matchMode: "contains" } : U.value[c]);
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 be() {
770
+ async function Ce() {
771
771
  var e, t;
772
- me(), Se.value = !0;
772
+ be(), Me.value = !0;
773
773
  try {
774
- const n = await s.api.list(bt());
775
- ke(n) || (Me.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, _t(n == null ? void 0 : n.data));
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
- Se.value = !1;
779
+ Me.value = !1;
780
780
  }
781
781
  }
782
- async function Xe(e) {
782
+ async function Qe(e) {
783
783
  var n;
784
784
  const t = e || s.data;
785
- if (t != null) return _t(t);
785
+ if (t != null) return St(t);
786
786
  if ((n = s.api) != null && n.list) {
787
- if (H.value) return be();
788
- Se.value = !0;
787
+ if (I.value) return Ce();
788
+ Me.value = !0;
789
789
  try {
790
790
  const i = await s.api.list();
791
- ke(i) || _t(i == null ? void 0 : i.data);
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
- Se.value = !1;
795
+ Me.value = !1;
796
796
  }
797
797
  }
798
- m("rowSelected", S.value === "single" ? null : []), T.value = null, A.value = /* @__PURE__ */ new Map();
798
+ k("rowSelected", L.value === "single" ? null : []), x.value = null, P.value = /* @__PURE__ */ new Map();
799
799
  }
800
- function _t(e) {
801
- var i, c, l, d, f, y;
800
+ function St(e) {
801
+ var i, c, f, m, M, l;
802
802
  if (!e) {
803
- Dt.value = !0, m("loaded", !0);
803
+ Et.value = !0, k("loaded", !0);
804
804
  return;
805
805
  }
806
806
  let t = e.rows || [], n = e.fields_def;
807
- if (de.value ? (de.value.processRows && (t = de.value.processRows(t, n) || t), de.value.processFields && (n = de.value.processFields(n, t[0]) ?? n)) : $e.value && (t = t.map((Y) => sl(Y, $e.value))), D.value = t, me(), n) {
808
- const Y = JSON.stringify(n.map((b) => b == null ? void 0 : b.field));
809
- if (Y === xt.value) return;
810
- xt.value = Y;
811
- let _e = [...n];
812
- (c = (i = s.config) == null ? void 0 : i.extraFields) != null && c.list && _e.push(...s.config.extraFields.list), $e.value && Wl(_e, $e.value);
813
- const Ct = (l = s.config) == null ? void 0 : l.columnFilterDefs;
814
- if (Ct)
815
- for (const b of _e)
816
- Ct[b.field] && (b.filter = { type: "text", ...Ct[b.field] });
817
- wt.value = _e;
818
- let St = _e;
819
- if ((d = de.value) != null && d.processColumns && (St = de.value.processColumns(_e)), E.value = [...St], lt.value = [...St], (f = s.config) != null && f.defaultColumnProps)
820
- for (let b = 0; b < E.value.length; b++)
821
- E.value[b] = { ...E.value[b], ...s.config.defaultColumnProps };
822
- if ((y = s.config) != null && y.columnOrder) {
823
- const b = [];
824
- for (const se of s.config.columnOrder) {
825
- const Q = E.value.find((Mt) => Mt.field === se);
826
- Q && b.push(Q);
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 se of E.value)
829
- b.some((Q) => Q.field === se.field) || b.push(se);
830
- E.value = b;
828
+ for (const re of R.value)
829
+ _.some((ee) => ee.field === re.field) || _.push(re);
830
+ R.value = _;
831
831
  }
832
- ul().then((b) => {
833
- if (b != null && b.columnWidths)
834
- for (const [se, Q] of Object.entries(b.columnWidths))
835
- Ce.value[se] = Q;
836
- if (ee.value = (b == null ? void 0 : b.columnOrder) || [], Array.isArray(b == null ? void 0 : b.hiddenFields) && b.hiddenFields.length) {
837
- const se = new Set(b.hiddenFields), Q = E.value.filter((Mt) => !se.has(Mt.field));
838
- Q.length && (E.value = Q);
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
- Dt.value = !0, m("loaded", !0);
842
+ Et.value = !0, k("loaded", !0);
843
843
  }
844
- function Rl() {
845
- if (!K.value) return;
846
- const e = it.value;
847
- !e || !nt.value || (le == null || le.disconnect(), le = new IntersectionObserver(([t]) => {
848
- t.isIntersecting && te.value && !Pe.value && Pl();
849
- }, { root: e, rootMargin: "0px 0px 200px 0px", threshold: 0 }), le.observe(nt.value));
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 Pl() {
851
+ async function Vl() {
852
852
  var e, t, n;
853
- if (Pe.value = !0, H.value) {
854
- ue.value++;
853
+ if (Ve.value = !0, I.value) {
854
+ de.value++;
855
855
  try {
856
- const i = await s.api.list(bt({ page: ue.value }));
857
- if (!ke(i)) {
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 && (D.value = [...D.value, ...c]), Me.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;
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
- te.value = D.value.length < Me.value;
861
+ ne.value = A.value.length < Te.value;
862
862
  } catch (i) {
863
- console.error("[TableEditor] load more error:", i), te.value = !1;
863
+ console.error("[TableEditor] load more error:", i), ne.value = !1;
864
864
  }
865
865
  } else {
866
- const i = je.value.length, c = D.value.length, l = Math.min(c + N.value, i);
867
- l > c && (D.value = [...je.value.slice(0, l)]), te.value = D.value.length < i;
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
- Pe.value = !1;
869
+ Ve.value = !1;
870
870
  }
871
- function Zt(e, t) {
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
- Tt(() => s.data, (e) => {
884
- (e == null ? void 0 : e.rows) !== void 0 && Xe(e);
885
- }), Tt(ae, () => el()), Tt([ot, Vt], () => Ht());
886
- function el() {
887
- !z.value.length || q.value || Ye(() => {
888
- const e = it.value;
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 && (Pt.value = Math.max(56, t + 24) + "px");
893
+ }), t > 0 && (Vt.value = Math.max(56, t + 24) + "px");
894
894
  });
895
895
  }
896
- return Vl(async () => {
897
- Bt(), Ht(), document.addEventListener("click", Qt), window.addEventListener("beforeunload", tt), M.value.fetchMisPreferencias && await M.value.fetchMisPreferencias(), await Xe(), Ye(() => Rl());
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", Qt), ie && ie.removeEventListener("change", rt), document.removeEventListener("pointermove", yt), document.removeEventListener("pointerup", mt), window.removeEventListener("beforeunload", tt), tt(), le == null || le.disconnect(), G && (clearTimeout(G), G = null), F && (F.api(F.data), F = null), Te && clearTimeout(Te), Le && clearTimeout(Le), ne && clearTimeout(ne);
900
- }), a({ loadData: Xe, applyConfig: Bt, refresh: Ke }), (e, t) => {
901
- var n, i, c;
902
- return o(), r("div", ql, [
903
- !((n = u.config) != null && n.hideToolbar) || st.value.length ? (o(), r("div", Jl, [
904
- p("div", Ul, [
905
- (o(!0), r(C, null, L(It.value, (l) => (o(), r("button", {
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: V(["te-btn", Ue(l.severity), l.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 ? (o(), r("span", {
913
+ l.icon ? (r(), u("span", {
913
914
  key: 0,
914
915
  class: "te-btn-icon",
915
- innerHTML: O($)(l.icon)
916
- }, null, 8, Xl)) : g("", !0),
917
- Z(w(l.getLabel()), 1)
918
- ], 10, Kl))), 128)),
919
- st.value.length ? (o(), r(C, { key: 0 }, [
920
- It.value.length ? (o(), r("span", Yl, "|")) : g("", !0),
921
- (o(!0), r(C, null, L(st.value, (l) => (o(), r("button", {
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: V(["te-btn", Ue(l.severity), l.class]),
924
- disabled: l.isDisabled() || !T.value,
925
- onClick: (d) => l.onClick(T.value),
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 ? (o(), r("span", {
930
+ l.icon ? (r(), u("span", {
929
931
  key: 0,
930
932
  class: "te-btn-icon",
931
- innerHTML: O($)(l.icon)
932
- }, null, 8, Zl)) : g("", !0),
933
- Z(w(l.getLabel()), 1)
934
- ], 10, Ql))), 128))
935
- ], 64)) : g("", !0)
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 = u.config) != null && i.hideToolbarEnd ? g("", !0) : (o(), r("div", en, [
938
- (c = u.config) != null && c.hideColumnSelector ? g("", !0) : (o(), r("div", {
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: at
944
+ ref: ot,
945
+ "data-help": ((f = o.config) == null ? void 0 : f.columnSelectorHelpKey) || void 0
943
946
  }, [
944
- p("button", {
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) => Ve.value = !Ve.value)
951
+ onClick: t[0] || (t[0] = (l) => He.value = !He.value)
949
952
  }, [
950
- p("span", {
953
+ h("span", {
951
954
  class: "te-btn-icon",
952
- innerHTML: O($)("columns")
953
- }, null, 8, tn),
954
- t[17] || (t[17] = Z("Columnas ", -1))
955
+ innerHTML: z(j)("columns")
956
+ }, null, 8, nn),
957
+ t[17] || (t[17] = te("Columnas ", -1))
955
958
  ]),
956
- Ve.value ? (o(), r("div", ln, [
957
- (o(!0), r(C, null, L(lt.value, (l) => (o(), r("label", {
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
- fe(p("input", {
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] = (d) => E.value = d),
968
+ "onUpdate:modelValue": t[1] || (t[1] = (p) => R.value = p),
966
969
  class: "te-checkbox",
967
- onChange: _l
968
- }, null, 40, nn), [
969
- [Nl, E.value]
970
+ onChange: Cl
971
+ }, null, 40, sn), [
972
+ [Nl, R.value]
970
973
  ]),
971
- Z(" " + w(l.headerName), 1)
974
+ te(" " + E(l.headerName), 1)
972
975
  ]))), 128))
973
- ])) : g("", !0)
974
- ], 512)),
975
- p("div", an, [
976
- p("span", {
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: O($)("search")
979
- }, null, 8, sn),
980
- fe(p("input", {
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) => Ae.value = l),
984
- onInput: bl,
989
+ "onUpdate:modelValue": t[2] || (t[2] = (l) => Re.value = l),
990
+ onInput: _l,
985
991
  placeholder: "Buscar..."
986
992
  }, null, 544), [
987
- [Lt, Ae.value]
993
+ [wt, Re.value]
988
994
  ])
989
- ])
995
+ ], 8, on)
990
996
  ]))
991
- ])) : g("", !0),
992
- p("div", {
997
+ ])) : y("", !0),
998
+ h("div", {
993
999
  class: "te-scroll-wrap",
994
- style: ve(Re.value ? { height: Re.value, minHeight: Re.value } : {}),
1000
+ style: he(Pe.value ? { height: Pe.value, minHeight: Pe.value } : {}),
995
1001
  ref_key: "scrollWrapRef",
996
- ref: it
1002
+ ref: st
997
1003
  }, [
998
- Se.value ? (o(), r("div", on, [...t[18] || (t[18] = [
999
- p("div", {
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
- p("span", { class: "te-sr-only" }, "Cargando...")
1009
+ h("span", { class: "te-sr-only" }, "Cargando...")
1004
1010
  ], -1)
1005
- ])])) : g("", !0),
1006
- gl.value ? (o(), r("div", rn, [
1007
- (o(!0), r(C, null, L(ae.value, (l, d) => (o(), r("div", {
1008
- key: Zt(l, d),
1009
- class: V(["te-mobile-card", l.__css_class, {
1010
- "te-tr-selected": De(l),
1011
- "te-tr-highlight": T.value === l
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: ve(l.__style),
1014
- onClick: (f) => Wt(l),
1015
- onDblclick: (f) => Gt(l)
1019
+ style: he(l.__style),
1020
+ onClick: (d) => Wt(l),
1021
+ onDblclick: (d) => Gt(l)
1016
1022
  }, [
1017
- p("div", cn, [
1018
- S.value !== null ? (o(), r("div", {
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
- S.value === "multiple" ? (o(), r("input", {
1030
+ L.value === "multiple" ? (r(), u("input", {
1025
1031
  key: 0,
1026
1032
  type: "checkbox",
1027
- checked: De(l),
1028
- onChange: (f) => pt(l),
1033
+ checked: Ee(l),
1034
+ onChange: (d) => gt(l),
1029
1035
  class: "te-checkbox"
1030
- }, null, 40, dn)) : (o(), r("input", {
1036
+ }, null, 40, vn)) : (r(), u("input", {
1031
1037
  key: 1,
1032
1038
  type: "radio",
1033
- checked: T.value === l,
1034
- onClick: (f) => vt(l),
1039
+ checked: x.value === l,
1040
+ onClick: (d) => ht(l),
1035
1041
  class: "te-checkbox"
1036
- }, null, 8, fn))
1037
- ])) : g("", !0),
1038
- Ot.value ? (o(), r("span", {
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: ft(l, Ot.value)
1042
- }, null, 8, vn)) : g("", !0)
1047
+ innerHTML: pt(l, Ot.value)
1048
+ }, null, 8, hn)) : y("", !0)
1043
1049
  ]),
1044
- Nt.value.length ? (o(), r("dl", pn, [
1045
- (o(!0), r(C, null, L(Nt.value, (f) => (o(), r(C, {
1046
- key: f.field
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
- p("dt", null, w(f.headerName), 1),
1049
- p("dd", {
1050
- innerHTML: ft(l, f)
1051
- }, null, 8, hn)
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
- ])) : g("", !0),
1054
- z.value.length && (!q.value || fl.value) ? (o(), r("div", {
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
- (o(!0), r(C, null, L(z.value, (f) => (o(), r(C, {
1061
- key: f.key
1066
+ (r(!0), u(T, null, D(B.value, (d) => (r(), u(T, {
1067
+ key: d.key
1062
1068
  }, [
1063
- f.isVisible() ? (o(), r("button", {
1069
+ d.isVisible() ? (r(), u("button", {
1064
1070
  key: 0,
1065
- class: V(["te-btn", Ue(f.severity), f.class]),
1066
- disabled: f.isDisabled(),
1067
- onClick: _((y) => f.onClick(l), ["stop"]),
1068
- title: f.getLabel()
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
- f.icon ? (o(), r("span", {
1077
+ d.icon ? (r(), u("span", {
1071
1078
  key: 0,
1072
1079
  class: "te-btn-icon",
1073
- innerHTML: O($)(f.icon)
1074
- }, null, 8, yn)) : g("", !0),
1075
- Z(" " + w(f.getLabel()), 1)
1076
- ], 10, gn)) : g("", !0)
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
- ])) : g("", !0)
1079
- ], 46, un))), 128)),
1080
- ae.value.length ? g("", !0) : (o(), r("div", mn, "Sin registros"))
1081
- ])) : (o(), r("table", {
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: V(["te-table", { "te-striped": cl.value }])
1090
+ class: N(["te-table", { "te-striped": dl.value }])
1084
1091
  }, [
1085
- p("colgroup", null, [
1086
- S.value !== null ? (o(), r("col", {
1092
+ h("colgroup", null, [
1093
+ L.value !== null ? (r(), u("col", {
1087
1094
  key: 0,
1088
- style: ve({ width: dl.value })
1089
- }, null, 4)) : g("", !0),
1090
- z.value.length && !q.value ? (o(), r("col", {
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: ve({ width: Pt.value })
1093
- }, null, 4)) : g("", !0),
1094
- (o(!0), r(C, null, L(P.value, (l) => (o(), r("col", {
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: ve({ width: Ce.value[l.field] || "15rem" }),
1103
+ style: he({ width: Se.value[l.field] || "15rem" }),
1097
1104
  "data-field": l.field
1098
- }, null, 12, kn))), 128)),
1099
- t[19] || (t[19] = p("col", { class: "te-col-filler" }, null, -1))
1105
+ }, null, 12, _n))), 128)),
1106
+ t[19] || (t[19] = h("col", { class: "te-col-filler" }, null, -1))
1100
1107
  ]),
1101
- p("thead", null, [
1102
- Ie.value ? (o(), r("tr", bn, [
1103
- S.value !== null ? (o(), r("th", _n, [
1104
- S.value === "multiple" ? (o(), r("input", {
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: ct.value,
1108
- onChange: jt,
1114
+ checked: ft.value,
1115
+ onChange: Kt,
1109
1116
  class: "te-checkbox"
1110
- }, null, 40, Cn)) : g("", !0)
1111
- ])) : g("", !0),
1112
- z.value.length && !q.value ? (o(), r("th", Sn, "Acciones")) : g("", !0),
1113
- (o(!0), r(C, null, L($t.value, (l) => (o(), r(C, {
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" ? (o(), r("th", {
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
- p("div", Tn, [
1122
- p("span", Ln, w(l.headerName), 1)
1128
+ h("div", wn, [
1129
+ h("span", xn, E(l.headerName), 1)
1123
1130
  ])
1124
- ], 8, Mn)) : (o(), r("th", {
1131
+ ], 8, Ln)) : (r(), u("th", {
1125
1132
  key: 1,
1126
1133
  rowspan: 2,
1127
1134
  "data-field": l._col.field,
1128
- class: V(["te-th", l._col.css, { "te-th-sorted": I.value === l._col.field }])
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
- p("div", xn, [
1131
- p("span", {
1138
+ h("div", En, [
1139
+ h("span", {
1132
1140
  class: "te-th-label",
1133
- onClick: (d) => gt(l._col.field)
1141
+ onClick: (p) => mt(l._col.field)
1134
1142
  }, [
1135
- Z(w(l._col.headerName) + " ", 1),
1136
- l._col.sortable !== !1 ? (o(), r("span", En, [
1137
- p("span", {
1138
- innerHTML: O($)(ht(l._col.field))
1139
- }, null, 8, Fn)
1140
- ])) : g("", !0)
1141
- ], 8, Dn)
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
- p("div", {
1151
+ h("div", {
1144
1152
  class: "te-resize-handle",
1145
- onPointerdown: _((d) => ye(d, l._col.field), ["stop"]),
1146
- onDblclick: _((d) => Ee(d, l._col.field), ["stop"]),
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, An)
1150
- ], 10, wn))
1157
+ }, null, 40, Pn)
1158
+ ], 10, Dn))
1151
1159
  ], 64))), 128)),
1152
- t[20] || (t[20] = p("th", {
1160
+ t[20] || (t[20] = h("th", {
1153
1161
  class: "te-th te-th-filler",
1154
1162
  rowspan: 2
1155
1163
  }, null, -1))
1156
- ])) : g("", !0),
1157
- Ie.value ? (o(), r("tr", Rn, [
1158
- (o(!0), r(C, null, L($t.value, (l) => (o(), r(C, {
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" ? (o(!0), r(C, { key: 0 }, L(l._cols, (d) => (o(), r("th", {
1162
- key: d.field,
1163
- "data-field": d.field,
1164
- class: V(["te-th", d.css, { "te-th-sorted": I.value === d.field }])
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
- p("div", Vn, [
1167
- p("span", {
1175
+ h("div", On, [
1176
+ h("span", {
1168
1177
  class: "te-th-label",
1169
- onClick: (f) => gt(d.field)
1178
+ onClick: (d) => mt(p.field)
1170
1179
  }, [
1171
- Z(w(d.headerName) + " ", 1),
1172
- d.sortable !== !1 ? (o(), r("span", Nn, [
1173
- p("span", {
1174
- innerHTML: O($)(ht(d.field))
1175
- }, null, 8, Hn)
1176
- ])) : g("", !0)
1177
- ], 8, On)
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
- p("div", {
1188
+ h("div", {
1180
1189
  class: "te-resize-handle",
1181
- onPointerdown: _((f) => ye(f, d.field), ["stop"]),
1182
- onDblclick: _((f) => Ee(f, d.field), ["stop"]),
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, zn)
1186
- ], 10, Pn))), 128)) : g("", !0)
1194
+ }, null, 40, In)
1195
+ ], 10, Hn))), 128)) : y("", !0)
1187
1196
  ], 64))), 128))
1188
- ])) : g("", !0),
1189
- Ie.value ? g("", !0) : (o(), r("tr", $n, [
1190
- S.value !== null ? (o(), r("th", In, [
1191
- S.value === "multiple" ? (o(), r("input", {
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: ct.value,
1195
- onChange: jt,
1203
+ checked: ft.value,
1204
+ onChange: Kt,
1196
1205
  class: "te-checkbox"
1197
- }, null, 40, Bn)) : g("", !0)
1198
- ])) : g("", !0),
1199
- z.value.length && !q.value ? (o(), r("th", jn, "Acciones")) : g("", !0),
1200
- (o(!0), r(C, null, L(P.value, (l) => (o(), r("th", {
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
- class: V(["te-th", l.css, {
1204
- "te-th-dragover-left": X.value === l.field && B.value === "left",
1205
- "te-th-dragover-right": X.value === l.field && B.value === "right",
1206
- "te-th-dragging": R.value === l.field,
1207
- "te-th-sorted": I.value === l.field
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: Rt.value,
1210
- onDragstart: (d) => Sl(d, l.field),
1211
- onDragenter: _((d) => Ml(d, l.field), ["prevent"]),
1212
- onDragover: _((d) => Tl(d, l.field), ["prevent"]),
1213
- onDragleave: (d) => Ll(d, l.field),
1214
- onDrop: _((d) => wl(d, l.field), ["prevent"]),
1215
- onDragend: qe
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
- p("div", Gn, [
1218
- Rt.value ? (o(), r("span", {
1227
+ h("div", qn, [
1228
+ Pt.value ? (r(), u("span", {
1219
1229
  key: 0,
1220
1230
  class: "te-th-grip",
1221
- innerHTML: O($)("grip")
1222
- }, null, 8, qn)) : g("", !0),
1223
- p("span", {
1231
+ innerHTML: z(j)("grip")
1232
+ }, null, 8, Jn)) : y("", !0),
1233
+ h("span", {
1224
1234
  class: "te-th-label",
1225
- onClick: (d) => gt(l.field)
1235
+ onClick: (p) => mt(l.field)
1226
1236
  }, [
1227
- Z(w(l.headerName) + " ", 1),
1228
- l.sortable !== !1 ? (o(), r("span", Un, [
1229
- p("span", {
1230
- innerHTML: O($)(ht(l.field))
1231
- }, null, 8, Kn)
1232
- ])) : g("", !0)
1233
- ], 8, Jn)
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
- p("div", {
1236
- class: V(["te-resize-handle", { "te-resizing-active": j.value === l.field }]),
1245
+ h("div", {
1246
+ class: N(["te-resize-handle", { "te-resizing-active": G.value === l.field }]),
1237
1247
  draggable: "false",
1238
- onPointerdown: _((d) => ye(d, l.field), ["stop"]),
1239
- onDblclick: _((d) => Ee(d, l.field), ["stop"]),
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, Xn),
1243
- X.value === l.field && B.value === "left" ? (o(), r("div", Yn)) : g("", !0),
1244
- X.value === l.field && B.value === "right" ? (o(), r("div", Qn)) : g("", !0)
1245
- ], 42, Wn))), 128)),
1246
- t[21] || (t[21] = p("th", { class: "te-th te-th-filler" }, null, -1))
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
- At.value ? (o(), r("tr", Zn, [
1249
- S.value !== null ? (o(), r("td", ei)) : g("", !0),
1250
- z.value.length && !q.value ? (o(), r("td", ti)) : g("", !0),
1251
- (o(!0), r(C, null, L(P.value, (l) => {
1252
- var d, f;
1253
- return o(), r("td", {
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
- ((d = l.filter) == null ? void 0 : d.type) === "select" ? fe((o(), r("select", {
1267
+ ((p = l.filter) == null ? void 0 : p.type) === "select" ? pe((r(), u("select", {
1258
1268
  key: 0,
1259
- "onUpdate:modelValue": (y) => U.value[l.field] = y,
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] = p("option", { value: "" }, "Todos", -1)),
1264
- (o(!0), r(C, null, L(l.filter.options, (y) => (o(), r("option", {
1265
- key: y.value,
1266
- value: y.value
1267
- }, w(y.label), 9, ni))), 128))
1268
- ], 40, li)), [
1269
- [tl, U.value[l.field]]
1270
- ]) : ((f = l.filter) == null ? void 0 : f.type) === "text" || !vl.value ? fe((o(), r("input", {
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": (y) => U.value[l.field] = y,
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, ii)), [
1278
- [Lt, U.value[l.field]]
1279
- ]) : g("", !0),
1280
- p("div", {
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: _((y) => ye(y, l.field), ["stop"]),
1284
- onDblclick: _((y) => Ee(y, l.field), ["stop"]),
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, ai)
1297
+ }, null, 40, oi)
1288
1298
  ]);
1289
1299
  }), 128)),
1290
- t[23] || (t[23] = p("td", { class: "te-td te-td-filler" }, null, -1))
1291
- ])) : g("", !0)
1300
+ t[23] || (t[23] = h("td", { class: "te-td te-td-filler" }, null, -1))
1301
+ ])) : y("", !0)
1292
1302
  ]),
1293
- p("tbody", null, [
1294
- (o(!0), r(C, null, L(ae.value, (l, d) => (o(), r("tr", {
1295
- key: Zt(l, d),
1296
- class: V(["te-tr", l.__css_class, {
1297
- "te-tr-selected": De(l),
1298
- "te-tr-highlight": T.value === l
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: ve(l.__style),
1301
- onClick: (f) => Wt(l),
1302
- onDblclick: (f) => Gt(l)
1310
+ style: he(l.__style),
1311
+ onClick: (d) => Wt(l),
1312
+ onDblclick: (d) => Gt(l)
1303
1313
  }, [
1304
- S.value !== null ? (o(), r("td", {
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
- S.value === "multiple" ? (o(), r("input", {
1320
+ L.value === "multiple" ? (r(), u("input", {
1311
1321
  key: 0,
1312
1322
  type: "checkbox",
1313
- checked: De(l),
1314
- onChange: (f) => pt(l),
1323
+ checked: Ee(l),
1324
+ onChange: (d) => gt(l),
1315
1325
  class: "te-checkbox"
1316
- }, null, 40, oi)) : (o(), r("input", {
1326
+ }, null, 40, ui)) : (r(), u("input", {
1317
1327
  key: 1,
1318
1328
  type: "radio",
1319
- checked: T.value === l,
1320
- onClick: (f) => vt(l),
1329
+ checked: x.value === l,
1330
+ onClick: (d) => ht(l),
1321
1331
  class: "te-checkbox"
1322
- }, null, 8, ri))
1323
- ])) : g("", !0),
1324
- z.value.length && !q.value ? (o(), r("td", ui, [
1325
- p("div", ci, [
1326
- (o(!0), r(C, null, L(z.value, (f) => (o(), r(C, {
1327
- key: f.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
- f.isVisible() ? (o(), r("button", {
1339
+ d.isVisible() ? (r(), u("button", {
1330
1340
  key: 0,
1331
- class: V(["te-btn", Ue(f.severity), f.class]),
1332
- disabled: f.isDisabled(),
1333
- onClick: _((y) => f.onClick(l), ["stop"]),
1334
- title: f.getLabel()
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
- f.icon ? (o(), r("span", {
1347
+ d.icon ? (r(), u("span", {
1337
1348
  key: 0,
1338
1349
  class: "te-btn-icon",
1339
- innerHTML: O($)(f.icon)
1340
- }, null, 8, fi)) : g("", !0),
1341
- Z(" " + w(f.getLabel()), 1)
1342
- ], 10, di)) : g("", !0)
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
- ])) : g("", !0),
1346
- (o(!0), r(C, null, L(P.value, (f) => (o(), r("td", {
1347
- key: f.field,
1348
- class: V(["te-td", f.css, {
1349
- "te-td-inline-edit": !!Je(f)
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: ve(O(Gl)(l, f))
1362
+ style: he(z(Gl)(l, d))
1352
1363
  }, [
1353
- xl(l, f) ? fe((o(), r("input", {
1364
+ Dl(l, d) ? pe((r(), u("input", {
1354
1365
  key: 0,
1355
- "onUpdate:modelValue": t[10] || (t[10] = (y) => ce.value = y),
1366
+ "onUpdate:modelValue": t[10] || (t[10] = (C) => fe.value = C),
1356
1367
  type: "text",
1357
1368
  class: "te-editing-input",
1358
- onBlur: (y) => Ut(l, f),
1369
+ onBlur: (C) => Ut(l, d),
1359
1370
  onKeydown: [
1360
- ll((y) => Ut(l, f), ["enter"]),
1361
- ll(Fe, ["escape"])
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: He
1366
- }, null, 40, vi)), [
1367
- [Lt, ce.value]
1368
- ]) : (o(), r("div", pi, [
1369
- p("span", {
1370
- onDblclick: (y) => Jt(y, l, f),
1371
- innerHTML: ft(l, f)
1372
- }, null, 40, hi),
1373
- Je(f) ? (o(), r("button", {
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: _((y) => Jt(y, l, f), ["stop"]),
1387
+ onClick: S((C) => Jt(C, l, d), ["stop"]),
1377
1388
  title: "Editar inline"
1378
1389
  }, [
1379
- p("span", {
1390
+ h("span", {
1380
1391
  class: "te-btn-icon",
1381
- innerHTML: O($)("pencil")
1382
- }, null, 8, yi)
1383
- ], 8, gi)) : g("", !0)
1392
+ innerHTML: z(j)("pencil")
1393
+ }, null, 8, ki)
1394
+ ], 8, mi)) : y("", !0)
1384
1395
  ])),
1385
- p("div", {
1396
+ h("div", {
1386
1397
  class: "te-resize-handle",
1387
1398
  draggable: "false",
1388
- onPointerdown: _((y) => ye(y, f.field), ["stop"]),
1389
- onDblclick: _((y) => Ee(y, f.field), ["stop"]),
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, mi)
1403
+ }, null, 40, bi)
1393
1404
  ], 6))), 128)),
1394
- t[24] || (t[24] = p("td", { class: "te-td te-td-filler" }, null, -1))
1395
- ], 46, si))), 128)),
1396
- ae.value.length ? g("", !0) : (o(), r("tr", ki, [
1397
- p("td", {
1398
- colspan: hl.value,
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, bi)
1411
+ }, "Sin registros", 8, Ci)
1401
1412
  ]))
1402
1413
  ])
1403
1414
  ], 2)),
1404
- K.value ? (o(), r("div", {
1415
+ Q.value ? (r(), u("div", {
1405
1416
  key: 3,
1406
1417
  ref_key: "sentinelRef",
1407
- ref: nt,
1418
+ ref: at,
1408
1419
  class: "te-sentinel"
1409
1420
  }, [
1410
- Pe.value ? (o(), r("span", _i)) : g("", !0)
1411
- ], 512)) : g("", !0)
1421
+ Ve.value ? (r(), u("span", Si)) : y("", !0)
1422
+ ], 512)) : y("", !0)
1412
1423
  ], 4),
1413
- fe(p("div", Ci, [
1414
- p("span", Si, "Mostrando " + w(ml.value) + " a " + w(kl.value) + " de " + w(ut.value), 1),
1415
- p("div", Mi, [
1416
- p("button", {
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: x.value <= 1,
1419
- onClick: t[12] || (t[12] = (l) => Ge(1))
1420
- }, "««", 8, Ti),
1421
- p("button", {
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: x.value <= 1,
1424
- onClick: t[13] || (t[13] = (l) => Ge(x.value - 1))
1425
- }, "«", 8, Li),
1426
- p("span", wi, w(x.value) + " / " + w(xe.value), 1),
1427
- p("button", {
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: x.value >= xe.value,
1430
- onClick: t[14] || (t[14] = (l) => Ge(x.value + 1))
1431
- }, "»", 8, xi),
1432
- p("button", {
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: x.value >= xe.value,
1435
- onClick: t[15] || (t[15] = (l) => Ge(xe.value))
1436
- }, "»»", 8, Di)
1448
+ disabled: F.value >= De.value,
1449
+ onClick: t[15] || (t[15] = (l) => qe(De.value))
1450
+ }, "»»", 8, Fi)
1437
1451
  ]),
1438
- fe(p("select", {
1439
- "onUpdate:modelValue": t[16] || (t[16] = (l) => N.value = l),
1452
+ pe(h("select", {
1453
+ "onUpdate:modelValue": t[16] || (t[16] = (l) => $.value = l),
1440
1454
  class: "te-select",
1441
- onChange: Cl
1455
+ onChange: Sl
1442
1456
  }, [
1443
- (o(!0), r(C, null, L(Et.value, (l) => (o(), r("option", {
1457
+ (r(!0), u(T, null, D(Ft.value, (l) => (r(), u("option", {
1444
1458
  key: l,
1445
1459
  value: l
1446
- }, w(l), 9, Ei))), 128))
1460
+ }, E(l), 9, Ai))), 128))
1447
1461
  ], 544), [
1448
- [tl, N.value]
1462
+ [ll, $.value]
1449
1463
  ])
1450
- ], 512), [
1451
- [Hl, !K.value && Ft.value]
1464
+ ], 8, Mi), [
1465
+ [zl, !Q.value && At.value]
1452
1466
  ])
1453
1467
  ]);
1454
1468
  };
1455
1469
  }
1456
1470
  };
1457
- function il(u) {
1458
- if (!u || !Array.isArray(u)) return {};
1471
+ function al(o) {
1472
+ if (!o || !Array.isArray(o)) return {};
1459
1473
  const a = {};
1460
- for (const v of u)
1474
+ for (const v of o)
1461
1475
  v.isJson && (a[v.field] = v);
1462
1476
  return a;
1463
1477
  }
1464
- function Ai(u, a) {
1465
- if (!u || !a) return u;
1478
+ function Pi(o, a) {
1479
+ if (!o || !a) return o;
1466
1480
  for (const [v] of Object.entries(a)) {
1467
- const s = u[v];
1481
+ const s = o[v];
1468
1482
  if (typeof s == "string")
1469
1483
  try {
1470
- u[v] = JSON.parse(s);
1484
+ o[v] = JSON.parse(s);
1471
1485
  } catch {
1472
- u[v] = s;
1486
+ o[v] = s;
1473
1487
  }
1474
1488
  }
1475
- return u;
1489
+ return o;
1476
1490
  }
1477
- function Ri(u, a, v) {
1478
- if (!u || !Array.isArray(u) || !a || !v) return u;
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 m = v[s];
1481
- if (m && typeof m == "object" && !Array.isArray(m))
1482
- for (const [M, he] of Object.entries(m))
1483
- typeof he == "object" && he !== null && !Array.isArray(he) || u.push({
1484
- field: `${s}.${M}`,
1485
- headerName: M,
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 u;
1504
+ return o;
1491
1505
  }
1492
- function rl(u, a) {
1493
- if (!u || !a) return u;
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" && (u[v.field] = v.formatter(u[v.field], u));
1496
- return u;
1509
+ v.formatter && typeof v.formatter == "function" && (o[v.field] = v.formatter(o[v.field], o));
1510
+ return o;
1497
1511
  }
1498
- const $i = rl;
1499
- function Pi(u) {
1500
- return !u || !Array.isArray(u) ? [] : u.map((a) => ({
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 Ii(u, a) {
1512
- if (!a || !a.length) return u;
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 m = u.find((M) => M.field === s);
1516
- m && v.push(m);
1529
+ const k = o.find((w) => w.field === s);
1530
+ k && v.push(k);
1517
1531
  }
1518
- for (const s of u)
1519
- v.some((m) => m.field === s.field) || v.push(s);
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 Vi(u) {
1523
- return !u || !Array.isArray(u) ? u : u.map((a) => ({
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 Bi(u = null) {
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 = il(v);
1533
- for (let m = 0; m < a.length; m++) {
1534
- let M = Ai(a[m], s);
1535
- M = rl(M, v), a[m] = sl(M, u);
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 = Ri([...s], il(s), v)), Vi(s);
1556
+ return v && (s = Vi([...s], al(s), v)), Oi(s);
1543
1557
  },
1544
1558
  processColumns(a) {
1545
- return Pi(a);
1559
+ return Hi(a);
1546
1560
  }
1547
1561
  };
1548
1562
  }
1549
1563
  export {
1550
- pe as BtnConfig,
1551
- zi as TableEditor,
1564
+ ge as BtnConfig,
1565
+ Ii as TableEditor,
1552
1566
  Wl as applyFieldDefCss,
1553
- sl as applyRowStyling,
1554
- Hi as availableIcons,
1567
+ ol as applyRowStyling,
1568
+ $i as availableIcons,
1555
1569
  Gl as cellStyle,
1556
- $l as createLocalStoragePrefsAdapter,
1557
- zi as default,
1558
- Ri as getCamposJSONyFieldDef,
1559
- il as getCamposJson,
1560
- Vi as getFieldDefFFormated,
1561
- Il as getGlobalPreferencesAdapter,
1562
- Pi as getProcessFieldDef,
1563
- Bi as greenbornDataPipeline,
1564
- $ as iconSvg,
1565
- jl as invertHexColor,
1566
- Ai as mapFilaJSONtabla,
1567
- Ii as reOrder,
1568
- rl as rowFormatter,
1569
- $i as row_formatter,
1570
- Ni as setGlobalPreferencesAdapter,
1571
- nl as toBtnConfig,
1572
- ol as unwrapCell
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