golden-logic-ui 1.3.30 → 1.3.32
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/dist/components/GeneralComponents/DataTable/GLDataTable.vue.js +57 -57
- package/dist/components/GeneralComponents/DataTable/GLDataTableServerSide.vue.js +95 -85
- package/dist/components/GeneralComponents/DataTable/GlDataTableComponent.vue.js +119 -119
- package/dist/components/GeneralComponents/DataTable/GlDataTableServerSideGroupBy.vue.js +38 -28
- package/dist/golden-logic-ui.css +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import L from "../../../node_modules/vue3-print-nb/dist/vue3-print-nb.es.js";
|
|
2
|
-
import { resolveComponent as D, resolveDirective as E, createElementBlock as l, openBlock as i, withDirectives as T, createElementVNode as r, createCommentVNode as j, createVNode as v, vModelText as O, withCtx as M, createTextVNode as
|
|
2
|
+
import { resolveComponent as D, resolveDirective as E, createElementBlock as l, openBlock as i, withDirectives as T, createElementVNode as r, createCommentVNode as j, createVNode as v, vModelText as O, withCtx as M, createTextVNode as f, Fragment as m, renderList as w, withModifiers as k, toDisplayString as g, normalizeClass as P } from "vue";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import A from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
5
|
const H = {
|
|
@@ -52,7 +52,7 @@ const H = {
|
|
|
52
52
|
computed: {
|
|
53
53
|
filteredData() {
|
|
54
54
|
const t = this.search.toLowerCase();
|
|
55
|
-
return this.sortData(this.data).filter((
|
|
55
|
+
return this.sortData(this.data).filter((a) => Object.values(a).some(
|
|
56
56
|
(d) => d != null && d.toString().toLowerCase().includes(t)
|
|
57
57
|
));
|
|
58
58
|
},
|
|
@@ -70,7 +70,7 @@ const H = {
|
|
|
70
70
|
), e = t + this.maxDisplayedPages - 1;
|
|
71
71
|
return e > this.totalPages && (e = this.totalPages, t = Math.max(e - this.maxDisplayedPages + 1, 1)), Array.from(
|
|
72
72
|
{ length: e - t + 1 },
|
|
73
|
-
(
|
|
73
|
+
(a, d) => t + d
|
|
74
74
|
);
|
|
75
75
|
},
|
|
76
76
|
firstItemIndex() {
|
|
@@ -83,14 +83,14 @@ const H = {
|
|
|
83
83
|
},
|
|
84
84
|
methods: {
|
|
85
85
|
async exportToExcel() {
|
|
86
|
-
const t = await import("xlsx"), e = t.default || t,
|
|
87
|
-
e.utils.book_append_sheet(
|
|
86
|
+
const t = await import("xlsx"), e = t.default || t, a = document.querySelector("#table" + this.Random_string), d = Array.from(a.querySelectorAll("thead th")).map((h) => h.innerText), o = ["", ...["action"]], p = d.map((h, b) => o.includes(h) ? b : -1).filter((h) => h !== -1), y = Array.from(a.querySelectorAll("tbody tr")).map((h) => Array.from(h.querySelectorAll("td")).map((C) => C.innerText).filter((C, S) => !p.includes(S))), s = [d.filter((h, b) => !p.includes(b)), ...y], c = e.utils.aoa_to_sheet(s), x = e.utils.book_new();
|
|
87
|
+
e.utils.book_append_sheet(x, c, "Sheet1"), e.writeFile(x, "exported-file.xlsx");
|
|
88
88
|
},
|
|
89
89
|
generateRandomString(t) {
|
|
90
90
|
let e = "";
|
|
91
|
-
const
|
|
92
|
-
for (let
|
|
93
|
-
e +=
|
|
91
|
+
const a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", d = a.length;
|
|
92
|
+
for (let n = 0; n < t; n++)
|
|
93
|
+
e += a.charAt(
|
|
94
94
|
Math.floor(Math.random() * d)
|
|
95
95
|
);
|
|
96
96
|
return e;
|
|
@@ -110,7 +110,7 @@ const H = {
|
|
|
110
110
|
t === this.sortKey ? this.sortOrder *= -1 : (this.sortKey = t, this.sortOrder = 1);
|
|
111
111
|
},
|
|
112
112
|
sortData(t) {
|
|
113
|
-
return this.sortKey ? t.slice().sort((e,
|
|
113
|
+
return this.sortKey ? t.slice().sort((e, a) => (e[this.sortKey] < a[this.sortKey] ? -1 : 1) * this.sortOrder) : t;
|
|
114
114
|
},
|
|
115
115
|
previousPage() {
|
|
116
116
|
this.currentPage > 1 && this.currentPage--;
|
|
@@ -144,21 +144,21 @@ const H = {
|
|
|
144
144
|
key: 0,
|
|
145
145
|
class: "flex items-center justify-between px-4 py-3 bg-white border-gray-200 sm:px-6 dark:text-gray-400 dark:bg-gray-800"
|
|
146
146
|
}, ee = { class: "flex flex-col items-center w-full gap-2" }, te = { class: "text-sm text-gray-700 dark:text-gray-400" }, re = { class: "font-semibold text-gray-900 dark:text-white" }, se = { class: "font-semibold text-gray-900 dark:text-white" }, ae = { class: "font-semibold text-gray-900 dark:text-white" }, ne = { "aria-label": "Page navigation" }, oe = { class: "flex items-center h-8 -space-x-px text-sm" }, le = ["onClick", "aria-current"];
|
|
147
|
-
function ie(t, e,
|
|
148
|
-
const
|
|
147
|
+
function ie(t, e, a, d, n, o) {
|
|
148
|
+
const p = D("dropdown"), y = D("gl-button"), _ = E("print");
|
|
149
149
|
return i(), l("div", V, [
|
|
150
150
|
T(r("button", B, null, 512), [
|
|
151
|
-
[_,
|
|
151
|
+
[_, n.printObj]
|
|
152
152
|
]),
|
|
153
153
|
r("div", I, [
|
|
154
154
|
r("div", K, [
|
|
155
155
|
e[4] || (e[4] = r("span", { class: "font-medium" }, " Show ", -1)),
|
|
156
156
|
r("div", q, [
|
|
157
|
-
v(
|
|
157
|
+
v(p, {
|
|
158
158
|
has_cancel: !1,
|
|
159
|
-
options:
|
|
160
|
-
modelValue:
|
|
161
|
-
"onUpdate:modelValue": e[0] || (e[0] = (s) =>
|
|
159
|
+
options: n.showNoOfEntries,
|
|
160
|
+
modelValue: n.itemsPerPage,
|
|
161
|
+
"onUpdate:modelValue": e[0] || (e[0] = (s) => n.itemsPerPage = s),
|
|
162
162
|
is_required: !1,
|
|
163
163
|
field_name: "NoOfEntries",
|
|
164
164
|
label_name: "",
|
|
@@ -177,17 +177,17 @@ function ie(t, e, o, d, a, n) {
|
|
|
177
177
|
e[6] || (e[6] = r("div", { class: "absolute inset-y-0 left-0 flex items-center pointer-events-none rtl:inset-r-0 rtl:right-0 ps-3" }, null, -1)),
|
|
178
178
|
T(r("input", {
|
|
179
179
|
type: "text",
|
|
180
|
-
"onUpdate:modelValue": e[1] || (e[1] = (s) =>
|
|
180
|
+
"onUpdate:modelValue": e[1] || (e[1] = (s) => n.search = s),
|
|
181
181
|
class: "gl-input-form",
|
|
182
182
|
placeholder: "Search ..."
|
|
183
183
|
}, null, 512), [
|
|
184
|
-
[O,
|
|
184
|
+
[O, n.search]
|
|
185
185
|
])
|
|
186
186
|
])
|
|
187
187
|
]),
|
|
188
188
|
r("div", N, [
|
|
189
189
|
v(y, {
|
|
190
|
-
onClick:
|
|
190
|
+
onClick: o.delayedPrint,
|
|
191
191
|
tag: "button",
|
|
192
192
|
is_loading: t.isLoadingPrint,
|
|
193
193
|
button_type: "light",
|
|
@@ -198,12 +198,12 @@ function ie(t, e, o, d, a, n) {
|
|
|
198
198
|
</svg>`
|
|
199
199
|
}, {
|
|
200
200
|
default: M(() => e[8] || (e[8] = [
|
|
201
|
-
|
|
201
|
+
f(" Print ")
|
|
202
202
|
])),
|
|
203
203
|
_: 1
|
|
204
204
|
}, 8, ["onClick", "is_loading"]),
|
|
205
205
|
v(y, {
|
|
206
|
-
onClick:
|
|
206
|
+
onClick: o.exportToExcel,
|
|
207
207
|
tag: "button",
|
|
208
208
|
button_type: "light",
|
|
209
209
|
has_border_reduced: !1,
|
|
@@ -214,29 +214,29 @@ function ie(t, e, o, d, a, n) {
|
|
|
214
214
|
`
|
|
215
215
|
}, {
|
|
216
216
|
default: M(() => e[9] || (e[9] = [
|
|
217
|
-
|
|
217
|
+
f(" Excel ")
|
|
218
218
|
])),
|
|
219
219
|
_: 1
|
|
220
220
|
}, 8, ["onClick"])
|
|
221
221
|
]),
|
|
222
222
|
r("div", {
|
|
223
|
-
id: "print_" +
|
|
223
|
+
id: "print_" + n.Random_string,
|
|
224
224
|
class: "overflow-auto rounded-lg dark:text-gray-400 dark:bg-gray-800"
|
|
225
225
|
}, [
|
|
226
226
|
r("table", {
|
|
227
|
-
id: "table" +
|
|
227
|
+
id: "table" + n.Random_string,
|
|
228
228
|
class: "w-full h-full max-w-full overflow-hidden bg-white border-separate xl:overflow-auto lg:border-collapse print:border-collapse! border-spacing-y-5 lg:border-spacing-y-0 print:border-spacing-y-0! dark:border-gray-800 dark:bg-gray-900"
|
|
229
229
|
}, [
|
|
230
230
|
r("thead", z, [
|
|
231
231
|
r("tr", null, [
|
|
232
|
-
(i(!0), l(m, null, w(
|
|
233
|
-
key:
|
|
234
|
-
onClick: k((
|
|
232
|
+
(i(!0), l(m, null, w(a.columns, (s, c) => (i(), l("th", {
|
|
233
|
+
key: c,
|
|
234
|
+
onClick: k((x) => o.sort(s), ["prevent"]),
|
|
235
235
|
class: "w-full px-4 py-2 lg:w-2/12 print:w-2/12! print:border!"
|
|
236
236
|
}, [
|
|
237
237
|
r("div", X, [
|
|
238
|
-
r("span", null,
|
|
239
|
-
|
|
238
|
+
r("span", null, g(s), 1),
|
|
239
|
+
n.sortKey === s ? (i(), l("span", G, e[10] || (e[10] = [
|
|
240
240
|
r("svg", {
|
|
241
241
|
class: "w-4 h-4",
|
|
242
242
|
"aria-hidden": "true",
|
|
@@ -258,47 +258,47 @@ function ie(t, e, o, d, a, n) {
|
|
|
258
258
|
])
|
|
259
259
|
]),
|
|
260
260
|
r("tbody", W, [
|
|
261
|
-
(i(!0), l(m, null, w(
|
|
262
|
-
key:
|
|
261
|
+
(i(!0), l(m, null, w(o.paginatedData, (s, c) => (i(), l("tr", {
|
|
262
|
+
key: c,
|
|
263
263
|
class: "text-gray-500 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800 dark:hover:text-gray-200"
|
|
264
264
|
}, [
|
|
265
|
-
(i(!0), l(m, null, w(
|
|
266
|
-
key:
|
|
267
|
-
"data-label":
|
|
265
|
+
(i(!0), l(m, null, w(a.columns, (x, u) => (i(), l("td", {
|
|
266
|
+
key: u,
|
|
267
|
+
"data-label": x,
|
|
268
268
|
class: P(["text-pretty before:content-[attr(data-label)] before:font-bold dark:before:text-gray-400 lg:before:content-[''] print:before:content-['']! flex flex-row flex-wrap items-center justify-between gap-x-4 gap-y-1 wrap-anywhere lg:wrap-normal lg:table-cell print:table-cell! py-2.5 px-4 lg:py-3 lg:px-4 print:py-3! print:px-4! border-[1px]! dark:border-gray-700", {
|
|
269
|
-
"rounded-t-lg lg:rounded-t-none!":
|
|
270
|
-
"rounded-b-lg lg:rounded-b-none!":
|
|
269
|
+
"rounded-t-lg lg:rounded-t-none!": u === 0,
|
|
270
|
+
"rounded-b-lg lg:rounded-b-none!": u === a.columns.length - 1
|
|
271
271
|
}])
|
|
272
272
|
}, [
|
|
273
|
-
|
|
273
|
+
a.escape_html ? (i(), l("p", Q, g(s[u]), 1)) : (i(), l("p", {
|
|
274
274
|
key: 1,
|
|
275
275
|
class: "text-pretty",
|
|
276
|
-
innerHTML: s[
|
|
276
|
+
innerHTML: s[u]
|
|
277
277
|
}, null, 8, Y))
|
|
278
278
|
], 10, J))), 128))
|
|
279
279
|
]))), 128))
|
|
280
280
|
])
|
|
281
281
|
], 8, Z)
|
|
282
282
|
], 8, F),
|
|
283
|
-
|
|
283
|
+
o.paginatedData.length > 0 ? (i(), l("div", $, [
|
|
284
284
|
r("div", ee, [
|
|
285
285
|
r("p", te, [
|
|
286
|
-
|
|
287
|
-
r("span", re,
|
|
288
|
-
|
|
289
|
-
r("span", se,
|
|
290
|
-
|
|
291
|
-
r("span", ae,
|
|
292
|
-
|
|
286
|
+
f(g(a.language?.showing ?? "Showing") + " ", 1),
|
|
287
|
+
r("span", re, g(o.firstItemIndex), 1),
|
|
288
|
+
f(" " + g(a.language?.to ?? "to") + " ", 1),
|
|
289
|
+
r("span", se, g(o.lastItemIndex), 1),
|
|
290
|
+
f(" " + g(a.language?.of ?? "of") + " ", 1),
|
|
291
|
+
r("span", ae, g(o.filteredData.length), 1),
|
|
292
|
+
f(" " + g(a.language?.entries ?? "entries"), 1)
|
|
293
293
|
]),
|
|
294
294
|
r("nav", ne, [
|
|
295
295
|
r("ul", oe, [
|
|
296
296
|
r("li", null, [
|
|
297
297
|
r("a", {
|
|
298
298
|
href: "#",
|
|
299
|
-
onClick: e[2] || (e[2] = k((...s) =>
|
|
299
|
+
onClick: e[2] || (e[2] = k((...s) => o.previousPage && o.previousPage(...s), ["prevent"])),
|
|
300
300
|
class: "flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 ms-0 border-e-0 rounded-s-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
|
|
301
|
-
}, e[
|
|
301
|
+
}, e[11] || (e[11] = [
|
|
302
302
|
r("span", { class: "sr-only" }, "Previous", -1),
|
|
303
303
|
r("svg", {
|
|
304
304
|
class: "w-2.5 h-2.5 rtl:rotate-180",
|
|
@@ -317,23 +317,23 @@ function ie(t, e, o, d, a, n) {
|
|
|
317
317
|
], -1)
|
|
318
318
|
]))
|
|
319
319
|
]),
|
|
320
|
-
(i(!0), l(m, null, w(
|
|
320
|
+
(i(!0), l(m, null, w(o.displayedPageNumbers, (s) => (i(), l("li", {
|
|
321
321
|
key: s,
|
|
322
|
-
class: P(Math.abs(s -
|
|
322
|
+
class: P(Math.abs(s - n.currentPage) > 2 ? "hidden sm:block" : "")
|
|
323
323
|
}, [
|
|
324
324
|
r("a", {
|
|
325
325
|
href: "#",
|
|
326
|
-
onClick: k((
|
|
327
|
-
class: P(
|
|
328
|
-
"aria-current":
|
|
329
|
-
},
|
|
326
|
+
onClick: k((c) => o.goToPage(s), ["prevent"]),
|
|
327
|
+
class: P(n.currentPage === s ? "z-10 flex items-center justify-center h-8 px-3 leading-tight text-blue-600 border border-blue-300 bg-blue-50 hover:bg-blue-100 hover:text-blue-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white" : "flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"),
|
|
328
|
+
"aria-current": n.currentPage === s ? "page" : void 0
|
|
329
|
+
}, g(s), 11, le)
|
|
330
330
|
], 2))), 128)),
|
|
331
331
|
r("li", null, [
|
|
332
332
|
r("a", {
|
|
333
333
|
href: "#",
|
|
334
|
-
onClick: e[3] || (e[3] = k((...s) =>
|
|
334
|
+
onClick: e[3] || (e[3] = k((...s) => o.nextPage && o.nextPage(...s), ["prevent"])),
|
|
335
335
|
class: "flex items-center justify-center h-8 px-3 leading-tight text-gray-500 bg-white border border-gray-300 rounded-e-lg hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
|
|
336
|
-
}, e[
|
|
336
|
+
}, e[12] || (e[12] = [
|
|
337
337
|
r("span", { class: "sr-only" }, "Next", -1),
|
|
338
338
|
r("svg", {
|
|
339
339
|
class: "w-2.5 h-2.5 rtl:rotate-180",
|
|
@@ -358,7 +358,7 @@ function ie(t, e, o, d, a, n) {
|
|
|
358
358
|
])) : j("", !0)
|
|
359
359
|
]);
|
|
360
360
|
}
|
|
361
|
-
const ue = /* @__PURE__ */ A(H, [["render", ie], ["__scopeId", "data-v-
|
|
361
|
+
const ue = /* @__PURE__ */ A(H, [["render", ie], ["__scopeId", "data-v-dc892000"]]);
|
|
362
362
|
export {
|
|
363
363
|
ue as default
|
|
364
364
|
};
|