admins-components 9.0.81 → 9.0.83
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-components173.js +151 -89
- package/dist/admins-components173.js.map +1 -1
- package/dist/admins-components38.js +25 -19
- package/dist/admins-components38.js.map +1 -1
- package/dist/admins-components40.js.map +1 -1
- package/dist/admins-components46.js +44 -44
- package/dist/admins-components46.js.map +1 -1
- package/dist/admins-components48.js.map +1 -1
- package/dist/admins-components51.js +9 -2
- package/dist/admins-components51.js.map +1 -1
- package/dist/admins-components52.js.map +1 -1
- package/dist/admins-components68.js +12 -9
- package/dist/admins-components68.js.map +1 -1
- package/dist/admins-components70.js.map +1 -1
- package/dist/admins-components87.js +1 -1
- package/dist/admins-components87.js.map +1 -1
- package/dist/admins-components91.js +74 -82
- package/dist/admins-components91.js.map +1 -1
- package/dist/admins-components93.js.map +1 -1
- package/dist/main.css +1 -1
- package/dist/src/components/Modal.vue.d.ts +2 -0
- package/dist/src/utils/dataFilters.d.ts +1 -0
- package/dist/test.html +163 -0
- package/dist/test81.html +161 -0
- package/dist/vueformelements/ArticlePickerElement.vue_vue_type_style_index_0_scoped_0afb93e7_lang.css +1 -0
- package/dist/widget/dist/favicon.ico +0 -0
- package/dist/widget/dist/search-posts-widget.css +1 -0
- package/dist/widget/dist/search-posts-widget.es.js +11197 -0
- package/dist/widget/dist/search-posts-widget.umd.js +34 -0
- package/dist/widget.css +1 -0
- package/package.json +6 -2
- package/dist/main.css.map +0 -1
- package/dist/vueformelements/ArticlePickerElement.vue_vue_type_style_index_0_scoped_54217a66_lang.css +0 -1
|
@@ -3,23 +3,23 @@ import t from "./admins-components19.js";
|
|
|
3
3
|
import n from "./admins-components40.js";
|
|
4
4
|
import { computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, onMounted as d, onUnmounted as f, openBlock as p, ref as m, vModelText as h, watch as g, withCtx as _, withDirectives as v } from "vue";
|
|
5
5
|
//#region src/components/custom/ImagePicker.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var y = { class: "ac-component
|
|
6
|
+
var y = { class: "ac-component c-image-picker" }, b = { class: "c-image-picker__preview-section" }, x = { class: "c-image-picker__preview" }, S = ["src", "alt"], C = {
|
|
7
7
|
key: 1,
|
|
8
8
|
class: "c-image-picker__placeholder"
|
|
9
|
-
},
|
|
9
|
+
}, w = { class: "c-image-picker__buttons" }, T = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "c-image-picker__details"
|
|
12
|
-
},
|
|
12
|
+
}, E = { class: "c-input-row" }, D = ["disabled"], O = { class: "c-input-row" }, k = ["disabled"], A = [
|
|
13
13
|
"viewid",
|
|
14
14
|
"environment",
|
|
15
15
|
"aeurl"
|
|
16
|
-
],
|
|
16
|
+
], j = {
|
|
17
17
|
id: "",
|
|
18
18
|
url: "",
|
|
19
19
|
isAdult: !1,
|
|
20
20
|
source: "",
|
|
21
21
|
title: ""
|
|
22
|
-
},
|
|
22
|
+
}, M = /*@__PURE__*/ l({
|
|
23
23
|
__name: "ImagePicker",
|
|
24
24
|
props: {
|
|
25
25
|
modelValue: { default: void 0 },
|
|
@@ -39,31 +39,31 @@ var y = { class: "ac-component" }, b = { class: "c-image-picker" }, x = { class:
|
|
|
39
39
|
imageViewId: {}
|
|
40
40
|
},
|
|
41
41
|
emits: ["update:modelValue"],
|
|
42
|
-
setup(l, { emit:
|
|
43
|
-
let
|
|
44
|
-
g(() =>
|
|
45
|
-
|
|
46
|
-
}, { deep: !0 }), g(() =>
|
|
47
|
-
e && (
|
|
42
|
+
setup(l, { emit: M }) {
|
|
43
|
+
let N = l, P = M, F = m(j), I = m(!1);
|
|
44
|
+
g(() => F.value, () => {
|
|
45
|
+
P("update:modelValue", F.value);
|
|
46
|
+
}, { deep: !0 }), g(() => N.modelValue, (e) => {
|
|
47
|
+
e && (F.value = e);
|
|
48
48
|
}, {
|
|
49
49
|
deep: !0,
|
|
50
50
|
immediate: !0
|
|
51
51
|
});
|
|
52
|
-
let
|
|
52
|
+
let L = `${typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `ip-${Date.now()}-${Math.random().toString(36).slice(2)}`}-image-picker-causation`;
|
|
53
53
|
d(() => {
|
|
54
|
-
if (!customElements.get("hvg-search-image") && !document.querySelector(`script[src="${
|
|
54
|
+
if (!customElements.get("hvg-search-image") && !document.querySelector(`script[src="${N.searchImageWidgetUrl}"]`)) {
|
|
55
55
|
let e = document.createElement("script");
|
|
56
|
-
e.type = "text/javascript", e.src =
|
|
56
|
+
e.type = "text/javascript", e.src = N.searchImageWidgetUrl, e.async = !0, document.head.appendChild(e);
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
|
-
let
|
|
60
|
-
if (
|
|
61
|
-
}),
|
|
62
|
-
e.preventDefault(),
|
|
59
|
+
let R = r(() => F.value && (F.value.url && F.value.url.length > 0 || F.value.id && F.value.id.length > 0)), z = r(() => {
|
|
60
|
+
if (R.value) return F.value.url && F.value.url.length > 0 ? F.value.url : `${N.imageBaseUrl}/${N.imageViewId}/${F.value.id}.img`;
|
|
61
|
+
}), B = r(() => N.direction === "horizontal"), V = (e) => {
|
|
62
|
+
e.preventDefault(), I.value = !0;
|
|
63
|
+
}, H = (e) => {
|
|
64
|
+
e.preventDefault(), F.value = { ...j };
|
|
63
65
|
}, U = (e) => {
|
|
64
|
-
e.
|
|
65
|
-
}, W = (e) => {
|
|
66
|
-
e?.detail?.causationid === R && (L.value = !1, e.detail?.image && (I.value = {
|
|
66
|
+
e?.detail?.causationid === L && (I.value = !1, e.detail?.image && (F.value = {
|
|
67
67
|
id: e.detail.image.id,
|
|
68
68
|
url: "",
|
|
69
69
|
isAdult: e.detail.image.isAdult,
|
|
@@ -72,69 +72,69 @@ var y = { class: "ac-component" }, b = { class: "c-image-picker" }, x = { class:
|
|
|
72
72
|
}));
|
|
73
73
|
};
|
|
74
74
|
return d(() => {
|
|
75
|
-
window.addEventListener("image-selected",
|
|
75
|
+
window.addEventListener("image-selected", U);
|
|
76
76
|
}), f(() => {
|
|
77
|
-
window.removeEventListener("image-selected",
|
|
78
|
-
}), (r, d) => (p(), o("div", y, [s("div",
|
|
77
|
+
window.removeEventListener("image-selected", U);
|
|
78
|
+
}), (r, d) => (p(), o("div", y, [s("div", { class: u(["c-image-picker__container", { "c-image-picker__container--horizontal": B.value }]) }, [s("div", b, [s("div", x, [R.value ? (p(), o("img", {
|
|
79
79
|
key: 0,
|
|
80
|
-
src:
|
|
81
|
-
alt:
|
|
80
|
+
src: z.value,
|
|
81
|
+
alt: F.value.title || "Selected image",
|
|
82
82
|
class: "c-image-picker__img"
|
|
83
|
-
}, null, 8,
|
|
83
|
+
}, null, 8, S)) : (p(), o("p", C, "Nincs kiválasztott kép"))]), s("div", w, [c(e, {
|
|
84
84
|
type: "success",
|
|
85
85
|
label: "Kép kiválasztása",
|
|
86
86
|
class: "nowrap",
|
|
87
|
-
onClick:
|
|
87
|
+
onClick: V,
|
|
88
88
|
icon: "fa-solid fa-image"
|
|
89
89
|
}), c(e, {
|
|
90
90
|
type: "error",
|
|
91
91
|
label: "Eltávolítás",
|
|
92
92
|
class: "nowrap",
|
|
93
|
-
onClick:
|
|
93
|
+
onClick: H,
|
|
94
94
|
icon: "fa-solid fa-trash"
|
|
95
|
-
})])]), l.details &&
|
|
95
|
+
})])]), l.details && F.value.id ? (p(), o("div", T, [
|
|
96
96
|
s("div", null, [d[4] ||= s("label", {
|
|
97
97
|
for: "image-source",
|
|
98
98
|
class: "c-label"
|
|
99
|
-
}, "Forrás", -1), s("div",
|
|
100
|
-
"onUpdate:modelValue": d[0] ||= (e) =>
|
|
99
|
+
}, "Forrás", -1), s("div", E, [v(s("input", {
|
|
100
|
+
"onUpdate:modelValue": d[0] ||= (e) => F.value.source = e,
|
|
101
101
|
id: "image-source",
|
|
102
102
|
type: "text",
|
|
103
103
|
class: "c-input",
|
|
104
104
|
placeholder: "Kép forrása",
|
|
105
105
|
disabled: !l.editable
|
|
106
|
-
}, null, 8,
|
|
106
|
+
}, null, 8, D), [[h, F.value.source]])])]),
|
|
107
107
|
s("div", null, [d[5] ||= s("label", {
|
|
108
108
|
for: "image-title",
|
|
109
109
|
class: "c-label"
|
|
110
|
-
}, "Cím / Alt szöveg", -1), s("div",
|
|
111
|
-
"onUpdate:modelValue": d[1] ||= (e) =>
|
|
110
|
+
}, "Cím / Alt szöveg", -1), s("div", O, [v(s("textarea", {
|
|
111
|
+
"onUpdate:modelValue": d[1] ||= (e) => F.value.title = e,
|
|
112
112
|
id: "image-title",
|
|
113
113
|
class: "c-input c-image-picker__textarea",
|
|
114
114
|
placeholder: "Cím vagy alt szöveg",
|
|
115
115
|
disabled: !l.editable
|
|
116
|
-
}, null, 8,
|
|
116
|
+
}, null, 8, k), [[h, F.value.title]])])]),
|
|
117
117
|
c(t, {
|
|
118
|
-
modelValue:
|
|
119
|
-
"onUpdate:modelValue": d[2] ||= (e) =>
|
|
118
|
+
modelValue: F.value.isAdult,
|
|
119
|
+
"onUpdate:modelValue": d[2] ||= (e) => F.value.isAdult = e,
|
|
120
120
|
label: "Felnőtt tartalom",
|
|
121
121
|
disabled: !l.editable
|
|
122
122
|
}, null, 8, ["modelValue", "disabled"])
|
|
123
|
-
])) : a("", !0)], 2),
|
|
123
|
+
])) : a("", !0)], 2), I.value ? (p(), i(n, {
|
|
124
124
|
key: 0,
|
|
125
125
|
modalClass: "c-image-picker-modal",
|
|
126
|
-
onClose: d[3] ||= (e) =>
|
|
126
|
+
onClose: d[3] ||= (e) => I.value = !1
|
|
127
127
|
}, {
|
|
128
128
|
default: _(() => [s("hvg-search-image", {
|
|
129
|
-
causationid:
|
|
129
|
+
causationid: L,
|
|
130
130
|
viewid: l.imageViewId,
|
|
131
131
|
environment: l.environment,
|
|
132
132
|
aeurl: l.articleEditorUrl,
|
|
133
133
|
selectonly: "true"
|
|
134
|
-
}, null, 8,
|
|
134
|
+
}, null, 8, A)]),
|
|
135
135
|
_: 1
|
|
136
|
-
})) : a("", !0)])
|
|
136
|
+
})) : a("", !0)]));
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
139
|
//#endregion
|
|
140
|
-
export {
|
|
140
|
+
export { M as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components46.js","names":[],"sources":["../src/components/custom/ImagePicker.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface ImagePickerModel {\n id: string\n url: string\n source: string\n title: string\n isAdult: boolean\n}\n\nexport interface ImagePickerProps {\n modelValue?: ImagePickerModel\n details?: boolean\n editable?: boolean\n direction?: 'horizontal' | 'vertical'\n articleEditorUrl: string\n environment: string\n searchImageWidgetUrl: string\n imageBaseUrl: string\n imageViewId: string\n}\n\nconst defaultValue: ImagePickerModel = {\n id: '',\n url: '',\n isAdult: false,\n source: '',\n title: '',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, ref, watch } from 'vue'\nimport Modal from '@/components/Modal.vue'\nimport Button from '@/components/Button.vue'\nimport Checkbox from '@/components/Checkbox.vue'\n\nconst props = withDefaults(defineProps<ImagePickerProps>(), {\n modelValue: undefined,\n details: false,\n editable: false,\n direction: 'vertical',\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: ImagePickerModel): void\n}>()\n\nconst local = ref<ImagePickerModel>(defaultValue)\nconst showImageModal = ref(false)\n\nwatch(\n () => local.value,\n () => {\n emit('update:modelValue', local.value)\n },\n { deep: true },\n)\n\nwatch(\n () => props.modelValue,\n (newValue) => {\n if (newValue) {\n local.value = newValue\n }\n },\n { deep: true, immediate: true },\n)\n\nconst uniqueId = (() => {\n if (typeof crypto !== 'undefined' && crypto.randomUUID) return crypto.randomUUID()\n return `ip-${Date.now()}-${Math.random().toString(36).slice(2)}`\n})()\n\nconst imageCausationId = `${uniqueId}-image-picker-causation`\n\nonMounted(() => {\n if (!customElements.get('hvg-search-image')) {\n if (!document.querySelector(`script[src=\"${props.searchImageWidgetUrl}\"]`)) {\n const script = document.createElement('script')\n script.type = 'text/javascript'\n script.src = props.searchImageWidgetUrl\n script.async = true\n document.head.appendChild(script)\n }\n }\n})\n\nconst hasImage = computed(() => {\n return (\n local.value &&\n ((local.value.url && local.value.url.length > 0) ||\n (local.value.id && local.value.id.length > 0))\n )\n})\n\nconst imageUrl = computed(() => {\n if (!hasImage.value) return undefined\n if (local.value.url && local.value.url.length > 0) return local.value.url\n return `${props.imageBaseUrl}/${props.imageViewId}/${local.value.id}.img`\n})\n\nconst isHorizontal = computed(() => props.direction === 'horizontal')\n\nconst selectImage = (event: MouseEvent) => {\n event.preventDefault()\n showImageModal.value = true\n}\n\nconst resetImage = (event: MouseEvent) => {\n event.preventDefault()\n local.value = { ...defaultValue }\n}\n\nconst onImageSelected = (e: CustomEvent) => {\n if (e?.detail?.causationid === imageCausationId) {\n showImageModal.value = false\n\n if (e.detail?.image) {\n local.value = {\n id: e.detail.image.id,\n url: '',\n isAdult: e.detail.image.isAdult,\n source: e.detail.image.source,\n title: e.detail.image.title,\n }\n }\n }\n}\n\nonMounted(() => {\n window.addEventListener('image-selected', onImageSelected as EventListener)\n})\n\nonUnmounted(() => {\n window.removeEventListener('image-selected', onImageSelected as EventListener)\n})\n</script>\n\n<template>\n <div class=\"ac-component
|
|
1
|
+
{"version":3,"file":"admins-components46.js","names":[],"sources":["../src/components/custom/ImagePicker.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface ImagePickerModel {\n id: string\n url: string\n source: string\n title: string\n isAdult: boolean\n}\n\nexport interface ImagePickerProps {\n modelValue?: ImagePickerModel\n details?: boolean\n editable?: boolean\n direction?: 'horizontal' | 'vertical'\n articleEditorUrl: string\n environment: string\n searchImageWidgetUrl: string\n imageBaseUrl: string\n imageViewId: string\n}\n\nconst defaultValue: ImagePickerModel = {\n id: '',\n url: '',\n isAdult: false,\n source: '',\n title: '',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, ref, watch } from 'vue'\nimport Modal from '@/components/Modal.vue'\nimport Button from '@/components/Button.vue'\nimport Checkbox from '@/components/Checkbox.vue'\n\nconst props = withDefaults(defineProps<ImagePickerProps>(), {\n modelValue: undefined,\n details: false,\n editable: false,\n direction: 'vertical',\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: ImagePickerModel): void\n}>()\n\nconst local = ref<ImagePickerModel>(defaultValue)\nconst showImageModal = ref(false)\n\nwatch(\n () => local.value,\n () => {\n emit('update:modelValue', local.value)\n },\n { deep: true },\n)\n\nwatch(\n () => props.modelValue,\n (newValue) => {\n if (newValue) {\n local.value = newValue\n }\n },\n { deep: true, immediate: true },\n)\n\nconst uniqueId = (() => {\n if (typeof crypto !== 'undefined' && crypto.randomUUID) return crypto.randomUUID()\n return `ip-${Date.now()}-${Math.random().toString(36).slice(2)}`\n})()\n\nconst imageCausationId = `${uniqueId}-image-picker-causation`\n\nonMounted(() => {\n if (!customElements.get('hvg-search-image')) {\n if (!document.querySelector(`script[src=\"${props.searchImageWidgetUrl}\"]`)) {\n const script = document.createElement('script')\n script.type = 'text/javascript'\n script.src = props.searchImageWidgetUrl\n script.async = true\n document.head.appendChild(script)\n }\n }\n})\n\nconst hasImage = computed(() => {\n return (\n local.value &&\n ((local.value.url && local.value.url.length > 0) ||\n (local.value.id && local.value.id.length > 0))\n )\n})\n\nconst imageUrl = computed(() => {\n if (!hasImage.value) return undefined\n if (local.value.url && local.value.url.length > 0) return local.value.url\n return `${props.imageBaseUrl}/${props.imageViewId}/${local.value.id}.img`\n})\n\nconst isHorizontal = computed(() => props.direction === 'horizontal')\n\nconst selectImage = (event: MouseEvent) => {\n event.preventDefault()\n showImageModal.value = true\n}\n\nconst resetImage = (event: MouseEvent) => {\n event.preventDefault()\n local.value = { ...defaultValue }\n}\n\nconst onImageSelected = (e: CustomEvent) => {\n if (e?.detail?.causationid === imageCausationId) {\n showImageModal.value = false\n\n if (e.detail?.image) {\n local.value = {\n id: e.detail.image.id,\n url: '',\n isAdult: e.detail.image.isAdult,\n source: e.detail.image.source,\n title: e.detail.image.title,\n }\n }\n }\n}\n\nonMounted(() => {\n window.addEventListener('image-selected', onImageSelected as EventListener)\n})\n\nonUnmounted(() => {\n window.removeEventListener('image-selected', onImageSelected as EventListener)\n})\n</script>\n\n<template>\n <div class=\"ac-component c-image-picker\">\n <div\n class=\"c-image-picker__container\"\n :class=\"{ 'c-image-picker__container--horizontal': isHorizontal }\"\n >\n <div class=\"c-image-picker__preview-section\">\n <div class=\"c-image-picker__preview\">\n <img\n v-if=\"hasImage\"\n :src=\"imageUrl\"\n :alt=\"local.title || 'Selected image'\"\n class=\"c-image-picker__img\"\n />\n <p v-else class=\"c-image-picker__placeholder\">Nincs kiválasztott kép</p>\n </div>\n\n <!-- Action Buttons -->\n <div class=\"c-image-picker__buttons\">\n <Button\n type=\"success\"\n label=\"Kép kiválasztása\"\n class=\"nowrap\"\n @click=\"selectImage\"\n icon=\"fa-solid fa-image\"\n ></Button>\n <Button\n type=\"error\"\n label=\"Eltávolítás\"\n class=\"nowrap\"\n @click=\"resetImage\"\n icon=\"fa-solid fa-trash\"\n ></Button>\n </div>\n </div>\n\n <!-- Details Section -->\n <div v-if=\"details && local.id\" class=\"c-image-picker__details\">\n <!-- Source Input -->\n <div>\n <label for=\"image-source\" class=\"c-label\">Forrás</label>\n <div class=\"c-input-row\">\n <input\n v-model=\"local.source\"\n id=\"image-source\"\n type=\"text\"\n class=\"c-input\"\n placeholder=\"Kép forrása\"\n :disabled=\"!editable\"\n />\n </div>\n </div>\n\n <!-- Title/Alt Text Input -->\n <div>\n <label for=\"image-title\" class=\"c-label\">Cím / Alt szöveg</label>\n <div class=\"c-input-row\">\n <textarea\n v-model=\"local.title\"\n id=\"image-title\"\n class=\"c-input c-image-picker__textarea\"\n placeholder=\"Cím vagy alt szöveg\"\n :disabled=\"!editable\"\n />\n </div>\n </div>\n\n <!-- Adult Content Checkbox -->\n <Checkbox v-model=\"local.isAdult\" label=\"Felnőtt tartalom\" :disabled=\"!editable\" />\n </div>\n </div>\n\n <!-- Image Search Modal Dialog -->\n <Modal v-if=\"showImageModal\" modalClass=\"c-image-picker-modal\" @close=\"showImageModal = false\">\n <hvg-search-image\n :causationid=\"imageCausationId\"\n :viewid=\"imageViewId\"\n :environment=\"environment\"\n :aeurl=\"articleEditorUrl\"\n selectonly=\"true\"\n />\n </Modal>\n </div>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/image-picker.scss\"></style>\n"],"mappings":";;;;;;;;;;;;;;;GAqBM,IAAiC;CACrC,IAAI;CACJ,KAAK;CACL,SAAS;CACT,QAAQ;CACR,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;EASA,IAAM,IAAQ,GAOR,IAAO,GAIP,IAAQ,EAAsB,CAAY,GAC1C,IAAiB,EAAI,EAAK;EAUhC,AARA,QACQ,EAAM,aACN;GACJ,EAAK,qBAAqB,EAAM,KAAK;EACvC,GACA,EAAE,MAAM,GAAK,CACf,GAEA,QACQ,EAAM,aACX,MAAa;GACZ,AAAI,MACF,EAAM,QAAQ;EAElB,GACA;GAAE,MAAM;GAAM,WAAW;EAAK,CAChC;EAOA,IAAM,IAAmB,GAJnB,OAAO,SAAW,OAAe,OAAO,aAAmB,OAAO,WAAW,IAC1E,MAAM,KAAK,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,IAG1B;EAErC,QAAgB;GACd,IAAI,CAAC,eAAe,IAAI,kBAAkB,KACpC,CAAC,SAAS,cAAc,eAAe,EAAM,qBAAqB,GAAG,GAAG;IAC1E,IAAM,IAAS,SAAS,cAAc,QAAQ;IAI9C,AAHA,EAAO,OAAO,mBACd,EAAO,MAAM,EAAM,sBACnB,EAAO,QAAQ,IACf,SAAS,KAAK,YAAY,CAAM;GAClC;EAEJ,CAAC;EAED,IAAM,IAAW,QAEb,EAAM,UACJ,EAAM,MAAM,OAAO,EAAM,MAAM,IAAI,SAAS,KAC3C,EAAM,MAA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AAA,EAQQ,GAAA;;GARqB,YAAW;GAAwB,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,QAAc;;GACnF,SAAA,QAME,CANF,EAME,oBAAA;IALC,aAAa;IACb,QAAQ,EAAA;IACR,aAAa,EAAA;IACb,OAAO,EAAA;IACR,YAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components48.js","names":[],"sources":["../src/components/custom/ImagePicker.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface ImagePickerModel {\n id: string\n url: string\n source: string\n title: string\n isAdult: boolean\n}\n\nexport interface ImagePickerProps {\n modelValue?: ImagePickerModel\n details?: boolean\n editable?: boolean\n direction?: 'horizontal' | 'vertical'\n articleEditorUrl: string\n environment: string\n searchImageWidgetUrl: string\n imageBaseUrl: string\n imageViewId: string\n}\n\nconst defaultValue: ImagePickerModel = {\n id: '',\n url: '',\n isAdult: false,\n source: '',\n title: '',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, ref, watch } from 'vue'\nimport Modal from '@/components/Modal.vue'\nimport Button from '@/components/Button.vue'\nimport Checkbox from '@/components/Checkbox.vue'\n\nconst props = withDefaults(defineProps<ImagePickerProps>(), {\n modelValue: undefined,\n details: false,\n editable: false,\n direction: 'vertical',\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: ImagePickerModel): void\n}>()\n\nconst local = ref<ImagePickerModel>(defaultValue)\nconst showImageModal = ref(false)\n\nwatch(\n () => local.value,\n () => {\n emit('update:modelValue', local.value)\n },\n { deep: true },\n)\n\nwatch(\n () => props.modelValue,\n (newValue) => {\n if (newValue) {\n local.value = newValue\n }\n },\n { deep: true, immediate: true },\n)\n\nconst uniqueId = (() => {\n if (typeof crypto !== 'undefined' && crypto.randomUUID) return crypto.randomUUID()\n return `ip-${Date.now()}-${Math.random().toString(36).slice(2)}`\n})()\n\nconst imageCausationId = `${uniqueId}-image-picker-causation`\n\nonMounted(() => {\n if (!customElements.get('hvg-search-image')) {\n if (!document.querySelector(`script[src=\"${props.searchImageWidgetUrl}\"]`)) {\n const script = document.createElement('script')\n script.type = 'text/javascript'\n script.src = props.searchImageWidgetUrl\n script.async = true\n document.head.appendChild(script)\n }\n }\n})\n\nconst hasImage = computed(() => {\n return (\n local.value &&\n ((local.value.url && local.value.url.length > 0) ||\n (local.value.id && local.value.id.length > 0))\n )\n})\n\nconst imageUrl = computed(() => {\n if (!hasImage.value) return undefined\n if (local.value.url && local.value.url.length > 0) return local.value.url\n return `${props.imageBaseUrl}/${props.imageViewId}/${local.value.id}.img`\n})\n\nconst isHorizontal = computed(() => props.direction === 'horizontal')\n\nconst selectImage = (event: MouseEvent) => {\n event.preventDefault()\n showImageModal.value = true\n}\n\nconst resetImage = (event: MouseEvent) => {\n event.preventDefault()\n local.value = { ...defaultValue }\n}\n\nconst onImageSelected = (e: CustomEvent) => {\n if (e?.detail?.causationid === imageCausationId) {\n showImageModal.value = false\n\n if (e.detail?.image) {\n local.value = {\n id: e.detail.image.id,\n url: '',\n isAdult: e.detail.image.isAdult,\n source: e.detail.image.source,\n title: e.detail.image.title,\n }\n }\n }\n}\n\nonMounted(() => {\n window.addEventListener('image-selected', onImageSelected as EventListener)\n})\n\nonUnmounted(() => {\n window.removeEventListener('image-selected', onImageSelected as EventListener)\n})\n</script>\n\n<template>\n <div class=\"ac-component
|
|
1
|
+
{"version":3,"file":"admins-components48.js","names":[],"sources":["../src/components/custom/ImagePicker.vue"],"sourcesContent":["<script lang=\"ts\">\nexport interface ImagePickerModel {\n id: string\n url: string\n source: string\n title: string\n isAdult: boolean\n}\n\nexport interface ImagePickerProps {\n modelValue?: ImagePickerModel\n details?: boolean\n editable?: boolean\n direction?: 'horizontal' | 'vertical'\n articleEditorUrl: string\n environment: string\n searchImageWidgetUrl: string\n imageBaseUrl: string\n imageViewId: string\n}\n\nconst defaultValue: ImagePickerModel = {\n id: '',\n url: '',\n isAdult: false,\n source: '',\n title: '',\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, onMounted, onUnmounted, ref, watch } from 'vue'\nimport Modal from '@/components/Modal.vue'\nimport Button from '@/components/Button.vue'\nimport Checkbox from '@/components/Checkbox.vue'\n\nconst props = withDefaults(defineProps<ImagePickerProps>(), {\n modelValue: undefined,\n details: false,\n editable: false,\n direction: 'vertical',\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: ImagePickerModel): void\n}>()\n\nconst local = ref<ImagePickerModel>(defaultValue)\nconst showImageModal = ref(false)\n\nwatch(\n () => local.value,\n () => {\n emit('update:modelValue', local.value)\n },\n { deep: true },\n)\n\nwatch(\n () => props.modelValue,\n (newValue) => {\n if (newValue) {\n local.value = newValue\n }\n },\n { deep: true, immediate: true },\n)\n\nconst uniqueId = (() => {\n if (typeof crypto !== 'undefined' && crypto.randomUUID) return crypto.randomUUID()\n return `ip-${Date.now()}-${Math.random().toString(36).slice(2)}`\n})()\n\nconst imageCausationId = `${uniqueId}-image-picker-causation`\n\nonMounted(() => {\n if (!customElements.get('hvg-search-image')) {\n if (!document.querySelector(`script[src=\"${props.searchImageWidgetUrl}\"]`)) {\n const script = document.createElement('script')\n script.type = 'text/javascript'\n script.src = props.searchImageWidgetUrl\n script.async = true\n document.head.appendChild(script)\n }\n }\n})\n\nconst hasImage = computed(() => {\n return (\n local.value &&\n ((local.value.url && local.value.url.length > 0) ||\n (local.value.id && local.value.id.length > 0))\n )\n})\n\nconst imageUrl = computed(() => {\n if (!hasImage.value) return undefined\n if (local.value.url && local.value.url.length > 0) return local.value.url\n return `${props.imageBaseUrl}/${props.imageViewId}/${local.value.id}.img`\n})\n\nconst isHorizontal = computed(() => props.direction === 'horizontal')\n\nconst selectImage = (event: MouseEvent) => {\n event.preventDefault()\n showImageModal.value = true\n}\n\nconst resetImage = (event: MouseEvent) => {\n event.preventDefault()\n local.value = { ...defaultValue }\n}\n\nconst onImageSelected = (e: CustomEvent) => {\n if (e?.detail?.causationid === imageCausationId) {\n showImageModal.value = false\n\n if (e.detail?.image) {\n local.value = {\n id: e.detail.image.id,\n url: '',\n isAdult: e.detail.image.isAdult,\n source: e.detail.image.source,\n title: e.detail.image.title,\n }\n }\n }\n}\n\nonMounted(() => {\n window.addEventListener('image-selected', onImageSelected as EventListener)\n})\n\nonUnmounted(() => {\n window.removeEventListener('image-selected', onImageSelected as EventListener)\n})\n</script>\n\n<template>\n <div class=\"ac-component c-image-picker\">\n <div\n class=\"c-image-picker__container\"\n :class=\"{ 'c-image-picker__container--horizontal': isHorizontal }\"\n >\n <div class=\"c-image-picker__preview-section\">\n <div class=\"c-image-picker__preview\">\n <img\n v-if=\"hasImage\"\n :src=\"imageUrl\"\n :alt=\"local.title || 'Selected image'\"\n class=\"c-image-picker__img\"\n />\n <p v-else class=\"c-image-picker__placeholder\">Nincs kiválasztott kép</p>\n </div>\n\n <!-- Action Buttons -->\n <div class=\"c-image-picker__buttons\">\n <Button\n type=\"success\"\n label=\"Kép kiválasztása\"\n class=\"nowrap\"\n @click=\"selectImage\"\n icon=\"fa-solid fa-image\"\n ></Button>\n <Button\n type=\"error\"\n label=\"Eltávolítás\"\n class=\"nowrap\"\n @click=\"resetImage\"\n icon=\"fa-solid fa-trash\"\n ></Button>\n </div>\n </div>\n\n <!-- Details Section -->\n <div v-if=\"details && local.id\" class=\"c-image-picker__details\">\n <!-- Source Input -->\n <div>\n <label for=\"image-source\" class=\"c-label\">Forrás</label>\n <div class=\"c-input-row\">\n <input\n v-model=\"local.source\"\n id=\"image-source\"\n type=\"text\"\n class=\"c-input\"\n placeholder=\"Kép forrása\"\n :disabled=\"!editable\"\n />\n </div>\n </div>\n\n <!-- Title/Alt Text Input -->\n <div>\n <label for=\"image-title\" class=\"c-label\">Cím / Alt szöveg</label>\n <div class=\"c-input-row\">\n <textarea\n v-model=\"local.title\"\n id=\"image-title\"\n class=\"c-input c-image-picker__textarea\"\n placeholder=\"Cím vagy alt szöveg\"\n :disabled=\"!editable\"\n />\n </div>\n </div>\n\n <!-- Adult Content Checkbox -->\n <Checkbox v-model=\"local.isAdult\" label=\"Felnőtt tartalom\" :disabled=\"!editable\" />\n </div>\n </div>\n\n <!-- Image Search Modal Dialog -->\n <Modal v-if=\"showImageModal\" modalClass=\"c-image-picker-modal\" @close=\"showImageModal = false\">\n <hvg-search-image\n :causationid=\"imageCausationId\"\n :viewid=\"imageViewId\"\n :environment=\"environment\"\n :aeurl=\"articleEditorUrl\"\n selectonly=\"true\"\n />\n </Modal>\n </div>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/image-picker.scss\"></style>\n"],"mappings":""}
|
|
@@ -7,7 +7,11 @@ import { createBlock as i, createCommentVNode as a, createElementBlock as o, cre
|
|
|
7
7
|
var g = { class: "ac-component" }, _ = { class: "d-flex flex-column gap-2" }, v = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "flex gap-2"
|
|
10
|
-
}, y = { class: "c-input-row" }, b = ["value"], x = { class: "c-input-row" }, S = ["value"], C = { class: "c-input-row" }, w = ["value"], T = { class: "c-input-row" }, E = ["value"], D = [
|
|
10
|
+
}, y = { class: "c-input-row" }, b = ["value"], x = { class: "c-input-row" }, S = ["value"], C = { class: "c-input-row" }, w = ["value"], T = { class: "c-input-row" }, E = ["value"], D = [
|
|
11
|
+
"id",
|
|
12
|
+
"environment",
|
|
13
|
+
"apiurl"
|
|
14
|
+
], O = "00000000-0000-0000-0000-000000000000", k = /*@__PURE__*/ l({
|
|
11
15
|
__name: "InternalArticleOffer",
|
|
12
16
|
props: {
|
|
13
17
|
modelValue: {},
|
|
@@ -34,7 +38,9 @@ var g = { class: "ac-component" }, _ = { class: "d-flex flex-column gap-2" }, v
|
|
|
34
38
|
lead: ""
|
|
35
39
|
},
|
|
36
40
|
format: ""
|
|
37
|
-
}, j = k, M = l
|
|
41
|
+
}, j = k, M = l;
|
|
42
|
+
console.log("AAAAA", { props: M });
|
|
43
|
+
let N = p(A), P = p({
|
|
38
44
|
id: N.value.article.imageId || "",
|
|
39
45
|
url: "",
|
|
40
46
|
source: "",
|
|
@@ -165,6 +171,7 @@ var g = { class: "ac-component" }, _ = { class: "d-flex flex-column gap-2" }, v
|
|
|
165
171
|
}, {
|
|
166
172
|
default: h(() => [s("search-posts-widget", {
|
|
167
173
|
id: I.value,
|
|
174
|
+
environment: M.environment,
|
|
168
175
|
selector: "true",
|
|
169
176
|
apiurl: M.searchArticleApiUrl,
|
|
170
177
|
wpurl: "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components51.js","names":[],"sources":["../src/components/custom/InternalArticleOffer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onMounted, onUnmounted, ref, watch } from 'vue'\nimport ImagePicker from '@/components/custom/ImagePicker.vue'\nimport DropdownSelect from '@/components/DropdownSelect.vue'\nimport Modal from '@/components/Modal.vue'\nimport Button from '@/components/Button.vue'\n\nexport interface Article {\n siteId: string\n id: string\n imageId: string\n title: string\n lead: string\n}\n\nexport interface InternalArticleOfferModel {\n article: Article\n format: string\n}\n\nconst defaultValue: InternalArticleOfferModel = {\n article: {\n siteId: '',\n id: '',\n imageId: '',\n title: '',\n lead: '',\n },\n format: '',\n}\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: InternalArticleOfferModel): void\n}>()\n\nconst props = withDefaults(\n defineProps<{\n modelValue?: InternalArticleOfferModel\n searchArticleApiUrl: string\n searchArticleWidgetUrl: string\n environment: string\n searchImageWidgetUrl: string\n imageBaseUrl: string\n imageViewId: string\n showIds?: boolean\n formats: { label: string; value: string }[]\n }>(),\n {\n showIds: true,\n },\n)\n\nconst localModel = ref<InternalArticleOfferModel>(defaultValue)\nconst imageModel = ref({\n id: localModel.value.article.imageId || '',\n url: '',\n source: '',\n title: '',\n isAdult: false,\n})\nconst showArticleModal = ref(false)\n\nwatch(\n () => props.modelValue,\n (newVal) => {\n if (!newVal) {\n localModel.value = defaultValue\n } else {\n localModel.value = newVal\n }\n },\n { deep: true, immediate: true },\n)\n\nwatch(\n () => localModel,\n (newVal) => {\n emit('update:modelValue', localModel.value)\n imageModel.value.id = newVal.value.article.imageId\n },\n { deep: true, immediate: true },\n)\n\nwatch(\n () => imageModel.value.id,\n (id) => {\n localModel.value.article.imageId = id\n },\n { deep: true, immediate: true },\n)\n\nconst articleCausationId = ref(new Date().getTime().toString() + 'article')\nconst EMPTYGUID = '00000000-0000-0000-0000-000000000000'\n\nonUnmounted(() => {\n window.removeEventListener('search_posts_selected', onPostSelected)\n})\n\nonMounted(() => {\n window.addEventListener('search_posts_selected', onPostSelected)\n})\n\nconst onPostSelected = (e: any) => {\n if (e.detail.id == articleCausationId.value) {\n if (e.detail.result && e.detail.posts.length > 0) {\n localModel.value.article.id = e.detail.posts[0].id\n localModel.value.article.siteId = e.detail.posts[0].siteId\n localModel.value.article.title = e.detail.posts[0].title\n localModel.value.article.lead = e.detail.posts[0].lead\n const imageId = e.detail.posts[0].featuredImage\n localModel.value.article.imageId = imageId || EMPTYGUID\n }\n\n showArticleModal.value = false\n }\n}\n\nconst selectArticle = () => {\n showArticleModal.value = true\n}\n\nconst addScript = (url: string) => {\n if (!customElements.get('search-posts-widget')) {\n if (!document.querySelector(`script[src=\"${url}\"]`)) {\n const script = document.createElement('script')\n script.type = 'text/javascript'\n script.src = url\n document.head.appendChild(script)\n }\n }\n}\n\nif (!customElements.get('hvg-search-image')) {\n if (!document.querySelector(`script[src=\"${props.searchImageWidgetUrl}\"]`)) {\n const script = document.createElement('script')\n script.type = 'text/javascript'\n script.src = props.searchImageWidgetUrl\n script.async = true\n document.head.appendChild(script)\n }\n}\n\naddScript(props.searchArticleWidgetUrl)\n</script>\n\n<template>\n <div class=\"ac-component\">\n <div class=\"d-flex flex-column gap-2\">\n <div>\n <Button\n type=\"success\"\n label=\"Cikk kiválasztása\"\n class=\"nowrap\"\n @click=\"selectArticle\"\n icon=\"fa-solid fa-newspaper\"\n />\n </div>\n\n <template v-if=\"showIds\">\n <div class=\"flex gap-2\">\n <div>\n <label for=\"articleId\" class=\"c-label\">Article ID</label>\n <div class=\"c-input-row\">\n <input\n id=\"articleId\"\n type=\"text\"\n class=\"c-input\"\n placeholder=\"Article ID\"\n disabled\n :value=\"localModel.article.id\"\n />\n </div>\n </div>\n\n <div>\n <label for=\"articleSiteId\" class=\"c-label\">Site ID</label>\n <div class=\"c-input-row\">\n <input\n id=\"articleSiteId\"\n type=\"text\"\n class=\"c-input\"\n placeholder=\"Site ID\"\n disabled\n :value=\"localModel.article.siteId\"\n />\n </div>\n </div>\n </div>\n </template>\n\n <div>\n <label for=\"articleTitle\" class=\"c-label\">Title</label>\n <div class=\"c-input-row\">\n <textarea\n id=\"articleTitle\"\n class=\"c-input\"\n placeholder=\"Article title\"\n :value=\"localModel.article.title\"\n @input=\"localModel.article.title = ($event.target as any)?.value || ''\"\n />\n </div>\n </div>\n\n <div>\n <label for=\"articleLead\" class=\"c-label\">Lead</label>\n <div class=\"c-input-row\">\n <textarea\n id=\"articleLead\"\n class=\"c-input\"\n placeholder=\"Article lead / description\"\n :value=\"localModel.article.lead\"\n @input=\"localModel.article.lead = ($event.target as any)?.value || ''\"\n />\n </div>\n </div>\n\n <hr class=\"separator\" />\n\n <div>\n <ImagePicker\n v-model=\"imageModel\"\n :details=\"false\"\n :editable=\"false\"\n :environment=\"props.environment\"\n :article-editor-url=\"props.searchArticleApiUrl\"\n :search-image-widget-url=\"props.searchImageWidgetUrl\"\n :image-base-url=\"props.imageBaseUrl\"\n :image-view-id=\"props.imageViewId\"\n />\n </div>\n\n <div>\n <label class=\"c-label\">Format</label>\n <DropdownSelect\n v-model=\"localModel.format\"\n :options=\"props.formats\"\n :config=\"{ placeholder: 'Select format...' }\"\n />\n </div>\n\n <Modal v-if=\"showArticleModal\" title=\"Search Article\" @close=\"showArticleModal = false\">\n <search-posts-widget\n :id=\"articleCausationId\"\n selector=\"true\"\n :apiurl=\"props.searchArticleApiUrl\"\n wpurl=\"\"\n searchurl=\"\"\n style=\"height: 500px\"\n />\n </Modal>\n </div>\n </div>\n</template>\n"],"mappings":";;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CANJ,AAAA,EAAA,OAAA,EAAqC,SAAA,EAA9B,OAAM,UAAS,GAAC,UAAM,EAAA,GAC7B,EAIE,GAAA;IAHS,YAAA,EAAA,MAAW;IAAX,uBAAA,AAAA,EAAA,QAAA,MAAA,EAAA,MAAW,SAAM;IACzB,SAAS,EAAM;IACf,QAAQ,EAAA,aAAA,mBAAA;;GAIA,EAAA,SAAb,EAAA,GAAA,EASQ,GAAA;;IATuB,OAAM;IAAkB,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,QAAgB;;IAC5E,SAAA,QAOE,CAPF,EAOE,uBAAA;KANC,IAAI,EAAA;KACL,UAAS;KACR,QAAQ,EAAM;KACf,OAAM;KACN,WAAU;KACV,OAAA,EAAA,QAAA,QAAA"}
|
|
1
|
+
{"version":3,"file":"admins-components51.js","names":[],"sources":["../src/components/custom/InternalArticleOffer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onMounted, onUnmounted, ref, watch } from 'vue'\nimport ImagePicker from '@/components/custom/ImagePicker.vue'\nimport DropdownSelect from '@/components/DropdownSelect.vue'\nimport Modal from '@/components/Modal.vue'\nimport Button from '@/components/Button.vue'\n\nexport interface Article {\n siteId: string\n id: string\n imageId: string\n title: string\n lead: string\n}\n\nexport interface InternalArticleOfferModel {\n article: Article\n format: string\n}\n\nconst defaultValue: InternalArticleOfferModel = {\n article: {\n siteId: '',\n id: '',\n imageId: '',\n title: '',\n lead: '',\n },\n format: '',\n}\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: InternalArticleOfferModel): void\n}>()\n\nconst props = withDefaults(\n defineProps<{\n modelValue?: InternalArticleOfferModel\n searchArticleApiUrl: string\n searchArticleWidgetUrl: string\n environment: string\n searchImageWidgetUrl: string\n imageBaseUrl: string\n imageViewId: string\n showIds?: boolean\n formats: { label: string; value: string }[]\n }>(),\n {\n showIds: true,\n },\n)\n\nconsole.log('AAAAA', { props })\n\nconst localModel = ref<InternalArticleOfferModel>(defaultValue)\nconst imageModel = ref({\n id: localModel.value.article.imageId || '',\n url: '',\n source: '',\n title: '',\n isAdult: false,\n})\nconst showArticleModal = ref(false)\n\nwatch(\n () => props.modelValue,\n (newVal) => {\n if (!newVal) {\n localModel.value = defaultValue\n } else {\n localModel.value = newVal\n }\n },\n { deep: true, immediate: true },\n)\n\nwatch(\n () => localModel,\n (newVal) => {\n emit('update:modelValue', localModel.value)\n imageModel.value.id = newVal.value.article.imageId\n },\n { deep: true, immediate: true },\n)\n\nwatch(\n () => imageModel.value.id,\n (id) => {\n localModel.value.article.imageId = id\n },\n { deep: true, immediate: true },\n)\n\nconst articleCausationId = ref(new Date().getTime().toString() + 'article')\nconst EMPTYGUID = '00000000-0000-0000-0000-000000000000'\n\nonUnmounted(() => {\n window.removeEventListener('search_posts_selected', onPostSelected)\n})\n\nonMounted(() => {\n window.addEventListener('search_posts_selected', onPostSelected)\n})\n\nconst onPostSelected = (e: any) => {\n if (e.detail.id == articleCausationId.value) {\n if (e.detail.result && e.detail.posts.length > 0) {\n localModel.value.article.id = e.detail.posts[0].id\n localModel.value.article.siteId = e.detail.posts[0].siteId\n localModel.value.article.title = e.detail.posts[0].title\n localModel.value.article.lead = e.detail.posts[0].lead\n const imageId = e.detail.posts[0].featuredImage\n localModel.value.article.imageId = imageId || EMPTYGUID\n }\n\n showArticleModal.value = false\n }\n}\n\nconst selectArticle = () => {\n showArticleModal.value = true\n}\n\nconst addScript = (url: string) => {\n if (!customElements.get('search-posts-widget')) {\n if (!document.querySelector(`script[src=\"${url}\"]`)) {\n const script = document.createElement('script')\n script.type = 'text/javascript'\n script.src = url\n document.head.appendChild(script)\n }\n }\n}\n\nif (!customElements.get('hvg-search-image')) {\n if (!document.querySelector(`script[src=\"${props.searchImageWidgetUrl}\"]`)) {\n const script = document.createElement('script')\n script.type = 'text/javascript'\n script.src = props.searchImageWidgetUrl\n script.async = true\n document.head.appendChild(script)\n }\n}\n\naddScript(props.searchArticleWidgetUrl)\n</script>\n\n<template>\n <div class=\"ac-component\">\n <div class=\"d-flex flex-column gap-2\">\n <div>\n <Button\n type=\"success\"\n label=\"Cikk kiválasztása\"\n class=\"nowrap\"\n @click=\"selectArticle\"\n icon=\"fa-solid fa-newspaper\"\n />\n </div>\n\n <template v-if=\"showIds\">\n <div class=\"flex gap-2\">\n <div>\n <label for=\"articleId\" class=\"c-label\">Article ID</label>\n <div class=\"c-input-row\">\n <input\n id=\"articleId\"\n type=\"text\"\n class=\"c-input\"\n placeholder=\"Article ID\"\n disabled\n :value=\"localModel.article.id\"\n />\n </div>\n </div>\n\n <div>\n <label for=\"articleSiteId\" class=\"c-label\">Site ID</label>\n <div class=\"c-input-row\">\n <input\n id=\"articleSiteId\"\n type=\"text\"\n class=\"c-input\"\n placeholder=\"Site ID\"\n disabled\n :value=\"localModel.article.siteId\"\n />\n </div>\n </div>\n </div>\n </template>\n\n <div>\n <label for=\"articleTitle\" class=\"c-label\">Title</label>\n <div class=\"c-input-row\">\n <textarea\n id=\"articleTitle\"\n class=\"c-input\"\n placeholder=\"Article title\"\n :value=\"localModel.article.title\"\n @input=\"localModel.article.title = ($event.target as any)?.value || ''\"\n />\n </div>\n </div>\n\n <div>\n <label for=\"articleLead\" class=\"c-label\">Lead</label>\n <div class=\"c-input-row\">\n <textarea\n id=\"articleLead\"\n class=\"c-input\"\n placeholder=\"Article lead / description\"\n :value=\"localModel.article.lead\"\n @input=\"localModel.article.lead = ($event.target as any)?.value || ''\"\n />\n </div>\n </div>\n\n <hr class=\"separator\" />\n\n <div>\n <ImagePicker\n v-model=\"imageModel\"\n :details=\"false\"\n :editable=\"false\"\n :environment=\"props.environment\"\n :article-editor-url=\"props.searchArticleApiUrl\"\n :search-image-widget-url=\"props.searchImageWidgetUrl\"\n :image-base-url=\"props.imageBaseUrl\"\n :image-view-id=\"props.imageViewId\"\n />\n </div>\n\n <div>\n <label class=\"c-label\">Format</label>\n <DropdownSelect\n v-model=\"localModel.format\"\n :options=\"props.formats\"\n :config=\"{ placeholder: 'Select format...' }\"\n />\n </div>\n\n <Modal v-if=\"showArticleModal\" title=\"Search Article\" @close=\"showArticleModal = false\">\n <search-posts-widget\n :id=\"articleCausationId\"\n :environment=\"props.environment\"\n selector=\"true\"\n :apiurl=\"props.searchArticleApiUrl\"\n wpurl=\"\"\n searchurl=\"\"\n style=\"height: 500px\"\n />\n </Modal>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;GA8FM,IAAY;;;;;;;;;;;;;;;;;;EA1ElB,IAAM,IAA0C;GAC9C,SAAS;IACP,QAAQ;IACR,IAAI;IACJ,SAAS;IACT,OAAO;IACP,MAAM;GACR;GACA,QAAQ;EACV,GAEM,IAAO,GAIP,IAAQ;EAiBd,QAAQ,IAAI,SAAS,EAAE,SAAM,CAAC;EAE9B,IAAM,IAAa,EAA+B,CAAY,GACxD,IAAa,EAAI;GACrB,IAAI,EAAW,MAAM,QAAQ,WAAW;GACxC,KAAK;GACL,QAAQ;GACR,OAAO;GACP,SAAS;EACX,CAAC,GACK,IAAmB,EAAI,EAAK;EAuBlC,AArBA,QACQ,EAAM,aACX,MAAW;GACV,AAAK,IAGH,EAAW,QAAQ,IAFnB,EAAW,QAAQ;EAIvB,GACA;GAAE,MAAM;GAAM,WAAW;EAAK,CAChC,GAEA,QACQ,IACL,MAAW;GAEV,AADA,EAAK,qBAAqB,EAAW,KAAK,GAC1C,EAAW,MAAM,KAAK,EAAO,MAAM,QAAQ;EAC7C,GACA;GAAE,MAAM;GAAM,WAAW;EAAK,CAChC,GAEA,QACQ,EAAW,MAAM,KACtB,MAAO;GACN,EAAW,MAAM,QAAQ,UAAU;EACrC,GACA;GAAE,MAAM;GAAM,WAAW;EAAK,CAChC;EAEA,IAAM,IAAqB,mBAAI,IAAI,KAAK,EAAA,CAAE,QAAQ,CAAC,CAAC,SAAS,IAAI,SAAS;EAO1E,AAJA,QAAkB;GAChB,OAAO,oBAAoB,yBAAyB,CAAc;EACpE,CAAC,GAED,QAAgB;GACd,OAAO,iBAAiB,yBAAyB,CAA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AAW,GAAA,MAAA,EAAA;GAErB,EAWM,OAAA,MAAA,CAVJ,EASE,GAAA;IARS,YAAA,EAAA;IAAA,uBAAA,AAAA,EAAA,QAAA,MAAA,EAAU,QAAA;IAClB,SAAS;IACT,UAAU;IACV,aAAa,EAAM;IACnB,sBAAoB,EAAM;IAC1B,2BAAyB,EAAM;IAC/B,kBAAgB,EAAM;IACtB,iBAAe,EAAM;;;;;;;;;GAI1B,EAOM,OAAA,MAAA,CANJ,AAAA,EAAA,OAAA,EAAqC,SAAA,EAA9B,OAAM,UAAS,GAAC,UAAM,EAAA,GAC7B,EAIE,GAAA;IAHS,YAAA,EAAA,MAAW;IAAX,uBAAA,AAAA,EAAA,QAAA,MAAA,EAAA,MAAW,SAAM;IACzB,SAAS,EAAM;IACf,QAAQ,EAAA,aAAA,mBAAA;;GAIA,EAAA,SAAb,EAAA,GAAA,EAUQ,GAAA;;IAVuB,OAAM;IAAkB,SAAK,AAAA,EAAA,QAAA,MAAE,EAAA,QAAgB;;IAC5E,SAAA,QAQE,CARF,EAQE,uBAAA;KAPC,IAAI,EAAA;KACJ,aAAa,EAAM;KACpB,UAAS;KACR,QAAQ,EAAM;KACf,OAAM;KACN,WAAU;KACV,OAAA,EAAA,QAAA,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components52.js","names":[],"sources":["../src/components/custom/InternalArticleOffer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onMounted, onUnmounted, ref, watch } from 'vue'\nimport ImagePicker from '@/components/custom/ImagePicker.vue'\nimport DropdownSelect from '@/components/DropdownSelect.vue'\nimport Modal from '@/components/Modal.vue'\nimport Button from '@/components/Button.vue'\n\nexport interface Article {\n siteId: string\n id: string\n imageId: string\n title: string\n lead: string\n}\n\nexport interface InternalArticleOfferModel {\n article: Article\n format: string\n}\n\nconst defaultValue: InternalArticleOfferModel = {\n article: {\n siteId: '',\n id: '',\n imageId: '',\n title: '',\n lead: '',\n },\n format: '',\n}\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: InternalArticleOfferModel): void\n}>()\n\nconst props = withDefaults(\n defineProps<{\n modelValue?: InternalArticleOfferModel\n searchArticleApiUrl: string\n searchArticleWidgetUrl: string\n environment: string\n searchImageWidgetUrl: string\n imageBaseUrl: string\n imageViewId: string\n showIds?: boolean\n formats: { label: string; value: string }[]\n }>(),\n {\n showIds: true,\n },\n)\n\nconst localModel = ref<InternalArticleOfferModel>(defaultValue)\nconst imageModel = ref({\n id: localModel.value.article.imageId || '',\n url: '',\n source: '',\n title: '',\n isAdult: false,\n})\nconst showArticleModal = ref(false)\n\nwatch(\n () => props.modelValue,\n (newVal) => {\n if (!newVal) {\n localModel.value = defaultValue\n } else {\n localModel.value = newVal\n }\n },\n { deep: true, immediate: true },\n)\n\nwatch(\n () => localModel,\n (newVal) => {\n emit('update:modelValue', localModel.value)\n imageModel.value.id = newVal.value.article.imageId\n },\n { deep: true, immediate: true },\n)\n\nwatch(\n () => imageModel.value.id,\n (id) => {\n localModel.value.article.imageId = id\n },\n { deep: true, immediate: true },\n)\n\nconst articleCausationId = ref(new Date().getTime().toString() + 'article')\nconst EMPTYGUID = '00000000-0000-0000-0000-000000000000'\n\nonUnmounted(() => {\n window.removeEventListener('search_posts_selected', onPostSelected)\n})\n\nonMounted(() => {\n window.addEventListener('search_posts_selected', onPostSelected)\n})\n\nconst onPostSelected = (e: any) => {\n if (e.detail.id == articleCausationId.value) {\n if (e.detail.result && e.detail.posts.length > 0) {\n localModel.value.article.id = e.detail.posts[0].id\n localModel.value.article.siteId = e.detail.posts[0].siteId\n localModel.value.article.title = e.detail.posts[0].title\n localModel.value.article.lead = e.detail.posts[0].lead\n const imageId = e.detail.posts[0].featuredImage\n localModel.value.article.imageId = imageId || EMPTYGUID\n }\n\n showArticleModal.value = false\n }\n}\n\nconst selectArticle = () => {\n showArticleModal.value = true\n}\n\nconst addScript = (url: string) => {\n if (!customElements.get('search-posts-widget')) {\n if (!document.querySelector(`script[src=\"${url}\"]`)) {\n const script = document.createElement('script')\n script.type = 'text/javascript'\n script.src = url\n document.head.appendChild(script)\n }\n }\n}\n\nif (!customElements.get('hvg-search-image')) {\n if (!document.querySelector(`script[src=\"${props.searchImageWidgetUrl}\"]`)) {\n const script = document.createElement('script')\n script.type = 'text/javascript'\n script.src = props.searchImageWidgetUrl\n script.async = true\n document.head.appendChild(script)\n }\n}\n\naddScript(props.searchArticleWidgetUrl)\n</script>\n\n<template>\n <div class=\"ac-component\">\n <div class=\"d-flex flex-column gap-2\">\n <div>\n <Button\n type=\"success\"\n label=\"Cikk kiválasztása\"\n class=\"nowrap\"\n @click=\"selectArticle\"\n icon=\"fa-solid fa-newspaper\"\n />\n </div>\n\n <template v-if=\"showIds\">\n <div class=\"flex gap-2\">\n <div>\n <label for=\"articleId\" class=\"c-label\">Article ID</label>\n <div class=\"c-input-row\">\n <input\n id=\"articleId\"\n type=\"text\"\n class=\"c-input\"\n placeholder=\"Article ID\"\n disabled\n :value=\"localModel.article.id\"\n />\n </div>\n </div>\n\n <div>\n <label for=\"articleSiteId\" class=\"c-label\">Site ID</label>\n <div class=\"c-input-row\">\n <input\n id=\"articleSiteId\"\n type=\"text\"\n class=\"c-input\"\n placeholder=\"Site ID\"\n disabled\n :value=\"localModel.article.siteId\"\n />\n </div>\n </div>\n </div>\n </template>\n\n <div>\n <label for=\"articleTitle\" class=\"c-label\">Title</label>\n <div class=\"c-input-row\">\n <textarea\n id=\"articleTitle\"\n class=\"c-input\"\n placeholder=\"Article title\"\n :value=\"localModel.article.title\"\n @input=\"localModel.article.title = ($event.target as any)?.value || ''\"\n />\n </div>\n </div>\n\n <div>\n <label for=\"articleLead\" class=\"c-label\">Lead</label>\n <div class=\"c-input-row\">\n <textarea\n id=\"articleLead\"\n class=\"c-input\"\n placeholder=\"Article lead / description\"\n :value=\"localModel.article.lead\"\n @input=\"localModel.article.lead = ($event.target as any)?.value || ''\"\n />\n </div>\n </div>\n\n <hr class=\"separator\" />\n\n <div>\n <ImagePicker\n v-model=\"imageModel\"\n :details=\"false\"\n :editable=\"false\"\n :environment=\"props.environment\"\n :article-editor-url=\"props.searchArticleApiUrl\"\n :search-image-widget-url=\"props.searchImageWidgetUrl\"\n :image-base-url=\"props.imageBaseUrl\"\n :image-view-id=\"props.imageViewId\"\n />\n </div>\n\n <div>\n <label class=\"c-label\">Format</label>\n <DropdownSelect\n v-model=\"localModel.format\"\n :options=\"props.formats\"\n :config=\"{ placeholder: 'Select format...' }\"\n />\n </div>\n\n <Modal v-if=\"showArticleModal\" title=\"Search Article\" @close=\"showArticleModal = false\">\n <search-posts-widget\n :id=\"articleCausationId\"\n selector=\"true\"\n :apiurl=\"props.searchArticleApiUrl\"\n wpurl=\"\"\n searchurl=\"\"\n style=\"height: 500px\"\n />\n </Modal>\n </div>\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"admins-components52.js","names":[],"sources":["../src/components/custom/InternalArticleOffer.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onMounted, onUnmounted, ref, watch } from 'vue'\nimport ImagePicker from '@/components/custom/ImagePicker.vue'\nimport DropdownSelect from '@/components/DropdownSelect.vue'\nimport Modal from '@/components/Modal.vue'\nimport Button from '@/components/Button.vue'\n\nexport interface Article {\n siteId: string\n id: string\n imageId: string\n title: string\n lead: string\n}\n\nexport interface InternalArticleOfferModel {\n article: Article\n format: string\n}\n\nconst defaultValue: InternalArticleOfferModel = {\n article: {\n siteId: '',\n id: '',\n imageId: '',\n title: '',\n lead: '',\n },\n format: '',\n}\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', v: InternalArticleOfferModel): void\n}>()\n\nconst props = withDefaults(\n defineProps<{\n modelValue?: InternalArticleOfferModel\n searchArticleApiUrl: string\n searchArticleWidgetUrl: string\n environment: string\n searchImageWidgetUrl: string\n imageBaseUrl: string\n imageViewId: string\n showIds?: boolean\n formats: { label: string; value: string }[]\n }>(),\n {\n showIds: true,\n },\n)\n\nconsole.log('AAAAA', { props })\n\nconst localModel = ref<InternalArticleOfferModel>(defaultValue)\nconst imageModel = ref({\n id: localModel.value.article.imageId || '',\n url: '',\n source: '',\n title: '',\n isAdult: false,\n})\nconst showArticleModal = ref(false)\n\nwatch(\n () => props.modelValue,\n (newVal) => {\n if (!newVal) {\n localModel.value = defaultValue\n } else {\n localModel.value = newVal\n }\n },\n { deep: true, immediate: true },\n)\n\nwatch(\n () => localModel,\n (newVal) => {\n emit('update:modelValue', localModel.value)\n imageModel.value.id = newVal.value.article.imageId\n },\n { deep: true, immediate: true },\n)\n\nwatch(\n () => imageModel.value.id,\n (id) => {\n localModel.value.article.imageId = id\n },\n { deep: true, immediate: true },\n)\n\nconst articleCausationId = ref(new Date().getTime().toString() + 'article')\nconst EMPTYGUID = '00000000-0000-0000-0000-000000000000'\n\nonUnmounted(() => {\n window.removeEventListener('search_posts_selected', onPostSelected)\n})\n\nonMounted(() => {\n window.addEventListener('search_posts_selected', onPostSelected)\n})\n\nconst onPostSelected = (e: any) => {\n if (e.detail.id == articleCausationId.value) {\n if (e.detail.result && e.detail.posts.length > 0) {\n localModel.value.article.id = e.detail.posts[0].id\n localModel.value.article.siteId = e.detail.posts[0].siteId\n localModel.value.article.title = e.detail.posts[0].title\n localModel.value.article.lead = e.detail.posts[0].lead\n const imageId = e.detail.posts[0].featuredImage\n localModel.value.article.imageId = imageId || EMPTYGUID\n }\n\n showArticleModal.value = false\n }\n}\n\nconst selectArticle = () => {\n showArticleModal.value = true\n}\n\nconst addScript = (url: string) => {\n if (!customElements.get('search-posts-widget')) {\n if (!document.querySelector(`script[src=\"${url}\"]`)) {\n const script = document.createElement('script')\n script.type = 'text/javascript'\n script.src = url\n document.head.appendChild(script)\n }\n }\n}\n\nif (!customElements.get('hvg-search-image')) {\n if (!document.querySelector(`script[src=\"${props.searchImageWidgetUrl}\"]`)) {\n const script = document.createElement('script')\n script.type = 'text/javascript'\n script.src = props.searchImageWidgetUrl\n script.async = true\n document.head.appendChild(script)\n }\n}\n\naddScript(props.searchArticleWidgetUrl)\n</script>\n\n<template>\n <div class=\"ac-component\">\n <div class=\"d-flex flex-column gap-2\">\n <div>\n <Button\n type=\"success\"\n label=\"Cikk kiválasztása\"\n class=\"nowrap\"\n @click=\"selectArticle\"\n icon=\"fa-solid fa-newspaper\"\n />\n </div>\n\n <template v-if=\"showIds\">\n <div class=\"flex gap-2\">\n <div>\n <label for=\"articleId\" class=\"c-label\">Article ID</label>\n <div class=\"c-input-row\">\n <input\n id=\"articleId\"\n type=\"text\"\n class=\"c-input\"\n placeholder=\"Article ID\"\n disabled\n :value=\"localModel.article.id\"\n />\n </div>\n </div>\n\n <div>\n <label for=\"articleSiteId\" class=\"c-label\">Site ID</label>\n <div class=\"c-input-row\">\n <input\n id=\"articleSiteId\"\n type=\"text\"\n class=\"c-input\"\n placeholder=\"Site ID\"\n disabled\n :value=\"localModel.article.siteId\"\n />\n </div>\n </div>\n </div>\n </template>\n\n <div>\n <label for=\"articleTitle\" class=\"c-label\">Title</label>\n <div class=\"c-input-row\">\n <textarea\n id=\"articleTitle\"\n class=\"c-input\"\n placeholder=\"Article title\"\n :value=\"localModel.article.title\"\n @input=\"localModel.article.title = ($event.target as any)?.value || ''\"\n />\n </div>\n </div>\n\n <div>\n <label for=\"articleLead\" class=\"c-label\">Lead</label>\n <div class=\"c-input-row\">\n <textarea\n id=\"articleLead\"\n class=\"c-input\"\n placeholder=\"Article lead / description\"\n :value=\"localModel.article.lead\"\n @input=\"localModel.article.lead = ($event.target as any)?.value || ''\"\n />\n </div>\n </div>\n\n <hr class=\"separator\" />\n\n <div>\n <ImagePicker\n v-model=\"imageModel\"\n :details=\"false\"\n :editable=\"false\"\n :environment=\"props.environment\"\n :article-editor-url=\"props.searchArticleApiUrl\"\n :search-image-widget-url=\"props.searchImageWidgetUrl\"\n :image-base-url=\"props.imageBaseUrl\"\n :image-view-id=\"props.imageViewId\"\n />\n </div>\n\n <div>\n <label class=\"c-label\">Format</label>\n <DropdownSelect\n v-model=\"localModel.format\"\n :options=\"props.formats\"\n :config=\"{ placeholder: 'Select format...' }\"\n />\n </div>\n\n <Modal v-if=\"showArticleModal\" title=\"Search Article\" @close=\"showArticleModal = false\">\n <search-posts-widget\n :id=\"articleCausationId\"\n :environment=\"props.environment\"\n selector=\"true\"\n :apiurl=\"props.searchArticleApiUrl\"\n wpurl=\"\"\n searchurl=\"\"\n style=\"height: 500px\"\n />\n </Modal>\n </div>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -9,10 +9,7 @@ import { Fragment as o, computed as s, createCommentVNode as c, createElementBlo
|
|
|
9
9
|
var T = { key: 0 }, E = ["title", "onClick"], D = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "c-actions-header"
|
|
12
|
-
}, O = { key: 0 }, k = ["onClick"], A = {
|
|
13
|
-
key: 1,
|
|
14
|
-
class: "c-actions-cell"
|
|
15
|
-
}, j = {
|
|
12
|
+
}, O = { key: 0 }, k = ["onClick"], A = ["onClick"], j = {
|
|
16
13
|
key: 1,
|
|
17
14
|
class: "c-actions-wrap"
|
|
18
15
|
}, M = { key: 1 }, N = { class: "c-table__loading-row" }, P = ["colspan"], F = { class: "c-table__loading-wrap" }, I = {
|
|
@@ -114,8 +111,10 @@ var T = { key: 0 }, E = ["title", "onClick"], D = {
|
|
|
114
111
|
key: u,
|
|
115
112
|
class: h({
|
|
116
113
|
"is-selected": i.config.selectableAttr && S(V).has(t[i.config.selectableAttr]),
|
|
117
|
-
"is-striped": i.settings.striped && u % 2 == 1
|
|
118
|
-
|
|
114
|
+
"is-striped": i.settings.striped && u % 2 == 1,
|
|
115
|
+
pointer: i.config.selectableAttr
|
|
116
|
+
}),
|
|
117
|
+
onClick: (e) => i.config.selectableAttr ? S(U)(t) : void 0
|
|
119
118
|
}, [
|
|
120
119
|
i.config.selectableAttr ? (_(), l("td", {
|
|
121
120
|
key: 0,
|
|
@@ -125,7 +124,7 @@ var T = { key: 0 }, E = ["title", "onClick"], D = {
|
|
|
125
124
|
"model-value": !!S(V).has(t[i.config.selectableAttr]),
|
|
126
125
|
"onUpdate:modelValue": (e) => S(U)(t),
|
|
127
126
|
onClick: s[0] ||= w(() => {}, ["stop"])
|
|
128
|
-
}, null, 8, ["model-value", "onUpdate:modelValue"])], 8,
|
|
127
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])], 8, A)) : c("", !0),
|
|
129
128
|
(_(!0), l(o, null, y(G.value, (e) => (_(), l("td", {
|
|
130
129
|
key: e.property,
|
|
131
130
|
class: h(["c-table__cell", [e.class, { "primary-col": e.primary }]])
|
|
@@ -141,7 +140,11 @@ var T = { key: 0 }, E = ["title", "onClick"], D = {
|
|
|
141
140
|
"col",
|
|
142
141
|
"copy"
|
|
143
142
|
])])], 2))), 128)),
|
|
144
|
-
i.config.actions ? (_(), l("td",
|
|
143
|
+
i.config.actions ? (_(), l("td", {
|
|
144
|
+
key: 1,
|
|
145
|
+
class: "c-actions-cell",
|
|
146
|
+
onClick: s[1] ||= w(() => {}, ["stop"])
|
|
147
|
+
}, [r.$slots.actions ? b(r.$slots, "actions", {
|
|
145
148
|
key: 0,
|
|
146
149
|
item: t,
|
|
147
150
|
index: u,
|
|
@@ -150,7 +153,7 @@ var T = { key: 0 }, E = ["title", "onClick"], D = {
|
|
|
150
153
|
actions: i.config.actions,
|
|
151
154
|
item: t
|
|
152
155
|
}, null, 8, ["actions", "item"])]))])) : c("", !0)
|
|
153
|
-
],
|
|
156
|
+
], 10, k))), 128))])) : (_(), l("tbody", M, [u("tr", N, [u("td", {
|
|
154
157
|
colspan: G.value.length + +!!i.config.selectableAttr + +!!i.config.actions,
|
|
155
158
|
class: "c-table__loading-cell"
|
|
156
159
|
}, [u("div", F, [f(t, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components68.js","names":["$slots"],"sources":["../src/components/data-table/DataTable.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type {\n LayoutMode,\n DataListConfig,\n DataListSettings,\n DataTableSettings,\n DataCardsSettings,\n Column,\n Sort,\n Action,\n ActionGroup,\n FilterConfig,\n FilterValue,\n} from '@/types/data-list'\n\nexport {\n dataTableSettingsDefaults,\n dataCardsSettingsDefaults,\n dataListSettingsDefaults,\n} from '@/types/data-list'\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, onMounted, watch, nextTick } from 'vue'\nimport Checkbox from '@/components/Checkbox.vue'\nimport { useSelection } from '@/composables/useSelection'\nimport { dataTableSettingsDefaults } from '@/types/data-list'\nimport type { Column, DataListConfig, DataTableSettings, Sort } from '@/types/data-list'\nimport Loader from '@/components/Loader.vue'\nimport DataCell from './DataCell.vue'\nimport DataListActions from './DataListActions.vue'\n\ntype SortDirection = 'asc' | 'desc'\n\nconst props = withDefaults(\n defineProps<{\n config: DataListConfig\n items: Record<string, unknown>[]\n settings?: DataTableSettings\n loading?: boolean\n initialSort?: { key: string; direction: SortDirection } | null\n }>(),\n {\n settings: () => ({ ...dataTableSettingsDefaults }),\n loading: false,\n initialSort: null,\n },\n)\n\nconst emit = defineEmits<{\n 'selection-change': [selected: unknown[]]\n 'sort-change': [sort: { key: string; direction: SortDirection }]\n}>()\n\n//const CHARACTER_BREAKPOINT = 20\n\nconst activeSort = ref<{\n key: string\n direction: SortDirection\n} | null>(null)\n\nconst tableWrapperRef = ref<HTMLElement | null>(null)\n\nwatch(\n () => props.loading,\n async (isLoading) => {\n if (isLoading) {\n await nextTick()\n tableWrapperRef.value?.scrollTo({ top: 0, behavior: 'smooth' })\n }\n },\n)\n\nconst {\n selectedKeys,\n allSelected,\n toggle: toggleRow,\n toggleAll,\n} = useSelection(\n () => props.items,\n () => props.config.selectableAttr,\n (s) => emit('selection-change', s),\n)\n\nconst visibleColumns = computed(() => props.config.columns.filter((c) => c.visible !== false))\n\nfunction getSortConfig(col: Column): Sort | null {\n if (!col.sort) return null\n return typeof col.sort === 'boolean' ? null : col.sort\n}\n\nfunction isSortable(col: Column): boolean {\n return !!col.sort\n}\n\nfunction handleSort(col: Column) {\n const key = col.property\n const direction: SortDirection =\n activeSort.value?.key === key && activeSort.value.direction === 'asc' ? 'desc' : 'asc'\n\n activeSort.value = { key, direction }\n getSortConfig(col)?.callback?.(key, direction)\n\n emit('sort-change', { key, direction })\n}\n\nfunction applyInitialSort(sort: { key: string; direction: SortDirection } | null | undefined) {\n if (!sort) {\n if (activeSort.value !== null) activeSort.value = null\n return\n }\n const col = props.config.columns.find((c) => c.property === sort.key)\n if (!col) return\n if (activeSort.value?.key === sort.key && activeSort.value.direction === sort.direction) return\n activeSort.value = { key: sort.key, direction: sort.direction }\n getSortConfig(col)?.callback?.(sort.key, sort.direction)\n emit('sort-change', { key: sort.key, direction: sort.direction })\n}\n\nonMounted(() => applyInitialSort(props.initialSort))\nwatch(\n () => props.initialSort,\n (s) => {\n if (!s) {\n if (activeSort.value !== null) activeSort.value = null\n return\n }\n const col = props.config.columns.find((c) => c.property === s.key)\n if (!col) return\n if (activeSort.value?.key === s.key && activeSort.value.direction === s.direction) return\n activeSort.value = { key: s.key, direction: s.direction }\n },\n)\n</script>\n\n<template>\n <div\n ref=\"tableWrapperRef\"\n class=\"ac-component c-table-wrapper list-table-view\"\n :class=\"{ 'is-loading': loading }\"\n >\n <!-- :style=\"{ '--action-count': config.actions?.length ?? 0 }\" -->\n <table class=\"c-table\" :class=\"{ 'is-compact': settings.compact }\">\n <thead>\n <tr>\n <th v-if=\"config.selectableAttr\">\n <Checkbox :model-value=\"allSelected\" @update:model-value=\"toggleAll\" />\n </th>\n\n <th\n v-for=\"col in visibleColumns\"\n :key=\"col.property\"\n :class=\"[\n {\n 'c-sortable': isSortable(col),\n 'c-sortable--sorted': activeSort?.key === col.property,\n 'primary-col': col.primary,\n },\n col.headerClass,\n ]\"\n :title=\"isSortable(col) ? `Sorrendezés ${col.label} alapján` : undefined\"\n @click=\"isSortable(col) ? handleSort(col) : undefined\"\n >\n {{ !col.hideHeader ? col.label : '' }}\n\n <span\n v-if=\"isSortable(col)\"\n class=\"c-sort-icon fa-solid\"\n :class=\"{\n 'fa-sort': activeSort?.key !== col.property,\n 'fa-sort-down': activeSort?.key === col.property && activeSort.direction === 'desc',\n 'fa-sort-up': activeSort?.key === col.property && activeSort.direction === 'asc',\n 'c-sort-icon--active': activeSort?.key === col.property,\n 'is-asc': activeSort?.key === col.property && activeSort.direction === 'asc',\n 'is-desc': activeSort?.key === col.property && activeSort.direction === 'desc',\n }\"\n ></span>\n </th>\n\n <th v-if=\"config.actions\" class=\"c-actions-header\">\n {{ config.actionHeader ?? '' }}\n </th>\n </tr>\n </thead>\n\n <tbody v-if=\"!loading || items.length > 0\">\n <tr\n v-for=\"(item, index) in items\"\n :key=\"index\"\n :class=\"{\n 'is-selected': config.selectableAttr && selectedKeys.has(item[config.selectableAttr]),\n 'is-striped': settings.striped && index % 2 === 1,\n }\"\n >\n <td v-if=\"config.selectableAttr\" class=\"pointer\" @click.stop=\"toggleRow(item)\">\n <Checkbox\n :model-value=\"!!selectedKeys.has(item[config.selectableAttr])\"\n @update:model-value=\"toggleRow(item)\"\n @click.stop\n />\n </td>\n\n <td\n v-for=\"col in visibleColumns\"\n :key=\"col.property\"\n class=\"c-table__cell\"\n :class=\"[\n col.class,\n { 'primary-col': col.primary },\n /* { 'is-nowrap': String(getColumnValue(item, col) ?? '').length < CHARACTER_BREAKPOINT}, */\n ]\"\n >\n <slot :name=\"`cell:${col.property}`\" :item=\"item\" :col=\"col\">\n <DataCell :item=\"item\" :col=\"col\" :copy=\"!col.hideCopyToClipboard\" />\n </slot>\n </td>\n\n <td v-if=\"config.actions\" class=\"c-actions-cell\">\n <slot\n v-if=\"$slots.actions\"\n name=\"actions\"\n :item=\"item\"\n :index=\"index\"\n :actions=\"config.actions\"\n />\n <div v-else class=\"c-actions-wrap\">\n <DataListActions :actions=\"config.actions\" :item=\"item\" />\n </div>\n </td>\n </tr>\n </tbody>\n <tbody v-else>\n <tr class=\"c-table__loading-row\">\n <td\n :colspan=\"\n visibleColumns.length + (config.selectableAttr ? 1 : 0) + (config.actions ? 1 : 0)\n \"\n class=\"c-table__loading-cell\"\n >\n <div class=\"c-table__loading-wrap\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n <div v-if=\"loading && items.length > 0\" class=\"c-table__backdrop\" aria-hidden=\"true\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n </div>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/data-table/data-table.scss\"></style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCA,IAAM,IAAQ,GAeR,IAAO,GAOP,IAAa,EAGT,IAAI,GAER,IAAkB,EAAwB,IAAI;EAEpD,QACQ,EAAM,SACZ,OAAO,MAAc;GACnB,AAAI,MACF,MAAM,EAAS,GACf,EAAgB,OAAO,SAAS;IAAE,KAAK;IAAG,UAAU;GAAS,CAAC;EAElE,CACF;EAEA,IAAM,EACJ,iBACA,gBACA,QAAQ,GACR,iBACE,QACI,EAAM,aACN,EAAM,OAAO,iBAClB,MAAM,EAAK,oBAAoB,CAAC,CACnC,GAEM,IAAiB,QAAe,EAAM,OAAO,QAAQ,QAAQ,MAAM,EAAE,YAAY,EAAK,CAAC;EAE7F,SAAS,EAAc,GAA0B;GAE/C,OADK,EAAI,OACF,OAAO,EAAI,QAAS,YAAY,OAAO,EAAI,OAD5B;EAExB;EAEA,SAAS,EAAW,GAAsB;GACxC,OAAO,CAAC,CAAC,EAAI;EACf;EAEA,SAAS,EAAW,GAAa;GAC/B,IAAM,IAAM,EAAI,UACV,IACJ,EAAW,OAAO,QAAQ,KAAO,EAAW,MAAM,cAAc,QAAQ,SAAS;GAKnF,AAHA,EAAW,QAAQ;IAAE;IAAK;GAAU,GACpC,EAAc,CAAG,CAAC,EAAE,WAAW,GAAK,CAAS,GAE7C,EAAK,eAAe;IAAE;IAAK;GAAU,CAAC;EACxC;EAEA,SAAS,EAAiB,GAAoE;GAC5F,IAAI,CAAC,GAAM;IACT,AAAI,EAA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AAA;GAA/B,SAAS;GAAM,MAAK;EAM5B,CAAA,CAAA,CAAA,CAAA,GAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,GAAA,CAAA,GAAA,EAAA,WAAW,EAAA,MAAM,SAAM,KAAlC,EAAA,GAAA,EAEM,OAFN,GAEM,CADJ,EAAwC,GAAA;GAA/B,SAAS;GAAM,MAAK"}
|
|
1
|
+
{"version":3,"file":"admins-components68.js","names":["$slots"],"sources":["../src/components/data-table/DataTable.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type {\n LayoutMode,\n DataListConfig,\n DataListSettings,\n DataTableSettings,\n DataCardsSettings,\n Column,\n Sort,\n Action,\n ActionGroup,\n FilterConfig,\n FilterValue,\n} from '@/types/data-list'\n\nexport {\n dataTableSettingsDefaults,\n dataCardsSettingsDefaults,\n dataListSettingsDefaults,\n} from '@/types/data-list'\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, onMounted, watch, nextTick } from 'vue'\nimport Checkbox from '@/components/Checkbox.vue'\nimport { useSelection } from '@/composables/useSelection'\nimport { dataTableSettingsDefaults } from '@/types/data-list'\nimport type { Column, DataListConfig, DataTableSettings, Sort } from '@/types/data-list'\nimport Loader from '@/components/Loader.vue'\nimport DataCell from './DataCell.vue'\nimport DataListActions from './DataListActions.vue'\n\ntype SortDirection = 'asc' | 'desc'\n\nconst props = withDefaults(\n defineProps<{\n config: DataListConfig\n items: Record<string, unknown>[]\n settings?: DataTableSettings\n loading?: boolean\n initialSort?: { key: string; direction: SortDirection } | null\n }>(),\n {\n settings: () => ({ ...dataTableSettingsDefaults }),\n loading: false,\n initialSort: null,\n },\n)\n\nconst emit = defineEmits<{\n 'selection-change': [selected: unknown[]]\n 'sort-change': [sort: { key: string; direction: SortDirection }]\n}>()\n\n//const CHARACTER_BREAKPOINT = 20\n\nconst activeSort = ref<{\n key: string\n direction: SortDirection\n} | null>(null)\n\nconst tableWrapperRef = ref<HTMLElement | null>(null)\n\nwatch(\n () => props.loading,\n async (isLoading) => {\n if (isLoading) {\n await nextTick()\n tableWrapperRef.value?.scrollTo({ top: 0, behavior: 'smooth' })\n }\n },\n)\n\nconst {\n selectedKeys,\n allSelected,\n toggle: toggleRow,\n toggleAll,\n} = useSelection(\n () => props.items,\n () => props.config.selectableAttr,\n (s) => emit('selection-change', s),\n)\n\nconst visibleColumns = computed(() => props.config.columns.filter((c) => c.visible !== false))\n\nfunction getSortConfig(col: Column): Sort | null {\n if (!col.sort) return null\n return typeof col.sort === 'boolean' ? null : col.sort\n}\n\nfunction isSortable(col: Column): boolean {\n return !!col.sort\n}\n\nfunction handleSort(col: Column) {\n const key = col.property\n const direction: SortDirection =\n activeSort.value?.key === key && activeSort.value.direction === 'asc' ? 'desc' : 'asc'\n\n activeSort.value = { key, direction }\n getSortConfig(col)?.callback?.(key, direction)\n\n emit('sort-change', { key, direction })\n}\n\nfunction applyInitialSort(sort: { key: string; direction: SortDirection } | null | undefined) {\n if (!sort) {\n if (activeSort.value !== null) activeSort.value = null\n return\n }\n const col = props.config.columns.find((c) => c.property === sort.key)\n if (!col) return\n if (activeSort.value?.key === sort.key && activeSort.value.direction === sort.direction) return\n activeSort.value = { key: sort.key, direction: sort.direction }\n getSortConfig(col)?.callback?.(sort.key, sort.direction)\n emit('sort-change', { key: sort.key, direction: sort.direction })\n}\n\nonMounted(() => applyInitialSort(props.initialSort))\nwatch(\n () => props.initialSort,\n (s) => {\n if (!s) {\n if (activeSort.value !== null) activeSort.value = null\n return\n }\n const col = props.config.columns.find((c) => c.property === s.key)\n if (!col) return\n if (activeSort.value?.key === s.key && activeSort.value.direction === s.direction) return\n activeSort.value = { key: s.key, direction: s.direction }\n },\n)\n</script>\n\n<template>\n <div\n ref=\"tableWrapperRef\"\n class=\"ac-component c-table-wrapper list-table-view\"\n :class=\"{ 'is-loading': loading }\"\n >\n <!-- :style=\"{ '--action-count': config.actions?.length ?? 0 }\" -->\n <table class=\"c-table\" :class=\"{ 'is-compact': settings.compact }\">\n <thead>\n <tr>\n <th v-if=\"config.selectableAttr\">\n <Checkbox :model-value=\"allSelected\" @update:model-value=\"toggleAll\" />\n </th>\n\n <th\n v-for=\"col in visibleColumns\"\n :key=\"col.property\"\n :class=\"[\n {\n 'c-sortable': isSortable(col),\n 'c-sortable--sorted': activeSort?.key === col.property,\n 'primary-col': col.primary,\n },\n col.headerClass,\n ]\"\n :title=\"isSortable(col) ? `Sorrendezés ${col.label} alapján` : undefined\"\n @click=\"isSortable(col) ? handleSort(col) : undefined\"\n >\n {{ !col.hideHeader ? col.label : '' }}\n\n <span\n v-if=\"isSortable(col)\"\n class=\"c-sort-icon fa-solid\"\n :class=\"{\n 'fa-sort': activeSort?.key !== col.property,\n 'fa-sort-down': activeSort?.key === col.property && activeSort.direction === 'desc',\n 'fa-sort-up': activeSort?.key === col.property && activeSort.direction === 'asc',\n 'c-sort-icon--active': activeSort?.key === col.property,\n 'is-asc': activeSort?.key === col.property && activeSort.direction === 'asc',\n 'is-desc': activeSort?.key === col.property && activeSort.direction === 'desc',\n }\"\n ></span>\n </th>\n\n <th v-if=\"config.actions\" class=\"c-actions-header\">\n {{ config.actionHeader ?? '' }}\n </th>\n </tr>\n </thead>\n\n <tbody v-if=\"!loading || items.length > 0\">\n <tr\n v-for=\"(item, index) in items\"\n :key=\"index\"\n :class=\"{\n 'is-selected': config.selectableAttr && selectedKeys.has(item[config.selectableAttr]),\n 'is-striped': settings.striped && index % 2 === 1,\n 'pointer': config.selectableAttr,\n }\"\n @click=\"config.selectableAttr ? toggleRow(item) : undefined\"\n >\n <td v-if=\"config.selectableAttr\" class=\"pointer\" @click.stop=\"toggleRow(item)\">\n <Checkbox\n :model-value=\"!!selectedKeys.has(item[config.selectableAttr])\"\n @update:model-value=\"toggleRow(item)\"\n @click.stop\n />\n </td>\n\n <td\n v-for=\"col in visibleColumns\"\n :key=\"col.property\"\n class=\"c-table__cell\"\n :class=\"[\n col.class,\n { 'primary-col': col.primary },\n /* { 'is-nowrap': String(getColumnValue(item, col) ?? '').length < CHARACTER_BREAKPOINT}, */\n ]\"\n >\n <slot :name=\"`cell:${col.property}`\" :item=\"item\" :col=\"col\">\n <DataCell :item=\"item\" :col=\"col\" :copy=\"!col.hideCopyToClipboard\" />\n </slot>\n </td>\n\n <td v-if=\"config.actions\" class=\"c-actions-cell\" @click.stop>\n <slot\n v-if=\"$slots.actions\"\n name=\"actions\"\n :item=\"item\"\n :index=\"index\"\n :actions=\"config.actions\"\n />\n <div v-else class=\"c-actions-wrap\">\n <DataListActions :actions=\"config.actions\" :item=\"item\" />\n </div>\n </td>\n </tr>\n </tbody>\n <tbody v-else>\n <tr class=\"c-table__loading-row\">\n <td\n :colspan=\"\n visibleColumns.length + (config.selectableAttr ? 1 : 0) + (config.actions ? 1 : 0)\n \"\n class=\"c-table__loading-cell\"\n >\n <div class=\"c-table__loading-wrap\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n <div v-if=\"loading && items.length > 0\" class=\"c-table__backdrop\" aria-hidden=\"true\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n </div>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/data-table/data-table.scss\"></style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCA,IAAM,IAAQ,GAeR,IAAO,GAOP,IAAa,EAGT,IAAI,GAER,IAAkB,EAAwB,IAAI;EAEpD,QACQ,EAAM,SACZ,OAAO,MAAc;GACnB,AAAI,MACF,MAAM,EAAS,GACf,EAAgB,OAAO,SAAS;IAAE,KAAK;IAAG,UAAU;GAAS,CAAC;EAElE,CACF;EAEA,IAAM,EACJ,iBACA,gBACA,QAAQ,GACR,iBACE,QACI,EAAM,aACN,EAAM,OAAO,iBAClB,MAAM,EAAK,oBAAoB,CAAC,CACnC,GAEM,IAAiB,QAAe,EAAM,OAAO,QAAQ,QAAQ,MAAM,EAAE,YAAY,EAAK,CAAC;EAE7F,SAAS,EAAc,GAA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Q;IAAW;IAAY;GAAxD,SAEO,CADL,EAAqE,GAAA;IAApD;IAAY;IAAM,MAAI,CAAG,EAAI;;;;;;GAIxC,EAAA,OAAO,WAAjB,EAAA,GAAA,EAWK,MAAA;;IAXqB,OAAM;IAAkB,SAAK,AAAA,EAAA,OAAA,QAAN,CAAA,GAAW,CAAA,MAAA,CAAA;GAElDA,GAAAA,CAAAA,EAAAA,OAAO,UADf,EAME,EAAA,QAAA,WAAA;;IAHO;IACC;IACP,SAAS,EAAA,OAAO;GAEnB,CAAA,KAAA,EAAA,GAAA,EAEM,OAFN,GAEM,CADJ,EAA0D,GAAA;IAAxC,SAAS,EAAA,OAAO;IAAgB;;YAK1D,GAAA,GAAA,EAAA,CAAA,MAAA,EAAA,GAAA,EAaQ,SAAA,GAAA,CAZN,EAWK,MAXL,GAWK,CAVH,EASK,MAAA;GARF,SAAwB,EAAA,MAAe,SAAU,KAAA,OAAO,iBAA2B,KAAA,OAAO;GAG3F,OAAM;EAEN,GAAA,CAAA,EAEM,OAFN,GAEM,CADJ,EAAwC,GAAA;GAA/B,SAAS;GAAM,MAAK;EAM5B,CAAA,CAAA,CAAA,CAAA,GAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,GAAA,CAAA,GAAA,EAAA,WAAW,EAAA,MAAM,SAAM,KAAlC,EAAA,GAAA,EAEM,OAFN,GAEM,CADJ,EAAwC,GAAA;GAA/B,SAAS;GAAM,MAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins-components70.js","names":[],"sources":["../src/components/data-table/DataTable.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type {\n LayoutMode,\n DataListConfig,\n DataListSettings,\n DataTableSettings,\n DataCardsSettings,\n Column,\n Sort,\n Action,\n ActionGroup,\n FilterConfig,\n FilterValue,\n} from '@/types/data-list'\n\nexport {\n dataTableSettingsDefaults,\n dataCardsSettingsDefaults,\n dataListSettingsDefaults,\n} from '@/types/data-list'\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, onMounted, watch, nextTick } from 'vue'\nimport Checkbox from '@/components/Checkbox.vue'\nimport { useSelection } from '@/composables/useSelection'\nimport { dataTableSettingsDefaults } from '@/types/data-list'\nimport type { Column, DataListConfig, DataTableSettings, Sort } from '@/types/data-list'\nimport Loader from '@/components/Loader.vue'\nimport DataCell from './DataCell.vue'\nimport DataListActions from './DataListActions.vue'\n\ntype SortDirection = 'asc' | 'desc'\n\nconst props = withDefaults(\n defineProps<{\n config: DataListConfig\n items: Record<string, unknown>[]\n settings?: DataTableSettings\n loading?: boolean\n initialSort?: { key: string; direction: SortDirection } | null\n }>(),\n {\n settings: () => ({ ...dataTableSettingsDefaults }),\n loading: false,\n initialSort: null,\n },\n)\n\nconst emit = defineEmits<{\n 'selection-change': [selected: unknown[]]\n 'sort-change': [sort: { key: string; direction: SortDirection }]\n}>()\n\n//const CHARACTER_BREAKPOINT = 20\n\nconst activeSort = ref<{\n key: string\n direction: SortDirection\n} | null>(null)\n\nconst tableWrapperRef = ref<HTMLElement | null>(null)\n\nwatch(\n () => props.loading,\n async (isLoading) => {\n if (isLoading) {\n await nextTick()\n tableWrapperRef.value?.scrollTo({ top: 0, behavior: 'smooth' })\n }\n },\n)\n\nconst {\n selectedKeys,\n allSelected,\n toggle: toggleRow,\n toggleAll,\n} = useSelection(\n () => props.items,\n () => props.config.selectableAttr,\n (s) => emit('selection-change', s),\n)\n\nconst visibleColumns = computed(() => props.config.columns.filter((c) => c.visible !== false))\n\nfunction getSortConfig(col: Column): Sort | null {\n if (!col.sort) return null\n return typeof col.sort === 'boolean' ? null : col.sort\n}\n\nfunction isSortable(col: Column): boolean {\n return !!col.sort\n}\n\nfunction handleSort(col: Column) {\n const key = col.property\n const direction: SortDirection =\n activeSort.value?.key === key && activeSort.value.direction === 'asc' ? 'desc' : 'asc'\n\n activeSort.value = { key, direction }\n getSortConfig(col)?.callback?.(key, direction)\n\n emit('sort-change', { key, direction })\n}\n\nfunction applyInitialSort(sort: { key: string; direction: SortDirection } | null | undefined) {\n if (!sort) {\n if (activeSort.value !== null) activeSort.value = null\n return\n }\n const col = props.config.columns.find((c) => c.property === sort.key)\n if (!col) return\n if (activeSort.value?.key === sort.key && activeSort.value.direction === sort.direction) return\n activeSort.value = { key: sort.key, direction: sort.direction }\n getSortConfig(col)?.callback?.(sort.key, sort.direction)\n emit('sort-change', { key: sort.key, direction: sort.direction })\n}\n\nonMounted(() => applyInitialSort(props.initialSort))\nwatch(\n () => props.initialSort,\n (s) => {\n if (!s) {\n if (activeSort.value !== null) activeSort.value = null\n return\n }\n const col = props.config.columns.find((c) => c.property === s.key)\n if (!col) return\n if (activeSort.value?.key === s.key && activeSort.value.direction === s.direction) return\n activeSort.value = { key: s.key, direction: s.direction }\n },\n)\n</script>\n\n<template>\n <div\n ref=\"tableWrapperRef\"\n class=\"ac-component c-table-wrapper list-table-view\"\n :class=\"{ 'is-loading': loading }\"\n >\n <!-- :style=\"{ '--action-count': config.actions?.length ?? 0 }\" -->\n <table class=\"c-table\" :class=\"{ 'is-compact': settings.compact }\">\n <thead>\n <tr>\n <th v-if=\"config.selectableAttr\">\n <Checkbox :model-value=\"allSelected\" @update:model-value=\"toggleAll\" />\n </th>\n\n <th\n v-for=\"col in visibleColumns\"\n :key=\"col.property\"\n :class=\"[\n {\n 'c-sortable': isSortable(col),\n 'c-sortable--sorted': activeSort?.key === col.property,\n 'primary-col': col.primary,\n },\n col.headerClass,\n ]\"\n :title=\"isSortable(col) ? `Sorrendezés ${col.label} alapján` : undefined\"\n @click=\"isSortable(col) ? handleSort(col) : undefined\"\n >\n {{ !col.hideHeader ? col.label : '' }}\n\n <span\n v-if=\"isSortable(col)\"\n class=\"c-sort-icon fa-solid\"\n :class=\"{\n 'fa-sort': activeSort?.key !== col.property,\n 'fa-sort-down': activeSort?.key === col.property && activeSort.direction === 'desc',\n 'fa-sort-up': activeSort?.key === col.property && activeSort.direction === 'asc',\n 'c-sort-icon--active': activeSort?.key === col.property,\n 'is-asc': activeSort?.key === col.property && activeSort.direction === 'asc',\n 'is-desc': activeSort?.key === col.property && activeSort.direction === 'desc',\n }\"\n ></span>\n </th>\n\n <th v-if=\"config.actions\" class=\"c-actions-header\">\n {{ config.actionHeader ?? '' }}\n </th>\n </tr>\n </thead>\n\n <tbody v-if=\"!loading || items.length > 0\">\n <tr\n v-for=\"(item, index) in items\"\n :key=\"index\"\n :class=\"{\n 'is-selected': config.selectableAttr && selectedKeys.has(item[config.selectableAttr]),\n 'is-striped': settings.striped && index % 2 === 1,\n }\"\n >\n <td v-if=\"config.selectableAttr\" class=\"pointer\" @click.stop=\"toggleRow(item)\">\n <Checkbox\n :model-value=\"!!selectedKeys.has(item[config.selectableAttr])\"\n @update:model-value=\"toggleRow(item)\"\n @click.stop\n />\n </td>\n\n <td\n v-for=\"col in visibleColumns\"\n :key=\"col.property\"\n class=\"c-table__cell\"\n :class=\"[\n col.class,\n { 'primary-col': col.primary },\n /* { 'is-nowrap': String(getColumnValue(item, col) ?? '').length < CHARACTER_BREAKPOINT}, */\n ]\"\n >\n <slot :name=\"`cell:${col.property}`\" :item=\"item\" :col=\"col\">\n <DataCell :item=\"item\" :col=\"col\" :copy=\"!col.hideCopyToClipboard\" />\n </slot>\n </td>\n\n <td v-if=\"config.actions\" class=\"c-actions-cell\">\n <slot\n v-if=\"$slots.actions\"\n name=\"actions\"\n :item=\"item\"\n :index=\"index\"\n :actions=\"config.actions\"\n />\n <div v-else class=\"c-actions-wrap\">\n <DataListActions :actions=\"config.actions\" :item=\"item\" />\n </div>\n </td>\n </tr>\n </tbody>\n <tbody v-else>\n <tr class=\"c-table__loading-row\">\n <td\n :colspan=\"\n visibleColumns.length + (config.selectableAttr ? 1 : 0) + (config.actions ? 1 : 0)\n \"\n class=\"c-table__loading-cell\"\n >\n <div class=\"c-table__loading-wrap\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n <div v-if=\"loading && items.length > 0\" class=\"c-table__backdrop\" aria-hidden=\"true\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n </div>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/data-table/data-table.scss\"></style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"admins-components70.js","names":[],"sources":["../src/components/data-table/DataTable.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type {\n LayoutMode,\n DataListConfig,\n DataListSettings,\n DataTableSettings,\n DataCardsSettings,\n Column,\n Sort,\n Action,\n ActionGroup,\n FilterConfig,\n FilterValue,\n} from '@/types/data-list'\n\nexport {\n dataTableSettingsDefaults,\n dataCardsSettingsDefaults,\n dataListSettingsDefaults,\n} from '@/types/data-list'\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, ref, onMounted, watch, nextTick } from 'vue'\nimport Checkbox from '@/components/Checkbox.vue'\nimport { useSelection } from '@/composables/useSelection'\nimport { dataTableSettingsDefaults } from '@/types/data-list'\nimport type { Column, DataListConfig, DataTableSettings, Sort } from '@/types/data-list'\nimport Loader from '@/components/Loader.vue'\nimport DataCell from './DataCell.vue'\nimport DataListActions from './DataListActions.vue'\n\ntype SortDirection = 'asc' | 'desc'\n\nconst props = withDefaults(\n defineProps<{\n config: DataListConfig\n items: Record<string, unknown>[]\n settings?: DataTableSettings\n loading?: boolean\n initialSort?: { key: string; direction: SortDirection } | null\n }>(),\n {\n settings: () => ({ ...dataTableSettingsDefaults }),\n loading: false,\n initialSort: null,\n },\n)\n\nconst emit = defineEmits<{\n 'selection-change': [selected: unknown[]]\n 'sort-change': [sort: { key: string; direction: SortDirection }]\n}>()\n\n//const CHARACTER_BREAKPOINT = 20\n\nconst activeSort = ref<{\n key: string\n direction: SortDirection\n} | null>(null)\n\nconst tableWrapperRef = ref<HTMLElement | null>(null)\n\nwatch(\n () => props.loading,\n async (isLoading) => {\n if (isLoading) {\n await nextTick()\n tableWrapperRef.value?.scrollTo({ top: 0, behavior: 'smooth' })\n }\n },\n)\n\nconst {\n selectedKeys,\n allSelected,\n toggle: toggleRow,\n toggleAll,\n} = useSelection(\n () => props.items,\n () => props.config.selectableAttr,\n (s) => emit('selection-change', s),\n)\n\nconst visibleColumns = computed(() => props.config.columns.filter((c) => c.visible !== false))\n\nfunction getSortConfig(col: Column): Sort | null {\n if (!col.sort) return null\n return typeof col.sort === 'boolean' ? null : col.sort\n}\n\nfunction isSortable(col: Column): boolean {\n return !!col.sort\n}\n\nfunction handleSort(col: Column) {\n const key = col.property\n const direction: SortDirection =\n activeSort.value?.key === key && activeSort.value.direction === 'asc' ? 'desc' : 'asc'\n\n activeSort.value = { key, direction }\n getSortConfig(col)?.callback?.(key, direction)\n\n emit('sort-change', { key, direction })\n}\n\nfunction applyInitialSort(sort: { key: string; direction: SortDirection } | null | undefined) {\n if (!sort) {\n if (activeSort.value !== null) activeSort.value = null\n return\n }\n const col = props.config.columns.find((c) => c.property === sort.key)\n if (!col) return\n if (activeSort.value?.key === sort.key && activeSort.value.direction === sort.direction) return\n activeSort.value = { key: sort.key, direction: sort.direction }\n getSortConfig(col)?.callback?.(sort.key, sort.direction)\n emit('sort-change', { key: sort.key, direction: sort.direction })\n}\n\nonMounted(() => applyInitialSort(props.initialSort))\nwatch(\n () => props.initialSort,\n (s) => {\n if (!s) {\n if (activeSort.value !== null) activeSort.value = null\n return\n }\n const col = props.config.columns.find((c) => c.property === s.key)\n if (!col) return\n if (activeSort.value?.key === s.key && activeSort.value.direction === s.direction) return\n activeSort.value = { key: s.key, direction: s.direction }\n },\n)\n</script>\n\n<template>\n <div\n ref=\"tableWrapperRef\"\n class=\"ac-component c-table-wrapper list-table-view\"\n :class=\"{ 'is-loading': loading }\"\n >\n <!-- :style=\"{ '--action-count': config.actions?.length ?? 0 }\" -->\n <table class=\"c-table\" :class=\"{ 'is-compact': settings.compact }\">\n <thead>\n <tr>\n <th v-if=\"config.selectableAttr\">\n <Checkbox :model-value=\"allSelected\" @update:model-value=\"toggleAll\" />\n </th>\n\n <th\n v-for=\"col in visibleColumns\"\n :key=\"col.property\"\n :class=\"[\n {\n 'c-sortable': isSortable(col),\n 'c-sortable--sorted': activeSort?.key === col.property,\n 'primary-col': col.primary,\n },\n col.headerClass,\n ]\"\n :title=\"isSortable(col) ? `Sorrendezés ${col.label} alapján` : undefined\"\n @click=\"isSortable(col) ? handleSort(col) : undefined\"\n >\n {{ !col.hideHeader ? col.label : '' }}\n\n <span\n v-if=\"isSortable(col)\"\n class=\"c-sort-icon fa-solid\"\n :class=\"{\n 'fa-sort': activeSort?.key !== col.property,\n 'fa-sort-down': activeSort?.key === col.property && activeSort.direction === 'desc',\n 'fa-sort-up': activeSort?.key === col.property && activeSort.direction === 'asc',\n 'c-sort-icon--active': activeSort?.key === col.property,\n 'is-asc': activeSort?.key === col.property && activeSort.direction === 'asc',\n 'is-desc': activeSort?.key === col.property && activeSort.direction === 'desc',\n }\"\n ></span>\n </th>\n\n <th v-if=\"config.actions\" class=\"c-actions-header\">\n {{ config.actionHeader ?? '' }}\n </th>\n </tr>\n </thead>\n\n <tbody v-if=\"!loading || items.length > 0\">\n <tr\n v-for=\"(item, index) in items\"\n :key=\"index\"\n :class=\"{\n 'is-selected': config.selectableAttr && selectedKeys.has(item[config.selectableAttr]),\n 'is-striped': settings.striped && index % 2 === 1,\n 'pointer': config.selectableAttr,\n }\"\n @click=\"config.selectableAttr ? toggleRow(item) : undefined\"\n >\n <td v-if=\"config.selectableAttr\" class=\"pointer\" @click.stop=\"toggleRow(item)\">\n <Checkbox\n :model-value=\"!!selectedKeys.has(item[config.selectableAttr])\"\n @update:model-value=\"toggleRow(item)\"\n @click.stop\n />\n </td>\n\n <td\n v-for=\"col in visibleColumns\"\n :key=\"col.property\"\n class=\"c-table__cell\"\n :class=\"[\n col.class,\n { 'primary-col': col.primary },\n /* { 'is-nowrap': String(getColumnValue(item, col) ?? '').length < CHARACTER_BREAKPOINT}, */\n ]\"\n >\n <slot :name=\"`cell:${col.property}`\" :item=\"item\" :col=\"col\">\n <DataCell :item=\"item\" :col=\"col\" :copy=\"!col.hideCopyToClipboard\" />\n </slot>\n </td>\n\n <td v-if=\"config.actions\" class=\"c-actions-cell\" @click.stop>\n <slot\n v-if=\"$slots.actions\"\n name=\"actions\"\n :item=\"item\"\n :index=\"index\"\n :actions=\"config.actions\"\n />\n <div v-else class=\"c-actions-wrap\">\n <DataListActions :actions=\"config.actions\" :item=\"item\" />\n </div>\n </td>\n </tr>\n </tbody>\n <tbody v-else>\n <tr class=\"c-table__loading-row\">\n <td\n :colspan=\"\n visibleColumns.length + (config.selectableAttr ? 1 : 0) + (config.actions ? 1 : 0)\n \"\n class=\"c-table__loading-cell\"\n >\n <div class=\"c-table__loading-wrap\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n <div v-if=\"loading && items.length > 0\" class=\"c-table__backdrop\" aria-hidden=\"true\">\n <Loader :loading=\"true\" size=\"2.5rem\" />\n </div>\n </div>\n</template>\n\n<style lang=\"scss\" src=\"@/styles/components/data-table/data-table.scss\"></style>\n"],"mappings":""}
|
|
@@ -131,4 +131,4 @@ function g(e, t) {
|
|
|
131
131
|
return n(e);
|
|
132
132
|
}
|
|
133
133
|
//#endregion
|
|
134
|
-
export { u as filterEmptyValues, a as getDefaultFilterValues, i as getDefaultFilters, l as getDefaultSavedFilter, s as getFilterUrlParams, c as getSavedFilters, h as writeFilterParams };
|
|
134
|
+
export { o as extractDropdownValues, u as filterEmptyValues, a as getDefaultFilterValues, i as getDefaultFilters, l as getDefaultSavedFilter, s as getFilterUrlParams, c as getSavedFilters, h as writeFilterParams };
|