golden-logic-ui 1.3.26 → 1.3.27

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,13 +1,14 @@
1
- import { ref as u, resolveDirective as w, createElementBlock as l, openBlock as s, Fragment as k, createVNode as D, withDirectives as g, createCommentVNode as n, createElementVNode as e, createTextVNode as p, withModifiers as C, vShow as $ } from "vue";
2
- import A from "../DeleteConfirmationModal.vue.js";
3
- import M from "../../../Stores/toast.js";
4
- const O = {
1
+ import { ref as C, resolveDirective as M, createElementBlock as s, openBlock as i, Fragment as $, createVNode as A, withDirectives as m, createCommentVNode as n, createElementVNode as e, unref as l, normalizeStyle as O, createTextVNode as p, withModifiers as j, vShow as B } from "vue";
2
+ import { useGlFloatingMenu as N } from "./useGlFloatingMenu.js";
3
+ import S from "../DeleteConfirmationModal.vue.js";
4
+ import V from "../../../Stores/toast.js";
5
+ const E = {
5
6
  key: 0,
6
7
  class: "flex lg:justify-center"
7
- }, _ = { class: "xs:right-[unset] ltr:lg:right-[30px] rtl:lg:left-[30px] absolute z-10 mt-11 origin-top-right bg-white rounded-lg w-44 dark:bg-gray-800 shadow-lg border dark:border-gray-700" }, j = {
8
+ }, Z = {
8
9
  class: "py-2 text-sm text-gray-700 dark:text-gray-200",
9
10
  "aria-labelledby": "dropdownDividerButton"
10
- }, B = { key: 0 }, N = ["href"], V = { key: 1 }, T = {
11
+ }, z = { key: 0 }, F = ["href"], G = { key: 1 }, R = {
11
12
  __name: "DatatableAction",
12
13
  props: {
13
14
  field: {
@@ -32,18 +33,14 @@ const O = {
32
33
  }
33
34
  },
34
35
  emits: ["deleteAction"],
35
- setup(t, { emit: m }) {
36
- const d = t, i = u(!1), a = u(!1), f = () => {
37
- i.value = !1;
38
- }, h = () => {
39
- i.value = !0;
40
- }, c = () => {
36
+ setup(t, { emit: f }) {
37
+ const d = t, { open: y, menu: h, style: v, toggle: c, close: u } = N(), a = C(!1), g = () => {
41
38
  a.value = !1;
42
- }, y = () => {
43
- a.value = !0;
44
- }, v = m, x = () => {
39
+ }, x = () => {
40
+ u(), a.value = !0;
41
+ }, k = f, b = () => {
45
42
  axios.delete(`${d.xprops.route}/${d.row.id}`).then(() => {
46
- c(), v("deleteAction"), M.methods.add({
43
+ g(), k("deleteAction"), V.methods.add({
47
44
  message: "Item deleted successfully.",
48
45
  type: "success",
49
46
  duration: 5e3
@@ -53,19 +50,19 @@ const O = {
53
50
  });
54
51
  };
55
52
  return (r, o) => {
56
- const b = w("click-outside");
57
- return s(), l(k, null, [
58
- D(A, {
53
+ const w = M("click-outside");
54
+ return i(), s($, null, [
55
+ A(S, {
59
56
  isOpen: a.value,
60
- onConfirmDelete: x,
61
- onCancelDelete: c
57
+ onConfirmDelete: b,
58
+ onCancelDelete: g
62
59
  }, null, 8, ["isOpen"]),
63
- t.row && r.can(`edit_${t.xprops.permission} || delete_${t.xprops.permission}`) ? g((s(), l("div", O, [
60
+ t.row && r.can(`edit_${t.xprops.permission} || delete_${t.xprops.permission}`) ? m((i(), s("div", E, [
64
61
  e("button", {
65
- onClick: h,
62
+ onClick: o[0] || (o[0] = (...D) => l(c) && l(c)(...D)),
66
63
  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
64
  type: "button"
68
- }, o[0] || (o[0] = [
65
+ }, o[1] || (o[1] = [
69
66
  e("svg", {
70
67
  class: "w-5 h-5",
71
68
  "aria-hidden": "true",
@@ -76,38 +73,43 @@ const O = {
76
73
  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
74
  ], -1)
78
75
  ])),
79
- g(e("div", _, [
80
- e("ul", j, [
81
- r.can(`edit_${t.xprops.permission}`) ? (s(), l("li", B, [
76
+ m(e("div", {
77
+ ref_key: "menu",
78
+ ref: h,
79
+ style: O(l(v)),
80
+ class: "fixed z-50 bg-white rounded-lg w-44 dark:bg-gray-800 shadow-lg border dark:border-gray-700"
81
+ }, [
82
+ e("ul", Z, [
83
+ r.can(`edit_${t.xprops.permission}`) ? (i(), s("li", z, [
82
84
  e("a", {
83
85
  href: t.xprops.route + "/" + t.row.id + "/edit",
84
86
  class: "block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
85
- }, o[1] || (o[1] = [
87
+ }, o[2] || (o[2] = [
86
88
  e("i", { class: "mr-2 fa-solid fa-list-ul opacity-80" }, null, -1),
87
89
  p(" Edit")
88
- ]), 8, N)
90
+ ]), 8, F)
89
91
  ])) : n("", !0),
90
- r.can(`delete_${t.xprops.permission}`) ? (s(), l("li", V, [
92
+ r.can(`delete_${t.xprops.permission}`) ? (i(), s("li", G, [
91
93
  e("a", {
92
94
  href: "#",
93
- onClick: C(y, ["prevent"]),
95
+ onClick: j(x, ["prevent"]),
94
96
  class: "block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
95
- }, o[2] || (o[2] = [
97
+ }, o[3] || (o[3] = [
96
98
  e("i", { class: "mr-2 fa-solid fa-trash-can opacity-80" }, null, -1),
97
99
  p(" Remove")
98
100
  ]))
99
101
  ])) : n("", !0)
100
102
  ])
101
- ], 512), [
102
- [$, i.value]
103
+ ], 4), [
104
+ [B, l(y)]
103
105
  ])
104
106
  ])), [
105
- [b, f]
107
+ [w, l(u)]
106
108
  ]) : n("", !0)
107
109
  ], 64);
108
110
  };
109
111
  }
110
112
  };
111
113
  export {
112
- T as default
114
+ R as default
113
115
  };
@@ -0,0 +1,99 @@
1
+ import { getCurrentInstance as B, computed as S, resolveDirective as z, withDirectives as b, createCommentVNode as u, createElementBlock as i, openBlock as s, createElementVNode as a, unref as n, normalizeStyle as M, Fragment as N, renderList as O, normalizeClass as d, createTextVNode as x, toDisplayString as k, vShow as V } from "vue";
2
+ import { useGlFloatingMenu as Z } from "./useGlFloatingMenu.js";
3
+ const E = {
4
+ key: 0,
5
+ class: "flex lg:justify-center"
6
+ }, F = ["aria-label", "aria-expanded"], G = ["href", "target"], I = ["disabled", "onClick"], $ = {
7
+ __name: "DatatableActionsMenu",
8
+ props: {
9
+ field: { type: String, default: "" },
10
+ row: { type: [Array, Object], default: () => ({}) },
11
+ xprops: { type: Object, default: () => ({}) },
12
+ tdProps: { type: Object, default: () => ({}) }
13
+ },
14
+ emits: ["cellAction"],
15
+ setup(c, { emit: v }) {
16
+ const o = c, C = v, { open: p, menu: A, style: _, toggle: g, close: l } = Z(), y = B()?.proxy, P = (t) => !t || typeof y?.can != "function" || y.can(t), m = S(() => (typeof o.tdProps?.actions == "function" ? o.tdProps.actions(o.row) : o.tdProps?.actions || []).filter((r) => P(r.permission) && (!r.show || r.show(o.row)))), f = (t) => t.disabled ? !!t.disabled(o.row) : !1, h = (t) => t.danger ? "text-red-600 hover:text-white hover:bg-red-600 dark:text-red-500 dark:hover:text-white dark:hover:bg-red-600" : "hover:bg-gray-100 dark:hover:bg-gray-700 dark:hover:text-white", D = (t) => {
17
+ if (l(), f(t))
18
+ return;
19
+ const r = o.tdProps?.onAction || o.xprops?.onAction;
20
+ if (r) {
21
+ r(t.key, o.row);
22
+ return;
23
+ }
24
+ C("cellAction", t.key);
25
+ };
26
+ return (t, r) => {
27
+ const j = z("click-outside");
28
+ return m.value.length ? b((s(), i("div", E, [
29
+ a("button", {
30
+ type: "button",
31
+ "aria-label": c.tdProps?.label ?? "Actions",
32
+ "aria-haspopup": "menu",
33
+ "aria-expanded": n(p) ? "true" : "false",
34
+ 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",
35
+ onClick: r[0] || (r[0] = (...e) => n(g) && n(g)(...e))
36
+ }, r[2] || (r[2] = [
37
+ a("svg", {
38
+ class: "w-5 h-5",
39
+ "aria-hidden": "true",
40
+ xmlns: "http://www.w3.org/2000/svg",
41
+ fill: "currentColor",
42
+ viewBox: "0 0 4 15"
43
+ }, [
44
+ a("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" })
45
+ ], -1)
46
+ ]), 8, F),
47
+ b(a("ul", {
48
+ ref_key: "menu",
49
+ ref: A,
50
+ role: "menu",
51
+ style: M(n(_)),
52
+ class: "fixed z-50 py-2 text-sm text-gray-700 bg-white border rounded-lg shadow-lg min-w-44 max-w-xs dark:bg-gray-800 dark:text-gray-200 dark:border-gray-700"
53
+ }, [
54
+ (s(!0), i(N, null, O(m.value, (e) => (s(), i("li", {
55
+ key: e.key,
56
+ role: "none"
57
+ }, [
58
+ e.href ? (s(), i("a", {
59
+ key: 0,
60
+ role: "menuitem",
61
+ href: e.href(c.row),
62
+ target: e.target || void 0,
63
+ class: d(["flex items-center px-4 py-2 whitespace-nowrap", h(e)]),
64
+ onClick: r[1] || (r[1] = (...w) => n(l) && n(l)(...w))
65
+ }, [
66
+ e.icon ? (s(), i("i", {
67
+ key: 0,
68
+ class: d(["w-4 opacity-80 me-2", e.icon]),
69
+ "aria-hidden": "true"
70
+ }, null, 2)) : u("", !0),
71
+ x(" " + k(e.label), 1)
72
+ ], 10, G)) : (s(), i("button", {
73
+ key: 1,
74
+ type: "button",
75
+ role: "menuitem",
76
+ disabled: f(e),
77
+ class: d(["flex items-center w-full px-4 py-2 whitespace-nowrap text-start disabled:opacity-50 disabled:cursor-not-allowed", h(e)]),
78
+ onClick: (w) => D(e)
79
+ }, [
80
+ e.icon ? (s(), i("i", {
81
+ key: 0,
82
+ class: d(["w-4 opacity-80 me-2", e.icon]),
83
+ "aria-hidden": "true"
84
+ }, null, 2)) : u("", !0),
85
+ x(" " + k(e.label), 1)
86
+ ], 10, I))
87
+ ]))), 128))
88
+ ], 4), [
89
+ [V, n(p)]
90
+ ])
91
+ ])), [
92
+ [j, n(l)]
93
+ ]) : u("", !0);
94
+ };
95
+ }
96
+ };
97
+ export {
98
+ $ as default
99
+ };
@@ -1,13 +1,14 @@
1
- import { ref as c, resolveDirective as x, createElementBlock as d, openBlock as n, Fragment as k, createVNode as D, withDirectives as u, createCommentVNode as p, createElementVNode as e, withModifiers as _, createTextVNode as C, vShow as A } from "vue";
2
- import M from "../DeleteConfirmationModal.vue.js";
3
- import g from "../../../Stores/toast.js";
4
- const O = {
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 $ = {
5
6
  key: 0,
6
7
  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
+ }, T = {
8
9
  class: "py-2 text-sm text-gray-700 dark:text-gray-200",
9
10
  "aria-labelledby": "dropdownDividerButton"
10
- }, N = { key: 0 }, T = {
11
+ }, Z = { key: 0 }, I = {
11
12
  __name: "DatatableDeleteAction",
12
13
  props: {
13
14
  field: {
@@ -32,44 +33,40 @@ const O = {
32
33
  }
33
34
  },
34
35
  emits: ["deleteAction"],
35
- setup(t, { emit: m }) {
36
- const a = t, s = c(!1), l = c(!1), f = () => {
36
+ setup(r, { emit: f }) {
37
+ const a = r, { open: y, menu: v, style: h, toggle: c, close: u } = S(), s = _(!1), i = () => {
37
38
  s.value = !1;
38
- }, y = () => {
39
- s.value = !0;
40
- }, i = () => {
41
- l.value = !1;
42
- }, h = () => {
43
- l.value = !0;
44
- }, v = m, w = () => {
39
+ }, w = () => {
40
+ u(), s.value = !0;
41
+ }, x = f, k = () => {
45
42
  axios.delete(`${a.xprops.route}/${a.row.id}`).then(() => {
46
- i(), v("deleteAction"), g.methods.add({
43
+ i(), x("deleteAction"), p.methods.add({
47
44
  message: "Item deleted successfully.",
48
45
  type: "success",
49
46
  duration: 5e3
50
47
  });
51
- }).catch((o) => {
52
- i(), g.methods.add({
53
- message: o.response?.data?.message ?? a.language?.delete_failed ?? "That item could not be deleted.",
48
+ }).catch((l) => {
49
+ i(), p.methods.add({
50
+ message: l.response?.data?.message ?? a.language?.delete_failed ?? "That item could not be deleted.",
54
51
  type: "error",
55
52
  duration: 5e3
56
53
  });
57
54
  });
58
55
  };
59
- return (o, r) => {
60
- const b = x("click-outside");
61
- return n(), d(k, null, [
62
- D(M, {
63
- isOpen: l.value,
64
- onConfirmDelete: w,
56
+ return (l, t) => {
57
+ const b = C("click-outside");
58
+ return n(), d(M, null, [
59
+ A(V, {
60
+ isOpen: s.value,
61
+ onConfirmDelete: k,
65
62
  onCancelDelete: i
66
63
  }, null, 8, ["isOpen"]),
67
- t.row && o.can(`delete_${t.xprops.permission}`) ? u((n(), d("div", O, [
64
+ r.row && l.can(`delete_${r.xprops.permission}`) ? m((n(), d("div", $, [
68
65
  e("button", {
69
- onClick: y,
66
+ onClick: t[0] || (t[0] = (...D) => o(c) && o(c)(...D)),
70
67
  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",
71
68
  type: "button"
72
- }, r[0] || (r[0] = [
69
+ }, t[1] || (t[1] = [
73
70
  e("svg", {
74
71
  class: "w-5 h-5",
75
72
  "aria-hidden": "true",
@@ -80,29 +77,34 @@ const O = {
80
77
  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" })
81
78
  ], -1)
82
79
  ])),
83
- u(e("div", j, [
84
- e("ul", B, [
85
- o.can(`delete_${t.xprops.permission}`) ? (n(), d("li", N, [
80
+ m(e("div", {
81
+ ref_key: "menu",
82
+ ref: v,
83
+ style: O(o(h)),
84
+ 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
+ }, [
86
+ e("ul", T, [
87
+ l.can(`delete_${r.xprops.permission}`) ? (n(), d("li", Z, [
86
88
  e("a", {
87
89
  href: "#",
88
- onClick: _(h, ["prevent"]),
90
+ onClick: j(w, ["prevent"]),
89
91
  class: "block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
90
- }, r[1] || (r[1] = [
92
+ }, t[2] || (t[2] = [
91
93
  e("i", { class: "mr-2 fa-solid fa-trash-can opacity-80" }, null, -1),
92
- C(" Remove")
94
+ B(" Remove")
93
95
  ]))
94
- ])) : p("", !0)
96
+ ])) : g("", !0)
95
97
  ])
96
- ], 512), [
97
- [A, s.value]
98
+ ], 4), [
99
+ [N, o(y)]
98
100
  ])
99
101
  ])), [
100
- [b, f]
101
- ]) : p("", !0)
102
+ [b, o(u)]
103
+ ]) : g("", !0)
102
104
  ], 64);
103
105
  };
104
106
  }
105
107
  };
106
108
  export {
107
- T as default
109
+ I as default
108
110
  };
@@ -1,13 +1,14 @@
1
- import { ref as g, resolveDirective as C, createElementBlock as l, openBlock as i, Fragment as $, createVNode as O, withDirectives as m, createCommentVNode as c, createElementVNode as t, withModifiers as p, createTextVNode as f, toDisplayString as y, vShow as j } from "vue";
2
- import M from "../DeleteConfirmationModal.vue.js";
3
- import v from "../../../Stores/toast.js";
4
- const B = {
1
+ import { ref as O, resolveDirective as j, createElementBlock as i, openBlock as s, Fragment as S, createVNode as B, withDirectives as p, createCommentVNode as u, createElementVNode as o, unref as a, normalizeStyle as E, withModifiers as y, createTextVNode as v, toDisplayString as h, vShow as N } from "vue";
2
+ import { useGlFloatingMenu as V } from "./useGlFloatingMenu.js";
3
+ import T from "../DeleteConfirmationModal.vue.js";
4
+ import k from "../../../Stores/toast.js";
5
+ const Z = {
5
6
  key: 0,
6
7
  class: "flex lg:justify-center"
7
- }, E = { class: "xs:right-[unset] ltr:lg:right-[30px] rtl:lg:left-[30px] absolute z-10 mt-11 origin-top-right bg-white divide-y divide-gray-100 rounded-lg shadow-sm w-44 dark:bg-gray-700 dark:divide-gray-600" }, N = {
8
+ }, q = {
8
9
  class: "py-2 text-sm text-gray-700 dark:text-gray-200",
9
10
  "aria-labelledby": "dropdownDividerButton"
10
- }, S = { key: 0 }, V = { key: 1 }, F = {
11
+ }, z = { key: 0 }, F = { key: 1 }, H = {
11
12
  __name: "DatatableDeleteEditAction",
12
13
  props: {
13
14
  language: {
@@ -38,90 +39,91 @@ const B = {
38
39
  }
39
40
  },
40
41
  emits: ["deleteAction", "editAction"],
41
- setup(e, { emit: h }) {
42
- const a = e, s = g(!1), n = g(!1), d = () => {
43
- n.value = !1;
44
- }, x = () => {
45
- n.value = !0;
46
- }, k = () => {
47
- s.value = !1;
48
- }, w = () => {
49
- s.value = !0;
50
- }, u = h, b = (o) => {
51
- u("editAction", o);
52
- }, D = () => {
53
- axios.delete(`${a.xprops.route}/${a.row.id}`).then(() => {
54
- d(), u("deleteAction"), v.methods.add({
55
- message: a.language?.item_deleted_successfully ?? "Item deleted successfully.",
42
+ setup(e, { emit: x }) {
43
+ const l = e, { open: w, menu: b, style: D, toggle: g, close: n } = V(), d = O(!1), c = () => {
44
+ d.value = !1;
45
+ }, A = () => {
46
+ n(), d.value = !0;
47
+ }, m = x, C = (r) => {
48
+ n(), m("editAction", r);
49
+ }, $ = () => {
50
+ axios.delete(`${l.xprops.route}/${l.row.id}`).then(() => {
51
+ c(), m("deleteAction"), k.methods.add({
52
+ message: l.language?.item_deleted_successfully ?? "Item deleted successfully.",
56
53
  type: "success",
57
54
  duration: 5e3
58
55
  });
59
- }).catch((o) => {
60
- d(), v.methods.add({
61
- message: o.response?.data?.message ?? a.language?.delete_failed ?? "That item could not be deleted.",
56
+ }).catch((r) => {
57
+ c(), k.methods.add({
58
+ message: r.response?.data?.message ?? l.language?.delete_failed ?? "That item could not be deleted.",
62
59
  type: "error",
63
60
  duration: 5e3
64
61
  });
65
62
  });
66
63
  };
67
- return (o, r) => {
68
- const A = C("click-outside");
69
- return i(), l($, null, [
70
- O(M, {
64
+ return (r, t) => {
65
+ const M = j("click-outside");
66
+ return s(), i(S, null, [
67
+ B(T, {
71
68
  language: e.language,
72
- isOpen: n.value,
73
- onConfirmDelete: D,
74
- onCancelDelete: d
69
+ isOpen: d.value,
70
+ onConfirmDelete: $,
71
+ onCancelDelete: c
75
72
  }, null, 8, ["language", "isOpen"]),
76
- e.row && (o.can(`delete_${e.xprops.permission}`) || o.can(`access_${e.xprops.permission}`)) ? m((i(), l("div", B, [
77
- t("button", {
78
- onClick: w,
73
+ e.row && (r.can(`delete_${e.xprops.permission}`) || r.can(`access_${e.xprops.permission}`)) ? p((s(), i("div", Z, [
74
+ o("button", {
75
+ onClick: t[0] || (t[0] = (...f) => a(g) && a(g)(...f)),
79
76
  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",
80
77
  type: "button"
81
- }, r[1] || (r[1] = [
82
- t("svg", {
78
+ }, t[2] || (t[2] = [
79
+ o("svg", {
83
80
  class: "w-5 h-5",
84
81
  "aria-hidden": "true",
85
82
  xmlns: "http://www.w3.org/2000/svg",
86
83
  fill: "currentColor",
87
84
  viewBox: "0 0 4 15"
88
85
  }, [
89
- t("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" })
86
+ 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" })
90
87
  ], -1)
91
88
  ])),
92
- m(t("div", E, [
93
- t("ul", N, [
94
- o.can(`access_${e.xprops.permission}`) ? (i(), l("li", S, [
95
- t("a", {
89
+ p(o("div", {
90
+ ref_key: "menu",
91
+ ref: b,
92
+ style: E(a(D)),
93
+ 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"
94
+ }, [
95
+ o("ul", q, [
96
+ r.can(`access_${e.xprops.permission}`) ? (s(), i("li", z, [
97
+ o("a", {
96
98
  href: "#",
97
- onClick: r[0] || (r[0] = p((T) => b(e.row), ["prevent"])),
99
+ onClick: t[1] || (t[1] = y((f) => C(e.row), ["prevent"])),
98
100
  class: "block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
99
101
  }, [
100
- r[2] || (r[2] = t("i", { class: "mr-1 fa-solid fa-pen-to-square opacity-80" }, null, -1)),
101
- f(" " + y(e.language?.edit ?? "Edit"), 1)
102
+ t[3] || (t[3] = o("i", { class: "mr-1 fa-solid fa-pen-to-square opacity-80" }, null, -1)),
103
+ v(" " + h(e.language?.edit ?? "Edit"), 1)
102
104
  ])
103
- ])) : c("", !0),
104
- o.can(`delete_${e.xprops.permission}`) ? (i(), l("li", V, [
105
- t("a", {
105
+ ])) : u("", !0),
106
+ r.can(`delete_${e.xprops.permission}`) ? (s(), i("li", F, [
107
+ o("a", {
106
108
  href: "#",
107
- onClick: p(x, ["prevent"]),
109
+ onClick: y(A, ["prevent"]),
108
110
  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"
109
111
  }, [
110
- r[3] || (r[3] = t("i", { class: "mr-1 fa-solid fa-trash-can opacity-80" }, null, -1)),
111
- f(" " + y(e.language?.remove ?? "Remove"), 1)
112
+ t[4] || (t[4] = o("i", { class: "mr-1 fa-solid fa-trash-can opacity-80" }, null, -1)),
113
+ v(" " + h(e.language?.remove ?? "Remove"), 1)
112
114
  ])
113
- ])) : c("", !0)
115
+ ])) : u("", !0)
114
116
  ])
115
- ], 512), [
116
- [j, s.value]
117
+ ], 4), [
118
+ [N, a(w)]
117
119
  ])
118
120
  ])), [
119
- [A, k]
120
- ]) : c("", !0)
121
+ [M, a(n)]
122
+ ]) : u("", !0)
121
123
  ], 64);
122
124
  };
123
125
  }
124
126
  };
125
127
  export {
126
- F as default
128
+ H as default
127
129
  };
@@ -0,0 +1,31 @@
1
+ import { ref as r, onBeforeUnmount as M, nextTick as m } from "vue";
2
+ const c = 4, s = 8;
3
+ function $() {
4
+ const o = r(!1), n = r(null), i = r({});
5
+ let l = null;
6
+ const u = (e) => {
7
+ e.key === "Escape" && t();
8
+ }, h = () => {
9
+ window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), document.addEventListener("keydown", u);
10
+ }, d = () => {
11
+ window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t), document.removeEventListener("keydown", u);
12
+ }, x = async () => {
13
+ if (!l || !n.value)
14
+ return;
15
+ const e = l.getBoundingClientRect(), a = n.value.offsetWidth, v = n.value.offsetHeight, p = window.innerHeight - e.bottom, E = p < v + c + s && e.top > p, L = getComputedStyle(l).direction === "rtl", f = E ? Math.max(s, e.top - v - c) : e.bottom + c, w = Math.min(Math.max(s, L ? e.left : e.right - a), window.innerWidth - a - s);
16
+ if (i.value = { top: `${f}px`, left: `${w}px`, visibility: "hidden" }, await m(), !n.value)
17
+ return;
18
+ const g = n.value.getBoundingClientRect();
19
+ i.value = { top: `${2 * f - g.top}px`, left: `${2 * w - g.left}px` };
20
+ }, y = (e) => {
21
+ l = e.currentTarget, i.value = { top: "0px", left: "0px", visibility: "hidden" }, o.value = !0, h(), m(x);
22
+ };
23
+ function t() {
24
+ o.value = !1, d();
25
+ }
26
+ const b = (e) => o.value ? t() : y(e);
27
+ return M(d), { open: o, menu: n, style: i, toggle: b, close: t };
28
+ }
29
+ export {
30
+ $ as useGlFloatingMenu
31
+ };
package/dist/main.js CHANGED
@@ -10,8 +10,8 @@ import { default as T } from "./components/GeneralComponents/GlTextInput.vue.js"
10
10
  import { default as c } from "./components/GeneralComponents/GlPhoneInput.vue.js";
11
11
  import { PHONE_CODE_DEFAULTS as g, PHONE_COUNTRIES as C, PHONE_PREFERRED as P } from "./components/GeneralComponents/phoneCountries.js";
12
12
  import { default as E } from "./components/GeneralComponents/GlDatePicker.vue.js";
13
- import { default as M } from "./components/GeneralComponents/GlDateTimePicker.vue.js";
14
- import { default as A } from "./components/GeneralComponents/GlDateRangePicker.vue.js";
13
+ import { default as F } from "./components/GeneralComponents/GlDateTimePicker.vue.js";
14
+ import { default as w } from "./components/GeneralComponents/GlDateRangePicker.vue.js";
15
15
  import { default as v } from "./components/GeneralComponents/GlDateTimeRangePicker.vue.js";
16
16
  import { default as O } from "./components/GeneralComponents/GlTimeRangePicker.vue.js";
17
17
  import { default as I } from "./components/GeneralComponents/GlDateRangeCalendar.vue.js";
@@ -37,91 +37,94 @@ import { default as ca } from "./components/GeneralComponents/DataTable/GlDataTa
37
37
  import { default as ga } from "./components/GeneralComponents/DataTable/GlDataTableServerSideGroupBy.vue.js";
38
38
  import { default as Pa } from "./components/GeneralComponents/DataTable/GLDataTable.vue.js";
39
39
  import { default as Ea } from "./components/GeneralComponents/DataTable/DatatableConvertCronToHuman.vue.js";
40
- import { default as Ma } from "./components/GeneralComponents/DeleteConfirmationModal.vue.js";
41
- import { default as Aa } from "./components/GeneralComponents/GlAccordionsWrapper.vue.js";
40
+ import { default as Fa } from "./components/GeneralComponents/DeleteConfirmationModal.vue.js";
41
+ import { default as wa } from "./components/GeneralComponents/GlAccordionsWrapper.vue.js";
42
42
  import { default as va } from "./components/GeneralComponents/GlAccordion.vue.js";
43
43
  import { default as Oa } from "./components/GeneralComponents/GlToastList.vue.js";
44
44
  import { default as Ia } from "./Stores/toast.js";
45
45
  import { default as Ba } from "./components/GeneralComponents/DataTable/DatatableAction.vue.js";
46
- import { default as Na } from "./components/GeneralComponents/DataTable/DatatableDeleteAction.vue.js";
47
- import { default as Ua } from "./components/GeneralComponents/DataTable/DatatableDeleteEditAction.vue.js";
48
- import { default as Va } from "./components/GeneralComponents/DataTable/DatatableFileDownload.vue.js";
49
- import { default as qa } from "./components/GeneralComponents/DataTable/DatatableFiles.vue.js";
50
- import { default as Ja } from "./components/GeneralComponents/DataTable/DatatableHtml.vue.js";
51
- import { default as Qa } from "./components/GeneralComponents/DataTable/DatatableList.vue.js";
52
- import { default as Ya } from "./components/GeneralComponents/DataTable/DatatableListNested.vue.js";
53
- import { default as $a } from "./components/GeneralComponents/DataTable/DatatablePicture.vue.js";
54
- import { default as tt } from "./components/GeneralComponents/DataTable/DatatablePictures.vue.js";
55
- import { default as ot } from "./components/GeneralComponents/DataTable/DatatableStatus.vue.js";
56
- import { default as lt } from "./components/GeneralComponents/DataTable/DatatableStatusGeneral.vue.js";
57
- import { default as st } from "./components/GeneralComponents/DataTable/DatatableStatusSpecficColor.vue.js";
58
- import { default as dt } from "./components/GeneralComponents/DataTable/DatatableStatusTextLabelGeneral.vue.js";
59
- import { default as pt } from "./components/GeneralComponents/DataTable/DatatableDateTime.vue.js";
60
- import { default as Gt } from "./components/GeneralComponents/DataTable/DatatableDate.vue.js";
61
- import { default as nt } from "./components/GeneralComponents/DataTable/DatatableStatusServer.vue.js";
62
- import { default as Tt } from "./components/GeneralComponents/DataTable/DatatableCommand.vue.js";
63
- import { default as ct } from "./components/LaravelVuePagination/TailwindPagination.vue.js";
64
- import { default as gt } from "./components/GeneralComponents/ConfirmationModal.vue.js";
65
- import { default as Pt } from "./components/GeneralComponents/DynamicConfirmation.vue.js";
66
- import { default as Et } from "./components/GeneralComponents/GlCodeCopy.vue.js";
67
- import { default as Mt } from "./components/GeneralComponents/GlTextCopy.vue.js";
68
- import { default as At } from "./components/GeneralComponents/StatusRunningSuccessFailed.vue.js";
69
- import { default as vt } from "./components/GeneralComponents/StatusConnectingConnectedDisconnected.vue.js";
70
- import { default as Ot } from "./components/GeneralComponents/GlStatusBadge.vue.js";
71
- import { STATES as It, statusState as _t, worstState as Bt, resolveStatus as Ht } from "./components/GeneralComponents/glStatusMap.js";
72
- import { default as ht } from "./components/GeneralComponents/GlLogViewer.vue.js";
73
- import { useGlFocusTrap as Wt } from "./components/GeneralComponents/useGlFocusTrap.js";
74
- import { default as jt } from "./ClickOutsideDirective.js";
75
- import { default as zt } from "./Form.js";
76
- import { default as Kt } from "./multilingual.js";
77
- import { glLocale as Xt, setGlLocales as Yt } from "./localeStore.js";
78
- import { default as $t, triggerPrint as ae } from "./print/print.js";
46
+ import { default as Na } from "./components/GeneralComponents/DataTable/DatatableActionsMenu.vue.js";
47
+ import { default as Ua } from "./components/GeneralComponents/DataTable/DatatableDeleteAction.vue.js";
48
+ import { default as Va } from "./components/GeneralComponents/DataTable/DatatableDeleteEditAction.vue.js";
49
+ import { default as qa } from "./components/GeneralComponents/DataTable/DatatableFileDownload.vue.js";
50
+ import { default as Ja } from "./components/GeneralComponents/DataTable/DatatableFiles.vue.js";
51
+ import { default as Qa } from "./components/GeneralComponents/DataTable/DatatableHtml.vue.js";
52
+ import { default as Ya } from "./components/GeneralComponents/DataTable/DatatableList.vue.js";
53
+ import { default as $a } from "./components/GeneralComponents/DataTable/DatatableListNested.vue.js";
54
+ import { default as tt } from "./components/GeneralComponents/DataTable/DatatablePicture.vue.js";
55
+ import { default as ot } from "./components/GeneralComponents/DataTable/DatatablePictures.vue.js";
56
+ import { default as lt } from "./components/GeneralComponents/DataTable/DatatableStatus.vue.js";
57
+ import { default as st } from "./components/GeneralComponents/DataTable/DatatableStatusGeneral.vue.js";
58
+ import { default as dt } from "./components/GeneralComponents/DataTable/DatatableStatusSpecficColor.vue.js";
59
+ import { default as pt } from "./components/GeneralComponents/DataTable/DatatableStatusTextLabelGeneral.vue.js";
60
+ import { default as Gt } from "./components/GeneralComponents/DataTable/DatatableDateTime.vue.js";
61
+ import { default as nt } from "./components/GeneralComponents/DataTable/DatatableDate.vue.js";
62
+ import { default as Tt } from "./components/GeneralComponents/DataTable/DatatableStatusServer.vue.js";
63
+ import { default as ct } from "./components/GeneralComponents/DataTable/DatatableCommand.vue.js";
64
+ import { default as gt } from "./components/LaravelVuePagination/TailwindPagination.vue.js";
65
+ import { default as Pt } from "./components/GeneralComponents/ConfirmationModal.vue.js";
66
+ import { default as Et } from "./components/GeneralComponents/DynamicConfirmation.vue.js";
67
+ import { default as Ft } from "./components/GeneralComponents/GlCodeCopy.vue.js";
68
+ import { default as wt } from "./components/GeneralComponents/GlTextCopy.vue.js";
69
+ import { default as vt } from "./components/GeneralComponents/StatusRunningSuccessFailed.vue.js";
70
+ import { default as Ot } from "./components/GeneralComponents/StatusConnectingConnectedDisconnected.vue.js";
71
+ import { default as It } from "./components/GeneralComponents/GlStatusBadge.vue.js";
72
+ import { STATES as Bt, statusState as Ht, worstState as Nt, resolveStatus as ht } from "./components/GeneralComponents/glStatusMap.js";
73
+ import { default as Wt } from "./components/GeneralComponents/GlLogViewer.vue.js";
74
+ import { useGlFocusTrap as jt } from "./components/GeneralComponents/useGlFocusTrap.js";
75
+ import { useGlFloatingMenu as zt } from "./components/GeneralComponents/DataTable/useGlFloatingMenu.js";
76
+ import { default as Kt } from "./ClickOutsideDirective.js";
77
+ import { default as Xt } from "./Form.js";
78
+ import { default as Zt } from "./multilingual.js";
79
+ import { glLocale as ae, setGlLocales as te } from "./localeStore.js";
80
+ import { default as oe, triggerPrint as re } from "./print/print.js";
79
81
  export {
80
- jt as ClickOutsideDirective,
81
- dt as DatatableStatusTextLabelGeneral,
82
- zt as Form,
83
- Tt as GLDatatableCommand,
84
- Gt as GLDatatableDate,
85
- pt as GLDatatableDateTime,
86
- nt as GLDatatableStatusServer,
87
- It as GL_STATUS_STATES,
82
+ Kt as ClickOutsideDirective,
83
+ pt as DatatableStatusTextLabelGeneral,
84
+ Xt as Form,
85
+ ct as GLDatatableCommand,
86
+ nt as GLDatatableDate,
87
+ Gt as GLDatatableDateTime,
88
+ Tt as GLDatatableStatusServer,
89
+ Bt as GL_STATUS_STATES,
88
90
  va as GlAccordion,
89
- Aa as GlAccordionsWrapper,
91
+ wa as GlAccordionsWrapper,
90
92
  p as GlButton,
91
93
  s as GlCard,
92
- Et as GlCodeCopy,
94
+ Ft as GlCodeCopy,
93
95
  pa as GlCodeMirror,
94
96
  Ga as GlCodeMirrorTranslate,
95
- gt as GlConfirmationModal,
97
+ Pt as GlConfirmationModal,
96
98
  Pa as GlDataTable,
97
99
  ca as GlDataTableComponent,
98
100
  Ta as GlDataTableServerSide,
99
101
  ga as GlDataTableServerSideGroupBy,
100
102
  Ba as GlDatatableAction,
103
+ Na as GlDatatableActionsMenu,
101
104
  Ea as GlDatatableConvertCronToHuman,
102
- Na as GlDatatableDeleteAction,
103
- Ua as GlDatatableDeleteEditAction,
104
- Va as GlDatatableFileDownload,
105
- qa as GlDatatableFiles,
106
- Ja as GlDatatableHtml,
107
- Qa as GlDatatableList,
108
- Ya as GlDatatableListNested,
109
- $a as GlDatatablePicture,
110
- tt as GlDatatablePictures,
111
- ot as GlDatatableStatus,
112
- lt as GlDatatableStatusGeneral,
113
- st as GlDatatableStatusSpecficColor,
105
+ Ua as GlDatatableDeleteAction,
106
+ Va as GlDatatableDeleteEditAction,
107
+ qa as GlDatatableFileDownload,
108
+ Ja as GlDatatableFiles,
109
+ Qa as GlDatatableHtml,
110
+ Ya as GlDatatableList,
111
+ $a as GlDatatableListNested,
112
+ tt as GlDatatablePicture,
113
+ ot as GlDatatablePictures,
114
+ lt as GlDatatableStatus,
115
+ st as GlDatatableStatusGeneral,
116
+ dt as GlDatatableStatusSpecficColor,
114
117
  E as GlDatePicker,
115
118
  I as GlDateRangeCalendar,
116
- A as GlDateRangePicker,
117
- M as GlDateTimePicker,
119
+ w as GlDateRangePicker,
120
+ F as GlDateTimePicker,
118
121
  v as GlDateTimeRangePicker,
119
- Ma as GlDeleteConfirmationModal,
122
+ Fa as GlDeleteConfirmationModal,
120
123
  la as GlDropdown,
121
- Pt as GlDynamicConfirmation,
124
+ Et as GlDynamicConfirmation,
122
125
  o as GlFilesUpload,
123
126
  l as GlLanguageSelector,
124
- ht as GlLogViewer,
127
+ Wt as GlLogViewer,
125
128
  Q as GlModal,
126
129
  $ as GlModalShow,
127
130
  Y as GlModalWithoutOverflow,
@@ -129,15 +132,15 @@ export {
129
132
  J as GlMultiItemSlideDynamic,
130
133
  d as GlMultiSelectDropdown,
131
134
  c as GlPhoneInput,
132
- $t as GlPrint,
133
- Ot as GlStatusBadge,
134
- vt as GlStatusConnectingConnectedDisconnected,
135
- At as GlStatusRunningSuccessFailed,
135
+ oe as GlPrint,
136
+ It as GlStatusBadge,
137
+ Ot as GlStatusConnectingConnectedDisconnected,
138
+ vt as GlStatusRunningSuccessFailed,
136
139
  U as GlTab,
137
140
  V as GlTabShow,
138
141
  N as GlTabsWrapper,
139
- ct as GlTailwindPagination,
140
- Mt as GlTextCopy,
142
+ gt as GlTailwindPagination,
143
+ wt as GlTextCopy,
141
144
  T as GlTextInput,
142
145
  B as GlTextInputFile,
143
146
  n as GlTextTranslate,
@@ -153,12 +156,13 @@ export {
153
156
  g as PHONE_CODE_DEFAULTS,
154
157
  C as PHONE_COUNTRIES,
155
158
  P as PHONE_PREFERRED,
156
- Xt as glLocale,
157
- _t as glStatusState,
158
- Bt as glWorstState,
159
- Kt as multilingual,
160
- Ht as resolveGlStatus,
161
- Yt as setGlLocales,
162
- ae as triggerPrint,
163
- Wt as useGlFocusTrap
159
+ ae as glLocale,
160
+ Ht as glStatusState,
161
+ Nt as glWorstState,
162
+ Zt as multilingual,
163
+ ht as resolveGlStatus,
164
+ te as setGlLocales,
165
+ re as triggerPrint,
166
+ zt as useGlFloatingMenu,
167
+ jt as useGlFocusTrap
164
168
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "The most popular library of interactive components built with Vuejs && Tailwind CSS",
4
4
  "type": "module",
5
5
  "private": false,
6
- "version": "1.3.26",
6
+ "version": "1.3.27",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/mrgiant/GoldenLogicUi.git"