admins-components 9.0.67 → 9.0.69
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-components29.js +19 -19
- package/dist/admins-components29.js.map +1 -1
- package/dist/admins-components30.js.map +1 -1
- package/dist/admins-components57.js +88 -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-components60.js +9 -28
- 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/index.d.ts +1 -0
- package/dist/src/styles/components/data-table/tag-list.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
|
@@ -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({ "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) }]) }, [...f[1] ||= [s("i", { class: "fa-solid fa-fw fa-chevron-down" }, null, -1)]], 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 v-if=\"label\" :class=\"{ 'align-center-fix ': props.labelAlignmentFix }\">{{\n label\n }}</span>\n\n <span class=\"c-icon-btn c-icon-btn--chevron\" :class=\"{ 'c-icon-btn--chevron-open': isOpen }\">\n <i class=\"fa-solid fa-fw fa-chevron-down\"></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,GAAG,EAAK,MAAM;IACxB,UAAU,GAAG,EAAK,QAAQ,EAAE;GAC9B;GACA,eAAe;EACjB,CAAC;EAED,SAAS,IAAa;GACpB,EAAO,QAAQ,CAAC,EAAO;EACzB;EAEA,SAAS,EAAW,GAAwB;GAE1C,AADA,EAAK,WAAW,GAChB,EAAO,QAAQ;EACjB;yBAIE,EAmDM,OAAA;YAnDG;GAAJ,KAAI;GAAa,OAAM;MAC1B,EAoBS,UAAA;GAnBP,MAAK;GACL,OAAK,EAAA,CAAC,oBAAkB;IACN,EAAA,SAAI,WAAA;IAAoC,EAAA,SAAI,WAAA;IAAoC,EAAA,SAAI,YAAA,SAA0B,EAAA;IAAgB,EAAM;;GAMrJ,cAAY,EAAA,aAAa,EAAA;GACzB,SAAK,AAAA,EAAA,QAAA,MAAE,EAAU;;GAET,EAAA,QAAA,EAAA,GAAT,EAA+C,KAAA;;IAAhC,OAAK,EAAA,CAAC,SAAgB,EAAA,IAAI,CAAA;;GAC7B,EAAA,SAAA,EAAA,GAAZ,EAES,QAAA;;IAFW,OAAK,EAAA,EAAA,qBAAyB,EAAM,kBAAiB,CAAA;QACvE,EAAA,KAAK,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA;GAGP,EAEO,QAAA,EAFD,OAAK,EAAA,CAAC,kCAAgC,EAAA,4BAAuC,EAAA,CAAA,EAAM,CAAA,CAAA,EAAA,GAAA,CAAA,GAAA,AAAA,EAAA,OAAA,CACvF,EAA8C,KAAA,EAA3C,OAAM,iCAAgC,GAAA,MAAA,EAAA,CAAA,CAAA,GAAA,CAAA;mBAI7C,EA2BW,GAAA,EA3BD,IAAG,OAAM,GAAA,CACjB,EAyBM,OAzBN,GAyBM,CAxBO,EAAA,CAAA,KAAA,EAAA,GAAX,EAuBM,OAAA;;YAvBiB;GAAJ,KAAI;GAAc,OAAM;GAAyB,OAAK,EAAE,EAAA,CAAA,CAAa;MACtF,EAqBK,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 v-if=\"label\" :class=\"{ 'align-center-fix ': props.labelAlignmentFix }\">{{\n label\n }}</span>\n\n <span class=\"c-icon-btn c-icon-btn--chevron\" :class=\"{ 'c-icon-btn--chevron-open': isOpen }\">\n <i class=\"fa-solid fa-fw fa-chevron-down\"></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,26 +1,90 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import e from "./admins-components6.js";
|
|
2
|
+
import t from "./admins-components30.js";
|
|
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
|
+
size: n.label ? "small" : "normal",
|
|
69
|
+
ariaLabel: n.ariaLabel,
|
|
70
|
+
class: n.class,
|
|
71
|
+
outline: "",
|
|
72
|
+
callback: () => m(n, s.item),
|
|
73
|
+
disabled: n.disabled ? n.disabled(s.item) : !1
|
|
74
|
+
}, { ref_for: !0 }, n.config), null, 16, [
|
|
75
|
+
"icon",
|
|
76
|
+
"label",
|
|
77
|
+
"type",
|
|
78
|
+
"size",
|
|
79
|
+
"ariaLabel",
|
|
80
|
+
"class",
|
|
81
|
+
"callback",
|
|
82
|
+
"disabled"
|
|
83
|
+
]))], 64))], 64))), 128)), f.value ? (l(), i(n, c({ key: 0 }, p(f.value.action, f.value.item), {
|
|
84
|
+
onConfirm: h,
|
|
85
|
+
onCancel: v[0] ||= (e) => f.value = null
|
|
86
|
+
}), null, 16)) : a("", !0)], 64));
|
|
11
87
|
}
|
|
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
|
-
}
|
|
88
|
+
});
|
|
25
89
|
//#endregion
|
|
26
|
-
export {
|
|
90
|
+
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 = 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 :size=\"action.label ? 'small' : 'normal'\"\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,IAAQ,OAAO,EAAO,qBAAsB,aAC9C,EAAO,kBAAkB,CAAI,IAC7B,EAAO;GACX,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,GACtC;EAE1B;EAEA,SAAS,EAAc,GAAmD;GACxE,OAAQ,EAAsB,YAAY,MAAQ,MAAM,QAAS,EAAsB,KAAK;EAC9F;EAEA,SAAS,EACP,GACA,GACoB;GACpB,OAAO,EAAM,MAAM,KAAK,MAAmB;IACzC,IAAM,IAAa,EAAO,UACpB,IAAW,EAAO;IACxB,OAAO;KACL,MAAM,EAAO;KACb,OAAO,EAAO,SAAS;KACvB,MAAM,EAAO;KACb,MAAM,EAAO,QAAQ,UAAU;KAC/B,OAAO,EAAO;KACd,gBAAgB,EAAc,GAAQ,CAAI;KAC1C,UAAU,UAAmB,EAAW,CAAI,IAAI,KAAA;KAChD,QAAQ,UAAiB,EAAS,CAAI,IAAI,KAAA;IAC5C;GACF,CAAC;EACH;6CAIE,EAyBW,GAAA,MAAA,EAzBsB,EAAA,UAAf,GAAQ,wBAAsB,EAAE,GAAA,CAC9B,EAAO,UAAU,EAAO,OAAO,EAAA,IAAI,IAqB5B,EAAA,IAAA,EAAA,KArB4B,EAAA,GAArD,EAuBW,GAAA,EAAA,KAAA,EAAA,GAAA,CArBD,EAAc,CAAM,KAAA,EAAA,GAD5B,EAOE,GAPF,EAOE;;GALC,MAAM,EAAO;GACb,OAAO,EAAO;GACd,OAAO,EAA0B,GAAQ,EAAA,IAAI;GAC7C,OAAO,EAAO;sBACP,EAAO,MAAM,GAAA,MAAA,IAAA;GAAA;GAAA;GAAA;GAAA;EAAA,CAAA,MAAA,EAAA,GAGvB,EAYE,GAZF,EAYE;;GAVC,MAAM,EAAO;GACb,OAAO,EAAO;GACd,MAAM,EAAO;GACb,MAAM,EAAO,QAAK,UAAA;GAClB,WAAW,EAAO;GAClB,OAAO,EAAO;GACf,SAAA;GACC,gBAAgB,EAAc,GAAQ,EAAA,IAAI;GAC1C,UAAU,EAAO,WAAW,EAAO,SAAS,EAAA,IAAI,IAAA;sBACzC,EAAO,MAAM,GAAA,MAAA,IAAA;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA;GAAA;EAAA,CAAA,EAAA,GAAA,EAAA,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 = 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 :size=\"action.label ? 'small' : 'normal'\"\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,29 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
setup(a) {
|
|
11
|
-
let f = a, p = c(!1), m = t(() => f.items.length), h = t(() => Math.max(0, m.value - f.visibleCount)), g = t(() => p.value || m.value <= f.visibleCount ? f.items : f.items.slice(0, f.visibleCount)), _ = t(() => p.value ? 0 : h.value);
|
|
12
|
-
function v(e) {
|
|
13
|
-
return e == null ? "" : typeof e == "string" ? e : e.label ?? (e.id == null ? "" : String(e.id));
|
|
14
|
-
}
|
|
15
|
-
function y() {
|
|
16
|
-
p.value = !p.value;
|
|
17
|
-
}
|
|
18
|
-
return (t, a) => (s(), r("span", { class: o(["tag-list", f.class]) }, [(s(!0), r(e, null, l(g.value, (t, n) => (s(), r(e, { key: n }, [i(u(v(t)) + u(n < g.value.length - 1 ? ", " : ""), 1)], 64))), 128)), _.value > 0 ? (s(), r("button", {
|
|
19
|
-
key: 0,
|
|
20
|
-
type: "button",
|
|
21
|
-
class: "tag-list__toggle",
|
|
22
|
-
"aria-expanded": p.value,
|
|
23
|
-
title: p.value ? "Összecsukás" : `További ${_.value} megjelenítése`,
|
|
24
|
-
onClick: y
|
|
25
|
-
}, " +" + u(_.value), 9, d)) : n("", !0)], 2));
|
|
26
|
-
}
|
|
27
|
-
});
|
|
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
|
+
};
|
|
28
9
|
//#endregion
|
|
29
|
-
export {
|
|
10
|
+
export { t as dataCardsSettingsDefaults, n as dataListSettingsDefaults, e as dataTableSettingsDefaults };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components60.js","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"admins-components60.js","names":[],"sources":["../src/types/data-list.ts"],"sourcesContent":["import type { DropdownOption } from '@/components/DropdownSelect.vue'\nimport type { PickedDate, PickedUtcRange } from '@/types/types'\nimport type { ButtonType } from '@/components/Button.vue'\nimport type { ConfirmModalProps } from '@/components/ConfirmModal.vue'\n\nexport type FilterValue = string | PickedDate | PickedUtcRange | string[] | null | undefined\n\nexport interface FilterConfig {\n type: 'text' | 'date' | 'date-range' | 'select' | 'multi-select'\n key: string\n placeholder?: string\n options?: DropdownOption[]\n}\n\nexport type LayoutMode = 'table' | 'cards' | 'screen'\n\nexport interface DataTableSettings {\n striped: boolean\n compact: boolean\n}\n\nexport interface DataCardsSettings {\n compact: boolean\n}\n\nexport interface DataListSettings extends DataTableSettings, DataCardsSettings {\n layout: LayoutMode\n columns: Record<string, boolean>\n cardHeaderColumns: Record<string, boolean>\n columnOrder: string[]\n cardHeaderOrder: string[]\n}\n\nexport interface PageSettings {\n page: number\n pageSize: number\n}\n\nexport interface PaginatorSettings extends PageSettings {\n total: number\n}\n\nexport interface DataListConfig {\n selectableAttr?: string\n columns: Column[]\n\n actions?: Array<Action | ActionGroup>\n actionHeader?: string\n}\n\nexport type ColumnType = 'normal' | 'uuid' | 'date' | 'datetime'\n\nexport interface Column {\n visible?: boolean\n primary?: boolean\n hideable?: boolean\n defaultCardHeader?: boolean\n label: string\n property: string\n sort?: Sort | boolean\n type?: ColumnType\n class?: string\n headerClass?: string\n hideCopyToClipboard?: boolean\n hideHeader?: boolean\n\n converter?: ((v: any, item: any) => any)\n loading?: (() => boolean)\n}\n\nexport type SortDirection = 'asc' | 'desc' | null\n\nexport interface Sort {\n label: string\n callback: (property: string, direction: SortDirection) => any\n}\n\nexport interface Action {\n icon: string\n label?: string\n ariaLabel?: string\n cardLabel?: string\n type?: ButtonType\n class?: string\n config?: Record<string, any>\n disabled?: (item: any) => boolean\n hidden?: (item: any) => boolean\n callback: (item: any) => any\n withConfirm?: boolean\n withConfirmConfig?: (item: any) => ConfirmModalProps\n}\n\nexport interface ActionGroup {\n isGroup: true\n icon?: string\n label?: string\n ariaLabel?: string\n cardLabel?: string\n class?: string\n config?: Record<string, any>\n items: Action[]\n disabled?: (item: any) => boolean\n hidden?: (item: any) => boolean\n}\n\nexport const dataTableSettingsDefaults: DataTableSettings = {\n striped: true,\n compact: false,\n}\n\nexport const dataCardsSettingsDefaults: DataCardsSettings = {\n compact: false,\n}\n\nexport const dataListSettingsDefaults: Partial<DataListSettings> = {\n layout: 'screen',\n compact: false,\n}\n"],"mappings":";AAyGA,IAAa,IAA+C;CAC1D,SAAS;CACT,SAAS;AACX,GAEa,IAA+C,EAC1D,SAAS,GACX,GAEa,IAAsD;CACjE,QAAQ;CACR,SAAS;AACX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admins-components61.js","names":[],"sources":["../src/utils/dataList.ts"],"sourcesContent":["import type { Column } from '@/types/data-list'\nimport type { Action, ActionGroup } from '@/types/data-list'\nimport type { DropdownMenuItem } from '@/components/DropdownMenu.vue'\n\nexport function getColumnValue(item: Record<string, unknown>, col: Column | undefined) {\n if (!col) return ''\n const value = (item as any)[col.property]\n return col.converter ? col.converter(value, item) : value\n}\n\nexport function isUuid(str: string): boolean {\n return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(str)\n}\n\nexport function isActionGroup(entry: Action | ActionGroup): entry is ActionGroup {\n return (entry as ActionGroup).isGroup === true && Array.isArray((entry as ActionGroup).items)\n}\n\nexport function buildActionGroupMenuItems(\n group: ActionGroup,\n item: Record<string, unknown>,\n): DropdownMenuItem[] {\n return group.items.map((action: Action) => ({\n icon: action.icon,\n label: action.label ?? '',\n type: action.type,\n size: action.label ? 'small' : 'normal',\n callback: () => action.callback(item),\n }))\n}\n"],"mappings":";AAIA,SAAgB,EAAe,GAA+B,GAAyB;CACrF,IAAI,CAAC,GAAK,OAAO;CACjB,IAAM,IAAS,EAAa,EAAI;CAChC,OAAO,EAAI,YAAY,EAAI,UAAU,GAAO,CAAI,IAAI;AACtD"}
|
|
@@ -1,7 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, defineComponent as i, normalizeClass as a, openBlock as o, ref as s, renderList as c, toDisplayString as l } from "vue";
|
|
2
|
+
//#region src/components/data-table/TagList.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var u = ["aria-expanded", "title"], d = /* @__PURE__ */ i({
|
|
4
|
+
__name: "TagList",
|
|
5
|
+
props: {
|
|
6
|
+
items: { default: () => [] },
|
|
7
|
+
visibleCount: { default: 3 },
|
|
8
|
+
class: { default: void 0 }
|
|
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
|
+
});
|
|
6
31
|
//#endregion
|
|
7
|
-
export {
|
|
32
|
+
export { d as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components62.js","names":[],"sources":["../src/components/data-table/TagList.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref } from 'vue'\n\ninterface TagListProps {\n items: Array<string | { label?: string; id?: string | number }>\n visibleCount?: number\n class?: string\n}\n\nconst props = withDefaults(defineProps<TagListProps>(), {\n visibleCount: 3,\n items: () => [],\n class: undefined,\n})\n\nconst expanded = ref(false)\n\nconst total = computed(() => props.items.length)\nconst overflow = computed(() => Math.max(0, total.value - props.visibleCount))\n\nconst visibleItems = computed(() => {\n if (expanded.value || total.value <= props.visibleCount) {\n return props.items\n }\n return props.items.slice(0, props.visibleCount)\n})\n\nconst hiddenCount = computed(() => {\n return expanded.value ? 0 : overflow.value\n})\n\nfunction labelOf(item: TagListProps['items'][number]): string {\n if (item == null) return ''\n if (typeof item === 'string') return item\n return item.label ?? (item.id != null ? String(item.id) : '')\n}\n\nfunction toggle() {\n expanded.value = !expanded.value\n}\n</script>\n\n<template>\n <span class=\"tag-list\" :class=\"props.class\">\n
|
|
1
|
+
{"version":3,"file":"admins-components62.js","names":[],"sources":["../src/components/data-table/TagList.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref } from 'vue'\n\ninterface TagListProps {\n items: Array<string | { label?: string; id?: string | number }>\n visibleCount?: number\n class?: string\n}\n\nconst props = withDefaults(defineProps<TagListProps>(), {\n visibleCount: 3,\n items: () => [],\n class: undefined,\n})\n\nconst expanded = ref(false)\n\nconst total = computed(() => props.items.length)\nconst overflow = computed(() => Math.max(0, total.value - props.visibleCount))\n\nconst visibleItems = computed(() => {\n if (expanded.value || total.value <= props.visibleCount) {\n return props.items\n }\n return props.items.slice(0, props.visibleCount)\n})\n\nconst hiddenCount = computed(() => {\n return expanded.value ? 0 : overflow.value\n})\n\nfunction labelOf(item: TagListProps['items'][number]): string {\n if (item == null) return ''\n if (typeof item === 'string') return item\n return item.label ?? (item.id != null ? String(item.id) : '')\n}\n\nfunction toggle() {\n expanded.value = !expanded.value\n}\n</script>\n\n<template>\n <span class=\"tag-list\" :class=\"props.class\">\n <span v-for=\"(item, i) in visibleItems\" :key=\"i\" class=\"tag-list__item\"\n >{{ labelOf(item) }}{{ i < visibleItems.length - 1 ? ',' : '' }}</span\n >\n<!-- <template v-for=\"(item, i) in visibleItems\" :key=\"i\"\n >{{ labelOf(item) }}{{ i < visibleItems.length - 1 ? ', ' : '' }}</template\n > -->\n <button\n v-if=\"hiddenCount > 0\"\n type=\"button\"\n class=\"tag-list__toggle\"\n :aria-expanded=\"expanded\"\n :title=\"expanded ? 'Összecsukás' : `További ${hiddenCount} megjelenítése`\"\n @click=\"toggle\"\n >\n +{{ hiddenCount }}\n </button>\n <!-- <button\n v-else-if=\"expanded && total > visibleCount\"\n type=\"button\"\n class=\"tag-list__toggle tag-list__toggle--collapse\"\n :aria-expanded=\"expanded\"\n title=\"Összecsukás\"\n @click=\"toggle\"\n >\n <i class=\"fa-solid fa-fw fa-chevron-up\" aria-hidden=\"true\"></i>\n </button> -->\n </span>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/data-table/tag-list.scss\"></style>\n"],"mappings":";;;;;;;;;;EASA,IAAM,IAAQ,GAMR,IAAW,EAAI,EAAK,GAEpB,IAAQ,QAAe,EAAM,MAAM,MAAM,GACzC,IAAW,QAAe,KAAK,IAAI,GAAG,EAAM,QAAQ,EAAM,YAAY,CAAC,GAEvE,IAAe,QACf,EAAS,SAAS,EAAM,SAAS,EAAM,eAClC,EAAM,QAER,EAAM,MAAM,MAAM,GAAG,EAAM,YAAY,CAC/C,GAEK,IAAc,QACX,EAAS,QAAQ,IAAI,EAAS,KACtC;EAED,SAAS,EAAQ,GAA6C;GAG5D,OAFI,KAAQ,OAAa,KACrB,OAAO,KAAS,WAAiB,IAC9B,EAAK,UAAU,EAAK,MAAM,OAAyB,KAAlB,OAAO,EAAK,EAAE;EACxD;EAEA,SAAS,IAAS;GAChB,EAAS,QAAQ,CAAC,EAAS;EAC7B;yBAIE,EA2BO,QAAA,EA3BD,OAAK,EAAA,CAAC,YAAmB,EAAM,KAAK,CAAA,EAAA,GAAA,EAAA,EAAA,EAAA,GACxC,EAEC,GAAA,MAAA,EAFyB,EAAA,QAAZ,GAAM,YAApB,EAEC,QAAA;GAFwC,KAAK;GAAG,OAAM;OACjD,EAAQ,CAAI,CAAA,IAAA,EAAO,IAAI,EAAA,MAAa,SAAM,IAAA,MAAA,EAAA,GAAA,CAAA,YAMxC,EAAA,QAAW,KAAA,EAAA,GADnB,EASS,UAAA;;GAPP,MAAK;GACL,OAAM;GACL,iBAAe,EAAA;GACf,OAAO,EAAA,QAAQ,gBAAA,WAA8B,EAAA,MAAW;GACxD,SAAO;KACT,OACE,EAAG,EAAA,KAAW,GAAA,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,GAAA,CAAA"}
|
|
@@ -1,71 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
//#region src/components/data-table/DataCell.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var v = { class: "dc-cell" }, y = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "dc-loading"
|
|
10
|
-
}, b = { key: 2 }, x = ["innerHTML"], S = {
|
|
11
|
-
key: 3,
|
|
12
|
-
class: "dc-datetime"
|
|
13
|
-
}, C = { class: "dc-datetime__part" }, w = {
|
|
14
|
-
key: 0,
|
|
15
|
-
class: "dc-datetime__sep"
|
|
16
|
-
}, T = { class: "dc-datetime__part" }, E = { key: 4 }, D = ["innerHTML"], O = /* @__PURE__ */ u({
|
|
17
|
-
__name: "DataCell",
|
|
18
|
-
props: {
|
|
19
|
-
item: {},
|
|
20
|
-
col: {},
|
|
21
|
-
copy: {
|
|
22
|
-
type: Boolean,
|
|
23
|
-
default: !0
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
setup(u) {
|
|
27
|
-
let O = u, k = i(() => n(O.item, O.col)), A = i(() => d(k.value)), j = i(() => r()(k.value)), M = i(() => {
|
|
28
|
-
if (O.col.type !== "datetime") return null;
|
|
29
|
-
let e = k.value;
|
|
30
|
-
if (!e) return {
|
|
31
|
-
date: "",
|
|
32
|
-
time: ""
|
|
33
|
-
};
|
|
34
|
-
let t = e.indexOf(" ");
|
|
35
|
-
return t === -1 ? {
|
|
36
|
-
date: e,
|
|
37
|
-
time: ""
|
|
38
|
-
} : {
|
|
39
|
-
date: e.slice(0, t),
|
|
40
|
-
time: e.slice(t + 1)
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
return (n, r) => {
|
|
44
|
-
let i = m("tooltip");
|
|
45
|
-
return f(), s("span", v, [p(n.$slots, "cell", {
|
|
46
|
-
item: u.item,
|
|
47
|
-
col: u.col,
|
|
48
|
-
value: k.value
|
|
49
|
-
}, () => [u.col.loading?.() ? (f(), s("span", y, [l(e, {
|
|
50
|
-
loading: !0,
|
|
51
|
-
size: "1rem"
|
|
52
|
-
})])) : A.value ? (f(), a(h(k.value), { key: 1 })) : u.col.type === "uuid" ? _((f(), s("span", b, [c("span", { innerHTML: j.value }, null, 8, x), u.copy && k.value ? (f(), a(t, {
|
|
53
|
-
key: 0,
|
|
54
|
-
value: k.value
|
|
55
|
-
}, null, 8, ["value"])) : o("", !0)])), [[i, k.value]]) : u.col.type === "datetime" ? (f(), s("span", S, [
|
|
56
|
-
c("span", C, g(M.value?.date), 1),
|
|
57
|
-
M.value?.time ? (f(), s("span", w)) : o("", !0),
|
|
58
|
-
c("span", T, g(M.value?.time), 1),
|
|
59
|
-
u.copy && k.value ? (f(), a(t, {
|
|
60
|
-
key: 1,
|
|
61
|
-
value: k.value
|
|
62
|
-
}, null, 8, ["value"])) : o("", !0)
|
|
63
|
-
])) : (f(), s("span", E, [c("span", { innerHTML: k.value }, null, 8, D), u.copy && k.value ? (f(), a(t, {
|
|
64
|
-
key: 0,
|
|
65
|
-
value: k.value
|
|
66
|
-
}, null, 8, ["value"])) : o("", !0)]))])]);
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
});
|
|
1
|
+
import './src/styles/components/data-table/tag-list.scss_vue_type_style_index_0_src_true_lang.css';
|
|
2
|
+
import e from "./admins-components62.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/data-table/TagList.vue
|
|
5
|
+
var t = e;
|
|
70
6
|
//#endregion
|
|
71
|
-
export {
|
|
7
|
+
export { t as default };
|