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.
@@ -1,6 +1,6 @@
1
- import { resolveComponent as b, createElementBlock as f, createCommentVNode as u, openBlock as _, createElementVNode as t, toDisplayString as s, renderSlot as y, withDirectives as h, createTextVNode as r, withKeys as v, withModifiers as k, vModelText as w, createVNode as x, withCtx as p, ref as c, watch as C } from "vue";
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 g } from "./useGlFocusTrap.js";
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(l, { emit: e }) {
30
- const n = c(null), o = c(null), d = c(null), i = c("");
31
- return C(() => l.isOpen, (a) => {
32
- a && (i.value = "");
33
- }), T(n, () => !!l.isOpen, {
34
- closeOnEscape: () => l.close_on_escape,
35
- onEscape: () => e("cancel-action"),
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: n,
38
+ panel: e,
39
39
  confirmInput: o,
40
40
  cancelButton: d,
41
41
  typedText: i,
42
- titleId: g("gl-confirmation-title"),
43
- inputId: g("gl-confirmation-input")
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(l, e, n, o, d, i) {
68
- const a = b("gl-button");
69
- return n.isOpen ? (_(), f("div", {
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
- e[3] || (e[3] = t("div", {
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
- e[4] || (e[4] = t("span", {
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
- }, s(n.title), 9, S),
92
+ }, l(e.title), 9, S),
93
93
  t("div", j, [
94
- y(l.$slots, "default")
94
+ y(a.$slots, "default")
95
95
  ]),
96
- n.confirm_text ? (_(), f("div", D, [
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
- r(s(n.language?.type_to_confirm ?? "Type") + " ", 1),
102
- t("code", K, s(n.confirm_text), 1),
103
- r(" " + s(n.language?.to_confirm ?? "to confirm"), 1)
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": e[0] || (e[0] = (m) => o.typedText = m),
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: e[1] || (e[1] = v(k((...m) => i.confirmAction && i.confirmAction(...m), ["prevent"]), ["enter"]))
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(a, {
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: p(() => [
129
- r(s(n.button_text), 1)
128
+ default: g(() => [
129
+ c(l(e.button_text), 1)
130
130
  ]),
131
131
  _: 1
132
132
  }, 8, ["onClick", "is_disabled"]),
133
- x(a, {
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: p(() => e[2] || (e[2] = [
140
- r(" Cancel ")
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 i } from "vue";
2
- import d from "../../../_virtual/_plugin-vue_export-helper.js";
3
- const f = {
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
- }, l = { class: "w-full" };
14
- function m(t, e, o, r, a, n) {
15
- return c(), s("div", l, i(n.formattedDate), 1);
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__ */ d(f, [["render", m]]);
17
+ const _ = /* @__PURE__ */ i(l, [["render", f]]);
18
18
  export {
19
19
  _ as default
20
20
  };
@@ -1,14 +1,14 @@
1
- import { ref as _, resolveDirective as C, createElementBlock as d, openBlock as n, Fragment as M, createVNode as A, withDirectives as m, createCommentVNode as g, createElementVNode as e, unref as o, normalizeStyle as O, withModifiers as j, createTextVNode as B, vShow as N } from "vue";
2
- import { useGlFloatingMenu as S } from "./useGlFloatingMenu.js";
3
- import V from "../DeleteConfirmationModal.vue.js";
4
- import p from "../../../Stores/toast.js";
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
- }, T = {
8
+ }, Z = {
9
9
  class: "py-2 text-sm text-gray-700 dark:text-gray-200",
10
10
  "aria-labelledby": "dropdownDividerButton"
11
- }, Z = { key: 0 }, I = {
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(r, { emit: f }) {
37
- const a = r, { open: y, menu: v, style: h, toggle: c, close: u } = S(), s = _(!1), i = () => {
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 = f, k = () => {
45
+ }, x = p, b = () => {
42
46
  axios.delete(`${a.xprops.route}/${a.row.id}`).then(() => {
43
- i(), x("deleteAction"), p.methods.add({
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
- i(), p.methods.add({
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, t) => {
57
- const b = C("click-outside");
58
- return n(), d(M, null, [
59
- A(V, {
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: k,
62
- onCancelDelete: i
63
- }, null, 8, ["isOpen"]),
64
- r.row && l.can(`delete_${r.xprops.permission}`) ? m((n(), d("div", $, [
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: t[0] || (t[0] = (...D) => o(c) && o(c)(...D)),
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
- }, t[1] || (t[1] = [
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
- m(e("div", {
85
+ g(e("div", {
81
86
  ref_key: "menu",
82
87
  ref: v,
83
- style: O(o(h)),
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", T, [
87
- l.can(`delete_${r.xprops.permission}`) ? (n(), d("li", Z, [
91
+ e("ul", Z, [
92
+ l.can(`delete_${t.xprops.permission}`) ? (d(), i("li", z, [
88
93
  e("a", {
89
94
  href: "#",
90
- onClick: j(w, ["prevent"]),
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
- }, t[2] || (t[2] = [
93
- e("i", { class: "mr-2 fa-solid fa-trash-can opacity-80" }, null, -1),
94
- B(" Remove")
95
- ]))
96
- ])) : g("", !0)
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, o(y)]
104
+ [N, r(y)]
100
105
  ])
101
106
  ])), [
102
- [b, o(u)]
103
- ]) : g("", !0)
107
+ [k, r(u)]
108
+ ]) : m("", !0)
104
109
  ], 64);
105
110
  };
106
111
  }
107
112
  };
108
113
  export {
109
- I as default
114
+ P as default
110
115
  };
@@ -1,31 +1,37 @@
1
- import { createElementBlock as t, openBlock as r, createCommentVNode as o, createElementVNode as s, createTextVNode as d } from "vue";
2
- import l from "../../../_virtual/_plugin-vue_export-helper.js";
3
- const a = {
4
- props: ["field", "row", "tdProps"],
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
- }, i = { class: "flex flex-wrap gap-2 text-nowrap" }, c = {
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 u(f, e, x, m, g, n) {
18
- return r(), t("div", i, [
19
- n.isActive ? (r(), t("span", c, e[0] || (e[0] = [
20
- s("span", { class: "w-2 h-2 bg-green-500 rounded-full me-1" }, null, -1),
21
- d(" Active ")
22
- ]))) : n.isActive ? o("", !0) : (r(), t("span", p, e[1] || (e[1] = [
23
- s("span", { class: "w-2 h-2 bg-red-500 rounded-full me-1" }, null, -1),
24
- d(" Inactive ")
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 b = /* @__PURE__ */ l(a, [["render", u]]);
34
+ const v = /* @__PURE__ */ o(u, [["render", g]]);
29
35
  export {
30
- b as default
36
+ v as default
31
37
  };