vuetable-next 1.1.0 → 1.2.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.
Files changed (45) hide show
  1. package/README.md +311 -270
  2. package/dist/chunks/vue2/createVuetable-GewoatYE.cjs +11 -0
  3. package/dist/chunks/vue2/createVuetable-zwzXUm5x.js +1511 -0
  4. package/dist/chunks/vue3/createVuetable-CE_PTu-W.cjs +5 -0
  5. package/dist/chunks/vue3/createVuetable-wZayTXed.js +1733 -0
  6. package/dist/portable/components/useVuetablePagination.d.ts +1 -0
  7. package/dist/portable/components/useVuetablePaginationInfo.d.ts +1 -0
  8. package/dist/public.d.ts +14 -1
  9. package/dist/structure.css +30 -0
  10. package/dist/style.css +77 -2
  11. package/dist/table.d.ts +13 -0
  12. package/dist/themes/semantic.css +47 -0
  13. package/dist/themes/tailwind.cjs +55 -0
  14. package/dist/themes/tailwind.js +35 -0
  15. package/dist/types/components/Vuetable.vue.d.ts +20 -53
  16. package/dist/types/components/VuetableContext.d.ts +1 -0
  17. package/dist/types/components/VuetableDetailHost.vue.d.ts +1 -1
  18. package/dist/types/components/VuetablePagination.vue.d.ts +13 -16
  19. package/dist/types/components/VuetablePaginationDropdown.vue.d.ts +13 -16
  20. package/dist/types/components/VuetablePaginationInfo.vue.d.ts +13 -1
  21. package/dist/types/components/VuetablePaginationInfoMixin.vue.d.ts +10 -0
  22. package/dist/types/components/VuetablePaginationMixin.vue.d.ts +10 -0
  23. package/dist/types/components/fetchAxios.d.ts +2 -0
  24. package/dist/types/components/resolveVuetableCss.d.ts +2 -0
  25. package/dist/types/components/useVuetableConfig.d.ts +15 -0
  26. package/dist/types/components/useVuetableFixedColumns.d.ts +1 -0
  27. package/dist/types/components/useVuetablePagination.d.ts +1 -0
  28. package/dist/types/components/useVuetablePaginationInfo.d.ts +1 -0
  29. package/dist/types/index.d.ts +3 -2
  30. package/dist/types/table.d.ts +10 -0
  31. package/dist/types/themes/tailwind.d.ts +35 -0
  32. package/dist/vue2-table.cjs +1 -0
  33. package/dist/vue2-table.js +21 -0
  34. package/dist/vue2.cjs +15 -22
  35. package/dist/vue2.js +381 -1737
  36. package/dist/vue3-table.cjs +1 -0
  37. package/dist/vue3-table.js +21 -0
  38. package/dist/vue3.cjs +1 -6
  39. package/dist/vue3.js +454 -1995
  40. package/package.json +23 -4
  41. package/style.css +77 -2
  42. package/dist/vue2.cjs.map +0 -1
  43. package/dist/vue2.js.map +0 -1
  44. package/dist/vue3.cjs.map +0 -1
  45. package/dist/vue3.js.map +0 -1
