golden-logic-ui 1.3.11 → 1.3.13
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/ConfirmationModal.vue.js +118 -41
- package/dist/components/GeneralComponents/DataTable/GLDataTable.vue.js +124 -114
- package/dist/components/GeneralComponents/DataTable/GLDataTableServerSide.vue.js +339 -243
- package/dist/components/GeneralComponents/DataTable/GlDataTableComponent.vue.js +117 -91
- package/dist/components/GeneralComponents/DeleteConfirmationModal.vue.js +107 -42
- package/dist/components/GeneralComponents/GlLogViewer.vue.js +237 -0
- package/dist/components/GeneralComponents/GlModal.vue.js +58 -35
- package/dist/components/GeneralComponents/GlStatusBadge.vue.js +69 -0
- package/dist/components/GeneralComponents/GlTabsWrapper.vue.js +78 -52
- package/dist/components/GeneralComponents/GlTextCopy.vue.js +27 -27
- package/dist/components/GeneralComponents/glStatusMap.js +255 -0
- package/dist/components/GeneralComponents/useGlFocusTrap.js +67 -0
- package/dist/golden-logic-ui.css +1 -1
- package/dist/main.js +114 -103
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import M from "../../../node_modules/vue3-print-nb/dist/vue3-print-nb.es.js";
|
|
2
|
-
import { resolveComponent as
|
|
2
|
+
import { resolveComponent as D, resolveDirective as E, createElementBlock as g, openBlock as d, withDirectives as j, createElementVNode as e, createCommentVNode as v, createVNode as k, vModelText as S, withCtx as L, createTextVNode as f, Fragment as b, renderList as w, toDisplayString as y, normalizeClass as _, createBlock as I, resolveDynamicComponent as O, withModifiers as P } from "vue";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import
|
|
5
|
-
const
|
|
4
|
+
import B from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const H = {
|
|
6
6
|
components: {},
|
|
7
7
|
props: {
|
|
8
8
|
data: Array,
|
|
@@ -14,6 +14,13 @@ const V = {
|
|
|
14
14
|
required: !1,
|
|
15
15
|
default: () => {
|
|
16
16
|
}
|
|
17
|
+
},
|
|
18
|
+
// Render plain (non-tdComp) cells as text instead of HTML. Off by default
|
|
19
|
+
// for backward compatibility. A column can opt out either way with
|
|
20
|
+
// `html: false` (always escape) or `html: true` (always render HTML).
|
|
21
|
+
escape_html: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !1
|
|
17
24
|
}
|
|
18
25
|
},
|
|
19
26
|
data() {
|
|
@@ -47,16 +54,16 @@ const V = {
|
|
|
47
54
|
// Set the maximum number of displayed pagination buttons
|
|
48
55
|
};
|
|
49
56
|
},
|
|
50
|
-
emits: ["editAction", "generalAction", "deleteAction"],
|
|
57
|
+
emits: ["editAction", "generalAction", "deleteAction", "cell-action"],
|
|
51
58
|
computed: {
|
|
52
59
|
itemLists() {
|
|
53
60
|
return this.data;
|
|
54
61
|
},
|
|
55
62
|
filteredData() {
|
|
56
63
|
const r = this.search.toLowerCase(), t = this.sortData(this.itemLists);
|
|
57
|
-
return r ? t.filter((
|
|
58
|
-
const
|
|
59
|
-
return
|
|
64
|
+
return r ? t.filter((n) => this.columns.some((c) => {
|
|
65
|
+
const l = n[c.field_name];
|
|
66
|
+
return l != null && String(l).toLowerCase().includes(r);
|
|
60
67
|
})) : t;
|
|
61
68
|
},
|
|
62
69
|
totalPages() {
|
|
@@ -73,7 +80,7 @@ const V = {
|
|
|
73
80
|
), t = r + this.maxDisplayedPages - 1;
|
|
74
81
|
return t > this.totalPages && (t = this.totalPages, r = Math.max(t - this.maxDisplayedPages + 1, 1)), Array.from(
|
|
75
82
|
{ length: t - r + 1 },
|
|
76
|
-
(
|
|
83
|
+
(n, c) => r + c
|
|
77
84
|
);
|
|
78
85
|
},
|
|
79
86
|
firstItemIndex() {
|
|
@@ -86,15 +93,15 @@ const V = {
|
|
|
86
93
|
},
|
|
87
94
|
methods: {
|
|
88
95
|
async exportToExcel() {
|
|
89
|
-
const r = await import("xlsx"), t = r.default || r,
|
|
90
|
-
t.utils.book_append_sheet(
|
|
96
|
+
const r = await import("xlsx"), t = r.default || r, n = document.querySelector("#table" + this.Random_string), c = Array.from(n.querySelectorAll("thead th")).map((o) => o.innerText), a = ["", ...["action"]], p = c.map((o, h) => a.includes(o) ? h : -1).filter((o) => o !== -1), x = Array.from(n.querySelectorAll("tbody tr")).map((o) => Array.from(o.querySelectorAll("td")).map((C) => C.innerText).filter((C, T) => !p.includes(T))), s = [c.filter((o, h) => !p.includes(h)), ...x], u = t.utils.aoa_to_sheet(s), i = t.utils.book_new();
|
|
97
|
+
t.utils.book_append_sheet(i, u, "Sheet1"), t.writeFile(i, "exported-file.xlsx");
|
|
91
98
|
},
|
|
92
99
|
generateRandomString(r) {
|
|
93
100
|
let t = "";
|
|
94
|
-
const
|
|
95
|
-
for (let
|
|
96
|
-
t +=
|
|
97
|
-
Math.floor(Math.random() *
|
|
101
|
+
const n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", c = n.length;
|
|
102
|
+
for (let l = 0; l < r; l++)
|
|
103
|
+
t += n.charAt(
|
|
104
|
+
Math.floor(Math.random() * c)
|
|
98
105
|
);
|
|
99
106
|
return t;
|
|
100
107
|
},
|
|
@@ -112,6 +119,14 @@ const V = {
|
|
|
112
119
|
generalAction(r) {
|
|
113
120
|
this.$emit("generalAction", r);
|
|
114
121
|
},
|
|
122
|
+
// Every cell event, with whatever the cell sent along. Cells can also emit
|
|
123
|
+
// their own named actions: emit('cellAction', 'restart', payload).
|
|
124
|
+
cellAction(r, t, n, c) {
|
|
125
|
+
this.$emit("cell-action", { action: r, row: t, payload: n, field: c?.field_name });
|
|
126
|
+
},
|
|
127
|
+
isEscapedColumn(r) {
|
|
128
|
+
return r?.html === !1 ? !0 : r?.html === !0 ? !1 : this.escape_html;
|
|
129
|
+
},
|
|
115
130
|
forDynCompIs(r) {
|
|
116
131
|
return typeof r == "object" ? r : null;
|
|
117
132
|
},
|
|
@@ -125,7 +140,7 @@ const V = {
|
|
|
125
140
|
r === this.sortKey ? this.sortOrder *= -1 : (this.sortKey = r, this.sortOrder = 1);
|
|
126
141
|
},
|
|
127
142
|
sortData(r) {
|
|
128
|
-
return this.sortKey ? r.slice().sort((t,
|
|
143
|
+
return this.sortKey ? r.slice().sort((t, n) => (t[this.sortKey] < n[this.sortKey] ? -1 : 1) * this.sortOrder) : r;
|
|
129
144
|
},
|
|
130
145
|
previousPage() {
|
|
131
146
|
this.currentPage > 1 && this.currentPage--;
|
|
@@ -155,31 +170,34 @@ const V = {
|
|
|
155
170
|
directives: {
|
|
156
171
|
print: M
|
|
157
172
|
}
|
|
158
|
-
},
|
|
173
|
+
}, V = { class: "p-0" }, K = {
|
|
159
174
|
ref: "hiddenPrintBtn",
|
|
160
175
|
style: { display: "none" }
|
|
161
176
|
}, q = { class: "flex flex-col flex-wrap gap-4 pb-4 xl:flex-row xl:items-center xl:justify-between" }, R = { class: "flex items-center gap-2" }, N = { class: "mt-[9px]" }, G = { class: "relative" }, F = { class: "flex flex-wrap mb-3" }, Z = ["id"], z = ["id"], U = { class: "hidden text-sm font-normal text-center text-gray-600 print:table-header-group! lg:table-header-group dark:border-gray-600 bg-gray-50 dark:bg-gray-800 dark:text-gray-400 print:border-[1px]!" }, X = ["onClick"], W = { class: "inline-flex items-center justify-center gap-1" }, J = {
|
|
162
177
|
key: 0,
|
|
163
178
|
class: "print:hidden!"
|
|
164
|
-
}, Q = { class: "bg-white dark:bg-gray-900" }, Y = { key: 0 }, $ = ["colspan"], ee = ["data-label"], te =
|
|
179
|
+
}, Q = { class: "bg-white dark:bg-gray-900" }, Y = { key: 0 }, $ = ["colspan"], ee = ["data-label"], te = {
|
|
180
|
+
key: 0,
|
|
181
|
+
class: "text-pretty"
|
|
182
|
+
}, re = ["innerHTML"], se = {
|
|
165
183
|
key: 0,
|
|
166
184
|
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"
|
|
167
|
-
},
|
|
168
|
-
function ue(r, t,
|
|
169
|
-
const
|
|
170
|
-
return
|
|
171
|
-
|
|
172
|
-
[
|
|
185
|
+
}, ae = { class: "flex flex-col items-center w-full gap-2" }, le = { class: "text-sm text-gray-700 dark:text-gray-400" }, ne = { class: "font-semibold text-gray-900 dark:text-white" }, ie = { class: "font-semibold text-gray-900 dark:text-white" }, oe = { class: "font-semibold text-gray-900 dark:text-white" }, de = { "aria-label": "Page navigation" }, ge = { class: "flex items-center h-8 -space-x-px text-sm" }, ce = ["onClick", "aria-current"];
|
|
186
|
+
function ue(r, t, n, c, l, a) {
|
|
187
|
+
const p = D("dropdown"), x = D("gl-button"), A = E("print");
|
|
188
|
+
return d(), g("div", V, [
|
|
189
|
+
j(e("button", K, null, 512), [
|
|
190
|
+
[A, l.printObj]
|
|
173
191
|
]),
|
|
174
192
|
e("div", q, [
|
|
175
193
|
e("div", R, [
|
|
176
194
|
t[4] || (t[4] = e("span", { class: "font-medium" }, " Show ", -1)),
|
|
177
195
|
e("div", N, [
|
|
178
|
-
k(
|
|
196
|
+
k(p, {
|
|
179
197
|
has_cancel: !1,
|
|
180
|
-
options:
|
|
181
|
-
modelValue:
|
|
182
|
-
"onUpdate:modelValue": t[0] || (t[0] = (s) =>
|
|
198
|
+
options: l.showNoOfEntries,
|
|
199
|
+
modelValue: l.itemsPerPage,
|
|
200
|
+
"onUpdate:modelValue": t[0] || (t[0] = (s) => l.itemsPerPage = s),
|
|
183
201
|
is_required: !1,
|
|
184
202
|
field_name: "NoOfEntries",
|
|
185
203
|
label_name: "",
|
|
@@ -196,19 +214,19 @@ function ue(r, t, l, u, a, n) {
|
|
|
196
214
|
}, "Search", -1)),
|
|
197
215
|
e("div", G, [
|
|
198
216
|
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)),
|
|
199
|
-
|
|
217
|
+
j(e("input", {
|
|
200
218
|
type: "text",
|
|
201
|
-
"onUpdate:modelValue": t[1] || (t[1] = (s) =>
|
|
219
|
+
"onUpdate:modelValue": t[1] || (t[1] = (s) => l.search = s),
|
|
202
220
|
class: "gl-input-form",
|
|
203
221
|
placeholder: "Search ..."
|
|
204
222
|
}, null, 512), [
|
|
205
|
-
[
|
|
223
|
+
[S, l.search]
|
|
206
224
|
])
|
|
207
225
|
])
|
|
208
226
|
]),
|
|
209
227
|
e("div", F, [
|
|
210
|
-
k(
|
|
211
|
-
onClick:
|
|
228
|
+
k(x, {
|
|
229
|
+
onClick: a.delayedPrint,
|
|
212
230
|
tag: "button",
|
|
213
231
|
is_loading: r.isLoadingPrint,
|
|
214
232
|
button_type: "light",
|
|
@@ -218,13 +236,13 @@ function ue(r, t, l, u, a, n) {
|
|
|
218
236
|
<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
|
|
219
237
|
</svg>`
|
|
220
238
|
}, {
|
|
221
|
-
default:
|
|
222
|
-
|
|
239
|
+
default: L(() => t[8] || (t[8] = [
|
|
240
|
+
f(" Print ")
|
|
223
241
|
])),
|
|
224
242
|
_: 1
|
|
225
243
|
}, 8, ["onClick", "is_loading"]),
|
|
226
|
-
k(
|
|
227
|
-
onClick:
|
|
244
|
+
k(x, {
|
|
245
|
+
onClick: a.exportToExcel,
|
|
228
246
|
tag: "button",
|
|
229
247
|
button_type: "light",
|
|
230
248
|
has_border_reduced: !1,
|
|
@@ -234,30 +252,30 @@ function ue(r, t, l, u, a, n) {
|
|
|
234
252
|
</svg>\r
|
|
235
253
|
`
|
|
236
254
|
}, {
|
|
237
|
-
default:
|
|
238
|
-
|
|
255
|
+
default: L(() => t[9] || (t[9] = [
|
|
256
|
+
f(" Excel ")
|
|
239
257
|
])),
|
|
240
258
|
_: 1
|
|
241
259
|
}, 8, ["onClick"])
|
|
242
260
|
]),
|
|
243
261
|
e("div", {
|
|
244
|
-
id: "print_" +
|
|
262
|
+
id: "print_" + l.Random_string,
|
|
245
263
|
class: "overflow-auto rounded-lg dark:text-gray-400 dark:bg-gray-800"
|
|
246
264
|
}, [
|
|
247
265
|
e("table", {
|
|
248
|
-
id: "table" +
|
|
266
|
+
id: "table" + l.Random_string,
|
|
249
267
|
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"
|
|
250
268
|
}, [
|
|
251
269
|
e("thead", U, [
|
|
252
270
|
e("tr", null, [
|
|
253
|
-
(
|
|
254
|
-
key:
|
|
255
|
-
onClick: (
|
|
271
|
+
(d(!0), g(b, null, w(n.columns, (s, u) => (d(), g("th", {
|
|
272
|
+
key: u,
|
|
273
|
+
onClick: (i) => a.sort(s.field_name, s.sortable),
|
|
256
274
|
class: "w-full px-4 py-2 lg:w-2/12 print:w-2/12! print:border!"
|
|
257
275
|
}, [
|
|
258
276
|
e("div", W, [
|
|
259
|
-
e("span", null,
|
|
260
|
-
|
|
277
|
+
e("span", null, y(s.field_label), 1),
|
|
278
|
+
l.sortKey === s.field_name ? (d(), g("span", J, t[10] || (t[10] = [
|
|
261
279
|
e("svg", {
|
|
262
280
|
class: "w-4 h-4",
|
|
263
281
|
"aria-hidden": "true",
|
|
@@ -273,15 +291,15 @@ function ue(r, t, l, u, a, n) {
|
|
|
273
291
|
d: "M8 20V7m0 13-4-4m4 4 4-4m4-12v13m0-13 4 4m-4-4-4 4"
|
|
274
292
|
})
|
|
275
293
|
], -1)
|
|
276
|
-
]))) :
|
|
294
|
+
]))) : v("", !0)
|
|
277
295
|
])
|
|
278
296
|
], 8, X))), 128))
|
|
279
297
|
])
|
|
280
298
|
]),
|
|
281
299
|
e("tbody", Q, [
|
|
282
|
-
|
|
300
|
+
l.isLoading ? (d(), g("tr", Y, [
|
|
283
301
|
e("td", {
|
|
284
|
-
colspan:
|
|
302
|
+
colspan: n.columns.length
|
|
285
303
|
}, t[11] || (t[11] = [
|
|
286
304
|
e("div", {
|
|
287
305
|
role: "status",
|
|
@@ -325,58 +343,66 @@ function ue(r, t, l, u, a, n) {
|
|
|
325
343
|
e("span", { class: "sr-only" }, "Loading...")
|
|
326
344
|
], -1)
|
|
327
345
|
]), 8, $)
|
|
328
|
-
])) :
|
|
329
|
-
|
|
330
|
-
key:
|
|
346
|
+
])) : v("", !0),
|
|
347
|
+
l.isLoading ? v("", !0) : (d(!0), g(b, { key: 1 }, w(a.paginatedData, (s, u) => (d(), g("tr", {
|
|
348
|
+
key: u,
|
|
331
349
|
class: "text-gray-500 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800 dark:hover:text-gray-200"
|
|
332
350
|
}, [
|
|
333
|
-
(
|
|
334
|
-
key:
|
|
335
|
-
"data-label":
|
|
336
|
-
class:
|
|
337
|
-
"rounded-t-lg lg:rounded-t-none!":
|
|
338
|
-
"rounded-b-lg lg:rounded-b-none!":
|
|
351
|
+
(d(!0), g(b, null, w(n.columns, (i, m) => (d(), g("td", {
|
|
352
|
+
key: m,
|
|
353
|
+
"data-label": i.field_label,
|
|
354
|
+
class: _(["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", {
|
|
355
|
+
"rounded-t-lg lg:rounded-t-none!": m === 0,
|
|
356
|
+
"rounded-b-lg lg:rounded-b-none!": m === n.columns.length - 1
|
|
339
357
|
}])
|
|
340
358
|
}, [
|
|
341
359
|
e("div", {
|
|
342
|
-
class:
|
|
360
|
+
class: _([i.field_name === "action" ? "" : "overflow-auto", "td_overflow_auto max-h-40 max-w-100"])
|
|
343
361
|
}, [
|
|
344
|
-
|
|
362
|
+
i.tdComp ? (d(), I(O(a.forDynCompIs(i.tdComp)), {
|
|
345
363
|
key: 0,
|
|
346
364
|
row: s,
|
|
347
|
-
field:
|
|
348
|
-
xprops:
|
|
349
|
-
tdProps:
|
|
350
|
-
onEditAction: (
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
365
|
+
field: i.field_name,
|
|
366
|
+
xprops: n.xprops,
|
|
367
|
+
tdProps: i.tdProps,
|
|
368
|
+
onEditAction: (o) => {
|
|
369
|
+
a.editAction(s), a.cellAction("editAction", s, o, i);
|
|
370
|
+
},
|
|
371
|
+
onGeneralAction: (o) => {
|
|
372
|
+
a.generalAction(s), a.cellAction("generalAction", s, o, i);
|
|
373
|
+
},
|
|
374
|
+
onDeleteAction: (o) => a.cellAction("deleteAction", s, o, i),
|
|
375
|
+
onCellAction: (o, h) => a.cellAction(o, s, h, i)
|
|
376
|
+
}, null, 40, ["row", "field", "xprops", "tdProps", "onEditAction", "onGeneralAction", "onDeleteAction", "onCellAction"])) : (d(), g(b, { key: 1 }, [
|
|
377
|
+
a.isEscapedColumn(i) ? (d(), g("p", te, y(s[i.field_name]), 1)) : (d(), g("p", {
|
|
378
|
+
key: 1,
|
|
379
|
+
class: "text-pretty",
|
|
380
|
+
innerHTML: s[i.field_name]
|
|
381
|
+
}, null, 8, re))
|
|
382
|
+
], 64))
|
|
357
383
|
], 2)
|
|
358
384
|
], 10, ee))), 128))
|
|
359
385
|
]))), 128))
|
|
360
386
|
])
|
|
361
387
|
], 8, z)
|
|
362
388
|
], 8, Z),
|
|
363
|
-
|
|
364
|
-
e("div",
|
|
365
|
-
e("p",
|
|
366
|
-
t[12] || (t[12] =
|
|
367
|
-
e("span", ne,
|
|
368
|
-
t[13] || (t[13] =
|
|
369
|
-
e("span",
|
|
370
|
-
t[14] || (t[14] =
|
|
371
|
-
e("span",
|
|
372
|
-
t[15] || (t[15] =
|
|
389
|
+
a.paginatedData.length > 0 ? (d(), g("div", se, [
|
|
390
|
+
e("div", ae, [
|
|
391
|
+
e("p", le, [
|
|
392
|
+
t[12] || (t[12] = f(" Showing ")),
|
|
393
|
+
e("span", ne, y(a.firstItemIndex), 1),
|
|
394
|
+
t[13] || (t[13] = f(" to ")),
|
|
395
|
+
e("span", ie, y(a.lastItemIndex), 1),
|
|
396
|
+
t[14] || (t[14] = f(" of ")),
|
|
397
|
+
e("span", oe, y(a.filteredData.length), 1),
|
|
398
|
+
t[15] || (t[15] = f(" entries "))
|
|
373
399
|
]),
|
|
374
|
-
e("nav",
|
|
375
|
-
e("ul",
|
|
400
|
+
e("nav", de, [
|
|
401
|
+
e("ul", ge, [
|
|
376
402
|
e("li", null, [
|
|
377
403
|
e("a", {
|
|
378
404
|
href: "#",
|
|
379
|
-
onClick: t[2] || (t[2] =
|
|
405
|
+
onClick: t[2] || (t[2] = P((...s) => a.previousPage && a.previousPage(...s), ["prevent"])),
|
|
380
406
|
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"
|
|
381
407
|
}, t[16] || (t[16] = [
|
|
382
408
|
e("span", { class: "sr-only" }, "Previous", -1),
|
|
@@ -397,18 +423,18 @@ function ue(r, t, l, u, a, n) {
|
|
|
397
423
|
], -1)
|
|
398
424
|
]))
|
|
399
425
|
]),
|
|
400
|
-
(
|
|
426
|
+
(d(!0), g(b, null, w(a.displayedPageNumbers, (s) => (d(), g("li", { key: s }, [
|
|
401
427
|
e("a", {
|
|
402
428
|
href: "#",
|
|
403
|
-
onClick:
|
|
404
|
-
class:
|
|
405
|
-
"aria-current":
|
|
406
|
-
},
|
|
429
|
+
onClick: P((u) => a.goToPage(s), ["prevent"]),
|
|
430
|
+
class: _(l.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"),
|
|
431
|
+
"aria-current": l.currentPage === s ? "page" : void 0
|
|
432
|
+
}, y(s), 11, ce)
|
|
407
433
|
]))), 128)),
|
|
408
434
|
e("li", null, [
|
|
409
435
|
e("a", {
|
|
410
436
|
href: "#",
|
|
411
|
-
onClick: t[3] || (t[3] =
|
|
437
|
+
onClick: t[3] || (t[3] = P((...s) => a.nextPage && a.nextPage(...s), ["prevent"])),
|
|
412
438
|
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"
|
|
413
439
|
}, t[17] || (t[17] = [
|
|
414
440
|
e("span", { class: "sr-only" }, "Next", -1),
|
|
@@ -432,10 +458,10 @@ function ue(r, t, l, u, a, n) {
|
|
|
432
458
|
])
|
|
433
459
|
])
|
|
434
460
|
])
|
|
435
|
-
])) :
|
|
461
|
+
])) : v("", !0)
|
|
436
462
|
]);
|
|
437
463
|
}
|
|
438
|
-
const
|
|
464
|
+
const pe = /* @__PURE__ */ B(H, [["render", ue], ["__scopeId", "data-v-84b2e0a5"]]);
|
|
439
465
|
export {
|
|
440
|
-
|
|
466
|
+
pe as default
|
|
441
467
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { ref as d, watch as y, resolveComponent as b, createElementBlock as f, createCommentVNode as u, openBlock as _, createElementVNode as e, toDisplayString as l, withDirectives as h, createTextVNode as c, withKeys as v, withModifiers as k, vModelText as w, createVNode as g, withCtx as x } from "vue";
|
|
2
|
+
import C from "./GLButton.vue.js";
|
|
3
|
+
import { useGlFocusTrap as D, nextGlId as p } from "./useGlFocusTrap.js";
|
|
4
|
+
import I from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const T = {
|
|
5
6
|
components: {
|
|
6
|
-
GlButton:
|
|
7
|
+
GlButton: C
|
|
7
8
|
},
|
|
8
9
|
props: {
|
|
9
10
|
isOpen: {
|
|
@@ -14,76 +15,140 @@ const g = {
|
|
|
14
15
|
type: Object,
|
|
15
16
|
default: () => {
|
|
16
17
|
}
|
|
18
|
+
},
|
|
19
|
+
// When set, the delete button stays disabled until exactly this text is typed.
|
|
20
|
+
confirm_text: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: ""
|
|
23
|
+
},
|
|
24
|
+
// Escape emits cancel-delete. Set false to only close through the buttons.
|
|
25
|
+
close_on_escape: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: !0
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
emits: ["confirm-delete", "cancel-delete"],
|
|
31
|
+
setup(a, { emit: n }) {
|
|
32
|
+
const t = d(null), o = d(null), r = d(null), i = d("");
|
|
33
|
+
return y(() => a.isOpen, (s) => {
|
|
34
|
+
s && (i.value = "");
|
|
35
|
+
}), D(t, () => a.isOpen, {
|
|
36
|
+
closeOnEscape: () => a.close_on_escape,
|
|
37
|
+
onEscape: () => n("cancel-delete"),
|
|
38
|
+
initialFocus: () => o.value || r.value?.$el || null
|
|
39
|
+
}), {
|
|
40
|
+
panel: t,
|
|
41
|
+
confirmInput: o,
|
|
42
|
+
cancelButton: r,
|
|
43
|
+
typedText: i,
|
|
44
|
+
titleId: p("gl-delete-confirmation-title"),
|
|
45
|
+
inputId: p("gl-delete-confirmation-input")
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
computed: {
|
|
49
|
+
canConfirm() {
|
|
50
|
+
return !this.confirm_text || this.typedText === this.confirm_text;
|
|
17
51
|
}
|
|
18
52
|
},
|
|
19
53
|
methods: {
|
|
20
54
|
confirmDeletion() {
|
|
21
|
-
this.$emit("confirm-delete");
|
|
55
|
+
this.canConfirm && this.$emit("confirm-delete");
|
|
22
56
|
},
|
|
23
57
|
cancelDeletion() {
|
|
24
58
|
this.$emit("cancel-delete");
|
|
25
59
|
}
|
|
26
60
|
}
|
|
27
|
-
}, p = {
|
|
61
|
+
}, B = ["aria-labelledby"], O = { class: "flex items-center justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:p-0" }, V = {
|
|
62
|
+
ref: "panel",
|
|
63
|
+
tabindex: "-1",
|
|
64
|
+
class: "inline-block relative overflow-hidden text-left align-bottom transition-all transform bg-white dark:bg-gray-800 rounded-lg shadow-xl sm:my-8 sm:align-middle sm:max-w-lg sm:w-full focus:outline-hidden"
|
|
65
|
+
}, E = { class: "px-4 pt-5 pb-4 sm:p-6 sm:pb-4" }, N = { class: "sm:flex sm:items-start" }, G = { class: "mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left" }, M = ["id"], j = { class: "mt-2" }, F = { class: "text-sm" }, K = {
|
|
28
66
|
key: 0,
|
|
29
|
-
class: "
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
e("div",
|
|
41
|
-
n[
|
|
67
|
+
class: "mt-4 text-left"
|
|
68
|
+
}, S = ["for"], z = { class: "px-1 py-0.5 font-mono text-red-600 bg-gray-100 rounded-sm dark:bg-gray-900 dark:text-red-300" }, A = ["id"], U = { class: "border-t border-gray-200 rounded-b dark:border-gray-600 px-4 py-3 sm:px-6 flex gap-2" };
|
|
69
|
+
function q(a, n, t, o, r, i) {
|
|
70
|
+
const s = b("gl-button");
|
|
71
|
+
return t.isOpen ? (_(), f("div", {
|
|
72
|
+
key: 0,
|
|
73
|
+
class: "fixed inset-0 z-99999 overflow-y-auto",
|
|
74
|
+
"aria-labelledby": o.titleId,
|
|
75
|
+
role: "dialog",
|
|
76
|
+
"aria-modal": "true"
|
|
77
|
+
}, [
|
|
78
|
+
e("div", O, [
|
|
79
|
+
n[2] || (n[2] = e("div", {
|
|
42
80
|
class: "fixed inset-0 transition-opacity bg-gray-500/75",
|
|
43
81
|
"aria-hidden": "true"
|
|
44
82
|
}, null, -1)),
|
|
45
|
-
n[
|
|
83
|
+
n[3] || (n[3] = e("span", {
|
|
46
84
|
class: "hidden sm:inline-block sm:align-middle sm:h-screen",
|
|
47
85
|
"aria-hidden": "true"
|
|
48
86
|
}, "", -1)),
|
|
49
|
-
e("div",
|
|
50
|
-
e("div",
|
|
51
|
-
e("div",
|
|
52
|
-
e("div",
|
|
53
|
-
e("h3",
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
87
|
+
e("div", V, [
|
|
88
|
+
e("div", E, [
|
|
89
|
+
e("div", N, [
|
|
90
|
+
e("div", G, [
|
|
91
|
+
e("h3", {
|
|
92
|
+
class: "text-lg font-medium leading-6",
|
|
93
|
+
id: o.titleId
|
|
94
|
+
}, l(t.language?.title_delete_confirmation ?? "Confirm Deletion"), 9, M),
|
|
95
|
+
e("div", j, [
|
|
96
|
+
e("p", F, l(t.language?.message_delete_confirmation ?? "Are you sure you want to delete this item? This action cannot be undone."), 1)
|
|
97
|
+
]),
|
|
98
|
+
t.confirm_text ? (_(), f("div", K, [
|
|
99
|
+
e("label", {
|
|
100
|
+
for: o.inputId,
|
|
101
|
+
class: "block mb-1 text-xs font-medium text-gray-600 dark:text-gray-300"
|
|
102
|
+
}, [
|
|
103
|
+
c(l(t.language?.type_to_confirm ?? "Type") + " ", 1),
|
|
104
|
+
e("code", z, l(t.confirm_text), 1),
|
|
105
|
+
c(" " + l(t.language?.to_confirm ?? "to confirm"), 1)
|
|
106
|
+
], 8, S),
|
|
107
|
+
h(e("input", {
|
|
108
|
+
id: o.inputId,
|
|
109
|
+
ref: "confirmInput",
|
|
110
|
+
"onUpdate:modelValue": n[0] || (n[0] = (m) => o.typedText = m),
|
|
111
|
+
type: "text",
|
|
112
|
+
autocomplete: "off",
|
|
113
|
+
spellcheck: "false",
|
|
114
|
+
class: "gl-input-form",
|
|
115
|
+
onKeydown: n[1] || (n[1] = v(k((...m) => i.confirmDeletion && i.confirmDeletion(...m), ["prevent"]), ["enter"]))
|
|
116
|
+
}, null, 40, A), [
|
|
117
|
+
[w, o.typedText]
|
|
118
|
+
])
|
|
119
|
+
])) : u("", !0)
|
|
57
120
|
])
|
|
58
121
|
])
|
|
59
122
|
]),
|
|
60
|
-
e("div",
|
|
61
|
-
s
|
|
123
|
+
e("div", U, [
|
|
124
|
+
g(s, {
|
|
62
125
|
onClick: i.confirmDeletion,
|
|
63
126
|
tag: "button",
|
|
64
|
-
button_type: "red"
|
|
127
|
+
button_type: "red",
|
|
128
|
+
is_disabled: !i.canConfirm
|
|
65
129
|
}, {
|
|
66
|
-
default:
|
|
67
|
-
|
|
130
|
+
default: x(() => [
|
|
131
|
+
c(l(t.language?.okbutton_delete_confirmation ?? "Delete"), 1)
|
|
68
132
|
]),
|
|
69
133
|
_: 1
|
|
70
|
-
}, 8, ["onClick"]),
|
|
71
|
-
s
|
|
134
|
+
}, 8, ["onClick", "is_disabled"]),
|
|
135
|
+
g(s, {
|
|
136
|
+
ref: "cancelButton",
|
|
72
137
|
onClick: i.cancelDeletion,
|
|
73
138
|
tag: "button",
|
|
74
139
|
button_type: "light"
|
|
75
140
|
}, {
|
|
76
|
-
default:
|
|
77
|
-
|
|
141
|
+
default: x(() => [
|
|
142
|
+
c(l(t.language?.cancelbutton_delete_confirmation ?? "Cancel"), 1)
|
|
78
143
|
]),
|
|
79
144
|
_: 1
|
|
80
145
|
}, 8, ["onClick"])
|
|
81
146
|
])
|
|
82
|
-
])
|
|
147
|
+
], 512)
|
|
83
148
|
])
|
|
84
|
-
])) :
|
|
149
|
+
], 8, B)) : u("", !0);
|
|
85
150
|
}
|
|
86
|
-
const
|
|
151
|
+
const Q = /* @__PURE__ */ I(T, [["render", q]]);
|
|
87
152
|
export {
|
|
88
|
-
|
|
153
|
+
Q as default
|
|
89
154
|
};
|