v-sistec-features 1.23.2 → 1.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- import { defineComponent as Q, useSlots as je, inject as fe, onMounted as he, computed as C, watch as J, resolveComponent as Ae, createElementBlock as l, openBlock as e, createCommentVNode as b, createElementVNode as r, withDirectives as ye, withKeys as Pe, vModelText as ke, Fragment as V, renderList as I, createBlock as N, withCtx as L, createTextVNode as H, toDisplayString as S, normalizeClass as k, withModifiers as _e, ref as $, nextTick as be, resolveDynamicComponent as ee, normalizeProps as me, mergeProps as se, createStaticVNode as Z, Comment as qe, Text as Le, provide as Fe, readonly as Ue, renderSlot as O, Teleport as ge, unref as f, createVNode as W, TransitionGroup as Ke, Transition as Ye, normalizeStyle as Xe } from "vue";
2
- import { D as Ge } from "./datatableConfig-BMFlKtgh.js";
3
- import { _ as re, P as We } from "./Pagination-DtVDFQ07.js";
4
- import Je from "vuedraggable";
5
- const xe = Symbol("v-datatable-key"), pa = /* @__PURE__ */ Q({
1
+ import { defineComponent as Q, useSlots as qe, inject as he, onMounted as ye, computed as C, watch as J, resolveComponent as Le, createElementBlock as n, openBlock as t, createCommentVNode as b, createElementVNode as i, withDirectives as ke, withKeys as Fe, vModelText as be, Fragment as V, renderList as N, createBlock as H, withCtx as F, createTextVNode as O, toDisplayString as $, normalizeClass as k, withModifiers as me, ref as M, nextTick as xe, resolveDynamicComponent as te, normalizeProps as ve, mergeProps as ne, createStaticVNode as ee, Comment as Ue, Text as Ke, provide as Ye, readonly as Xe, renderSlot as j, Teleport as ge, unref as g, createVNode as W, TransitionGroup as Ge, Transition as We, normalizeStyle as Je } from "vue";
2
+ import { D as Qe } from "./datatableConfig-BMFlKtgh.js";
3
+ import { _ as re, P as Re } from "./Pagination-DtVDFQ07.js";
4
+ import Ze from "vuedraggable";
5
+ const we = Symbol("v-datatable-key"), va = /* @__PURE__ */ Q({
6
6
  __name: "VColumn",
7
7
  props: {
8
8
  field: { default: null },
@@ -21,67 +21,73 @@ const xe = Symbol("v-datatable-key"), pa = /* @__PURE__ */ Q({
21
21
  param_ordering: { default: "" },
22
22
  decreasing_value: { default: "" },
23
23
  increasing_value: { default: "" },
24
- class_rules: { default: () => ({}) }
24
+ class_rules: { default: () => ({}) },
25
+ start_hidden: { type: Boolean, default: !1 }
25
26
  },
26
- setup(d) {
27
- const o = d, _ = je(), t = fe(xe);
28
- if (!t)
27
+ setup(u) {
28
+ const f = crypto.randomUUID(), l = u, e = qe(), _ = he(we);
29
+ if (!_)
29
30
  throw new Error("VColumn deve ser usado dentro de um VDataTable.");
30
- const g = ["text", "img", "date", "html"];
31
- return he(() => {
32
- if (o.field !== null && !o.field)
31
+ const c = ["text", "img", "date", "html"];
32
+ return ye(() => {
33
+ if (l.field !== null && !l.field)
33
34
  throw new Error('A propriedade "field" é obrigatória em VColumn.');
34
- if (!o.header)
35
+ if (!l.header)
35
36
  throw new Error('A propriedade "header" é obrigatória em VColumn.');
36
- if (o.field !== null && !g.includes(o.type))
37
- throw new Error(`O tipo "${o.type}" não é suportado em VColumn. Tipos suportados: text, img, date, html.`);
38
- if (o.limite_text) {
39
- if (o.type !== "text")
37
+ if (l.field !== null && !c.includes(l.type))
38
+ throw new Error(`O tipo "${l.type}" não é suportado em VColumn. Tipos suportados: text, img, date, html.`);
39
+ if (l.limite_text) {
40
+ if (l.type !== "text")
40
41
  throw new Error('A propriedade "limite_text" só pode ser usada quando o tipo for "text".');
41
- if (typeof o.limite_text == "string" && isNaN(Number(o.limite_text)))
42
+ if (typeof l.limite_text == "string" && isNaN(Number(l.limite_text)))
42
43
  throw new Error('A propriedade "limite_text" deve ser um número quando for uma string.');
43
- if (isNaN(Number(o.limite_text)) || Number(o.limite_text) <= 0)
44
+ if (isNaN(Number(l.limite_text)) || Number(l.limite_text) <= 0)
44
45
  throw new Error('A propriedade "limite_text" deve ser um número maior que 0.');
45
46
  }
46
- t.addColumn({
47
- field: o.field,
48
- header: o.header,
49
- type: o.type,
50
- class_column: o.class_column,
51
- class_row: o.class_row,
52
- class_item: o.class_item,
53
- click: o.click,
54
- transform_function: o.transform_function,
55
- locked: o.locked,
56
- use_ordering: o.use_ordering,
57
- param_ordering: o.param_ordering,
58
- decreasing_value: o.decreasing_value,
59
- increasing_value: o.increasing_value,
60
- class_rules: o.class_rules,
61
- bodySlot: _.body,
47
+ _.addColumn({
48
+ id: f,
49
+ field: l.field,
50
+ header: l.header,
51
+ type: l.type,
52
+ class_column: l.class_column,
53
+ class_row: l.class_row,
54
+ class_item: l.class_item,
55
+ click: l.click,
56
+ transform_function: l.transform_function,
57
+ locked: l.locked,
58
+ use_ordering: l.use_ordering,
59
+ param_ordering: l.param_ordering,
60
+ decreasing_value: l.decreasing_value,
61
+ increasing_value: l.increasing_value,
62
+ class_rules: l.class_rules,
63
+ bodySlot: e.body,
62
64
  // colHeaderSlot é para o slot do header da coluna, que pode ser usado para colocar ícone de ordenação ou qualquer outra coisa que o usuário queira colocar no header da coluna
63
- colHeaderSlot: _.col_header,
65
+ colHeaderSlot: e.col_header,
64
66
  // colHeaderMidleSlot é para o slot do header da coluna, mas ele fica entre o texto do header e o ícone de ordenação, para o usuário colocar coisas entre eles
65
- colHeaderMidleSlot: _.col_header_midle,
66
- ...o.type === "text" && { limite_text: Number(o.limite_text) },
67
- ...o.type === "img" && { deactivate_img_preview: o.deactivate_img_preview },
68
- ...o.type === "date" && { format: o.format }
67
+ colHeaderMidleSlot: e.col_header_midle,
68
+ ...l.type === "text" && { limite_text: Number(l.limite_text) },
69
+ ...l.type === "img" && { deactivate_img_preview: l.deactivate_img_preview },
70
+ ...l.type === "date" && { format: l.format },
71
+ start_hidden: l.start_hidden,
72
+ // se a coluna é opcional por padrão ela não é visível, mas o usuário pode escolher mostrar ela
73
+ visible: !l.start_hidden
74
+ // Se start_hidden for true, ela não estará visível inicialmente
69
75
  });
70
- }), (c, T) => null;
76
+ }), (B, x) => null;
71
77
  }
72
- }), Qe = { class: "dropdown d-flex" }, Re = {
78
+ }), et = { class: "dropdown d-flex" }, tt = {
73
79
  key: 0,
74
80
  href: "#",
75
81
  class: "btn dropdown-toggle",
76
82
  "data-bs-toggle": "dropdown",
77
83
  title: "Pesquisas Prédefinidas"
78
- }, Ze = { class: "input-icon" }, et = ["placeholder"], tt = {
84
+ }, at = { class: "input-icon" }, lt = ["placeholder"], st = {
79
85
  key: 1,
80
86
  class: "input-icon-addon"
81
- }, at = {
87
+ }, nt = {
82
88
  key: 1,
83
89
  class: "dropdown-menu"
84
- }, lt = ["onClick"], nt = ["onClick"], st = /* @__PURE__ */ Q({
90
+ }, rt = ["onClick"], ot = ["onClick"], it = /* @__PURE__ */ Q({
85
91
  __name: "SearchDatatable",
86
92
  props: {
87
93
  search: {},
@@ -93,42 +99,42 @@ const xe = Symbol("v-datatable-key"), pa = /* @__PURE__ */ Q({
93
99
  deactivate_search_empty: { type: Boolean, default: !1 }
94
100
  },
95
101
  emits: ["update:search", "update:filter", "search", "clickedClearSearch"],
96
- setup(d, { emit: o }) {
97
- const _ = d, t = o, g = C({
98
- get: () => _.search,
99
- set: (s) => t("update:search", s)
102
+ setup(u, { emit: f }) {
103
+ const l = u, e = f, _ = C({
104
+ get: () => l.search,
105
+ set: (o) => e("update:search", o)
100
106
  }), c = C({
101
- get: () => _.filter,
102
- set: (s) => t("update:filter", s)
107
+ get: () => l.filter,
108
+ set: (o) => e("update:filter", o)
103
109
  });
104
110
  J(c, () => {
105
- t("search");
111
+ e("search");
106
112
  }), J(
107
- () => _.list_filter,
108
- (s) => {
109
- Array.isArray(s) ? (s.forEach((a, x) => {
110
- a?.type === 1 && !a.to && console.error(`Filtro na posição ${x} é do tipo 'router-link' mas não possui a propriedade 'to'.`);
111
- }), _.item_use.includes(2) && s.length === 0 && console.error("Nenhum filtro foi passado. Certifique-se de que o array de filtros não está vazio.")) : console.error("list_filter deve ser um array.");
113
+ () => l.list_filter,
114
+ (o) => {
115
+ Array.isArray(o) ? (o.forEach((a, w) => {
116
+ a?.type === 1 && !a.to && console.error(`Filtro na posição ${w} é do tipo 'router-link' mas não possui a propriedade 'to'.`);
117
+ }), l.item_use.includes(2) && o.length === 0 && console.error("Nenhum filtro foi passado. Certifique-se de que o array de filtros não está vazio.")) : console.error("list_filter deve ser um array.");
112
118
  },
113
119
  { immediate: !0, deep: !0 }
114
120
  );
115
- function T(s) {
116
- c.value === s ? c.value = "" : c.value = s;
121
+ function B(o) {
122
+ c.value === o ? c.value = "" : c.value = o;
117
123
  }
118
- function w() {
119
- g.value = "", _.deactivate_search_on_clear || t("search"), t("clickedClearSearch");
124
+ function x() {
125
+ _.value = "", l.deactivate_search_on_clear || e("search"), e("clickedClearSearch");
120
126
  }
121
- function h(s) {
122
- s.click && typeof s.click == "function" ? s.click() : console.error("O filtro selecionado não possui uma função de clique válida.");
127
+ function h(o) {
128
+ o.click && typeof o.click == "function" ? o.click() : console.error("O filtro selecionado não possui uma função de clique válida.");
123
129
  }
124
130
  function v() {
125
- _.deactivate_search_empty && g.value.trim() === "" || t("search");
131
+ l.deactivate_search_empty && _.value.trim() === "" || e("search");
126
132
  }
127
- return (s, a) => {
128
- const x = Ae("router-link");
129
- return e(), l("div", Qe, [
130
- d.item_use.includes(2) ? (e(), l("a", Re, [...a[2] || (a[2] = [
131
- r("svg", {
133
+ return (o, a) => {
134
+ const w = Le("router-link");
135
+ return t(), n("div", et, [
136
+ u.item_use.includes(2) ? (t(), n("a", tt, [...a[2] || (a[2] = [
137
+ i("svg", {
132
138
  xmlns: "http://www.w3.org/2000/svg",
133
139
  class: "icon icon-tabler icon-tabler-filter",
134
140
  width: "24",
@@ -140,32 +146,32 @@ const xe = Symbol("v-datatable-key"), pa = /* @__PURE__ */ Q({
140
146
  "stroke-linecap": "round",
141
147
  "stroke-linejoin": "round"
142
148
  }, [
143
- r("path", {
149
+ i("path", {
144
150
  stroke: "none",
145
151
  d: "M0 0h24v24H0z",
146
152
  fill: "none"
147
153
  }),
148
- r("path", { d: "M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" })
154
+ i("path", { d: "M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z" })
149
155
  ], -1)
150
156
  ])])) : b("", !0),
151
- r("div", Ze, [
152
- ye(r("input", {
157
+ i("div", at, [
158
+ ke(i("input", {
153
159
  type: "text",
154
160
  class: "form-control ms-1",
155
161
  id: "inputSearchVDataTable",
156
- "onUpdate:modelValue": a[0] || (a[0] = (m) => g.value = m),
157
- onKeyup: Pe(v, ["enter"]),
158
- placeholder: d.placeholder_search
159
- }, null, 40, et), [
160
- [ke, g.value]
162
+ "onUpdate:modelValue": a[0] || (a[0] = (m) => _.value = m),
163
+ onKeyup: Fe(v, ["enter"]),
164
+ placeholder: u.placeholder_search
165
+ }, null, 40, lt), [
166
+ [be, _.value]
161
167
  ]),
162
- g.value ? (e(), l("span", {
168
+ _.value ? (t(), n("span", {
163
169
  key: 0,
164
- onClick: a[1] || (a[1] = (m) => w()),
170
+ onClick: a[1] || (a[1] = (m) => x()),
165
171
  class: "inputClose",
166
172
  title: "Limpar pesquisa"
167
173
  }, [...a[3] || (a[3] = [
168
- r("svg", {
174
+ i("svg", {
169
175
  xmlns: "http://www.w3.org/2000/svg",
170
176
  width: "24",
171
177
  height: "24",
@@ -177,16 +183,16 @@ const xe = Symbol("v-datatable-key"), pa = /* @__PURE__ */ Q({
177
183
  "stroke-linejoin": "round",
178
184
  class: "icon icon-tabler icons-tabler-outline icon-tabler-x"
179
185
  }, [
180
- r("path", {
186
+ i("path", {
181
187
  stroke: "none",
182
188
  d: "M0 0h24v24H0z",
183
189
  fill: "none"
184
190
  }),
185
- r("path", { d: "M18 6l-12 12" }),
186
- r("path", { d: "M6 6l12 12" })
191
+ i("path", { d: "M18 6l-12 12" }),
192
+ i("path", { d: "M6 6l12 12" })
187
193
  ], -1)
188
- ])])) : (e(), l("span", tt, [...a[4] || (a[4] = [
189
- r("svg", {
194
+ ])])) : (t(), n("span", st, [...a[4] || (a[4] = [
195
+ i("svg", {
190
196
  xmlns: "http://www.w3.org/2000/svg",
191
197
  width: "24",
192
198
  height: "24",
@@ -198,223 +204,223 @@ const xe = Symbol("v-datatable-key"), pa = /* @__PURE__ */ Q({
198
204
  "stroke-linejoin": "round",
199
205
  class: "icon"
200
206
  }, [
201
- r("path", {
207
+ i("path", {
202
208
  stroke: "none",
203
209
  d: "M0 0h24v24H0z",
204
210
  fill: "none"
205
211
  }),
206
- r("path", { d: "M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" }),
207
- r("path", { d: "M21 21l-6 -6" })
212
+ i("path", { d: "M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" }),
213
+ i("path", { d: "M21 21l-6 -6" })
208
214
  ], -1)
209
215
  ])]))
210
216
  ]),
211
- d.item_use.includes(2) ? (e(), l("div", at, [
212
- (e(!0), l(V, null, I(_.list_filter, (m, B) => (e(), l(V, { key: B }, [
213
- "type" in m && m.type === 1 && (!("visible" in m) || m.visible) ? (e(), N(x, {
217
+ u.item_use.includes(2) ? (t(), n("div", nt, [
218
+ (t(!0), n(V, null, N(l.list_filter, (m, S) => (t(), n(V, { key: S }, [
219
+ "type" in m && m.type === 1 && (!("visible" in m) || m.visible) ? (t(), H(w, {
214
220
  key: 0,
215
221
  to: m?.to,
216
222
  class: "dropdown-item cursor-pointer"
217
223
  }, {
218
- default: L(() => [
219
- H(S(m.text), 1)
224
+ default: F(() => [
225
+ O($(m.text), 1)
220
226
  ]),
221
227
  _: 2
222
- }, 1032, ["to"])) : (!("type" in m) || m.type === 2) && (!("visible" in m) || m.visible) ? (e(), l("a", {
228
+ }, 1032, ["to"])) : (!("type" in m) || m.type === 2) && (!("visible" in m) || m.visible) ? (t(), n("a", {
223
229
  key: 1,
224
- onClick: _e((M) => T(String(m.value)), ["prevent"]),
230
+ onClick: me((z) => B(String(m.value)), ["prevent"]),
225
231
  class: k(["dropdown-item cursor-pointer", c.value === m?.value ? "bg-info text-dark selected" : ""])
226
- }, S(m.text), 11, lt)) : (!("type" in m) || m.type === 3) && (!("visible" in m) || m.visible) ? (e(), l("a", {
232
+ }, $(m.text), 11, rt)) : (!("type" in m) || m.type === 3) && (!("visible" in m) || m.visible) ? (t(), n("a", {
227
233
  key: 2,
228
- onClick: _e((M) => h(m), ["prevent"]),
234
+ onClick: me((z) => h(m), ["prevent"]),
229
235
  class: k(["dropdown-item cursor-pointer", m?.active ? "bg-info text-dark selected" : ""])
230
- }, S(m.text), 11, nt)) : b("", !0)
236
+ }, $(m.text), 11, ot)) : b("", !0)
231
237
  ], 64))), 128))
232
238
  ])) : b("", !0)
233
239
  ]);
234
240
  };
235
241
  }
236
- }), rt = /* @__PURE__ */ re(st, [["__scopeId", "data-v-ed591287"]]);
237
- function ot() {
238
- const d = $(!1), o = $(""), _ = $(0), t = $(0), g = C(() => ({
242
+ }), dt = /* @__PURE__ */ re(it, [["__scopeId", "data-v-ed591287"]]);
243
+ function ut() {
244
+ const u = M(!1), f = M(""), l = M(0), e = M(0), _ = C(() => ({
239
245
  position: "fixed",
240
246
  zIndex: 9999,
241
247
  pointerEvents: "none",
242
- top: `${t.value + 15}px`,
243
- left: `${_.value + 15}px`
248
+ top: `${e.value + 15}px`,
249
+ left: `${l.value + 15}px`
244
250
  }));
245
251
  function c(v) {
246
- const s = v.clientX, a = v.clientY, x = window.innerHeight, m = 15, B = 300;
247
- let M = a + m;
248
- M + B > x && (M = a - B - m, M < 0 && (M = 0)), _.value = s, t.value = M;
252
+ const o = v.clientX, a = v.clientY, w = window.innerHeight, m = 15, S = 300;
253
+ let z = a + m;
254
+ z + S > w && (z = a - S - m, z < 0 && (z = 0)), l.value = o, e.value = z;
249
255
  }
250
- function T(v, s) {
251
- d.value = !0, o.value = s, c(v);
256
+ function B(v, o) {
257
+ u.value = !0, f.value = o, c(v);
252
258
  }
253
- function w(v) {
254
- d.value && c(v);
259
+ function x(v) {
260
+ u.value && c(v);
255
261
  }
256
262
  function h() {
257
- d.value = !1;
263
+ u.value = !1;
258
264
  }
259
265
  return {
260
- isHovering: d,
261
- previewSrc: o,
262
- previewStyle: g,
263
- handleMouseOver: T,
264
- handleMouseMove: w,
266
+ isHovering: u,
267
+ previewSrc: f,
268
+ previewStyle: _,
269
+ handleMouseOver: B,
270
+ handleMouseMove: x,
265
271
  handleMouseLeave: h
266
272
  };
267
273
  }
268
- function it(d, o, _, t) {
269
- const g = $([]);
274
+ function ct(u, f, l, e) {
275
+ const _ = M([]);
270
276
  function c() {
271
- g.value = [];
277
+ _.value = [];
272
278
  }
273
- function T(v) {
274
- const s = v[o];
275
- return g.value.some((a) => a === s);
279
+ function B(v) {
280
+ const o = v[f];
281
+ return _.value.some((a) => a === o);
276
282
  }
277
- function w(v) {
278
- const s = v[o], a = g.value.findIndex((m) => m === s), x = a > -1;
279
- d ? (c(), x || (g.value.push(s), t && h(s))) : x ? g.value.splice(a, 1) : (g.value.push(s), t && h(s));
283
+ function x(v) {
284
+ const o = v[f], a = _.value.findIndex((m) => m === o), w = a > -1;
285
+ u ? (c(), w || (_.value.push(o), e && h(o))) : w ? _.value.splice(a, 1) : (_.value.push(o), e && h(o));
280
286
  }
281
287
  function h(v) {
282
- be(() => {
283
- if (_) {
284
- const s = document.querySelector("#expand-item-" + v);
285
- s && s.scrollIntoView({ behavior: "smooth", block: "center" });
288
+ xe(() => {
289
+ if (l) {
290
+ const o = document.querySelector("#expand-item-" + v);
291
+ o && o.scrollIntoView({ behavior: "smooth", block: "center" });
286
292
  return;
287
293
  } else
288
294
  setTimeout(() => {
289
- const s = document.querySelector("#expand-item-" + v);
290
- s && s.scrollIntoView({ behavior: "smooth", block: "center" });
295
+ const o = document.querySelector("#expand-item-" + v);
296
+ o && o.scrollIntoView({ behavior: "smooth", block: "center" });
291
297
  }, 600);
292
298
  });
293
299
  }
294
300
  return {
295
- expanded_items: g,
296
- is_item_expanded: T,
297
- expand_item_toggle: w,
301
+ expanded_items: _,
302
+ is_item_expanded: B,
303
+ expand_item_toggle: x,
298
304
  close_all_expanded_items: c
299
305
  };
300
306
  }
301
- function dt(d, o, _, t, g, c) {
302
- const T = $([]), w = C(() => (o.value.current_page = d.page_starts_at, d.endpoint)), h = C(() => ({
303
- [d.page_param_name]: o.value.current_page + 1,
304
- [d.page_size_param_name]: o.value.limit_per_page,
305
- [d.search_param_name]: o.value.search || "",
306
- [d.filter_param_name]: o.value.filter || ""
307
+ function pt(u, f, l, e, _, c) {
308
+ const B = M([]), x = C(() => (f.value.current_page = u.page_starts_at, u.endpoint)), h = C(() => ({
309
+ [u.page_param_name]: f.value.current_page + 1,
310
+ [u.page_size_param_name]: f.value.limit_per_page,
311
+ [u.search_param_name]: f.value.search || "",
312
+ [u.filter_param_name]: f.value.filter || ""
307
313
  })), v = C(() => {
308
314
  const D = {};
309
- for (const z of _.value)
310
- z.use_ordering && (t.value[z.header] === "increasing" ? D[z.param_ordering] = z.increasing_value || "increasing" : t.value[z.header] === "decreasing" && (D[z.param_ordering] = z.decreasing_value || "decreasing"));
315
+ for (const T of l.value)
316
+ T.use_ordering && (e.value[T.id] === "increasing" ? D[T.param_ordering] = T.increasing_value || "increasing" : e.value[T.id] === "decreasing" && (D[T.param_ordering] = T.decreasing_value || "decreasing"));
311
317
  return D;
312
- }), { data: s, pending: a, error: x, execute: m, attempt: B } = d.fetch(w, {
313
- disable_request: () => d.disable_request,
318
+ }), { data: o, pending: a, error: w, execute: m, attempt: S } = u.fetch(x, {
319
+ disable_request: () => u.disable_request,
314
320
  params: () => {
315
- const D = typeof d.add_params == "function";
316
- let z = {};
321
+ const D = typeof u.add_params == "function";
322
+ let T = {};
317
323
  if (D) {
318
- const te = d.add_params;
319
- z = te();
324
+ const ae = u.add_params;
325
+ T = ae();
320
326
  } else
321
- z = d.add_params || {};
322
- return d.deactivate_default_params ? {
323
- ...z,
327
+ T = u.add_params || {};
328
+ return u.deactivate_default_params ? {
329
+ ...T,
324
330
  ...v.value
325
331
  } : {
326
332
  ...h.value,
327
- ...d.add_params,
333
+ ...u.add_params,
328
334
  ...v.value
329
335
  };
330
336
  },
331
- retry: d.retry_attempts,
332
- retryDelay: d.retry_delay,
337
+ retry: u.retry_attempts,
338
+ retryDelay: u.retry_delay,
333
339
  paramsReactives: !1,
334
340
  immediate: !1
335
- }, d.fetch_name), M = $(!1), A = $(null), y = $(!1), F = C(() => a.value || M.value);
336
- async function U() {
337
- y.value || (y.value = !0), A.value && clearTimeout(A.value), M.value = !0, A.value = setTimeout(() => {
338
- M.value = !1;
339
- }, d.min_loading_delay), c(), g("beforeFetch"), await m(), g("afterFetch");
341
+ }, u.fetch_name), z = M(!1), P = M(null), y = M(!1), U = C(() => a.value || z.value);
342
+ async function K() {
343
+ y.value || (y.value = !0), P.value && clearTimeout(P.value), z.value = !0, P.value = setTimeout(() => {
344
+ z.value = !1;
345
+ }, u.min_loading_delay), c(), _("beforeFetch"), await m(), _("afterFetch");
340
346
  }
341
- function K() {
342
- o.value.current_page = d.page_starts_at, U();
347
+ function Y() {
348
+ f.value.current_page = u.page_starts_at, K();
343
349
  }
344
350
  return {
345
- items: T,
351
+ items: B,
346
352
  pending: a,
347
- error: x,
353
+ error: w,
348
354
  execute: m,
349
- response: s,
350
- attempt: B,
355
+ response: o,
356
+ attempt: S,
351
357
  default_params: h,
352
- fetchDataWithDelay: U,
353
- reSearch: K,
354
- showLoadingState: F,
358
+ fetchDataWithDelay: K,
359
+ reSearch: Y,
360
+ showLoadingState: U,
355
361
  first_fetch: y
356
362
  };
357
363
  }
358
- function ut(d, o) {
359
- const _ = $(null), t = $([]), g = (v) => {
360
- const s = d.item_key;
361
- return t.value.some((a) => a[s] === v[s]);
364
+ function _t(u, f) {
365
+ const l = M(null), e = M([]), _ = (v) => {
366
+ const o = u.item_key;
367
+ return e.value.some((a) => a[o] === v[o]);
362
368
  }, c = C(() => {
363
- if (!o.value.length) return !1;
364
- const v = o.value.filter((s) => g(s)).length;
365
- return v === 0 ? !1 : v === o.value.length ? !0 : "indeterminate";
366
- }), T = C(() => t.value.length > 0);
367
- J([c, _], ([v]) => {
368
- _.value && (v === "indeterminate" ? (_.value.checked = !1, _.value.indeterminate = !0) : (_.value.checked = v, _.value.indeterminate = !1));
369
+ if (!f.value.length) return !1;
370
+ const v = f.value.filter((o) => _(o)).length;
371
+ return v === 0 ? !1 : v === f.value.length ? !0 : "indeterminate";
372
+ }), B = C(() => e.value.length > 0);
373
+ J([c, l], ([v]) => {
374
+ l.value && (v === "indeterminate" ? (l.value.checked = !1, l.value.indeterminate = !0) : (l.value.checked = v, l.value.indeterminate = !1));
369
375
  }, {
370
376
  immediate: !0,
371
377
  flush: "post"
372
378
  });
373
- function w() {
374
- const v = o.value;
379
+ function x() {
380
+ const v = f.value;
375
381
  if (!v.length) return;
376
- const s = c.value;
377
- if (s === !0 || s === "indeterminate") {
378
- const a = v.map((x) => x[d.item_key]);
379
- t.value = t.value.filter(
380
- (x) => !a.includes(x[d.item_key])
382
+ const o = c.value;
383
+ if (o === !0 || o === "indeterminate") {
384
+ const a = v.map((w) => w[u.item_key]);
385
+ e.value = e.value.filter(
386
+ (w) => !a.includes(w[u.item_key])
381
387
  );
382
388
  } else
383
389
  v.forEach((a) => {
384
- g(a) || t.value.push(a);
390
+ _(a) || e.value.push(a);
385
391
  });
386
392
  }
387
393
  function h(v) {
388
- const s = d.item_key, a = t.value.findIndex((x) => x[s] === v[s]);
389
- a > -1 ? t.value.splice(a, 1) : t.value.push(v);
394
+ const o = u.item_key, a = e.value.findIndex((w) => w[o] === v[o]);
395
+ a > -1 ? e.value.splice(a, 1) : e.value.push(v);
390
396
  }
391
397
  return {
392
- selectAllCheckbox: _,
393
- selected_items: t,
394
- isSelected: g,
398
+ selectAllCheckbox: l,
399
+ selected_items: e,
400
+ isSelected: _,
395
401
  selectAllState: c,
396
- atLeastOneSelected: T,
397
- toggleSelectAll: w,
402
+ atLeastOneSelected: B,
403
+ toggleSelectAll: x,
398
404
  toggleItemSelection: h
399
405
  };
400
406
  }
401
- const ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt = {
407
+ const mt = { class: "loading-container" }, vt = { key: 0 }, gt = { key: 2 }, ft = {
402
408
  key: 5,
403
409
  class: "text-danger erro-custom-container"
404
- }, gt = { class: "badge bg-orange text-white erro-custom-text" }, vt = { key: 0 }, ft = { key: 2 }, ht = {
410
+ }, ht = { class: "badge bg-orange text-white erro-custom-text" }, yt = { key: 0 }, kt = { key: 2 }, bt = {
405
411
  key: 5,
406
412
  class: "text-danger erro-custom-container"
407
- }, yt = { class: "badge bg-orange text-white erro-custom-text" }, kt = ["colspan"], bt = {
413
+ }, xt = { class: "badge bg-orange text-white erro-custom-text" }, wt = ["colspan"], St = {
408
414
  key: 0,
409
415
  class: "d-flex flex-column justify-content-center align-items-center",
410
416
  style: { height: "6rem" }
411
- }, xt = {
417
+ }, Ct = {
412
418
  key: 1,
413
419
  style: { height: "3rem" }
414
- }, wt = {
420
+ }, $t = {
415
421
  key: 2,
416
422
  class: "p-3 text-center text-secondary"
417
- }, St = /* @__PURE__ */ Q({
423
+ }, Mt = /* @__PURE__ */ Q({
418
424
  __name: "VDataTableLoading",
419
425
  props: {
420
426
  columns: {},
@@ -425,131 +431,131 @@ const ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
425
431
  attempt: {},
426
432
  pagination: {}
427
433
  },
428
- setup(d) {
429
- const o = d;
430
- return (_, t) => (e(), l("div", ct, [
431
- o.custom_loading ? (e(), N(ee(o.custom_loading), { key: 0 })) : (e(), l("table", {
434
+ setup(u) {
435
+ const f = u;
436
+ return (l, e) => (t(), n("div", mt, [
437
+ f.custom_loading ? (t(), H(te(f.custom_loading), { key: 0 })) : (t(), n("table", {
432
438
  key: 1,
433
- class: k(["table table-vcenter table-selectable", o.class_table])
439
+ class: k(["table table-vcenter table-selectable", f.class_table])
434
440
  }, [
435
- r("thead", null, [
436
- r("tr", null, [
437
- (e(!0), l(V, null, I(d.columns, (g) => (e(), l("th", {
438
- key: g.field || g.header,
439
- class: k(g.class_column)
440
- }, S(g.header), 3))), 128))
441
+ i("thead", null, [
442
+ i("tr", null, [
443
+ (t(!0), n(V, null, N(u.columns, (_) => (t(), n("th", {
444
+ key: _.field || _.header,
445
+ class: k(_.class_column)
446
+ }, $(_.header), 3))), 128))
441
447
  ])
442
448
  ]),
443
- r("tbody", null, [
444
- o.type_loading === "placeholder" ? (e(!0), l(V, { key: 0 }, I(d.pagination.limit_per_page, (g) => (e(), l("tr", {
445
- key: "placeholder-" + g,
449
+ i("tbody", null, [
450
+ f.type_loading === "placeholder" ? (t(!0), n(V, { key: 0 }, N(u.pagination.limit_per_page, (_) => (t(), n("tr", {
451
+ key: "placeholder-" + _,
446
452
  class: "placeholder-glow"
447
453
  }, [
448
- (e(!0), l(V, null, I(d.columns, (c) => (e(), l("td", {
454
+ (t(!0), n(V, null, N(u.columns, (c) => (t(), n("td", {
449
455
  key: c.field || c.header,
450
456
  class: k(c.class_row)
451
457
  }, [
452
- c.bodySlot ? (e(), l("span", pt, [...t[0] || (t[0] = [
453
- r("span", { class: "placeholder col-8" }, null, -1)
454
- ])])) : c.type === "text" ? (e(), l("span", {
458
+ c.bodySlot ? (t(), n("span", vt, [...e[0] || (e[0] = [
459
+ i("span", { class: "placeholder col-8" }, null, -1)
460
+ ])])) : c.type === "text" ? (t(), n("span", {
455
461
  key: 1,
456
462
  class: k(c.class_item)
457
- }, [...t[1] || (t[1] = [
458
- r("span", { class: "placeholder col-8" }, null, -1)
459
- ])], 2)) : c.type === "date" ? (e(), l("span", _t, [...t[2] || (t[2] = [
460
- r("span", { class: "placeholder col-9" }, null, -1)
461
- ])])) : c.type === "html" ? (e(), l("div", {
463
+ }, [...e[1] || (e[1] = [
464
+ i("span", { class: "placeholder col-8" }, null, -1)
465
+ ])], 2)) : c.type === "date" ? (t(), n("span", gt, [...e[2] || (e[2] = [
466
+ i("span", { class: "placeholder col-9" }, null, -1)
467
+ ])])) : c.type === "html" ? (t(), n("div", {
462
468
  key: 3,
463
469
  class: k(c.class_item)
464
- }, [...t[3] || (t[3] = [
465
- r("div", { class: "placeholder col-12" }, null, -1)
466
- ])], 2)) : c.type === "img" ? (e(), l("div", {
470
+ }, [...e[3] || (e[3] = [
471
+ i("div", { class: "placeholder col-12" }, null, -1)
472
+ ])], 2)) : c.type === "img" ? (t(), n("div", {
467
473
  key: 4,
468
474
  class: k(c.class_item)
469
- }, [...t[4] || (t[4] = [
470
- r("div", { class: "placeholder placeholder-img" }, null, -1)
471
- ])], 2)) : (e(), l("span", mt, [
472
- t[5] || (t[5] = H("tipo ", -1)),
473
- r("span", gt, S(c.type), 1),
474
- t[6] || (t[6] = H(" não suportado ", -1))
475
+ }, [...e[4] || (e[4] = [
476
+ i("div", { class: "placeholder placeholder-img" }, null, -1)
477
+ ])], 2)) : (t(), n("span", ft, [
478
+ e[5] || (e[5] = O("tipo ", -1)),
479
+ i("span", ht, $(c.type), 1),
480
+ e[6] || (e[6] = O(" não suportado ", -1))
475
481
  ]))
476
482
  ], 2))), 128))
477
- ]))), 128)) : o.type_loading === "spiner-table" ? (e(!0), l(V, { key: 1 }, I(d.pagination.limit_per_page, (g) => (e(), l("tr", {
478
- key: "placeholder-" + g
483
+ ]))), 128)) : f.type_loading === "spiner-table" ? (t(!0), n(V, { key: 1 }, N(u.pagination.limit_per_page, (_) => (t(), n("tr", {
484
+ key: "placeholder-" + _
479
485
  }, [
480
- (e(!0), l(V, null, I(d.columns, (c) => (e(), l("td", {
486
+ (t(!0), n(V, null, N(u.columns, (c) => (t(), n("td", {
481
487
  key: c.field || c.header,
482
488
  class: k(c.class_row)
483
489
  }, [
484
- c.bodySlot ? (e(), l("span", vt, [...t[7] || (t[7] = [
485
- r("span", {
490
+ c.bodySlot ? (t(), n("span", yt, [...e[7] || (e[7] = [
491
+ i("span", {
486
492
  class: "spinner-border spinner-border-sm",
487
493
  role: "status",
488
494
  "aria-hidden": "true"
489
495
  }, null, -1)
490
- ])])) : c.type === "text" ? (e(), l("span", {
496
+ ])])) : c.type === "text" ? (t(), n("span", {
491
497
  key: 1,
492
498
  class: k(c.class_item)
493
- }, [...t[8] || (t[8] = [
494
- r("span", {
499
+ }, [...e[8] || (e[8] = [
500
+ i("span", {
495
501
  class: "spinner-border spinner-border-sm",
496
502
  role: "status",
497
503
  "aria-hidden": "true"
498
504
  }, null, -1)
499
- ])], 2)) : c.type === "date" ? (e(), l("span", ft, [...t[9] || (t[9] = [
500
- r("span", {
505
+ ])], 2)) : c.type === "date" ? (t(), n("span", kt, [...e[9] || (e[9] = [
506
+ i("span", {
501
507
  class: "spinner-border spinner-border-sm",
502
508
  role: "status",
503
509
  "aria-hidden": "true"
504
510
  }, null, -1)
505
- ])])) : c.type === "html" ? (e(), l("div", {
511
+ ])])) : c.type === "html" ? (t(), n("div", {
506
512
  key: 3,
507
513
  class: k(c.class_item)
508
- }, [...t[10] || (t[10] = [
509
- r("span", {
514
+ }, [...e[10] || (e[10] = [
515
+ i("span", {
510
516
  class: "spinner-border spinner-border-sm",
511
517
  role: "status",
512
518
  "aria-hidden": "true"
513
519
  }, null, -1)
514
- ])], 2)) : c.type === "img" ? (e(), l("div", {
520
+ ])], 2)) : c.type === "img" ? (t(), n("div", {
515
521
  key: 4,
516
522
  class: k(["", c.class_item])
517
- }, [...t[11] || (t[11] = [
518
- r("span", { class: "placeholder-img d-flex justify-content-center align-items-center" }, [
519
- r("span", {
523
+ }, [...e[11] || (e[11] = [
524
+ i("span", { class: "placeholder-img d-flex justify-content-center align-items-center" }, [
525
+ i("span", {
520
526
  class: "spinner-border spinner-border-sm",
521
527
  role: "status",
522
528
  "aria-hidden": "true"
523
529
  })
524
530
  ], -1)
525
- ])], 2)) : (e(), l("span", ht, [
526
- t[12] || (t[12] = H("tipo ", -1)),
527
- r("span", yt, S(c.type), 1),
528
- t[13] || (t[13] = H(" não suportado ", -1))
531
+ ])], 2)) : (t(), n("span", bt, [
532
+ e[12] || (e[12] = O("tipo ", -1)),
533
+ i("span", xt, $(c.type), 1),
534
+ e[13] || (e[13] = O(" não suportado ", -1))
529
535
  ]))
530
536
  ], 2))), 128))
531
- ]))), 128)) : o.type_loading === "spiner" ? (e(!0), l(V, { key: 2 }, I(d.pagination.limit_per_page, (g) => (e(), l("tr", { key: g }, [
532
- r("td", {
533
- colspan: d.columns.length,
537
+ ]))), 128)) : f.type_loading === "spiner" ? (t(!0), n(V, { key: 2 }, N(u.pagination.limit_per_page, (_) => (t(), n("tr", { key: _ }, [
538
+ i("td", {
539
+ colspan: u.columns.length,
534
540
  class: "text-center p-0",
535
541
  style: { "border-bottom": "none" }
536
542
  }, [
537
- g === Math.floor(d.pagination.limit_per_page / 2) + 1 ? (e(), l("div", bt, [...t[14] || (t[14] = [
538
- r("div", {
543
+ _ === Math.floor(u.pagination.limit_per_page / 2) + 1 ? (t(), n("div", St, [...e[14] || (e[14] = [
544
+ i("div", {
539
545
  class: "spinner-border",
540
546
  style: { width: "3rem", height: "3rem" },
541
547
  role: "status"
542
548
  }, null, -1),
543
- r("span", { class: "mt-2" }, "Carregando...", -1)
544
- ])])) : (e(), l("div", xt))
545
- ], 8, kt)
549
+ i("span", { class: "mt-2" }, "Carregando...", -1)
550
+ ])])) : (t(), n("div", Ct))
551
+ ], 8, wt)
546
552
  ]))), 128)) : b("", !0)
547
553
  ])
548
554
  ], 2)),
549
- d.attempt && d.attempt.current > 1 ? (e(), l("div", wt, " A conexão falhou. Tentando novamente... (Tentativa " + S(d.attempt.current) + " de " + S(d.attempt.total) + ") ", 1)) : b("", !0)
555
+ u.attempt && u.attempt.current > 1 ? (t(), n("div", $t, " A conexão falhou. Tentando novamente... (Tentativa " + $(u.attempt.current) + " de " + $(u.attempt.total) + ") ", 1)) : b("", !0)
550
556
  ]));
551
557
  }
552
- }), Ct = /* @__PURE__ */ re(St, [["__scopeId", "data-v-3b019685"]]), $t = {
558
+ }), zt = /* @__PURE__ */ re(Mt, [["__scopeId", "data-v-3b019685"]]), Tt = {
553
559
  key: 0,
554
560
  xmlns: "http://www.w3.org/2000/svg",
555
561
  width: "16",
@@ -560,7 +566,7 @@ const ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
560
566
  "stroke-width": "2",
561
567
  "stroke-linecap": "round",
562
568
  "stroke-linejoin": "round"
563
- }, Mt = {
569
+ }, Bt = {
564
570
  key: 1,
565
571
  xmlns: "http://www.w3.org/2000/svg",
566
572
  width: "16",
@@ -571,7 +577,7 @@ const ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
571
577
  "stroke-width": "2",
572
578
  "stroke-linecap": "round",
573
579
  "stroke-linejoin": "round"
574
- }, zt = {
580
+ }, Vt = {
575
581
  key: 2,
576
582
  xmlns: "http://www.w3.org/2000/svg",
577
583
  width: "16",
@@ -582,7 +588,7 @@ const ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
582
588
  "stroke-width": "2",
583
589
  "stroke-linecap": "round",
584
590
  "stroke-linejoin": "round"
585
- }, ve = /* @__PURE__ */ Q({
591
+ }, fe = /* @__PURE__ */ Q({
586
592
  __name: "VThDataTable",
587
593
  props: {
588
594
  header: {},
@@ -593,65 +599,65 @@ const ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
593
599
  col: {}
594
600
  },
595
601
  emits: ["toggleOrderingState"],
596
- setup(d, { emit: o }) {
597
- const _ = d, t = C(() => ({
598
- "header-draggable": !_.locked,
599
- "header-locked": _.locked,
600
- [_.class_column]: !0
601
- })), g = o, c = (w) => !w || w.length === 0 ? !0 : w.every((h) => h.type === qe || h.type === Le && typeof h.children == "string" && !h.children.trim() ? !0 : h.type === V || h.type === Symbol.for("v-fgt") || String(h.type) === "Symbol(Fragment)" ? c(h.children) : !1), T = C(() => {
602
- if (!_.col || !_.col.colHeaderSlot) return !1;
603
- const w = _.col.colHeaderSlot({ col: _.col, locked: _.locked });
604
- return !c(w);
602
+ setup(u, { emit: f }) {
603
+ const l = u, e = C(() => ({
604
+ "header-draggable": !l.locked,
605
+ "header-locked": l.locked,
606
+ [l.class_column]: !0
607
+ })), _ = f, c = (x) => !x || x.length === 0 ? !0 : x.every((h) => h.type === Ue || h.type === Ke && typeof h.children == "string" && !h.children.trim() ? !0 : h.type === V || h.type === Symbol.for("v-fgt") || String(h.type) === "Symbol(Fragment)" ? c(h.children) : !1), B = C(() => {
608
+ if (!l.col || !l.col.colHeaderSlot) return !1;
609
+ const x = l.col.colHeaderSlot({ col: l.col, locked: l.locked });
610
+ return !c(x);
605
611
  });
606
- return (w, h) => (e(), l("th", {
607
- class: k(t.value)
612
+ return (x, h) => (t(), n("th", {
613
+ class: k(e.value)
608
614
  }, [
609
- r("div", {
610
- class: k({ "header-ordering": d.use_ordering })
615
+ i("div", {
616
+ class: k({ "header-ordering": u.use_ordering })
611
617
  }, [
612
- T.value ? (e(), N(ee(d.col.colHeaderSlot), me(se({ key: 0 }, { col: _.col, locked: _.locked })), null, 16)) : (e(), l(V, { key: 1 }, [
613
- r("span", null, S(_.header), 1),
614
- d.col.colHeaderMidleSlot ? (e(), N(ee(d.col.colHeaderMidleSlot), me(se({ key: 0 }, { col: _.col, locked: _.locked })), null, 16)) : b("", !0),
615
- d.use_ordering ? (e(), l("span", {
618
+ B.value ? (t(), H(te(u.col.colHeaderSlot), ve(ne({ key: 0 }, { col: l.col, locked: l.locked })), null, 16)) : (t(), n(V, { key: 1 }, [
619
+ i("span", null, $(l.header), 1),
620
+ u.col.colHeaderMidleSlot ? (t(), H(te(u.col.colHeaderMidleSlot), ve(ne({ key: 0 }, { col: l.col, locked: l.locked })), null, 16)) : b("", !0),
621
+ u.use_ordering ? (t(), n("span", {
616
622
  key: 1,
617
- onClick: h[0] || (h[0] = (v) => g("toggleOrderingState")),
623
+ onClick: h[0] || (h[0] = (v) => _("toggleOrderingState")),
618
624
  class: "ms-2 cursor-pointer"
619
625
  }, [
620
- !_.orderings_state || _.orderings_state === "none" ? (e(), l("svg", $t, [...h[1] || (h[1] = [
621
- Z('<path d="m3 8 4-4 4 4"></path><path d="m11 16-4 4-4-4"></path><path d="M7 4v16"></path><path d="M15 8h6"></path><path d="M15 16h6"></path><path d="M13 12h8"></path>', 6)
622
- ])])) : _.orderings_state === "decreasing" ? (e(), l("svg", Mt, [...h[2] || (h[2] = [
623
- Z('<path d="m3 16 4 4 4-4"></path><path d="M7 20V4"></path><path d="M11 4h10"></path><path d="M11 8h7"></path><path d="M11 12h4"></path>', 5)
624
- ])])) : _.orderings_state === "increasing" ? (e(), l("svg", zt, [...h[3] || (h[3] = [
625
- Z('<path d="m3 8 4-4 4 4"></path><path d="M7 4v16"></path><path d="M11 12h4"></path><path d="M11 16h7"></path><path d="M11 20h10"></path>', 5)
626
+ !l.orderings_state || l.orderings_state === "none" ? (t(), n("svg", Tt, [...h[1] || (h[1] = [
627
+ ee('<path d="m3 8 4-4 4 4"></path><path d="m11 16-4 4-4-4"></path><path d="M7 4v16"></path><path d="M15 8h6"></path><path d="M15 16h6"></path><path d="M13 12h8"></path>', 6)
628
+ ])])) : l.orderings_state === "decreasing" ? (t(), n("svg", Bt, [...h[2] || (h[2] = [
629
+ ee('<path d="m3 16 4 4 4-4"></path><path d="M7 20V4"></path><path d="M11 4h10"></path><path d="M11 8h7"></path><path d="M11 12h4"></path>', 5)
630
+ ])])) : l.orderings_state === "increasing" ? (t(), n("svg", Vt, [...h[3] || (h[3] = [
631
+ ee('<path d="m3 8 4-4 4 4"></path><path d="M7 4v16"></path><path d="M11 12h4"></path><path d="M11 16h7"></path><path d="M11 20h10"></path>', 5)
626
632
  ])])) : b("", !0)
627
633
  ])) : b("", !0)
628
634
  ], 64))
629
635
  ], 2)
630
636
  ], 2));
631
637
  }
632
- }), Tt = { class: "mx-2 d-inline-block" }, Bt = {
638
+ }), Dt = { class: "mx-2 d-inline-block" }, Et = {
633
639
  key: 0,
634
640
  class: "alert alert-cyan d-flex justify-content-center align-items-center py-2",
635
641
  role: "alert"
636
- }, Vt = { class: "alert-title m-0" }, Dt = { class: "badge bg-azure text-azure-fg" }, Et = {
642
+ }, It = { class: "alert-title m-0" }, Nt = { class: "badge bg-azure text-azure-fg" }, Ht = {
637
643
  key: 1,
638
644
  class: "feedback-container text-center"
639
- }, It = {
645
+ }, Ot = {
640
646
  key: 0,
641
647
  class: "text-secondary"
642
- }, Nt = {
648
+ }, jt = {
643
649
  key: 1,
644
650
  class: "text-secondary"
645
- }, Ht = {
651
+ }, At = {
646
652
  key: 2,
647
653
  class: "table-responsive"
648
- }, Ot = { key: 0 }, jt = { key: 0 }, At = {
654
+ }, Pt = { key: 0 }, qt = { key: 0 }, Lt = {
649
655
  key: 1,
650
656
  class: "w-1"
651
- }, Pt = {
657
+ }, Ft = {
652
658
  key: 0,
653
659
  class: "w-1"
654
- }, qt = ["onClick"], Lt = {
660
+ }, Ut = ["onClick"], Kt = {
655
661
  key: 0,
656
662
  xmlns: "http://www.w3.org/2000/svg",
657
663
  width: "24",
@@ -663,7 +669,7 @@ const ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
663
669
  "stroke-linecap": "round",
664
670
  "stroke-linejoin": "round",
665
671
  class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-right icon-transition-arrow"
666
- }, Ft = {
672
+ }, Yt = {
667
673
  key: 1,
668
674
  xmlns: "http://www.w3.org/2000/svg",
669
675
  width: "20",
@@ -675,16 +681,16 @@ const ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
675
681
  "stroke-linecap": "round",
676
682
  "stroke-linejoin": "round",
677
683
  class: "icon icon-transition-plus"
678
- }, Ut = {
684
+ }, Xt = {
679
685
  key: 1,
680
686
  class: "w-1"
681
- }, Kt = ["checked", "onChange"], Yt = ["onClick"], Xt = ["onClick"], Gt = { key: 0 }, Wt = { key: 1 }, Jt = ["onClick", "innerHTML"], Qt = ["onClick"], Rt = ["src"], Zt = ["src"], ea = {
687
+ }, Gt = ["checked", "onChange"], Wt = ["onClick"], Jt = ["onClick"], Qt = { key: 0 }, Rt = { key: 1 }, Zt = ["onClick", "innerHTML"], ea = ["onClick"], ta = ["src"], aa = ["src"], la = {
682
688
  key: 5,
683
689
  class: "text-danger erro-custom-container"
684
- }, ta = { class: "badge bg-orange text-white erro-custom-text" }, aa = ["id"], la = ["colspan"], na = { key: 1 }, sa = {
690
+ }, sa = { class: "badge bg-orange text-white erro-custom-text" }, na = ["id"], ra = ["colspan"], oa = { key: 1 }, ia = {
685
691
  key: 2,
686
692
  class: "text-center p-4 text-secondary"
687
- }, ra = ["src"], oa = /* @__PURE__ */ Q({
693
+ }, da = ["src"], ua = /* @__PURE__ */ Q({
688
694
  __name: "VDataTable",
689
695
  props: {
690
696
  fetch: {},
@@ -730,49 +736,51 @@ const ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
730
736
  disable_search: { type: Boolean, default: !1 },
731
737
  disable_request: { default: !1 },
732
738
  pagination_teleport: { default: null },
733
- search_teleport: { default: null }
739
+ search_teleport: { default: null },
740
+ show_header_when_empty: { type: Boolean, default: !1 }
734
741
  },
735
742
  emits: ["tradePage", "beforeFetch", "afterFetch", "clickedClearSearch"],
736
- setup(d, { expose: o, emit: _ }) {
737
- const t = fe(Ge, {}), {
738
- isHovering: g,
743
+ setup(u, { expose: f, emit: l }) {
744
+ const e = he(Qe, {}), {
745
+ isHovering: _,
739
746
  previewSrc: c,
740
- previewStyle: T,
741
- handleMouseOver: w,
747
+ previewStyle: B,
748
+ handleMouseOver: x,
742
749
  handleMouseMove: h,
743
750
  handleMouseLeave: v
744
- } = ot(), s = d, a = C(() => ({
751
+ } = ut(), o = u, a = C(() => ({
745
752
  // Primeiro, espelha todas as props originais.
746
- ...s,
753
+ ...o,
747
754
  // Agora SOBRESCREVEMOS as propriedades que precisam de lógica Global/Default
748
755
  // (Prioridade para Prop, mas aceita Global)
749
756
  // === TEXTOS ===
750
- first_text_page_size: s.first_text_page_size ?? t.first_text_page_size ?? "Mostrar",
751
- second_text_page_size: s.second_text_page_size ?? t.second_text_page_size ?? "registros",
752
- placeholder_search: s.placeholder_search ?? t.placeholder_search ?? "Buscar...",
757
+ first_text_page_size: o.first_text_page_size ?? e.first_text_page_size ?? "Mostrar",
758
+ second_text_page_size: o.second_text_page_size ?? e.second_text_page_size ?? "registros",
759
+ placeholder_search: o.placeholder_search ?? e.placeholder_search ?? "Buscar...",
753
760
  // === CLASSES ===
754
- class_table: s.class_table || t.class_table || "",
755
- class_pagination: s.class_pagination || t.class_pagination || "",
756
- class_container: s.class_container || t.class_container || "",
757
- class_content: s.class_content || t.class_content || "",
758
- class_filters: s.class_filters || t.class_filters || "",
759
- class_page_size: s.class_page_size || t.class_page_size || "",
761
+ class_table: o.class_table || e.class_table || "",
762
+ class_pagination: o.class_pagination || e.class_pagination || "",
763
+ class_container: o.class_container || e.class_container || "",
764
+ class_content: o.class_content || e.class_content || "",
765
+ class_filters: o.class_filters || e.class_filters || "",
766
+ class_page_size: o.class_page_size || e.class_page_size || "",
760
767
  // === CONFIGURAÇÃO DE API ===
761
- filter_param_name: s.filter_param_name ?? t.filter_param_name ?? "filter",
762
- search_param_name: s.search_param_name ?? t.search_param_name ?? "search",
763
- page_param_name: s.page_param_name ?? t.page_param_name ?? "page",
764
- page_size_param_name: s.page_size_param_name ?? t.page_size_param_name ?? "page_size",
765
- page_starts_at: s.page_starts_at ?? t.page_starts_at ?? 0,
766
- item_key: s.item_key ?? t.item_key ?? "id",
767
- data_key: s.data_key ?? t.data_key ?? "results",
768
- total_key: s.total_key ?? t.total_key ?? "count",
768
+ filter_param_name: o.filter_param_name ?? e.filter_param_name ?? "filter",
769
+ search_param_name: o.search_param_name ?? e.search_param_name ?? "search",
770
+ page_param_name: o.page_param_name ?? e.page_param_name ?? "page",
771
+ page_size_param_name: o.page_size_param_name ?? e.page_size_param_name ?? "page_size",
772
+ page_starts_at: o.page_starts_at ?? e.page_starts_at ?? 0,
773
+ item_key: o.item_key ?? e.item_key ?? "id",
774
+ data_key: o.data_key ?? e.data_key ?? "results",
775
+ total_key: o.total_key ?? e.total_key ?? "count",
769
776
  // === COMPORTAMENTO ===
770
- limit_per_page: s.limit_per_page ?? t.limit_per_page ?? 5,
771
- type_loading: s.type_loading ?? t.type_loading ?? "placeholder",
772
- min_loading_delay: s.min_loading_delay ?? t.min_loading_delay ?? 600,
773
- retry_attempts: s.retry_attempts ?? t.retry_attempts ?? 3,
774
- retry_delay: s.retry_delay ?? t.retry_delay ?? 2e3
775
- })), x = _, m = $({}), B = $([]), M = $(0), A = $(!1), y = $({
777
+ limit_per_page: o.limit_per_page ?? e.limit_per_page ?? 5,
778
+ type_loading: o.type_loading ?? e.type_loading ?? "placeholder",
779
+ min_loading_delay: o.min_loading_delay ?? e.min_loading_delay ?? 600,
780
+ retry_attempts: o.retry_attempts ?? e.retry_attempts ?? 3,
781
+ retry_delay: o.retry_delay ?? e.retry_delay ?? 2e3,
782
+ show_header_when_empty: o.show_header_when_empty ?? e.show_header_when_empty ?? !1
783
+ })), w = l, m = M({}), S = M([]), z = M(0), P = M(!1), y = M({
776
784
  current_page: a.value.page_starts_at,
777
785
  // pagina atual
778
786
  count: 0,
@@ -784,120 +792,135 @@ const ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
784
792
  filter: ""
785
793
  // filtro selecionado
786
794
  }), {
787
- expand_item_toggle: F,
788
- close_all_expanded_items: U,
789
- is_item_expanded: K
790
- } = it(
795
+ expand_item_toggle: U,
796
+ close_all_expanded_items: K,
797
+ is_item_expanded: Y
798
+ } = ct(
791
799
  a.value.close_expanded_item_on_expand_new,
792
800
  a.value.item_key,
793
801
  a.value.deactivate_animation_expand,
794
802
  a.value.scroll_to_expanded_item
795
803
  ), {
796
804
  items: D,
797
- error: z,
798
- response: te,
799
- attempt: ae,
800
- default_params: we,
801
- fetchDataWithDelay: P,
805
+ error: T,
806
+ response: ae,
807
+ attempt: le,
808
+ default_params: Se,
809
+ fetchDataWithDelay: q,
802
810
  reSearch: E,
803
- showLoadingState: Se,
804
- first_fetch: Ce
805
- } = dt(a.value, y, B, m, x, U), {
811
+ showLoadingState: Ce,
812
+ first_fetch: $e
813
+ } = pt(a.value, y, S, m, w, K), {
806
814
  selectAllCheckbox: oe,
807
- selected_items: q,
815
+ selected_items: L,
808
816
  isSelected: ie,
809
- atLeastOneSelected: $e,
817
+ atLeastOneSelected: Me,
810
818
  toggleSelectAll: de,
811
- toggleItemSelection: Me
812
- } = ut(a.value, D), le = C(
813
- () => B.value.filter((i) => i.locked)
814
- ), ne = C({
819
+ toggleItemSelection: ze
820
+ } = _t(a.value, D), ue = C(
821
+ () => S.value.filter((r) => r.locked && r.visible !== !1)
822
+ ), se = C({
815
823
  get() {
816
- return B.value.filter((i) => !i.locked);
824
+ return S.value.filter((r) => !r.locked && r.visible !== !1);
817
825
  },
818
- set(i) {
819
- const u = le.value;
820
- B.value = [...i, ...u];
826
+ set(r) {
827
+ const d = S.value.filter((I) => I.locked), s = S.value.filter((I) => !I.locked && I.visible === !1);
828
+ S.value = [...r, ...s, ...d];
821
829
  }
822
- }), ze = C(() => [...ne.value, ...le.value]), ue = C(() => {
823
- let i = [1];
824
- return a.value.list_filter.length > 0 && i.push(2), i;
825
- });
826
- J(te, (i) => {
827
- i ? (D.value = i[a.value.data_key] || [], M.value = i[a.value.total_key] || 0, y.value.count = M.value) : (D.value = [], M.value = 0);
830
+ }), Te = C(() => [...se.value, ...ue.value]), Be = C(() => S.value.map((r) => ({
831
+ id: r.id,
832
+ header: r.header,
833
+ field: r.field,
834
+ start_hidden: !!r.start_hidden,
835
+ // Converte para booleano, caso seja undefined
836
+ visible: r.visible !== !1,
837
+ locked: r.locked
838
+ })));
839
+ function Ve(r) {
840
+ const d = S.value.find((s) => s.id === r);
841
+ d && (d.visible = !d.visible);
842
+ }
843
+ const ce = C(() => {
844
+ let r = [1];
845
+ return a.value.list_filter.length > 0 && r.push(2), r;
846
+ }), R = C(() => D.value.length > 0);
847
+ J(ae, (r) => {
848
+ r ? (D.value = r[a.value.data_key] || [], z.value = r[a.value.total_key] || 0, y.value.count = z.value) : (D.value = [], z.value = 0);
828
849
  }, { immediate: !0 });
829
- function Te() {
850
+ function De() {
830
851
  setTimeout(() => {
831
- A.value = !1;
852
+ P.value = !1;
832
853
  }, 500);
833
854
  }
834
- function Be(i) {
835
- B.value.push(i);
855
+ function Ee(r) {
856
+ S.value.push(r);
836
857
  }
837
- Fe(xe, { addColumn: Be });
838
- const ce = (i) => {
839
- const u = i.target, n = parseInt(u.value, 10);
840
- n > 0 && (y.value.limit_per_page = n, y.value.limit_per_page = n, E());
858
+ Ye(we, { addColumn: Ee });
859
+ const pe = (r) => {
860
+ const d = r.target, s = parseInt(d.value, 10);
861
+ s > 0 && (y.value.limit_per_page = s, y.value.limit_per_page = s, E());
841
862
  };
842
- function j(i, u, n = null) {
843
- if (!i) return u;
844
- const Y = i.split(".");
845
- let p = u;
846
- for (const X of Y)
847
- p && typeof p == "object" && X in p ? p = p[X] : console.error(`Caminho inválido ou valor nulo em: ${i} na parte ${X}`);
848
- return n && (p = n(p)), p;
863
+ function A(r, d, s = null) {
864
+ if (!r) return d;
865
+ const I = r.split(".");
866
+ let p = d;
867
+ for (const X of I)
868
+ p && typeof p == "object" && X in p ? p = p[X] : console.error(`Caminho inválido ou valor nulo em: ${r} na parte ${X}`);
869
+ return s && (p = s(p)), p;
849
870
  }
850
- function Ve(i, u) {
851
- return u && typeof u == "number" && u > 0 && typeof i == "string" && i.length > u ? i.substring(0, u) + "..." : i;
871
+ function Ie(r, d) {
872
+ return d && typeof d == "number" && d > 0 && typeof r == "string" && r.length > d ? r.substring(0, d) + "..." : r;
852
873
  }
853
- function pe(i) {
854
- for (const n in m.value)
855
- n !== i && (m.value[n] = "none");
856
- const u = m.value[i] || "none";
857
- u === "none" ? m.value[i] = "increasing" : u === "increasing" ? m.value[i] = "decreasing" : m.value[i] = "none", E();
874
+ function _e(r) {
875
+ for (const s in m.value)
876
+ s !== r && (m.value[s] = "none");
877
+ const d = m.value[r] || "none";
878
+ d === "none" ? m.value[r] = "increasing" : d === "increasing" ? m.value[r] = "decreasing" : m.value[r] = "none", E();
858
879
  }
859
- function De(i) {
860
- i > 0 ? (y.value.limit_per_page = i, E()) : console.warn("O limite deve ser um número maior que zero.");
880
+ function Ne(r) {
881
+ r > 0 ? (y.value.limit_per_page = r, E()) : console.warn("O limite deve ser um número maior que zero.");
861
882
  }
862
- function Ee(i) {
863
- y.value.search = i, E();
883
+ function He(r) {
884
+ y.value.search = r, E();
864
885
  }
865
- function Ie(i) {
866
- y.value.filter = i, E();
886
+ function Oe(r) {
887
+ y.value.filter = r, E();
867
888
  }
868
- function Ne(i) {
869
- i >= 0 && i <= Math.ceil(y.value.count / y.value.limit_per_page) ? (y.value.current_page = i, P()) : console.warn("Número de página inválido.");
889
+ function je(r) {
890
+ r >= 0 && r <= Math.ceil(y.value.count / y.value.limit_per_page) ? (y.value.current_page = r, q()) : console.warn("Número de página inválido.");
870
891
  }
871
- function He() {
872
- let i = B.value.length;
873
- return a.value.use_checkbox && (i += 1), a.value.use_expandable_items && (i += 1), i;
892
+ function Ae() {
893
+ let r = S.value.length;
894
+ return a.value.use_checkbox && (r += 1), a.value.use_expandable_items && (r += 1), r;
874
895
  }
875
- function Oe() {
876
- x("tradePage"), P();
896
+ function Pe() {
897
+ w("tradePage"), q();
877
898
  }
878
- const R = (i, u) => {
879
- const n = [i.class_item || ""];
880
- if (i.click && n.push("cursor-pointer"), i.class_rules)
881
- for (const [Y, p] of Object.entries(i.class_rules))
882
- typeof p == "function" && p(u) && n.push(Y);
883
- return n.join(" ").trim();
899
+ const Z = (r, d) => {
900
+ const s = [r.class_item || ""];
901
+ if (r.click && s.push("cursor-pointer"), r.class_rules)
902
+ for (const [I, p] of Object.entries(r.class_rules))
903
+ typeof p == "function" && p(d) && s.push(I);
904
+ return s.join(" ").trim();
884
905
  };
885
- return o({
886
- execute: P,
906
+ return f({
907
+ execute: q,
887
908
  reSearch: E,
888
- pagination: Ue(y),
889
- set_limit_per_page: De,
890
- set_search: Ee,
891
- set_filter: Ie,
892
- set_page: Ne,
893
- default_params: we,
894
- selected_items: q,
895
- atLeastOneSelected: $e,
896
- expand_item_toggle: F,
897
- close_all_expanded_items: U,
898
- selectAllCheckbox: oe
899
- }), he(() => {
900
- a.value.immediate && be(() => {
909
+ pagination: Xe(y),
910
+ set_limit_per_page: Ne,
911
+ set_search: He,
912
+ set_filter: Oe,
913
+ set_page: je,
914
+ default_params: Se,
915
+ selected_items: L,
916
+ atLeastOneSelected: Me,
917
+ expand_item_toggle: U,
918
+ close_all_expanded_items: K,
919
+ selectAllCheckbox: oe,
920
+ toggleColumnVisibility: Ve,
921
+ columns_list: Be
922
+ }), ye(() => {
923
+ a.value.immediate && xe(() => {
901
924
  E();
902
925
  });
903
926
  }), J(
@@ -906,349 +929,353 @@ const ct = { class: "loading-container" }, pt = { key: 0 }, _t = { key: 2 }, mt
906
929
  E();
907
930
  },
908
931
  { deep: !0 }
909
- ), (i, u) => (e(), l("div", null, [
910
- r("div", {
932
+ ), (r, d) => (t(), n("div", null, [
933
+ i("div", {
911
934
  class: k(["", a.value.class_container])
912
935
  }, [
913
- O(i.$slots, "default", {}, void 0, !0),
914
- r("div", {
936
+ j(r.$slots, "default", {}, void 0, !0),
937
+ i("div", {
915
938
  class: k(["", a.value.class_content])
916
939
  }, [
917
- r("div", {
940
+ i("div", {
918
941
  class: k([a.value.class_filters, "d-flex justify-content-between align-items-start"])
919
942
  }, [
920
- O(i.$slots, "pageSize", {
921
- changePageSize: ce,
943
+ j(r.$slots, "pageSize", {
944
+ changePageSize: pe,
922
945
  limit_per_page: y.value.limit_per_page
923
946
  }, () => [
924
- r("div", {
947
+ i("div", {
925
948
  class: k(["text-secondary", a.value.class_page_size])
926
949
  }, [
927
- H(S(a.value.first_text_page_size) + " ", 1),
928
- r("div", Tt, [
929
- ye(r("input", {
950
+ O($(a.value.first_text_page_size) + " ", 1),
951
+ i("div", Dt, [
952
+ ke(i("input", {
930
953
  class: "form-control form-control-sm",
931
- onChange: ce,
932
- "onUpdate:modelValue": u[0] || (u[0] = (n) => y.value.limit_per_page = n),
954
+ onChange: pe,
955
+ "onUpdate:modelValue": d[0] || (d[0] = (s) => y.value.limit_per_page = s),
933
956
  min: "1",
934
957
  size: "3",
935
958
  "aria-label": "Número de registros por página",
936
959
  type: "number"
937
960
  }, null, 544), [
938
961
  [
939
- ke,
962
+ be,
940
963
  y.value.limit_per_page,
941
964
  void 0,
942
965
  { lazy: !0 }
943
966
  ]
944
967
  ])
945
968
  ]),
946
- H(" " + S(a.value.second_text_page_size), 1)
969
+ O(" " + $(a.value.second_text_page_size), 1)
947
970
  ], 2)
948
971
  ], !0),
949
- O(i.$slots, "fieldMiddle", {}, void 0, !0),
950
- (e(), N(ge, {
972
+ j(r.$slots, "fieldMiddle", {}, void 0, !0),
973
+ (t(), H(ge, {
951
974
  to: a.value.search_teleport || "body",
952
975
  disabled: !a.value.search_teleport
953
976
  }, [
954
- O(i.$slots, "search-field", {
977
+ j(r.$slots, "search-field", {
955
978
  search: y.value.search,
956
979
  filter: y.value.filter,
957
- reSearch: f(E),
980
+ reSearch: g(E),
958
981
  list_filter: a.value.list_filter,
959
- item_use: ue.value
982
+ item_use: ce.value
960
983
  }, () => [
961
- a.value.disable_search ? b("", !0) : (e(), N(rt, {
984
+ a.value.disable_search ? b("", !0) : (t(), H(dt, {
962
985
  key: 0,
963
986
  search: y.value.search,
964
- "onUpdate:search": u[1] || (u[1] = (n) => y.value.search = n),
987
+ "onUpdate:search": d[1] || (d[1] = (s) => y.value.search = s),
965
988
  filter: y.value.filter,
966
- "onUpdate:filter": u[2] || (u[2] = (n) => y.value.filter = n),
989
+ "onUpdate:filter": d[2] || (d[2] = (s) => y.value.filter = s),
967
990
  list_filter: a.value.list_filter,
968
- item_use: ue.value,
969
- onSearch: f(E),
991
+ item_use: ce.value,
992
+ onSearch: g(E),
970
993
  deactivate_search_on_clear: a.value.deactivate_search_on_clear,
971
994
  placeholder_search: a.value.placeholder_search,
972
995
  deactivate_search_empty: a.value.deactivate_search_empty,
973
- onClickedClearSearch: u[3] || (u[3] = (n) => i.$emit("clickedClearSearch"))
996
+ onClickedClearSearch: d[3] || (d[3] = (s) => r.$emit("clickedClearSearch"))
974
997
  }, null, 8, ["search", "filter", "list_filter", "item_use", "onSearch", "deactivate_search_on_clear", "placeholder_search", "deactivate_search_empty"]))
975
998
  ], !0)
976
999
  ], 8, ["to", "disabled"]))
977
1000
  ], 2),
978
- O(i.$slots, "item-selected-info", {
979
- selected_items: f(q),
980
- clearSelection: () => q.value = []
1001
+ j(r.$slots, "item-selected-info", {
1002
+ selected_items: g(L),
1003
+ clearSelection: () => L.value = []
981
1004
  }, () => [
982
- a.value.use_checkbox && f(q).length > 0 && !a.value.deactivate_selected_info ? (e(), l("div", Bt, [
983
- r("h4", Vt, [
984
- u[10] || (u[10] = r("strong", null, "oi Itens Selecionados:", -1)),
985
- u[11] || (u[11] = H()),
986
- r("span", Dt, S(f(q).length), 1)
1005
+ a.value.use_checkbox && g(L).length > 0 && !a.value.deactivate_selected_info ? (t(), n("div", Et, [
1006
+ i("h4", It, [
1007
+ d[10] || (d[10] = i("strong", null, "oi Itens Selecionados:", -1)),
1008
+ d[11] || (d[11] = O()),
1009
+ i("span", Nt, $(g(L).length), 1)
987
1010
  ]),
988
- r("a", {
1011
+ i("a", {
989
1012
  class: "cursor-pointer",
990
- onClick: u[4] || (u[4] = (n) => q.value = [])
991
- }, [...u[12] || (u[12] = [
992
- Z('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-trash" data-v-7d2530f6><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-7d2530f6></path><path d="M4 7l16 0" data-v-7d2530f6></path><path d="M10 11l0 6" data-v-7d2530f6></path><path d="M14 11l0 6" data-v-7d2530f6></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" data-v-7d2530f6></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" data-v-7d2530f6></path></svg> Limpar Seleção', 2)
1013
+ onClick: d[4] || (d[4] = (s) => L.value = [])
1014
+ }, [...d[12] || (d[12] = [
1015
+ ee('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-trash" data-v-ea8e198a><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-ea8e198a></path><path d="M4 7l16 0" data-v-ea8e198a></path><path d="M10 11l0 6" data-v-ea8e198a></path><path d="M14 11l0 6" data-v-ea8e198a></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" data-v-ea8e198a></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" data-v-ea8e198a></path></svg> Limpar Seleção', 2)
993
1016
  ])])
994
1017
  ])) : b("", !0)
995
1018
  ], !0),
996
- f(Se) ? (e(), N(Ct, {
1019
+ g(Ce) ? (t(), H(zt, {
997
1020
  key: 0,
998
- columns: B.value,
1021
+ columns: S.value,
999
1022
  limit: y.value.limit_per_page,
1000
1023
  type_loading: a.value.type_loading,
1001
1024
  custom_loading: a.value.custom_loading,
1002
1025
  class_table: a.value.class_table,
1003
- attempt: f(ae),
1026
+ attempt: g(le),
1004
1027
  pagination: y.value
1005
- }, null, 8, ["columns", "limit", "type_loading", "custom_loading", "class_table", "attempt", "pagination"])) : f(z) ? (e(), l("div", Et, [
1006
- u[13] || (u[13] = r("h4", { class: "text-danger" }, "Ocorreu um Erro", -1)),
1007
- f(ae) ? (e(), l("p", It, " Não foi possível carregar os dados após " + S(f(ae).total) + " tentativa(s). ", 1)) : (e(), l("p", Nt, " Não foi possível carregar os dados. Verifique sua conexão. ")),
1008
- r("button", {
1028
+ }, null, 8, ["columns", "limit", "type_loading", "custom_loading", "class_table", "attempt", "pagination"])) : g(T) ? (t(), n("div", Ht, [
1029
+ d[13] || (d[13] = i("h4", { class: "text-danger" }, "Ocorreu um Erro", -1)),
1030
+ g(le) ? (t(), n("p", Ot, " Não foi possível carregar os dados após " + $(g(le).total) + " tentativa(s). ", 1)) : (t(), n("p", jt, " Não foi possível carregar os dados. Verifique sua conexão. ")),
1031
+ i("button", {
1009
1032
  class: "btn btn-primary mt-2",
1010
- onClick: u[5] || (u[5] = //@ts-ignore
1011
- (...n) => f(P) && f(P)(...n))
1033
+ onClick: d[5] || (d[5] = //@ts-ignore
1034
+ (...s) => g(q) && g(q)(...s))
1012
1035
  }, " Tentar Novamente ")
1013
- ])) : f(D) ? (e(), l("div", Ht, [
1014
- f(D).length > 0 ? (e(), l("div", Ot, [
1015
- r("table", {
1036
+ ])) : g(D) ? (t(), n("div", At, [
1037
+ R.value || a.value.show_header_when_empty ? (t(), n("div", Pt, [
1038
+ i("table", {
1016
1039
  class: k(["table table-vcenter table-selectable", a.value.class_table])
1017
1040
  }, [
1018
- r("thead", null, [
1019
- W(f(Je), {
1020
- modelValue: ne.value,
1021
- "onUpdate:modelValue": u[7] || (u[7] = (n) => ne.value = n),
1041
+ i("thead", null, [
1042
+ W(g(Ze), {
1043
+ modelValue: se.value,
1044
+ "onUpdate:modelValue": d[7] || (d[7] = (s) => se.value = s),
1022
1045
  tag: "tr",
1023
- "item-key": "header",
1046
+ "item-key": "id",
1024
1047
  animation: 400,
1025
1048
  "ghost-class": "ghost-item",
1026
1049
  "drag-class": "dragging-item",
1027
- onStart: u[8] || (u[8] = (n) => A.value = !0),
1028
- onEnd: u[9] || (u[9] = () => Te())
1050
+ onStart: d[8] || (d[8] = (s) => P.value = !0),
1051
+ onEnd: d[9] || (d[9] = () => De())
1029
1052
  }, {
1030
- header: L(() => [
1031
- a.value.use_expandable_items ? (e(), l("th", jt)) : b("", !0),
1032
- a.value.use_checkbox ? (e(), l("th", At, [
1033
- r("input", {
1053
+ header: F(() => [
1054
+ a.value.use_expandable_items ? (t(), n("th", qt)) : b("", !0),
1055
+ a.value.use_checkbox ? (t(), n("th", Lt, [
1056
+ i("input", {
1034
1057
  class: "form-check-input m-0",
1035
1058
  type: "checkbox",
1036
1059
  ref_key: "selectAllCheckbox",
1037
1060
  ref: oe,
1038
- onChange: u[6] || (u[6] = //@ts-ignore
1039
- (...n) => f(de) && f(de)(...n)),
1061
+ onChange: d[6] || (d[6] = //@ts-ignore
1062
+ (...s) => g(de) && g(de)(...s)),
1040
1063
  "aria-label": "Selecionar todos os itens na página"
1041
1064
  }, null, 544)
1042
1065
  ])) : b("", !0)
1043
1066
  ]),
1044
- item: L(({ element: n }) => [
1045
- W(ve, {
1046
- header: n.header,
1047
- class_column: n.class_column,
1048
- use_ordering: n.use_ordering,
1049
- orderings_state: m.value[n.header] || "none",
1050
- onToggleOrderingState: () => pe(n.header),
1067
+ item: F(({ element: s }) => [
1068
+ W(fe, {
1069
+ header: s.header,
1070
+ class_column: s.class_column,
1071
+ use_ordering: s.use_ordering,
1072
+ orderings_state: m.value[s.id] || "none",
1073
+ onToggleOrderingState: () => _e(s.id),
1051
1074
  locked: !1,
1052
- col: n
1075
+ col: s
1053
1076
  }, null, 8, ["header", "class_column", "use_ordering", "orderings_state", "onToggleOrderingState", "col"])
1054
1077
  ]),
1055
- footer: L(() => [
1056
- (e(!0), l(V, null, I(le.value, (n) => (e(), N(ve, {
1057
- key: n.field || n.header,
1058
- header: n.header,
1059
- class_column: n.class_column,
1060
- use_ordering: n.use_ordering,
1061
- orderings_state: m.value[n.header] || "none",
1062
- onToggleOrderingState: () => pe(n.header),
1063
- col: n,
1078
+ footer: F(() => [
1079
+ (t(!0), n(V, null, N(ue.value, (s) => (t(), H(fe, {
1080
+ key: s.field || s.header,
1081
+ header: s.header,
1082
+ class_column: s.class_column,
1083
+ use_ordering: s.use_ordering,
1084
+ orderings_state: m.value[s.id] || "none",
1085
+ onToggleOrderingState: () => _e(s.id),
1086
+ col: s,
1064
1087
  locked: ""
1065
1088
  }, null, 8, ["header", "class_column", "use_ordering", "orderings_state", "onToggleOrderingState", "col"]))), 128))
1066
1089
  ]),
1067
1090
  _: 1
1068
1091
  }, 8, ["modelValue"])
1069
1092
  ]),
1070
- r("tbody", null, [
1071
- (e(!0), l(V, null, I(f(D), (n, Y) => (e(), l(V, {
1072
- key: n[a.value.item_key]
1093
+ i("tbody", null, [
1094
+ R.value ? (t(!0), n(V, { key: 0 }, N(g(D), (s, I) => (t(), n(V, {
1095
+ key: s[a.value.item_key]
1073
1096
  }, [
1074
- W(Ke, {
1097
+ W(Ge, {
1075
1098
  tag: "tr",
1076
- name: A.value ? "column-move" : ""
1099
+ name: P.value ? "column-move" : ""
1077
1100
  }, {
1078
- default: L(() => [
1079
- a.value.use_expandable_items ? (e(), l("td", Pt, [
1080
- O(i.$slots, "expand-button", {
1081
- item: n,
1082
- index: Y,
1083
- isExpanded: f(K)(n),
1084
- expand_item_toggle: f(F)
1101
+ default: F(() => [
1102
+ a.value.use_expandable_items ? (t(), n("td", Ft, [
1103
+ j(r.$slots, "expand-button", {
1104
+ item: s,
1105
+ index: I,
1106
+ isExpanded: g(Y)(s),
1107
+ expand_item_toggle: g(U)
1085
1108
  }, () => [
1086
- r("button", {
1109
+ i("button", {
1087
1110
  type: "button",
1088
- class: k(["btn-clean btn-icon-anim", { "is-expanded": f(K)(n) }]),
1089
- onClick: (p) => f(F)(n)
1111
+ class: k(["btn-clean btn-icon-anim", { "is-expanded": g(Y)(s) }]),
1112
+ onClick: (p) => g(U)(s)
1090
1113
  }, [
1091
- a.value.type_button_expand === "arrow" ? (e(), l("svg", Lt, [...u[14] || (u[14] = [
1092
- r("path", {
1114
+ a.value.type_button_expand === "arrow" ? (t(), n("svg", Kt, [...d[14] || (d[14] = [
1115
+ i("path", {
1093
1116
  stroke: "none",
1094
1117
  d: "M0 0h24v24H0z",
1095
1118
  fill: "none"
1096
1119
  }, null, -1),
1097
- r("path", { d: "M9 6l6 6l-6 6" }, null, -1)
1098
- ])])) : (e(), l("svg", Ft, [...u[15] || (u[15] = [
1099
- r("path", {
1120
+ i("path", { d: "M9 6l6 6l-6 6" }, null, -1)
1121
+ ])])) : (t(), n("svg", Yt, [...d[15] || (d[15] = [
1122
+ i("path", {
1100
1123
  stroke: "none",
1101
1124
  d: "M0 0h24v24H0z",
1102
1125
  fill: "none"
1103
1126
  }, null, -1),
1104
- r("path", {
1127
+ i("path", {
1105
1128
  d: "M12 5l0 14",
1106
1129
  class: "vertical-line"
1107
1130
  }, null, -1),
1108
- r("path", { d: "M5 12l14 0" }, null, -1)
1131
+ i("path", { d: "M5 12l14 0" }, null, -1)
1109
1132
  ])]))
1110
- ], 10, qt)
1133
+ ], 10, Ut)
1111
1134
  ], !0)
1112
1135
  ])) : b("", !0),
1113
- a.value.use_checkbox ? (e(), l("td", Ut, [
1114
- r("input", {
1136
+ a.value.use_checkbox ? (t(), n("td", Xt, [
1137
+ i("input", {
1115
1138
  class: "form-check-input m-0",
1116
1139
  type: "checkbox",
1117
- checked: f(ie)(n),
1118
- onChange: (p) => f(Me)(n),
1140
+ checked: g(ie)(s),
1141
+ onChange: (p) => g(ze)(s),
1119
1142
  "aria-label": "Selecionar este item"
1120
- }, null, 40, Kt)
1143
+ }, null, 40, Gt)
1121
1144
  ])) : b("", !0),
1122
- (e(!0), l(V, null, I(ze.value, (p, X) => (e(), l("td", {
1145
+ (t(!0), n(V, null, N(Te.value, (p, X) => (t(), n("td", {
1123
1146
  key: p.field || p.header,
1124
1147
  class: k(p.class_row)
1125
1148
  }, [
1126
- p.bodySlot ? (e(), N(ee(p.bodySlot), {
1149
+ p.bodySlot ? (t(), H(te(p.bodySlot), {
1127
1150
  key: 0,
1128
- item: n,
1151
+ item: s,
1129
1152
  index: X,
1130
- "is-selected": f(ie)(n)
1131
- }, null, 8, ["item", "index", "is-selected"])) : p.type === "text" ? (e(), l("span", {
1153
+ "is-selected": g(ie)(s)
1154
+ }, null, 8, ["item", "index", "is-selected"])) : p.type === "text" ? (t(), n("span", {
1132
1155
  key: 1,
1133
- onClick: (G) => p.click ? p.click(n) : null,
1134
- class: k(R(p, n))
1135
- }, S(Ve(j(p.field, n, p.transform_function), p.limite_text ?? null)), 11, Yt)) : p.type === "date" ? (e(), l("span", {
1156
+ onClick: (G) => p.click ? p.click(s) : null,
1157
+ class: k(Z(p, s))
1158
+ }, $(Ie(A(p.field, s, p.transform_function), p.limite_text ?? null)), 11, Wt)) : p.type === "date" ? (t(), n("span", {
1136
1159
  key: 2,
1137
- onClick: (G) => p.click ? p.click(n) : null,
1138
- class: k(R(p, n))
1160
+ onClick: (G) => p.click ? p.click(s) : null,
1161
+ class: k(Z(p, s))
1139
1162
  }, [
1140
- p.format === "complete" ? (e(), l("span", Gt, S(new Date(j(p.field, n)).toLocaleString()), 1)) : b("", !0),
1141
- p.format === "simple" ? (e(), l("span", Wt, S(new Date(j(
1163
+ p.format === "complete" ? (t(), n("span", Qt, $(new Date(A(
1164
+ p.field,
1165
+ s
1166
+ )).toLocaleString()), 1)) : b("", !0),
1167
+ p.format === "simple" ? (t(), n("span", Rt, $(new Date(A(
1142
1168
  p.field,
1143
- n
1169
+ s
1144
1170
  )).toLocaleDateString()), 1)) : b("", !0)
1145
- ], 10, Xt)) : p.type === "html" ? (e(), l("div", {
1171
+ ], 10, Jt)) : p.type === "html" ? (t(), n("div", {
1146
1172
  key: 3,
1147
- onClick: (G) => p.click ? p.click(n) : null,
1148
- class: k(R(p, n)),
1149
- innerHTML: j(p.field, n)
1150
- }, null, 10, Jt)) : p.type === "img" ? (e(), l("div", {
1173
+ onClick: (G) => p.click ? p.click(s) : null,
1174
+ class: k(Z(p, s)),
1175
+ innerHTML: A(p.field, s)
1176
+ }, null, 10, Zt)) : p.type === "img" ? (t(), n("div", {
1151
1177
  key: 4,
1152
- onClick: (G) => p.click ? p.click(n) : null,
1153
- class: k(R(p, n))
1178
+ onClick: (G) => p.click ? p.click(s) : null,
1179
+ class: k(Z(p, s))
1154
1180
  }, [
1155
- j(p.field, n) ? (e(), l("div", se({
1181
+ A(p.field, s) ? (t(), n("div", ne({
1156
1182
  key: 0,
1157
1183
  ref_for: !0
1158
1184
  }, p.deactivate_img_preview ? {
1159
1185
  class: "container-img"
1160
1186
  } : {
1161
- onMouseover: (G) => f(w)(G, j(p.field, n)),
1162
- onMousemove: f(h),
1163
- onMouseleave: f(v),
1187
+ onMouseover: (G) => g(x)(G, A(p.field, s)),
1188
+ onMousemove: g(h),
1189
+ onMouseleave: g(v),
1164
1190
  class: "container-img container-img-preview"
1165
1191
  }), [
1166
- r("img", {
1192
+ i("img", {
1167
1193
  class: "img-tamanho",
1168
- src: j(p.field, n)
1169
- }, null, 8, Rt),
1170
- r("img", {
1194
+ src: A(p.field, s)
1195
+ }, null, 8, ta),
1196
+ i("img", {
1171
1197
  class: "img-tamanho-cover",
1172
- src: j(p.field, n)
1173
- }, null, 8, Zt),
1174
- u[16] || (u[16] = r("div", { class: "bg-img" }, null, -1))
1198
+ src: A(p.field, s)
1199
+ }, null, 8, aa),
1200
+ d[16] || (d[16] = i("div", { class: "bg-img" }, null, -1))
1175
1201
  ], 16)) : b("", !0)
1176
- ], 10, Qt)) : (e(), l("span", ea, [
1177
- u[17] || (u[17] = H("tipo ", -1)),
1178
- r("span", ta, S(p.type), 1),
1179
- u[18] || (u[18] = H(" não suportado", -1))
1202
+ ], 10, ea)) : (t(), n("span", la, [
1203
+ d[17] || (d[17] = O("tipo ", -1)),
1204
+ i("span", sa, $(p.type), 1),
1205
+ d[18] || (d[18] = O(" não suportado", -1))
1180
1206
  ]))
1181
1207
  ], 2))), 128))
1182
1208
  ]),
1183
1209
  _: 2
1184
1210
  }, 1032, ["name"]),
1185
- W(Ye, {
1211
+ W(We, {
1186
1212
  name: "expand-item-" + a.value.type_animation_expand,
1187
1213
  css: !a.value.deactivate_animation_expand
1188
1214
  }, {
1189
- default: L(() => [
1190
- f(K)(n) ? (e(), l("tr", {
1215
+ default: F(() => [
1216
+ g(Y)(s) ? (t(), n("tr", {
1191
1217
  key: 0,
1192
- id: "expand-item-" + n[a.value.item_key],
1218
+ id: "expand-item-" + s[a.value.item_key],
1193
1219
  class: "expanded-item-row"
1194
1220
  }, [
1195
- r("td", {
1196
- colspan: He()
1221
+ i("td", {
1222
+ colspan: Ae()
1197
1223
  }, [
1198
- O(i.$slots, "after-row", { item: n }, void 0, !0)
1199
- ], 8, la)
1200
- ], 8, aa)) : b("", !0)
1224
+ j(r.$slots, "after-row", { item: s }, void 0, !0)
1225
+ ], 8, ra)
1226
+ ], 8, na)) : b("", !0)
1201
1227
  ]),
1202
1228
  _: 2
1203
1229
  }, 1032, ["name", "css"])
1204
- ], 64))), 128))
1230
+ ], 64))), 128)) : b("", !0)
1205
1231
  ])
1206
1232
  ], 2)
1207
- ])) : f(Ce) === !1 ? (e(), l("div", na, [
1208
- O(i.$slots, "idle-state", {}, void 0, !0)
1209
- ])) : (e(), l("div", sa, [...u[19] || (u[19] = [
1210
- r("p", { class: "m-0" }, "Nenhum item encontrado.", -1)
1233
+ ])) : b("", !0),
1234
+ !R.value && g($e) === !1 ? (t(), n("div", oa, [
1235
+ j(r.$slots, "idle-state", {}, void 0, !0)
1236
+ ])) : R.value ? b("", !0) : (t(), n("div", ia, [...d[19] || (d[19] = [
1237
+ i("p", { class: "m-0" }, "Nenhum item encontrado.", -1)
1211
1238
  ])]))
1212
1239
  ])) : b("", !0)
1213
1240
  ], 2)
1214
1241
  ], 2),
1215
- (e(), N(ge, {
1242
+ (t(), H(ge, {
1216
1243
  to: a.value.pagination_teleport || "body",
1217
1244
  disabled: !a.value.pagination_teleport
1218
1245
  }, [
1219
- O(i.$slots, "pagination", {
1246
+ j(r.$slots, "pagination", {
1220
1247
  pagination: y.value,
1221
- tradePage: f(P),
1222
- error: f(z)
1248
+ tradePage: g(q),
1249
+ error: g(T)
1223
1250
  }, () => [
1224
- !f(z) && y.value.count > 0 ? (e(), l("div", {
1251
+ !g(T) && y.value.count > 0 ? (t(), n("div", {
1225
1252
  key: 0,
1226
1253
  class: k(["px-3", a.value.class_pagination])
1227
1254
  }, [
1228
- W(We, {
1255
+ W(Re, {
1229
1256
  page_starts_at: a.value.page_starts_at,
1230
1257
  filtering: !0,
1231
1258
  pagination: y.value,
1232
- onTradePage: Oe
1259
+ onTradePage: Pe
1233
1260
  }, null, 8, ["page_starts_at", "pagination"])
1234
1261
  ], 2)) : b("", !0)
1235
1262
  ], !0)
1236
1263
  ], 8, ["to", "disabled"])),
1237
- f(g) ? (e(), l("div", {
1264
+ g(_) ? (t(), n("div", {
1238
1265
  key: 0,
1239
1266
  class: "image-preview-container",
1240
- style: Xe(f(T))
1267
+ style: Je(g(B))
1241
1268
  }, [
1242
- r("img", {
1243
- src: f(c),
1269
+ i("img", {
1270
+ src: g(c),
1244
1271
  alt: "Preview",
1245
1272
  class: "image-preview-large"
1246
- }, null, 8, ra)
1273
+ }, null, 8, da)
1247
1274
  ], 4)) : b("", !0)
1248
1275
  ]));
1249
1276
  }
1250
- }), _a = /* @__PURE__ */ re(oa, [["__scopeId", "data-v-7d2530f6"]]);
1277
+ }), ga = /* @__PURE__ */ re(ua, [["__scopeId", "data-v-ea8e198a"]]);
1251
1278
  export {
1252
- pa as VColumn,
1253
- _a as VDataTable
1279
+ va as VColumn,
1280
+ ga as VDataTable
1254
1281
  };