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