golden-logic-ui 1.3.27 → 1.3.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import L from "../../../node_modules/vue3-print-nb/dist/vue3-print-nb.es.js";
2
- import { resolveComponent as C, resolveDirective as E, createElementBlock as l, openBlock as i, withDirectives as D, createElementVNode as r, createCommentVNode as T, createVNode as w, vModelText as O, withCtx as j, createTextVNode as u, Fragment as m, renderList as k, withModifiers as v, toDisplayString as p, normalizeClass as M } from "vue";
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 u, Fragment as m, renderList as w, withModifiers as k, toDisplayString as p, 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((n) => Object.values(n).some(
55
+ return this.sortData(this.data).filter((o) => Object.values(o).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
- (n, d) => t + d
73
+ (o, 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, n = document.querySelector("#table" + this.Random_string), d = Array.from(n.querySelectorAll("thead th")).map((g) => g.innerText), a = ["", ...["action"]], x = d.map((g, b) => a.includes(g) ? b : -1).filter((g) => g !== -1), y = Array.from(n.querySelectorAll("tbody tr")).map((g) => Array.from(g.querySelectorAll("td")).map((_) => _.innerText).filter((_, S) => !x.includes(S))), s = [d.filter((g, b) => !x.includes(b)), ...y], h = e.utils.aoa_to_sheet(s), f = e.utils.book_new();
86
+ const t = await import("xlsx"), e = t.default || t, o = document.querySelector("#table" + this.Random_string), d = Array.from(o.querySelectorAll("thead th")).map((g) => g.innerText), n = ["", ...["action"]], x = d.map((g, b) => n.includes(g) ? b : -1).filter((g) => g !== -1), y = Array.from(o.querySelectorAll("tbody tr")).map((g) => Array.from(g.querySelectorAll("td")).map((C) => C.innerText).filter((C, S) => !x.includes(S))), s = [d.filter((g, b) => !x.includes(b)), ...y], h = e.utils.aoa_to_sheet(s), f = e.utils.book_new();
87
87
  e.utils.book_append_sheet(f, h, "Sheet1"), e.writeFile(f, "exported-file.xlsx");
88
88
  },
89
89
  generateRandomString(t) {
90
90
  let e = "";
91
- const n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", d = n.length;
92
- for (let o = 0; o < t; o++)
93
- e += n.charAt(
91
+ const o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", d = o.length;
92
+ for (let a = 0; a < t; a++)
93
+ e += o.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, n) => (e[this.sortKey] < n[this.sortKey] ? -1 : 1) * this.sortOrder) : t;
113
+ return this.sortKey ? t.slice().sort((e, o) => (e[this.sortKey] < o[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, n, d, o, a) {
148
- const x = C("dropdown"), y = C("gl-button"), P = E("print");
147
+ function ie(t, e, o, d, a, n) {
148
+ const x = D("dropdown"), y = D("gl-button"), _ = E("print");
149
149
  return i(), l("div", V, [
150
- D(r("button", B, null, 512), [
151
- [P, o.printObj]
150
+ T(r("button", B, null, 512), [
151
+ [_, a.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
- w(x, {
157
+ v(x, {
158
158
  has_cancel: !1,
159
- options: o.showNoOfEntries,
160
- modelValue: o.itemsPerPage,
161
- "onUpdate:modelValue": e[0] || (e[0] = (s) => o.itemsPerPage = s),
159
+ options: a.showNoOfEntries,
160
+ modelValue: a.itemsPerPage,
161
+ "onUpdate:modelValue": e[0] || (e[0] = (s) => a.itemsPerPage = s),
162
162
  is_required: !1,
163
163
  field_name: "NoOfEntries",
164
164
  label_name: "",
@@ -175,19 +175,19 @@ function ie(t, e, n, d, o, a) {
175
175
  }, "Search", -1)),
176
176
  r("div", R, [
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
- D(r("input", {
178
+ T(r("input", {
179
179
  type: "text",
180
- "onUpdate:modelValue": e[1] || (e[1] = (s) => o.search = s),
180
+ "onUpdate:modelValue": e[1] || (e[1] = (s) => a.search = s),
181
181
  class: "gl-input-form",
182
182
  placeholder: "Search ..."
183
183
  }, null, 512), [
184
- [O, o.search]
184
+ [O, a.search]
185
185
  ])
186
186
  ])
187
187
  ]),
188
188
  r("div", N, [
189
- w(y, {
190
- onClick: a.delayedPrint,
189
+ v(y, {
190
+ onClick: n.delayedPrint,
191
191
  tag: "button",
192
192
  is_loading: t.isLoadingPrint,
193
193
  button_type: "light",
@@ -197,13 +197,13 @@ function ie(t, e, n, d, o, a) {
197
197
  <path stroke="currentColor" stroke-linejoin="round" stroke-width="2" d="M16.444 18H19a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h2.556M17 11V5a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v6h10ZM7 15h10v4a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1v-4Z"/>\r
198
198
  </svg>`
199
199
  }, {
200
- default: j(() => e[8] || (e[8] = [
200
+ default: M(() => e[8] || (e[8] = [
201
201
  u(" Print ")
202
202
  ])),
203
203
  _: 1
204
204
  }, 8, ["onClick", "is_loading"]),
205
- w(y, {
206
- onClick: a.exportToExcel,
205
+ v(y, {
206
+ onClick: n.exportToExcel,
207
207
  tag: "button",
208
208
  button_type: "light",
209
209
  has_border_reduced: !1,
@@ -213,30 +213,30 @@ function ie(t, e, n, d, o, a) {
213
213
  </svg>\r
214
214
  `
215
215
  }, {
216
- default: j(() => e[9] || (e[9] = [
216
+ default: M(() => e[9] || (e[9] = [
217
217
  u(" Excel ")
218
218
  ])),
219
219
  _: 1
220
220
  }, 8, ["onClick"])
221
221
  ]),
222
222
  r("div", {
223
- id: "print_" + o.Random_string,
223
+ id: "print_" + a.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" + o.Random_string,
227
+ id: "table" + a.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, k(n.columns, (s, h) => (i(), l("th", {
232
+ (i(!0), l(m, null, w(o.columns, (s, h) => (i(), l("th", {
233
233
  key: h,
234
- onClick: v((f) => a.sort(s), ["prevent"]),
234
+ onClick: k((f) => n.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
238
  r("span", null, p(s), 1),
239
- o.sortKey === s ? (i(), l("span", G, e[10] || (e[10] = [
239
+ a.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",
@@ -252,25 +252,25 @@ function ie(t, e, n, d, o, a) {
252
252
  d: "M8 20V7m0 13-4-4m4 4 4-4m4-12v13m0-13 4 4m-4-4-4 4"
253
253
  })
254
254
  ], -1)
255
- ]))) : T("", !0)
255
+ ]))) : j("", !0)
256
256
  ])
257
257
  ], 8, U))), 128))
258
258
  ])
259
259
  ]),
260
260
  r("tbody", W, [
261
- (i(!0), l(m, null, k(a.paginatedData, (s, h) => (i(), l("tr", {
261
+ (i(!0), l(m, null, w(n.paginatedData, (s, h) => (i(), l("tr", {
262
262
  key: h,
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, k(n.columns, (f, c) => (i(), l("td", {
265
+ (i(!0), l(m, null, w(o.columns, (f, c) => (i(), l("td", {
266
266
  key: c,
267
267
  "data-label": f,
268
- class: M(["text-pretty before:content-[attr(data-label)] before:font-bold dark:before:text-gray-400 lg:before:content-[''] print:before:content-['']! flex flex-col justify-between gap-2 lg:table-cell print:table-cell! py-4 px-5 lg:py-3 lg:px-4 print:py-3! print:px-4! border-[1px]! dark:border-gray-700", {
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
269
  "rounded-t-lg lg:rounded-t-none!": c === 0,
270
- "rounded-b-lg lg:rounded-b-none!": c === n.columns.length - 1
270
+ "rounded-b-lg lg:rounded-b-none!": c === o.columns.length - 1
271
271
  }])
272
272
  }, [
273
- n.escape_html ? (i(), l("p", Q, p(s[c]), 1)) : (i(), l("p", {
273
+ o.escape_html ? (i(), l("p", Q, p(s[c]), 1)) : (i(), l("p", {
274
274
  key: 1,
275
275
  class: "text-pretty",
276
276
  innerHTML: s[c]
@@ -280,15 +280,15 @@ function ie(t, e, n, d, o, a) {
280
280
  ])
281
281
  ], 8, Z)
282
282
  ], 8, F),
283
- a.paginatedData.length > 0 ? (i(), l("div", $, [
283
+ n.paginatedData.length > 0 ? (i(), l("div", $, [
284
284
  r("div", ee, [
285
285
  r("p", te, [
286
286
  e[11] || (e[11] = u(" Showing ")),
287
- r("span", re, p(a.firstItemIndex), 1),
287
+ r("span", re, p(n.firstItemIndex), 1),
288
288
  e[12] || (e[12] = u(" to ")),
289
- r("span", se, p(a.lastItemIndex), 1),
289
+ r("span", se, p(n.lastItemIndex), 1),
290
290
  e[13] || (e[13] = u(" of ")),
291
- r("span", ae, p(a.filteredData.length), 1),
291
+ r("span", ae, p(n.filteredData.length), 1),
292
292
  e[14] || (e[14] = u(" entries "))
293
293
  ]),
294
294
  r("nav", ne, [
@@ -296,7 +296,7 @@ function ie(t, e, n, d, o, a) {
296
296
  r("li", null, [
297
297
  r("a", {
298
298
  href: "#",
299
- onClick: e[2] || (e[2] = v((...s) => a.previousPage && a.previousPage(...s), ["prevent"])),
299
+ onClick: e[2] || (e[2] = k((...s) => n.previousPage && n.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
301
  }, e[15] || (e[15] = [
302
302
  r("span", { class: "sr-only" }, "Previous", -1),
@@ -317,18 +317,21 @@ function ie(t, e, n, d, o, a) {
317
317
  ], -1)
318
318
  ]))
319
319
  ]),
320
- (i(!0), l(m, null, k(a.displayedPageNumbers, (s) => (i(), l("li", { key: s }, [
320
+ (i(!0), l(m, null, w(n.displayedPageNumbers, (s) => (i(), l("li", {
321
+ key: s,
322
+ class: P(Math.abs(s - a.currentPage) > 2 ? "hidden sm:block" : "")
323
+ }, [
321
324
  r("a", {
322
325
  href: "#",
323
- onClick: v((h) => a.goToPage(s), ["prevent"]),
324
- class: M(o.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"),
325
- "aria-current": o.currentPage === s ? "page" : void 0
326
+ onClick: k((h) => n.goToPage(s), ["prevent"]),
327
+ class: P(a.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": a.currentPage === s ? "page" : void 0
326
329
  }, p(s), 11, le)
327
- ]))), 128)),
330
+ ], 2))), 128)),
328
331
  r("li", null, [
329
332
  r("a", {
330
333
  href: "#",
331
- onClick: e[3] || (e[3] = v((...s) => a.nextPage && a.nextPage(...s), ["prevent"])),
334
+ onClick: e[3] || (e[3] = k((...s) => n.nextPage && n.nextPage(...s), ["prevent"])),
332
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"
333
336
  }, e[16] || (e[16] = [
334
337
  r("span", { class: "sr-only" }, "Next", -1),
@@ -352,10 +355,10 @@ function ie(t, e, n, d, o, a) {
352
355
  ])
353
356
  ])
354
357
  ])
355
- ])) : T("", !0)
358
+ ])) : j("", !0)
356
359
  ]);
357
360
  }
358
- const ue = /* @__PURE__ */ A(H, [["render", ie], ["__scopeId", "data-v-fe0a5c64"]]);
361
+ const ue = /* @__PURE__ */ A(H, [["render", ie], ["__scopeId", "data-v-40c29557"]]);
359
362
  export {
360
363
  ue as default
361
364
  };