@@ -0,0 +1,1511 @@
1
+ var Gn = Object.defineProperty, Nn = Object.defineProperties;
2
+ var zn = Object.getOwnPropertyDescriptors;
3
+ var Le = Object.getOwnPropertySymbols;
4
+ var sn = Object.prototype.hasOwnProperty, un = Object.prototype.propertyIsEnumerable;
5
+ var on = (e, a, n) => a in e ? Gn(e, a, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[a] = n, X = (e, a) => {
6
+ for (var n in a || (a = {}))
7
+ sn.call(a, n) && on(e, n, a[n]);
8
+ if (Le)
9
+ for (var n of Le(a))
10
+ un.call(a, n) && on(e, n, a[n]);
11
+ return e;
12
+ }, Fe = (e, a) => Nn(e, zn(a));
13
+ var cn = (e, a) => {
14
+ var n = {};
15
+ for (var l in e)
16
+ sn.call(e, l) && a.indexOf(l) < 0 && (n[l] = e[l]);
17
+ if (e != null && Le)
18
+ for (var l of Le(e))
19
+ a.indexOf(l) < 0 && un.call(e, l) && (n[l] = e[l]);
20
+ return n;
21
+ };
22
+ var dn = (e, a, n) => new Promise((l, u) => {
23
+ var o = (d) => {
24
+ try {
25
+ c(n.next(d));
26
+ } catch (s) {
27
+ u(s);
28
+ }
29
+ }, f = (d) => {
30
+ try {
31
+ c(n.throw(d));
32
+ } catch (s) {
33
+ u(s);
34
+ }
35
+ }, c = (d) => d.done ? l(d.value) : Promise.resolve(d.value).then(o, f);
36
+ c((n = n.apply(e, a)).next());
37
+ });
38
+ import * as xt from "vue-demi";
39
+ import { getCurrentInstance as wn, computed as x, defineComponent as oe, inject as de, ref as I, isVue2 as A, h as Un, markRaw as xn, toRaw as mt, watch as U, shallowRef as me, onMounted as Sn, onUpdated as Jn, onBeforeUnmount as Ct, onBeforeUpdate as fn, onBeforeMount as Zn, nextTick as Re, reactive as Qn, toRefs as Yn, provide as Xn, set as er, isReadonly as tr, triggerRef as nr } from "vue-demi";
40
+ const _n = Symbol.for("vuetable-next/config");
41
+ function Er(e, a = {}) {
42
+ var l;
43
+ const n = Object.freeze({ unstyled: (l = a.unstyled) != null ? l : !1 });
44
+ e.prototype ? e.prototype.$vuetableConfig = n : typeof e.provide == "function" && e.provide(_n, n);
45
+ }
46
+ function rr(e, a, n) {
47
+ var u, o, f, c, d, s, g;
48
+ if (e !== void 0) return e;
49
+ const l = (f = (o = (u = a == null ? void 0 : a.$root) == null ? void 0 : u.$options) == null ? void 0 : o.vuetable) == null ? void 0 : f.unstyled;
50
+ return l !== void 0 ? l : n ? (d = (c = n[_n]) == null ? void 0 : c.unstyled) != null ? d : !1 : a && "$vuetableConfig" in a && (g = (s = a.$vuetableConfig) == null ? void 0 : s.unstyled) != null ? g : !1;
51
+ }
52
+ function lr(e) {
53
+ const a = wn();
54
+ return x(() => {
55
+ var n;
56
+ return rr(e.unstyled, a == null ? void 0 : a.proxy, (n = a == null ? void 0 : a.appContext) == null ? void 0 : n.provides);
57
+ });
58
+ }
59
+ let $e;
60
+ function wt(e, a = /* @__PURE__ */ new WeakMap()) {
61
+ if (e === null || typeof e != "object") return e;
62
+ const n = Object.getPrototypeOf(e);
63
+ if (!Array.isArray(e) && n !== Object.prototype && n !== null) return e;
64
+ if (a.has(e)) return a.get(e);
65
+ const l = Array.isArray(e) ? new Array(e.length) : Object.create(n);
66
+ a.set(e, l);
67
+ for (const u of Reflect.ownKeys(e))
68
+ Object.prototype.propertyIsEnumerable.call(e, u) && Object.defineProperty(l, u, {
69
+ value: wt(Reflect.get(e, u), a),
70
+ enumerable: !0,
71
+ configurable: !0,
72
+ writable: !0
73
+ });
74
+ return l;
75
+ }
76
+ function ar(e, a, n) {
77
+ return dn(this, null, function* () {
78
+ const l = wt(X({}, a)), u = l.headers;
79
+ Object.prototype.toString.call(u) === "[object AxiosHeaders]" ? l.headers = wt(X({}, u)) : typeof Headers != "undefined" && u instanceof Headers && (l.headers = new Headers(u));
80
+ const o = n, f = e;
81
+ if ($e || ($e = import("axios").then((s) => s.default).catch((s) => {
82
+ throw $e = void 0, s;
83
+ })), o === "post") {
84
+ const d = l, { params: s } = d, g = cn(d, ["params"]), [v, m] = yield Promise.all([$e, s]);
85
+ return v.post(f, m, g);
86
+ }
87
+ return (yield $e).get(f, l);
88
+ });
89
+ }
90
+ const We = oe({
91
+ name: "vuetable-field-checkbox",
92
+ inheritAttrs: !1,
93
+ props: {
94
+ rowData: { type: Object, required: !1 },
95
+ rowIndex: { type: Number, required: !1 },
96
+ rowField: { type: Object, required: !1, default: null },
97
+ isHeader: { type: Boolean, required: !1, default: !1 },
98
+ title: { type: String, required: !1 }
99
+ },
100
+ setup(e) {
101
+ const a = de("vuetable"), n = I(null), l = x(() => (a.tableData || []).filter((s) => a.isSelectedRow(s[a.trackBy])).length), u = x(() => {
102
+ var s;
103
+ return l.value > 0 && l.value < (((s = a.tableData) == null ? void 0 : s.length) || 0);
104
+ });
105
+ function o(s, g) {
106
+ var v;
107
+ s && a.onCheckboxToggled(g.target.checked, (v = e.rowField) == null ? void 0 : v.name, s);
108
+ }
109
+ function f(s) {
110
+ a.onCheckboxToggledAll(s.target.checked);
111
+ }
112
+ function c(s) {
113
+ return !!s && a.isSelectedRow(s[a.trackBy]);
114
+ }
115
+ function d() {
116
+ return l.value > 0;
117
+ }
118
+ return { vuetable: a, checkbox: n, isIndeterminate: u, toggleCheckbox: o, toggleAllCheckbox: f, isSelected: c, isAllItemsInCurrentPageSelected: d };
119
+ }
120
+ });
121
+ var or = function() {
122
+ var e = this, a = e.$createElement, n = e._self._c || a;
123
+ return e.isHeader ? n("th", e._b({ staticClass: "vuetable-th-component-checkbox" }, "th", e.$attrs, !1), [n("input", { ref: "checkbox", attrs: { type: "checkbox" }, domProps: { indeterminate: e.isIndeterminate, checked: e.isAllItemsInCurrentPageSelected() }, on: { change: function(l) {
124
+ return e.toggleAllCheckbox(l);
125
+ } } })]) : n("td", e._b({ staticClass: "vuetable-td-component-checkbox" }, "td", e.$attrs, !1), [n("input", { ref: "checkbox", attrs: { type: "checkbox" }, domProps: { checked: e.isSelected(e.rowData) }, on: { change: function(l) {
126
+ return e.toggleCheckbox(e.rowData, l);
127
+ } } })]);
128
+ }, sr = [];
129
+ We.render = or;
130
+ We.staticRenderFns = sr;
131
+ const Ke = oe({
132
+ name: "vuetable-field-handle",
133
+ inheritAttrs: !1,
134
+ props: {
135
+ isHeader: { type: Boolean, required: !1, default: !1 },
136
+ title: { type: String, required: !1, default: "" }
137
+ },
138
+ setup() {
139
+ const e = de("vuetable");
140
+ function a(n, l = "") {
141
+ return !e.css.handleIcon && typeof e.css.renderIcon != "function" ? "" : typeof e.css.renderIcon == "undefined" ? `<i class="${n.join(" ")}" ${l}></i>` : e.css.renderIcon(n, l);
142
+ }
143
+ return { vuetable: e, renderIconTag: a };
144
+ }
145
+ });
146
+ var ir = function() {
147
+ var e = this, a = e.$createElement, n = e._self._c || a;
148
+ return e.isHeader ? n("th", e._b({ staticClass: "vuetable-th-component-handle", domProps: { innerHTML: e._s(e.title) } }, "th", e.$attrs, !1)) : n("td", e._b({ staticClass: "vuetable-td-component-handle", domProps: { innerHTML: e._s(e.renderIconTag(["handle-icon", e.vuetable.css.handleIcon])) } }, "td", e.$attrs, !1));
149
+ }, ur = [];
150
+ Ke.render = ir;
151
+ Ke.staticRenderFns = ur;
152
+ const Ge = oe({
153
+ name: "vuetable-field-sequence",
154
+ inheritAttrs: !1,
155
+ props: {
156
+ rowIndex: { type: Number, required: !1, default: 0 },
157
+ isHeader: { type: Boolean, required: !1, default: !1 },
158
+ title: { type: String, required: !1, default: "" }
159
+ },
160
+ setup(e) {
161
+ const a = de("vuetable");
162
+ function n() {
163
+ return a.tablePagination ? a.tablePagination.from + e.rowIndex : 1 + e.rowIndex;
164
+ }
165
+ return { vuetable: a, renderSequence: n };
166
+ }
167
+ });
168
+ var cr = function() {
169
+ var e = this, a = e.$createElement, n = e._self._c || a;
170
+ return e.isHeader ? n("th", e._b({ staticClass: "vuetable-th-component-sequence", domProps: { innerHTML: e._s(e.title) } }, "th", e.$attrs, !1)) : n("td", e._b({ staticClass: "vuetable-td-component-sequence", domProps: { innerHTML: e._s(e.renderSequence()) } }, "td", e.$attrs, !1));
171
+ }, dr = [];
172
+ Ge.render = cr;
173
+ Ge.staticRenderFns = dr;
174
+ const He = oe({
175
+ name: "vuetable-th-gutter",
176
+ setup() {
177
+ const e = de("vuetable"), a = x(() => e.hasFixedRightColumn && e.tableLayout.isFixedHeader);
178
+ return { vuetable: e, pinned: a };
179
+ }
180
+ });
181
+ var fr = function() {
182
+ var e = this, a = e.$createElement, n = e._self._c || a;
183
+ return n("th", { staticClass: "vuetable-th-gutter", class: { "vuetable-fixed-column": e.pinned, "vuetable-fixed-header": e.pinned }, style: { width: e.vuetable.scrollBarWidth, padding: "0 !important", borderLeftWidth: "0 !important", borderRightWidth: "0 !important", position: e.pinned ? "sticky" : void 0, right: e.pinned ? "0px" : void 0 } });
184
+ }, vr = [];
185
+ He.render = fr;
186
+ He.staticRenderFns = vr;
187
+ const St = (e, { slots: a }) => {
188
+ var l, u;
189
+ const n = (l = a.default) == null ? void 0 : l.call(a)[0];
190
+ return (u = e.onRendered) == null || u.call(e), n;
191
+ };
192
+ St.props = ["revision", "onRendered"];
193
+ St.inheritAttrs = !1;
194
+ const _t = (e, { slots: a }) => xt.renderSlot({ default: e.content }, "default", e.scope, a.default);
195
+ _t.props = ["content", "scope"];
196
+ _t.inheritAttrs = !1;
197
+ const br = xt.isVue2 ? {
198
+ functional: !0,
199
+ props: ["revision", "onRendered"],
200
+ render: (e, a) => {
201
+ var l, u, o, f, c;
202
+ const n = (o = (u = (l = a.scopedSlots).default) == null ? void 0 : u.call(l)[0]) != null ? o : a.children[0];
203
+ return (c = (f = a.props).onRendered) == null || c.call(f), n;
204
+ }
205
+ } : St, Pn = xt.isVue2 ? {
206
+ functional: !0,
207
+ props: ["content", "scope"],
208
+ render: (e, a) => {
209
+ var n, l, u, o, f;
210
+ return (f = (l = (n = a.props).content) == null ? void 0 : l.call(n, a.props.scope)) != null ? f : (o = (u = a.scopedSlots).default) == null ? void 0 : o.call(u);
211
+ }
212
+ } : _t, Pt = oe({
213
+ name: "vuetable-row-header",
214
+ components: {
215
+ SlotOutlet: Pn,
216
+ "vuetable-field-checkbox": We,
217
+ "vuetable-field-handle": Ke,
218
+ "vuetable-field-sequence": Ge,
219
+ VuetableColGutter: He
220
+ },
221
+ props: {
222
+ vuetable: { type: Object, default: null }
223
+ },
224
+ setup() {
225
+ const e = de("vuetable");
226
+ function a(b) {
227
+ return e.columnRevision, e.getColumnSlot(b.name, !0);
228
+ }
229
+ function n(b) {
230
+ return b.replace(e.fieldPrefix, "");
231
+ }
232
+ function l(b, p) {
233
+ return [
234
+ `${b}-${u(p.name)}`,
235
+ p.titleClass || "",
236
+ e.groupClass(p),
237
+ e.getCellProps(p, "header").class,
238
+ o(p),
239
+ { sortable: e.isSortable(p) }
240
+ ];
241
+ }
242
+ function u(b) {
243
+ return typeof b == "string" && b.replace(/([A-Z])/g, (p) => "_" + p.toLowerCase()).replace(" ", "_").replace(".", "_");
244
+ }
245
+ function o(b) {
246
+ const p = s(b);
247
+ return p !== !1 ? e.sortOrder[p].direction == "asc" ? e.css.ascendingClass : e.css.descendingClass : "";
248
+ }
249
+ function f(b) {
250
+ const p = s(b);
251
+ return p === !1 ? e.css.sortableIcon : e.sortOrder[p].direction == "asc" ? e.css.ascendingIcon : e.css.descendingIcon;
252
+ }
253
+ function c(b) {
254
+ return s(b) !== !1;
255
+ }
256
+ function d(b) {
257
+ return e.isSortable(b) && (!!e.css.sortableIcon || typeof e.css.renderIcon == "function");
258
+ }
259
+ function s(b) {
260
+ if (!e.isSortable(b))
261
+ return !1;
262
+ for (let p = 0; p < e.sortOrder.length; p++)
263
+ if (g(b, p))
264
+ return p;
265
+ return !1;
266
+ }
267
+ function g(b, p) {
268
+ return e.sortOrder[p].field === b.name && e.sortOrder[p].sortField === b.sortField;
269
+ }
270
+ function v(b, p = !1) {
271
+ const w = p ? "" : m(b);
272
+ if ((p || w.length > 0) && c(b) || d(b)) {
273
+ const S = `opacity:${H(b)};position:relative;float:right`, q = e.showSortIcons && (f(b) || e.css.renderIcon) ? O(["sort-icon", f(b)].filter(Boolean), `style="${S}"`) : "";
274
+ return w + " " + q;
275
+ }
276
+ return w;
277
+ }
278
+ function m(b) {
279
+ return typeof b.title == "function" ? b.title() : typeof b.title == "undefined" ? b.name.toString().replace(".", " ") : b.title;
280
+ }
281
+ function H(b) {
282
+ let S = 0.3;
283
+ const q = e.sortOrder.length, V = s(b);
284
+ return 1 - q * S < 0.3 && (S = (1 - 0.3) / (q - 1)), 1 - (V === !1 ? 0 : V) * S;
285
+ }
286
+ function O(b, p = "") {
287
+ return typeof e.css.renderIcon == "undefined" ? `<i class="${b.join(" ")}" ${p}></i>` : e.css.renderIcon(b, p);
288
+ }
289
+ function F(b, p) {
290
+ e.orderBy(b, p);
291
+ }
292
+ return { headerTable: e, getHeaderSlot: a, stripPrefix: n, headerClass: l, toSnakeCase: u, sortClass: o, sortIcon: f, isInCurrentSortGroup: c, hasSortableIcon: d, currentSortOrderPosition: s, fieldIsInSortOrderPosition: g, renderTitle: v, getTitle: m, sortIconOpacity: H, renderIconTag: O, onColumnHeaderClicked: F, VuetableColGutter: He };
293
+ }
294
+ });
295
+ var hr = function() {
296
+ var e = this, a = e.$createElement, n = e._self._c || a;
297
+ return n("tr", [e._l(e.headerTable.tableFields, function(l, u) {
298
+ return [l.visible ? [e.headerTable.isFieldComponent(l.name) ? [n(l.name, { key: e.headerTable.getColumnKey(l) + ":0.0.0:" + e.headerTable.getColumnKey(l), tag: "component", class: e.headerClass("vuetable-th-component", l), style: [{ width: l.width }, e.headerTable.getCellProps(l, "header").style], attrs: { "is-header": "", vuetable: e.headerTable, "row-field": l, title: e.renderTitle(l), "data-vuetable-column": e.headerTable.getCellProps(l, "header")["data-vuetable-column"] }, on: { "vuetable:header-event": e.headerTable.onHeaderEvent, click: function(o) {
299
+ return e.onColumnHeaderClicked(l, o);
300
+ } } })] : e.headerTable.isFieldSlot(l.name) ? [n("th", { key: e.headerTable.getColumnKey(l) + ":0.0.0.0:" + e.headerTable.getColumnKey(l), class: e.headerClass("vuetable-th-slot", l), style: [{ width: l.width }, e.headerTable.getCellProps(l, "header").style], attrs: { "data-vuetable-column": e.headerTable.getCellProps(l, "header")["data-vuetable-column"] }, domProps: { innerHTML: e._s(e.renderTitle(l)) }, on: { click: function(o) {
301
+ return e.onColumnHeaderClicked(l, o);
302
+ } } })] : e.getHeaderSlot(l) ? [n("th", { key: e.headerTable.getColumnKey(l) + ":0.0.0.0:" + e.headerTable.getColumnKey(l), class: e.headerClass("vuetable-th", l), style: [{ width: l.width }, e.headerTable.getCellProps(l, "header").style], attrs: { id: "_" + l.name, "data-vuetable-column": e.headerTable.getCellProps(l, "header")["data-vuetable-column"] }, on: { click: function(o) {
303
+ return e.onColumnHeaderClicked(l, o);
304
+ } } }, [n("slot-outlet", { attrs: { content: e.getHeaderSlot(l), scope: { column: l, index: u } } }), e._v(" "), n("span", { domProps: { innerHTML: e._s(e.renderTitle(l, !0)) } })], 1)] : [n("th", { key: e.headerTable.getColumnKey(l) + ":0.0.0.0:" + e.headerTable.getColumnKey(l), class: e.headerClass("vuetable-th", l), style: [{ width: l.width }, e.headerTable.getCellProps(l, "header").style], attrs: { id: "_" + l.name, "data-vuetable-column": e.headerTable.getCellProps(l, "header")["data-vuetable-column"] }, domProps: { innerHTML: e._s(e.renderTitle(l)) }, on: { click: function(o) {
305
+ return e.onColumnHeaderClicked(l, o);
306
+ } } })]] : e._e()];
307
+ }), e._v(" "), e.headerTable.scrollVisible ? n("VuetableColGutter") : e._e()], 2);
308
+ }, pr = [];
309
+ Pt.render = hr;
310
+ Pt.staticRenderFns = pr;
311
+ function kn(e, a, n) {
312
+ const l = new Map(a.tableFields.map((d, s) => [d, s])), u = a.groupBy != null, o = u ? a.tableLayout.headerGroups : [{ key: "fields", fields: a.tableFields.filter((d) => d.visible) }], f = () => e("col", { style: { width: a.scrollBarWidth }, class: "vuetable-col-gutter" }), c = o.map((d) => e("colgroup", { key: d.key }, [
313
+ ...d.fields.map((s) => {
314
+ var g;
315
+ const m = (typeof s.name == "object" && s.name !== null ? s.name.name || "component" : s.name).replace(a.fieldPrefix, ""), H = (g = s.$_index) != null ? g : l.get(s);
316
+ return e("col", {
317
+ key: a.getColumnKey(s),
318
+ style: { width: n && a.getHeaderWidth(s) || s.width },
319
+ class: [`vuetable-col-${m}`, s.titleClass, `${m}-${H}`, a.groupClass(s)]
320
+ });
321
+ }),
322
+ ...!u && n && a.scrollVisible ? [f()] : []
323
+ ]));
324
+ return u && n && a.scrollVisible && c.push(e("colgroup", { key: "gutter" }, [f()])), c;
325
+ }
326
+ const On = { isHeader: { type: Boolean, default: !1 } }, yr = {
327
+ name: "vuetable-col-group",
328
+ functional: !0,
329
+ inject: ["vuetable"],
330
+ props: On,
331
+ render: (e, a) => kn(e, a.injections.vuetable, a.props.isHeader)
332
+ }, gr = oe({
333
+ name: "vuetable-col-group",
334
+ inheritAttrs: !1,
335
+ props: On,
336
+ setup(e) {
337
+ const a = de("vuetable");
338
+ return () => kn(Un, a, e.isHeader);
339
+ }
340
+ }), vn = A ? yr : gr, kt = oe({
341
+ name: "VuetableDetailHost",
342
+ props: {
343
+ detailComponent: { type: [String, Object], default: "" },
344
+ rowData: { type: Object, required: !0 },
345
+ rowIndex: { type: Number, required: !0 },
346
+ options: { type: Object, default: () => ({}) }
347
+ },
348
+ setup(e) {
349
+ const a = de("vuetable"), n = x(() => a.vuetable), l = x(() => typeof e.detailComponent == "object" ? xn(mt(e.detailComponent)) : e.detailComponent);
350
+ return { tableContext: a, vuetable: n, resolvedDetailComponent: l };
351
+ }
352
+ });
353
+ var mr = function() {
354
+ var e = this, a = e.$createElement, n = e._self._c || a;
355
+ return n(e.resolvedDetailComponent, { tag: "component", attrs: { "row-data": e.rowData, "row-index": e.rowIndex, vuetable: e.tableContext, options: e.options } });
356
+ }, Cr = [];
357
+ kt.render = mr;
358
+ kt.staticRenderFns = Cr;
359
+ function bn(e, a, n) {
360
+ return e === void 0 ? n : e === "" || e === a || !!e;
361
+ }
362
+ function hn(e) {
363
+ if (typeof e == "function")
364
+ return (a) => {
365
+ const n = e(a);
366
+ return Array.isArray(n) ? n : n == null ? [] : [n];
367
+ };
368
+ }
369
+ function wr(e) {
370
+ let a = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), u = !1;
371
+ function o(c) {
372
+ const d = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set();
373
+ function g(v) {
374
+ var H, O, F, b, p, w, S, q, V, re;
375
+ if (Array.isArray(v)) {
376
+ v.forEach(g);
377
+ return;
378
+ }
379
+ if (!v || typeof v != "object") return;
380
+ const m = A ? (O = (H = v.componentOptions) == null ? void 0 : H.Ctor) == null ? void 0 : O.options : v.type;
381
+ if ((m == null ? void 0 : m.__vuetableColumn) === !0) {
382
+ const M = A ? X(X({}, (F = v.data) == null ? void 0 : F.attrs), (b = v.componentOptions) == null ? void 0 : b.propsData) : v.props || {}, L = M.field;
383
+ if (typeof L != "string" || !L) {
384
+ s.add("VuetableColumn requires a non-empty field.");
385
+ return;
386
+ }
387
+ if (d.has(L)) {
388
+ s.add(`Duplicate VuetableColumn field: ${L}. The first declaration wins.`);
389
+ return;
390
+ }
391
+ const E = (R, T) => {
392
+ var K;
393
+ return (K = M[R]) != null ? K : M[T];
394
+ }, C = A ? [(p = v.data) == null ? void 0 : p.staticClass, (w = v.data) == null ? void 0 : w.class] : M.class, y = A ? ((S = v.data) == null ? void 0 : S.scopedSlots) || {} : v.children || {}, P = A ? (q = v.componentOptions) == null ? void 0 : q.children : Array.isArray(y) ? y : void 0;
395
+ d.set(L, {
396
+ field: {
397
+ name: L,
398
+ title: M.label,
399
+ sortField: bn(M.sortable, "sortable", !1) ? E("sortField", "sort-field") || L : null,
400
+ width: (V = M.width) != null ? V : null,
401
+ fixed: M.fixed,
402
+ fixedOrder: Object.prototype.hasOwnProperty.call(M, "fixedOrder") ? M.fixedOrder : M["fixed-order"],
403
+ group: (re = M.group) != null ? re : null,
404
+ visible: bn(M.visible, "visible", !0),
405
+ titleClass: [C, E("headerClass", "header-class")],
406
+ dataClass: [C, E("cellClass", "cell-class")],
407
+ $_columnKey: L
408
+ },
409
+ cell: hn(y.default) || (P != null && P.length ? () => P : void 0),
410
+ header: hn(y.header)
411
+ });
412
+ return;
413
+ }
414
+ typeof v.type == "symbol" && Array.isArray(v.children) && g(v.children);
415
+ }
416
+ g(c), s.forEach((v) => {
417
+ l.has(v) || e.warn(v);
418
+ }), l = s, a = d, u = d.size > 0;
419
+ }
420
+ function f() {
421
+ const c = /* @__PURE__ */ new Map(), d = [...a].map(([s, g], v) => {
422
+ const m = e.normalize(g.field, v);
423
+ c.set(s, m);
424
+ const H = n.get(s), O = e.fields.value.find((F) => F.$_columnKey === s);
425
+ if (!H || !O) return X({}, m);
426
+ for (const F of Object.keys(m))
427
+ JSON.stringify(m[F]) !== JSON.stringify(H[F]) && (O[F] = m[F]);
428
+ return O;
429
+ });
430
+ (d.length !== e.fields.value.length || d.some((s, g) => s !== e.fields.value[g])) && (e.fields.value = d), n = c;
431
+ }
432
+ return {
433
+ discover: o,
434
+ reconcile: f,
435
+ hasDeclarations: () => u,
436
+ getColumnSlot: (c, d = !1) => {
437
+ var s, g;
438
+ return d ? (s = a.get(c)) == null ? void 0 : s.header : (g = a.get(c)) == null ? void 0 : g.cell;
439
+ }
440
+ };
441
+ }
442
+ function ee(e) {
443
+ return e.fixed === "left" || e.fixed === "right" ? e.fixed : void 0;
444
+ }
445
+ function pn(e, a) {
446
+ const n = Object.keys(a);
447
+ return n.length === Object.keys(e).length && n.every((l) => e[l] === a[l]);
448
+ }
449
+ function yn(e, a) {
450
+ return e.$_columnKey || (typeof e.name == "string" ? e.name : e.name || a);
451
+ }
452
+ function xr(e) {
453
+ const a = /* @__PURE__ */ new Map();
454
+ let n = /* @__PURE__ */ new Map(), l = 0, u = 0;
455
+ const o = (c) => typeof c == "number" && Number.isInteger(c) && c >= 1;
456
+ return U(() => e.fields.value.map((c, d) => ({ field: c, identity: yn(c, d), side: ee(c), order: c.fixedOrder })), (c) => {
457
+ const d = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
458
+ for (const { field: g, identity: v, side: m, order: H } of c) {
459
+ const O = d.get(v) || 0;
460
+ d.set(v, O + 1);
461
+ const F = a.get(v) || [], b = F[O] || { key: l++, sequence: 0, invalidOrder: !1 };
462
+ F[O] = b, a.set(v, F), b.side !== m && (b.side = m, b.sequence = m ? u++ : 0);
463
+ const p = H !== void 0 && !o(H);
464
+ p && !b.invalidOrder && e.warn(`fixedOrder for ${String(g.name)} must be a positive integer; treating it as automatic.`), b.invalidOrder = p, s.set(g, b);
465
+ }
466
+ n = s;
467
+ }, { immediate: !0, flush: "sync" }), U(() => e.fields.value.map(yn), (c) => {
468
+ const d = /* @__PURE__ */ new Map();
469
+ for (const s of c) d.set(s, (d.get(s) || 0) + 1);
470
+ for (const [s, g] of a) {
471
+ const v = d.get(s);
472
+ v === void 0 ? a.delete(s) : g.length = v;
473
+ }
474
+ }), { orderedFields: x(() => {
475
+ if (e.mode.value === "in-place" || !e.fields.value.some((v) => ee(v))) return e.fields.value;
476
+ const c = [], d = [], s = [], g = (v, m) => {
477
+ const H = v.map((w) => {
478
+ var S;
479
+ return { field: w, order: o(w.fixedOrder) ? w.fixedOrder : void 0, sequence: ((S = n.get(w)) == null ? void 0 : S.sequence) || 0 };
480
+ }), O = new Set(H.filter((w) => w.order !== void 0).map((w) => w.order)), F = H.filter((w) => w.order === void 0).sort((w, S) => w.sequence - S.sequence);
481
+ let b = 1;
482
+ for (const w of F) {
483
+ for (; O.has(b); ) b++;
484
+ w.order = b++;
485
+ }
486
+ const p = H.sort((w, S) => w.order - S.order || w.sequence - S.sequence).map((w) => w.field);
487
+ return m === "right" ? p.reverse() : p;
488
+ };
489
+ for (const v of e.fields.value) {
490
+ const m = ee(v);
491
+ m === "left" ? c.push(v) : m === "right" ? s.push(v) : d.push(v);
492
+ }
493
+ return [...g(c, "left"), ...d, ...g(s, "right")];
494
+ }), getColumnKey: (c) => {
495
+ var d, s, g, v;
496
+ return (v = (g = (s = c.$_columnKey) != null ? s : (d = n.get(c)) == null ? void 0 : d.key) != null ? g : c.$_index) != null ? v : 0;
497
+ } };
498
+ }
499
+ function Sr(e) {
500
+ const a = me({}), n = me({}), l = me(), u = me(), o = me(), f = x(() => new Map(e.fields.value.map((C, y) => [C, y]))), c = x(() => e.fields.value.filter((C) => C.visible)), d = x(() => new Map(c.value.map((C, y) => [C, y]))), s = x(() => c.value.some((C) => ee(C))), g = x(() => s.value || e.isFixedHeader.value), v = x(() => c.value.some((C) => ee(C) === "right")), m = x(() => e.isFixedHeader.value && u.value !== void 0 ? `${u.value}px` : e.scrollBarWidth.value), H = x(() => {
501
+ const C = /* @__PURE__ */ new Map();
502
+ for (const y of ["left", "right"]) {
503
+ let P = 0;
504
+ const R = y === "left" ? c.value : [...c.value].reverse();
505
+ for (const T of R)
506
+ ee(T) === y && (C.set(T, P), P += a.value[String(f.value.get(T))] || 0);
507
+ }
508
+ return C;
509
+ });
510
+ let O = !1, F = !1, b, p = !1, w;
511
+ const S = /* @__PURE__ */ new Set();
512
+ function q(C, y) {
513
+ var T;
514
+ const P = ee(C);
515
+ if (!C.visible || !P) return { class: [], style: {} };
516
+ const R = P === "right" && y === "header" && e.isFixedHeader.value && e.scrollVisible.value ? (T = o.value) != null ? T : Number.parseFloat(m.value) || 0 : 0;
517
+ return {
518
+ class: ["vuetable-fixed-column", `vuetable-fixed-${P}`, `vuetable-fixed-${y}`],
519
+ style: { position: "sticky", [P]: `${(H.value.get(C) || 0) + R}px` }
520
+ };
521
+ }
522
+ function V(C, y = "body") {
523
+ if (!s.value || !C.visible || !ee(C)) return { class: [], style: {} };
524
+ const P = f.value.get(C);
525
+ if (P === void 0) return { class: [], style: {} };
526
+ const R = q(C, y);
527
+ return R["data-vuetable-column"] = String(P), R;
528
+ }
529
+ function re(C, y = "header") {
530
+ if (!s.value) return { class: [], style: {} };
531
+ const P = d.value.get(C[0]), R = C.length ? ee(C[0]) : void 0;
532
+ return !R || P === void 0 || !C.every((T, K) => c.value[P + K] === T && ee(T) === R) ? { class: [], style: {} } : q(R === "left" ? C[0] : C[C.length - 1], y);
533
+ }
534
+ function M(C) {
535
+ if (!e.isFixedHeader.value) return;
536
+ const y = n.value[String(f.value.get(C))];
537
+ return y === void 0 ? void 0 : `${y}px`;
538
+ }
539
+ function L() {
540
+ var xe, ve, Se;
541
+ if (b = void 0, F || !O) return;
542
+ const C = e.root(), y = C && g.value ? C.querySelector(":scope > .vuetable-body-wrapper") : null, P = C && g.value ? C.querySelector(":scope > .vuetable-head-wrapper") : null, R = y == null ? void 0 : y.querySelector(":scope > table.vuetable"), T = P == null ? void 0 : P.querySelector(":scope > table.vuetable"), K = new Set(g.value ? [C, y, P, R, T].filter((j) => !!j) : []), Ce = /* @__PURE__ */ new Map(), G = {};
543
+ let te, se, fe;
544
+ if (e.isFixedHeader.value) {
545
+ const j = (ve = (xe = R == null ? void 0 : R.tBodies[0]) == null ? void 0 : xe.rows[0]) == null ? void 0 : ve.cells;
546
+ if ((j == null ? void 0 : j.length) === c.value.length && Array.from(j).every((D) => D.colSpan === 1 && !D.classList.contains("vuetable-empty-result")) && c.value.forEach((D, N) => {
547
+ const W = j[N], z = W.getBoundingClientRect().width;
548
+ Ce.set(W, z), Number.isFinite(z) && z > 0 && (G[String(f.value.get(D))] = z, K.add(W));
549
+ }), e.scrollVisible.value && y && y.offsetWidth > 0) {
550
+ const D = window.getComputedStyle(y);
551
+ te = Math.max(0, y.offsetWidth - y.clientWidth - (Number.parseFloat(D.borderLeftWidth) || 0) - (Number.parseFloat(D.borderRightWidth) || 0));
552
+ }
553
+ if (R && c.value.length > 0 && Object.keys(G).length === c.value.length) {
554
+ const D = R.getBoundingClientRect().width;
555
+ if (Number.isFinite(D) && D > 0) {
556
+ const N = window.getComputedStyle(R), W = N.borderCollapse === "collapse" ? 0 : Number.parseFloat(N.borderSpacing) || 0, z = e.scrollVisible.value ? (te != null ? te : Number.parseFloat(e.scrollBarWidth.value) || 0) + W : 0;
557
+ fe = `${D + z}px`;
558
+ }
559
+ }
560
+ const Q = T == null ? void 0 : T.querySelector(":scope > thead > tr > .vuetable-th-gutter"), ne = Q == null ? void 0 : Q.getBoundingClientRect().width;
561
+ Q && ne !== void 0 && Number.isFinite(ne) && ne > 0 && (se = ne, K.add(Q));
562
+ }
563
+ const ie = {};
564
+ for (const j of c.value) {
565
+ if (!ee(j)) continue;
566
+ const Q = String(f.value.get(j)), ne = `[data-vuetable-column="${Q}"]`, D = [
567
+ `:scope > .vuetable-body-wrapper > table.vuetable > tbody > tr > ${ne}`,
568
+ `:scope > .vuetable-head-wrapper > table.vuetable > thead > tr > ${ne}, :scope > .vuetable-body-wrapper > table.vuetable > thead > tr > ${ne}`
569
+ ];
570
+ for (const N of D) {
571
+ const W = C && s.value ? C.querySelector(N) : null, z = W ? (Se = Ce.get(W)) != null ? Se : W.getBoundingClientRect().width : void 0;
572
+ if (W && z !== void 0 && Number.isFinite(z) && z > 0) {
573
+ ie[Q] = z, K.add(W);
574
+ break;
575
+ }
576
+ }
577
+ }
578
+ for (const j of S)
579
+ K.has(j) || (w == null || w.unobserve(j), S.delete(j));
580
+ for (const j of K)
581
+ S.has(j) || (w == null || w.observe(j), S.add(j));
582
+ pn(a.value, ie) || (a.value = ie);
583
+ const we = !pn(n.value, G), ue = u.value !== te;
584
+ we && (n.value = G), ue && (u.value = te), l.value !== fe && (l.value = fe), o.value = se, (we || ue) && E();
585
+ }
586
+ function E() {
587
+ !O || F || b !== void 0 || !g.value && S.size === 0 && Object.keys(a.value).length === 0 || (p = typeof requestAnimationFrame == "function", b = p ? requestAnimationFrame(L) : setTimeout(L, 0));
588
+ }
589
+ return Sn(() => {
590
+ O = !0, typeof ResizeObserver != "undefined" && (w = new ResizeObserver(E)), window.addEventListener("resize", E), E();
591
+ }), Jn(E), Ct(() => {
592
+ F = !0, O = !1, w == null || w.disconnect(), S.clear(), window.removeEventListener("resize", E), b !== void 0 && (p ? cancelAnimationFrame(b) : clearTimeout(b));
593
+ }), { enabled: s, hasFixedRightColumn: v, headerGutterWidth: m, headerTableWidth: l, getHeaderWidth: M, getCellProps: V, getSpanProps: re, schedule: E };
594
+ }
595
+ function _r(e) {
596
+ return typeof e == "string" && e.trim() !== "" || typeof e == "number" && Number.isFinite(e) ? e : null;
597
+ }
598
+ function Pr(e) {
599
+ const a = x(() => e.fields.value.filter((f) => f.visible)), n = x(() => {
600
+ const f = e.groupBy();
601
+ return f == null ? [] : a.value.reduce((c, d, s) => {
602
+ const g = _r(f in d && Object.prototype.hasOwnProperty.call(d, f) ? d[f] : null), v = c[c.length - 1];
603
+ return v && v.value === g ? (v.fields.push(d), v.colspan++, v.endIndex = s) : c.push({ key: `${typeof g}:${String(g)}:${s}`, value: g, fields: [d], colspan: 1, startIndex: s, endIndex: s }), c;
604
+ }, []);
605
+ }), l = x(() => n.value.flatMap((f) => {
606
+ const c = [];
607
+ return f.fields.forEach((d, s) => {
608
+ const g = ee(d), v = c[c.length - 1];
609
+ if (v && v.fixed === g)
610
+ v.fields.push(d), v.colspan++, v.endIndex++, v.isGroupEnd = v.endIndex === f.endIndex;
611
+ else {
612
+ const m = f.startIndex + s;
613
+ c.push(Fe(X({}, f), { key: `${f.key}:${g || "none"}:${m}`, groupKey: f.key, fields: [d], colspan: 1, startIndex: m, endIndex: m, fixed: g, isGroupStart: m === f.startIndex, isGroupEnd: m === f.endIndex }));
614
+ }
615
+ }), c;
616
+ })), u = x(() => {
617
+ const f = /* @__PURE__ */ new Map();
618
+ for (const c of n.value) {
619
+ f.set(c.fields[0], ["vuetable-group-start"]);
620
+ const d = c.fields[c.fields.length - 1];
621
+ f.set(d, [...f.get(d) || [], "vuetable-group-end"]);
622
+ }
623
+ return f;
624
+ });
625
+ return { scope: x(() => ({
626
+ fields: e.fields.value,
627
+ visibleFields: a.value,
628
+ groups: n.value,
629
+ headerGroups: l.value,
630
+ getCellProps: e.getCellProps,
631
+ getSpanProps: e.getSpanProps,
632
+ columnCount: a.value.length,
633
+ isFixedHeader: e.isFixedHeader.value,
634
+ scrollVisible: e.scrollVisible.value,
635
+ scrollBarWidth: e.scrollBarWidth.value
636
+ })), groupClass: (f) => u.value.get(f) || [] };
637
+ }
638
+ const kr = {
639
+ table: {
640
+ tableWrapper: "",
641
+ tableHeaderClass: "fixed",
642
+ tableBodyClass: "fixed",
643
+ tableClass: "ui blue selectable unstackable celled table",
644
+ loadingClass: "loading",
645
+ ascendingIcon: "blue chevron up icon",
646
+ descendingIcon: "blue chevron down icon",
647
+ ascendingClass: "sorted-asc",
648
+ descendingClass: "sorted-desc",
649
+ sortableIcon: "grey sort icon",
650
+ handleIcon: "grey sidebar icon"
651
+ },
652
+ pagination: {
653
+ wrapperClass: "ui right floated pagination menu",
654
+ activeClass: "active large",
655
+ disabledClass: "disabled",
656
+ pageClass: "item",
657
+ linkClass: "icon item",
658
+ paginationClass: "ui bottom attached segment grid",
659
+ paginationInfoClass: "left floated left aligned six wide column",
660
+ dropdownClass: "ui search dropdown",
661
+ icons: {
662
+ first: "angle double left icon",
663
+ prev: "left chevron icon",
664
+ next: "right chevron icon",
665
+ last: "angle double right icon"
666
+ }
667
+ },
668
+ paginationInfo: {
669
+ infoClass: "left floated left aligned six wide column"
670
+ }
671
+ };
672
+ function Or(e, a = {}, n = !1) {
673
+ const l = kr[e], u = n ? Object.fromEntries(Object.entries(l).map(([f, c]) => [
674
+ f,
675
+ typeof c == "object" ? Object.fromEntries(Object.keys(c).map((d) => [d, ""])) : ""
676
+ ])) : l, o = X(X({}, u), a);
677
+ if (e === "table" && !n)
678
+ for (const f of ["tableClass", "ascendingIcon", "descendingIcon", "sortableIcon", "handleIcon"])
679
+ Object.prototype.hasOwnProperty.call(a || {}, f) || (o[f] += f === "tableClass" ? " vuetable-semantic-table" : " vuetable-semantic-icon");
680
+ return o;
681
+ }
682
+ var Fr = Object.defineProperty, Rr = Object.defineProperties, $r = Object.getOwnPropertyDescriptors, gn = Object.getOwnPropertySymbols, qr = Object.prototype.hasOwnProperty, Hr = Object.prototype.propertyIsEnumerable, mn = (e, a, n) => a in e ? Fr(e, a, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[a] = n, le = (e, a) => {
683
+ for (var n in a || (a = {}))
684
+ qr.call(a, n) && mn(e, n, a[n]);
685
+ if (gn)
686
+ for (var n of gn(a))
687
+ Hr.call(a, n) && mn(e, n, a[n]);
688
+ return e;
689
+ }, gt = (e, a) => Rr(e, $r(a)), Tr = (e, a, n) => new Promise((l, u) => {
690
+ var o = (d) => {
691
+ try {
692
+ c(n.next(d));
693
+ } catch (s) {
694
+ u(s);
695
+ }
696
+ }, f = (d) => {
697
+ try {
698
+ c(n.throw(d));
699
+ } catch (s) {
700
+ u(s);
701
+ }
702
+ }, c = (d) => d.done ? l(d.value) : Promise.resolve(d.value).then(o, f);
703
+ c((n = n.apply(e, a)).next());
704
+ });
705
+ const Cn = /* @__PURE__ */ new WeakMap(), qe = oe({
706
+ name: "Vuetable",
707
+ inheritAttrs: A,
708
+ components: {
709
+ RenderBoundary: br,
710
+ SlotOutlet: Pn,
711
+ VuetableRowHeader: Pt,
712
+ VuetableColGroup: vn,
713
+ VuetableColGutter: He,
714
+ VuetableDetailHost: kt,
715
+ "vuetable-field-checkbox": We,
716
+ "vuetable-field-handle": Ke,
717
+ "vuetable-field-sequence": Ge
718
+ },
719
+ props: {
720
+ fields: { type: Array, default: void 0 },
721
+ groupBy: { type: String, default: null },
722
+ fixedMode: { type: String, default: "edges", validator: (e) => e === "edges" || e === "in-place" },
723
+ loadOnStart: { type: Boolean, required: !1, default: !0 },
724
+ apiUrl: { type: String, required: !1, default: "" },
725
+ httpMethod: { type: String, required: !1, default: "get" },
726
+ reactiveApiUrl: { type: Boolean, required: !1, default: !0 },
727
+ apiMode: { type: Boolean, required: !1, default: !0 },
728
+ data: { type: null, required: !1, default: null },
729
+ dataManager: { type: Function, required: !1, default: null },
730
+ dataPath: { type: String, required: !1, default: "data" },
731
+ paginationPath: { type: String, required: !1, default: "links.pagination" },
732
+ queryParams: { type: [Object, Function], required: !1, default: () => ({
733
+ sort: "sort",
734
+ page: "page",
735
+ perPage: "per_page"
736
+ }) },
737
+ appendParams: { type: Object, required: !1, default: () => ({}) },
738
+ httpOptions: { type: Object, required: !1, default: () => ({}) },
739
+ httpFetch: { type: Function, required: !1, default: null },
740
+ perPage: { type: Number, required: !1, default: 10 },
741
+ initialPage: { type: Number, required: !1, default: 1 },
742
+ firstPage: { type: Number, required: !1, default: 1 },
743
+ sortOrder: { type: Array, required: !1, default: () => I([]).value },
744
+ multiSort: { type: Boolean, required: !1, default: !1 },
745
+ tableHeight: { type: String, required: !1, default: null },
746
+ multiSortKey: { type: String, required: !1, default: "alt" },
747
+ rowClass: { type: [String, Function], required: !1, default: "" },
748
+ detailRowComponent: { type: [String, Object], required: !1, default: "" },
749
+ detailRowTransition: { type: String, required: !1, default: "" },
750
+ detailRowClass: { type: [String, Function], required: !1, default: "vuetable-detail-row" },
751
+ detailRowOptions: { type: Object, required: !1, default: () => ({}) },
752
+ trackBy: { type: String, required: !1, default: "id" },
753
+ css: { type: Object, required: !1, default: () => ({}) },
754
+ unstyled: { type: Boolean, required: !1, default: void 0 },
755
+ minRows: { type: Number, required: !1, default: 0 },
756
+ silent: { type: Boolean, required: !1, default: !1 },
757
+ noDataTemplate: { type: String, required: !1, default: "No Data Available" },
758
+ showSortIcons: { type: Boolean, required: !1, default: !0 },
759
+ headerRows: { type: Array, required: !1, default: () => ["VuetableRowHeader"] },
760
+ transform: { type: Function, required: !1, default: null },
761
+ sortParams: { type: Function, required: !1, default: null },
762
+ fieldPrefix: { type: String, required: !1, default: "vuetable-field-" },
763
+ eventPrefix: { type: String, required: !1, default: "vuetable:" }
764
+ },
765
+ computed: {
766
+ $_css() {
767
+ return this.tableCss;
768
+ }
769
+ },
770
+ setup(e, { emit: a, slots: n, attrs: l }) {
771
+ var u;
772
+ const o = wn(), f = lr(e), c = I(), d = I(0);
773
+ let s = le(le({}, e), l), g = Object.keys(n).length > 0;
774
+ fn(() => {
775
+ var t, r, i, h;
776
+ if (A) {
777
+ const Y = o == null ? void 0 : o.proxy;
778
+ (F.hasDeclarations() || Be("default") || (t = Y == null ? void 0 : Y.$slots) != null && t.default || (h = (i = (r = Y == null ? void 0 : Y.$vnode) == null ? void 0 : r.data) == null ? void 0 : i.scopedSlots) != null && h.default) && d.value++;
779
+ return;
780
+ }
781
+ const k = le(le({}, e), l), B = Object.keys(k), J = B.length === Object.keys(s).length && B.every((Y) => k[Y] === s[Y]), Z = Object.keys(n).length > 0;
782
+ (J || g || Z) && d.value++, g = Z, s = k;
783
+ });
784
+ const v = x(() => o == null ? void 0 : o.proxy), m = I([]), H = xr({ fields: m, mode: x(() => e.fixedMode || "edges"), warn: pe }), O = x({
785
+ get: () => H.orderedFields.value,
786
+ set: (t) => {
787
+ m.value = t;
788
+ }
789
+ }), F = wr({ fields: m, normalize: Ue, warn: pe }), b = F.getColumnSlot, p = I(null), w = x(() => {
790
+ const t = /* @__PURE__ */ new Map();
791
+ return (p.value || []).map((i) => {
792
+ const h = i[e.trackBy];
793
+ if (typeof h != "string" && (typeof h != "number" || !Number.isFinite(h))) return null;
794
+ const k = JSON.stringify(["id", h]);
795
+ return t.set(k, (t.get(k) || 0) + 1), k;
796
+ }).map((i, h) => i !== null && t.get(i) === 1 ? i : JSON.stringify(["index", h]));
797
+ }), S = I(null), q = I(e.initialPage), V = I([]), re = I([]), M = I(0), L = I("17px"), E = I(!1), C = Ve(e.sortOrder), y = A ? I(C) : me(C);
798
+ let P = !1;
799
+ const R = x({
800
+ get: () => y.value,
801
+ set: (t) => {
802
+ P = !0, y.value = Ve(t), Oe();
803
+ }
804
+ });
805
+ A && o && Zn(() => Object.defineProperty(o.proxy, "sortOrder", {
806
+ configurable: !0,
807
+ enumerable: !0,
808
+ get: () => R.value,
809
+ set: (t) => {
810
+ R.value = t;
811
+ }
812
+ }));
813
+ const T = (u = o == null ? void 0 : o.proxy) == null ? void 0 : u.$parent;
814
+ if (T) {
815
+ let t = Cn.get(T);
816
+ if (!t) {
817
+ t = /* @__PURE__ */ new Set(), Cn.set(T, t);
818
+ const i = t, h = () => i.forEach((k) => k());
819
+ A ? T.$on("hook:beforeUpdate", h) : fn(h, T.$);
820
+ }
821
+ t.add(ut);
822
+ const r = t;
823
+ Ct(() => r.delete(ut));
824
+ }
825
+ const K = I(e.httpOptions), Ce = I();
826
+ let G = 0;
827
+ const te = x(() => Or("table", e.css, f.value));
828
+ U(te, () => {
829
+ d.value++;
830
+ });
831
+ const se = x(() => {
832
+ var t, r;
833
+ return (t = p.value) != null && t.length ? ((r = p.value) == null ? void 0 : r.length) > 0 : !1;
834
+ }), fe = x(() => se.value && e.detailRowComponent !== ""), ie = x(() => p.value && typeof p.value[0][e.trackBy] != "undefined"), we = x(() => O.value.filter((t) => t.visible).length), ue = x(() => {
835
+ var t;
836
+ return ((t = p.value) == null ? void 0 : t.length) || 0;
837
+ }), xe = x(() => ue.value === 0 && e.noDataTemplate.length > 0), ve = x(() => {
838
+ var t;
839
+ return p.value === null || ((t = p.value) == null ? void 0 : t.length) === 0;
840
+ }), Se = x(() => ve.value ? !0 : p.value.length < e.minRows), j = x(() => ve.value ? e.minRows : p.value.length >= e.minRows ? 0 : e.minRows - p.value.length), Q = x(() => e.apiMode), ne = x(() => !e.apiMode), D = x(() => e.tableHeight != null), N = Sr({ fields: O, root: () => {
841
+ var t;
842
+ return (t = o == null ? void 0 : o.proxy) == null ? void 0 : t.$el;
843
+ }, isFixedHeader: D, scrollVisible: E, scrollBarWidth: L }), { getCellProps: W, getSpanProps: z, enabled: Fn } = N, Ne = Pr({ fields: O, groupBy: () => e.groupBy, isFixedHeader: D, scrollVisible: E, scrollBarWidth: N.headerGutterWidth, getCellProps: W, getSpanProps: z });
844
+ ze(), Oe(), Re(() => {
845
+ be || $("initialized", O.value);
846
+ });
847
+ let Te = !1, be = !1, he = null, ce = null;
848
+ function je() {
849
+ const t = c.value;
850
+ he && (!Te || !D.value || he !== t) && (he.removeEventListener("scroll", De), he = null), !(!Te || !D.value || !t) && (L.value = Ft() + "px", he !== t && (t.addEventListener("scroll", De), he = t), M.value = -1, De({ currentTarget: t }), Pe());
851
+ }
852
+ U(D, () => {
853
+ A ? Re(je) : je();
854
+ }, { flush: "post" }), Sn(() => {
855
+ Te = !0, e.loadOnStart && ae(), je();
856
+ }), Ct(() => {
857
+ Te = !1, be = !0, G++, ce !== null && (clearTimeout(ce), ce = null), je();
858
+ });
859
+ const Ot = Qn(gt(le({}, Yn(e)), {
860
+ vuetable: v,
861
+ $el: x(() => {
862
+ var t;
863
+ return (t = o == null ? void 0 : o.proxy) == null ? void 0 : t.$el;
864
+ }),
865
+ isApiMode: Q,
866
+ tableLayout: Ne.scope,
867
+ groupClass: Ne.groupClass,
868
+ getCellProps: W,
869
+ getSpanProps: z,
870
+ fixedColumnsEnabled: Fn,
871
+ hasFixedRightColumn: N.hasFixedRightColumn,
872
+ headerTableWidth: N.headerTableWidth,
873
+ scheduleFixedColumns: N.schedule,
874
+ getHeaderWidth: N.getHeaderWidth,
875
+ getColumnKey: H.getColumnKey,
876
+ tableFields: O,
877
+ tableData: p,
878
+ tablePagination: S,
879
+ selectedTo: V,
880
+ countVisibleFields: we,
881
+ dataIsAvailable: se,
882
+ countTableData: ue,
883
+ displayEmptyDataRow: xe,
884
+ useDetailRow: fe,
885
+ hasRowIdentifier: ie,
886
+ lessThanMinRows: Se,
887
+ blankRows: j,
888
+ scrollVisible: E,
889
+ scrollBarWidth: N.headerGutterWidth,
890
+ sortOrder: y,
891
+ css: te,
892
+ $_css: te,
893
+ unstyled: f,
894
+ isFieldSlot: qt,
895
+ getColumnSlot: b,
896
+ columnRevision: d,
897
+ onHeaderEvent: tn,
898
+ setData: Ze,
899
+ getFieldTitle: $t,
900
+ orderBy: At,
901
+ camelCase: Ht,
902
+ clearSortOrder: It,
903
+ toggleDetailRow: Nt,
904
+ showDetailRow: bt,
905
+ hideDetailRow: ht,
906
+ isVisibleDetailRow: ke,
907
+ reload: pt,
908
+ fireEvent: $,
909
+ singleColumnSort: it,
910
+ removeSortColumn: ot,
911
+ setSortColumnDirection: st,
912
+ clearSelectedValues: Lt,
913
+ showField: zt,
914
+ hideField: Ut,
915
+ toggleField: Jt,
916
+ onCheckboxToggled: nn,
917
+ onCheckboxToggledAll: rn,
918
+ checkIfRowIdentifierExists: Qe,
919
+ changePage: ln,
920
+ resetData: an,
921
+ refresh: yt,
922
+ isFieldComponent: Ye,
923
+ makeTitle: Me,
924
+ getAllQueryParams: nt,
925
+ isSortable: Ie,
926
+ getDefaultSortParam: rt,
927
+ getObjectValue: ge,
928
+ isSelectedRow: vt
929
+ }));
930
+ Xn("vuetable", Ot);
931
+ function Ft() {
932
+ const t = document.createElement("div"), r = document.createElement("div");
933
+ t.style.visibility = "hidden", t.style.width = "100px", r.style.width = "100%", t.appendChild(r), document.body.appendChild(t);
934
+ const i = t.offsetWidth;
935
+ t.style.overflow = "scroll";
936
+ const h = r.offsetWidth;
937
+ return document.body.removeChild(t), i - h;
938
+ }
939
+ function De(t) {
940
+ var r, i;
941
+ const h = t.currentTarget;
942
+ if (!h) return;
943
+ const k = h.scrollLeft;
944
+ if (k != M.value) {
945
+ const B = (i = (r = c.value) == null ? void 0 : r.parentElement) == null ? void 0 : i.querySelector(".vuetable-head-wrapper");
946
+ B != null && (B.scrollLeft = k), M.value = k;
947
+ }
948
+ }
949
+ function pe(t) {
950
+ e.silent || console.error(t);
951
+ }
952
+ function Rn(t, r) {
953
+ return [t, r.dataClass, ...Ne.groupClass(r), ...W(r).class];
954
+ }
955
+ function ze() {
956
+ if (typeof e.fields == "undefined") {
957
+ F.reconcile();
958
+ return;
959
+ }
960
+ m.value = e.fields.map(Ue);
961
+ }
962
+ function Ue(t, r) {
963
+ const i = {
964
+ name: "",
965
+ // title:
966
+ // this allow the code to detect undefined title
967
+ // and replace it with capitalized name instead
968
+ titleClass: "",
969
+ dataClass: "",
970
+ sortField: null,
971
+ formatter: null,
972
+ visible: !0,
973
+ width: null,
974
+ $_index: r
975
+ };
976
+ if (typeof t == "string")
977
+ return gt(le({}, i), {
978
+ name: Je(t),
979
+ title: Me(t)
980
+ });
981
+ const h = Object.assign({}, i, t);
982
+ return h.name = Je(h.name), h.title === void 0 && (h.title = Me(h.name)), h.formatter !== null && typeof h.formatter != "function" && (console.error(h.name + " field formatter must be a function"), h.formatter = null), h;
983
+ }
984
+ function Je(t) {
985
+ return t instanceof Object ? xn(mt(t)) : t.replace("__", e.fieldPrefix);
986
+ }
987
+ function Ze(t) {
988
+ t === null || typeof t == "undefined" || _e(t, ++G);
989
+ }
990
+ function _(t) {
991
+ return !be && t === G;
992
+ }
993
+ function _e(t, r) {
994
+ if (!(!_(r) || t === null || typeof t == "undefined") && ($("loading"), !!_(r))) {
995
+ if (Array.isArray(t)) {
996
+ if (p.value = t, !_(r)) return;
997
+ $("loaded");
998
+ return;
999
+ }
1000
+ Rt(t, r);
1001
+ }
1002
+ }
1003
+ function Rt(t, r, i = !1) {
1004
+ const h = ge(t, e.dataPath, null);
1005
+ if (!_(r) || (p.value = h, !_(r))) return;
1006
+ const k = ge(t, e.paginationPath, null);
1007
+ _(r) && (S.value = k, _(r) && (i && S.value === null && pe(`vuetable: pagination-path ${e.paginationPath} not found.
1008
+ It looks like the data returned from the server does not have pagination information
1009
+ or you may have set it incorrectly.
1010
+
1011
+ You can explicitly suppress this warning by setting pagination-path="".`), Re(() => {
1012
+ _(r) && (Qe(), _(r) && (Ae(), _(r) && ($("pagination-data", S.value), _(r) && $("loaded"))));
1013
+ })));
1014
+ }
1015
+ function Qe() {
1016
+ if (se.value)
1017
+ return ie.value ? !0 : (pe('Invalid your data! Use "track-by" prop to specify.'), !1);
1018
+ }
1019
+ function Me(t) {
1020
+ return Ye(t) ? "" : Xe(t.replace(".", " "));
1021
+ }
1022
+ function $t(t) {
1023
+ return typeof t.title == "function" ? t.title() : t.title;
1024
+ }
1025
+ function $n(t, r) {
1026
+ return ct(t) ? Vt(t, r) : ge(r, t.name, "");
1027
+ }
1028
+ function Ye(t) {
1029
+ return t instanceof Object ? !0 : t.slice(0, e.fieldPrefix.length) === e.fieldPrefix || t.slice(0, 2) === "__";
1030
+ }
1031
+ function qt(t) {
1032
+ return typeof Be(t) != "undefined";
1033
+ }
1034
+ function Be(t) {
1035
+ var r, i;
1036
+ return A ? (i = (r = o == null ? void 0 : o.proxy) == null ? void 0 : r.$scopedSlots) == null ? void 0 : i[t] : n[t];
1037
+ }
1038
+ function Xe(t) {
1039
+ return t.replace(/\w+/g, (r) => r.charAt(0).toUpperCase() + r.substring(1).toLowerCase());
1040
+ }
1041
+ function Ht(t, r = "_") {
1042
+ return t.split(r).map((i) => Xe(i)).join("");
1043
+ }
1044
+ function ae(t = et, r = Ee) {
1045
+ const i = ++G;
1046
+ if (ne.value) {
1047
+ Qt(i);
1048
+ return;
1049
+ }
1050
+ if (!_(i) || ($("loading"), !_(i))) return Promise.resolve();
1051
+ const h = le({}, K.value), k = nt();
1052
+ if (!_(i) || (h.params = Mt(le({}, k)), !_(i))) return Promise.resolve();
1053
+ const B = Tt(e.apiUrl, h);
1054
+ return _(i) && (Ce.value = B), B.then(
1055
+ (J) => {
1056
+ if (_(i))
1057
+ return t === et ? jt(J, i) : t(J);
1058
+ },
1059
+ (J) => {
1060
+ if (_(i))
1061
+ return r === Ee ? tt(J, i) : r(J);
1062
+ }
1063
+ ).catch(() => {
1064
+ if (_(i))
1065
+ return r === Ee ? tt(void 0, i) : r();
1066
+ });
1067
+ }
1068
+ function Tt(t, r) {
1069
+ return Tr(this, null, function* () {
1070
+ const i = e.httpFetch, h = e.httpMethod;
1071
+ return i ? i(t, r) : yield ar(t, r, h);
1072
+ });
1073
+ }
1074
+ function et(t) {
1075
+ jt(t, G);
1076
+ }
1077
+ function jt(t, r) {
1078
+ if (!_(r) || ($("load-success", t), !_(r))) return;
1079
+ const i = e.transform ? e.transform(t.data) : t.data;
1080
+ _(r) && Rt(i, r, !0);
1081
+ }
1082
+ function Ae() {
1083
+ be || (ce !== null && clearTimeout(ce), ce = setTimeout(() => {
1084
+ ce = null, Pe();
1085
+ }, 80));
1086
+ }
1087
+ function Pe() {
1088
+ be || Re(() => {
1089
+ if (be) return;
1090
+ const t = c.value;
1091
+ t != null && (E.value = t.scrollHeight > t.clientHeight, $("scrollbar-visible", E.value));
1092
+ });
1093
+ }
1094
+ function Ee(t) {
1095
+ tt(t, G);
1096
+ }
1097
+ function tt(t, r) {
1098
+ _(r) && (console.error("load-error", t), _(r) && ($("load-error", t), _(r) && $("loaded")));
1099
+ }
1100
+ function nt() {
1101
+ let t = {};
1102
+ return typeof e.queryParams == "function" ? (t = e.queryParams(y.value, q.value, e.perPage), typeof t == "object" ? t : {}) : (t[e.queryParams.sort] = Dt(), t[e.queryParams.page] = q.value, t[e.queryParams.perPage] = e.perPage, t);
1103
+ }
1104
+ function Dt() {
1105
+ var t;
1106
+ return !y.value || ((t = y.value[0]) == null ? void 0 : t.field) == "" ? "" : typeof e.sortParams == "function" ? e.sortParams(y.value) : rt();
1107
+ }
1108
+ function rt() {
1109
+ return y.value.map((t) => `${t.sortField}|${t.direction}`).join(",");
1110
+ }
1111
+ function Mt(t) {
1112
+ for (let r in e.appendParams)
1113
+ t[r] = e.appendParams[r];
1114
+ return t;
1115
+ }
1116
+ function Ie(t) {
1117
+ return t.sortField !== null;
1118
+ }
1119
+ function Bt(t) {
1120
+ if (!Ie(t))
1121
+ return !1;
1122
+ for (let r = 0; r < y.value.length; r++)
1123
+ if (lt(t, r))
1124
+ return r;
1125
+ return !1;
1126
+ }
1127
+ function lt(t, r) {
1128
+ return y.value[r].field === t.name && y.value[r].sortField === t.sortField;
1129
+ }
1130
+ function At(t, r) {
1131
+ if (!Ie(t)) return;
1132
+ const i = e.multiSortKey.toLowerCase() + "Key";
1133
+ e.multiSort && r[i] ? Et(t) : it(t), q.value = e.firstPage, (Q.value || e.dataManager) && ae();
1134
+ }
1135
+ function ye() {
1136
+ A || nr(y);
1137
+ }
1138
+ function at(t, r) {
1139
+ y.value.push({
1140
+ field: t.name,
1141
+ sortField: t.sortField,
1142
+ direction: r || "asc"
1143
+ }), ye();
1144
+ }
1145
+ function ot(t) {
1146
+ y.value.splice(t, 1), ye();
1147
+ }
1148
+ function st(t, r) {
1149
+ y.value[t].direction = r, ye();
1150
+ }
1151
+ function Et(t) {
1152
+ let r = Bt(t);
1153
+ r === !1 ? at(t, "asc") : y.value[r].direction === "asc" ? st(r, "desc") : ot(r);
1154
+ }
1155
+ function it(t) {
1156
+ if (y.value.length === 0) {
1157
+ at(t, "asc");
1158
+ return;
1159
+ }
1160
+ y.value.splice(1), lt(t, 0) ? y.value[0].direction = y.value[0].direction === "asc" ? "desc" : "asc" : y.value[0].direction = "asc", y.value[0].field = t.name, y.value[0].sortField = t.sortField, ye();
1161
+ }
1162
+ function It() {
1163
+ R.value = I([]).value;
1164
+ }
1165
+ function ut() {
1166
+ var t;
1167
+ if (!P) return;
1168
+ const r = A ? (t = o == null ? void 0 : o.proxy) == null ? void 0 : t.$options.propsData : o == null ? void 0 : o.vnode.props;
1169
+ (r == null ? void 0 : r.sortOrder) === void 0 && (r == null ? void 0 : r["sort-order"]) === void 0 || (P = !1, y.value = Ve(e.sortOrder), Oe());
1170
+ }
1171
+ function ct(t) {
1172
+ return typeof t.formatter == "function";
1173
+ }
1174
+ function Vt(t, r) {
1175
+ if (ct(t) && typeof t.formatter == "function")
1176
+ return t.formatter(ge(r, t.name), o == null ? void 0 : o.proxy);
1177
+ }
1178
+ function ge(t, r, i) {
1179
+ i = typeof i == "undefined" ? null : i;
1180
+ let h = t;
1181
+ return r.trim() != "" && r.split(".").forEach((B) => {
1182
+ if (h !== null && typeof h[B] != "undefined" && h[B] !== null)
1183
+ h = h[B];
1184
+ else {
1185
+ h = i;
1186
+ return;
1187
+ }
1188
+ }), h;
1189
+ }
1190
+ function dt(t) {
1191
+ vt(t) || V.value.push(t);
1192
+ }
1193
+ function ft(t) {
1194
+ V.value = V.value.filter((r) => r !== t);
1195
+ }
1196
+ function vt(t) {
1197
+ return V.value.indexOf(t) >= 0;
1198
+ }
1199
+ function Lt() {
1200
+ V.value = [];
1201
+ }
1202
+ function Wt() {
1203
+ q.value > e.firstPage && (q.value -= 1, ae());
1204
+ }
1205
+ function Kt() {
1206
+ q.value < S.value.last_page && (q.value += 1, ae());
1207
+ }
1208
+ function Gt(t) {
1209
+ t != q.value && t >= e.firstPage && t <= S.value.last_page && (q.value = t, ae());
1210
+ }
1211
+ function ke(t) {
1212
+ return re.value.indexOf(t) >= 0;
1213
+ }
1214
+ function bt(t) {
1215
+ ke(t) || re.value.push(t), Pe();
1216
+ }
1217
+ function ht(t) {
1218
+ ke(t) && (re.value.splice(
1219
+ re.value.indexOf(t),
1220
+ 1
1221
+ ), Ae());
1222
+ }
1223
+ function Nt(t) {
1224
+ ke(t) ? ht(t) : bt(t);
1225
+ }
1226
+ function zt(t) {
1227
+ t < 0 || t >= m.value.length || (m.value[t].visible = !0);
1228
+ }
1229
+ function Ut(t) {
1230
+ t < 0 || t >= m.value.length || (m.value[t].visible = !1);
1231
+ }
1232
+ function Jt(t) {
1233
+ t < 0 || t >= m.value.length || (m.value[t].visible = !m.value[t].visible);
1234
+ }
1235
+ function Zt(t = null, r = null, i = null) {
1236
+ return t = t === null ? 0 : t, r = r === null ? e.perPage : r, i = i === null ? q.value : i, {
1237
+ total: t,
1238
+ per_page: r,
1239
+ current_page: i,
1240
+ last_page: Math.ceil(t / r) || 0,
1241
+ next_page_url: "",
1242
+ prev_page_url: "",
1243
+ from: (i - 1) * r + 1,
1244
+ to: Math.min(i * r, t)
1245
+ };
1246
+ }
1247
+ function Ve(t) {
1248
+ const r = (i) => tr(i) || Object.isFrozen(mt(i));
1249
+ return r(t) || t.some(r) ? I(t.map((i) => le({}, i))).value : t;
1250
+ }
1251
+ function Oe() {
1252
+ let t = !1;
1253
+ y.value.forEach((r) => {
1254
+ const i = r.sortField || r.field;
1255
+ r.sortField !== i && (er(r, "sortField", i), t = !0);
1256
+ }), t && ye();
1257
+ }
1258
+ function qn() {
1259
+ Qt(++G);
1260
+ }
1261
+ function Qt(t) {
1262
+ if (_(t)) {
1263
+ if (e.data !== null && Array.isArray(e.data)) {
1264
+ _e(e.data, t);
1265
+ return;
1266
+ }
1267
+ e.dataManager ? Yt(t) : _e(e.data, t);
1268
+ }
1269
+ }
1270
+ function Hn() {
1271
+ Yt(++G);
1272
+ }
1273
+ function Yt(t) {
1274
+ if (!_(t)) return;
1275
+ const r = e.dataManager(y.value, Zt());
1276
+ en(r) ? r.then((i) => _e(i, t)) : _e(r, t);
1277
+ }
1278
+ function Xt(t) {
1279
+ return typeof t == "object" && t !== null;
1280
+ }
1281
+ function en(t) {
1282
+ return Xt(t) && typeof t.then == "function";
1283
+ }
1284
+ function Tn(t, r) {
1285
+ return typeof e.rowClass == "function" ? e.rowClass(t, r) : e.rowClass;
1286
+ }
1287
+ function jn(t, r) {
1288
+ return typeof e.detailRowClass == "function" ? e.detailRowClass(t, r) : e.detailRowClass;
1289
+ }
1290
+ function Dn(t, r, i) {
1291
+ return $("row-clicked", { data: t, index: r, event: i }), !0;
1292
+ }
1293
+ function Mn(t, r, i) {
1294
+ $("row-dblclicked", { data: t, index: r, event: i });
1295
+ }
1296
+ function Bn(t, r, i) {
1297
+ $("detail-row-clicked", { data: t, index: r, event: i });
1298
+ }
1299
+ function An(t, r, i, h) {
1300
+ $("cell-clicked", { data: t, index: r, field: i, event: h });
1301
+ }
1302
+ function En(t, r, i, h) {
1303
+ $("cell-dblclicked", { data: t, index: r, field: i, event: h });
1304
+ }
1305
+ function In(t, r, i, h) {
1306
+ $("cell-rightclicked", { data: t, index: r, field: i, event: h });
1307
+ }
1308
+ function Vn(t, r, i) {
1309
+ $("row-mouseover", { data: t, index: r, event: i });
1310
+ }
1311
+ function Ln(t, r) {
1312
+ $("field-event", t, r, o == null ? void 0 : o.proxy);
1313
+ }
1314
+ function tn(t, r) {
1315
+ $("header-event", t, r, o == null ? void 0 : o.proxy);
1316
+ }
1317
+ function nn(t, r, i) {
1318
+ if (i[e.trackBy] === void 0) {
1319
+ pe(`checkbox field: The "${e.trackBy}" field does not exist! Make sure the field you specify in "track-by" prop does exist.`);
1320
+ return;
1321
+ }
1322
+ const h = i[e.trackBy];
1323
+ t ? dt(h) : ft(h), $("checkbox-toggled", t, r, i);
1324
+ }
1325
+ function rn(t) {
1326
+ var r, i;
1327
+ t ? (r = p.value) == null || r.forEach((h) => {
1328
+ dt(h[e.trackBy]);
1329
+ }) : (i = p.value) == null || i.forEach((h) => {
1330
+ ft(h[e.trackBy]);
1331
+ }), $("checkbox-toggled-all", t);
1332
+ }
1333
+ function ln(t) {
1334
+ t === "prev" ? Wt() : t === "next" ? Kt() : Gt(t);
1335
+ }
1336
+ function pt() {
1337
+ return ae();
1338
+ }
1339
+ function $(t, ...r) {
1340
+ return a(`${e.eventPrefix}${t}`, ...r);
1341
+ }
1342
+ function Wn() {
1343
+ var t, r, i, h;
1344
+ if (F.discover((h = (t = Be("default")) == null ? void 0 : t()) != null ? h : A ? (i = (r = o == null ? void 0 : o.proxy) == null ? void 0 : r.$slots) == null ? void 0 : i.default : void 0), e.fields === void 0 && F.reconcile(), A) return {};
1345
+ const k = String(e.eventPrefix), B = [k, `${k}x`.replace(/-(\w)/g, (Z, Y) => Y.toUpperCase()).slice(0, -1)].map((Z) => `on${Z.charAt(0).toUpperCase()}${Z.slice(1)}`), J = {};
1346
+ for (const Z in l)
1347
+ if (Object.prototype.hasOwnProperty.call(l, Z)) {
1348
+ if (/^on[^a-z]/.test(Z)) {
1349
+ const Y = Z.replace(/(?:Once|Passive|Capture)+$/, "");
1350
+ if (!Z.startsWith("on:") && !/^on[A-Z][a-z0-9]*$/.test(Y) && (k === "" || B.some((Kn) => Y.startsWith(Kn)))) continue;
1351
+ }
1352
+ J[Z] = l[Z];
1353
+ }
1354
+ return J;
1355
+ }
1356
+ function yt() {
1357
+ return q.value = e.firstPage, ae();
1358
+ }
1359
+ function an() {
1360
+ const t = ++G;
1361
+ _(t) && (p.value = null, _(t) && (S.value = null, _(t) && $("data-reset")));
1362
+ }
1363
+ return U(() => e.multiSort, (t) => {
1364
+ !t && y.value.length > 1 && (y.value.splice(1), ye(), ae());
1365
+ }), U(() => e.apiUrl, (t, r) => e.reactiveApiUrl && t !== r && yt()), U(() => e.data, Ze, { immediate: !0 }), U([p, ue], () => {
1366
+ D.value && Re(Ae);
1367
+ }), U(() => e.tableHeight, (t, r) => {
1368
+ (t == null || r != null) && Pe();
1369
+ }), U(() => {
1370
+ var t;
1371
+ return { source: e.fields, fields: (t = e.fields) == null ? void 0 : t.map((r) => ({ source: r, fixed: typeof r == "object" && r !== null ? r.fixed : void 0, fixedOrder: typeof r == "object" && r !== null ? r.fixedOrder : void 0 })) };
1372
+ }, (t, r) => {
1373
+ var i;
1374
+ if (!r || t.source !== r.source || !t.fields || t.fields.length !== ((i = r.fields) == null ? void 0 : i.length) || t.fields.some((h, k) => {
1375
+ var B;
1376
+ return h.source !== ((B = r.fields) == null ? void 0 : B[k].source);
1377
+ })) {
1378
+ ze();
1379
+ return;
1380
+ }
1381
+ t.fields.forEach((h, k) => {
1382
+ var B, J;
1383
+ h.fixed !== ((B = r.fields) == null ? void 0 : B[k].fixed) && (m.value[k].fixed = h.fixed), h.fixedOrder !== ((J = r.fields) == null ? void 0 : J[k].fixedOrder) && (m.value[k].fixedOrder = h.fixedOrder);
1384
+ });
1385
+ }, { immediate: !0 }), U(() => e.perPage, pt), U(() => e.sortOrder, (t, r) => {
1386
+ (t !== r || y.value === t || P) && (P = !1, y.value = Ve(t)), Oe();
1387
+ }, { flush: "sync" }), U(() => e.sortOrder.slice(), ut), U(() => e.httpOptions, (t) => {
1388
+ K.value = t;
1389
+ }, { immediate: !0 }), gt(le({}, A ? {} : { sortOrder: R }), { bodyRevision: d, getSlot: Be, getRootAttrs: Wn, tableContext: Ot, fireEvent: $, bodyWrapper: c, vuetable: v, tableFields: O, tableData: p, rowKeys: w, tablePagination: S, currentPage: q, selectedTo: V, visibleDetailRows: re, lastScrollPosition: M, scrollBarWidth: L, scrollVisible: E, order: y, optionsHttp: K, instanceFetch: Ce, tableCss: te, dataIsAvailable: se, useDetailRow: fe, hasRowIdentifier: ie, countVisibleFields: we, countTableData: ue, displayEmptyDataRow: xe, emptyDataTable: ve, lessThanMinRows: Se, blankRows: j, isApiMode: Q, isDataMode: ne, isFixedHeader: D, getScrollBarWidth: Ft, handleScroll: De, warn: pe, bodyClass: Rn, normalizeFields: ze, newField: Ue, normalizeFieldName: Je, setData: Ze, checkIfRowIdentifierExists: Qe, makeTitle: Me, getFieldTitle: $t, renderNormalField: $n, isFieldComponent: Ye, isFieldSlot: qt, titleCase: Xe, camelCase: Ht, loadData: ae, fetch: Tt, loadSuccess: et, updateHeader: Ae, checkScrollbarVisibility: Pe, loadFailed: Ee, getAllQueryParams: nt, getSortParam: Dt, getDefaultSortParam: rt, getAppendParams: Mt, isSortable: Ie, currentSortOrderPosition: Bt, fieldIsInSortOrderPosition: lt, orderBy: At, addSortColumn: at, removeSortColumn: ot, setSortColumnDirection: st, multiColumnSort: Et, singleColumnSort: it, clearSortOrder: It, hasFormatter: ct, callFormatter: Vt, getObjectValue: ge, selectId: dt, unselectId: ft, isSelectedRow: vt, clearSelectedValues: Lt, gotoPreviousPage: Wt, gotoNextPage: Kt, gotoPage: Gt, isVisibleDetailRow: ke, showDetailRow: bt, hideDetailRow: ht, toggleDetailRow: Nt, showField: zt, hideField: Ut, toggleField: Jt, makePagination: Zt, normalizeSortOrder: Oe, handleDataMode: qn, callDataManager: Hn, isObject: Xt, isPromiseObject: en, onRowClass: Tn, onDetailRowClass: jn, onRowClicked: Dn, onRowDoubleClicked: Mn, onDetailRowClick: Bn, onCellClicked: An, onCellDoubleClicked: En, onCellRightClicked: In, onMouseOver: Vn, onFieldEvent: Ln, onHeaderEvent: tn, onCheckboxToggled: nn, onCheckboxToggledAll: rn, changePage: ln, reload: pt, refresh: yt, resetData: an, VuetableColGroup: vn });
1390
+ }
1391
+ });
1392
+ var jr = function() {
1393
+ var e = this, a = e.$createElement, n = e._self._c || a;
1394
+ return n("div", e._b({ class: ["vuetable-root", e.tableCss.tableWrapper, { "vuetable-fixed-columns": e.tableContext.fixedColumnsEnabled, "vuetable-unstyled": e.tableContext.unstyled, "vuetable-styled": !e.tableContext.unstyled }] }, "div", e.getRootAttrs(), !1), [e.isFixedHeader ? n("div", { staticClass: "vuetable-head-wrapper" }, [n("table", { class: ["vuetable", "fixed-header", e.tableCss.tableClass, e.tableCss.tableHeaderClass, { "vuetable-styled": !e.tableContext.unstyled }], style: { width: e.tableContext.headerTableWidth, boxSizing: e.tableContext.headerTableWidth ? "border-box" : void 0 } }, [n("vuetable-col-group", { attrs: { "is-header": "" } }), e._v(" "), n("thead", [n("slot-outlet", { attrs: { content: e.getSlot("beforeHeader"), scope: e.tableContext.tableLayout } }), e._t("tableHeader", function() {
1395
+ return [e.tableContext.tableLayout.groups.length && e.getSlot("tableHeaderGroups") ? n("slot-outlet", { attrs: { content: e.getSlot("tableHeaderGroups"), scope: e.tableContext.tableLayout } }) : e.tableContext.tableLayout.groups.length ? n("tr", { staticClass: "vuetable-header-groups" }, [e._l(e.tableContext.tableLayout.headerGroups, function(l) {
1396
+ return n("th", { key: l.key, class: [e.tableContext.tableLayout.getSpanProps(l.fields).class, { "vuetable-group-start": l.isGroupStart, "vuetable-group-end": l.isGroupEnd }], style: e.tableContext.tableLayout.getSpanProps(l.fields).style, attrs: { colspan: l.colspan, scope: "colgroup" } }, [e._v(`
1397
+ ` + e._s(l.value) + `
1398
+ `)]);
1399
+ }), e.scrollVisible ? n("vuetable-col-gutter") : e._e()], 2) : e._e(), e._l(e.headerRows, function(l, u) {
1400
+ return n(l, { key: u, tag: "component", attrs: { index: u, vuetable: e.tableContext }, on: { "vuetable:header-event": e.onHeaderEvent } });
1401
+ })];
1402
+ }, null, e.tableContext.tableLayout), n("slot-outlet", { attrs: { content: e.getSlot("afterHeader"), scope: e.tableContext.tableLayout } })], 2)], 1)]) : e._e(), e._v(" "), n("render-boundary", { attrs: { revision: e.bodyRevision, "on-rendered": e.isFixedHeader || e.tableContext.fixedColumnsEnabled ? e.tableContext.scheduleFixedColumns : void 0 } }, [n("div", { ref: "bodyWrapper", staticClass: "vuetable-body-wrapper", class: { "fixed-header": e.isFixedHeader }, style: { height: e.tableHeight } }, [n("table", { class: ["vuetable", e.isFixedHeader ? "fixed-header" : "", e.tableCss.tableClass, e.tableCss.tableBodyClass, { "vuetable-styled": !e.tableContext.unstyled }] }, [n("vuetable-col-group"), e._v(" "), e.isFixedHeader ? e._e() : n("thead", [n("slot-outlet", { attrs: { content: e.getSlot("beforeHeader"), scope: e.tableContext.tableLayout } }), n("slot-outlet", { attrs: { content: e.getSlot("tableHeader"), scope: e.tableContext.tableLayout } }, [e.tableContext.tableLayout.groups.length && e.getSlot("tableHeaderGroups") ? n("slot-outlet", { attrs: { content: e.getSlot("tableHeaderGroups"), scope: e.tableContext.tableLayout } }) : e.tableContext.tableLayout.groups.length ? n("tr", { staticClass: "vuetable-header-groups" }, [e._l(e.tableContext.tableLayout.headerGroups, function(l) {
1403
+ return n("th", { key: l.key, class: [e.tableContext.tableLayout.getSpanProps(l.fields).class, { "vuetable-group-start": l.isGroupStart, "vuetable-group-end": l.isGroupEnd }], style: e.tableContext.tableLayout.getSpanProps(l.fields).style, attrs: { colspan: l.colspan, scope: "colgroup" } }, [e._v(`
1404
+ ` + e._s(l.value) + `
1405
+ `)]);
1406
+ }), e.scrollVisible ? n("vuetable-col-gutter") : e._e()], 2) : e._e(), e._l(e.headerRows, function(l, u) {
1407
+ return n(l, { key: u, tag: "component", attrs: { index: u, vuetable: e.tableContext }, on: { "vuetable:header-event": e.onHeaderEvent } });
1408
+ })], 2), n("slot-outlet", { attrs: { content: e.getSlot("afterHeader"), scope: e.tableContext.tableLayout } })], 1), e._v(" "), n("tfoot", [n("slot-outlet", { attrs: { content: e.getSlot("beforeFooter"), scope: e.tableContext.tableLayout } }), n("slot-outlet", { attrs: { content: e.getSlot("tableFooter"), scope: e.tableContext.tableLayout } }), n("slot-outlet", { attrs: { content: e.getSlot("afterFooter"), scope: e.tableContext.tableLayout } })], 1), e._v(" "), n("tbody", { staticClass: "vuetable-body" }, [e._l(e.tableData, function(l, u) {
1409
+ return [n("tr", { key: e.rowKeys[u] + ":0", class: e.onRowClass(l, u), attrs: { "item-index": u }, on: { click: function(o) {
1410
+ return e.onRowClicked(l, u, o);
1411
+ }, dblclick: function(o) {
1412
+ return e.onRowDoubleClicked(l, u, o);
1413
+ }, mouseover: function(o) {
1414
+ return e.onMouseOver(l, u, o);
1415
+ } } }, [e._l(e.tableFields, function(o) {
1416
+ return [o.visible ? [e.isFieldComponent(o.name) ? [n(o.name, { key: e.tableContext.getColumnKey(o) + ":0.0.0:" + e.tableContext.getColumnKey(o), tag: "component", class: e.bodyClass("vuetable-component", o), style: [{ width: o.width || void 0 }, e.tableContext.getCellProps(o).style], attrs: { "row-data": l, "row-index": u, "row-field": o, vuetable: e.tableContext, "data-vuetable-column": e.tableContext.getCellProps(o)["data-vuetable-column"] }, on: { "vuetable:field-event": e.onFieldEvent } })] : e.isFieldSlot(o.name) ? [n("td", { key: e.tableContext.getColumnKey(o) + ":0.0.0.0:" + e.tableContext.getColumnKey(o), class: e.bodyClass("vuetable-slot", o), style: [{ width: o.width || void 0 }, e.tableContext.getCellProps(o).style], attrs: { "data-vuetable-column": e.tableContext.getCellProps(o)["data-vuetable-column"] } }, [n("slot-outlet", { attrs: { content: e.getSlot(o.name), scope: { rowData: l, rowIndex: u, rowField: o } } })], 1)] : e.tableContext.getColumnSlot(o.name) ? [n("td", { key: e.tableContext.getColumnKey(o) + ":0.0.0.0:" + e.tableContext.getColumnKey(o), class: e.bodyClass("vuetable-td-" + o.name, o), style: [{ width: o.width || void 0 }, e.tableContext.getCellProps(o).style], attrs: { "data-vuetable-column": e.tableContext.getCellProps(o)["data-vuetable-column"] }, on: { click: function(f) {
1417
+ return e.onCellClicked(l, u, o, f);
1418
+ }, dblclick: function(f) {
1419
+ return e.onCellDoubleClicked(l, u, o, f);
1420
+ }, contextmenu: function(f) {
1421
+ return e.onCellRightClicked(l, u, o, f);
1422
+ } } }, [n("slot-outlet", { attrs: { content: e.tableContext.getColumnSlot(o.name), scope: { row: l, index: u, column: o } } })], 1)] : [n("td", { key: e.tableContext.getColumnKey(o) + ":0.0.0.0:" + e.tableContext.getColumnKey(o), class: e.bodyClass("vuetable-td-" + o.name, o), style: [{ width: o.width || void 0 }, e.tableContext.getCellProps(o).style], attrs: { "data-vuetable-column": e.tableContext.getCellProps(o)["data-vuetable-column"] }, domProps: { innerHTML: e._s(e.renderNormalField(o, l)) }, on: { click: function(f) {
1423
+ return e.onCellClicked(l, u, o, f);
1424
+ }, dblclick: function(f) {
1425
+ return e.onCellDoubleClicked(l, u, o, f);
1426
+ }, contextmenu: function(f) {
1427
+ return e.onCellRightClicked(l, u, o, f);
1428
+ } } })]] : e._e()];
1429
+ })], 2), e._v(" "), e.useDetailRow ? [n("transition", { key: e.rowKeys[u] + ":1.0:" + ("detail:" + e.rowKeys[u]), attrs: { name: e.detailRowTransition } }, [e.isVisibleDetailRow(l[e.trackBy]) ? n("tr", { key: "detail:" + e.rowKeys[u], class: e.onDetailRowClass(l, u), on: { click: function(o) {
1430
+ return e.onDetailRowClick(l, u, o);
1431
+ } } }, [n("td", { attrs: { colspan: e.countVisibleFields } }, [n("vuetable-detail-host", { attrs: { "detail-component": e.detailRowComponent, "row-data": l, "row-index": u, options: e.detailRowOptions } })], 1)]) : e._e()])] : e._e()];
1432
+ }), e._v(" "), e.displayEmptyDataRow ? [n("tr", [n("td", { staticClass: "vuetable-empty-result", attrs: { colspan: e.countVisibleFields }, domProps: { innerHTML: e._s(e.noDataTemplate) } })])] : e._e(), e._v(" "), e.lessThanMinRows ? e._l(e.blankRows, function(l) {
1433
+ return n("tr", { key: l, staticClass: "blank-row" }, [e._l(e.tableFields, function(u) {
1434
+ return [u.visible ? n("td", { key: e.tableContext.getColumnKey(u), class: [e.tableContext.groupClass(u), e.tableContext.getCellProps(u).class], style: e.tableContext.getCellProps(u).style, attrs: { "data-vuetable-column": e.tableContext.getCellProps(u)["data-vuetable-column"] } }, [e._v(`
1435
+  
1436
+ `)]) : e._e()];
1437
+ })], 2);
1438
+ }) : e._e()], 2)], 1)])])], 1);
1439
+ }, Dr = [];
1440
+ qe.render = jr;
1441
+ qe.staticRenderFns = Dr;
1442
+ const Ir = Object.assign(oe({
1443
+ name: "VuetableColumn",
1444
+ inheritAttrs: !1,
1445
+ props: {
1446
+ field: { type: String, required: !0 },
1447
+ label: String,
1448
+ sortable: Boolean,
1449
+ sortField: String,
1450
+ width: String,
1451
+ fixed: { type: String, validator: (e) => e === "left" || e === "right" },
1452
+ fixedOrder: Number,
1453
+ visible: { type: Boolean, default: !0 },
1454
+ headerClass: String,
1455
+ cellClass: String,
1456
+ group: { type: [String, Number], default: null }
1457
+ },
1458
+ render: () => null
1459
+ }), { __vuetableColumn: !0 }), Mr = [
1460
+ "initialized",
1461
+ "loading",
1462
+ "loaded",
1463
+ "pagination-data",
1464
+ "load-success",
1465
+ "scrollbar-visible",
1466
+ "load-error",
1467
+ "row-clicked",
1468
+ "row-dblclicked",
1469
+ "detail-row-clicked",
1470
+ "cell-clicked",
1471
+ "cell-dblclicked",
1472
+ "cell-rightclicked",
1473
+ "row-mouseover",
1474
+ "field-event",
1475
+ "header-event",
1476
+ "checkbox-toggled",
1477
+ "checkbox-toggled-all",
1478
+ "data-reset",
1479
+ "checkbox-toggled-custom"
1480
+ ];
1481
+ function Vr(e = {}) {
1482
+ var l, u;
1483
+ if (A) throw new Error("createVuetable requires Vue 3. Use the generic Vuetable component on Vue 2.");
1484
+ const a = (l = e.eventPrefix) != null ? l : "vuetable:", n = Fe(X({}, qe), {
1485
+ props: Fe(X({}, qe.props), {
1486
+ eventPrefix: Fe(X({}, qe.props.eventPrefix), {
1487
+ default: a,
1488
+ validator: (o) => o === a
1489
+ })
1490
+ }),
1491
+ emits: [...new Set([...Mr, ...(u = e.events) != null ? u : []].reduce((o, f) => {
1492
+ const c = `${a}${f}`, d = c.replace(/-(\w)/g, (s, g) => g.toUpperCase());
1493
+ return o.push(c, d.charAt(0).toLowerCase() + d.slice(1)), o;
1494
+ }, []))]
1495
+ });
1496
+ return delete n.install, n;
1497
+ }
1498
+ export {
1499
+ Ir as V,
1500
+ rr as a,
1501
+ He as b,
1502
+ qe as c,
1503
+ We as d,
1504
+ Ke as e,
1505
+ Ge as f,
1506
+ Pt as g,
1507
+ Vr as h,
1508
+ Er as i,
1509
+ Or as r,
1510
+ lr as u
1511
+ };