golden-logic-ui 1.3.32 → 1.3.34
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 +32 -32
- package/dist/components/GeneralComponents/DataTable/DatatableDate.vue.js +8 -8
- package/dist/components/GeneralComponents/DataTable/DatatableDeleteAction.vue.js +42 -37
- package/dist/components/GeneralComponents/DataTable/DatatableStatus.vue.js +22 -16
- package/dist/components/GeneralComponents/DataTable/GLDataTable.vue.js +84 -83
- package/dist/components/GeneralComponents/DataTable/GLDataTableServerSide.vue.js +8 -5
- package/dist/components/GeneralComponents/DataTable/GlDataTableComponent.vue.js +93 -92
- package/dist/components/GeneralComponents/DataTable/GlDataTableServerSideGroupBy.vue.js +16 -15
- package/dist/components/GeneralComponents/FilesUpload.vue.js +114 -109
- package/dist/components/GeneralComponents/GlDropdown.vue.js +85 -77
- package/dist/components/GeneralComponents/GlMultiSelectDropdown.vue.js +9 -8
- package/dist/golden-logic-ui.css +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { resolveComponent as b, createElementBlock as f, createCommentVNode as u, openBlock as _, createElementVNode as t, toDisplayString as
|
|
1
|
+
import { resolveComponent as b, createElementBlock as f, createCommentVNode as u, openBlock as _, createElementVNode as t, toDisplayString as l, renderSlot as y, withDirectives as h, createTextVNode as c, withKeys as v, withModifiers as k, vModelText as w, createVNode as x, withCtx as g, ref as r, watch as C } from "vue";
|
|
2
2
|
import I from "./GLButton.vue.js";
|
|
3
|
-
import { useGlFocusTrap as T, nextGlId as
|
|
3
|
+
import { useGlFocusTrap as T, nextGlId as p } from "./useGlFocusTrap.js";
|
|
4
4
|
import A from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
5
|
const B = {
|
|
6
6
|
components: {
|
|
@@ -26,21 +26,21 @@ const B = {
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
emits: ["confirm-action", "cancel-action"],
|
|
29
|
-
setup(
|
|
30
|
-
const
|
|
31
|
-
return C(() =>
|
|
32
|
-
|
|
33
|
-
}), T(
|
|
34
|
-
closeOnEscape: () =>
|
|
35
|
-
onEscape: () =>
|
|
29
|
+
setup(a, { emit: n }) {
|
|
30
|
+
const e = r(null), o = r(null), d = r(null), i = r("");
|
|
31
|
+
return C(() => a.isOpen, (s) => {
|
|
32
|
+
s && (i.value = "");
|
|
33
|
+
}), T(e, () => !!a.isOpen, {
|
|
34
|
+
closeOnEscape: () => a.close_on_escape,
|
|
35
|
+
onEscape: () => n("cancel-action"),
|
|
36
36
|
initialFocus: () => o.value || d.value?.$el || null
|
|
37
37
|
}), {
|
|
38
|
-
panel:
|
|
38
|
+
panel: e,
|
|
39
39
|
confirmInput: o,
|
|
40
40
|
cancelButton: d,
|
|
41
41
|
typedText: i,
|
|
42
|
-
titleId:
|
|
43
|
-
inputId:
|
|
42
|
+
titleId: p("gl-confirmation-title"),
|
|
43
|
+
inputId: p("gl-confirmation-input")
|
|
44
44
|
};
|
|
45
45
|
},
|
|
46
46
|
computed: {
|
|
@@ -64,9 +64,9 @@ const B = {
|
|
|
64
64
|
key: 0,
|
|
65
65
|
class: "mt-4 text-left"
|
|
66
66
|
}, F = ["for"], K = { class: "px-1 py-0.5 font-mono text-red-600 bg-gray-100 rounded-sm dark:bg-gray-900 dark:text-red-300" }, z = ["id"], U = { class: "border-t border-gray-200 rounded-b dark:border-gray-600 px-4 py-3 sm:px-6 flex gap-2" };
|
|
67
|
-
function q(
|
|
68
|
-
const
|
|
69
|
-
return
|
|
67
|
+
function q(a, n, e, o, d, i) {
|
|
68
|
+
const s = b("gl-button");
|
|
69
|
+
return e.isOpen ? (_(), f("div", {
|
|
70
70
|
key: 0,
|
|
71
71
|
class: "fixed inset-0 z-99999 overflow-y-auto",
|
|
72
72
|
role: "dialog",
|
|
@@ -74,11 +74,11 @@ function q(l, e, n, o, d, i) {
|
|
|
74
74
|
"aria-labelledby": o.titleId
|
|
75
75
|
}, [
|
|
76
76
|
t("div", V, [
|
|
77
|
-
|
|
77
|
+
n[2] || (n[2] = t("div", {
|
|
78
78
|
class: "fixed inset-0 transition-opacity bg-gray-500/75",
|
|
79
79
|
"aria-hidden": "true"
|
|
80
80
|
}, null, -1)),
|
|
81
|
-
|
|
81
|
+
n[3] || (n[3] = t("span", {
|
|
82
82
|
class: "hidden sm:inline-block sm:align-middle sm:h-screen",
|
|
83
83
|
"aria-hidden": "true"
|
|
84
84
|
}, "", -1)),
|
|
@@ -89,28 +89,28 @@ function q(l, e, n, o, d, i) {
|
|
|
89
89
|
t("h3", {
|
|
90
90
|
id: o.titleId,
|
|
91
91
|
class: "text-lg font-medium leading-6"
|
|
92
|
-
},
|
|
92
|
+
}, l(e.title), 9, S),
|
|
93
93
|
t("div", j, [
|
|
94
|
-
y(
|
|
94
|
+
y(a.$slots, "default")
|
|
95
95
|
]),
|
|
96
|
-
|
|
96
|
+
e.confirm_text ? (_(), f("div", D, [
|
|
97
97
|
t("label", {
|
|
98
98
|
for: o.inputId,
|
|
99
99
|
class: "block mb-1 text-xs font-medium text-gray-600 dark:text-gray-300"
|
|
100
100
|
}, [
|
|
101
|
-
|
|
102
|
-
t("code", K,
|
|
103
|
-
|
|
101
|
+
c(l(e.language?.type_to_confirm ?? "Type") + " ", 1),
|
|
102
|
+
t("code", K, l(e.confirm_text), 1),
|
|
103
|
+
c(" " + l(e.language?.to_confirm ?? "to confirm"), 1)
|
|
104
104
|
], 8, F),
|
|
105
105
|
h(t("input", {
|
|
106
106
|
id: o.inputId,
|
|
107
107
|
ref: "confirmInput",
|
|
108
|
-
"onUpdate:modelValue":
|
|
108
|
+
"onUpdate:modelValue": n[0] || (n[0] = (m) => o.typedText = m),
|
|
109
109
|
type: "text",
|
|
110
110
|
autocomplete: "off",
|
|
111
111
|
spellcheck: "false",
|
|
112
112
|
class: "gl-input-form",
|
|
113
|
-
onKeydown:
|
|
113
|
+
onKeydown: n[1] || (n[1] = v(k((...m) => i.confirmAction && i.confirmAction(...m), ["prevent"]), ["enter"]))
|
|
114
114
|
}, null, 40, z), [
|
|
115
115
|
[w, o.typedText]
|
|
116
116
|
])
|
|
@@ -119,26 +119,26 @@ function q(l, e, n, o, d, i) {
|
|
|
119
119
|
])
|
|
120
120
|
]),
|
|
121
121
|
t("div", U, [
|
|
122
|
-
x(
|
|
122
|
+
x(s, {
|
|
123
123
|
onClick: i.confirmAction,
|
|
124
124
|
tag: "button",
|
|
125
125
|
button_type: "red",
|
|
126
126
|
is_disabled: !i.canConfirm
|
|
127
127
|
}, {
|
|
128
|
-
default:
|
|
129
|
-
|
|
128
|
+
default: g(() => [
|
|
129
|
+
c(l(e.button_text), 1)
|
|
130
130
|
]),
|
|
131
131
|
_: 1
|
|
132
132
|
}, 8, ["onClick", "is_disabled"]),
|
|
133
|
-
x(
|
|
133
|
+
x(s, {
|
|
134
134
|
ref: "cancelButton",
|
|
135
135
|
onClick: i.cancelAction,
|
|
136
136
|
tag: "button",
|
|
137
137
|
button_type: "light"
|
|
138
138
|
}, {
|
|
139
|
-
default:
|
|
140
|
-
|
|
141
|
-
])
|
|
139
|
+
default: g(() => [
|
|
140
|
+
c(l(e.language?.cancel ?? "Cancel"), 1)
|
|
141
|
+
]),
|
|
142
142
|
_: 1
|
|
143
143
|
}, 8, ["onClick"])
|
|
144
144
|
])
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { createElementBlock as s, openBlock as c, toDisplayString as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { createElementBlock as s, openBlock as c, toDisplayString as d } from "vue";
|
|
2
|
+
import i from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
const l = {
|
|
4
4
|
props: ["field", "row", "tdProps"],
|
|
5
5
|
computed: {
|
|
6
6
|
formattedDate() {
|
|
7
7
|
if (!this.row[this.field])
|
|
8
8
|
return "";
|
|
9
|
-
const t = new Date(this.row[this.field]), e = t.getFullYear(), o = t.toLocaleString("default", { month: "long" }), r = t.getDate();
|
|
9
|
+
const t = new Date(this.row[this.field]), e = t.getFullYear(), o = t.toLocaleString(document.documentElement.lang || "default", { month: "long" }), r = t.getDate();
|
|
10
10
|
return `${o} ${r}, ${e}`;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
},
|
|
14
|
-
function
|
|
15
|
-
return c(), s("div",
|
|
13
|
+
}, m = { class: "w-full" };
|
|
14
|
+
function f(t, e, o, r, a, n) {
|
|
15
|
+
return c(), s("div", m, d(n.formattedDate), 1);
|
|
16
16
|
}
|
|
17
|
-
const _ = /* @__PURE__ */
|
|
17
|
+
const _ = /* @__PURE__ */ i(l, [["render", f]]);
|
|
18
18
|
export {
|
|
19
19
|
_ as default
|
|
20
20
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { useGlFloatingMenu as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { ref as C, resolveDirective as M, createElementBlock as i, openBlock as d, Fragment as O, createVNode as _, withDirectives as g, createCommentVNode as m, createElementVNode as e, unref as r, normalizeStyle as j, withModifiers as A, createTextVNode as S, toDisplayString as B, vShow as N } from "vue";
|
|
2
|
+
import { useGlFloatingMenu as V } from "./useGlFloatingMenu.js";
|
|
3
|
+
import $ from "../DeleteConfirmationModal.vue.js";
|
|
4
|
+
import f from "../../../Stores/toast.js";
|
|
5
|
+
const T = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "flex lg:justify-center"
|
|
8
|
-
},
|
|
8
|
+
}, Z = {
|
|
9
9
|
class: "py-2 text-sm text-gray-700 dark:text-gray-200",
|
|
10
10
|
"aria-labelledby": "dropdownDividerButton"
|
|
11
|
-
},
|
|
11
|
+
}, z = { key: 0 }, P = {
|
|
12
12
|
__name: "DatatableDeleteAction",
|
|
13
13
|
props: {
|
|
14
14
|
field: {
|
|
@@ -30,43 +30,48 @@ const $ = {
|
|
|
30
30
|
tdProps: {
|
|
31
31
|
type: Object,
|
|
32
32
|
default: {}
|
|
33
|
+
},
|
|
34
|
+
language: {
|
|
35
|
+
type: Object,
|
|
36
|
+
default: () => ({})
|
|
33
37
|
}
|
|
34
38
|
},
|
|
35
39
|
emits: ["deleteAction"],
|
|
36
|
-
setup(
|
|
37
|
-
const a =
|
|
40
|
+
setup(t, { emit: p }) {
|
|
41
|
+
const a = t, { open: y, menu: v, style: h, toggle: c, close: u } = V(), s = C(!1), n = () => {
|
|
38
42
|
s.value = !1;
|
|
39
43
|
}, w = () => {
|
|
40
44
|
u(), s.value = !0;
|
|
41
|
-
}, x =
|
|
45
|
+
}, x = p, b = () => {
|
|
42
46
|
axios.delete(`${a.xprops.route}/${a.row.id}`).then(() => {
|
|
43
|
-
|
|
44
|
-
message: "Item deleted successfully.",
|
|
47
|
+
n(), x("deleteAction"), f.methods.add({
|
|
48
|
+
message: a.language?.item_deleted_successfully ?? "Item deleted successfully.",
|
|
45
49
|
type: "success",
|
|
46
50
|
duration: 5e3
|
|
47
51
|
});
|
|
48
52
|
}).catch((l) => {
|
|
49
|
-
|
|
53
|
+
n(), f.methods.add({
|
|
50
54
|
message: l.response?.data?.message ?? a.language?.delete_failed ?? "That item could not be deleted.",
|
|
51
55
|
type: "error",
|
|
52
56
|
duration: 5e3
|
|
53
57
|
});
|
|
54
58
|
});
|
|
55
59
|
};
|
|
56
|
-
return (l,
|
|
57
|
-
const
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
+
return (l, o) => {
|
|
61
|
+
const k = M("click-outside");
|
|
62
|
+
return d(), i(O, null, [
|
|
63
|
+
_($, {
|
|
64
|
+
language: t.language,
|
|
60
65
|
isOpen: s.value,
|
|
61
|
-
onConfirmDelete:
|
|
62
|
-
onCancelDelete:
|
|
63
|
-
}, null, 8, ["isOpen"]),
|
|
64
|
-
|
|
66
|
+
onConfirmDelete: b,
|
|
67
|
+
onCancelDelete: n
|
|
68
|
+
}, null, 8, ["language", "isOpen"]),
|
|
69
|
+
t.row && l.can(`delete_${t.xprops.permission}`) ? g((d(), i("div", T, [
|
|
65
70
|
e("button", {
|
|
66
|
-
onClick:
|
|
71
|
+
onClick: o[0] || (o[0] = (...D) => r(c) && r(c)(...D)),
|
|
67
72
|
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",
|
|
68
73
|
type: "button"
|
|
69
|
-
},
|
|
74
|
+
}, o[1] || (o[1] = [
|
|
70
75
|
e("svg", {
|
|
71
76
|
class: "w-5 h-5",
|
|
72
77
|
"aria-hidden": "true",
|
|
@@ -77,34 +82,34 @@ const $ = {
|
|
|
77
82
|
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" })
|
|
78
83
|
], -1)
|
|
79
84
|
])),
|
|
80
|
-
|
|
85
|
+
g(e("div", {
|
|
81
86
|
ref_key: "menu",
|
|
82
87
|
ref: v,
|
|
83
|
-
style:
|
|
88
|
+
style: j(r(h)),
|
|
84
89
|
class: "fixed z-50 bg-white divide-y divide-gray-100 rounded-lg shadow-sm w-44 dark:bg-gray-700 dark:divide-gray-600"
|
|
85
90
|
}, [
|
|
86
|
-
e("ul",
|
|
87
|
-
l.can(`delete_${
|
|
91
|
+
e("ul", Z, [
|
|
92
|
+
l.can(`delete_${t.xprops.permission}`) ? (d(), i("li", z, [
|
|
88
93
|
e("a", {
|
|
89
94
|
href: "#",
|
|
90
|
-
onClick:
|
|
95
|
+
onClick: A(w, ["prevent"]),
|
|
91
96
|
class: "block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
|
|
92
|
-
},
|
|
93
|
-
e("i", { class: "mr-2 fa-solid fa-trash-can opacity-80" }, null, -1),
|
|
94
|
-
B("
|
|
95
|
-
])
|
|
96
|
-
])) :
|
|
97
|
+
}, [
|
|
98
|
+
o[2] || (o[2] = e("i", { class: "mr-2 fa-solid fa-trash-can opacity-80" }, null, -1)),
|
|
99
|
+
S(" " + B(t.language?.remove ?? "Remove"), 1)
|
|
100
|
+
])
|
|
101
|
+
])) : m("", !0)
|
|
97
102
|
])
|
|
98
103
|
], 4), [
|
|
99
|
-
[N,
|
|
104
|
+
[N, r(y)]
|
|
100
105
|
])
|
|
101
106
|
])), [
|
|
102
|
-
[
|
|
103
|
-
]) :
|
|
107
|
+
[k, r(u)]
|
|
108
|
+
]) : m("", !0)
|
|
104
109
|
], 64);
|
|
105
110
|
};
|
|
106
111
|
}
|
|
107
112
|
};
|
|
108
113
|
export {
|
|
109
|
-
|
|
114
|
+
P as default
|
|
110
115
|
};
|
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
import { createElementBlock as t, openBlock as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
props:
|
|
1
|
+
import { createElementBlock as t, openBlock as n, createCommentVNode as i, createElementVNode as s, createTextVNode as a, toDisplayString as d } from "vue";
|
|
2
|
+
import o from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
const u = {
|
|
4
|
+
props: {
|
|
5
|
+
field: null,
|
|
6
|
+
row: null,
|
|
7
|
+
tdProps: null,
|
|
8
|
+
// Texts in the table's language; without it the badges read Active / Inactive.
|
|
9
|
+
language: { type: Object, default: () => ({}) }
|
|
10
|
+
},
|
|
5
11
|
computed: {
|
|
6
12
|
isActive() {
|
|
7
13
|
return this.row[this.field] === 1;
|
|
8
14
|
}
|
|
9
15
|
}
|
|
10
|
-
},
|
|
16
|
+
}, c = { class: "flex flex-wrap gap-2 text-nowrap" }, f = {
|
|
11
17
|
key: 0,
|
|
12
18
|
class: "inline-flex items-center px-2 py-1 text-xs font-medium text-green-800 bg-green-100 rounded-full dark:bg-green-900 dark:text-green-300"
|
|
13
19
|
}, p = {
|
|
14
20
|
key: 1,
|
|
15
21
|
class: "inline-flex items-center px-2 py-1 bg-red-100 text-red-800 text-xs font-medium rounded-full dark:bg-red-900 dark:text-red-300"
|
|
16
22
|
};
|
|
17
|
-
function
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
s("span", { class: "w-2 h-2 bg-green-500 rounded-full me-1" }, null, -1),
|
|
21
|
-
|
|
22
|
-
]))
|
|
23
|
-
s("span", { class: "w-2 h-2 bg-red-500 rounded-full me-1" }, null, -1),
|
|
24
|
-
|
|
25
|
-
]))
|
|
23
|
+
function g(x, e, r, m, _, l) {
|
|
24
|
+
return n(), t("div", c, [
|
|
25
|
+
l.isActive ? (n(), t("span", f, [
|
|
26
|
+
e[0] || (e[0] = s("span", { class: "w-2 h-2 bg-green-500 rounded-full me-1" }, null, -1)),
|
|
27
|
+
a(" " + d(r.language?.active ?? "Active"), 1)
|
|
28
|
+
])) : l.isActive ? i("", !0) : (n(), t("span", p, [
|
|
29
|
+
e[1] || (e[1] = s("span", { class: "w-2 h-2 bg-red-500 rounded-full me-1" }, null, -1)),
|
|
30
|
+
a(" " + d(r.language?.inactive ?? "Inactive"), 1)
|
|
31
|
+
]))
|
|
26
32
|
]);
|
|
27
33
|
}
|
|
28
|
-
const
|
|
34
|
+
const v = /* @__PURE__ */ o(u, [["render", g]]);
|
|
29
35
|
export {
|
|
30
|
-
|
|
36
|
+
v as default
|
|
31
37
|
};
|