golden-logic-ui 1.2.22 → 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.
- package/dist/ConfirmationModal-i3ekouBw.js +75 -0
- package/dist/DatatableAction-D-Qdjj2W.js +113 -0
- package/dist/DatatableCommand-BoU5cYJg.js +18 -0
- package/dist/DatatableConvertCronToHuman-Coiaa-wa.js +82 -0
- package/dist/DatatableDate-DtEktp_Z.js +20 -0
- package/dist/DatatableDateTime-PEXV-bY7.js +22 -0
- package/dist/DatatableDeleteAction-BQ6MyhV6.js +104 -0
- package/dist/DatatableDeleteEditAction-Cx324OUt.js +125 -0
- package/dist/DatatableFileDownload-BxP2_lpQ.js +87 -0
- package/dist/DatatableFiles-BROH3vBH.js +80 -0
- package/dist/DatatableHtml-ChZzeapg.js +17 -0
- package/dist/DatatableList-BSVI22pu.js +35 -0
- package/dist/DatatableListNested-BWEqWRCc.js +37 -0
- package/dist/DatatablePicture-DaWD4uIX.js +26 -0
- package/dist/DatatablePictures-xxeghKp3.js +39 -0
- package/dist/DatatableStatus-Dx60sa7s.js +31 -0
- package/dist/DatatableStatusGeneral-UOub65UY.js +59 -0
- package/dist/DatatableStatusServer-Dcq11U5_.js +37 -0
- package/dist/DatatableStatusSpecficColor-BYUuGgEb.js +64 -0
- package/dist/DatatableStatusTextLabelGeneral-J4MytOnh.js +83 -0
- package/dist/DeleteConfirmationModal-CQ07_qiL.js +96 -0
- package/dist/DynamicConfirmation-rEhA3jCe.js +115 -0
- package/dist/FilesUpload-JKyOru3A.js +300 -0
- package/dist/GLButton-ByIDh6vq.js +118 -0
- package/dist/GLDataTable-Bixwkdr4.js +278 -0
- package/dist/GLDataTableServerSide-Ra5AqDGB.js +16336 -0
- package/dist/GLTextarea-j7XXWI7A.js +110 -0
- package/dist/GlAccordion-BIAfvctc.js +91 -0
- package/dist/GlAccordionsWrapper-DsdunDzi.js +31 -0
- package/dist/GlCard-BVXmTv6q.js +37 -0
- package/dist/GlCodeCopy-C068yRcM.js +86 -0
- package/dist/GlCodeMirror-Ow8TJYSN.js +161 -0
- package/dist/GlCodeMirrorTranslate-CFmoM7d6.js +2068 -0
- package/dist/GlDataTableComponent-CSsMcDcX.js +366 -0
- package/dist/GlDataTableServerSideGroupBy-cG4BhXOA.js +260 -0
- package/dist/GlDateRangePicker-BWAEfZTB.js +124 -0
- package/dist/GlDropdown-B_zVkmxO.js +414 -0
- package/dist/GlLanguageSelector-DmWuIxzK.js +68 -0
- package/dist/GlModal-AMtSRssu.js +123 -0
- package/dist/GlModalShow-BzbcLu51.js +120 -0
- package/dist/GlModalWithoutOverflow-vR50Ulka.js +127 -0
- package/dist/GlMultiItemSlide-CxsiUcTr.js +409 -0
- package/dist/GlMultiItemSlideDynamic-BhdHrj3L.js +434 -0
- package/dist/GlMultiSelectDropdown-OaAC5ouZ.js +383 -0
- package/dist/GlTab-CUbU0yit.js +22 -0
- package/dist/GlTabShow-BBU3VU7O.js +21 -0
- package/dist/GlTabsWrapper-Dw7NAgDw.js +54 -0
- package/dist/GlTextCopy-CGgnIqPh.js +93 -0
- package/dist/GlTextInput-CoL8oZSw.js +126 -0
- package/dist/GlTextInputFile-BE2maeRQ.js +95 -0
- package/dist/GlTextInputWithText-C6fzOoYl.js +116 -0
- package/dist/GlTextTranslate-C3DzCK6k.js +125 -0
- package/dist/GlTextareaTranslate-DyU86Wf_.js +126 -0
- package/dist/GlTinymce-CjsbThKo.js +118 -0
- package/dist/GlTinymceTranslate-vp6hYqDK.js +188 -0
- package/dist/GlToastList-eeZ0hUJQ.js +126 -0
- package/dist/GlToggleBox-Dym29cx5.js +120 -0
- package/dist/GlToggleBoxTrueFalse-CjvcXXTw.js +112 -0
- package/dist/StatusConnectingConnectedDisconnected-CK5YzyQH.js +63 -0
- package/dist/StatusRunningSuccessFailed-CxK20462.js +41 -0
- package/dist/TailwindPagination-Dz89aS_l.js +276 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/golden-logic-ui.css +1 -1
- package/dist/golden-logic-ui.js +217 -94352
- package/dist/golden-logic-ui.umd.cjs +94 -94
- package/dist/index-B4V16SEr.js +15668 -0
- package/dist/plugin-D6yBFU6i.js +53226 -0
- package/package.json +1 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import c from "./GLButton-ByIDh6vq.js";
|
|
2
|
+
import { resolveComponent as m, createElementBlock as f, createCommentVNode as _, openBlock as p, createElementVNode as t, toDisplayString as i, renderSlot as u, createVNode as l, withCtx as r, createTextVNode as a } from "vue";
|
|
3
|
+
import { _ as x } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
const g = {
|
|
5
|
+
components: {
|
|
6
|
+
GlButton: c
|
|
7
|
+
},
|
|
8
|
+
props: ["isOpen", "title", "button_text"],
|
|
9
|
+
methods: {
|
|
10
|
+
confirmAction() {
|
|
11
|
+
this.$emit("confirm-action");
|
|
12
|
+
},
|
|
13
|
+
cancelAction() {
|
|
14
|
+
this.$emit("cancel-action");
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}, b = {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "fixed inset-0 z-50 overflow-y-auto",
|
|
20
|
+
role: "dialog",
|
|
21
|
+
"aria-modal": "true"
|
|
22
|
+
}, h = { class: "flex items-center justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:p-0" }, v = { 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" }, y = { class: "px-4 pt-5 pb-4 sm:p-6 sm:pb-4" }, k = { class: "sm:flex sm:items-start" }, C = { class: "mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left" }, w = { class: "text-lg font-medium leading-6" }, A = { class: "mt-2" }, N = { class: "border-t border-gray-200 rounded-b dark:border-gray-600 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse gap-2" };
|
|
23
|
+
function V(d, e, o, B, E, n) {
|
|
24
|
+
const s = m("gl-button");
|
|
25
|
+
return o.isOpen ? (p(), f("div", b, [
|
|
26
|
+
t("div", h, [
|
|
27
|
+
e[1] || (e[1] = t("div", {
|
|
28
|
+
class: "fixed inset-0 transition-opacity bg-gray-500/75",
|
|
29
|
+
"aria-hidden": "true"
|
|
30
|
+
}, null, -1)),
|
|
31
|
+
e[2] || (e[2] = t("span", {
|
|
32
|
+
class: "hidden sm:inline-block sm:align-middle sm:h-screen",
|
|
33
|
+
"aria-hidden": "true"
|
|
34
|
+
}, "", -1)),
|
|
35
|
+
t("div", v, [
|
|
36
|
+
t("div", y, [
|
|
37
|
+
t("div", k, [
|
|
38
|
+
t("div", C, [
|
|
39
|
+
t("h3", w, i(o.title), 1),
|
|
40
|
+
t("div", A, [
|
|
41
|
+
u(d.$slots, "default")
|
|
42
|
+
])
|
|
43
|
+
])
|
|
44
|
+
])
|
|
45
|
+
]),
|
|
46
|
+
t("div", N, [
|
|
47
|
+
l(s, {
|
|
48
|
+
onClick: n.confirmAction,
|
|
49
|
+
tag: "button",
|
|
50
|
+
button_type: "red"
|
|
51
|
+
}, {
|
|
52
|
+
default: r(() => [
|
|
53
|
+
a(i(o.button_text), 1)
|
|
54
|
+
]),
|
|
55
|
+
_: 1
|
|
56
|
+
}, 8, ["onClick"]),
|
|
57
|
+
l(s, {
|
|
58
|
+
onClick: n.cancelAction,
|
|
59
|
+
tag: "button",
|
|
60
|
+
button_type: "light"
|
|
61
|
+
}, {
|
|
62
|
+
default: r(() => e[0] || (e[0] = [
|
|
63
|
+
a(" Cancel ")
|
|
64
|
+
])),
|
|
65
|
+
_: 1
|
|
66
|
+
}, 8, ["onClick"])
|
|
67
|
+
])
|
|
68
|
+
])
|
|
69
|
+
])
|
|
70
|
+
])) : _("", !0);
|
|
71
|
+
}
|
|
72
|
+
const j = /* @__PURE__ */ x(g, [["render", V]]);
|
|
73
|
+
export {
|
|
74
|
+
j as default
|
|
75
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { ref as u, resolveDirective as k, createElementBlock as i, openBlock as s, Fragment as b, createVNode as D, withDirectives as p, createCommentVNode as n, createElementVNode as e, createTextVNode as g, withModifiers as C, vShow as $ } from "vue";
|
|
2
|
+
import A from "./DeleteConfirmationModal-CQ07_qiL.js";
|
|
3
|
+
import { GlToast as M } from "./golden-logic-ui.js";
|
|
4
|
+
const O = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "flex lg:justify-center"
|
|
7
|
+
}, _ = { class: "absolute z-10 mt-6 origin-top-right bg-white divide-y divide-gray-100 rounded-lg shadow-sm w-44 dark:bg-gray-700 dark:divide-gray-600" }, j = {
|
|
8
|
+
class: "py-2 text-sm text-gray-700 dark:text-gray-200",
|
|
9
|
+
"aria-labelledby": "dropdownDividerButton"
|
|
10
|
+
}, B = { key: 0 }, N = ["href"], V = { key: 1 }, T = {
|
|
11
|
+
__name: "DatatableAction",
|
|
12
|
+
props: {
|
|
13
|
+
field: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ""
|
|
16
|
+
},
|
|
17
|
+
route_url: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
row: {
|
|
22
|
+
type: [Array, Object],
|
|
23
|
+
default: []
|
|
24
|
+
},
|
|
25
|
+
xprops: {
|
|
26
|
+
type: Object,
|
|
27
|
+
default: {}
|
|
28
|
+
},
|
|
29
|
+
tdProps: {
|
|
30
|
+
type: Object,
|
|
31
|
+
default: {}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
emits: ["deleteAction"],
|
|
35
|
+
setup(t, { emit: m }) {
|
|
36
|
+
const d = t, a = u(!1), l = u(!1), f = () => {
|
|
37
|
+
a.value = !1;
|
|
38
|
+
}, y = () => {
|
|
39
|
+
a.value = !0;
|
|
40
|
+
}, c = () => {
|
|
41
|
+
l.value = !1;
|
|
42
|
+
}, h = () => {
|
|
43
|
+
l.value = !0;
|
|
44
|
+
}, v = m, w = () => {
|
|
45
|
+
axios.delete(`${d.xprops.route}/${d.row.id}`).then(() => {
|
|
46
|
+
c(), v("deleteAction"), M.methods.add({
|
|
47
|
+
message: "Item deleted successfully.",
|
|
48
|
+
type: "success",
|
|
49
|
+
duration: 5e3
|
|
50
|
+
});
|
|
51
|
+
}).catch((r) => {
|
|
52
|
+
console.log(r);
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
return (r, o) => {
|
|
56
|
+
const x = k("click-outside");
|
|
57
|
+
return s(), i(b, null, [
|
|
58
|
+
D(A, {
|
|
59
|
+
isOpen: l.value,
|
|
60
|
+
onConfirmDelete: w,
|
|
61
|
+
onCancelDelete: c
|
|
62
|
+
}, null, 8, ["isOpen"]),
|
|
63
|
+
t.row && r.can(`edit_${t.xprops.permission} || delete_${t.xprops.permission}`) ? p((s(), i("div", O, [
|
|
64
|
+
e("button", {
|
|
65
|
+
onClick: y,
|
|
66
|
+
class: "inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-white rounded-lg hover:bg-gray-100 focus:ring-4 focus:outline-hidden dark:text-white focus:ring-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-600",
|
|
67
|
+
type: "button"
|
|
68
|
+
}, o[0] || (o[0] = [
|
|
69
|
+
e("svg", {
|
|
70
|
+
class: "w-5 h-5",
|
|
71
|
+
"aria-hidden": "true",
|
|
72
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
73
|
+
fill: "currentColor",
|
|
74
|
+
viewBox: "0 0 4 15"
|
|
75
|
+
}, [
|
|
76
|
+
e("path", { d: "M3.5 1.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 6.041a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 5.959a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z" })
|
|
77
|
+
], -1)
|
|
78
|
+
])),
|
|
79
|
+
p(e("div", _, [
|
|
80
|
+
e("ul", j, [
|
|
81
|
+
r.can(`edit_${t.xprops.permission}`) ? (s(), i("li", B, [
|
|
82
|
+
e("a", {
|
|
83
|
+
href: t.xprops.route + "/" + t.row.id + "/edit",
|
|
84
|
+
class: "block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
|
|
85
|
+
}, o[1] || (o[1] = [
|
|
86
|
+
e("i", { class: "mr-2 fa-solid fa-list-ul opacity-80" }, null, -1),
|
|
87
|
+
g(" Edit")
|
|
88
|
+
]), 8, N)
|
|
89
|
+
])) : n("", !0),
|
|
90
|
+
r.can(`delete_${t.xprops.permission}`) ? (s(), i("li", V, [
|
|
91
|
+
e("a", {
|
|
92
|
+
href: "#",
|
|
93
|
+
onClick: C(h, ["prevent"]),
|
|
94
|
+
class: "block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
|
|
95
|
+
}, o[2] || (o[2] = [
|
|
96
|
+
e("i", { class: "mr-2 fa-solid fa-trash-can opacity-80" }, null, -1),
|
|
97
|
+
g(" Remove")
|
|
98
|
+
]))
|
|
99
|
+
])) : n("", !0)
|
|
100
|
+
])
|
|
101
|
+
], 512), [
|
|
102
|
+
[$, a.value]
|
|
103
|
+
])
|
|
104
|
+
])), [
|
|
105
|
+
[x, f]
|
|
106
|
+
]) : n("", !0)
|
|
107
|
+
], 64);
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
export {
|
|
112
|
+
T as default
|
|
113
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createElementBlock as t, createCommentVNode as o, openBlock as r, createElementVNode as n, toDisplayString as s } from "vue";
|
|
2
|
+
import { _ as a } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const l = {
|
|
4
|
+
props: ["field", "row", "tdProps"]
|
|
5
|
+
}, c = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "text-nowrap w-full"
|
|
8
|
+
}, d = { class: "w-full h-full p-3 mx-0 mt-0 overflow-auto font-mono text-left break-words rounded-sm cursor-default whitespace-nowrap console_styles" };
|
|
9
|
+
function f(m, i, e, _, u, p) {
|
|
10
|
+
return e.row[e.field] ? (r(), t("div", c, [
|
|
11
|
+
n("pre", d, " " + s(e.row[e.field]) + `
|
|
12
|
+
`, 1)
|
|
13
|
+
])) : o("", !0);
|
|
14
|
+
}
|
|
15
|
+
const h = /* @__PURE__ */ a(l, [["render", f]]);
|
|
16
|
+
export {
|
|
17
|
+
h as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { createElementBlock as l, createCommentVNode as h, openBlock as v, createElementVNode as f, toDisplayString as p } from "vue";
|
|
2
|
+
import { _ as $ } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const b = {
|
|
4
|
+
props: ["field", "row", "tdProps"],
|
|
5
|
+
methods: {
|
|
6
|
+
convertCronToHuman(e) {
|
|
7
|
+
const [t, n, o, a, r] = e.split(" ");
|
|
8
|
+
if (t === "*" && n === "*" && o === "*" && a === "*" && r === "*")
|
|
9
|
+
return "Runs every minute.";
|
|
10
|
+
if (t === "0" && n === "0" && o === "*" && a === "*" && r !== "*")
|
|
11
|
+
return `Runs at 12:00 AM every ${this.convertDayOfWeek(r)}.`;
|
|
12
|
+
const s = {
|
|
13
|
+
0: "Sunday",
|
|
14
|
+
1: "Monday",
|
|
15
|
+
2: "Tuesday",
|
|
16
|
+
3: "Wednesday",
|
|
17
|
+
4: "Thursday",
|
|
18
|
+
5: "Friday",
|
|
19
|
+
6: "Saturday",
|
|
20
|
+
"*": "every day"
|
|
21
|
+
}, u = {
|
|
22
|
+
1: "January",
|
|
23
|
+
2: "February",
|
|
24
|
+
3: "March",
|
|
25
|
+
4: "April",
|
|
26
|
+
5: "May",
|
|
27
|
+
6: "June",
|
|
28
|
+
7: "July",
|
|
29
|
+
8: "August",
|
|
30
|
+
9: "September",
|
|
31
|
+
10: "October",
|
|
32
|
+
11: "November",
|
|
33
|
+
12: "December",
|
|
34
|
+
"*": "every month"
|
|
35
|
+
}, d = this.convertField(t, "minute", 59), c = this.convertField(n, "hour", 23), i = this.convertField(o, "day of the month", 31), y = this.convertField(a, "month", 12, u), m = this.convertField(r, "day", 6, s);
|
|
36
|
+
return `Runs ${d} ${c} ${i} ${y} on ${m}.`;
|
|
37
|
+
},
|
|
38
|
+
convertField(e, t, n, o = {}) {
|
|
39
|
+
if (e === "*") return `every ${t}`;
|
|
40
|
+
if (e.includes("/")) {
|
|
41
|
+
const [a, r] = e.split("/");
|
|
42
|
+
return `every ${r} ${t}${r > 1 ? "s" : ""} starting at ${a}`;
|
|
43
|
+
}
|
|
44
|
+
if (e.includes("-")) {
|
|
45
|
+
const [a, r] = e.split("-");
|
|
46
|
+
return `${t}s from ${a} to ${r}`;
|
|
47
|
+
}
|
|
48
|
+
if (e.includes(",")) {
|
|
49
|
+
const a = e.split(",").map((r) => o[r] || r);
|
|
50
|
+
return `${t}s on ${a.join(", ")}`;
|
|
51
|
+
}
|
|
52
|
+
return o[e] || `${t} ${e}`;
|
|
53
|
+
},
|
|
54
|
+
convertDayOfWeek(e) {
|
|
55
|
+
return {
|
|
56
|
+
0: "Sunday",
|
|
57
|
+
1: "Monday",
|
|
58
|
+
2: "Tuesday",
|
|
59
|
+
3: "Wednesday",
|
|
60
|
+
4: "Thursday",
|
|
61
|
+
5: "Friday",
|
|
62
|
+
6: "Saturday"
|
|
63
|
+
}[e] || "Invalid day";
|
|
64
|
+
},
|
|
65
|
+
formatHour(e) {
|
|
66
|
+
const t = parseInt(e, 10), n = t >= 12 ? "PM" : "AM";
|
|
67
|
+
return `${(t % 12 || 12).toString().padStart(2, "0")}:00 ${n}`;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, M = {
|
|
71
|
+
key: 0,
|
|
72
|
+
class: "flex flex-wrap gap-2"
|
|
73
|
+
}, _ = { class: "px-2 py-1 text-xs font-medium text-blue-800 bg-blue-100 rounded-sm dark:bg-blue-900 dark:text-blue-300" };
|
|
74
|
+
function k(e, t, n, o, a, r) {
|
|
75
|
+
return n.row[n.field] ? (v(), l("div", M, [
|
|
76
|
+
f("span", _, p(r.convertCronToHuman(n.row[n.field])), 1)
|
|
77
|
+
])) : h("", !0);
|
|
78
|
+
}
|
|
79
|
+
const F = /* @__PURE__ */ $(b, [["render", k]]);
|
|
80
|
+
export {
|
|
81
|
+
F as default
|
|
82
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createElementBlock as n, openBlock as c, toDisplayString as i } from "vue";
|
|
2
|
+
import { _ as d } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const f = {
|
|
4
|
+
props: ["field", "row", "tdProps"],
|
|
5
|
+
computed: {
|
|
6
|
+
formattedDate() {
|
|
7
|
+
if (!this.row[this.field])
|
|
8
|
+
return "";
|
|
9
|
+
const t = new Date(this.row[this.field]), e = t.getFullYear(), o = t.toLocaleString("default", { month: "long" }), r = t.getDate();
|
|
10
|
+
return `${o} ${r}, ${e}`;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}, l = { class: "w-full" };
|
|
14
|
+
function m(t, e, o, r, a, s) {
|
|
15
|
+
return c(), n("div", l, i(s.formattedDate), 1);
|
|
16
|
+
}
|
|
17
|
+
const u = /* @__PURE__ */ d(f, [["render", m]]);
|
|
18
|
+
export {
|
|
19
|
+
u as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createElementBlock as i, openBlock as m, toDisplayString as d } from "vue";
|
|
2
|
+
import { _ as l } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const f = {
|
|
4
|
+
props: ["field", "row", "tdProps"],
|
|
5
|
+
computed: {
|
|
6
|
+
formattedDate() {
|
|
7
|
+
if (!this.row[this.field])
|
|
8
|
+
return "";
|
|
9
|
+
const e = new Date(this.row[this.field]), s = e.getFullYear(), r = e.toLocaleString("default", { month: "long" }), a = e.getDate();
|
|
10
|
+
let t = e.getHours();
|
|
11
|
+
const o = e.getMinutes(), n = e.getSeconds(), c = t >= 12 ? "pm" : "am";
|
|
12
|
+
return t = t % 12, t = t || 12, `${r} ${a}, ${s}, ${t}:${o}:${n} ${c}`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}, p = { class: "w-full" };
|
|
16
|
+
function u(e, s, r, a, t, o) {
|
|
17
|
+
return m(), i("div", p, d(o.formattedDate), 1);
|
|
18
|
+
}
|
|
19
|
+
const D = /* @__PURE__ */ l(f, [["render", u]]);
|
|
20
|
+
export {
|
|
21
|
+
D as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ref as c, resolveDirective as x, createElementBlock as s, openBlock as i, Fragment as b, createVNode as k, withDirectives as u, createCommentVNode as p, createElementVNode as e, withModifiers as D, createTextVNode as _, vShow as C } from "vue";
|
|
2
|
+
import A from "./DeleteConfirmationModal-CQ07_qiL.js";
|
|
3
|
+
import { GlToast as M } from "./golden-logic-ui.js";
|
|
4
|
+
const O = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "flex lg:justify-center"
|
|
7
|
+
}, j = { class: "absolute z-10 mt-5 origin-top-right bg-white divide-y divide-gray-100 rounded-lg shadow-sm w-44 dark:bg-gray-700 dark:divide-gray-600" }, B = {
|
|
8
|
+
class: "py-2 text-sm text-gray-700 dark:text-gray-200",
|
|
9
|
+
"aria-labelledby": "dropdownDividerButton"
|
|
10
|
+
}, N = { key: 0 }, Z = {
|
|
11
|
+
__name: "DatatableDeleteAction",
|
|
12
|
+
props: {
|
|
13
|
+
field: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ""
|
|
16
|
+
},
|
|
17
|
+
route_url: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
row: {
|
|
22
|
+
type: [Array, Object],
|
|
23
|
+
default: []
|
|
24
|
+
},
|
|
25
|
+
xprops: {
|
|
26
|
+
type: Object,
|
|
27
|
+
default: {}
|
|
28
|
+
},
|
|
29
|
+
tdProps: {
|
|
30
|
+
type: Object,
|
|
31
|
+
default: {}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
emits: ["deleteAction"],
|
|
35
|
+
setup(t, { emit: g }) {
|
|
36
|
+
const n = t, a = c(!1), l = c(!1), m = () => {
|
|
37
|
+
a.value = !1;
|
|
38
|
+
}, f = () => {
|
|
39
|
+
a.value = !0;
|
|
40
|
+
}, d = () => {
|
|
41
|
+
l.value = !1;
|
|
42
|
+
}, y = () => {
|
|
43
|
+
l.value = !0;
|
|
44
|
+
}, v = g, h = () => {
|
|
45
|
+
axios.delete(`${n.xprops.route}/${n.row.id}`).then(() => {
|
|
46
|
+
d(), v("deleteAction"), M.methods.add({
|
|
47
|
+
message: "Item deleted successfully.",
|
|
48
|
+
type: "success",
|
|
49
|
+
duration: 5e3
|
|
50
|
+
});
|
|
51
|
+
}).catch((o) => {
|
|
52
|
+
console.log(o);
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
return (o, r) => {
|
|
56
|
+
const w = x("click-outside");
|
|
57
|
+
return i(), s(b, null, [
|
|
58
|
+
k(A, {
|
|
59
|
+
isOpen: l.value,
|
|
60
|
+
onConfirmDelete: h,
|
|
61
|
+
onCancelDelete: d
|
|
62
|
+
}, null, 8, ["isOpen"]),
|
|
63
|
+
t.row && o.can(`delete_${t.xprops.permission}`) ? u((i(), s("div", O, [
|
|
64
|
+
e("button", {
|
|
65
|
+
onClick: f,
|
|
66
|
+
class: "inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-white rounded-lg hover:bg-gray-100 focus:ring-4 focus:outline-hidden dark:text-white focus:ring-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-600",
|
|
67
|
+
type: "button"
|
|
68
|
+
}, r[0] || (r[0] = [
|
|
69
|
+
e("svg", {
|
|
70
|
+
class: "w-5 h-5",
|
|
71
|
+
"aria-hidden": "true",
|
|
72
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
73
|
+
fill: "currentColor",
|
|
74
|
+
viewBox: "0 0 4 15"
|
|
75
|
+
}, [
|
|
76
|
+
e("path", { d: "M3.5 1.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 6.041a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 5.959a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z" })
|
|
77
|
+
], -1)
|
|
78
|
+
])),
|
|
79
|
+
u(e("div", j, [
|
|
80
|
+
e("ul", B, [
|
|
81
|
+
o.can(`delete_${t.xprops.permission}`) ? (i(), s("li", N, [
|
|
82
|
+
e("a", {
|
|
83
|
+
href: "#",
|
|
84
|
+
onClick: D(y, ["prevent"]),
|
|
85
|
+
class: "block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
|
|
86
|
+
}, r[1] || (r[1] = [
|
|
87
|
+
e("i", { class: "mr-2 fa-solid fa-trash-can opacity-80" }, null, -1),
|
|
88
|
+
_(" Remove")
|
|
89
|
+
]))
|
|
90
|
+
])) : p("", !0)
|
|
91
|
+
])
|
|
92
|
+
], 512), [
|
|
93
|
+
[C, a.value]
|
|
94
|
+
])
|
|
95
|
+
])), [
|
|
96
|
+
[w, m]
|
|
97
|
+
]) : p("", !0)
|
|
98
|
+
], 64);
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
export {
|
|
103
|
+
Z as default
|
|
104
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { ref as m, resolveDirective as $, createElementBlock as a, openBlock as i, Fragment as O, createVNode as j, withDirectives as f, createCommentVNode as d, createElementVNode as o, withModifiers as y, createTextVNode as v, toDisplayString as h, vShow as M } from "vue";
|
|
2
|
+
import B from "./DeleteConfirmationModal-CQ07_qiL.js";
|
|
3
|
+
import { GlToast as E } from "./golden-logic-ui.js";
|
|
4
|
+
const N = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "flex lg:justify-center"
|
|
7
|
+
}, S = { class: "xs:right-[unset] lg:right-[30px] absolute z-10 mt-6 origin-top-right bg-white divide-y divide-gray-100 rounded-lg shadow-sm w-44 dark:bg-gray-700 dark:divide-gray-600" }, V = {
|
|
8
|
+
class: "py-2 text-sm text-gray-700 dark:text-gray-200",
|
|
9
|
+
"aria-labelledby": "dropdownDividerButton"
|
|
10
|
+
}, Z = { key: 0 }, q = { key: 1 }, I = {
|
|
11
|
+
__name: "DatatableDeleteEditAction",
|
|
12
|
+
props: {
|
|
13
|
+
language: {
|
|
14
|
+
type: Object,
|
|
15
|
+
required: !1,
|
|
16
|
+
default: () => {
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
field: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: ""
|
|
22
|
+
},
|
|
23
|
+
route_url: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: ""
|
|
26
|
+
},
|
|
27
|
+
row: {
|
|
28
|
+
type: [Array, Object],
|
|
29
|
+
default: () => ({})
|
|
30
|
+
},
|
|
31
|
+
xprops: {
|
|
32
|
+
type: Object,
|
|
33
|
+
default: () => ({})
|
|
34
|
+
},
|
|
35
|
+
tdProps: {
|
|
36
|
+
type: Object,
|
|
37
|
+
default: () => ({})
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
emits: ["deleteAction", "editAction"],
|
|
41
|
+
setup(t, { emit: x }) {
|
|
42
|
+
const l = t, s = m(!1), n = m(!1), c = () => {
|
|
43
|
+
n.value = !1;
|
|
44
|
+
}, k = () => {
|
|
45
|
+
n.value = !0;
|
|
46
|
+
}, w = () => {
|
|
47
|
+
s.value = !1;
|
|
48
|
+
}, b = () => {
|
|
49
|
+
s.value = !0;
|
|
50
|
+
}, u = x, D = (e) => {
|
|
51
|
+
u("editAction", e);
|
|
52
|
+
}, A = () => {
|
|
53
|
+
axios.delete(`${l.xprops.route}/${l.row.id}`).then(() => {
|
|
54
|
+
var e;
|
|
55
|
+
c(), u("deleteAction"), E.methods.add({
|
|
56
|
+
message: ((e = l.language) == null ? void 0 : e.item_deleted_successfully) ?? "Item deleted successfully.",
|
|
57
|
+
type: "success",
|
|
58
|
+
duration: 5e3
|
|
59
|
+
});
|
|
60
|
+
}).catch((e) => {
|
|
61
|
+
console.log(e);
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
return (e, r) => {
|
|
65
|
+
var g, p;
|
|
66
|
+
const C = $("click-outside");
|
|
67
|
+
return i(), a(O, null, [
|
|
68
|
+
j(B, {
|
|
69
|
+
language: t.language,
|
|
70
|
+
isOpen: n.value,
|
|
71
|
+
onConfirmDelete: A,
|
|
72
|
+
onCancelDelete: c
|
|
73
|
+
}, null, 8, ["language", "isOpen"]),
|
|
74
|
+
t.row && (e.can(`delete_${t.xprops.permission}`) || e.can(`access_${t.xprops.permission}`)) ? f((i(), a("div", N, [
|
|
75
|
+
o("button", {
|
|
76
|
+
onClick: b,
|
|
77
|
+
class: "inline-flex items-center p-2 text-sm font-medium text-center text-gray-900 bg-white rounded-lg hover:bg-gray-100 focus:ring-4 focus:outline-hidden dark:text-white focus:ring-gray-50 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-600",
|
|
78
|
+
type: "button"
|
|
79
|
+
}, r[1] || (r[1] = [
|
|
80
|
+
o("svg", {
|
|
81
|
+
class: "w-5 h-5",
|
|
82
|
+
"aria-hidden": "true",
|
|
83
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
84
|
+
fill: "currentColor",
|
|
85
|
+
viewBox: "0 0 4 15"
|
|
86
|
+
}, [
|
|
87
|
+
o("path", { d: "M3.5 1.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 6.041a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0 5.959a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z" })
|
|
88
|
+
], -1)
|
|
89
|
+
])),
|
|
90
|
+
f(o("div", S, [
|
|
91
|
+
o("ul", V, [
|
|
92
|
+
e.can(`access_${t.xprops.permission}`) ? (i(), a("li", Z, [
|
|
93
|
+
o("a", {
|
|
94
|
+
href: "#",
|
|
95
|
+
onClick: r[0] || (r[0] = y((T) => D(t.row), ["prevent"])),
|
|
96
|
+
class: "block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
|
|
97
|
+
}, [
|
|
98
|
+
r[2] || (r[2] = o("i", { class: "mr-1 fa-solid fa-pen-to-square opacity-80" }, null, -1)),
|
|
99
|
+
v(" " + h(((g = t.language) == null ? void 0 : g.edit) ?? "Edit"), 1)
|
|
100
|
+
])
|
|
101
|
+
])) : d("", !0),
|
|
102
|
+
e.can(`delete_${t.xprops.permission}`) ? (i(), a("li", q, [
|
|
103
|
+
o("a", {
|
|
104
|
+
href: "#",
|
|
105
|
+
onClick: y(k, ["prevent"]),
|
|
106
|
+
class: "block px-4 py-2 text-red-600 hover:text-white hover:bg-red-600 dark:text-red-500 dark:hover:text-white dark:hover:bg-red-600"
|
|
107
|
+
}, [
|
|
108
|
+
r[3] || (r[3] = o("i", { class: "mr-1 fa-solid fa-trash-can opacity-80" }, null, -1)),
|
|
109
|
+
v(" " + h(((p = t.language) == null ? void 0 : p.remove) ?? "Remove"), 1)
|
|
110
|
+
])
|
|
111
|
+
])) : d("", !0)
|
|
112
|
+
])
|
|
113
|
+
], 512), [
|
|
114
|
+
[M, s.value]
|
|
115
|
+
])
|
|
116
|
+
])), [
|
|
117
|
+
[C, w]
|
|
118
|
+
]) : d("", !0)
|
|
119
|
+
], 64);
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
export {
|
|
124
|
+
I as default
|
|
125
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { createElementBlock as r, openBlock as l, createCommentVNode as s, Fragment as u, renderList as c, createElementVNode as e, createTextVNode as a } from "vue";
|
|
2
|
+
import { _ as h } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const f = {
|
|
4
|
+
props: ["field", "row"],
|
|
5
|
+
computed: {
|
|
6
|
+
isArray() {
|
|
7
|
+
return Array.isArray(this.row);
|
|
8
|
+
},
|
|
9
|
+
isObject() {
|
|
10
|
+
return typeof this.row == "object";
|
|
11
|
+
},
|
|
12
|
+
isString() {
|
|
13
|
+
return typeof this.row == "string";
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
mounted() {
|
|
17
|
+
}
|
|
18
|
+
}, g = ["href", "title"], b = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "m-1 d-inline-block"
|
|
21
|
+
}, v = ["href", "title"];
|
|
22
|
+
function w(m, t, o, x, p, n) {
|
|
23
|
+
return l(), r("div", null, [
|
|
24
|
+
n.isArray ? (l(!0), r(u, { key: 0 }, c(o.row, (i, d) => (l(), r("div", {
|
|
25
|
+
key: d,
|
|
26
|
+
class: "m-1 d-inline-block"
|
|
27
|
+
}, [
|
|
28
|
+
e("a", {
|
|
29
|
+
href: i,
|
|
30
|
+
title: i,
|
|
31
|
+
target: "_blank",
|
|
32
|
+
class: "inline-flex items-center px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-hidden focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
|
|
33
|
+
}, t[0] || (t[0] = [
|
|
34
|
+
e("svg", {
|
|
35
|
+
class: "w-3 h-3 text-white me-2",
|
|
36
|
+
"aria-hidden": "true",
|
|
37
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
38
|
+
fill: "currentColor",
|
|
39
|
+
viewBox: "0 0 24 24"
|
|
40
|
+
}, [
|
|
41
|
+
e("path", {
|
|
42
|
+
"fill-rule": "evenodd",
|
|
43
|
+
d: "M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z",
|
|
44
|
+
"clip-rule": "evenodd"
|
|
45
|
+
}),
|
|
46
|
+
e("path", {
|
|
47
|
+
"fill-rule": "evenodd",
|
|
48
|
+
d: "M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z",
|
|
49
|
+
"clip-rule": "evenodd"
|
|
50
|
+
})
|
|
51
|
+
], -1),
|
|
52
|
+
a(" Download ")
|
|
53
|
+
]), 8, g)
|
|
54
|
+
]))), 128)) : n.isString ? (l(), r("div", b, [
|
|
55
|
+
e("a", {
|
|
56
|
+
href: o.row,
|
|
57
|
+
title: o.row,
|
|
58
|
+
target: "_blank",
|
|
59
|
+
class: "inline-flex items-center px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-hidden focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
|
|
60
|
+
}, t[1] || (t[1] = [
|
|
61
|
+
e("svg", {
|
|
62
|
+
class: "w-3 h-3 text-white me-2",
|
|
63
|
+
"aria-hidden": "true",
|
|
64
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
65
|
+
fill: "currentColor",
|
|
66
|
+
viewBox: "0 0 24 24"
|
|
67
|
+
}, [
|
|
68
|
+
e("path", {
|
|
69
|
+
"fill-rule": "evenodd",
|
|
70
|
+
d: "M13 11.15V4a1 1 0 1 0-2 0v7.15L8.78 8.374a1 1 0 1 0-1.56 1.25l4 5a1 1 0 0 0 1.56 0l4-5a1 1 0 1 0-1.56-1.25L13 11.15Z",
|
|
71
|
+
"clip-rule": "evenodd"
|
|
72
|
+
}),
|
|
73
|
+
e("path", {
|
|
74
|
+
"fill-rule": "evenodd",
|
|
75
|
+
d: "M9.657 15.874 7.358 13H5a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2.358l-2.3 2.874a3 3 0 0 1-4.685 0ZM17 16a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H17Z",
|
|
76
|
+
"clip-rule": "evenodd"
|
|
77
|
+
})
|
|
78
|
+
], -1),
|
|
79
|
+
a(" Download ")
|
|
80
|
+
]), 8, v)
|
|
81
|
+
])) : s("", !0)
|
|
82
|
+
]);
|
|
83
|
+
}
|
|
84
|
+
const y = /* @__PURE__ */ h(f, [["render", w]]);
|
|
85
|
+
export {
|
|
86
|
+
y as default
|
|
87
|
+
};
|