vuetable-next 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +419 -39
- package/dist/index.js +21 -0
- package/dist/portable/components/useVuetableField.d.ts +28 -0
- package/dist/portable/components/useVuetableFieldCheckbox.d.ts +19 -0
- package/dist/portable/components/useVuetablePagination.d.ts +34 -0
- package/dist/portable/components/useVuetablePaginationInfo.d.ts +25 -0
- package/dist/portable/helpers/toValue.d.ts +4 -0
- package/dist/portable/reactivity.d.ts +7 -0
- package/dist/public.d.ts +124 -0
- package/dist/selector.cjs +1 -0
- package/dist/style.css +3 -1
- package/dist/types/components/Vuetable.vue.d.ts +1258 -0
- package/dist/types/components/VuetableColGroup.vue.d.ts +33 -0
- package/dist/types/components/VuetableColGutter.vue.d.ts +5 -0
- package/dist/types/components/VuetableContext.d.ts +21 -0
- package/dist/types/components/VuetableCssSemanticUI.d.ts +35 -0
- package/dist/types/components/VuetableDetailHost.vue.d.ts +44 -0
- package/dist/types/components/VuetableFieldCheckbox.vue.d.ts +64 -0
- package/dist/types/components/VuetableFieldCheckboxMixin.vue.d.ts +66 -0
- package/dist/types/components/VuetableFieldHandle.vue.d.ts +31 -0
- package/dist/types/components/VuetableFieldMixin.vue.d.ts +53 -0
- package/dist/types/components/VuetableFieldSequence.vue.d.ts +42 -0
- package/dist/types/components/VuetablePagination.vue.d.ts +69 -0
- package/dist/types/components/VuetablePaginationDropdown.vue.d.ts +82 -0
- package/dist/types/components/VuetablePaginationInfo.vue.d.ts +44 -0
- package/dist/types/components/VuetablePaginationInfoMixin.vue.d.ts +47 -0
- package/dist/types/components/VuetablePaginationMixin.vue.d.ts +57 -0
- package/dist/types/components/VuetableRenderBoundary.d.ts +14 -0
- package/dist/types/components/VuetableRowHeader.vue.d.ts +182 -0
- package/dist/types/components/createVuetable.d.ts +6 -0
- package/dist/types/components/useVuetableField.d.ts +28 -0
- package/dist/types/components/useVuetableFieldCheckbox.d.ts +19 -0
- package/dist/types/components/useVuetablePagination.d.ts +34 -0
- package/dist/types/components/useVuetablePaginationInfo.d.ts +25 -0
- package/dist/types/helpers/toValue.d.ts +4 -0
- package/dist/types/index.d.ts +30 -0
- package/dist/vue2.cjs +18 -0
- package/dist/vue2.cjs.map +1 -0
- package/dist/vue2.js +1673 -0
- package/dist/vue2.js.map +1 -0
- package/dist/vue3.cjs +6 -0
- package/dist/vue3.cjs.map +1 -0
- package/dist/vue3.js +1835 -0
- package/dist/vue3.js.map +1 -0
- package/package.json +117 -87
- package/style.css +3 -0
- package/vue2.js +2 -0
- package/vue3.js +2 -0
- package/auto-imports.d.ts +0 -9
- package/dist/vuetable-next.d.ts +0 -728
- package/dist/vuetable-next.js +0 -3324
- package/dist/vuetable-next.js.map +0 -1
- package/dist/vuetable-next.umd.cjs +0 -11
- package/dist/vuetable-next.umd.cjs.map +0 -1
- package/src/assets/vue.svg +0 -1
- package/src/components/Demo.vue +0 -17
- package/src/components/Vuetable.vue +0 -1216
- package/src/components/VuetableColGroup.vue +0 -66
- package/src/components/VuetableColGutter.vue +0 -25
- package/src/components/VuetableCssSemanticUI.ts +0 -36
- package/src/components/VuetableFieldCheckbox.vue +0 -87
- package/src/components/VuetableFieldCheckboxMixin.vue +0 -46
- package/src/components/VuetableFieldHandle.vue +0 -41
- package/src/components/VuetableFieldMixin.vue +0 -30
- package/src/components/VuetableFieldSequence.vue +0 -43
- package/src/components/VuetablePagination.vue +0 -119
- package/src/components/VuetablePaginationDropdown.vue +0 -88
- package/src/components/VuetablePaginationInfo.vue +0 -51
- package/src/components/VuetablePaginationInfoMixin.vue +0 -64
- package/src/components/VuetablePaginationMixin.vue +0 -107
- package/src/components/VuetableRowHeader.vue +0 -195
- package/src/components/useVuetablePagination.ts +0 -57
- package/src/components/useVuetablePaginationInfo.ts +0 -41
- package/src/data/fields.ts +0 -102
- package/src/data/lang.ts +0 -4
- package/src/helpers/toValue.ts +0 -9
- package/src/index.ts +0 -57
- package/src/main.ts +0 -398
- package/src/style.css +0 -79
- package/src/vite-env.d.ts +0 -1
package/dist/vue3.js
ADDED
|
@@ -0,0 +1,1835 @@
|
|
|
1
|
+
var mn = Object.defineProperty, yn = Object.defineProperties;
|
|
2
|
+
var Cn = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var zt = Object.getOwnPropertySymbols;
|
|
4
|
+
var Pn = Object.prototype.hasOwnProperty, wn = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Ut = (e, n, a) => n in e ? mn(e, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[n] = a, S = (e, n) => {
|
|
6
|
+
for (var a in n || (n = {}))
|
|
7
|
+
Pn.call(n, a) && Ut(e, a, n[a]);
|
|
8
|
+
if (zt)
|
|
9
|
+
for (var a of zt(n))
|
|
10
|
+
wn.call(n, a) && Ut(e, a, n[a]);
|
|
11
|
+
return e;
|
|
12
|
+
}, Z = (e, n) => yn(e, Cn(n));
|
|
13
|
+
var Wt = (e, n, a) => new Promise((o, i) => {
|
|
14
|
+
var s = (m) => {
|
|
15
|
+
try {
|
|
16
|
+
u(a.next(m));
|
|
17
|
+
} catch (p) {
|
|
18
|
+
i(p);
|
|
19
|
+
}
|
|
20
|
+
}, d = (m) => {
|
|
21
|
+
try {
|
|
22
|
+
u(a.throw(m));
|
|
23
|
+
} catch (p) {
|
|
24
|
+
i(p);
|
|
25
|
+
}
|
|
26
|
+
}, u = (m) => m.done ? o(m.value) : Promise.resolve(m.value).then(s, d);
|
|
27
|
+
u((a = a.apply(e, n)).next());
|
|
28
|
+
});
|
|
29
|
+
import * as Ke from "vue-demi";
|
|
30
|
+
import { defineComponent as j, inject as W, ref as D, computed as w, markRaw as Zt, toRaw as ze, isVue2 as J, getCurrentInstance as kn, onBeforeUpdate as $n, shallowRef as Sn, nextTick as fe, onMounted as Qt, onBeforeUnmount as Fn, reactive as Ye, toRefs as Tn, provide as Dn, set as qn, watch as N, triggerRef as Rn, isReadonly as Hn, unref as On, isRef as Jt, onUpdated as En } from "vue-demi";
|
|
31
|
+
import Gt from "axios";
|
|
32
|
+
import { openBlock as f, createElementBlock as h, createElementVNode as R, normalizeStyle as L, resolveComponent as ae, Fragment as H, renderList as B, createBlock as X, resolveDynamicComponent as le, normalizeClass as $, createCommentVNode as A, mergeProps as jn, createVNode as Q, renderSlot as In, withCtx as _e, Transition as Mn, withDirectives as An, vShow as Bn, toDisplayString as Kt } from "vue";
|
|
33
|
+
import Vn from "mitt";
|
|
34
|
+
const Ln = j({
|
|
35
|
+
name: "vuetable-field-checkbox",
|
|
36
|
+
props: {
|
|
37
|
+
rowData: { type: Object, required: !1 },
|
|
38
|
+
rowIndex: { type: Number, required: !1 },
|
|
39
|
+
rowField: { type: Object, required: !1, default: null },
|
|
40
|
+
isHeader: { type: Boolean, required: !1, default: !1 },
|
|
41
|
+
title: { type: String, required: !1 }
|
|
42
|
+
},
|
|
43
|
+
setup(e) {
|
|
44
|
+
const n = W("vuetable"), a = D(null), o = w(() => (n.tableData || []).filter((p) => n.isSelectedRow(p[n.trackBy])).length), i = w(() => {
|
|
45
|
+
var p;
|
|
46
|
+
return o.value > 0 && o.value < (((p = n.tableData) == null ? void 0 : p.length) || 0);
|
|
47
|
+
});
|
|
48
|
+
function s(p, g) {
|
|
49
|
+
var r;
|
|
50
|
+
p && n.onCheckboxToggled(g.target.checked, (r = e.rowField) == null ? void 0 : r.name, p);
|
|
51
|
+
}
|
|
52
|
+
function d(p) {
|
|
53
|
+
n.onCheckboxToggledAll(p.target.checked);
|
|
54
|
+
}
|
|
55
|
+
function u(p) {
|
|
56
|
+
return !!p && n.isSelectedRow(p[n.trackBy]);
|
|
57
|
+
}
|
|
58
|
+
function m() {
|
|
59
|
+
return o.value > 0;
|
|
60
|
+
}
|
|
61
|
+
return { vuetable: n, checkbox: a, isIndeterminate: i, toggleCheckbox: s, toggleAllCheckbox: d, isSelected: u, isAllItemsInCurrentPageSelected: m };
|
|
62
|
+
}
|
|
63
|
+
}), V = (e, n) => {
|
|
64
|
+
const a = e.__vccOpts || e;
|
|
65
|
+
for (const [o, i] of n)
|
|
66
|
+
a[o] = i;
|
|
67
|
+
return a;
|
|
68
|
+
}, _n = {
|
|
69
|
+
key: 0,
|
|
70
|
+
class: "vuetable-th-component-checkbox"
|
|
71
|
+
}, Nn = [".indeterminate", "checked"], zn = {
|
|
72
|
+
key: 1,
|
|
73
|
+
class: "vuetable-td-component-checkbox"
|
|
74
|
+
}, Un = ["checked"];
|
|
75
|
+
function Wn(e, n, a, o, i, s) {
|
|
76
|
+
return e.isHeader ? (f(), h("th", _n, [
|
|
77
|
+
R("input", {
|
|
78
|
+
ref: "checkbox",
|
|
79
|
+
".indeterminate": e.isIndeterminate,
|
|
80
|
+
checked: e.isAllItemsInCurrentPageSelected(),
|
|
81
|
+
type: "checkbox",
|
|
82
|
+
onChange: n[0] || (n[0] = (d) => e.toggleAllCheckbox(d))
|
|
83
|
+
}, null, 40, Nn)
|
|
84
|
+
])) : (f(), h("td", zn, [
|
|
85
|
+
R("input", {
|
|
86
|
+
ref: "checkbox",
|
|
87
|
+
checked: e.isSelected(e.rowData),
|
|
88
|
+
type: "checkbox",
|
|
89
|
+
onChange: n[1] || (n[1] = (d) => e.toggleCheckbox(e.rowData, d))
|
|
90
|
+
}, null, 40, Un)
|
|
91
|
+
]));
|
|
92
|
+
}
|
|
93
|
+
const Ze = /* @__PURE__ */ V(Ln, [["render", Wn]]), Gn = j({
|
|
94
|
+
name: "vuetable-field-handle",
|
|
95
|
+
props: {
|
|
96
|
+
isHeader: { type: Boolean, required: !1, default: !1 },
|
|
97
|
+
title: { type: String, required: !1, default: "" }
|
|
98
|
+
},
|
|
99
|
+
setup() {
|
|
100
|
+
const e = W("vuetable");
|
|
101
|
+
function n(a, o = "") {
|
|
102
|
+
return typeof e.css.renderIcon == "undefined" ? `<i class="${a.join(" ")}" ${o}></i>` : e.css.renderIcon(a, o);
|
|
103
|
+
}
|
|
104
|
+
return { vuetable: e, renderIconTag: n };
|
|
105
|
+
}
|
|
106
|
+
}), Kn = ["innerHTML"], Yn = ["innerHTML"];
|
|
107
|
+
function Zn(e, n, a, o, i, s) {
|
|
108
|
+
return e.isHeader ? (f(), h("th", {
|
|
109
|
+
key: 0,
|
|
110
|
+
class: "vuetable-th-component-handle",
|
|
111
|
+
innerHTML: e.title
|
|
112
|
+
}, null, 8, Kn)) : (f(), h("td", {
|
|
113
|
+
key: 1,
|
|
114
|
+
class: "vuetable-td-component-handle",
|
|
115
|
+
innerHTML: e.renderIconTag(["handle-icon", e.vuetable.css.handleIcon])
|
|
116
|
+
}, null, 8, Yn));
|
|
117
|
+
}
|
|
118
|
+
const Qe = /* @__PURE__ */ V(Gn, [["render", Zn]]), Qn = j({
|
|
119
|
+
name: "vuetable-field-sequence",
|
|
120
|
+
props: {
|
|
121
|
+
rowIndex: { type: Number, required: !1, default: 0 },
|
|
122
|
+
isHeader: { type: Boolean, required: !1, default: !1 },
|
|
123
|
+
title: { type: String, required: !1, default: "" }
|
|
124
|
+
},
|
|
125
|
+
setup(e) {
|
|
126
|
+
const n = W("vuetable");
|
|
127
|
+
function a() {
|
|
128
|
+
return n.tablePagination ? n.tablePagination.from + e.rowIndex : 1 + e.rowIndex;
|
|
129
|
+
}
|
|
130
|
+
return { vuetable: n, renderSequence: a };
|
|
131
|
+
}
|
|
132
|
+
}), Jn = ["innerHTML"], Xn = ["innerHTML"];
|
|
133
|
+
function xn(e, n, a, o, i, s) {
|
|
134
|
+
return e.isHeader ? (f(), h("th", {
|
|
135
|
+
key: 0,
|
|
136
|
+
class: "vuetable-th-component-sequence",
|
|
137
|
+
innerHTML: e.title
|
|
138
|
+
}, null, 8, Jn)) : (f(), h("td", {
|
|
139
|
+
key: 1,
|
|
140
|
+
class: "vuetable-td-component-sequence",
|
|
141
|
+
innerHTML: e.renderSequence()
|
|
142
|
+
}, null, 8, Xn));
|
|
143
|
+
}
|
|
144
|
+
const Je = /* @__PURE__ */ V(Qn, [["render", xn]]), ea = j({
|
|
145
|
+
name: "vuetable-th-gutter",
|
|
146
|
+
setup() {
|
|
147
|
+
return { vuetable: W("vuetable") };
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
function ta(e, n, a, o, i, s) {
|
|
151
|
+
return f(), h("th", {
|
|
152
|
+
style: L({ width: e.vuetable.scrollBarWidth }),
|
|
153
|
+
class: "vuetable-th-gutter"
|
|
154
|
+
}, null, 4);
|
|
155
|
+
}
|
|
156
|
+
const Ue = /* @__PURE__ */ V(ea, [["render", ta], ["__scopeId", "data-v-11e7e3ce"]]), na = j({
|
|
157
|
+
name: "vuetable-row-header",
|
|
158
|
+
components: {
|
|
159
|
+
"vuetable-field-checkbox": Ze,
|
|
160
|
+
"vuetable-field-handle": Qe,
|
|
161
|
+
"vuetable-field-sequence": Je,
|
|
162
|
+
VuetableColGutter: Ue
|
|
163
|
+
},
|
|
164
|
+
props: {
|
|
165
|
+
vuetable: { type: Object, default: null }
|
|
166
|
+
},
|
|
167
|
+
setup() {
|
|
168
|
+
const e = W("vuetable");
|
|
169
|
+
function n(v) {
|
|
170
|
+
return v.replace(e.fieldPrefix, "");
|
|
171
|
+
}
|
|
172
|
+
function a(v, P) {
|
|
173
|
+
return [
|
|
174
|
+
`${v}-${o(P.name)}`,
|
|
175
|
+
P.titleClass || "",
|
|
176
|
+
i(P),
|
|
177
|
+
{ sortable: e.isSortable(P) }
|
|
178
|
+
];
|
|
179
|
+
}
|
|
180
|
+
function o(v) {
|
|
181
|
+
return typeof v == "string" && v.replace(/([A-Z])/g, (P) => "_" + P.toLowerCase()).replace(" ", "_").replace(".", "_");
|
|
182
|
+
}
|
|
183
|
+
function i(v) {
|
|
184
|
+
const P = m(v);
|
|
185
|
+
return P !== !1 ? e.sortOrder[P].direction == "asc" ? e.css.ascendingClass : e.css.descendingClass : "";
|
|
186
|
+
}
|
|
187
|
+
function s(v) {
|
|
188
|
+
const P = m(v);
|
|
189
|
+
return P === !1 ? e.css.sortableIcon : e.sortOrder[P].direction == "asc" ? e.css.ascendingIcon : e.css.descendingIcon;
|
|
190
|
+
}
|
|
191
|
+
function d(v) {
|
|
192
|
+
return m(v) !== !1;
|
|
193
|
+
}
|
|
194
|
+
function u(v) {
|
|
195
|
+
return e.isSortable(v) && e.css.sortableIcon != "";
|
|
196
|
+
}
|
|
197
|
+
function m(v) {
|
|
198
|
+
if (!e.isSortable(v))
|
|
199
|
+
return !1;
|
|
200
|
+
for (let P = 0; P < e.sortOrder.length; P++)
|
|
201
|
+
if (p(v, P))
|
|
202
|
+
return P;
|
|
203
|
+
return !1;
|
|
204
|
+
}
|
|
205
|
+
function p(v, P) {
|
|
206
|
+
return e.sortOrder[P].field === v.name && e.sortOrder[P].sortField === v.sortField;
|
|
207
|
+
}
|
|
208
|
+
function g(v) {
|
|
209
|
+
const P = r(v);
|
|
210
|
+
if (P.length > 0 && d(v) || u(v)) {
|
|
211
|
+
const I = `opacity:${b(v)};position:relative;float:right`, M = e.showSortIcons ? k(["sort-icon", s(v)], `style="${I}"`) : "";
|
|
212
|
+
return P + " " + M;
|
|
213
|
+
}
|
|
214
|
+
return P;
|
|
215
|
+
}
|
|
216
|
+
function r(v) {
|
|
217
|
+
return typeof v.title == "function" ? v.title() : typeof v.title == "undefined" ? v.name.toString().replace(".", " ") : v.title;
|
|
218
|
+
}
|
|
219
|
+
function b(v) {
|
|
220
|
+
let M = 0.3;
|
|
221
|
+
const K = e.sortOrder.length, y = m(v);
|
|
222
|
+
return 1 - K * M < 0.3 && (M = (1 - 0.3) / (K - 1)), 1 - (y === !1 ? 0 : y) * M;
|
|
223
|
+
}
|
|
224
|
+
function k(v, P = "") {
|
|
225
|
+
return typeof e.css.renderIcon == "undefined" ? `<i class="${v.join(" ")}" ${P}></i>` : e.css.renderIcon(v, P);
|
|
226
|
+
}
|
|
227
|
+
function F(v, P) {
|
|
228
|
+
e.orderBy(v, P);
|
|
229
|
+
}
|
|
230
|
+
return { headerTable: e, stripPrefix: n, headerClass: a, toSnakeCase: o, sortClass: i, sortIcon: s, isInCurrentSortGroup: d, hasSortableIcon: u, currentSortOrderPosition: m, fieldIsInSortOrderPosition: p, renderTitle: g, getTitle: r, sortIconOpacity: b, renderIconTag: k, onColumnHeaderClicked: F, VuetableColGutter: Ue };
|
|
231
|
+
}
|
|
232
|
+
}), aa = ["innerHTML", "onClick"], la = ["id", "innerHTML", "onClick"];
|
|
233
|
+
function oa(e, n, a, o, i, s) {
|
|
234
|
+
const d = ae("VuetableColGutter");
|
|
235
|
+
return f(), h("tr", null, [
|
|
236
|
+
(f(!0), h(H, null, B(e.headerTable.tableFields, (u, m) => (f(), h(H, null, [
|
|
237
|
+
u.visible ? (f(), h(H, { key: 0 }, [
|
|
238
|
+
e.headerTable.isFieldComponent(u.name) ? (f(), X(le(u.name), {
|
|
239
|
+
key: m,
|
|
240
|
+
"is-header": "",
|
|
241
|
+
vuetable: e.headerTable,
|
|
242
|
+
"row-field": u,
|
|
243
|
+
title: e.renderTitle(u),
|
|
244
|
+
class: $(e.headerClass("vuetable-th-component", u)),
|
|
245
|
+
style: L({ width: u.width }),
|
|
246
|
+
"onVuetable:headerEvent": e.headerTable.onHeaderEvent,
|
|
247
|
+
onClick: (p) => e.onColumnHeaderClicked(u, p)
|
|
248
|
+
}, null, 40, ["vuetable", "row-field", "title", "class", "style", "onVuetable:headerEvent", "onClick"])) : e.headerTable.isFieldSlot(u.name) ? (f(), h("th", {
|
|
249
|
+
key: m,
|
|
250
|
+
class: $(e.headerClass("vuetable-th-slot", u)),
|
|
251
|
+
style: L({ width: u.width }),
|
|
252
|
+
innerHTML: e.renderTitle(u),
|
|
253
|
+
onClick: (p) => e.onColumnHeaderClicked(u, p)
|
|
254
|
+
}, null, 14, aa)) : (f(), h("th", {
|
|
255
|
+
key: m,
|
|
256
|
+
id: "_" + u.name,
|
|
257
|
+
class: $(e.headerClass("vuetable-th", u)),
|
|
258
|
+
style: L({ width: u.width }),
|
|
259
|
+
innerHTML: e.renderTitle(u),
|
|
260
|
+
onClick: (p) => e.onColumnHeaderClicked(u, p)
|
|
261
|
+
}, null, 14, la))
|
|
262
|
+
], 64)) : A("", !0)
|
|
263
|
+
], 64))), 256)),
|
|
264
|
+
e.headerTable.scrollVisible ? (f(), X(d, { key: 0 })) : A("", !0)
|
|
265
|
+
]);
|
|
266
|
+
}
|
|
267
|
+
const Xt = /* @__PURE__ */ V(na, [["render", oa]]), ia = j({
|
|
268
|
+
name: "vuetable-col-group",
|
|
269
|
+
props: {
|
|
270
|
+
isHeader: { type: Boolean, required: !1, default: !1 }
|
|
271
|
+
},
|
|
272
|
+
setup() {
|
|
273
|
+
const e = W("vuetable");
|
|
274
|
+
function n(a, o) {
|
|
275
|
+
let i = typeof a.name == "object" && a.name !== null ? a.name.name || "component" : a.name;
|
|
276
|
+
return i = i.replace(e.fieldPrefix, ""), [`vuetable-col-${i}`, a.titleClass, `${i}-${o}`];
|
|
277
|
+
}
|
|
278
|
+
return { vuetable: e, columnClass: n };
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
function ra(e, n, a, o, i, s) {
|
|
282
|
+
return f(), h("colgroup", null, [
|
|
283
|
+
(f(!0), h(H, null, B(e.vuetable.tableFields, (d, u) => (f(), h(H, null, [
|
|
284
|
+
d.visible ? (f(), h("col", {
|
|
285
|
+
key: u,
|
|
286
|
+
style: L({ width: d.width }),
|
|
287
|
+
class: $(e.columnClass(d, u))
|
|
288
|
+
}, null, 6)) : A("", !0)
|
|
289
|
+
], 64))), 256)),
|
|
290
|
+
e.isHeader && e.vuetable.scrollVisible ? (f(), h("col", {
|
|
291
|
+
key: 0,
|
|
292
|
+
style: L({ width: e.vuetable.scrollBarWidth }),
|
|
293
|
+
class: "vuetable-col-gutter"
|
|
294
|
+
}, null, 4)) : A("", !0)
|
|
295
|
+
]);
|
|
296
|
+
}
|
|
297
|
+
const Yt = /* @__PURE__ */ V(ia, [["render", ra]]), sa = j({
|
|
298
|
+
name: "VuetableDetailHost",
|
|
299
|
+
props: {
|
|
300
|
+
detailComponent: { type: [String, Object], default: "" },
|
|
301
|
+
rowData: { type: Object, required: !0 },
|
|
302
|
+
rowIndex: { type: Number, required: !0 },
|
|
303
|
+
options: { type: Object, default: () => ({}) }
|
|
304
|
+
},
|
|
305
|
+
setup(e) {
|
|
306
|
+
const n = W("vuetable"), a = w(() => n.vuetable), o = w(() => typeof e.detailComponent == "object" ? Zt(ze(e.detailComponent)) : e.detailComponent);
|
|
307
|
+
return { tableContext: n, vuetable: a, resolvedDetailComponent: o };
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
function ua(e, n, a, o, i, s) {
|
|
311
|
+
return f(), X(le(e.resolvedDetailComponent), {
|
|
312
|
+
"row-data": e.rowData,
|
|
313
|
+
"row-index": e.rowIndex,
|
|
314
|
+
vuetable: e.tableContext,
|
|
315
|
+
options: e.options
|
|
316
|
+
}, null, 8, ["row-data", "row-index", "vuetable", "options"]);
|
|
317
|
+
}
|
|
318
|
+
const ca = /* @__PURE__ */ V(sa, [["render", ua]]), Xe = (e, { slots: n }) => {
|
|
319
|
+
var a;
|
|
320
|
+
return (a = n.default) == null ? void 0 : a.call(n)[0];
|
|
321
|
+
};
|
|
322
|
+
Xe.props = ["revision"];
|
|
323
|
+
Xe.inheritAttrs = !1;
|
|
324
|
+
const xe = (e, { slots: n }) => Ke.renderSlot({ default: e.content }, "default", e.scope, n.default);
|
|
325
|
+
xe.props = ["content", "scope"];
|
|
326
|
+
xe.inheritAttrs = !1;
|
|
327
|
+
const da = Ke.isVue2 ? {
|
|
328
|
+
functional: !0,
|
|
329
|
+
render: (e, n) => {
|
|
330
|
+
var a, o, i;
|
|
331
|
+
return (i = (o = (a = n.scopedSlots).default) == null ? void 0 : o.call(a)[0]) != null ? i : n.children[0];
|
|
332
|
+
}
|
|
333
|
+
} : Xe, fa = Ke.isVue2 ? {
|
|
334
|
+
functional: !0,
|
|
335
|
+
props: ["content", "scope"],
|
|
336
|
+
render: (e, n) => {
|
|
337
|
+
var a, o, i, s, d;
|
|
338
|
+
return (d = (o = (a = n.props).content) == null ? void 0 : o.call(a, n.props.scope)) != null ? d : (s = (i = n.scopedSlots).default) == null ? void 0 : s.call(i);
|
|
339
|
+
}
|
|
340
|
+
} : xe, G = {
|
|
341
|
+
table: {
|
|
342
|
+
tableWrapper: "",
|
|
343
|
+
tableHeaderClass: "fixed",
|
|
344
|
+
tableBodyClass: "fixed",
|
|
345
|
+
tableClass: "ui blue selectable unstackable celled table",
|
|
346
|
+
loadingClass: "loading",
|
|
347
|
+
ascendingIcon: "blue chevron up icon",
|
|
348
|
+
descendingIcon: "blue chevron down icon",
|
|
349
|
+
ascendingClass: "sorted-asc",
|
|
350
|
+
descendingClass: "sorted-desc",
|
|
351
|
+
sortableIcon: "grey sort icon",
|
|
352
|
+
handleIcon: "grey sidebar icon"
|
|
353
|
+
},
|
|
354
|
+
pagination: {
|
|
355
|
+
wrapperClass: "ui right floated pagination menu",
|
|
356
|
+
activeClass: "active large",
|
|
357
|
+
disabledClass: "disabled",
|
|
358
|
+
pageClass: "item",
|
|
359
|
+
linkClass: "icon item",
|
|
360
|
+
paginationClass: "ui bottom attached segment grid",
|
|
361
|
+
paginationInfoClass: "left floated left aligned six wide column",
|
|
362
|
+
dropdownClass: "ui search dropdown",
|
|
363
|
+
icons: {
|
|
364
|
+
first: "angle double left icon",
|
|
365
|
+
prev: "left chevron icon",
|
|
366
|
+
next: "right chevron icon",
|
|
367
|
+
last: "angle double right icon"
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
paginationInfo: {
|
|
371
|
+
infoClass: "left floated left aligned six wide column"
|
|
372
|
+
}
|
|
373
|
+
}, ba = j({
|
|
374
|
+
name: "Vuetable",
|
|
375
|
+
inheritAttrs: J,
|
|
376
|
+
components: {
|
|
377
|
+
RenderBoundary: da,
|
|
378
|
+
SlotOutlet: fa,
|
|
379
|
+
VuetableRowHeader: Xt,
|
|
380
|
+
VuetableColGroup: Yt,
|
|
381
|
+
VuetableDetailHost: ca,
|
|
382
|
+
"vuetable-field-checkbox": Ze,
|
|
383
|
+
"vuetable-field-handle": Qe,
|
|
384
|
+
"vuetable-field-sequence": Je
|
|
385
|
+
},
|
|
386
|
+
props: {
|
|
387
|
+
fields: { type: Array, required: !0 },
|
|
388
|
+
loadOnStart: { type: Boolean, required: !1, default: !0 },
|
|
389
|
+
apiUrl: { type: String, required: !1, default: "" },
|
|
390
|
+
httpMethod: { type: String, required: !1, default: "get" },
|
|
391
|
+
reactiveApiUrl: { type: Boolean, required: !1, default: !0 },
|
|
392
|
+
apiMode: { type: Boolean, required: !1, default: !0 },
|
|
393
|
+
data: { type: null, required: !1, default: null },
|
|
394
|
+
dataManager: { type: Function, required: !1, default: null },
|
|
395
|
+
dataPath: { type: String, required: !1, default: "data" },
|
|
396
|
+
paginationPath: { type: String, required: !1, default: "links.pagination" },
|
|
397
|
+
queryParams: { type: [Object, Function], required: !1, default: () => ({
|
|
398
|
+
sort: "sort",
|
|
399
|
+
page: "page",
|
|
400
|
+
perPage: "per_page"
|
|
401
|
+
}) },
|
|
402
|
+
appendParams: { type: Object, required: !1, default: () => ({}) },
|
|
403
|
+
httpOptions: { type: Object, required: !1, default: () => ({}) },
|
|
404
|
+
httpFetch: { type: Function, required: !1, default: null },
|
|
405
|
+
perPage: { type: Number, required: !1, default: 10 },
|
|
406
|
+
initialPage: { type: Number, required: !1, default: 1 },
|
|
407
|
+
firstPage: { type: Number, required: !1, default: 1 },
|
|
408
|
+
sortOrder: { type: Array, required: !1, default: () => D([]).value },
|
|
409
|
+
multiSort: { type: Boolean, required: !1, default: !1 },
|
|
410
|
+
tableHeight: { type: String, required: !1, default: null },
|
|
411
|
+
multiSortKey: { type: String, required: !1, default: "alt" },
|
|
412
|
+
rowClass: { type: [String, Function], required: !1, default: "" },
|
|
413
|
+
detailRowComponent: { type: [String, Object], required: !1, default: "" },
|
|
414
|
+
detailRowTransition: { type: String, required: !1, default: "" },
|
|
415
|
+
detailRowClass: { type: [String, Function], required: !1, default: "vuetable-detail-row" },
|
|
416
|
+
detailRowOptions: { type: Object, required: !1, default: () => ({}) },
|
|
417
|
+
trackBy: { type: String, required: !1, default: "id" },
|
|
418
|
+
css: { type: Object, required: !1, default: () => ({}) },
|
|
419
|
+
minRows: { type: Number, required: !1, default: 0 },
|
|
420
|
+
silent: { type: Boolean, required: !1, default: !1 },
|
|
421
|
+
noDataTemplate: { type: String, required: !1, default: "No Data Available" },
|
|
422
|
+
showSortIcons: { type: Boolean, required: !1, default: !0 },
|
|
423
|
+
headerRows: { type: Array, required: !1, default: () => ["VuetableRowHeader"] },
|
|
424
|
+
transform: { type: Function, required: !1, default: null },
|
|
425
|
+
sortParams: { type: Function, required: !1, default: null },
|
|
426
|
+
fieldPrefix: { type: String, required: !1, default: "vuetable-field-" },
|
|
427
|
+
eventPrefix: { type: String, required: !1, default: "vuetable:" }
|
|
428
|
+
},
|
|
429
|
+
computed: {
|
|
430
|
+
$_css() {
|
|
431
|
+
return this.tableCss;
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
setup(e, { emit: n, slots: a, attrs: o }) {
|
|
435
|
+
const i = kn(), s = D(), d = D(0);
|
|
436
|
+
let u = S(S({}, e), o), m = Object.keys(a).length > 0;
|
|
437
|
+
$n(() => {
|
|
438
|
+
if (J) return;
|
|
439
|
+
const t = S(S({}, e), o), l = Object.keys(t), c = l.length === Object.keys(u).length && l.every((U) => t[U] === u[U]), C = Object.keys(a).length > 0;
|
|
440
|
+
(c || m || C) && d.value++, m = C, u = t;
|
|
441
|
+
});
|
|
442
|
+
const p = w(() => i == null ? void 0 : i.proxy), g = D([]), r = D(null), b = D(null), k = D(e.initialPage), F = D([]), v = D([]), P = D(0), I = D("17px"), M = D(!1), K = Et(e.sortOrder), y = J ? D(K) : Sn(K), O = D(e.httpOptions), ge = D(), he = w(() => S(S({}, G.table), e.css)), ie = w(() => {
|
|
443
|
+
var t, l;
|
|
444
|
+
return (t = r.value) != null && t.length ? ((l = r.value) == null ? void 0 : l.length) > 0 : !1;
|
|
445
|
+
}), et = w(() => ie.value && e.detailRowComponent !== ""), ve = w(() => r.value && typeof r.value[0][e.trackBy] != "undefined"), tt = w(() => g.value.filter((t) => t.visible).length), pe = w(() => {
|
|
446
|
+
var t;
|
|
447
|
+
return ((t = r.value) == null ? void 0 : t.length) || 0;
|
|
448
|
+
}), nt = w(() => pe.value === 0 && e.noDataTemplate.length > 0), me = w(() => {
|
|
449
|
+
var t;
|
|
450
|
+
return r.value === null || ((t = r.value) == null ? void 0 : t.length) === 0;
|
|
451
|
+
}), at = w(() => me.value ? !0 : r.value.length < e.minRows), lt = w(() => me.value ? e.minRows : r.value.length >= e.minRows ? 0 : e.minRows - r.value.length), ye = w(() => e.apiMode), ot = w(() => !e.apiMode), it = w(() => e.tableHeight != null);
|
|
452
|
+
Pe(), Be(), fe(() => {
|
|
453
|
+
T("initialized", g.value);
|
|
454
|
+
}), Qt(() => {
|
|
455
|
+
if (e.loadOnStart && _(), it.value) {
|
|
456
|
+
I.value = st() + "px";
|
|
457
|
+
const t = s.value;
|
|
458
|
+
t != null && t.addEventListener("scroll", Ce);
|
|
459
|
+
}
|
|
460
|
+
}), Fn(() => {
|
|
461
|
+
const t = s.value;
|
|
462
|
+
t != null && t.removeEventListener("scroll", Ce);
|
|
463
|
+
});
|
|
464
|
+
const rt = Ye(Z(S({}, Tn(e)), {
|
|
465
|
+
vuetable: p,
|
|
466
|
+
$el: w(() => {
|
|
467
|
+
var t;
|
|
468
|
+
return (t = i == null ? void 0 : i.proxy) == null ? void 0 : t.$el;
|
|
469
|
+
}),
|
|
470
|
+
isApiMode: ye,
|
|
471
|
+
tableFields: g,
|
|
472
|
+
tableData: r,
|
|
473
|
+
tablePagination: b,
|
|
474
|
+
selectedTo: F,
|
|
475
|
+
countVisibleFields: tt,
|
|
476
|
+
dataIsAvailable: ie,
|
|
477
|
+
countTableData: pe,
|
|
478
|
+
displayEmptyDataRow: nt,
|
|
479
|
+
useDetailRow: et,
|
|
480
|
+
hasRowIdentifier: ve,
|
|
481
|
+
lessThanMinRows: at,
|
|
482
|
+
blankRows: lt,
|
|
483
|
+
scrollVisible: M,
|
|
484
|
+
scrollBarWidth: I,
|
|
485
|
+
sortOrder: y,
|
|
486
|
+
css: he,
|
|
487
|
+
$_css: he,
|
|
488
|
+
isFieldSlot: dt,
|
|
489
|
+
onHeaderEvent: Bt,
|
|
490
|
+
setData: Y,
|
|
491
|
+
getFieldTitle: ct,
|
|
492
|
+
orderBy: Ct,
|
|
493
|
+
camelCase: bt,
|
|
494
|
+
clearSortOrder: wt,
|
|
495
|
+
toggleDetailRow: Dt,
|
|
496
|
+
showDetailRow: Me,
|
|
497
|
+
hideDetailRow: Ae,
|
|
498
|
+
isVisibleDetailRow: ne,
|
|
499
|
+
reload: Ve,
|
|
500
|
+
fireEvent: T,
|
|
501
|
+
singleColumnSort: He,
|
|
502
|
+
removeSortColumn: qe,
|
|
503
|
+
setSortColumnDirection: Re,
|
|
504
|
+
clearSelectedValues: $t,
|
|
505
|
+
showField: qt,
|
|
506
|
+
hideField: Rt,
|
|
507
|
+
toggleField: Ht,
|
|
508
|
+
onCheckboxToggled: Vt,
|
|
509
|
+
onCheckboxToggledAll: Lt,
|
|
510
|
+
checkIfRowIdentifierExists: re,
|
|
511
|
+
changePage: _t,
|
|
512
|
+
resetData: Nt,
|
|
513
|
+
refresh: Le,
|
|
514
|
+
isFieldComponent: ke,
|
|
515
|
+
makeTitle: se,
|
|
516
|
+
getAllQueryParams: Se,
|
|
517
|
+
isSortable: de,
|
|
518
|
+
getDefaultSortParam: Fe,
|
|
519
|
+
getObjectValue: z,
|
|
520
|
+
isSelectedRow: Ie
|
|
521
|
+
}));
|
|
522
|
+
Dn("vuetable", rt);
|
|
523
|
+
function st() {
|
|
524
|
+
const t = document.createElement("div"), l = document.createElement("div");
|
|
525
|
+
t.style.visibility = "hidden", t.style.width = "100px", l.style.width = "100%", t.appendChild(l), document.body.appendChild(t);
|
|
526
|
+
const c = t.offsetWidth;
|
|
527
|
+
t.style.overflow = "scroll";
|
|
528
|
+
const C = l.offsetWidth;
|
|
529
|
+
return document.body.removeChild(t), c - C;
|
|
530
|
+
}
|
|
531
|
+
function Ce(t) {
|
|
532
|
+
var c, C, U;
|
|
533
|
+
const l = (c = t.currentTarget) == null ? void 0 : c.scrollLeft;
|
|
534
|
+
if (l != P.value) {
|
|
535
|
+
const ee = (U = (C = s.value) == null ? void 0 : C.parentElement) == null ? void 0 : U.querySelector(".vuetable-head-wrapper");
|
|
536
|
+
ee != null && (ee.scrollLeft = l), P.value = l;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
function te(t) {
|
|
540
|
+
e.silent || console.error(t);
|
|
541
|
+
}
|
|
542
|
+
function ln(t, l) {
|
|
543
|
+
return [t, l.dataClass];
|
|
544
|
+
}
|
|
545
|
+
function Pe() {
|
|
546
|
+
if (typeof e.fields == "undefined") {
|
|
547
|
+
te('You need to provide "fields" prop.');
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
g.value = [], e.fields.forEach((t, l) => {
|
|
551
|
+
g.value.push(ut(t, l));
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
function ut(t, l) {
|
|
555
|
+
const c = {
|
|
556
|
+
name: "",
|
|
557
|
+
// title:
|
|
558
|
+
// this allow the code to detect undefined title
|
|
559
|
+
// and replace it with capitalized name instead
|
|
560
|
+
titleClass: "",
|
|
561
|
+
dataClass: "",
|
|
562
|
+
sortField: null,
|
|
563
|
+
formatter: null,
|
|
564
|
+
visible: !0,
|
|
565
|
+
width: null,
|
|
566
|
+
$_index: l
|
|
567
|
+
};
|
|
568
|
+
if (typeof t == "string")
|
|
569
|
+
return Z(S({}, c), {
|
|
570
|
+
name: we(t),
|
|
571
|
+
title: se(t)
|
|
572
|
+
});
|
|
573
|
+
const C = Object.assign({}, c, t);
|
|
574
|
+
return C.name = we(C.name), C.title === void 0 && (C.title = se(C.name)), C.formatter !== null && typeof C.formatter != "function" && (console.error(C.name + " field formatter must be a function"), C.formatter = null), C;
|
|
575
|
+
}
|
|
576
|
+
function we(t) {
|
|
577
|
+
return t instanceof Object ? Zt(ze(t)) : t.replace("__", e.fieldPrefix);
|
|
578
|
+
}
|
|
579
|
+
function Y(t) {
|
|
580
|
+
if (!(t === null || typeof t == "undefined")) {
|
|
581
|
+
if (T("loading"), Array.isArray(t)) {
|
|
582
|
+
r.value = t, T("loaded");
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
r.value = z(t, e.dataPath, null), b.value = z(t, e.paginationPath, null), fe(() => {
|
|
586
|
+
re(), ue(), T("pagination-data", b.value), T("loaded");
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
function re() {
|
|
591
|
+
if (ie.value)
|
|
592
|
+
return ve.value ? !0 : (te('Invalid your data! Use "track-by" prop to specify.'), !1);
|
|
593
|
+
}
|
|
594
|
+
function se(t) {
|
|
595
|
+
return ke(t) ? "" : $e(t.replace(".", " "));
|
|
596
|
+
}
|
|
597
|
+
function ct(t) {
|
|
598
|
+
return typeof t.title == "function" ? t.title() : t.title;
|
|
599
|
+
}
|
|
600
|
+
function on(t, l) {
|
|
601
|
+
return Oe(t) ? kt(t, l) : z(l, t.name, "");
|
|
602
|
+
}
|
|
603
|
+
function ke(t) {
|
|
604
|
+
return t instanceof Object ? !0 : t.slice(0, e.fieldPrefix.length) === e.fieldPrefix || t.slice(0, 2) === "__";
|
|
605
|
+
}
|
|
606
|
+
function dt(t) {
|
|
607
|
+
return typeof ft(t) != "undefined";
|
|
608
|
+
}
|
|
609
|
+
function ft(t) {
|
|
610
|
+
var l, c;
|
|
611
|
+
return J ? (c = (l = i == null ? void 0 : i.proxy) == null ? void 0 : l.$scopedSlots) == null ? void 0 : c[t] : a[t];
|
|
612
|
+
}
|
|
613
|
+
function $e(t) {
|
|
614
|
+
return t.replace(/\w+/g, (l) => l.charAt(0).toUpperCase() + l.substring(1).toLowerCase());
|
|
615
|
+
}
|
|
616
|
+
function bt(t, l = "_") {
|
|
617
|
+
return t.split(l).map((c) => $e(c)).join("");
|
|
618
|
+
}
|
|
619
|
+
function _(t = ht, l = vt) {
|
|
620
|
+
if (ot.value) {
|
|
621
|
+
jt();
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
return T("loading"), O.value.params = mt(Se()), ge.value = gt(e.apiUrl, O.value), ge.value.then(
|
|
625
|
+
t,
|
|
626
|
+
l
|
|
627
|
+
).catch(() => l());
|
|
628
|
+
}
|
|
629
|
+
function gt(t, l) {
|
|
630
|
+
return Wt(this, null, function* () {
|
|
631
|
+
if (e.httpFetch)
|
|
632
|
+
return e.httpFetch(t, l);
|
|
633
|
+
if (e.httpMethod === "get")
|
|
634
|
+
return Gt.get(t, l);
|
|
635
|
+
{
|
|
636
|
+
const c = yield O.value.params;
|
|
637
|
+
return delete l.params, delete O.value.params, Gt.post(t, c, O.value);
|
|
638
|
+
}
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
function ht(t) {
|
|
642
|
+
T("load-success", t);
|
|
643
|
+
const l = e.transform ? e.transform(t.data) : t.data;
|
|
644
|
+
r.value = z(l, e.dataPath, null), b.value = z(l, e.paginationPath, null), b.value === null && te(`vuetable: pagination-path ${e.paginationPath} not found.
|
|
645
|
+
It looks like the data returned from the server does not have pagination information
|
|
646
|
+
or you may have set it incorrectly.
|
|
647
|
+
|
|
648
|
+
You can explicitly suppress this warning by setting pagination-path="".`), fe(() => {
|
|
649
|
+
re(), ue(), T("pagination-data", b.value), T("loaded");
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
function ue() {
|
|
653
|
+
setTimeout(ce, 80);
|
|
654
|
+
}
|
|
655
|
+
function ce() {
|
|
656
|
+
fe(() => {
|
|
657
|
+
const t = s.value;
|
|
658
|
+
t != null && (M.value = t.scrollHeight > t.clientHeight, T("scrollbar-visible", M.value));
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
function vt(t) {
|
|
662
|
+
console.error("load-error", t), T("load-error", t), T("loaded");
|
|
663
|
+
}
|
|
664
|
+
function Se() {
|
|
665
|
+
let t = {};
|
|
666
|
+
return typeof e.queryParams == "function" ? (t = e.queryParams(y.value, k.value, e.perPage), typeof t == "object" ? t : {}) : (t[e.queryParams.sort] = pt(), t[e.queryParams.page] = k.value, t[e.queryParams.perPage] = e.perPage, t);
|
|
667
|
+
}
|
|
668
|
+
function pt() {
|
|
669
|
+
var t;
|
|
670
|
+
return !y.value || ((t = y.value[0]) == null ? void 0 : t.field) == "" ? "" : typeof e.sortParams == "function" ? e.sortParams(y.value) : Fe();
|
|
671
|
+
}
|
|
672
|
+
function Fe() {
|
|
673
|
+
return y.value.map((t) => `${t.sortField}|${t.direction}`).join(",");
|
|
674
|
+
}
|
|
675
|
+
function mt(t) {
|
|
676
|
+
for (let l in e.appendParams)
|
|
677
|
+
t[l] = e.appendParams[l];
|
|
678
|
+
return t;
|
|
679
|
+
}
|
|
680
|
+
function de(t) {
|
|
681
|
+
return t.sortField !== null;
|
|
682
|
+
}
|
|
683
|
+
function yt(t) {
|
|
684
|
+
if (!de(t))
|
|
685
|
+
return !1;
|
|
686
|
+
for (let l = 0; l < y.value.length; l++)
|
|
687
|
+
if (Te(t, l))
|
|
688
|
+
return l;
|
|
689
|
+
return !1;
|
|
690
|
+
}
|
|
691
|
+
function Te(t, l) {
|
|
692
|
+
return y.value[l].field === t.name && y.value[l].sortField === t.sortField;
|
|
693
|
+
}
|
|
694
|
+
function Ct(t, l) {
|
|
695
|
+
if (!de(t)) return;
|
|
696
|
+
const c = e.multiSortKey.toLowerCase() + "Key";
|
|
697
|
+
e.multiSort && l[c] ? Pt(t) : He(t), k.value = e.firstPage, (ye.value || e.dataManager) && _();
|
|
698
|
+
}
|
|
699
|
+
function x() {
|
|
700
|
+
J || Rn(y);
|
|
701
|
+
}
|
|
702
|
+
function De(t, l) {
|
|
703
|
+
y.value.push({
|
|
704
|
+
field: t.name,
|
|
705
|
+
sortField: t.sortField,
|
|
706
|
+
direction: l || "asc"
|
|
707
|
+
}), x();
|
|
708
|
+
}
|
|
709
|
+
function qe(t) {
|
|
710
|
+
y.value.splice(t, 1), x();
|
|
711
|
+
}
|
|
712
|
+
function Re(t, l) {
|
|
713
|
+
y.value[t].direction = l, x();
|
|
714
|
+
}
|
|
715
|
+
function Pt(t) {
|
|
716
|
+
let l = yt(t);
|
|
717
|
+
l === !1 ? De(t, "asc") : y.value[l].direction === "asc" ? Re(l, "desc") : qe(l);
|
|
718
|
+
}
|
|
719
|
+
function He(t) {
|
|
720
|
+
if (y.value.length === 0) {
|
|
721
|
+
De(t, "asc");
|
|
722
|
+
return;
|
|
723
|
+
}
|
|
724
|
+
y.value.splice(1), Te(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, x();
|
|
725
|
+
}
|
|
726
|
+
function wt() {
|
|
727
|
+
y.value = D([]).value;
|
|
728
|
+
}
|
|
729
|
+
function Oe(t) {
|
|
730
|
+
return typeof t.formatter == "function";
|
|
731
|
+
}
|
|
732
|
+
function kt(t, l) {
|
|
733
|
+
if (Oe(t) && typeof t.formatter == "function")
|
|
734
|
+
return t.formatter(z(l, t.name), i == null ? void 0 : i.proxy);
|
|
735
|
+
}
|
|
736
|
+
function z(t, l, c) {
|
|
737
|
+
c = typeof c == "undefined" ? null : c;
|
|
738
|
+
let C = t;
|
|
739
|
+
return l.trim() != "" && l.split(".").forEach((ee) => {
|
|
740
|
+
if (C !== null && typeof C[ee] != "undefined" && C[ee] !== null)
|
|
741
|
+
C = C[ee];
|
|
742
|
+
else {
|
|
743
|
+
C = c;
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
}), C;
|
|
747
|
+
}
|
|
748
|
+
function Ee(t) {
|
|
749
|
+
Ie(t) || F.value.push(t);
|
|
750
|
+
}
|
|
751
|
+
function je(t) {
|
|
752
|
+
F.value = F.value.filter((l) => l !== t);
|
|
753
|
+
}
|
|
754
|
+
function Ie(t) {
|
|
755
|
+
return F.value.indexOf(t) >= 0;
|
|
756
|
+
}
|
|
757
|
+
function $t() {
|
|
758
|
+
F.value = [];
|
|
759
|
+
}
|
|
760
|
+
function St() {
|
|
761
|
+
k.value > e.firstPage && (k.value -= 1, _());
|
|
762
|
+
}
|
|
763
|
+
function Ft() {
|
|
764
|
+
k.value < b.value.last_page && (k.value += 1, _());
|
|
765
|
+
}
|
|
766
|
+
function Tt(t) {
|
|
767
|
+
t != k.value && t >= e.firstPage && t <= b.value.last_page && (k.value = t, _());
|
|
768
|
+
}
|
|
769
|
+
function ne(t) {
|
|
770
|
+
return v.value.indexOf(t) >= 0;
|
|
771
|
+
}
|
|
772
|
+
function Me(t) {
|
|
773
|
+
ne(t) || v.value.push(t), ce();
|
|
774
|
+
}
|
|
775
|
+
function Ae(t) {
|
|
776
|
+
ne(t) && (v.value.splice(
|
|
777
|
+
v.value.indexOf(t),
|
|
778
|
+
1
|
|
779
|
+
), ue());
|
|
780
|
+
}
|
|
781
|
+
function Dt(t) {
|
|
782
|
+
ne(t) ? Ae(t) : Me(t);
|
|
783
|
+
}
|
|
784
|
+
function qt(t) {
|
|
785
|
+
t < 0 || t > g.value.length || (g.value[t].visible = !0);
|
|
786
|
+
}
|
|
787
|
+
function Rt(t) {
|
|
788
|
+
t < 0 || t > g.value.length || (g.value[t].visible = !1);
|
|
789
|
+
}
|
|
790
|
+
function Ht(t) {
|
|
791
|
+
t < 0 || t > g.value.length || (g.value[t].visible = !g.value[t].visible);
|
|
792
|
+
}
|
|
793
|
+
function Ot(t = null, l = null, c = null) {
|
|
794
|
+
return t = t === null ? 0 : t, l = l === null ? e.perPage : l, c = c === null ? k.value : c, {
|
|
795
|
+
total: t,
|
|
796
|
+
per_page: l,
|
|
797
|
+
current_page: c,
|
|
798
|
+
last_page: Math.ceil(t / l) || 0,
|
|
799
|
+
next_page_url: "",
|
|
800
|
+
prev_page_url: "",
|
|
801
|
+
from: (c - 1) * l + 1,
|
|
802
|
+
to: Math.min(c * l, t)
|
|
803
|
+
};
|
|
804
|
+
}
|
|
805
|
+
function Et(t) {
|
|
806
|
+
const l = (c) => Hn(c) || Object.isFrozen(ze(c));
|
|
807
|
+
return l(t) || t.some(l) ? D(t.map((c) => S({}, c))).value : t;
|
|
808
|
+
}
|
|
809
|
+
function Be() {
|
|
810
|
+
let t = !1;
|
|
811
|
+
y.value.forEach((l) => {
|
|
812
|
+
const c = l.sortField || l.field;
|
|
813
|
+
l.sortField !== c && (qn(l, "sortField", c), t = !0);
|
|
814
|
+
}), t && x();
|
|
815
|
+
}
|
|
816
|
+
function jt() {
|
|
817
|
+
if (e.data !== null && Array.isArray(e.data)) {
|
|
818
|
+
Y(e.data);
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
e.dataManager ? It() : Y(e.data);
|
|
822
|
+
}
|
|
823
|
+
function It() {
|
|
824
|
+
const t = e.dataManager(y.value, Ot());
|
|
825
|
+
At(t) ? t.then((l) => Y(l)) : Y(t);
|
|
826
|
+
}
|
|
827
|
+
function Mt(t) {
|
|
828
|
+
return typeof t == "object" && t !== null;
|
|
829
|
+
}
|
|
830
|
+
function At(t) {
|
|
831
|
+
return Mt(t) && typeof t.then == "function";
|
|
832
|
+
}
|
|
833
|
+
function rn(t, l) {
|
|
834
|
+
return typeof e.rowClass == "function" ? e.rowClass(t, l) : e.rowClass;
|
|
835
|
+
}
|
|
836
|
+
function sn(t, l) {
|
|
837
|
+
return typeof e.detailRowClass == "function" ? e.detailRowClass(t, l) : e.detailRowClass;
|
|
838
|
+
}
|
|
839
|
+
function un(t, l, c) {
|
|
840
|
+
return T("row-clicked", { data: t, index: l, event: c }), !0;
|
|
841
|
+
}
|
|
842
|
+
function cn(t, l, c) {
|
|
843
|
+
T("row-dblclicked", { data: t, index: l, event: c });
|
|
844
|
+
}
|
|
845
|
+
function dn(t, l, c) {
|
|
846
|
+
T("detail-row-clicked", { data: t, index: l, event: c });
|
|
847
|
+
}
|
|
848
|
+
function fn(t, l, c, C) {
|
|
849
|
+
T("cell-clicked", { data: t, index: l, field: c, event: C });
|
|
850
|
+
}
|
|
851
|
+
function bn(t, l, c, C) {
|
|
852
|
+
T("cell-dblclicked", { data: t, index: l, field: c, event: C });
|
|
853
|
+
}
|
|
854
|
+
function gn(t, l, c, C) {
|
|
855
|
+
T("cell-rightclicked", { data: t, index: l, field: c, event: C });
|
|
856
|
+
}
|
|
857
|
+
function hn(t, l, c) {
|
|
858
|
+
T("row-mouseover", { data: t, index: l, event: c });
|
|
859
|
+
}
|
|
860
|
+
function vn(t, l) {
|
|
861
|
+
T("field-event", t, l, i == null ? void 0 : i.proxy);
|
|
862
|
+
}
|
|
863
|
+
function Bt(t, l) {
|
|
864
|
+
T("header-event", t, l, i == null ? void 0 : i.proxy);
|
|
865
|
+
}
|
|
866
|
+
function Vt(t, l, c) {
|
|
867
|
+
if (c[e.trackBy] === void 0) {
|
|
868
|
+
te(`checkbox field: The "${e.trackBy}" field does not exist! Make sure the field you specify in "track-by" prop does exist.`);
|
|
869
|
+
return;
|
|
870
|
+
}
|
|
871
|
+
const C = c[e.trackBy];
|
|
872
|
+
t ? Ee(C) : je(C), T("checkbox-toggled", t, l);
|
|
873
|
+
}
|
|
874
|
+
function Lt(t) {
|
|
875
|
+
var l, c;
|
|
876
|
+
t ? (l = r.value) == null || l.forEach((C) => {
|
|
877
|
+
Ee(C[e.trackBy]);
|
|
878
|
+
}) : (c = r.value) == null || c.forEach((C) => {
|
|
879
|
+
je(C[e.trackBy]);
|
|
880
|
+
}), T("checkbox-toggled-all", t);
|
|
881
|
+
}
|
|
882
|
+
function _t(t) {
|
|
883
|
+
t === "prev" ? St() : t === "next" ? Ft() : Tt(t);
|
|
884
|
+
}
|
|
885
|
+
function Ve() {
|
|
886
|
+
return _();
|
|
887
|
+
}
|
|
888
|
+
function T(t, ...l) {
|
|
889
|
+
return n(`${e.eventPrefix}${t}`, ...l);
|
|
890
|
+
}
|
|
891
|
+
function pn() {
|
|
892
|
+
if (J) return {};
|
|
893
|
+
const t = [e.eventPrefix, `${e.eventPrefix}x`.replace(/-(\w)/g, (c, C) => C.toUpperCase()).slice(0, -1)].map((c) => `on${c.charAt(0).toUpperCase()}${c.slice(1)}`), l = {};
|
|
894
|
+
for (const c in o)
|
|
895
|
+
if (Object.prototype.hasOwnProperty.call(o, c)) {
|
|
896
|
+
if (/^on[^a-z]/.test(c)) {
|
|
897
|
+
const C = c.replace(/(?:Once|Passive|Capture)+$/, "");
|
|
898
|
+
if (!c.startsWith("on:") && !/^on[A-Z][a-z0-9]*$/.test(C) && (e.eventPrefix === "" || t.some((U) => C.startsWith(U)))) continue;
|
|
899
|
+
}
|
|
900
|
+
l[c] = o[c];
|
|
901
|
+
}
|
|
902
|
+
return l;
|
|
903
|
+
}
|
|
904
|
+
function Le() {
|
|
905
|
+
return k.value = e.firstPage, _();
|
|
906
|
+
}
|
|
907
|
+
function Nt() {
|
|
908
|
+
r.value = null, b.value = null, T("data-reset");
|
|
909
|
+
}
|
|
910
|
+
return N(() => e.multiSort, (t) => {
|
|
911
|
+
!t && y.value.length > 1 && (y.value.splice(1), x(), _());
|
|
912
|
+
}), N(() => e.apiUrl, (t, l) => e.reactiveApiUrl && t !== l && Le()), N(() => e.data, Y, { immediate: !0 }), N(() => e.tableHeight, ce), N(() => e.fields, Pe, { immediate: !0 }), N(() => e.perPage, Ve), N(() => e.sortOrder, (t, l) => {
|
|
913
|
+
(t !== l || y.value === t) && (y.value = Et(t)), Be();
|
|
914
|
+
}, { flush: "sync" }), N(() => e.httpOptions, (t) => {
|
|
915
|
+
O.value = t;
|
|
916
|
+
}, { immediate: !0 }), { bodyRevision: d, getSlot: ft, getRootAttrs: pn, tableContext: rt, fireEvent: T, bodyWrapper: s, vuetable: p, tableFields: g, tableData: r, tablePagination: b, currentPage: k, selectedTo: F, visibleDetailRows: v, lastScrollPosition: P, scrollBarWidth: I, scrollVisible: M, order: y, optionsHttp: O, instanceFetch: ge, tableCss: he, dataIsAvailable: ie, useDetailRow: et, hasRowIdentifier: ve, countVisibleFields: tt, countTableData: pe, displayEmptyDataRow: nt, emptyDataTable: me, lessThanMinRows: at, blankRows: lt, isApiMode: ye, isDataMode: ot, isFixedHeader: it, getScrollBarWidth: st, handleScroll: Ce, warn: te, bodyClass: ln, normalizeFields: Pe, newField: ut, normalizeFieldName: we, setData: Y, checkIfRowIdentifierExists: re, makeTitle: se, getFieldTitle: ct, renderNormalField: on, isFieldComponent: ke, isFieldSlot: dt, titleCase: $e, camelCase: bt, loadData: _, fetch: gt, loadSuccess: ht, updateHeader: ue, checkScrollbarVisibility: ce, loadFailed: vt, getAllQueryParams: Se, getSortParam: pt, getDefaultSortParam: Fe, getAppendParams: mt, isSortable: de, currentSortOrderPosition: yt, fieldIsInSortOrderPosition: Te, orderBy: Ct, addSortColumn: De, removeSortColumn: qe, setSortColumnDirection: Re, multiColumnSort: Pt, singleColumnSort: He, clearSortOrder: wt, hasFormatter: Oe, callFormatter: kt, getObjectValue: z, selectId: Ee, unselectId: je, isSelectedRow: Ie, clearSelectedValues: $t, gotoPreviousPage: St, gotoNextPage: Ft, gotoPage: Tt, isVisibleDetailRow: ne, showDetailRow: Me, hideDetailRow: Ae, toggleDetailRow: Dt, showField: qt, hideField: Rt, toggleField: Ht, makePagination: Ot, normalizeSortOrder: Be, handleDataMode: jt, callDataManager: It, isObject: Mt, isPromiseObject: At, onRowClass: rn, onDetailRowClass: sn, onRowClicked: un, onRowDoubleClicked: cn, onDetailRowClick: dn, onCellClicked: fn, onCellDoubleClicked: bn, onCellRightClicked: gn, onMouseOver: hn, onFieldEvent: vn, onHeaderEvent: Bt, onCheckboxToggled: Vt, onCheckboxToggledAll: Lt, changePage: _t, reload: Ve, refresh: Le, resetData: Nt, VuetableColGroup: Yt };
|
|
917
|
+
}
|
|
918
|
+
}), ga = {
|
|
919
|
+
key: 0,
|
|
920
|
+
class: "vuetable-head-wrapper"
|
|
921
|
+
}, ha = { key: 0 }, va = { class: "vuetable-body" }, pa = ["item-index", "onClick", "onDblclick", "onMouseover"], ma = ["innerHTML", "onClick", "onDblclick", "onContextmenu"], ya = ["onClick"], Ca = ["colspan"], Pa = { key: 0 }, wa = ["colspan", "innerHTML"];
|
|
922
|
+
function ka(e, n, a, o, i, s) {
|
|
923
|
+
const d = ae("vuetable-col-group"), u = ae("slot-outlet"), m = ae("vuetable-detail-host"), p = ae("render-boundary");
|
|
924
|
+
return f(), h("div", jn(e.getRootAttrs(), {
|
|
925
|
+
class: e.tableCss.tableWrapper
|
|
926
|
+
}), [
|
|
927
|
+
e.isFixedHeader ? (f(), h("div", ga, [
|
|
928
|
+
R("table", {
|
|
929
|
+
class: $(["vuetable", e.tableCss.tableClass, e.tableCss.tableHeaderClass])
|
|
930
|
+
}, [
|
|
931
|
+
Q(d, { "is-header": "" }),
|
|
932
|
+
R("thead", null, [
|
|
933
|
+
In(e.$slots, "tableHeader", { fields: e.tableFields }, () => [
|
|
934
|
+
(f(!0), h(H, null, B(e.headerRows, (g, r) => (f(), X(le(g), {
|
|
935
|
+
key: r,
|
|
936
|
+
index: r,
|
|
937
|
+
vuetable: e.tableContext,
|
|
938
|
+
"onVuetable:headerEvent": e.onHeaderEvent
|
|
939
|
+
}, null, 40, ["index", "vuetable", "onVuetable:headerEvent"]))), 128))
|
|
940
|
+
])
|
|
941
|
+
])
|
|
942
|
+
], 2)
|
|
943
|
+
])) : A("", !0),
|
|
944
|
+
Q(p, { revision: e.bodyRevision }, {
|
|
945
|
+
default: _e(() => [
|
|
946
|
+
R("div", {
|
|
947
|
+
ref: "bodyWrapper",
|
|
948
|
+
class: $([{ "fixed-header": e.isFixedHeader }, "vuetable-body-wrapper"]),
|
|
949
|
+
style: L({ height: e.tableHeight })
|
|
950
|
+
}, [
|
|
951
|
+
R("table", {
|
|
952
|
+
class: $(["vuetable", e.isFixedHeader ? "fixed-header" : "", e.tableCss.tableClass, e.tableCss.tableBodyClass])
|
|
953
|
+
}, [
|
|
954
|
+
Q(d),
|
|
955
|
+
e.isFixedHeader ? A("", !0) : (f(), h("thead", ha, [
|
|
956
|
+
Q(u, {
|
|
957
|
+
content: e.getSlot("tableHeader"),
|
|
958
|
+
scope: { fields: e.tableFields }
|
|
959
|
+
}, {
|
|
960
|
+
default: _e(() => [
|
|
961
|
+
(f(!0), h(H, null, B(e.headerRows, (g, r) => (f(), X(le(g), {
|
|
962
|
+
key: r,
|
|
963
|
+
index: r,
|
|
964
|
+
vuetable: e.tableContext,
|
|
965
|
+
"onVuetable:headerEvent": e.onHeaderEvent
|
|
966
|
+
}, null, 40, ["index", "vuetable", "onVuetable:headerEvent"]))), 128))
|
|
967
|
+
]),
|
|
968
|
+
_: 1
|
|
969
|
+
}, 8, ["content", "scope"])
|
|
970
|
+
])),
|
|
971
|
+
R("tfoot", null, [
|
|
972
|
+
Q(u, {
|
|
973
|
+
content: e.getSlot("tableFooter"),
|
|
974
|
+
scope: { fields: e.tableFields }
|
|
975
|
+
}, null, 8, ["content", "scope"])
|
|
976
|
+
]),
|
|
977
|
+
R("tbody", va, [
|
|
978
|
+
(f(!0), h(H, null, B(e.tableData, (g, r) => (f(), h(H, { key: r }, [
|
|
979
|
+
R("tr", {
|
|
980
|
+
"item-index": r,
|
|
981
|
+
class: $(e.onRowClass(g, r)),
|
|
982
|
+
onClick: (b) => e.onRowClicked(g, r, b),
|
|
983
|
+
onDblclick: (b) => e.onRowDoubleClicked(g, r, b),
|
|
984
|
+
onMouseover: (b) => e.onMouseOver(g, r, b)
|
|
985
|
+
}, [
|
|
986
|
+
(f(!0), h(H, null, B(e.tableFields, (b, k) => (f(), h(H, null, [
|
|
987
|
+
b.visible ? (f(), h(H, { key: 0 }, [
|
|
988
|
+
e.isFieldComponent(b.name) ? (f(), X(le(b.name), {
|
|
989
|
+
key: k,
|
|
990
|
+
"row-data": g,
|
|
991
|
+
"row-index": r,
|
|
992
|
+
"row-field": b,
|
|
993
|
+
vuetable: e.tableContext,
|
|
994
|
+
class: $(e.bodyClass("vuetable-component", b)),
|
|
995
|
+
style: L({ width: b.width || void 0 }),
|
|
996
|
+
"onVuetable:fieldEvent": e.onFieldEvent
|
|
997
|
+
}, null, 40, ["row-data", "row-index", "row-field", "vuetable", "class", "style", "onVuetable:fieldEvent"])) : e.isFieldSlot(b.name) ? (f(), h("td", {
|
|
998
|
+
key: k,
|
|
999
|
+
class: $(e.bodyClass("vuetable-slot", b)),
|
|
1000
|
+
style: L({ width: b.width || void 0 })
|
|
1001
|
+
}, [
|
|
1002
|
+
Q(u, {
|
|
1003
|
+
content: e.getSlot(b.name),
|
|
1004
|
+
scope: { rowData: g, rowIndex: r, rowField: b }
|
|
1005
|
+
}, null, 8, ["content", "scope"])
|
|
1006
|
+
], 6)) : (f(), h("td", {
|
|
1007
|
+
key: k,
|
|
1008
|
+
class: $(e.bodyClass("vuetable-td-" + b.name, b)),
|
|
1009
|
+
style: L({ width: b.width || void 0 }),
|
|
1010
|
+
innerHTML: e.renderNormalField(b, g),
|
|
1011
|
+
onClick: (F) => e.onCellClicked(g, r, b, F),
|
|
1012
|
+
onDblclick: (F) => e.onCellDoubleClicked(g, r, b, F),
|
|
1013
|
+
onContextmenu: (F) => e.onCellRightClicked(g, r, b, F)
|
|
1014
|
+
}, null, 46, ma))
|
|
1015
|
+
], 64)) : A("", !0)
|
|
1016
|
+
], 64))), 256))
|
|
1017
|
+
], 42, pa),
|
|
1018
|
+
e.useDetailRow ? (f(), X(Mn, {
|
|
1019
|
+
key: r,
|
|
1020
|
+
name: e.detailRowTransition
|
|
1021
|
+
}, {
|
|
1022
|
+
default: _e(() => [
|
|
1023
|
+
e.isVisibleDetailRow(g[e.trackBy]) ? (f(), h("tr", {
|
|
1024
|
+
key: 0,
|
|
1025
|
+
class: $(e.onDetailRowClass(g, r)),
|
|
1026
|
+
onClick: (b) => e.onDetailRowClick(g, r, b)
|
|
1027
|
+
}, [
|
|
1028
|
+
R("td", { colspan: e.countVisibleFields }, [
|
|
1029
|
+
Q(m, {
|
|
1030
|
+
"detail-component": e.detailRowComponent,
|
|
1031
|
+
"row-data": g,
|
|
1032
|
+
"row-index": r,
|
|
1033
|
+
options: e.detailRowOptions
|
|
1034
|
+
}, null, 8, ["detail-component", "row-data", "row-index", "options"])
|
|
1035
|
+
], 8, Ca)
|
|
1036
|
+
], 10, ya)) : A("", !0)
|
|
1037
|
+
]),
|
|
1038
|
+
_: 2
|
|
1039
|
+
}, 1032, ["name"])) : A("", !0)
|
|
1040
|
+
], 64))), 128)),
|
|
1041
|
+
e.displayEmptyDataRow ? (f(), h("tr", Pa, [
|
|
1042
|
+
R("td", {
|
|
1043
|
+
colspan: e.countVisibleFields,
|
|
1044
|
+
class: "vuetable-empty-result",
|
|
1045
|
+
innerHTML: e.noDataTemplate
|
|
1046
|
+
}, null, 8, wa)
|
|
1047
|
+
])) : A("", !0),
|
|
1048
|
+
e.lessThanMinRows ? (f(!0), h(H, { key: 1 }, B(e.blankRows, (g) => (f(), h("tr", {
|
|
1049
|
+
key: g,
|
|
1050
|
+
class: "blank-row"
|
|
1051
|
+
}, [
|
|
1052
|
+
(f(!0), h(H, null, B(e.tableFields, (r, b) => (f(), h(H, null, [
|
|
1053
|
+
r.visible ? (f(), h("td", { key: b }, " ")) : A("", !0)
|
|
1054
|
+
], 64))), 256))
|
|
1055
|
+
]))), 128)) : A("", !0)
|
|
1056
|
+
])
|
|
1057
|
+
], 2)
|
|
1058
|
+
], 6)
|
|
1059
|
+
]),
|
|
1060
|
+
_: 1
|
|
1061
|
+
}, 8, ["revision"])
|
|
1062
|
+
], 16);
|
|
1063
|
+
}
|
|
1064
|
+
const be = /* @__PURE__ */ V(ba, [["render", ka]]);
|
|
1065
|
+
function E(e) {
|
|
1066
|
+
return typeof e == "function" ? e() : On(e);
|
|
1067
|
+
}
|
|
1068
|
+
function xt(e, n) {
|
|
1069
|
+
const a = e === void 0 || Jt(e) || typeof e == "function" || typeof e == "number" ? { onEachSide: e, firstPage: n } : e, o = () => E(a.onEachSide === void 0 ? 2 : a.onEachSide), i = () => E(a.firstPage === void 0 ? 1 : a.firstPage), s = D(null), d = D({}), u = D("vuetable-pagination:"), m = w(() => {
|
|
1070
|
+
var y, O;
|
|
1071
|
+
return (O = (y = s.value) == null ? void 0 : y.last_page) != null ? O : 0;
|
|
1072
|
+
}), p = w(() => {
|
|
1073
|
+
var y;
|
|
1074
|
+
return ((y = s.value) == null ? void 0 : y.current_page) === E(i);
|
|
1075
|
+
}), g = w(() => {
|
|
1076
|
+
var y;
|
|
1077
|
+
return ((y = s.value) == null ? void 0 : y.current_page) === m.value;
|
|
1078
|
+
}), r = w(() => E(o) * 2 + 1), b = w(() => s.value ? s.value.last_page - E(i) + 1 : 0), k = w(() => b.value < E(o) * 2 + 4), F = w(() => !s.value || s.value.current_page <= E(o) ? 1 : s.value.current_page >= b.value - E(o) ? b.value - E(o) * 2 : s.value.current_page - E(o));
|
|
1079
|
+
function v() {
|
|
1080
|
+
d.value = S(S({}, G.pagination), E(a.css === void 0 ? {} : a.css));
|
|
1081
|
+
}
|
|
1082
|
+
function P(y) {
|
|
1083
|
+
var O;
|
|
1084
|
+
(O = a.emit) == null || O.call(a, "vuetable-pagination:change-page", y);
|
|
1085
|
+
}
|
|
1086
|
+
function I(y) {
|
|
1087
|
+
s.value = y;
|
|
1088
|
+
}
|
|
1089
|
+
function M() {
|
|
1090
|
+
s.value = null;
|
|
1091
|
+
}
|
|
1092
|
+
function K(y) {
|
|
1093
|
+
var O;
|
|
1094
|
+
return y === ((O = s.value) == null ? void 0 : O.current_page);
|
|
1095
|
+
}
|
|
1096
|
+
return v(), {
|
|
1097
|
+
tablePagination: s,
|
|
1098
|
+
customCss: d,
|
|
1099
|
+
eventPrefix: u,
|
|
1100
|
+
lastPage: m,
|
|
1101
|
+
isOnFirstPage: p,
|
|
1102
|
+
isOnLastPage: g,
|
|
1103
|
+
notEnoughPages: k,
|
|
1104
|
+
windowSize: r,
|
|
1105
|
+
windowStart: F,
|
|
1106
|
+
totalPage: b,
|
|
1107
|
+
setPaginationData: I,
|
|
1108
|
+
resetData: M,
|
|
1109
|
+
isCurrentPage: K,
|
|
1110
|
+
mergeCss: v,
|
|
1111
|
+
loadPage: P
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
const $a = j({
|
|
1115
|
+
props: {
|
|
1116
|
+
css: { type: Object, required: !1, default: () => ({}) },
|
|
1117
|
+
onEachSide: { type: Number, required: !1, default: 2 },
|
|
1118
|
+
firstPage: { type: Number, required: !1, default: 1 }
|
|
1119
|
+
},
|
|
1120
|
+
emits: ["vuetable-pagination:change-page"],
|
|
1121
|
+
setup(e, { emit: n }) {
|
|
1122
|
+
const a = Ye(S(S({}, G.pagination), e.css)), {
|
|
1123
|
+
tablePagination: o,
|
|
1124
|
+
totalPage: i,
|
|
1125
|
+
lastPage: s,
|
|
1126
|
+
isOnFirstPage: d,
|
|
1127
|
+
isOnLastPage: u,
|
|
1128
|
+
notEnoughPages: m,
|
|
1129
|
+
windowSize: p,
|
|
1130
|
+
windowStart: g,
|
|
1131
|
+
isCurrentPage: r,
|
|
1132
|
+
setPaginationData: b,
|
|
1133
|
+
resetData: k
|
|
1134
|
+
} = xt(() => e.onEachSide, () => e.firstPage);
|
|
1135
|
+
function F(v) {
|
|
1136
|
+
n("vuetable-pagination:change-page", v);
|
|
1137
|
+
}
|
|
1138
|
+
return { tableCss: a, tablePagination: o, totalPage: i, lastPage: s, isOnFirstPage: d, isOnLastPage: u, notEnoughPages: m, windowSize: p, windowStart: g, isCurrentPage: r, setPaginationData: b, resetData: k, loadPage: F };
|
|
1139
|
+
}
|
|
1140
|
+
}), Sa = { key: 1 }, Fa = { key: 1 }, Ta = ["innerHTML", "onClick"], Da = ["innerHTML", "onClick"], qa = { key: 1 }, Ra = { key: 1 };
|
|
1141
|
+
function Ha(e, n, a, o, i, s) {
|
|
1142
|
+
return An((f(), h("div", {
|
|
1143
|
+
class: $(e.tableCss.wrapperClass)
|
|
1144
|
+
}, [
|
|
1145
|
+
R("a", {
|
|
1146
|
+
class: $(["btn-nav", e.tableCss.linkClass, e.isOnFirstPage ? e.tableCss.disabledClass : ""]),
|
|
1147
|
+
onClick: n[0] || (n[0] = (d) => e.loadPage(e.firstPage))
|
|
1148
|
+
}, [
|
|
1149
|
+
e.tableCss.icons.first != "" ? (f(), h("i", {
|
|
1150
|
+
key: 0,
|
|
1151
|
+
class: $([e.tableCss.icons.first])
|
|
1152
|
+
}, null, 2)) : (f(), h("span", Sa, " « "))
|
|
1153
|
+
], 2),
|
|
1154
|
+
R("a", {
|
|
1155
|
+
class: $(["btn-nav", e.tableCss.linkClass, e.isOnFirstPage ? e.tableCss.disabledClass : ""]),
|
|
1156
|
+
onClick: n[1] || (n[1] = (d) => e.loadPage("prev"))
|
|
1157
|
+
}, [
|
|
1158
|
+
e.tableCss.icons.next != "" ? (f(), h("i", {
|
|
1159
|
+
key: 0,
|
|
1160
|
+
class: $([e.tableCss.icons.prev])
|
|
1161
|
+
}, null, 2)) : (f(), h("span", Fa, " ‹ "))
|
|
1162
|
+
], 2),
|
|
1163
|
+
e.notEnoughPages ? (f(!0), h(H, { key: 0 }, B(e.totalPage, (d, u) => (f(), h("a", {
|
|
1164
|
+
key: u,
|
|
1165
|
+
class: $([e.tableCss.pageClass, e.isCurrentPage(u + e.firstPage) ? e.tableCss.activeClass : ""]),
|
|
1166
|
+
innerHTML: d,
|
|
1167
|
+
onClick: (m) => e.loadPage(u + e.firstPage)
|
|
1168
|
+
}, null, 10, Ta))), 128)) : (f(!0), h(H, { key: 1 }, B(e.windowSize, (d, u) => (f(), h("a", {
|
|
1169
|
+
key: u,
|
|
1170
|
+
class: $([e.tableCss.pageClass, e.isCurrentPage(e.windowStart + u + e.firstPage - 1) ? e.tableCss.activeClass : ""]),
|
|
1171
|
+
innerHTML: e.windowStart + d - 1,
|
|
1172
|
+
onClick: (m) => e.loadPage(e.windowStart + u + e.firstPage - 1)
|
|
1173
|
+
}, null, 10, Da))), 128)),
|
|
1174
|
+
R("a", {
|
|
1175
|
+
class: $(["btn-nav", e.tableCss.linkClass, e.isOnLastPage ? e.tableCss.disabledClass : ""]),
|
|
1176
|
+
onClick: n[2] || (n[2] = (d) => e.loadPage("next"))
|
|
1177
|
+
}, [
|
|
1178
|
+
e.tableCss.icons.next != "" ? (f(), h("i", {
|
|
1179
|
+
key: 0,
|
|
1180
|
+
class: $([e.tableCss.icons.next])
|
|
1181
|
+
}, null, 2)) : (f(), h("span", qa, " › "))
|
|
1182
|
+
], 2),
|
|
1183
|
+
R("a", {
|
|
1184
|
+
class: $(["btn-nav", e.tableCss.linkClass, e.isOnLastPage ? e.tableCss.disabledClass : ""]),
|
|
1185
|
+
onClick: n[3] || (n[3] = (d) => e.loadPage(e.lastPage))
|
|
1186
|
+
}, [
|
|
1187
|
+
e.tableCss.icons.last != "" ? (f(), h("i", {
|
|
1188
|
+
key: 0,
|
|
1189
|
+
class: $([e.tableCss.icons.last])
|
|
1190
|
+
}, null, 2)) : (f(), h("span", Ra, " » "))
|
|
1191
|
+
], 2)
|
|
1192
|
+
], 2)), [
|
|
1193
|
+
[Bn, e.tablePagination && e.lastPage > e.firstPage]
|
|
1194
|
+
]);
|
|
1195
|
+
}
|
|
1196
|
+
const Oa = /* @__PURE__ */ V($a, [["render", Ha]]), Ea = j({
|
|
1197
|
+
props: {
|
|
1198
|
+
css: { type: Object, required: !1, default: () => ({}) },
|
|
1199
|
+
pageText: { type: String, required: !1, default: "Page" },
|
|
1200
|
+
onEachSide: { type: Number, required: !1, default: 2 },
|
|
1201
|
+
firstPage: { type: Number, required: !1, default: 1 }
|
|
1202
|
+
},
|
|
1203
|
+
emits: ["vuetable-pagination:change-page"],
|
|
1204
|
+
setup(e, { emit: n }) {
|
|
1205
|
+
const a = Vn(), o = Ye(S(S({}, G.pagination), e.css)), {
|
|
1206
|
+
tablePagination: i,
|
|
1207
|
+
totalPage: s,
|
|
1208
|
+
lastPage: d,
|
|
1209
|
+
isOnFirstPage: u,
|
|
1210
|
+
isOnLastPage: m,
|
|
1211
|
+
notEnoughPages: p,
|
|
1212
|
+
windowSize: g,
|
|
1213
|
+
windowStart: r,
|
|
1214
|
+
isCurrentPage: b,
|
|
1215
|
+
setPaginationData: k,
|
|
1216
|
+
resetData: F
|
|
1217
|
+
} = xt(() => e.onEachSide, () => e.firstPage);
|
|
1218
|
+
function v(I) {
|
|
1219
|
+
n("vuetable-pagination:change-page", I);
|
|
1220
|
+
}
|
|
1221
|
+
function P(I) {
|
|
1222
|
+
v(I.target.selectedIndex + e.firstPage);
|
|
1223
|
+
}
|
|
1224
|
+
return a.on("vuetable:pagination-data", (I) => {
|
|
1225
|
+
k(I);
|
|
1226
|
+
}), { emitter: a, tableCss: o, tablePagination: i, totalPage: s, lastPage: d, isOnFirstPage: u, isOnLastPage: m, notEnoughPages: p, windowSize: g, windowStart: r, isCurrentPage: b, setPaginationData: k, resetData: F, loadPage: v, onPageSelected: P };
|
|
1227
|
+
}
|
|
1228
|
+
}), ja = ["value", "selected"];
|
|
1229
|
+
function Ia(e, n, a, o, i, s) {
|
|
1230
|
+
return f(), h("div", {
|
|
1231
|
+
class: $([e.tableCss.wrapperClass])
|
|
1232
|
+
}, [
|
|
1233
|
+
R("a", {
|
|
1234
|
+
class: $([e.tableCss.linkClass, { [e.tableCss.disabledClass]: e.isOnFirstPage }]),
|
|
1235
|
+
onClick: n[0] || (n[0] = (d) => e.loadPage("prev"))
|
|
1236
|
+
}, [
|
|
1237
|
+
R("i", {
|
|
1238
|
+
class: $(e.tableCss.icons.prev)
|
|
1239
|
+
}, null, 2)
|
|
1240
|
+
], 2),
|
|
1241
|
+
R("select", {
|
|
1242
|
+
class: $(["vuetable-pagination-dropdown", e.tableCss.dropdownClass]),
|
|
1243
|
+
onChange: n[1] || (n[1] = (d) => e.onPageSelected(d))
|
|
1244
|
+
}, [
|
|
1245
|
+
(f(!0), h(H, null, B(e.totalPage, (d, u) => (f(), h("option", {
|
|
1246
|
+
key: d,
|
|
1247
|
+
class: $([e.tableCss.pageClass]),
|
|
1248
|
+
value: u + e.firstPage,
|
|
1249
|
+
selected: e.isCurrentPage(u + e.firstPage)
|
|
1250
|
+
}, Kt(e.pageText) + " " + Kt(d), 11, ja))), 128))
|
|
1251
|
+
], 34),
|
|
1252
|
+
R("a", {
|
|
1253
|
+
class: $([e.tableCss.linkClass, { [e.tableCss.disabledClass]: e.isOnLastPage }]),
|
|
1254
|
+
onClick: n[2] || (n[2] = (d) => e.loadPage("next"))
|
|
1255
|
+
}, [
|
|
1256
|
+
R("i", {
|
|
1257
|
+
class: $(e.tableCss.icons.next)
|
|
1258
|
+
}, null, 2)
|
|
1259
|
+
], 2)
|
|
1260
|
+
], 2);
|
|
1261
|
+
}
|
|
1262
|
+
const Ma = /* @__PURE__ */ V(Ea, [["render", Ia]]);
|
|
1263
|
+
function Aa(e, n) {
|
|
1264
|
+
const a = e === void 0 || Jt(e) || typeof e == "function" || typeof e == "string" ? { noDataTemplate: e, infoTemplate: n } : e, o = () => E(a.noDataTemplate === void 0 ? "No relevant data" : a.noDataTemplate), i = () => E(a.infoTemplate === void 0 ? "Displaying {from} to {to} of {total} items" : a.infoTemplate), s = D(null), d = D({}), u = w(() => s.value == null || s.value.total == 0), m = w(() => u.value ? E(o) : E(i).replace("{from}", `${s.value.from || 0}`).replace("{to}", `${s.value.to || 0}`).replace("{total}", `${s.value.total || 0}`));
|
|
1265
|
+
function p() {
|
|
1266
|
+
d.value = S(S({}, G.paginationInfo), E(a.css === void 0 ? {} : a.css));
|
|
1267
|
+
}
|
|
1268
|
+
function g(k) {
|
|
1269
|
+
s.value = k;
|
|
1270
|
+
}
|
|
1271
|
+
function r() {
|
|
1272
|
+
s.value = null;
|
|
1273
|
+
}
|
|
1274
|
+
function b(k) {
|
|
1275
|
+
var F;
|
|
1276
|
+
return k === ((F = s.value) == null ? void 0 : F.current_page);
|
|
1277
|
+
}
|
|
1278
|
+
return p(), {
|
|
1279
|
+
tablePagination: s,
|
|
1280
|
+
customCss: d,
|
|
1281
|
+
paginationInfo: m,
|
|
1282
|
+
setPaginationData: g,
|
|
1283
|
+
resetData: r,
|
|
1284
|
+
isCurrentPage: b,
|
|
1285
|
+
mergeCss: p
|
|
1286
|
+
};
|
|
1287
|
+
}
|
|
1288
|
+
const Ba = j({
|
|
1289
|
+
props: {
|
|
1290
|
+
css: { type: null, required: !1, default: () => ({}) },
|
|
1291
|
+
infoTemplate: { type: String, required: !1, default: "Displaying {from} to {to} of {total} items" },
|
|
1292
|
+
noDataTemplate: { type: String, required: !1, default: "No relevant data" }
|
|
1293
|
+
},
|
|
1294
|
+
setup(e) {
|
|
1295
|
+
const {
|
|
1296
|
+
tablePagination: n,
|
|
1297
|
+
paginationInfo: a,
|
|
1298
|
+
setPaginationData: o,
|
|
1299
|
+
resetData: i
|
|
1300
|
+
} = Aa(() => e.noDataTemplate, () => e.infoTemplate), s = D(S(S({}, G.paginationInfo), e.css));
|
|
1301
|
+
return { tablePagination: n, paginationInfo: a, setPaginationData: o, resetData: i, tableCss: s };
|
|
1302
|
+
}
|
|
1303
|
+
}), Va = ["innerHTML"];
|
|
1304
|
+
function La(e, n, a, o, i, s) {
|
|
1305
|
+
return f(), h("div", {
|
|
1306
|
+
class: $(["vuetable-pagination-info", e.tableCss.infoClass]),
|
|
1307
|
+
innerHTML: e.paginationInfo
|
|
1308
|
+
}, null, 10, Va);
|
|
1309
|
+
}
|
|
1310
|
+
const _a = /* @__PURE__ */ V(Ba, [["render", La]]), Na = j({
|
|
1311
|
+
props: {
|
|
1312
|
+
rowData: {
|
|
1313
|
+
type: Object,
|
|
1314
|
+
default: null
|
|
1315
|
+
},
|
|
1316
|
+
rowIndex: {
|
|
1317
|
+
type: Number
|
|
1318
|
+
},
|
|
1319
|
+
rowField: {
|
|
1320
|
+
type: Object
|
|
1321
|
+
},
|
|
1322
|
+
isHeader: {
|
|
1323
|
+
type: Boolean,
|
|
1324
|
+
default: !1
|
|
1325
|
+
},
|
|
1326
|
+
title: {
|
|
1327
|
+
type: String,
|
|
1328
|
+
default: ""
|
|
1329
|
+
},
|
|
1330
|
+
vuetable: {
|
|
1331
|
+
type: Object,
|
|
1332
|
+
default: null
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
}), ol = j({
|
|
1336
|
+
mixins: [Na],
|
|
1337
|
+
methods: {
|
|
1338
|
+
toggleCheckbox(e, n) {
|
|
1339
|
+
this.vuetable.onCheckboxToggled(n.target.checked, this.rowField.name, e);
|
|
1340
|
+
},
|
|
1341
|
+
toggleAllCheckbox(e) {
|
|
1342
|
+
this.vuetable.onCheckboxToggledAll(e.target.checked);
|
|
1343
|
+
},
|
|
1344
|
+
isSelected(e) {
|
|
1345
|
+
return this.vuetable.isSelectedRow(e[this.vuetable.trackBy]);
|
|
1346
|
+
},
|
|
1347
|
+
isAllItemsInCurrentPageSelected() {
|
|
1348
|
+
var o;
|
|
1349
|
+
if (!this.vuetable.tableData) return;
|
|
1350
|
+
let e = this.vuetable.trackBy, n = (o = this.$el) == null ? void 0 : o.querySelector("input[type=checkbox]"), a = this.vuetable.tableData.filter((i) => this.vuetable.isSelectedRow(i[e]));
|
|
1351
|
+
return a.length <= 0 ? (n && (n.indeterminate = !1), !1) : a.length < this.vuetable.tableData.length ? (n && (n.indeterminate = !0), !0) : (n && (n.indeterminate = !1), !0);
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
}), il = j({
|
|
1355
|
+
props: {
|
|
1356
|
+
css: {
|
|
1357
|
+
type: Object,
|
|
1358
|
+
default: () => ({})
|
|
1359
|
+
},
|
|
1360
|
+
infoTemplate: {
|
|
1361
|
+
type: String,
|
|
1362
|
+
default: "Displaying {from} to {to} of {total} items"
|
|
1363
|
+
},
|
|
1364
|
+
noDataTemplate: {
|
|
1365
|
+
type: String,
|
|
1366
|
+
default: "No relevant data"
|
|
1367
|
+
}
|
|
1368
|
+
},
|
|
1369
|
+
data() {
|
|
1370
|
+
return {
|
|
1371
|
+
tablePagination: null,
|
|
1372
|
+
customCss: {}
|
|
1373
|
+
};
|
|
1374
|
+
},
|
|
1375
|
+
computed: {
|
|
1376
|
+
paginationInfo() {
|
|
1377
|
+
return this.tablePagination == null || this.tablePagination.total === 0 ? this.noDataTemplate : this.infoTemplate.replace("{from}", `${this.tablePagination.from || 0}`).replace("{to}", `${this.tablePagination.to || 0}`).replace("{total}", `${this.tablePagination.total || 0}`);
|
|
1378
|
+
}
|
|
1379
|
+
},
|
|
1380
|
+
created() {
|
|
1381
|
+
this.mergeCss();
|
|
1382
|
+
},
|
|
1383
|
+
methods: {
|
|
1384
|
+
mergeCss() {
|
|
1385
|
+
this.customCss = S(S({}, G.paginationInfo), this.css);
|
|
1386
|
+
},
|
|
1387
|
+
setPaginationData(e) {
|
|
1388
|
+
this.tablePagination = e;
|
|
1389
|
+
},
|
|
1390
|
+
resetData() {
|
|
1391
|
+
this.tablePagination = null;
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
}), rl = j({
|
|
1395
|
+
emits: [
|
|
1396
|
+
"vuetable-pagination:change-page"
|
|
1397
|
+
],
|
|
1398
|
+
props: {
|
|
1399
|
+
css: {
|
|
1400
|
+
type: Object,
|
|
1401
|
+
default() {
|
|
1402
|
+
return {};
|
|
1403
|
+
}
|
|
1404
|
+
},
|
|
1405
|
+
onEachSide: {
|
|
1406
|
+
type: Number,
|
|
1407
|
+
default() {
|
|
1408
|
+
return 2;
|
|
1409
|
+
}
|
|
1410
|
+
},
|
|
1411
|
+
firstPage: {
|
|
1412
|
+
type: Number,
|
|
1413
|
+
default: 1
|
|
1414
|
+
}
|
|
1415
|
+
},
|
|
1416
|
+
data() {
|
|
1417
|
+
return {
|
|
1418
|
+
eventPrefix: "vuetable-pagination:",
|
|
1419
|
+
tablePagination: null,
|
|
1420
|
+
customCss: {}
|
|
1421
|
+
};
|
|
1422
|
+
},
|
|
1423
|
+
created() {
|
|
1424
|
+
this.mergeCss();
|
|
1425
|
+
},
|
|
1426
|
+
computed: {
|
|
1427
|
+
totalPage() {
|
|
1428
|
+
return this.tablePagination === null ? 0 : this.tablePagination.last_page - this.firstPage + 1;
|
|
1429
|
+
},
|
|
1430
|
+
lastPage() {
|
|
1431
|
+
return this.tablePagination === null ? 0 : this.tablePagination.last_page;
|
|
1432
|
+
},
|
|
1433
|
+
isOnFirstPage() {
|
|
1434
|
+
return this.tablePagination === null ? !1 : this.tablePagination.current_page === this.firstPage;
|
|
1435
|
+
},
|
|
1436
|
+
isOnLastPage() {
|
|
1437
|
+
return this.tablePagination === null ? !1 : this.tablePagination.current_page === this.lastPage;
|
|
1438
|
+
},
|
|
1439
|
+
notEnoughPages() {
|
|
1440
|
+
return this.totalPage < this.onEachSide * 2 + 4;
|
|
1441
|
+
},
|
|
1442
|
+
windowSize() {
|
|
1443
|
+
return this.onEachSide * 2 + 1;
|
|
1444
|
+
},
|
|
1445
|
+
windowStart() {
|
|
1446
|
+
return !this.tablePagination || this.tablePagination.current_page <= this.onEachSide ? 1 : this.tablePagination.current_page >= this.totalPage - this.onEachSide ? this.totalPage - this.onEachSide * 2 : this.tablePagination.current_page - this.onEachSide;
|
|
1447
|
+
}
|
|
1448
|
+
},
|
|
1449
|
+
methods: {
|
|
1450
|
+
mergeCss() {
|
|
1451
|
+
this.customCss = S(S({}, G.pagination), this.css);
|
|
1452
|
+
},
|
|
1453
|
+
loadPage(e) {
|
|
1454
|
+
this.$emit("vuetable-pagination:change-page", e);
|
|
1455
|
+
},
|
|
1456
|
+
isCurrentPage(e) {
|
|
1457
|
+
return e === this.tablePagination.current_page;
|
|
1458
|
+
},
|
|
1459
|
+
setPaginationData(e) {
|
|
1460
|
+
this.tablePagination = e;
|
|
1461
|
+
},
|
|
1462
|
+
resetData() {
|
|
1463
|
+
this.tablePagination = null;
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
});
|
|
1467
|
+
function za(e) {
|
|
1468
|
+
const n = W("vuetable", null);
|
|
1469
|
+
return {
|
|
1470
|
+
rowData: w(() => {
|
|
1471
|
+
var a;
|
|
1472
|
+
return (a = e.rowData) != null ? a : null;
|
|
1473
|
+
}),
|
|
1474
|
+
rowIndex: w(() => e.rowIndex),
|
|
1475
|
+
rowField: w(() => e.rowField),
|
|
1476
|
+
isHeader: w(() => {
|
|
1477
|
+
var a;
|
|
1478
|
+
return (a = e.isHeader) != null ? a : !1;
|
|
1479
|
+
}),
|
|
1480
|
+
title: w(() => {
|
|
1481
|
+
var a;
|
|
1482
|
+
return (a = e.title) != null ? a : "";
|
|
1483
|
+
}),
|
|
1484
|
+
vuetable: w(() => {
|
|
1485
|
+
var a;
|
|
1486
|
+
return (a = e.vuetable) != null ? a : n;
|
|
1487
|
+
})
|
|
1488
|
+
};
|
|
1489
|
+
}
|
|
1490
|
+
function sl(e) {
|
|
1491
|
+
const n = za(e);
|
|
1492
|
+
function a() {
|
|
1493
|
+
const r = n.vuetable.value;
|
|
1494
|
+
if (!r)
|
|
1495
|
+
throw new TypeError('useVuetableFieldCheckbox requires a vuetable prop or a "vuetable" provider.');
|
|
1496
|
+
return r;
|
|
1497
|
+
}
|
|
1498
|
+
a();
|
|
1499
|
+
const o = D(null), i = w(() => {
|
|
1500
|
+
const r = a();
|
|
1501
|
+
return (r.tableData || []).filter((b) => r.isSelectedRow(b[r.trackBy])).length;
|
|
1502
|
+
}), s = w(() => {
|
|
1503
|
+
var r;
|
|
1504
|
+
return i.value > 0 && i.value < (((r = a().tableData) == null ? void 0 : r.length) || 0);
|
|
1505
|
+
});
|
|
1506
|
+
function d(r, b) {
|
|
1507
|
+
var F;
|
|
1508
|
+
if (!r) return;
|
|
1509
|
+
a().onCheckboxToggled(b.target.checked, (F = n.rowField.value) == null ? void 0 : F.name, r);
|
|
1510
|
+
}
|
|
1511
|
+
function u(r) {
|
|
1512
|
+
a().onCheckboxToggledAll(r.target.checked);
|
|
1513
|
+
}
|
|
1514
|
+
function m(r) {
|
|
1515
|
+
if (!r) return !1;
|
|
1516
|
+
const b = a();
|
|
1517
|
+
return b.isSelectedRow(r[b.trackBy]);
|
|
1518
|
+
}
|
|
1519
|
+
function p() {
|
|
1520
|
+
if (a().tableData)
|
|
1521
|
+
return i.value > 0;
|
|
1522
|
+
}
|
|
1523
|
+
function g() {
|
|
1524
|
+
o.value && (o.value.indeterminate = n.isHeader.value && s.value);
|
|
1525
|
+
}
|
|
1526
|
+
return Qt(g), En(g), N([o, n.isHeader, s], g, { flush: "post" }), Z(S({}, n), {
|
|
1527
|
+
checkbox: o,
|
|
1528
|
+
selectedCount: i,
|
|
1529
|
+
isIndeterminate: s,
|
|
1530
|
+
toggleCheckbox: d,
|
|
1531
|
+
toggleAllCheckbox: u,
|
|
1532
|
+
isSelected: m,
|
|
1533
|
+
isAllItemsInCurrentPageSelected: p
|
|
1534
|
+
});
|
|
1535
|
+
}
|
|
1536
|
+
function Ua(e) {
|
|
1537
|
+
var n = this.constructor;
|
|
1538
|
+
return this.then(
|
|
1539
|
+
function(a) {
|
|
1540
|
+
return n.resolve(e()).then(function() {
|
|
1541
|
+
return a;
|
|
1542
|
+
});
|
|
1543
|
+
},
|
|
1544
|
+
function(a) {
|
|
1545
|
+
return n.resolve(e()).then(function() {
|
|
1546
|
+
return n.reject(a);
|
|
1547
|
+
});
|
|
1548
|
+
}
|
|
1549
|
+
);
|
|
1550
|
+
}
|
|
1551
|
+
function Wa(e) {
|
|
1552
|
+
var n = this;
|
|
1553
|
+
return new n(function(a, o) {
|
|
1554
|
+
if (!(e && typeof e.length != "undefined"))
|
|
1555
|
+
return o(
|
|
1556
|
+
new TypeError(
|
|
1557
|
+
typeof e + " " + e + " is not iterable(cannot read property Symbol(Symbol.iterator))"
|
|
1558
|
+
)
|
|
1559
|
+
);
|
|
1560
|
+
var i = Array.prototype.slice.call(e);
|
|
1561
|
+
if (i.length === 0) return a([]);
|
|
1562
|
+
var s = i.length;
|
|
1563
|
+
function d(m, p) {
|
|
1564
|
+
if (p && (typeof p == "object" || typeof p == "function")) {
|
|
1565
|
+
var g = p.then;
|
|
1566
|
+
if (typeof g == "function") {
|
|
1567
|
+
g.call(
|
|
1568
|
+
p,
|
|
1569
|
+
function(r) {
|
|
1570
|
+
d(m, r);
|
|
1571
|
+
},
|
|
1572
|
+
function(r) {
|
|
1573
|
+
i[m] = { status: "rejected", reason: r }, --s === 0 && a(i);
|
|
1574
|
+
}
|
|
1575
|
+
);
|
|
1576
|
+
return;
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
i[m] = { status: "fulfilled", value: p }, --s === 0 && a(i);
|
|
1580
|
+
}
|
|
1581
|
+
for (var u = 0; u < i.length; u++)
|
|
1582
|
+
d(u, i[u]);
|
|
1583
|
+
});
|
|
1584
|
+
}
|
|
1585
|
+
function en(e, n) {
|
|
1586
|
+
this.name = "AggregateError", this.errors = e, this.message = n || "";
|
|
1587
|
+
}
|
|
1588
|
+
en.prototype = Error.prototype;
|
|
1589
|
+
function Ga(e) {
|
|
1590
|
+
var n = this;
|
|
1591
|
+
return new n(function(a, o) {
|
|
1592
|
+
if (!(e && typeof e.length != "undefined"))
|
|
1593
|
+
return o(new TypeError("Promise.any accepts an array"));
|
|
1594
|
+
var i = Array.prototype.slice.call(e);
|
|
1595
|
+
if (i.length === 0) return o();
|
|
1596
|
+
for (var s = [], d = 0; d < i.length; d++)
|
|
1597
|
+
try {
|
|
1598
|
+
n.resolve(i[d]).then(a).catch(function(u) {
|
|
1599
|
+
s.push(u), s.length === i.length && o(
|
|
1600
|
+
new en(
|
|
1601
|
+
s,
|
|
1602
|
+
"All promises were rejected"
|
|
1603
|
+
)
|
|
1604
|
+
);
|
|
1605
|
+
});
|
|
1606
|
+
} catch (u) {
|
|
1607
|
+
o(u);
|
|
1608
|
+
}
|
|
1609
|
+
});
|
|
1610
|
+
}
|
|
1611
|
+
var Ka = setTimeout;
|
|
1612
|
+
function tn(e) {
|
|
1613
|
+
return !!(e && typeof e.length != "undefined");
|
|
1614
|
+
}
|
|
1615
|
+
function Ya() {
|
|
1616
|
+
}
|
|
1617
|
+
function Za(e, n) {
|
|
1618
|
+
return function() {
|
|
1619
|
+
e.apply(n, arguments);
|
|
1620
|
+
};
|
|
1621
|
+
}
|
|
1622
|
+
function q(e) {
|
|
1623
|
+
if (!(this instanceof q))
|
|
1624
|
+
throw new TypeError("Promises must be constructed via new");
|
|
1625
|
+
if (typeof e != "function") throw new TypeError("not a function");
|
|
1626
|
+
this._state = 0, this._handled = !1, this._value = void 0, this._deferreds = [], an(e, this);
|
|
1627
|
+
}
|
|
1628
|
+
function nn(e, n) {
|
|
1629
|
+
for (; e._state === 3; )
|
|
1630
|
+
e = e._value;
|
|
1631
|
+
if (e._state === 0) {
|
|
1632
|
+
e._deferreds.push(n);
|
|
1633
|
+
return;
|
|
1634
|
+
}
|
|
1635
|
+
e._handled = !0, q._immediateFn(function() {
|
|
1636
|
+
var a = e._state === 1 ? n.onFulfilled : n.onRejected;
|
|
1637
|
+
if (a === null) {
|
|
1638
|
+
(e._state === 1 ? We : oe)(n.promise, e._value);
|
|
1639
|
+
return;
|
|
1640
|
+
}
|
|
1641
|
+
var o;
|
|
1642
|
+
try {
|
|
1643
|
+
o = a(e._value);
|
|
1644
|
+
} catch (i) {
|
|
1645
|
+
oe(n.promise, i);
|
|
1646
|
+
return;
|
|
1647
|
+
}
|
|
1648
|
+
We(n.promise, o);
|
|
1649
|
+
});
|
|
1650
|
+
}
|
|
1651
|
+
function We(e, n) {
|
|
1652
|
+
try {
|
|
1653
|
+
if (n === e)
|
|
1654
|
+
throw new TypeError("A promise cannot be resolved with itself.");
|
|
1655
|
+
if (n && (typeof n == "object" || typeof n == "function")) {
|
|
1656
|
+
var a = n.then;
|
|
1657
|
+
if (n instanceof q) {
|
|
1658
|
+
e._state = 3, e._value = n, Ge(e);
|
|
1659
|
+
return;
|
|
1660
|
+
} else if (typeof a == "function") {
|
|
1661
|
+
an(Za(a, n), e);
|
|
1662
|
+
return;
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
e._state = 1, e._value = n, Ge(e);
|
|
1666
|
+
} catch (o) {
|
|
1667
|
+
oe(e, o);
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
function oe(e, n) {
|
|
1671
|
+
e._state = 2, e._value = n, Ge(e);
|
|
1672
|
+
}
|
|
1673
|
+
function Ge(e) {
|
|
1674
|
+
e._state === 2 && e._deferreds.length === 0 && q._immediateFn(function() {
|
|
1675
|
+
e._handled || q._unhandledRejectionFn(e._value);
|
|
1676
|
+
});
|
|
1677
|
+
for (var n = 0, a = e._deferreds.length; n < a; n++)
|
|
1678
|
+
nn(e, e._deferreds[n]);
|
|
1679
|
+
e._deferreds = null;
|
|
1680
|
+
}
|
|
1681
|
+
function Qa(e, n, a) {
|
|
1682
|
+
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof n == "function" ? n : null, this.promise = a;
|
|
1683
|
+
}
|
|
1684
|
+
function an(e, n) {
|
|
1685
|
+
var a = !1;
|
|
1686
|
+
try {
|
|
1687
|
+
e(
|
|
1688
|
+
function(o) {
|
|
1689
|
+
a || (a = !0, We(n, o));
|
|
1690
|
+
},
|
|
1691
|
+
function(o) {
|
|
1692
|
+
a || (a = !0, oe(n, o));
|
|
1693
|
+
}
|
|
1694
|
+
);
|
|
1695
|
+
} catch (o) {
|
|
1696
|
+
if (a) return;
|
|
1697
|
+
a = !0, oe(n, o);
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
q.prototype.catch = function(e) {
|
|
1701
|
+
return this.then(null, e);
|
|
1702
|
+
};
|
|
1703
|
+
q.prototype.then = function(e, n) {
|
|
1704
|
+
var a = new this.constructor(Ya);
|
|
1705
|
+
return nn(this, new Qa(e, n, a)), a;
|
|
1706
|
+
};
|
|
1707
|
+
q.prototype.finally = Ua;
|
|
1708
|
+
q.all = function(e) {
|
|
1709
|
+
return new q(function(n, a) {
|
|
1710
|
+
if (!tn(e))
|
|
1711
|
+
return a(new TypeError("Promise.all accepts an array"));
|
|
1712
|
+
var o = Array.prototype.slice.call(e);
|
|
1713
|
+
if (o.length === 0) return n([]);
|
|
1714
|
+
var i = o.length;
|
|
1715
|
+
function s(u, m) {
|
|
1716
|
+
try {
|
|
1717
|
+
if (m && (typeof m == "object" || typeof m == "function")) {
|
|
1718
|
+
var p = m.then;
|
|
1719
|
+
if (typeof p == "function") {
|
|
1720
|
+
p.call(
|
|
1721
|
+
m,
|
|
1722
|
+
function(g) {
|
|
1723
|
+
s(u, g);
|
|
1724
|
+
},
|
|
1725
|
+
a
|
|
1726
|
+
);
|
|
1727
|
+
return;
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
o[u] = m, --i === 0 && n(o);
|
|
1731
|
+
} catch (g) {
|
|
1732
|
+
a(g);
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
for (var d = 0; d < o.length; d++)
|
|
1736
|
+
s(d, o[d]);
|
|
1737
|
+
});
|
|
1738
|
+
};
|
|
1739
|
+
q.any = Ga;
|
|
1740
|
+
q.allSettled = Wa;
|
|
1741
|
+
q.resolve = function(e) {
|
|
1742
|
+
return e && typeof e == "object" && e.constructor === q ? e : new q(function(n) {
|
|
1743
|
+
n(e);
|
|
1744
|
+
});
|
|
1745
|
+
};
|
|
1746
|
+
q.reject = function(e) {
|
|
1747
|
+
return new q(function(n, a) {
|
|
1748
|
+
a(e);
|
|
1749
|
+
});
|
|
1750
|
+
};
|
|
1751
|
+
q.race = function(e) {
|
|
1752
|
+
return new q(function(n, a) {
|
|
1753
|
+
if (!tn(e))
|
|
1754
|
+
return a(new TypeError("Promise.race accepts an array"));
|
|
1755
|
+
for (var o = 0, i = e.length; o < i; o++)
|
|
1756
|
+
q.resolve(e[o]).then(n, a);
|
|
1757
|
+
});
|
|
1758
|
+
};
|
|
1759
|
+
q._immediateFn = // @ts-ignore
|
|
1760
|
+
typeof setImmediate == "function" && function(e) {
|
|
1761
|
+
setImmediate(e);
|
|
1762
|
+
} || function(e) {
|
|
1763
|
+
Ka(e, 0);
|
|
1764
|
+
};
|
|
1765
|
+
q._unhandledRejectionFn = function(n) {
|
|
1766
|
+
typeof console != "undefined" && console && console.warn("Possible Unhandled Promise Rejection:", n);
|
|
1767
|
+
};
|
|
1768
|
+
const Ja = [
|
|
1769
|
+
"initialized",
|
|
1770
|
+
"loading",
|
|
1771
|
+
"loaded",
|
|
1772
|
+
"pagination-data",
|
|
1773
|
+
"load-success",
|
|
1774
|
+
"scrollbar-visible",
|
|
1775
|
+
"load-error",
|
|
1776
|
+
"row-clicked",
|
|
1777
|
+
"row-dblclicked",
|
|
1778
|
+
"detail-row-clicked",
|
|
1779
|
+
"cell-clicked",
|
|
1780
|
+
"cell-dblclicked",
|
|
1781
|
+
"cell-rightclicked",
|
|
1782
|
+
"row-mouseover",
|
|
1783
|
+
"field-event",
|
|
1784
|
+
"header-event",
|
|
1785
|
+
"checkbox-toggled",
|
|
1786
|
+
"checkbox-toggled-all",
|
|
1787
|
+
"data-reset",
|
|
1788
|
+
"checkbox-toggled-custom"
|
|
1789
|
+
];
|
|
1790
|
+
function ul(e = {}) {
|
|
1791
|
+
var o, i;
|
|
1792
|
+
if (J) throw new Error("createVuetable requires Vue 3. Use the generic Vuetable component on Vue 2.");
|
|
1793
|
+
const n = (o = e.eventPrefix) != null ? o : "vuetable:", a = Z(S({}, be), {
|
|
1794
|
+
props: Z(S({}, be.props), {
|
|
1795
|
+
eventPrefix: Z(S({}, be.props.eventPrefix), {
|
|
1796
|
+
default: n,
|
|
1797
|
+
validator: (s) => s === n
|
|
1798
|
+
})
|
|
1799
|
+
}),
|
|
1800
|
+
emits: [...new Set([...Ja, ...(i = e.events) != null ? i : []].reduce((s, d) => {
|
|
1801
|
+
const u = `${n}${d}`, m = u.replace(/-(\w)/g, (p, g) => g.toUpperCase());
|
|
1802
|
+
return s.push(u, m.charAt(0).toLowerCase() + m.slice(1)), s;
|
|
1803
|
+
}, []))]
|
|
1804
|
+
});
|
|
1805
|
+
return delete a.install, a;
|
|
1806
|
+
}
|
|
1807
|
+
const Ne = typeof globalThis == "object" ? globalThis : typeof self == "object" ? self : void 0;
|
|
1808
|
+
Ne && !Ne.Promise && (Ne.Promise = q);
|
|
1809
|
+
function Xa(e) {
|
|
1810
|
+
e.component("vuetable", xa), e.component("vuetable-col-gutter", Ue), e.component("vuetable-field-checkbox", Ze), e.component("vuetable-field-handle", Qe), e.component("vuetable-field-sequence", Je), e.component("vuetable-pagination", Oa), e.component("vuetable-pagination-dropdown", Ma), e.component("vuetable-pagination-info", _a), e.component("vuetable-row-header", Xt);
|
|
1811
|
+
}
|
|
1812
|
+
const xa = Object.assign(be, { install: Xa });
|
|
1813
|
+
export {
|
|
1814
|
+
xa as Vuetable,
|
|
1815
|
+
Ue as VuetableColGutter,
|
|
1816
|
+
Ze as VuetableFieldCheckbox,
|
|
1817
|
+
ol as VuetableFieldCheckboxMixin,
|
|
1818
|
+
Qe as VuetableFieldHandle,
|
|
1819
|
+
Na as VuetableFieldMixin,
|
|
1820
|
+
Je as VuetableFieldSequence,
|
|
1821
|
+
Oa as VuetablePagination,
|
|
1822
|
+
Ma as VuetablePaginationDropdown,
|
|
1823
|
+
_a as VuetablePaginationInfo,
|
|
1824
|
+
il as VuetablePaginationInfoMixin,
|
|
1825
|
+
rl as VuetablePaginationMixin,
|
|
1826
|
+
Xt as VuetableRowHeader,
|
|
1827
|
+
ul as createVuetable,
|
|
1828
|
+
xa as default,
|
|
1829
|
+
Xa as install,
|
|
1830
|
+
za as useVuetableField,
|
|
1831
|
+
sl as useVuetableFieldCheckbox,
|
|
1832
|
+
xt as useVuetablePagination,
|
|
1833
|
+
Aa as useVuetablePaginationInfo
|
|
1834
|
+
};
|
|
1835
|
+
//# sourceMappingURL=vue3.js.map
|