admins-components 9.0.68 → 9.0.70
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/admins-components.js +44 -43
- package/dist/admins-components103.js +102 -94
- package/dist/admins-components103.js.map +1 -1
- package/dist/admins-components105.js.map +1 -1
- package/dist/admins-components12.js +41 -31
- package/dist/admins-components12.js.map +1 -1
- package/dist/admins-components29.js +19 -19
- package/dist/admins-components29.js.map +1 -1
- package/dist/admins-components30.js.map +1 -1
- package/dist/admins-components5.js +4 -1
- package/dist/admins-components5.js.map +1 -1
- package/dist/admins-components57.js +86 -24
- package/dist/admins-components57.js.map +1 -1
- package/dist/admins-components58.js +4 -9
- package/dist/admins-components58.js.map +1 -1
- package/dist/admins-components59.js +24 -6
- package/dist/admins-components59.js.map +1 -1
- package/dist/admins-components6.js.map +1 -1
- package/dist/admins-components60.js +9 -31
- package/dist/admins-components60.js.map +1 -1
- package/dist/admins-components61.js +8 -0
- package/dist/admins-components61.js.map +1 -0
- package/dist/admins-components62.js +31 -6
- package/dist/admins-components62.js.map +1 -1
- package/dist/admins-components64.js +6 -70
- package/dist/admins-components64.js.map +1 -1
- package/dist/admins-components65.js +96 -4
- package/dist/admins-components65.js.map +1 -1
- package/dist/admins-components66.js +65 -84
- package/dist/admins-components66.js.map +1 -1
- package/dist/admins-components67.js +1 -1
- package/dist/admins-components67.js.map +1 -1
- package/dist/admins-components68.js +34 -26
- package/dist/admins-components68.js.map +1 -1
- package/dist/admins-components70.js +1 -1
- package/dist/admins-components70.js.map +1 -1
- package/dist/admins-components71.js +33 -29
- package/dist/admins-components71.js.map +1 -1
- package/dist/admins-components73.js +1 -1
- package/dist/admins-components73.js.map +1 -1
- package/dist/admins-components75.js +1 -1
- package/dist/main.css +1 -1
- package/dist/main.css.map +1 -1
- package/dist/src/components/data-table/DataCards.vue.d.ts +6 -0
- package/dist/src/components/data-table/DataList.vue.d.ts +4 -0
- package/dist/src/components/data-table/DataTable.vue.d.ts +6 -0
- package/dist/src/composables/useDropdownAnchor.d.ts +12 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/styles/components/data-table/data-table.scss_vue_type_style_index_0_src_true_lang.css +1 -1
- package/package.json +1 -1
- package/dist/admins-components63.js +0 -97
- package/dist/admins-components63.js.map +0 -1
|
@@ -4,52 +4,62 @@ function a(e, t, n) {
|
|
|
4
4
|
let r = e.target, i = t?.contains(r) ?? !1, a = n?.contains(r) ?? !1;
|
|
5
5
|
return !i && !a;
|
|
6
6
|
}
|
|
7
|
-
function o(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
function o(e, t) {
|
|
8
|
+
if (!t) return e ?? null;
|
|
9
|
+
let n = e ? Number.parseFloat(e) : NaN, r = Number.parseFloat(t);
|
|
10
|
+
return Number.isNaN(n) || n < r ? t : e;
|
|
11
|
+
}
|
|
12
|
+
function s(s, c, l = {}) {
|
|
13
|
+
let { extraStyle: u, isOutsideClick: d = a, closeOnScroll: f = !1, minWidth: p = "120px" } = l, m = r(!1), h = r({});
|
|
14
|
+
function g() {
|
|
15
|
+
if (!s.value) return;
|
|
16
|
+
let t = s.value.getBoundingClientRect(), n = u ? u(t) : void 0, r = o(n?.minWidth, p);
|
|
17
|
+
h.value = {
|
|
13
18
|
position: "fixed",
|
|
14
19
|
top: `${t.bottom + 2}px`,
|
|
15
20
|
left: `${t.left}px`,
|
|
16
21
|
zIndex: "10001",
|
|
17
|
-
...
|
|
22
|
+
...n ?? {},
|
|
23
|
+
...r ? { minWidth: r } : {}
|
|
18
24
|
}, e(() => {
|
|
19
|
-
if (!
|
|
20
|
-
let e =
|
|
21
|
-
(i || a)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
if (!c.value || !s.value) return;
|
|
26
|
+
let e = c.value.getBoundingClientRect(), t = s.value.getBoundingClientRect(), n = window.innerHeight, r = window.innerWidth, i = e.bottom > n, a = e.right > r, l = i ? `${t.top - e.height - 2}px` : `${t.bottom + 2}px`, d = a ? `${Math.max(t.right - e.width, 0)}px` : `${t.left}px`;
|
|
27
|
+
if (i || a) {
|
|
28
|
+
let e = u ? u(t) : void 0, n = o(e?.minWidth, p);
|
|
29
|
+
h.value = {
|
|
30
|
+
position: "fixed",
|
|
31
|
+
top: l,
|
|
32
|
+
left: d,
|
|
33
|
+
zIndex: "10001",
|
|
34
|
+
...e ?? {},
|
|
35
|
+
...n ? { minWidth: n } : {}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
28
38
|
});
|
|
29
39
|
}
|
|
30
|
-
function
|
|
31
|
-
|
|
40
|
+
function _(e) {
|
|
41
|
+
d(e, s.value, c.value) && (m.value = !1);
|
|
32
42
|
}
|
|
33
|
-
function
|
|
34
|
-
if (
|
|
35
|
-
if (
|
|
36
|
-
|
|
43
|
+
function v() {
|
|
44
|
+
if (m.value) {
|
|
45
|
+
if (f) {
|
|
46
|
+
m.value = !1;
|
|
37
47
|
return;
|
|
38
48
|
}
|
|
39
|
-
|
|
49
|
+
g();
|
|
40
50
|
}
|
|
41
51
|
}
|
|
42
|
-
return i(
|
|
43
|
-
e &&
|
|
52
|
+
return i(m, (e) => {
|
|
53
|
+
e && g();
|
|
44
54
|
}), n(() => {
|
|
45
|
-
document.addEventListener("mousedown",
|
|
55
|
+
document.addEventListener("mousedown", _), window.addEventListener("scroll", v, !0), window.addEventListener("resize", v);
|
|
46
56
|
}), t(() => {
|
|
47
|
-
document.removeEventListener("mousedown",
|
|
57
|
+
document.removeEventListener("mousedown", _), window.removeEventListener("scroll", v, !0), window.removeEventListener("resize", v);
|
|
48
58
|
}), {
|
|
49
|
-
isOpen:
|
|
50
|
-
dropdownStyle:
|
|
51
|
-
positionDropdown:
|
|
59
|
+
isOpen: m,
|
|
60
|
+
dropdownStyle: h,
|
|
61
|
+
positionDropdown: g
|
|
52
62
|
};
|
|
53
63
|
}
|
|
54
64
|
//#endregion
|
|
55
|
-
export {
|
|
65
|
+
export { s as useDropdownAnchor };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components12.js","names":[],"sources":["../src/composables/useDropdownAnchor.ts"],"sourcesContent":["import { ref, watch, onMounted, onBeforeUnmount, nextTick } from 'vue'\nimport type { Ref } from 'vue'\n\nexport interface UseDropdownAnchorOptions {\n extraStyle?: (rect: DOMRect) => Record<string, string>\n isOutsideClick?: (\n e: MouseEvent,\n wrapperEl: HTMLElement | null,\n dropdownEl: HTMLElement | null,\n ) => boolean\n closeOnScroll?: boolean\n}\n\nexport interface UseDropdownAnchorReturn {\n isOpen: Ref<boolean>\n dropdownStyle: Ref<Record<string, string>>\n positionDropdown: () => void\n}\n\nfunction defaultIsOutsideClick(\n e: MouseEvent,\n wrapperEl: HTMLElement | null,\n dropdownEl: HTMLElement | null,\n): boolean {\n const target = e.target as Node\n const inWrapper = wrapperEl?.contains(target) ?? false\n const inDropdown = dropdownEl?.contains(target) ?? false\n return !inWrapper && !inDropdown\n}\n\nexport function useDropdownAnchor(\n wrapperRef: Ref<HTMLElement | null>,\n dropdownRef: Ref<HTMLElement | null>,\n options: UseDropdownAnchorOptions = {},\n): UseDropdownAnchorReturn {\n const {
|
|
1
|
+
{"version":3,"file":"admins-components12.js","names":[],"sources":["../src/composables/useDropdownAnchor.ts"],"sourcesContent":["import { ref, watch, onMounted, onBeforeUnmount, nextTick } from 'vue'\nimport type { Ref } from 'vue'\n\nexport interface UseDropdownAnchorOptions {\n extraStyle?: (rect: DOMRect) => Record<string, string>\n isOutsideClick?: (\n e: MouseEvent,\n wrapperEl: HTMLElement | null,\n dropdownEl: HTMLElement | null,\n ) => boolean\n closeOnScroll?: boolean\n /**\n * Global minimum width applied to the dropdown. Defaults to `'120px'`.\n *\n * The global value is only applied when `extraStyle` does not request\n * an equal-or-larger `minWidth`. So `minWidth` acts as a **floor**:\n * dropdowns can grow bigger (via `extraStyle`), but never smaller than\n * this value. Pass `null` to disable the floor entirely.\n *\n * Both the floor and any `extraStyle` `minWidth` are assumed to be\n * `px` values.\n */\n minWidth?: string | null\n}\n\nexport interface UseDropdownAnchorReturn {\n isOpen: Ref<boolean>\n dropdownStyle: Ref<Record<string, string>>\n positionDropdown: () => void\n}\n\nfunction defaultIsOutsideClick(\n e: MouseEvent,\n wrapperEl: HTMLElement | null,\n dropdownEl: HTMLElement | null,\n): boolean {\n const target = e.target as Node\n const inWrapper = wrapperEl?.contains(target) ?? false\n const inDropdown = dropdownEl?.contains(target) ?? false\n return !inWrapper && !inDropdown\n}\n\n/**\n * Compare the global `minWidth` floor against an optional value supplied\n * by `extraStyle` and return the larger of the two (in pixels).\n *\n * Both the floor and any `extraStyle` `minWidth` are expected to be `px`\n * values (e.g. `'120px'`, `'${rect.width}px'`), so a single `parseFloat`\n * is enough.\n *\n * Returns `null` when there is no floor and `extraStyle` didn't supply\n * a `minWidth`, letting the caller skip the property entirely.\n */\nfunction pickMinWidth(extraMinWidth: string | undefined, floor: string | null): string | null {\n if (!floor) return extraMinWidth ?? null\n const extraPx = extraMinWidth ? Number.parseFloat(extraMinWidth) : Number.NaN\n const floorPx = Number.parseFloat(floor)\n if (Number.isNaN(extraPx) || extraPx < floorPx) return floor\n return extraMinWidth!\n}\n\nexport function useDropdownAnchor(\n wrapperRef: Ref<HTMLElement | null>,\n dropdownRef: Ref<HTMLElement | null>,\n options: UseDropdownAnchorOptions = {},\n): UseDropdownAnchorReturn {\n const {\n extraStyle,\n isOutsideClick = defaultIsOutsideClick,\n closeOnScroll = false,\n minWidth = '120px',\n } = options\n\n const isOpen = ref(false)\n const dropdownStyle = ref<Record<string, string>>({})\n\n function positionDropdown() {\n if (!wrapperRef.value) return\n const rect = wrapperRef.value.getBoundingClientRect()\n const extraStyleValues = extraStyle ? extraStyle(rect) : undefined\n const effectiveMinWidth = pickMinWidth(extraStyleValues?.minWidth, minWidth)\n\n dropdownStyle.value = {\n position: 'fixed',\n top: `${rect.bottom + 2}px`,\n left: `${rect.left}px`,\n zIndex: '10001',\n ...(extraStyleValues ?? {}),\n ...(effectiveMinWidth ? { minWidth: effectiveMinWidth } : {}),\n }\n nextTick(() => {\n if (!dropdownRef.value || !wrapperRef.value) return\n const dropdownRect = dropdownRef.value.getBoundingClientRect()\n const anchorRect = wrapperRef.value.getBoundingClientRect()\n const viewportHeight = window.innerHeight\n const viewportWidth = window.innerWidth\n\n // Flip vertically when the dropdown doesn't fit below the anchor.\n const flipY = dropdownRect.bottom > viewportHeight\n\n // Flip horizontally when the dropdown would otherwise be partially\n // cut off by the right edge of the viewport. We anchor the\n // dropdown's right edge to the trigger's right edge so it stays\n // fully visible while preserving the anchor.\n const flipX = dropdownRect.right > viewportWidth\n\n const top = flipY\n ? `${anchorRect.top - dropdownRect.height - 2}px`\n : `${anchorRect.bottom + 2}px`\n const left = flipX\n ? `${Math.max(anchorRect.right - dropdownRect.width, 0)}px`\n : `${anchorRect.left}px`\n\n if (flipY || flipX) {\n const flippedExtras = extraStyle ? extraStyle(anchorRect) : undefined\n const flippedMinWidth = pickMinWidth(flippedExtras?.minWidth, minWidth)\n dropdownStyle.value = {\n position: 'fixed',\n top,\n left,\n zIndex: '10001',\n ...(flippedExtras ?? {}),\n ...(flippedMinWidth ? { minWidth: flippedMinWidth } : {}),\n }\n }\n })\n }\n\n function onClickOutside(e: MouseEvent) {\n if (isOutsideClick(e, wrapperRef.value, dropdownRef.value)) {\n isOpen.value = false\n }\n }\n\n function onScrollOrResize() {\n if (!isOpen.value) return\n if (closeOnScroll) {\n isOpen.value = false\n return\n }\n positionDropdown()\n }\n\n watch(isOpen, (open) => {\n if (open) positionDropdown()\n })\n\n onMounted(() => {\n document.addEventListener('mousedown', onClickOutside)\n\n window.addEventListener('scroll', onScrollOrResize, true)\n window.addEventListener('resize', onScrollOrResize)\n })\n\n onBeforeUnmount(() => {\n document.removeEventListener('mousedown', onClickOutside)\n\n window.removeEventListener('scroll', onScrollOrResize, true)\n window.removeEventListener('resize', onScrollOrResize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AAS,EAAE,MAC5C,GAAG,EAAW,SAAS,EAAE,KACvB,IAAO,IACT,GAAG,KAAK,IAAI,EAAW,QAAQ,EAAa,OAAO,CAAC,EAAE,MACtD,GAAG,EAAW,KAAK;GAEvB,IAAI,KAAS,GAAO;IAClB,IAAM,IAAgB,IAAa,EAAW,CAAU,IAAI,KAAA,GACtD,IAAkB,EAAa,GAAe,UAAU,CAAQ;IACtE,EAAc,QAAQ;KACpB,UAAU;KACV;KACA;KACA,QAAQ;KACR,GAAI,KAAiB,CAAC;KACtB,GAAI,IAAkB,EAAE,UAAU,EAAgB,IAAI,CAAC;IACzD;GACF;EACF,CAAC;CACH;CAEA,SAAS,EAAe,GAAe;EACrC,AAAI,EAAe,GAAG,EAAW,OAAO,EAAY,KAAK,MACvD,EAAO,QAAQ;CAEnB;CAEA,SAAS,IAAmB;EACrB,MAAO,OACZ;OAAI,GAAe;IACjB,EAAO,QAAQ;IACf;GACF;GACA,EAAiB;EADjB;CAEF;CAoBA,OAlBA,EAAM,IAAS,MAAS;EACtB,AAAI,KAAM,EAAiB;CAC7B,CAAC,GAED,QAAgB;EAId,AAHA,SAAS,iBAAiB,aAAa,CAAc,GAErD,OAAO,iBAAiB,UAAU,GAAkB,EAAI,GACxD,OAAO,iBAAiB,UAAU,CAAgB;CACpD,CAAC,GAED,QAAsB;EAIpB,AAHA,SAAS,oBAAoB,aAAa,CAAc,GAExD,OAAO,oBAAoB,UAAU,GAAkB,EAAI,GAC3D,OAAO,oBAAoB,UAAU,CAAgB;CACvD,CAAC,GAEM;EAAE;EAAQ;EAAe;CAAiB;AACnD"}
|
|
@@ -2,7 +2,7 @@ import { sizeToClass as e } from "./admins-components4.js";
|
|
|
2
2
|
import { useDropdownAnchor as t } from "./admins-components12.js";
|
|
3
3
|
import { Fragment as n, Teleport as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, defineComponent as c, normalizeClass as l, normalizeStyle as u, openBlock as d, ref as f, renderList as p, toDisplayString as m, unref as h, vShow as g, withDirectives as _ } from "vue";
|
|
4
4
|
//#region src/components/DropdownMenu.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var v =
|
|
5
|
+
var v = ["aria-label"], y = { class: "ac-component" }, b = { class: "ds-options c-scroll" }, x = ["onClick", "aria-label"], S = /* @__PURE__ */ c({
|
|
6
6
|
__name: "DropdownMenu",
|
|
7
7
|
props: {
|
|
8
8
|
size: { default: "normal" },
|
|
@@ -22,22 +22,22 @@ var v = { class: "ac-component" }, y = ["aria-label"], b = { class: "ac-componen
|
|
|
22
22
|
class: {}
|
|
23
23
|
},
|
|
24
24
|
setup(c) {
|
|
25
|
-
let
|
|
25
|
+
let S = c, C = f(null), w = f(null), { isOpen: T, dropdownStyle: E } = t(C, w, {
|
|
26
26
|
extraStyle: (e) => ({
|
|
27
27
|
minWidth: `${e.width}px`,
|
|
28
28
|
maxWidth: `${e.width * 2}px`
|
|
29
29
|
}),
|
|
30
30
|
closeOnScroll: !0
|
|
31
31
|
});
|
|
32
|
-
function
|
|
33
|
-
|
|
32
|
+
function D() {
|
|
33
|
+
T.value = !T.value;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
e.callback?.(),
|
|
35
|
+
function O(e) {
|
|
36
|
+
e.callback?.(), T.value = !1;
|
|
37
37
|
}
|
|
38
|
-
return (t, f) => (d(), o("div",
|
|
38
|
+
return (t, f) => (d(), o("div", {
|
|
39
39
|
ref_key: "wrapperRef",
|
|
40
|
-
ref:
|
|
40
|
+
ref: C,
|
|
41
41
|
class: "ds-wrapper d-inline-block"
|
|
42
42
|
}, [s("button", {
|
|
43
43
|
type: "button",
|
|
@@ -45,10 +45,10 @@ var v = { class: "ac-component" }, y = ["aria-label"], b = { class: "ac-componen
|
|
|
45
45
|
c.size === "small" && "c-btn-sm",
|
|
46
46
|
c.size === "large" && "c-btn-lg",
|
|
47
47
|
c.type !== "normal" && `c-btn-${c.type}`,
|
|
48
|
-
|
|
48
|
+
S.class
|
|
49
49
|
]]),
|
|
50
50
|
"aria-label": c.ariaLabel ?? c.label,
|
|
51
|
-
onClick: f[0] ||= (e) =>
|
|
51
|
+
onClick: f[0] ||= (e) => D()
|
|
52
52
|
}, [
|
|
53
53
|
c.icon ? (d(), o("i", {
|
|
54
54
|
key: 0,
|
|
@@ -56,16 +56,16 @@ var v = { class: "ac-component" }, y = ["aria-label"], b = { class: "ac-componen
|
|
|
56
56
|
}, null, 2)) : a("", !0),
|
|
57
57
|
c.label ? (d(), o("span", {
|
|
58
58
|
key: 1,
|
|
59
|
-
class: l({ "align-center-fix ":
|
|
59
|
+
class: l(["btn-label", { "align-center-fix ": S.labelAlignmentFix }])
|
|
60
60
|
}, m(c.label), 3)) : a("", !0),
|
|
61
|
-
s("span", { class: l(["c-icon-btn c-icon-btn--chevron", { "c-icon-btn--chevron-open": h(
|
|
62
|
-
], 10,
|
|
61
|
+
s("span", { class: l(["c-icon-btn c-icon-btn--chevron", { "c-icon-btn--chevron-open": h(T) }]) }, [s("i", { class: l(["fa-solid fa-chevron-down", { "fa-fw": !!c.label }]) }, null, 2)], 2)
|
|
62
|
+
], 10, v), (d(), i(r, { to: "body" }, [s("div", y, [h(T) ? (d(), o("div", {
|
|
63
63
|
key: 0,
|
|
64
64
|
ref_key: "dropdownRef",
|
|
65
|
-
ref:
|
|
65
|
+
ref: w,
|
|
66
66
|
class: "c-dropdown ds-wrapper",
|
|
67
|
-
style: u(h(
|
|
68
|
-
}, [s("ul",
|
|
67
|
+
style: u(h(E))
|
|
68
|
+
}, [s("ul", b, [(d(!0), o(n, null, p(c.items, (t, n) => _((d(), o("li", {
|
|
69
69
|
key: `cb-${n}`,
|
|
70
70
|
class: l(["d-option dm-option c-field-size c-type-color", {
|
|
71
71
|
[`c-field-size--${h(e)(t.size)}`]: t.size,
|
|
@@ -74,13 +74,13 @@ var v = { class: "ac-component" }, y = ["aria-label"], b = { class: "ac-componen
|
|
|
74
74
|
[t.class]: !!t.class
|
|
75
75
|
}]),
|
|
76
76
|
tabindex: "0",
|
|
77
|
-
onClick: (e) =>
|
|
77
|
+
onClick: (e) => O(t),
|
|
78
78
|
"aria-label": t.ariaLabel ?? t.label
|
|
79
79
|
}, [t.icon ? (d(), o("i", {
|
|
80
80
|
key: 0,
|
|
81
81
|
class: l(["fa-fw", t.icon])
|
|
82
|
-
}, null, 2)) : a("", !0), s("span", { class: l(["d-option__label", { "c-truncate":
|
|
82
|
+
}, null, 2)) : a("", !0), s("span", { class: l(["d-option__label", { "c-truncate": S.textEllipsis }]) }, m(t.label), 3)], 10, x)), [[g, !t.hidden?.()]])), 128))])], 4)) : a("", !0)])]))], 512));
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
//#endregion
|
|
86
|
-
export {
|
|
86
|
+
export { S as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components29.js","names":[],"sources":["../src/components/DropdownMenu.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface DropdownMenuItem {\n icon?: string\n label: string\n type?: ButtonType\n size?: ControlSize\n ariaLabel?: string\n class?: string\n callback: () => void\n disabled?: () => boolean\n hidden?: () => boolean\n}\n\nexport interface DropdownMenuProps {\n size?: ControlSize\n icon?: string\n label?: string\n ariaLabel?: string\n textEllipsis?: boolean\n type?: ButtonType\n items: DropdownMenuItem[]\n labelAlignmentFix?: boolean\n class?: string\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport type { ControlSize } from '@/types/types'\nimport type { ButtonType } from '@/components/Button.vue'\nimport { useDropdownAnchor } from '@/composables/useDropdownAnchor'\nimport { sizeToClass } from '@/utils/dom'\n\nconst props = withDefaults(defineProps<DropdownMenuProps>(), {\n size: 'normal',\n type: 'normal',\n textEllipsis: true,\n icon: undefined,\n label: undefined,\n labelAlignmentFix: false,\n})\n\nconst wrapperRef = ref<HTMLElement | null>(null)\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst { isOpen, dropdownStyle } = useDropdownAnchor(wrapperRef, dropdownRef, {\n extraStyle: (rect) => ({\n minWidth: `${rect.width}px`,\n maxWidth: `${rect.width * 2}px`,\n }),\n closeOnScroll: true,\n})\n\nfunction toggleOpen() {\n isOpen.value = !isOpen.value\n}\n\nfunction selectItem(item: DropdownMenuItem) {\n item.callback?.()\n isOpen.value = false\n}\n</script>\n\n<template>\n <div
|
|
1
|
+
{"version":3,"file":"admins-components29.js","names":[],"sources":["../src/components/DropdownMenu.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface DropdownMenuItem {\n icon?: string\n label: string\n type?: ButtonType\n size?: ControlSize\n ariaLabel?: string\n class?: string\n callback: () => void\n disabled?: () => boolean\n hidden?: () => boolean\n}\n\nexport interface DropdownMenuProps {\n size?: ControlSize\n icon?: string\n label?: string\n ariaLabel?: string\n textEllipsis?: boolean\n type?: ButtonType\n items: DropdownMenuItem[]\n labelAlignmentFix?: boolean\n class?: string\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport type { ControlSize } from '@/types/types'\nimport type { ButtonType } from '@/components/Button.vue'\nimport { useDropdownAnchor } from '@/composables/useDropdownAnchor'\nimport { sizeToClass } from '@/utils/dom'\n\nconst props = withDefaults(defineProps<DropdownMenuProps>(), {\n size: 'normal',\n type: 'normal',\n textEllipsis: true,\n icon: undefined,\n label: undefined,\n labelAlignmentFix: false,\n})\n\nconst wrapperRef = ref<HTMLElement | null>(null)\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst { isOpen, dropdownStyle } = useDropdownAnchor(wrapperRef, dropdownRef, {\n extraStyle: (rect) => ({\n minWidth: `${rect.width}px`,\n maxWidth: `${rect.width * 2}px`,\n }),\n closeOnScroll: true,\n})\n\nfunction toggleOpen() {\n isOpen.value = !isOpen.value\n}\n\nfunction selectItem(item: DropdownMenuItem) {\n item.callback?.()\n isOpen.value = false\n}\n</script>\n\n<template>\n <div ref=\"wrapperRef\" class=\"ds-wrapper d-inline-block\">\n <button\n type=\"button\"\n class=\"c-btn dm-trigger\"\n :class=\"[\n size === 'small' && 'c-btn-sm',\n size === 'large' && 'c-btn-lg',\n type !== 'normal' && `c-btn-${type}`,\n props.class,\n ]\"\n :aria-label=\"ariaLabel ?? label\"\n @click=\"toggleOpen()\"\n >\n <i v-if=\"icon\" class=\"fa-fw\" :class=\"icon\"></i>\n <span\n v-if=\"label\"\n class=\"btn-label\"\n :class=\"{ 'align-center-fix ': props.labelAlignmentFix }\"\n >{{ label }}</span\n >\n\n <span class=\"c-icon-btn c-icon-btn--chevron\" :class=\"{ 'c-icon-btn--chevron-open': isOpen }\">\n <i class=\"fa-solid fa-chevron-down\" :class=\"{ 'fa-fw': !!label }\"></i>\n </span>\n </button>\n\n <Teleport to=\"body\">\n <div class=\"ac-component\">\n <div v-if=\"isOpen\" ref=\"dropdownRef\" class=\"c-dropdown ds-wrapper\" :style=\"dropdownStyle\">\n <ul class=\"ds-options c-scroll\">\n <li\n v-for=\"(item, idx) in items\"\n v-show=\"!item.hidden?.()\"\n :key=\"`cb-${idx}`\"\n class=\"d-option dm-option c-field-size c-type-color\"\n :class=\"{\n [`c-field-size--${sizeToClass(item.size)}`]: item.size,\n [`c-type-color--${item.type}`]: item.type,\n 'is-disabled': item.disabled?.(),\n [item.class!]: !!item.class,\n }\"\n tabindex=\"0\"\n @click=\"selectItem(item)\"\n :aria-label=\"item.ariaLabel ?? item.label\"\n >\n <i v-if=\"item.icon\" class=\"fa-fw\" :class=\"item.icon\"></i>\n <span class=\"d-option__label\" :class=\"{ 'c-truncate': props.textEllipsis }\">{{\n item.label\n }}</span>\n </li>\n </ul>\n </div>\n </div>\n </Teleport>\n </div>\n</template>\n<style lang=\"scss\" src=\"@/styles/components/dropdown-select.scss\"></style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAiCA,IAAM,IAAQ,GASR,IAAa,EAAwB,IAAI,GACzC,IAAc,EAAwB,IAAI,GAC1C,EAAE,WAAQ,qBAAkB,EAAkB,GAAY,GAAa;GAC3E,aAAa,OAAU;IACrB,UAAU,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MArBL,GAqBK,EAAA,EAAA,EAAA,GApBH,EAmBK,GAAA,MAAA,EAlBmB,EAAA,QAAd,GAAM,cADhB,EAmBK,MAAA;GAhBF,KAAG,MAAQ;GACZ,OAAK,EAAA,CAAC,gDAA8C;sBACR,EAAA,CAAA,EAAY,EAAK,IAAI,MAAM,EAAK;sBAAwC,EAAK,SAAS,EAAK;mBAAqC,EAAK,WAAQ;KAAuB,EAAK,QAAK,CAAA,CAAM,EAAK;;GAMrO,UAAS;GACR,UAAK,MAAE,EAAW,CAAI;GACtB,cAAY,EAAK,aAAa,EAAK;MAE3B,EAAK,QAAA,EAAA,GAAd,EAAyD,KAAA;;GAArC,OAAK,EAAA,CAAC,SAAgB,EAAK,IAAI,CAAA;4BACnD,EAES,QAAA,EAFH,OAAK,EAAA,CAAC,mBAAiB,EAAA,cAAyB,EAAM,aAAY,CAAA,CAAA,EAAA,GAAA,EACtE,EAAK,KAAK,GAAA,CAAA,CAAA,GAAA,IAAA,CAAA,IAAA,CAAA,CAAA,GAAA,CAfH,EAAK,SAAM,CAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components30.js","names":[],"sources":["../src/components/DropdownMenu.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface DropdownMenuItem {\n icon?: string\n label: string\n type?: ButtonType\n size?: ControlSize\n ariaLabel?: string\n class?: string\n callback: () => void\n disabled?: () => boolean\n hidden?: () => boolean\n}\n\nexport interface DropdownMenuProps {\n size?: ControlSize\n icon?: string\n label?: string\n ariaLabel?: string\n textEllipsis?: boolean\n type?: ButtonType\n items: DropdownMenuItem[]\n labelAlignmentFix?: boolean\n class?: string\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport type { ControlSize } from '@/types/types'\nimport type { ButtonType } from '@/components/Button.vue'\nimport { useDropdownAnchor } from '@/composables/useDropdownAnchor'\nimport { sizeToClass } from '@/utils/dom'\n\nconst props = withDefaults(defineProps<DropdownMenuProps>(), {\n size: 'normal',\n type: 'normal',\n textEllipsis: true,\n icon: undefined,\n label: undefined,\n labelAlignmentFix: false,\n})\n\nconst wrapperRef = ref<HTMLElement | null>(null)\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst { isOpen, dropdownStyle } = useDropdownAnchor(wrapperRef, dropdownRef, {\n extraStyle: (rect) => ({\n minWidth: `${rect.width}px`,\n maxWidth: `${rect.width * 2}px`,\n }),\n closeOnScroll: true,\n})\n\nfunction toggleOpen() {\n isOpen.value = !isOpen.value\n}\n\nfunction selectItem(item: DropdownMenuItem) {\n item.callback?.()\n isOpen.value = false\n}\n</script>\n\n<template>\n <div
|
|
1
|
+
{"version":3,"file":"admins-components30.js","names":[],"sources":["../src/components/DropdownMenu.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface DropdownMenuItem {\n icon?: string\n label: string\n type?: ButtonType\n size?: ControlSize\n ariaLabel?: string\n class?: string\n callback: () => void\n disabled?: () => boolean\n hidden?: () => boolean\n}\n\nexport interface DropdownMenuProps {\n size?: ControlSize\n icon?: string\n label?: string\n ariaLabel?: string\n textEllipsis?: boolean\n type?: ButtonType\n items: DropdownMenuItem[]\n labelAlignmentFix?: boolean\n class?: string\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport type { ControlSize } from '@/types/types'\nimport type { ButtonType } from '@/components/Button.vue'\nimport { useDropdownAnchor } from '@/composables/useDropdownAnchor'\nimport { sizeToClass } from '@/utils/dom'\n\nconst props = withDefaults(defineProps<DropdownMenuProps>(), {\n size: 'normal',\n type: 'normal',\n textEllipsis: true,\n icon: undefined,\n label: undefined,\n labelAlignmentFix: false,\n})\n\nconst wrapperRef = ref<HTMLElement | null>(null)\nconst dropdownRef = ref<HTMLElement | null>(null)\nconst { isOpen, dropdownStyle } = useDropdownAnchor(wrapperRef, dropdownRef, {\n extraStyle: (rect) => ({\n minWidth: `${rect.width}px`,\n maxWidth: `${rect.width * 2}px`,\n }),\n closeOnScroll: true,\n})\n\nfunction toggleOpen() {\n isOpen.value = !isOpen.value\n}\n\nfunction selectItem(item: DropdownMenuItem) {\n item.callback?.()\n isOpen.value = false\n}\n</script>\n\n<template>\n <div ref=\"wrapperRef\" class=\"ds-wrapper d-inline-block\">\n <button\n type=\"button\"\n class=\"c-btn dm-trigger\"\n :class=\"[\n size === 'small' && 'c-btn-sm',\n size === 'large' && 'c-btn-lg',\n type !== 'normal' && `c-btn-${type}`,\n props.class,\n ]\"\n :aria-label=\"ariaLabel ?? label\"\n @click=\"toggleOpen()\"\n >\n <i v-if=\"icon\" class=\"fa-fw\" :class=\"icon\"></i>\n <span\n v-if=\"label\"\n class=\"btn-label\"\n :class=\"{ 'align-center-fix ': props.labelAlignmentFix }\"\n >{{ label }}</span\n >\n\n <span class=\"c-icon-btn c-icon-btn--chevron\" :class=\"{ 'c-icon-btn--chevron-open': isOpen }\">\n <i class=\"fa-solid fa-chevron-down\" :class=\"{ 'fa-fw': !!label }\"></i>\n </span>\n </button>\n\n <Teleport to=\"body\">\n <div class=\"ac-component\">\n <div v-if=\"isOpen\" ref=\"dropdownRef\" class=\"c-dropdown ds-wrapper\" :style=\"dropdownStyle\">\n <ul class=\"ds-options c-scroll\">\n <li\n v-for=\"(item, idx) in items\"\n v-show=\"!item.hidden?.()\"\n :key=\"`cb-${idx}`\"\n class=\"d-option dm-option c-field-size c-type-color\"\n :class=\"{\n [`c-field-size--${sizeToClass(item.size)}`]: item.size,\n [`c-type-color--${item.type}`]: item.type,\n 'is-disabled': item.disabled?.(),\n [item.class!]: !!item.class,\n }\"\n tabindex=\"0\"\n @click=\"selectItem(item)\"\n :aria-label=\"item.ariaLabel ?? item.label\"\n >\n <i v-if=\"item.icon\" class=\"fa-fw\" :class=\"item.icon\"></i>\n <span class=\"d-option__label\" :class=\"{ 'c-truncate': props.textEllipsis }\">{{\n item.label\n }}</span>\n </li>\n </ul>\n </div>\n </div>\n </Teleport>\n </div>\n</template>\n<style lang=\"scss\" src=\"@/styles/components/dropdown-select.scss\"></style>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components5.js","names":[],"sources":["../src/components/Button.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type ButtonType = 'normal' | 'primary' | 'dark' | 'success' | 'error' | 'warning' | 'info'\n\nexport type IconPosition = 'left' | 'right'\n\nexport interface ButtonProps {\n size?: ControlSize\n type?: ButtonType\n outline?: boolean\n icon?: string\n iconPosition?: IconPosition\n label?: string\n ariaLabel?: string\n callback?: () => void\n disabled?: boolean | (() => boolean)\n indicator?: string | number\n labelAlignmentFix?: boolean\n class?: string\n}\n\nexport const buttonDefaults = {\n size: 'normal' as ControlSize,\n type: 'normal' as ButtonType,\n outline: false,\n icon: undefined,\n iconPosition: 'left' as IconPosition,\n labelAlignmentFix: false,\n}\n</script>\n\n<script setup lang=\"ts\">\nimport type { ControlSize } from '@/types/types'\nimport { sizeToClass, typeToClass } from '@/utils/dom'\nimport { computed } from 'vue'\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n ...buttonDefaults,\n})\n\nconst classes = computed(() => [\n 'c-btn',\n sizeToClass(props.size, 'c-btn'),\n props.outline && 'c-btn-outline',\n typeToClass(props.type, 'c-btn'),\n props.class,\n])\n\nconst isDisabled = computed(() => {\n if (props.disabled === undefined || props.disabled === null) return false\n return typeof props.disabled === 'function' ? props.disabled() : props.disabled\n})\n</script>\n\n<template>\n <button\n type=\"button\"\n :class=\"classes\"\n :aria-label=\"ariaLabel ?? label\"\n :title=\"ariaLabel ?? label\"\n @click=\"callback?.()\"\n :disabled=\"isDisabled\"\n >\n <i v-if=\"icon && iconPosition === 'left'\" :class=\"icon\"></i>\n <span v-if=\"label\">{{ label }}</span>\n <span\n v-if=\"indicator != null && indicator !== ''\"\n class=\"c-btn-indicator\"\n :aria-label=\"`${indicator}`\"\n >\n {{ indicator }}\n </span>\n <i v-if=\"icon && iconPosition === 'right'\" :class=\"icon\"></i>\n </button>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"admins-components5.js","names":[],"sources":["../src/components/Button.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type ButtonType = 'normal' | 'primary' | 'dark' | 'success' | 'error' | 'warning' | 'info'\n\nexport type IconPosition = 'left' | 'right'\n\nexport interface ButtonProps {\n size?: ControlSize\n type?: ButtonType\n outline?: boolean\n icon?: string\n iconPosition?: IconPosition\n label?: string\n ariaLabel?: string\n callback?: () => void\n disabled?: boolean | (() => boolean)\n indicator?: string | number\n labelAlignmentFix?: boolean\n class?: string\n}\n\nexport const buttonDefaults = {\n size: 'normal' as ControlSize,\n type: 'normal' as ButtonType,\n outline: false,\n icon: undefined,\n iconPosition: 'left' as IconPosition,\n labelAlignmentFix: false,\n}\n</script>\n\n<script setup lang=\"ts\">\nimport type { ControlSize } from '@/types/types'\nimport { sizeToClass, typeToClass } from '@/utils/dom'\nimport { computed } from 'vue'\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n ...buttonDefaults,\n})\n\nconst classes = computed(() => [\n 'c-btn',\n sizeToClass(props.size, 'c-btn'),\n props.outline && 'c-btn-outline',\n typeToClass(props.type, 'c-btn'),\n props.class,\n])\n\nconst isDisabled = computed(() => {\n if (props.disabled === undefined || props.disabled === null) return false\n return typeof props.disabled === 'function' ? props.disabled() : props.disabled\n})\n</script>\n\n<template>\n <button\n type=\"button\"\n :class=\"classes\"\n :aria-label=\"ariaLabel ?? label\"\n :title=\"ariaLabel ?? label\"\n @click=\"callback?.()\"\n :disabled=\"isDisabled\"\n >\n <i v-if=\"icon && iconPosition === 'left'\" :class=\"icon\"></i>\n <span v-if=\"label\" class=\"btn-label\">{{ label }}</span>\n <span\n v-if=\"indicator != null && indicator !== ''\"\n class=\"c-btn-indicator\"\n :aria-label=\"`${indicator}`\"\n >\n {{ indicator }}\n </span>\n <i v-if=\"icon && iconPosition === 'right'\" :class=\"icon\"></i>\n </button>\n</template>\n"],"mappings":";;;;;;;;;;uBAoBa,IAAiB;CAC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
|
3
|
+
import n from "./admins-components42.js";
|
|
4
|
+
import { Fragment as r, createBlock as i, createCommentVNode as a, createElementBlock as o, defineComponent as s, mergeProps as c, openBlock as l, ref as u, renderList as d } from "vue";
|
|
5
|
+
//#region src/components/data-table/DataListActions.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var f = /* @__PURE__ */ s({
|
|
7
|
+
__name: "DataListActions",
|
|
8
|
+
props: {
|
|
9
|
+
actions: {},
|
|
10
|
+
item: {}
|
|
11
|
+
},
|
|
12
|
+
setup(s) {
|
|
13
|
+
let f = u(null);
|
|
14
|
+
function p(e, t) {
|
|
15
|
+
let n = {
|
|
16
|
+
title: e.label ?? "Megerősítés",
|
|
17
|
+
message: "Biztosan végrehajta a műveletet?",
|
|
18
|
+
type: e.type
|
|
19
|
+
}, r = typeof e.withConfirmConfig == "function" ? e.withConfirmConfig(t) : e.withConfirmConfig;
|
|
20
|
+
return {
|
|
21
|
+
...n,
|
|
22
|
+
...r
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function m(e, t) {
|
|
26
|
+
e.withConfirm ? f.value = {
|
|
27
|
+
action: e,
|
|
28
|
+
item: t
|
|
29
|
+
} : e.callback(t);
|
|
30
|
+
}
|
|
31
|
+
function h() {
|
|
32
|
+
f.value &&= (f.value.action.callback(f.value.item), null);
|
|
33
|
+
}
|
|
34
|
+
function g(e) {
|
|
35
|
+
return e.isGroup === !0 && Array.isArray(e.items);
|
|
36
|
+
}
|
|
37
|
+
function _(e, t) {
|
|
38
|
+
return e.items.map((e) => {
|
|
39
|
+
let n = e.disabled, r = e.hidden;
|
|
40
|
+
return {
|
|
41
|
+
icon: e.icon,
|
|
42
|
+
label: e.label ?? "",
|
|
43
|
+
type: e.type,
|
|
44
|
+
size: e.label ? "small" : "normal",
|
|
45
|
+
class: e.class,
|
|
46
|
+
callback: () => m(e, t),
|
|
47
|
+
disabled: n ? () => n(t) : void 0,
|
|
48
|
+
hidden: r ? () => r(t) : void 0
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return (u, v) => (l(), o(r, null, [(l(!0), o(r, null, d(s.actions, (n, u) => (l(), o(r, { key: u }, [n.hidden && n.hidden(s.item) ? a("", !0) : (l(), o(r, { key: 0 }, [g(n) ? (l(), i(t, c({
|
|
53
|
+
key: 0,
|
|
54
|
+
icon: n.icon,
|
|
55
|
+
label: n.label,
|
|
56
|
+
items: _(n, s.item),
|
|
57
|
+
class: n.class
|
|
58
|
+
}, { ref_for: !0 }, n.config), null, 16, [
|
|
59
|
+
"icon",
|
|
60
|
+
"label",
|
|
61
|
+
"items",
|
|
62
|
+
"class"
|
|
63
|
+
])) : (l(), i(e, c({
|
|
64
|
+
key: 1,
|
|
65
|
+
icon: n.icon,
|
|
66
|
+
label: n.label,
|
|
67
|
+
type: n.type,
|
|
68
|
+
ariaLabel: n.ariaLabel,
|
|
69
|
+
class: n.class,
|
|
70
|
+
outline: "",
|
|
71
|
+
callback: () => m(n, s.item),
|
|
72
|
+
disabled: n.disabled ? n.disabled(s.item) : !1
|
|
73
|
+
}, { ref_for: !0 }, n.config), null, 16, [
|
|
74
|
+
"icon",
|
|
75
|
+
"label",
|
|
76
|
+
"type",
|
|
77
|
+
"ariaLabel",
|
|
78
|
+
"class",
|
|
79
|
+
"callback",
|
|
80
|
+
"disabled"
|
|
81
|
+
]))], 64))], 64))), 128)), f.value ? (l(), i(n, c({ key: 0 }, p(f.value.action, f.value.item), {
|
|
82
|
+
onConfirm: h,
|
|
83
|
+
onCancel: v[0] ||= (e) => f.value = null
|
|
84
|
+
}), null, 16)) : a("", !0)], 64));
|
|
11
85
|
}
|
|
12
|
-
|
|
13
|
-
let e = r();
|
|
14
|
-
if (o.value) a.value.clear();
|
|
15
|
-
else for (let t of n()) a.value.add(t[e]);
|
|
16
|
-
i([...a.value]);
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
selectedKeys: a,
|
|
20
|
-
allSelected: o,
|
|
21
|
-
toggle: s,
|
|
22
|
-
toggleAll: c
|
|
23
|
-
};
|
|
24
|
-
}
|
|
86
|
+
});
|
|
25
87
|
//#endregion
|
|
26
|
-
export {
|
|
88
|
+
export { f as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components57.js","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"admins-components57.js","names":[],"sources":["../src/components/data-table/DataListActions.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport type { Action, ActionGroup } from '@/types/data-list'\nimport type { ConfirmModalProps } from '@/components/ConfirmModal.vue'\nimport Button from '@/components/Button.vue'\nimport DropdownMenu from '@/components/DropdownMenu.vue'\nimport ConfirmModal from '@/components/ConfirmModal.vue'\nimport type { DropdownMenuItem } from '@/components/DropdownMenu.vue'\n\ndefineProps<{\n actions: Array<Action | ActionGroup>\n item?: Record<string, unknown>\n}>()\n\nconst activeConfirm = ref<{\n action: Action\n item?: Record<string, unknown>\n} | null>(null)\n\nfunction getConfirmConfig(action: Action, item?: Record<string, unknown>): ConfirmModalProps {\n const defaultConfig = {\n title: action.label ?? 'Megerősítés',\n message: 'Biztosan végrehajta a műveletet?',\n type: action.type,\n }\n const extra =\n typeof action.withConfirmConfig === 'function'\n ? action.withConfirmConfig(item)\n : action.withConfirmConfig\n return {\n ...defaultConfig,\n ...extra,\n }\n}\n\nfunction handleOnClick(action: Action, item?: Record<string, unknown>) {\n if (action.withConfirm) {\n activeConfirm.value = { action, item }\n } else {\n action.callback(item)\n }\n}\n\nfunction handleConfirm() {\n if (activeConfirm.value) {\n activeConfirm.value.action.callback(activeConfirm.value.item)\n activeConfirm.value = null\n }\n}\n\nfunction isActionGroup(entry: Action | ActionGroup): entry is ActionGroup {\n return (entry as ActionGroup).isGroup === true && Array.isArray((entry as ActionGroup).items)\n}\n\nfunction buildActionGroupMenuItems(\n group: ActionGroup,\n item?: Record<string, unknown>,\n): DropdownMenuItem[] {\n return group.items.map((action: Action) => {\n const isDisabled = action.disabled\n const isHidden = action.hidden\n return {\n icon: action.icon,\n label: action.label ?? '',\n type: action.type,\n size: action.label ? 'small' : 'normal',\n class: action.class,\n callback: () => handleOnClick(action, item),\n disabled: isDisabled ? () => isDisabled(item) : undefined,\n hidden: isHidden ? () => isHidden(item) : undefined,\n }\n })\n}\n</script>\n\n<template>\n <template v-for=\"(action, ai) in actions\" :key=\"ai\">\n <template v-if=\"!(action.hidden && action.hidden(item))\">\n <DropdownMenu\n v-if=\"isActionGroup(action)\"\n :icon=\"action.icon\"\n :label=\"action.label\"\n :items=\"buildActionGroupMenuItems(action, item)\"\n :class=\"action.class\"\n v-bind=\"action.config\"\n />\n\n <Button\n v-else\n :icon=\"action.icon\"\n :label=\"action.label\"\n :type=\"action.type\"\n :ariaLabel=\"action.ariaLabel\"\n :class=\"action.class\"\n outline\n :callback=\"() => handleOnClick(action, item)\"\n :disabled=\"action.disabled ? action.disabled(item) : false\"\n v-bind=\"action.config\"\n />\n </template>\n </template>\n\n <ConfirmModal\n v-if=\"activeConfirm\"\n v-bind=\"getConfirmConfig(activeConfirm.action, activeConfirm.item)\"\n @confirm=\"handleConfirm\"\n @cancel=\"activeConfirm = null\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;EAcA,IAAM,IAAgB,EAGZ,IAAI;EAEd,SAAS,EAAiB,GAAgB,GAAmD;GAC3F,IAAM,IAAgB;IACpB,OAAO,EAAO,SAAS;IACvB,SAAS;IACT,MAAM,EAAO;GACf,GACM,IACJ,OAAO,EAAO,qBAAsB,aAChC,EAAO,kBAAkB,CAAI,IAC7B,EAAO;GACb,OAAO;IACL,GAAG;IACH,GAAG;GACL;EACF;EAEA,SAAS,EAAc,GAAgB,GAAgC;GACrE,AAAI,EAAO,cACT,EAAc,QAAQ;IAAE;IAAQ;GAAK,IAErC,EAAO,SAAS,CAAI;EAExB;EAEA,SAAS,IAAgB;GACvB,AAEE,EAAc,WADd,EAAc,MAAM,OAAO,SAAS,EAAc,MAAM,IAAI,G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EAAA,GAAA,EAAA,YAMnB,EAAA,SAAA,EAAA,GADR,EAKE,GALF,EAKE,EAAA,KAAA,EAAA,GAHQ,EAAiB,EAAA,MAAc,QAAQ,EAAA,MAAc,IAAI,GAAA;GAChE,WAAS;GACT,UAAM,AAAA,EAAA,QAAA,MAAE,EAAA,QAAa"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
compact: !1
|
|
5
|
-
}, t = { compact: !1 }, n = {
|
|
6
|
-
layout: "screen",
|
|
7
|
-
compact: !1
|
|
8
|
-
};
|
|
1
|
+
import e from "./admins-components57.js";
|
|
2
|
+
//#region src/components/data-table/DataListActions.vue
|
|
3
|
+
var t = e;
|
|
9
4
|
//#endregion
|
|
10
|
-
export { t as
|
|
5
|
+
export { t as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components58.js","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"admins-components58.js","names":[],"sources":["../src/components/data-table/DataListActions.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport type { Action, ActionGroup } from '@/types/data-list'\nimport type { ConfirmModalProps } from '@/components/ConfirmModal.vue'\nimport Button from '@/components/Button.vue'\nimport DropdownMenu from '@/components/DropdownMenu.vue'\nimport ConfirmModal from '@/components/ConfirmModal.vue'\nimport type { DropdownMenuItem } from '@/components/DropdownMenu.vue'\n\ndefineProps<{\n actions: Array<Action | ActionGroup>\n item?: Record<string, unknown>\n}>()\n\nconst activeConfirm = ref<{\n action: Action\n item?: Record<string, unknown>\n} | null>(null)\n\nfunction getConfirmConfig(action: Action, item?: Record<string, unknown>): ConfirmModalProps {\n const defaultConfig = {\n title: action.label ?? 'Megerősítés',\n message: 'Biztosan végrehajta a műveletet?',\n type: action.type,\n }\n const extra =\n typeof action.withConfirmConfig === 'function'\n ? action.withConfirmConfig(item)\n : action.withConfirmConfig\n return {\n ...defaultConfig,\n ...extra,\n }\n}\n\nfunction handleOnClick(action: Action, item?: Record<string, unknown>) {\n if (action.withConfirm) {\n activeConfirm.value = { action, item }\n } else {\n action.callback(item)\n }\n}\n\nfunction handleConfirm() {\n if (activeConfirm.value) {\n activeConfirm.value.action.callback(activeConfirm.value.item)\n activeConfirm.value = null\n }\n}\n\nfunction isActionGroup(entry: Action | ActionGroup): entry is ActionGroup {\n return (entry as ActionGroup).isGroup === true && Array.isArray((entry as ActionGroup).items)\n}\n\nfunction buildActionGroupMenuItems(\n group: ActionGroup,\n item?: Record<string, unknown>,\n): DropdownMenuItem[] {\n return group.items.map((action: Action) => {\n const isDisabled = action.disabled\n const isHidden = action.hidden\n return {\n icon: action.icon,\n label: action.label ?? '',\n type: action.type,\n size: action.label ? 'small' : 'normal',\n class: action.class,\n callback: () => handleOnClick(action, item),\n disabled: isDisabled ? () => isDisabled(item) : undefined,\n hidden: isHidden ? () => isHidden(item) : undefined,\n }\n })\n}\n</script>\n\n<template>\n <template v-for=\"(action, ai) in actions\" :key=\"ai\">\n <template v-if=\"!(action.hidden && action.hidden(item))\">\n <DropdownMenu\n v-if=\"isActionGroup(action)\"\n :icon=\"action.icon\"\n :label=\"action.label\"\n :items=\"buildActionGroupMenuItems(action, item)\"\n :class=\"action.class\"\n v-bind=\"action.config\"\n />\n\n <Button\n v-else\n :icon=\"action.icon\"\n :label=\"action.label\"\n :type=\"action.type\"\n :ariaLabel=\"action.ariaLabel\"\n :class=\"action.class\"\n outline\n :callback=\"() => handleOnClick(action, item)\"\n :disabled=\"action.disabled ? action.disabled(item) : false\"\n v-bind=\"action.config\"\n />\n </template>\n </template>\n\n <ConfirmModal\n v-if=\"activeConfirm\"\n v-bind=\"getConfirmConfig(activeConfirm.action, activeConfirm.item)\"\n @confirm=\"handleConfirm\"\n @cancel=\"activeConfirm = null\"\n />\n</template>\n"],"mappings":""}
|
|
@@ -1,8 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
let
|
|
5
|
-
|
|
1
|
+
import { computed as e, ref as t } from "vue";
|
|
2
|
+
//#region src/composables/useSelection.ts
|
|
3
|
+
function n(n, r, i) {
|
|
4
|
+
let a = t(/* @__PURE__ */ new Set()), o = e(() => {
|
|
5
|
+
let e = r(), t = n();
|
|
6
|
+
return t.length > 0 && e != null && t.every((t) => a.value.has(t[e]));
|
|
7
|
+
});
|
|
8
|
+
function s(e) {
|
|
9
|
+
let t = e[r()];
|
|
10
|
+
a.value.has(t) ? a.value.delete(t) : a.value.add(t), i([...a.value]);
|
|
11
|
+
}
|
|
12
|
+
function c() {
|
|
13
|
+
let e = r();
|
|
14
|
+
if (o.value) a.value.clear();
|
|
15
|
+
else for (let t of n()) a.value.add(t[e]);
|
|
16
|
+
i([...a.value]);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
selectedKeys: a,
|
|
20
|
+
allSelected: o,
|
|
21
|
+
toggle: s,
|
|
22
|
+
toggleAll: c
|
|
23
|
+
};
|
|
6
24
|
}
|
|
7
25
|
//#endregion
|
|
8
|
-
export {
|
|
26
|
+
export { n as useSelection };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components59.js","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"admins-components59.js","names":[],"sources":["../src/composables/useSelection.ts"],"sourcesContent":["import { ref, computed } from 'vue'\n\nexport function useSelection(\n getItems: () => Record<string, unknown>[],\n getAttr: () => string | undefined,\n emit: (selected: unknown[]) => void,\n) {\n const selectedKeys = ref<Set<unknown>>(new Set())\n\n const allSelected = computed(() => {\n const attr = getAttr()\n const items = getItems()\n return items.length > 0 && attr != null && items.every((i) => selectedKeys.value.has(i[attr]))\n })\n\n function toggle(item: Record<string, unknown>) {\n const key = item[getAttr()!]\n if (selectedKeys.value.has(key)) {\n selectedKeys.value.delete(key)\n } else {\n selectedKeys.value.add(key)\n }\n emit([...selectedKeys.value])\n }\n\n function toggleAll() {\n const attr = getAttr()!\n if (allSelected.value) {\n selectedKeys.value.clear()\n } else {\n for (const item of getItems()) {\n selectedKeys.value.add(item[attr])\n }\n }\n emit([...selectedKeys.value])\n }\n\n return { selectedKeys, allSelected, toggle, toggleAll }\n}\n"],"mappings":";;AAEA,SAAgB,EACd,GACA,GACA,GACA;CACA,IAAM,IAAe,kBAAkB,IAAI,IAAI,CAAC,GAE1C,IAAc,QAAe;EACjC,IAAM,IAAO,EAAQ,GACf,IAAQ,EAAS;EACvB,OAAO,EAAM,SAAS,KAAK,KAAQ,QAAQ,EAAM,OAAO,MAAM,EAAa,MAAM,IAAI,EAAE,EAAK,CAAC;CAC/F,CAAC;CAED,SAAS,EAAO,GAA+B;EAC7C,IAAM,IAAM,EAAK,EAAQ;EAMzB,AALI,EAAa,MAAM,IAAI,CAAG,IAC5B,EAAa,MAAM,OAAO,CAAG,IAE7B,EAAa,MAAM,IAAI,CAAG,GAE5B,EAAK,CAAC,GAAG,EAAa,KAAK,CAAC;CAC9B;CAEA,SAAS,IAAY;EACnB,IAAM,IAAO,EAAQ;EACrB,IAAI,EAAY,OACd,EAAa,MAAM,MAAM;OAEzB,KAAK,IAAM,KAAQ,EAAS,GAC1B,EAAa,MAAM,IAAI,EAAK,EAAK;EAGrC,EAAK,CAAC,GAAG,EAAa,KAAK,CAAC;CAC9B;CAEA,OAAO;EAAE;EAAc;EAAa;EAAQ;CAAU;AACxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components6.js","names":[],"sources":["../src/components/Button.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type ButtonType = 'normal' | 'primary' | 'dark' | 'success' | 'error' | 'warning' | 'info'\n\nexport type IconPosition = 'left' | 'right'\n\nexport interface ButtonProps {\n size?: ControlSize\n type?: ButtonType\n outline?: boolean\n icon?: string\n iconPosition?: IconPosition\n label?: string\n ariaLabel?: string\n callback?: () => void\n disabled?: boolean | (() => boolean)\n indicator?: string | number\n labelAlignmentFix?: boolean\n class?: string\n}\n\nexport const buttonDefaults = {\n size: 'normal' as ControlSize,\n type: 'normal' as ButtonType,\n outline: false,\n icon: undefined,\n iconPosition: 'left' as IconPosition,\n labelAlignmentFix: false,\n}\n</script>\n\n<script setup lang=\"ts\">\nimport type { ControlSize } from '@/types/types'\nimport { sizeToClass, typeToClass } from '@/utils/dom'\nimport { computed } from 'vue'\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n ...buttonDefaults,\n})\n\nconst classes = computed(() => [\n 'c-btn',\n sizeToClass(props.size, 'c-btn'),\n props.outline && 'c-btn-outline',\n typeToClass(props.type, 'c-btn'),\n props.class,\n])\n\nconst isDisabled = computed(() => {\n if (props.disabled === undefined || props.disabled === null) return false\n return typeof props.disabled === 'function' ? props.disabled() : props.disabled\n})\n</script>\n\n<template>\n <button\n type=\"button\"\n :class=\"classes\"\n :aria-label=\"ariaLabel ?? label\"\n :title=\"ariaLabel ?? label\"\n @click=\"callback?.()\"\n :disabled=\"isDisabled\"\n >\n <i v-if=\"icon && iconPosition === 'left'\" :class=\"icon\"></i>\n <span v-if=\"label\">{{ label }}</span>\n <span\n v-if=\"indicator != null && indicator !== ''\"\n class=\"c-btn-indicator\"\n :aria-label=\"`${indicator}`\"\n >\n {{ indicator }}\n </span>\n <i v-if=\"icon && iconPosition === 'right'\" :class=\"icon\"></i>\n </button>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"admins-components6.js","names":[],"sources":["../src/components/Button.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type ButtonType = 'normal' | 'primary' | 'dark' | 'success' | 'error' | 'warning' | 'info'\n\nexport type IconPosition = 'left' | 'right'\n\nexport interface ButtonProps {\n size?: ControlSize\n type?: ButtonType\n outline?: boolean\n icon?: string\n iconPosition?: IconPosition\n label?: string\n ariaLabel?: string\n callback?: () => void\n disabled?: boolean | (() => boolean)\n indicator?: string | number\n labelAlignmentFix?: boolean\n class?: string\n}\n\nexport const buttonDefaults = {\n size: 'normal' as ControlSize,\n type: 'normal' as ButtonType,\n outline: false,\n icon: undefined,\n iconPosition: 'left' as IconPosition,\n labelAlignmentFix: false,\n}\n</script>\n\n<script setup lang=\"ts\">\nimport type { ControlSize } from '@/types/types'\nimport { sizeToClass, typeToClass } from '@/utils/dom'\nimport { computed } from 'vue'\n\nconst props = withDefaults(defineProps<ButtonProps>(), {\n ...buttonDefaults,\n})\n\nconst classes = computed(() => [\n 'c-btn',\n sizeToClass(props.size, 'c-btn'),\n props.outline && 'c-btn-outline',\n typeToClass(props.type, 'c-btn'),\n props.class,\n])\n\nconst isDisabled = computed(() => {\n if (props.disabled === undefined || props.disabled === null) return false\n return typeof props.disabled === 'function' ? props.disabled() : props.disabled\n})\n</script>\n\n<template>\n <button\n type=\"button\"\n :class=\"classes\"\n :aria-label=\"ariaLabel ?? label\"\n :title=\"ariaLabel ?? label\"\n @click=\"callback?.()\"\n :disabled=\"isDisabled\"\n >\n <i v-if=\"icon && iconPosition === 'left'\" :class=\"icon\"></i>\n <span v-if=\"label\" class=\"btn-label\">{{ label }}</span>\n <span\n v-if=\"indicator != null && indicator !== ''\"\n class=\"c-btn-indicator\"\n :aria-label=\"`${indicator}`\"\n >\n {{ indicator }}\n </span>\n <i v-if=\"icon && iconPosition === 'right'\" :class=\"icon\"></i>\n </button>\n</template>\n"],"mappings":""}
|
|
@@ -1,32 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
setup(i) {
|
|
11
|
-
let d = i, f = s(!1), p = t(() => d.items.length), m = t(() => Math.max(0, p.value - d.visibleCount)), h = t(() => f.value || p.value <= d.visibleCount ? d.items : d.items.slice(0, d.visibleCount)), g = t(() => f.value ? 0 : m.value);
|
|
12
|
-
function _(e) {
|
|
13
|
-
return e == null ? "" : typeof e == "string" ? e : e.label ?? (e.id == null ? "" : String(e.id));
|
|
14
|
-
}
|
|
15
|
-
function v() {
|
|
16
|
-
f.value = !f.value;
|
|
17
|
-
}
|
|
18
|
-
return (t, i) => (o(), r("span", { class: a(["tag-list", d.class]) }, [(o(!0), r(e, null, c(h.value, (e, t) => (o(), r("span", {
|
|
19
|
-
key: t,
|
|
20
|
-
class: "tag-list__item"
|
|
21
|
-
}, l(_(e)) + l(t < h.value.length - 1 ? "," : ""), 1))), 128)), g.value > 0 ? (o(), r("button", {
|
|
22
|
-
key: 0,
|
|
23
|
-
type: "button",
|
|
24
|
-
class: "tag-list__toggle",
|
|
25
|
-
"aria-expanded": f.value,
|
|
26
|
-
title: f.value ? "Összecsukás" : `További ${g.value} megjelenítése`,
|
|
27
|
-
onClick: v
|
|
28
|
-
}, " +" + l(g.value), 9, u)) : n("", !0)], 2));
|
|
29
|
-
}
|
|
30
|
-
});
|
|
1
|
+
//#region src/types/data-list.ts
|
|
2
|
+
var e = {
|
|
3
|
+
striped: !0,
|
|
4
|
+
compact: !1
|
|
5
|
+
}, t = { compact: !1 }, n = {
|
|
6
|
+
layout: "screen",
|
|
7
|
+
compact: !1
|
|
8
|
+
};
|
|
31
9
|
//#endregion
|
|
32
|
-
export {
|
|
10
|
+
export { t as dataCardsSettingsDefaults, n as dataListSettingsDefaults, e as dataTableSettingsDefaults };
|