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,278 @@
1
+ import { resolveComponent as p, createElementBlock as o, openBlock as l, createElementVNode as t, createCommentVNode as f, createVNode as k, withDirectives as v, vModelText as w, Fragment as c, renderList as x, withModifiers as d, createTextVNode as y, toDisplayString as h } from "vue";
2
+ import { _ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ const D = {
4
+ components: {},
5
+ props: {
6
+ data: Array,
7
+ columns: Array
8
+ },
9
+ data() {
10
+ return {
11
+ showNoOfEntries: [1, 2, 3, 10, 20, 30, 40],
12
+ search: "",
13
+ sortKey: "",
14
+ sortOrder: 1,
15
+ currentPage: 1,
16
+ itemsPerPage: 10,
17
+ jumpToPage: "",
18
+ maxDisplayedPages: 10
19
+ // Set the maximum number of displayed pagination buttons
20
+ };
21
+ },
22
+ computed: {
23
+ filteredData() {
24
+ const r = this.search.toLowerCase();
25
+ return this.sortData(this.data).filter((i) => Object.values(i).some(
26
+ (g) => g != null && g.toString().toLowerCase().includes(r)
27
+ ));
28
+ },
29
+ totalPages() {
30
+ return Math.ceil(this.filteredData.length / this.itemsPerPage);
31
+ },
32
+ paginatedData() {
33
+ const r = (this.currentPage - 1) * this.itemsPerPage, e = r + this.itemsPerPage;
34
+ return this.filteredData.slice(r, e);
35
+ },
36
+ displayedPageNumbers() {
37
+ let r = Math.max(
38
+ this.currentPage - Math.floor(this.maxDisplayedPages / 2),
39
+ 1
40
+ ), e = r + this.maxDisplayedPages - 1;
41
+ return e > this.totalPages && (e = this.totalPages, r = Math.max(e - this.maxDisplayedPages + 1, 1)), Array.from(
42
+ { length: e - r + 1 },
43
+ (i, g) => r + g
44
+ );
45
+ },
46
+ firstItemIndex() {
47
+ return this.itemsPerPage * (this.currentPage - 1) + 1;
48
+ },
49
+ lastItemIndex() {
50
+ const r = this.itemsPerPage * this.currentPage;
51
+ return r > this.filteredData.length ? this.filteredData.length : r;
52
+ }
53
+ },
54
+ methods: {
55
+ handleItemsPerPageChange(r) {
56
+ this.itemsPerPage = r;
57
+ },
58
+ goToPage(r) {
59
+ r >= 1 && r <= this.totalPages && (this.currentPage = r);
60
+ },
61
+ sort(r) {
62
+ r === this.sortKey ? this.sortOrder *= -1 : (this.sortKey = r, this.sortOrder = 1);
63
+ },
64
+ sortData(r) {
65
+ return this.sortKey ? r.slice().sort((e, i) => (e[this.sortKey] < i[this.sortKey] ? -1 : 1) * this.sortOrder) : r;
66
+ },
67
+ previousPage() {
68
+ this.currentPage > 1 && this.currentPage--;
69
+ },
70
+ nextPage() {
71
+ this.currentPage < this.totalPages && this.currentPage++;
72
+ },
73
+ firstPage() {
74
+ this.currentPage = 1;
75
+ },
76
+ lastPage() {
77
+ this.currentPage = this.totalPages;
78
+ },
79
+ goToPage(r) {
80
+ r >= 1 && r <= this.totalPages && (this.currentPage = r);
81
+ }
82
+ }
83
+ }, C = { class: "p-2" }, j = { class: "flex flex-wrap pb-4 space-y-4 md:items-center md:justify-between flex-column sm:flex-row sm:space-y-0" }, I = { class: "flex items-center gap-2" }, T = { style: { "margin-top": "9px" } }, M = { class: "relative" }, O = { class: "overflow-auto rounded-lg dark:text-gray-400 dark:bg-gray-800" }, V = { 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" }, K = { class: "hidden text-sm font-normal text-center text-gray-700 lg:table-header-group dark:border-strokeDark bg-gray-50 dark:bg-gray-700 dark:text-gray-400" }, E = ["onClick"], L = {
84
+ key: 0,
85
+ class: "ml-2"
86
+ }, S = {
87
+ key: 0,
88
+ class: "fa fa-arrow-up"
89
+ }, B = {
90
+ key: 1,
91
+ class: "fa fa-arrow-down"
92
+ }, A = ["data-label"], z = ["innerHTML"], H = {
93
+ key: 0,
94
+ 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"
95
+ }, U = { class: "flex justify-between flex-1 sm:hidden" }, q = ["disabled"], F = ["disabled"], G = { class: "hidden sm:flex sm:flex-1 sm:items-center sm:justify-between" }, N = { class: "text-sm text-gray-700 dark:text-gray-400" }, J = { class: "font-medium" }, Q = { class: "font-medium" }, R = { class: "font-medium" }, W = { "aria-label": "Page navigation" }, X = { class: "flex items-center h-8 -space-x-px text-sm" }, Y = ["disabled"], Z = ["onClick"], $ = ["onClick"], ee = ["disabled"];
96
+ function te(r, e, i, g, n, a) {
97
+ const P = p("dropdown");
98
+ return l(), o("div", C, [
99
+ t("div", j, [
100
+ t("div", I, [
101
+ e[6] || (e[6] = t("span", { class: "font-medium" }, " Show ", -1)),
102
+ t("div", T, [
103
+ k(P, {
104
+ has_cancel: !1,
105
+ options: n.showNoOfEntries,
106
+ modelValue: n.itemsPerPage,
107
+ "onUpdate:modelValue": e[0] || (e[0] = (s) => n.itemsPerPage = s),
108
+ is_required: !1,
109
+ field_name: "NoOfEntries",
110
+ label_name: "",
111
+ default_value: 10,
112
+ show: !1,
113
+ placeholder: "Please select an option"
114
+ }, null, 8, ["options", "modelValue"])
115
+ ]),
116
+ e[7] || (e[7] = t("span", { class: "font-medium" }, " Entries ", -1))
117
+ ]),
118
+ e[9] || (e[9] = t("label", {
119
+ for: "table-search",
120
+ class: "sr-only"
121
+ }, "Search", -1)),
122
+ t("div", M, [
123
+ e[8] || (e[8] = t("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)),
124
+ v(t("input", {
125
+ type: "text",
126
+ "onUpdate:modelValue": e[1] || (e[1] = (s) => n.search = s),
127
+ 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",
128
+ placeholder: "Search ..."
129
+ }, null, 512), [
130
+ [w, n.search]
131
+ ])
132
+ ])
133
+ ]),
134
+ t("div", O, [
135
+ t("table", V, [
136
+ t("thead", K, [
137
+ t("tr", null, [
138
+ (l(!0), o(c, null, x(i.columns, (s, u) => (l(), o("th", {
139
+ key: u,
140
+ onClick: d((b) => a.sort(s), ["prevent"]),
141
+ class: "w-full px-4 py-2 lg:w-2/12 capitalize"
142
+ }, [
143
+ y(h(s) + " ", 1),
144
+ n.sortKey === s ? (l(), o("span", L, [
145
+ n.sortOrder === 1 ? (l(), o("i", S)) : (l(), o("i", B))
146
+ ])) : f("", !0)
147
+ ], 8, E))), 128))
148
+ ])
149
+ ]),
150
+ t("tbody", null, [
151
+ (l(!0), o(c, null, x(a.paginatedData, (s, u) => (l(), o("tr", {
152
+ key: u,
153
+ 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"
154
+ }, [
155
+ (l(!0), o(c, null, x(i.columns, (b, m) => (l(), o("td", {
156
+ key: m,
157
+ "data-label": b,
158
+ 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-2.5 lg:px-4 border-[1px] dark:border-gray-700"
159
+ }, [
160
+ t("p", {
161
+ class: "text-pretty",
162
+ innerHTML: s[m]
163
+ }, null, 8, z)
164
+ ], 8, A))), 128))
165
+ ]))), 128))
166
+ ])
167
+ ])
168
+ ]),
169
+ a.paginatedData.length > 0 ? (l(), o("div", H, [
170
+ t("div", U, [
171
+ t("a", {
172
+ href: "#",
173
+ onClick: e[2] || (e[2] = d((...s) => a.previousPage && a.previousPage(...s), ["prevent"])),
174
+ disabled: n.currentPage === 1,
175
+ 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"
176
+ }, "Previous", 8, q),
177
+ t("a", {
178
+ href: "#",
179
+ onClick: e[3] || (e[3] = d((...s) => a.nextPage && a.nextPage(...s), ["prevent"])),
180
+ disabled: n.currentPage === a.totalPages,
181
+ 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"
182
+ }, "Next", 8, F)
183
+ ]),
184
+ t("div", G, [
185
+ t("div", null, [
186
+ t("p", N, [
187
+ e[10] || (e[10] = y(" Showing ")),
188
+ t("span", J, h(a.firstItemIndex), 1),
189
+ e[11] || (e[11] = y(" to ")),
190
+ t("span", Q, h(a.lastItemIndex), 1),
191
+ e[12] || (e[12] = y(" of ")),
192
+ t("span", R, h(a.filteredData.length), 1),
193
+ e[13] || (e[13] = y(" entries "))
194
+ ])
195
+ ]),
196
+ t("div", null, [
197
+ t("nav", W, [
198
+ t("ul", X, [
199
+ t("li", null, [
200
+ t("a", {
201
+ href: "#",
202
+ onClick: e[4] || (e[4] = d((...s) => a.previousPage && a.previousPage(...s), ["prevent"])),
203
+ disabled: n.currentPage === 1,
204
+ 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"
205
+ }, e[14] || (e[14] = [
206
+ t("span", { class: "sr-only" }, "Previous", -1),
207
+ t("svg", {
208
+ class: "w-2.5 h-2.5 rtl:rotate-180",
209
+ "aria-hidden": "true",
210
+ xmlns: "http://www.w3.org/2000/svg",
211
+ fill: "none",
212
+ viewBox: "0 0 6 10"
213
+ }, [
214
+ t("path", {
215
+ stroke: "currentColor",
216
+ "stroke-linecap": "round",
217
+ "stroke-linejoin": "round",
218
+ "stroke-width": "2",
219
+ d: "M5 1 1 5l4 4"
220
+ })
221
+ ], -1)
222
+ ]), 8, Y)
223
+ ]),
224
+ (l(!0), o(c, null, x(a.displayedPageNumbers, (s) => (l(), o(c, { key: s }, [
225
+ t("li", null, [
226
+ n.currentPage !== s ? (l(), o("a", {
227
+ key: 0,
228
+ href: "#",
229
+ onClick: d((u) => a.goToPage(s), ["prevent"]),
230
+ 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"
231
+ }, h(s), 9, Z)) : f("", !0)
232
+ ]),
233
+ t("li", null, [
234
+ n.currentPage === s ? (l(), o("a", {
235
+ key: 0,
236
+ href: "#",
237
+ onClick: d((u) => a.goToPage(s), ["prevent"]),
238
+ "aria-current": "page",
239
+ 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"
240
+ }, h(s), 9, $)) : f("", !0)
241
+ ])
242
+ ], 64))), 128)),
243
+ t("li", null, [
244
+ t("a", {
245
+ href: "#",
246
+ onClick: e[5] || (e[5] = d((...s) => a.nextPage && a.nextPage(...s), ["prevent"])),
247
+ disabled: n.currentPage === a.totalPages,
248
+ 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"
249
+ }, e[15] || (e[15] = [
250
+ t("span", { class: "sr-only" }, "Next", -1),
251
+ t("svg", {
252
+ class: "w-2.5 h-2.5 rtl:rotate-180",
253
+ "aria-hidden": "true",
254
+ xmlns: "http://www.w3.org/2000/svg",
255
+ fill: "none",
256
+ viewBox: "0 0 6 10"
257
+ }, [
258
+ t("path", {
259
+ stroke: "currentColor",
260
+ "stroke-linecap": "round",
261
+ "stroke-linejoin": "round",
262
+ "stroke-width": "2",
263
+ d: "m1 9 4-4-4-4"
264
+ })
265
+ ], -1)
266
+ ]), 8, ee)
267
+ ])
268
+ ])
269
+ ])
270
+ ])
271
+ ])
272
+ ])) : f("", !0)
273
+ ]);
274
+ }
275
+ const ae = /* @__PURE__ */ _(D, [["render", te]]);
276
+ export {
277
+ ae as default
278
+ };