golden-logic-ui 1.2.21 → 1.2.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/ConfirmationModal-i3ekouBw.js +75 -0
  2. package/dist/DatatableAction-D-Qdjj2W.js +113 -0
  3. package/dist/DatatableCommand-BoU5cYJg.js +18 -0
  4. package/dist/DatatableConvertCronToHuman-Coiaa-wa.js +82 -0
  5. package/dist/DatatableDate-DtEktp_Z.js +20 -0
  6. package/dist/DatatableDateTime-PEXV-bY7.js +22 -0
  7. package/dist/DatatableDeleteAction-BQ6MyhV6.js +104 -0
  8. package/dist/DatatableDeleteEditAction-Cx324OUt.js +125 -0
  9. package/dist/DatatableFileDownload-BxP2_lpQ.js +87 -0
  10. package/dist/DatatableFiles-BROH3vBH.js +80 -0
  11. package/dist/DatatableHtml-ChZzeapg.js +17 -0
  12. package/dist/DatatableList-BSVI22pu.js +35 -0
  13. package/dist/DatatableListNested-BWEqWRCc.js +37 -0
  14. package/dist/DatatablePicture-DaWD4uIX.js +26 -0
  15. package/dist/DatatablePictures-xxeghKp3.js +39 -0
  16. package/dist/DatatableStatus-Dx60sa7s.js +31 -0
  17. package/dist/DatatableStatusGeneral-UOub65UY.js +59 -0
  18. package/dist/DatatableStatusServer-Dcq11U5_.js +37 -0
  19. package/dist/DatatableStatusSpecficColor-BYUuGgEb.js +64 -0
  20. package/dist/DatatableStatusTextLabelGeneral-J4MytOnh.js +83 -0
  21. package/dist/DeleteConfirmationModal-CQ07_qiL.js +96 -0
  22. package/dist/DynamicConfirmation-rEhA3jCe.js +115 -0
  23. package/dist/FilesUpload-JKyOru3A.js +300 -0
  24. package/dist/GLButton-ByIDh6vq.js +118 -0
  25. package/dist/GLDataTable-Bixwkdr4.js +278 -0
  26. package/dist/GLDataTableServerSide-Ra5AqDGB.js +16336 -0
  27. package/dist/GLTextarea-j7XXWI7A.js +110 -0
  28. package/dist/GlAccordion-BIAfvctc.js +91 -0
  29. package/dist/GlAccordionsWrapper-DsdunDzi.js +31 -0
  30. package/dist/GlCard-BVXmTv6q.js +37 -0
  31. package/dist/GlCodeCopy-C068yRcM.js +86 -0
  32. package/dist/GlCodeMirror-Ow8TJYSN.js +161 -0
  33. package/dist/GlCodeMirrorTranslate-CFmoM7d6.js +2068 -0
  34. package/dist/GlDataTableComponent-CSsMcDcX.js +366 -0
  35. package/dist/GlDataTableServerSideGroupBy-cG4BhXOA.js +260 -0
  36. package/dist/GlDateRangePicker-BWAEfZTB.js +124 -0
  37. package/dist/GlDropdown-B_zVkmxO.js +414 -0
  38. package/dist/GlLanguageSelector-DmWuIxzK.js +68 -0
  39. package/dist/GlModal-AMtSRssu.js +123 -0
  40. package/dist/GlModalShow-BzbcLu51.js +120 -0
  41. package/dist/GlModalWithoutOverflow-vR50Ulka.js +127 -0
  42. package/dist/GlMultiItemSlide-CxsiUcTr.js +409 -0
  43. package/dist/GlMultiItemSlideDynamic-BhdHrj3L.js +434 -0
  44. package/dist/GlMultiSelectDropdown-OaAC5ouZ.js +383 -0
  45. package/dist/GlTab-CUbU0yit.js +22 -0
  46. package/dist/GlTabShow-BBU3VU7O.js +21 -0
  47. package/dist/GlTabsWrapper-Dw7NAgDw.js +54 -0
  48. package/dist/GlTextCopy-CGgnIqPh.js +93 -0
  49. package/dist/GlTextInput-CoL8oZSw.js +126 -0
  50. package/dist/GlTextInputFile-BE2maeRQ.js +95 -0
  51. package/dist/GlTextInputWithText-C6fzOoYl.js +116 -0
  52. package/dist/GlTextTranslate-C3DzCK6k.js +125 -0
  53. package/dist/GlTextareaTranslate-DyU86Wf_.js +126 -0
  54. package/dist/GlTinymce-CjsbThKo.js +118 -0
  55. package/dist/GlTinymceTranslate-vp6hYqDK.js +188 -0
  56. package/dist/GlToastList-eeZ0hUJQ.js +126 -0
  57. package/dist/GlToggleBox-Dym29cx5.js +120 -0
  58. package/dist/GlToggleBoxTrueFalse-CjvcXXTw.js +112 -0
  59. package/dist/StatusConnectingConnectedDisconnected-CK5YzyQH.js +63 -0
  60. package/dist/StatusRunningSuccessFailed-CxK20462.js +41 -0
  61. package/dist/TailwindPagination-Dz89aS_l.js +276 -0
  62. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  63. package/dist/golden-logic-ui.css +1 -1
  64. package/dist/golden-logic-ui.js +217 -94352
  65. package/dist/golden-logic-ui.umd.cjs +94 -94
  66. package/dist/index-B4V16SEr.js +15668 -0
  67. package/dist/plugin-D6yBFU6i.js +53226 -0
  68. package/package.json +1 -1
@@ -0,0 +1,366 @@
1
+ import { resolveComponent as p, createElementBlock as d, openBlock as l, createElementVNode as e, createCommentVNode as h, createVNode as w, withDirectives as P, vModelText as _, Fragment as y, renderList as m, createTextVNode as c, toDisplayString as g, normalizeClass as D, createBlock as C, resolveDynamicComponent as j, withModifiers as b } from "vue";
2
+ import { _ as A } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ const L = {
4
+ components: {},
5
+ props: {
6
+ data: Array,
7
+ columns: Array,
8
+ get_item_url: String,
9
+ xprops: Object
10
+ },
11
+ data() {
12
+ return {
13
+ isLoading: !1,
14
+ itemLists: [],
15
+ data: [],
16
+ showNoOfEntries: [1, 2, 3, 10, 20, 30, 40],
17
+ search: "",
18
+ sortKey: "",
19
+ sortOrder: 1,
20
+ currentPage: 1,
21
+ itemsPerPage: 10,
22
+ jumpToPage: "",
23
+ maxDisplayedPages: 10
24
+ // Set the maximum number of displayed pagination buttons
25
+ };
26
+ },
27
+ emits: ["editAction", "generalAction", "deleteAction"],
28
+ computed: {
29
+ filteredData() {
30
+ const r = this.search.toLowerCase();
31
+ return this.sortData(this.itemLists).filter((o) => Object.values(o).some(
32
+ (u) => u != null && u.toString().toLowerCase().includes(r)
33
+ ));
34
+ },
35
+ totalPages() {
36
+ return Math.ceil(this.filteredData.length / this.itemsPerPage);
37
+ },
38
+ paginatedData() {
39
+ const r = (this.currentPage - 1) * this.itemsPerPage, t = r + this.itemsPerPage;
40
+ return this.filteredData.slice(r, t);
41
+ },
42
+ displayedPageNumbers() {
43
+ let r = Math.max(
44
+ this.currentPage - Math.floor(this.maxDisplayedPages / 2),
45
+ 1
46
+ ), t = r + this.maxDisplayedPages - 1;
47
+ return t > this.totalPages && (t = this.totalPages, r = Math.max(t - this.maxDisplayedPages + 1, 1)), Array.from(
48
+ { length: t - r + 1 },
49
+ (o, u) => r + u
50
+ );
51
+ },
52
+ firstItemIndex() {
53
+ return this.itemsPerPage * (this.currentPage - 1) + 1;
54
+ },
55
+ lastItemIndex() {
56
+ const r = this.itemsPerPage * this.currentPage;
57
+ return r > this.filteredData.length ? this.filteredData.length : r;
58
+ }
59
+ },
60
+ methods: {
61
+ editAction(r) {
62
+ this.$emit("editAction", r);
63
+ },
64
+ deleteAction() {
65
+ this.$emit("deleteAction");
66
+ },
67
+ generalAction(r) {
68
+ this.$emit("generalAction", r);
69
+ },
70
+ forDynCompIs(r) {
71
+ return typeof r == "object" ? r : null;
72
+ },
73
+ handleItemsPerPageChange(r) {
74
+ this.itemsPerPage = r;
75
+ },
76
+ goToPage(r) {
77
+ r >= 1 && r <= this.totalPages && (this.currentPage = r);
78
+ },
79
+ sort(r) {
80
+ r === this.sortKey ? this.sortOrder *= -1 : (this.sortKey = r, this.sortOrder = 1);
81
+ },
82
+ sortData(r) {
83
+ return this.sortKey ? r.slice().sort((t, o) => (t[this.sortKey] < o[this.sortKey] ? -1 : 1) * this.sortOrder) : r;
84
+ },
85
+ previousPage() {
86
+ this.currentPage > 1 && this.currentPage--;
87
+ },
88
+ nextPage() {
89
+ this.currentPage < this.totalPages && this.currentPage++;
90
+ },
91
+ firstPage() {
92
+ this.currentPage = 1;
93
+ },
94
+ lastPage() {
95
+ this.currentPage = this.totalPages;
96
+ },
97
+ goToPage(r) {
98
+ r >= 1 && r <= this.totalPages && (this.currentPage = r);
99
+ },
100
+ GetItemLists() {
101
+ this.isLoading = !0, axios.get(this.xprops.route_get_data).then((r) => {
102
+ this.itemLists = r.data, this.isLoading = !1;
103
+ }).catch((r) => {
104
+ console.error(r), this.isLoading = !1;
105
+ });
106
+ }
107
+ },
108
+ mounted() {
109
+ this.GetItemLists();
110
+ }
111
+ }, I = { class: "p-2" }, O = { class: "flex flex-wrap pb-4 space-y-4 md:items-center md:justify-between flex-column sm:flex-row sm:space-y-0" }, T = { class: "flex items-center gap-2" }, E = { style: { "margin-top": "9px" } }, V = { class: "relative" }, K = { class: "overflow-auto rounded-lg dark:text-gray-400 dark:bg-gray-800" }, M = { class: "w-full h-full max-w-full overflow-hidden bg-white border-separate xl:overflow-auto lg:border-collapse border-spacing-y-5 lg:border-spacing-y-0 dark:border-strokeDark dark:bg-boxDark" }, S = { class: "hidden text-sm font-normal text-center text-gray-500 lg:table-header-group dark:border-strokeDark bg-gray-50 dark:bg-gray-700 dark:text-gray-400" }, G = ["onClick"], B = {
112
+ key: 0,
113
+ class: "ml-2"
114
+ }, z = {
115
+ key: 0,
116
+ class: "fa fa-arrow-up"
117
+ }, U = {
118
+ key: 1,
119
+ class: "fa fa-arrow-down"
120
+ }, q = { key: 0 }, F = ["colspan"], N = ["data-label"], H = { class: "overflow-auto max-h-40" }, J = {
121
+ key: 0,
122
+ 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"
123
+ }, Q = { class: "flex justify-between flex-1 sm:hidden" }, R = ["disabled"], W = ["disabled"], X = { class: "hidden sm:flex sm:flex-1 sm:items-center sm:justify-between" }, Y = { class: "text-sm text-gray-700 dark:text-gray-400" }, Z = { class: "font-medium" }, $ = { class: "font-medium" }, ee = { class: "font-medium" }, te = { "aria-label": "Page navigation" }, re = { class: "flex items-center h-8 -space-x-px text-sm" }, se = ["disabled"], ae = ["onClick"], le = ["onClick"], de = ["disabled"];
124
+ function ie(r, t, o, u, i, a) {
125
+ const k = p("dropdown");
126
+ return l(), d("div", I, [
127
+ e("div", O, [
128
+ e("div", T, [
129
+ t[7] || (t[7] = e("span", { class: "font-medium" }, " Show ", -1)),
130
+ e("div", E, [
131
+ w(k, {
132
+ has_cancel: !1,
133
+ options: i.showNoOfEntries,
134
+ modelValue: i.itemsPerPage,
135
+ "onUpdate:modelValue": t[0] || (t[0] = (s) => i.itemsPerPage = s),
136
+ is_required: !1,
137
+ field_name: "NoOfEntries",
138
+ label_name: "",
139
+ default_value: 10,
140
+ show: !1,
141
+ placeholder: "Please select an option"
142
+ }, null, 8, ["options", "modelValue"])
143
+ ]),
144
+ t[8] || (t[8] = e("span", { class: "font-medium" }, " Entries ", -1))
145
+ ]),
146
+ t[10] || (t[10] = e("label", {
147
+ for: "table-search",
148
+ class: "sr-only"
149
+ }, "Search", -1)),
150
+ e("div", V, [
151
+ t[9] || (t[9] = e("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)),
152
+ P(e("input", {
153
+ type: "text",
154
+ "onUpdate:modelValue": t[1] || (t[1] = (s) => i.search = s),
155
+ class: "block p-2 text-sm text-gray-900 border border-gray-300 rounded-lg ps-10 w-80 bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",
156
+ placeholder: "Search ..."
157
+ }, null, 512), [
158
+ [_, i.search]
159
+ ])
160
+ ])
161
+ ]),
162
+ e("div", K, [
163
+ e("table", M, [
164
+ e("thead", S, [
165
+ e("tr", null, [
166
+ (l(!0), d(y, null, m(o.columns, (s, f) => (l(), d("th", {
167
+ key: f,
168
+ onClick: (n) => a.sort(s.field_name, s.sortable),
169
+ class: "w-full px-4 py-2 lg:w-2/12"
170
+ }, [
171
+ c(g(s.field_label) + " ", 1),
172
+ i.sortKey === s.field_name ? (l(), d("span", B, [
173
+ i.sortOrder === 1 ? (l(), d("i", z)) : (l(), d("i", U))
174
+ ])) : h("", !0)
175
+ ], 8, G))), 128))
176
+ ])
177
+ ]),
178
+ e("tbody", null, [
179
+ i.isLoading ? (l(), d("tr", q, [
180
+ e("td", {
181
+ colspan: o.columns.length
182
+ }, t[11] || (t[11] = [
183
+ e("div", {
184
+ role: "status",
185
+ class: "p-4 space-y-4 border border-gray-200 divide-y divide-gray-200 rounded-sm shadow-sm animate-pulse dark:divide-gray-700 md:p-6 dark:border-gray-700"
186
+ }, [
187
+ e("div", { class: "flex items-center justify-between" }, [
188
+ e("div", null, [
189
+ e("div", { class: "h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3" }),
190
+ e("div", { class: "w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700" })
191
+ ]),
192
+ e("div", { class: "h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12" })
193
+ ]),
194
+ e("div", { class: "flex items-center justify-between pt-4" }, [
195
+ e("div", null, [
196
+ e("div", { class: "h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3" }),
197
+ e("div", { class: "w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700" })
198
+ ]),
199
+ e("div", { class: "h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12" })
200
+ ]),
201
+ e("div", { class: "flex items-center justify-between pt-4" }, [
202
+ e("div", null, [
203
+ e("div", { class: "h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3" }),
204
+ e("div", { class: "w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700" })
205
+ ]),
206
+ e("div", { class: "h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12" })
207
+ ]),
208
+ e("div", { class: "flex items-center justify-between pt-4" }, [
209
+ e("div", null, [
210
+ e("div", { class: "h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3" }),
211
+ e("div", { class: "w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700" })
212
+ ]),
213
+ e("div", { class: "h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12" })
214
+ ]),
215
+ e("div", { class: "flex items-center justify-between pt-4" }, [
216
+ e("div", null, [
217
+ e("div", { class: "h-3 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-3" }),
218
+ e("div", { class: "w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700" })
219
+ ]),
220
+ e("div", { class: "h-3 bg-gray-300 rounded-full dark:bg-gray-700 w-12" })
221
+ ]),
222
+ e("span", { class: "sr-only" }, "Loading...")
223
+ ], -1)
224
+ ]), 8, F)
225
+ ])) : h("", !0),
226
+ i.isLoading ? h("", !0) : (l(!0), d(y, { key: 1 }, m(a.paginatedData, (s, f) => (l(), d("tr", {
227
+ key: f,
228
+ class: "bg-white dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 dark:hover:text-gray-200 text-gray-500"
229
+ }, [
230
+ (l(!0), d(y, null, m(o.columns, (n, x) => (l(), d("td", {
231
+ key: x,
232
+ "data-label": n.field_label,
233
+ class: D(["text-pretty before:content-[attr(data-label)] before:font-bold lg:before:content-none flex flex-col justify-between gap-2 lg:table-cell py-4 px-5 lg:py-3 lg:px-4 border-[1px] dark:border-gray-700", {
234
+ "rounded-t-lg lg:rounded-t-none": x === 0,
235
+ "rounded-b-lg lg:rounded-b-none": x === o.columns.length - 1
236
+ }])
237
+ }, [
238
+ e("div", H, [
239
+ n.tdComp ? (l(), C(j(a.forDynCompIs(n.tdComp)), {
240
+ key: 0,
241
+ row: s,
242
+ field: n.field_name,
243
+ xprops: o.xprops,
244
+ tdProps: n.tdProps,
245
+ onDeleteAction: t[2] || (t[2] = (v) => a.GetItemLists()),
246
+ onEditAction: (v) => a.editAction(s),
247
+ onGeneralAction: (v) => a.generalAction(s)
248
+ }, null, 40, ["row", "field", "xprops", "tdProps", "onEditAction", "onGeneralAction"])) : (l(), d(y, { key: 1 }, [
249
+ c(g(s[n.field_name]), 1)
250
+ ], 64))
251
+ ])
252
+ ], 10, N))), 128))
253
+ ]))), 128))
254
+ ])
255
+ ])
256
+ ]),
257
+ a.paginatedData.length > 0 ? (l(), d("div", J, [
258
+ e("div", Q, [
259
+ e("a", {
260
+ href: "#",
261
+ onClick: t[3] || (t[3] = b((...s) => a.previousPage && a.previousPage(...s), ["prevent"])),
262
+ disabled: i.currentPage === 1,
263
+ class: "relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"
264
+ }, "Previous", 8, R),
265
+ e("a", {
266
+ href: "#",
267
+ onClick: t[4] || (t[4] = b((...s) => a.nextPage && a.nextPage(...s), ["prevent"])),
268
+ disabled: i.currentPage === a.totalPages,
269
+ class: "relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50"
270
+ }, "Next", 8, W)
271
+ ]),
272
+ e("div", X, [
273
+ e("div", null, [
274
+ e("p", Y, [
275
+ t[12] || (t[12] = c(" Showing ")),
276
+ e("span", Z, g(a.firstItemIndex), 1),
277
+ t[13] || (t[13] = c(" to ")),
278
+ e("span", $, g(a.lastItemIndex), 1),
279
+ t[14] || (t[14] = c(" of ")),
280
+ e("span", ee, g(a.filteredData.length), 1),
281
+ t[15] || (t[15] = c(" entries "))
282
+ ])
283
+ ]),
284
+ e("div", null, [
285
+ e("nav", te, [
286
+ e("ul", re, [
287
+ e("li", null, [
288
+ e("a", {
289
+ href: "#",
290
+ onClick: t[5] || (t[5] = b((...s) => a.previousPage && a.previousPage(...s), ["prevent"])),
291
+ disabled: i.currentPage === 1,
292
+ 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"
293
+ }, t[16] || (t[16] = [
294
+ e("span", { class: "sr-only" }, "Previous", -1),
295
+ e("svg", {
296
+ class: "w-2.5 h-2.5 rtl:rotate-180",
297
+ "aria-hidden": "true",
298
+ xmlns: "http://www.w3.org/2000/svg",
299
+ fill: "none",
300
+ viewBox: "0 0 6 10"
301
+ }, [
302
+ e("path", {
303
+ stroke: "currentColor",
304
+ "stroke-linecap": "round",
305
+ "stroke-linejoin": "round",
306
+ "stroke-width": "2",
307
+ d: "M5 1 1 5l4 4"
308
+ })
309
+ ], -1)
310
+ ]), 8, se)
311
+ ]),
312
+ (l(!0), d(y, null, m(a.displayedPageNumbers, (s) => (l(), d(y, { key: s }, [
313
+ e("li", null, [
314
+ i.currentPage !== s ? (l(), d("a", {
315
+ key: 0,
316
+ href: "#",
317
+ onClick: b((f) => a.goToPage(s), ["prevent"]),
318
+ class: "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"
319
+ }, g(s), 9, ae)) : h("", !0)
320
+ ]),
321
+ e("li", null, [
322
+ i.currentPage === s ? (l(), d("a", {
323
+ key: 0,
324
+ href: "#",
325
+ onClick: b((f) => a.goToPage(s), ["prevent"]),
326
+ "aria-current": "page",
327
+ class: "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"
328
+ }, g(s), 9, le)) : h("", !0)
329
+ ])
330
+ ], 64))), 128)),
331
+ e("li", null, [
332
+ e("a", {
333
+ href: "#",
334
+ onClick: t[6] || (t[6] = b((...s) => a.nextPage && a.nextPage(...s), ["prevent"])),
335
+ disabled: i.currentPage === a.totalPages,
336
+ 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"
337
+ }, t[17] || (t[17] = [
338
+ e("span", { class: "sr-only" }, "Next", -1),
339
+ e("svg", {
340
+ class: "w-2.5 h-2.5 rtl:rotate-180",
341
+ "aria-hidden": "true",
342
+ xmlns: "http://www.w3.org/2000/svg",
343
+ fill: "none",
344
+ viewBox: "0 0 6 10"
345
+ }, [
346
+ e("path", {
347
+ stroke: "currentColor",
348
+ "stroke-linecap": "round",
349
+ "stroke-linejoin": "round",
350
+ "stroke-width": "2",
351
+ d: "m1 9 4-4-4-4"
352
+ })
353
+ ], -1)
354
+ ]), 8, de)
355
+ ])
356
+ ])
357
+ ])
358
+ ])
359
+ ])
360
+ ])) : h("", !0)
361
+ ]);
362
+ }
363
+ const ge = /* @__PURE__ */ A(L, [["render", ie]]);
364
+ export {
365
+ ge as default
366
+ };
@@ -0,0 +1,260 @@
1
+ import D from "./TailwindPagination-Dz89aS_l.js";
2
+ import { resolveComponent as y, createElementBlock as o, openBlock as a, createElementVNode as e, createVNode as m, withDirectives as P, vModelText as C, Fragment as u, renderList as p, createTextVNode as k, createCommentVNode as f, toDisplayString as h, createBlock as I, resolveDynamicComponent as O } from "vue";
3
+ import { _ as S } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const j = {
5
+ components: { TailwindPagination: D },
6
+ props: {
7
+ data: Array,
8
+ columns: Array,
9
+ get_item_url: String,
10
+ xprops: Object,
11
+ refreshData: Boolean,
12
+ groupField: String
13
+ },
14
+ data() {
15
+ return {
16
+ isLoading: !1,
17
+ isMounted: !1,
18
+ limit: 5,
19
+ showDisabled: !1,
20
+ size: "default",
21
+ align: "left",
22
+ search: "",
23
+ isDropdownOpen: !1,
24
+ itemLists: [],
25
+ tableData: [],
26
+ sortField: this.columns[0].field_name,
27
+ sortOrder: "desc",
28
+ pageOptions: [5, 10, 20, 50],
29
+ perPage: 5,
30
+ page: 1
31
+ };
32
+ },
33
+ emits: ["editAction"],
34
+ computed: {
35
+ filteredData() {
36
+ const r = this.search.toLowerCase();
37
+ return this.sortData(this.data).filter((l) => Object.values(l).some(
38
+ (n) => n.toString().toLowerCase().includes(r)
39
+ ));
40
+ },
41
+ groupedItems() {
42
+ return this.groupBy(this.groupField);
43
+ }
44
+ },
45
+ methods: {
46
+ groupBy(r) {
47
+ return this.itemLists.data ? this.itemLists.data.reduce((t, l) => {
48
+ const n = l[r];
49
+ t[n] || (t[n] = []);
50
+ const s = { ...l };
51
+ return delete s[r], t[n].push(s), t;
52
+ }, {}) : [];
53
+ },
54
+ editAction(r) {
55
+ this.$emit("editAction", r);
56
+ },
57
+ forDynCompIs(r) {
58
+ return typeof r == "object" ? r : null;
59
+ },
60
+ GetItemLists(r = 1) {
61
+ this.isLoading = !0, this.page = r;
62
+ const t = {
63
+ sort: this.sortField,
64
+ order: this.sortOrder,
65
+ s: this.search,
66
+ limit: this.perPage,
67
+ page: this.page
68
+ };
69
+ axios.get(this.xprops.route_get_data, { params: t }).then((l) => {
70
+ this.itemLists = l.data, this.isLoading = !1;
71
+ }).catch((l) => {
72
+ console.error(l), this.isLoading = !1;
73
+ });
74
+ },
75
+ updateSortColumn(r, t) {
76
+ t && (r === this.sortField ? this.sortOrder = this.sortOrder === "asc" ? "desc" : "asc" : (this.sortField = r, this.sortOrder = "asc"), this.GetItemLists(this.page));
77
+ },
78
+ handleSearch() {
79
+ this.sortField = this.columns[0].field_name, this.sortOrder = "asc", this.page = 1, this.GetItemLists(this.page);
80
+ }
81
+ },
82
+ mounted() {
83
+ this.GetItemLists(), this.isMounted = !0;
84
+ },
85
+ watch: {
86
+ searchFilter() {
87
+ this.filteredOptions.length === 0 ? this.selected = {} : this.selected = this.filteredOptions[0];
88
+ },
89
+ perPage(r) {
90
+ this.page = 1, this.perPage = r, this.GetItemLists(this.page);
91
+ },
92
+ refreshData(r, t) {
93
+ this.isMounted && r !== t && this.GetItemLists();
94
+ }
95
+ }
96
+ }, F = { class: "p-2" }, G = { class: "flex flex-col flex-wrap pb-4 space-y-4 xl:flex-row xl:items-center xl:justify-between sm:space-y-0" }, A = { class: "flex items-center gap-2" }, V = { style: { "margin-top": "9px" } }, B = { class: "relative" }, T = { class: "overflow-auto rounded-lg dark:text-gray-400 dark:bg-gray-800" }, z = { class: "w-full h-full max-w-full overflow-hidden bg-white border-separate xl:overflow-auto lg:border-collapse border-spacing-y-3 lg:border-spacing-y-0 dark:border-strokeDark dark:bg-boxDark" }, E = { class: "hidden text-sm font-normal text-center text-gray-500 lg:table-header-group dark:border-strokeDark bg-gray-50 dark:bg-gray-700 dark:text-gray-400" }, M = ["onClick"], N = {
97
+ key: 0,
98
+ class: "ml-2"
99
+ }, U = {
100
+ key: 0,
101
+ class: "fa fa-arrow-up"
102
+ }, q = {
103
+ key: 1,
104
+ class: "fa fa-arrow-down"
105
+ }, H = { key: 0 }, J = ["colspan"], K = { class: "text-gray-500 bg-white dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 dark:hover:text-gray-200" }, Q = ["colspan"], R = ["data-label"], W = { class: "overflow-auto max-h-40" }, X = { 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" };
106
+ function Y(r, t, l, n, s, d) {
107
+ const w = y("dropdown"), v = y("TailwindPagination");
108
+ return a(), o("div", F, [
109
+ e("div", G, [
110
+ e("div", A, [
111
+ t[4] || (t[4] = e("span", { class: "font-medium" }, " Show ", -1)),
112
+ e("div", V, [
113
+ m(w, {
114
+ options_top_size: 0,
115
+ has_cancel: !1,
116
+ options: s.pageOptions,
117
+ modelValue: s.perPage,
118
+ "onUpdate:modelValue": t[0] || (t[0] = (i) => s.perPage = i),
119
+ is_required: !1,
120
+ field_name: "perPage",
121
+ label_name: "",
122
+ default_value: 5,
123
+ show: !1,
124
+ placeholder: "Please select an option"
125
+ }, null, 8, ["options", "modelValue"])
126
+ ]),
127
+ t[5] || (t[5] = e("span", { class: "font-medium" }, " Entries ", -1))
128
+ ]),
129
+ t[7] || (t[7] = e("label", {
130
+ for: "table-search",
131
+ class: "sr-only"
132
+ }, "Search", -1)),
133
+ e("div", B, [
134
+ t[6] || (t[6] = e("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)),
135
+ P(e("input", {
136
+ type: "text",
137
+ "onUpdate:modelValue": t[1] || (t[1] = (i) => s.search = i),
138
+ onInput: t[2] || (t[2] = (i) => d.handleSearch()),
139
+ class: "block w-full p-2 text-sm text-gray-900 border border-gray-300 rounded-lg ps-10 bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",
140
+ placeholder: "Search ..."
141
+ }, null, 544), [
142
+ [C, s.search]
143
+ ])
144
+ ])
145
+ ]),
146
+ e("div", T, [
147
+ e("table", z, [
148
+ e("thead", E, [
149
+ e("tr", null, [
150
+ (a(!0), o(u, null, p(l.columns, (i, b) => (a(), o("th", {
151
+ key: b,
152
+ onClick: (c) => d.updateSortColumn(i.field_name, i.sortable),
153
+ class: "w-full px-4 py-2 lg:w-2/12"
154
+ }, [
155
+ k(h(i.field_label) + " ", 1),
156
+ s.sortField === i.field_name ? (a(), o("span", N, [
157
+ s.sortOrder === "asc" ? (a(), o("i", U)) : (a(), o("i", q))
158
+ ])) : f("", !0)
159
+ ], 8, M))), 128))
160
+ ])
161
+ ]),
162
+ e("tbody", null, [
163
+ s.isLoading ? (a(), o("tr", H, [
164
+ e("td", {
165
+ colspan: l.columns.length
166
+ }, t[8] || (t[8] = [
167
+ e("div", {
168
+ role: "status",
169
+ class: "p-4 space-y-4 border border-gray-200 divide-y divide-gray-200 rounded-sm shadow-sm animate-pulse dark:divide-gray-700 md:p-6 dark:border-gray-700"
170
+ }, [
171
+ e("div", { class: "flex items-center justify-between" }, [
172
+ e("div", null, [
173
+ e("div", { class: "w-24 h-3 mb-3 bg-gray-300 rounded-full dark:bg-gray-600" }),
174
+ e("div", { class: "w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700" })
175
+ ]),
176
+ e("div", { class: "w-12 h-3 bg-gray-300 rounded-full dark:bg-gray-700" })
177
+ ]),
178
+ e("div", { class: "flex items-center justify-between pt-4" }, [
179
+ e("div", null, [
180
+ e("div", { class: "w-24 h-3 mb-3 bg-gray-300 rounded-full dark:bg-gray-600" }),
181
+ e("div", { class: "w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700" })
182
+ ]),
183
+ e("div", { class: "w-12 h-3 bg-gray-300 rounded-full dark:bg-gray-700" })
184
+ ]),
185
+ e("div", { class: "flex items-center justify-between pt-4" }, [
186
+ e("div", null, [
187
+ e("div", { class: "w-24 h-3 mb-3 bg-gray-300 rounded-full dark:bg-gray-600" }),
188
+ e("div", { class: "w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700" })
189
+ ]),
190
+ e("div", { class: "w-12 h-3 bg-gray-300 rounded-full dark:bg-gray-700" })
191
+ ]),
192
+ e("div", { class: "flex items-center justify-between pt-4" }, [
193
+ e("div", null, [
194
+ e("div", { class: "w-24 h-3 mb-3 bg-gray-300 rounded-full dark:bg-gray-600" }),
195
+ e("div", { class: "w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700" })
196
+ ]),
197
+ e("div", { class: "w-12 h-3 bg-gray-300 rounded-full dark:bg-gray-700" })
198
+ ]),
199
+ e("div", { class: "flex items-center justify-between pt-4" }, [
200
+ e("div", null, [
201
+ e("div", { class: "w-24 h-3 mb-3 bg-gray-300 rounded-full dark:bg-gray-600" }),
202
+ e("div", { class: "w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700" })
203
+ ]),
204
+ e("div", { class: "w-12 h-3 bg-gray-300 rounded-full dark:bg-gray-700" })
205
+ ]),
206
+ e("span", { class: "sr-only" }, "Loading...")
207
+ ], -1)
208
+ ]), 8, J)
209
+ ])) : f("", !0),
210
+ s.isLoading ? f("", !0) : (a(!0), o(u, { key: 1 }, p(d.groupedItems, (i, b) => (a(), o(u, null, [
211
+ e("tr", K, [
212
+ e("td", {
213
+ colspan: l.columns.length,
214
+ class: "text-pretty before:content-[attr(data-label)] before:font-bold lg:before:content-none flex md:flex-row flex-col justify-between gap-2 lg:table-cell py-4 px-5 lg:py-3 lg:px-4 border dark:border-gray-700"
215
+ }, h(b), 9, Q)
216
+ ]),
217
+ (a(!0), o(u, null, p(i, (c, x) => (a(), o("tr", {
218
+ key: x,
219
+ class: "text-gray-500 bg-white dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 dark:hover:text-gray-200"
220
+ }, [
221
+ (a(!0), o(u, null, p(l.columns, (g, _) => (a(), o("td", {
222
+ key: _,
223
+ "data-label": g.field_label,
224
+ class: "text-pretty before:content-[attr(data-label)] before:font-bold lg:before:content-none flex md:flex-row flex-col justify-between gap-2 lg:table-cell py-4 px-5 lg:py-3 lg:px-4 border-[1px] dark:border-gray-700"
225
+ }, [
226
+ e("div", W, [
227
+ g.tdComp ? (a(), I(O(d.forDynCompIs(g.tdComp)), {
228
+ key: 0,
229
+ row: c,
230
+ field: g.field_name,
231
+ xprops: l.xprops,
232
+ tdProps: g.tdProps,
233
+ onDeleteAction: t[3] || (t[3] = (L) => d.GetItemLists()),
234
+ onEditAction: (L) => d.editAction(c)
235
+ }, null, 40, ["row", "field", "xprops", "tdProps", "onEditAction"])) : (a(), o(u, { key: 1 }, [
236
+ k(h(c[g.field_name]), 1)
237
+ ], 64))
238
+ ])
239
+ ], 8, R))), 128))
240
+ ]))), 128))
241
+ ], 64))), 256))
242
+ ])
243
+ ])
244
+ ]),
245
+ e("div", X, [
246
+ m(v, {
247
+ class: "mt-3 mb-0",
248
+ data: s.itemLists,
249
+ limit: s.limit,
250
+ size: s.size,
251
+ align: s.align,
252
+ onPaginationChangePage: d.GetItemLists
253
+ }, null, 8, ["data", "limit", "size", "align", "onPaginationChangePage"])
254
+ ])
255
+ ]);
256
+ }
257
+ const te = /* @__PURE__ */ S(j, [["render", Y]]);
258
+ export {
259
+ te as default
260
+ };